@atlaskit/editor-plugin-table 5.7.4 → 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 +8 -0
- 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/ui/common-styles.js +1 -1
- package/dist/cjs/utils/analytics.js +2 -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/ui/common-styles.js +1 -0
- package/dist/es2019/utils/analytics.js +2 -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/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/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/utils/analytics.d.ts +1 -0
- package/package.json +2 -2
- package/src/__tests__/unit/nodeviews/TableContainer.tsx +7 -0
- package/src/nodeviews/TableComponent.tsx +2 -1
- package/src/nodeviews/TableContainer.tsx +9 -0
- package/src/nodeviews/TableResizer.tsx +6 -0
- package/src/ui/common-styles.ts +1 -0
- package/src/utils/analytics.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 5.7.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -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) {
|
|
@@ -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
|
});
|
|
@@ -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) {
|
|
@@ -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
|
};
|
|
@@ -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"
|
|
@@ -43,7 +43,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
43
43
|
getPos = _ref2.getPos,
|
|
44
44
|
tableRef = _ref2.tableRef,
|
|
45
45
|
isResizing = _ref2.isResizing,
|
|
46
|
-
pluginInjectionApi = _ref2.pluginInjectionApi
|
|
46
|
+
pluginInjectionApi = _ref2.pluginInjectionApi,
|
|
47
|
+
tableResizePerformance = _ref2.tableResizePerformance;
|
|
47
48
|
var containerRef = useRef(null);
|
|
48
49
|
var tableWidthRef = useRef(akEditorDefaultLayoutWidth);
|
|
49
50
|
var updateContainerHeight = useCallback(function (height) {
|
|
@@ -124,7 +125,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
124
125
|
tableRef: tableRef,
|
|
125
126
|
displayGuideline: displayGuideline,
|
|
126
127
|
attachAnalyticsEvent: attachAnalyticsEvent,
|
|
127
|
-
displayGapCursor: displayGapCursor
|
|
128
|
+
displayGapCursor: displayGapCursor,
|
|
129
|
+
tableResizePerformance: tableResizePerformance
|
|
128
130
|
};
|
|
129
131
|
if (getBooleanFF('platform.editor.resizing-table-height-improvement')) {
|
|
130
132
|
tableResizerProps = _objectSpread(_objectSpread({}, tableResizerProps), {}, {
|
|
@@ -136,7 +138,8 @@ export var ResizableTableContainer = /*#__PURE__*/React.memo(function (_ref2) {
|
|
|
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
|
|
@@ -162,7 +165,8 @@ export var TableContainer = function TableContainer(_ref3) {
|
|
|
162
165
|
tableRef = _ref3.tableRef,
|
|
163
166
|
isNested = _ref3.isNested,
|
|
164
167
|
isResizing = _ref3.isResizing,
|
|
165
|
-
pluginInjectionApi = _ref3.pluginInjectionApi
|
|
168
|
+
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
169
|
+
tableResizePerformance = _ref3.tableResizePerformance;
|
|
166
170
|
if (isTableResizingEnabled && !isNested) {
|
|
167
171
|
return /*#__PURE__*/React.createElement(ResizableTableContainer, {
|
|
168
172
|
className: className,
|
|
@@ -172,7 +176,8 @@ export var TableContainer = function TableContainer(_ref3) {
|
|
|
172
176
|
getPos: getPos,
|
|
173
177
|
tableRef: tableRef,
|
|
174
178
|
isResizing: isResizing,
|
|
175
|
-
pluginInjectionApi: pluginInjectionApi
|
|
179
|
+
pluginInjectionApi: pluginInjectionApi,
|
|
180
|
+
tableResizePerformance: tableResizePerformance
|
|
176
181
|
}, children);
|
|
177
182
|
}
|
|
178
183
|
var tableWidth = isBreakoutEnabled ? calcTableWidth(node.attrs.layout, editorWidth) : 'inherit';
|
|
@@ -87,7 +87,8 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
87
87
|
tableRef = _ref.tableRef,
|
|
88
88
|
displayGuideline = _ref.displayGuideline,
|
|
89
89
|
attachAnalyticsEvent = _ref.attachAnalyticsEvent,
|
|
90
|
-
displayGapCursor = _ref.displayGapCursor
|
|
90
|
+
displayGapCursor = _ref.displayGapCursor,
|
|
91
|
+
tableResizePerformance = _ref.tableResizePerformance;
|
|
91
92
|
var currentGap = useRef(0);
|
|
92
93
|
// track resizing state - use ref over state to avoid re-render
|
|
93
94
|
var isResizing = useRef(false);
|
|
@@ -217,7 +218,10 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
217
218
|
var resizeFrameRatePayloads = generateResizeFrameRatePayloads({
|
|
218
219
|
docSize: state.doc.nodeSize,
|
|
219
220
|
frameRateSamples: frameRateSamples,
|
|
220
|
-
originalNode: node
|
|
221
|
+
originalNode: node,
|
|
222
|
+
experiments: {
|
|
223
|
+
tableResizePerformance: tableResizePerformance
|
|
224
|
+
}
|
|
221
225
|
});
|
|
222
226
|
resizeFrameRatePayloads.forEach(function (payload) {
|
|
223
227
|
var _attachAnalyticsEvent;
|
|
@@ -253,7 +257,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
253
257
|
onResizeStop();
|
|
254
258
|
}
|
|
255
259
|
return newWidth;
|
|
256
|
-
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop]);
|
|
260
|
+
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, tableResizePerformance]);
|
|
257
261
|
var handleTableSizeChangeOnKeypress = useCallback(function (step) {
|
|
258
262
|
var newWidth = width + step;
|
|
259
263
|
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
|
@@ -23,7 +23,7 @@ export var tableRowHeight = 44;
|
|
|
23
23
|
var rangeSelectionStyles = "\n.".concat(ClassName.NODEVIEW_WRAPPER, ".").concat(akEditorSelectedNodeClassName, " table tbody tr {\n th,td {\n ").concat(getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), "\n }\n}\n");
|
|
24
24
|
var sentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, ", > .").concat(ClassName.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(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n bottom: ").concat(tableScrollbarOffset + stickyRowOffsetTop + tablePadding * 2 + 23, "px;\n }\n &.").concat(ClassName.WITH_CONTROLS, " {\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_TOP, " {\n top: 0px;\n }\n > .").concat(ClassName.TABLE_STICKY_SENTINEL_BOTTOM, " {\n margin-bottom: ").concat(columnControlsDecorationHeight, "px;\n }\n }\n}");
|
|
25
25
|
var stickyScrollbarSentinelStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, ",\n > .").concat(ClassName.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(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_TOP, " {\n top: ").concat(columnControlsDecorationHeight + tableRowHeight * 3, "px;\n }\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_SENTINEL_BOTTOM, " {\n bottom: ").concat(MAX_BROWSER_SCROLLBAR_HEIGHT, "px;\n }\n}");
|
|
26
|
-
var stickyScrollbarContainerStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.TABLE_STICKY_SCROLLBAR_CONTAINER, " {\n width: 100%;\n display: none;\n overflow-x: auto;\n position: sticky;\n bottom: 0;\n }\n}");
|
|
26
|
+
var stickyScrollbarContainerStyles = ".".concat(ClassName.TABLE_CONTAINER, " {\n > .").concat(ClassName.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}");
|
|
27
27
|
var stickyScrollbarStyles = function stickyScrollbarStyles(featureFlags) {
|
|
28
28
|
return featureFlags !== null && featureFlags !== void 0 && featureFlags.stickyScrollbar ? "".concat(stickyScrollbarContainerStyles, " ").concat(stickyScrollbarSentinelStyles) : '';
|
|
29
29
|
};
|
|
@@ -107,7 +107,8 @@ export var generateResizeFrameRatePayloads = function generateResizeFrameRatePay
|
|
|
107
107
|
frameRate: frameRateSample,
|
|
108
108
|
nodeSize: props.originalNode.nodeSize,
|
|
109
109
|
docSize: props.docSize,
|
|
110
|
-
isInitialSample: index === 0
|
|
110
|
+
isInitialSample: index === 0,
|
|
111
|
+
experiments: props.experiments
|
|
111
112
|
}
|
|
112
113
|
};
|
|
113
114
|
});
|
|
@@ -24,8 +24,9 @@ type ResizableTableContainerProps = {
|
|
|
24
24
|
tableRef: HTMLTableElement;
|
|
25
25
|
isResizing?: boolean;
|
|
26
26
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
|
+
tableResizePerformance?: boolean;
|
|
27
28
|
};
|
|
28
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
29
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableResizePerformance, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
29
30
|
type TableContainerProps = {
|
|
30
31
|
node: PMNode;
|
|
31
32
|
className: string;
|
|
@@ -38,6 +39,7 @@ type TableContainerProps = {
|
|
|
38
39
|
isNested: boolean;
|
|
39
40
|
isResizing?: boolean;
|
|
40
41
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
42
|
+
tableResizePerformance?: boolean;
|
|
41
43
|
};
|
|
42
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
44
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, tableResizePerformance, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
43
45
|
export {};
|
|
@@ -16,10 +16,11 @@ interface TableResizerProps {
|
|
|
16
16
|
displayGuideline: (guideline: GuidelineConfig[]) => boolean;
|
|
17
17
|
attachAnalyticsEvent: (payload: TableEventPayload) => ((tr: Transaction) => boolean) | undefined;
|
|
18
18
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
19
|
+
tableResizePerformance?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
21
22
|
onResizeStop?: () => void;
|
|
22
23
|
onResizeStart?: () => void;
|
|
23
24
|
}
|
|
24
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
25
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, tableResizePerformance, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -33,6 +33,7 @@ export declare const generateResizeFrameRatePayloads: (props: {
|
|
|
33
33
|
docSize: number;
|
|
34
34
|
frameRateSamples: number[];
|
|
35
35
|
originalNode: PMNode;
|
|
36
|
+
experiments?: Record<string, boolean | undefined>;
|
|
36
37
|
}) => TableEventPayload[];
|
|
37
38
|
/**
|
|
38
39
|
* Measures the framerate of a component over a given time period.
|
|
@@ -24,8 +24,9 @@ type ResizableTableContainerProps = {
|
|
|
24
24
|
tableRef: HTMLTableElement;
|
|
25
25
|
isResizing?: boolean;
|
|
26
26
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
27
|
+
tableResizePerformance?: boolean;
|
|
27
28
|
};
|
|
28
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
29
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableResizePerformance, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
29
30
|
type TableContainerProps = {
|
|
30
31
|
node: PMNode;
|
|
31
32
|
className: string;
|
|
@@ -38,6 +39,7 @@ type TableContainerProps = {
|
|
|
38
39
|
isNested: boolean;
|
|
39
40
|
isResizing?: boolean;
|
|
40
41
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
42
|
+
tableResizePerformance?: boolean;
|
|
41
43
|
};
|
|
42
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
44
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { lineLength, width: editorWidth }, isTableResizingEnabled, isBreakoutEnabled, editorView, getPos, tableRef, isNested, isResizing, pluginInjectionApi, tableResizePerformance, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
43
45
|
export {};
|
|
@@ -16,10 +16,11 @@ interface TableResizerProps {
|
|
|
16
16
|
displayGuideline: (guideline: GuidelineConfig[]) => boolean;
|
|
17
17
|
attachAnalyticsEvent: (payload: TableEventPayload) => ((tr: Transaction) => boolean) | undefined;
|
|
18
18
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
19
|
+
tableResizePerformance?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
21
22
|
onResizeStop?: () => void;
|
|
22
23
|
onResizeStart?: () => void;
|
|
23
24
|
}
|
|
24
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
25
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, tableResizePerformance, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
25
26
|
export {};
|
|
@@ -33,6 +33,7 @@ export declare const generateResizeFrameRatePayloads: (props: {
|
|
|
33
33
|
docSize: number;
|
|
34
34
|
frameRateSamples: number[];
|
|
35
35
|
originalNode: PMNode;
|
|
36
|
+
experiments?: Record<string, boolean | undefined>;
|
|
36
37
|
}) => TableEventPayload[];
|
|
37
38
|
/**
|
|
38
39
|
* Measures the framerate of a component over a given time period.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "5.7.
|
|
3
|
+
"version": "5.7.5",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^35.2.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.0.10",
|
|
33
|
-
"@atlaskit/editor-common": "^76.
|
|
33
|
+
"@atlaskit/editor-common": "^76.31.0",
|
|
34
34
|
"@atlaskit/editor-palette": "1.5.2",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^0.4.0",
|
|
36
36
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.0",
|
|
@@ -302,6 +302,7 @@ describe('table -> nodeviews -> TableContainer.tsx', () => {
|
|
|
302
302
|
analytics: { actions: { attachAnalyticsEvent: analyticsMock } },
|
|
303
303
|
} as any
|
|
304
304
|
}
|
|
305
|
+
tableResizePerformance={true}
|
|
305
306
|
/>,
|
|
306
307
|
);
|
|
307
308
|
|
|
@@ -326,6 +327,9 @@ describe('table -> nodeviews -> TableContainer.tsx', () => {
|
|
|
326
327
|
frameRate: 51,
|
|
327
328
|
isInitialSample: true,
|
|
328
329
|
nodeSize: 20,
|
|
330
|
+
experiments: {
|
|
331
|
+
tableResizePerformance: true,
|
|
332
|
+
},
|
|
329
333
|
},
|
|
330
334
|
});
|
|
331
335
|
|
|
@@ -338,6 +342,9 @@ describe('table -> nodeviews -> TableContainer.tsx', () => {
|
|
|
338
342
|
frameRate: 53,
|
|
339
343
|
isInitialSample: false,
|
|
340
344
|
nodeSize: 20,
|
|
345
|
+
experiments: {
|
|
346
|
+
tableResizePerformance: true,
|
|
347
|
+
},
|
|
341
348
|
},
|
|
342
349
|
});
|
|
343
350
|
|
|
@@ -569,7 +569,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
569
569
|
shadowPadding +
|
|
570
570
|
2;
|
|
571
571
|
|
|
572
|
-
const { stickyScrollbar } = getEditorFeatureFlags();
|
|
572
|
+
const { stickyScrollbar, tableResizePerformance } = getEditorFeatureFlags();
|
|
573
573
|
|
|
574
574
|
return (
|
|
575
575
|
<TableContainer
|
|
@@ -589,6 +589,7 @@ class TableComponent extends React.Component<ComponentProps, TableState> {
|
|
|
589
589
|
pluginInjectionApi={pluginInjectionApi}
|
|
590
590
|
isTableResizingEnabled={options?.isTableResizingEnabled}
|
|
591
591
|
isResizing={isResizing}
|
|
592
|
+
tableResizePerformance={tableResizePerformance}
|
|
592
593
|
>
|
|
593
594
|
<div
|
|
594
595
|
className={ClassName.TABLE_STICKY_SENTINEL_TOP}
|
|
@@ -75,6 +75,7 @@ type ResizableTableContainerProps = {
|
|
|
75
75
|
tableRef: HTMLTableElement;
|
|
76
76
|
isResizing?: boolean;
|
|
77
77
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
78
|
+
tableResizePerformance?: boolean;
|
|
78
79
|
};
|
|
79
80
|
|
|
80
81
|
export const ResizableTableContainer = React.memo(
|
|
@@ -88,6 +89,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
88
89
|
tableRef,
|
|
89
90
|
isResizing,
|
|
90
91
|
pluginInjectionApi,
|
|
92
|
+
tableResizePerformance,
|
|
91
93
|
}: PropsWithChildren<ResizableTableContainerProps>) => {
|
|
92
94
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
93
95
|
const tableWidthRef = useRef<number>(akEditorDefaultLayoutWidth);
|
|
@@ -207,6 +209,7 @@ export const ResizableTableContainer = React.memo(
|
|
|
207
209
|
displayGuideline,
|
|
208
210
|
attachAnalyticsEvent,
|
|
209
211
|
displayGapCursor,
|
|
212
|
+
tableResizePerformance,
|
|
210
213
|
};
|
|
211
214
|
|
|
212
215
|
if (getBooleanFF('platform.editor.resizing-table-height-improvement')) {
|
|
@@ -223,6 +226,9 @@ export const ResizableTableContainer = React.memo(
|
|
|
223
226
|
display: 'flex',
|
|
224
227
|
justifyContent: 'center',
|
|
225
228
|
}}
|
|
229
|
+
contentEditable={
|
|
230
|
+
tableResizePerformance && isResizing ? 'false' : undefined
|
|
231
|
+
}
|
|
226
232
|
>
|
|
227
233
|
<div
|
|
228
234
|
style={{
|
|
@@ -254,6 +260,7 @@ type TableContainerProps = {
|
|
|
254
260
|
isNested: boolean;
|
|
255
261
|
isResizing?: boolean;
|
|
256
262
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
263
|
+
tableResizePerformance?: boolean;
|
|
257
264
|
};
|
|
258
265
|
|
|
259
266
|
export const TableContainer = ({
|
|
@@ -269,6 +276,7 @@ export const TableContainer = ({
|
|
|
269
276
|
isNested,
|
|
270
277
|
isResizing,
|
|
271
278
|
pluginInjectionApi,
|
|
279
|
+
tableResizePerformance,
|
|
272
280
|
}: PropsWithChildren<TableContainerProps>) => {
|
|
273
281
|
if (isTableResizingEnabled && !isNested) {
|
|
274
282
|
return (
|
|
@@ -281,6 +289,7 @@ export const TableContainer = ({
|
|
|
281
289
|
tableRef={tableRef}
|
|
282
290
|
isResizing={isResizing}
|
|
283
291
|
pluginInjectionApi={pluginInjectionApi}
|
|
292
|
+
tableResizePerformance={tableResizePerformance}
|
|
284
293
|
>
|
|
285
294
|
{children}
|
|
286
295
|
</ResizableTableContainer>
|
|
@@ -68,6 +68,7 @@ interface TableResizerProps {
|
|
|
68
68
|
payload: TableEventPayload,
|
|
69
69
|
) => ((tr: Transaction) => boolean) | undefined;
|
|
70
70
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
71
|
+
tableResizePerformance?: boolean;
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
@@ -162,6 +163,7 @@ export const TableResizer = ({
|
|
|
162
163
|
displayGuideline,
|
|
163
164
|
attachAnalyticsEvent,
|
|
164
165
|
displayGapCursor,
|
|
166
|
+
tableResizePerformance,
|
|
165
167
|
}: PropsWithChildren<TableResizerImprovementProps>) => {
|
|
166
168
|
const currentGap = useRef(0);
|
|
167
169
|
// track resizing state - use ref over state to avoid re-render
|
|
@@ -354,6 +356,9 @@ export const TableResizer = ({
|
|
|
354
356
|
docSize: state.doc.nodeSize,
|
|
355
357
|
frameRateSamples,
|
|
356
358
|
originalNode: node,
|
|
359
|
+
experiments: {
|
|
360
|
+
tableResizePerformance,
|
|
361
|
+
},
|
|
357
362
|
});
|
|
358
363
|
resizeFrameRatePayloads.forEach((payload) => {
|
|
359
364
|
attachAnalyticsEvent(payload)?.(tr);
|
|
@@ -416,6 +421,7 @@ export const TableResizer = ({
|
|
|
416
421
|
attachAnalyticsEvent,
|
|
417
422
|
endMeasure,
|
|
418
423
|
onResizeStop,
|
|
424
|
+
tableResizePerformance,
|
|
419
425
|
],
|
|
420
426
|
);
|
|
421
427
|
|
package/src/ui/common-styles.ts
CHANGED
package/src/utils/analytics.ts
CHANGED
|
@@ -144,6 +144,7 @@ export const generateResizeFrameRatePayloads = (props: {
|
|
|
144
144
|
docSize: number;
|
|
145
145
|
frameRateSamples: number[];
|
|
146
146
|
originalNode: PMNode;
|
|
147
|
+
experiments?: Record<string, boolean | undefined>;
|
|
147
148
|
}): TableEventPayload[] => {
|
|
148
149
|
const reducedResizeFrameRateSamples = reduceResizeFrameRateSamples(
|
|
149
150
|
props.frameRateSamples,
|
|
@@ -157,6 +158,7 @@ export const generateResizeFrameRatePayloads = (props: {
|
|
|
157
158
|
nodeSize: props.originalNode.nodeSize,
|
|
158
159
|
docSize: props.docSize,
|
|
159
160
|
isInitialSample: index === 0,
|
|
161
|
+
experiments: props.experiments,
|
|
160
162
|
},
|
|
161
163
|
}));
|
|
162
164
|
};
|