@atlaskit/editor-plugin-table 15.4.10 → 15.4.12
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 +20 -0
- package/dist/cjs/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/cjs/pm-plugins/analytics/plugin.js +0 -8
- package/dist/cjs/pm-plugins/decorations/plugin.js +0 -6
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/cjs/pm-plugins/handlers.js +1 -8
- package/dist/cjs/pm-plugins/main.js +0 -23
- package/dist/cjs/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/cjs/pm-plugins/table-analytics.js +0 -7
- package/dist/cjs/pm-plugins/table-local-id.js +0 -17
- package/dist/cjs/pm-plugins/table-resizing/plugin.js +0 -4
- package/dist/cjs/pm-plugins/table-size-selector.js +0 -4
- package/dist/cjs/pm-plugins/table-width-in-comment-fix.js +0 -7
- package/dist/cjs/pm-plugins/table-width.js +0 -17
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +0 -40
- package/dist/cjs/tablePlugin.js +0 -2
- package/dist/es2019/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/es2019/pm-plugins/analytics/plugin.js +0 -8
- package/dist/es2019/pm-plugins/decorations/plugin.js +0 -6
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/es2019/pm-plugins/handlers.js +1 -8
- package/dist/es2019/pm-plugins/main.js +0 -24
- package/dist/es2019/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/es2019/pm-plugins/table-analytics.js +0 -9
- package/dist/es2019/pm-plugins/table-local-id.js +0 -20
- package/dist/es2019/pm-plugins/table-resizing/plugin.js +0 -6
- package/dist/es2019/pm-plugins/table-size-selector.js +0 -4
- package/dist/es2019/pm-plugins/table-width-in-comment-fix.js +0 -10
- package/dist/es2019/pm-plugins/table-width.js +0 -19
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +0 -42
- package/dist/es2019/tablePlugin.js +0 -2
- package/dist/esm/nodeviews/TableRowNativeStickyWithFallback.js +6 -1
- package/dist/esm/pm-plugins/analytics/plugin.js +0 -8
- package/dist/esm/pm-plugins/decorations/plugin.js +0 -6
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +0 -9
- package/dist/esm/pm-plugins/handlers.js +1 -8
- package/dist/esm/pm-plugins/main.js +0 -23
- package/dist/esm/pm-plugins/safari-delete-composition-text-issue-workaround.js +0 -8
- package/dist/esm/pm-plugins/table-analytics.js +0 -7
- package/dist/esm/pm-plugins/table-local-id.js +0 -17
- package/dist/esm/pm-plugins/table-resizing/plugin.js +0 -4
- package/dist/esm/pm-plugins/table-size-selector.js +0 -4
- package/dist/esm/pm-plugins/table-width-in-comment-fix.js +0 -7
- package/dist/esm/pm-plugins/table-width.js +0 -17
- package/dist/esm/pm-plugins/view-mode-sort/index.js +0 -40
- package/dist/esm/tablePlugin.js +0 -2
- package/package.json +5 -5
|
@@ -35,7 +35,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
35
35
|
allTables: []
|
|
36
36
|
};
|
|
37
37
|
},
|
|
38
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
39
38
|
apply: function apply(tr, pluginState, oldState) {
|
|
40
39
|
var _api$editorViewMode;
|
|
41
40
|
// TODO: ED-26961 - move this mode check to plugin creation if possible. Right now it's here because the initial state
|
|
@@ -44,8 +43,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
44
43
|
mode = _ref.mode;
|
|
45
44
|
if (mode !== 'view') {
|
|
46
45
|
var _pluginState$decorati, _pluginState$decorati2;
|
|
47
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
48
|
-
|
|
49
46
|
var _sortingDecorations = pluginState === null || pluginState === void 0 || (_pluginState$decorati = pluginState.decorations) === null || _pluginState$decorati === void 0 ? void 0 : _pluginState$decorati.find(undefined, undefined, function (s) {
|
|
50
47
|
return (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration';
|
|
51
48
|
});
|
|
@@ -63,8 +60,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
63
60
|
|
|
64
61
|
// Remove the table from the state
|
|
65
62
|
if (removeTableMeta) {
|
|
66
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
67
|
-
|
|
68
63
|
allTables = allTables.filter(function (_ref2) {
|
|
69
64
|
var _ref3 = _slicedToArray(_ref2, 1),
|
|
70
65
|
id = _ref3[0];
|
|
@@ -74,9 +69,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
74
69
|
tableId = hoverTableMeta === null || hoverTableMeta === void 0 ? void 0 : hoverTableMeta[0];
|
|
75
70
|
}
|
|
76
71
|
sort = _objectSpread(_objectSpread({}, sort), sortMeta);
|
|
77
|
-
|
|
78
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
79
|
-
|
|
80
72
|
var isTableInState = allTables.some(function (_ref4) {
|
|
81
73
|
var _ref5 = _slicedToArray(_ref4, 1),
|
|
82
74
|
id = _ref5[0];
|
|
@@ -85,8 +77,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
85
77
|
|
|
86
78
|
// Update the table in the state
|
|
87
79
|
if (hoverTableMeta) {
|
|
88
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
89
|
-
|
|
90
80
|
allTables = allTables.filter(function (_ref6) {
|
|
91
81
|
var _ref7 = _slicedToArray(_ref6, 1),
|
|
92
82
|
id = _ref7[0];
|
|
@@ -99,32 +89,23 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
99
89
|
* Create decorations for the sorting icons
|
|
100
90
|
*/
|
|
101
91
|
var decs = [];
|
|
102
|
-
|
|
103
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
104
|
-
|
|
105
92
|
var sortingDecorations = pluginState.decorations.find(undefined, undefined, function (spec) {
|
|
106
93
|
return spec.tableId === tableId && spec.type === 'sorting-decoration';
|
|
107
94
|
});
|
|
108
95
|
|
|
109
96
|
// TODO: ED-26961 - add support for keyboard only users
|
|
110
97
|
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
|
|
111
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
112
|
-
|
|
113
98
|
allTables.forEach(function (table) {
|
|
114
99
|
var _table = _slicedToArray(table, 3),
|
|
115
100
|
tableId = _table[0],
|
|
116
101
|
_node = _table[1],
|
|
117
102
|
pos = _table[2];
|
|
118
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
119
|
-
|
|
120
103
|
var tableNode = tr.doc.nodeAt(tr.mapping.map(pos));
|
|
121
104
|
if (!tableNode || tableNode.type.name !== 'table') {
|
|
122
105
|
return pluginState;
|
|
123
106
|
}
|
|
124
107
|
var map = TableMap.get(tableNode);
|
|
125
108
|
var hasMergedCells = new Set(map.map).size !== map.map.length;
|
|
126
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
127
|
-
|
|
128
109
|
map.mapByRow[0].forEach(function (cell, index) {
|
|
129
110
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
130
111
|
var decorationRenderKey = uuid();
|
|
@@ -173,14 +154,8 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
173
154
|
* Map the decorations to the new document if there are changes
|
|
174
155
|
*/
|
|
175
156
|
if (tr.docChanged) {
|
|
176
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
177
|
-
|
|
178
157
|
decorations = decorations.map(tr.mapping, tr.doc);
|
|
179
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
180
|
-
|
|
181
158
|
allTables = allTables.map(function (table) {
|
|
182
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
183
|
-
|
|
184
159
|
return [table[0], table[1], tr.mapping.map(table[2])];
|
|
185
160
|
});
|
|
186
161
|
}
|
|
@@ -192,8 +167,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
192
167
|
}
|
|
193
168
|
},
|
|
194
169
|
key: key,
|
|
195
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
196
|
-
|
|
197
170
|
appendTransaction: function appendTransaction(trs, oldState, newState) {
|
|
198
171
|
var _api$editorViewMode2, _key$getState;
|
|
199
172
|
// return newState.tr;
|
|
@@ -215,8 +188,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
215
188
|
var tr = _step.value;
|
|
216
189
|
var hoverTableMeta = tr.getMeta('mouseEnterTable');
|
|
217
190
|
if (hoverTableMeta) {
|
|
218
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
219
|
-
|
|
220
191
|
allTables = allTables.filter(function (_ref9) {
|
|
221
192
|
var _ref0 = _slicedToArray(_ref9, 1),
|
|
222
193
|
id = _ref0[0];
|
|
@@ -267,8 +238,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
267
238
|
var sortedOrder = _toConsumableArray(oldOrder).sort(function (a, b) {
|
|
268
239
|
return a.value - b.value;
|
|
269
240
|
});
|
|
270
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
271
|
-
|
|
272
241
|
sortedOrder.forEach(function (index, i) {
|
|
273
242
|
tbody.appendChild(rows[index.index + 1]);
|
|
274
243
|
});
|
|
@@ -295,8 +264,6 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
295
264
|
_rows = _getTableElements2.rows,
|
|
296
265
|
_tbody = _getTableElements2.tbody;
|
|
297
266
|
if (_rows && newOrder) {
|
|
298
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
299
|
-
|
|
300
267
|
newOrder.forEach(function (index, i) {
|
|
301
268
|
_tbody === null || _tbody === void 0 || _tbody.appendChild(_rows[index.value + 1]);
|
|
302
269
|
});
|
|
@@ -328,11 +295,7 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
328
295
|
return newState.tr;
|
|
329
296
|
},
|
|
330
297
|
props: {
|
|
331
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
332
|
-
|
|
333
298
|
handleDOMEvents: {
|
|
334
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
335
|
-
|
|
336
299
|
keydown: function keydown(view, event) {
|
|
337
300
|
// TODO: ED-26961 - fix the focus issue here, where toggling sort with a keypress loses focus
|
|
338
301
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -341,15 +304,12 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
341
304
|
toggleSort(view, event, pluginState);
|
|
342
305
|
}
|
|
343
306
|
},
|
|
344
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
345
|
-
|
|
346
307
|
click: function click(view, event) {
|
|
347
308
|
var _key$getState3;
|
|
348
309
|
var pluginState = ((_key$getState3 = key.getState(view.state)) === null || _key$getState3 === void 0 ? void 0 : _key$getState3.sort) || {};
|
|
349
310
|
toggleSort(view, event, pluginState);
|
|
350
311
|
}
|
|
351
312
|
},
|
|
352
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
353
313
|
decorations: function decorations(state) {
|
|
354
314
|
var _key$getState4;
|
|
355
315
|
var decs = ((_key$getState4 = key.getState(state)) === null || _key$getState4 === void 0 ? void 0 : _key$getState4.decorations) || DecorationSet.empty;
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -414,8 +414,6 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
414
414
|
plugin: function plugin(_ref17) {
|
|
415
415
|
var dispatchAnalyticsEvent = _ref17.dispatchAnalyticsEvent;
|
|
416
416
|
return new SafePlugin({
|
|
417
|
-
// @ts-ignore - Workaround for help-center local consumption
|
|
418
|
-
|
|
419
417
|
view: function view(editorView) {
|
|
420
418
|
editorViewRef.current = editorView;
|
|
421
419
|
var setTimeoutID;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "15.4.
|
|
3
|
+
"version": "15.4.12",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"singleton": true
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^51.
|
|
31
|
+
"@atlaskit/adf-schema": "^51.5.1",
|
|
32
32
|
"@atlaskit/button": "^23.6.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.16.0",
|
|
34
34
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-batch-attribute-updates": "^6.1.0",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^6.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "9.2.
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "9.2.9",
|
|
41
41
|
"@atlaskit/editor-plugin-guideline": "^6.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-interaction": "^10.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-limited-mode": "^3.1.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.1.0",
|
|
59
59
|
"@atlaskit/primitives": "^16.4.0",
|
|
60
60
|
"@atlaskit/theme": "^21.0.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^14.5.0",
|
|
62
62
|
"@atlaskit/toggle": "^15.1.0",
|
|
63
63
|
"@atlaskit/tokens": "^8.4.0",
|
|
64
64
|
"@atlaskit/tooltip": "^20.10.0",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"uuid": "^3.1.0"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@atlaskit/editor-common": "^110.
|
|
74
|
+
"@atlaskit/editor-common": "^110.38.0",
|
|
75
75
|
"react": "^18.2.0",
|
|
76
76
|
"react-dom": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|