@atlaskit/editor-plugin-table 0.0.10 → 0.1.1
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 +35 -0
- package/CHANGELOG.md +31 -0
- package/commands/package.json +14 -0
- package/dist/cjs/plugins/table/commands/hover.js +4 -4
- package/dist/cjs/plugins/table/commands-with-analytics.js +59 -58
- package/dist/cjs/plugins/table/event-handlers.js +0 -1
- package/dist/cjs/plugins/table/index.js +54 -37
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/index.js +9 -1
- package/dist/cjs/plugins/table/toolbar.js +150 -22
- package/dist/cjs/plugins/table/transforms/fix-tables.js +7 -7
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/cjs/plugins/table/ui/FloatingDeleteButton/index.js +2 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/cjs/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/cjs/plugins/table/utils/column-controls.js +0 -1
- package/dist/cjs/plugins/table/utils/decoration.js +53 -4
- package/dist/cjs/plugins/table/utils/dom.js +0 -2
- package/dist/cjs/plugins/table/utils/paste.js +0 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/hover.js +4 -4
- package/dist/es2019/plugins/table/commands-with-analytics.js +6 -9
- package/dist/es2019/plugins/table/event-handlers.js +1 -2
- package/dist/es2019/plugins/table/handlers.js +1 -2
- package/dist/es2019/plugins/table/index.js +23 -5
- package/dist/es2019/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/table-local-id.js +1 -3
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/index.js +2 -1
- package/dist/es2019/plugins/table/toolbar.js +133 -16
- package/dist/es2019/plugins/table/transforms/fix-tables.js +2 -4
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/es2019/plugins/table/ui/FloatingDeleteButton/index.js +3 -3
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/es2019/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/es2019/plugins/table/utils/column-controls.js +0 -1
- package/dist/es2019/plugins/table/utils/decoration.js +60 -25
- package/dist/es2019/plugins/table/utils/dom.js +0 -2
- package/dist/es2019/plugins/table/utils/paste.js +1 -2
- package/dist/es2019/plugins/table/utils/row-controls.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/hover.js +4 -4
- package/dist/esm/plugins/table/commands-with-analytics.js +56 -55
- package/dist/esm/plugins/table/event-handlers.js +1 -2
- package/dist/esm/plugins/table/handlers.js +1 -2
- package/dist/esm/plugins/table/index.js +55 -38
- package/dist/esm/plugins/table/pm-plugins/keymap.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/table-local-id.js +1 -3
- package/dist/esm/plugins/table/pm-plugins/table-resizing/index.js +2 -1
- package/dist/esm/plugins/table/toolbar.js +139 -17
- package/dist/esm/plugins/table/transforms/fix-tables.js +2 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +4 -6
- package/dist/esm/plugins/table/ui/FloatingDeleteButton/index.js +3 -3
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +3 -5
- package/dist/esm/plugins/table/ui/TableFloatingControls/CornerControls/index.js +2 -1
- package/dist/esm/plugins/table/utils/column-controls.js +0 -1
- package/dist/esm/plugins/table/utils/decoration.js +50 -4
- package/dist/esm/plugins/table/utils/dom.js +0 -2
- package/dist/esm/plugins/table/utils/paste.js +1 -2
- package/dist/esm/plugins/table/utils/row-controls.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
- package/dist/types/plugins/table/toolbar.d.ts +2 -2
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +1 -1
- package/dist/types/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/99-testing.tsx +35 -30
- package/examples/config.jsonc +14 -0
- package/package.json +14 -19
- package/plugin-key/package.json +14 -0
- package/report.api.md +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/auto-size-documents.ts +5 -10
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/basic-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/empty-paragraph-underneath-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/even-columns.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/layout-documents.ts +1 -2
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/merged-rows-and-cols-document.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/nested-in-extension.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/paragraph-and-table-adf.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/resize-documents.ts +5 -10
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/scale.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-inside-layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-min-width-columns-document.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-multiline-date.adf.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__fixtures__/table-with-text-and-empty-row.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/auto-size.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/change-date-inside-table.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/copy-button.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-columns.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-in-full-width.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-column-with-empty-action.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-last-row-with-empty-action.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-rows.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/delete-table-when-selected.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/deleting-empty-paragraph-under-table.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/even-columns.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-cell-header-with-strong-mark.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/insert-row-inside-layout.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/layout.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/resize.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/__snapshots__/scale.ts.snap +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/arrow-down-into-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/auto-size.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/block-node-selection.ts +1 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/cell-selection.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/change-date-inside-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/copy-button.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-columns.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-in-full-width.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-column-with-empty-action.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-last-row-with-empty-action.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-rows.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/integration/delete-table-when-selected.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/deleting-empty-paragraph-under-table.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/even-columns.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-cell-header-with-strong-mark.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-long-smart-link.ts +1 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/insert-row-inside-layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/layout.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/resize-handler.ts +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/integration/resize.ts +2 -3
- package/src/{plugins/table/__tests__ → __tests__}/integration/scale.ts +0 -0
- package/src/__tests__/integration/table-controls-selection.ts +71 -0
- package/src/__tests__/unit/analytics.ts +41 -41
- package/src/__tests__/unit/collab.ts +12 -9
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/go-to-next-cell.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/insert.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands/misc.ts +12 -6
- package/src/__tests__/unit/commands/sort.ts +28 -28
- package/src/{plugins/table/__tests__ → __tests__}/unit/commands.ts +7 -7
- package/src/__tests__/unit/copy-button.ts +22 -0
- package/src/__tests__/unit/copy-paste.ts +6 -8
- package/src/__tests__/unit/event-handlers.ts +127 -11
- package/src/__tests__/unit/fix-tables.ts +17 -23
- package/src/{plugins/table/__tests__ → __tests__}/unit/get-toolbar-config.ts +8 -8
- package/src/__tests__/unit/hover-selection.ts +1 -66
- package/src/__tests__/unit/index-with-fake-timers.ts +1 -1
- package/src/__tests__/unit/index.ts +5 -5
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/OverflowShadowsObserver.ts +2 -2
- package/src/__tests__/unit/nodeviews/TableComponent.tsx +181 -0
- package/src/__tests__/unit/nodeviews/cell.ts +12 -10
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/table.ts +29 -30
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-controls.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-resizing.ts +9 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/plugin.ts +5 -5
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main-with-allow-collapse.ts +4 -4
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main.ts +6 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +12 -9
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/sticky-headers/tableRow.tsx +27 -25
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-local-id.ts +3 -6
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/colgroup.ts +1 -1
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/event-handlers.ts +3 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-selection-keymap.ts +3 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/toolbar.ts +23 -14
- package/src/__tests__/unit/ui/ContextualMenu.tsx +55 -0
- package/src/__tests__/unit/ui/CornerControls.tsx +7 -7
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +45 -49
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +49 -0
- package/src/__tests__/unit/ui/FloatingDeleteButton.tsx +30 -2
- package/src/__tests__/unit/ui/FloatingInsertButton.tsx +143 -111
- package/src/__tests__/unit/ui/RowControls.tsx +112 -141
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +18 -15
- package/src/__tests__/unit/undo-redo.ts +10 -9
- package/src/{plugins/table/__tests__ → __tests__}/unit/utils/collapse.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/utils/column-controls.ts +1 -1
- package/src/__tests__/unit/utils/nodes.ts +8 -4
- package/src/__tests__/unit/utils/row-controls.ts +8 -4
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__fixtures__/table-with-100-numbered-list-items.json +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-should-remove-the-table-column-on-click-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-column-menu-item-visual-hints-should-be-added-to-the-table-column-on-hover-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-should-remove-the-table-row-on-click-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/cell-options-menu-ts-table-cell-options-menu-delete-row-menu-item-visual-hints-should-be-added-to-the-table-row-on-hover-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/copy-button-ts-floating-toolbar-copy-button-table-target-node-displays-blue-border-when-copy-button-is-hovered-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-1-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-2-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/__image_snapshots__/index-ts-snapshot-test-table-numbered-list-should-not-overflow-table-cell-when-there-are-more-than-100-ordered-list-items-3-snap.png +0 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/cell-options-menu.ts +2 -0
- package/src/__tests__/visual-regression/copy-button.ts +181 -0
- package/src/{plugins/table/__tests__ → __tests__}/visual-regression/index.ts +3 -1
- package/src/plugins/table/commands/clear.ts +30 -29
- package/src/plugins/table/commands/go-to-next-cell.ts +41 -38
- package/src/plugins/table/commands/hover.ts +4 -1
- package/src/plugins/table/commands/insert.ts +91 -91
- package/src/plugins/table/commands/misc.ts +123 -125
- package/src/plugins/table/commands/selection.ts +329 -319
- package/src/plugins/table/commands-with-analytics.ts +299 -290
- package/src/plugins/table/event-handlers.ts +111 -112
- package/src/plugins/table/handlers.ts +95 -95
- package/src/plugins/table/index.tsx +28 -2
- package/src/plugins/table/nodeviews/OverflowShadowsObserver.ts +4 -3
- package/src/plugins/table/nodeviews/TableComponent.tsx +6 -9
- package/src/plugins/table/nodeviews/update-overflow-shadows.ts +39 -39
- package/src/plugins/table/pm-plugins/decorations/utils/column-controls.ts +7 -9
- package/src/plugins/table/pm-plugins/decorations/utils/column-resizing.ts +30 -30
- package/src/plugins/table/pm-plugins/decorations/utils/compose-decorations.ts +7 -7
- package/src/plugins/table/pm-plugins/keymap.ts +1 -1
- package/src/plugins/table/pm-plugins/plugin-factory.ts +33 -33
- package/src/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.ts +6 -9
- package/src/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.ts +3 -2
- package/src/plugins/table/pm-plugins/table-local-id.ts +0 -2
- package/src/plugins/table/pm-plugins/table-resizing/commands.ts +98 -90
- package/src/plugins/table/pm-plugins/table-resizing/index.ts +1 -0
- package/src/plugins/table/pm-plugins/table-resizing/utils/dom.ts +46 -47
- package/src/plugins/table/{toolbar.ts → toolbar.tsx} +276 -101
- package/src/plugins/table/transforms/column-width.ts +143 -146
- package/src/plugins/table/transforms/delete-columns.ts +144 -142
- package/src/plugins/table/transforms/delete-rows.ts +110 -111
- package/src/plugins/table/transforms/fix-tables.ts +2 -3
- package/src/plugins/table/transforms/metadata.ts +9 -9
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +0 -1
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +20 -16
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +3 -3
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +2 -6
- package/src/plugins/table/ui/LayoutButton/index.tsx +4 -10
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +1 -0
- package/src/plugins/table/ui/common-styles.ts +1 -3
- package/src/plugins/table/utils/analytics.ts +24 -25
- package/src/plugins/table/utils/column-controls.ts +0 -1
- package/src/plugins/table/utils/decoration.ts +44 -5
- package/src/plugins/table/utils/dom.ts +3 -5
- package/src/plugins/table/utils/paste.ts +0 -1
- package/src/plugins/table/utils/row-controls.ts +92 -94
- package/types/package.json +5 -5
- package/ui/common-styles/package.json +14 -0
- package/ui/consts/package.json +14 -0
- package/dist/cjs/plugins/plugin-key.js +0 -17
- package/dist/cjs/plugins/table/todo-stubs.js +0 -10
- package/dist/cjs/types.js +0 -5
- package/dist/es2019/plugins/plugin-key.js +0 -3
- package/dist/es2019/plugins/table/todo-stubs.js +0 -1
- package/dist/es2019/types.js +0 -1
- package/dist/esm/plugins/plugin-key.js +0 -5
- package/dist/esm/plugins/table/todo-stubs.js +0 -1
- package/dist/esm/types.js +0 -1
- package/dist/types/plugins/plugin-key.d.ts +0 -4
- package/dist/types/plugins/table/todo-stubs.d.ts +0 -1
- package/dist/types/types.d.ts +0 -3
- package/dist/types-ts4.0/index.d.ts +0 -1
- package/dist/types-ts4.0/plugins/plugin-key.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/commands/clear.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/commands/collapse.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/commands/go-to-next-cell.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/commands/hover.d.ts +0 -8
- package/dist/types-ts4.0/plugins/table/commands/index.d.ts +0 -7
- package/dist/types-ts4.0/plugins/table/commands/insert.d.ts +0 -10
- package/dist/types-ts4.0/plugins/table/commands/misc.d.ts +0 -27
- package/dist/types-ts4.0/plugins/table/commands/selection.d.ts +0 -8
- package/dist/types-ts4.0/plugins/table/commands/sort.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/commands/split-cell.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/commands/toggle.d.ts +0 -12
- package/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +0 -26
- package/dist/types-ts4.0/plugins/table/create-plugin-config.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/event-handlers.d.ts +0 -16
- package/dist/types-ts4.0/plugins/table/handlers.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/index.d.ts +0 -17
- package/dist/types-ts4.0/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +0 -26
- package/dist/types-ts4.0/plugins/table/nodeviews/TableComponent.d.ts +0 -72
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +0 -9
- package/dist/types-ts4.0/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +0 -9
- package/dist/types-ts4.0/plugins/table/nodeviews/table.d.ts +0 -31
- package/dist/types-ts4.0/plugins/table/nodeviews/tableCell.d.ts +0 -19
- package/dist/types-ts4.0/plugins/table/nodeviews/types.d.ts +0 -24
- package/dist/types-ts4.0/plugins/table/nodeviews/update-overflow-shadows.d.ts +0 -8
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/plugin.d.ts +0 -7
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/index.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/decorations/utils/types.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/pm-plugins/default-table-selection.d.ts +0 -5
- package/dist/types-ts4.0/plugins/table/pm-plugins/keymap.d.ts +0 -5
- package/dist/types-ts4.0/plugins/table/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-factory.d.ts +0 -1
- package/dist/types-ts4.0/plugins/table/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +0 -15
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/commands.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/index.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +0 -65
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/types.d.ts +0 -16
- package/dist/types-ts4.0/plugins/table/pm-plugins/sticky-headers/util.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-local-id.d.ts +0 -22
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/commands.d.ts +0 -25
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/plugin.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/reducer.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +0 -8
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +0 -14
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +0 -13
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +0 -12
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +0 -22
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +0 -29
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +0 -17
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +0 -22
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +0 -1
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-selection-keymap.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/reducer.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +0 -1
- package/dist/types-ts4.0/plugins/table/toolbar.d.ts +0 -36
- package/dist/types-ts4.0/plugins/table/transforms/column-width.d.ts +0 -18
- package/dist/types-ts4.0/plugins/table/transforms/delete-columns.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/transforms/delete-rows.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +0 -10
- package/dist/types-ts4.0/plugins/table/transforms/index.d.ts +0 -7
- package/dist/types-ts4.0/plugins/table/transforms/merge.d.ts +0 -5
- package/dist/types-ts4.0/plugins/table/transforms/metadata.d.ts +0 -21
- package/dist/types-ts4.0/plugins/table/transforms/replace-table.d.ts +0 -5
- package/dist/types-ts4.0/plugins/table/transforms/split.d.ts +0 -9
- package/dist/types-ts4.0/plugins/table/types.d.ts +0 -328
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/index.d.ts +0 -29
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualButton/styles.d.ts +0 -1
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +0 -87
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/index.d.ts +0 -22
- package/dist/types-ts4.0/plugins/table/ui/FloatingContextualMenu/styles.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +0 -14
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +0 -10
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/index.d.ts +0 -54
- package/dist/types-ts4.0/plugins/table/ui/FloatingDeleteButton/types.d.ts +0 -1
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +0 -12
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +0 -3
- package/dist/types-ts4.0/plugins/table/ui/FloatingInsertButton/index.d.ts +0 -35
- package/dist/types-ts4.0/plugins/table/ui/LayoutButton/index.d.ts +0 -21
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +0 -16
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +0 -21
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +0 -17
- package/dist/types-ts4.0/plugins/table/ui/TableFloatingControls/index.d.ts +0 -40
- package/dist/types-ts4.0/plugins/table/ui/common-styles.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/ui/consts.d.ts +0 -39
- package/dist/types-ts4.0/plugins/table/ui/messages.d.ts +0 -38
- package/dist/types-ts4.0/plugins/table/ui/ui-styles.d.ts +0 -15
- package/dist/types-ts4.0/plugins/table/utils/analytics.d.ts +0 -18
- package/dist/types-ts4.0/plugins/table/utils/collapse.d.ts +0 -29
- package/dist/types-ts4.0/plugins/table/utils/column-controls.d.ts +0 -10
- package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +0 -16
- package/dist/types-ts4.0/plugins/table/utils/dom.d.ts +0 -20
- package/dist/types-ts4.0/plugins/table/utils/get-allow-add-column-custom-step.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/utils/index.d.ts +0 -11
- package/dist/types-ts4.0/plugins/table/utils/nodes.d.ts +0 -12
- package/dist/types-ts4.0/plugins/table/utils/paste.d.ts +0 -14
- package/dist/types-ts4.0/plugins/table/utils/referentiality.d.ts +0 -2
- package/dist/types-ts4.0/plugins/table/utils/row-controls.d.ts +0 -16
- package/dist/types-ts4.0/plugins/table/utils/selection.d.ts +0 -6
- package/dist/types-ts4.0/plugins/table/utils/table.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/utils/update-plugin-state-decorations.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table-plugin.d.ts +0 -2
- package/dist/types-ts4.0/types.d.ts +0 -3
- package/src/plugins/plugin-key.ts +0 -7
- package/src/plugins/table/__tests__/integration/table-controls-selection.ts +0 -70
- package/src/plugins/table/__tests__/unit/event-handlers.ts +0 -130
- package/src/plugins/table/__tests__/unit/nodeviews/TableComponent.tsx +0 -388
- package/src/plugins/table/todo-stubs.ts +0 -1
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/ContextualMenu.tsx +0 -55
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/FloatingContextualMenu.tsx +0 -49
- package/src/types.ts +0 -3
- package/tmp/api-report-tmp.d.ts +0 -91
|
@@ -9,6 +9,8 @@ exports.messages = exports.getToolbarMenuConfig = exports.getToolbarConfig = exp
|
|
|
9
9
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
11
|
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
12
14
|
var _reactIntlNext = require("react-intl-next");
|
|
13
15
|
|
|
14
16
|
var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
|
|
@@ -25,11 +27,13 @@ var _tableResizing = require("./pm-plugins/table-resizing");
|
|
|
25
27
|
|
|
26
28
|
var _types = require("./types");
|
|
27
29
|
|
|
30
|
+
var _utils = require("./utils");
|
|
31
|
+
|
|
28
32
|
var _referentiality = require("./utils/referentiality");
|
|
29
33
|
|
|
30
34
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
31
35
|
|
|
32
|
-
var
|
|
36
|
+
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
33
37
|
|
|
34
38
|
var _transforms = require("./transforms");
|
|
35
39
|
|
|
@@ -39,8 +43,19 @@ var _ContextualMenu = require("./ui/FloatingContextualMenu/ContextualMenu");
|
|
|
39
43
|
|
|
40
44
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
41
45
|
|
|
42
|
-
var
|
|
46
|
+
var _utils3 = require("@atlaskit/editor-common/utils");
|
|
47
|
+
|
|
48
|
+
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
49
|
+
|
|
50
|
+
var _resizeState = require("./pm-plugins/table-resizing/utils/resize-state");
|
|
51
|
+
|
|
52
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
43
53
|
|
|
54
|
+
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
55
|
+
|
|
56
|
+
var _uiColor = require("@atlaskit/editor-common/ui-color");
|
|
57
|
+
|
|
58
|
+
/** @jsx jsx */
|
|
44
59
|
var messages = (0, _reactIntlNext.defineMessages)({
|
|
45
60
|
tableOptions: {
|
|
46
61
|
id: 'fabric.editor.tableOptions',
|
|
@@ -115,6 +130,8 @@ var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, ed
|
|
|
115
130
|
exports.getToolbarMenuConfig = getToolbarMenuConfig;
|
|
116
131
|
|
|
117
132
|
var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorState, initialSelectionRect, _ref2, getEditorContainerWidth, editorAnalyticsAPI) {
|
|
133
|
+
var _pluginState$pluginCo, _pluginState$pluginCo2;
|
|
134
|
+
|
|
118
135
|
var formatMessage = _ref2.formatMessage;
|
|
119
136
|
var top = initialSelectionRect.top,
|
|
120
137
|
bottom = initialSelectionRect.bottom,
|
|
@@ -122,6 +139,7 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
122
139
|
left = initialSelectionRect.left;
|
|
123
140
|
var numberOfColumns = right - left;
|
|
124
141
|
var numberOfRows = bottom - top;
|
|
142
|
+
var pluginState = (0, _pluginFactory.getPluginState)(editorState);
|
|
125
143
|
var options = [{
|
|
126
144
|
id: 'editor.table.insertColumn',
|
|
127
145
|
title: formatMessage(_messages2.default.insertColumn),
|
|
@@ -136,7 +154,10 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
136
154
|
return true;
|
|
137
155
|
},
|
|
138
156
|
selected: false,
|
|
139
|
-
disabled: false
|
|
157
|
+
disabled: false,
|
|
158
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
159
|
+
css: _shortcut.shortcutStyle
|
|
160
|
+
}, (0, _keymaps.tooltip)(_keymaps.addColumnAfter))
|
|
140
161
|
}, {
|
|
141
162
|
id: 'editor.table.insertRow',
|
|
142
163
|
title: formatMessage(_messages2.default.insertRow),
|
|
@@ -154,7 +175,10 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
154
175
|
return true;
|
|
155
176
|
},
|
|
156
177
|
selected: false,
|
|
157
|
-
disabled: false
|
|
178
|
+
disabled: false,
|
|
179
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
180
|
+
css: _shortcut.shortcutStyle
|
|
181
|
+
}, (0, _keymaps.tooltip)(_keymaps.addRowAfter))
|
|
158
182
|
}, {
|
|
159
183
|
id: 'editor.table.removeColumns',
|
|
160
184
|
title: formatMessage(_messages2.default.removeColumns, {
|
|
@@ -190,16 +214,63 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
190
214
|
}, {
|
|
191
215
|
id: 'editor.table.mergeCells',
|
|
192
216
|
title: formatMessage(_ContextualMenu.messages.mergeCells),
|
|
193
|
-
onClick: (0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI),
|
|
217
|
+
onClick: (0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB),
|
|
194
218
|
selected: false,
|
|
195
219
|
disabled: !(0, _transforms.canMergeCells)(editorState.tr)
|
|
196
220
|
}, {
|
|
197
221
|
id: 'editor.table.splitCell',
|
|
198
222
|
title: formatMessage(_ContextualMenu.messages.splitCell),
|
|
199
|
-
onClick: (0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI),
|
|
223
|
+
onClick: (0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB),
|
|
200
224
|
selected: false,
|
|
201
|
-
disabled: !(0,
|
|
202
|
-
}
|
|
225
|
+
disabled: !(0, _utils2.splitCell)(editorState)
|
|
226
|
+
}];
|
|
227
|
+
|
|
228
|
+
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo = pluginState.pluginConfig) !== null && _pluginState$pluginCo !== void 0 && _pluginState$pluginCo.allowDistributeColumns) {
|
|
229
|
+
var distributeColumnWidths = function distributeColumnWidths(state, dispatch, view) {
|
|
230
|
+
var newResizeStateWithAnalytics = view ? (0, _resizeState.getNewResizeStateFromSelectedColumns)(initialSelectionRect, editorState, view.domAtPos.bind(view), getEditorContainerWidth) : undefined;
|
|
231
|
+
|
|
232
|
+
if (newResizeStateWithAnalytics) {
|
|
233
|
+
(0, _commandsWithAnalytics.distributeColumnsWidthsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, newResizeStateWithAnalytics)(state, dispatch);
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return false;
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
options.push({
|
|
241
|
+
id: 'editor.table.distributeColumns',
|
|
242
|
+
title: formatMessage(_ContextualMenu.messages.distributeColumns),
|
|
243
|
+
onClick: distributeColumnWidths,
|
|
244
|
+
selected: false,
|
|
245
|
+
disabled: numberOfColumns <= 1
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo2 = pluginState.pluginConfig) !== null && _pluginState$pluginCo2 !== void 0 && _pluginState$pluginCo2.allowColumnSorting) {
|
|
250
|
+
var hasMergedCellsInTable = (0, _utils.getMergedCellsPositions)(editorState.tr).length > 0;
|
|
251
|
+
options.push({
|
|
252
|
+
id: 'editor.table.sortColumnAsc',
|
|
253
|
+
title: formatMessage(_ContextualMenu.messages.sortColumnASC),
|
|
254
|
+
onClick: function onClick(state, dispatch) {
|
|
255
|
+
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, initialSelectionRect.left, _steps.TableSortOrder.ASC)(state, dispatch);
|
|
256
|
+
return true;
|
|
257
|
+
},
|
|
258
|
+
selected: false,
|
|
259
|
+
disabled: hasMergedCellsInTable
|
|
260
|
+
});
|
|
261
|
+
options.push({
|
|
262
|
+
id: 'editor.table.sortColumnDesc',
|
|
263
|
+
title: formatMessage(_ContextualMenu.messages.sortColumnDESC),
|
|
264
|
+
onClick: function onClick(state, dispatch) {
|
|
265
|
+
(0, _commandsWithAnalytics.sortColumnWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, initialSelectionRect.left, _steps.TableSortOrder.DESC)(state, dispatch);
|
|
266
|
+
return true;
|
|
267
|
+
},
|
|
268
|
+
selected: false,
|
|
269
|
+
disabled: hasMergedCellsInTable
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
options.push({
|
|
203
274
|
id: 'editor.table.clearCells',
|
|
204
275
|
title: formatMessage(_ContextualMenu.messages.clearCells, {
|
|
205
276
|
0: Math.max(numberOfColumns, numberOfRows)
|
|
@@ -212,14 +283,19 @@ var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(editorSta
|
|
|
212
283
|
return true;
|
|
213
284
|
},
|
|
214
285
|
selected: false,
|
|
215
|
-
disabled: false
|
|
216
|
-
|
|
286
|
+
disabled: false,
|
|
287
|
+
elemAfter: (0, _react.jsx)("div", {
|
|
288
|
+
css: _shortcut.shortcutStyle
|
|
289
|
+
}, (0, _keymaps.tooltip)(_keymaps.backspace))
|
|
290
|
+
});
|
|
217
291
|
return {
|
|
218
292
|
id: 'editor.table.cellOptions',
|
|
219
293
|
type: 'dropdown',
|
|
220
294
|
title: formatMessage(_messages2.default.cellOptions),
|
|
221
|
-
|
|
222
|
-
|
|
295
|
+
options: options,
|
|
296
|
+
// Increased dropdown item width to prevent labels from being truncated
|
|
297
|
+
dropdownWidth: 230,
|
|
298
|
+
showSelected: false
|
|
223
299
|
};
|
|
224
300
|
};
|
|
225
301
|
|
|
@@ -227,13 +303,13 @@ exports.getToolbarCellOptionsConfig = getToolbarCellOptionsConfig;
|
|
|
227
303
|
|
|
228
304
|
var getClosestSelectionRect = function getClosestSelectionRect(state) {
|
|
229
305
|
var selection = state.selection;
|
|
230
|
-
return (0,
|
|
306
|
+
return (0, _utils2.isSelectionType)(selection, 'cell') ? (0, _utils2.getSelectionRect)(selection) : (0, _utils2.findCellRectClosestToPos)(selection.$from);
|
|
231
307
|
};
|
|
232
308
|
|
|
233
|
-
var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
309
|
+
var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags) {
|
|
234
310
|
return function (config) {
|
|
235
311
|
return function (state, intl) {
|
|
236
|
-
var tableObject = (0,
|
|
312
|
+
var tableObject = (0, _utils2.findTable)(state.selection);
|
|
237
313
|
var pluginState = (0, _pluginFactory.getPluginState)(state);
|
|
238
314
|
|
|
239
315
|
var resizeState = _tableResizing.pluginKey.getState(state);
|
|
@@ -241,7 +317,12 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
241
317
|
if (tableObject && pluginState.editorHasFocus) {
|
|
242
318
|
var nodeType = state.schema.nodes.table;
|
|
243
319
|
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
|
|
244
|
-
|
|
320
|
+
|
|
321
|
+
var _ref3 = getEditorFeatureFlags() || {},
|
|
322
|
+
tableCellOptionsInFloatingToolbar = _ref3.tableCellOptionsInFloatingToolbar;
|
|
323
|
+
|
|
324
|
+
var cellItems = getCellItems(config, state, intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar);
|
|
325
|
+
var colorPicker = getColorPicker(state, menu, intl, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar); // Check if we need to show confirm dialog for delete button
|
|
245
326
|
|
|
246
327
|
var confirmDialog;
|
|
247
328
|
var localId = tableObject.node.attrs.localId;
|
|
@@ -262,7 +343,7 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
262
343
|
var tableRef = parent.querySelector('table') || undefined;
|
|
263
344
|
|
|
264
345
|
if (tableRef) {
|
|
265
|
-
element = (0,
|
|
346
|
+
element = (0, _utils3.closestElement)(tableRef, ".".concat(_types.TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
|
|
266
347
|
}
|
|
267
348
|
}
|
|
268
349
|
|
|
@@ -274,9 +355,20 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
274
355
|
getDomRef: getDomRef,
|
|
275
356
|
nodeType: nodeType,
|
|
276
357
|
offset: [0, 3],
|
|
277
|
-
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(cellItems), [{
|
|
358
|
+
items: [menu, separator(menu.hidden)].concat((0, _toConsumableArray2.default)(cellItems), (0, _toConsumableArray2.default)(colorPicker), [{
|
|
278
359
|
type: 'extensions-placeholder',
|
|
279
360
|
separator: 'end'
|
|
361
|
+
}, {
|
|
362
|
+
type: 'copy-button',
|
|
363
|
+
items: [{
|
|
364
|
+
state: state,
|
|
365
|
+
formatMessage: intl.formatMessage,
|
|
366
|
+
nodeType: nodeType,
|
|
367
|
+
onMouseEnter: (0, _commands.hoverTable)(false, true),
|
|
368
|
+
onMouseLeave: (0, _commands.clearHoverSelection)()
|
|
369
|
+
}, {
|
|
370
|
+
type: 'separator'
|
|
371
|
+
}]
|
|
280
372
|
}, {
|
|
281
373
|
id: 'editor.table.delete',
|
|
282
374
|
type: 'button',
|
|
@@ -288,7 +380,8 @@ var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editor
|
|
|
288
380
|
onMouseLeave: (0, _commands.clearHoverSelection)(),
|
|
289
381
|
title: intl.formatMessage(_messages.default.remove),
|
|
290
382
|
confirmDialog: confirmDialog
|
|
291
|
-
}])
|
|
383
|
+
}]),
|
|
384
|
+
scrollable: true
|
|
292
385
|
};
|
|
293
386
|
}
|
|
294
387
|
|
|
@@ -306,10 +399,10 @@ var separator = function separator(hidden) {
|
|
|
306
399
|
};
|
|
307
400
|
};
|
|
308
401
|
|
|
309
|
-
var getCellItems = function getCellItems(pluginConfig, state,
|
|
310
|
-
var formatMessage =
|
|
402
|
+
var getCellItems = function getCellItems(pluginConfig, state, _ref4, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
|
|
403
|
+
var formatMessage = _ref4.formatMessage;
|
|
311
404
|
|
|
312
|
-
if (pluginConfig.allowCellOptionsInFloatingToolbar) {
|
|
405
|
+
if (pluginConfig.allowCellOptionsInFloatingToolbar || tableCellOptionsInFloatingToolbar) {
|
|
313
406
|
var initialSelectionRect = getClosestSelectionRect(state);
|
|
314
407
|
|
|
315
408
|
if (initialSelectionRect) {
|
|
@@ -321,4 +414,39 @@ var getCellItems = function getCellItems(pluginConfig, state, _ref3, getEditorCo
|
|
|
321
414
|
}
|
|
322
415
|
|
|
323
416
|
return [];
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
var getColorPicker = function getColorPicker(state, menu, _ref5, getEditorContainerWidth, editorAnalyticsAPI, tableCellOptionsInFloatingToolbar) {
|
|
420
|
+
var _node$attrs;
|
|
421
|
+
|
|
422
|
+
var formatMessage = _ref5.formatMessage;
|
|
423
|
+
|
|
424
|
+
var _getPluginState2 = (0, _pluginFactory.getPluginState)(state),
|
|
425
|
+
targetCellPosition = _getPluginState2.targetCellPosition,
|
|
426
|
+
pluginConfig = _getPluginState2.pluginConfig;
|
|
427
|
+
|
|
428
|
+
if (!pluginConfig.allowBackgroundColor || !tableCellOptionsInFloatingToolbar) {
|
|
429
|
+
return [];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
var node = targetCellPosition ? state.doc.nodeAt(targetCellPosition) : undefined;
|
|
433
|
+
var currentBackground = (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.background) || '#ffffff';
|
|
434
|
+
var defaultPalette = _uiColor.cellBackgroundColorPalette.find(function (item) {
|
|
435
|
+
return item.value === currentBackground;
|
|
436
|
+
}) || {
|
|
437
|
+
label: 'Custom',
|
|
438
|
+
value: currentBackground,
|
|
439
|
+
border: _uiColor.DEFAULT_BORDER_COLOR
|
|
440
|
+
};
|
|
441
|
+
return [{
|
|
442
|
+
id: 'editor.panel.colorPicker',
|
|
443
|
+
title: formatMessage(_ContextualMenu.messages.cellBackground),
|
|
444
|
+
type: 'select',
|
|
445
|
+
selectType: 'color',
|
|
446
|
+
defaultValue: defaultPalette,
|
|
447
|
+
options: _uiColor.cellBackgroundColorPalette,
|
|
448
|
+
onChange: function onChange(option) {
|
|
449
|
+
return (0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.FLOATING_TB, option.value, targetCellPosition);
|
|
450
|
+
}
|
|
451
|
+
}, separator(menu.hidden)];
|
|
324
452
|
};
|
|
@@ -13,9 +13,9 @@ var _styles = require("@atlaskit/editor-common/styles");
|
|
|
13
13
|
|
|
14
14
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _utils2 = require("../pm-plugins/table-resizing/utils");
|
|
19
19
|
|
|
20
20
|
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; }
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
23
23
|
|
|
24
24
|
var fireAnalytics = function fireAnalytics() {
|
|
25
25
|
var properties = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
|
-
return (0,
|
|
26
|
+
return (0, _utils.sendLogs)({
|
|
27
27
|
events: [{
|
|
28
28
|
name: 'atlaskit.fabric.editor.fixtable',
|
|
29
29
|
product: 'atlaskit',
|
|
@@ -146,7 +146,7 @@ var fixAutoSizedTable = function fixAutoSizedTable(view, tableNode, tableRef, ta
|
|
|
146
146
|
return acc + current;
|
|
147
147
|
}, 0);
|
|
148
148
|
var tableLayout = getLayoutBasedOnWidth(totalContentWidth);
|
|
149
|
-
var maxLayoutSize = (0,
|
|
149
|
+
var maxLayoutSize = (0, _utils2.getLayoutSize)(tableLayout, opts.containerWidth, {}); // Content width will generally not meet the constraints of the layout
|
|
150
150
|
// whether it be below or above, so we scale our columns widths
|
|
151
151
|
// to meet these requirements
|
|
152
152
|
|
|
@@ -199,9 +199,9 @@ function parseDOMColumnWidths(domAtPos, tableNode, tableStart, tableRef) {
|
|
|
199
199
|
|
|
200
200
|
for (var span = 0; span < colspan; span++) {
|
|
201
201
|
var colIdx = col + span;
|
|
202
|
-
var cells = (0,
|
|
203
|
-
var colWidth = (0,
|
|
204
|
-
return (0,
|
|
202
|
+
var cells = (0, _utils2.getCellsRefsInColumn)(colIdx, tableNode, tableStart, domAtPos);
|
|
203
|
+
var colWidth = (0, _utils2.calculateColumnWidth)(cells, function (_, col) {
|
|
204
|
+
return (0, _utils2.contentWidth)(col, tableRef).width;
|
|
205
205
|
});
|
|
206
206
|
cols[colIdx] = Math.max(colWidth, _styles.tableCellMinWidth);
|
|
207
207
|
}
|
|
@@ -175,8 +175,7 @@ var FloatingContextualButtonInner = /*#__PURE__*/function (_React$Component) {
|
|
|
175
175
|
key: "shouldComponentUpdate",
|
|
176
176
|
value: function shouldComponentUpdate(nextProps) {
|
|
177
177
|
return this.props.tableNode !== nextProps.tableNode || this.props.targetCellPosition !== nextProps.targetCellPosition || this.props.layout !== nextProps.layout || this.props.isContextualMenuOpen !== nextProps.isContextualMenuOpen || this.props.isNumberColumnEnabled !== nextProps.isNumberColumnEnabled || this.props.stickyHeader !== nextProps.stickyHeader;
|
|
178
|
-
}
|
|
179
|
-
|
|
178
|
+
}
|
|
180
179
|
}]);
|
|
181
180
|
return FloatingContextualButtonInner;
|
|
182
181
|
}(_react.default.Component);
|
|
@@ -326,14 +326,14 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
326
326
|
break;
|
|
327
327
|
|
|
328
328
|
case 'merge':
|
|
329
|
-
(0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(state, dispatch);
|
|
329
|
+
(0, _commandsWithAnalytics.mergeCellsWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
330
330
|
|
|
331
331
|
_this.toggleOpen();
|
|
332
332
|
|
|
333
333
|
break;
|
|
334
334
|
|
|
335
335
|
case 'split':
|
|
336
|
-
(0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(state, dispatch);
|
|
336
|
+
(0, _commandsWithAnalytics.splitCellWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU)(state, dispatch);
|
|
337
337
|
|
|
338
338
|
_this.toggleOpen();
|
|
339
339
|
|
|
@@ -474,10 +474,8 @@ var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
474
474
|
targetCellPosition = _getPluginState4.targetCellPosition;
|
|
475
475
|
|
|
476
476
|
var state = editorView.state,
|
|
477
|
-
dispatch = editorView.dispatch;
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
(0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(color, targetCellPosition)(state, dispatch);
|
|
477
|
+
dispatch = editorView.dispatch;
|
|
478
|
+
(0, _commandsWithAnalytics.setColorWithAnalytics)(editorAnalyticsAPI)(_analytics.INPUT_METHOD.CONTEXT_MENU, color, targetCellPosition)(state, dispatch);
|
|
481
479
|
|
|
482
480
|
_this.toggleOpen();
|
|
483
481
|
});
|
|
@@ -154,7 +154,8 @@ var FloatingDeleteButton = /*#__PURE__*/function (_Component) {
|
|
|
154
154
|
dispatch = _this$props$editorVie2.dispatch;
|
|
155
155
|
return (0, _commands.clearHoverSelection)()(state, dispatch);
|
|
156
156
|
});
|
|
157
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function () {
|
|
157
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function (event) {
|
|
158
|
+
event.preventDefault();
|
|
158
159
|
var editorAnalyticsAPI = _this.props.editorAnalyticsAPI;
|
|
159
160
|
var _this$props$editorVie3 = _this.props.editorView,
|
|
160
161
|
state = _this$props$editorVie3.state,
|
|
@@ -154,8 +154,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
154
154
|
}, {
|
|
155
155
|
key: "renderSticky",
|
|
156
156
|
value: function renderSticky(button, targetRef, tableRef) {
|
|
157
|
-
|
|
158
|
-
var title = 'TODO MISSING TITLE';
|
|
157
|
+
var title = this.getTitle();
|
|
159
158
|
|
|
160
159
|
if (!(targetRef instanceof HTMLElement) || !(tableRef instanceof HTMLElement)) {
|
|
161
160
|
return null;
|
|
@@ -184,10 +183,9 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
|
|
|
184
183
|
|
|
185
184
|
if (!targetRef) {
|
|
186
185
|
return null;
|
|
187
|
-
}
|
|
188
|
-
|
|
186
|
+
}
|
|
189
187
|
|
|
190
|
-
var title =
|
|
188
|
+
var title = this.getTitle();
|
|
191
189
|
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
192
190
|
ariaLabel: title,
|
|
193
191
|
target: targetRef,
|
|
@@ -125,7 +125,8 @@ var CornerControlComponent = /*#__PURE__*/function (_Component) {
|
|
|
125
125
|
}),
|
|
126
126
|
style: {
|
|
127
127
|
top: this.props.stickyTop !== undefined ? "".concat(this.props.stickyTop, "px") : undefined
|
|
128
|
-
}
|
|
128
|
+
},
|
|
129
|
+
contentEditable: false
|
|
129
130
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
130
131
|
"aria-label": formatMessage(messages.cornerControl),
|
|
131
132
|
type: "button",
|
|
@@ -23,7 +23,6 @@ var _types = require("../types");
|
|
|
23
23
|
|
|
24
24
|
var _consts = require("../ui/consts");
|
|
25
25
|
|
|
26
|
-
// import { maphElem } from '@atlaskit/editor-core/src/utils/dom';
|
|
27
26
|
var getColumnsWidths = function getColumnsWidths(view) {
|
|
28
27
|
var selection = view.state.selection;
|
|
29
28
|
var widths = [];
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.updateDecorations = exports.findControlsHoverDecoration = exports.findColumnControlSelectedDecoration = exports.createResizeHandleDecoration = exports.createControlsHoverDecoration = exports.createColumnSelectedDecoration = exports.createColumnLineResize = exports.createColumnControlsDecoration = exports.createCellHoverDecoration = void 0;
|
|
7
9
|
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
8
12
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
9
13
|
|
|
10
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
@@ -15,7 +19,6 @@ var _utils2 = require("@atlaskit/editor-common/utils");
|
|
|
15
19
|
|
|
16
20
|
var _types = require("../types");
|
|
17
21
|
|
|
18
|
-
// import { nonNullable } from '@atlaskit/editor-core/src/utils';
|
|
19
22
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
20
23
|
return decorationSet.find(undefined, undefined, function (spec) {
|
|
21
24
|
return spec.key.indexOf(key) > -1;
|
|
@@ -46,8 +49,54 @@ var createCellHoverDecoration = function createCellHoverDecoration(cells, type)
|
|
|
46
49
|
|
|
47
50
|
exports.createCellHoverDecoration = createCellHoverDecoration;
|
|
48
51
|
|
|
49
|
-
var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, danger, selected) {
|
|
50
|
-
|
|
52
|
+
var createControlsHoverDecoration = function createControlsHoverDecoration(cells, type, tr, danger, selected) {
|
|
53
|
+
var table = (0, _utils.findTable)(tr.selection);
|
|
54
|
+
|
|
55
|
+
if (!table) {
|
|
56
|
+
return [];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
var map = _tableMap.TableMap.get(table.node);
|
|
60
|
+
|
|
61
|
+
var _cells$reduce = cells.reduce(function (_ref, cell) {
|
|
62
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
63
|
+
min = _ref2[0],
|
|
64
|
+
max = _ref2[1];
|
|
65
|
+
|
|
66
|
+
if (min === null || cell.pos < min) {
|
|
67
|
+
min = cell.pos;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (max === null || cell.pos > max) {
|
|
71
|
+
max = cell.pos;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return [min, max];
|
|
75
|
+
}, [null, null]),
|
|
76
|
+
_cells$reduce2 = (0, _slicedToArray2.default)(_cells$reduce, 2),
|
|
77
|
+
min = _cells$reduce2[0],
|
|
78
|
+
max = _cells$reduce2[1];
|
|
79
|
+
|
|
80
|
+
if (min === null || max === null) {
|
|
81
|
+
return [];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
var updatedCells = cells.map(function (x) {
|
|
85
|
+
return x.pos;
|
|
86
|
+
}); // ED-15246 fixed trello card table overflow issue
|
|
87
|
+
// If columns / rows have been merged the hovered selection is different to the actual selection
|
|
88
|
+
// So If the table cells are in danger we want to create a "rectangle" selection
|
|
89
|
+
// to match the "clicked" selection
|
|
90
|
+
|
|
91
|
+
if (danger) {
|
|
92
|
+
var rect = map.rectBetween(min - table.start, max - table.start);
|
|
93
|
+
updatedCells = map.cellsInRect(rect).map(function (x) {
|
|
94
|
+
return x + table.start;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return updatedCells.map(function (pos) {
|
|
99
|
+
var cell = tr.doc.nodeAt(pos);
|
|
51
100
|
var classes = [_types.TableCssClassName.HOVERED_CELL];
|
|
52
101
|
|
|
53
102
|
if (danger) {
|
|
@@ -75,7 +124,7 @@ var createControlsHoverDecoration = function createControlsHoverDecoration(cells
|
|
|
75
124
|
break;
|
|
76
125
|
}
|
|
77
126
|
|
|
78
|
-
return _prosemirrorView.Decoration.node(
|
|
127
|
+
return _prosemirrorView.Decoration.node(pos, pos + cell.nodeSize, {
|
|
79
128
|
class: classes.join(' ')
|
|
80
129
|
}, {
|
|
81
130
|
key: key
|
|
@@ -11,8 +11,6 @@ var _types = require("../types");
|
|
|
11
11
|
|
|
12
12
|
var _consts = require("../ui/consts");
|
|
13
13
|
|
|
14
|
-
// import { containsClassName } from '@atlaskit/editor-core/src/utils';
|
|
15
|
-
// import { closestElement } from '@atlaskit/editor-core/src/utils/dom';
|
|
16
14
|
var SELECTOR_TABLE_LEAFS = ".".concat(_types.TableCssClassName.TABLE_CELL, ", .").concat(_types.TableCssClassName.TABLE_HEADER_CELL);
|
|
17
15
|
|
|
18
16
|
var isCell = function isCell(node) {
|
|
@@ -18,7 +18,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
18
18
|
|
|
19
19
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
20
20
|
|
|
21
|
-
// import { flatmap, mapSlice } from '@atlaskit/editor-core/src/utils/slice';
|
|
22
21
|
// lifts up the content of each cell, returning an array of nodes
|
|
23
22
|
var unwrapContentFromTable = function unwrapContentFromTable(maybeTable) {
|
|
24
23
|
var schema = maybeTable.type.schema;
|
package/dist/cjs/version.json
CHANGED
|
@@ -37,13 +37,13 @@ export const hoverMergedCells = () => createCommand(state => {
|
|
|
37
37
|
};
|
|
38
38
|
}, tr => tr.setMeta('addToHistory', false));
|
|
39
39
|
export const hoverColumns = (hoveredColumns, isInDanger) => createCommand(state => {
|
|
40
|
-
const cells = getCellsInColumn(hoveredColumns)(state.selection);
|
|
40
|
+
const cells = getCellsInColumn(hoveredColumns)(state.tr.selection);
|
|
41
41
|
|
|
42
42
|
if (!cells) {
|
|
43
43
|
return false;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
const decorations = createControlsHoverDecoration(cells, 'column', isInDanger);
|
|
46
|
+
const decorations = createControlsHoverDecoration(cells, 'column', state.tr, isInDanger);
|
|
47
47
|
return {
|
|
48
48
|
type: 'HOVER_COLUMNS',
|
|
49
49
|
data: {
|
|
@@ -60,7 +60,7 @@ export const hoverRows = (hoveredRows, isInDanger) => createCommand(state => {
|
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
const decorations = createControlsHoverDecoration(cells, 'row', isInDanger);
|
|
63
|
+
const decorations = createControlsHoverDecoration(cells, 'row', state.tr, isInDanger);
|
|
64
64
|
return {
|
|
65
65
|
type: 'HOVER_ROWS',
|
|
66
66
|
data: {
|
|
@@ -86,7 +86,7 @@ export const hoverTable = (isInDanger, isSelected) => createCommand(state => {
|
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
-
const decorations = createControlsHoverDecoration(cells, 'table', isInDanger, isSelected);
|
|
89
|
+
const decorations = createControlsHoverDecoration(cells, 'table', state.tr, isInDanger, isSelected);
|
|
90
90
|
return {
|
|
91
91
|
type: 'HOVER_TABLE',
|
|
92
92
|
data: {
|
|
@@ -44,7 +44,7 @@ export const emptyMultipleCellsWithAnalytics = editorAnalyticsAPI => (inputMetho
|
|
|
44
44
|
eventType: EVENT_TYPE.TRACK
|
|
45
45
|
};
|
|
46
46
|
})(editorAnalyticsAPI)(clearMultipleCells(targetCellPosition));
|
|
47
|
-
export const mergeCellsWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsAPI(({
|
|
47
|
+
export const mergeCellsWithAnalytics = editorAnalyticsAPI => inputMethod => withEditorAnalyticsAPI(({
|
|
48
48
|
selection
|
|
49
49
|
}) => {
|
|
50
50
|
const {
|
|
@@ -59,8 +59,7 @@ export const mergeCellsWithAnalytics = editorAnalyticsAPI => withEditorAnalytics
|
|
|
59
59
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
60
60
|
actionSubjectId: null,
|
|
61
61
|
attributes: {
|
|
62
|
-
inputMethod
|
|
63
|
-
// TODO: merge with floating toolbar once command is updated
|
|
62
|
+
inputMethod,
|
|
64
63
|
horizontalCells,
|
|
65
64
|
verticalCells,
|
|
66
65
|
totalCells,
|
|
@@ -76,7 +75,7 @@ export const mergeCellsWithAnalytics = editorAnalyticsAPI => withEditorAnalytics
|
|
|
76
75
|
|
|
77
76
|
return true;
|
|
78
77
|
});
|
|
79
|
-
export const splitCellWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsAPI(({
|
|
78
|
+
export const splitCellWithAnalytics = editorAnalyticsAPI => inputMethod => withEditorAnalyticsAPI(({
|
|
80
79
|
selection
|
|
81
80
|
}) => {
|
|
82
81
|
const {
|
|
@@ -95,8 +94,7 @@ export const splitCellWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsA
|
|
|
95
94
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
96
95
|
actionSubjectId: null,
|
|
97
96
|
attributes: {
|
|
98
|
-
inputMethod
|
|
99
|
-
// TODO: merge with floating toolbar once command is updated
|
|
97
|
+
inputMethod,
|
|
100
98
|
horizontalCells,
|
|
101
99
|
verticalCells,
|
|
102
100
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -109,7 +107,7 @@ export const splitCellWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsA
|
|
|
109
107
|
|
|
110
108
|
return;
|
|
111
109
|
})(editorAnalyticsAPI)(splitCell);
|
|
112
|
-
export const setColorWithAnalytics = editorAnalyticsAPI => (cellColor, targetCellPosition) => withEditorAnalyticsAPI(({
|
|
110
|
+
export const setColorWithAnalytics = editorAnalyticsAPI => (inputMethod, cellColor, targetCellPosition) => withEditorAnalyticsAPI(({
|
|
113
111
|
selection
|
|
114
112
|
}) => {
|
|
115
113
|
const {
|
|
@@ -124,8 +122,7 @@ export const setColorWithAnalytics = editorAnalyticsAPI => (cellColor, targetCel
|
|
|
124
122
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
125
123
|
actionSubjectId: null,
|
|
126
124
|
attributes: {
|
|
127
|
-
inputMethod
|
|
128
|
-
// TODO: merge with floating toolbar once command is updated
|
|
125
|
+
inputMethod,
|
|
129
126
|
cellColor: (tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
|
|
130
127
|
horizontalCells,
|
|
131
128
|
verticalCells,
|
|
@@ -3,8 +3,7 @@ import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
|
3
3
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
4
4
|
import { cellAround, findCellRectClosestToPos, findTable, getSelectionRect, removeTable } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
6
|
-
import { isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
7
|
-
|
|
6
|
+
import { isElementInTableCell, isLastItemMediaGroup, setNodeSelection } from '@atlaskit/editor-common/utils';
|
|
8
7
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
9
8
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
10
9
|
import { addResizeHandleDecorations, clearHoverSelection, hideInsertColumnOrRowButton, hideResizeHandleLine, hoverColumns, selectColumn, setEditorFocus, showInsertColumnButton, showInsertRowButton, showResizeHandleLine } from './commands';
|