@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/dist/esm/toolbar.js
CHANGED
|
@@ -9,6 +9,7 @@ import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
|
9
9
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { addColumnAfter, addRowAfter, backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import commonMessages, { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
+
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
12
13
|
import { cellBackgroundColorPalette, DEFAULT_BORDER_COLOR } from '@atlaskit/editor-common/ui-color';
|
|
13
14
|
import { closestElement, getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
14
15
|
import { findParentDomRefOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
@@ -108,6 +109,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
108
109
|
var _pluginState$pluginCo, _pluginState$pluginCo2;
|
|
109
110
|
var formatMessage = _ref2.formatMessage;
|
|
110
111
|
var isTableScalingEnabled = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
112
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
111
113
|
var top = initialSelectionRect.top,
|
|
112
114
|
bottom = initialSelectionRect.bottom,
|
|
113
115
|
right = initialSelectionRect.right,
|
|
@@ -122,7 +124,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
122
124
|
var selectionRect = getClosestSelectionRect(state);
|
|
123
125
|
var index = selectionRect === null || selectionRect === void 0 ? void 0 : selectionRect.right;
|
|
124
126
|
if (index) {
|
|
125
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
|
|
127
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, index)(state, dispatch, view);
|
|
126
128
|
}
|
|
127
129
|
return true;
|
|
128
130
|
},
|
|
@@ -158,7 +160,7 @@ export var getToolbarCellOptionsConfig = function getToolbarCellOptionsConfig(ed
|
|
|
158
160
|
onClick: function onClick(state, dispatch, view) {
|
|
159
161
|
var selectionRect = getClosestSelectionRect(state);
|
|
160
162
|
if (selectionRect) {
|
|
161
|
-
deleteColumnsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
|
|
163
|
+
deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.FLOATING_TB, selectionRect)(state, dispatch, view);
|
|
162
164
|
}
|
|
163
165
|
return true;
|
|
164
166
|
},
|
|
@@ -309,6 +311,7 @@ export var getClosestSelectionOrTableRect = function getClosestSelectionOrTableR
|
|
|
309
311
|
return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
|
|
310
312
|
};
|
|
311
313
|
export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options) {
|
|
314
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
312
315
|
return function (config) {
|
|
313
316
|
return function (state, intl) {
|
|
314
317
|
var tableObject = findTable(state.selection);
|
|
@@ -325,7 +328,7 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
325
328
|
var isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
|
|
326
329
|
alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth) : [];
|
|
327
330
|
var cellItems;
|
|
328
|
-
cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled);
|
|
331
|
+
cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
329
332
|
var columnSettingsItems;
|
|
330
333
|
columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, getEditorView(), intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) : [];
|
|
331
334
|
var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView);
|
|
@@ -428,11 +431,12 @@ var separator = function separator(hidden) {
|
|
|
428
431
|
var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerWidth, editorAnalyticsAPI) {
|
|
429
432
|
var formatMessage = _ref3.formatMessage;
|
|
430
433
|
var isTableScalingEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
434
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
431
435
|
var initialSelectionRect = getClosestSelectionRect(state);
|
|
432
436
|
if (initialSelectionRect) {
|
|
433
437
|
var cellOptions = getToolbarCellOptionsConfig(state, view, initialSelectionRect, {
|
|
434
438
|
formatMessage: formatMessage
|
|
435
|
-
}, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled);
|
|
439
|
+
}, getEditorContainerWidth, editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
436
440
|
return [cellOptions, separator(cellOptions.hidden)];
|
|
437
441
|
}
|
|
438
442
|
return [];
|
|
@@ -652,7 +656,8 @@ export var getSelectedAlignmentIcon = function getSelectedAlignmentIcon(alignmen
|
|
|
652
656
|
};
|
|
653
657
|
export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth) {
|
|
654
658
|
var lineLength = getEditorContainerWidth().lineLength;
|
|
655
|
-
|
|
659
|
+
var tableWidth = getTableContainerWidth(selectedNode);
|
|
660
|
+
if (selectedNode && lineLength && tableWidth > lineLength) {
|
|
656
661
|
return true;
|
|
657
662
|
}
|
|
658
663
|
return false;
|
|
@@ -92,6 +92,7 @@ export var updateColumnWidths = function updateColumnWidths(resizeState, table,
|
|
|
92
92
|
*/
|
|
93
93
|
export var rescaleColumns = function rescaleColumns() {
|
|
94
94
|
var isTableScalingEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
95
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
95
96
|
return function (table, view) {
|
|
96
97
|
return function (tr) {
|
|
97
98
|
if (!view) {
|
|
@@ -177,7 +178,8 @@ export var rescaleColumns = function rescaleColumns() {
|
|
|
177
178
|
tableRef: tableRef,
|
|
178
179
|
domAtPos: domAtPos,
|
|
179
180
|
maxSize: previousTableInfo.possibleMaxWidth,
|
|
180
|
-
isTableScalingEnabled: shouldScale
|
|
181
|
+
isTableScalingEnabled: shouldScale,
|
|
182
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
181
183
|
});
|
|
182
184
|
|
|
183
185
|
// Two scenarios that require scaling:
|
|
@@ -206,6 +206,7 @@ function fixRowSpans(table) {
|
|
|
206
206
|
}
|
|
207
207
|
export var deleteColumns = function deleteColumns(rect, allowCustomStep, view) {
|
|
208
208
|
var isTableScalingEnabled = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
209
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
209
210
|
return function (tr) {
|
|
210
211
|
var updatedTr = tr;
|
|
211
212
|
updatedTr.setMeta(META_KEYS.OVERFLOW_TRIGGER, {
|
|
@@ -218,7 +219,7 @@ export var deleteColumns = function deleteColumns(rect, allowCustomStep, view) {
|
|
|
218
219
|
}
|
|
219
220
|
var table = findTable(updatedTr.selection);
|
|
220
221
|
if (table) {
|
|
221
|
-
updatedTr = rescaleColumns(isTableScalingEnabled)(table, view)(updatedTr);
|
|
222
|
+
updatedTr = rescaleColumns(isTableScalingEnabled, shouldUseIncreasedScalingPercent)(table, view)(updatedTr);
|
|
222
223
|
}
|
|
223
224
|
return updatedTr;
|
|
224
225
|
};
|
|
@@ -29,6 +29,7 @@ import { splitCell } from '@atlaskit/editor-tables/utils';
|
|
|
29
29
|
import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
|
|
30
30
|
import EditorBackgroundColorIcon from '@atlaskit/icon/glyph/editor/background-color';
|
|
31
31
|
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
32
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
32
33
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, toggleContextualMenu } from '../../commands';
|
|
33
34
|
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics } from '../../commands-with-analytics';
|
|
34
35
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
@@ -382,6 +383,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
382
383
|
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
383
384
|
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
384
385
|
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC;
|
|
386
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
385
387
|
switch (item.value.name) {
|
|
386
388
|
case 'sort_column_desc':
|
|
387
389
|
sortColumnWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect.left, SortOrder.DESC)(state, dispatch);
|
|
@@ -411,7 +413,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
411
413
|
_this.toggleOpen();
|
|
412
414
|
break;
|
|
413
415
|
case 'insert_column':
|
|
414
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
|
|
416
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect.right)(state, dispatch, editorView);
|
|
415
417
|
_this.toggleOpen();
|
|
416
418
|
break;
|
|
417
419
|
case 'insert_row':
|
|
@@ -422,7 +424,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
|
|
|
422
424
|
_this.toggleOpen();
|
|
423
425
|
break;
|
|
424
426
|
case 'delete_column':
|
|
425
|
-
deleteColumnsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
|
|
427
|
+
deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.CONTEXT_MENU, selectionRect)(state, dispatch, editorView);
|
|
426
428
|
_this.toggleOpen();
|
|
427
429
|
break;
|
|
428
430
|
case 'delete_row':
|
|
@@ -181,7 +181,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
181
181
|
scrollableElement = _ref.scrollableElement,
|
|
182
182
|
boundariesElement = _ref.boundariesElement,
|
|
183
183
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
184
|
-
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring
|
|
184
|
+
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
|
|
185
|
+
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent;
|
|
185
186
|
var state = editorView.state,
|
|
186
187
|
dispatch = editorView.dispatch;
|
|
187
188
|
var selection = state.selection;
|
|
@@ -205,7 +206,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
205
206
|
hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
|
|
206
207
|
}
|
|
207
208
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
208
|
-
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring);
|
|
209
|
+
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent);
|
|
209
210
|
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
210
211
|
menuItems = _convertToDropdownIte.menuItems,
|
|
211
212
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
3
3
|
import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
|
|
6
7
|
import DragMenu from './DragMenu';
|
|
7
8
|
var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
@@ -32,6 +33,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
32
33
|
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
33
34
|
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
34
35
|
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC;
|
|
36
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
35
37
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
36
38
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
37
39
|
alignY: direction === 'row' ? 'start' : undefined,
|
|
@@ -66,7 +68,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
66
68
|
boundariesElement: boundariesElement,
|
|
67
69
|
scrollableElement: scrollableElement,
|
|
68
70
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
69
|
-
tableDuplicateCellColouring: tableDuplicateCellColouring
|
|
71
|
+
tableDuplicateCellColouring: tableDuplicateCellColouring,
|
|
72
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
70
73
|
}));
|
|
71
74
|
};
|
|
72
75
|
FloatingDragMenu.displayName = 'FloatingDragMenu';
|
|
@@ -18,6 +18,7 @@ import { akEditorTableCellOnStickyHeaderZIndex } from '@atlaskit/editor-shared-s
|
|
|
18
18
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
19
19
|
import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
20
20
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
21
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
21
22
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
|
|
22
23
|
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
23
24
|
import { TableCssClassName as ClassName } from '../../types';
|
|
@@ -195,12 +196,13 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
195
196
|
var _getPluginState = getPluginState(editorView.state),
|
|
196
197
|
_getPluginState$isTab = _getPluginState.isTableScalingEnabled,
|
|
197
198
|
isTableScalingEnabled = _getPluginState$isTab === void 0 ? false : _getPluginState$isTab;
|
|
199
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button') && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
198
200
|
var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
199
201
|
_ref$tableDuplicateCe = _ref.tableDuplicateCellColouring,
|
|
200
202
|
tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe;
|
|
201
203
|
var state = editorView.state,
|
|
202
204
|
dispatch = editorView.dispatch;
|
|
203
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
205
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
204
206
|
}
|
|
205
207
|
}
|
|
206
208
|
}]);
|
|
@@ -72,6 +72,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
72
72
|
var _tableMap$height, _tableMap$height2, _tableMap$width, _tableMap$width2;
|
|
73
73
|
var isTableScalingEnabled = arguments.length > 11 && arguments[11] !== undefined ? arguments[11] : false;
|
|
74
74
|
var tableDuplicateCellColouring = arguments.length > 12 && arguments[12] !== undefined ? arguments[12] : false;
|
|
75
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
75
76
|
var addOptions = direction === 'row' ? [{
|
|
76
77
|
label: 'above',
|
|
77
78
|
offset: 0,
|
|
@@ -156,7 +157,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
156
157
|
moveCursorToInsertedRow: true
|
|
157
158
|
})(state, dispatch);
|
|
158
159
|
} else {
|
|
159
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
|
|
160
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
|
|
160
161
|
}
|
|
161
162
|
return true;
|
|
162
163
|
},
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
@@ -3,10 +3,10 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
-
export declare const addColumnBefore: (isTableScalingEnabled?: boolean) => Command;
|
|
8
|
-
export declare const addColumnAfter: (isTableScalingEnabled?: boolean) => Command;
|
|
9
|
-
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean) => (column: number) => Command;
|
|
6
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
8
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
10
10
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
11
11
|
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
12
|
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -15,10 +15,10 @@ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalytics
|
|
|
15
15
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
16
16
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
17
17
|
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
18
|
-
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
18
|
+
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
19
19
|
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
20
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
21
|
-
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
20
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
21
|
+
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
22
22
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
23
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
24
24
|
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -12,7 +12,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
|
|
|
12
12
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
13
|
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
14
14
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
16
16
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
17
17
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
18
|
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -29,8 +29,9 @@ type ResizableTableContainerProps = {
|
|
|
29
29
|
isWholeTableInDanger?: boolean;
|
|
30
30
|
isTableScalingEnabled?: boolean;
|
|
31
31
|
isTableAlignmentEnabled?: boolean;
|
|
32
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
32
33
|
};
|
|
33
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
34
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
34
35
|
type TableContainerProps = {
|
|
35
36
|
node: PMNode;
|
|
36
37
|
className: string;
|
|
@@ -46,6 +47,7 @@ type TableContainerProps = {
|
|
|
46
47
|
isTableResizingEnabled: boolean | undefined;
|
|
47
48
|
isTableScalingEnabled?: boolean;
|
|
48
49
|
isTableAlignmentEnabled?: boolean;
|
|
50
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
49
51
|
};
|
|
50
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
52
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
51
53
|
export {};
|
|
@@ -23,10 +23,11 @@ interface TableResizerProps {
|
|
|
23
23
|
isTableAlignmentEnabled?: boolean;
|
|
24
24
|
isWholeTableInDanger?: boolean;
|
|
25
25
|
isFullWidthModeEnabled?: boolean;
|
|
26
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
28
29
|
onResizeStop?: () => void;
|
|
29
30
|
onResizeStart?: () => void;
|
|
30
31
|
}
|
|
31
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
32
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
32
33
|
export {};
|
|
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -6,4 +6,4 @@ import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-pro
|
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
9
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
9
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
@@ -9,8 +9,8 @@ type Col = Array<string | {
|
|
|
9
9
|
* overflow.
|
|
10
10
|
*/
|
|
11
11
|
export declare const getColWidthFix: (colwidth: number, tableColumnCount: number) => number;
|
|
12
|
-
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement) => Col[];
|
|
13
|
-
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean) => HTMLCollection;
|
|
12
|
+
export declare const generateColgroup: (table: PmNode, tableRef?: HTMLElement, shouldUseIncreasedScalingPercent?: boolean) => Col[];
|
|
13
|
+
export declare const insertColgroupFromNode: (tableRef: HTMLTableElement | null, table: PmNode, isTableScalingEnabled?: boolean, shouldRemove?: boolean, shouldUseIncreasedScalingPercent?: boolean) => HTMLCollection;
|
|
14
14
|
export declare const hasTableBeenResized: (table: PmNode) => boolean;
|
|
15
15
|
/**
|
|
16
16
|
* Check if a table has all the column width set to tableCellMinWidth(48px) or null
|
|
@@ -2,4 +2,5 @@ export declare const COLUMN_MIN_WIDTH = 48;
|
|
|
2
2
|
export declare const TABLE_DEFAULT_WIDTH = 760;
|
|
3
3
|
export declare const TABLE_MAX_WIDTH = 1800;
|
|
4
4
|
export declare const MAX_SCALING_PERCENT = 0.3;
|
|
5
|
+
export declare const MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION = 0.4;
|
|
5
6
|
export declare const TABLE_EDITOR_MARGIN = 76;
|
|
@@ -10,4 +10,4 @@ export { scale, scaleWithParent, scaleTable, previewScaleTable } from './scale-t
|
|
|
10
10
|
export type { ScaleOptions } from './scale-table';
|
|
11
11
|
export type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
12
12
|
export { resizeColumn, resizeColumnAndTable } from './resize-column';
|
|
13
|
-
export { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_DEFAULT_WIDTH, MAX_SCALING_PERCENT, } from './consts';
|
|
13
|
+
export { COLUMN_MIN_WIDTH, TABLE_MAX_WIDTH, TABLE_DEFAULT_WIDTH, MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION, } from './consts';
|
|
@@ -24,6 +24,6 @@ export declare const getTableMaxWidth: ({ table, tableStart, state, layout, getE
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const getTableElementWidth: (table: PMNode) => number;
|
|
26
26
|
export declare const getTableContainerElementWidth: (table: PMNode) => number;
|
|
27
|
-
export declare const getTableScalingPercent: (table: PMNode, tableRef: HTMLElement | null) => number;
|
|
28
|
-
export declare const getStaticTableScalingPercent: (table: PMNode, tableRenderWidth: number) => number;
|
|
27
|
+
export declare const getTableScalingPercent: (table: PMNode, tableRef: HTMLElement | null, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
28
|
+
export declare const getStaticTableScalingPercent: (table: PMNode, tableRenderWidth: number, shouldUseIncreasedScalingPercent?: boolean) => number;
|
|
29
29
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import type { ResizeState } from './types';
|
|
3
|
-
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement | null, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean) => ResizeState;
|
|
4
|
-
export declare const resizeColumnAndTable: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean, originalTableWidth?: number) => ResizeState;
|
|
3
|
+
export declare const resizeColumn: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement | null, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
|
|
4
|
+
export declare const resizeColumnAndTable: (resizeState: ResizeState, colIndex: number, amount: number, tableRef: HTMLElement, tableNode: PmNode, selectedColumns?: number[], isTableScalingEnabled?: boolean, originalTableWidth?: number, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
|
|
@@ -3,7 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
4
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
5
5
|
import type { ResizeState, ResizeStateWithAnalytics } from './types';
|
|
6
|
-
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, }: {
|
|
6
|
+
export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, start, domAtPos, isTableScalingEnabled, shouldUseIncreasedScalingPercent, }: {
|
|
7
7
|
minWidth: number;
|
|
8
8
|
maxSize: number;
|
|
9
9
|
table: PMNode;
|
|
@@ -14,8 +14,9 @@ export declare const getResizeState: ({ minWidth, maxSize, table, tableRef, star
|
|
|
14
14
|
offset: number;
|
|
15
15
|
};
|
|
16
16
|
isTableScalingEnabled: boolean;
|
|
17
|
+
shouldUseIncreasedScalingPercent: boolean;
|
|
17
18
|
}) => ResizeState;
|
|
18
|
-
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement | null, tableNode?: PMNode, isTableScalingEnabled?: boolean) => void;
|
|
19
|
+
export declare const updateColgroup: (state: ResizeState, tableRef: HTMLElement | null, tableNode?: PMNode, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => void;
|
|
19
20
|
export declare const getTotalWidth: ({ cols }: ResizeState) => number;
|
|
20
21
|
export declare const adjustColumnsWidths: (resizeState: ResizeState, maxSize: number) => ResizeState;
|
|
21
22
|
export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeState;
|
|
@@ -13,8 +13,8 @@ export interface ScaleOptions {
|
|
|
13
13
|
isFullWidthModeEnabled?: boolean;
|
|
14
14
|
isTableResizingEnabled?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean) => ResizeState | undefined;
|
|
17
|
-
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean) => ResizeState;
|
|
16
|
+
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
|
|
17
|
+
export declare const scaleWithParent: (tableRef: HTMLTableElement, parentWidth: number, table: PMNode, start: number, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState;
|
|
18
18
|
export declare function scaleTableTo(state: ResizeState, maxSize: number): ResizeState;
|
|
19
19
|
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => void;
|
|
20
|
-
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean) => (tr: Transaction) => Transaction;
|
|
20
|
+
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ import { Rect } from '@atlaskit/editor-tables/table-map';
|
|
|
8
8
|
import type { TablePluginOptions } from './plugin';
|
|
9
9
|
import type { AlignmentOptions, PluginConfig, ToolbarMenuConfig, ToolbarMenuContext, ToolbarMenuState } from './types';
|
|
10
10
|
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
11
|
-
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => FloatingToolbarDropdown<Command>;
|
|
11
|
+
export declare const getToolbarCellOptionsConfig: (editorState: EditorState, editorView: EditorView | undefined | null, initialSelectionRect: Rect, { formatMessage }: ToolbarMenuContext, getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => FloatingToolbarDropdown<Command>;
|
|
12
12
|
export declare const getClosestSelectionRect: (state: EditorState) => Rect | undefined;
|
|
13
13
|
export declare const getClosestSelectionOrTableRect: (state: EditorState) => Rect | undefined;
|
|
14
|
-
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
15
|
export declare const getLockBtnConfig: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
16
16
|
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
17
17
|
type AlignmentIcon = {
|
|
@@ -21,4 +21,4 @@ export declare const updateColumnWidths: (resizeState: ResizeState, table: PMNod
|
|
|
21
21
|
* @param view
|
|
22
22
|
* @returns Updated transaction with rescaled columns for a given table
|
|
23
23
|
*/
|
|
24
|
-
export declare const rescaleColumns: (isTableScalingEnabled?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
24
|
+
export declare const rescaleColumns: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
2
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
3
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
4
|
-
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean) => (tr: Transaction) => Transaction;
|
|
4
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -26,8 +26,9 @@ type DragMenuProps = {
|
|
|
26
26
|
scrollableElement?: HTMLElement;
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
28
|
tableDuplicateCellColouring?: boolean;
|
|
29
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
29
30
|
};
|
|
30
|
-
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
31
|
+
export declare const DragMenu: React.MemoExoticComponent<({ direction, index, target, isOpen, editorView, tableNode, targetCellPosition, getEditorContainerWidth, editorAnalyticsAPI, pluginConfig, intl: { formatMessage }, fitHeight, fitWidth, mountPoint, scrollableElement, boundariesElement, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
31
32
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
32
33
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
33
34
|
};
|
|
@@ -13,4 +13,4 @@ export interface DragMenuConfig extends DropdownOptionT<Command> {
|
|
|
13
13
|
icon?: React.ComponentType<React.PropsWithChildren<IconProps>>;
|
|
14
14
|
keymap?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean) => DragMenuConfig[];
|
|
16
|
+
export declare const getDragMenuConfig: (direction: TableDirection, getEditorContainerWidth: GetEditorContainerWidth, canDrag: boolean, hasMergedCellsInTable: boolean, editorView: EditorView, tableMap?: TableMap, index?: number, targetCellPosition?: number, selectionRect?: Rect, editorAnalyticsAPI?: EditorAnalyticsAPI, isHeaderRowRequired?: boolean, isTableScalingEnabled?: boolean, tableDuplicateCellColouring?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { Rect } from '@atlaskit/editor-tables/table-map';
|
|
3
|
-
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean) => Command;
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
@@ -3,10 +3,10 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { Command, EditorCommand } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
-
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
-
export declare const addColumnBefore: (isTableScalingEnabled?: boolean) => Command;
|
|
8
|
-
export declare const addColumnAfter: (isTableScalingEnabled?: boolean) => Command;
|
|
9
|
-
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean) => (column: number) => Command;
|
|
6
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
8
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (column: number) => Command;
|
|
10
10
|
export declare const insertRow: (row: number, moveCursorToTheNewRow: boolean, isCellBackgroundDuplicated?: boolean) => Command;
|
|
11
11
|
export declare const createTable: (isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthModeEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI | undefined | null) => Command;
|
|
12
12
|
export declare const insertTableWithSize: (isFullWidthModeEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI) => (rowsCount: number, colsCount: number, inputMethod?: INPUT_METHOD.PICKER) => EditorCommand;
|
|
@@ -15,10 +15,10 @@ export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalytics
|
|
|
15
15
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
16
16
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
17
17
|
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
18
|
-
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
18
|
+
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, position: number) => Command;
|
|
19
19
|
export declare const deleteRowsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect, isHeaderRowRequired: boolean) => Command;
|
|
20
|
-
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
21
|
-
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
20
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.BUTTON | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.SHORTCUT | INPUT_METHOD.TABLE_CONTEXT_MENU, rect: Rect) => Command;
|
|
21
|
+
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
22
22
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
23
23
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
24
24
|
export declare const toggleHeaderRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
@@ -12,7 +12,7 @@ export declare const handleMouseEnter: (view: EditorView, mouseEvent: Event) =>
|
|
|
12
12
|
export declare const handleMouseLeave: (view: EditorView, event: Event) => boolean;
|
|
13
13
|
export declare const handleMouseMove: (view: EditorView, event: Event) => boolean;
|
|
14
14
|
export declare function handleTripleClick(view: EditorView, pos: number): boolean;
|
|
15
|
-
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean) => Transaction;
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
16
16
|
export declare const isTableInFocus: (view: EditorView) => boolean;
|
|
17
17
|
export declare const whenTableInFocus: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
18
18
|
export declare const withCellTracking: (eventHandler: (view: EditorView, mouseEvent: Event) => boolean) => (view: EditorView, mouseEvent: Event) => boolean;
|
|
@@ -29,8 +29,9 @@ type ResizableTableContainerProps = {
|
|
|
29
29
|
isWholeTableInDanger?: boolean;
|
|
30
30
|
isTableScalingEnabled?: boolean;
|
|
31
31
|
isTableAlignmentEnabled?: boolean;
|
|
32
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
32
33
|
};
|
|
33
|
-
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
34
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
34
35
|
type TableContainerProps = {
|
|
35
36
|
node: PMNode;
|
|
36
37
|
className: string;
|
|
@@ -46,6 +47,7 @@ type TableContainerProps = {
|
|
|
46
47
|
isTableResizingEnabled: boolean | undefined;
|
|
47
48
|
isTableScalingEnabled?: boolean;
|
|
48
49
|
isTableAlignmentEnabled?: boolean;
|
|
50
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
49
51
|
};
|
|
50
|
-
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
52
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
51
53
|
export {};
|
|
@@ -23,10 +23,11 @@ interface TableResizerProps {
|
|
|
23
23
|
isTableAlignmentEnabled?: boolean;
|
|
24
24
|
isWholeTableInDanger?: boolean;
|
|
25
25
|
isFullWidthModeEnabled?: boolean;
|
|
26
|
+
shouldUseIncreasedScalingPercent?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export interface TableResizerImprovementProps extends TableResizerProps {
|
|
28
29
|
onResizeStop?: () => void;
|
|
29
30
|
onResizeStart?: () => void;
|
|
30
31
|
}
|
|
31
|
-
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
32
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
32
33
|
export {};
|
|
@@ -3,5 +3,5 @@ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
4
|
import type { GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
5
5
|
import type { PluginInjectionAPIWithA11y } from '../types';
|
|
6
|
-
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -6,4 +6,4 @@ import type { LegacyPortalProviderAPI } from '@atlaskit/editor-common/portal-pro
|
|
|
6
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
7
7
|
import type { GetEditorContainerWidth, GetEditorFeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { PluginConfig, PluginInjectionAPI } from '../types';
|
|
9
|
-
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean) => SafePlugin<import("../types").TablePluginState>;
|
|
9
|
+
export declare const createPlugin: (dispatchAnalyticsEvent: DispatchAnalyticsEvent, dispatch: Dispatch, portalProviderAPI: LegacyPortalProviderAPI | PortalProviderAPI, eventDispatcher: EventDispatcher, pluginConfig: PluginConfig, getEditorContainerWidth: GetEditorContainerWidth, getEditorFeatureFlags: GetEditorFeatureFlags, getIntl: () => IntlShape, tableResizingEnabled?: boolean, fullWidthModeEnabled?: boolean, previousFullWidthModeEnabled?: boolean, dragAndDropEnabled?: boolean, editorAnalyticsAPI?: EditorAnalyticsAPI, pluginInjectionApi?: PluginInjectionAPI, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => SafePlugin<import("../types").TablePluginState>;
|