@atlaskit/editor-plugin-table 2.3.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +6 -0
- package/CHANGELOG.md +16 -0
- package/dist/cjs/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/cjs/plugins/table/commands/insert.js +3 -3
- package/dist/cjs/plugins/table/commands/misc.js +26 -26
- package/dist/cjs/plugins/table/commands/referentiality.js +1 -1
- package/dist/cjs/plugins/table/commands/selection.js +2 -2
- package/dist/cjs/plugins/table/commands/sort.js +8 -8
- package/dist/cjs/plugins/table/commands-with-analytics.js +3 -3
- package/dist/cjs/plugins/table/event-handlers.js +15 -15
- package/dist/cjs/plugins/table/handlers.js +6 -7
- package/dist/cjs/plugins/table/index.js +16 -16
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +44 -40
- package/dist/cjs/plugins/table/nodeviews/TableContainer.js +6 -9
- package/dist/cjs/plugins/table/nodeviews/TableResizer.js +4 -3
- package/dist/cjs/plugins/table/nodeviews/table.js +11 -9
- package/dist/cjs/plugins/table/nodeviews/tableCell.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +24 -21
- package/dist/cjs/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/cjs/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/cjs/plugins/table/toolbar.js +26 -26
- package/dist/cjs/plugins/table/transforms/column-width.js +5 -5
- package/dist/cjs/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/cjs/plugins/table/transforms/merge.js +1 -1
- package/dist/cjs/plugins/table/transforms/replace-table.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +11 -11
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +10 -10
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +9 -9
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/cjs/plugins/table/ui/common-styles.js +2 -2
- package/dist/cjs/plugins/table/ui/consts.js +2 -2
- package/dist/cjs/plugins/table/ui/ui-styles.js +2 -2
- package/dist/cjs/plugins/table/utils/column-controls.js +11 -11
- package/dist/cjs/plugins/table/utils/decoration.js +11 -11
- package/dist/cjs/plugins/table/utils/nodes.js +1 -1
- package/dist/cjs/plugins/table/utils/row-controls.js +9 -9
- package/dist/cjs/plugins/table/utils/selection.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/clear.js +3 -1
- package/dist/es2019/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/es2019/plugins/table/commands/insert.js +4 -3
- package/dist/es2019/plugins/table/commands/misc.js +4 -4
- package/dist/es2019/plugins/table/commands/referentiality.js +1 -1
- package/dist/es2019/plugins/table/commands/selection.js +3 -3
- package/dist/es2019/plugins/table/commands/sort.js +3 -4
- package/dist/es2019/plugins/table/commands/toggle.js +1 -2
- package/dist/es2019/plugins/table/commands-with-analytics.js +4 -4
- package/dist/es2019/plugins/table/event-handlers.js +3 -5
- package/dist/es2019/plugins/table/handlers.js +5 -5
- package/dist/es2019/plugins/table/index.js +16 -16
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +19 -15
- package/dist/es2019/plugins/table/nodeviews/TableContainer.js +7 -10
- package/dist/es2019/plugins/table/nodeviews/TableResizer.js +6 -5
- package/dist/es2019/plugins/table/nodeviews/table.js +11 -9
- package/dist/es2019/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/main.js +13 -13
- package/dist/es2019/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/es2019/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/es2019/plugins/table/toolbar.js +16 -18
- package/dist/es2019/plugins/table/transforms/column-width.js +6 -7
- package/dist/es2019/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/es2019/plugins/table/transforms/merge.js +2 -1
- package/dist/es2019/plugins/table/transforms/replace-table.js +2 -2
- package/dist/es2019/plugins/table/transforms/split.js +1 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/styles.js +7 -4
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/es2019/plugins/table/ui/common-styles.js +5 -5
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/ui-styles.js +3 -3
- package/dist/es2019/plugins/table/utils/column-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/decoration.js +2 -2
- package/dist/es2019/plugins/table/utils/guidelines.js +1 -1
- package/dist/es2019/plugins/table/utils/nodes.js +1 -1
- package/dist/es2019/plugins/table/utils/row-controls.js +3 -3
- package/dist/es2019/plugins/table/utils/selection.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/clear.js +3 -1
- package/dist/esm/plugins/table/commands/go-to-next-cell.js +2 -2
- package/dist/esm/plugins/table/commands/insert.js +4 -3
- package/dist/esm/plugins/table/commands/misc.js +4 -4
- package/dist/esm/plugins/table/commands/referentiality.js +1 -1
- package/dist/esm/plugins/table/commands/selection.js +3 -3
- package/dist/esm/plugins/table/commands/sort.js +3 -4
- package/dist/esm/plugins/table/commands/toggle.js +1 -2
- package/dist/esm/plugins/table/commands-with-analytics.js +4 -4
- package/dist/esm/plugins/table/event-handlers.js +3 -5
- package/dist/esm/plugins/table/handlers.js +5 -5
- package/dist/esm/plugins/table/index.js +16 -16
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -1
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +37 -34
- package/dist/esm/plugins/table/nodeviews/TableContainer.js +7 -10
- package/dist/esm/plugins/table/nodeviews/TableResizer.js +6 -5
- package/dist/esm/plugins/table/nodeviews/table.js +11 -9
- package/dist/esm/plugins/table/nodeviews/tableCell.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/keymap.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/main.js +13 -13
- package/dist/esm/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/commands.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/event-handlers.js +4 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/column-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/dom.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/misc.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/scale-table.js +2 -3
- package/dist/esm/plugins/table/pm-plugins/table-selection-keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-width.js +3 -3
- package/dist/esm/plugins/table/toolbar.js +16 -18
- package/dist/esm/plugins/table/transforms/column-width.js +6 -7
- package/dist/esm/plugins/table/transforms/delete-columns.js +1 -1
- package/dist/esm/plugins/table/transforms/merge.js +2 -1
- package/dist/esm/plugins/table/transforms/replace-table.js +2 -2
- package/dist/esm/plugins/table/transforms/split.js +1 -0
- package/dist/esm/plugins/table/ui/FloatingContextualButton/FixedButton.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +4 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/styles.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +10 -10
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +2 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/styles.js +6 -3
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +5 -5
- package/dist/esm/plugins/table/ui/FloatingInsertButton/InsertButton.js +3 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +4 -5
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -3
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +1 -1
- package/dist/esm/plugins/table/ui/common-styles.js +5 -5
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/ui-styles.js +3 -3
- package/dist/esm/plugins/table/utils/column-controls.js +3 -3
- package/dist/esm/plugins/table/utils/decoration.js +2 -2
- package/dist/esm/plugins/table/utils/guidelines.js +1 -1
- package/dist/esm/plugins/table/utils/nodes.js +1 -1
- package/dist/esm/plugins/table/utils/row-controls.js +3 -3
- package/dist/esm/plugins/table/utils/selection.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types/plugins/table/handlers.d.ts +1 -1
- package/dist/types/plugins/table/index.d.ts +4 -4
- package/dist/types/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types/plugins/table/toolbar.d.ts +4 -5
- package/dist/types/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types/plugins/table/types.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/index.d.ts +4 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/TableContainer.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/TableResizer.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +4 -6
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +0 -12
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +3 -4
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -3
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +4 -5
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +1 -2
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +1 -1
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +2 -2
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/99-testing.tsx +11 -10
- package/package.json +12 -4
- package/report.api.md +2 -0
- package/src/__tests__/integration/arrow-down-into-table.ts +3 -2
- package/src/__tests__/integration/auto-size.ts +8 -10
- package/src/__tests__/integration/cell-selection.ts +8 -7
- package/src/__tests__/integration/change-date-inside-table.ts +4 -5
- package/src/__tests__/integration/delete-columns.ts +6 -4
- package/src/__tests__/integration/delete-last-column-in-full-width.ts +4 -4
- package/src/__tests__/integration/delete-last-column-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-last-row-with-empty-action.ts +4 -4
- package/src/__tests__/integration/delete-rows.ts +8 -6
- package/src/__tests__/integration/delete-table-when-selected.ts +10 -11
- package/src/__tests__/integration/deleting-empty-paragraph-under-table.ts +5 -4
- package/src/__tests__/integration/even-columns.ts +8 -8
- package/src/__tests__/integration/floating-toolbar.ts +3 -1
- package/src/__tests__/integration/horizontal-scroll-shadows.ts +7 -8
- package/src/__tests__/integration/horizontal-scroll.ts +8 -7
- package/src/__tests__/integration/insert-cell-header-with-strong-mark.ts +3 -4
- package/src/__tests__/integration/insert-row-inside-layout.ts +8 -6
- package/src/__tests__/integration/layout.ts +8 -11
- package/src/__tests__/integration/meta-arrowup-cursor-in-first-row.ts +3 -2
- package/src/__tests__/integration/resize-handler.ts +2 -2
- package/src/__tests__/integration/resize.ts +15 -15
- package/src/__tests__/integration/scale.ts +8 -8
- package/src/__tests__/integration/sticky-header.ts +3 -2
- package/src/__tests__/unit/analytics.ts +21 -21
- package/src/__tests__/unit/collab.ts +16 -16
- package/src/__tests__/unit/commands/go-to-next-cell.ts +14 -13
- package/src/__tests__/unit/commands/insert.ts +12 -12
- package/src/__tests__/unit/commands/misc.ts +18 -16
- package/src/__tests__/unit/commands/sort.ts +9 -8
- package/src/__tests__/unit/commands.ts +13 -14
- package/src/__tests__/unit/copy-paste.ts +31 -25
- package/src/__tests__/unit/event-handlers/index.ts +15 -13
- package/src/__tests__/unit/event-handlers.ts +18 -18
- package/src/__tests__/unit/fix-tables.ts +9 -9
- package/src/__tests__/unit/get-toolbar-config.ts +21 -21
- package/src/__tests__/unit/handlers.ts +13 -12
- package/src/__tests__/unit/hover-selection.ts +14 -13
- package/src/__tests__/unit/index-with-fake-timers.ts +6 -5
- package/src/__tests__/unit/index.ts +30 -31
- package/src/__tests__/unit/layout.ts +16 -16
- package/src/__tests__/unit/nodeviews/OverflowShadowsObserver.ts +4 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +21 -20
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +38 -105
- package/src/__tests__/unit/nodeviews/cell.ts +17 -16
- package/src/__tests__/unit/nodeviews/table.ts +15 -13
- package/src/__tests__/unit/pm-plugins/decorations/column-controls.ts +1 -1
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +7 -8
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +45 -57
- package/src/__tests__/unit/pm-plugins/main.ts +15 -14
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +7 -6
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +23 -21
- package/src/__tests__/unit/pm-plugins/table-local-id.ts +14 -15
- package/src/__tests__/unit/pm-plugins/table-resizing/colgroup.ts +3 -2
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +22 -21
- package/src/__tests__/unit/sort-column.ts +16 -14
- package/src/__tests__/unit/toolbar.ts +22 -21
- package/src/__tests__/unit/transforms/delete-columns.ts +16 -14
- package/src/__tests__/unit/transforms/delete-rows.ts +16 -14
- package/src/__tests__/unit/transforms/merging.ts +15 -13
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/CornerControls.tsx +11 -9
- package/src/__tests__/unit/ui/DeleteButton.tsx +3 -1
- package/src/__tests__/unit/ui/FixedButton.tsx +4 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +14 -11
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -6
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +12 -9
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +21 -19
- package/src/__tests__/unit/ui/RowControls.tsx +15 -12
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +16 -15
- package/src/__tests__/unit/undo-redo.ts +17 -15
- package/src/__tests__/unit/utils/collapse.ts +7 -8
- package/src/__tests__/unit/utils/nodes.ts +12 -11
- package/src/__tests__/unit/utils/row-controls.ts +12 -12
- package/src/__tests__/unit/utils/table.ts +5 -4
- package/src/__tests__/unit/utils.ts +18 -16
- package/src/__tests__/visual-regression/cell-options-menu.ts +2 -2
- package/src/__tests__/visual-regression/index.ts +8 -7
- package/src/__tests__/visual-regression/sticky-header.ts +6 -5
- package/src/plugins/table/commands/clear.ts +3 -2
- package/src/plugins/table/commands/collapse.ts +1 -0
- package/src/plugins/table/commands/go-to-next-cell.ts +8 -7
- package/src/plugins/table/commands/insert.ts +8 -7
- package/src/plugins/table/commands/misc.ts +15 -18
- package/src/plugins/table/commands/referentiality.ts +3 -1
- package/src/plugins/table/commands/selection.ts +11 -10
- package/src/plugins/table/commands/sort.ts +9 -9
- package/src/plugins/table/commands/split-cell.ts +1 -1
- package/src/plugins/table/commands/toggle.ts +2 -3
- package/src/plugins/table/commands-with-analytics.ts +15 -15
- package/src/plugins/table/event-handlers.ts +19 -20
- package/src/plugins/table/handlers.ts +6 -7
- package/src/plugins/table/index.tsx +51 -51
- package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +2 -1
- package/src/plugins/table/nodeviews/TableComponent.tsx +22 -25
- package/src/plugins/table/nodeviews/TableContainer.tsx +13 -24
- package/src/plugins/table/nodeviews/TableResizer.tsx +9 -7
- package/src/plugins/table/nodeviews/table.tsx +25 -18
- package/src/plugins/table/nodeviews/tableCell.tsx +9 -7
- package/src/plugins/table/nodeviews/types.ts +4 -2
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +3 -1
- package/src/plugins/table/pm-plugins/decorations/plugin.ts +4 -3
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +2 -1
- package/src/plugins/table/pm-plugins/keymap.ts +8 -8
- package/src/plugins/table/pm-plugins/main.ts +38 -33
- package/src/plugins/table/pm-plugins/plugin-factory.ts +2 -0
- package/src/plugins/table/pm-plugins/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -1
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +6 -7
- package/src/plugins/table/pm-plugins/sticky-headers/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/sticky-headers/plugin.ts +3 -4
- package/src/plugins/table/pm-plugins/table-local-id.ts +3 -4
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +3 -2
- package/src/plugins/table/pm-plugins/table-resizing/event-handlers.ts +13 -14
- package/src/plugins/table/pm-plugins/table-resizing/plugin-factory.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin-key.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/plugin.ts +7 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/colgroup.ts +2 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/column-state.ts +1 -1
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +3 -3
- package/src/plugins/table/pm-plugins/table-resizing/utils/misc.ts +8 -9
- package/src/plugins/table/pm-plugins/table-resizing/utils/resize-state.ts +8 -6
- package/src/plugins/table/pm-plugins/table-resizing/utils/scale-table.ts +4 -5
- package/src/plugins/table/pm-plugins/table-resizing/utils/types.ts +2 -1
- package/src/plugins/table/pm-plugins/table-selection-keymap.ts +4 -3
- package/src/plugins/table/pm-plugins/table-width.ts +5 -4
- package/src/plugins/table/toolbar.tsx +54 -57
- package/src/plugins/table/transforms/column-width.ts +13 -13
- package/src/plugins/table/transforms/delete-columns.ts +2 -2
- package/src/plugins/table/transforms/delete-rows.ts +2 -2
- package/src/plugins/table/transforms/merge.ts +3 -3
- package/src/plugins/table/transforms/replace-table.ts +6 -5
- package/src/plugins/table/transforms/split.ts +1 -1
- package/src/plugins/table/types.ts +3 -3
- package/src/plugins/table/ui/FloatingContextualButton/FixedButton.tsx +4 -2
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +12 -11
- package/src/plugins/table/ui/FloatingContextualButton/styles.ts +5 -3
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +27 -28
- package/src/plugins/table/ui/FloatingContextualMenu/index.tsx +10 -11
- package/src/plugins/table/ui/FloatingContextualMenu/styles.ts +8 -4
- package/src/plugins/table/ui/FloatingDeleteButton/DeleteButton.tsx +5 -2
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +9 -9
- package/src/plugins/table/ui/FloatingInsertButton/InsertButton.tsx +4 -5
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +16 -18
- package/src/plugins/table/ui/LayoutButton/index.tsx +6 -6
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +3 -2
- package/src/plugins/table/ui/TableFloatingControls/NumberColumn/index.tsx +2 -1
- package/src/plugins/table/ui/TableFloatingControls/index.tsx +2 -3
- package/src/plugins/table/ui/common-styles.ts +33 -34
- package/src/plugins/table/ui/consts.ts +12 -13
- package/src/plugins/table/ui/ui-styles.ts +24 -22
- package/src/plugins/table/utils/analytics.ts +3 -2
- package/src/plugins/table/utils/collapse.ts +2 -2
- package/src/plugins/table/utils/column-controls.ts +5 -6
- package/src/plugins/table/utils/decoration.ts +6 -7
- package/src/plugins/table/utils/dom.ts +1 -0
- package/src/plugins/table/utils/guidelines.ts +2 -2
- package/src/plugins/table/utils/nodes.ts +2 -1
- package/src/plugins/table/utils/row-controls.ts +4 -3
- package/src/plugins/table/utils/selection.ts +2 -1
- package/src/plugins/table/utils/table.ts +2 -1
|
@@ -3,11 +3,11 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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
4
|
import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { calcTableColumnWidths } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { getSelectedTableInfo } from '../../../utils';
|
|
6
7
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
7
8
|
import { getCellsRefsInColumn, getColumnStateFromDOM } from './column-state';
|
|
8
9
|
import { syncStickyRowToTable } from './dom';
|
|
9
10
|
import { getTableMaxWidth } from './misc';
|
|
10
|
-
import { getSelectedTableInfo } from '../../../utils';
|
|
11
11
|
export var getResizeState = function getResizeState(_ref) {
|
|
12
12
|
var minWidth = _ref.minWidth,
|
|
13
13
|
maxSize = _ref.maxSize,
|
|
@@ -3,13 +3,12 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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
4
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
|
-
import {
|
|
6
|
+
import { updateColumnWidths } from '../../../transforms';
|
|
7
7
|
import { getTableWidth } from '../../../utils';
|
|
8
8
|
import { getLayoutSize } from '../utils/misc';
|
|
9
9
|
import { reduceSpace } from '../utils/resize-logic';
|
|
10
10
|
import { adjustColumnsWidths, getResizeState, getTotalWidth, updateColgroup } from '../utils/resize-state';
|
|
11
11
|
import { hasTableBeenResized, insertColgroupFromNode } from './colgroup';
|
|
12
|
-
import { updateColumnWidths } from '../../../transforms';
|
|
13
12
|
// Base function to trigger the actual scale on a table node.
|
|
14
13
|
// Will only resize/scale if a table has been previously resized.
|
|
15
14
|
export var scale = function scale(tableRef, options, domAtPos) {
|
|
@@ -105,7 +104,7 @@ export var previewScaleTable = function previewScaleTable(tableRef, options, dom
|
|
|
105
104
|
if (!tableRef) {
|
|
106
105
|
return;
|
|
107
106
|
}
|
|
108
|
-
if (
|
|
107
|
+
if (parentWidth) {
|
|
109
108
|
tableRef.style.width = "".concat(parentWidth, "px");
|
|
110
109
|
}
|
|
111
110
|
if (!hasTableBeenResized(node)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { keymap } from 'prosemirror-keymap';
|
|
2
|
-
import { bindKeymapWithCommand,
|
|
2
|
+
import { bindKeymapWithCommand, moveLeft, moveRight } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { arrowLeftFromTable, arrowRightFromTable } from '../commands/selection';
|
|
4
4
|
export function tableSelectionKeymapPlugin(editorSelectionAPI) {
|
|
5
5
|
var list = {};
|
|
@@ -8,11 +8,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
8
8
|
* Has login to scan the document, add width value to table's width attribute when necessary
|
|
9
9
|
* Also holds resizing state to hide / show table controls
|
|
10
10
|
*/
|
|
11
|
+
import { PluginKey } from 'prosemirror-state';
|
|
12
|
+
import { ReplaceStep } from 'prosemirror-transform';
|
|
13
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
11
14
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
12
15
|
import { akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
13
|
-
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
14
|
-
import { ReplaceStep } from 'prosemirror-transform';
|
|
15
|
-
import { PluginKey } from 'prosemirror-state';
|
|
16
16
|
export var pluginKey = new PluginKey('tableWidthPlugin');
|
|
17
17
|
var createPlugin = function createPlugin(dispatch, fullWidthEnabled) {
|
|
18
18
|
return new SafePlugin({
|
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
+
import { findParentDomRefOfType } from 'prosemirror-utils';
|
|
3
4
|
import { defineMessages } from 'react-intl-next';
|
|
4
|
-
import
|
|
5
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
6
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
5
8
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
9
|
+
import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
10
|
+
import { closestElement, getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
12
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
13
|
+
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType, splitCell } from '@atlaskit/editor-tables/utils';
|
|
14
|
+
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
15
|
+
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
16
|
+
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
8
17
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
9
18
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
19
|
+
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
10
20
|
import { pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
11
|
-
import { TableCssClassName } from './types';
|
|
12
|
-
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from './utils';
|
|
13
|
-
import { isReferencedSource, getChildrenInfo as _getChildrenInfo, getNodeName } from '@atlaskit/editor-common/utils';
|
|
14
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
15
|
-
import { findCellRectClosestToPos, findTable, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
16
21
|
import { canMergeCells } from './transforms';
|
|
17
|
-
import {
|
|
18
|
-
import tableMessages from './ui/messages';
|
|
22
|
+
import { TableCssClassName } from './types';
|
|
19
23
|
import { messages as ContextualMenuMessages } from './ui/FloatingContextualMenu/ContextualMenu';
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import { addColumnAfter, addRowAfter, tooltip, backspace } from '@atlaskit/editor-common/keymaps';
|
|
23
|
-
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
24
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
25
|
-
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
26
|
-
import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
27
|
-
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
24
|
+
import tableMessages from './ui/messages';
|
|
25
|
+
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from './utils';
|
|
28
26
|
export var messages = defineMessages({
|
|
29
27
|
tableOptions: {
|
|
30
28
|
id: 'fabric.editor.tableOptions',
|
|
@@ -1,18 +1,17 @@
|
|
|
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 {
|
|
5
|
-
import { tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
4
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
5
|
+
import { tableCellMinWidth, tableNewColumnMinWidth } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
|
|
8
|
-
import {
|
|
9
|
-
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
10
|
+
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
10
11
|
import { getTableMaxWidth } from '../pm-plugins/table-resizing/utils/misc';
|
|
11
|
-
import {
|
|
12
|
+
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
12
13
|
import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
13
|
-
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
14
14
|
import { insertColumnButtonOffset } from '../ui/common-styles';
|
|
15
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
export var updateColumnWidths = function updateColumnWidths(resizeState, table, start) {
|
|
17
16
|
return function (tr) {
|
|
18
17
|
var map = TableMap.get(table);
|
|
@@ -3,9 +3,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
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
5
|
import { Selection } from 'prosemirror-state';
|
|
6
|
+
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
6
7
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
8
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
8
|
-
import { AddColumnStep } from '@atlaskit/adf-schema/steps';
|
|
9
9
|
import { splitCellsInColumns } from './split';
|
|
10
10
|
var deleteColumnsCustomStep = function deleteColumnsCustomStep(rect) {
|
|
11
11
|
return function (tr) {
|
|
@@ -3,9 +3,10 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
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
4
|
import { Fragment } from 'prosemirror-model';
|
|
5
5
|
import { Selection } from 'prosemirror-state';
|
|
6
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
6
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
8
|
import { findTable, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
9
|
+
|
|
9
10
|
// re-creates table node with merged cells
|
|
10
11
|
export function mergeCells(tr) {
|
|
11
12
|
var selection = tr.selection;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Fragment, Slice } from 'prosemirror-model';
|
|
1
2
|
import { TextSelection } from 'prosemirror-state';
|
|
2
|
-
import {
|
|
3
|
+
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
3
4
|
import { findTable, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
4
|
-
import { TABLE_ACTION, ACTION_SUBJECT, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { getSelectedTableInfo } from '../utils';
|
|
6
6
|
export var replaceSelectedTable = function replaceSelectedTable(state, content, inputMethod, editorAnalyticsAPI) {
|
|
7
7
|
if (isTableSelected(state.selection)) {
|
|
@@ -2,6 +2,7 @@ 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
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Helper to split all the cells in a range of columns
|
|
7
8
|
* @param tr
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
|
-
import { createPortal } from 'react-dom';
|
|
3
2
|
import rafSchedule from 'raf-schd';
|
|
3
|
+
import { createPortal } from 'react-dom';
|
|
4
4
|
import { akEditorFloatingPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
import { insertColumnButtonOffset } from '../common-styles';
|
|
6
5
|
import { TableCssClassName as ClassName } from '../../types';
|
|
6
|
+
import { insertColumnButtonOffset } from '../common-styles';
|
|
7
7
|
export var BUTTON_WIDTH = 20;
|
|
8
8
|
export var calcLeftPos = function calcLeftPos(_ref) {
|
|
9
9
|
var buttonWidth = _ref.buttonWidth,
|
|
@@ -3,17 +3,17 @@ import React from 'react';
|
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
5
5
|
import { injectIntl } from 'react-intl-next';
|
|
6
|
+
import { ACTION_SUBJECT } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
6
8
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
9
|
+
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
7
10
|
import { akEditorSmallZIndex } from '@atlaskit/editor-shared-styles';
|
|
8
11
|
import ExpandIcon from '@atlaskit/icon/glyph/chevron-down';
|
|
9
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
10
12
|
import { toggleContextualMenu } from '../../commands';
|
|
11
13
|
import { TableCssClassName as ClassName } from '../../types';
|
|
12
14
|
import messages from '../../ui/messages';
|
|
13
15
|
import FixedButton from './FixedButton';
|
|
14
|
-
import {
|
|
15
|
-
import { tableFloatingCellButtonStyles, tableFloatingCellButtonSelectedStyles } from './styles';
|
|
16
|
-
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
16
|
+
import { tableFloatingCellButtonSelectedStyles, tableFloatingCellButtonStyles } from './styles';
|
|
17
17
|
var BUTTON_OFFSET = 3;
|
|
18
18
|
var FloatingContextualButtonInner = /*#__PURE__*/React.memo(function (props) {
|
|
19
19
|
var editorView = props.editorView,
|
|
@@ -2,9 +2,9 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { B75, DN0, DN60, N0, N20, N30A, N700 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { themed } from '@atlaskit/theme/components';
|
|
5
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
6
7
|
import { contextualMenuTriggerSize } from '../consts';
|
|
7
|
-
import { themed } from '@atlaskit/theme/components';
|
|
8
8
|
export var tableFloatingCellButtonStyles = function tableFloatingCellButtonStyles(props) {
|
|
9
9
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n > div {\n // Sits behind button to provide surface-color background\n background: ", ";\n border-radius: ", "px;\n display: flex;\n height: ", "px;\n flex-direction: column;\n }\n && button {\n background: ", ";\n flex-direction: column;\n margin: 2px;\n outline: 2px solid ", ";\n border-radius: 1px;\n padding: 0;\n height: calc(100% - 4px);\n display: flex;\n }\n && button:hover {\n background: ", ";\n }\n && button:active {\n background: ", ";\n }\n && button > span {\n margin: 0px -4px;\n }\n && span {\n pointer-events: none;\n }\n"])), "var(--ds-surface, ".concat(N20, ")"), borderRadius(), contextualMenuTriggerSize + 2, themed({
|
|
10
10
|
light: "var(--ds-background-neutral, none)",
|
|
@@ -12,27 +12,27 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
/** @jsx jsx */
|
|
13
13
|
import { Component } from 'react';
|
|
14
14
|
import { jsx } from '@emotion/react';
|
|
15
|
-
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
16
|
-
import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
17
15
|
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
16
|
+
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
17
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
18
18
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
19
|
-
import { ColorPalette, backgroundPaletteTooltipMessages, cellBackgroundColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
20
19
|
import { DropdownMenuSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
20
|
+
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
21
21
|
import { ArrowKeyNavigationType, DropdownMenu } from '@atlaskit/editor-common/ui-menu';
|
|
22
|
-
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
23
|
-
import { cellColourPreviewStyles } from './styles';
|
|
24
22
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
25
|
-
import {
|
|
23
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
24
|
+
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
25
|
+
import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
26
26
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, toggleContextualMenu } from '../../commands';
|
|
27
|
-
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics
|
|
27
|
+
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
|
|
28
28
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
29
|
+
import { getNewResizeStateFromSelectedColumns } from '../../pm-plugins/table-resizing/utils/resize-state';
|
|
29
30
|
import { canMergeCells } from '../../transforms';
|
|
30
31
|
import { TableCssClassName as ClassName } from '../../types';
|
|
31
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
32
32
|
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes } from '../../utils';
|
|
33
|
-
import tableMessages from '../messages';
|
|
34
33
|
import { contextualMenuDropdownWidth } from '../consts';
|
|
35
|
-
import
|
|
34
|
+
import tableMessages from '../messages';
|
|
35
|
+
import { cellColourPreviewStyles } from './styles';
|
|
36
36
|
export var messages = defineMessages({
|
|
37
37
|
cellBackground: {
|
|
38
38
|
id: 'fabric.editor.cellBackground',
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
4
|
-
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
5
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
6
5
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
8
8
|
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
9
9
|
import { contextualMenuDropdownWidth, contextualMenuTriggerSize } from '../consts';
|
|
10
|
-
import { tablePopupStyles } from './styles';
|
|
11
10
|
import ContextualMenu from './ContextualMenu';
|
|
11
|
+
import { tablePopupStyles } from './styles';
|
|
12
12
|
|
|
13
13
|
// offset of the contextual menu dropdown
|
|
14
14
|
var calculateOffset = function calculateOffset(targetCellRef, state) {
|
|
@@ -3,10 +3,13 @@ var _templateObject, _templateObject2;
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableBackgroundBorderColor } from '@atlaskit/adf-schema';
|
|
5
5
|
import { N60A, N90 } from '@atlaskit/theme/colors';
|
|
6
|
-
import { contextualMenuDropdownWidth } from '../consts';
|
|
7
|
-
import { TableCssClassName as ClassName } from '../../types';
|
|
8
6
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
|
+
import { TableCssClassName as ClassName } from '../../types';
|
|
8
|
+
import { contextualMenuDropdownWidth } from '../consts';
|
|
9
9
|
export var cellColourPreviewStyles = function cellColourPreviewStyles(selectedColor) {
|
|
10
10
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &::before {\n background: ", ";\n }\n"])), selectedColor);
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
// TODO Delete this comment after verifying space token -> previous value `padding: 8px`
|
|
14
|
+
// TODO Delete this comment after verifying space token -> previous value `margin-left: 4px`
|
|
15
|
+
export var tablePopupStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .", " {\n border-radius: ", "px;\n background: ", ";\n box-shadow: ", ";\n display: block;\n position: absolute;\n top: 0;\n left: ", "px;\n padding: ", ";\n\n > div {\n padding: 0;\n }\n }\n\n .", " {\n display: flex;\n\n &::before {\n content: '';\n display: block;\n border: 1px solid ", ";\n border-radius: ", "px;\n width: 20px;\n height: 20px;\n }\n\n &::after {\n content: '\u203A';\n margin-left: ", ";\n line-height: 20px;\n color: ", ";\n }\n }\n"])), ClassName.CONTEXTUAL_SUBMENU, borderRadius(), "var(--ds-surface-overlay, white)", "var(--ds-shadow-overlay, ".concat("0 4px 8px -2px ".concat(N60A, ", 0 0 1px ").concat(N60A), ")"), contextualMenuDropdownWidth, "var(--ds-space-100, 8px)", ClassName.CONTEXTUAL_MENU_ICON, tableBackgroundBorderColor, borderRadius(), "var(--ds-space-050, 4px)", "var(--ds-icon, ".concat(N90, ")"));
|
|
@@ -11,20 +11,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
11
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
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, { Component } from 'react';
|
|
14
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
15
|
-
import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
16
14
|
import { createPortal } from 'react-dom';
|
|
15
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
17
16
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
18
|
-
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
19
17
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
20
|
-
import {
|
|
18
|
+
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
19
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
20
|
+
import { getSelectionRect, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
21
21
|
import { clearHoverSelection, hoverColumns, hoverRows } from '../../commands';
|
|
22
22
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics } from '../../commands-with-analytics';
|
|
23
23
|
import { getPluginState as getTablePluginState } from '../../pm-plugins/plugin-factory';
|
|
24
24
|
import { TableCssClassName as ClassName } from '../../types';
|
|
25
25
|
import { getColumnDeleteButtonParams, getColumnsWidths, getRowDeleteButtonParams, getRowHeights } from '../../utils';
|
|
26
|
-
import tableMessages from '../messages';
|
|
27
26
|
import { stickyRowZIndex } from '../consts';
|
|
27
|
+
import tableMessages from '../messages';
|
|
28
28
|
import DeleteButton from './DeleteButton';
|
|
29
29
|
import getPopupOptions from './getPopUpOptions';
|
|
30
30
|
export function getSelectionType(selection) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
+
import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
3
4
|
import { tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
5
|
+
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
4
6
|
import { akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
5
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import * as keymaps from '@atlaskit/editor-common/keymaps';
|
|
7
|
-
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { TableCssClassName as ClassName } from '../../types';
|
|
9
|
-
import tableMessages from '../messages';
|
|
10
9
|
import { tableToolbarSize } from '../consts';
|
|
10
|
+
import tableMessages from '../messages';
|
|
11
11
|
var getInsertLineHeight = function getInsertLineHeight(tableRef, hasStickyHeaders) {
|
|
12
12
|
// The line gets height 100% from the table,
|
|
13
13
|
// but since we have an overflow on the left,
|
|
@@ -9,20 +9,19 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
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; } }
|
|
11
11
|
import React from 'react';
|
|
12
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
13
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
14
12
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
15
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
16
13
|
import { injectIntl } from 'react-intl-next';
|
|
14
|
+
import { ACTION, ACTION_SUBJECT, CONTENT_COMPONENT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
17
15
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
18
16
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
19
|
-
import {
|
|
17
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
18
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
19
|
+
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
20
20
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
|
|
21
21
|
import { TableCssClassName as ClassName } from '../../types';
|
|
22
22
|
import { checkIfNumberColumnEnabled } from '../../utils';
|
|
23
23
|
import getPopupOptions from './getPopupOptions';
|
|
24
24
|
import InsertButton from './InsertButton';
|
|
25
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, CONTENT_COMPONENT } from '@atlaskit/editor-common/analytics';
|
|
26
25
|
export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
27
26
|
_inherits(FloatingInsertButton, _React$Component);
|
|
28
27
|
var _super = _createSuper(FloatingInsertButton);
|
|
@@ -11,15 +11,15 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
11
11
|
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; }
|
|
12
12
|
import React, { createRef } from 'react';
|
|
13
13
|
import classnames from 'classnames';
|
|
14
|
+
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
14
15
|
import { injectIntl } from 'react-intl-next';
|
|
16
|
+
import commonMessages from '@atlaskit/editor-common/messages';
|
|
15
17
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
18
|
+
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
16
19
|
import CollapseIcon from '@atlaskit/icon/glyph/editor/collapse';
|
|
17
20
|
import ExpandIcon from '@atlaskit/icon/glyph/editor/expand';
|
|
18
|
-
import commonMessages from '@atlaskit/editor-common/messages';
|
|
19
|
-
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
|
20
21
|
import { toggleTableLayoutWithAnalytics } from '../../commands-with-analytics';
|
|
21
22
|
import { TableCssClassName as ClassName } from '../../types';
|
|
22
|
-
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
23
23
|
var addPopupOffset = function addPopupOffset(pos) {
|
|
24
24
|
return _objectSpread(_objectSpread({}, pos), {}, {
|
|
25
25
|
// add 12 pixels to align y position with
|
|
@@ -8,8 +8,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
9
|
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; } }
|
|
10
10
|
import React, { Component } from 'react';
|
|
11
|
-
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
12
11
|
import classnames from 'classnames';
|
|
12
|
+
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
13
13
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
14
14
|
import { findTable, isTableSelected, selectTable } from '@atlaskit/editor-tables/utils';
|
|
15
15
|
import { clearHoverSelection, hoverTable } from '../../../commands';
|
|
@@ -2,13 +2,13 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableMarginTop, tableSharedStyle } from '@atlaskit/editor-common/styles';
|
|
5
|
-
import {
|
|
6
|
-
import { N40A, B300, N300, N20A, N0, R500 } from '@atlaskit/theme/colors';
|
|
7
|
-
import { SelectionStyle, getSelectionStyles, akEditorSmallZIndex, akEditorTableNumberColumnWidth, akEditorStickyHeaderZIndex, akEditorTableToolbarSize, akEditorUnitZIndex, akEditorSelectedNodeClassName, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { akEditorSelectedNodeClassName, akEditorSmallZIndex, akEditorStickyHeaderZIndex, akEditorTableNumberColumnWidth, akEditorTableToolbarSize, akEditorUnitZIndex, getSelectionStyles, relativeFontSizeToBase16, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
8
6
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
7
|
+
import { B300, N0, N20A, N300, N40A, R500 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { fontSize } from '@atlaskit/theme/constants';
|
|
9
9
|
import { TableCssClassName as ClassName } from '../types';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { columnControlsDecorationHeight, resizeHandlerAreaWidth, resizeLineWidth, stickyHeaderBorderBottomWidth, stickyRowOffsetTop, stickyRowZIndex, tableBorderColor, tableBorderDeleteColor, tableBorderRadiusSize, tableBorderSelectedColor, tableCellBackgroundColor, tableCellDeleteColor, tableCellSelectedColor, tableControlsSpacing, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tablePadding, tableScrollbarOffset, tableTextColor, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
11
|
+
import { columnControlsDecoration, columnControlsLineMarker, DeleteButton, HeaderButton, HeaderButtonDanger, HeaderButtonHover, hoveredCell, hoveredDeleteButton, hoveredWarningCell, insertColumnButtonWrapper, InsertMarker, insertRowButtonWrapper, OverflowShadow, resizeHandle } from './ui-styles';
|
|
12
12
|
var cornerControlHeight = tableToolbarSize + 1;
|
|
13
13
|
|
|
14
14
|
/*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { B200, B300, N20, R400, R75, DN400, N200, DN30, N0 } from '@atlaskit/theme/colors';
|
|
2
1
|
import { tableCellBorderWidth, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
3
2
|
import { akEditorTableBorder, akEditorTableBorderDark, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableToolbarSize, akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
|
-
import {
|
|
3
|
+
import { B200, B300, DN30, DN400, N0, N20, N200, R400, R75 } from '@atlaskit/theme/colors';
|
|
5
4
|
import { themed } from '@atlaskit/theme/components';
|
|
5
|
+
import { RESIZE_HANDLE_AREA_DECORATION_GAP } from '../types';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Basic colors added to prevent content overflow in table cells.
|
|
@@ -3,10 +3,10 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _temp
|
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { tableCellBorderWidth, tableMarginTop, tableMarginTopWithControl } from '@atlaskit/editor-common/styles';
|
|
5
5
|
import { akEditorShadowZIndex, akEditorTableNumberColumnWidth, akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
6
|
-
import {
|
|
7
|
-
import { tableBorderColor, tableToolbarSelectedColor, tableHeaderCellBackgroundColor, tableBorderSelectedColor, tableCellDeleteColor, tableBorderDeleteColor, tableToolbarDeleteColor, lineMarkerSize, columnControlsDecorationHeight, columnControlsZIndex, columnControlsSelectedZIndex, resizeHandlerAreaWidth, resizeLineWidth, resizeHandlerZIndex, tableToolbarSize, tableInsertColumnButtonSize, tableDeleteButtonSize } from './consts';
|
|
8
|
-
import { TableCssClassName as ClassName } from '../types';
|
|
6
|
+
import { B300, N0, N20A, N300, N40A, N60A, R300, Y200, Y50 } from '@atlaskit/theme/colors';
|
|
9
7
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
8
|
+
import { TableCssClassName as ClassName } from '../types';
|
|
9
|
+
import { columnControlsDecorationHeight, columnControlsSelectedZIndex, columnControlsZIndex, lineMarkerSize, resizeHandlerAreaWidth, resizeHandlerZIndex, resizeLineWidth, tableBorderColor, tableBorderDeleteColor, tableBorderSelectedColor, tableCellDeleteColor, tableDeleteButtonSize, tableHeaderCellBackgroundColor, tableInsertColumnButtonSize, tableToolbarDeleteColor, tableToolbarSelectedColor, tableToolbarSize } from './consts';
|
|
10
10
|
var InsertLine = function InsertLine(cssString) {
|
|
11
11
|
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .", " {\n background: ", ";\n display: none;\n position: absolute;\n z-index: ", ";\n ", "\n }\n"])), ClassName.CONTROLS_INSERT_LINE, tableBorderSelectedColor, akEditorUnitZIndex, cssString);
|
|
12
12
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
4
2
|
import { findDomRefAtPos } from 'prosemirror-utils';
|
|
5
|
-
import { findTable, getCellsInColumn, getSelectionRect, isColumnSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
6
3
|
import { maphElem } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
6
|
+
import { findTable, getCellsInColumn, getSelectionRect, isColumnSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
7
7
|
import { TableCssClassName as ClassName } from '../types';
|
|
8
8
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
9
9
|
export var getColumnsWidths = function getColumnsWidths(view) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
3
3
|
|
|
4
|
-
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
-
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
6
4
|
import { Decoration } from 'prosemirror-view';
|
|
7
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { Rect, TableMap } from '@atlaskit/editor-tables/table-map';
|
|
7
|
+
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { TableCssClassName as ClassName, TableDecorations } from '../types';
|
|
9
9
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
10
10
|
return decorationSet.find(undefined, undefined, function (spec) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createFixedGuidelinesFromLengths } from '@atlaskit/editor-common/guideline';
|
|
2
|
-
import { akEditorDefaultLayoutWidth,
|
|
2
|
+
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorWideLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
3
3
|
export var defaultGuidelineWidths = [akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth];
|
|
4
4
|
export var defaultGuidelines = createFixedGuidelinesFromLengths(defaultGuidelineWidths);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
2
|
import { hasParentNodeOfType } from 'prosemirror-utils';
|
|
3
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
6
6
|
export var isIsolating = function isIsolating(node) {
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
|
-
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
4
|
import { safeInsert } from 'prosemirror-utils';
|
|
7
|
-
import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
5
|
import { parsePx } from '@atlaskit/editor-common/utils';
|
|
6
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
7
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
8
|
+
import { findTable, getSelectionRect, isRowSelected, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
9
9
|
import { TableCssClassName as ClassName } from '../types';
|
|
10
10
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
11
11
|
export var getRowHeights = function getRowHeights(tableRef) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
2
1
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
2
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
3
3
|
import { findTable, getSelectionRangeInColumn, getSelectionRangeInRow, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
|
|
4
4
|
export var isSelectionUpdated = function isSelectionUpdated(oldSelection, newSelection) {
|
|
5
5
|
return !!(!newSelection && oldSelection) || isSelectionType(oldSelection, 'cell') !== isSelectionType(newSelection, 'cell') || isSelectionType(oldSelection, 'cell') && isSelectionType(newSelection, 'cell') && oldSelection.ranges !== newSelection.ranges;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Direction } from '@atlaskit/editor-tables/types';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
3
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
+
import { Direction } from '@atlaskit/editor-tables/types';
|
|
4
4
|
export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (direction: Direction) => Command;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from 'prosemirror-state';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
3
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
6
6
|
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
1
|
import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
2
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
export declare enum TableSelectionDirection {
|
|
4
4
|
TopToBottom = "TopToBottom",
|
|
5
5
|
BottomToTop = "BottomToTop"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
1
|
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
2
|
+
import { Command } from '@atlaskit/editor-common/types';
|
|
3
3
|
export declare const sortByColumn: (columnIndex: number, order?: SortOrder) => Command;
|