@atlaskit/editor-plugin-table 7.5.12 → 7.5.13
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 +7 -0
- package/commands/package.json +1 -1
- package/dist/cjs/commands/index.js +6 -0
- package/dist/cjs/commands/misc.js +16 -1
- package/dist/cjs/nodeviews/TableResizer.js +17 -1
- package/dist/cjs/reducer.js +1 -0
- package/dist/es2019/commands/index.js +1 -1
- package/dist/es2019/commands/misc.js +15 -1
- package/dist/es2019/nodeviews/TableResizer.js +21 -2
- package/dist/es2019/reducer.js +1 -0
- package/dist/esm/commands/index.js +1 -1
- package/dist/esm/commands/misc.js +15 -0
- package/dist/esm/nodeviews/TableResizer.js +17 -1
- package/dist/esm/reducer.js +1 -0
- package/dist/types/commands/index.d.ts +1 -1
- package/dist/types/commands/misc.d.ts +1 -0
- package/dist/types/pm-plugins/analytics/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/ui/DragHandle/index.d.ts +2 -2
- package/dist/types/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
- package/dist/types/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
- package/dist/types/ui/FloatingInsertButton/index.d.ts +2 -2
- package/dist/types/ui/LayoutButton/index.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
- package/dist/types/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -2
- package/dist/types-ts4.5/commands/index.d.ts +1 -1
- package/dist/types-ts4.5/commands/misc.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/analytics/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/sticky-headers/plugin-state.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/plugin-factory.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/dist/types-ts4.5/ui/DragHandle/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingContextualMenu/ContextualMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDeleteButton/DeleteButton.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingDragMenu/DragMenu.d.ts +2 -2
- package/dist/types-ts4.5/ui/FloatingInsertButton/InsertButton.d.ts +4 -4
- package/dist/types-ts4.5/ui/FloatingInsertButton/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/LayoutButton/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/ClassicCornerControls.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/ClassicControls.d.ts +2 -2
- package/dist/types-ts4.5/ui/TableFloatingControls/RowControls/DragControls.d.ts +2 -2
- package/package.json +7 -7
- package/plugin-key/package.json +1 -1
- package/src/commands/index.ts +1 -0
- package/src/commands/misc.ts +16 -0
- package/src/nodeviews/TableResizer.tsx +29 -2
- package/src/reducer.ts +1 -0
- package/src/types.ts +7 -0
- package/types/package.json +1 -1
- package/ui/common-styles/package.json +1 -1
- package/ui/consts/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-table
|
|
2
2
|
|
|
3
|
+
## 7.5.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 7.5.12
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/commands/package.json
CHANGED
|
@@ -249,6 +249,12 @@ Object.defineProperty(exports, "triggerUnlessTableHeader", {
|
|
|
249
249
|
return _misc.triggerUnlessTableHeader;
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
+
Object.defineProperty(exports, "updateWidthToWidest", {
|
|
253
|
+
enumerable: true,
|
|
254
|
+
get: function get() {
|
|
255
|
+
return _misc.updateWidthToWidest;
|
|
256
|
+
}
|
|
257
|
+
});
|
|
252
258
|
var _hover = require("./hover");
|
|
253
259
|
var _insert = require("./insert");
|
|
254
260
|
var _toggle = require("./toggle");
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.updateResizeHandleDecorations = exports.triggerUnlessTableHeader = exports.transformSliceToRemoveColumnsWidths = exports.transformSliceToAddTableHeaders = exports.transformSliceRemoveCellBackgroundColor = exports.showInsertRowButton = exports.showInsertColumnButton = exports.setTableRef = exports.setMultipleCellAttrs = exports.setEditorFocus = exports.setCellAttr = exports.selectRows = exports.selectRow = exports.selectColumns = exports.selectColumn = exports.removeResizeHandleDecorations = exports.moveCursorBackward = exports.isInsideFirstCellOfRowOrColumn = exports.hideInsertColumnOrRowButton = exports.getTableSelectionType = exports.getTableElementMoveTypeBySlice = exports.deleteTableIfSelected = exports.deleteTable = exports.countCellsInSlice = exports.convertFirstRowToHeader = exports.autoSizeTable = exports.addResizeHandleDecorations = exports.addBoldInEmptyHeaderCells = void 0;
|
|
7
|
+
exports.updateWidthToWidest = exports.updateResizeHandleDecorations = exports.triggerUnlessTableHeader = exports.transformSliceToRemoveColumnsWidths = exports.transformSliceToAddTableHeaders = exports.transformSliceRemoveCellBackgroundColor = exports.showInsertRowButton = exports.showInsertColumnButton = exports.setTableRef = exports.setMultipleCellAttrs = exports.setEditorFocus = exports.setCellAttr = exports.selectRows = exports.selectRow = exports.selectColumns = exports.selectColumn = exports.removeResizeHandleDecorations = exports.moveCursorBackward = exports.isInsideFirstCellOfRowOrColumn = exports.hideInsertColumnOrRowButton = exports.getTableSelectionType = exports.getTableElementMoveTypeBySlice = exports.deleteTableIfSelected = exports.deleteTable = exports.countCellsInSlice = exports.convertFirstRowToHeader = exports.autoSizeTable = exports.addResizeHandleDecorations = exports.addBoldInEmptyHeaderCells = void 0;
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -561,4 +561,19 @@ var addBoldInEmptyHeaderCells = exports.addBoldInEmptyHeaderCells = function add
|
|
|
561
561
|
}
|
|
562
562
|
return false;
|
|
563
563
|
};
|
|
564
|
+
};
|
|
565
|
+
var updateWidthToWidest = exports.updateWidthToWidest = function updateWidthToWidest(widthToWidest) {
|
|
566
|
+
return (0, _pluginFactory.createCommand)(function (state) {
|
|
567
|
+
var _getPluginState4 = (0, _pluginFactory.getPluginState)(state),
|
|
568
|
+
prevWidthToWidest = _getPluginState4.widthToWidest;
|
|
569
|
+
if (prevWidthToWidest === widthToWidest) {
|
|
570
|
+
return false;
|
|
571
|
+
}
|
|
572
|
+
return {
|
|
573
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST',
|
|
574
|
+
data: {
|
|
575
|
+
widthToWidest: widthToWidest
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
});
|
|
564
579
|
};
|
|
@@ -18,8 +18,10 @@ var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
|
18
18
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
19
19
|
var _resizer = require("@atlaskit/editor-common/resizer");
|
|
20
20
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
21
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
21
22
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
22
23
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
24
|
+
var _misc = require("../commands/misc");
|
|
23
25
|
var _pluginFactory = require("../pm-plugins/plugin-factory");
|
|
24
26
|
var _tableAnalytics = require("../pm-plugins/table-analytics");
|
|
25
27
|
var _utils3 = require("../pm-plugins/table-resizing/utils");
|
|
@@ -190,6 +192,7 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
190
192
|
}
|
|
191
193
|
}, [startMeasure, editorView, displayGapCursor, isTableScalingEnabled, containerWidth, displayGuideline, onResizeStart]);
|
|
192
194
|
var handleResize = (0, _react.useCallback)(function (originalState, delta) {
|
|
195
|
+
var _defaultGuidelinesFor;
|
|
193
196
|
countFrames();
|
|
194
197
|
var newWidth = originalState.width + delta.width;
|
|
195
198
|
var pos;
|
|
@@ -208,7 +211,17 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
208
211
|
parentWidth: newWidth
|
|
209
212
|
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
|
|
210
213
|
updateActiveGuidelines((0, _snapping.findClosestSnap)(newWidth, isTableScalingEnabled ? (0, _snapping.defaultTablePreserveSnappingWidths)(containerWidth) : _snapping.defaultSnappingWidths, isTableScalingEnabled ? (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth) : _guidelines.defaultGuidelines, _consts.TABLE_HIGHLIGHT_GAP, _consts.TABLE_HIGHLIGHT_TOLERANCE));
|
|
211
|
-
|
|
214
|
+
|
|
215
|
+
// when isTableScalingEnabled true
|
|
216
|
+
// and a table is resized to fit the widest guideline when view port width is between 1011 and 1800
|
|
217
|
+
// set the width of the table to 1800 pixels.
|
|
218
|
+
var state = editorView.state,
|
|
219
|
+
dispatch = editorView.dispatch;
|
|
220
|
+
var widestGuideLineWidthString = (_defaultGuidelinesFor = (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth)[16].key) === null || _defaultGuidelinesFor === void 0 || (_defaultGuidelinesFor = _defaultGuidelinesFor.match(/[\d]*[.]{0,1}[\d]+/g)) === null || _defaultGuidelinesFor === void 0 ? void 0 : _defaultGuidelinesFor.join('');
|
|
221
|
+
var widestGuideLineWidth = parseInt(widestGuideLineWidthString || '', 10);
|
|
222
|
+
var shouldUpdateWidthToWidest = !!(isTableScalingEnabled && (0, _guidelines.defaultGuidelinesForPreserveTable)(containerWidth).length === 17 && widestGuideLineWidth - newWidth <= 1);
|
|
223
|
+
(0, _misc.updateWidthToWidest)(shouldUpdateWidthToWidest)(state, dispatch);
|
|
224
|
+
updateWidth(shouldUpdateWidthToWidest ? _editorSharedStyles.akEditorFullWidthLayoutWidth : newWidth);
|
|
212
225
|
return newWidth;
|
|
213
226
|
}, [countFrames, isTableScalingEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos]);
|
|
214
227
|
var scheduleResize = (0, _react.useMemo)(function () {
|
|
@@ -220,6 +233,9 @@ var TableResizer = exports.TableResizer = function TableResizer(_ref) {
|
|
|
220
233
|
var state = editorView.state,
|
|
221
234
|
dispatch = editorView.dispatch;
|
|
222
235
|
var pos = getPos();
|
|
236
|
+
var _getPluginState2 = (0, _pluginFactory.getPluginState)(editorView.state),
|
|
237
|
+
widthToWidest = _getPluginState2.widthToWidest;
|
|
238
|
+
newWidth = widthToWidest ? _editorSharedStyles.akEditorFullWidthLayoutWidth : newWidth;
|
|
223
239
|
var tr = state.tr.setMeta(_tableWidth.pluginKey, {
|
|
224
240
|
resizing: false
|
|
225
241
|
});
|
package/dist/cjs/reducer.js
CHANGED
|
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
|
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout } from './toggle';
|
|
4
4
|
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations } from './misc';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest } from './misc';
|
|
6
6
|
export { sortByColumn } from './sort';
|
|
7
7
|
export { goToNextCell } from './go-to-next-cell';
|
|
8
8
|
export { removeDescendantNodes } from './referentiality';
|
|
@@ -522,4 +522,18 @@ export const addBoldInEmptyHeaderCells = tableCellHeader => (state, dispatch) =>
|
|
|
522
522
|
return true;
|
|
523
523
|
}
|
|
524
524
|
return false;
|
|
525
|
-
};
|
|
525
|
+
};
|
|
526
|
+
export const updateWidthToWidest = widthToWidest => createCommand(state => {
|
|
527
|
+
let {
|
|
528
|
+
widthToWidest: prevWidthToWidest
|
|
529
|
+
} = getPluginState(state);
|
|
530
|
+
if (prevWidthToWidest === widthToWidest) {
|
|
531
|
+
return false;
|
|
532
|
+
}
|
|
533
|
+
return {
|
|
534
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST',
|
|
535
|
+
data: {
|
|
536
|
+
widthToWidest
|
|
537
|
+
}
|
|
538
|
+
};
|
|
539
|
+
});
|
|
@@ -8,8 +8,10 @@ import { focusTableResizer, ToolTipContent } from '@atlaskit/editor-common/keyma
|
|
|
8
8
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
10
10
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
11
|
+
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
12
13
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { updateWidthToWidest } from '../commands/misc';
|
|
13
15
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
14
16
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
15
17
|
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils';
|
|
@@ -181,6 +183,7 @@ export const TableResizer = ({
|
|
|
181
183
|
}
|
|
182
184
|
}, [startMeasure, editorView, displayGapCursor, isTableScalingEnabled, containerWidth, displayGuideline, onResizeStart]);
|
|
183
185
|
const handleResize = useCallback((originalState, delta) => {
|
|
186
|
+
var _defaultGuidelinesFor, _defaultGuidelinesFor2;
|
|
184
187
|
countFrames();
|
|
185
188
|
const newWidth = originalState.width + delta.width;
|
|
186
189
|
let pos;
|
|
@@ -199,18 +202,34 @@ export const TableResizer = ({
|
|
|
199
202
|
parentWidth: newWidth
|
|
200
203
|
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
|
|
201
204
|
updateActiveGuidelines(findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE));
|
|
202
|
-
|
|
205
|
+
|
|
206
|
+
// when isTableScalingEnabled true
|
|
207
|
+
// and a table is resized to fit the widest guideline when view port width is between 1011 and 1800
|
|
208
|
+
// set the width of the table to 1800 pixels.
|
|
209
|
+
const {
|
|
210
|
+
state,
|
|
211
|
+
dispatch
|
|
212
|
+
} = editorView;
|
|
213
|
+
const widestGuideLineWidthString = (_defaultGuidelinesFor = defaultGuidelinesForPreserveTable(containerWidth)[16].key) === null || _defaultGuidelinesFor === void 0 ? void 0 : (_defaultGuidelinesFor2 = _defaultGuidelinesFor.match(/[\d]*[.]{0,1}[\d]+/g)) === null || _defaultGuidelinesFor2 === void 0 ? void 0 : _defaultGuidelinesFor2.join('');
|
|
214
|
+
const widestGuideLineWidth = parseInt(widestGuideLineWidthString || '', 10);
|
|
215
|
+
const shouldUpdateWidthToWidest = !!(isTableScalingEnabled && defaultGuidelinesForPreserveTable(containerWidth).length === 17 && widestGuideLineWidth - newWidth <= 1);
|
|
216
|
+
updateWidthToWidest(shouldUpdateWidthToWidest)(state, dispatch);
|
|
217
|
+
updateWidth(shouldUpdateWidthToWidest ? akEditorFullWidthLayoutWidth : newWidth);
|
|
203
218
|
return newWidth;
|
|
204
219
|
}, [countFrames, isTableScalingEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos]);
|
|
205
220
|
const scheduleResize = useMemo(() => rafSchd(handleResize), [handleResize]);
|
|
206
221
|
const handleResizeStop = useCallback((originalState, delta) => {
|
|
207
222
|
isResizing.current = false;
|
|
208
|
-
|
|
223
|
+
let newWidth = originalState.width + delta.width;
|
|
209
224
|
const {
|
|
210
225
|
state,
|
|
211
226
|
dispatch
|
|
212
227
|
} = editorView;
|
|
213
228
|
const pos = getPos();
|
|
229
|
+
const {
|
|
230
|
+
widthToWidest
|
|
231
|
+
} = getPluginState(editorView.state);
|
|
232
|
+
newWidth = widthToWidest ? akEditorFullWidthLayoutWidth : newWidth;
|
|
214
233
|
let tr = state.tr.setMeta(tableWidthPluginKey, {
|
|
215
234
|
resizing: false
|
|
216
235
|
});
|
package/dist/es2019/reducer.js
CHANGED
|
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
|
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout } from './toggle';
|
|
4
4
|
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations } from './misc';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest } from './misc';
|
|
6
6
|
export { sortByColumn } from './sort';
|
|
7
7
|
export { goToNextCell } from './go-to-next-cell';
|
|
8
8
|
export { removeDescendantNodes } from './referentiality';
|
|
@@ -554,4 +554,19 @@ export var addBoldInEmptyHeaderCells = function addBoldInEmptyHeaderCells(tableC
|
|
|
554
554
|
}
|
|
555
555
|
return false;
|
|
556
556
|
};
|
|
557
|
+
};
|
|
558
|
+
export var updateWidthToWidest = function updateWidthToWidest(widthToWidest) {
|
|
559
|
+
return createCommand(function (state) {
|
|
560
|
+
var _getPluginState4 = getPluginState(state),
|
|
561
|
+
prevWidthToWidest = _getPluginState4.widthToWidest;
|
|
562
|
+
if (prevWidthToWidest === widthToWidest) {
|
|
563
|
+
return false;
|
|
564
|
+
}
|
|
565
|
+
return {
|
|
566
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST',
|
|
567
|
+
data: {
|
|
568
|
+
widthToWidest: widthToWidest
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
});
|
|
557
572
|
};
|
|
@@ -12,8 +12,10 @@ import { focusTableResizer, ToolTipContent } from '@atlaskit/editor-common/keyma
|
|
|
12
12
|
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
14
14
|
import { browser } from '@atlaskit/editor-common/utils';
|
|
15
|
+
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
15
16
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
16
17
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
18
|
+
import { updateWidthToWidest } from '../commands/misc';
|
|
17
19
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
18
20
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
19
21
|
import { COLUMN_MIN_WIDTH, getColgroupChildrenLength, previewScaleTable, scaleTable } from '../pm-plugins/table-resizing/utils';
|
|
@@ -180,6 +182,7 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
180
182
|
}
|
|
181
183
|
}, [startMeasure, editorView, displayGapCursor, isTableScalingEnabled, containerWidth, displayGuideline, onResizeStart]);
|
|
182
184
|
var handleResize = useCallback(function (originalState, delta) {
|
|
185
|
+
var _defaultGuidelinesFor;
|
|
183
186
|
countFrames();
|
|
184
187
|
var newWidth = originalState.width + delta.width;
|
|
185
188
|
var pos;
|
|
@@ -198,7 +201,17 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
198
201
|
parentWidth: newWidth
|
|
199
202
|
}, editorView.domAtPos.bind(editorView), isTableScalingEnabled);
|
|
200
203
|
updateActiveGuidelines(findClosestSnap(newWidth, isTableScalingEnabled ? defaultTablePreserveSnappingWidths(containerWidth) : defaultSnappingWidths, isTableScalingEnabled ? defaultGuidelinesForPreserveTable(containerWidth) : defaultGuidelines, TABLE_HIGHLIGHT_GAP, TABLE_HIGHLIGHT_TOLERANCE));
|
|
201
|
-
|
|
204
|
+
|
|
205
|
+
// when isTableScalingEnabled true
|
|
206
|
+
// and a table is resized to fit the widest guideline when view port width is between 1011 and 1800
|
|
207
|
+
// set the width of the table to 1800 pixels.
|
|
208
|
+
var state = editorView.state,
|
|
209
|
+
dispatch = editorView.dispatch;
|
|
210
|
+
var widestGuideLineWidthString = (_defaultGuidelinesFor = defaultGuidelinesForPreserveTable(containerWidth)[16].key) === null || _defaultGuidelinesFor === void 0 || (_defaultGuidelinesFor = _defaultGuidelinesFor.match(/[\d]*[.]{0,1}[\d]+/g)) === null || _defaultGuidelinesFor === void 0 ? void 0 : _defaultGuidelinesFor.join('');
|
|
211
|
+
var widestGuideLineWidth = parseInt(widestGuideLineWidthString || '', 10);
|
|
212
|
+
var shouldUpdateWidthToWidest = !!(isTableScalingEnabled && defaultGuidelinesForPreserveTable(containerWidth).length === 17 && widestGuideLineWidth - newWidth <= 1);
|
|
213
|
+
updateWidthToWidest(shouldUpdateWidthToWidest)(state, dispatch);
|
|
214
|
+
updateWidth(shouldUpdateWidthToWidest ? akEditorFullWidthLayoutWidth : newWidth);
|
|
202
215
|
return newWidth;
|
|
203
216
|
}, [countFrames, isTableScalingEnabled, tableRef, node, editorView, updateActiveGuidelines, containerWidth, updateWidth, getPos]);
|
|
204
217
|
var scheduleResize = useMemo(function () {
|
|
@@ -210,6 +223,9 @@ export var TableResizer = function TableResizer(_ref) {
|
|
|
210
223
|
var state = editorView.state,
|
|
211
224
|
dispatch = editorView.dispatch;
|
|
212
225
|
var pos = getPos();
|
|
226
|
+
var _getPluginState2 = getPluginState(editorView.state),
|
|
227
|
+
widthToWidest = _getPluginState2.widthToWidest;
|
|
228
|
+
newWidth = widthToWidest ? akEditorFullWidthLayoutWidth : newWidth;
|
|
213
229
|
var tr = state.tr.setMeta(tableWidthPluginKey, {
|
|
214
230
|
resizing: false
|
|
215
231
|
});
|
package/dist/esm/reducer.js
CHANGED
|
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
|
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
4
|
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, } from './misc';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, } from './misc';
|
|
6
6
|
export { sortByColumn } from './sort';
|
|
7
7
|
export { goToNextCell } from './go-to-next-cell';
|
|
8
8
|
export { removeDescendantNodes } from './referentiality';
|
|
@@ -33,3 +33,4 @@ export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTML
|
|
|
33
33
|
containerWidth: number;
|
|
34
34
|
}) => boolean;
|
|
35
35
|
export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
|
|
36
|
+
export declare const updateWidthToWidest: (widthToWidest: boolean) => Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
2
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
3
|
export { createPluginState, createCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnResizingPluginState } from '../../types';
|
|
2
2
|
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
4
4
|
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export interface TablePluginState {
|
|
|
83
83
|
isKeyboardResize?: boolean;
|
|
84
84
|
isTableCollapsed?: boolean;
|
|
85
85
|
canCollapseTable?: boolean;
|
|
86
|
+
widthToWidest?: boolean;
|
|
86
87
|
getIntl: () => IntlShape;
|
|
87
88
|
isBreakoutEnabled?: boolean;
|
|
88
89
|
wasFullWidthModeEnabled?: boolean;
|
|
@@ -168,6 +169,11 @@ export type TablePluginAction = {
|
|
|
168
169
|
resizeHandleColumnIndex: number | undefined;
|
|
169
170
|
resizeHandleIncludeTooltip: boolean | undefined;
|
|
170
171
|
};
|
|
172
|
+
} | {
|
|
173
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
|
|
174
|
+
data: {
|
|
175
|
+
widthToWidest: boolean | undefined;
|
|
176
|
+
};
|
|
171
177
|
} | {
|
|
172
178
|
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
173
179
|
data: {
|
|
@@ -21,7 +21,7 @@ type DragHandleProps = {
|
|
|
21
21
|
editorView: EditorView;
|
|
22
22
|
isDragMenuTarget: boolean;
|
|
23
23
|
};
|
|
24
|
-
export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps
|
|
25
|
-
WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps
|
|
24
|
+
export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps>> & {
|
|
25
|
+
WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
|
|
26
26
|
};
|
|
27
27
|
export {};
|
|
@@ -50,7 +50,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
50
50
|
private closeSubmenu;
|
|
51
51
|
private setColor;
|
|
52
52
|
}
|
|
53
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
54
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps
|
|
53
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
54
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
55
55
|
};
|
|
56
56
|
export default _default;
|
|
@@ -8,7 +8,7 @@ export interface ButtonProps {
|
|
|
8
8
|
onMouseEnter?: (event: SyntheticEvent) => void;
|
|
9
9
|
onMouseLeave?: (event: SyntheticEvent) => void;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
12
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
11
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
@@ -27,7 +27,7 @@ type DragMenuProps = {
|
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
28
|
};
|
|
29
29
|
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
30
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps
|
|
31
|
-
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps
|
|
30
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
31
|
+
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
32
32
|
};
|
|
33
33
|
export default _default;
|
|
@@ -9,10 +9,10 @@ export interface ButtonProps {
|
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
-
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
13
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
14
14
|
};
|
|
15
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
16
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
15
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -29,7 +29,7 @@ export declare class FloatingInsertButton extends React.Component<Props & Wrappe
|
|
|
29
29
|
private insertRow;
|
|
30
30
|
private insertColumn;
|
|
31
31
|
}
|
|
32
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
33
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
32
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
33
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
34
34
|
};
|
|
35
35
|
export default _default;
|
|
@@ -15,7 +15,7 @@ export interface Props {
|
|
|
15
15
|
stickyHeader?: RowStickyState;
|
|
16
16
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
17
17
|
}
|
|
18
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
19
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
18
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
19
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { CornerControlProps } from './types';
|
|
4
|
-
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps
|
|
5
|
-
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps
|
|
4
|
+
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { CornerControlProps } from './types';
|
|
4
|
-
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps
|
|
5
|
-
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps
|
|
4
|
+
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
|
|
6
6
|
};
|
|
@@ -12,6 +12,6 @@ export interface Props {
|
|
|
12
12
|
insertRowButtonIndex?: number;
|
|
13
13
|
stickyTop?: number;
|
|
14
14
|
}
|
|
15
|
-
export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
16
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
15
|
+
export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
17
17
|
};
|
|
@@ -18,7 +18,7 @@ type DragControlsProps = {
|
|
|
18
18
|
selectRows: (rowIndexes: number[]) => void;
|
|
19
19
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps
|
|
22
|
-
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps
|
|
21
|
+
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps>> & {
|
|
22
|
+
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps>;
|
|
23
23
|
};
|
|
24
24
|
export {};
|
|
@@ -2,7 +2,7 @@ export { hoverColumns, hoverRows, hoverTable, hoverCell, hoverMergedCells, clear
|
|
|
2
2
|
export { insertColumn, insertRow, createTable } from './insert';
|
|
3
3
|
export { getNextLayout, toggleContextualMenu, toggleHeaderColumn, toggleHeaderRow, toggleNumberColumn, toggleTableLayout, } from './toggle';
|
|
4
4
|
export { clearMultipleCells } from './clear';
|
|
5
|
-
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, } from './misc';
|
|
5
|
+
export { autoSizeTable, convertFirstRowToHeader, deleteTable, hideInsertColumnOrRowButton, moveCursorBackward, selectColumn, selectColumns, selectRow, selectRows, setCellAttr, setEditorFocus, setMultipleCellAttrs, setTableRef, showInsertColumnButton, showInsertRowButton, transformSliceToAddTableHeaders, triggerUnlessTableHeader, addBoldInEmptyHeaderCells, addResizeHandleDecorations, updateWidthToWidest, } from './misc';
|
|
6
6
|
export { sortByColumn } from './sort';
|
|
7
7
|
export { goToNextCell } from './go-to-next-cell';
|
|
8
8
|
export { removeDescendantNodes } from './referentiality';
|
|
@@ -33,3 +33,4 @@ export declare const autoSizeTable: (view: EditorView, node: PMNode, table: HTML
|
|
|
33
33
|
containerWidth: number;
|
|
34
34
|
}) => boolean;
|
|
35
35
|
export declare const addBoldInEmptyHeaderCells: (tableCellHeader: ContentNodeWithPos) => Command;
|
|
36
|
+
export declare const updateWidthToWidest: (widthToWidest: boolean) => Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").AnalyticPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState)) => import("prosemirror-state").SafeStateField<import("./types").AnalyticPluginState>, createCommand: <A = import("./actions").AnalyticPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").AnalyticPluginState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("./types").DragAndDropPluginState | ((state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState)) => import("prosemirror-state").SafeStateField<import("./types").DragAndDropPluginState>, createCommand: <A = import("./actions").DragAndDropPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("./types").DragAndDropPluginState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
1
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: import("../types").TablePluginState | ((state: import("prosemirror-state").EditorState) => import("../types").TablePluginState)) => import("prosemirror-state").SafeStateField<import("../types").TablePluginState>, createCommand: <A = import("../types").TablePluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("../types").TablePluginState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StickyPluginAction, StickyPluginState } from './types';
|
|
2
|
-
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
2
|
+
declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: StickyPluginState | ((state: import("prosemirror-state").EditorState) => StickyPluginState)) => import("prosemirror-state").SafeStateField<StickyPluginState>, createCommand: <A = StickyPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
3
|
export { createPluginState, createCommand };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ColumnResizingPluginState } from '../../types';
|
|
2
2
|
export declare const createCommand: <A = import("../../types").ColumnResizingPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch
|
|
3
|
+
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch, initialState: ColumnResizingPluginState | ((state: import("prosemirror-state").EditorState) => ColumnResizingPluginState)) => import("prosemirror-state").SafeStateField<ColumnResizingPluginState>;
|
|
4
4
|
export declare const getPluginState: (state: import("prosemirror-state").EditorState) => ColumnResizingPluginState;
|
|
@@ -83,6 +83,7 @@ export interface TablePluginState {
|
|
|
83
83
|
isKeyboardResize?: boolean;
|
|
84
84
|
isTableCollapsed?: boolean;
|
|
85
85
|
canCollapseTable?: boolean;
|
|
86
|
+
widthToWidest?: boolean;
|
|
86
87
|
getIntl: () => IntlShape;
|
|
87
88
|
isBreakoutEnabled?: boolean;
|
|
88
89
|
wasFullWidthModeEnabled?: boolean;
|
|
@@ -168,6 +169,11 @@ export type TablePluginAction = {
|
|
|
168
169
|
resizeHandleColumnIndex: number | undefined;
|
|
169
170
|
resizeHandleIncludeTooltip: boolean | undefined;
|
|
170
171
|
};
|
|
172
|
+
} | {
|
|
173
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
|
|
174
|
+
data: {
|
|
175
|
+
widthToWidest: boolean | undefined;
|
|
176
|
+
};
|
|
171
177
|
} | {
|
|
172
178
|
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
173
179
|
data: {
|
|
@@ -21,7 +21,7 @@ type DragHandleProps = {
|
|
|
21
21
|
editorView: EditorView;
|
|
22
22
|
isDragMenuTarget: boolean;
|
|
23
23
|
};
|
|
24
|
-
export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps
|
|
25
|
-
WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps
|
|
24
|
+
export declare const DragHandle: React.FC<import("react-intl-next").WithIntlProps<DragHandleProps & WrappedComponentProps>> & {
|
|
25
|
+
WrappedComponent: React.ComponentType<DragHandleProps & WrappedComponentProps>;
|
|
26
26
|
};
|
|
27
27
|
export {};
|
|
@@ -50,7 +50,7 @@ export declare class ContextualMenu extends Component<Props & WrappedComponentPr
|
|
|
50
50
|
private closeSubmenu;
|
|
51
51
|
private setColor;
|
|
52
52
|
}
|
|
53
|
-
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
54
|
-
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps
|
|
53
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
54
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
55
55
|
};
|
|
56
56
|
export default _default;
|
|
@@ -8,7 +8,7 @@ export interface ButtonProps {
|
|
|
8
8
|
onMouseEnter?: (event: SyntheticEvent) => void;
|
|
9
9
|
onMouseLeave?: (event: SyntheticEvent) => void;
|
|
10
10
|
}
|
|
11
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
12
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
11
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
13
13
|
};
|
|
14
14
|
export default _default;
|
|
@@ -27,7 +27,7 @@ type DragMenuProps = {
|
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
28
|
};
|
|
29
29
|
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
30
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps
|
|
31
|
-
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps
|
|
30
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
31
|
+
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
32
32
|
};
|
|
33
33
|
export default _default;
|
|
@@ -9,10 +9,10 @@ export interface ButtonProps {
|
|
|
9
9
|
hasStickyHeaders: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const InsertButtonForDragAndDrop: ({ onMouseDown, tableRef, type, intl: { formatMessage }, hasStickyHeaders, }: ButtonProps & WrappedComponentProps) => JSX.Element;
|
|
12
|
-
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
13
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
12
|
+
export declare const DragAndDropInsertButton: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
13
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
14
14
|
};
|
|
15
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps
|
|
16
|
-
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps
|
|
15
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ButtonProps & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: React.ComponentType<ButtonProps & WrappedComponentProps>;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -29,7 +29,7 @@ export declare class FloatingInsertButton extends React.Component<Props & Wrappe
|
|
|
29
29
|
private insertRow;
|
|
30
30
|
private insertColumn;
|
|
31
31
|
}
|
|
32
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
33
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
32
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
33
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
34
34
|
};
|
|
35
35
|
export default _default;
|
|
@@ -15,7 +15,7 @@ export interface Props {
|
|
|
15
15
|
stickyHeader?: RowStickyState;
|
|
16
16
|
editorAnalyticsAPI?: EditorAnalyticsAPI;
|
|
17
17
|
}
|
|
18
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
19
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
18
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
19
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { CornerControlProps } from './types';
|
|
4
|
-
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps
|
|
5
|
-
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps
|
|
4
|
+
export declare const CornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { CornerControlProps } from './types';
|
|
4
|
-
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps
|
|
5
|
-
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps
|
|
4
|
+
export declare const DragCornerControls: React.FC<import("react-intl-next").WithIntlProps<CornerControlProps & WrappedComponentProps>> & {
|
|
5
|
+
WrappedComponent: React.ComponentType<CornerControlProps & WrappedComponentProps>;
|
|
6
6
|
};
|
|
@@ -12,6 +12,6 @@ export interface Props {
|
|
|
12
12
|
insertRowButtonIndex?: number;
|
|
13
13
|
stickyTop?: number;
|
|
14
14
|
}
|
|
15
|
-
export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps
|
|
16
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps
|
|
15
|
+
export declare const RowControls: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
17
17
|
};
|
|
@@ -18,7 +18,7 @@ type DragControlsProps = {
|
|
|
18
18
|
selectRows: (rowIndexes: number[]) => void;
|
|
19
19
|
updateCellHoverLocation: (rowIndex: number) => void;
|
|
20
20
|
};
|
|
21
|
-
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps
|
|
22
|
-
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps
|
|
21
|
+
export declare const DragControls: React.FC<import("react-intl-next").WithIntlProps<DragControlsProps & WrappedComponentProps>> & {
|
|
22
|
+
WrappedComponent: React.ComponentType<DragControlsProps & WrappedComponentProps>;
|
|
23
23
|
};
|
|
24
24
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-table",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.13",
|
|
4
4
|
"description": "Table plugin for the @atlaskit/editor",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^35.6.0",
|
|
32
32
|
"@atlaskit/custom-steps": "^0.0.15",
|
|
33
|
-
"@atlaskit/editor-common": "^78.
|
|
34
|
-
"@atlaskit/editor-palette": "1.5.
|
|
33
|
+
"@atlaskit/editor-common": "^78.17.0",
|
|
34
|
+
"@atlaskit/editor-palette": "1.5.3",
|
|
35
35
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-content-insertion": "^1.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-guideline": "^1.0.0",
|
|
@@ -46,10 +46,10 @@
|
|
|
46
46
|
"@atlaskit/pragmatic-drag-and-drop": "^1.0.0",
|
|
47
47
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^1.0.0",
|
|
48
48
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.0",
|
|
49
|
-
"@atlaskit/primitives": "^5.
|
|
49
|
+
"@atlaskit/primitives": "^5.1.0",
|
|
50
50
|
"@atlaskit/theme": "^12.6.0",
|
|
51
51
|
"@atlaskit/toggle": "^13.0.0",
|
|
52
|
-
"@atlaskit/tokens": "^1.
|
|
52
|
+
"@atlaskit/tokens": "^1.42.0",
|
|
53
53
|
"@atlaskit/tooltip": "^18.1.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
68
|
-
"typescript": "~4.
|
|
68
|
+
"typescript": "~5.4.2"
|
|
69
69
|
},
|
|
70
70
|
"af:exports": {
|
|
71
71
|
"./types": "./src/types.ts",
|
|
@@ -150,4 +150,4 @@
|
|
|
150
150
|
"type": "boolean"
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
}
|
|
153
|
+
}
|
package/plugin-key/package.json
CHANGED
package/src/commands/index.ts
CHANGED
package/src/commands/misc.ts
CHANGED
|
@@ -778,3 +778,19 @@ export const addBoldInEmptyHeaderCells =
|
|
|
778
778
|
|
|
779
779
|
return false;
|
|
780
780
|
};
|
|
781
|
+
|
|
782
|
+
export const updateWidthToWidest = (widthToWidest: boolean) =>
|
|
783
|
+
createCommand((state) => {
|
|
784
|
+
let { widthToWidest: prevWidthToWidest } = getPluginState(state);
|
|
785
|
+
|
|
786
|
+
if (prevWidthToWidest === widthToWidest) {
|
|
787
|
+
return false;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
return {
|
|
791
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST',
|
|
792
|
+
data: {
|
|
793
|
+
widthToWidest,
|
|
794
|
+
},
|
|
795
|
+
};
|
|
796
|
+
});
|
|
@@ -27,10 +27,12 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
27
27
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
28
28
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
29
29
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
30
|
+
import { akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
30
31
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
31
32
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
33
|
import { token } from '@atlaskit/tokens';
|
|
33
34
|
|
|
35
|
+
import { updateWidthToWidest } from '../commands/misc';
|
|
34
36
|
import { getPluginState } from '../pm-plugins/plugin-factory';
|
|
35
37
|
import { META_KEYS } from '../pm-plugins/table-analytics';
|
|
36
38
|
import {
|
|
@@ -341,7 +343,30 @@ export const TableResizer = ({
|
|
|
341
343
|
TABLE_HIGHLIGHT_TOLERANCE,
|
|
342
344
|
),
|
|
343
345
|
);
|
|
344
|
-
|
|
346
|
+
|
|
347
|
+
// when isTableScalingEnabled true
|
|
348
|
+
// and a table is resized to fit the widest guideline when view port width is between 1011 and 1800
|
|
349
|
+
// set the width of the table to 1800 pixels.
|
|
350
|
+
const { state, dispatch } = editorView;
|
|
351
|
+
const widestGuideLineWidthString = defaultGuidelinesForPreserveTable(
|
|
352
|
+
containerWidth,
|
|
353
|
+
)[16]
|
|
354
|
+
.key?.match(/[\d]*[.]{0,1}[\d]+/g)
|
|
355
|
+
?.join('');
|
|
356
|
+
const widestGuideLineWidth = parseInt(
|
|
357
|
+
widestGuideLineWidthString || '',
|
|
358
|
+
10,
|
|
359
|
+
);
|
|
360
|
+
const shouldUpdateWidthToWidest = !!(
|
|
361
|
+
isTableScalingEnabled &&
|
|
362
|
+
defaultGuidelinesForPreserveTable(containerWidth).length === 17 &&
|
|
363
|
+
widestGuideLineWidth - newWidth <= 1
|
|
364
|
+
);
|
|
365
|
+
updateWidthToWidest(shouldUpdateWidthToWidest)(state, dispatch);
|
|
366
|
+
|
|
367
|
+
updateWidth(
|
|
368
|
+
shouldUpdateWidthToWidest ? akEditorFullWidthLayoutWidth : newWidth,
|
|
369
|
+
);
|
|
345
370
|
|
|
346
371
|
return newWidth;
|
|
347
372
|
},
|
|
@@ -363,9 +388,11 @@ export const TableResizer = ({
|
|
|
363
388
|
const handleResizeStop = useCallback<HandleResize>(
|
|
364
389
|
(originalState, delta) => {
|
|
365
390
|
isResizing.current = false;
|
|
366
|
-
|
|
391
|
+
let newWidth = originalState.width + delta.width;
|
|
367
392
|
const { state, dispatch } = editorView;
|
|
368
393
|
const pos = getPos();
|
|
394
|
+
const { widthToWidest } = getPluginState(editorView.state);
|
|
395
|
+
newWidth = widthToWidest ? akEditorFullWidthLayoutWidth : newWidth;
|
|
369
396
|
|
|
370
397
|
let tr = state.tr.setMeta(tableWidthPluginKey, { resizing: false });
|
|
371
398
|
const frameRateSamples = endMeasure();
|
package/src/reducer.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -130,6 +130,7 @@ export interface TablePluginState {
|
|
|
130
130
|
// for table wrap/collapse
|
|
131
131
|
isTableCollapsed?: boolean; // is the current table already in an expand?
|
|
132
132
|
canCollapseTable?: boolean; // enabled/disabled state of collapse option
|
|
133
|
+
widthToWidest?: boolean; // is the current table set to the widest width regarding view port
|
|
133
134
|
|
|
134
135
|
getIntl: () => IntlShape;
|
|
135
136
|
|
|
@@ -217,6 +218,12 @@ export type TablePluginAction =
|
|
|
217
218
|
resizeHandleIncludeTooltip: boolean | undefined;
|
|
218
219
|
};
|
|
219
220
|
}
|
|
221
|
+
| {
|
|
222
|
+
type: 'UPDATE_TABLE_WIDTH_TO_WIDEST';
|
|
223
|
+
data: {
|
|
224
|
+
widthToWidest: boolean | undefined;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
220
227
|
| {
|
|
221
228
|
type: 'REMOVE_RESIZE_HANDLE_DECORATIONS';
|
|
222
229
|
data: { decorationSet: DecorationSet };
|
package/types/package.json
CHANGED