@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
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
isTableSelected,
|
|
11
11
|
} from '@atlaskit/editor-tables/utils';
|
|
12
12
|
|
|
13
|
-
// import { parsePx } from '@atlaskit/editor-core/src/utils/dom';
|
|
14
13
|
import { parsePx } from '@atlaskit/editor-common/utils';
|
|
15
14
|
import { TableCssClassName as ClassName } from '../types';
|
|
16
15
|
import { tableDeleteButtonSize } from '../ui/consts';
|
|
@@ -126,113 +125,112 @@ export const getRowClassNames = (
|
|
|
126
125
|
return classNames.join(' ');
|
|
127
126
|
};
|
|
128
127
|
|
|
129
|
-
export const copyPreviousRow =
|
|
130
|
-
insertNewRowIndex: number
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
export const copyPreviousRow =
|
|
129
|
+
(schema: Schema) => (insertNewRowIndex: number) => (tr: Transaction) => {
|
|
130
|
+
const table = findTable(tr.selection);
|
|
131
|
+
if (!table) {
|
|
132
|
+
return tr;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const map = TableMap.get(table.node);
|
|
136
|
+
const copyPreviousRowIndex = insertNewRowIndex - 1;
|
|
136
137
|
|
|
137
|
-
|
|
138
|
-
|
|
138
|
+
if (insertNewRowIndex <= 0) {
|
|
139
|
+
throw Error(
|
|
140
|
+
`Row Index less or equal 0 isn't not allowed since there is not a previous to copy`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (insertNewRowIndex > map.height) {
|
|
145
|
+
return tr;
|
|
146
|
+
}
|
|
139
147
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
const tableNode = table.node;
|
|
149
|
+
const {
|
|
150
|
+
nodes: { tableRow },
|
|
151
|
+
} = schema;
|
|
152
|
+
|
|
153
|
+
const cellsInRow = map.cellsInRect({
|
|
154
|
+
left: 0,
|
|
155
|
+
right: map.width,
|
|
156
|
+
top: copyPreviousRowIndex,
|
|
157
|
+
bottom: copyPreviousRowIndex + 1,
|
|
158
|
+
});
|
|
159
|
+
const offsetIndexPosition = copyPreviousRowIndex * map.width;
|
|
160
|
+
const offsetNextLineIndexPosition = insertNewRowIndex * map.width;
|
|
161
|
+
const cellsPositionsInOriginalRow = map.map.slice(
|
|
162
|
+
offsetIndexPosition,
|
|
163
|
+
offsetIndexPosition + map.width,
|
|
143
164
|
);
|
|
144
|
-
}
|
|
145
165
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
166
|
+
const cellsPositionsInNextRow = map.map.slice(
|
|
167
|
+
offsetNextLineIndexPosition,
|
|
168
|
+
offsetNextLineIndexPosition + map.width,
|
|
169
|
+
);
|
|
149
170
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
bottom: copyPreviousRowIndex + 1,
|
|
160
|
-
});
|
|
161
|
-
const offsetIndexPosition = copyPreviousRowIndex * map.width;
|
|
162
|
-
const offsetNextLineIndexPosition = insertNewRowIndex * map.width;
|
|
163
|
-
const cellsPositionsInOriginalRow = map.map.slice(
|
|
164
|
-
offsetIndexPosition,
|
|
165
|
-
offsetIndexPosition + map.width,
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
const cellsPositionsInNextRow = map.map.slice(
|
|
169
|
-
offsetNextLineIndexPosition,
|
|
170
|
-
offsetNextLineIndexPosition + map.width,
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
let cells = [] as PMNode[];
|
|
174
|
-
let fixRowspans = [];
|
|
175
|
-
for (let i = 0; i < cellsPositionsInOriginalRow.length; ) {
|
|
176
|
-
const pos = cellsPositionsInOriginalRow[i];
|
|
177
|
-
const documentCellPos = pos + table.start;
|
|
178
|
-
const node = tr.doc.nodeAt(documentCellPos);
|
|
179
|
-
if (!node) {
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
171
|
+
let cells = [] as PMNode[];
|
|
172
|
+
let fixRowspans = [];
|
|
173
|
+
for (let i = 0; i < cellsPositionsInOriginalRow.length; ) {
|
|
174
|
+
const pos = cellsPositionsInOriginalRow[i];
|
|
175
|
+
const documentCellPos = pos + table.start;
|
|
176
|
+
const node = tr.doc.nodeAt(documentCellPos);
|
|
177
|
+
if (!node) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
182
180
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
181
|
+
const attributes = {
|
|
182
|
+
...node.attrs,
|
|
183
|
+
colspan: 1,
|
|
184
|
+
rowspan: 1,
|
|
185
|
+
};
|
|
188
186
|
|
|
189
|
-
|
|
187
|
+
const newCell = node.type.createAndFill(attributes);
|
|
190
188
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
if (!newCell) {
|
|
190
|
+
return tr;
|
|
191
|
+
}
|
|
194
192
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if (!newCellWithColspanFixed) {
|
|
205
|
-
return tr;
|
|
206
|
-
}
|
|
193
|
+
if (cellsPositionsInNextRow.indexOf(pos) > -1) {
|
|
194
|
+
fixRowspans.push({ pos: documentCellPos, node });
|
|
195
|
+
} else if (cellsInRow.indexOf(pos) > -1) {
|
|
196
|
+
if (node.attrs.colspan > 1) {
|
|
197
|
+
const newCellWithColspanFixed = node.type.createAndFill({
|
|
198
|
+
...attributes,
|
|
199
|
+
colspan: node.attrs.colspan,
|
|
200
|
+
});
|
|
207
201
|
|
|
208
|
-
|
|
209
|
-
|
|
202
|
+
if (!newCellWithColspanFixed) {
|
|
203
|
+
return tr;
|
|
204
|
+
}
|
|
210
205
|
|
|
211
|
-
|
|
206
|
+
cells.push(newCellWithColspanFixed);
|
|
207
|
+
i = i + node.attrs.colspan;
|
|
208
|
+
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
cells.push(newCell);
|
|
212
|
+
} else {
|
|
213
|
+
cells.push(newCell);
|
|
212
214
|
}
|
|
213
|
-
cells.push(newCell);
|
|
214
|
-
} else {
|
|
215
|
-
cells.push(newCell);
|
|
216
|
-
}
|
|
217
215
|
|
|
218
|
-
|
|
219
|
-
|
|
216
|
+
i++;
|
|
217
|
+
}
|
|
220
218
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
fixRowspans.forEach((cell) => {
|
|
220
|
+
tr.setNodeMarkup(cell.pos, undefined, {
|
|
221
|
+
...cell.node.attrs,
|
|
222
|
+
rowspan: cell.node.attrs.rowspan + 1,
|
|
223
|
+
});
|
|
225
224
|
});
|
|
226
|
-
});
|
|
227
225
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
const cloneRow = tableNode.child(copyPreviousRowIndex);
|
|
227
|
+
let rowPos = table.start;
|
|
228
|
+
for (let i = 0; i < insertNewRowIndex; i++) {
|
|
229
|
+
rowPos += tableNode.child(i).nodeSize;
|
|
230
|
+
}
|
|
233
231
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
};
|
|
232
|
+
return safeInsert(
|
|
233
|
+
tableRow.createChecked(cloneRow.attrs, cells, cloneRow.marks),
|
|
234
|
+
rowPos,
|
|
235
|
+
)(tr);
|
|
236
|
+
};
|
package/types/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table/types",
|
|
3
|
-
"main": "../dist/cjs/types.js",
|
|
4
|
-
"module": "../dist/esm/types.js",
|
|
5
|
-
"module:es2019": "../dist/es2019/types.js",
|
|
6
|
-
"types": "../dist/types/types.d.ts",
|
|
3
|
+
"main": "../dist/cjs/plugins/table/types.js",
|
|
4
|
+
"module": "../dist/esm/plugins/table/types.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/plugins/table/types.js",
|
|
6
|
+
"types": "../dist/types/plugins/table/types.d.ts",
|
|
7
7
|
"typesVersions": {
|
|
8
8
|
">=4.0 <4.5": {
|
|
9
9
|
"*": [
|
|
10
|
-
"../dist/types-ts4.0/types.d.ts"
|
|
10
|
+
"../dist/types-ts4.0/plugins/table/types.d.ts"
|
|
11
11
|
]
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-table/ui/common-styles",
|
|
3
|
+
"main": "../../dist/cjs/plugins/table/ui/common-styles.js",
|
|
4
|
+
"module": "../../dist/esm/plugins/table/ui/common-styles.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/plugins/table/ui/common-styles.js",
|
|
6
|
+
"types": "../../dist/types/plugins/table/ui/common-styles.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../../dist/types-ts4.0/plugins/table/ui/common-styles.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-table/ui/consts",
|
|
3
|
+
"main": "../../dist/cjs/plugins/table/ui/consts.js",
|
|
4
|
+
"module": "../../dist/esm/plugins/table/ui/consts.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/plugins/table/ui/consts.js",
|
|
6
|
+
"types": "../../dist/types/plugins/table/ui/consts.d.ts",
|
|
7
|
+
"typesVersions": {
|
|
8
|
+
">=4.0 <4.5": {
|
|
9
|
+
"*": [
|
|
10
|
+
"../../dist/types-ts4.0/plugins/table/ui/consts.d.ts"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pluginKey = exports.getPluginState = void 0;
|
|
7
|
-
|
|
8
|
-
var _prosemirrorState = require("prosemirror-state");
|
|
9
|
-
|
|
10
|
-
var pluginKey = new _prosemirrorState.PluginKey('nextTablePlugin');
|
|
11
|
-
exports.pluginKey = pluginKey;
|
|
12
|
-
|
|
13
|
-
var getPluginState = function getPluginState(state) {
|
|
14
|
-
return state && pluginKey.getState(state);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
exports.getPluginState = getPluginState;
|
package/dist/cjs/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const sendLogs = _a => {};
|
package/dist/es2019/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var sendLogs = function sendLogs(_a) {};
|
package/dist/esm/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { EditorState, PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { TablePluginState } from '../types';
|
|
3
|
-
export declare const pluginKey: PluginKey<TablePluginState, any>;
|
|
4
|
-
export declare const getPluginState: (state: EditorState) => TablePluginState | undefined | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const sendLogs: (_a?: any) => void;
|
package/dist/types/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as tablesPlugin } from './plugins/table-plugin';
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { EditorState, PluginKey } from 'prosemirror-state';
|
|
2
|
-
import { TablePluginState } from '../types';
|
|
3
|
-
export declare const pluginKey: PluginKey<TablePluginState, any>;
|
|
4
|
-
export declare const getPluginState: (state: EditorState) => TablePluginState | undefined | null;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Direction } from '@atlaskit/editor-tables/types';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
export declare const goToNextCell: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (direction: Direction) => Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { CellColumnPositioning } from '../types';
|
|
2
|
-
export declare const hoverMergedCells: () => import("@atlaskit/editor-common/types").Command;
|
|
3
|
-
export declare const hoverColumns: (hoveredColumns: number[], isInDanger?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
4
|
-
export declare const hoverRows: (hoveredRows: number[], isInDanger?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
5
|
-
export declare const hoverTable: (isInDanger?: boolean | undefined, isSelected?: boolean | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
6
|
-
export declare const clearHoverSelection: () => import("@atlaskit/editor-common/types").Command;
|
|
7
|
-
export declare const showResizeHandleLine: (cellColumnPositioning: CellColumnPositioning) => import("@atlaskit/editor-common/types").Command;
|
|
8
|
-
export declare const hideResizeHandleLine: () => import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { hoverColumns, hoverRows, hoverTable, hoverMergedCells, clearHoverSelection, showResizeHandleLine, hideResizeHandleLine, } from './hover';
|
|
2
|
-
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
|
-
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
|
-
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectRow, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, } from './misc';
|
|
6
|
-
export { sortByColumn } from './sort';
|
|
7
|
-
export { goToNextCell } from './go-to-next-cell';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Transaction } from 'prosemirror-state';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
-
export declare function addColumnAt(getEditorContainerWidth: GetEditorContainerWidth): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction<any>;
|
|
6
|
-
export declare const addColumnBefore: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
7
|
-
export declare const addColumnAfter: (getEditorContainerWidth: GetEditorContainerWidth) => Command;
|
|
8
|
-
export declare const insertColumn: (getEditorContainerWidth: GetEditorContainerWidth) => (column: number) => Command;
|
|
9
|
-
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean) => Command;
|
|
10
|
-
export declare const createTable: () => Command;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Node as PMNode, Schema, Slice } from 'prosemirror-model';
|
|
2
|
-
import { Transaction } from 'prosemirror-state';
|
|
3
|
-
import { ContentNodeWithPos } from 'prosemirror-utils';
|
|
4
|
-
import { EditorView } from 'prosemirror-view';
|
|
5
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare const setEditorFocus: (editorHasFocus: boolean) => Command;
|
|
7
|
-
export declare const setTableRef: (ref?: HTMLTableElement | undefined) => Command;
|
|
8
|
-
export declare const setCellAttr: (name: string, value: any) => Command;
|
|
9
|
-
export declare const triggerUnlessTableHeader: (command: Command) => Command;
|
|
10
|
-
export declare const transformSliceRemoveCellBackgroundColor: (slice: Slice, schema: Schema) => Slice;
|
|
11
|
-
export declare const transformSliceToAddTableHeaders: (slice: Slice, schema: Schema) => Slice;
|
|
12
|
-
export declare const transformSliceToRemoveColumnsWidths: (slice: Slice, schema: Schema) => Slice;
|
|
13
|
-
export declare const deleteTable: Command;
|
|
14
|
-
export declare const deleteTableIfSelected: Command;
|
|
15
|
-
export declare const convertFirstRowToHeader: (schema: Schema) => (tr: Transaction) => Transaction;
|
|
16
|
-
export declare const moveCursorBackward: Command;
|
|
17
|
-
export declare const setMultipleCellAttrs: (attrs: Object, targetCellPosition?: number | undefined) => Command;
|
|
18
|
-
export declare const selectColumn: (column: number, expand?: boolean | undefined) => Command;
|
|
19
|
-
export declare const selectRow: (row: number, expand?: boolean | undefined) => Command;
|
|
20
|
-
export declare const showInsertColumnButton: (columnIndex: number) => Command;
|
|
21
|
-
export declare const showInsertRowButton: (rowIndex: number) => Command;
|
|
22
|
-
export declare const hideInsertColumnOrRowButton: () => Command;
|
|
23
|
-
export declare const addResizeHandleDecorations: (columnIndex: number) => Command;
|
|
24
|
-
export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTMLTableElement, basePos: number, opts: {
|
|
25
|
-
containerWidth: number;
|
|
26
|
-
}) => boolean;
|
|
27
|
-
export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
3
|
-
export declare enum TableSelectionDirection {
|
|
4
|
-
TopToBottom = "TopToBottom",
|
|
5
|
-
BottomToTop = "BottomToTop"
|
|
6
|
-
}
|
|
7
|
-
export declare const arrowLeftFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
|
|
8
|
-
export declare const arrowRightFromTable: (editorSelectionAPI: EditorSelectionAPI | undefined | null) => () => Command;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
2
|
-
/**
|
|
3
|
-
* We need to split cell keeping the right type of cell given current table configuration.
|
|
4
|
-
* We are using editor-tables splitCellWithType that allows you to choose what cell type should be.
|
|
5
|
-
*/
|
|
6
|
-
export declare const splitCell: Command;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TableLayout } from '@atlaskit/adf-schema';
|
|
2
|
-
import { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
/**
|
|
4
|
-
* Table layout toggle logic
|
|
5
|
-
* default -> wide -> full-width -> default
|
|
6
|
-
*/
|
|
7
|
-
export declare const getNextLayout: (currentLayout: TableLayout) => TableLayout;
|
|
8
|
-
export declare const toggleHeaderRow: Command;
|
|
9
|
-
export declare const toggleHeaderColumn: Command;
|
|
10
|
-
export declare const toggleNumberColumn: Command;
|
|
11
|
-
export declare const toggleTableLayout: Command;
|
|
12
|
-
export declare const toggleContextualMenu: () => Command;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
2
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
3
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
6
|
-
import { TableSortOrder as SortOrder } from '@atlaskit/adf-schema/steps';
|
|
7
|
-
import { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
8
|
-
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
9
|
-
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB, targetCellPosition?: number | undefined) => Command;
|
|
10
|
-
export declare const mergeCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined) => Command;
|
|
11
|
-
export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
|
-
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (cellColor: string, targetCellPosition?: number | undefined) => Command;
|
|
13
|
-
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
14
|
-
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
15
|
-
export declare const insertColumnWithAnalytics: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB, position: number) => Command;
|
|
16
|
-
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
17
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB, rect: Rect) => Command;
|
|
18
|
-
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
19
|
-
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
20
|
-
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
21
|
-
export declare const toggleHeaderColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
22
|
-
export declare const toggleNumberColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
|
-
export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
24
|
-
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
25
|
-
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
26
|
-
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
-
import { EditorView } from 'prosemirror-view';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { ElementContentRects } from './types';
|
|
5
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare const handleBlur: (view: EditorView, event: Event) => boolean;
|
|
7
|
-
export declare const handleFocus: (view: EditorView, event: Event) => boolean;
|
|
8
|
-
export declare const handleClick: (view: EditorView, event: Event) => boolean;
|
|
9
|
-
export declare const handleMouseOver: (view: EditorView, mouseEvent: Event) => boolean;
|
|
10
|
-
export declare const handleMouseDown: (_: EditorView, event: Event) => boolean;
|
|
11
|
-
export declare const handleMouseOut: (view: EditorView, mouseEvent: Event) => boolean;
|
|
12
|
-
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
|
-
export declare const handleMouseMove: (getEditorFeatureFlags: GetEditorFeatureFlags) => (view: EditorView, event: Event, tableCellOptimization?: boolean | undefined, elementContentRects?: ElementContentRects | undefined) => boolean;
|
|
14
|
-
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined) => Transaction;
|
|
16
|
-
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event, tableCellOptimization?: boolean | undefined, elementContentRects?: ElementContentRects | undefined) => boolean, elementContentRects?: ElementContentRects | undefined) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { EditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
4
|
-
import { PluginConfig } from './types';
|
|
5
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
6
|
-
interface TablePluginOptions {
|
|
7
|
-
tableOptions: PluginConfig;
|
|
8
|
-
breakoutEnabled?: boolean;
|
|
9
|
-
allowContextualMenu?: boolean;
|
|
10
|
-
fullWidthEnabled?: boolean;
|
|
11
|
-
wasFullWidthEnabled?: boolean;
|
|
12
|
-
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
13
|
-
editorSelectionAPI?: EditorSelectionAPI;
|
|
14
|
-
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
15
|
-
}
|
|
16
|
-
declare const tablesPlugin: (options?: TablePluginOptions | undefined) => EditorPlugin;
|
|
17
|
-
export default tablesPlugin;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { ShadowEvent } from '../types';
|
|
2
|
-
export declare class OverflowShadowsObserver {
|
|
3
|
-
private tableIntersectionObserver?;
|
|
4
|
-
private updateShadowState;
|
|
5
|
-
private table;
|
|
6
|
-
private wrapper;
|
|
7
|
-
private firstCell;
|
|
8
|
-
private lastCell;
|
|
9
|
-
private getFirstCell;
|
|
10
|
-
private getLastCell;
|
|
11
|
-
private isSticky;
|
|
12
|
-
private stickyRowHeight;
|
|
13
|
-
constructor(updateShadowState: (shadowKey: ShadowEvent, value: boolean) => void, table: HTMLElement, wrapper: HTMLDivElement);
|
|
14
|
-
private init;
|
|
15
|
-
private checkIntersectionEvent;
|
|
16
|
-
private updateStickyShadowsHeightIfChanged;
|
|
17
|
-
private getStickyCell;
|
|
18
|
-
observeCells: (isSticky?: boolean | undefined, hasHeaderRow?: boolean | undefined) => void;
|
|
19
|
-
/**
|
|
20
|
-
* Takes a heightStyle if it can be computed in a less expensive manner,
|
|
21
|
-
* e.g. bounds on an IntersectionObserverEntry, otherwise proceed with
|
|
22
|
-
* reading it from sticky cell
|
|
23
|
-
*/
|
|
24
|
-
updateStickyShadows: (stickyRowHeight?: number | undefined) => void;
|
|
25
|
-
dispose(): void;
|
|
26
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Node as PmNode } from 'prosemirror-model';
|
|
3
|
-
import { EditorView } from 'prosemirror-view';
|
|
4
|
-
import type { EditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { RowStickyState, StickyPluginState } from '../pm-plugins/sticky-headers';
|
|
6
|
-
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
|
-
import { ColumnResizingPluginState, ShadowEvent } from '../types';
|
|
8
|
-
import type { TableColumnOrdering } from '@atlaskit/adf-schema/steps';
|
|
9
|
-
import type { TableOptions } from './types';
|
|
10
|
-
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
11
|
-
export interface ComponentProps {
|
|
12
|
-
view: EditorView;
|
|
13
|
-
getNode: () => PmNode;
|
|
14
|
-
allowColumnResizing?: boolean;
|
|
15
|
-
eventDispatcher: EventDispatcher;
|
|
16
|
-
getPos: () => number;
|
|
17
|
-
options?: TableOptions;
|
|
18
|
-
contentDOM: (node: HTMLElement | null) => void;
|
|
19
|
-
containerWidth: EditorContainerWidth;
|
|
20
|
-
allowControls: boolean;
|
|
21
|
-
isHeaderRowEnabled: boolean;
|
|
22
|
-
isHeaderColumnEnabled: boolean;
|
|
23
|
-
isMediaFullscreen?: boolean;
|
|
24
|
-
tableActive: boolean;
|
|
25
|
-
ordering: TableColumnOrdering;
|
|
26
|
-
tableResizingPluginState?: ColumnResizingPluginState;
|
|
27
|
-
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
28
|
-
}
|
|
29
|
-
interface TableState {
|
|
30
|
-
scroll: number;
|
|
31
|
-
tableContainerWidth: string;
|
|
32
|
-
parentWidth?: number;
|
|
33
|
-
isLoading: boolean;
|
|
34
|
-
stickyHeader?: RowStickyState;
|
|
35
|
-
[ShadowEvent.SHOW_BEFORE_SHADOW]: boolean;
|
|
36
|
-
[ShadowEvent.SHOW_AFTER_SHADOW]: boolean;
|
|
37
|
-
}
|
|
38
|
-
declare class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
39
|
-
static displayName: string;
|
|
40
|
-
state: TableState;
|
|
41
|
-
private wrapper?;
|
|
42
|
-
private table?;
|
|
43
|
-
private node;
|
|
44
|
-
private containerWidth?;
|
|
45
|
-
private layoutSize?;
|
|
46
|
-
private overflowShadowsObserver?;
|
|
47
|
-
constructor(props: ComponentProps);
|
|
48
|
-
componentDidMount(): void;
|
|
49
|
-
componentWillUnmount(): void;
|
|
50
|
-
componentDidUpdate(prevProps: ComponentProps): void;
|
|
51
|
-
private updateShadows;
|
|
52
|
-
private updateShadowState;
|
|
53
|
-
onStickyState: (state: StickyPluginState) => void;
|
|
54
|
-
prevTableState: any;
|
|
55
|
-
render(): JSX.Element;
|
|
56
|
-
private getMarginLeft;
|
|
57
|
-
private handleScroll;
|
|
58
|
-
private handleTableResizing;
|
|
59
|
-
private scaleTable;
|
|
60
|
-
private handleAutoSize;
|
|
61
|
-
private handleWindowResize;
|
|
62
|
-
private updateTableContainerWidth;
|
|
63
|
-
private getParentNodeWidth;
|
|
64
|
-
private updateParentWidth;
|
|
65
|
-
private tableNodeLayoutSize;
|
|
66
|
-
private scaleTableDebounced;
|
|
67
|
-
private handleTableResizingDebounced;
|
|
68
|
-
private handleScrollDebounced;
|
|
69
|
-
private handleAutoSizeDebounced;
|
|
70
|
-
private handleWindowResizeDebounced;
|
|
71
|
-
}
|
|
72
|
-
export default TableComponent;
|