@atlaskit/editor-plugin-table 7.19.1 → 7.19.3
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/TableComponent.js +7 -2
- package/dist/cjs/plugin.js +1 -2
- package/dist/es2019/nodeviews/TableComponent.js +7 -3
- package/dist/es2019/plugin.js +1 -2
- package/dist/esm/nodeviews/TableComponent.js +7 -2
- package/dist/esm/plugin.js +1 -2
- package/package.json +3 -3
- package/src/nodeviews/TableComponent.tsx +18 -7
- package/src/plugin.tsx +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.19.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#114530](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114530)
|
|
8
|
+
[`3b9fcf5e7a8bd`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3b9fcf5e7a8bd) -
|
|
9
|
+
[ux] Fix increased scaling percent check
|
|
10
|
+
|
|
11
|
+
## 7.19.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#115086](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115086)
|
|
16
|
+
[`e22c1261d6b17`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e22c1261d6b17) -
|
|
17
|
+
Add a tint to table transactions that are not created by users to avoid issues for view only live
|
|
18
|
+
pages
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 7.19.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -19,6 +19,7 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
19
19
|
var _rafSchd = _interopRequireDefault(require("raf-schd"));
|
|
20
20
|
var _reactIntlNext = require("react-intl-next");
|
|
21
21
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
22
|
+
var _collab = require("@atlaskit/editor-common/collab");
|
|
22
23
|
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
23
24
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
24
25
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -164,7 +165,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
164
165
|
if (shouldScaleTable) {
|
|
165
166
|
_this.scaleTable({
|
|
166
167
|
parentWidth: parentWidth
|
|
167
|
-
});
|
|
168
|
+
}, hasNumberedColumnChanged);
|
|
168
169
|
}
|
|
169
170
|
|
|
170
171
|
// only when table resizing is enabled and toggle numbered column to run scaleTable
|
|
@@ -172,7 +173,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
172
173
|
if (!(0, _colgroup.hasTableBeenResized)(prevNode)) {
|
|
173
174
|
_this.scaleTable({
|
|
174
175
|
parentWidth: node.attrs.width
|
|
175
|
-
});
|
|
176
|
+
}, true);
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
_this.updateParentWidth(parentWidth);
|
|
@@ -183,6 +184,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
183
184
|
});
|
|
184
185
|
// Function gets called when table is nested.
|
|
185
186
|
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "scaleTable", function (scaleOptions) {
|
|
187
|
+
var isUserTriggered = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
186
188
|
var _this$props2 = _this.props,
|
|
187
189
|
view = _this$props2.view,
|
|
188
190
|
getNode = _this$props2.getNode,
|
|
@@ -209,6 +211,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
209
211
|
// isTableScalingEnabled doesn't change the behavior of nested tables
|
|
210
212
|
false // shouldUseIncreasedScalingPercent set to false for nested tables
|
|
211
213
|
)(state.tr);
|
|
214
|
+
if (!isUserTriggered) {
|
|
215
|
+
(0, _collab.tintDirtyTransaction)(tr);
|
|
216
|
+
}
|
|
212
217
|
dispatch(tr);
|
|
213
218
|
});
|
|
214
219
|
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "setTimerToSendInitialOverflowCaptured", function (isOverflowing) {
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -73,8 +73,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
73
73
|
};
|
|
74
74
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
75
75
|
var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
76
|
-
var shouldUseIncreasedScalingPercent = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
77
|
-
isTableFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
76
|
+
var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && isTableFixedColumnWidthsOptionEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
78
77
|
var isCellBackgroundDuplicated = (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableDuplicateCellColouring) || false;
|
|
79
78
|
return {
|
|
80
79
|
name: 'table',
|
|
@@ -5,6 +5,7 @@ import memoizeOne from 'memoize-one';
|
|
|
5
5
|
import rafSchedule from 'raf-schd';
|
|
6
6
|
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
8
9
|
import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
9
10
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
10
11
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
@@ -148,7 +149,7 @@ class TableComponent extends React.Component {
|
|
|
148
149
|
if (shouldScaleTable) {
|
|
149
150
|
this.scaleTable({
|
|
150
151
|
parentWidth
|
|
151
|
-
});
|
|
152
|
+
}, hasNumberedColumnChanged);
|
|
152
153
|
}
|
|
153
154
|
|
|
154
155
|
// only when table resizing is enabled and toggle numbered column to run scaleTable
|
|
@@ -156,7 +157,7 @@ class TableComponent extends React.Component {
|
|
|
156
157
|
if (!hasTableBeenResized(prevNode)) {
|
|
157
158
|
this.scaleTable({
|
|
158
159
|
parentWidth: node.attrs.width
|
|
159
|
-
});
|
|
160
|
+
}, true);
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
this.updateParentWidth(parentWidth);
|
|
@@ -166,7 +167,7 @@ class TableComponent extends React.Component {
|
|
|
166
167
|
this.layoutSize = layoutSize;
|
|
167
168
|
});
|
|
168
169
|
// Function gets called when table is nested.
|
|
169
|
-
_defineProperty(this, "scaleTable", scaleOptions => {
|
|
170
|
+
_defineProperty(this, "scaleTable", (scaleOptions, isUserTriggered = false) => {
|
|
170
171
|
const {
|
|
171
172
|
view,
|
|
172
173
|
getNode,
|
|
@@ -200,6 +201,9 @@ class TableComponent extends React.Component {
|
|
|
200
201
|
// isTableScalingEnabled doesn't change the behavior of nested tables
|
|
201
202
|
false // shouldUseIncreasedScalingPercent set to false for nested tables
|
|
202
203
|
)(state.tr);
|
|
204
|
+
if (!isUserTriggered) {
|
|
205
|
+
tintDirtyTransaction(tr);
|
|
206
|
+
}
|
|
203
207
|
dispatch(tr);
|
|
204
208
|
});
|
|
205
209
|
_defineProperty(this, "setTimerToSendInitialOverflowCaptured", isOverflowing => {
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -62,8 +62,7 @@ const tablesPlugin = ({
|
|
|
62
62
|
};
|
|
63
63
|
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
64
64
|
const isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 ? void 0 : (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
65
|
-
const shouldUseIncreasedScalingPercent = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
66
|
-
isTableFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
65
|
+
const shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && isTableFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
67
66
|
const isCellBackgroundDuplicated = (options === null || options === void 0 ? void 0 : (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableDuplicateCellColouring) || false;
|
|
68
67
|
return {
|
|
69
68
|
name: 'table',
|
|
@@ -19,6 +19,7 @@ import memoizeOne from 'memoize-one';
|
|
|
19
19
|
import rafSchedule from 'raf-schd';
|
|
20
20
|
import { injectIntl } from 'react-intl-next';
|
|
21
21
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
22
|
+
import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
22
23
|
import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
23
24
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
24
25
|
import { browser, isValidPosition } from '@atlaskit/editor-common/utils';
|
|
@@ -157,7 +158,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
157
158
|
if (shouldScaleTable) {
|
|
158
159
|
_this.scaleTable({
|
|
159
160
|
parentWidth: parentWidth
|
|
160
|
-
});
|
|
161
|
+
}, hasNumberedColumnChanged);
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
// only when table resizing is enabled and toggle numbered column to run scaleTable
|
|
@@ -165,7 +166,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
165
166
|
if (!hasTableBeenResized(prevNode)) {
|
|
166
167
|
_this.scaleTable({
|
|
167
168
|
parentWidth: node.attrs.width
|
|
168
|
-
});
|
|
169
|
+
}, true);
|
|
169
170
|
}
|
|
170
171
|
}
|
|
171
172
|
_this.updateParentWidth(parentWidth);
|
|
@@ -176,6 +177,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
176
177
|
});
|
|
177
178
|
// Function gets called when table is nested.
|
|
178
179
|
_defineProperty(_assertThisInitialized(_this), "scaleTable", function (scaleOptions) {
|
|
180
|
+
var isUserTriggered = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
179
181
|
var _this$props2 = _this.props,
|
|
180
182
|
view = _this$props2.view,
|
|
181
183
|
getNode = _this$props2.getNode,
|
|
@@ -202,6 +204,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
202
204
|
// isTableScalingEnabled doesn't change the behavior of nested tables
|
|
203
205
|
false // shouldUseIncreasedScalingPercent set to false for nested tables
|
|
204
206
|
)(state.tr);
|
|
207
|
+
if (!isUserTriggered) {
|
|
208
|
+
tintDirtyTransaction(tr);
|
|
209
|
+
}
|
|
205
210
|
dispatch(tr);
|
|
206
211
|
});
|
|
207
212
|
_defineProperty(_assertThisInitialized(_this), "setTimerToSendInitialOverflowCaptured", function (isOverflowing) {
|
package/dist/esm/plugin.js
CHANGED
|
@@ -66,8 +66,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
66
66
|
};
|
|
67
67
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
68
68
|
var isTableFixedColumnWidthsOptionEnabled = (options === null || options === void 0 || (_options$getEditorFea = options.getEditorFeatureFlags) === null || _options$getEditorFea === void 0 ? void 0 : _options$getEditorFea.call(options).tableWithFixedColumnWidthsOption) || false;
|
|
69
|
-
var shouldUseIncreasedScalingPercent = options === null || options === void 0 ? void 0 : options.isTableScalingEnabled;
|
|
70
|
-
isTableFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
69
|
+
var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && isTableFixedColumnWidthsOptionEnabled && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
71
70
|
var isCellBackgroundDuplicated = (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableDuplicateCellColouring) || false;
|
|
72
71
|
return {
|
|
73
72
|
name: 'table',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.19.
|
|
3
|
+
"version": "7.19.3",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/adf-schema": "^38.0.0",
|
|
32
32
|
"@atlaskit/button": "^18.0.0",
|
|
33
33
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
34
|
-
"@atlaskit/editor-common": "^83.
|
|
34
|
+
"@atlaskit/editor-common": "^83.4.0",
|
|
35
35
|
"@atlaskit/editor-palette": "1.6.0",
|
|
36
36
|
"@atlaskit/editor-plugin-accessibility-utils": "^1.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
45
45
|
"@atlaskit/editor-tables": "^2.7.0",
|
|
46
46
|
"@atlaskit/icon": "^22.5.0",
|
|
47
|
-
"@atlaskit/menu": "^2.
|
|
47
|
+
"@atlaskit/menu": "^2.6.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
49
49
|
"@atlaskit/pragmatic-drag-and-drop": "^1.1.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.3.0",
|
|
@@ -10,6 +10,7 @@ import { injectIntl } from 'react-intl-next';
|
|
|
10
10
|
import type { TableColumnOrdering } from '@atlaskit/custom-steps';
|
|
11
11
|
import { ACTION_SUBJECT, EVENT_TYPE, TABLE_ACTION } from '@atlaskit/editor-common/analytics';
|
|
12
12
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import { tintDirtyTransaction } from '@atlaskit/editor-common/collab';
|
|
13
14
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
14
15
|
import { getParentNodeWidth, getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
15
16
|
import { tableMarginSides } from '@atlaskit/editor-common/styles';
|
|
@@ -966,17 +967,23 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
966
967
|
|
|
967
968
|
// If column has been inserted/deleted avoid multi dispatch
|
|
968
969
|
if (shouldScaleTable) {
|
|
969
|
-
this.scaleTable(
|
|
970
|
-
|
|
971
|
-
|
|
970
|
+
this.scaleTable(
|
|
971
|
+
{
|
|
972
|
+
parentWidth,
|
|
973
|
+
},
|
|
974
|
+
hasNumberedColumnChanged,
|
|
975
|
+
);
|
|
972
976
|
}
|
|
973
977
|
|
|
974
978
|
// only when table resizing is enabled and toggle numbered column to run scaleTable
|
|
975
979
|
if (options?.isTableResizingEnabled && hasNumberedColumnChanged) {
|
|
976
980
|
if (!hasTableBeenResized(prevNode)) {
|
|
977
|
-
this.scaleTable(
|
|
978
|
-
|
|
979
|
-
|
|
981
|
+
this.scaleTable(
|
|
982
|
+
{
|
|
983
|
+
parentWidth: node.attrs.width,
|
|
984
|
+
},
|
|
985
|
+
true,
|
|
986
|
+
);
|
|
980
987
|
}
|
|
981
988
|
}
|
|
982
989
|
|
|
@@ -989,7 +996,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
989
996
|
};
|
|
990
997
|
|
|
991
998
|
// Function gets called when table is nested.
|
|
992
|
-
private scaleTable = (scaleOptions: { parentWidth?: number }) => {
|
|
999
|
+
private scaleTable = (scaleOptions: { parentWidth?: number }, isUserTriggered = false) => {
|
|
993
1000
|
const { view, getNode, getPos, containerWidth, options } = this.props;
|
|
994
1001
|
const node = getNode();
|
|
995
1002
|
const { state, dispatch } = view;
|
|
@@ -1019,6 +1026,10 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
1019
1026
|
false, // shouldUseIncreasedScalingPercent set to false for nested tables
|
|
1020
1027
|
)(state.tr);
|
|
1021
1028
|
|
|
1029
|
+
if (!isUserTriggered) {
|
|
1030
|
+
tintDirtyTransaction(tr);
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1022
1033
|
dispatch(tr);
|
|
1023
1034
|
};
|
|
1024
1035
|
|
package/src/plugin.tsx
CHANGED
|
@@ -158,8 +158,9 @@ const tablesPlugin: TablePlugin = ({ config: options, api }) => {
|
|
|
158
158
|
|
|
159
159
|
const isTableFixedColumnWidthsOptionEnabled =
|
|
160
160
|
options?.getEditorFeatureFlags?.().tableWithFixedColumnWidthsOption || false;
|
|
161
|
-
const shouldUseIncreasedScalingPercent =
|
|
162
|
-
|
|
161
|
+
const shouldUseIncreasedScalingPercent =
|
|
162
|
+
options?.isTableScalingEnabled &&
|
|
163
|
+
isTableFixedColumnWidthsOptionEnabled &&
|
|
163
164
|
getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
164
165
|
|
|
165
166
|
const isCellBackgroundDuplicated =
|