@atlaskit/editor-plugin-table 5.7.3 → 5.7.5
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 +14 -0
- package/dist/cjs/commands/insert.js +1 -1
- package/dist/cjs/nodeviews/TableComponent.js +4 -2
- package/dist/cjs/nodeviews/TableContainer.js +10 -5
- package/dist/cjs/nodeviews/TableResizer.js +7 -3
- package/dist/cjs/transforms/column-width.js +3 -105
- package/dist/cjs/transforms/delete-columns.js +2 -5
- package/dist/cjs/ui/common-styles.js +1 -1
- package/dist/cjs/utils/analytics.js +2 -1
- package/dist/es2019/commands/insert.js +1 -1
- package/dist/es2019/nodeviews/TableComponent.js +4 -2
- package/dist/es2019/nodeviews/TableContainer.js +10 -5
- package/dist/es2019/nodeviews/TableResizer.js +7 -3
- package/dist/es2019/transforms/column-width.js +4 -102
- package/dist/es2019/transforms/delete-columns.js +2 -5
- package/dist/es2019/ui/common-styles.js +1 -0
- package/dist/es2019/utils/analytics.js +2 -1
- package/dist/esm/commands/insert.js +1 -1
- package/dist/esm/nodeviews/TableComponent.js +4 -2
- package/dist/esm/nodeviews/TableContainer.js +10 -5
- package/dist/esm/nodeviews/TableResizer.js +7 -3
- package/dist/esm/transforms/column-width.js +4 -106
- package/dist/esm/transforms/delete-columns.js +2 -5
- package/dist/esm/ui/common-styles.js +1 -1
- package/dist/esm/utils/analytics.js +2 -1
- package/dist/types/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/transforms/column-width.d.ts +1 -14
- package/dist/types/utils/analytics.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types-ts4.5/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -14
- package/dist/types-ts4.5/utils/analytics.d.ts +1 -0
- package/package.json +2 -5
- package/src/__tests__/unit/commands/insert.ts +7 -0
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +7 -0
- package/src/__tests__/unit/transforms/delete-columns.ts +147 -368
- package/src/commands/insert.ts +1 -3
- package/src/nodeviews/TableComponent.tsx +2 -1
- package/src/nodeviews/TableContainer.tsx +9 -0
- package/src/nodeviews/TableResizer.tsx +6 -0
- package/src/transforms/column-width.ts +4 -137
- package/src/transforms/delete-columns.ts +3 -9
- package/src/ui/common-styles.ts +1 -0
- package/src/utils/analytics.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 5.7.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#64179](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64179) [`3754cce9321d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3754cce9321d) - setup table resizing performance experiment
|
|
8
|
+
- [#63857](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63857) [`9f15ea30d592`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f15ea30d592) - [ux] fix zindex for sticky scrollbar
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.7.4
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#63287](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63287) [`8b58c452f126`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b58c452f126) - ED-20334 Cleaned reference for feature flag 'platform.editor.table-update-colwidths-after-column-is-deleted'and refactored code for it.
|
|
16
|
+
|
|
3
17
|
## 5.7.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -43,7 +43,7 @@ function addColumnAt(getEditorContainerWidth) {
|
|
|
43
43
|
var table = (0, _utils2.findTable)(updatedTr.selection);
|
|
44
44
|
if (table) {
|
|
45
45
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
46
|
-
updatedTr = (0, _columnWidth.rescaleColumns)(
|
|
46
|
+
updatedTr = (0, _columnWidth.rescaleColumns)()(table, view)(updatedTr);
|
|
47
47
|
}
|
|
48
48
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.analytics-plugin-moved-event') && view) {
|
|
49
49
|
updatedTr = (0, _commands.updateRowOrColumnMovedTransform)({
|
|
@@ -605,7 +605,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
605
605
|
var isNested = (0, _utils4.isTableNested)(view.state, tablePos);
|
|
606
606
|
var topStickyShadowPosition = isDragAndDropEnabled ? this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + 2 : this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2;
|
|
607
607
|
var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
|
|
608
|
-
stickyScrollbar = _getEditorFeatureFlag3.stickyScrollbar
|
|
608
|
+
stickyScrollbar = _getEditorFeatureFlag3.stickyScrollbar,
|
|
609
|
+
tableResizePerformance = _getEditorFeatureFlag3.tableResizePerformance;
|
|
609
610
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer, {
|
|
610
611
|
className: (0, _classnames2.default)(_types.TableCssClassName.TABLE_CONTAINER, (_classnames = {}, (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.WITH_CONTROLS, allowControls && tableActive), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.HOVERED_DELETE_BUTTON, isInDanger), (0, _defineProperty3.default)(_classnames, _types.TableCssClassName.TABLE_SELECTED, (0, _utils2.isTableSelected)(view.state.selection)), _classnames)),
|
|
611
612
|
editorView: view,
|
|
@@ -617,7 +618,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
617
618
|
isNested: isNested,
|
|
618
619
|
pluginInjectionApi: pluginInjectionApi,
|
|
619
620
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled,
|
|
620
|
-
isResizing: isResizing
|
|
621
|
+
isResizing: isResizing,
|
|
622
|
+
tableResizePerformance: tableResizePerformance
|
|
621
623
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
622
624
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
623
625
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -53,7 +53,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
53
53
|
getPos = _ref2.getPos,
|
|
54
54
|
tableRef = _ref2.tableRef,
|
|
55
55
|
isResizing = _ref2.isResizing,
|
|
56
|
-
pluginInjectionApi = _ref2.pluginInjectionApi
|
|
56
|
+
pluginInjectionApi = _ref2.pluginInjectionApi,
|
|
57
|
+
tableResizePerformance = _ref2.tableResizePerformance;
|
|
57
58
|
var containerRef = (0, _react.useRef)(null);
|
|
58
59
|
var tableWidthRef = (0, _react.useRef)(_editorSharedStyles.akEditorDefaultLayoutWidth);
|
|
59
60
|
var updateContainerHeight = (0, _react.useCallback)(function (height) {
|
|
@@ -134,7 +135,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
134
135
|
tableRef: tableRef,
|
|
135
136
|
displayGuideline: displayGuideline,
|
|
136
137
|
attachAnalyticsEvent: attachAnalyticsEvent,
|
|
137
|
-
displayGapCursor: displayGapCursor
|
|
138
|
+
displayGapCursor: displayGapCursor,
|
|
139
|
+
tableResizePerformance: tableResizePerformance
|
|
138
140
|
};
|
|
139
141
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.resizing-table-height-improvement')) {
|
|
140
142
|
tableResizerProps = _objectSpread(_objectSpread({}, tableResizerProps), {}, {
|
|
@@ -146,7 +148,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
146
148
|
style: {
|
|
147
149
|
display: 'flex',
|
|
148
150
|
justifyContent: 'center'
|
|
149
|
-
}
|
|
151
|
+
},
|
|
152
|
+
contentEditable: tableResizePerformance && isResizing ? 'false' : undefined
|
|
150
153
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
151
154
|
style: {
|
|
152
155
|
width: tableWidthRef.current
|
|
@@ -172,7 +175,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref3) {
|
|
|
172
175
|
tableRef = _ref3.tableRef,
|
|
173
176
|
isNested = _ref3.isNested,
|
|
174
177
|
isResizing = _ref3.isResizing,
|
|
175
|
-
pluginInjectionApi = _ref3.pluginInjectionApi
|
|
178
|
+
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
179
|
+
tableResizePerformance = _ref3.tableResizePerformance;
|
|
176
180
|
if (isTableResizingEnabled && !isNested) {
|
|
177
181
|
return /*#__PURE__*/_react.default.createElement(ResizableTableContainer, {
|
|
178
182
|
className: className,
|
|
@@ -182,7 +186,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref3) {
|
|
|
182
186
|
getPos: getPos,
|
|
183
187
|
tableRef: tableRef,
|
|
184
188
|
isResizing: isResizing,
|
|
185
|
-
pluginInjectionApi: pluginInjectionApi
|
|
189
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
190
|
+
tableResizePerformance: tableResizePerformance
|
|
186
191
|
}, children);
|
|
187
192
|
}
|
|
188
193
|
var tableWidth = isBreakoutEnabled ? (0, _styles.calcTableWidth)(node.attrs.layout, editorWidth) : 'inherit';
|
|
@@ -97,7 +97,8 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
97
97
|
tableRef = _ref.tableRef,
|
|
98
98
|
displayGuideline = _ref.displayGuideline,
|
|
99
99
|
attachAnalyticsEvent = _ref.attachAnalyticsEvent,
|
|
100
|
-
displayGapCursor = _ref.displayGapCursor
|
|
100
|
+
displayGapCursor = _ref.displayGapCursor,
|
|
101
|
+
tableResizePerformance = _ref.tableResizePerformance;
|
|
101
102
|
var currentGap = (0, _react.useRef)(0);
|
|
102
103
|
// track resizing state - use ref over state to avoid re-render
|
|
103
104
|
var isResizing = (0, _react.useRef)(false);
|
|
@@ -227,7 +228,10 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
227
228
|
var resizeFrameRatePayloads = (0, _analytics2.generateResizeFrameRatePayloads)({
|
|
228
229
|
docSize: state.doc.nodeSize,
|
|
229
230
|
frameRateSamples: frameRateSamples,
|
|
230
|
-
originalNode: node
|
|
231
|
+
originalNode: node,
|
|
232
|
+
experiments: {
|
|
233
|
+
tableResizePerformance: tableResizePerformance
|
|
234
|
+
}
|
|
231
235
|
});
|
|
232
236
|
resizeFrameRatePayloads.forEach(function (payload) {
|
|
233
237
|
var _attachAnalyticsEvent;
|
|
@@ -263,7 +267,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
263
267
|
onResizeStop();
|
|
264
268
|
}
|
|
265
269
|
return newWidth;
|
|
266
|
-
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop]);
|
|
270
|
+
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, tableResizePerformance]);
|
|
267
271
|
var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
|
|
268
272
|
var newWidth = width + step;
|
|
269
273
|
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
|
@@ -4,16 +4,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.updateColumnWidths = exports.
|
|
7
|
+
exports.updateColumnWidths = exports.rescaleColumns = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
10
10
|
var _transform = require("@atlaskit/editor-prosemirror/transform");
|
|
11
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
11
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
13
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _utils = require("../pm-plugins/table-resizing/utils");
|
|
15
14
|
var _colgroup = require("../pm-plugins/table-resizing/utils/colgroup");
|
|
16
|
-
var _misc = require("../pm-plugins/table-resizing/utils/misc");
|
|
17
15
|
var _resizeState = require("../pm-plugins/table-resizing/utils/resize-state");
|
|
18
16
|
var _scaleTable = require("../pm-plugins/table-resizing/utils/scale-table");
|
|
19
17
|
var _commonStyles = require("../ui/common-styles");
|
|
@@ -95,7 +93,7 @@ var updateColumnWidths = exports.updateColumnWidths = function updateColumnWidth
|
|
|
95
93
|
* @param view
|
|
96
94
|
* @returns Updated transaction with rescaled columns for a given table
|
|
97
95
|
*/
|
|
98
|
-
var
|
|
96
|
+
var rescaleColumns = exports.rescaleColumns = function rescaleColumns() {
|
|
99
97
|
return function (table, view) {
|
|
100
98
|
return function (tr) {
|
|
101
99
|
var _tableRef$parentEleme, _tableRef$parentEleme2;
|
|
@@ -115,7 +113,7 @@ var rescaleColumnsNew = exports.rescaleColumnsNew = function rescaleColumnsNew()
|
|
|
115
113
|
// when table is resized the tableRef client width will be 1px larger than colGroup, which is used in calculations
|
|
116
114
|
width: isResized ? tableRef.clientWidth - 1 : tableRef.clientWidth,
|
|
117
115
|
/** the is the width the table can reach before overflowing */
|
|
118
|
-
possibleMaxWidth: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? (tableRef === null || tableRef === void 0 || (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0 : ((tableRef === null || tableRef === void 0 || (_tableRef$parentEleme2 = tableRef.parentElement) === null || _tableRef$parentEleme2 === void 0 ? void 0 : _tableRef$parentEleme2.clientWidth) || 0) - _commonStyles.insertColumnButtonOffset
|
|
116
|
+
possibleMaxWidth: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.custom-table-width') ? (tableRef === null || tableRef === void 0 || (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0 : ((tableRef === null || tableRef === void 0 || (_tableRef$parentEleme2 = tableRef.parentElement) === null || _tableRef$parentEleme2 === void 0 ? void 0 : _tableRef$parentEleme2.clientWidth) || 0) - _commonStyles.insertColumnButtonOffset,
|
|
119
117
|
isResized: isResized
|
|
120
118
|
};
|
|
121
119
|
|
|
@@ -175,104 +173,4 @@ var rescaleColumnsNew = exports.rescaleColumnsNew = function rescaleColumnsNew()
|
|
|
175
173
|
return updateColumnWidths(resizeState, table.node, table.start)(tr);
|
|
176
174
|
};
|
|
177
175
|
};
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* This function is called when user inserts/deletes a column in a table to;
|
|
182
|
-
* - rescale all columns (if the table did not overflow before the insertion)
|
|
183
|
-
* - and update column widths.
|
|
184
|
-
*
|
|
185
|
-
* This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
|
|
186
|
-
* @param table
|
|
187
|
-
* @param view
|
|
188
|
-
* @returns Updated transaction with rescaled columns for a given table
|
|
189
|
-
*/
|
|
190
|
-
var rescaleColumnsOld = exports.rescaleColumnsOld = function rescaleColumnsOld(getEditorContainerWidth) {
|
|
191
|
-
return function (table, view) {
|
|
192
|
-
return function (tr) {
|
|
193
|
-
var _tableRef$parentEleme3;
|
|
194
|
-
if (!view) {
|
|
195
|
-
return tr;
|
|
196
|
-
}
|
|
197
|
-
var pos = table.pos;
|
|
198
|
-
var newTable = tr.doc.nodeAt(pos);
|
|
199
|
-
var state = view.state;
|
|
200
|
-
var domAtPos = view.domAtPos.bind(view);
|
|
201
|
-
var maybeTable = domAtPos(table.start).node;
|
|
202
|
-
var tableRef = maybeTable.closest('table');
|
|
203
|
-
if (!tableRef || !newTable) {
|
|
204
|
-
return tr;
|
|
205
|
-
}
|
|
206
|
-
var layout = (0, _resizeState.normaliseTableLayout)(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
|
|
207
|
-
// The is the width the table can reach before overflowing
|
|
208
|
-
var maxSize = (0, _misc.getTableMaxWidth)({
|
|
209
|
-
table: table.node,
|
|
210
|
-
tableStart: table.start,
|
|
211
|
-
state: state,
|
|
212
|
-
layout: layout,
|
|
213
|
-
getEditorContainerWidth: getEditorContainerWidth
|
|
214
|
-
});
|
|
215
|
-
var tableWidth = tableRef.clientWidth || _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
216
|
-
var tableMaxWidth = (tableRef === null || tableRef === void 0 || (_tableRef$parentEleme3 = tableRef.parentElement) === null || _tableRef$parentEleme3 === void 0 ? void 0 : _tableRef$parentEleme3.clientWidth) || 0;
|
|
217
|
-
tableMaxWidth -= _commonStyles.insertColumnButtonOffset;
|
|
218
|
-
var newTableMap = _tableMap.TableMap.get(newTable);
|
|
219
|
-
var noOfColumns = newTableMap.width;
|
|
220
|
-
if (!noOfColumns || noOfColumns <= 0) {
|
|
221
|
-
return tr;
|
|
222
|
-
}
|
|
223
|
-
var columnWidthUnresized = tableWidth / noOfColumns;
|
|
224
|
-
|
|
225
|
-
// If the table has not been resized, and the column width is bigger than the minimum column width
|
|
226
|
-
// we skip updating the size of columns here.
|
|
227
|
-
if (!(0, _utils.hasTableBeenResized)(table.node) && columnWidthUnresized > _styles.tableCellMinWidth) {
|
|
228
|
-
return tr;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// If the table has not been resized, and the column width is smaller than the minimum column width
|
|
232
|
-
// Or if the table has been resized, but each column width is either 48px or null
|
|
233
|
-
// we update the table to have 48px for each column
|
|
234
|
-
if (!(0, _utils.hasTableBeenResized)(table.node) && columnWidthUnresized <= _styles.tableCellMinWidth || (0, _utils.hasTableBeenResized)(table.node) && (0, _colgroup.isMinCellWidthTable)(table.node)) {
|
|
235
|
-
var widths = new Array(noOfColumns).fill(_styles.tableCellMinWidth);
|
|
236
|
-
var cols = widths.map(function (_, index) {
|
|
237
|
-
return {
|
|
238
|
-
width: _styles.tableCellMinWidth,
|
|
239
|
-
minWidth: _styles.tableCellMinWidth,
|
|
240
|
-
index: index
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
var overflow = tableWidth > maxSize;
|
|
244
|
-
var minWidthResizeState = {
|
|
245
|
-
cols: cols,
|
|
246
|
-
widths: widths,
|
|
247
|
-
maxSize: maxSize,
|
|
248
|
-
tableWidth: tableWidth,
|
|
249
|
-
overflow: overflow
|
|
250
|
-
};
|
|
251
|
-
return updateColumnWidths(minWidthResizeState, table.node, table.start)(tr);
|
|
252
|
-
}
|
|
253
|
-
var resizeState = (0, _resizeState.getResizeState)({
|
|
254
|
-
minWidth: _styles.tableCellMinWidth,
|
|
255
|
-
table: table.node,
|
|
256
|
-
start: table.start,
|
|
257
|
-
tableRef: tableRef,
|
|
258
|
-
domAtPos: domAtPos,
|
|
259
|
-
maxSize: maxSize
|
|
260
|
-
});
|
|
261
|
-
var previousTableWidth = resizeState.tableWidth - _tableMap.tableNewColumnMinWidth;
|
|
262
|
-
var tableDidntPreviouslyOverflow = previousTableWidth <= Math.max(maxSize, tableMaxWidth);
|
|
263
|
-
|
|
264
|
-
// If the new table width will result in the table going into an overflow state
|
|
265
|
-
// we resize the cells to avoid the overflow occuring
|
|
266
|
-
if (tableDidntPreviouslyOverflow && resizeState.overflow) {
|
|
267
|
-
resizeState = (0, _scaleTable.scaleTableTo)(resizeState, maxSize);
|
|
268
|
-
}
|
|
269
|
-
return updateColumnWidths(resizeState, table.node, table.start)(tr);
|
|
270
|
-
};
|
|
271
|
-
};
|
|
272
|
-
};
|
|
273
|
-
var rescaleColumns = exports.rescaleColumns = function rescaleColumns(getEditorContainerWidth) {
|
|
274
|
-
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table-update-colwidths-after-column-is-deleted')) {
|
|
275
|
-
return rescaleColumnsNew();
|
|
276
|
-
}
|
|
277
|
-
return rescaleColumnsOld(getEditorContainerWidth);
|
|
278
176
|
};
|
|
@@ -12,7 +12,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
13
|
var _tableMap = require("@atlaskit/editor-tables/table-map");
|
|
14
14
|
var _utils = require("@atlaskit/editor-tables/utils");
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
15
|
var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
17
16
|
var _columnWidth = require("./column-width");
|
|
18
17
|
var _split = require("./split");
|
|
@@ -224,10 +223,8 @@ var deleteColumns = exports.deleteColumns = function deleteColumns(rect, allowCu
|
|
|
224
223
|
updatedTr = deleteColumnsLegacy(rect)(updatedTr);
|
|
225
224
|
}
|
|
226
225
|
var table = (0, _utils.findTable)(updatedTr.selection);
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
updatedTr = (0, _columnWidth.rescaleColumns)()(table, view)(updatedTr);
|
|
230
|
-
}
|
|
226
|
+
if (table) {
|
|
227
|
+
updatedTr = (0, _columnWidth.rescaleColumns)()(table, view)(updatedTr);
|
|
231
228
|
}
|
|
232
229
|
return updatedTr;
|
|
233
230
|
};
|
|
@@ -30,7 +30,7 @@ var tableRowHeight = exports.tableRowHeight = 44;
|
|
|
30
30
|
var rangeSelectionStyles = "\n.".concat(_types.TableCssClassName.NODEVIEW_WRAPPER, ".").concat(_editorSharedStyles.akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat((0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), "\n }\n}\n");
|
|
31
31
|
var sentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(_consts.tableScrollbarOffset + _consts.stickyRowOffsetTop + _consts.tablePadding * 2 + 23, "px;\n }\n &.").concat(_types.TableCssClassName.WITH_CONTROLS, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(_consts.columnControlsDecorationHeight, "px;\n }\n }\n}");
|
|
32
32
|
var stickyScrollbarSentinelStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n position: absolute;\n width: 100%;\n height: 1px;\n margin-top: -1px;\n // need this to avoid sentinel being focused via keyboard\n // this still allows it to be detected by intersection observer\n visibility: hidden;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n top: ").concat(_consts.columnControlsDecorationHeight + tableRowHeight * 3, "px;\n }\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n bottom: ").concat(_editorSharedStyles.MAX_BROWSER_SCROLLBAR_HEIGHT, "px;\n }\n}");
|
|
33
|
-
var stickyScrollbarContainerStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n width: 100%;\n display: none;\n overflow-x: auto;\n position: sticky;\n bottom: 0;\n }\n}");
|
|
33
|
+
var stickyScrollbarContainerStyles = ".".concat(_types.TableCssClassName.TABLE_CONTAINER, " {\n > .").concat(_types.TableCssClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n width: 100%;\n display: none;\n overflow-x: auto;\n position: sticky;\n bottom: 0;\n z-index: 1;\n }\n}");
|
|
34
34
|
var stickyScrollbarStyles = function stickyScrollbarStyles(featureFlags) {
|
|
35
35
|
return featureFlags !== null && featureFlags !== void 0 && featureFlags.stickyScrollbar ? "".concat(stickyScrollbarContainerStyles, " ").concat(stickyScrollbarSentinelStyles) : '';
|
|
36
36
|
};
|
|
@@ -116,7 +116,8 @@ var generateResizeFrameRatePayloads = exports.generateResizeFrameRatePayloads =
|
|
|
116
116
|
frameRate: frameRateSample,
|
|
117
117
|
nodeSize: props.originalNode.nodeSize,
|
|
118
118
|
docSize: props.docSize,
|
|
119
|
-
isInitialSample: index === 0
|
|
119
|
+
isInitialSample: index === 0,
|
|
120
|
+
experiments: props.experiments
|
|
120
121
|
}
|
|
121
122
|
};
|
|
122
123
|
});
|
|
@@ -32,7 +32,7 @@ export function addColumnAt(getEditorContainerWidth) {
|
|
|
32
32
|
const table = findTable(updatedTr.selection);
|
|
33
33
|
if (table) {
|
|
34
34
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
35
|
-
updatedTr = rescaleColumns(
|
|
35
|
+
updatedTr = rescaleColumns()(table, view)(updatedTr);
|
|
36
36
|
}
|
|
37
37
|
if (getBooleanFF('platform.editor.table.analytics-plugin-moved-event') && view) {
|
|
38
38
|
updatedTr = updateRowOrColumnMovedTransform({
|
|
@@ -608,7 +608,8 @@ class TableComponent extends React.Component {
|
|
|
608
608
|
const isNested = isTableNested(view.state, tablePos);
|
|
609
609
|
const topStickyShadowPosition = isDragAndDropEnabled ? this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + 2 : this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2;
|
|
610
610
|
const {
|
|
611
|
-
stickyScrollbar
|
|
611
|
+
stickyScrollbar,
|
|
612
|
+
tableResizePerformance
|
|
612
613
|
} = getEditorFeatureFlags();
|
|
613
614
|
return /*#__PURE__*/React.createElement(TableContainer, {
|
|
614
615
|
className: classnames(ClassName.TABLE_CONTAINER, {
|
|
@@ -626,7 +627,8 @@ class TableComponent extends React.Component {
|
|
|
626
627
|
isNested: isNested,
|
|
627
628
|
pluginInjectionApi: pluginInjectionApi,
|
|
628
629
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled,
|
|
629
|
-
isResizing: isResizing
|
|
630
|
+
isResizing: isResizing,
|
|
631
|
+
tableResizePerformance: tableResizePerformance
|
|
630
632
|
}, /*#__PURE__*/React.createElement("div", {
|
|
631
633
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
632
634
|
"data-testid": "sticky-sentinel-top"
|
|
@@ -41,7 +41,8 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
41
41
|
getPos,
|
|
42
42
|
tableRef,
|
|
43
43
|
isResizing,
|
|
44
|
-
pluginInjectionApi
|
|
44
|
+
pluginInjectionApi,
|
|
45
|
+
tableResizePerformance
|
|
45
46
|
}) => {
|
|
46
47
|
const containerRef = useRef(null);
|
|
47
48
|
const tableWidthRef = useRef(akEditorDefaultLayoutWidth);
|
|
@@ -123,7 +124,8 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
123
124
|
tableRef,
|
|
124
125
|
displayGuideline,
|
|
125
126
|
attachAnalyticsEvent,
|
|
126
|
-
displayGapCursor
|
|
127
|
+
displayGapCursor,
|
|
128
|
+
tableResizePerformance
|
|
127
129
|
};
|
|
128
130
|
if (getBooleanFF('platform.editor.resizing-table-height-improvement')) {
|
|
129
131
|
tableResizerProps = {
|
|
@@ -136,7 +138,8 @@ export const ResizableTableContainer = /*#__PURE__*/React.memo(({
|
|
|
136
138
|
style: {
|
|
137
139
|
display: 'flex',
|
|
138
140
|
justifyContent: 'center'
|
|
139
|
-
}
|
|
141
|
+
},
|
|
142
|
+
contentEditable: tableResizePerformance && isResizing ? 'false' : undefined
|
|
140
143
|
}, /*#__PURE__*/React.createElement("div", {
|
|
141
144
|
style: {
|
|
142
145
|
width: tableWidthRef.current
|
|
@@ -163,7 +166,8 @@ export const TableContainer = ({
|
|
|
163
166
|
tableRef,
|
|
164
167
|
isNested,
|
|
165
168
|
isResizing,
|
|
166
|
-
pluginInjectionApi
|
|
169
|
+
pluginInjectionApi,
|
|
170
|
+
tableResizePerformance
|
|
167
171
|
}) => {
|
|
168
172
|
if (isTableResizingEnabled && !isNested) {
|
|
169
173
|
return /*#__PURE__*/React.createElement(ResizableTableContainer, {
|
|
@@ -174,7 +178,8 @@ export const TableContainer = ({
|
|
|
174
178
|
getPos: getPos,
|
|
175
179
|
tableRef: tableRef,
|
|
176
180
|
isResizing: isResizing,
|
|
177
|
-
pluginInjectionApi: pluginInjectionApi
|
|
181
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
182
|
+
tableResizePerformance: tableResizePerformance
|
|
178
183
|
}, children);
|
|
179
184
|
}
|
|
180
185
|
const tableWidth = isBreakoutEnabled ? calcTableWidth(node.attrs.layout, editorWidth) : 'inherit';
|
|
@@ -82,7 +82,8 @@ export const TableResizer = ({
|
|
|
82
82
|
tableRef,
|
|
83
83
|
displayGuideline,
|
|
84
84
|
attachAnalyticsEvent,
|
|
85
|
-
displayGapCursor
|
|
85
|
+
displayGapCursor,
|
|
86
|
+
tableResizePerformance
|
|
86
87
|
}) => {
|
|
87
88
|
var _findTable, _editorView$state;
|
|
88
89
|
const currentGap = useRef(0);
|
|
@@ -218,7 +219,10 @@ export const TableResizer = ({
|
|
|
218
219
|
const resizeFrameRatePayloads = generateResizeFrameRatePayloads({
|
|
219
220
|
docSize: state.doc.nodeSize,
|
|
220
221
|
frameRateSamples,
|
|
221
|
-
originalNode: node
|
|
222
|
+
originalNode: node,
|
|
223
|
+
experiments: {
|
|
224
|
+
tableResizePerformance
|
|
225
|
+
}
|
|
222
226
|
});
|
|
223
227
|
resizeFrameRatePayloads.forEach(payload => {
|
|
224
228
|
var _attachAnalyticsEvent;
|
|
@@ -255,7 +259,7 @@ export const TableResizer = ({
|
|
|
255
259
|
onResizeStop();
|
|
256
260
|
}
|
|
257
261
|
return newWidth;
|
|
258
|
-
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop]);
|
|
262
|
+
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, tableResizePerformance]);
|
|
259
263
|
const handleTableSizeChangeOnKeypress = useCallback(step => {
|
|
260
264
|
const newWidth = width + step;
|
|
261
265
|
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
2
2
|
import { AttrStep } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
-
import {
|
|
4
|
-
import { TableMap, tableNewColumnMinWidth } from '@atlaskit/editor-tables/table-map';
|
|
3
|
+
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
4
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { hasTableBeenResized } from '../pm-plugins/table-resizing/utils';
|
|
7
6
|
import { isMinCellWidthTable } from '../pm-plugins/table-resizing/utils/colgroup';
|
|
8
|
-
import {
|
|
9
|
-
import { getResizeState, normaliseTableLayout } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
7
|
+
import { getResizeState } from '../pm-plugins/table-resizing/utils/resize-state';
|
|
10
8
|
import { scaleTableTo } from '../pm-plugins/table-resizing/utils/scale-table';
|
|
11
9
|
import { insertColumnButtonOffset } from '../ui/common-styles';
|
|
12
10
|
|
|
@@ -87,7 +85,7 @@ export const updateColumnWidths = (resizeState, table, start) => tr => {
|
|
|
87
85
|
* @param view
|
|
88
86
|
* @returns Updated transaction with rescaled columns for a given table
|
|
89
87
|
*/
|
|
90
|
-
export const
|
|
88
|
+
export const rescaleColumns = () => (table, view) => tr => {
|
|
91
89
|
var _tableRef$parentEleme, _tableRef$parentEleme2;
|
|
92
90
|
if (!view) {
|
|
93
91
|
return tr;
|
|
@@ -105,7 +103,7 @@ export const rescaleColumnsNew = () => (table, view) => tr => {
|
|
|
105
103
|
// when table is resized the tableRef client width will be 1px larger than colGroup, which is used in calculations
|
|
106
104
|
width: isResized ? tableRef.clientWidth - 1 : tableRef.clientWidth,
|
|
107
105
|
/** the is the width the table can reach before overflowing */
|
|
108
|
-
possibleMaxWidth: getBooleanFF('platform.editor.custom-table-width') ? (tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0 : ((tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme2 = tableRef.parentElement) === null || _tableRef$parentEleme2 === void 0 ? void 0 : _tableRef$parentEleme2.clientWidth) || 0) - insertColumnButtonOffset
|
|
106
|
+
possibleMaxWidth: getBooleanFF('platform.editor.custom-table-width') ? (tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme = tableRef.parentElement) === null || _tableRef$parentEleme === void 0 ? void 0 : _tableRef$parentEleme.clientWidth) || 0 : ((tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme2 = tableRef.parentElement) === null || _tableRef$parentEleme2 === void 0 ? void 0 : _tableRef$parentEleme2.clientWidth) || 0) - insertColumnButtonOffset,
|
|
109
107
|
isResized
|
|
110
108
|
};
|
|
111
109
|
|
|
@@ -161,100 +159,4 @@ export const rescaleColumnsNew = () => (table, view) => tr => {
|
|
|
161
159
|
resizeState = scaleTableTo(resizeState, previousTableInfo.possibleMaxWidth);
|
|
162
160
|
}
|
|
163
161
|
return updateColumnWidths(resizeState, table.node, table.start)(tr);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* This function is called when user inserts/deletes a column in a table to;
|
|
168
|
-
* - rescale all columns (if the table did not overflow before the insertion)
|
|
169
|
-
* - and update column widths.
|
|
170
|
-
*
|
|
171
|
-
* This is done manually to avoid a multi-dispatch in TableComponent. See [ED-8288].
|
|
172
|
-
* @param table
|
|
173
|
-
* @param view
|
|
174
|
-
* @returns Updated transaction with rescaled columns for a given table
|
|
175
|
-
*/
|
|
176
|
-
export const rescaleColumnsOld = getEditorContainerWidth => (table, view) => tr => {
|
|
177
|
-
var _tableRef$parentEleme3;
|
|
178
|
-
if (!view) {
|
|
179
|
-
return tr;
|
|
180
|
-
}
|
|
181
|
-
const pos = table.pos;
|
|
182
|
-
const newTable = tr.doc.nodeAt(pos);
|
|
183
|
-
const {
|
|
184
|
-
state
|
|
185
|
-
} = view;
|
|
186
|
-
const domAtPos = view.domAtPos.bind(view);
|
|
187
|
-
const maybeTable = domAtPos(table.start).node;
|
|
188
|
-
const tableRef = maybeTable.closest('table');
|
|
189
|
-
if (!tableRef || !newTable) {
|
|
190
|
-
return tr;
|
|
191
|
-
}
|
|
192
|
-
const layout = normaliseTableLayout(tableRef === null || tableRef === void 0 ? void 0 : tableRef.dataset.layout);
|
|
193
|
-
// The is the width the table can reach before overflowing
|
|
194
|
-
const maxSize = getTableMaxWidth({
|
|
195
|
-
table: table.node,
|
|
196
|
-
tableStart: table.start,
|
|
197
|
-
state,
|
|
198
|
-
layout,
|
|
199
|
-
getEditorContainerWidth
|
|
200
|
-
});
|
|
201
|
-
const tableWidth = tableRef.clientWidth || akEditorDefaultLayoutWidth;
|
|
202
|
-
let tableMaxWidth = (tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$parentEleme3 = tableRef.parentElement) === null || _tableRef$parentEleme3 === void 0 ? void 0 : _tableRef$parentEleme3.clientWidth) || 0;
|
|
203
|
-
tableMaxWidth -= insertColumnButtonOffset;
|
|
204
|
-
const newTableMap = TableMap.get(newTable);
|
|
205
|
-
const noOfColumns = newTableMap.width;
|
|
206
|
-
if (!noOfColumns || noOfColumns <= 0) {
|
|
207
|
-
return tr;
|
|
208
|
-
}
|
|
209
|
-
const columnWidthUnresized = tableWidth / noOfColumns;
|
|
210
|
-
|
|
211
|
-
// If the table has not been resized, and the column width is bigger than the minimum column width
|
|
212
|
-
// we skip updating the size of columns here.
|
|
213
|
-
if (!hasTableBeenResized(table.node) && columnWidthUnresized > tableCellMinWidth) {
|
|
214
|
-
return tr;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// If the table has not been resized, and the column width is smaller than the minimum column width
|
|
218
|
-
// Or if the table has been resized, but each column width is either 48px or null
|
|
219
|
-
// we update the table to have 48px for each column
|
|
220
|
-
if (!hasTableBeenResized(table.node) && columnWidthUnresized <= tableCellMinWidth || hasTableBeenResized(table.node) && isMinCellWidthTable(table.node)) {
|
|
221
|
-
const widths = new Array(noOfColumns).fill(tableCellMinWidth);
|
|
222
|
-
const cols = widths.map((_, index) => ({
|
|
223
|
-
width: tableCellMinWidth,
|
|
224
|
-
minWidth: tableCellMinWidth,
|
|
225
|
-
index
|
|
226
|
-
}));
|
|
227
|
-
const overflow = tableWidth > maxSize;
|
|
228
|
-
const minWidthResizeState = {
|
|
229
|
-
cols,
|
|
230
|
-
widths,
|
|
231
|
-
maxSize,
|
|
232
|
-
tableWidth,
|
|
233
|
-
overflow
|
|
234
|
-
};
|
|
235
|
-
return updateColumnWidths(minWidthResizeState, table.node, table.start)(tr);
|
|
236
|
-
}
|
|
237
|
-
let resizeState = getResizeState({
|
|
238
|
-
minWidth: tableCellMinWidth,
|
|
239
|
-
table: table.node,
|
|
240
|
-
start: table.start,
|
|
241
|
-
tableRef,
|
|
242
|
-
domAtPos,
|
|
243
|
-
maxSize
|
|
244
|
-
});
|
|
245
|
-
const previousTableWidth = resizeState.tableWidth - tableNewColumnMinWidth;
|
|
246
|
-
const tableDidntPreviouslyOverflow = previousTableWidth <= Math.max(maxSize, tableMaxWidth);
|
|
247
|
-
|
|
248
|
-
// If the new table width will result in the table going into an overflow state
|
|
249
|
-
// we resize the cells to avoid the overflow occuring
|
|
250
|
-
if (tableDidntPreviouslyOverflow && resizeState.overflow) {
|
|
251
|
-
resizeState = scaleTableTo(resizeState, maxSize);
|
|
252
|
-
}
|
|
253
|
-
return updateColumnWidths(resizeState, table.node, table.start)(tr);
|
|
254
|
-
};
|
|
255
|
-
export const rescaleColumns = getEditorContainerWidth => {
|
|
256
|
-
if (getBooleanFF('platform.editor.table-update-colwidths-after-column-is-deleted')) {
|
|
257
|
-
return rescaleColumnsNew();
|
|
258
|
-
}
|
|
259
|
-
return rescaleColumnsOld(getEditorContainerWidth);
|
|
260
162
|
};
|
|
@@ -3,7 +3,6 @@ import { TABLE_OVERFLOW_CHANGE_TRIGGER } from '@atlaskit/editor-common/analytics
|
|
|
3
3
|
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
8
7
|
import { rescaleColumns } from './column-width';
|
|
9
8
|
import { splitCellsInColumns } from './split';
|
|
@@ -204,10 +203,8 @@ export const deleteColumns = (rect, allowCustomStep, view) => tr => {
|
|
|
204
203
|
updatedTr = deleteColumnsLegacy(rect)(updatedTr);
|
|
205
204
|
}
|
|
206
205
|
const table = findTable(updatedTr.selection);
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
updatedTr = rescaleColumns()(table, view)(updatedTr);
|
|
210
|
-
}
|
|
206
|
+
if (table) {
|
|
207
|
+
updatedTr = rescaleColumns()(table, view)(updatedTr);
|
|
211
208
|
}
|
|
212
209
|
return updatedTr;
|
|
213
210
|
};
|
|
@@ -101,7 +101,8 @@ export const generateResizeFrameRatePayloads = props => {
|
|
|
101
101
|
frameRate: frameRateSample,
|
|
102
102
|
nodeSize: props.originalNode.nodeSize,
|
|
103
103
|
docSize: props.docSize,
|
|
104
|
-
isInitialSample: index === 0
|
|
104
|
+
isInitialSample: index === 0,
|
|
105
|
+
experiments: props.experiments
|
|
105
106
|
}
|
|
106
107
|
}));
|
|
107
108
|
};
|
|
@@ -34,7 +34,7 @@ export function addColumnAt(getEditorContainerWidth) {
|
|
|
34
34
|
var table = findTable(updatedTr.selection);
|
|
35
35
|
if (table) {
|
|
36
36
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
37
|
-
updatedTr = rescaleColumns(
|
|
37
|
+
updatedTr = rescaleColumns()(table, view)(updatedTr);
|
|
38
38
|
}
|
|
39
39
|
if (getBooleanFF('platform.editor.table.analytics-plugin-moved-event') && view) {
|
|
40
40
|
updatedTr = updateRowOrColumnMovedTransform({
|
|
@@ -598,7 +598,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
598
598
|
var isNested = isTableNested(view.state, tablePos);
|
|
599
599
|
var topStickyShadowPosition = isDragAndDropEnabled ? this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + 2 : this.state.stickyHeader && this.state.stickyHeader.top + this.state.stickyHeader.padding + shadowPadding + 2;
|
|
600
600
|
var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
|
|
601
|
-
stickyScrollbar = _getEditorFeatureFlag3.stickyScrollbar
|
|
601
|
+
stickyScrollbar = _getEditorFeatureFlag3.stickyScrollbar,
|
|
602
|
+
tableResizePerformance = _getEditorFeatureFlag3.tableResizePerformance;
|
|
602
603
|
return /*#__PURE__*/React.createElement(TableContainer, {
|
|
603
604
|
className: classnames(ClassName.TABLE_CONTAINER, (_classnames = {}, _defineProperty(_classnames, ClassName.WITH_CONTROLS, allowControls && tableActive), _defineProperty(_classnames, ClassName.TABLE_STICKY, this.state.stickyHeader && hasHeaderRow), _defineProperty(_classnames, ClassName.HOVERED_DELETE_BUTTON, isInDanger), _defineProperty(_classnames, ClassName.TABLE_SELECTED, isTableSelected(view.state.selection)), _classnames)),
|
|
604
605
|
editorView: view,
|
|
@@ -610,7 +611,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
610
611
|
isNested: isNested,
|
|
611
612
|
pluginInjectionApi: pluginInjectionApi,
|
|
612
613
|
isTableResizingEnabled: options === null || options === void 0 ? void 0 : options.isTableResizingEnabled,
|
|
613
|
-
isResizing: isResizing
|
|
614
|
+
isResizing: isResizing,
|
|
615
|
+
tableResizePerformance: tableResizePerformance
|
|
614
616
|
}, /*#__PURE__*/React.createElement("div", {
|
|
615
617
|
className: ClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
616
618
|
"data-testid": "sticky-sentinel-top"
|