@atlaskit/editor-plugin-table 1.3.1 → 1.4.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/CHANGELOG.md +15 -0
- package/dist/cjs/plugins/table/commands/misc.js +1 -2
- package/dist/cjs/plugins/table/index.js +25 -34
- package/dist/cjs/plugins/table/transforms/column-width.js +0 -17
- package/dist/cjs/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/cjs/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/cjs/plugins/table/transforms/fix-tables.js +6 -24
- package/dist/cjs/plugins/table/transforms/index.js +0 -13
- package/dist/cjs/plugins/table/transforms/merge.js +5 -20
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +2 -3
- package/dist/es2019/plugins/table/index.js +21 -33
- package/dist/es2019/plugins/table/transforms/column-width.js +0 -17
- package/dist/es2019/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/es2019/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/es2019/plugins/table/transforms/fix-tables.js +0 -14
- package/dist/es2019/plugins/table/transforms/index.js +1 -2
- package/dist/es2019/plugins/table/transforms/merge.js +5 -21
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands/misc.js +2 -3
- package/dist/esm/plugins/table/index.js +25 -34
- package/dist/esm/plugins/table/transforms/column-width.js +0 -17
- package/dist/esm/plugins/table/transforms/delete-columns.js +4 -13
- package/dist/esm/plugins/table/transforms/delete-rows.js +4 -13
- package/dist/esm/plugins/table/transforms/fix-tables.js +0 -17
- package/dist/esm/plugins/table/transforms/index.js +1 -2
- package/dist/esm/plugins/table/transforms/merge.js +5 -21
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/index.d.ts +9 -0
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +0 -1
- package/dist/types/plugins/table/transforms/index.d.ts +1 -2
- package/dist/types-ts4.5/i18n/cs.d.ts +35 -0
- package/dist/types-ts4.5/i18n/da.d.ts +33 -0
- package/dist/types-ts4.5/i18n/de.d.ts +33 -0
- package/dist/types-ts4.5/i18n/en.d.ts +35 -0
- package/dist/types-ts4.5/i18n/en_GB.d.ts +35 -0
- package/dist/types-ts4.5/i18n/es.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/fr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/hu.d.ts +35 -0
- package/dist/types-ts4.5/i18n/it.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ja.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ko.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nb.d.ts +33 -0
- package/dist/types-ts4.5/i18n/nl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pl.d.ts +35 -0
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +35 -0
- package/dist/types-ts4.5/i18n/ru.d.ts +35 -0
- package/dist/types-ts4.5/i18n/sv.d.ts +33 -0
- package/dist/types-ts4.5/i18n/th.d.ts +33 -0
- package/dist/types-ts4.5/i18n/tr.d.ts +35 -0
- package/dist/types-ts4.5/i18n/uk.d.ts +35 -0
- package/dist/types-ts4.5/i18n/vi.d.ts +33 -0
- package/dist/types-ts4.5/i18n/zh.d.ts +35 -0
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +35 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/commands/clear.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/collapse.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/go-to-next-cell.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/commands/hover.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/index.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/insert.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/commands/misc.d.ts +27 -0
- package/dist/types-ts4.5/plugins/table/commands/referentiality.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/commands/selection.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/commands/sort.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/commands/split-cell.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/commands/toggle.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/commands-with-analytics.d.ts +26 -0
- package/dist/types-ts4.5/plugins/table/create-plugin-config.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/event-handlers.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/handlers.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/index.d.ts +30 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/OverflowShadowsObserver.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/TableComponent.d.ts +73 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverflowShadowsObserver.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/__mocks__/OverridableMock.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/table.d.ts +34 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/tableCell.d.ts +19 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/types.d.ts +24 -0
- package/dist/types-ts4.5/plugins/table/nodeviews/update-overflow-shadows.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/plugin.d.ts +7 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-controls.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/column-resizing.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/compose-decorations.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/decorations/utils/types.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/default-table-selection.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/keymap.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/main.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-factory.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/safari-delete-composition-text-issue-workaround.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/commands.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/dom.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.d.ts +72 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin-state.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/plugin.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/types.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/sticky-headers/util.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-local-id.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/commands.d.ts +25 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/event-handlers.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-factory.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/plugin.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/colgroup.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/column-state.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/content-width.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/dom.d.ts +13 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/index.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/misc.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-logic.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/resize-state.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/scale-table.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +22 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-resizing/utils/unit-to-number.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/pm-plugins/table-selection-keymap.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/reducer.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/toolbar.d.ts +37 -0
- package/dist/types-ts4.5/plugins/table/transforms/column-width.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-columns.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/transforms/delete-rows.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/transforms/fix-tables.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/transforms/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/transforms/merge.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/replace-table.d.ts +5 -0
- package/dist/types-ts4.5/plugins/table/transforms/split.d.ts +9 -0
- package/dist/types-ts4.5/plugins/table/types.d.ts +332 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/index.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualButton/styles.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/ContextualMenu.d.ts +88 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/index.d.ts +23 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingContextualMenu/styles.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/DeleteButton.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/getPopUpOptions.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/index.d.ts +54 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingDeleteButton/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/InsertButton.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/getPopupOptions.d.ts +3 -0
- package/dist/types-ts4.5/plugins/table/ui/FloatingInsertButton/index.d.ts +35 -0
- package/dist/types-ts4.5/plugins/table/ui/LayoutButton/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/CornerControls/index.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/NumberColumn/index.d.ts +21 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/RowControls/index.d.ts +17 -0
- package/dist/types-ts4.5/plugins/table/ui/TableFloatingControls/index.d.ts +40 -0
- package/dist/types-ts4.5/plugins/table/ui/common-styles.d.ts +8 -0
- package/dist/types-ts4.5/plugins/table/ui/consts.d.ts +39 -0
- package/dist/types-ts4.5/plugins/table/ui/messages.d.ts +58 -0
- package/dist/types-ts4.5/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types-ts4.5/plugins/table/utils/analytics.d.ts +18 -0
- package/dist/types-ts4.5/plugins/table/utils/collapse.d.ts +29 -0
- package/dist/types-ts4.5/plugins/table/utils/column-controls.d.ts +10 -0
- package/dist/types-ts4.5/plugins/table/utils/decoration.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/utils/dom.d.ts +20 -0
- package/dist/types-ts4.5/plugins/table/utils/get-allow-add-column-custom-step.d.ts +2 -0
- package/dist/types-ts4.5/plugins/table/utils/index.d.ts +11 -0
- package/dist/types-ts4.5/plugins/table/utils/nodes.d.ts +12 -0
- package/dist/types-ts4.5/plugins/table/utils/paste.d.ts +14 -0
- package/dist/types-ts4.5/plugins/table/utils/row-controls.d.ts +16 -0
- package/dist/types-ts4.5/plugins/table/utils/selection.d.ts +6 -0
- package/dist/types-ts4.5/plugins/table/utils/table.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table/utils/update-plugin-state-decorations.d.ts +4 -0
- package/dist/types-ts4.5/plugins/table-plugin.d.ts +2 -0
- package/dist/types-ts4.5/types/i18n.d.ts +5 -0
- package/examples/99-testing.tsx +4 -94
- package/package.json +7 -5
- package/report.api.md +11 -0
- package/src/__tests__/unit/analytics.ts +6 -0
- package/src/__tests__/unit/collab.ts +6 -0
- package/src/__tests__/unit/color-picker.ts +4 -0
- package/src/__tests__/unit/commands/go-to-next-cell.ts +8 -1
- package/src/__tests__/unit/commands/insert.ts +6 -0
- package/src/__tests__/unit/commands/misc.ts +14 -6
- package/src/__tests__/unit/commands/sort.ts +19 -12
- package/src/__tests__/unit/commands.ts +10 -2
- package/src/__tests__/unit/copy-paste.ts +6 -0
- package/src/__tests__/unit/event-handlers/index.ts +13 -8
- package/src/__tests__/unit/event-handlers.ts +13 -1
- package/src/__tests__/unit/fix-tables.ts +8 -4
- package/src/__tests__/unit/get-toolbar-config.ts +4 -0
- package/src/__tests__/unit/handlers.ts +8 -1
- package/src/__tests__/unit/hover-selection.ts +8 -1
- package/src/__tests__/unit/index.ts +10 -2
- package/src/__tests__/unit/keymap.ts +10 -4
- package/src/__tests__/unit/layout.ts +4 -0
- package/src/__tests__/unit/nodeviews/cell.ts +6 -0
- package/src/__tests__/unit/nodeviews/table.ts +16 -9
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +14 -4
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +8 -1
- package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +4 -0
- package/src/__tests__/unit/pm-plugins/main.ts +6 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +8 -4
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +13 -4
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +6 -0
- package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +6 -0
- package/src/__tests__/unit/sort-column.ts +6 -0
- package/src/__tests__/unit/toolbar.ts +16 -9
- package/src/__tests__/unit/transforms/delete-columns.ts +8 -1
- package/src/__tests__/unit/transforms/delete-rows.ts +8 -1
- package/src/__tests__/unit/transforms/merging.ts +8 -1
- package/src/__tests__/unit/ui/ContextualMenu.tsx +8 -4
- package/src/__tests__/unit/ui/CornerControls.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +8 -1
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +8 -1
- package/src/__tests__/unit/ui/RowControls.tsx +8 -1
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +8 -1
- package/src/__tests__/unit/undo-redo.ts +6 -0
- package/src/__tests__/unit/utils/collapse.ts +4 -0
- package/src/__tests__/unit/utils/nodes.ts +8 -1
- package/src/__tests__/unit/utils/row-controls.ts +8 -1
- package/src/__tests__/unit/utils.ts +8 -1
- package/src/plugins/table/commands/misc.ts +2 -4
- package/src/plugins/table/index.tsx +39 -40
- package/src/plugins/table/transforms/column-width.ts +0 -11
- package/src/plugins/table/transforms/delete-columns.ts +4 -5
- package/src/plugins/table/transforms/delete-rows.ts +4 -7
- package/src/plugins/table/transforms/fix-tables.ts +0 -17
- package/src/plugins/table/transforms/index.ts +1 -2
- package/src/plugins/table/transforms/merge.ts +9 -20
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -79
- package/dist/cjs/plugins/table/transforms/metadata.js +0 -20
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/es2019/plugins/table/transforms/metadata.js +0 -12
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +0 -71
- package/dist/esm/plugins/table/transforms/metadata.js +0 -14
- package/dist/types/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.d.ts +0 -4
- package/dist/types/plugins/table/transforms/metadata.d.ts +0 -21
- package/src/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.ts +0 -78
- package/src/plugins/table/transforms/metadata.ts +0 -35
|
@@ -13,6 +13,9 @@ import {
|
|
|
13
13
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
14
14
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
15
15
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
16
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
17
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
18
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
16
19
|
|
|
17
20
|
describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
18
21
|
let editor: any;
|
|
@@ -21,10 +24,11 @@ describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
|
21
24
|
editor = (doc: DocBuilder) =>
|
|
22
25
|
createEditor({
|
|
23
26
|
doc,
|
|
24
|
-
preset: new Preset<LightEditorPlugin>()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
preset: new Preset<LightEditorPlugin>()
|
|
28
|
+
.add([featureFlagsPlugin, {}])
|
|
29
|
+
.add([analyticsPlugin, {}])
|
|
30
|
+
.add(contentInsertionPlugin)
|
|
31
|
+
.add([tablePlugin, { tableOptions: { allowColumnResizing: true } }]),
|
|
28
32
|
pluginKey,
|
|
29
33
|
});
|
|
30
34
|
});
|
|
@@ -18,7 +18,7 @@ import tablePlugin from '../../../../plugins/table';
|
|
|
18
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
|
+
|
|
22
22
|
jest.mock(
|
|
23
23
|
'../../../../plugins/table/pm-plugins/sticky-headers/commands',
|
|
24
24
|
() => ({
|
|
@@ -43,6 +43,9 @@ import {
|
|
|
43
43
|
stickyRowOffsetTop,
|
|
44
44
|
tableScrollbarOffset,
|
|
45
45
|
} from '../../../../plugins/table/ui/consts';
|
|
46
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
47
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
48
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
46
49
|
|
|
47
50
|
describe('TableRowNodeView', () => {
|
|
48
51
|
let tableRowNodeView: TableRowNodeView;
|
|
@@ -54,8 +57,10 @@ describe('TableRowNodeView', () => {
|
|
|
54
57
|
return createEditor({
|
|
55
58
|
doc,
|
|
56
59
|
preset: new Preset<LightEditorPlugin>()
|
|
57
|
-
.add(
|
|
58
|
-
.add([
|
|
60
|
+
.add([featureFlagsPlugin, {}])
|
|
61
|
+
.add([analyticsPlugin, {}])
|
|
62
|
+
.add(contentInsertionPlugin)
|
|
63
|
+
.add(tablePlugin),
|
|
59
64
|
pluginKey,
|
|
60
65
|
attachTo: document.body,
|
|
61
66
|
});
|
|
@@ -82,7 +87,11 @@ describe('TableRowNodeView', () => {
|
|
|
82
87
|
const editorWithTableSticky = (doc: DocBuilder) =>
|
|
83
88
|
createEditor({
|
|
84
89
|
doc,
|
|
85
|
-
preset: new Preset<LightEditorPlugin>()
|
|
90
|
+
preset: new Preset<LightEditorPlugin>()
|
|
91
|
+
.add([featureFlagsPlugin, {}])
|
|
92
|
+
.add([analyticsPlugin, {}])
|
|
93
|
+
.add(contentInsertionPlugin)
|
|
94
|
+
.add(tablePlugin),
|
|
86
95
|
pluginKey,
|
|
87
96
|
});
|
|
88
97
|
const editorData = editorWithTableSticky(
|
|
@@ -30,6 +30,9 @@ import {
|
|
|
30
30
|
akEditorFullPageMaxWidth,
|
|
31
31
|
akEditorDefaultLayoutWidth,
|
|
32
32
|
} from '@atlaskit/editor-shared-styles/consts';
|
|
33
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
34
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
35
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
33
36
|
|
|
34
37
|
describe('table-resizing/event-handlers', () => {
|
|
35
38
|
const editorAnalyticsAPIFake: EditorAnalyticsAPI = {
|
|
@@ -43,6 +46,9 @@ describe('table-resizing/event-handlers', () => {
|
|
|
43
46
|
doc,
|
|
44
47
|
attachTo: document.body,
|
|
45
48
|
preset: new Preset<LightEditorPlugin>()
|
|
49
|
+
.add([featureFlagsPlugin, {}])
|
|
50
|
+
.add([analyticsPlugin, {}])
|
|
51
|
+
.add(contentInsertionPlugin)
|
|
46
52
|
.add([
|
|
47
53
|
tablePlugin,
|
|
48
54
|
{
|
|
@@ -28,6 +28,9 @@ import { TablePluginState } from '../../../plugins/table/types';
|
|
|
28
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
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
32
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
33
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
31
34
|
|
|
32
35
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
33
36
|
describe('table selection keymap', () => {
|
|
@@ -42,6 +45,9 @@ describe('table selection keymap', () => {
|
|
|
42
45
|
|
|
43
46
|
const createEditor = createProsemirrorEditorFactory();
|
|
44
47
|
const preset = new Preset<LightEditorPlugin>()
|
|
48
|
+
.add([featureFlagsPlugin, {}])
|
|
49
|
+
.add([analyticsPlugin, {}])
|
|
50
|
+
.add(contentInsertionPlugin)
|
|
45
51
|
.add(selectionPlugin)
|
|
46
52
|
.add([tablePlugin, { tableOptions: {}, editorSelectionAPI }])
|
|
47
53
|
.add(panelPlugin)
|
|
@@ -26,6 +26,9 @@ import { sortByColumn } from '../../plugins/table/commands';
|
|
|
26
26
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
27
27
|
import tablePlugin from '../../plugins/table-plugin';
|
|
28
28
|
import { PluginKey } from 'prosemirror-state';
|
|
29
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
30
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
31
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
29
32
|
|
|
30
33
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
31
34
|
|
|
@@ -48,6 +51,9 @@ describe('table plugin', () => {
|
|
|
48
51
|
allowColumnSorting: true,
|
|
49
52
|
};
|
|
50
53
|
const preset = new Preset<LightEditorPlugin>()
|
|
54
|
+
.add([featureFlagsPlugin, {}])
|
|
55
|
+
.add([analyticsPlugin, {}])
|
|
56
|
+
.add(contentInsertionPlugin)
|
|
51
57
|
.add([tablePlugin, { tableOptions }])
|
|
52
58
|
.add(textFormattingPlugin)
|
|
53
59
|
.add(blockTypePlugin);
|
|
@@ -31,6 +31,9 @@ import tablePlugin from '../../plugins/table';
|
|
|
31
31
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
32
32
|
import { getMergedCellsPositions } from '../../plugins/table/utils';
|
|
33
33
|
import { getNewResizeStateFromSelectedColumns } from '../../plugins/table/pm-plugins/table-resizing/utils/resize-state';
|
|
34
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
35
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
36
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
34
37
|
|
|
35
38
|
jest.mock('@atlaskit/editor-tables/utils');
|
|
36
39
|
jest.mock('../../plugins/table/transforms');
|
|
@@ -151,16 +154,20 @@ describe('getToolbarMenuConfig', () => {
|
|
|
151
154
|
describe('getToolbarCellOptionsConfig', () => {
|
|
152
155
|
const createEditor = createProsemirrorEditorFactory();
|
|
153
156
|
const props = {
|
|
154
|
-
preset: new Preset<LightEditorPlugin>()
|
|
155
|
-
|
|
156
|
-
{
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
preset: new Preset<LightEditorPlugin>()
|
|
158
|
+
.add([featureFlagsPlugin, {}])
|
|
159
|
+
.add([analyticsPlugin, {}])
|
|
160
|
+
.add(contentInsertionPlugin)
|
|
161
|
+
.add([
|
|
162
|
+
tablePlugin,
|
|
163
|
+
{
|
|
164
|
+
tableOptions: {
|
|
165
|
+
allowDistributeColumns: true,
|
|
166
|
+
allowColumnResizing: true,
|
|
167
|
+
allowColumnSorting: true,
|
|
168
|
+
},
|
|
161
169
|
},
|
|
162
|
-
|
|
163
|
-
]),
|
|
170
|
+
]),
|
|
164
171
|
pluginKey,
|
|
165
172
|
};
|
|
166
173
|
const { editorView } = createEditor({
|
|
@@ -21,6 +21,9 @@ import { getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
|
21
21
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
22
22
|
import { PluginKey } from 'prosemirror-state';
|
|
23
23
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
24
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
25
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
27
|
|
|
25
28
|
const colsToRect = (cols: Array<number>, noOfRows: number): Rect => ({
|
|
26
29
|
left: Math.min(...cols),
|
|
@@ -41,7 +44,11 @@ describe('table plugin -> transforms -> delete columns', () => {
|
|
|
41
44
|
});
|
|
42
45
|
|
|
43
46
|
const createEditor = createProsemirrorEditorFactory();
|
|
44
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
47
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
48
|
+
.add([featureFlagsPlugin, {}])
|
|
49
|
+
.add([analyticsPlugin, {}])
|
|
50
|
+
.add(contentInsertionPlugin)
|
|
51
|
+
.add(tablePlugin);
|
|
45
52
|
|
|
46
53
|
const editor = (doc: DocBuilder) =>
|
|
47
54
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -22,6 +22,9 @@ import { deleteRows } from '../../../plugins/table/transforms';
|
|
|
22
22
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
23
23
|
import { PluginKey } from 'prosemirror-state';
|
|
24
24
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
25
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
27
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
25
28
|
|
|
26
29
|
const rowsToRect = (rows: Array<number>, noOfColumns: number): Rect => ({
|
|
27
30
|
left: 0,
|
|
@@ -41,7 +44,11 @@ describe('table plugin -> transforms -> delete rows', () => {
|
|
|
41
44
|
uuid.setStatic(false);
|
|
42
45
|
});
|
|
43
46
|
const createEditor = createProsemirrorEditorFactory();
|
|
44
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
47
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
48
|
+
.add([featureFlagsPlugin, {}])
|
|
49
|
+
.add([analyticsPlugin, {}])
|
|
50
|
+
.add(contentInsertionPlugin)
|
|
51
|
+
.add(tablePlugin);
|
|
45
52
|
|
|
46
53
|
const editor = (doc: DocBuilder) =>
|
|
47
54
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -18,6 +18,9 @@ import { mergeCells } from '../../../plugins/table/transforms';
|
|
|
18
18
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
19
19
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
20
20
|
import { PluginKey } from 'prosemirror-state';
|
|
21
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
22
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
21
24
|
|
|
22
25
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
23
26
|
|
|
@@ -31,7 +34,11 @@ describe('table plugin -> transforms -> merge cells', () => {
|
|
|
31
34
|
});
|
|
32
35
|
|
|
33
36
|
const createEditor = createProsemirrorEditorFactory();
|
|
34
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
38
|
+
.add([featureFlagsPlugin, {}])
|
|
39
|
+
.add([analyticsPlugin, {}])
|
|
40
|
+
.add(contentInsertionPlugin)
|
|
41
|
+
.add(tablePlugin);
|
|
35
42
|
|
|
36
43
|
const editor = (doc: DocBuilder) =>
|
|
37
44
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -17,6 +17,9 @@ import {
|
|
|
17
17
|
tr,
|
|
18
18
|
} from '@atlaskit/editor-test-helpers/doc-builder';
|
|
19
19
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
20
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
20
23
|
|
|
21
24
|
import { ContextualMenu } from '../../../plugins/table/ui/FloatingContextualMenu/ContextualMenu';
|
|
22
25
|
|
|
@@ -29,10 +32,11 @@ describe('ContextualMenu', () => {
|
|
|
29
32
|
beforeEach(() => {
|
|
30
33
|
({ editorView } = createEditor({
|
|
31
34
|
doc: doc(table()(tr(th()(p('')), th()(p(''))), tr(tdCursor, tdEmpty))),
|
|
32
|
-
preset: new Preset<LightEditorPlugin>()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
preset: new Preset<LightEditorPlugin>()
|
|
36
|
+
.add([featureFlagsPlugin, {}])
|
|
37
|
+
.add([analyticsPlugin, {}])
|
|
38
|
+
.add(contentInsertionPlugin)
|
|
39
|
+
.add([tablePlugin, { tableOptions: { advanced: true } }]),
|
|
36
40
|
}));
|
|
37
41
|
});
|
|
38
42
|
|
|
@@ -19,6 +19,9 @@ import { CornerControls } from '../../../plugins/table/ui/TableFloatingControls/
|
|
|
19
19
|
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
20
20
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
21
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
22
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
23
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
24
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
25
|
|
|
23
26
|
describe('CornerControls', () => {
|
|
24
27
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -26,7 +29,11 @@ describe('CornerControls', () => {
|
|
|
26
29
|
const editor = (doc: DocBuilder) =>
|
|
27
30
|
createEditor({
|
|
28
31
|
doc,
|
|
29
|
-
preset: new Preset<LightEditorPlugin>()
|
|
32
|
+
preset: new Preset<LightEditorPlugin>()
|
|
33
|
+
.add([featureFlagsPlugin, {}])
|
|
34
|
+
.add([analyticsPlugin, {}])
|
|
35
|
+
.add(contentInsertionPlugin)
|
|
36
|
+
.add(tablePlugin),
|
|
30
37
|
pluginKey,
|
|
31
38
|
});
|
|
32
39
|
|
|
@@ -23,13 +23,20 @@ import FloatingContextualButton, {
|
|
|
23
23
|
Props as FloatingContextualButtonProps,
|
|
24
24
|
} from '../../../plugins/table/ui/FloatingContextualButton';
|
|
25
25
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
27
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
28
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
26
29
|
|
|
27
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
28
31
|
let createAnalyticsEvent = jest.fn(() => ({ fire() {} } as UIAnalyticsEvent));
|
|
29
32
|
const editor = (doc: DocBuilder) =>
|
|
30
33
|
createEditor({
|
|
31
34
|
doc,
|
|
32
|
-
preset: new Preset<LightEditorPlugin>()
|
|
35
|
+
preset: new Preset<LightEditorPlugin>()
|
|
36
|
+
.add([featureFlagsPlugin, {}])
|
|
37
|
+
.add([analyticsPlugin, {}])
|
|
38
|
+
.add(contentInsertionPlugin)
|
|
39
|
+
.add(tablePlugin),
|
|
33
40
|
});
|
|
34
41
|
|
|
35
42
|
describe('Floating Contextual Button', () => {
|
|
@@ -20,6 +20,9 @@ import {
|
|
|
20
20
|
import { getPluginState } from '../../../plugins/table/pm-plugins/plugin-factory';
|
|
21
21
|
import FloatingContextualMenu from '../../../plugins/table/ui/FloatingContextualMenu';
|
|
22
22
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
23
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
24
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
25
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
26
|
|
|
24
27
|
describe('FloatingContextualMenu', () => {
|
|
25
28
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -28,7 +31,11 @@ describe('FloatingContextualMenu', () => {
|
|
|
28
31
|
beforeEach(() => {
|
|
29
32
|
({ editorView } = createEditor({
|
|
30
33
|
doc: doc(table()(tr(th()(p('')), th()(p(''))), tr(tdCursor, tdEmpty))),
|
|
31
|
-
preset: new Preset<LightEditorPlugin>()
|
|
34
|
+
preset: new Preset<LightEditorPlugin>()
|
|
35
|
+
.add([featureFlagsPlugin, {}])
|
|
36
|
+
.add([analyticsPlugin, {}])
|
|
37
|
+
.add(contentInsertionPlugin)
|
|
38
|
+
.add(tablePlugin),
|
|
32
39
|
}));
|
|
33
40
|
});
|
|
34
41
|
|
|
@@ -25,6 +25,9 @@ import TableFloatingControls from '../../../plugins/table/ui/TableFloatingContro
|
|
|
25
25
|
import { RowControls } from '../../../plugins/table/ui/TableFloatingControls/RowControls';
|
|
26
26
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
27
27
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
28
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
28
31
|
|
|
29
32
|
describe('RowControls', () => {
|
|
30
33
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -52,7 +55,11 @@ describe('RowControls', () => {
|
|
|
52
55
|
const editor = (doc: DocBuilder) => {
|
|
53
56
|
return createEditor({
|
|
54
57
|
doc,
|
|
55
|
-
preset: new Preset<LightEditorPlugin>()
|
|
58
|
+
preset: new Preset<LightEditorPlugin>()
|
|
59
|
+
.add([featureFlagsPlugin, {}])
|
|
60
|
+
.add([analyticsPlugin, {}])
|
|
61
|
+
.add(contentInsertionPlugin)
|
|
62
|
+
.add(tablePlugin),
|
|
56
63
|
pluginKey,
|
|
57
64
|
});
|
|
58
65
|
};
|
|
@@ -24,11 +24,18 @@ import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
|
24
24
|
import { getDecorations } from '../../../plugins/table/pm-plugins/decorations/plugin';
|
|
25
25
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
26
26
|
import { PluginKey } from 'prosemirror-state';
|
|
27
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
28
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
29
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
30
|
|
|
28
31
|
describe('TableFloatingControls', () => {
|
|
29
32
|
const createEditor = createProsemirrorEditorFactory();
|
|
30
33
|
const fakeGetEditorFeatureFlags = () => ({});
|
|
31
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
34
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
35
|
+
.add([featureFlagsPlugin, {}])
|
|
36
|
+
.add([analyticsPlugin, {}])
|
|
37
|
+
.add(contentInsertionPlugin)
|
|
38
|
+
.add(tablePlugin);
|
|
32
39
|
|
|
33
40
|
const editor = (doc: DocBuilder) =>
|
|
34
41
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -25,6 +25,9 @@ import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
|
25
25
|
import clone from 'lodash/clone';
|
|
26
26
|
import tablePlugin from '../../plugins/table';
|
|
27
27
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
28
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
28
31
|
|
|
29
32
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
30
33
|
|
|
@@ -59,6 +62,9 @@ describe('undo/redo with tables', () => {
|
|
|
59
62
|
return createEditor({
|
|
60
63
|
doc,
|
|
61
64
|
preset: new Preset<LightEditorPlugin>()
|
|
65
|
+
.add([featureFlagsPlugin, {}])
|
|
66
|
+
.add([analyticsPlugin, {}])
|
|
67
|
+
.add(contentInsertionPlugin)
|
|
62
68
|
.add([tablePlugin, { tableOptions }])
|
|
63
69
|
.add(widthPlugin),
|
|
64
70
|
pluginKey: tablePluginKey,
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
collapseSelectedTable,
|
|
20
20
|
} from '../../../plugins/table/utils/collapse';
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
23
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
24
|
|
|
23
25
|
describe('collapse', () => {
|
|
24
26
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -26,6 +28,8 @@ describe('collapse', () => {
|
|
|
26
28
|
const editor = (doc: DocBuilder, expandInPlugins?: boolean) => {
|
|
27
29
|
const preset = new Preset<LightEditorPlugin>()
|
|
28
30
|
.add([featureFlagsPlugin, {}])
|
|
31
|
+
.add([analyticsPlugin, {}])
|
|
32
|
+
.add(contentInsertionPlugin)
|
|
29
33
|
.add(tablePlugin);
|
|
30
34
|
|
|
31
35
|
const finalPreset = expandInPlugins ? preset.add(expandPlugin) : preset;
|
|
@@ -18,6 +18,9 @@ import {
|
|
|
18
18
|
import { containsHeaderColumn } from '../../../plugins/table/utils/nodes';
|
|
19
19
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
20
20
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
21
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
23
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
21
24
|
|
|
22
25
|
describe('table merging logic', () => {
|
|
23
26
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -25,7 +28,11 @@ describe('table merging logic', () => {
|
|
|
25
28
|
const editor = (doc: DocBuilder) =>
|
|
26
29
|
createEditor({
|
|
27
30
|
doc,
|
|
28
|
-
preset: new Preset<LightEditorPlugin>()
|
|
31
|
+
preset: new Preset<LightEditorPlugin>()
|
|
32
|
+
.add([featureFlagsPlugin, {}])
|
|
33
|
+
.add([analyticsPlugin, {}])
|
|
34
|
+
.add(contentInsertionPlugin)
|
|
35
|
+
.add(tablePlugin),
|
|
29
36
|
pluginKey,
|
|
30
37
|
});
|
|
31
38
|
|
|
@@ -19,6 +19,9 @@ import {
|
|
|
19
19
|
import { copyPreviousRow } from '../../../plugins/table/utils/row-controls';
|
|
20
20
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
21
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
22
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
25
|
|
|
23
26
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
24
27
|
|
|
@@ -35,7 +38,11 @@ describe('table plugin: utils/row-controls.js', () => {
|
|
|
35
38
|
const editor = (doc: DocBuilder) =>
|
|
36
39
|
createEditor({
|
|
37
40
|
doc,
|
|
38
|
-
preset: new Preset<LightEditorPlugin>()
|
|
41
|
+
preset: new Preset<LightEditorPlugin>()
|
|
42
|
+
.add([featureFlagsPlugin, {}])
|
|
43
|
+
.add([analyticsPlugin, {}])
|
|
44
|
+
.add(contentInsertionPlugin)
|
|
45
|
+
.add(tablePlugin),
|
|
39
46
|
pluginKey,
|
|
40
47
|
});
|
|
41
48
|
|
|
@@ -28,10 +28,17 @@ import { getColumnsWidths } from '../../plugins/table/utils/column-controls';
|
|
|
28
28
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
29
29
|
import tablePlugin from '../../plugins/table';
|
|
30
30
|
import { PluginKey } from 'prosemirror-state';
|
|
31
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
32
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
33
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
31
34
|
|
|
32
35
|
describe('table plugin: utils', () => {
|
|
33
36
|
const createEditor = createProsemirrorEditorFactory();
|
|
34
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
38
|
+
.add([featureFlagsPlugin, {}])
|
|
39
|
+
.add([analyticsPlugin, {}])
|
|
40
|
+
.add(contentInsertionPlugin)
|
|
41
|
+
.add(tablePlugin);
|
|
35
42
|
|
|
36
43
|
const editor = (doc: DocBuilder) =>
|
|
37
44
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// #region Imports
|
|
2
2
|
import { Node as PMNode, Schema, Slice } from 'prosemirror-model';
|
|
3
|
-
import {
|
|
3
|
+
import { TextSelection, Transaction } from 'prosemirror-state';
|
|
4
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
6
6
|
import {
|
|
@@ -352,10 +352,8 @@ export const setMultipleCellAttrs =
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
if (tr.docChanged && cursorPos !== undefined) {
|
|
355
|
-
const $pos = tr.doc.resolve(tr.mapping.map(cursorPos!));
|
|
356
|
-
|
|
357
355
|
if (dispatch) {
|
|
358
|
-
dispatch(tr
|
|
356
|
+
dispatch(tr);
|
|
359
357
|
}
|
|
360
358
|
return true;
|
|
361
359
|
}
|