@atlaskit/editor-plugin-table 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -0
- package/CHANGELOG.md +6 -0
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/cjs/plugins/table/commands/insert.js +3 -3
- package/dist/cjs/plugins/table/commands/misc.js +26 -26
- package/dist/cjs/plugins/table/commands/referentiality.js +1 -1
- package/dist/cjs/plugins/table/commands/selection.js +2 -2
- package/dist/cjs/plugins/table/commands/sort.js +8 -8
- package/dist/cjs/plugins/table/commands-with-analytics.js +3 -3
- package/dist/cjs/plugins/table/event-handlers.js +15 -15
- package/dist/cjs/plugins/table/handlers.js +6 -7
- package/dist/cjs/plugins/table/index.js +16 -16
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +44 -40
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +6 -9
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +11 -9
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +24 -21
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +26 -26
- package/dist/cjs/plugins/table/transforms/column-width.js +5 -5
- package/dist/cjs/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/cjs/plugins/table/transforms/merge.js +1 -1
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +11 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +10 -10
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +9 -9
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/ui/consts.js +2 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/column-controls.js +11 -11
- package/dist/cjs/plugins/table/utils/decoration.js +11 -11
- package/dist/cjs/plugins/table/utils/nodes.js +1 -1
- package/dist/cjs/plugins/table/utils/row-controls.js +9 -9
- package/dist/cjs/plugins/table/utils/selection.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/es2019/plugins/table/commands/insert.js +4 -3
- package/dist/es2019/plugins/table/commands/misc.js +4 -4
- package/dist/es2019/plugins/table/commands/referentiality.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +3 -3
- package/dist/es2019/plugins/table/commands/sort.js +3 -4
- package/dist/es2019/plugins/table/commands/toggle.js +1 -2
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -4
- package/dist/es2019/plugins/table/event-handlers.js +3 -5
- package/dist/es2019/plugins/table/handlers.js +5 -5
- package/dist/es2019/plugins/table/index.js +16 -16
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +19 -15
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +7 -10
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/es2019/plugins/table/nodeviews/table.js +11 -9
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/main.js +13 -13
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/es2019/plugins/table/toolbar.js +16 -18
- package/dist/es2019/plugins/table/transforms/column-width.js +6 -7
- package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/es2019/plugins/table/transforms/merge.js +2 -1
- package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
- package/dist/es2019/plugins/table/transforms/split.js +1 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +7 -4
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +5 -5
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/column-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/decoration.js +2 -2
- package/dist/es2019/plugins/table/utils/guidelines.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +1 -1
- package/dist/es2019/plugins/table/utils/row-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/selection.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/esm/plugins/table/commands/insert.js +4 -3
- package/dist/esm/plugins/table/commands/misc.js +4 -4
- package/dist/esm/plugins/table/commands/referentiality.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +3 -3
- package/dist/esm/plugins/table/commands/sort.js +3 -4
- package/dist/esm/plugins/table/commands/toggle.js +1 -2
- package/dist/esm/plugins/table/commands-with-analytics.js +4 -4
- package/dist/esm/plugins/table/event-handlers.js +3 -5
- package/dist/esm/plugins/table/handlers.js +5 -5
- package/dist/esm/plugins/table/index.js +16 -16
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +37 -34
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +7 -10
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +4 -4
- package/dist/esm/plugins/table/nodeviews/table.js +11 -9
- package/dist/esm/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/main.js +13 -13
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/esm/plugins/table/toolbar.js +16 -18
- package/dist/esm/plugins/table/transforms/column-width.js +6 -7
- package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/esm/plugins/table/transforms/merge.js +2 -1
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
- package/dist/esm/plugins/table/transforms/split.js +1 -0
- package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +5 -5
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
- package/dist/esm/plugins/table/utils/column-controls.js +3 -3
- package/dist/esm/plugins/table/utils/decoration.js +2 -2
- package/dist/esm/plugins/table/utils/guidelines.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +1 -1
- package/dist/esm/plugins/table/utils/row-controls.js +3 -3
- package/dist/esm/plugins/table/utils/selection.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/handlers.d.ts +1 -1
- package/dist/types/plugins/table/index.d.ts +4 -4
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types/plugins/table/toolbar.d.ts +4 -5
- package/dist/types/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/99-testing.tsx +11 -10
- package/package.json +11 -3
- package/report.api.md +2 -0
- package/src/__tests__/integration/arrow-down-into-table.ts +3 -2
- package/src/__tests__/integration/auto-size.ts +8 -10
- package/src/__tests__/integration/cell-selection.ts +8 -7
- package/src/__tests__/integration/change-date-inside-table.ts +4 -5
- package/src/__tests__/integration/delete-columns.ts +6 -4
- package/src/__tests__/integration/delete-last-column-in-full-width.ts +4 -4
- package/src/__tests__/integration/delete-last-column-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-last-row-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-rows.ts +8 -6
- package/src/__tests__/integration/delete-table-when-selected.ts +10 -11
- package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +5 -4
- package/src/__tests__/integration/even-columns.ts +8 -8
- package/src/__tests__/integration/floating-toolbar.ts +3 -1
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +7 -8
- package/src/__tests__/integration/horizontal-scroll.ts +8 -7
- package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +3 -4
- package/src/__tests__/integration/insert-row-inside-layout.ts +8 -6
- package/src/__tests__/integration/layout.ts +8 -11
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +3 -2
- package/src/__tests__/integration/resize-handler.ts +2 -2
- package/src/__tests__/integration/resize.ts +15 -15
- package/src/__tests__/integration/scale.ts +8 -8
- package/src/__tests__/integration/sticky-header.ts +3 -2
- package/src/__tests__/unit/analytics.ts +21 -21
- package/src/__tests__/unit/collab.ts +16 -16
- package/src/__tests__/unit/commands/go-to-next-cell.ts +14 -13
- package/src/__tests__/unit/commands/insert.ts +12 -12
- package/src/__tests__/unit/commands/misc.ts +18 -16
- package/src/__tests__/unit/commands/sort.ts +9 -8
- package/src/__tests__/unit/commands.ts +13 -14
- package/src/__tests__/unit/copy-paste.ts +31 -25
- package/src/__tests__/unit/event-handlers/index.ts +15 -13
- package/src/__tests__/unit/event-handlers.ts +18 -18
- package/src/__tests__/unit/fix-tables.ts +9 -9
- package/src/__tests__/unit/get-toolbar-config.ts +21 -21
- package/src/__tests__/unit/handlers.ts +13 -12
- package/src/__tests__/unit/hover-selection.ts +14 -13
- package/src/__tests__/unit/index-with-fake-timers.ts +6 -5
- package/src/__tests__/unit/index.ts +30 -31
- package/src/__tests__/unit/layout.ts +16 -16
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +4 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +21 -20
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +38 -105
- package/src/__tests__/unit/nodeviews/cell.ts +17 -16
- package/src/__tests__/unit/nodeviews/table.ts +15 -13
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -1
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +7 -8
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +45 -57
- package/src/__tests__/unit/pm-plugins/main.ts +15 -14
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +7 -6
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +23 -21
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +14 -15
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +3 -2
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +22 -21
- package/src/__tests__/unit/sort-column.ts +16 -14
- package/src/__tests__/unit/toolbar.ts +22 -21
- package/src/__tests__/unit/transforms/delete-columns.ts +16 -14
- package/src/__tests__/unit/transforms/delete-rows.ts +16 -14
- package/src/__tests__/unit/transforms/merging.ts +15 -13
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/CornerControls.tsx +11 -9
- package/src/__tests__/unit/ui/DeleteButton.tsx +3 -1
- package/src/__tests__/unit/ui/FixedButton.tsx +4 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +14 -11
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +12 -9
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +21 -19
- package/src/__tests__/unit/ui/RowControls.tsx +15 -12
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +16 -15
- package/src/__tests__/unit/undo-redo.ts +17 -15
- package/src/__tests__/unit/utils/collapse.ts +7 -8
- package/src/__tests__/unit/utils/nodes.ts +12 -11
- package/src/__tests__/unit/utils/row-controls.ts +12 -12
- package/src/__tests__/unit/utils/table.ts +5 -4
- package/src/__tests__/unit/utils.ts +18 -16
- package/src/__tests__/visual-regression/cell-options-menu.ts +2 -2
- package/src/__tests__/visual-regression/index.ts +8 -7
- package/src/__tests__/visual-regression/sticky-header.ts +6 -5
- package/src/plugins/table/commands/clear.ts +3 -2
- package/src/plugins/table/commands/collapse.ts +1 -0
- package/src/plugins/table/commands/go-to-next-cell.ts +8 -7
- package/src/plugins/table/commands/insert.ts +8 -7
- package/src/plugins/table/commands/misc.ts +15 -18
- package/src/plugins/table/commands/referentiality.ts +3 -1
- package/src/plugins/table/commands/selection.ts +11 -10
- package/src/plugins/table/commands/sort.ts +9 -9
- package/src/plugins/table/commands/split-cell.ts +1 -1
- package/src/plugins/table/commands/toggle.ts +2 -3
- package/src/plugins/table/commands-with-analytics.ts +15 -15
- package/src/plugins/table/event-handlers.ts +19 -20
- package/src/plugins/table/handlers.ts +6 -7
- package/src/plugins/table/index.tsx +51 -51
- package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +2 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +22 -25
- package/src/plugins/table/nodeviews/TableContainer.tsx +13 -24
- package/src/plugins/table/nodeviews/TableResizer.tsx +8 -7
- package/src/plugins/table/nodeviews/table.tsx +25 -18
- package/src/plugins/table/nodeviews/tableCell.tsx +9 -7
- package/src/plugins/table/nodeviews/types.ts +4 -2
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +3 -1
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +4 -3
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +2 -1
- package/src/plugins/table/pm-plugins/keymap.ts +8 -8
- package/src/plugins/table/pm-plugins/main.ts +38 -33
- package/src/plugins/table/pm-plugins/plugin-factory.ts +2 -0
- package/src/plugins/table/pm-plugins/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +6 -7
- package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +3 -4
- package/src/plugins/table/pm-plugins/table-local-id.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -2
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +13 -14
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +7 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +2 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +3 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +8 -9
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +8 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +4 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +2 -1
- package/src/plugins/table/pm-plugins/table-selection-keymap.ts +4 -3
- package/src/plugins/table/pm-plugins/table-width.ts +5 -4
- package/src/plugins/table/toolbar.tsx +54 -57
- package/src/plugins/table/transforms/column-width.ts +13 -13
- package/src/plugins/table/transforms/delete-columns.ts +2 -2
- package/src/plugins/table/transforms/delete-rows.ts +2 -2
- package/src/plugins/table/transforms/merge.ts +3 -3
- package/src/plugins/table/transforms/replace-table.ts +6 -5
- package/src/plugins/table/transforms/split.ts +1 -1
- package/src/plugins/table/types.ts +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +4 -2
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +12 -11
- package/src/plugins/table/ui/FloatingContextualButton/styles.ts +5 -3
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +27 -28
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +10 -11
- package/src/plugins/table/ui/FloatingContextualMenu/styles.ts +8 -4
- package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +5 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +9 -9
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +4 -5
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +16 -18
- package/src/plugins/table/ui/LayoutButton/index.tsx +6 -6
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +3 -2
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -1
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
- package/src/plugins/table/ui/common-styles.ts +33 -34
- package/src/plugins/table/ui/consts.ts +12 -13
- package/src/plugins/table/ui/ui-styles.ts +24 -22
- package/src/plugins/table/utils/analytics.ts +3 -2
- package/src/plugins/table/utils/collapse.ts +2 -2
- package/src/plugins/table/utils/column-controls.ts +5 -6
- package/src/plugins/table/utils/decoration.ts +6 -7
- package/src/plugins/table/utils/dom.ts +1 -0
- package/src/plugins/table/utils/guidelines.ts +2 -2
- package/src/plugins/table/utils/nodes.ts +2 -1
- package/src/plugins/table/utils/row-controls.ts +4 -3
- package/src/plugins/table/utils/selection.ts +2 -1
- package/src/plugins/table/utils/table.ts +2 -1
- package/tmp/api-report-tmp.d.ts +108 -0
|
@@ -8,10 +8,10 @@ exports.tableStyles = exports.tableFullPageEditorStyles = exports.tableCommentEd
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
12
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
13
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
12
|
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
13
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
15
15
|
var _types = require("../types");
|
|
16
16
|
var _consts = require("./consts");
|
|
17
17
|
var _uiStyles = require("./ui-styles");
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tableToolbarSize = exports.tableToolbarSelectedColor = exports.tableToolbarDeleteColor = exports.tableToolbarColor = exports.tableTextColor = exports.tableScrollbarOffset = exports.tablePadding = exports.tableMarginFullWidthMode = exports.tableInsertColumnButtonSize = exports.tableInsertColumnButtonOffset = exports.tableHeaderCellBackgroundColor = exports.tableFloatingControlsColor = exports.tableDeleteButtonSize = exports.tableDeleteButtonOffset = exports.tableControlsSpacing = exports.tableCellSelectedColor = exports.tableCellDeleteColor = exports.tableCellBackgroundColor = exports.tableBorderSelectedColor = exports.tableBorderRadiusSize = exports.tableBorderDeleteColor = exports.tableBorderColor = exports.stickyRowZIndex = exports.stickyRowOffsetTop = exports.stickyHeaderBorderBottomWidth = exports.resizeLineWidth = exports.resizeHandlerZIndex = exports.resizeHandlerAreaWidth = exports.lineMarkerSize = exports.lineMarkerOffsetFromColumnControls = exports.layoutButtonSize = exports.contextualMenuTriggerSize = exports.contextualMenuDropdownWidth = exports.columnResizeHandleZIndex = exports.columnControlsZIndex = exports.columnControlsSelectedZIndex = exports.columnControlsDecorationHeight = exports.TABLE_SNAP_GAP = exports.TABLE_HIGHLIGHT_GAP = void 0;
|
|
7
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
8
7
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
9
8
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
10
|
-
var
|
|
9
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
11
10
|
var _components = require("@atlaskit/theme/components");
|
|
11
|
+
var _types = require("../types");
|
|
12
12
|
/**
|
|
13
13
|
* Basic colors added to prevent content overflow in table cells.
|
|
14
14
|
*/
|
|
@@ -10,9 +10,9 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
|
-
var _consts = require("./consts");
|
|
14
|
-
var _types = require("../types");
|
|
15
13
|
var _constants = require("@atlaskit/theme/constants");
|
|
14
|
+
var _types = require("../types");
|
|
15
|
+
var _consts = require("./consts");
|
|
16
16
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18, _templateObject19, _templateObject20, _templateObject21;
|
|
17
17
|
var InsertLine = function InsertLine(cssString) {
|
|
18
18
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), _types.TableCssClassName.CONTROLS_INSERT_LINE, _consts.tableBorderSelectedColor, _editorSharedStyles.akEditorUnitZIndex, cssString);
|
|
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.isColumnDeleteButtonVisible = exports.getColumnsWidths = exports.getColumnDeleteButtonParams = exports.getColumnClassNames = exports.colWidthsForRow = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
-
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
9
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
12
|
-
var _utils = require("@atlaskit/editor-
|
|
13
|
-
var
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _types = require("../types");
|
|
15
15
|
var _consts = require("../ui/consts");
|
|
16
16
|
var getColumnsWidths = function getColumnsWidths(view) {
|
|
17
17
|
var selection = view.state.selection;
|
|
18
18
|
var widths = [];
|
|
19
|
-
var table = (0,
|
|
19
|
+
var table = (0, _utils2.findTable)(selection);
|
|
20
20
|
if (table) {
|
|
21
21
|
var map = _tableMap.TableMap.get(table.node);
|
|
22
22
|
var domAtPos = view.domAtPos.bind(view);
|
|
@@ -26,7 +26,7 @@ var getColumnsWidths = function getColumnsWidths(view) {
|
|
|
26
26
|
length: map.width
|
|
27
27
|
});
|
|
28
28
|
for (var i = 0; i < map.width; i++) {
|
|
29
|
-
var cells = (0,
|
|
29
|
+
var cells = (0, _utils2.getCellsInColumn)(i)(selection);
|
|
30
30
|
var cell = cells[0];
|
|
31
31
|
if (cell) {
|
|
32
32
|
var cellRef = (0, _prosemirrorUtils.findDomRefAtPos)(cell.pos, domAtPos);
|
|
@@ -40,14 +40,14 @@ var getColumnsWidths = function getColumnsWidths(view) {
|
|
|
40
40
|
};
|
|
41
41
|
exports.getColumnsWidths = getColumnsWidths;
|
|
42
42
|
var isColumnDeleteButtonVisible = function isColumnDeleteButtonVisible(selection) {
|
|
43
|
-
if (!(0,
|
|
43
|
+
if (!(0, _utils2.isTableSelected)(selection) && selection instanceof _cellSelection.CellSelection && selection.isColSelection()) {
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
46
46
|
return false;
|
|
47
47
|
};
|
|
48
48
|
exports.isColumnDeleteButtonVisible = isColumnDeleteButtonVisible;
|
|
49
49
|
var getColumnDeleteButtonParams = function getColumnDeleteButtonParams(columnsWidths, selection) {
|
|
50
|
-
var rect = (0,
|
|
50
|
+
var rect = (0, _utils2.getSelectionRect)(selection);
|
|
51
51
|
if (!rect) {
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
@@ -81,7 +81,7 @@ var getColumnClassNames = function getColumnClassNames(index, selection) {
|
|
|
81
81
|
var isInDanger = arguments.length > 3 ? arguments[3] : undefined;
|
|
82
82
|
var isResizing = arguments.length > 4 ? arguments[4] : undefined;
|
|
83
83
|
var classNames = [];
|
|
84
|
-
if ((0,
|
|
84
|
+
if ((0, _utils2.isColumnSelected)(index)(selection) || hoveredColumns.indexOf(index) > -1 && !isResizing) {
|
|
85
85
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_ACTIVE);
|
|
86
86
|
if (isInDanger) {
|
|
87
87
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_IN_DANGER);
|
|
@@ -144,7 +144,7 @@ var getRelativeDomCellWidths = function getRelativeDomCellWidths(_ref) {
|
|
|
144
144
|
};
|
|
145
145
|
var colWidthsForRow = function colWidthsForRow(tr) {
|
|
146
146
|
// get the colspans
|
|
147
|
-
var rowColSpans = (0,
|
|
147
|
+
var rowColSpans = (0, _utils.maphElem)(tr, function (cell) {
|
|
148
148
|
return Number(cell.getAttribute('colspan') || 1 /* default to span of 1 */);
|
|
149
149
|
});
|
|
150
150
|
|
|
@@ -159,7 +159,7 @@ var colWidthsForRow = function colWidthsForRow(tr) {
|
|
|
159
159
|
var copyTarget = tr.nextElementSibling || tr;
|
|
160
160
|
if (copyTarget) {
|
|
161
161
|
// either from the first row while it's still in the table
|
|
162
|
-
var cellInfos = (0,
|
|
162
|
+
var cellInfos = (0, _utils.maphElem)(copyTarget, function (cell) {
|
|
163
163
|
return {
|
|
164
164
|
width: cell.getBoundingClientRect().width,
|
|
165
165
|
colspan: Number(cell.getAttribute('colspan') || 1),
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.updateDecorations = exports.findControlsHoverDecoration = exports.findColumnControlSelectedDecoration = exports.createResizeHandleDecoration = exports.createControlsHoverDecoration = exports.createColumnSelectedDecoration = exports.createColumnLineResize = exports.createColumnControlsDecoration = exports.createCellHoverDecoration = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
-
var _utils = require("@atlaskit/editor-tables/utils");
|
|
11
9
|
var _prosemirrorView = require("prosemirror-view");
|
|
12
|
-
var
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
12
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
13
13
|
var _types = require("../types");
|
|
14
14
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
15
15
|
|
|
@@ -37,7 +37,7 @@ var createCellHoverDecoration = function createCellHoverDecoration(cells) {
|
|
|
37
37
|
};
|
|
38
38
|
exports.createCellHoverDecoration = createCellHoverDecoration;
|
|
39
39
|
var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, danger, selected) {
|
|
40
|
-
var table = (0,
|
|
40
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
41
41
|
if (!table) {
|
|
42
42
|
return [];
|
|
43
43
|
}
|
|
@@ -137,8 +137,8 @@ exports.createControlsHoverDecoration = createControlsHoverDecoration;
|
|
|
137
137
|
var createColumnSelectedDecoration = function createColumnSelectedDecoration(tr) {
|
|
138
138
|
var selection = tr.selection,
|
|
139
139
|
doc = tr.doc;
|
|
140
|
-
var table = (0,
|
|
141
|
-
var rect = (0,
|
|
140
|
+
var table = (0, _utils2.findTable)(selection);
|
|
141
|
+
var rect = (0, _utils2.getSelectionRect)(selection);
|
|
142
142
|
if (!table || !rect) {
|
|
143
143
|
return [];
|
|
144
144
|
}
|
|
@@ -155,7 +155,7 @@ var createColumnSelectedDecoration = function createColumnSelectedDecoration(tr)
|
|
|
155
155
|
};
|
|
156
156
|
exports.createColumnSelectedDecoration = createColumnSelectedDecoration;
|
|
157
157
|
var createColumnControlsDecoration = function createColumnControlsDecoration(selection) {
|
|
158
|
-
var cells = (0,
|
|
158
|
+
var cells = (0, _utils2.getCellsInRow)(0)(selection) || [];
|
|
159
159
|
var index = 0;
|
|
160
160
|
return cells.map(function (cell) {
|
|
161
161
|
var colspan = cell.node.attrs.colspan || 1;
|
|
@@ -271,7 +271,7 @@ var makeArray = function makeArray(n) {
|
|
|
271
271
|
*/
|
|
272
272
|
var createResizeHandleDecoration = function createResizeHandleDecoration(tr, rowIndexTarget, columnEndIndexTarget) {
|
|
273
273
|
var emptyResult = [[], []];
|
|
274
|
-
var table = (0,
|
|
274
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
275
275
|
if (!table || !table.node) {
|
|
276
276
|
return emptyResult;
|
|
277
277
|
}
|
|
@@ -347,7 +347,7 @@ var createResizeHandleDecoration = function createResizeHandleDecoration(tr, row
|
|
|
347
347
|
lastCellElementsDecorations.push(lastCellDec);
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
|
-
return [resizeHandleCellDecorations, lastCellElementsDecorations.filter(
|
|
350
|
+
return [resizeHandleCellDecorations, lastCellElementsDecorations.filter(_utils.nonNullable)];
|
|
351
351
|
};
|
|
352
352
|
|
|
353
353
|
/*
|
|
@@ -394,7 +394,7 @@ var createResizeHandleDecoration = function createResizeHandleDecoration(tr, row
|
|
|
394
394
|
*/
|
|
395
395
|
exports.createResizeHandleDecoration = createResizeHandleDecoration;
|
|
396
396
|
var createColumnLineResize = function createColumnLineResize(selection, cellColumnPositioning) {
|
|
397
|
-
var table = (0,
|
|
397
|
+
var table = (0, _utils2.findTable)(selection);
|
|
398
398
|
if (!table || cellColumnPositioning.right === null) {
|
|
399
399
|
return [];
|
|
400
400
|
}
|
|
@@ -431,6 +431,6 @@ var createColumnLineResize = function createColumnLineResize(selection, cellColu
|
|
|
431
431
|
}, {
|
|
432
432
|
key: "".concat(_types.TableDecorations.COLUMN_RESIZING_HANDLE_LINE, "_").concat(cellColumnPositioning.right, "_").concat(index)
|
|
433
433
|
});
|
|
434
|
-
}).filter(
|
|
434
|
+
}).filter(_utils.nonNullable);
|
|
435
435
|
};
|
|
436
436
|
exports.createColumnLineResize = createColumnLineResize;
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.tablesHaveDifferentNoOfColumns = exports.tablesHaveDifferentColumnWidths = exports.isTableNested = exports.isLayoutSupported = exports.isIsolating = exports.getTableWidth = exports.containsHeaderRow = exports.containsHeaderColumn = exports.checkIfNumberColumnEnabled = exports.checkIfHeaderRowEnabled = exports.checkIfHeaderColumnEnabled = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
9
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
10
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
11
11
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
12
12
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
13
13
|
var isIsolating = function isIsolating(node) {
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.isRowDeleteButtonVisible = exports.getRowsParams = exports.getRowHeights = exports.getRowDeleteButtonParams = exports.getRowClassNames = exports.copyPreviousRow = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
10
|
-
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
11
9
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
12
|
-
var _utils = require("@atlaskit/editor-
|
|
13
|
-
var
|
|
10
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
11
|
+
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
12
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
14
14
|
var _types = require("../types");
|
|
15
15
|
var _consts = require("../ui/consts");
|
|
16
16
|
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; }
|
|
@@ -27,7 +27,7 @@ var getRowHeights = function getRowHeights(tableRef) {
|
|
|
27
27
|
// padding only gets applied when the container has sticky
|
|
28
28
|
if (row.classList.contains('sticky') && i === 0) {
|
|
29
29
|
var styles = window.getComputedStyle(row);
|
|
30
|
-
var paddingTop = (0,
|
|
30
|
+
var paddingTop = (0, _utils.parsePx)(styles.paddingTop || '');
|
|
31
31
|
heights[i] -= paddingTop ? paddingTop + 1 : +1;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -36,7 +36,7 @@ var getRowHeights = function getRowHeights(tableRef) {
|
|
|
36
36
|
};
|
|
37
37
|
exports.getRowHeights = getRowHeights;
|
|
38
38
|
var isRowDeleteButtonVisible = function isRowDeleteButtonVisible(selection) {
|
|
39
|
-
if (!(0,
|
|
39
|
+
if (!(0, _utils2.isTableSelected)(selection) && selection instanceof _cellSelection.CellSelection && selection.isRowSelection()) {
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
42
|
return false;
|
|
@@ -44,7 +44,7 @@ var isRowDeleteButtonVisible = function isRowDeleteButtonVisible(selection) {
|
|
|
44
44
|
exports.isRowDeleteButtonVisible = isRowDeleteButtonVisible;
|
|
45
45
|
var getRowDeleteButtonParams = function getRowDeleteButtonParams(rowsHeights, selection) {
|
|
46
46
|
var offsetTop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
47
|
-
var rect = (0,
|
|
47
|
+
var rect = (0, _utils2.getSelectionRect)(selection);
|
|
48
48
|
if (!rect) {
|
|
49
49
|
return null;
|
|
50
50
|
}
|
|
@@ -101,7 +101,7 @@ var getRowClassNames = function getRowClassNames(index, selection) {
|
|
|
101
101
|
var isInDanger = arguments.length > 3 ? arguments[3] : undefined;
|
|
102
102
|
var isResizing = arguments.length > 4 ? arguments[4] : undefined;
|
|
103
103
|
var classNames = [];
|
|
104
|
-
if ((0,
|
|
104
|
+
if ((0, _utils2.isRowSelected)(index)(selection) || hoveredRows.indexOf(index) > -1 && !isResizing) {
|
|
105
105
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_ACTIVE);
|
|
106
106
|
if (isInDanger) {
|
|
107
107
|
classNames.push(_types.TableCssClassName.HOVERED_CELL_IN_DANGER);
|
|
@@ -113,7 +113,7 @@ exports.getRowClassNames = getRowClassNames;
|
|
|
113
113
|
var copyPreviousRow = function copyPreviousRow(schema) {
|
|
114
114
|
return function (insertNewRowIndex) {
|
|
115
115
|
return function (tr) {
|
|
116
|
-
var table = (0,
|
|
116
|
+
var table = (0, _utils2.findTable)(tr.selection);
|
|
117
117
|
if (!table) {
|
|
118
118
|
return tr;
|
|
119
119
|
}
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.normalizeSelection = exports.isSelectionUpdated = exports.getSelectedRowIndexes = exports.getSelectedColumnIndexes = void 0;
|
|
7
|
-
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
8
7
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
8
|
+
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
9
9
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
10
10
|
var isSelectionUpdated = function isSelectionUpdated(oldSelection, newSelection) {
|
|
11
11
|
return !!(!newSelection && oldSelection) || (0, _utils.isSelectionType)(oldSelection, 'cell') !== (0, _utils.isSelectionType)(newSelection, 'cell') || (0, _utils.isSelectionType)(oldSelection, 'cell') && (0, _utils.isSelectionType)(newSelection, 'cell') && oldSelection.ranges !== newSelection.ranges;
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { Selection } from 'prosemirror-state';
|
|
3
|
-
import {
|
|
3
|
+
import { emptyCell, findCellClosestToPos, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
4
|
+
|
|
4
5
|
// #endregion
|
|
6
|
+
|
|
5
7
|
// #region Commands
|
|
6
8
|
export const clearMultipleCells = targetCellPosition => (state, dispatch) => {
|
|
7
9
|
let cursorPos;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// #region Constants
|
|
2
|
-
import { findTable, goToNextCell as baseGotoNextCell } from '@atlaskit/editor-tables/utils';
|
|
3
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
2
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
5
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
+
import { goToNextCell as baseGotoNextCell, findTable } from '@atlaskit/editor-tables/utils';
|
|
6
6
|
import { insertRowWithAnalytics } from '../commands-with-analytics';
|
|
7
7
|
const TAB_FORWARD_DIRECTION = 1;
|
|
8
8
|
const TAB_BACKWARD_DIRECTION = -1;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { Selection } from 'prosemirror-state';
|
|
3
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
import { addColumnAt as addColumnAtPMUtils, addRowAt, createTable as createTableNode, findTable, selectedRect } from '@atlaskit/editor-tables/utils';
|
|
5
3
|
import { safeInsert } from 'prosemirror-utils';
|
|
6
4
|
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
5
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import { addColumnAt as addColumnAtPMUtils, addRowAt, createTable as createTableNode, findTable, selectedRect } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { rescaleColumns } from '../transforms/column-width';
|
|
7
8
|
import { checkIfHeaderRowEnabled, copyPreviousRow } from '../utils';
|
|
8
9
|
import { getAllowAddColumnCustomStep } from '../utils/get-allow-add-column-custom-step';
|
|
9
|
-
|
|
10
|
+
|
|
10
11
|
// #endregion
|
|
11
12
|
|
|
12
13
|
function addColumnAtCustomStep(column) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
|
|
3
3
|
import { TextSelection } from 'prosemirror-state';
|
|
4
|
-
import {
|
|
4
|
+
import { closestElement, isParagraph, isTextSelection, mapSlice } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
+
import { findCellClosestToPos, findTable, getCellsInColumn, getCellsInRow, getSelectionRect, isSelectionType, isTableSelected, removeTable, selectColumn as selectColumnTransform, selectionCell, selectRow as selectRowTransform, setCellAttrs } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { getDecorations } from '../pm-plugins/decorations/plugin';
|
|
9
9
|
import { buildColumnResizingDecorations } from '../pm-plugins/decorations/utils';
|
|
10
10
|
import { createCommand, getPluginState } from '../pm-plugins/plugin-factory';
|
|
11
11
|
import { fixAutoSizedTable } from '../transforms';
|
|
12
12
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
13
13
|
import { createColumnControlsDecoration, createColumnSelectedDecoration } from '../utils/decoration';
|
|
14
|
-
import {
|
|
14
|
+
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled, isIsolating } from '../utils/nodes';
|
|
15
15
|
import { updatePluginStateDecorations } from '../utils/update-plugin-state-decorations';
|
|
16
16
|
// #endregion
|
|
17
17
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
2
1
|
import { removeConnectedNodes } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
3
3
|
export const removeDescendantNodes = sourceNode => createCommand({
|
|
4
4
|
type: 'UPDATE_STATE',
|
|
5
5
|
data: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Selection, TextSelection } from 'prosemirror-state';
|
|
2
|
+
import { GapCursorSelection, isSelectionAtEndOfNode, isSelectionAtStartOfNode, RelativeSelectionPos, Side } from '@atlaskit/editor-common/selection';
|
|
3
3
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
5
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { RelativeSelectionPos, GapCursorSelection, Side, isSelectionAtStartOfNode, isSelectionAtEndOfNode } from '@atlaskit/editor-common/selection';
|
|
6
6
|
export let TableSelectionDirection = /*#__PURE__*/function (TableSelectionDirection) {
|
|
7
7
|
TableSelectionDirection["TopToBottom"] = "TopToBottom";
|
|
8
8
|
TableSelectionDirection["BottomToTop"] = "BottomToTop";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Selection } from 'prosemirror-state';
|
|
2
|
-
import {
|
|
3
|
-
import { findCellRectClosestToPos } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { convertArrayOfRowsToTableNode, convertTableNodeToArrayOfRows, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
2
|
+
import { TableSortOrder as SortOrder, TableSortStep } from '@atlaskit/adf-schema/steps';
|
|
5
3
|
import { createCompareNodes } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
+
import { convertArrayOfRowsToTableNode, convertTableNodeToArrayOfRows, findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
6
6
|
import { createCommand, getPluginState } from '../pm-plugins/plugin-factory';
|
|
7
|
-
import { TableSortStep, TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
8
7
|
const createGetInlineCardTextFromStore = attrs => {
|
|
9
8
|
const {
|
|
10
9
|
data
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
//#region Imports
|
|
2
2
|
|
|
3
|
-
import { toggleHeader } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
3
|
+
import { findTable, toggleHeader } from '@atlaskit/editor-tables/utils';
|
|
5
4
|
import { createCommand } from '../pm-plugins/plugin-factory';
|
|
6
5
|
//#endregion
|
|
7
6
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
-
import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
3
1
|
import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
|
|
4
2
|
import { ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION, TABLE_BREAKOUT } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
|
+
import { findCellClosestToPos, findCellRectClosestToPos, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { clearMultipleCells } from './commands/clear';
|
|
6
6
|
import { wrapTableInExpand } from './commands/collapse';
|
|
7
7
|
import { insertColumn, insertRow } from './commands/insert';
|
|
8
|
-
import { deleteTable,
|
|
8
|
+
import { deleteTable, deleteTableIfSelected, setMultipleCellAttrs } from './commands/misc';
|
|
9
9
|
import { sortByColumn } from './commands/sort';
|
|
10
10
|
import { splitCell } from './commands/split-cell';
|
|
11
11
|
import { getNextLayout, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout } from './commands/toggle';
|
|
12
|
-
import { distributeColumnsWidths } from './pm-plugins/table-resizing/commands';
|
|
13
12
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
13
|
+
import { distributeColumnsWidths } from './pm-plugins/table-resizing/commands';
|
|
14
14
|
import { deleteColumns, deleteRows, mergeCells } from './transforms';
|
|
15
15
|
import { checkIfNumberColumnEnabled, getSelectedCellInfo, getSelectedTableInfo } from './utils';
|
|
16
16
|
import { withEditorAnalyticsAPI } from './utils/analytics';
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { Selection, TextSelection } from 'prosemirror-state';
|
|
2
|
+
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { browser, closestElement, isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
2
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
3
5
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
6
|
import { cellAround, findCellRectClosestToPos, findTable, getSelectionRect, removeTable } from '@atlaskit/editor-tables/utils';
|
|
5
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
|
6
|
-
import { isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
8
|
-
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
9
7
|
import { addResizeHandleDecorations, clearHoverSelection, hideInsertColumnOrRowButton, hideResizeHandleLine, hoverColumns, selectColumn, setEditorFocus, showInsertColumnButton, showInsertRowButton, showResizeHandleLine } from './commands';
|
|
10
8
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
11
9
|
import { getPluginState as getResizePluginState } from './pm-plugins/table-resizing/plugin-factory';
|
|
12
10
|
import { deleteColumns, deleteRows } from './transforms';
|
|
13
11
|
import { RESIZE_HANDLE_AREA_DECORATION_GAP } from './types';
|
|
14
|
-
import { getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, getSelectedCellInfo, isCell, isColumnControlsDecorations, isCornerButton, isInsertRowButton, isResizeHandleDecoration, isRowControlsButton,
|
|
12
|
+
import { getColumnOrRowIndex, getMousePositionHorizontalRelativeByElement, getMousePositionVerticalRelativeByElement, getSelectedCellInfo, hasResizeHandler, isCell, isColumnControlsDecorations, isCornerButton, isInsertRowButton, isResizeHandleDecoration, isRowControlsButton, isTableContainerOrWrapper, isTableControlsButton } from './utils';
|
|
15
13
|
import { getAllowAddColumnCustomStep } from './utils/get-allow-add-column-custom-step';
|
|
16
14
|
const isFocusingCalendar = event => event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.getAttribute('aria-label') === 'calendar';
|
|
17
15
|
const isFocusingModal = event => event instanceof FocusEvent && event.relatedTarget instanceof HTMLElement && event.relatedTarget.closest('[role="dialog"]');
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// #region Imports
|
|
2
|
+
|
|
2
3
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
3
4
|
|
|
4
5
|
import { findParentNodeOfType } from 'prosemirror-utils';
|
|
5
|
-
import {
|
|
6
|
+
import { TableSortStep } from '@atlaskit/adf-schema/steps';
|
|
6
7
|
import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import {
|
|
8
|
+
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
8
9
|
import { defaultTableSelection } from './pm-plugins/default-table-selection';
|
|
9
10
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { checkIfNumberColumnEnabled, checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled } from './utils/nodes';
|
|
11
|
+
import { isTableCollapsible } from './utils/collapse';
|
|
12
|
+
import { checkIfHeaderColumnEnabled, checkIfHeaderRowEnabled, checkIfNumberColumnEnabled } from './utils/nodes';
|
|
13
13
|
const nextTableSorting = (tr, table) => {
|
|
14
14
|
const tableSortStep = tr.steps.find(step => step instanceof TableSortStep);
|
|
15
15
|
return tableSortStep && table && table.pos === tableSortStep.pos ? tableSortStep.next : undefined;
|
|
@@ -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
|
const defaultGetEditorFeatureFlags = () => ({});
|
|
33
32
|
const tablesPlugin = (options, api) => {
|
|
34
33
|
var _api$dependencies$ana;
|
|
@@ -63,7 +62,7 @@ const tablesPlugin = (options, api) => {
|
|
|
63
62
|
}
|
|
64
63
|
},
|
|
65
64
|
nodes() {
|
|
66
|
-
const tableNode =
|
|
65
|
+
const tableNode = options !== null && options !== void 0 && options.tableResizingEnabled ? tableWithCustomWidth : table;
|
|
67
66
|
return [{
|
|
68
67
|
name: 'table',
|
|
69
68
|
node: tableNode
|
|
@@ -90,11 +89,12 @@ const tablesPlugin = (options, api) => {
|
|
|
90
89
|
const {
|
|
91
90
|
fullWidthEnabled,
|
|
92
91
|
wasFullWidthEnabled,
|
|
92
|
+
tableResizingEnabled,
|
|
93
93
|
breakoutEnabled,
|
|
94
94
|
tableOptions,
|
|
95
95
|
getEditorFeatureFlags
|
|
96
96
|
} = options || {};
|
|
97
|
-
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
97
|
+
return createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, breakoutEnabled, fullWidthEnabled, tableResizingEnabled, wasFullWidthEnabled, editorAnalyticsAPI, api);
|
|
98
98
|
}
|
|
99
99
|
}, {
|
|
100
100
|
name: 'tablePMColResizing',
|
|
@@ -160,7 +160,7 @@ const tablesPlugin = (options, api) => {
|
|
|
160
160
|
dispatch
|
|
161
161
|
}) => {
|
|
162
162
|
var _options$fullWidthEna;
|
|
163
|
-
return
|
|
163
|
+
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;
|
|
164
164
|
}
|
|
165
165
|
}, {
|
|
166
166
|
name: 'tableGetEditorViewReferencePlugin',
|
|
@@ -238,7 +238,7 @@ const tablesPlugin = (options, api) => {
|
|
|
238
238
|
allowControls
|
|
239
239
|
} = pluginConfig;
|
|
240
240
|
const stickyHeader = stickyHeadersState ? findStickyHeaderForTable(stickyHeadersState, tablePos) : undefined;
|
|
241
|
-
const LayoutContent =
|
|
241
|
+
const LayoutContent = options && !options.tableResizingEnabled && isLayoutSupported(state) && options.breakoutEnabled ? /*#__PURE__*/React.createElement(LayoutButton, {
|
|
242
242
|
editorView: editorView,
|
|
243
243
|
mountPoint: popupsMountPoint,
|
|
244
244
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { TableCssClassName as ClassName, ShadowEvent } from '../types';
|
|
3
3
|
import { tableInsertColumnButtonSize } from '../ui/consts';
|
|
4
4
|
import { updateShadowListForStickyStyles } from './update-overflow-shadows';
|
|
5
5
|
export class OverflowShadowsObserver {
|