@atlaskit/editor-plugin-table 1.3.1 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -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 +8 -6
- 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
|
@@ -20,6 +20,9 @@ import tablePlugin from '../../../plugins/table/index';
|
|
|
20
20
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
21
21
|
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
22
|
import { goToNextCell } from '../../../plugins/table/commands/go-to-next-cell';
|
|
23
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
26
|
|
|
24
27
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
25
28
|
|
|
@@ -30,7 +33,11 @@ describe('table plugin: goToNextCell', () => {
|
|
|
30
33
|
attachAnalyticsEvent: jest.fn().mockReturnValue(() => jest.fn()),
|
|
31
34
|
};
|
|
32
35
|
const createEditor = createProsemirrorEditorFactory();
|
|
33
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
36
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
.add([featureFlagsPlugin, {}])
|
|
38
|
+
.add([analyticsPlugin, {}])
|
|
39
|
+
.add(contentInsertionPlugin)
|
|
40
|
+
.add(tablePlugin);
|
|
34
41
|
const editor = (doc: DocBuilder) =>
|
|
35
42
|
createEditor<TablePluginState, PluginKey>({
|
|
36
43
|
doc,
|
|
@@ -21,6 +21,9 @@ import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
|
21
21
|
import { TablePluginState } from '../../../plugins/table/types';
|
|
22
22
|
import { addColumnAt } from '../../../plugins/table/commands/insert';
|
|
23
23
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
24
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
27
|
|
|
25
28
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
26
29
|
|
|
@@ -38,6 +41,9 @@ describe('table plugin: insert', () => {
|
|
|
38
41
|
const createEditor = createProsemirrorEditorFactory();
|
|
39
42
|
|
|
40
43
|
const preset = new Preset<LightEditorPlugin>()
|
|
44
|
+
.add([featureFlagsPlugin, {}])
|
|
45
|
+
.add([analyticsPlugin, {}])
|
|
46
|
+
.add(contentInsertionPlugin)
|
|
41
47
|
.add([
|
|
42
48
|
tablePlugin,
|
|
43
49
|
{
|
|
@@ -27,15 +27,23 @@ import {
|
|
|
27
27
|
TablePluginState,
|
|
28
28
|
} from '../../../plugins/table/types';
|
|
29
29
|
import tablePlugin from '../../../plugins/table';
|
|
30
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
31
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
32
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
33
|
|
|
31
34
|
describe('table plugin: commands', () => {
|
|
32
35
|
const createEditor = createProsemirrorEditorFactory();
|
|
33
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
37
|
+
.add([featureFlagsPlugin, {}])
|
|
38
|
+
.add([analyticsPlugin, {}])
|
|
39
|
+
.add(panelPlugin)
|
|
40
|
+
.add(contentInsertionPlugin)
|
|
41
|
+
.add([
|
|
42
|
+
tablePlugin,
|
|
43
|
+
{
|
|
44
|
+
tableOptions: { allowHeaderColumn: true },
|
|
45
|
+
},
|
|
46
|
+
]);
|
|
39
47
|
const editor = (doc: DocBuilder) =>
|
|
40
48
|
createEditor<TablePluginState, PluginKey>({
|
|
41
49
|
doc,
|
|
@@ -26,6 +26,8 @@ import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disab
|
|
|
26
26
|
import hyperlinkPlugin from '@atlaskit/editor-core/src/plugins/hyperlink';
|
|
27
27
|
import datePlugin from '@atlaskit/editor-core/src/plugins/date';
|
|
28
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';
|
|
29
31
|
|
|
30
32
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
31
33
|
|
|
@@ -41,10 +43,11 @@ describe('Sort Table', () => {
|
|
|
41
43
|
const createEditor = createProsemirrorEditorFactory();
|
|
42
44
|
it('should test a basic table with heading', () => {
|
|
43
45
|
const { editorView } = createEditor({
|
|
44
|
-
preset: new Preset<LightEditorPlugin>()
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
preset: new Preset<LightEditorPlugin>()
|
|
47
|
+
.add([featureFlagsPlugin, {}])
|
|
48
|
+
.add([analyticsPlugin, {}])
|
|
49
|
+
.add(contentInsertionPlugin)
|
|
50
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
48
51
|
doc: doc(
|
|
49
52
|
table()(
|
|
50
53
|
tr(th({})(p('Number{<>}'))),
|
|
@@ -70,10 +73,11 @@ describe('Sort Table', () => {
|
|
|
70
73
|
|
|
71
74
|
it('should test a basic table descending', () => {
|
|
72
75
|
const { editorView } = createEditor({
|
|
73
|
-
preset: new Preset<LightEditorPlugin>()
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
preset: new Preset<LightEditorPlugin>()
|
|
77
|
+
.add([featureFlagsPlugin, {}])
|
|
78
|
+
.add([analyticsPlugin, {}])
|
|
79
|
+
.add(contentInsertionPlugin)
|
|
80
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
77
81
|
doc: doc(
|
|
78
82
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
79
83
|
),
|
|
@@ -93,10 +97,11 @@ describe('Sort Table', () => {
|
|
|
93
97
|
|
|
94
98
|
it('should test a basic table ascending', () => {
|
|
95
99
|
const { editorView } = createEditor({
|
|
96
|
-
preset: new Preset<LightEditorPlugin>()
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
preset: new Preset<LightEditorPlugin>()
|
|
101
|
+
.add([featureFlagsPlugin, {}])
|
|
102
|
+
.add([analyticsPlugin, {}])
|
|
103
|
+
.add(contentInsertionPlugin)
|
|
104
|
+
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
100
105
|
doc: doc(
|
|
101
106
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
102
107
|
),
|
|
@@ -121,6 +126,8 @@ describe('Sort Table', () => {
|
|
|
121
126
|
({ editorView } = createEditor({
|
|
122
127
|
preset: new Preset<LightEditorPlugin>()
|
|
123
128
|
.add([featureFlagsPlugin, {}])
|
|
129
|
+
.add([analyticsPlugin, {}])
|
|
130
|
+
.add(contentInsertionPlugin)
|
|
124
131
|
.add(editorDisabledPlugin)
|
|
125
132
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }])
|
|
126
133
|
.add([statusPlugin, { menuDisabled: false }])
|
|
@@ -59,8 +59,12 @@ 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';
|
|
61
61
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
62
|
+
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
63
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
62
64
|
import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
|
|
63
65
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
66
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
67
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
64
68
|
|
|
65
69
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
66
70
|
|
|
@@ -80,6 +84,10 @@ describe('table plugin: actions', () => {
|
|
|
80
84
|
attachTo: document.body,
|
|
81
85
|
preset: new Preset<LightEditorPlugin>()
|
|
82
86
|
.add([featureFlagsPlugin, {}])
|
|
87
|
+
.add([analyticsPlugin, {}])
|
|
88
|
+
.add(contentInsertionPlugin)
|
|
89
|
+
.add(widthPlugin)
|
|
90
|
+
.add(gridPlugin)
|
|
83
91
|
.add(tablePlugin)
|
|
84
92
|
.add(panelPlugin)
|
|
85
93
|
.add(textFormattingPlugin)
|
|
@@ -341,12 +349,12 @@ describe('table plugin: actions', () => {
|
|
|
341
349
|
editorView.state,
|
|
342
350
|
dispatch,
|
|
343
351
|
);
|
|
344
|
-
expect(editorView.state
|
|
352
|
+
expect(editorView.state).toEqualDocumentAndSelection(
|
|
345
353
|
doc(
|
|
346
354
|
p('text'),
|
|
347
355
|
table({ localId: TABLE_LOCAL_ID })(
|
|
348
356
|
tr(tdEmpty, tdEmpty, tdEmpty),
|
|
349
|
-
tr(td({ colspan: 2 })(panelNote(p('
|
|
357
|
+
tr(td({ colspan: 2 })(panelNote(p('te{<>}xt'))), tdEmpty),
|
|
350
358
|
),
|
|
351
359
|
),
|
|
352
360
|
);
|
|
@@ -43,6 +43,9 @@ import { transformSliceToRemoveOpenExpand } from '@atlaskit/editor-common/transf
|
|
|
43
43
|
import { Schema } from 'prosemirror-model';
|
|
44
44
|
import tablePlugin from '../../plugins/table-plugin';
|
|
45
45
|
import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
|
|
46
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
47
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
46
49
|
|
|
47
50
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
48
51
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -101,6 +104,9 @@ describe('table plugin', () => {
|
|
|
101
104
|
} as PluginConfig;
|
|
102
105
|
|
|
103
106
|
const preset = new Preset<LightEditorPlugin>()
|
|
107
|
+
.add([featureFlagsPlugin, {}])
|
|
108
|
+
.add([analyticsPlugin, {}])
|
|
109
|
+
.add(contentInsertionPlugin)
|
|
104
110
|
.add([tablePlugin, { tableOptions }])
|
|
105
111
|
.add(undoRedoPlugin);
|
|
106
112
|
|
|
@@ -17,6 +17,9 @@ import { setDragging } from '../../../plugins/table/pm-plugins/table-resizing/co
|
|
|
17
17
|
import { pluginKey } from '../../../plugins/table/pm-plugins/plugin-key';
|
|
18
18
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
19
19
|
import { PluginKey } from 'prosemirror-state';
|
|
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
|
describe('event-handlers', () => {
|
|
22
25
|
let editor: any;
|
|
@@ -25,10 +28,11 @@ describe('event-handlers', () => {
|
|
|
25
28
|
describe('when allowColumnResizing is false', () => {
|
|
26
29
|
beforeEach(() => {
|
|
27
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
28
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
32
|
+
.add([featureFlagsPlugin, {}])
|
|
33
|
+
.add([analyticsPlugin, {}])
|
|
34
|
+
.add(contentInsertionPlugin)
|
|
35
|
+
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
32
36
|
editor = (doc: DocBuilder) =>
|
|
33
37
|
createEditor<TablePluginState, PluginKey>({
|
|
34
38
|
doc,
|
|
@@ -55,10 +59,11 @@ describe('event-handlers', () => {
|
|
|
55
59
|
describe('when allowColumnResizing is true', () => {
|
|
56
60
|
beforeEach(() => {
|
|
57
61
|
const createEditor = createProsemirrorEditorFactory();
|
|
58
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
63
|
+
.add([featureFlagsPlugin, {}])
|
|
64
|
+
.add([analyticsPlugin, {}])
|
|
65
|
+
.add(contentInsertionPlugin)
|
|
66
|
+
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
62
67
|
editor = (doc: DocBuilder) =>
|
|
63
68
|
createEditor<TablePluginState, PluginKey>({
|
|
64
69
|
doc,
|
|
@@ -35,14 +35,22 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
35
35
|
import { TableCssClassName as ClassName } from '../../plugins/table/types';
|
|
36
36
|
import tablePlugin from '../../plugins/table-plugin';
|
|
37
37
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
38
|
+
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
39
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
38
40
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
41
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
42
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
39
43
|
|
|
40
44
|
describe('table plugin: decorations', () => {
|
|
41
45
|
const createEditor = createProsemirrorEditorFactory();
|
|
42
46
|
const editor = (doc: DocBuilder) =>
|
|
43
47
|
createEditor({
|
|
44
48
|
doc,
|
|
45
|
-
preset: new Preset<LightEditorPlugin>()
|
|
49
|
+
preset: new Preset<LightEditorPlugin>()
|
|
50
|
+
.add([featureFlagsPlugin, {}])
|
|
51
|
+
.add([analyticsPlugin, {}])
|
|
52
|
+
.add(contentInsertionPlugin)
|
|
53
|
+
.add(tablePlugin),
|
|
46
54
|
pluginKey,
|
|
47
55
|
});
|
|
48
56
|
|
|
@@ -156,6 +164,10 @@ describe('table event handlers', () => {
|
|
|
156
164
|
attachTo: document.body,
|
|
157
165
|
preset: new Preset<LightEditorPlugin>()
|
|
158
166
|
.add([featureFlagsPlugin, {}])
|
|
167
|
+
.add([analyticsPlugin, {}])
|
|
168
|
+
.add(contentInsertionPlugin)
|
|
169
|
+
.add(widthPlugin)
|
|
170
|
+
.add(gridPlugin)
|
|
159
171
|
.add(tablePlugin)
|
|
160
172
|
.add([
|
|
161
173
|
mediaPlugin,
|
|
@@ -16,6 +16,9 @@ import { PluginConfig } from '../../plugins/table/types';
|
|
|
16
16
|
|
|
17
17
|
import { pluginKey as tablePluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
18
18
|
import tablePlugin from '../../plugins/table-plugin';
|
|
19
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
21
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
19
22
|
|
|
20
23
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
21
24
|
|
|
@@ -36,10 +39,11 @@ describe('fix tables', () => {
|
|
|
36
39
|
return createEditor({
|
|
37
40
|
doc,
|
|
38
41
|
attachTo: document.body,
|
|
39
|
-
preset: new Preset<LightEditorPlugin>()
|
|
40
|
-
|
|
41
|
-
{
|
|
42
|
-
|
|
42
|
+
preset: new Preset<LightEditorPlugin>()
|
|
43
|
+
.add([featureFlagsPlugin, {}])
|
|
44
|
+
.add([analyticsPlugin, {}])
|
|
45
|
+
.add(contentInsertionPlugin)
|
|
46
|
+
.add([tablePlugin, { tableOptions }]),
|
|
43
47
|
pluginKey: tablePluginKey,
|
|
44
48
|
});
|
|
45
49
|
};
|
|
@@ -29,6 +29,8 @@ import type {
|
|
|
29
29
|
GetEditorFeatureFlags,
|
|
30
30
|
} from '@atlaskit/editor-common/types';
|
|
31
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';
|
|
32
34
|
|
|
33
35
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
34
36
|
`${message.id}`;
|
|
@@ -75,6 +77,8 @@ describe('getToolbarConfig', () => {
|
|
|
75
77
|
attachTo: document.body,
|
|
76
78
|
preset: new Preset<LightEditorPlugin>()
|
|
77
79
|
.add([featureFlagsPlugin, {}])
|
|
80
|
+
.add([analyticsPlugin, {}])
|
|
81
|
+
.add(contentInsertionPlugin)
|
|
78
82
|
.add(dataConsumerPlugin)
|
|
79
83
|
.add(extensionPlugin)
|
|
80
84
|
.add(tablePlugin),
|
|
@@ -18,6 +18,9 @@ import { handleDocOrSelectionChanged } from '../../plugins/table/handlers';
|
|
|
18
18
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
19
19
|
import { defaultTableSelection } from '../../plugins/table/pm-plugins/default-table-selection';
|
|
20
20
|
import tablePlugin from '../../plugins/table-plugin';
|
|
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
|
describe('table action handlers', () => {
|
|
23
26
|
let editor: any;
|
|
@@ -25,7 +28,11 @@ describe('table action handlers', () => {
|
|
|
25
28
|
|
|
26
29
|
beforeEach(() => {
|
|
27
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
28
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
31
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
32
|
+
.add([featureFlagsPlugin, {}])
|
|
33
|
+
.add([analyticsPlugin, {}])
|
|
34
|
+
.add(contentInsertionPlugin)
|
|
35
|
+
.add(tablePlugin);
|
|
29
36
|
|
|
30
37
|
editor = (doc: DocBuilder) =>
|
|
31
38
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -31,10 +31,17 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
31
31
|
import { getDecorations } from '../../plugins/table/pm-plugins/decorations/plugin';
|
|
32
32
|
import tablePlugin from '../../plugins/table-plugin';
|
|
33
33
|
import { PluginKey } from 'prosemirror-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
|
describe('table hover selection plugin', () => {
|
|
36
39
|
const createEditor = createProsemirrorEditorFactory();
|
|
37
|
-
const preset = new Preset<LightEditorPlugin>()
|
|
40
|
+
const preset = new Preset<LightEditorPlugin>()
|
|
41
|
+
.add([featureFlagsPlugin, {}])
|
|
42
|
+
.add([analyticsPlugin, {}])
|
|
43
|
+
.add(contentInsertionPlugin)
|
|
44
|
+
.add(tablePlugin);
|
|
38
45
|
|
|
39
46
|
const editor = (doc: DocBuilder) =>
|
|
40
47
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -53,9 +53,12 @@ import {
|
|
|
53
53
|
} from '../../plugins/table/utils';
|
|
54
54
|
import listPlugin from '@atlaskit/editor-core/src/plugins/list';
|
|
55
55
|
import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
|
|
56
|
-
import
|
|
56
|
+
import deprecatedAnalyticsPlugin from '@atlaskit/editor-core/src/plugins/analytics';
|
|
57
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
57
58
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
58
59
|
import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
|
|
60
|
+
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
61
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
59
62
|
import { insertMediaAsMediaSingle } from '@atlaskit/editor-core/src/plugins/media/utils/media-single';
|
|
60
63
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
61
64
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
@@ -63,6 +66,7 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
63
66
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
64
67
|
import tablePlugin from '../../plugins/table-plugin';
|
|
65
68
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
69
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
66
70
|
|
|
67
71
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
68
72
|
|
|
@@ -93,9 +97,13 @@ describe('table plugin', () => {
|
|
|
93
97
|
|
|
94
98
|
const preset = new Preset<LightEditorPlugin>()
|
|
95
99
|
.add([featureFlagsPlugin, {}])
|
|
100
|
+
.add([analyticsPlugin, {}])
|
|
101
|
+
.add([deprecatedAnalyticsPlugin, {}])
|
|
102
|
+
.add(contentInsertionPlugin)
|
|
103
|
+
.add(widthPlugin)
|
|
104
|
+
.add(gridPlugin)
|
|
96
105
|
.add([tablePlugin, { tableOptions }])
|
|
97
106
|
.add([mediaPlugin, { allowMediaSingle: true }])
|
|
98
|
-
.add([analyticsPlugin, {}])
|
|
99
107
|
.add(textFormattingPlugin)
|
|
100
108
|
.add(listPlugin)
|
|
101
109
|
.add(selectionPlugin);
|
|
@@ -36,12 +36,14 @@ import {
|
|
|
36
36
|
import { uuid } from '@atlaskit/adf-schema';
|
|
37
37
|
import { uuid as tablesUuid } from '@atlaskit/editor-tables';
|
|
38
38
|
|
|
39
|
+
import gridPlugin from '@atlaskit/editor-core/src/plugins/grid';
|
|
39
40
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
40
41
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
41
42
|
import tasksDecisionsPlugin from '@atlaskit/editor-core/src/plugins/tasks-and-decisions';
|
|
42
43
|
import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
|
|
43
44
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
44
|
-
import
|
|
45
|
+
import deprecatedAnalyticsPlugin from '@atlaskit/editor-core/src/plugins/analytics';
|
|
46
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
45
47
|
import listPlugin from '@atlaskit/editor-core/src/plugins/list';
|
|
46
48
|
import blockTypePlugin from '@atlaskit/editor-core/src/plugins/block-type';
|
|
47
49
|
import codeBlockPlugin from '@atlaskit/editor-core/src/plugins/code-block';
|
|
@@ -59,6 +61,7 @@ import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
|
59
61
|
import widthPlugin from '@atlaskit/editor-core/src/plugins/width';
|
|
60
62
|
import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disabled';
|
|
61
63
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
64
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
62
65
|
|
|
63
66
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
64
67
|
|
|
@@ -83,6 +86,11 @@ describe('table keymap', () => {
|
|
|
83
86
|
const createEditor = createProsemirrorEditorFactory();
|
|
84
87
|
const preset = new Preset<LightEditorPlugin>()
|
|
85
88
|
.add([featureFlagsPlugin, {}])
|
|
89
|
+
.add([analyticsPlugin, { createAnalyticsEvent }])
|
|
90
|
+
.add([deprecatedAnalyticsPlugin, { createAnalyticsEvent }])
|
|
91
|
+
.add(contentInsertionPlugin)
|
|
92
|
+
.add(widthPlugin)
|
|
93
|
+
.add(gridPlugin)
|
|
86
94
|
.add(selectionPlugin)
|
|
87
95
|
.add([
|
|
88
96
|
tablePlugin,
|
|
@@ -103,9 +111,7 @@ describe('table keymap', () => {
|
|
|
103
111
|
.add(datePlugin)
|
|
104
112
|
.add(layoutPlugin)
|
|
105
113
|
.add([statusPlugin, { menuDisabled: false }])
|
|
106
|
-
.add([mediaPlugin, { allowMediaSingle: true }])
|
|
107
|
-
.add([analyticsPlugin, { createAnalyticsEvent }])
|
|
108
|
-
.add(widthPlugin);
|
|
114
|
+
.add([mediaPlugin, { allowMediaSingle: true }]);
|
|
109
115
|
|
|
110
116
|
const editor = (doc: DocBuilder) =>
|
|
111
117
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -36,6 +36,8 @@ import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
|
36
36
|
import layoutPlugin from '@atlaskit/editor-core/src/plugins/layout';
|
|
37
37
|
import { PluginKey } from 'prosemirror-state';
|
|
38
38
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
39
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
40
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
39
41
|
|
|
40
42
|
describe('table toolbar', () => {
|
|
41
43
|
const tableOptions = {
|
|
@@ -48,6 +50,8 @@ describe('table toolbar', () => {
|
|
|
48
50
|
const createEditor = createProsemirrorEditorFactory();
|
|
49
51
|
const preset = new Preset<LightEditorPlugin>()
|
|
50
52
|
.add([featureFlagsPlugin, {}])
|
|
53
|
+
.add([analyticsPlugin, {}])
|
|
54
|
+
.add(contentInsertionPlugin)
|
|
51
55
|
.add([tablePlugin, { tableOptions }])
|
|
52
56
|
.add(expandPlugin)
|
|
53
57
|
.add(extensionPlugin)
|
|
@@ -31,6 +31,9 @@ import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
|
31
31
|
import * as domHelpers from '../../../plugins/table/pm-plugins/sticky-headers/nodeviews/dom';
|
|
32
32
|
import tablePlugin from '../../../plugins/table-plugin';
|
|
33
33
|
import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
|
|
34
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
35
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
36
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
34
37
|
|
|
35
38
|
jest.mock('@atlaskit/editor-common/utils', () => ({
|
|
36
39
|
...jest.requireActual<Object>('@atlaskit/editor-common/utils'),
|
|
@@ -62,6 +65,9 @@ describe('table -> nodeviews -> tableCell.tsx', () => {
|
|
|
62
65
|
doc,
|
|
63
66
|
attachTo: document.body,
|
|
64
67
|
preset: new Preset<LightEditorPlugin>()
|
|
68
|
+
.add([featureFlagsPlugin, {}])
|
|
69
|
+
.add([analyticsPlugin, {}])
|
|
70
|
+
.add(contentInsertionPlugin)
|
|
65
71
|
.add([tablePlugin, { tableOptions: { advanced: true, ...props } }])
|
|
66
72
|
.add(undoRedoPlugin),
|
|
67
73
|
pluginKey,
|
|
@@ -21,6 +21,9 @@ import TableView from '../../../plugins/table/nodeviews/table';
|
|
|
21
21
|
import defaultSchema from '@atlaskit/editor-test-helpers/schema';
|
|
22
22
|
import { EditorView } from 'prosemirror-view';
|
|
23
23
|
import { hoverRows } from '../../../plugins/table/commands';
|
|
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
|
describe('table -> nodeviews -> table.tsx', () => {
|
|
26
29
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -34,15 +37,19 @@ describe('table -> nodeviews -> table.tsx', () => {
|
|
|
34
37
|
const editor = (doc: DocBuilder) =>
|
|
35
38
|
createEditor({
|
|
36
39
|
doc,
|
|
37
|
-
preset: new Preset<LightEditorPlugin>()
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
preset: new Preset<LightEditorPlugin>()
|
|
41
|
+
.add([featureFlagsPlugin, {}])
|
|
42
|
+
.add([analyticsPlugin, {}])
|
|
43
|
+
.add(contentInsertionPlugin)
|
|
44
|
+
.add([
|
|
45
|
+
tablePlugin,
|
|
46
|
+
{
|
|
47
|
+
tableOptions: {},
|
|
48
|
+
getEditorFeatureFlags: () => ({
|
|
49
|
+
tableRenderOptimization: true,
|
|
50
|
+
}),
|
|
51
|
+
},
|
|
52
|
+
]),
|
|
46
53
|
pluginKey,
|
|
47
54
|
});
|
|
48
55
|
|
|
@@ -32,6 +32,9 @@ import {
|
|
|
32
32
|
TableDecorations,
|
|
33
33
|
TablePluginState,
|
|
34
34
|
} from '../../../../plugins/table/types';
|
|
35
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
36
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
37
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
35
38
|
|
|
36
39
|
describe('tables: column resizing decorations', () => {
|
|
37
40
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -39,10 +42,17 @@ describe('tables: column resizing decorations', () => {
|
|
|
39
42
|
const editor = (doc: DocBuilder) =>
|
|
40
43
|
createEditor<TablePluginState, PluginKey>({
|
|
41
44
|
doc,
|
|
42
|
-
preset: new Preset<LightEditorPlugin>()
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
preset: new Preset<LightEditorPlugin>()
|
|
46
|
+
.add([featureFlagsPlugin, {}])
|
|
47
|
+
.add([analyticsPlugin, {}])
|
|
48
|
+
.add(contentInsertionPlugin)
|
|
49
|
+
.add([
|
|
50
|
+
tablePlugin,
|
|
51
|
+
{
|
|
52
|
+
tableOptions: { allowColumnResizing: true },
|
|
53
|
+
getEditorFeatureFlags,
|
|
54
|
+
},
|
|
55
|
+
]),
|
|
46
56
|
pluginKey,
|
|
47
57
|
});
|
|
48
58
|
|
|
@@ -24,6 +24,9 @@ import {
|
|
|
24
24
|
import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
25
25
|
import { TableDecorations } from '../../../../plugins/table/types';
|
|
26
26
|
import tablePlugin from '../../../../plugins/table';
|
|
27
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
28
|
+
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
30
|
|
|
28
31
|
describe('decorations plugin', () => {
|
|
29
32
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -31,7 +34,11 @@ describe('decorations plugin', () => {
|
|
|
31
34
|
createEditor({
|
|
32
35
|
doc,
|
|
33
36
|
attachTo: document.body,
|
|
34
|
-
preset: new Preset<LightEditorPlugin>()
|
|
37
|
+
preset: new Preset<LightEditorPlugin>()
|
|
38
|
+
.add([featureFlagsPlugin, {}])
|
|
39
|
+
.add([analyticsPlugin, {}])
|
|
40
|
+
.add(contentInsertionPlugin)
|
|
41
|
+
.add(tablePlugin),
|
|
35
42
|
pluginKey,
|
|
36
43
|
});
|
|
37
44
|
|
|
@@ -22,6 +22,8 @@ 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
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
|
+
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
|
+
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
25
27
|
|
|
26
28
|
describe('tables: main plugin with allowCollapse: true', () => {
|
|
27
29
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -30,6 +32,8 @@ describe('tables: main plugin with allowCollapse: true', () => {
|
|
|
30
32
|
doc,
|
|
31
33
|
preset: new Preset<LightEditorPlugin>()
|
|
32
34
|
.add([featureFlagsPlugin, {}])
|
|
35
|
+
.add([analyticsPlugin, {}])
|
|
36
|
+
.add(contentInsertionPlugin)
|
|
33
37
|
.add(tablePlugin)
|
|
34
38
|
.add(expandPlugin)
|
|
35
39
|
.add(extensionPlugin),
|
|
@@ -28,6 +28,9 @@ import {
|
|
|
28
28
|
toggleHeaderRow,
|
|
29
29
|
toggleNumberColumn,
|
|
30
30
|
} from '../../../plugins/table/commands';
|
|
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('tables: main plugin', () => {
|
|
33
36
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -35,6 +38,9 @@ describe('tables: main plugin', () => {
|
|
|
35
38
|
createEditor({
|
|
36
39
|
doc,
|
|
37
40
|
preset: new Preset<LightEditorPlugin>()
|
|
41
|
+
.add([featureFlagsPlugin, {}])
|
|
42
|
+
.add([analyticsPlugin, {}])
|
|
43
|
+
.add(contentInsertionPlugin)
|
|
38
44
|
.add(tablePlugin)
|
|
39
45
|
.add(textFormattingPlugin),
|
|
40
46
|
pluginKey,
|