@atlaskit/editor-plugin-table 0.0.10 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +35 -0
- package/CHANGELOG.md +23 -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/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 +1 -2
- 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 +1 -2
- 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/dist/types-ts4.0/plugins/table/commands-with-analytics.d.ts +5 -5
- package/dist/types-ts4.0/plugins/table/pm-plugins/table-resizing/index.d.ts +1 -0
- package/dist/types-ts4.0/plugins/table/toolbar.d.ts +2 -2
- package/dist/types-ts4.0/plugins/table/transforms/fix-tables.d.ts +1 -1
- package/dist/types-ts4.0/plugins/table/utils/decoration.d.ts +1 -1
- package/examples/config.jsonc +14 -0
- package/package.json +15 -11
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +1 -1
- 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 +8 -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/{plugins/table/__tests__ → __tests__}/unit/commands.ts +7 -7
- package/src/__tests__/unit/copy-button.ts +22 -0
- package/src/__tests__/unit/event-handlers.ts +120 -1
- package/src/{plugins/table/__tests__ → __tests__}/unit/get-toolbar-config.ts +8 -3
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/OverflowShadowsObserver.ts +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/TableComponent.tsx +11 -11
- package/src/{plugins/table/__tests__ → __tests__}/unit/nodeviews/table.ts +5 -5
- 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 +2 -2
- package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/sticky-headers/tableRow.tsx +16 -13
- 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 +5 -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/{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/hover.ts +4 -1
- package/src/plugins/table/commands-with-analytics.ts +12 -8
- package/src/plugins/table/event-handlers.ts +0 -1
- package/src/plugins/table/handlers.ts +0 -1
- package/src/plugins/table/index.tsx +28 -2
- package/src/plugins/table/pm-plugins/keymap.ts +1 -1
- package/src/plugins/table/pm-plugins/table-local-id.ts +0 -2
- package/src/plugins/table/pm-plugins/table-resizing/index.ts +1 -0
- package/src/plugins/table/{toolbar.ts → toolbar.tsx} +186 -14
- package/src/plugins/table/transforms/fix-tables.ts +2 -3
- package/src/plugins/table/ui/FloatingContextualButton/index.tsx +0 -1
- package/src/plugins/table/ui/FloatingContextualMenu/ContextualMenu.tsx +13 -10
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/ContextualMenu.tsx +1 -0
- package/src/plugins/table/ui/FloatingContextualMenu/__tests__/FloatingContextualMenu.tsx +1 -0
- package/src/plugins/table/ui/FloatingDeleteButton/index.tsx +0 -1
- package/src/plugins/table/ui/FloatingInsertButton/index.tsx +0 -1
- package/src/plugins/table/ui/LayoutButton/index.tsx +2 -4
- package/src/plugins/table/ui/TableFloatingControls/CornerControls/index.tsx +1 -0
- 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 +0 -2
- package/src/plugins/table/utils/paste.ts +0 -1
- package/src/plugins/table/utils/row-controls.ts +0 -1
- 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/plugins/plugin-key.d.ts +0 -4
- package/dist/types-ts4.0/plugins/table/todo-stubs.d.ts +0 -1
- 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/todo-stubs.ts +0 -1
- package/src/types.ts +0 -3
- package/tmp/api-report-tmp.d.ts +0 -91
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/sticky-headers/tableRow.tsx
RENAMED
|
@@ -13,33 +13,36 @@ import {
|
|
|
13
13
|
tr,
|
|
14
14
|
DocBuilder,
|
|
15
15
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
16
|
-
import { TableRowNodeView } from '../../../../pm-plugins/sticky-headers';
|
|
17
|
-
import tablePlugin from '
|
|
18
|
-
import { pluginKey } from '../../../../pm-plugins/plugin-key';
|
|
16
|
+
import { TableRowNodeView } from '../../../../plugins/table/pm-plugins/sticky-headers';
|
|
17
|
+
import tablePlugin from '../../../../plugins/table';
|
|
18
|
+
import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
19
19
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
20
20
|
import createStub, { Stub } from 'raf-stub';
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-core/src/plugins/feature-flags-context';
|
|
22
|
-
jest.mock(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
jest.mock(
|
|
23
|
+
'../../../../plugins/table/pm-plugins/sticky-headers/commands',
|
|
24
|
+
() => ({
|
|
25
|
+
...jest.requireActual<Object>(
|
|
26
|
+
'../../../../plugins/table/pm-plugins/sticky-headers/commands',
|
|
27
|
+
),
|
|
28
|
+
updateStickyState: jest.fn(() => jest.fn()),
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
28
31
|
jest.mock('@atlaskit/editor-common/ui', () => ({
|
|
29
32
|
...jest.requireActual<Object>('@atlaskit/editor-common/ui'),
|
|
30
33
|
findOverflowScrollParent: jest.fn(() => jest.fn()),
|
|
31
34
|
}));
|
|
32
35
|
|
|
33
36
|
import { findOverflowScrollParent } from '@atlaskit/editor-common/ui';
|
|
34
|
-
import { updateStickyState } from '../../../../pm-plugins/sticky-headers/commands';
|
|
35
|
-
import { TableCssClassName } from '../../../../types';
|
|
36
|
-
import TableComponent from '../../../../nodeviews/TableComponent';
|
|
37
|
+
import { updateStickyState } from '../../../../plugins/table/pm-plugins/sticky-headers/commands';
|
|
38
|
+
import { TableCssClassName } from '../../../../plugins/table/types';
|
|
39
|
+
import TableComponent from '../../../../plugins/table/nodeviews/TableComponent';
|
|
37
40
|
import React from 'react';
|
|
38
41
|
import { render, screen } from '@testing-library/react';
|
|
39
42
|
import {
|
|
40
43
|
stickyRowOffsetTop,
|
|
41
44
|
tableScrollbarOffset,
|
|
42
|
-
} from '../../../../ui/consts';
|
|
45
|
+
} from '../../../../plugins/table/ui/consts';
|
|
43
46
|
|
|
44
47
|
describe('TableRowNodeView', () => {
|
|
45
48
|
let tableRowNodeView: TableRowNodeView;
|
|
@@ -7,7 +7,7 @@ import dispatchPasteEvent from '@atlaskit/editor-test-helpers/dispatch-paste-eve
|
|
|
7
7
|
import { insertText } from '@atlaskit/editor-test-helpers/transactions';
|
|
8
8
|
import { replaceRaf } from 'raf-stub';
|
|
9
9
|
|
|
10
|
-
import { handleCut } from '../../../event-handlers';
|
|
10
|
+
import { handleCut } from '../../../plugins/table/event-handlers';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
doc,
|
|
@@ -21,11 +21,8 @@ import {
|
|
|
21
21
|
th,
|
|
22
22
|
DocBuilder,
|
|
23
23
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
PluginConfig,
|
|
27
|
-
} from '../../../../../plugins/table/types';
|
|
28
|
-
import { pluginKey as tablePluginKey } from '../../../../../plugins/table/pm-plugins/plugin-key';
|
|
24
|
+
import { TablePluginState, PluginConfig } from '../../../plugins/table/types';
|
|
25
|
+
import { pluginKey as tablePluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
29
26
|
import { CellSelection } from '@atlaskit/editor-tables';
|
|
30
27
|
|
|
31
28
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/colgroup.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { p, table, tr, td } from '@atlaskit/editor-test-helpers/doc-builder';
|
|
2
2
|
import defaultSchema from '@atlaskit/editor-test-helpers/schema';
|
|
3
|
-
import { generateColgroup } from '../../../../pm-plugins/table-resizing/utils';
|
|
3
|
+
import { generateColgroup } from '../../../../plugins/table/pm-plugins/table-resizing/utils';
|
|
4
4
|
|
|
5
5
|
describe('table-resizing/colgroup', () => {
|
|
6
6
|
describe('#generateColgroup', () => {
|
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/table-resizing/event-handlers.ts
RENAMED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
LightEditorPlugin,
|
|
4
4
|
Preset,
|
|
5
5
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
6
|
-
import { setResizeHandlePos } from '
|
|
6
|
+
import { setResizeHandlePos } from '../../../../plugins/table/pm-plugins/table-resizing/commands';
|
|
7
7
|
import {
|
|
8
8
|
doc,
|
|
9
9
|
table,
|
|
@@ -19,8 +19,8 @@ import {
|
|
|
19
19
|
TABLE_ACTION,
|
|
20
20
|
} from '@atlaskit/editor-common/analytics';
|
|
21
21
|
|
|
22
|
-
import tablePlugin from '
|
|
23
|
-
import { pluginKey } from '../../../../pm-plugins/plugin-key';
|
|
22
|
+
import tablePlugin from '../../../../plugins/table';
|
|
23
|
+
import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
24
24
|
import { TextSelection, NodeSelection } from 'prosemirror-state';
|
|
25
25
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
26
26
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
@@ -23,9 +23,9 @@ import { uuid } from '@atlaskit/adf-schema';
|
|
|
23
23
|
import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
|
|
24
24
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
25
25
|
import codeBlockPlugin from '@atlaskit/editor-core/src/plugins/code-block';
|
|
26
|
-
import tablePlugin from '../../../
|
|
27
|
-
import { TablePluginState } from '../../../types';
|
|
28
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
26
|
+
import tablePlugin from '../../../plugins/table';
|
|
27
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
28
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
29
29
|
import { createEditorSelectionAPI } from '@atlaskit/editor-core/src/selection-api/api';
|
|
30
30
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
31
31
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getToolbarMenuConfig,
|
|
3
3
|
getToolbarCellOptionsConfig,
|
|
4
|
-
} from '../../toolbar';
|
|
5
|
-
import { ToolbarMenuConfig, ToolbarMenuState } from '../../types';
|
|
4
|
+
} from '../../plugins/table/toolbar';
|
|
5
|
+
import { ToolbarMenuConfig, ToolbarMenuState } from '../../plugins/table/types';
|
|
6
6
|
import { createEditorState } from '@atlaskit/editor-test-helpers/create-editor-state';
|
|
7
7
|
import {
|
|
8
8
|
doc,
|
|
@@ -17,11 +17,11 @@ import type {
|
|
|
17
17
|
FloatingToolbarDropdown,
|
|
18
18
|
} from '@atlaskit/editor-common/types';
|
|
19
19
|
import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
20
|
-
import { canMergeCells } from '../../transforms';
|
|
20
|
+
import { canMergeCells } from '../../plugins/table/transforms';
|
|
21
21
|
import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
22
22
|
|
|
23
23
|
jest.mock('@atlaskit/editor-tables/utils');
|
|
24
|
-
jest.mock('../../transforms');
|
|
24
|
+
jest.mock('../../plugins/table/transforms');
|
|
25
25
|
|
|
26
26
|
const formatMessage: (t: unknown) => string = (id) => 'Lorem ipsum';
|
|
27
27
|
const ctx = { formatMessage };
|
|
@@ -133,7 +133,7 @@ describe('getToolbarMenuConfig', () => {
|
|
|
133
133
|
describe('getToolbarCellOptionsConfig', () => {
|
|
134
134
|
const state = createEditorState(doc(table()(row(td()(p('1{cursor}'))))));
|
|
135
135
|
const getEditorContainerWidth = () => ({ width: 500 });
|
|
136
|
-
|
|
136
|
+
|
|
137
137
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
138
138
|
`${message.id}`;
|
|
139
139
|
const rect = new Rect(1, 1, 1, 1);
|
|
@@ -146,10 +146,6 @@ describe('getToolbarCellOptionsConfig', () => {
|
|
|
146
146
|
getEditorContainerWidth,
|
|
147
147
|
undefined,
|
|
148
148
|
);
|
|
149
|
-
//
|
|
150
|
-
it('is hidden by default', () => {
|
|
151
|
-
expect(cellOptionsMenu.hidden).toBe(true);
|
|
152
|
-
});
|
|
153
149
|
|
|
154
150
|
it('is a dropdown with the following dropdown items with the given order', () => {
|
|
155
151
|
const items = cellOptionsMenu.options as Array<DropdownOptionT<Command>>;
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
DocBuilder,
|
|
12
12
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
13
13
|
|
|
14
|
-
import tablePlugin from '
|
|
14
|
+
import tablePlugin from '../../../plugins/table';
|
|
15
15
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
16
16
|
|
|
17
17
|
import {
|
|
18
18
|
isTableCollapsible,
|
|
19
19
|
collapseSelectedTable,
|
|
20
|
-
} from '../../../utils/collapse';
|
|
20
|
+
} from '../../../plugins/table/utils/collapse';
|
|
21
21
|
|
|
22
22
|
describe('collapse', () => {
|
|
23
23
|
const createEditor = createProsemirrorEditorFactory();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
it.skip('TODO: restore vr `packages/editor/editor-plugin-table/src/plugins/table/__tests__/visual-regression/copy-button.ts`', () => {});
|
|
4
|
+
|
|
5
|
+
// import { _getCopyButtonTestSuite } from '../../../copy-button/__tests__/visual-regression/_getCopyButtonTestSuite';
|
|
6
|
+
|
|
7
|
+
// _getCopyButtonTestSuite({
|
|
8
|
+
// nodeName: 'Table',
|
|
9
|
+
// editorOptions: {
|
|
10
|
+
// allowTables: {
|
|
11
|
+
// advanced: true,
|
|
12
|
+
// },
|
|
13
|
+
// defaultValue: {
|
|
14
|
+
// version: 1,
|
|
15
|
+
// type: 'doc',
|
|
16
|
+
// content: [
|
|
17
|
+
// {
|
|
18
|
+
// type: 'table',
|
|
19
|
+
// attrs: {
|
|
20
|
+
// isNumberColumnEnabled: false,
|
|
21
|
+
// layout: 'default',
|
|
22
|
+
// localId: '15804638-b946-4591-b64c-beffe5122733',
|
|
23
|
+
// },
|
|
24
|
+
// content: [
|
|
25
|
+
// {
|
|
26
|
+
// type: 'tableRow',
|
|
27
|
+
// content: [
|
|
28
|
+
// {
|
|
29
|
+
// type: 'tableHeader',
|
|
30
|
+
// attrs: {},
|
|
31
|
+
// content: [
|
|
32
|
+
// {
|
|
33
|
+
// type: 'paragraph',
|
|
34
|
+
// content: [
|
|
35
|
+
// {
|
|
36
|
+
// type: 'text',
|
|
37
|
+
// text: '1',
|
|
38
|
+
// },
|
|
39
|
+
// ],
|
|
40
|
+
// },
|
|
41
|
+
// ],
|
|
42
|
+
// },
|
|
43
|
+
// {
|
|
44
|
+
// type: 'tableHeader',
|
|
45
|
+
// attrs: {},
|
|
46
|
+
// content: [
|
|
47
|
+
// {
|
|
48
|
+
// type: 'paragraph',
|
|
49
|
+
// content: [
|
|
50
|
+
// {
|
|
51
|
+
// type: 'text',
|
|
52
|
+
// text: '2',
|
|
53
|
+
// },
|
|
54
|
+
// ],
|
|
55
|
+
// },
|
|
56
|
+
// ],
|
|
57
|
+
// },
|
|
58
|
+
// {
|
|
59
|
+
// type: 'tableHeader',
|
|
60
|
+
// attrs: {},
|
|
61
|
+
// content: [
|
|
62
|
+
// {
|
|
63
|
+
// type: 'paragraph',
|
|
64
|
+
// content: [
|
|
65
|
+
// {
|
|
66
|
+
// type: 'text',
|
|
67
|
+
// text: '3',
|
|
68
|
+
// },
|
|
69
|
+
// ],
|
|
70
|
+
// },
|
|
71
|
+
// ],
|
|
72
|
+
// },
|
|
73
|
+
// ],
|
|
74
|
+
// },
|
|
75
|
+
// {
|
|
76
|
+
// type: 'tableRow',
|
|
77
|
+
// content: [
|
|
78
|
+
// {
|
|
79
|
+
// type: 'tableCell',
|
|
80
|
+
// attrs: {},
|
|
81
|
+
// content: [
|
|
82
|
+
// {
|
|
83
|
+
// type: 'paragraph',
|
|
84
|
+
// content: [
|
|
85
|
+
// {
|
|
86
|
+
// type: 'text',
|
|
87
|
+
// text: '4',
|
|
88
|
+
// },
|
|
89
|
+
// ],
|
|
90
|
+
// },
|
|
91
|
+
// ],
|
|
92
|
+
// },
|
|
93
|
+
// {
|
|
94
|
+
// type: 'tableCell',
|
|
95
|
+
// attrs: {},
|
|
96
|
+
// content: [
|
|
97
|
+
// {
|
|
98
|
+
// type: 'paragraph',
|
|
99
|
+
// content: [
|
|
100
|
+
// {
|
|
101
|
+
// type: 'text',
|
|
102
|
+
// text: '5',
|
|
103
|
+
// },
|
|
104
|
+
// ],
|
|
105
|
+
// },
|
|
106
|
+
// ],
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// type: 'tableCell',
|
|
110
|
+
// attrs: {},
|
|
111
|
+
// content: [
|
|
112
|
+
// {
|
|
113
|
+
// type: 'paragraph',
|
|
114
|
+
// content: [
|
|
115
|
+
// {
|
|
116
|
+
// type: 'text',
|
|
117
|
+
// text: '6',
|
|
118
|
+
// },
|
|
119
|
+
// ],
|
|
120
|
+
// },
|
|
121
|
+
// ],
|
|
122
|
+
// },
|
|
123
|
+
// ],
|
|
124
|
+
// },
|
|
125
|
+
// {
|
|
126
|
+
// type: 'tableRow',
|
|
127
|
+
// content: [
|
|
128
|
+
// {
|
|
129
|
+
// type: 'tableCell',
|
|
130
|
+
// attrs: {},
|
|
131
|
+
// content: [
|
|
132
|
+
// {
|
|
133
|
+
// type: 'paragraph',
|
|
134
|
+
// content: [
|
|
135
|
+
// {
|
|
136
|
+
// type: 'text',
|
|
137
|
+
// text: '7',
|
|
138
|
+
// },
|
|
139
|
+
// ],
|
|
140
|
+
// },
|
|
141
|
+
// ],
|
|
142
|
+
// },
|
|
143
|
+
// {
|
|
144
|
+
// type: 'tableCell',
|
|
145
|
+
// attrs: {},
|
|
146
|
+
// content: [
|
|
147
|
+
// {
|
|
148
|
+
// type: 'paragraph',
|
|
149
|
+
// content: [
|
|
150
|
+
// {
|
|
151
|
+
// type: 'text',
|
|
152
|
+
// text: '8',
|
|
153
|
+
// },
|
|
154
|
+
// ],
|
|
155
|
+
// },
|
|
156
|
+
// ],
|
|
157
|
+
// },
|
|
158
|
+
// {
|
|
159
|
+
// type: 'tableCell',
|
|
160
|
+
// attrs: {},
|
|
161
|
+
// content: [
|
|
162
|
+
// {
|
|
163
|
+
// type: 'paragraph',
|
|
164
|
+
// content: [
|
|
165
|
+
// {
|
|
166
|
+
// type: 'text',
|
|
167
|
+
// text: '9',
|
|
168
|
+
// },
|
|
169
|
+
// ],
|
|
170
|
+
// },
|
|
171
|
+
// ],
|
|
172
|
+
// },
|
|
173
|
+
// ],
|
|
174
|
+
// },
|
|
175
|
+
// ],
|
|
176
|
+
// },
|
|
177
|
+
// ],
|
|
178
|
+
// },
|
|
179
|
+
// },
|
|
180
|
+
// nodeSelector: '.pm-table-cell-content-wrap',
|
|
181
|
+
// });
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
1
3
|
// import { PuppeteerPage } from '@atlaskit/visual-regression/helper';
|
|
4
|
+
// import { Device } from '@atlaskit/editor-test-helpers/vr-utils/device-viewport';
|
|
2
5
|
// import {
|
|
3
6
|
// snapshot,
|
|
4
7
|
// initFullPageEditorWithAdf,
|
|
5
|
-
// Device,
|
|
6
8
|
// } from '../../../../__tests__/visual-regression/_utils';
|
|
7
9
|
// import tableWith100ListItemsADF from './__fixtures__/table-with-100-numbered-list-items.json';
|
|
8
10
|
// import {
|
|
@@ -59,13 +59,14 @@ export const hoverMergedCells = () =>
|
|
|
59
59
|
export const hoverColumns = (hoveredColumns: number[], isInDanger?: boolean) =>
|
|
60
60
|
createCommand(
|
|
61
61
|
(state) => {
|
|
62
|
-
const cells = getCellsInColumn(hoveredColumns)(state.selection);
|
|
62
|
+
const cells = getCellsInColumn(hoveredColumns)(state.tr.selection);
|
|
63
63
|
if (!cells) {
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
66
|
const decorations = createControlsHoverDecoration(
|
|
67
67
|
cells,
|
|
68
68
|
'column',
|
|
69
|
+
state.tr,
|
|
69
70
|
isInDanger,
|
|
70
71
|
);
|
|
71
72
|
|
|
@@ -95,6 +96,7 @@ export const hoverRows = (hoveredRows: number[], isInDanger?: boolean) =>
|
|
|
95
96
|
const decorations = createControlsHoverDecoration(
|
|
96
97
|
cells,
|
|
97
98
|
'row',
|
|
99
|
+
state.tr,
|
|
98
100
|
isInDanger,
|
|
99
101
|
);
|
|
100
102
|
|
|
@@ -131,6 +133,7 @@ export const hoverTable = (isInDanger?: boolean, isSelected?: boolean) =>
|
|
|
131
133
|
const decorations = createControlsHoverDecoration(
|
|
132
134
|
cells,
|
|
133
135
|
'table',
|
|
136
|
+
state.tr,
|
|
134
137
|
isInDanger,
|
|
135
138
|
isSelected,
|
|
136
139
|
);
|
|
@@ -96,7 +96,7 @@ export const emptyMultipleCellsWithAnalytics = (
|
|
|
96
96
|
|
|
97
97
|
export const mergeCellsWithAnalytics = (
|
|
98
98
|
editorAnalyticsAPI: EditorAnalyticsAPI | null | undefined,
|
|
99
|
-
) =>
|
|
99
|
+
) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) =>
|
|
100
100
|
withEditorAnalyticsAPI(({ selection }) => {
|
|
101
101
|
const {
|
|
102
102
|
horizontalCells,
|
|
@@ -111,7 +111,7 @@ export const mergeCellsWithAnalytics = (
|
|
|
111
111
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
112
112
|
actionSubjectId: null,
|
|
113
113
|
attributes: {
|
|
114
|
-
inputMethod
|
|
114
|
+
inputMethod,
|
|
115
115
|
horizontalCells,
|
|
116
116
|
verticalCells,
|
|
117
117
|
totalCells,
|
|
@@ -129,7 +129,7 @@ export const mergeCellsWithAnalytics = (
|
|
|
129
129
|
|
|
130
130
|
export const splitCellWithAnalytics = (
|
|
131
131
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
132
|
-
) =>
|
|
132
|
+
) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB) =>
|
|
133
133
|
withEditorAnalyticsAPI(({ selection }) => {
|
|
134
134
|
const { totalRowCount, totalColumnCount } = getSelectedCellInfo(selection);
|
|
135
135
|
const cell = findCellClosestToPos(selection.$anchor);
|
|
@@ -144,7 +144,7 @@ export const splitCellWithAnalytics = (
|
|
|
144
144
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
145
145
|
actionSubjectId: null,
|
|
146
146
|
attributes: {
|
|
147
|
-
inputMethod
|
|
147
|
+
inputMethod,
|
|
148
148
|
horizontalCells,
|
|
149
149
|
verticalCells,
|
|
150
150
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -159,7 +159,11 @@ export const splitCellWithAnalytics = (
|
|
|
159
159
|
|
|
160
160
|
export const setColorWithAnalytics = (
|
|
161
161
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
162
|
-
) => (
|
|
162
|
+
) => (
|
|
163
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB,
|
|
164
|
+
cellColor: string,
|
|
165
|
+
targetCellPosition?: number,
|
|
166
|
+
) =>
|
|
163
167
|
withEditorAnalyticsAPI(({ selection }) => {
|
|
164
168
|
const {
|
|
165
169
|
horizontalCells,
|
|
@@ -174,7 +178,7 @@ export const setColorWithAnalytics = (
|
|
|
174
178
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
175
179
|
actionSubjectId: null,
|
|
176
180
|
attributes: {
|
|
177
|
-
inputMethod
|
|
181
|
+
inputMethod,
|
|
178
182
|
cellColor: (
|
|
179
183
|
tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor
|
|
180
184
|
).toLowerCase(),
|
|
@@ -457,7 +461,7 @@ export const toggleTableLayoutWithAnalytics = (
|
|
|
457
461
|
export const sortColumnWithAnalytics = (
|
|
458
462
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
459
463
|
) => (
|
|
460
|
-
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
464
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB,
|
|
461
465
|
columnIndex: number,
|
|
462
466
|
sortOrder: SortOrder,
|
|
463
467
|
) =>
|
|
@@ -483,7 +487,7 @@ export const sortColumnWithAnalytics = (
|
|
|
483
487
|
export const distributeColumnsWidthsWithAnalytics = (
|
|
484
488
|
editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null,
|
|
485
489
|
) => (
|
|
486
|
-
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
490
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB,
|
|
487
491
|
{ resizeState, table, attributes }: ResizeStateWithAnalytics,
|
|
488
492
|
) => {
|
|
489
493
|
return withEditorAnalyticsAPI(() => {
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
isLastItemMediaGroup,
|
|
24
24
|
setNodeSelection,
|
|
25
25
|
} from '@atlaskit/editor-common/utils';
|
|
26
|
-
// import { closestElement } from '@atlaskit/editor-core/src/utils/dom';
|
|
27
26
|
import { closestElement } from '@atlaskit/editor-common/utils';
|
|
28
27
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
29
28
|
import {
|
|
@@ -3,7 +3,6 @@ import { Transaction, ReadonlyTransaction } from 'prosemirror-state';
|
|
|
3
3
|
import { ContentNodeWithPos, findParentNodeOfType } from 'prosemirror-utils';
|
|
4
4
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
|
|
6
|
-
// import { isTextInput } from '../../utils/is-text-input';
|
|
7
6
|
import { isTextInput } from '@atlaskit/editor-common/utils';
|
|
8
7
|
import { isTableCollapsible } from './utils/collapse';
|
|
9
8
|
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
ACTION_SUBJECT_ID,
|
|
21
21
|
EVENT_TYPE,
|
|
22
22
|
INPUT_METHOD,
|
|
23
|
+
TABLE_ACTION,
|
|
23
24
|
} from '@atlaskit/editor-common/analytics';
|
|
24
25
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
25
26
|
|
|
@@ -59,6 +60,7 @@ import type {
|
|
|
59
60
|
GetEditorContainerWidth,
|
|
60
61
|
GetEditorFeatureFlags,
|
|
61
62
|
} from '@atlaskit/editor-common/types';
|
|
63
|
+
import { EditorState, Transaction } from 'prosemirror-state';
|
|
62
64
|
|
|
63
65
|
interface TablePluginOptions {
|
|
64
66
|
tableOptions: PluginConfig;
|
|
@@ -177,8 +179,31 @@ const tablesPlugin = (options?: TablePluginOptions): EditorPlugin => {
|
|
|
177
179
|
name: 'tableSelectionKeymap',
|
|
178
180
|
plugin: () => tableSelectionKeymapPlugin(options?.editorSelectionAPI),
|
|
179
181
|
},
|
|
180
|
-
{
|
|
181
|
-
|
|
182
|
+
{
|
|
183
|
+
name: 'tableEditing',
|
|
184
|
+
plugin: () =>
|
|
185
|
+
tableEditing({
|
|
186
|
+
reportFixedTable: ({
|
|
187
|
+
state,
|
|
188
|
+
tr,
|
|
189
|
+
reason,
|
|
190
|
+
}: {
|
|
191
|
+
state: EditorState;
|
|
192
|
+
tr: Transaction;
|
|
193
|
+
reason: string;
|
|
194
|
+
}) => {
|
|
195
|
+
options?.editorAnalyticsAPI?.attachAnalyticsEvent({
|
|
196
|
+
action: TABLE_ACTION.FIXED,
|
|
197
|
+
actionSubject: ACTION_SUBJECT.TABLE,
|
|
198
|
+
actionSubjectId: null,
|
|
199
|
+
attributes: {
|
|
200
|
+
reason,
|
|
201
|
+
},
|
|
202
|
+
eventType: EVENT_TYPE.TRACK,
|
|
203
|
+
})(tr);
|
|
204
|
+
},
|
|
205
|
+
}) as SafePlugin,
|
|
206
|
+
},
|
|
182
207
|
{
|
|
183
208
|
name: 'tableStickyHeaders',
|
|
184
209
|
plugin: ({ dispatch, eventDispatcher }) =>
|
|
@@ -432,6 +457,7 @@ const tablesPlugin = (options?: TablePluginOptions): EditorPlugin => {
|
|
|
432
457
|
floatingToolbar: getToolbarConfig(
|
|
433
458
|
defaultGetEditorContainerWidth,
|
|
434
459
|
options?.editorAnalyticsAPI,
|
|
460
|
+
options?.getEditorFeatureFlags || defaultGetEditorFeatureFlags,
|
|
435
461
|
)(pluginConfig(options?.tableOptions)),
|
|
436
462
|
},
|
|
437
463
|
};
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
INPUT_METHOD,
|
|
12
12
|
} from '@atlaskit/editor-common/analytics';
|
|
13
13
|
import {
|
|
14
|
+
triggerUnlessTableHeader,
|
|
14
15
|
createTable,
|
|
15
16
|
goToNextCell,
|
|
16
17
|
moveCursorBackward,
|
|
17
|
-
triggerUnlessTableHeader,
|
|
18
18
|
} from '../commands';
|
|
19
19
|
import {
|
|
20
20
|
addRowAroundSelection,
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
* TODO: https://product-fabric.atlassian.net/browse/ED-12714
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
// import { Dispatch } from '../../../event-dispatcher';
|
|
14
13
|
import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
15
14
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
16
15
|
import { EditorState, PluginKey, Transaction } from 'prosemirror-state';
|
|
@@ -19,7 +18,6 @@ import rafSchedule from 'raf-schd';
|
|
|
19
18
|
|
|
20
19
|
import { uuid } from '@atlaskit/adf-schema';
|
|
21
20
|
|
|
22
|
-
// import { stepAddsOneOf } from '../../../utils/step';
|
|
23
21
|
import { stepAddsOneOf } from '@atlaskit/editor-common/utils';
|
|
24
22
|
|
|
25
23
|
interface TableLocalIdPluginState {
|