@atlaskit/editor-plugin-table 1.5.1 → 1.5.3
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 +12 -0
- package/dist/cjs/plugins/table/index.js +5 -12
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/index.js +5 -16
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/index.js +5 -12
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/table/index.d.ts +6 -1
- package/dist/types-ts4.5/plugins/table/index.d.ts +3 -1
- package/package.json +8 -8
- package/report.api.md +6 -1
- package/src/__tests__/unit/analytics.ts +2 -0
- package/src/__tests__/unit/collab.ts +2 -2
- package/src/__tests__/unit/commands/go-to-next-cell.ts +2 -0
- package/src/__tests__/unit/commands/insert.ts +2 -2
- package/src/__tests__/unit/commands/misc.ts +2 -0
- package/src/__tests__/unit/commands/sort.ts +5 -0
- package/src/__tests__/unit/copy-paste.ts +2 -0
- package/src/__tests__/unit/event-handlers/index.ts +3 -0
- package/src/__tests__/unit/event-handlers.ts +1 -0
- package/src/__tests__/unit/fix-tables.ts +2 -0
- package/src/__tests__/unit/handlers.ts +2 -0
- package/src/__tests__/unit/hover-selection.ts +2 -0
- package/src/__tests__/unit/nodeviews/cell.ts +2 -0
- package/src/__tests__/unit/nodeviews/table.ts +2 -0
- package/src/__tests__/unit/pm-plugins/decorations/column-resizing.ts +2 -0
- package/src/__tests__/unit/pm-plugins/decorations/plugin.ts +2 -0
- package/src/__tests__/unit/pm-plugins/main.ts +2 -0
- package/src/__tests__/unit/pm-plugins/safari-delete-composition-text-issue-workaround.ts +2 -0
- package/src/__tests__/unit/pm-plugins/sticky-headers/tableRow.tsx +3 -0
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +1 -1
- package/src/__tests__/unit/pm-plugins/table-selection-keymap.ts +2 -0
- package/src/__tests__/unit/sort-column.ts +2 -0
- package/src/__tests__/unit/toolbar.ts +2 -0
- package/src/__tests__/unit/transforms/delete-columns.ts +2 -0
- package/src/__tests__/unit/transforms/delete-rows.ts +2 -0
- package/src/__tests__/unit/transforms/merging.ts +2 -0
- package/src/__tests__/unit/ui/ContextualMenu.tsx +2 -0
- package/src/__tests__/unit/ui/CornerControls.tsx +2 -0
- package/src/__tests__/unit/ui/FloatingContextualButton.tsx +2 -0
- package/src/__tests__/unit/ui/FloatingContextualMenu.tsx +2 -0
- package/src/__tests__/unit/ui/RowControls.tsx +2 -0
- package/src/__tests__/unit/ui/TableFloatingControls.tsx +2 -0
- package/src/__tests__/unit/undo-redo.ts +2 -2
- package/src/__tests__/unit/utils/collapse.ts +2 -0
- package/src/__tests__/unit/utils/nodes.ts +2 -0
- package/src/__tests__/unit/utils/row-controls.ts +2 -0
- package/src/__tests__/unit/utils.ts +2 -0
- package/src/plugins/table/index.tsx +10 -15
- package/tmp/api-report-tmp.d.ts +107 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 1.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b38a0fcd924`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b38a0fcd924) - Use NextEditorPlugin API for width plugin in tables.
|
|
8
|
+
|
|
9
|
+
## 1.5.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 1.5.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -43,18 +43,11 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
43
43
|
current: null
|
|
44
44
|
};
|
|
45
45
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
var state = editorViewRef.current.state;
|
|
53
|
-
|
|
54
|
-
// TODO: ED-15663
|
|
55
|
-
// Please, do not copy or use this kind of code below
|
|
56
|
-
// @ts-ignore
|
|
57
|
-
return state['widthPlugin$'];
|
|
46
|
+
var _document$body$offset, _document, _document$body, _api$dependencies$wid;
|
|
47
|
+
var defaultState = {
|
|
48
|
+
width: (_document$body$offset = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
|
|
49
|
+
};
|
|
50
|
+
return (_api$dependencies$wid = api === null || api === void 0 ? void 0 : api.dependencies.width.sharedState.currentState()) !== null && _api$dependencies$wid !== void 0 ? _api$dependencies$wid : defaultState;
|
|
58
51
|
};
|
|
59
52
|
return {
|
|
60
53
|
name: 'table',
|
package/dist/cjs/version.json
CHANGED
|
@@ -34,22 +34,11 @@ const tablesPlugin = (options, api) => {
|
|
|
34
34
|
current: null
|
|
35
35
|
};
|
|
36
36
|
const defaultGetEditorContainerWidth = () => {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
const {
|
|
44
|
-
current: {
|
|
45
|
-
state
|
|
46
|
-
}
|
|
47
|
-
} = editorViewRef;
|
|
48
|
-
|
|
49
|
-
// TODO: ED-15663
|
|
50
|
-
// Please, do not copy or use this kind of code below
|
|
51
|
-
// @ts-ignore
|
|
52
|
-
return state['widthPlugin$'];
|
|
37
|
+
var _document$body$offset, _document, _document$body, _api$dependencies$wid;
|
|
38
|
+
const defaultState = {
|
|
39
|
+
width: (_document$body$offset = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
|
|
40
|
+
};
|
|
41
|
+
return (_api$dependencies$wid = api === null || api === void 0 ? void 0 : api.dependencies.width.sharedState.currentState()) !== null && _api$dependencies$wid !== void 0 ? _api$dependencies$wid : defaultState;
|
|
53
42
|
};
|
|
54
43
|
return {
|
|
55
44
|
name: 'table',
|
package/dist/es2019/version.json
CHANGED
|
@@ -36,18 +36,11 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
36
36
|
current: null
|
|
37
37
|
};
|
|
38
38
|
var defaultGetEditorContainerWidth = function defaultGetEditorContainerWidth() {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
var state = editorViewRef.current.state;
|
|
46
|
-
|
|
47
|
-
// TODO: ED-15663
|
|
48
|
-
// Please, do not copy or use this kind of code below
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
return state['widthPlugin$'];
|
|
39
|
+
var _document$body$offset, _document, _document$body, _api$dependencies$wid;
|
|
40
|
+
var defaultState = {
|
|
41
|
+
width: (_document$body$offset = (_document = document) === null || _document === void 0 ? void 0 : (_document$body = _document.body) === null || _document$body === void 0 ? void 0 : _document$body.offsetWidth) !== null && _document$body$offset !== void 0 ? _document$body$offset : 500
|
|
42
|
+
};
|
|
43
|
+
return (_api$dependencies$wid = api === null || api === void 0 ? void 0 : api.dependencies.width.sharedState.currentState()) !== null && _api$dependencies$wid !== void 0 ? _api$dependencies$wid : defaultState;
|
|
51
44
|
};
|
|
52
45
|
return {
|
|
53
46
|
name: 'table',
|
package/dist/esm/version.json
CHANGED
|
@@ -6,6 +6,7 @@ import { PluginConfig } from './types';
|
|
|
6
6
|
import type { GetEditorFeatureFlags, NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
8
|
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
9
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
10
|
interface TablePluginOptions {
|
|
10
11
|
tableOptions: PluginConfig;
|
|
11
12
|
breakoutEnabled?: boolean;
|
|
@@ -22,6 +23,10 @@ declare const tablesPlugin: NextEditorPlugin<'table', {
|
|
|
22
23
|
actions: {
|
|
23
24
|
insertTable: InsertTableAction;
|
|
24
25
|
};
|
|
25
|
-
dependencies: [
|
|
26
|
+
dependencies: [
|
|
27
|
+
typeof analyticsPlugin,
|
|
28
|
+
typeof contentInsertionPlugin,
|
|
29
|
+
typeof widthPlugin
|
|
30
|
+
];
|
|
26
31
|
}>;
|
|
27
32
|
export default tablesPlugin;
|
|
@@ -6,6 +6,7 @@ import { PluginConfig } from './types';
|
|
|
6
6
|
import type { GetEditorFeatureFlags, NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
8
|
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
9
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
9
10
|
interface TablePluginOptions {
|
|
10
11
|
tableOptions: PluginConfig;
|
|
11
12
|
breakoutEnabled?: boolean;
|
|
@@ -24,7 +25,8 @@ declare const tablesPlugin: NextEditorPlugin<'table', {
|
|
|
24
25
|
};
|
|
25
26
|
dependencies: [
|
|
26
27
|
typeof analyticsPlugin,
|
|
27
|
-
typeof contentInsertionPlugin
|
|
28
|
+
typeof contentInsertionPlugin,
|
|
29
|
+
typeof widthPlugin
|
|
28
30
|
];
|
|
29
31
|
}>;
|
|
30
32
|
export default tablesPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"atlaskit:src": "src/index.ts",
|
|
24
24
|
"atlassian": {
|
|
25
25
|
"team": "Editor",
|
|
26
|
-
"releaseModel": "
|
|
26
|
+
"releaseModel": "continuous"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/adf-schema": "^25.
|
|
30
|
-
"@atlaskit/editor-common": "^74.
|
|
31
|
-
"@atlaskit/editor-palette": "1.4.
|
|
29
|
+
"@atlaskit/adf-schema": "^25.8.0",
|
|
30
|
+
"@atlaskit/editor-common": "^74.5.0",
|
|
31
|
+
"@atlaskit/editor-palette": "1.4.3",
|
|
32
32
|
"@atlaskit/editor-plugin-analytics": "^0.0.1",
|
|
33
33
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.1",
|
|
34
34
|
"@atlaskit/editor-shared-styles": "^2.4.0",
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
65
65
|
"@atlaskit/button": "^16.7.0",
|
|
66
|
-
"@atlaskit/editor-core": "^185.
|
|
66
|
+
"@atlaskit/editor-core": "^185.1.0",
|
|
67
67
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
68
68
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
69
69
|
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
70
|
-
"@atlaskit/editor-plugin-width": "^0.0
|
|
71
|
-
"@atlaskit/editor-test-helpers": "^18.
|
|
70
|
+
"@atlaskit/editor-plugin-width": "^0.1.0",
|
|
71
|
+
"@atlaskit/editor-test-helpers": "^18.6.0",
|
|
72
72
|
"@atlaskit/link-provider": "^1.6.0",
|
|
73
73
|
"@atlaskit/logo": "^13.14.0",
|
|
74
74
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
package/report.api.md
CHANGED
|
@@ -24,6 +24,7 @@ import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
|
24
24
|
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
25
25
|
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
26
26
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
27
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
27
28
|
|
|
28
29
|
// @public (undocumented)
|
|
29
30
|
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
@@ -107,7 +108,11 @@ export const tablesPlugin: NextEditorPlugin<
|
|
|
107
108
|
actions: {
|
|
108
109
|
insertTable: InsertTableAction;
|
|
109
110
|
};
|
|
110
|
-
dependencies: [
|
|
111
|
+
dependencies: [
|
|
112
|
+
typeof analyticsPlugin,
|
|
113
|
+
typeof contentInsertionPlugin,
|
|
114
|
+
typeof widthPlugin,
|
|
115
|
+
];
|
|
111
116
|
}
|
|
112
117
|
>;
|
|
113
118
|
|
|
@@ -46,6 +46,7 @@ import quickInsertPlugin from '@atlaskit/editor-core/src/plugins/quick-insert';
|
|
|
46
46
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
47
47
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
48
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
49
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
49
50
|
|
|
50
51
|
const defaultTableDoc = doc(
|
|
51
52
|
table()(
|
|
@@ -86,6 +87,7 @@ describe('Table analytic events', () => {
|
|
|
86
87
|
.add(typeAheadPlugin)
|
|
87
88
|
.add(contentInsertionPlugin)
|
|
88
89
|
.add(quickInsertPlugin)
|
|
90
|
+
.add(widthPlugin)
|
|
89
91
|
.add([
|
|
90
92
|
tablePlugin,
|
|
91
93
|
{ tableOptions, editorAnalyticsAPI: editorAnalyticsAPIFake },
|
|
@@ -42,8 +42,8 @@ describe('Tables with Collab editing', () => {
|
|
|
42
42
|
.add([featureFlagsPlugin, {}])
|
|
43
43
|
.add([analyticsPlugin, {}])
|
|
44
44
|
.add(contentInsertionPlugin)
|
|
45
|
-
.add(
|
|
46
|
-
.add(
|
|
45
|
+
.add(widthPlugin)
|
|
46
|
+
.add([tablePlugin, { tableOptions }]),
|
|
47
47
|
pluginKey: tablePluginKey,
|
|
48
48
|
});
|
|
49
49
|
};
|
|
@@ -23,6 +23,7 @@ import { goToNextCell } from '../../../plugins/table/commands/go-to-next-cell';
|
|
|
23
23
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
24
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
25
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
26
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
26
27
|
|
|
27
28
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
28
29
|
|
|
@@ -37,6 +38,7 @@ describe('table plugin: goToNextCell', () => {
|
|
|
37
38
|
.add([featureFlagsPlugin, {}])
|
|
38
39
|
.add([analyticsPlugin, {}])
|
|
39
40
|
.add(contentInsertionPlugin)
|
|
41
|
+
.add(widthPlugin)
|
|
40
42
|
.add(tablePlugin);
|
|
41
43
|
const editor = (doc: DocBuilder) =>
|
|
42
44
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -44,13 +44,13 @@ describe('table plugin: insert', () => {
|
|
|
44
44
|
.add([featureFlagsPlugin, {}])
|
|
45
45
|
.add([analyticsPlugin, {}])
|
|
46
46
|
.add(contentInsertionPlugin)
|
|
47
|
+
.add(widthPlugin)
|
|
47
48
|
.add([
|
|
48
49
|
tablePlugin,
|
|
49
50
|
{
|
|
50
51
|
tableOptions: {},
|
|
51
52
|
},
|
|
52
|
-
])
|
|
53
|
-
.add(widthPlugin);
|
|
53
|
+
]);
|
|
54
54
|
|
|
55
55
|
const editor = (doc: DocBuilder) =>
|
|
56
56
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -31,6 +31,7 @@ import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
|
31
31
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
32
32
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
33
33
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
34
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
34
35
|
|
|
35
36
|
describe('table plugin: commands', () => {
|
|
36
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -40,6 +41,7 @@ describe('table plugin: commands', () => {
|
|
|
40
41
|
.add(decorationsPlugin)
|
|
41
42
|
.add(panelPlugin)
|
|
42
43
|
.add(contentInsertionPlugin)
|
|
44
|
+
.add(widthPlugin)
|
|
43
45
|
.add([
|
|
44
46
|
tablePlugin,
|
|
45
47
|
{
|
|
@@ -28,6 +28,7 @@ import datePlugin from '@atlaskit/editor-core/src/plugins/date';
|
|
|
28
28
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
29
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
30
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
31
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
31
32
|
|
|
32
33
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
33
34
|
|
|
@@ -47,6 +48,7 @@ describe('Sort Table', () => {
|
|
|
47
48
|
.add([featureFlagsPlugin, {}])
|
|
48
49
|
.add([analyticsPlugin, {}])
|
|
49
50
|
.add(contentInsertionPlugin)
|
|
51
|
+
.add(widthPlugin)
|
|
50
52
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
51
53
|
doc: doc(
|
|
52
54
|
table()(
|
|
@@ -77,6 +79,7 @@ describe('Sort Table', () => {
|
|
|
77
79
|
.add([featureFlagsPlugin, {}])
|
|
78
80
|
.add([analyticsPlugin, {}])
|
|
79
81
|
.add(contentInsertionPlugin)
|
|
82
|
+
.add(widthPlugin)
|
|
80
83
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
81
84
|
doc: doc(
|
|
82
85
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
@@ -101,6 +104,7 @@ describe('Sort Table', () => {
|
|
|
101
104
|
.add([featureFlagsPlugin, {}])
|
|
102
105
|
.add([analyticsPlugin, {}])
|
|
103
106
|
.add(contentInsertionPlugin)
|
|
107
|
+
.add(widthPlugin)
|
|
104
108
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }]),
|
|
105
109
|
doc: doc(
|
|
106
110
|
table()(tr(td({})(p('2{<>}'))), tr(td({})(p('5'))), tr(td({})(p('4')))),
|
|
@@ -129,6 +133,7 @@ describe('Sort Table', () => {
|
|
|
129
133
|
.add([analyticsPlugin, {}])
|
|
130
134
|
.add(contentInsertionPlugin)
|
|
131
135
|
.add(editorDisabledPlugin)
|
|
136
|
+
.add(widthPlugin)
|
|
132
137
|
.add([tablePlugin, { tableOptions: { allowHeaderRow: true } }])
|
|
133
138
|
.add([statusPlugin, { menuDisabled: false }])
|
|
134
139
|
.add(mentionsPlugin)
|
|
@@ -46,6 +46,7 @@ import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
|
|
|
46
46
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
47
47
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
48
48
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
49
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
49
50
|
|
|
50
51
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
51
52
|
const array = (...args: any): Node[] => args.map((i: any) => i(defaultSchema));
|
|
@@ -107,6 +108,7 @@ describe('table plugin', () => {
|
|
|
107
108
|
.add([featureFlagsPlugin, {}])
|
|
108
109
|
.add([analyticsPlugin, {}])
|
|
109
110
|
.add(contentInsertionPlugin)
|
|
111
|
+
.add(widthPlugin)
|
|
110
112
|
.add([tablePlugin, { tableOptions }])
|
|
111
113
|
.add(undoRedoPlugin);
|
|
112
114
|
|
|
@@ -20,6 +20,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
22
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
23
24
|
|
|
24
25
|
describe('event-handlers', () => {
|
|
25
26
|
let editor: any;
|
|
@@ -32,6 +33,7 @@ describe('event-handlers', () => {
|
|
|
32
33
|
.add([featureFlagsPlugin, {}])
|
|
33
34
|
.add([analyticsPlugin, {}])
|
|
34
35
|
.add(contentInsertionPlugin)
|
|
36
|
+
.add(widthPlugin)
|
|
35
37
|
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
36
38
|
editor = (doc: DocBuilder) =>
|
|
37
39
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -63,6 +65,7 @@ describe('event-handlers', () => {
|
|
|
63
65
|
.add([featureFlagsPlugin, {}])
|
|
64
66
|
.add([analyticsPlugin, {}])
|
|
65
67
|
.add(contentInsertionPlugin)
|
|
68
|
+
.add(widthPlugin)
|
|
66
69
|
.add([tablePlugin, { tableOptions: { allowColumnResizing: false } }]);
|
|
67
70
|
editor = (doc: DocBuilder) =>
|
|
68
71
|
createEditor<TablePluginState, PluginKey>({
|
|
@@ -19,6 +19,7 @@ import tablePlugin from '../../plugins/table-plugin';
|
|
|
19
19
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
20
20
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
21
21
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
22
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
22
23
|
|
|
23
24
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
24
25
|
|
|
@@ -43,6 +44,7 @@ describe('fix tables', () => {
|
|
|
43
44
|
.add([featureFlagsPlugin, {}])
|
|
44
45
|
.add([analyticsPlugin, {}])
|
|
45
46
|
.add(contentInsertionPlugin)
|
|
47
|
+
.add(widthPlugin)
|
|
46
48
|
.add([tablePlugin, { tableOptions }]),
|
|
47
49
|
pluginKey: tablePluginKey,
|
|
48
50
|
});
|
|
@@ -21,6 +21,7 @@ import tablePlugin from '../../plugins/table-plugin';
|
|
|
21
21
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
22
22
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
23
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
25
|
|
|
25
26
|
describe('table action handlers', () => {
|
|
26
27
|
let editor: any;
|
|
@@ -32,6 +33,7 @@ describe('table action handlers', () => {
|
|
|
32
33
|
.add([featureFlagsPlugin, {}])
|
|
33
34
|
.add([analyticsPlugin, {}])
|
|
34
35
|
.add(contentInsertionPlugin)
|
|
36
|
+
.add(widthPlugin)
|
|
35
37
|
.add(tablePlugin);
|
|
36
38
|
|
|
37
39
|
editor = (doc: DocBuilder) =>
|
|
@@ -34,6 +34,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
34
34
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
35
35
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
36
36
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
37
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
37
38
|
|
|
38
39
|
describe('table hover selection plugin', () => {
|
|
39
40
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -41,6 +42,7 @@ describe('table hover selection plugin', () => {
|
|
|
41
42
|
.add([featureFlagsPlugin, {}])
|
|
42
43
|
.add([analyticsPlugin, {}])
|
|
43
44
|
.add(contentInsertionPlugin)
|
|
45
|
+
.add(widthPlugin)
|
|
44
46
|
.add(tablePlugin);
|
|
45
47
|
|
|
46
48
|
const editor = (doc: DocBuilder) =>
|
|
@@ -34,6 +34,7 @@ import undoRedoPlugin from '@atlaskit/editor-core/src/plugins/undo-redo';
|
|
|
34
34
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
35
35
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
36
36
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
37
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
37
38
|
|
|
38
39
|
jest.mock('@atlaskit/editor-common/utils', () => ({
|
|
39
40
|
...jest.requireActual<Object>('@atlaskit/editor-common/utils'),
|
|
@@ -68,6 +69,7 @@ describe('table -> nodeviews -> tableCell.tsx', () => {
|
|
|
68
69
|
.add([featureFlagsPlugin, {}])
|
|
69
70
|
.add([analyticsPlugin, {}])
|
|
70
71
|
.add(contentInsertionPlugin)
|
|
72
|
+
.add(widthPlugin)
|
|
71
73
|
.add([tablePlugin, { tableOptions: { advanced: true, ...props } }])
|
|
72
74
|
.add(undoRedoPlugin),
|
|
73
75
|
pluginKey,
|
|
@@ -24,6 +24,7 @@ import { hoverRows } from '../../../plugins/table/commands';
|
|
|
24
24
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
25
25
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
26
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
27
28
|
|
|
28
29
|
describe('table -> nodeviews -> table.tsx', () => {
|
|
29
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -41,6 +42,7 @@ describe('table -> nodeviews -> table.tsx', () => {
|
|
|
41
42
|
.add([featureFlagsPlugin, {}])
|
|
42
43
|
.add([analyticsPlugin, {}])
|
|
43
44
|
.add(contentInsertionPlugin)
|
|
45
|
+
.add(widthPlugin)
|
|
44
46
|
.add([
|
|
45
47
|
tablePlugin,
|
|
46
48
|
{
|
|
@@ -35,6 +35,7 @@ import {
|
|
|
35
35
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
36
36
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
37
37
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
38
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
38
39
|
|
|
39
40
|
describe('tables: column resizing decorations', () => {
|
|
40
41
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -46,6 +47,7 @@ describe('tables: column resizing decorations', () => {
|
|
|
46
47
|
.add([featureFlagsPlugin, {}])
|
|
47
48
|
.add([analyticsPlugin, {}])
|
|
48
49
|
.add(contentInsertionPlugin)
|
|
50
|
+
.add(widthPlugin)
|
|
49
51
|
.add([
|
|
50
52
|
tablePlugin,
|
|
51
53
|
{
|
|
@@ -27,6 +27,7 @@ import tablePlugin from '../../../../plugins/table';
|
|
|
27
27
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
28
28
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
29
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
30
31
|
|
|
31
32
|
describe('decorations plugin', () => {
|
|
32
33
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -38,6 +39,7 @@ describe('decorations plugin', () => {
|
|
|
38
39
|
.add([featureFlagsPlugin, {}])
|
|
39
40
|
.add([analyticsPlugin, {}])
|
|
40
41
|
.add(contentInsertionPlugin)
|
|
42
|
+
.add(widthPlugin)
|
|
41
43
|
.add(tablePlugin),
|
|
42
44
|
pluginKey,
|
|
43
45
|
});
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
32
32
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
33
33
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
34
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
34
35
|
|
|
35
36
|
describe('tables: main plugin', () => {
|
|
36
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -41,6 +42,7 @@ describe('tables: main plugin', () => {
|
|
|
41
42
|
.add([featureFlagsPlugin, {}])
|
|
42
43
|
.add([analyticsPlugin, {}])
|
|
43
44
|
.add(contentInsertionPlugin)
|
|
45
|
+
.add(widthPlugin)
|
|
44
46
|
.add(tablePlugin)
|
|
45
47
|
.add(textFormattingPlugin),
|
|
46
48
|
pluginKey,
|
|
@@ -16,6 +16,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
16
16
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
17
17
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
18
18
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
19
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
19
20
|
|
|
20
21
|
describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
21
22
|
let editor: any;
|
|
@@ -28,6 +29,7 @@ describe('table/safari-delete-composition-text-issue-workaround', () => {
|
|
|
28
29
|
.add([featureFlagsPlugin, {}])
|
|
29
30
|
.add([analyticsPlugin, {}])
|
|
30
31
|
.add(contentInsertionPlugin)
|
|
32
|
+
.add(widthPlugin)
|
|
31
33
|
.add([tablePlugin, { tableOptions: { allowColumnResizing: true } }]),
|
|
32
34
|
pluginKey,
|
|
33
35
|
});
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
47
47
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
48
48
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
49
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
49
50
|
|
|
50
51
|
describe('TableRowNodeView', () => {
|
|
51
52
|
let tableRowNodeView: TableRowNodeView;
|
|
@@ -60,6 +61,7 @@ describe('TableRowNodeView', () => {
|
|
|
60
61
|
.add([featureFlagsPlugin, {}])
|
|
61
62
|
.add([analyticsPlugin, {}])
|
|
62
63
|
.add(contentInsertionPlugin)
|
|
64
|
+
.add(widthPlugin)
|
|
63
65
|
.add(tablePlugin),
|
|
64
66
|
pluginKey,
|
|
65
67
|
attachTo: document.body,
|
|
@@ -91,6 +93,7 @@ describe('TableRowNodeView', () => {
|
|
|
91
93
|
.add([featureFlagsPlugin, {}])
|
|
92
94
|
.add([analyticsPlugin, {}])
|
|
93
95
|
.add(contentInsertionPlugin)
|
|
96
|
+
.add(widthPlugin)
|
|
94
97
|
.add(tablePlugin),
|
|
95
98
|
pluginKey,
|
|
96
99
|
});
|
|
@@ -51,6 +51,7 @@ describe('table-resizing/event-handlers', () => {
|
|
|
51
51
|
.add([analyticsPlugin, {}])
|
|
52
52
|
.add(contentInsertionPlugin)
|
|
53
53
|
.add(decorationsPlugin)
|
|
54
|
+
.add(widthPlugin)
|
|
54
55
|
.add([
|
|
55
56
|
tablePlugin,
|
|
56
57
|
{
|
|
@@ -58,7 +59,6 @@ describe('table-resizing/event-handlers', () => {
|
|
|
58
59
|
editorAnalyticsAPI: editorAnalyticsAPIFake,
|
|
59
60
|
},
|
|
60
61
|
])
|
|
61
|
-
.add(widthPlugin)
|
|
62
62
|
.add(panelPlugin),
|
|
63
63
|
pluginKey,
|
|
64
64
|
});
|
|
@@ -32,6 +32,7 @@ import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
32
32
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
33
33
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
34
34
|
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
35
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
35
36
|
|
|
36
37
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
37
38
|
describe('table selection keymap', () => {
|
|
@@ -51,6 +52,7 @@ describe('table selection keymap', () => {
|
|
|
51
52
|
.add(contentInsertionPlugin)
|
|
52
53
|
.add(decorationsPlugin)
|
|
53
54
|
.add(selectionPlugin)
|
|
55
|
+
.add(widthPlugin)
|
|
54
56
|
.add([tablePlugin, { tableOptions: {}, editorSelectionAPI }])
|
|
55
57
|
.add(panelPlugin)
|
|
56
58
|
.add([codeBlockPlugin, { appearance: 'full-page' }]);
|
|
@@ -29,6 +29,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
29
29
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
30
30
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
31
31
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
32
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
32
33
|
|
|
33
34
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
34
35
|
|
|
@@ -54,6 +55,7 @@ describe('table plugin', () => {
|
|
|
54
55
|
.add([featureFlagsPlugin, {}])
|
|
55
56
|
.add([analyticsPlugin, {}])
|
|
56
57
|
.add(contentInsertionPlugin)
|
|
58
|
+
.add(widthPlugin)
|
|
57
59
|
.add([tablePlugin, { tableOptions }])
|
|
58
60
|
.add(textFormattingPlugin)
|
|
59
61
|
.add(blockTypePlugin);
|
|
@@ -34,6 +34,7 @@ import { getNewResizeStateFromSelectedColumns } from '../../plugins/table/pm-plu
|
|
|
34
34
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
35
35
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
36
36
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
37
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
37
38
|
|
|
38
39
|
jest.mock('@atlaskit/editor-tables/utils');
|
|
39
40
|
jest.mock('../../plugins/table/transforms');
|
|
@@ -158,6 +159,7 @@ describe('getToolbarCellOptionsConfig', () => {
|
|
|
158
159
|
.add([featureFlagsPlugin, {}])
|
|
159
160
|
.add([analyticsPlugin, {}])
|
|
160
161
|
.add(contentInsertionPlugin)
|
|
162
|
+
.add(widthPlugin)
|
|
161
163
|
.add([
|
|
162
164
|
tablePlugin,
|
|
163
165
|
{
|
|
@@ -24,6 +24,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
24
24
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
25
25
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
26
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
27
28
|
|
|
28
29
|
const colsToRect = (cols: Array<number>, noOfRows: number): Rect => ({
|
|
29
30
|
left: Math.min(...cols),
|
|
@@ -48,6 +49,7 @@ describe('table plugin -> transforms -> delete columns', () => {
|
|
|
48
49
|
.add([featureFlagsPlugin, {}])
|
|
49
50
|
.add([analyticsPlugin, {}])
|
|
50
51
|
.add(contentInsertionPlugin)
|
|
52
|
+
.add(widthPlugin)
|
|
51
53
|
.add(tablePlugin);
|
|
52
54
|
|
|
53
55
|
const editor = (doc: DocBuilder) =>
|
|
@@ -25,6 +25,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
25
25
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
26
26
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
27
27
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
28
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
28
29
|
|
|
29
30
|
const rowsToRect = (rows: Array<number>, noOfColumns: number): Rect => ({
|
|
30
31
|
left: 0,
|
|
@@ -48,6 +49,7 @@ describe('table plugin -> transforms -> delete rows', () => {
|
|
|
48
49
|
.add([featureFlagsPlugin, {}])
|
|
49
50
|
.add([analyticsPlugin, {}])
|
|
50
51
|
.add(contentInsertionPlugin)
|
|
52
|
+
.add(widthPlugin)
|
|
51
53
|
.add(tablePlugin);
|
|
52
54
|
|
|
53
55
|
const editor = (doc: DocBuilder) =>
|
|
@@ -21,6 +21,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
21
21
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
22
22
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
23
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
25
|
|
|
25
26
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
26
27
|
|
|
@@ -38,6 +39,7 @@ describe('table plugin -> transforms -> merge cells', () => {
|
|
|
38
39
|
.add([featureFlagsPlugin, {}])
|
|
39
40
|
.add([analyticsPlugin, {}])
|
|
40
41
|
.add(contentInsertionPlugin)
|
|
42
|
+
.add(widthPlugin)
|
|
41
43
|
.add(tablePlugin);
|
|
42
44
|
|
|
43
45
|
const editor = (doc: DocBuilder) =>
|
|
@@ -20,6 +20,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
22
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
23
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
23
24
|
|
|
24
25
|
import { ContextualMenu } from '../../../plugins/table/ui/FloatingContextualMenu/ContextualMenu';
|
|
25
26
|
|
|
@@ -36,6 +37,7 @@ describe('ContextualMenu', () => {
|
|
|
36
37
|
.add([featureFlagsPlugin, {}])
|
|
37
38
|
.add([analyticsPlugin, {}])
|
|
38
39
|
.add(contentInsertionPlugin)
|
|
40
|
+
.add(widthPlugin)
|
|
39
41
|
.add([tablePlugin, { tableOptions: { advanced: true } }]),
|
|
40
42
|
}));
|
|
41
43
|
});
|
|
@@ -22,6 +22,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
22
22
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
23
23
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
24
24
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
25
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
25
26
|
|
|
26
27
|
describe('CornerControls', () => {
|
|
27
28
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -33,6 +34,7 @@ describe('CornerControls', () => {
|
|
|
33
34
|
.add([featureFlagsPlugin, {}])
|
|
34
35
|
.add([analyticsPlugin, {}])
|
|
35
36
|
.add(contentInsertionPlugin)
|
|
37
|
+
.add(widthPlugin)
|
|
36
38
|
.add(tablePlugin),
|
|
37
39
|
pluginKey,
|
|
38
40
|
});
|
|
@@ -26,6 +26,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
26
26
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
27
27
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
28
28
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
29
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
29
30
|
|
|
30
31
|
const createEditor = createProsemirrorEditorFactory();
|
|
31
32
|
let createAnalyticsEvent = jest.fn(() => ({ fire() {} } as UIAnalyticsEvent));
|
|
@@ -36,6 +37,7 @@ const editor = (doc: DocBuilder) =>
|
|
|
36
37
|
.add([featureFlagsPlugin, {}])
|
|
37
38
|
.add([analyticsPlugin, {}])
|
|
38
39
|
.add(contentInsertionPlugin)
|
|
40
|
+
.add(widthPlugin)
|
|
39
41
|
.add(tablePlugin),
|
|
40
42
|
});
|
|
41
43
|
|
|
@@ -23,6 +23,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
23
23
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
24
24
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
25
25
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
26
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
26
27
|
|
|
27
28
|
describe('FloatingContextualMenu', () => {
|
|
28
29
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -35,6 +36,7 @@ describe('FloatingContextualMenu', () => {
|
|
|
35
36
|
.add([featureFlagsPlugin, {}])
|
|
36
37
|
.add([analyticsPlugin, {}])
|
|
37
38
|
.add(contentInsertionPlugin)
|
|
39
|
+
.add(widthPlugin)
|
|
38
40
|
.add(tablePlugin),
|
|
39
41
|
}));
|
|
40
42
|
});
|
|
@@ -28,6 +28,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
28
28
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
29
29
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
30
30
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
31
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
31
32
|
|
|
32
33
|
describe('RowControls', () => {
|
|
33
34
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -59,6 +60,7 @@ describe('RowControls', () => {
|
|
|
59
60
|
.add([featureFlagsPlugin, {}])
|
|
60
61
|
.add([analyticsPlugin, {}])
|
|
61
62
|
.add(contentInsertionPlugin)
|
|
63
|
+
.add(widthPlugin)
|
|
62
64
|
.add(tablePlugin),
|
|
63
65
|
pluginKey,
|
|
64
66
|
});
|
|
@@ -27,6 +27,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
27
27
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
28
28
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
29
29
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
30
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
30
31
|
|
|
31
32
|
describe('TableFloatingControls', () => {
|
|
32
33
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -35,6 +36,7 @@ describe('TableFloatingControls', () => {
|
|
|
35
36
|
.add([featureFlagsPlugin, {}])
|
|
36
37
|
.add([analyticsPlugin, {}])
|
|
37
38
|
.add(contentInsertionPlugin)
|
|
39
|
+
.add(widthPlugin)
|
|
38
40
|
.add(tablePlugin);
|
|
39
41
|
|
|
40
42
|
const editor = (doc: DocBuilder) =>
|
|
@@ -65,8 +65,8 @@ describe('undo/redo with tables', () => {
|
|
|
65
65
|
.add([featureFlagsPlugin, {}])
|
|
66
66
|
.add([analyticsPlugin, {}])
|
|
67
67
|
.add(contentInsertionPlugin)
|
|
68
|
-
.add(
|
|
69
|
-
.add(
|
|
68
|
+
.add(widthPlugin)
|
|
69
|
+
.add([tablePlugin, { tableOptions }]),
|
|
70
70
|
pluginKey: tablePluginKey,
|
|
71
71
|
});
|
|
72
72
|
};
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import tablePlugin from '../../../plugins/table';
|
|
15
15
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
16
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
16
17
|
|
|
17
18
|
import {
|
|
18
19
|
isTableCollapsible,
|
|
@@ -31,6 +32,7 @@ describe('collapse', () => {
|
|
|
31
32
|
.add([featureFlagsPlugin, {}])
|
|
32
33
|
.add([analyticsPlugin, {}])
|
|
33
34
|
.add(contentInsertionPlugin)
|
|
35
|
+
.add(widthPlugin)
|
|
34
36
|
.add(tablePlugin);
|
|
35
37
|
|
|
36
38
|
const finalPreset = expandInPlugins
|
|
@@ -21,6 +21,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
21
21
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
22
22
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
23
23
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
24
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
25
|
|
|
25
26
|
describe('table merging logic', () => {
|
|
26
27
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -32,6 +33,7 @@ describe('table merging logic', () => {
|
|
|
32
33
|
.add([featureFlagsPlugin, {}])
|
|
33
34
|
.add([analyticsPlugin, {}])
|
|
34
35
|
.add(contentInsertionPlugin)
|
|
36
|
+
.add(widthPlugin)
|
|
35
37
|
.add(tablePlugin),
|
|
36
38
|
pluginKey,
|
|
37
39
|
});
|
|
@@ -22,6 +22,7 @@ import tablePlugin from '../../../plugins/table-plugin';
|
|
|
22
22
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
23
23
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
24
24
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
25
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
25
26
|
|
|
26
27
|
const TABLE_LOCAL_ID = 'test-table-local-id';
|
|
27
28
|
|
|
@@ -42,6 +43,7 @@ describe('table plugin: utils/row-controls.js', () => {
|
|
|
42
43
|
.add([featureFlagsPlugin, {}])
|
|
43
44
|
.add([analyticsPlugin, {}])
|
|
44
45
|
.add(contentInsertionPlugin)
|
|
46
|
+
.add(widthPlugin)
|
|
45
47
|
.add(tablePlugin),
|
|
46
48
|
pluginKey,
|
|
47
49
|
});
|
|
@@ -31,6 +31,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
31
31
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
32
32
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
33
33
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
34
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
34
35
|
|
|
35
36
|
describe('table plugin: utils', () => {
|
|
36
37
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -38,6 +39,7 @@ describe('table plugin: utils', () => {
|
|
|
38
39
|
.add([featureFlagsPlugin, {}])
|
|
39
40
|
.add([analyticsPlugin, {}])
|
|
40
41
|
.add(contentInsertionPlugin)
|
|
42
|
+
.add(widthPlugin)
|
|
41
43
|
.add(tablePlugin);
|
|
42
44
|
|
|
43
45
|
const editor = (doc: DocBuilder) =>
|
|
@@ -70,6 +70,7 @@ import { EditorState, Transaction } from 'prosemirror-state';
|
|
|
70
70
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
71
71
|
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
72
72
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
73
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
73
74
|
|
|
74
75
|
interface TablePluginOptions {
|
|
75
76
|
tableOptions: PluginConfig;
|
|
@@ -94,25 +95,19 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
94
95
|
actions: {
|
|
95
96
|
insertTable: InsertTableAction;
|
|
96
97
|
};
|
|
97
|
-
dependencies: [
|
|
98
|
+
dependencies: [
|
|
99
|
+
typeof analyticsPlugin,
|
|
100
|
+
typeof contentInsertionPlugin,
|
|
101
|
+
typeof widthPlugin,
|
|
102
|
+
];
|
|
98
103
|
}
|
|
99
104
|
> = (options?: TablePluginOptions, api?) => {
|
|
100
105
|
const editorViewRef: Record<'current', EditorView | null> = { current: null };
|
|
101
106
|
const defaultGetEditorContainerWidth: GetEditorContainerWidth = () => {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
const {
|
|
109
|
-
current: { state },
|
|
110
|
-
} = editorViewRef;
|
|
111
|
-
|
|
112
|
-
// TODO: ED-15663
|
|
113
|
-
// Please, do not copy or use this kind of code below
|
|
114
|
-
// @ts-ignore
|
|
115
|
-
return (state as any)['widthPlugin$'];
|
|
107
|
+
const defaultState = {
|
|
108
|
+
width: document?.body?.offsetWidth ?? 500,
|
|
109
|
+
};
|
|
110
|
+
return api?.dependencies.width.sharedState.currentState() ?? defaultState;
|
|
116
111
|
};
|
|
117
112
|
|
|
118
113
|
return {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-table"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
10
|
+
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
11
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
12
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
13
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
14
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
15
|
+
import { TableLayout } from '@atlaskit/adf-schema';
|
|
16
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
17
|
+
|
|
18
|
+
// @public (undocumented)
|
|
19
|
+
type InsertTableAction = (analyticsPayload: AnalyticsEventPayload) => Command;
|
|
20
|
+
|
|
21
|
+
// @public (undocumented)
|
|
22
|
+
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
23
|
+
|
|
24
|
+
// @public (undocumented)
|
|
25
|
+
interface PluginConfig {
|
|
26
|
+
// (undocumented)
|
|
27
|
+
advanced?: boolean;
|
|
28
|
+
// (undocumented)
|
|
29
|
+
allowAddColumnWithCustomStep?: boolean;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
allowBackgroundColor?: boolean;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
allowCollapse?: boolean;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
allowColumnResizing?: boolean;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
allowColumnSorting?: boolean;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
allowControls?: boolean;
|
|
42
|
+
// (undocumented)
|
|
43
|
+
allowDistributeColumns?: boolean;
|
|
44
|
+
// (undocumented)
|
|
45
|
+
allowHeaderColumn?: boolean;
|
|
46
|
+
// (undocumented)
|
|
47
|
+
allowHeaderRow?: boolean;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
allowMergeCells?: boolean;
|
|
50
|
+
// (undocumented)
|
|
51
|
+
allowNumberColumn?: boolean;
|
|
52
|
+
// (undocumented)
|
|
53
|
+
initialRenderOptimization?: boolean;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
isHeaderRowRequired?: boolean;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
mouseMoveOptimization?: boolean;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
stickyHeaders?: boolean;
|
|
62
|
+
// (undocumented)
|
|
63
|
+
stickyHeadersOptimization?: boolean;
|
|
64
|
+
// (undocumented)
|
|
65
|
+
tableCellOptimization?: boolean;
|
|
66
|
+
// (undocumented)
|
|
67
|
+
tableOverflowShadowsOptimization?: boolean;
|
|
68
|
+
// (undocumented)
|
|
69
|
+
tableRenderOptimization?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// @public (undocumented)
|
|
73
|
+
interface TablePluginOptions {
|
|
74
|
+
// (undocumented)
|
|
75
|
+
allowContextualMenu?: boolean;
|
|
76
|
+
// (undocumented)
|
|
77
|
+
breakoutEnabled?: boolean;
|
|
78
|
+
// (undocumented)
|
|
79
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
80
|
+
// (undocumented)
|
|
81
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
82
|
+
// (undocumented)
|
|
83
|
+
fullWidthEnabled?: boolean;
|
|
84
|
+
// (undocumented)
|
|
85
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
86
|
+
// (undocumented)
|
|
87
|
+
tableOptions: PluginConfig;
|
|
88
|
+
// (undocumented)
|
|
89
|
+
wasFullWidthEnabled?: boolean;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// @public (undocumented)
|
|
93
|
+
export const tablesPlugin: NextEditorPlugin<'table', {
|
|
94
|
+
pluginConfiguration: TablePluginOptions | undefined;
|
|
95
|
+
actions: {
|
|
96
|
+
insertTable: InsertTableAction;
|
|
97
|
+
};
|
|
98
|
+
dependencies: [
|
|
99
|
+
typeof analyticsPlugin,
|
|
100
|
+
typeof contentInsertionPlugin,
|
|
101
|
+
typeof widthPlugin
|
|
102
|
+
];
|
|
103
|
+
}>;
|
|
104
|
+
|
|
105
|
+
// (No @packageDocumentation comment for this package)
|
|
106
|
+
|
|
107
|
+
```
|