@atlaskit/editor-plugin-table 9.4.0 → 9.4.1
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 +9 -0
- package/dist/cjs/pm-plugins/utils/decoration.js +5 -21
- package/dist/cjs/pm-plugins/view-mode-sort/index.js +5 -23
- package/dist/es2019/pm-plugins/utils/decoration.js +8 -24
- package/dist/es2019/pm-plugins/view-mode-sort/index.js +10 -28
- package/dist/esm/pm-plugins/utils/decoration.js +5 -21
- package/dist/esm/pm-plugins/view-mode-sort/index.js +5 -23
- package/dist/types/types/index.d.ts +19 -22
- package/dist/types-ts4.5/types/index.d.ts +19 -22
- package/package.json +7 -10
- package/src/pm-plugins/utils/decoration.ts +6 -27
- package/src/pm-plugins/view-mode-sort/index.ts +6 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 9.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#112186](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112186)
|
|
8
|
+
[`9462d8ca2405a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9462d8ca2405a) -
|
|
9
|
+
Bump adf-schema to 47.2.1
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 9.4.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -7,14 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.updateDecorations = exports.findControlsHoverDecoration = exports.findColumnControlSelectedDecoration = exports.createRowInsertLine = exports.createResizeHandleDecoration = exports.createControlsHoverDecoration = exports.createColumnSelectedDecoration = exports.createColumnLineResize = exports.createColumnInsertLine = exports.createColumnControlsDecoration = exports.createCellHoverDecoration = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
10
|
var _reactIntlNext = require("react-intl-next");
|
|
12
11
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
13
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
14
13
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
15
14
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
16
15
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
17
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
16
|
var _types = require("../../types");
|
|
19
17
|
var _ColumnResizeWidget = require("../../ui/ColumnResizeWidget");
|
|
20
18
|
// @ts-ignore -- ReadonlyTransaction is a local declaration and will cause a TS2305 error in CCFE typecheck
|
|
@@ -274,34 +272,20 @@ var createResizeHandleDecoration = exports.createResizeHandleDecoration = functi
|
|
|
274
272
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
275
273
|
return _view.Decoration.widget(position, function () {
|
|
276
274
|
var element = document.createElement('div');
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
280
|
-
value: getIntl()
|
|
281
|
-
}, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
|
|
282
|
-
startIndex: cellColumnPositioning.left,
|
|
283
|
-
endIndex: cellColumnPositioning.right,
|
|
284
|
-
includeTooltip: includeTooltip
|
|
285
|
-
}));
|
|
286
|
-
}, element, decorationRenderKey);
|
|
287
|
-
} else {
|
|
288
|
-
_reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
275
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
276
|
+
return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
289
277
|
value: getIntl()
|
|
290
278
|
}, /*#__PURE__*/(0, _react.createElement)(_ColumnResizeWidget.ColumnResizeWidget, {
|
|
291
279
|
startIndex: cellColumnPositioning.left,
|
|
292
280
|
endIndex: cellColumnPositioning.right,
|
|
293
281
|
includeTooltip: includeTooltip
|
|
294
|
-
}))
|
|
295
|
-
}
|
|
282
|
+
}));
|
|
283
|
+
}, element, decorationRenderKey);
|
|
296
284
|
return element;
|
|
297
285
|
}, {
|
|
298
286
|
key: "".concat(_types.TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
|
|
299
287
|
destroy: function destroy(node) {
|
|
300
|
-
|
|
301
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
302
|
-
} else {
|
|
303
|
-
_reactDom.default.unmountComponentAtNode(node);
|
|
304
|
-
}
|
|
288
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
305
289
|
}
|
|
306
290
|
});
|
|
307
291
|
};
|
|
@@ -9,14 +9,12 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = require("react");
|
|
12
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
12
|
var _reactIntlNext = require("react-intl-next");
|
|
14
13
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
15
14
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
16
15
|
var _types = require("@atlaskit/editor-common/types");
|
|
17
16
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
18
17
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
18
|
var _SortingIconWrapper = require("../../ui/icons/SortingIconWrapper");
|
|
21
19
|
var _pluginFactory = require("../plugin-factory");
|
|
22
20
|
var _consts = require("./consts");
|
|
@@ -122,20 +120,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
|
|
|
122
120
|
}
|
|
123
121
|
var _getPluginState = (0, _pluginFactory.getPluginState)(oldState),
|
|
124
122
|
getIntl = _getPluginState.getIntl;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
128
|
-
value: getIntl()
|
|
129
|
-
}, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
|
|
130
|
-
isSortingAllowed: !hasMergedCells,
|
|
131
|
-
sortOrdered: sortOrdered,
|
|
132
|
-
onClick: function onClick() {},
|
|
133
|
-
onKeyDown: function onKeyDown() {},
|
|
134
|
-
api: api
|
|
135
|
-
}));
|
|
136
|
-
}, element, decorationRenderKey);
|
|
137
|
-
} else {
|
|
138
|
-
_reactDom.default.render( /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
123
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
124
|
+
return /*#__PURE__*/(0, _react.createElement)(_reactIntlNext.RawIntlProvider, {
|
|
139
125
|
value: getIntl()
|
|
140
126
|
}, /*#__PURE__*/(0, _react.createElement)(_SortingIconWrapper.SortingIconWrapper, {
|
|
141
127
|
isSortingAllowed: !hasMergedCells,
|
|
@@ -143,16 +129,12 @@ var createPlugin = exports.createPlugin = function createPlugin(api, nodeViewPor
|
|
|
143
129
|
onClick: function onClick() {},
|
|
144
130
|
onKeyDown: function onKeyDown() {},
|
|
145
131
|
api: api
|
|
146
|
-
}))
|
|
147
|
-
}
|
|
132
|
+
}));
|
|
133
|
+
}, element, decorationRenderKey);
|
|
148
134
|
return element;
|
|
149
135
|
}, {
|
|
150
136
|
destroy: function destroy(node) {
|
|
151
|
-
|
|
152
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
153
|
-
} else {
|
|
154
|
-
_reactDom.default.unmountComponentAtNode(node);
|
|
155
|
-
}
|
|
137
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
156
138
|
}
|
|
157
139
|
}));
|
|
158
140
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
2
|
import { RawIntlProvider } from 'react-intl-next';
|
|
4
3
|
import uuid from 'uuid/v4';
|
|
5
4
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
@@ -9,7 +8,6 @@ import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
|
9
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
10
9
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
11
10
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
12
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
11
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
14
12
|
import { ColumnResizeWidget } from '../../ui/ColumnResizeWidget';
|
|
15
13
|
const filterDecorationByKey = (key, decorationSet) => decorationSet.find(undefined, undefined, spec => spec.key.indexOf(key) > -1);
|
|
@@ -244,32 +242,18 @@ export const createResizeHandleDecoration = (tr, rowIndexTarget, columnEndIndexT
|
|
|
244
242
|
const position = cellPos + cellNode.nodeSize - 1;
|
|
245
243
|
return Decoration.widget(position, () => {
|
|
246
244
|
const element = document.createElement('div');
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
})), element, decorationRenderKey);
|
|
255
|
-
} else {
|
|
256
|
-
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
257
|
-
value: getIntl()
|
|
258
|
-
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
259
|
-
startIndex: cellColumnPositioning.left,
|
|
260
|
-
endIndex: cellColumnPositioning.right,
|
|
261
|
-
includeTooltip
|
|
262
|
-
})), element);
|
|
263
|
-
}
|
|
245
|
+
nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
|
|
246
|
+
value: getIntl()
|
|
247
|
+
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
248
|
+
startIndex: cellColumnPositioning.left,
|
|
249
|
+
endIndex: cellColumnPositioning.right,
|
|
250
|
+
includeTooltip
|
|
251
|
+
})), element, decorationRenderKey);
|
|
264
252
|
return element;
|
|
265
253
|
}, {
|
|
266
254
|
key: `${TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET}_${rowIndex}_${columnIndex}_${includeTooltip ? 'with' : 'no'}-tooltip`,
|
|
267
255
|
destroy: node => {
|
|
268
|
-
|
|
269
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
270
|
-
} else {
|
|
271
|
-
ReactDOM.unmountComponentAtNode(node);
|
|
272
|
-
}
|
|
256
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
273
257
|
}
|
|
274
258
|
});
|
|
275
259
|
};
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { createElement } from 'react';
|
|
8
|
-
import ReactDOM from 'react-dom';
|
|
9
8
|
import { RawIntlProvider } from 'react-intl-next';
|
|
10
9
|
import uuid from 'uuid/v4';
|
|
11
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
12
11
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
13
12
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
14
13
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
14
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
17
15
|
import { getPluginState } from '../plugin-factory';
|
|
18
16
|
import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
|
|
@@ -99,35 +97,19 @@ export const createPlugin = (api, nodeViewPortalProviderAPI) => {
|
|
|
99
97
|
const {
|
|
100
98
|
getIntl
|
|
101
99
|
} = getPluginState(oldState);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})), element, decorationRenderKey);
|
|
112
|
-
} else {
|
|
113
|
-
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
114
|
-
value: getIntl()
|
|
115
|
-
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
116
|
-
isSortingAllowed: !hasMergedCells,
|
|
117
|
-
sortOrdered,
|
|
118
|
-
onClick: () => {},
|
|
119
|
-
onKeyDown: () => {},
|
|
120
|
-
api
|
|
121
|
-
})), element);
|
|
122
|
-
}
|
|
100
|
+
nodeViewPortalProviderAPI.render(() => /*#__PURE__*/createElement(RawIntlProvider, {
|
|
101
|
+
value: getIntl()
|
|
102
|
+
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
103
|
+
isSortingAllowed: !hasMergedCells,
|
|
104
|
+
sortOrdered,
|
|
105
|
+
onClick: () => {},
|
|
106
|
+
onKeyDown: () => {},
|
|
107
|
+
api
|
|
108
|
+
})), element, decorationRenderKey);
|
|
123
109
|
return element;
|
|
124
110
|
}, {
|
|
125
111
|
destroy: node => {
|
|
126
|
-
|
|
127
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
128
|
-
} else {
|
|
129
|
-
ReactDOM.unmountComponentAtNode(node);
|
|
130
|
-
}
|
|
112
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
131
113
|
}
|
|
132
114
|
}));
|
|
133
115
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { createElement } from 'react';
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
3
|
import { RawIntlProvider } from 'react-intl-next';
|
|
5
4
|
import uuid from 'uuid/v4';
|
|
6
5
|
import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
@@ -10,7 +9,6 @@ import { nonNullable } from '@atlaskit/editor-common/utils';
|
|
|
10
9
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
11
10
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
12
11
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
12
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
15
13
|
import { ColumnResizeWidget } from '../../ui/ColumnResizeWidget';
|
|
16
14
|
var filterDecorationByKey = function filterDecorationByKey(key, decorationSet) {
|
|
@@ -268,34 +266,20 @@ export var createResizeHandleDecoration = function createResizeHandleDecoration(
|
|
|
268
266
|
var position = cellPos + cellNode.nodeSize - 1;
|
|
269
267
|
return Decoration.widget(position, function () {
|
|
270
268
|
var element = document.createElement('div');
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
274
|
-
value: getIntl()
|
|
275
|
-
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
276
|
-
startIndex: cellColumnPositioning.left,
|
|
277
|
-
endIndex: cellColumnPositioning.right,
|
|
278
|
-
includeTooltip: includeTooltip
|
|
279
|
-
}));
|
|
280
|
-
}, element, decorationRenderKey);
|
|
281
|
-
} else {
|
|
282
|
-
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
269
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
270
|
+
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
283
271
|
value: getIntl()
|
|
284
272
|
}, /*#__PURE__*/createElement(ColumnResizeWidget, {
|
|
285
273
|
startIndex: cellColumnPositioning.left,
|
|
286
274
|
endIndex: cellColumnPositioning.right,
|
|
287
275
|
includeTooltip: includeTooltip
|
|
288
|
-
}))
|
|
289
|
-
}
|
|
276
|
+
}));
|
|
277
|
+
}, element, decorationRenderKey);
|
|
290
278
|
return element;
|
|
291
279
|
}, {
|
|
292
280
|
key: "".concat(TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET, "_").concat(rowIndex, "_").concat(columnIndex, "_").concat(includeTooltip ? 'with' : 'no', "-tooltip"),
|
|
293
281
|
destroy: function destroy(node) {
|
|
294
|
-
|
|
295
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
296
|
-
} else {
|
|
297
|
-
ReactDOM.unmountComponentAtNode(node);
|
|
298
|
-
}
|
|
282
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
299
283
|
}
|
|
300
284
|
});
|
|
301
285
|
};
|
|
@@ -13,14 +13,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { createElement } from 'react';
|
|
16
|
-
import ReactDOM from 'react-dom';
|
|
17
16
|
import { RawIntlProvider } from 'react-intl-next';
|
|
18
17
|
import uuid from 'uuid/v4';
|
|
19
18
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
20
19
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
21
20
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
22
21
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
23
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
22
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
25
23
|
import { getPluginState } from '../plugin-factory';
|
|
26
24
|
import { IS_DISABLED_CLASS_NAME, SORT_INDEX_DATA_ATTRIBUTE, SORTING_ICON_CLASS_NAME } from './consts';
|
|
@@ -117,20 +115,8 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
117
115
|
}
|
|
118
116
|
var _getPluginState = getPluginState(oldState),
|
|
119
117
|
getIntl = _getPluginState.getIntl;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
123
|
-
value: getIntl()
|
|
124
|
-
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
125
|
-
isSortingAllowed: !hasMergedCells,
|
|
126
|
-
sortOrdered: sortOrdered,
|
|
127
|
-
onClick: function onClick() {},
|
|
128
|
-
onKeyDown: function onKeyDown() {},
|
|
129
|
-
api: api
|
|
130
|
-
}));
|
|
131
|
-
}, element, decorationRenderKey);
|
|
132
|
-
} else {
|
|
133
|
-
ReactDOM.render( /*#__PURE__*/createElement(RawIntlProvider, {
|
|
118
|
+
nodeViewPortalProviderAPI.render(function () {
|
|
119
|
+
return /*#__PURE__*/createElement(RawIntlProvider, {
|
|
134
120
|
value: getIntl()
|
|
135
121
|
}, /*#__PURE__*/createElement(SortingIconWrapper, {
|
|
136
122
|
isSortingAllowed: !hasMergedCells,
|
|
@@ -138,16 +124,12 @@ export var createPlugin = function createPlugin(api, nodeViewPortalProviderAPI)
|
|
|
138
124
|
onClick: function onClick() {},
|
|
139
125
|
onKeyDown: function onKeyDown() {},
|
|
140
126
|
api: api
|
|
141
|
-
}))
|
|
142
|
-
}
|
|
127
|
+
}));
|
|
128
|
+
}, element, decorationRenderKey);
|
|
143
129
|
return element;
|
|
144
130
|
}, {
|
|
145
131
|
destroy: function destroy(node) {
|
|
146
|
-
|
|
147
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
148
|
-
} else {
|
|
149
|
-
ReactDOM.unmountComponentAtNode(node);
|
|
150
|
-
}
|
|
132
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
151
133
|
}
|
|
152
134
|
}));
|
|
153
135
|
});
|
|
@@ -401,28 +401,25 @@ export declare const TableCssClassName: {
|
|
|
401
401
|
WITH_ROW_INSERT_LINE_INACTIVE: string;
|
|
402
402
|
WITH_LAST_ROW_INSERT_LINE: string;
|
|
403
403
|
WITH_LAST_ROW_INSERT_LINE_INACTIVE: string;
|
|
404
|
-
TABLE_CONTAINER:
|
|
405
|
-
TABLE_NODE_WRAPPER:
|
|
406
|
-
TABLE_LEFT_SHADOW:
|
|
407
|
-
TABLE_RIGHT_SHADOW:
|
|
408
|
-
TABLE_STICKY_SHADOW:
|
|
409
|
-
TABLE_STICKY_WRAPPER:
|
|
410
|
-
TABLE_STICKY_SCROLLBAR_CONTAINER:
|
|
411
|
-
TABLE_STICKY_SENTINEL_TOP:
|
|
412
|
-
TABLE_STICKY_SENTINEL_BOTTOM:
|
|
413
|
-
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP:
|
|
414
|
-
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM:
|
|
415
|
-
TABLE_SHADOW_SENTINEL_LEFT:
|
|
416
|
-
TABLE_SHADOW_SENTINEL_RIGHT:
|
|
417
|
-
TABLE_CELL_NODEVIEW_CONTENT_DOM:
|
|
418
|
-
TABLE_CELL_WRAPPER:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
TABLE_ROW_CONTROLS_WRAPPER: string;
|
|
424
|
-
TABLE_COLUMN_CONTROLS_DECORATIONS: string;
|
|
425
|
-
TABLE_RESIZER_CONTAINER: string;
|
|
404
|
+
TABLE_CONTAINER: "pm-table-container";
|
|
405
|
+
TABLE_NODE_WRAPPER: "pm-table-wrapper";
|
|
406
|
+
TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
|
|
407
|
+
TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
|
|
408
|
+
TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
|
|
409
|
+
TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
|
|
410
|
+
TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
|
|
411
|
+
TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
|
|
412
|
+
TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
|
|
413
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
|
|
414
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
|
|
415
|
+
TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
|
|
416
|
+
TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
|
|
417
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
|
|
418
|
+
TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
|
|
419
|
+
TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
|
|
420
|
+
TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
|
|
421
|
+
TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
|
|
422
|
+
TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
|
|
426
423
|
};
|
|
427
424
|
export interface ToolbarMenuConfig {
|
|
428
425
|
allowHeaderRow?: boolean;
|
|
@@ -401,28 +401,25 @@ export declare const TableCssClassName: {
|
|
|
401
401
|
WITH_ROW_INSERT_LINE_INACTIVE: string;
|
|
402
402
|
WITH_LAST_ROW_INSERT_LINE: string;
|
|
403
403
|
WITH_LAST_ROW_INSERT_LINE_INACTIVE: string;
|
|
404
|
-
TABLE_CONTAINER:
|
|
405
|
-
TABLE_NODE_WRAPPER:
|
|
406
|
-
TABLE_LEFT_SHADOW:
|
|
407
|
-
TABLE_RIGHT_SHADOW:
|
|
408
|
-
TABLE_STICKY_SHADOW:
|
|
409
|
-
TABLE_STICKY_WRAPPER:
|
|
410
|
-
TABLE_STICKY_SCROLLBAR_CONTAINER:
|
|
411
|
-
TABLE_STICKY_SENTINEL_TOP:
|
|
412
|
-
TABLE_STICKY_SENTINEL_BOTTOM:
|
|
413
|
-
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP:
|
|
414
|
-
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM:
|
|
415
|
-
TABLE_SHADOW_SENTINEL_LEFT:
|
|
416
|
-
TABLE_SHADOW_SENTINEL_RIGHT:
|
|
417
|
-
TABLE_CELL_NODEVIEW_CONTENT_DOM:
|
|
418
|
-
TABLE_CELL_WRAPPER:
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
TABLE_ROW_CONTROLS_WRAPPER: string;
|
|
424
|
-
TABLE_COLUMN_CONTROLS_DECORATIONS: string;
|
|
425
|
-
TABLE_RESIZER_CONTAINER: string;
|
|
404
|
+
TABLE_CONTAINER: "pm-table-container";
|
|
405
|
+
TABLE_NODE_WRAPPER: "pm-table-wrapper";
|
|
406
|
+
TABLE_LEFT_SHADOW: "pm-table-with-left-shadow";
|
|
407
|
+
TABLE_RIGHT_SHADOW: "pm-table-with-right-shadow";
|
|
408
|
+
TABLE_STICKY_SHADOW: "pm-table-sticky-shadow";
|
|
409
|
+
TABLE_STICKY_WRAPPER: "pm-table-sticky-wrapper";
|
|
410
|
+
TABLE_STICKY_SCROLLBAR_CONTAINER: "pm-table-sticky-scrollbar-container";
|
|
411
|
+
TABLE_STICKY_SENTINEL_TOP: "pm-table-sticky-sentinel-top";
|
|
412
|
+
TABLE_STICKY_SENTINEL_BOTTOM: "pm-table-sticky-sentinel-bottom";
|
|
413
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_TOP: "pm-table-sticky-scrollbar-sentinel-top";
|
|
414
|
+
TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM: "pm-table-sticky-scrollbar-sentinel-bottom";
|
|
415
|
+
TABLE_SHADOW_SENTINEL_LEFT: "pm-table-shadow-sentinel-left";
|
|
416
|
+
TABLE_SHADOW_SENTINEL_RIGHT: "pm-table-shadow-sentinel-right";
|
|
417
|
+
TABLE_CELL_NODEVIEW_CONTENT_DOM: "pm-table-cell-nodeview-content-dom";
|
|
418
|
+
TABLE_CELL_WRAPPER: "pm-table-cell-content-wrap";
|
|
419
|
+
TABLE_HEADER_CELL_WRAPPER: "pm-table-header-content-wrap";
|
|
420
|
+
TABLE_ROW_CONTROLS_WRAPPER: "pm-table-row-controls-wrapper";
|
|
421
|
+
TABLE_COLUMN_CONTROLS_DECORATIONS: "pm-table-column-controls-decoration";
|
|
422
|
+
TABLE_RESIZER_CONTAINER: "pm-table-resizer-container";
|
|
426
423
|
};
|
|
427
424
|
export interface ToolbarMenuConfig {
|
|
428
425
|
allowHeaderRow?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.1",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"runReact18": true
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
30
|
+
"@atlaskit/adf-schema": "^47.2.1",
|
|
31
31
|
"@atlaskit/button": "^20.5.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.10.0",
|
|
33
|
-
"@atlaskit/editor-common": "^99.
|
|
33
|
+
"@atlaskit/editor-common": "^99.14.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.7.0",
|
|
35
35
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.4.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.12.0",
|
|
37
|
-
"@atlaskit/editor-plugin-batch-attribute-updates": "1.3.
|
|
37
|
+
"@atlaskit/editor-plugin-batch-attribute-updates": "1.3.1",
|
|
38
38
|
"@atlaskit/editor-plugin-content-insertion": "^1.13.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.2.0",
|
|
40
40
|
"@atlaskit/editor-plugin-guideline": "^1.4.0",
|
|
41
|
-
"@atlaskit/editor-plugin-selection": "^1.
|
|
41
|
+
"@atlaskit/editor-plugin-selection": "^1.8.0",
|
|
42
42
|
"@atlaskit/editor-plugin-width": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
46
|
-
"@atlaskit/icon": "^23.
|
|
46
|
+
"@atlaskit/icon": "^23.9.0",
|
|
47
47
|
"@atlaskit/menu": "^2.14.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
52
52
|
"@atlaskit/primitives": "^13.5.0",
|
|
53
53
|
"@atlaskit/theme": "^15.0.0",
|
|
54
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^2.46.0",
|
|
55
55
|
"@atlaskit/toggle": "^14.1.0",
|
|
56
56
|
"@atlaskit/tokens": "^3.3.0",
|
|
57
57
|
"@atlaskit/tooltip": "^19.1.0",
|
|
@@ -116,9 +116,6 @@
|
|
|
116
116
|
"platform-visual-refresh-icons": {
|
|
117
117
|
"type": "boolean"
|
|
118
118
|
},
|
|
119
|
-
"platform_editor_react18_plugin_portalprovider": {
|
|
120
|
-
"type": "boolean"
|
|
121
|
-
},
|
|
122
119
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
123
120
|
"type": "boolean",
|
|
124
121
|
"referenceOnly": true
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { createElement } from 'react';
|
|
2
2
|
|
|
3
|
-
import ReactDOM from 'react-dom';
|
|
4
3
|
import { RawIntlProvider } from 'react-intl-next';
|
|
5
4
|
import type { IntlShape } from 'react-intl-next';
|
|
6
5
|
import uuid from 'uuid/v4';
|
|
@@ -20,7 +19,6 @@ import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
20
19
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
21
20
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
22
21
|
import { findTable, getCellsInRow, getSelectionRect } from '@atlaskit/editor-tables/utils';
|
|
23
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
22
|
|
|
25
23
|
import type { Cell, CellColumnPositioning } from '../../types';
|
|
26
24
|
import { TableCssClassName as ClassName, TableDecorations } from '../../types';
|
|
@@ -341,23 +339,8 @@ export const createResizeHandleDecoration = (
|
|
|
341
339
|
position,
|
|
342
340
|
() => {
|
|
343
341
|
const element = document.createElement('div');
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
() =>
|
|
347
|
-
createElement(
|
|
348
|
-
RawIntlProvider,
|
|
349
|
-
{ value: getIntl() },
|
|
350
|
-
createElement(ColumnResizeWidget, {
|
|
351
|
-
startIndex: cellColumnPositioning.left,
|
|
352
|
-
endIndex: cellColumnPositioning.right,
|
|
353
|
-
includeTooltip,
|
|
354
|
-
}),
|
|
355
|
-
),
|
|
356
|
-
element,
|
|
357
|
-
decorationRenderKey,
|
|
358
|
-
);
|
|
359
|
-
} else {
|
|
360
|
-
ReactDOM.render(
|
|
342
|
+
nodeViewPortalProviderAPI.render(
|
|
343
|
+
() =>
|
|
361
344
|
createElement(
|
|
362
345
|
RawIntlProvider,
|
|
363
346
|
{ value: getIntl() },
|
|
@@ -367,9 +350,9 @@ export const createResizeHandleDecoration = (
|
|
|
367
350
|
includeTooltip,
|
|
368
351
|
}),
|
|
369
352
|
),
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
353
|
+
element,
|
|
354
|
+
decorationRenderKey,
|
|
355
|
+
);
|
|
373
356
|
return element;
|
|
374
357
|
},
|
|
375
358
|
{
|
|
@@ -377,11 +360,7 @@ export const createResizeHandleDecoration = (
|
|
|
377
360
|
TableDecorations.COLUMN_RESIZING_HANDLE_WIDGET
|
|
378
361
|
}_${rowIndex}_${columnIndex}_${includeTooltip ? 'with' : 'no'}-tooltip`,
|
|
379
362
|
destroy: (node) => {
|
|
380
|
-
|
|
381
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
382
|
-
} else {
|
|
383
|
-
ReactDOM.unmountComponentAtNode(node as HTMLDivElement);
|
|
384
|
-
}
|
|
363
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
385
364
|
},
|
|
386
365
|
},
|
|
387
366
|
);
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
import { createElement } from 'react';
|
|
8
8
|
|
|
9
|
-
import ReactDOM from 'react-dom';
|
|
10
9
|
import { RawIntlProvider } from 'react-intl-next';
|
|
11
10
|
import uuid from 'uuid/v4';
|
|
12
11
|
|
|
@@ -16,7 +15,6 @@ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
|
16
15
|
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
17
16
|
import { Decoration, DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
18
17
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
19
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
18
|
|
|
21
19
|
import type tablePlugin from '../../tablePlugin';
|
|
22
20
|
import { SortingIconWrapper } from '../../ui/icons/SortingIconWrapper';
|
|
@@ -111,25 +109,8 @@ export const createPlugin = (
|
|
|
111
109
|
|
|
112
110
|
const { getIntl } = getPluginState(oldState);
|
|
113
111
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
() =>
|
|
117
|
-
createElement(
|
|
118
|
-
RawIntlProvider,
|
|
119
|
-
{ value: getIntl() },
|
|
120
|
-
createElement(SortingIconWrapper, {
|
|
121
|
-
isSortingAllowed: !hasMergedCells,
|
|
122
|
-
sortOrdered,
|
|
123
|
-
onClick: () => {},
|
|
124
|
-
onKeyDown: () => {},
|
|
125
|
-
api,
|
|
126
|
-
}),
|
|
127
|
-
),
|
|
128
|
-
element,
|
|
129
|
-
decorationRenderKey,
|
|
130
|
-
);
|
|
131
|
-
} else {
|
|
132
|
-
ReactDOM.render(
|
|
112
|
+
nodeViewPortalProviderAPI.render(
|
|
113
|
+
() =>
|
|
133
114
|
createElement(
|
|
134
115
|
RawIntlProvider,
|
|
135
116
|
{ value: getIntl() },
|
|
@@ -141,19 +122,15 @@ export const createPlugin = (
|
|
|
141
122
|
api,
|
|
142
123
|
}),
|
|
143
124
|
),
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
125
|
+
element,
|
|
126
|
+
decorationRenderKey,
|
|
127
|
+
);
|
|
147
128
|
|
|
148
129
|
return element;
|
|
149
130
|
},
|
|
150
131
|
{
|
|
151
132
|
destroy: (node) => {
|
|
152
|
-
|
|
153
|
-
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
154
|
-
} else {
|
|
155
|
-
ReactDOM.unmountComponentAtNode(node as HTMLDivElement);
|
|
156
|
-
}
|
|
133
|
+
nodeViewPortalProviderAPI.remove(decorationRenderKey);
|
|
157
134
|
},
|
|
158
135
|
},
|
|
159
136
|
),
|