@atlaskit/editor-plugin-table 0.0.4 → 0.0.6
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/commands-with-analytics.js +6 -0
- package/dist/cjs/plugins/table/nodeviews/table.js +13 -7
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/table/commands-with-analytics.js +6 -0
- package/dist/es2019/plugins/table/nodeviews/table.js +15 -10
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/table/commands-with-analytics.js +6 -0
- package/dist/esm/plugins/table/nodeviews/table.js +13 -7
- package/dist/esm/version.json +1 -1
- package/package.json +7 -7
- package/report.api.md +13 -6
- 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/commands-with-analytics.ts +3 -0
- package/src/plugins/table/nodeviews/table.tsx +12 -5
- package/tmp/api-report-tmp.d.ts +91 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 0.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 0.0.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`75afc133d94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/75afc133d94) - [ED-15625] Fix media full screen on table
|
|
14
|
+
|
|
3
15
|
## 0.0.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -99,6 +99,8 @@ var mergeCellsWithAnalytics = function mergeCellsWithAnalytics(editorAnalyticsAP
|
|
|
99
99
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
100
100
|
actionSubjectId: null,
|
|
101
101
|
attributes: {
|
|
102
|
+
inputMethod: _analytics.INPUT_METHOD.CONTEXT_MENU,
|
|
103
|
+
// TODO: merge with floating toolbar once command is updated
|
|
102
104
|
horizontalCells: horizontalCells,
|
|
103
105
|
verticalCells: verticalCells,
|
|
104
106
|
totalCells: totalCells,
|
|
@@ -137,6 +139,8 @@ var splitCellWithAnalytics = function splitCellWithAnalytics(editorAnalyticsAPI)
|
|
|
137
139
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
138
140
|
actionSubjectId: null,
|
|
139
141
|
attributes: {
|
|
142
|
+
inputMethod: _analytics.INPUT_METHOD.CONTEXT_MENU,
|
|
143
|
+
// TODO: merge with floating toolbar once command is updated
|
|
140
144
|
horizontalCells: horizontalCells,
|
|
141
145
|
verticalCells: verticalCells,
|
|
142
146
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -170,6 +174,8 @@ var setColorWithAnalytics = function setColorWithAnalytics(editorAnalyticsAPI) {
|
|
|
170
174
|
actionSubject: _analytics.ACTION_SUBJECT.TABLE,
|
|
171
175
|
actionSubjectId: null,
|
|
172
176
|
attributes: {
|
|
177
|
+
inputMethod: _analytics.INPUT_METHOD.CONTEXT_MENU,
|
|
178
|
+
// TODO: merge with floating toolbar once command is updated
|
|
173
179
|
cellColor: (_adfSchema.tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
|
|
174
180
|
horizontalCells: horizontalCells,
|
|
175
181
|
verticalCells: verticalCells,
|
|
@@ -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
|
@@ -59,6 +59,8 @@ export const mergeCellsWithAnalytics = editorAnalyticsAPI => withEditorAnalytics
|
|
|
59
59
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
60
60
|
actionSubjectId: null,
|
|
61
61
|
attributes: {
|
|
62
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
63
|
+
// TODO: merge with floating toolbar once command is updated
|
|
62
64
|
horizontalCells,
|
|
63
65
|
verticalCells,
|
|
64
66
|
totalCells,
|
|
@@ -93,6 +95,8 @@ export const splitCellWithAnalytics = editorAnalyticsAPI => withEditorAnalyticsA
|
|
|
93
95
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
94
96
|
actionSubjectId: null,
|
|
95
97
|
attributes: {
|
|
98
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
99
|
+
// TODO: merge with floating toolbar once command is updated
|
|
96
100
|
horizontalCells,
|
|
97
101
|
verticalCells,
|
|
98
102
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -120,6 +124,8 @@ export const setColorWithAnalytics = editorAnalyticsAPI => (cellColor, targetCel
|
|
|
120
124
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
121
125
|
actionSubjectId: null,
|
|
122
126
|
attributes: {
|
|
127
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
128
|
+
// TODO: merge with floating toolbar once command is updated
|
|
123
129
|
cellColor: (tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
|
|
124
130
|
horizontalCells,
|
|
125
131
|
verticalCells,
|
|
@@ -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
|
@@ -70,6 +70,8 @@ export var mergeCellsWithAnalytics = function mergeCellsWithAnalytics(editorAnal
|
|
|
70
70
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
71
71
|
actionSubjectId: null,
|
|
72
72
|
attributes: {
|
|
73
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
74
|
+
// TODO: merge with floating toolbar once command is updated
|
|
73
75
|
horizontalCells: horizontalCells,
|
|
74
76
|
verticalCells: verticalCells,
|
|
75
77
|
totalCells: totalCells,
|
|
@@ -105,6 +107,8 @@ export var splitCellWithAnalytics = function splitCellWithAnalytics(editorAnalyt
|
|
|
105
107
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
106
108
|
actionSubjectId: null,
|
|
107
109
|
attributes: {
|
|
110
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
111
|
+
// TODO: merge with floating toolbar once command is updated
|
|
108
112
|
horizontalCells: horizontalCells,
|
|
109
113
|
verticalCells: verticalCells,
|
|
110
114
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -135,6 +139,8 @@ export var setColorWithAnalytics = function setColorWithAnalytics(editorAnalytic
|
|
|
135
139
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
136
140
|
actionSubjectId: null,
|
|
137
141
|
attributes: {
|
|
142
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU,
|
|
143
|
+
// TODO: merge with floating toolbar once command is updated
|
|
138
144
|
cellColor: (tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor).toLowerCase(),
|
|
139
145
|
horizontalCells: horizontalCells,
|
|
140
146
|
verticalCells: verticalCells,
|
|
@@ -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.6",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@atlaskit/adf-schema": "^24.0.0",
|
|
28
|
-
"@atlaskit/editor-common": "^
|
|
28
|
+
"@atlaskit/editor-common": "^70.0.0",
|
|
29
29
|
"@atlaskit/editor-shared-styles": "^2.2.0",
|
|
30
|
-
"@atlaskit/editor-tables": "^2.
|
|
31
|
-
"@atlaskit/icon": "^21.
|
|
30
|
+
"@atlaskit/editor-tables": "^2.2.0",
|
|
31
|
+
"@atlaskit/icon": "^21.11.0",
|
|
32
32
|
"@atlaskit/theme": "^12.1.0",
|
|
33
33
|
"@atlaskit/tokens": "^0.10.0",
|
|
34
|
-
"@atlaskit/tooltip": "^17.
|
|
34
|
+
"@atlaskit/tooltip": "^17.6.0",
|
|
35
35
|
"@babel/runtime": "^7.0.0",
|
|
36
36
|
"@emotion/react": "^11.7.1",
|
|
37
37
|
"@types/prosemirror-state": "^1.2.0",
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@atlaskit/button": "^16.3.0",
|
|
60
|
-
"@atlaskit/editor-core": "^
|
|
60
|
+
"@atlaskit/editor-core": "^173.0.0",
|
|
61
61
|
"@atlaskit/editor-test-helpers": "^17.2.0",
|
|
62
62
|
"@atlaskit/link-provider": "^1.2.6",
|
|
63
|
-
"@atlaskit/logo": "^13.
|
|
63
|
+
"@atlaskit/logo": "^13.10.0",
|
|
64
64
|
"@atlaskit/media-integration-test-helpers": "^2.6.0",
|
|
65
65
|
"@atlaskit/synchrony-test-helpers": "^2.3.0",
|
|
66
66
|
"@atlaskit/visual-regression": "*",
|
package/report.api.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
<!-- API Report Version: 2.2 -->
|
|
2
|
+
|
|
1
3
|
## API Report File for "@atlaskit/editor-plugin-table"
|
|
2
4
|
|
|
3
|
-
> Do not edit this file.
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
4
9
|
|
|
5
|
-
|
|
6
|
-
Generated API Report version: 2.0
|
|
7
|
-
-->
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
### Main Entry Types
|
|
13
|
+
|
|
14
|
+
<!--SECTION START: Main Entry Types-->
|
|
10
15
|
|
|
11
16
|
```ts
|
|
12
17
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
@@ -16,7 +21,7 @@ import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
|
16
21
|
import { TableLayout } from '@atlaskit/adf-schema';
|
|
17
22
|
|
|
18
23
|
// @public (undocumented)
|
|
19
|
-
type PermittedLayoutsDescriptor = TableLayout[]
|
|
24
|
+
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
20
25
|
|
|
21
26
|
// @public (undocumented)
|
|
22
27
|
interface PluginConfig {
|
|
@@ -95,3 +100,5 @@ export const tablesPlugin: (
|
|
|
95
100
|
|
|
96
101
|
// (No @packageDocumentation comment for this package)
|
|
97
102
|
```
|
|
103
|
+
|
|
104
|
+
<!--SECTION END: Main Entry Types-->
|
|
@@ -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
|
+
// );
|
|
@@ -111,6 +111,7 @@ export const mergeCellsWithAnalytics = (
|
|
|
111
111
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
112
112
|
actionSubjectId: null,
|
|
113
113
|
attributes: {
|
|
114
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU, // TODO: merge with floating toolbar once command is updated
|
|
114
115
|
horizontalCells,
|
|
115
116
|
verticalCells,
|
|
116
117
|
totalCells,
|
|
@@ -143,6 +144,7 @@ export const splitCellWithAnalytics = (
|
|
|
143
144
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
144
145
|
actionSubjectId: null,
|
|
145
146
|
attributes: {
|
|
147
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU, // TODO: merge with floating toolbar once command is updated
|
|
146
148
|
horizontalCells,
|
|
147
149
|
verticalCells,
|
|
148
150
|
totalCells: horizontalCells * verticalCells,
|
|
@@ -172,6 +174,7 @@ export const setColorWithAnalytics = (
|
|
|
172
174
|
actionSubject: ACTION_SUBJECT.TABLE,
|
|
173
175
|
actionSubjectId: null,
|
|
174
176
|
attributes: {
|
|
177
|
+
inputMethod: INPUT_METHOD.CONTEXT_MENU, // TODO: merge with floating toolbar once command is updated
|
|
175
178
|
cellColor: (
|
|
176
179
|
tableBackgroundColorPalette.get(cellColor.toLowerCase()) || cellColor
|
|
177
180
|
).toLowerCase(),
|
|
@@ -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 (
|
|
@@ -0,0 +1,91 @@
|
|
|
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 type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import type { EditorPlugin } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
|
|
10
|
+
import type { GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
11
|
+
import { TableLayout } from '@atlaskit/adf-schema';
|
|
12
|
+
|
|
13
|
+
// @public (undocumented)
|
|
14
|
+
type PermittedLayoutsDescriptor = 'all' | TableLayout[];
|
|
15
|
+
|
|
16
|
+
// @public (undocumented)
|
|
17
|
+
interface PluginConfig {
|
|
18
|
+
// (undocumented)
|
|
19
|
+
advanced?: boolean;
|
|
20
|
+
// (undocumented)
|
|
21
|
+
allowAddColumnWithCustomStep?: boolean;
|
|
22
|
+
// (undocumented)
|
|
23
|
+
allowBackgroundColor?: boolean;
|
|
24
|
+
// (undocumented)
|
|
25
|
+
allowCellOptionsInFloatingToolbar?: boolean;
|
|
26
|
+
// (undocumented)
|
|
27
|
+
allowCollapse?: boolean;
|
|
28
|
+
// (undocumented)
|
|
29
|
+
allowColumnResizing?: boolean;
|
|
30
|
+
// (undocumented)
|
|
31
|
+
allowColumnSorting?: boolean;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
allowControls?: boolean;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
allowDistributeColumns?: boolean;
|
|
36
|
+
// (undocumented)
|
|
37
|
+
allowHeaderColumn?: boolean;
|
|
38
|
+
// (undocumented)
|
|
39
|
+
allowHeaderRow?: boolean;
|
|
40
|
+
// (undocumented)
|
|
41
|
+
allowMergeCells?: boolean;
|
|
42
|
+
// (undocumented)
|
|
43
|
+
allowNumberColumn?: boolean;
|
|
44
|
+
// (undocumented)
|
|
45
|
+
initialRenderOptimization?: boolean;
|
|
46
|
+
// (undocumented)
|
|
47
|
+
isHeaderRowRequired?: boolean;
|
|
48
|
+
// (undocumented)
|
|
49
|
+
mouseMoveOptimization?: boolean;
|
|
50
|
+
// (undocumented)
|
|
51
|
+
permittedLayouts?: PermittedLayoutsDescriptor;
|
|
52
|
+
// (undocumented)
|
|
53
|
+
stickToolbarToBottom?: boolean;
|
|
54
|
+
// (undocumented)
|
|
55
|
+
stickyHeaders?: boolean;
|
|
56
|
+
// (undocumented)
|
|
57
|
+
stickyHeadersOptimization?: boolean;
|
|
58
|
+
// (undocumented)
|
|
59
|
+
tableCellOptimization?: boolean;
|
|
60
|
+
// (undocumented)
|
|
61
|
+
tableOverflowShadowsOptimization?: boolean;
|
|
62
|
+
// (undocumented)
|
|
63
|
+
tableRenderOptimization?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// @public (undocumented)
|
|
67
|
+
interface TablePluginOptions {
|
|
68
|
+
// (undocumented)
|
|
69
|
+
allowContextualMenu?: boolean;
|
|
70
|
+
// (undocumented)
|
|
71
|
+
breakoutEnabled?: boolean;
|
|
72
|
+
// (undocumented)
|
|
73
|
+
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
74
|
+
// (undocumented)
|
|
75
|
+
editorSelectionAPI?: EditorSelectionAPI;
|
|
76
|
+
// (undocumented)
|
|
77
|
+
fullWidthEnabled?: boolean;
|
|
78
|
+
// (undocumented)
|
|
79
|
+
getEditorFeatureFlags?: GetEditorFeatureFlags;
|
|
80
|
+
// (undocumented)
|
|
81
|
+
tableOptions: PluginConfig;
|
|
82
|
+
// (undocumented)
|
|
83
|
+
wasFullWidthEnabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// @public (undocumented)
|
|
87
|
+
export const tablesPlugin: (options?: TablePluginOptions | undefined) => EditorPlugin;
|
|
88
|
+
|
|
89
|
+
// (No @packageDocumentation comment for this package)
|
|
90
|
+
|
|
91
|
+
```
|