@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
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
} from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
9
9
|
import { documentWithMergedCells } from './__fixtures__/merged-rows-and-cols-document';
|
|
10
10
|
import { nestedInExtension } from './__fixtures__/nested-in-extension';
|
|
11
|
-
import { TableCssClassName as ClassName } from '
|
|
11
|
+
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
12
12
|
import {
|
|
13
13
|
goToEditorTestingWDExample,
|
|
14
14
|
mountEditor,
|
|
15
15
|
} from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
16
|
-
import messages from '
|
|
16
|
+
import messages from '../../plugins/table/ui/messages';
|
|
17
17
|
import { deleteRow } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
18
18
|
|
|
19
19
|
BrowserTestCase(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/{plugins/table/__tests__ → __tests__}/integration/insert-cell-header-with-strong-mark.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
tableForBulkResizeWithNumberCol,
|
|
28
28
|
} from './__fixtures__/resize-documents';
|
|
29
29
|
import { tableWithMinWidthColumnsDocument } from './__fixtures__/table-with-min-width-columns-document';
|
|
30
|
-
import { pluginKey as tableResizingPluginKey } from '
|
|
30
|
+
import { pluginKey as tableResizingPluginKey } from '../../plugins/table/pm-plugins/table-resizing';
|
|
31
31
|
|
|
32
32
|
import {
|
|
33
33
|
goToEditorTestingWDExample,
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
test.todo('TODO [ED-15027]; restore unit');
|
|
3
|
+
|
|
4
|
+
// //TODO: [ED-15027] remove and relocate this test once the behaviour has been corrected.\
|
|
5
|
+
// import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
6
|
+
// import { BrowserObject } from '@atlaskit/webdriver-runner/wd-wrapper';
|
|
7
|
+
// import {
|
|
8
|
+
// goToEditorTestingWDExample,
|
|
9
|
+
// mountEditor,
|
|
10
|
+
// } from '../../../../__tests__/__helpers/testing-example-helpers';
|
|
11
|
+
|
|
12
|
+
// import {
|
|
13
|
+
// fullpage,
|
|
14
|
+
// expectToMatchSelection,
|
|
15
|
+
// setProseMirrorTextSelection,
|
|
16
|
+
// } from '../../../../__tests__/integration/_helpers';
|
|
17
|
+
// import { WebDriverPage } from '../../../../__tests__/__helpers/page-objects/_types';
|
|
18
|
+
// import adf from './__fixtures__/table-with-multiline-date.adf.json';
|
|
19
|
+
|
|
20
|
+
// describe('table with multiline date', () => {
|
|
21
|
+
// const initEditor = async ({
|
|
22
|
+
// client,
|
|
23
|
+
// selection,
|
|
24
|
+
// adf,
|
|
25
|
+
// }: {
|
|
26
|
+
// client: BrowserObject;
|
|
27
|
+
// selection: { anchor: number; head: number };
|
|
28
|
+
// adf: string;
|
|
29
|
+
// }): Promise<WebDriverPage> => {
|
|
30
|
+
// const page = await goToEditorTestingWDExample(client);
|
|
31
|
+
// const props = {
|
|
32
|
+
// appearance: fullpage.appearance,
|
|
33
|
+
// defaultValue: adf,
|
|
34
|
+
// allowTextAlignment: true,
|
|
35
|
+
// allowTables: {
|
|
36
|
+
// advanced: true,
|
|
37
|
+
// allowColumnResizing: true,
|
|
38
|
+
// },
|
|
39
|
+
// allowDate: true,
|
|
40
|
+
// };
|
|
41
|
+
|
|
42
|
+
// await mountEditor(page, props, undefined, { clickInEditor: false });
|
|
43
|
+
|
|
44
|
+
// await page.waitForSelector('.inlineNodeView');
|
|
45
|
+
|
|
46
|
+
// await setProseMirrorTextSelection(page, selection);
|
|
47
|
+
|
|
48
|
+
// return page;
|
|
49
|
+
// };
|
|
50
|
+
// BrowserTestCase(
|
|
51
|
+
// 'Does not select table corner controls when navigating up from a multiline node inside a table',
|
|
52
|
+
// {
|
|
53
|
+
// skip: ['firefox', 'safari'],
|
|
54
|
+
// },
|
|
55
|
+
// async (client: BrowserObject) => {
|
|
56
|
+
// const page = await initEditor({
|
|
57
|
+
// client,
|
|
58
|
+
// selection: { anchor: 27, head: 27 },
|
|
59
|
+
// adf,
|
|
60
|
+
// });
|
|
61
|
+
|
|
62
|
+
// await page.keys('ArrowUp');
|
|
63
|
+
|
|
64
|
+
// await expectToMatchSelection(page, {
|
|
65
|
+
// type: 'text',
|
|
66
|
+
// anchor: 27,
|
|
67
|
+
// head: 27,
|
|
68
|
+
// });
|
|
69
|
+
// },
|
|
70
|
+
// );
|
|
71
|
+
// });
|
|
@@ -239,9 +239,8 @@ describe('Table analytic events', () => {
|
|
|
239
239
|
);
|
|
240
240
|
|
|
241
241
|
mergeCellsWithAnalytics(editorAnalyticsAPIFake)(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
);
|
|
242
|
+
INPUT_METHOD.CONTEXT_MENU,
|
|
243
|
+
)(editorView.state, editorView.dispatch);
|
|
245
244
|
});
|
|
246
245
|
|
|
247
246
|
it('should fire v3 analytics', () => {
|
|
@@ -273,7 +272,7 @@ describe('Table analytic events', () => {
|
|
|
273
272
|
),
|
|
274
273
|
);
|
|
275
274
|
|
|
276
|
-
splitCellWithAnalytics(editorAnalyticsAPIFake)(
|
|
275
|
+
splitCellWithAnalytics(editorAnalyticsAPIFake)(INPUT_METHOD.CONTEXT_MENU)(
|
|
277
276
|
editorView.state,
|
|
278
277
|
editorView.dispatch,
|
|
279
278
|
);
|
|
@@ -308,11 +307,11 @@ describe('Table analytic events', () => {
|
|
|
308
307
|
),
|
|
309
308
|
);
|
|
310
309
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
);
|
|
310
|
+
setColorWithAnalytics(editorAnalyticsAPIFake)(
|
|
311
|
+
INPUT_METHOD.CONTEXT_MENU,
|
|
312
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
313
|
+
B50,
|
|
314
|
+
)(editorView.state, editorView.dispatch);
|
|
316
315
|
});
|
|
317
316
|
|
|
318
317
|
it('should fire v3 analytics', () => {
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
DocBuilder,
|
|
17
17
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
18
18
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
19
|
-
import tablePlugin from '../../../index';
|
|
20
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
21
|
-
import { TablePluginState } from '../../../types';
|
|
22
|
-
import { goToNextCell } from '../../../commands/go-to-next-cell';
|
|
19
|
+
import tablePlugin from '../../../plugins/table/index';
|
|
20
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
|
+
import { goToNextCell } from '../../../plugins/table/commands/go-to-next-cell';
|
|
23
23
|
|
|
24
24
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
25
25
|
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
17
17
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
18
18
|
|
|
19
|
-
import tablePlugin from '../../../index';
|
|
20
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
21
|
-
import { TablePluginState } from '../../../types';
|
|
22
|
-
import { addColumnAt } from '../../../commands/insert';
|
|
19
|
+
import tablePlugin from '../../../plugins/table/index';
|
|
20
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
|
+
import { addColumnAt } from '../../../plugins/table/commands/insert';
|
|
23
23
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
24
24
|
|
|
25
25
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
@@ -15,12 +15,18 @@ import {
|
|
|
15
15
|
createProsemirrorEditorFactory,
|
|
16
16
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
17
17
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
18
|
+
import {
|
|
19
|
+
selectColumn,
|
|
20
|
+
moveCursorBackward,
|
|
21
|
+
} from '../../../plugins/table/commands';
|
|
22
|
+
import { getDecorations } from '../../../plugins/table/pm-plugins/decorations/plugin';
|
|
23
|
+
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
24
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
25
|
+
import {
|
|
26
|
+
TableDecorations,
|
|
27
|
+
TablePluginState,
|
|
28
|
+
} from '../../../plugins/table/types';
|
|
29
|
+
import tablePlugin from '../../../plugins/table';
|
|
24
30
|
|
|
25
31
|
describe('table plugin: commands', () => {
|
|
26
32
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -48,13 +48,13 @@ import {
|
|
|
48
48
|
toggleHeaderColumn,
|
|
49
49
|
toggleHeaderRow,
|
|
50
50
|
transformSliceToAddTableHeaders,
|
|
51
|
-
} from '../../commands';
|
|
52
|
-
import { splitCell } from '../../commands/split-cell';
|
|
53
|
-
import { wrapTableInExpand } from '../../commands/collapse';
|
|
54
|
-
import { handleCut } from '../../event-handlers';
|
|
55
|
-
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
56
|
-
import { pluginKey } from '../../pm-plugins/plugin-key';
|
|
57
|
-
import tablePlugin from '
|
|
51
|
+
} from '../../plugins/table/commands';
|
|
52
|
+
import { splitCell } from '../../plugins/table/commands/split-cell';
|
|
53
|
+
import { wrapTableInExpand } from '../../plugins/table/commands/collapse';
|
|
54
|
+
import { handleCut } from '../../plugins/table/event-handlers';
|
|
55
|
+
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
56
|
+
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
57
|
+
import tablePlugin from '../../plugins/table';
|
|
58
58
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
59
59
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
60
60
|
import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
it.skip('TODO; restore unit', () => {});
|
|
4
|
+
|
|
5
|
+
// import { _getCopyButtonTestSuite } from '../../../copy-button/__tests__/unit/_getCopyButtonTestSuite';
|
|
6
|
+
// import {
|
|
7
|
+
// doc,
|
|
8
|
+
// p,
|
|
9
|
+
// table,
|
|
10
|
+
// tr,
|
|
11
|
+
// td,
|
|
12
|
+
// } from '@atlaskit/editor-test-helpers/doc-builder';
|
|
13
|
+
|
|
14
|
+
// _getCopyButtonTestSuite({
|
|
15
|
+
// nodeType: 'table',
|
|
16
|
+
// editorOptions: {
|
|
17
|
+
// allowTables: {
|
|
18
|
+
// advanced: true,
|
|
19
|
+
// },
|
|
20
|
+
// },
|
|
21
|
+
// doc: doc(table()(tr(td({})(p())), tr(td({})(p())), tr(td({})(p())))),
|
|
22
|
+
// });
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { MediaAttributes } from '@atlaskit/adf-schema';
|
|
2
2
|
import { TextSelection } from 'prosemirror-state';
|
|
3
3
|
import { createEditorFactory } from '@atlaskit/editor-test-helpers/create-editor';
|
|
4
|
+
import {
|
|
5
|
+
createProsemirrorEditorFactory,
|
|
6
|
+
LightEditorPlugin,
|
|
7
|
+
Preset,
|
|
8
|
+
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
4
9
|
import {
|
|
5
10
|
doc,
|
|
6
11
|
table,
|
|
@@ -24,9 +29,124 @@ import {
|
|
|
24
29
|
showInsertColumnButton,
|
|
25
30
|
addResizeHandleDecorations,
|
|
26
31
|
} from '../../plugins/table/commands';
|
|
32
|
+
import {
|
|
33
|
+
handleMouseOut,
|
|
34
|
+
handleMouseDown,
|
|
35
|
+
} from '../../plugins/table/event-handlers';
|
|
27
36
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
37
|
+
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
28
38
|
import tablePlugin from '../../plugins/table-plugin';
|
|
29
39
|
|
|
40
|
+
describe('table plugin: decorations', () => {
|
|
41
|
+
const createEditor = createProsemirrorEditorFactory();
|
|
42
|
+
const editor = (doc: DocBuilder) =>
|
|
43
|
+
createEditor({
|
|
44
|
+
doc,
|
|
45
|
+
preset: new Preset<LightEditorPlugin>().add(tablePlugin),
|
|
46
|
+
pluginKey,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
describe('#handleMouseDown', () => {
|
|
50
|
+
beforeEach(() => {
|
|
51
|
+
jest.resetAllMocks();
|
|
52
|
+
});
|
|
53
|
+
it('should return true & prevent default behaviour for table wrappers: pm-table-contianer', () => {
|
|
54
|
+
const { editorView } = editor(
|
|
55
|
+
doc(table()(tr(td({})(p())), tr(td({})(p())), tr(td({})(p())))),
|
|
56
|
+
);
|
|
57
|
+
const tableContainer = document.createElement('div');
|
|
58
|
+
tableContainer.className = 'pm-table-container';
|
|
59
|
+
const event = new MouseEvent('mousedown');
|
|
60
|
+
Object.defineProperty(event, 'target', { value: tableContainer });
|
|
61
|
+
const preventDefaultSpy = jest.spyOn(
|
|
62
|
+
MouseEvent.prototype,
|
|
63
|
+
'preventDefault',
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
expect(handleMouseDown(editorView, event)).toEqual(true);
|
|
67
|
+
expect(preventDefaultSpy).toHaveBeenCalledTimes(1);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should return true & prevent default behaviour for table wrappers: pm-table-wrapper', () => {
|
|
71
|
+
const { editorView } = editor(
|
|
72
|
+
doc(table()(tr(td({})(p())), tr(td({})(p())), tr(td({})(p())))),
|
|
73
|
+
);
|
|
74
|
+
const tableContainer = document.createElement('div');
|
|
75
|
+
tableContainer.className = 'pm-table-wrapper';
|
|
76
|
+
const event = new MouseEvent('mousedown');
|
|
77
|
+
Object.defineProperty(event, 'target', { value: tableContainer });
|
|
78
|
+
const preventDefaultSpy = jest.spyOn(
|
|
79
|
+
MouseEvent.prototype,
|
|
80
|
+
'preventDefault',
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
expect(handleMouseDown(editorView, event)).toEqual(true);
|
|
84
|
+
expect(preventDefaultSpy).toHaveBeenCalledTimes(1);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('should return false & not prevent default behaviour for editor content area: ak-editor-content-area', () => {
|
|
88
|
+
const { editorView } = editor(
|
|
89
|
+
doc(table()(tr(td({})(p())), tr(td({})(p())), tr(td({})(p())))),
|
|
90
|
+
);
|
|
91
|
+
const editorContentArea = document.createElement('div');
|
|
92
|
+
editorContentArea.className = 'ak-editor-content-area';
|
|
93
|
+
const event = new MouseEvent('mousedown');
|
|
94
|
+
Object.defineProperty(event, 'target', { value: editorContentArea });
|
|
95
|
+
const preventDefaultSpy = jest.spyOn(
|
|
96
|
+
MouseEvent.prototype,
|
|
97
|
+
'preventDefault',
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
expect(handleMouseDown(editorView, event)).toEqual(false);
|
|
101
|
+
expect(preventDefaultSpy).toHaveBeenCalledTimes(0);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
describe('#handleMouseOut', () => {
|
|
106
|
+
describe('when the target is a resize handle column', () => {
|
|
107
|
+
it('should return true', () => {
|
|
108
|
+
const { editorView } = editor(
|
|
109
|
+
doc(table()(tr(tdCursor, tdEmpty), tr(td()(p('{o}')), tdEmpty))),
|
|
110
|
+
);
|
|
111
|
+
const firstCell = document.createElement('div');
|
|
112
|
+
firstCell.classList.add(ClassName.RESIZE_HANDLE_DECORATION);
|
|
113
|
+
|
|
114
|
+
const spy = jest
|
|
115
|
+
.spyOn(MouseEvent.prototype, 'target', 'get')
|
|
116
|
+
.mockReturnValue(firstCell);
|
|
117
|
+
|
|
118
|
+
const event = new MouseEvent('opa');
|
|
119
|
+
|
|
120
|
+
expect(handleMouseOut(editorView, event)).toEqual(true);
|
|
121
|
+
spy.mockRestore();
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
describe('when the relatedTarget is a resize handle column too', () => {
|
|
126
|
+
it('should return false', () => {
|
|
127
|
+
const { editorView } = editor(
|
|
128
|
+
doc(table()(tr(tdCursor, tdEmpty), tr(td()(p('{o}')), tdEmpty))),
|
|
129
|
+
);
|
|
130
|
+
const firstCell = document.createElement('div');
|
|
131
|
+
firstCell.classList.add(ClassName.RESIZE_HANDLE_DECORATION);
|
|
132
|
+
const secondCell = document.createElement('div');
|
|
133
|
+
secondCell.classList.add(ClassName.RESIZE_HANDLE_DECORATION);
|
|
134
|
+
|
|
135
|
+
const spy = jest
|
|
136
|
+
.spyOn(MouseEvent.prototype, 'target', 'get')
|
|
137
|
+
.mockReturnValue(secondCell);
|
|
138
|
+
|
|
139
|
+
const event = new MouseEvent('opa', {
|
|
140
|
+
relatedTarget: firstCell,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
expect(handleMouseOut(editorView, event)).toEqual(false);
|
|
144
|
+
spy.mockRestore();
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
30
150
|
describe('table event handlers', () => {
|
|
31
151
|
const createEditor = createEditorFactory<TablePluginState>();
|
|
32
152
|
const fakeGetEditorFeatureFlags = () => ({});
|
|
@@ -160,7 +280,6 @@ describe('table event handlers', () => {
|
|
|
160
280
|
collection: testCollectionName,
|
|
161
281
|
};
|
|
162
282
|
const tableAttrs = { localId: 'table' };
|
|
163
|
-
|
|
164
283
|
const { editorView } = editor(
|
|
165
284
|
doc(
|
|
166
285
|
table(tableAttrs)(
|
|
@@ -17,15 +17,16 @@ import {
|
|
|
17
17
|
Preset,
|
|
18
18
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
19
19
|
|
|
20
|
-
import tablePlugin from '
|
|
20
|
+
import tablePlugin from '../../plugins/table';
|
|
21
21
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
22
|
-
import { getToolbarConfig } from '../../toolbar';
|
|
23
|
-
import { setTableRef, setEditorFocus } from '../../commands';
|
|
22
|
+
import { getToolbarConfig } from '../../plugins/table/toolbar';
|
|
23
|
+
import { setTableRef, setEditorFocus } from '../../plugins/table/commands';
|
|
24
24
|
import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
25
25
|
import dataConsumerPlugin from '@atlaskit/editor-core/src/plugins/data-consumer';
|
|
26
26
|
import type {
|
|
27
27
|
FloatingToolbarItem,
|
|
28
28
|
FloatingToolbarButton,
|
|
29
|
+
GetEditorFeatureFlags,
|
|
29
30
|
} from '@atlaskit/editor-common/types';
|
|
30
31
|
|
|
31
32
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
@@ -36,11 +37,15 @@ describe('getToolbarConfig', () => {
|
|
|
36
37
|
const editorAnalyticsAPIFake: EditorAnalyticsAPI = {
|
|
37
38
|
attachAnalyticsEvent: jest.fn().mockReturnValue(() => jest.fn()),
|
|
38
39
|
};
|
|
40
|
+
const getEditorFeatureFlags: GetEditorFeatureFlags = jest
|
|
41
|
+
.fn()
|
|
42
|
+
.mockReturnValue({});
|
|
39
43
|
const getButton = (editorView: EditorView) => {
|
|
40
44
|
const { state } = editorView;
|
|
41
45
|
const config = getToolbarConfig(
|
|
42
46
|
getEditorContainerWidth,
|
|
43
47
|
editorAnalyticsAPIFake,
|
|
48
|
+
getEditorFeatureFlags,
|
|
44
49
|
)({})(state, { formatMessage } as any, {} as any)!;
|
|
45
50
|
//
|
|
46
51
|
expect(config).not.toBeUndefined();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MockIntersectionObserver } from '@atlaskit/editor-test-helpers/mock-intersection-observer';
|
|
2
2
|
|
|
3
|
-
import { OverflowShadowsObserver } from '../../../nodeviews/OverflowShadowsObserver';
|
|
4
|
-
import { ShadowEvent } from '../../../types';
|
|
3
|
+
import { OverflowShadowsObserver } from '../../../plugins/table/nodeviews/OverflowShadowsObserver';
|
|
4
|
+
import { ShadowEvent } from '../../../plugins/table/types';
|
|
5
5
|
|
|
6
6
|
describe('OverflowShadowsObserver', () => {
|
|
7
7
|
let table: HTMLTableElement;
|
|
@@ -3,7 +3,7 @@ import { mount, ReactWrapper, shallow } from 'enzyme';
|
|
|
3
3
|
import { replaceRaf } from 'raf-stub';
|
|
4
4
|
|
|
5
5
|
import { createEditorFactory } from '@atlaskit/editor-test-helpers/create-editor';
|
|
6
|
-
import tablePlugin from '
|
|
6
|
+
import tablePlugin from '../../../plugins/table-plugin';
|
|
7
7
|
import {
|
|
8
8
|
doc,
|
|
9
9
|
p,
|
|
@@ -19,26 +19,26 @@ import { findTable, selectTable } from '@atlaskit/editor-tables/utils';
|
|
|
19
19
|
import {
|
|
20
20
|
TableCssClassName as ClassName,
|
|
21
21
|
TablePluginState,
|
|
22
|
-
} from '../../../types';
|
|
23
|
-
import TableComponent from '../../../nodeviews/TableComponent';
|
|
24
|
-
import { OverflowShadowsObserver } from '../../../nodeviews/OverflowShadowsObserver';
|
|
25
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
22
|
+
} from '../../../plugins/table/types';
|
|
23
|
+
import TableComponent from '../../../plugins/table/nodeviews/TableComponent';
|
|
24
|
+
import { OverflowShadowsObserver } from '../../../plugins/table/nodeviews/OverflowShadowsObserver';
|
|
25
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
26
26
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
27
|
-
import { toggleNumberColumn } from '../../../commands';
|
|
27
|
+
import { toggleNumberColumn } from '../../../plugins/table/commands';
|
|
28
28
|
import {
|
|
29
29
|
pluginKey as stickyHeadersPluginKey,
|
|
30
30
|
StickyPluginState,
|
|
31
|
-
} from '../../../pm-plugins/sticky-headers';
|
|
32
|
-
import { tablesHaveDifferentColumnWidths } from '../../../utils/nodes';
|
|
31
|
+
} from '../../../plugins/table/pm-plugins/sticky-headers';
|
|
32
|
+
import { tablesHaveDifferentColumnWidths } from '../../../plugins/table/utils/nodes';
|
|
33
33
|
|
|
34
|
-
jest.mock('../../../utils/nodes', () =>
|
|
35
|
-
Object.assign({}, jest.requireActual('../../../utils/nodes'), {
|
|
34
|
+
jest.mock('../../../plugins/table/utils/nodes', () =>
|
|
35
|
+
Object.assign({}, jest.requireActual('../../../plugins/table/utils/nodes'), {
|
|
36
36
|
tablesHaveDifferentColumnWidths: jest.fn(),
|
|
37
37
|
}),
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
// with this jest will load mocked class from the relative __mocks__ folder
|
|
41
|
-
jest.mock('../../../nodeviews/OverflowShadowsObserver');
|
|
41
|
+
jest.mock('../../../plugins/table/nodeviews/OverflowShadowsObserver');
|
|
42
42
|
|
|
43
43
|
replaceRaf();
|
|
44
44
|
const requestAnimationFrame = window.requestAnimationFrame as any;
|
|
@@ -11,14 +11,14 @@ import {
|
|
|
11
11
|
DocBuilder,
|
|
12
12
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
13
13
|
import { TableAttributes } from '@atlaskit/adf-schema';
|
|
14
|
-
import { TablePluginState } from '
|
|
15
|
-
import { pluginKey } from '
|
|
16
|
-
import tablePlugin from '
|
|
17
|
-
import TableView from '
|
|
14
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
15
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
16
|
+
import tablePlugin from '../../../plugins/table';
|
|
17
|
+
import TableView from '../../../plugins/table/nodeviews/table';
|
|
18
18
|
import defaultSchema from '@atlaskit/editor-test-helpers/schema';
|
|
19
19
|
import type { EditorProps } from '@atlaskit/editor-core';
|
|
20
20
|
import { EditorView } from 'prosemirror-view';
|
|
21
|
-
import { hoverRows } from '../../../commands';
|
|
21
|
+
import { hoverRows } from '../../../plugins/table/commands';
|
|
22
22
|
|
|
23
23
|
describe('table -> nodeviews -> table.tsx', () => {
|
|
24
24
|
const createEditor = createEditorFactory<TablePluginState>();
|
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-controls.ts
RENAMED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
10
10
|
import { createEditorState } from '@atlaskit/editor-test-helpers/create-editor-state';
|
|
11
11
|
|
|
12
|
-
import { buildColumnControlsDecorations } from '../../../../pm-plugins/decorations/utils';
|
|
13
|
-
import { TableDecorations } from '../../../../types';
|
|
12
|
+
import { buildColumnControlsDecorations } from '../../../../plugins/table/pm-plugins/decorations/utils';
|
|
13
|
+
import { TableDecorations } from '../../../../plugins/table/types';
|
|
14
14
|
|
|
15
15
|
describe('tables: column controls decorations', () => {
|
|
16
16
|
describe('#buildColumnControlsDecorations', () => {
|
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/decorations/column-resizing.ts
RENAMED
|
@@ -20,15 +20,18 @@ import {
|
|
|
20
20
|
DocBuilder,
|
|
21
21
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
22
22
|
|
|
23
|
-
import tablePlugin from '
|
|
23
|
+
import tablePlugin from '../../../../plugins/table';
|
|
24
24
|
import {
|
|
25
25
|
hideResizeHandleLine,
|
|
26
26
|
showResizeHandleLine,
|
|
27
|
-
} from '../../../../commands/hover';
|
|
28
|
-
import { getDecorations } from '../../../../pm-plugins/decorations/plugin';
|
|
29
|
-
import { buildColumnResizingDecorations } from '../../../../pm-plugins/decorations/utils';
|
|
30
|
-
import { pluginKey } from '../../../../pm-plugins/plugin-key';
|
|
31
|
-
import {
|
|
27
|
+
} from '../../../../plugins/table/commands/hover';
|
|
28
|
+
import { getDecorations } from '../../../../plugins/table/pm-plugins/decorations/plugin';
|
|
29
|
+
import { buildColumnResizingDecorations } from '../../../../plugins/table/pm-plugins/decorations/utils';
|
|
30
|
+
import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
31
|
+
import {
|
|
32
|
+
TableDecorations,
|
|
33
|
+
TablePluginState,
|
|
34
|
+
} from '../../../../plugins/table/types';
|
|
32
35
|
|
|
33
36
|
describe('tables: column resizing decorations', () => {
|
|
34
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
DocBuilder,
|
|
17
17
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
18
18
|
|
|
19
|
-
import { selectColumn } from '../../../../commands';
|
|
19
|
+
import { selectColumn } from '../../../../plugins/table/commands';
|
|
20
20
|
import {
|
|
21
21
|
getDecorations,
|
|
22
22
|
handleDocOrSelectionChanged,
|
|
23
|
-
} from '../../../../pm-plugins/decorations/plugin';
|
|
24
|
-
import { pluginKey } from '../../../../pm-plugins/plugin-key';
|
|
25
|
-
import { TableDecorations } from '../../../../types';
|
|
26
|
-
import tablePlugin from '
|
|
23
|
+
} from '../../../../plugins/table/pm-plugins/decorations/plugin';
|
|
24
|
+
import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
25
|
+
import { TableDecorations } from '../../../../plugins/table/types';
|
|
26
|
+
import tablePlugin from '../../../../plugins/table';
|
|
27
27
|
|
|
28
28
|
describe('decorations plugin', () => {
|
|
29
29
|
const createEditor = createProsemirrorEditorFactory();
|
package/src/{plugins/table/__tests__ → __tests__}/unit/pm-plugins/main-with-allow-collapse.ts
RENAMED
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
DocBuilder,
|
|
16
16
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
17
17
|
|
|
18
|
-
import tablePlugin from '
|
|
19
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
20
|
-
import { TablePluginState } from '../../../types';
|
|
21
|
-
import { handleDocOrSelectionChanged } from '../../../handlers';
|
|
18
|
+
import tablePlugin from '../../../plugins/table';
|
|
19
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
20
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
21
|
+
import { handleDocOrSelectionChanged } from '../../../plugins/table/handlers';
|
|
22
22
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
23
23
|
import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
24
24
|
|
|
@@ -15,19 +15,19 @@ import {
|
|
|
15
15
|
import { Selection } from 'prosemirror-state';
|
|
16
16
|
import * as pmUtils from 'prosemirror-utils';
|
|
17
17
|
|
|
18
|
-
import tablePlugin from '
|
|
18
|
+
import tablePlugin from '../../../plugins/table';
|
|
19
19
|
import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
|
|
20
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
21
|
-
import { getPluginState } from '../../../pm-plugins/plugin-factory';
|
|
22
|
-
import { setEditorFocus } from '
|
|
23
|
-
import * as miscCommands from '
|
|
20
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
|
+
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
22
|
+
import { setEditorFocus } from '../../../plugins/table/commands/misc';
|
|
23
|
+
import * as miscCommands from '../../../plugins/table/commands/misc';
|
|
24
24
|
import { NodeType } from 'prosemirror-model';
|
|
25
25
|
import { undo } from 'prosemirror-history';
|
|
26
26
|
import {
|
|
27
27
|
toggleHeaderColumn,
|
|
28
28
|
toggleHeaderRow,
|
|
29
29
|
toggleNumberColumn,
|
|
30
|
-
} from '
|
|
30
|
+
} from '../../../plugins/table/commands';
|
|
31
31
|
|
|
32
32
|
describe('tables: main plugin', () => {
|
|
33
33
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
td,
|
|
8
8
|
tr,
|
|
9
9
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
10
|
-
import { pluginKey } from '../../../pm-plugins/plugin-key';
|
|
11
|
-
import { TablePluginState } from '../../../types';
|
|
10
|
+
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
11
|
+
import { TablePluginState } from '../../../plugins/table/types';
|
|
12
12
|
|
|
13
13
|
describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
14
14
|
let editor: any;
|