@atlaskit/editor-plugin-table 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cjs/plugins/table/index.js +3 -1
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +5 -0
- package/dist/cjs/plugins/table/nodeviews/table.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/index.js +4 -2
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +5 -0
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/index.js +4 -2
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +5 -0
- package/dist/esm/plugins/table/nodeviews/table.js +2 -1
- package/dist/esm/version.json +1 -1
- package/package.json +13 -5
- package/src/__tests__/integration/auto-size.ts +6 -2
- package/src/__tests__/integration/sticky-header.ts +1 -4
- package/src/__tests__/unit/collab.ts +1 -1
- package/src/__tests__/unit/color-picker.ts +2 -0
- package/src/__tests__/unit/commands/insert.ts +1 -1
- package/src/__tests__/unit/commands.ts +2 -2
- package/src/__tests__/unit/event-handlers.ts +2 -2
- package/src/__tests__/unit/get-toolbar-config.ts +2 -0
- package/src/__tests__/unit/index.ts +2 -2
- package/src/__tests__/unit/keymap.ts +2 -2
- package/src/__tests__/unit/layout.ts +2 -0
- package/src/__tests__/unit/pm-plugins/main-with-allow-collapse.ts +2 -0
- package/src/__tests__/unit/pm-plugins/table-resizing/event-handlers.ts +1 -1
- package/src/__tests__/unit/undo-redo.ts +1 -1
- package/src/plugins/table/index.tsx +13 -2
- package/src/plugins/table/nodeviews/TableComponent.tsx +6 -0
- package/src/plugins/table/nodeviews/table.tsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 1.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`20809d41658`](https://bitbucket.org/atlassian/atlassian-frontend/commits/20809d41658) - Added feature flag `platform.editor.custom-table-width` which toggles the new table experience
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [`1549c2e6dda`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1549c2e6dda) - Extract width plugin from `editor-core` to separate `editor-plugin-width` package.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 1.4.1
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -34,6 +34,7 @@ var _FloatingInsertButton = _interopRequireDefault(require("./ui/FloatingInsertB
|
|
|
34
34
|
var _LayoutButton = _interopRequireDefault(require("./ui/LayoutButton"));
|
|
35
35
|
var _utils3 = require("./utils");
|
|
36
36
|
var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
|
|
37
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
37
38
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
38
39
|
return {};
|
|
39
40
|
};
|
|
@@ -77,9 +78,10 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
nodes: function nodes() {
|
|
81
|
+
var tableNode = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? _adfSchema.tableWithCustomWidth : _adfSchema.table;
|
|
80
82
|
return [{
|
|
81
83
|
name: 'table',
|
|
82
|
-
node:
|
|
84
|
+
node: tableNode
|
|
83
85
|
}, {
|
|
84
86
|
name: 'tableHeader',
|
|
85
87
|
node: _adfSchema.tableHeader
|
|
@@ -16,6 +16,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
16
16
|
var _classnames2 = _interopRequireDefault(require("classnames"));
|
|
17
17
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
18
18
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
19
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
20
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
20
21
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
21
22
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
@@ -481,6 +482,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
481
482
|
visibility: visible ? 'visible' : 'hidden'
|
|
482
483
|
};
|
|
483
484
|
}) : NOOP;
|
|
485
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width')) {
|
|
486
|
+
// new table experience code goes here
|
|
487
|
+
// return <Resizer>...
|
|
488
|
+
}
|
|
484
489
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
485
490
|
style: {
|
|
486
491
|
width: tableContainerWidth,
|
|
@@ -33,7 +33,8 @@ var tableAttributes = function tableAttributes(node) {
|
|
|
33
33
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
34
34
|
'data-layout': node.attrs.layout,
|
|
35
35
|
'data-autosize': node.attrs.__autoSize,
|
|
36
|
-
'data-table-local-id': node.attrs.localId || ''
|
|
36
|
+
'data-table-local-id': node.attrs.localId || '',
|
|
37
|
+
'data-table-width': node.attrs.width
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
40
|
var toDOM = function toDOM(node, props) {
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,7 +3,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
3
3
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
5
5
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { table, tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
6
|
+
import { table, tableCell, tableHeader, tableRow, tableWithCustomWidth } from '@atlaskit/adf-schema';
|
|
7
7
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
@@ -27,6 +27,7 @@ import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
|
27
27
|
import LayoutButton from './ui/LayoutButton';
|
|
28
28
|
import { isLayoutSupported } from './utils';
|
|
29
29
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
30
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
30
31
|
const defaultGetEditorFeatureFlags = () => ({});
|
|
31
32
|
const tablesPlugin = (options, api) => {
|
|
32
33
|
const editorViewRef = {
|
|
@@ -70,9 +71,10 @@ const tablesPlugin = (options, api) => {
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
nodes() {
|
|
74
|
+
const tableNode = getBooleanFF('platform.editor.custom-table-width') ? tableWithCustomWidth : table;
|
|
73
75
|
return [{
|
|
74
76
|
name: 'table',
|
|
75
|
-
node:
|
|
77
|
+
node: tableNode
|
|
76
78
|
}, {
|
|
77
79
|
name: 'tableHeader',
|
|
78
80
|
node: tableHeader
|
|
@@ -4,6 +4,7 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
6
6
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { calcTableWidth, tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
8
9
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
9
10
|
import { akEditorMobileBreakoutPoint, akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -484,6 +485,10 @@ class TableComponent extends React.Component {
|
|
|
484
485
|
const shadowStyle = tableOverflowShadowsOptimization ? memoizeOne(visible => ({
|
|
485
486
|
visibility: visible ? 'visible' : 'hidden'
|
|
486
487
|
})) : NOOP;
|
|
488
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
489
|
+
// new table experience code goes here
|
|
490
|
+
// return <Resizer>...
|
|
491
|
+
}
|
|
487
492
|
return /*#__PURE__*/React.createElement("div", {
|
|
488
493
|
style: {
|
|
489
494
|
width: tableContainerWidth,
|
|
@@ -15,7 +15,8 @@ const tableAttributes = node => {
|
|
|
15
15
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
16
16
|
'data-layout': node.attrs.layout,
|
|
17
17
|
'data-autosize': node.attrs.__autoSize,
|
|
18
|
-
'data-table-local-id': node.attrs.localId || ''
|
|
18
|
+
'data-table-local-id': node.attrs.localId || '',
|
|
19
|
+
'data-table-width': node.attrs.width
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
const toDOM = (node, props) => {
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,7 +3,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
3
3
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
5
5
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { table, tableCell, tableHeader, tableRow } from '@atlaskit/adf-schema';
|
|
6
|
+
import { table, tableCell, tableHeader, tableRow, tableWithCustomWidth } from '@atlaskit/adf-schema';
|
|
7
7
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
8
8
|
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
9
9
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
@@ -27,6 +27,7 @@ import FloatingInsertButton from './ui/FloatingInsertButton';
|
|
|
27
27
|
import LayoutButton from './ui/LayoutButton';
|
|
28
28
|
import { isLayoutSupported } from './utils';
|
|
29
29
|
import { ErrorBoundary } from '@atlaskit/editor-common/error-boundary';
|
|
30
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
30
31
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
31
32
|
return {};
|
|
32
33
|
};
|
|
@@ -70,9 +71,10 @@ var tablesPlugin = function tablesPlugin(options, api) {
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
nodes: function nodes() {
|
|
74
|
+
var tableNode = getBooleanFF('platform.editor.custom-table-width') ? tableWithCustomWidth : table;
|
|
73
75
|
return [{
|
|
74
76
|
name: 'table',
|
|
75
|
-
node:
|
|
77
|
+
node: tableNode
|
|
76
78
|
}, {
|
|
77
79
|
name: 'tableHeader',
|
|
78
80
|
node: tableHeader
|
|
@@ -14,6 +14,7 @@ import classnames from 'classnames';
|
|
|
14
14
|
import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
15
15
|
import rafSchedule from 'raf-schd';
|
|
16
16
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
17
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import { calcTableWidth, tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
18
19
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
19
20
|
import { akEditorMobileBreakoutPoint, akEditorTableToolbarSize as tableToolbarSize } from '@atlaskit/editor-shared-styles';
|
|
@@ -476,6 +477,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
476
477
|
visibility: visible ? 'visible' : 'hidden'
|
|
477
478
|
};
|
|
478
479
|
}) : NOOP;
|
|
480
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
481
|
+
// new table experience code goes here
|
|
482
|
+
// return <Resizer>...
|
|
483
|
+
}
|
|
479
484
|
return /*#__PURE__*/React.createElement("div", {
|
|
480
485
|
style: {
|
|
481
486
|
width: tableContainerWidth,
|
|
@@ -26,7 +26,8 @@ var tableAttributes = function tableAttributes(node) {
|
|
|
26
26
|
'data-number-column': node.attrs.isNumberColumnEnabled,
|
|
27
27
|
'data-layout': node.attrs.layout,
|
|
28
28
|
'data-autosize': node.attrs.__autoSize,
|
|
29
|
-
'data-table-local-id': node.attrs.localId || ''
|
|
29
|
+
'data-table-local-id': node.attrs.localId || '',
|
|
30
|
+
'data-table-width': node.attrs.width
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
33
|
var toDOM = function toDOM(node, props) {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -26,14 +26,15 @@
|
|
|
26
26
|
"releaseModel": "scheduled"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@atlaskit/adf-schema": "^25.
|
|
30
|
-
"@atlaskit/editor-common": "^74.
|
|
29
|
+
"@atlaskit/adf-schema": "^25.7.0",
|
|
30
|
+
"@atlaskit/editor-common": "^74.2.0",
|
|
31
31
|
"@atlaskit/editor-palette": "1.4.2",
|
|
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",
|
|
35
35
|
"@atlaskit/editor-tables": "^2.3.0",
|
|
36
36
|
"@atlaskit/icon": "^21.12.0",
|
|
37
|
+
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
37
38
|
"@atlaskit/theme": "^12.5.0",
|
|
38
39
|
"@atlaskit/tokens": "^1.4.0",
|
|
39
40
|
"@atlaskit/tooltip": "^17.8.0",
|
|
@@ -62,9 +63,11 @@
|
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
64
65
|
"@atlaskit/button": "^16.7.0",
|
|
65
|
-
"@atlaskit/editor-core": "^
|
|
66
|
+
"@atlaskit/editor-core": "^184.0.0",
|
|
66
67
|
"@atlaskit/editor-plugin-feature-flags": "^0.1.0",
|
|
67
|
-
"@atlaskit/editor-
|
|
68
|
+
"@atlaskit/editor-plugin-grid": "^0.1.0",
|
|
69
|
+
"@atlaskit/editor-plugin-width": "^0.0.1",
|
|
70
|
+
"@atlaskit/editor-test-helpers": "^18.4.0",
|
|
68
71
|
"@atlaskit/link-provider": "^1.6.0",
|
|
69
72
|
"@atlaskit/logo": "^13.14.0",
|
|
70
73
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
@@ -98,5 +101,10 @@
|
|
|
98
101
|
"emotion"
|
|
99
102
|
]
|
|
100
103
|
}
|
|
104
|
+
},
|
|
105
|
+
"platform-feature-flags": {
|
|
106
|
+
"platform.editor.custom-table-width": {
|
|
107
|
+
"type": "boolean"
|
|
108
|
+
}
|
|
101
109
|
}
|
|
102
110
|
}
|
|
@@ -41,7 +41,9 @@ async function loadAndRetrieveDocument(
|
|
|
41
41
|
|
|
42
42
|
BrowserTestCase(
|
|
43
43
|
'Doesnt scale past default',
|
|
44
|
-
{
|
|
44
|
+
{
|
|
45
|
+
skip: ['*'],
|
|
46
|
+
},
|
|
45
47
|
async (client: any, testName: string) => {
|
|
46
48
|
const page = await goToEditorTestingWDExample(
|
|
47
49
|
client,
|
|
@@ -54,7 +56,9 @@ BrowserTestCase(
|
|
|
54
56
|
|
|
55
57
|
BrowserTestCase(
|
|
56
58
|
'Scales to wide',
|
|
57
|
-
{
|
|
59
|
+
{
|
|
60
|
+
skip: ['*'],
|
|
61
|
+
},
|
|
58
62
|
async (client: any, testName: string) => {
|
|
59
63
|
const page = await goToEditorTestingWDExample(
|
|
60
64
|
client,
|
|
@@ -51,12 +51,9 @@ const insertColumn = async (page: any, cell: 'first' | 'last') => {
|
|
|
51
51
|
await page.click(insertButton);
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
// FIXME: This test was automatically skipped due to failure on 01/04/2023: https://product-fabric.atlassian.net/browse/ED-17364
|
|
55
54
|
BrowserTestCase(
|
|
56
55
|
'Sticky header should correctly toggle on and off',
|
|
57
|
-
{
|
|
58
|
-
skip: ['*'],
|
|
59
|
-
},
|
|
56
|
+
{},
|
|
60
57
|
async (client: any, testName: string) => {
|
|
61
58
|
const page = await goToEditorTestingWDExample(
|
|
62
59
|
client,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
Preset,
|
|
19
19
|
} from '@atlaskit/editor-test-helpers/create-prosemirror-editor';
|
|
20
20
|
import tablePlugin from '../../plugins/table-plugin';
|
|
21
|
-
import widthPlugin from '@atlaskit/editor-
|
|
21
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
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';
|
|
@@ -26,6 +26,7 @@ import { getToolbarConfig } from '../../plugins/table/toolbar';
|
|
|
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 formatMessage: (t: { id: string }) => string = (message) =>
|
|
31
32
|
`${message.id}`;
|
|
@@ -46,6 +47,7 @@ describe('color picker', () => {
|
|
|
46
47
|
.add([featureFlagsPlugin, {}])
|
|
47
48
|
.add([analyticsPlugin, {}])
|
|
48
49
|
.add(contentInsertionPlugin)
|
|
50
|
+
.add(widthPlugin)
|
|
49
51
|
.add(dataConsumerPlugin)
|
|
50
52
|
.add(extensionPlugin)
|
|
51
53
|
.add(tablePlugin),
|
|
@@ -20,7 +20,7 @@ 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 { addColumnAt } from '../../../plugins/table/commands/insert';
|
|
23
|
-
import widthPlugin from '@atlaskit/editor-
|
|
23
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
24
24
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
25
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
26
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
@@ -59,8 +59,8 @@ 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-
|
|
63
|
-
import gridPlugin from '@atlaskit/editor-
|
|
62
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
63
|
+
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
64
64
|
import textFormattingPlugin from '@atlaskit/editor-core/src/plugins/text-formatting';
|
|
65
65
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
66
66
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -35,8 +35,8 @@ 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-
|
|
39
|
-
import gridPlugin from '@atlaskit/editor-
|
|
38
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
39
|
+
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
40
40
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
41
41
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
42
42
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
@@ -31,6 +31,7 @@ import type {
|
|
|
31
31
|
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
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
34
35
|
|
|
35
36
|
const formatMessage: (t: { id: string }) => string = (message) =>
|
|
36
37
|
`${message.id}`;
|
|
@@ -79,6 +80,7 @@ describe('getToolbarConfig', () => {
|
|
|
79
80
|
.add([featureFlagsPlugin, {}])
|
|
80
81
|
.add([analyticsPlugin, {}])
|
|
81
82
|
.add(contentInsertionPlugin)
|
|
83
|
+
.add(widthPlugin)
|
|
82
84
|
.add(dataConsumerPlugin)
|
|
83
85
|
.add(extensionPlugin)
|
|
84
86
|
.add(tablePlugin),
|
|
@@ -57,8 +57,8 @@ import deprecatedAnalyticsPlugin from '@atlaskit/editor-core/src/plugins/analyti
|
|
|
57
57
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
58
58
|
import mediaPlugin from '@atlaskit/editor-core/src/plugins/media';
|
|
59
59
|
import selectionPlugin from '@atlaskit/editor-core/src/plugins/selection';
|
|
60
|
-
import widthPlugin from '@atlaskit/editor-
|
|
61
|
-
import gridPlugin from '@atlaskit/editor-
|
|
60
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
61
|
+
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
62
62
|
import { insertMediaAsMediaSingle } from '@atlaskit/editor-core/src/plugins/media/utils/media-single';
|
|
63
63
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
64
64
|
import { getPluginState } from '../../plugins/table/pm-plugins/plugin-factory';
|
|
@@ -36,7 +36,7 @@ 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-
|
|
39
|
+
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
40
40
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
41
41
|
import expandPlugin from '@atlaskit/editor-core/src/plugins/expand';
|
|
42
42
|
import tasksDecisionsPlugin from '@atlaskit/editor-core/src/plugins/tasks-and-decisions';
|
|
@@ -58,7 +58,7 @@ import statusPlugin from '@atlaskit/editor-core/src/plugins/status';
|
|
|
58
58
|
import tablePlugin from '../../plugins/table';
|
|
59
59
|
import { TablePluginState } from '../../plugins/table/types';
|
|
60
60
|
import { pluginKey } from '../../plugins/table/pm-plugins/plugin-key';
|
|
61
|
-
import widthPlugin from '@atlaskit/editor-
|
|
61
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
62
62
|
import editorDisabledPlugin from '@atlaskit/editor-core/src/plugins/editor-disabled';
|
|
63
63
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
64
64
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
@@ -38,6 +38,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
38
38
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
39
39
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
40
40
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
41
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
41
42
|
|
|
42
43
|
describe('table toolbar', () => {
|
|
43
44
|
const tableOptions = {
|
|
@@ -52,6 +53,7 @@ describe('table toolbar', () => {
|
|
|
52
53
|
.add([featureFlagsPlugin, {}])
|
|
53
54
|
.add([analyticsPlugin, {}])
|
|
54
55
|
.add(contentInsertionPlugin)
|
|
56
|
+
.add(widthPlugin)
|
|
55
57
|
.add([tablePlugin, { tableOptions }])
|
|
56
58
|
.add(expandPlugin)
|
|
57
59
|
.add(extensionPlugin)
|
|
@@ -24,6 +24,7 @@ import extensionPlugin from '@atlaskit/editor-core/src/plugins/extension';
|
|
|
24
24
|
import featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
25
25
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
26
26
|
import { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
27
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
27
28
|
|
|
28
29
|
describe('tables: main plugin with allowCollapse: true', () => {
|
|
29
30
|
const createEditor = createProsemirrorEditorFactory();
|
|
@@ -34,6 +35,7 @@ describe('tables: main plugin with allowCollapse: true', () => {
|
|
|
34
35
|
.add([featureFlagsPlugin, {}])
|
|
35
36
|
.add([analyticsPlugin, {}])
|
|
36
37
|
.add(contentInsertionPlugin)
|
|
38
|
+
.add(widthPlugin)
|
|
37
39
|
.add(tablePlugin)
|
|
38
40
|
.add(expandPlugin)
|
|
39
41
|
.add(extensionPlugin),
|
|
@@ -24,7 +24,7 @@ import { pluginKey } from '../../../../plugins/table/pm-plugins/plugin-key';
|
|
|
24
24
|
import { TextSelection, NodeSelection, EditorState } from 'prosemirror-state';
|
|
25
25
|
import { EditorView } from 'prosemirror-view';
|
|
26
26
|
import panelPlugin from '@atlaskit/editor-core/src/plugins/panel';
|
|
27
|
-
import widthPlugin from '@atlaskit/editor-
|
|
27
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
28
28
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
29
29
|
import {
|
|
30
30
|
akEditorFullPageMaxWidth,
|
|
@@ -24,7 +24,7 @@ import { colsToRect } from '../../plugins/table/utils/table';
|
|
|
24
24
|
import sendKeyToPm from '@atlaskit/editor-test-helpers/send-key-to-pm';
|
|
25
25
|
import clone from 'lodash/clone';
|
|
26
26
|
import tablePlugin from '../../plugins/table';
|
|
27
|
-
import widthPlugin from '@atlaskit/editor-
|
|
27
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
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';
|
|
@@ -7,7 +7,13 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
import { tableEditing } from '@atlaskit/editor-tables/pm-plugins';
|
|
8
8
|
import { createTable } from '@atlaskit/editor-tables/utils';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
table,
|
|
12
|
+
tableCell,
|
|
13
|
+
tableHeader,
|
|
14
|
+
tableRow,
|
|
15
|
+
tableWithCustomWidth,
|
|
16
|
+
} from '@atlaskit/adf-schema';
|
|
11
17
|
|
|
12
18
|
import { toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
13
19
|
|
|
@@ -63,6 +69,7 @@ import type {
|
|
|
63
69
|
import { EditorState, Transaction } from 'prosemirror-state';
|
|
64
70
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
65
71
|
import type { contentInsertionPlugin } from '@atlaskit/editor-plugin-content-insertion';
|
|
72
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
66
73
|
|
|
67
74
|
interface TablePluginOptions {
|
|
68
75
|
tableOptions: PluginConfig;
|
|
@@ -135,8 +142,12 @@ const tablesPlugin: NextEditorPlugin<
|
|
|
135
142
|
},
|
|
136
143
|
|
|
137
144
|
nodes() {
|
|
145
|
+
const tableNode = getBooleanFF('platform.editor.custom-table-width')
|
|
146
|
+
? tableWithCustomWidth
|
|
147
|
+
: table;
|
|
148
|
+
|
|
138
149
|
return [
|
|
139
|
-
{ name: 'table', node:
|
|
150
|
+
{ name: 'table', node: tableNode },
|
|
140
151
|
{ name: 'tableHeader', node: tableHeader },
|
|
141
152
|
{ name: 'tableRow', node: tableRow },
|
|
142
153
|
{ name: 'tableCell', node: tableCell },
|
|
@@ -5,6 +5,7 @@ import { isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
|
5
5
|
import { EditorView } from 'prosemirror-view';
|
|
6
6
|
import rafSchedule from 'raf-schd';
|
|
7
7
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
|
|
9
10
|
import {
|
|
10
11
|
calcTableWidth,
|
|
@@ -393,6 +394,11 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
393
394
|
)
|
|
394
395
|
: NOOP;
|
|
395
396
|
|
|
397
|
+
if (getBooleanFF('platform.editor.custom-table-width')) {
|
|
398
|
+
// new table experience code goes here
|
|
399
|
+
// return <Resizer>...
|
|
400
|
+
}
|
|
401
|
+
|
|
396
402
|
return (
|
|
397
403
|
<div
|
|
398
404
|
style={{
|