@atlaskit/editor-plugin-table 12.1.10 → 12.1.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 +18 -0
- package/dist/cjs/nodeviews/table.js +3 -7
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +3 -4
- package/dist/es2019/nodeviews/table.js +3 -7
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +3 -4
- package/dist/esm/nodeviews/table.js +3 -7
- package/dist/esm/pm-plugins/view-mode-sort/index.js +3 -4
- package/dist/types/pm-plugins/view-mode-sort/index.d.ts +6 -2
- package/dist/types-ts4.5/pm-plugins/view-mode-sort/index.d.ts +10 -2
- package/package.json +3 -9
- package/src/nodeviews/table.tsx +3 -7
- package/src/pm-plugins/view-mode-sort/index.ts +5 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 12.1.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#195989](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195989)
|
|
8
|
+
[`4132618fc5097`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4132618fc5097) -
|
|
9
|
+
EDITOR-1146 Remove usage of FG `platform_editor_sort_decoration_fix_on_live_page`
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 12.1.11
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#195804](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195804)
|
|
17
|
+
[`c60fbe1e74541`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c60fbe1e74541) -
|
|
18
|
+
ED-28804: Cleanup FG platform_editor_r18_fix_selection_resync
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 12.1.10
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -165,13 +165,9 @@ var TableView = exports.default = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
165
165
|
var resolvedSelection = selectionBookmark.resolve(_this2.view.state.tr.doc);
|
|
166
166
|
// Don't set the selection if it's the same as the current selection.
|
|
167
167
|
if (!resolvedSelection.eq(_this2.view.state.selection)) {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
_this2.view.dispatch(tr);
|
|
172
|
-
} else {
|
|
173
|
-
_this2.view.dispatch(_this2.view.state.tr.setSelection(resolvedSelection));
|
|
174
|
-
}
|
|
168
|
+
var tr = _this2.view.state.tr.setSelection(resolvedSelection);
|
|
169
|
+
tr.setMeta('source', 'TableNodeView:_handleTableRef:selection-resync');
|
|
170
|
+
_this2.view.dispatch(tr);
|
|
175
171
|
}
|
|
176
172
|
}
|
|
177
173
|
});
|
|
@@ -15,7 +15,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
15
15
|
var _types = require("@atlaskit/editor-common/types");
|
|
16
16
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
17
17
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _SortingIconWrapper = require("../../ui/icons/SortingIconWrapper");
|
|
20
19
|
var _pluginFactory = require("../plugin-factory");
|
|
21
20
|
var _consts = require("./consts");
|
|
@@ -51,9 +50,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
|
|
|
51
50
|
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) {
|
|
52
51
|
return (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration';
|
|
53
52
|
});
|
|
54
|
-
return
|
|
53
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
55
54
|
decorations: pluginState === null || pluginState === void 0 || (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(_sortingDecorations)
|
|
56
|
-
})
|
|
55
|
+
});
|
|
57
56
|
}
|
|
58
57
|
var decorations = pluginState.decorations,
|
|
59
58
|
sort = pluginState.sort,
|
|
@@ -99,7 +98,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
|
|
|
99
98
|
});
|
|
100
99
|
|
|
101
100
|
// TODO: ED-26961 - add support for keyboard only users
|
|
102
|
-
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length
|
|
101
|
+
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
|
|
103
102
|
allTables.forEach(function (table) {
|
|
104
103
|
var _table = (0, _slicedToArray2.default)(table, 3),
|
|
105
104
|
tableId = _table[0],
|
|
@@ -137,13 +137,9 @@ export default class TableView extends ReactNodeView {
|
|
|
137
137
|
const resolvedSelection = selectionBookmark.resolve(this.view.state.tr.doc);
|
|
138
138
|
// Don't set the selection if it's the same as the current selection.
|
|
139
139
|
if (!resolvedSelection.eq(this.view.state.selection)) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
this.view.dispatch(tr);
|
|
144
|
-
} else {
|
|
145
|
-
this.view.dispatch(this.view.state.tr.setSelection(resolvedSelection));
|
|
146
|
-
}
|
|
140
|
+
const tr = this.view.state.tr.setSelection(resolvedSelection);
|
|
141
|
+
tr.setMeta('source', 'TableNodeView:_handleTableRef:selection-resync');
|
|
142
|
+
this.view.dispatch(tr);
|
|
147
143
|
}
|
|
148
144
|
}
|
|
149
145
|
});
|
|
@@ -11,7 +11,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
11
11
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
12
12
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
13
13
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
16
15
|
import { getPluginState } from '../plugin-factory';
|
|
17
16
|
import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
|
|
@@ -35,10 +34,10 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
|
|
|
35
34
|
if (mode !== 'view') {
|
|
36
35
|
var _pluginState$decorati, _pluginState$decorati2;
|
|
37
36
|
const sortingDecorations = pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$decorati = pluginState.decorations) === null || _pluginState$decorati === void 0 ? void 0 : _pluginState$decorati.find(undefined, undefined, s => (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration');
|
|
38
|
-
return
|
|
37
|
+
return {
|
|
39
38
|
...pluginState,
|
|
40
39
|
decorations: pluginState === null || pluginState === void 0 ? void 0 : (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(sortingDecorations)
|
|
41
|
-
}
|
|
40
|
+
};
|
|
42
41
|
}
|
|
43
42
|
let {
|
|
44
43
|
decorations,
|
|
@@ -75,7 +74,7 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
|
|
|
75
74
|
const sortingDecorations = pluginState.decorations.find(undefined, undefined, spec => spec.tableId === tableId && spec.type === 'sorting-decoration');
|
|
76
75
|
|
|
77
76
|
// TODO: ED-26961 - add support for keyboard only users
|
|
78
|
-
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length
|
|
77
|
+
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
|
|
79
78
|
allTables.forEach(table => {
|
|
80
79
|
const [tableId, _node, pos] = table;
|
|
81
80
|
const tableNode = tr.doc.nodeAt(tr.mapping.map(pos));
|
|
@@ -158,13 +158,9 @@ var TableView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
158
158
|
var resolvedSelection = selectionBookmark.resolve(_this2.view.state.tr.doc);
|
|
159
159
|
// Don't set the selection if it's the same as the current selection.
|
|
160
160
|
if (!resolvedSelection.eq(_this2.view.state.selection)) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
_this2.view.dispatch(tr);
|
|
165
|
-
} else {
|
|
166
|
-
_this2.view.dispatch(_this2.view.state.tr.setSelection(resolvedSelection));
|
|
167
|
-
}
|
|
161
|
+
var tr = _this2.view.state.tr.setSelection(resolvedSelection);
|
|
162
|
+
tr.setMeta('source', 'TableNodeView:_handleTableRef:selection-resync');
|
|
163
|
+
_this2.view.dispatch(tr);
|
|
168
164
|
}
|
|
169
165
|
}
|
|
170
166
|
});
|
|
@@ -19,7 +19,6 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
19
19
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
20
20
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
21
21
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
22
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
23
22
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
24
23
|
import { getPluginState } from '../plugin-factory';
|
|
25
24
|
import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
|
|
@@ -46,9 +45,9 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
46
45
|
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) {
|
|
47
46
|
return (s === null || s === void 0 ? void 0 : s.type) === 'sorting-decoration';
|
|
48
47
|
});
|
|
49
|
-
return
|
|
48
|
+
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
50
49
|
decorations: pluginState === null || pluginState === void 0 || (_pluginState$decorati2 = pluginState.decorations) === null || _pluginState$decorati2 === void 0 ? void 0 : _pluginState$decorati2.remove(_sortingDecorations)
|
|
51
|
-
})
|
|
50
|
+
});
|
|
52
51
|
}
|
|
53
52
|
var decorations = pluginState.decorations,
|
|
54
53
|
sort = pluginState.sort,
|
|
@@ -94,7 +93,7 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
94
93
|
});
|
|
95
94
|
|
|
96
95
|
// TODO: ED-26961 - add support for keyboard only users
|
|
97
|
-
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length
|
|
96
|
+
if (hoverTableMeta && !isTableInState || sortMeta || isTableInState && !sortingDecorations.length) {
|
|
98
97
|
allTables.forEach(function (table) {
|
|
99
98
|
var _table = _slicedToArray(table, 3),
|
|
100
99
|
tableId = _table[0],
|
|
@@ -6,6 +6,10 @@
|
|
|
6
6
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
10
|
import type tablePlugin from '../../tablePlugin';
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
|
|
12
|
+
decorations: DecorationSet;
|
|
13
|
+
sort: import("./types").TableSortMeta;
|
|
14
|
+
allTables: [string, import("prosemirror-model").Node, number][];
|
|
15
|
+
}>;
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
8
8
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
|
+
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
9
10
|
import type tablePlugin from '../../tablePlugin';
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
export declare const createPlugin: (api: ExtractInjectionAPI<typeof tablePlugin>, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<{
|
|
12
|
+
decorations: DecorationSet;
|
|
13
|
+
sort: import("./types").TableSortMeta;
|
|
14
|
+
allTables: [
|
|
15
|
+
string,
|
|
16
|
+
import("prosemirror-model").Node,
|
|
17
|
+
number
|
|
18
|
+
][];
|
|
19
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "12.1.
|
|
3
|
+
"version": "12.1.12",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/primitives": "^14.11.0",
|
|
55
55
|
"@atlaskit/react-ufo": "^4.1.0",
|
|
56
56
|
"@atlaskit/theme": "^19.0.0",
|
|
57
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^9.24.0",
|
|
58
58
|
"@atlaskit/toggle": "^15.1.0",
|
|
59
59
|
"@atlaskit/tokens": "^6.0.0",
|
|
60
60
|
"@atlaskit/tooltip": "^20.4.0",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"uuid": "^3.1.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@atlaskit/editor-common": "^107.
|
|
70
|
+
"@atlaskit/editor-common": "^107.17.0",
|
|
71
71
|
"react": "^18.2.0",
|
|
72
72
|
"react-dom": "^18.2.0",
|
|
73
73
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -145,9 +145,6 @@
|
|
|
145
145
|
"platform_editor_nested_tables_sticky_header_bug": {
|
|
146
146
|
"type": "boolean"
|
|
147
147
|
},
|
|
148
|
-
"platform_editor_sort_decoration_fix_on_live_page": {
|
|
149
|
-
"type": "boolean"
|
|
150
|
-
},
|
|
151
148
|
"platform_editor_table_column_selected_state_fix": {
|
|
152
149
|
"type": "boolean"
|
|
153
150
|
},
|
|
@@ -178,9 +175,6 @@
|
|
|
178
175
|
"platform_editor_table_drag_menu_flickers_fix": {
|
|
179
176
|
"type": "boolean"
|
|
180
177
|
},
|
|
181
|
-
"platform_editor_r18_fix_selection_resync": {
|
|
182
|
-
"type": "boolean"
|
|
183
|
-
},
|
|
184
178
|
"platform_editor_table_fw_numcol_overflow_fix": {
|
|
185
179
|
"type": "boolean"
|
|
186
180
|
},
|
package/src/nodeviews/table.tsx
CHANGED
|
@@ -207,13 +207,9 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
207
207
|
const resolvedSelection = selectionBookmark.resolve(this.view.state.tr.doc);
|
|
208
208
|
// Don't set the selection if it's the same as the current selection.
|
|
209
209
|
if (!resolvedSelection.eq(this.view.state.selection)) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
this.view.dispatch(tr);
|
|
214
|
-
} else {
|
|
215
|
-
this.view.dispatch(this.view.state.tr.setSelection(resolvedSelection));
|
|
216
|
-
}
|
|
210
|
+
const tr = this.view.state.tr.setSelection(resolvedSelection);
|
|
211
|
+
tr.setMeta('source', 'TableNodeView:_handleTableRef:selection-resync');
|
|
212
|
+
this.view.dispatch(tr);
|
|
217
213
|
}
|
|
218
214
|
}
|
|
219
215
|
});
|
|
@@ -15,7 +15,6 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
15
15
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
16
16
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
17
17
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
18
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
18
|
|
|
20
19
|
import type tablePlugin from '../../tablePlugin';
|
|
21
20
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
@@ -52,12 +51,10 @@ export const createPlugin = (
|
|
|
52
51
|
(s) => s?.type === 'sorting-decoration',
|
|
53
52
|
);
|
|
54
53
|
|
|
55
|
-
return
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
: pluginState;
|
|
54
|
+
return {
|
|
55
|
+
...pluginState,
|
|
56
|
+
decorations: pluginState?.decorations?.remove(sortingDecorations),
|
|
57
|
+
};
|
|
61
58
|
}
|
|
62
59
|
let { decorations, sort, allTables } = pluginState;
|
|
63
60
|
|
|
@@ -99,9 +96,7 @@ export const createPlugin = (
|
|
|
99
96
|
if (
|
|
100
97
|
(hoverTableMeta && !isTableInState) ||
|
|
101
98
|
sortMeta ||
|
|
102
|
-
(isTableInState &&
|
|
103
|
-
!sortingDecorations.length &&
|
|
104
|
-
fg('platform_editor_sort_decoration_fix_on_live_page'))
|
|
99
|
+
(isTableInState && !sortingDecorations.length)
|
|
105
100
|
) {
|
|
106
101
|
allTables.forEach((table) => {
|
|
107
102
|
const [tableId, _node, pos] = table;
|