@atlaskit/editor-plugin-table 7.16.13 → 7.16.15
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 +17 -0
- package/dist/cjs/commands/column-resize.js +6 -3
- package/dist/cjs/commands/delete.js +2 -1
- package/dist/cjs/commands/insert.js +8 -5
- package/dist/cjs/commands/misc.js +17 -1
- package/dist/cjs/commands-with-analytics.js +6 -4
- package/dist/cjs/event-handlers.js +2 -1
- package/dist/cjs/nodeviews/TableComponent.js +21 -10
- package/dist/cjs/nodeviews/TableContainer.js +7 -3
- package/dist/cjs/nodeviews/TableResizer.js +3 -2
- package/dist/cjs/plugin.js +4 -3
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +4 -2
- package/dist/cjs/pm-plugins/keymap.js +5 -4
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +12 -7
- package/dist/cjs/pm-plugins/table-resizing/utils/colgroup.js +6 -5
- package/dist/cjs/pm-plugins/table-resizing/utils/consts.js +2 -1
- package/dist/cjs/pm-plugins/table-resizing/utils/index.js +6 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +6 -4
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-column.js +5 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +13 -8
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +17 -9
- package/dist/cjs/toolbar.js +10 -5
- package/dist/cjs/transforms/column-width.js +3 -1
- package/dist/cjs/transforms/delete-columns.js +2 -1
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +4 -2
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +4 -1
- package/dist/cjs/ui/FloatingInsertButton/index.js +3 -1
- package/dist/cjs/utils/drag-menu.js +2 -1
- package/dist/es2019/commands/column-resize.js +6 -3
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands/misc.js +17 -1
- package/dist/es2019/commands-with-analytics.js +6 -6
- package/dist/es2019/event-handlers.js +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +21 -10
- package/dist/es2019/nodeviews/TableContainer.js +7 -3
- package/dist/es2019/nodeviews/TableResizer.js +3 -2
- package/dist/es2019/plugin.js +4 -3
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +4 -2
- package/dist/es2019/pm-plugins/keymap.js +5 -5
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +12 -7
- package/dist/es2019/pm-plugins/table-resizing/utils/colgroup.js +6 -6
- package/dist/es2019/pm-plugins/table-resizing/utils/consts.js +1 -0
- package/dist/es2019/pm-plugins/table-resizing/utils/index.js +1 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +7 -5
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-column.js +5 -5
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +12 -8
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +17 -12
- package/dist/es2019/toolbar.js +10 -8
- package/dist/es2019/transforms/column-width.js +3 -2
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +4 -2
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +4 -1
- package/dist/es2019/ui/FloatingInsertButton/index.js +3 -1
- package/dist/es2019/utils/drag-menu.js +2 -2
- package/dist/esm/commands/column-resize.js +6 -3
- package/dist/esm/commands/delete.js +2 -1
- package/dist/esm/commands/insert.js +8 -5
- package/dist/esm/commands/misc.js +17 -1
- package/dist/esm/commands-with-analytics.js +6 -4
- package/dist/esm/event-handlers.js +2 -1
- package/dist/esm/nodeviews/TableComponent.js +21 -10
- package/dist/esm/nodeviews/TableContainer.js +7 -3
- package/dist/esm/nodeviews/TableResizer.js +3 -2
- package/dist/esm/plugin.js +4 -3
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +4 -2
- package/dist/esm/pm-plugins/keymap.js +5 -4
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +12 -7
- package/dist/esm/pm-plugins/table-resizing/utils/colgroup.js +6 -5
- package/dist/esm/pm-plugins/table-resizing/utils/consts.js +1 -0
- package/dist/esm/pm-plugins/table-resizing/utils/index.js +1 -1
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +7 -5
- package/dist/esm/pm-plugins/table-resizing/utils/resize-column.js +5 -3
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +13 -8
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +17 -9
- package/dist/esm/toolbar.js +10 -5
- package/dist/esm/transforms/column-width.js +3 -1
- package/dist/esm/transforms/delete-columns.js +2 -1
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +4 -2
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +4 -1
- package/dist/esm/ui/FloatingInsertButton/index.js +3 -1
- package/dist/esm/utils/drag-menu.js +2 -1
- package/dist/types/commands/delete.d.ts +1 -1
- package/dist/types/commands/insert.d.ts +4 -4
- package/dist/types/commands-with-analytics.d.ts +3 -3
- package/dist/types/event-handlers.d.ts +1 -1
- package/dist/types/nodeviews/TableContainer.d.ts +4 -2
- package/dist/types/nodeviews/TableResizer.d.ts +2 -1
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/main.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/misc.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -2
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -2
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types/toolbar.d.ts +2 -2
- package/dist/types/transforms/column-width.d.ts +1 -1
- package/dist/types/transforms/delete-columns.d.ts +1 -1
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/commands/delete.d.ts +1 -1
- package/dist/types-ts4.5/commands/insert.d.ts +4 -4
- package/dist/types-ts4.5/commands-with-analytics.d.ts +3 -3
- package/dist/types-ts4.5/event-handlers.d.ts +1 -1
- 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/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/colgroup.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/consts.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/misc.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-column.d.ts +2 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +3 -2
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +3 -3
- package/dist/types-ts4.5/toolbar.d.ts +2 -2
- package/dist/types-ts4.5/transforms/column-width.d.ts +1 -1
- package/dist/types-ts4.5/transforms/delete-columns.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -1
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +4 -1
- package/src/commands/column-resize.ts +9 -3
- package/src/commands/delete.ts +2 -1
- package/src/commands/insert.ts +31 -12
- package/src/commands/misc.ts +20 -4
- package/src/commands-with-analytics.ts +24 -8
- package/src/event-handlers.ts +2 -0
- package/src/nodeviews/TableComponent.tsx +41 -12
- package/src/nodeviews/TableContainer.tsx +6 -0
- package/src/nodeviews/TableResizer.tsx +4 -0
- package/src/plugin.tsx +9 -0
- package/src/pm-plugins/drag-and-drop/plugin.ts +13 -4
- package/src/pm-plugins/keymap.ts +17 -4
- package/src/pm-plugins/main.ts +2 -0
- package/src/pm-plugins/table-resizing/event-handlers.ts +21 -10
- package/src/pm-plugins/table-resizing/utils/colgroup.ts +14 -4
- package/src/pm-plugins/table-resizing/utils/consts.ts +1 -0
- package/src/pm-plugins/table-resizing/utils/index.ts +1 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +24 -5
- package/src/pm-plugins/table-resizing/utils/resize-column.ts +11 -4
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +17 -6
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +32 -9
- package/src/toolbar.tsx +18 -10
- package/src/transforms/column-width.ts +2 -1
- package/src/transforms/delete-columns.ts +11 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +12 -5
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
- package/src/ui/FloatingDragMenu/index.tsx +7 -0
- package/src/ui/FloatingInsertButton/index.tsx +7 -0
- package/src/utils/drag-menu.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.16.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#105930](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105930)
|
|
8
|
+
[`939b873db211`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/939b873db211) -
|
|
9
|
+
[ux] Sets increased table scaling percent when FF is enabled.
|
|
10
|
+
|
|
11
|
+
## 7.16.14
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#107290](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107290)
|
|
16
|
+
[`9b3d2881e8d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9b3d2881e8d5) -
|
|
17
|
+
Set table width when alignment changes if not set, as layout attribute can be used to determine
|
|
18
|
+
width
|
|
19
|
+
|
|
3
20
|
## 7.16.13
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -211,9 +211,11 @@ var changeColumnWidthByStep = exports.changeColumnWidthByStep = function changeC
|
|
|
211
211
|
getEditorContainerWidth: getEditorContainerWidth
|
|
212
212
|
});
|
|
213
213
|
var isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
|
|
214
|
-
|
|
214
|
+
var isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
215
|
+
if (isTableScalingEnabledWithLockButton) {
|
|
215
216
|
isTableScalingEnabledOnCurrentTable = originalTable.attrs.displayMode !== 'fixed';
|
|
216
217
|
}
|
|
218
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
217
219
|
var initialResizeState = (0, _utils3.getResizeState)({
|
|
218
220
|
minWidth: _styles.tableCellMinWidth,
|
|
219
221
|
maxSize: maxSize,
|
|
@@ -221,14 +223,15 @@ var changeColumnWidthByStep = exports.changeColumnWidthByStep = function changeC
|
|
|
221
223
|
tableRef: dom,
|
|
222
224
|
start: tableStartPosition,
|
|
223
225
|
domAtPos: domAtPos,
|
|
224
|
-
isTableScalingEnabled: isTableScalingEnabledOnCurrentTable
|
|
226
|
+
isTableScalingEnabled: isTableScalingEnabledOnCurrentTable,
|
|
227
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
225
228
|
});
|
|
226
229
|
(0, _utils3.updateControls)()(state);
|
|
227
230
|
var selectionRect = (0, _utils.getSelectionRect)(state.selection);
|
|
228
231
|
var selectedColumns = selectionRect ? (0, _utils4.getSelectedColumnIndexes)(selectionRect) : [];
|
|
229
232
|
// only selected (or selected - 1) columns should be distributed
|
|
230
233
|
var resizingSelectedColumns = selectedColumns.indexOf(colIndex) > -1 || selectedColumns.indexOf(colIndex + 1) > -1;
|
|
231
|
-
var newResizeState = (0, _utils3.resizeColumn)(initialResizeState, colIndex, stepSize, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, isTableScalingEnabled);
|
|
234
|
+
var newResizeState = (0, _utils3.resizeColumn)(initialResizeState, colIndex, stepSize, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
232
235
|
customTr = (0, _transforms.updateColumnWidths)(newResizeState, originalTable, tableStartPosition)(customTr);
|
|
233
236
|
if (dispatch) {
|
|
234
237
|
dispatch(customTr);
|
|
@@ -8,8 +8,9 @@ var _deleteColumns = require("../transforms/delete-columns");
|
|
|
8
8
|
var _getAllowAddColumnCustomStep = require("../utils/get-allow-add-column-custom-step");
|
|
9
9
|
var deleteColumnsCommand = exports.deleteColumnsCommand = function deleteColumnsCommand(rect) {
|
|
10
10
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
11
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
11
12
|
return function (state, dispatch, view) {
|
|
12
|
-
var tr = (0, _deleteColumns.deleteColumns)(rect, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view, isTableScalingEnabled)(state.tr);
|
|
13
|
+
var tr = (0, _deleteColumns.deleteColumns)(rect, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(state.tr);
|
|
13
14
|
if (dispatch) {
|
|
14
15
|
dispatch(tr);
|
|
15
16
|
return true;
|
|
@@ -31,6 +31,7 @@ function addColumnAtCustomStep(column) {
|
|
|
31
31
|
function addColumnAt() {
|
|
32
32
|
var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
33
33
|
var isCellBackgroundDuplicated = arguments.length > 1 ? arguments[1] : undefined;
|
|
34
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 2 ? arguments[2] : undefined;
|
|
34
35
|
return function (column) {
|
|
35
36
|
var allowAddColumnCustomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
36
37
|
var view = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -44,7 +45,7 @@ function addColumnAt() {
|
|
|
44
45
|
var table = (0, _utils2.findTable)(updatedTr.selection);
|
|
45
46
|
if (table) {
|
|
46
47
|
// [ED-8288] Update colwidths manually to avoid multiple dispatch in TableComponent
|
|
47
|
-
updatedTr = (0, _columnWidth.rescaleColumns)(isTableScalingEnabled)(table, view)(updatedTr);
|
|
48
|
+
updatedTr = (0, _columnWidth.rescaleColumns)(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
|
|
48
49
|
}
|
|
49
50
|
if (view) {
|
|
50
51
|
updatedTr = (0, _commands.updateRowOrColumnMovedTransform)({
|
|
@@ -63,6 +64,7 @@ function addColumnAt() {
|
|
|
63
64
|
// Command to add a column before the column with the selection.
|
|
64
65
|
var addColumnBefore = exports.addColumnBefore = function addColumnBefore() {
|
|
65
66
|
var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
67
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
66
68
|
return function (state, dispatch, view) {
|
|
67
69
|
var table = (0, _utils2.findTable)(state.selection);
|
|
68
70
|
if (!table) {
|
|
@@ -70,7 +72,7 @@ var addColumnBefore = exports.addColumnBefore = function addColumnBefore() {
|
|
|
70
72
|
}
|
|
71
73
|
if (dispatch) {
|
|
72
74
|
var rect = (0, _utils2.selectedRect)(state);
|
|
73
|
-
dispatch(addColumnAt(isTableScalingEnabled)(rect.left, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
75
|
+
dispatch(addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(rect.left, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
74
76
|
}
|
|
75
77
|
return true;
|
|
76
78
|
};
|
|
@@ -78,7 +80,7 @@ var addColumnBefore = exports.addColumnBefore = function addColumnBefore() {
|
|
|
78
80
|
|
|
79
81
|
// :: (EditorState, dispatch: ?(tr: Transaction)) → bool
|
|
80
82
|
// Command to add a column after the column with the selection.
|
|
81
|
-
var addColumnAfter = exports.addColumnAfter = function addColumnAfter(isTableScalingEnabled) {
|
|
83
|
+
var addColumnAfter = exports.addColumnAfter = function addColumnAfter(isTableScalingEnabled, shouldUseIncreasedScalingPercent) {
|
|
82
84
|
return function (state, dispatch, view) {
|
|
83
85
|
var table = (0, _utils2.findTable)(state.selection);
|
|
84
86
|
if (!table) {
|
|
@@ -86,7 +88,7 @@ var addColumnAfter = exports.addColumnAfter = function addColumnAfter(isTableSca
|
|
|
86
88
|
}
|
|
87
89
|
if (dispatch) {
|
|
88
90
|
var rect = (0, _utils2.selectedRect)(state);
|
|
89
|
-
dispatch(addColumnAt(isTableScalingEnabled)(rect.right, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
91
|
+
dispatch(addColumnAt(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(rect.right, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr));
|
|
90
92
|
}
|
|
91
93
|
return true;
|
|
92
94
|
};
|
|
@@ -94,9 +96,10 @@ var addColumnAfter = exports.addColumnAfter = function addColumnAfter(isTableSca
|
|
|
94
96
|
var insertColumn = exports.insertColumn = function insertColumn() {
|
|
95
97
|
var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
96
98
|
var isCellBackgroundDuplicated = arguments.length > 1 ? arguments[1] : undefined;
|
|
99
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 2 ? arguments[2] : undefined;
|
|
97
100
|
return function (column) {
|
|
98
101
|
return function (state, dispatch, view) {
|
|
99
|
-
var tr = addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated)(column, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr);
|
|
102
|
+
var tr = addColumnAt(isTableScalingEnabled, isCellBackgroundDuplicated, shouldUseIncreasedScalingPercent)(column, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(state), view)(state.tr);
|
|
100
103
|
var table = (0, _utils2.findTable)(tr.selection);
|
|
101
104
|
if (!table) {
|
|
102
105
|
return false;
|
|
@@ -8,6 +8,7 @@ exports.updateWidthToWidest = exports.updateResizeHandleDecorations = exports.tr
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
11
|
+
var _nodeWidth = require("@atlaskit/editor-common/node-width");
|
|
11
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
12
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
13
14
|
var _cellSelection = require("@atlaskit/editor-tables/cell-selection");
|
|
@@ -597,6 +598,13 @@ var setTableAlignment = exports.setTableAlignment = function setTableAlignment(n
|
|
|
597
598
|
var nextTableAttrs = _objectSpread(_objectSpread({}, tableObject.node.attrs), {}, {
|
|
598
599
|
layout: newAlignment
|
|
599
600
|
});
|
|
601
|
+
|
|
602
|
+
// table uses old breakout values in layout attribute to determine width
|
|
603
|
+
// but that information is lost when alignment changes, so we need to ensure we retain that info
|
|
604
|
+
if (!tableObject.node.attrs.width) {
|
|
605
|
+
var tableWidth = (0, _nodeWidth.getTableContainerWidth)(tableObject.node);
|
|
606
|
+
nextTableAttrs.width = tableWidth;
|
|
607
|
+
}
|
|
600
608
|
tr.setNodeMarkup(tableObject.pos, undefined, nextTableAttrs).setMeta('scrollIntoView', false);
|
|
601
609
|
return tr;
|
|
602
610
|
};
|
|
@@ -604,9 +612,17 @@ var setTableAlignment = exports.setTableAlignment = function setTableAlignment(n
|
|
|
604
612
|
var setTableAlignmentWithTableContentWithPos = exports.setTableAlignmentWithTableContentWithPos = function setTableAlignmentWithTableContentWithPos(newAlignment, tableNodeWithPos) {
|
|
605
613
|
return function (_ref3) {
|
|
606
614
|
var tr = _ref3.tr;
|
|
607
|
-
var
|
|
615
|
+
var table = tableNodeWithPos.node;
|
|
616
|
+
var nextTableAttrs = _objectSpread(_objectSpread({}, table.attrs), {}, {
|
|
608
617
|
layout: newAlignment
|
|
609
618
|
});
|
|
619
|
+
|
|
620
|
+
// table uses old breakout values in layout attribute to determine width
|
|
621
|
+
// but that information is lost when alignment changes, so we need to ensure we retain that info
|
|
622
|
+
if (!table.attrs.width) {
|
|
623
|
+
var tableWidth = (0, _nodeWidth.getTableContainerWidth)(table);
|
|
624
|
+
nextTableAttrs.width = tableWidth;
|
|
625
|
+
}
|
|
610
626
|
tr.setNodeMarkup(tableNodeWithPos.pos, undefined, nextTableAttrs).setMeta('scrollIntoView', false);
|
|
611
627
|
return tr;
|
|
612
628
|
};
|
|
@@ -228,6 +228,7 @@ var changeColumnWidthByStepWithAnalytics = exports.changeColumnWidthByStepWithAn
|
|
|
228
228
|
var insertColumnWithAnalytics = exports.insertColumnWithAnalytics = function insertColumnWithAnalytics(editorAnalyticsAPI) {
|
|
229
229
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
230
230
|
var isCellbackgroundDuplicated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
231
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
231
232
|
return function (inputMethod, position) {
|
|
232
233
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (state) {
|
|
233
234
|
var _getSelectedTableInfo3 = (0, _utils2.getSelectedTableInfo)(state.selection),
|
|
@@ -245,7 +246,7 @@ var insertColumnWithAnalytics = exports.insertColumnWithAnalytics = function ins
|
|
|
245
246
|
},
|
|
246
247
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
247
248
|
};
|
|
248
|
-
})(editorAnalyticsAPI)((0, _insert.insertColumn)(isTableScalingEnabled, isCellbackgroundDuplicated)(position));
|
|
249
|
+
})(editorAnalyticsAPI)((0, _insert.insertColumn)(isTableScalingEnabled, isCellbackgroundDuplicated, shouldUseIncreasedScalingPercent)(position));
|
|
249
250
|
};
|
|
250
251
|
};
|
|
251
252
|
var deleteRowsWithAnalytics = exports.deleteRowsWithAnalytics = function deleteRowsWithAnalytics(editorAnalyticsAPI) {
|
|
@@ -278,6 +279,7 @@ var deleteRowsWithAnalytics = exports.deleteRowsWithAnalytics = function deleteR
|
|
|
278
279
|
};
|
|
279
280
|
var deleteColumnsWithAnalytics = exports.deleteColumnsWithAnalytics = function deleteColumnsWithAnalytics(editorAnalyticsAPI) {
|
|
280
281
|
var isTableScalingEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
282
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
281
283
|
return function (inputMethod, rect) {
|
|
282
284
|
return (0, _analytics2.withEditorAnalyticsAPI)(function (_ref6) {
|
|
283
285
|
var selection = _ref6.selection;
|
|
@@ -297,10 +299,10 @@ var deleteColumnsWithAnalytics = exports.deleteColumnsWithAnalytics = function d
|
|
|
297
299
|
},
|
|
298
300
|
eventType: _analytics.EVENT_TYPE.TRACK
|
|
299
301
|
};
|
|
300
|
-
})(editorAnalyticsAPI)((0, _delete.deleteColumnsCommand)(rect, isTableScalingEnabled));
|
|
302
|
+
})(editorAnalyticsAPI)((0, _delete.deleteColumnsCommand)(rect, isTableScalingEnabled, shouldUseIncreasedScalingPercent));
|
|
301
303
|
};
|
|
302
304
|
};
|
|
303
|
-
var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = exports.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI) {
|
|
305
|
+
var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = exports.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = function deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent) {
|
|
304
306
|
return function (state, dispatch) {
|
|
305
307
|
var selection = state.selection;
|
|
306
308
|
var isCellSelection = selection instanceof _cellSelection.CellSelection;
|
|
@@ -318,7 +320,7 @@ var deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut = exports.deleteSelected
|
|
|
318
320
|
var isHeaderRowRequired = pluginConfig.isHeaderRowRequired || false;
|
|
319
321
|
return deleteRowsWithAnalytics(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT, rect, isHeaderRowRequired)(state, dispatch);
|
|
320
322
|
} else if (selectionType === 'column') {
|
|
321
|
-
return deleteColumnsWithAnalytics(editorAnalyticsAPI)(_analytics.INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
|
|
323
|
+
return deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(_analytics.INPUT_METHOD.SHORTCUT, rect)(state, dispatch);
|
|
322
324
|
} else {
|
|
323
325
|
return false;
|
|
324
326
|
}
|
|
@@ -354,6 +354,7 @@ function handleTripleClick(view, pos) {
|
|
|
354
354
|
}
|
|
355
355
|
var handleCut = exports.handleCut = function handleCut(oldTr, oldState, newState, editorAnalyticsAPI, editorView) {
|
|
356
356
|
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
357
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
357
358
|
var oldSelection = oldState.tr.selection;
|
|
358
359
|
var tr = newState.tr;
|
|
359
360
|
if (oldSelection instanceof _cellSelection.CellSelection) {
|
|
@@ -396,7 +397,7 @@ var handleCut = exports.handleCut = function handleCut(oldTr, oldState, newState
|
|
|
396
397
|
isHeaderRowRequired = _getPluginState9.pluginConfig.isHeaderRowRequired;
|
|
397
398
|
tr = (0, _transforms.deleteRows)(rect, isHeaderRowRequired)(tr);
|
|
398
399
|
} else if (tr.selection.isColSelection()) {
|
|
399
|
-
tr = (0, _transforms.deleteColumns)(rect, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(oldState), editorView, isTableScalingEnabled)(tr);
|
|
400
|
+
tr = (0, _transforms.deleteColumns)(rect, (0, _getAllowAddColumnCustomStep.getAllowAddColumnCustomStep)(oldState), editorView, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(tr);
|
|
400
401
|
}
|
|
401
402
|
}
|
|
402
403
|
}
|
|
@@ -181,6 +181,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
181
181
|
_this.containerWidth = containerWidth;
|
|
182
182
|
_this.layoutSize = layoutSize;
|
|
183
183
|
});
|
|
184
|
+
// Function gets called when table is nested.
|
|
184
185
|
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "scaleTable", function (scaleOptions) {
|
|
185
186
|
var _this$props2 = _this.props,
|
|
186
187
|
view = _this$props2.view,
|
|
@@ -204,7 +205,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
204
205
|
start: pos + 1,
|
|
205
206
|
containerWidth: width,
|
|
206
207
|
previousContainerWidth: _this.containerWidth.width || width
|
|
207
|
-
}, options), domAtPos, false
|
|
208
|
+
}, options), domAtPos, false,
|
|
209
|
+
// isTableScalingEnabled doesn't change the behavior of nested tables
|
|
210
|
+
false // shouldUseIncreasedScalingPercent set to false for nested tables
|
|
211
|
+
)(state.tr);
|
|
208
212
|
dispatch(tr);
|
|
209
213
|
});
|
|
210
214
|
(0, _defineProperty3.default)((0, _assertThisInitialized2.default)(_this), "setTimerToSendInitialOverflowCaptured", function (isOverflowing) {
|
|
@@ -478,7 +482,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
478
482
|
var isNumberOfColumnsChanged = (0, _utils5.tablesHaveDifferentNoOfColumns)(tableNode, this.node);
|
|
479
483
|
var maybeScale = isTableSquashed || isTableWidthChanged || isTableResizedFullWidth || isNumberColumnChanged || isNumberOfColumnsChanged;
|
|
480
484
|
if (force || maybeScale) {
|
|
481
|
-
var _this$containerWidth;
|
|
485
|
+
var _this$containerWidth, _this$props$options;
|
|
482
486
|
var containerWidthValue = containerWidth.width;
|
|
483
487
|
var isWidthChanged = ((_this$containerWidth = this.containerWidth) === null || _this$containerWidth === void 0 ? void 0 : _this$containerWidth.width) !== containerWidthValue;
|
|
484
488
|
var wasTableResized = (0, _colgroup.hasTableBeenResized)(this.node);
|
|
@@ -486,8 +490,10 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
486
490
|
var isColumnsDistributed = wasTableResized && !isTableResized;
|
|
487
491
|
var isTableDisplayModeChanged = this.node.attrs.displayMode !== tableNode.attrs.displayMode;
|
|
488
492
|
var shouldUpdateColgroup = isWidthChanged || isColumnsDistributed || isTableResizedFullWidth || isTableWidthChanged || isTableDisplayModeChanged || isNumberColumnChanged || isNumberOfColumnsChanged;
|
|
493
|
+
var isTableScalingEnabledWithLockButton = ((_this$props$options = this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.isTableScalingEnabled) && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
494
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent') || false;
|
|
489
495
|
if (force || !isResizing && shouldUpdateColgroup) {
|
|
490
|
-
var _this$props$
|
|
496
|
+
var _this$props$options2;
|
|
491
497
|
var resizeState = (0, _utils4.getResizeState)({
|
|
492
498
|
minWidth: _utils4.COLUMN_MIN_WIDTH,
|
|
493
499
|
maxSize: tableRenderWidth,
|
|
@@ -495,19 +501,20 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
495
501
|
tableRef: this.table,
|
|
496
502
|
start: start,
|
|
497
503
|
domAtPos: view.domAtPos.bind(view),
|
|
498
|
-
isTableScalingEnabled: true
|
|
504
|
+
isTableScalingEnabled: true,
|
|
505
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
499
506
|
});
|
|
500
507
|
var shouldScaleOnColgroupUpdate = false;
|
|
501
|
-
if ((_this$props$
|
|
508
|
+
if ((_this$props$options2 = this.props.options) !== null && _this$props$options2 !== void 0 && _this$props$options2.isTableScalingEnabled && !(0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button')) {
|
|
502
509
|
shouldScaleOnColgroupUpdate = true;
|
|
503
510
|
}
|
|
504
|
-
if (
|
|
511
|
+
if (isTableScalingEnabledWithLockButton && tableNode.attrs.displayMode !== 'fixed') {
|
|
505
512
|
shouldScaleOnColgroupUpdate = true;
|
|
506
513
|
}
|
|
507
514
|
|
|
508
515
|
// Request animation frame required for Firefox
|
|
509
516
|
requestAnimationFrame(function () {
|
|
510
|
-
(0, _utils4.updateColgroup)(resizeState, _this2.table, tableNode, shouldScaleOnColgroupUpdate);
|
|
517
|
+
(0, _utils4.updateColgroup)(resizeState, _this2.table, tableNode, shouldScaleOnColgroupUpdate, shouldUseIncreasedScalingPercent);
|
|
511
518
|
});
|
|
512
519
|
}
|
|
513
520
|
}
|
|
@@ -541,7 +548,9 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
541
548
|
shouldScale = true;
|
|
542
549
|
shouldHandleColgroupUpdates = true;
|
|
543
550
|
}
|
|
544
|
-
|
|
551
|
+
var isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
552
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
553
|
+
if (isTableScalingEnabledWithLockButton && getNode().attrs.displayMode !== 'fixed') {
|
|
545
554
|
shouldScale = true;
|
|
546
555
|
shouldHandleColgroupUpdates = true;
|
|
547
556
|
}
|
|
@@ -593,7 +602,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
593
602
|
var start = getPos() || 0;
|
|
594
603
|
var depth = _view.state.doc.resolve(start).depth;
|
|
595
604
|
shouldScale = depth === 0 && shouldScale;
|
|
596
|
-
(0, _utils4.insertColgroupFromNode)(this.table, currentTable, shouldScale);
|
|
605
|
+
(0, _utils4.insertColgroupFromNode)(this.table, currentTable, shouldScale, undefined, shouldUseIncreasedScalingPercent);
|
|
597
606
|
}
|
|
598
607
|
(0, _dom.updateControls)()(_view.state);
|
|
599
608
|
}
|
|
@@ -749,6 +758,7 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
749
758
|
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;
|
|
750
759
|
var _getEditorFeatureFlag3 = getEditorFeatureFlags(),
|
|
751
760
|
stickyScrollbar = _getEditorFeatureFlag3.stickyScrollbar;
|
|
761
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
752
762
|
return /*#__PURE__*/_react.default.createElement(_TableContainer.TableContainer
|
|
753
763
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
754
764
|
, {
|
|
@@ -765,7 +775,8 @@ var TableComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
765
775
|
isResizing: isResizing,
|
|
766
776
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
767
777
|
isWholeTableInDanger: isWholeTableInDanger,
|
|
768
|
-
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
778
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
779
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
769
780
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
770
781
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
771
782
|
className: _types.TableCssClassName.TABLE_STICKY_SENTINEL_TOP,
|
|
@@ -124,7 +124,8 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
124
124
|
tableWrapperHeight = _ref4.tableWrapperHeight,
|
|
125
125
|
isWholeTableInDanger = _ref4.isWholeTableInDanger,
|
|
126
126
|
isTableScalingEnabled = _ref4.isTableScalingEnabled,
|
|
127
|
-
isTableAlignmentEnabled = _ref4.isTableAlignmentEnabled
|
|
127
|
+
isTableAlignmentEnabled = _ref4.isTableAlignmentEnabled,
|
|
128
|
+
shouldUseIncreasedScalingPercent = _ref4.shouldUseIncreasedScalingPercent;
|
|
128
129
|
var containerRef = (0, _react.useRef)(null);
|
|
129
130
|
var tableWidthRef = (0, _react.useRef)(_editorSharedStyles.akEditorDefaultLayoutWidth);
|
|
130
131
|
var _useState = (0, _react.useState)(false),
|
|
@@ -231,6 +232,7 @@ var ResizableTableContainer = exports.ResizableTableContainer = /*#__PURE__*/_re
|
|
|
231
232
|
isFullWidthModeEnabled: isFullWidthModeEnabled,
|
|
232
233
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
233
234
|
isWholeTableInDanger: isWholeTableInDanger,
|
|
235
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
234
236
|
pluginInjectionApi: pluginInjectionApi,
|
|
235
237
|
onResizeStart: onResizeStart,
|
|
236
238
|
onResizeStop: onResizeStop
|
|
@@ -284,7 +286,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref6) {
|
|
|
284
286
|
isWholeTableInDanger = _ref6.isWholeTableInDanger,
|
|
285
287
|
isTableResizingEnabled = _ref6.isTableResizingEnabled,
|
|
286
288
|
isTableScalingEnabled = _ref6.isTableScalingEnabled,
|
|
287
|
-
isTableAlignmentEnabled = _ref6.isTableAlignmentEnabled
|
|
289
|
+
isTableAlignmentEnabled = _ref6.isTableAlignmentEnabled,
|
|
290
|
+
shouldUseIncreasedScalingPercent = _ref6.shouldUseIncreasedScalingPercent;
|
|
288
291
|
if (isTableResizingEnabled && !isNested) {
|
|
289
292
|
return /*#__PURE__*/_react.default.createElement(ResizableTableContainer
|
|
290
293
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -301,7 +304,8 @@ var TableContainer = exports.TableContainer = function TableContainer(_ref6) {
|
|
|
301
304
|
pluginInjectionApi: pluginInjectionApi,
|
|
302
305
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
303
306
|
isWholeTableInDanger: isWholeTableInDanger,
|
|
304
|
-
isTableAlignmentEnabled: isTableAlignmentEnabled
|
|
307
|
+
isTableAlignmentEnabled: isTableAlignmentEnabled,
|
|
308
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
305
309
|
}, children);
|
|
306
310
|
}
|
|
307
311
|
return /*#__PURE__*/_react.default.createElement(InnerContainer, {
|
|
@@ -121,6 +121,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
121
121
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
122
122
|
isTableAlignmentEnabled = _ref.isTableAlignmentEnabled,
|
|
123
123
|
isWholeTableInDanger = _ref.isWholeTableInDanger,
|
|
124
|
+
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
|
|
124
125
|
pluginInjectionApi = _ref.pluginInjectionApi,
|
|
125
126
|
isFullWidthModeEnabled = _ref.isFullWidthModeEnabled;
|
|
126
127
|
var currentGap = (0, _react.useRef)(0);
|
|
@@ -303,7 +304,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
303
304
|
prevNode: node,
|
|
304
305
|
start: pos + 1,
|
|
305
306
|
parentWidth: newWidth
|
|
306
|
-
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled)(tr);
|
|
307
|
+
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled, shouldUseIncreasedScalingPercent || false)(tr);
|
|
307
308
|
var scaledNode = tr.doc.nodeAt(pos);
|
|
308
309
|
(_attachAnalyticsEvent2 = attachAnalyticsEvent((0, _analytics2.generateResizedPayload)({
|
|
309
310
|
originalNode: node,
|
|
@@ -334,7 +335,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
334
335
|
onResizeStop();
|
|
335
336
|
}
|
|
336
337
|
return newWidth;
|
|
337
|
-
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, widthToWidest, formatMessage, pluginInjectionApi]);
|
|
338
|
+
}, [displayGapCursor, updateWidth, editorView, getPos, node, tableRef, scheduleResize, displayGuideline, attachAnalyticsEvent, endMeasure, onResizeStop, isTableScalingEnabled, shouldUseIncreasedScalingPercent, widthToWidest, formatMessage, pluginInjectionApi]);
|
|
338
339
|
var handleTableSizeChangeOnKeypress = (0, _react.useCallback)(function (step) {
|
|
339
340
|
var newWidth = width + step;
|
|
340
341
|
if (newWidth > maxWidth || newWidth < resizerMinWidth) {
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -72,6 +72,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
72
72
|
};
|
|
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
|
+
var shouldUseIncreasedScalingPercent = (options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button') && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
75
76
|
return {
|
|
76
77
|
name: 'table',
|
|
77
78
|
// Use getSharedState to store fullWidthEnabled and wasFullWidthModeEnabled to guarantee access
|
|
@@ -163,7 +164,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
163
164
|
dragAndDropEnabled = _ref3.dragAndDropEnabled,
|
|
164
165
|
isTableScalingEnabled = _ref3.isTableScalingEnabled,
|
|
165
166
|
isTableAlignmentEnabled = _ref3.isTableAlignmentEnabled;
|
|
166
|
-
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled);
|
|
167
|
+
return (0, _main.createPlugin)(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, (0, _createPluginConfig.pluginConfig)(tableOptions), defaultGetEditorContainerWidth, getEditorFeatureFlags || defaultGetEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthEnabled, wasFullWidthEnabled, dragAndDropEnabled, editorAnalyticsAPI, api, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent);
|
|
167
168
|
}
|
|
168
169
|
}, {
|
|
169
170
|
name: 'tablePMColResizing',
|
|
@@ -200,7 +201,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
200
201
|
isTableAlignmentEnabled = _ref7$isTableAlignmen === void 0 ? false : _ref7$isTableAlignmen,
|
|
201
202
|
_ref7$fullWidthEnable = _ref7.fullWidthEnabled,
|
|
202
203
|
fullWidthEnabled = _ref7$fullWidthEnable === void 0 ? false : _ref7$fullWidthEnable;
|
|
203
|
-
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl);
|
|
204
|
+
return (0, _keymap.keymapPlugin)(defaultGetEditorContainerWidth, editorAnalyticsAPI, dragAndDropEnabled, isTableScalingEnabled, isTableAlignmentEnabled, fullWidthEnabled, api, getIntl, shouldUseIncreasedScalingPercent);
|
|
204
205
|
}
|
|
205
206
|
}, {
|
|
206
207
|
name: 'tableSelectionKeymap',
|
|
@@ -470,7 +471,7 @@ var tablesPlugin = function tablesPlugin(_ref) {
|
|
|
470
471
|
},
|
|
471
472
|
floatingToolbar: (0, _toolbar.getToolbarConfig)(defaultGetEditorContainerWidth, editorAnalyticsAPI, (options === null || options === void 0 ? void 0 : options.getEditorFeatureFlags) || defaultGetEditorFeatureFlags, function () {
|
|
472
473
|
return editorViewRef.current;
|
|
473
|
-
}, options)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
474
|
+
}, options, shouldUseIncreasedScalingPercent)((0, _createPluginConfig.pluginConfig)(options === null || options === void 0 ? void 0 : options.tableOptions))
|
|
474
475
|
}
|
|
475
476
|
};
|
|
476
477
|
};
|
|
@@ -164,10 +164,12 @@ var destroyFn = function destroyFn(editorView, editorAnalyticsAPI) {
|
|
|
164
164
|
_getTablePluginState5 = _getTablePluginState4.isTableScalingEnabled,
|
|
165
165
|
isTableScalingEnabled = _getTablePluginState5 === void 0 ? false : _getTablePluginState5;
|
|
166
166
|
var isTableScalingEnabledOnCurrentTable = isTableScalingEnabled;
|
|
167
|
-
|
|
167
|
+
var isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
168
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
169
|
+
if (isTableScalingEnabledWithLockButton) {
|
|
168
170
|
isTableScalingEnabledOnCurrentTable = tableNode.attrs.displayMode !== 'fixed';
|
|
169
171
|
}
|
|
170
|
-
(0, _utils3.insertColgroupFromNode)(tableRef, tableNode, isTableScalingEnabledOnCurrentTable);
|
|
172
|
+
(0, _utils3.insertColgroupFromNode)(tableRef, tableNode, isTableScalingEnabledOnCurrentTable, shouldUseIncreasedScalingPercent);
|
|
171
173
|
}
|
|
172
174
|
}
|
|
173
175
|
editorView.focus();
|
|
@@ -22,6 +22,7 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
22
22
|
var isFullWidthEnabled = arguments.length > 5 ? arguments[5] : undefined;
|
|
23
23
|
var pluginInjectionApi = arguments.length > 6 ? arguments[6] : undefined;
|
|
24
24
|
var getIntl = arguments.length > 7 ? arguments[7] : undefined;
|
|
25
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 8 ? arguments[8] : undefined;
|
|
25
26
|
var list = {};
|
|
26
27
|
var ariaNotifyPlugin = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.accessibilityUtils) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions.ariaNotify;
|
|
27
28
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.nextCell.common, (0, _commands2.goToNextCell)(editorAnalyticsAPI, ariaNotifyPlugin, getIntl)(1), list);
|
|
@@ -33,8 +34,8 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
33
34
|
// Add row/column shortcuts
|
|
34
35
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowBefore.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('TOP'), list);
|
|
35
36
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addRowAfter.common, (0, _commandsWithAnalytics.addRowAroundSelection)(editorAnalyticsAPI)('BOTTOM'), list);
|
|
36
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(isTableScalingEnabled), list);
|
|
37
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(isTableScalingEnabled), list);
|
|
37
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnBefore.common, (0, _insert.addColumnBefore)(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
38
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.addColumnAfter.common, (0, _insert.addColumnAfter)(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
38
39
|
if (dragAndDropEnabled) {
|
|
39
40
|
// Move row/column shortcuts
|
|
40
41
|
/**
|
|
@@ -50,8 +51,8 @@ function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAndDropEn
|
|
|
50
51
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.moveColumnRight.common, (0, _commandsWithAnalytics2.moveSourceWithAnalyticsViaShortcut)(editorAnalyticsAPI)('table-column', 1), list);
|
|
51
52
|
|
|
52
53
|
// Delete row/column shortcuts
|
|
53
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.deleteColumn.common, (0, _commandsWithAnalytics.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut)(editorAnalyticsAPI), list);
|
|
54
|
-
(0, _keymaps.bindKeymapWithCommand)(_keymaps.deleteRow.common, (0, _commandsWithAnalytics.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut)(editorAnalyticsAPI), list);
|
|
54
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.deleteColumn.common, (0, _commandsWithAnalytics.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut)(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
55
|
+
(0, _keymaps.bindKeymapWithCommand)(_keymaps.deleteRow.common, (0, _commandsWithAnalytics.deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut)(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
55
56
|
}
|
|
56
57
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-column-resizing_emcvz')) {
|
|
57
58
|
(0, _keymaps.bindKeymapWithCommand)(_keymaps.startColumnResizing.common, (0, _columnResize.initiateKeyboardColumnResizing)({
|
|
@@ -32,7 +32,7 @@ var _pluginFactory = require("./plugin-factory");
|
|
|
32
32
|
var _pluginKey = require("./plugin-key");
|
|
33
33
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
34
34
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
35
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled) {
|
|
35
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch, portalProviderAPI, eventDispatcher, pluginConfig, getEditorContainerWidth, getEditorFeatureFlags, getIntl, tableResizingEnabled, fullWidthModeEnabled, previousFullWidthModeEnabled, dragAndDropEnabled, editorAnalyticsAPI, pluginInjectionApi, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent) {
|
|
36
36
|
var _accessibilityUtils;
|
|
37
37
|
var state = (0, _pluginFactory.createPluginState)(dispatch, _objectSpread(_objectSpread(_objectSpread({
|
|
38
38
|
pluginConfig: pluginConfig,
|
|
@@ -89,7 +89,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatchAnalytic
|
|
|
89
89
|
}
|
|
90
90
|
if (tr) {
|
|
91
91
|
// "fixTables" removes empty rows as we don't allow that in schema
|
|
92
|
-
var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState, editorAnalyticsAPI, editorViewRef || undefined, isTableScalingEnabled);
|
|
92
|
+
var updatedTr = (0, _eventHandlers.handleCut)(tr, oldState, newState, editorAnalyticsAPI, editorViewRef || undefined, isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
93
93
|
return (0, _transforms2.fixTables)(updatedTr) || updatedTr;
|
|
94
94
|
}
|
|
95
95
|
if (transactions.find(function (tr) {
|
|
@@ -53,7 +53,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
53
53
|
getEditorContainerWidth: getEditorContainerWidth
|
|
54
54
|
});
|
|
55
55
|
var shouldScale = tableDepth === 0 && isTableScalingEnabled;
|
|
56
|
-
|
|
56
|
+
var isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
57
|
+
if (isTableScalingEnabledWithLockButton) {
|
|
57
58
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
58
59
|
}
|
|
59
60
|
var resizeState = (0, _utils3.getResizeState)({
|
|
@@ -63,7 +64,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
63
64
|
tableRef: dom,
|
|
64
65
|
start: start,
|
|
65
66
|
domAtPos: domAtPos,
|
|
66
|
-
isTableScalingEnabled: shouldScale
|
|
67
|
+
isTableScalingEnabled: shouldScale,
|
|
68
|
+
shouldUseIncreasedScalingPercent: isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent')
|
|
67
69
|
});
|
|
68
70
|
if ((0, _commands.evenColumns)({
|
|
69
71
|
resizeState: resizeState,
|
|
@@ -138,7 +140,8 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
138
140
|
// only selected (or selected - 1) columns should be distributed
|
|
139
141
|
var resizingSelectedColumns = selectedColumns.indexOf(colIndex) > -1 || selectedColumns.indexOf(colIndex + 1) > -1;
|
|
140
142
|
var _shouldScale = tableDepth === 0 && isTableScalingEnabled;
|
|
141
|
-
|
|
143
|
+
var _isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
144
|
+
if (_isTableScalingEnabledWithLockButton) {
|
|
142
145
|
_shouldScale = _shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
143
146
|
}
|
|
144
147
|
var resizedDelta = clientX - startX;
|
|
@@ -147,7 +150,7 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
147
150
|
tr = (0, _transforms.updateColumnWidths)(newResizeState, table, start)(tr);
|
|
148
151
|
tr.setNodeAttribute(start - 1, 'width', newResizeState.tableWidth);
|
|
149
152
|
} else {
|
|
150
|
-
var _newResizeState = (0, _utils3.resizeColumn)(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale);
|
|
153
|
+
var _newResizeState = (0, _utils3.resizeColumn)(resizeState, colIndex, clientX - startX, dom, originalTable, resizingSelectedColumns ? selectedColumns : undefined, _shouldScale, _isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent'));
|
|
151
154
|
tr = (0, _transforms.updateColumnWidths)(_newResizeState, table, start)(tr);
|
|
152
155
|
}
|
|
153
156
|
if (colIndex === map.width - 1) {
|
|
@@ -215,13 +218,15 @@ var handleMouseDown = exports.handleMouseDown = function handleMouseDown(view, e
|
|
|
215
218
|
var map = _tableMap.TableMap.get(table);
|
|
216
219
|
var colIndex = map.colCount($cell.pos - $cell.start(-1)) + $cell.nodeAfter.attrs.colspan - 1;
|
|
217
220
|
var shouldScale = tableDepth === 0 && isTableScalingEnabled;
|
|
218
|
-
|
|
221
|
+
var isTableScalingEnabledWithLockButton = isTableScalingEnabled && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.preserve-widths-with-lock-button');
|
|
222
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabledWithLockButton && (0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.use-increased-scaling-percent');
|
|
223
|
+
if (isTableScalingEnabledWithLockButton) {
|
|
219
224
|
shouldScale = shouldScale && originalTable.attrs.displayMode !== 'fixed';
|
|
220
225
|
}
|
|
221
226
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.table.colum-resizing-improvements')) {
|
|
222
|
-
(0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale);
|
|
227
|
+
(0, _utils3.resizeColumnAndTable)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, undefined, shouldUseIncreasedScalingPercent);
|
|
223
228
|
} else {
|
|
224
|
-
(0, _utils3.resizeColumn)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale);
|
|
229
|
+
(0, _utils3.resizeColumn)(resizeState, colIndex, clientX - dragging.startX, dom, table, undefined, shouldScale, shouldUseIncreasedScalingPercent);
|
|
225
230
|
}
|
|
226
231
|
(0, _utils3.updateControls)()(state);
|
|
227
232
|
}
|
|
@@ -20,7 +20,7 @@ var _misc = require("./misc");
|
|
|
20
20
|
var getColWidthFix = exports.getColWidthFix = function getColWidthFix(colwidth, tableColumnCount) {
|
|
21
21
|
return colwidth - 1 / tableColumnCount;
|
|
22
22
|
};
|
|
23
|
-
var generateColgroup = exports.generateColgroup = function generateColgroup(table, tableRef) {
|
|
23
|
+
var generateColgroup = exports.generateColgroup = function generateColgroup(table, tableRef, shouldUseIncreasedScalingPercent) {
|
|
24
24
|
var cols = [];
|
|
25
25
|
var map = _tableMap.TableMap.get(table);
|
|
26
26
|
table.content.firstChild.content.forEach(function (cell) {
|
|
@@ -29,7 +29,7 @@ var generateColgroup = exports.generateColgroup = function generateColgroup(tabl
|
|
|
29
29
|
// We slice here to guard against our colwidth array having more entries
|
|
30
30
|
// Than the we actually span. We'll patch the document at a later point.
|
|
31
31
|
if (tableRef) {
|
|
32
|
-
var scalePercent = (0, _misc.getTableScalingPercent)(table, tableRef);
|
|
32
|
+
var scalePercent = (0, _misc.getTableScalingPercent)(table, tableRef, shouldUseIncreasedScalingPercent);
|
|
33
33
|
cell.attrs.colwidth.slice(0, colspan).forEach(function (width) {
|
|
34
34
|
var fixedColWidth = getColWidthFix(width, map.width);
|
|
35
35
|
var scaledWidth = fixedColWidth * scalePercent;
|
|
@@ -63,11 +63,12 @@ var generateColgroup = exports.generateColgroup = function generateColgroup(tabl
|
|
|
63
63
|
var insertColgroupFromNode = exports.insertColgroupFromNode = function insertColgroupFromNode(tableRef, table) {
|
|
64
64
|
var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
65
65
|
var shouldRemove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
|
|
66
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
66
67
|
var colgroup = tableRef === null || tableRef === void 0 ? void 0 : tableRef.querySelector('colgroup');
|
|
67
68
|
if (colgroup && shouldRemove) {
|
|
68
69
|
tableRef === null || tableRef === void 0 || tableRef.removeChild(colgroup);
|
|
69
70
|
}
|
|
70
|
-
colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined);
|
|
71
|
+
colgroup = renderColgroupFromNode(table, isTableScalingEnabled ? tableRef !== null && tableRef !== void 0 ? tableRef : undefined : undefined, shouldUseIncreasedScalingPercent);
|
|
71
72
|
if (shouldRemove) {
|
|
72
73
|
tableRef === null || tableRef === void 0 || tableRef.insertBefore(colgroup, tableRef === null || tableRef === void 0 ? void 0 : tableRef.firstChild);
|
|
73
74
|
}
|
|
@@ -92,8 +93,8 @@ var isMinCellWidthTable = exports.isMinCellWidthTable = function isMinCellWidthT
|
|
|
92
93
|
});
|
|
93
94
|
return isTableMinCellWidth;
|
|
94
95
|
};
|
|
95
|
-
function renderColgroupFromNode(table, maybeTableRef) {
|
|
96
|
-
var rendered = _model.DOMSerializer.renderSpec(document, ['colgroup', {}].concat((0, _toConsumableArray2.default)(generateColgroup(table, maybeTableRef))));
|
|
96
|
+
function renderColgroupFromNode(table, maybeTableRef, shouldUseIncreasedScalingPercent) {
|
|
97
|
+
var rendered = _model.DOMSerializer.renderSpec(document, ['colgroup', {}].concat((0, _toConsumableArray2.default)(generateColgroup(table, maybeTableRef, shouldUseIncreasedScalingPercent))));
|
|
97
98
|
return rendered.dom;
|
|
98
99
|
}
|
|
99
100
|
var getColgroupChildrenLength = exports.getColgroupChildrenLength = function getColgroupChildrenLength(table) {
|