@atlaskit/editor-plugin-table 0.0.3 → 0.0.5
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 +13 -0
- package/dist/cjs/plugins/table/index.js +5 -1
- package/dist/cjs/plugins/table/nodeviews/table.js +13 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/index.js +3 -4
- package/dist/es2019/plugins/table/nodeviews/table.js +15 -10
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/index.js +5 -4
- package/dist/esm/plugins/table/nodeviews/table.js +13 -7
- package/dist/esm/version.json +1 -1
- package/package.json +3 -3
- package/src/plugins/table/__tests__/integration/block-node-selection.ts +164 -163
- package/src/plugins/table/__tests__/integration/insert-long-smart-link.ts +65 -52
- package/src/plugins/table/index.tsx +3 -3
- package/src/plugins/table/nodeviews/table.tsx +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 0.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`75afc133d94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/75afc133d94) - [ED-15625] Fix media full screen on table
|
|
8
|
+
|
|
9
|
+
## 0.0.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`06ae7af103f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/06ae7af103f) - [ux][ed-15739] Bring back the table icon to the typeahead menu by moving IconTable component to shared package
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 0.0.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -27,6 +27,8 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
27
27
|
|
|
28
28
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
29
29
|
|
|
30
|
+
var _icons = require("@atlaskit/editor-common/icons");
|
|
31
|
+
|
|
30
32
|
var _createPluginConfig = require("./create-plugin-config");
|
|
31
33
|
|
|
32
34
|
var _tableLocalId = require("./pm-plugins/table-local-id");
|
|
@@ -345,7 +347,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
345
347
|
keywords: ['cell', 'table'],
|
|
346
348
|
priority: 600,
|
|
347
349
|
keyshortcut: (0, _keymaps.tooltip)(_keymaps.toggleTable),
|
|
348
|
-
|
|
350
|
+
icon: function icon() {
|
|
351
|
+
return /*#__PURE__*/_react.default.createElement(_icons.IconTable, null);
|
|
352
|
+
},
|
|
349
353
|
action: function action(insert, state) {
|
|
350
354
|
var _options$editorAnalyt;
|
|
351
355
|
|
|
@@ -130,22 +130,28 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
130
130
|
getState: function getState(state) {
|
|
131
131
|
return state['widthPlugin$'];
|
|
132
132
|
}
|
|
133
|
+
}; // TODO: ED-15663
|
|
134
|
+
// Please, do not copy or use this kind of code below
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
|
|
137
|
+
var fakeMediaPluginKey = {
|
|
138
|
+
key: 'mediaPlugin$',
|
|
139
|
+
getState: function getState(state) {
|
|
140
|
+
return state['mediaPlugin$'];
|
|
141
|
+
}
|
|
133
142
|
};
|
|
134
143
|
return /*#__PURE__*/_react.default.createElement(_withPluginState.WithPluginState, {
|
|
135
144
|
plugins: {
|
|
136
145
|
pluginState: _pluginKey.pluginKey,
|
|
137
146
|
tableResizingPluginState: _tableResizing.pluginKey,
|
|
138
|
-
widthPlugin: fakePluginKey
|
|
139
|
-
|
|
147
|
+
widthPlugin: fakePluginKey,
|
|
148
|
+
mediaState: fakeMediaPluginKey
|
|
140
149
|
},
|
|
141
150
|
editorView: props.view,
|
|
142
151
|
render: function render(pluginStates) {
|
|
143
152
|
var tableResizingPluginState = pluginStates.tableResizingPluginState,
|
|
144
|
-
pluginState = pluginStates.pluginState
|
|
145
|
-
|
|
146
|
-
var mediaState = {
|
|
147
|
-
isFullscreen: false
|
|
148
|
-
};
|
|
153
|
+
pluginState = pluginStates.pluginState,
|
|
154
|
+
mediaState = pluginStates.mediaState;
|
|
149
155
|
var tableActive = props.getPos() === pluginState.tablePos;
|
|
150
156
|
var containerWidth = props.getEditorContainerWidth();
|
|
151
157
|
return /*#__PURE__*/_react.default.createElement(_TableComponent.default, {
|
package/dist/cjs/version.json
CHANGED
|
@@ -7,9 +7,8 @@ import { table, tableCell, tableHeader, tableRow } 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 } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
13
12
|
import { pluginConfig } from './create-plugin-config';
|
|
14
13
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
15
14
|
import { createPlugin as createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin } from './pm-plugins/safari-delayed-dom-selection-syncing-workaround';
|
|
@@ -311,8 +310,8 @@ const tablesPlugin = options => {
|
|
|
311
310
|
keywords: ['cell', 'table'],
|
|
312
311
|
priority: 600,
|
|
313
312
|
keyshortcut: tooltip(toggleTable),
|
|
313
|
+
icon: () => /*#__PURE__*/React.createElement(IconTable, null),
|
|
314
314
|
|
|
315
|
-
// icon: () => <IconTable />,
|
|
316
315
|
action(insert, state) {
|
|
317
316
|
var _options$editorAnalyt;
|
|
318
317
|
|
|
@@ -75,26 +75,31 @@ export default class TableView extends ReactNodeView {
|
|
|
75
75
|
getState: state => {
|
|
76
76
|
return state['widthPlugin$'];
|
|
77
77
|
}
|
|
78
|
+
}; // TODO: ED-15663
|
|
79
|
+
// Please, do not copy or use this kind of code below
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
|
|
82
|
+
const fakeMediaPluginKey = {
|
|
83
|
+
key: 'mediaPlugin$',
|
|
84
|
+
getState: state => {
|
|
85
|
+
return state['mediaPlugin$'];
|
|
86
|
+
}
|
|
78
87
|
};
|
|
79
88
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
80
89
|
plugins: {
|
|
81
90
|
pluginState: pluginKey,
|
|
82
91
|
tableResizingPluginState: tableResizingPluginKey,
|
|
83
|
-
widthPlugin: fakePluginKey
|
|
84
|
-
|
|
92
|
+
widthPlugin: fakePluginKey,
|
|
93
|
+
mediaState: fakeMediaPluginKey
|
|
85
94
|
},
|
|
86
95
|
editorView: props.view,
|
|
87
96
|
render: pluginStates => {
|
|
88
97
|
const {
|
|
89
98
|
tableResizingPluginState,
|
|
90
|
-
pluginState
|
|
91
|
-
//
|
|
92
|
-
|
|
93
|
-
} = pluginStates;
|
|
94
|
-
|
|
95
|
-
const mediaState = {
|
|
96
|
-
isFullscreen: false
|
|
97
|
-
};
|
|
99
|
+
pluginState,
|
|
100
|
+
// containerWidth,
|
|
101
|
+
mediaState
|
|
102
|
+
} = pluginStates;
|
|
98
103
|
const tableActive = props.getPos() === pluginState.tablePos;
|
|
99
104
|
const containerWidth = props.getEditorContainerWidth();
|
|
100
105
|
return /*#__PURE__*/React.createElement(TableComponent, {
|
package/dist/es2019/version.json
CHANGED
|
@@ -7,9 +7,8 @@ import { table, tableCell, tableHeader, tableRow } 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 } from '@atlaskit/editor-common/analytics';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
13
12
|
import { pluginConfig } from './create-plugin-config';
|
|
14
13
|
import { createPlugin as createTableLocalIdPlugin } from './pm-plugins/table-local-id';
|
|
15
14
|
import { createPlugin as createTableSafariDelayedDomSelectionSyncingWorkaroundPlugin } from './pm-plugins/safari-delayed-dom-selection-syncing-workaround';
|
|
@@ -310,7 +309,9 @@ var tablesPlugin = function tablesPlugin(options) {
|
|
|
310
309
|
keywords: ['cell', 'table'],
|
|
311
310
|
priority: 600,
|
|
312
311
|
keyshortcut: tooltip(toggleTable),
|
|
313
|
-
|
|
312
|
+
icon: function icon() {
|
|
313
|
+
return /*#__PURE__*/React.createElement(IconTable, null);
|
|
314
|
+
},
|
|
314
315
|
action: function action(insert, state) {
|
|
315
316
|
var _options$editorAnalyt;
|
|
316
317
|
|
|
@@ -106,22 +106,28 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
106
106
|
getState: function getState(state) {
|
|
107
107
|
return state['widthPlugin$'];
|
|
108
108
|
}
|
|
109
|
+
}; // TODO: ED-15663
|
|
110
|
+
// Please, do not copy or use this kind of code below
|
|
111
|
+
// @ts-ignore
|
|
112
|
+
|
|
113
|
+
var fakeMediaPluginKey = {
|
|
114
|
+
key: 'mediaPlugin$',
|
|
115
|
+
getState: function getState(state) {
|
|
116
|
+
return state['mediaPlugin$'];
|
|
117
|
+
}
|
|
109
118
|
};
|
|
110
119
|
return /*#__PURE__*/React.createElement(WithPluginState, {
|
|
111
120
|
plugins: {
|
|
112
121
|
pluginState: pluginKey,
|
|
113
122
|
tableResizingPluginState: tableResizingPluginKey,
|
|
114
|
-
widthPlugin: fakePluginKey
|
|
115
|
-
|
|
123
|
+
widthPlugin: fakePluginKey,
|
|
124
|
+
mediaState: fakeMediaPluginKey
|
|
116
125
|
},
|
|
117
126
|
editorView: props.view,
|
|
118
127
|
render: function render(pluginStates) {
|
|
119
128
|
var tableResizingPluginState = pluginStates.tableResizingPluginState,
|
|
120
|
-
pluginState = pluginStates.pluginState
|
|
121
|
-
|
|
122
|
-
var mediaState = {
|
|
123
|
-
isFullscreen: false
|
|
124
|
-
};
|
|
129
|
+
pluginState = pluginStates.pluginState,
|
|
130
|
+
mediaState = pluginStates.mediaState;
|
|
125
131
|
var tableActive = props.getPos() === pluginState.tablePos;
|
|
126
132
|
var containerWidth = props.getEditorContainerWidth();
|
|
127
133
|
return /*#__PURE__*/React.createElement(TableComponent, {
|
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": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-schema": "^24.0.0",
|
|
28
|
-
"@atlaskit/editor-common": "^69.
|
|
28
|
+
"@atlaskit/editor-common": "^69.4.0",
|
|
29
29
|
"@atlaskit/editor-shared-styles": "^2.2.0",
|
|
30
30
|
"@atlaskit/editor-tables": "^2.1.0",
|
|
31
31
|
"@atlaskit/icon": "^21.10.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@atlaskit/button": "^16.3.0",
|
|
60
|
-
"@atlaskit/editor-core": "^172.
|
|
60
|
+
"@atlaskit/editor-core": "^172.3.0",
|
|
61
61
|
"@atlaskit/editor-test-helpers": "^17.2.0",
|
|
62
62
|
"@atlaskit/link-provider": "^1.2.6",
|
|
63
63
|
"@atlaskit/logo": "^13.9.0",
|
|
@@ -1,163 +1,164 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
1
|
+
it.todo('TODO: ED-15801 - Fix smart link async rendering integration test');
|
|
2
|
+
// import { runBlockNodeSelectionTestSuite } from '@atlaskit/editor-test-helpers/integration/selection';
|
|
3
|
+
//
|
|
4
|
+
// runBlockNodeSelectionTestSuite({
|
|
5
|
+
// nodeName: 'table',
|
|
6
|
+
// editorOptions: {
|
|
7
|
+
// allowTables: {
|
|
8
|
+
// advanced: true,
|
|
9
|
+
// },
|
|
10
|
+
// },
|
|
11
|
+
// selector: 'table',
|
|
12
|
+
// adfNode: {
|
|
13
|
+
// type: 'table',
|
|
14
|
+
// attrs: {
|
|
15
|
+
// isNumberColumnEnabled: false,
|
|
16
|
+
// layout: 'default',
|
|
17
|
+
// localId: '15804638-b946-4591-b64c-beffe5122733',
|
|
18
|
+
// },
|
|
19
|
+
// content: [
|
|
20
|
+
// {
|
|
21
|
+
// type: 'tableRow',
|
|
22
|
+
// content: [
|
|
23
|
+
// {
|
|
24
|
+
// type: 'tableHeader',
|
|
25
|
+
// attrs: {},
|
|
26
|
+
// content: [
|
|
27
|
+
// {
|
|
28
|
+
// type: 'paragraph',
|
|
29
|
+
// content: [],
|
|
30
|
+
// },
|
|
31
|
+
// ],
|
|
32
|
+
// },
|
|
33
|
+
// {
|
|
34
|
+
// type: 'tableHeader',
|
|
35
|
+
// attrs: {},
|
|
36
|
+
// content: [
|
|
37
|
+
// {
|
|
38
|
+
// type: 'paragraph',
|
|
39
|
+
// content: [],
|
|
40
|
+
// },
|
|
41
|
+
// ],
|
|
42
|
+
// },
|
|
43
|
+
// {
|
|
44
|
+
// type: 'tableHeader',
|
|
45
|
+
// attrs: {},
|
|
46
|
+
// content: [
|
|
47
|
+
// {
|
|
48
|
+
// type: 'paragraph',
|
|
49
|
+
// content: [],
|
|
50
|
+
// },
|
|
51
|
+
// ],
|
|
52
|
+
// },
|
|
53
|
+
// ],
|
|
54
|
+
// },
|
|
55
|
+
// {
|
|
56
|
+
// type: 'tableRow',
|
|
57
|
+
// content: [
|
|
58
|
+
// {
|
|
59
|
+
// type: 'tableCell',
|
|
60
|
+
// attrs: {},
|
|
61
|
+
// content: [
|
|
62
|
+
// {
|
|
63
|
+
// type: 'paragraph',
|
|
64
|
+
// content: [],
|
|
65
|
+
// },
|
|
66
|
+
// ],
|
|
67
|
+
// },
|
|
68
|
+
// {
|
|
69
|
+
// type: 'tableCell',
|
|
70
|
+
// attrs: {},
|
|
71
|
+
// content: [
|
|
72
|
+
// {
|
|
73
|
+
// type: 'paragraph',
|
|
74
|
+
// content: [],
|
|
75
|
+
// },
|
|
76
|
+
// ],
|
|
77
|
+
// },
|
|
78
|
+
// {
|
|
79
|
+
// type: 'tableCell',
|
|
80
|
+
// attrs: {},
|
|
81
|
+
// content: [
|
|
82
|
+
// {
|
|
83
|
+
// type: 'paragraph',
|
|
84
|
+
// content: [],
|
|
85
|
+
// },
|
|
86
|
+
// ],
|
|
87
|
+
// },
|
|
88
|
+
// ],
|
|
89
|
+
// },
|
|
90
|
+
// {
|
|
91
|
+
// type: 'tableRow',
|
|
92
|
+
// content: [
|
|
93
|
+
// {
|
|
94
|
+
// type: 'tableCell',
|
|
95
|
+
// attrs: {},
|
|
96
|
+
// content: [
|
|
97
|
+
// {
|
|
98
|
+
// type: 'paragraph',
|
|
99
|
+
// content: [],
|
|
100
|
+
// },
|
|
101
|
+
// ],
|
|
102
|
+
// },
|
|
103
|
+
// {
|
|
104
|
+
// type: 'tableCell',
|
|
105
|
+
// attrs: {},
|
|
106
|
+
// content: [
|
|
107
|
+
// {
|
|
108
|
+
// type: 'paragraph',
|
|
109
|
+
// content: [],
|
|
110
|
+
// },
|
|
111
|
+
// ],
|
|
112
|
+
// },
|
|
113
|
+
// {
|
|
114
|
+
// type: 'tableCell',
|
|
115
|
+
// attrs: {},
|
|
116
|
+
// content: [
|
|
117
|
+
// {
|
|
118
|
+
// type: 'paragraph',
|
|
119
|
+
// content: [],
|
|
120
|
+
// },
|
|
121
|
+
// ],
|
|
122
|
+
// },
|
|
123
|
+
// ],
|
|
124
|
+
// },
|
|
125
|
+
// ],
|
|
126
|
+
// },
|
|
127
|
+
// skipTests: {
|
|
128
|
+
// 'Extend selection right two characters to select [block-node] from line above with shift + arrow right': [
|
|
129
|
+
// 'chrome',
|
|
130
|
+
// 'safari',
|
|
131
|
+
// 'firefox',
|
|
132
|
+
// ],
|
|
133
|
+
// 'Extend selection left two characters to select [block-node] from line below with shift + arrow left': [
|
|
134
|
+
// 'chrome',
|
|
135
|
+
// 'safari',
|
|
136
|
+
// 'firefox',
|
|
137
|
+
// ],
|
|
138
|
+
// 'Extend a selection from end of the document to the start when [block-node] is the first node': [
|
|
139
|
+
// 'chrome',
|
|
140
|
+
// 'safari',
|
|
141
|
+
// 'firefox',
|
|
142
|
+
// ],
|
|
143
|
+
// 'Click and drag from the end to start of the document to select [block-node] when [block-node] is the first node': [
|
|
144
|
+
// 'chrome',
|
|
145
|
+
// 'safari',
|
|
146
|
+
// 'firefox',
|
|
147
|
+
// ],
|
|
148
|
+
// 'Extend a selection to the end of the document from start when [block-node] is the last node': [
|
|
149
|
+
// 'chrome',
|
|
150
|
+
// 'safari',
|
|
151
|
+
// 'firefox',
|
|
152
|
+
// ],
|
|
153
|
+
// 'Click and drag from start of the document to select [block-node] when [block-node] is the last node': [
|
|
154
|
+
// 'chrome',
|
|
155
|
+
// 'safari',
|
|
156
|
+
// 'firefox',
|
|
157
|
+
// ],
|
|
158
|
+
// "Extend selection down by one line multiple times to select [block-node]'s in sequence with shift + arrow down": [
|
|
159
|
+
// 'chrome',
|
|
160
|
+
// 'safari',
|
|
161
|
+
// 'firefox',
|
|
162
|
+
// ],
|
|
163
|
+
// },
|
|
164
|
+
// });
|
|
@@ -1,52 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
);
|
|
1
|
+
it.todo('TODO: ED-15801 - Fix smart link async rendering integration test');
|
|
2
|
+
// import { BrowserTestCase } from '@atlaskit/webdriver-runner/runner';
|
|
3
|
+
// import { copyToClipboard } from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
4
|
+
// import { waitForInlineCard } from '@atlaskit/media-integration-test-helpers';
|
|
5
|
+
// import { fullpage } from '@atlaskit/editor-test-helpers/integration/helpers';
|
|
6
|
+
// import { inlineCardLongNameSlowResolveUrl } from '@atlaskit/editor-test-helpers/card-provider';
|
|
7
|
+
// import {
|
|
8
|
+
// goToEditorTestingWDExample,
|
|
9
|
+
// mountEditor,
|
|
10
|
+
// } from '@atlaskit/editor-test-helpers/testing-example-page';
|
|
11
|
+
// import {
|
|
12
|
+
// clickFirstCell,
|
|
13
|
+
// insertTable,
|
|
14
|
+
// tableSelectors,
|
|
15
|
+
// } from '@atlaskit/editor-test-helpers/page-objects/table';
|
|
16
|
+
//
|
|
17
|
+
// BrowserTestCase(
|
|
18
|
+
// 'table row controls should be same height as table body after a long title smart link finishes async rendering',
|
|
19
|
+
// { skip: ['safari'] },
|
|
20
|
+
// async (client: any) => {
|
|
21
|
+
// const page = await goToEditorTestingWDExample(
|
|
22
|
+
// client,
|
|
23
|
+
// 'editor-plugin-table',
|
|
24
|
+
// );
|
|
25
|
+
//
|
|
26
|
+
// await copyToClipboard(page, inlineCardLongNameSlowResolveUrl);
|
|
27
|
+
// await mountEditor(page, {
|
|
28
|
+
// appearance: fullpage.appearance,
|
|
29
|
+
// smartLinks: {},
|
|
30
|
+
// allowTables: {
|
|
31
|
+
// advanced: true,
|
|
32
|
+
// },
|
|
33
|
+
// });
|
|
34
|
+
//
|
|
35
|
+
// await insertTable(page);
|
|
36
|
+
// await clickFirstCell(page);
|
|
37
|
+
// await page.paste();
|
|
38
|
+
// await waitForInlineCard(page);
|
|
39
|
+
//
|
|
40
|
+
// const { tableBodyHeight, tableRowControlsHeight } = await page.evaluate<{
|
|
41
|
+
// tableBodyHeight: number;
|
|
42
|
+
// tableRowControlsHeight: number;
|
|
43
|
+
// }>(
|
|
44
|
+
// (tableRowControlsSelector, tableBodySelector) => {
|
|
45
|
+
// const tableRowControls = document.querySelector(
|
|
46
|
+
// tableRowControlsSelector,
|
|
47
|
+
// ) as HTMLElement;
|
|
48
|
+
// const tableBody = document.querySelector(tableBodySelector);
|
|
49
|
+
// if (!tableBody || !tableRowControls) {
|
|
50
|
+
// throw new Error(
|
|
51
|
+
// 'Missing tableBody or tableRowControls, exiting test',
|
|
52
|
+
// );
|
|
53
|
+
// }
|
|
54
|
+
// return {
|
|
55
|
+
// tableBodyHeight: Math.round(tableBody.offsetHeight),
|
|
56
|
+
// tableRowControlsHeight: Math.round(tableRowControls.offsetHeight),
|
|
57
|
+
// };
|
|
58
|
+
// },
|
|
59
|
+
// tableSelectors.rowControlsForTableBody,
|
|
60
|
+
// tableSelectors.tableBody,
|
|
61
|
+
// );
|
|
62
|
+
//
|
|
63
|
+
// expect(tableBodyHeight).toBe(tableRowControlsHeight);
|
|
64
|
+
// },
|
|
65
|
+
// );
|
|
@@ -23,8 +23,8 @@ import {
|
|
|
23
23
|
} from '@atlaskit/editor-common/analytics';
|
|
24
24
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
import { IconTable } from '@atlaskit/editor-common/icons';
|
|
27
|
+
|
|
28
28
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
29
29
|
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
30
30
|
|
|
@@ -411,7 +411,7 @@ const tablesPlugin = (options?: TablePluginOptions): EditorPlugin => {
|
|
|
411
411
|
keywords: ['cell', 'table'],
|
|
412
412
|
priority: 600,
|
|
413
413
|
keyshortcut: tooltip(toggleTable),
|
|
414
|
-
|
|
414
|
+
icon: () => <IconTable />,
|
|
415
415
|
action(insert, state) {
|
|
416
416
|
const tr = insert(
|
|
417
417
|
createTable({
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
Node as PmNode,
|
|
6
6
|
} from 'prosemirror-model';
|
|
7
7
|
import { EditorView, NodeView } from 'prosemirror-view';
|
|
8
|
-
// import { stateKey as mediaPluginKey } from '../../../plugins/media/pm-plugins/plugin-key';
|
|
9
8
|
import { PluginKey, EditorState } from 'prosemirror-state';
|
|
10
9
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
11
10
|
import type {
|
|
@@ -118,13 +117,23 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
118
117
|
},
|
|
119
118
|
} as PluginKey;
|
|
120
119
|
|
|
120
|
+
// TODO: ED-15663
|
|
121
|
+
// Please, do not copy or use this kind of code below
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
const fakeMediaPluginKey = {
|
|
124
|
+
key: 'mediaPlugin$',
|
|
125
|
+
getState: (state: EditorState) => {
|
|
126
|
+
return (state as any)['mediaPlugin$'];
|
|
127
|
+
},
|
|
128
|
+
} as PluginKey;
|
|
129
|
+
|
|
121
130
|
return (
|
|
122
131
|
<WithPluginState
|
|
123
132
|
plugins={{
|
|
124
133
|
pluginState: pluginKey,
|
|
125
134
|
tableResizingPluginState: tableResizingPluginKey,
|
|
126
135
|
widthPlugin: fakePluginKey,
|
|
127
|
-
|
|
136
|
+
mediaState: fakeMediaPluginKey,
|
|
128
137
|
}}
|
|
129
138
|
editorView={props.view}
|
|
130
139
|
render={(pluginStates) => {
|
|
@@ -132,10 +141,8 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
132
141
|
tableResizingPluginState,
|
|
133
142
|
pluginState,
|
|
134
143
|
// containerWidth,
|
|
135
|
-
|
|
144
|
+
mediaState,
|
|
136
145
|
} = pluginStates;
|
|
137
|
-
// const mediaState = {};
|
|
138
|
-
const mediaState = { isFullscreen: false };
|
|
139
146
|
const tableActive = props.getPos() === pluginState!.tablePos;
|
|
140
147
|
const containerWidth = props.getEditorContainerWidth();
|
|
141
148
|
return (
|