@atlaskit/editor-plugin-table 7.16.16 → 7.16.18
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 +34 -0
- package/dist/cjs/commands-with-analytics.js +66 -41
- package/dist/cjs/nodeviews/TableContainer.js +14 -12
- package/dist/cjs/nodeviews/TableResizer.js +17 -18
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/keymap.js +6 -0
- package/dist/cjs/pm-plugins/table-resizing/utils/misc.js +1 -1
- package/dist/cjs/toolbar.js +54 -71
- package/dist/cjs/ui/icons/index.js +0 -7
- package/dist/cjs/utils/snapping.js +2 -2
- package/dist/es2019/commands-with-analytics.js +29 -6
- package/dist/es2019/nodeviews/TableContainer.js +17 -13
- package/dist/es2019/nodeviews/TableResizer.js +17 -18
- package/dist/es2019/plugin.js +3 -2
- package/dist/es2019/pm-plugins/keymap.js +7 -1
- package/dist/es2019/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/es2019/toolbar.js +54 -71
- package/dist/es2019/ui/icons/index.js +0 -1
- package/dist/es2019/utils/snapping.js +3 -3
- package/dist/esm/commands-with-analytics.js +66 -41
- package/dist/esm/nodeviews/TableContainer.js +15 -13
- package/dist/esm/nodeviews/TableResizer.js +20 -21
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/keymap.js +7 -1
- package/dist/esm/pm-plugins/table-resizing/utils/misc.js +2 -2
- package/dist/esm/toolbar.js +55 -72
- package/dist/esm/ui/icons/index.js +0 -1
- package/dist/esm/utils/snapping.js +3 -3
- package/dist/types/commands/toggle.d.ts +1 -1
- package/dist/types/commands-with-analytics.d.ts +7 -4
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/toolbar.d.ts +4 -5
- package/dist/types/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -0
- package/dist/types/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -0
- package/dist/types/ui/TableFloatingControls/index.d.ts +2 -0
- package/dist/types/ui/icons/index.d.ts +0 -1
- package/dist/types-ts4.5/commands/toggle.d.ts +1 -1
- package/dist/types-ts4.5/commands-with-analytics.d.ts +7 -4
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +4 -5
- package/dist/types-ts4.5/ui/TableFloatingColumnControls/ColumnControls/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/CornerControls/DragCornerControls.d.ts +4 -0
- package/dist/types-ts4.5/ui/TableFloatingControls/index.d.ts +2 -0
- package/dist/types-ts4.5/ui/icons/index.d.ts +0 -1
- package/package.json +9 -6
- package/src/commands-with-analytics.ts +80 -40
- package/src/nodeviews/TableContainer.tsx +24 -14
- package/src/nodeviews/TableResizer.tsx +29 -15
- package/src/plugin.tsx +5 -2
- package/src/pm-plugins/keymap.ts +30 -0
- package/src/pm-plugins/table-resizing/utils/misc.ts +2 -2
- package/src/toolbar.tsx +80 -83
- package/src/ui/TableFloatingControls/index.tsx +0 -1
- package/src/ui/icons/index.ts +0 -1
- package/src/utils/snapping.ts +4 -4
- package/dist/cjs/ui/icons/DisplayModeIcon.js +0 -46
- package/dist/es2019/ui/icons/DisplayModeIcon.js +0 -39
- package/dist/esm/ui/icons/DisplayModeIcon.js +0 -39
- package/dist/types/ui/icons/DisplayModeIcon.d.ts +0 -4
- package/dist/types-ts4.5/ui/icons/DisplayModeIcon.d.ts +0 -4
- package/src/ui/icons/DisplayModeIcon.tsx +0 -41
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
-
import { addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, backspace, bindKeymapWithCommand, decreaseMediaSize, deleteColumn, deleteRow, escape, increaseMediaSize, moveColumnLeft, moveColumnRight, moveLeft, moveRight, moveRowDown, moveRowUp, nextCell, previousCell, startColumnResizing, toggleTable } from '@atlaskit/editor-common/keymaps';
|
|
2
|
+
import { addColumnAfter, addColumnAfterVO, addColumnBefore, addColumnBeforeVO, addRowAfter, addRowAfterVO, addRowBefore, addRowBeforeVO, backspace, bindKeymapWithCommand, decreaseMediaSize, deleteColumn, deleteRow, escape, increaseMediaSize, moveColumnLeft, moveColumnRight, moveLeft, moveRight, moveRowDown, moveRowUp, nextCell, previousCell, startColumnResizing, toggleTable } from '@atlaskit/editor-common/keymaps';
|
|
3
3
|
import { chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
4
4
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
5
5
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
@@ -29,6 +29,12 @@ export function keymapPlugin(getEditorContainerWidth, editorAnalyticsAPI, dragAn
|
|
|
29
29
|
bindKeymapWithCommand(addRowAfter.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
30
30
|
bindKeymapWithCommand(addColumnBefore.common, addColumnBeforeCommand(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
31
31
|
bindKeymapWithCommand(addColumnAfter.common, addColumnAfterCommand(isTableScalingEnabled, shouldUseIncreasedScalingPercent), list);
|
|
32
|
+
if (getBooleanFF('platform.editor.a11y-help-dialog-shortcut-keys-position_aghfg')) {
|
|
33
|
+
bindKeymapWithCommand(addRowBeforeVO.common, addRowAroundSelection(editorAnalyticsAPI)('TOP'), list);
|
|
34
|
+
bindKeymapWithCommand(addRowAfterVO.common, addRowAroundSelection(editorAnalyticsAPI)('BOTTOM'), list);
|
|
35
|
+
bindKeymapWithCommand(addColumnBeforeVO.common, addColumnBeforeCommand(isTableScalingEnabled), list);
|
|
36
|
+
bindKeymapWithCommand(addColumnAfterVO.common, addColumnAfterCommand(isTableScalingEnabled), list);
|
|
37
|
+
}
|
|
32
38
|
if (dragAndDropEnabled) {
|
|
33
39
|
// Move row/column shortcuts
|
|
34
40
|
/**
|
|
@@ -2,7 +2,7 @@ import { getParentNodeWidth, getTableContainerWidth, layoutToWidth } from '@atla
|
|
|
2
2
|
import { calcTableWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { getBreakpoint, mapBreakpointToLayoutMaxWidth } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { calcTableColumnWidths, containsClassName } from '@atlaskit/editor-common/utils';
|
|
5
|
-
import { akEditorFullWidthLayoutWidth,
|
|
5
|
+
import { akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorTableNumberColumnWidth } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { hasTableBeenResized } from './colgroup';
|
|
7
7
|
import { MAX_SCALING_PERCENT, MAX_SCALING_PERCENT_TABLES_WITH_FIXED_COLUMN_WIDTHS_OPTION } from './consts';
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ export function getLayoutSize(tableLayout) {
|
|
|
12
12
|
var options = arguments.length > 2 ? arguments[2] : undefined;
|
|
13
13
|
var isFullWidthModeEnabled = options.isFullWidthModeEnabled;
|
|
14
14
|
if (isFullWidthModeEnabled) {
|
|
15
|
-
return containerWidth ? Math.min(containerWidth -
|
|
15
|
+
return containerWidth ? Math.min(containerWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth) : akEditorFullWidthLayoutWidth;
|
|
16
16
|
}
|
|
17
17
|
var calculatedTableWidth = calcTableWidth(tableLayout, containerWidth, true);
|
|
18
18
|
if (calculatedTableWidth !== 'inherit') {
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -6,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
/** @jsx jsx */
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
9
|
-
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
9
|
+
import { CHANGE_ALIGNMENT_REASON, 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
12
|
import { getTableContainerWidth } from '@atlaskit/editor-common/node-width';
|
|
@@ -24,21 +24,32 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
24
24
|
import TableOptionsIcon from '@atlaskit/icon/glyph/preferences';
|
|
25
25
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
26
26
|
import { clearHoverSelection, hoverColumns, hoverMergedCells, hoverRows, hoverTable, removeDescendantNodes } from './commands';
|
|
27
|
-
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, setTableAlignmentWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics,
|
|
27
|
+
import { deleteColumnsWithAnalytics, deleteRowsWithAnalytics, deleteTableWithAnalytics, distributeColumnsWidthsWithAnalytics, emptyMultipleCellsWithAnalytics, insertColumnWithAnalytics, insertRowWithAnalytics, mergeCellsWithAnalytics, setColorWithAnalytics, setTableAlignmentWithAnalytics, sortColumnWithAnalytics, splitCellWithAnalytics, toggleFixedColumnWidthsOptionAnalytics, toggleHeaderColumnWithAnalytics, toggleHeaderRowWithAnalytics, toggleNumberColumnWithAnalytics, wrapTableInExpandWithAnalytics } from './commands-with-analytics';
|
|
28
28
|
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
29
29
|
import { pluginKey as tableResizingPluginKey } from './pm-plugins/table-resizing';
|
|
30
|
+
import { getStaticTableScalingPercent } from './pm-plugins/table-resizing/utils/misc';
|
|
30
31
|
import { getNewResizeStateFromSelectedColumns } from './pm-plugins/table-resizing/utils/resize-state';
|
|
31
32
|
import { pluginKey as tableWidthPluginKey } from './pm-plugins/table-width';
|
|
32
33
|
import { canMergeCells } from './transforms';
|
|
33
34
|
import { TableCssClassName } from './types';
|
|
34
35
|
import { FloatingAlignmentButtons } from './ui/FloatingAlignmentButtons/FloatingAlignmentButtons';
|
|
35
|
-
import { DisplayModeIcon } from './ui/icons';
|
|
36
36
|
import { getMergedCellsPositions, getSelectedColumnIndexes, getSelectedRowIndexes, isTableNested } from './utils';
|
|
37
37
|
import { normaliseAlignment } from './utils/alignment';
|
|
38
38
|
export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _ref, editorAnalyticsAPI) {
|
|
39
39
|
var formatMessage = _ref.formatMessage;
|
|
40
|
+
var isTableScalingWithFixedColumnWidthsOptionShown = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
41
|
+
var areTableColumnWidthsFixed = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
40
42
|
var optionItem = getBooleanFF('platform.editor.a11y-table-floating-toolbar-dropdown-menu_zkb33') ? 'item-checkbox' : 'item';
|
|
41
43
|
var options = [{
|
|
44
|
+
id: 'editor.table.lockColumnWidths',
|
|
45
|
+
title: formatMessage(messages.lockColumnWidths),
|
|
46
|
+
onClick: toggleFixedColumnWidthsOptionAnalytics(editorAnalyticsAPI, INPUT_METHOD.FLOATING_TB),
|
|
47
|
+
selected: areTableColumnWidthsFixed,
|
|
48
|
+
hidden: !isTableScalingWithFixedColumnWidthsOptionShown,
|
|
49
|
+
domItemOptions: {
|
|
50
|
+
type: optionItem
|
|
51
|
+
}
|
|
52
|
+
}, {
|
|
42
53
|
id: 'editor.table.headerRow',
|
|
43
54
|
title: formatMessage(messages.headerRow),
|
|
44
55
|
onClick: toggleHeaderRowWithAnalytics(editorAnalyticsAPI),
|
|
@@ -86,7 +97,8 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
|
|
|
86
97
|
hidden: options.every(function (option) {
|
|
87
98
|
return option.hidden;
|
|
88
99
|
}),
|
|
89
|
-
options: options
|
|
100
|
+
options: options,
|
|
101
|
+
dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
|
|
90
102
|
};
|
|
91
103
|
} else {
|
|
92
104
|
return {
|
|
@@ -97,7 +109,8 @@ export var getToolbarMenuConfig = function getToolbarMenuConfig(config, state, _
|
|
|
97
109
|
hidden: options.every(function (option) {
|
|
98
110
|
return option.hidden;
|
|
99
111
|
}),
|
|
100
|
-
options: options
|
|
112
|
+
options: options,
|
|
113
|
+
dropdownWidth: isTableScalingWithFixedColumnWidthsOptionShown ? 192 : undefined
|
|
101
114
|
};
|
|
102
115
|
}
|
|
103
116
|
};
|
|
@@ -311,7 +324,8 @@ export var getClosestSelectionOrTableRect = function getClosestSelectionOrTableR
|
|
|
311
324
|
return isSelectionType(selection, 'cell') ? getSelectionRect(selection) : tableRect;
|
|
312
325
|
};
|
|
313
326
|
export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth, editorAnalyticsAPI, getEditorFeatureFlags, getEditorView, options) {
|
|
314
|
-
var
|
|
327
|
+
var isTableScalingWithFixedColumnWidthsOptionEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
328
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
315
329
|
return function (config) {
|
|
316
330
|
return function (state, intl) {
|
|
317
331
|
var tableObject = findTable(state.selection);
|
|
@@ -323,14 +337,26 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
323
337
|
var isWidthResizing = tableWidthState === null || tableWidthState === void 0 ? void 0 : tableWidthState.resizing;
|
|
324
338
|
if (tableObject && pluginState.editorHasFocus && !isWidthResizing) {
|
|
325
339
|
var nodeType = state.schema.nodes.table;
|
|
326
|
-
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI);
|
|
327
|
-
var alignmentMenu;
|
|
328
340
|
var isNested = pluginState.tablePos && isTableNested(state, pluginState.tablePos);
|
|
329
|
-
|
|
330
|
-
var
|
|
331
|
-
|
|
332
|
-
var
|
|
333
|
-
|
|
341
|
+
var isTableScalingWithFixedColumnWidthsOptionShown = isTableScalingWithFixedColumnWidthsOptionEnabled && !isNested;
|
|
342
|
+
var areTableColumWidthsFixed = tableObject.node.attrs.displayMode === 'fixed';
|
|
343
|
+
var editorView = getEditorView();
|
|
344
|
+
var getDomRef = function getDomRef(editorView) {
|
|
345
|
+
var element;
|
|
346
|
+
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
347
|
+
var parent = findParentDomRefOfType(nodeType, domAtPos)(state.selection);
|
|
348
|
+
if (parent) {
|
|
349
|
+
var tableRef = parent.querySelector('table') || undefined;
|
|
350
|
+
if (tableRef) {
|
|
351
|
+
element = closestElement(tableRef, ".".concat(TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return element;
|
|
355
|
+
};
|
|
356
|
+
var menu = getToolbarMenuConfig(config, pluginState, intl, editorAnalyticsAPI, isTableScalingWithFixedColumnWidthsOptionShown, areTableColumWidthsFixed);
|
|
357
|
+
var alignmentMenu = options !== null && options !== void 0 && options.isTableAlignmentEnabled && !isNested ? getAlignmentOptionsConfig(state, intl, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) : [];
|
|
358
|
+
var cellItems = pluginState.isDragAndDropEnabled ? [] : getCellItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled, shouldUseIncreasedScalingPercent);
|
|
359
|
+
var columnSettingsItems = pluginState.isDragAndDropEnabled ? getColumnSettingItems(state, editorView, intl, getEditorContainerWidth, editorAnalyticsAPI, options === null || options === void 0 ? void 0 : options.isTableScalingEnabled) : [];
|
|
334
360
|
var colorPicker = getColorPicker(state, menu, intl, editorAnalyticsAPI, getEditorView);
|
|
335
361
|
|
|
336
362
|
// Check if we need to show confirm dialog for delete button
|
|
@@ -357,18 +383,6 @@ export var getToolbarConfig = function getToolbarConfig(getEditorContainerWidth,
|
|
|
357
383
|
};
|
|
358
384
|
};
|
|
359
385
|
}
|
|
360
|
-
var getDomRef = function getDomRef(editorView) {
|
|
361
|
-
var element;
|
|
362
|
-
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
363
|
-
var parent = findParentDomRefOfType(nodeType, domAtPos)(state.selection);
|
|
364
|
-
if (parent) {
|
|
365
|
-
var tableRef = parent.querySelector('table') || undefined;
|
|
366
|
-
if (tableRef) {
|
|
367
|
-
element = closestElement(tableRef, ".".concat(TableCssClassName.TABLE_NODE_WRAPPER)) || undefined;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
return element;
|
|
371
|
-
};
|
|
372
386
|
var _getEditorFeatureFlag = getEditorFeatureFlags(),
|
|
373
387
|
stickyScrollbar = _getEditorFeatureFlag.stickyScrollbar;
|
|
374
388
|
return {
|
|
@@ -441,23 +455,6 @@ var getCellItems = function getCellItems(state, view, _ref3, getEditorContainerW
|
|
|
441
455
|
}
|
|
442
456
|
return [];
|
|
443
457
|
};
|
|
444
|
-
export var getLockBtnConfig = function getLockBtnConfig(editorAnalyticsAPI) {
|
|
445
|
-
return function (state, dispatch, editorView) {
|
|
446
|
-
var selectionOrTableRect = getClosestSelectionOrTableRect(state);
|
|
447
|
-
if (!editorView || !selectionOrTableRect) {
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
var tr = state.tr;
|
|
451
|
-
var table = findTable(tr.selection);
|
|
452
|
-
if (!table) {
|
|
453
|
-
return false;
|
|
454
|
-
} else {
|
|
455
|
-
var displayMode = table.node.attrs.displayMode;
|
|
456
|
-
toggleTableLockWithAnalytics(editorAnalyticsAPI)(displayMode, INPUT_METHOD.FLOATING_TB)(state, dispatch);
|
|
457
|
-
return true;
|
|
458
|
-
}
|
|
459
|
-
};
|
|
460
|
-
};
|
|
461
458
|
export var getDistributeConfig = function getDistributeConfig(getEditorContainerWidth, editorAnalyticsAPI) {
|
|
462
459
|
var isTableScalingEnabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
463
460
|
return function (state, dispatch, editorView) {
|
|
@@ -488,29 +485,6 @@ var getColumnSettingItems = function getColumnSettingItems(editorState, editorVi
|
|
|
488
485
|
var newResizeStateWithAnalytics = getNewResizeStateFromSelectedColumns(selectionOrTableRect, editorState, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
|
|
489
486
|
var wouldChange = (_newResizeStateWithAn2 = newResizeStateWithAnalytics === null || newResizeStateWithAnalytics === void 0 ? void 0 : newResizeStateWithAnalytics.changed) !== null && _newResizeStateWithAn2 !== void 0 ? _newResizeStateWithAn2 : false;
|
|
490
487
|
var items = [];
|
|
491
|
-
var isNested = pluginState.tablePos && isTableNested(editorState, pluginState.tablePos);
|
|
492
|
-
var isTableScalingLockBtnEnabled = !isNested && isTableScalingEnabled && getBooleanFF('platform.editor.table.preserve-widths-with-lock-button');
|
|
493
|
-
if (isTableScalingLockBtnEnabled) {
|
|
494
|
-
var _pluginState$tableNod;
|
|
495
|
-
var areColumnWidthsLocked = (pluginState === null || pluginState === void 0 || (_pluginState$tableNod = pluginState.tableNode) === null || _pluginState$tableNod === void 0 ? void 0 : _pluginState$tableNod.attrs.displayMode) === 'fixed';
|
|
496
|
-
var title = areColumnWidthsLocked ? formatMessage(messages.unlockColumnWidths) : formatMessage(messages.lockColumnWidths);
|
|
497
|
-
items.push({
|
|
498
|
-
id: 'editor.table.lockColumns',
|
|
499
|
-
type: 'button',
|
|
500
|
-
title: title,
|
|
501
|
-
icon: function icon() {
|
|
502
|
-
return jsx(DisplayModeIcon, {
|
|
503
|
-
size: "medium",
|
|
504
|
-
label: title
|
|
505
|
-
});
|
|
506
|
-
},
|
|
507
|
-
onClick: function onClick(state, dispatch, view) {
|
|
508
|
-
return getLockBtnConfig(editorAnalyticsAPI)(state, dispatch, view);
|
|
509
|
-
},
|
|
510
|
-
selected: areColumnWidthsLocked,
|
|
511
|
-
testId: 'table-lock-column-widths-btn'
|
|
512
|
-
});
|
|
513
|
-
}
|
|
514
488
|
if (pluginState !== null && pluginState !== void 0 && (_pluginState$pluginCo3 = pluginState.pluginConfig) !== null && _pluginState$pluginCo3 !== void 0 && _pluginState$pluginCo3.allowDistributeColumns && pluginState.isDragAndDropEnabled) {
|
|
515
489
|
items.push({
|
|
516
490
|
id: 'editor.table.distributeColumns',
|
|
@@ -591,7 +565,7 @@ var highlightColumnsHandler = function highlightColumnsHandler(state, dispatch)
|
|
|
591
565
|
}
|
|
592
566
|
return false;
|
|
593
567
|
};
|
|
594
|
-
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth) {
|
|
568
|
+
export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editorState, _ref6, editorAnalyticsAPI, getEditorContainerWidth, getDomRef, editorView) {
|
|
595
569
|
var formatMessage = _ref6.formatMessage;
|
|
596
570
|
var tableObject = findTable(editorState.selection);
|
|
597
571
|
if (!tableObject) {
|
|
@@ -623,8 +597,8 @@ export var getAlignmentOptionsConfig = function getAlignmentOptionsConfig(editor
|
|
|
623
597
|
icon: icon,
|
|
624
598
|
title: formatMessage(layoutToMessages[value]),
|
|
625
599
|
selected: normaliseAlignment(currentLayout) === value,
|
|
626
|
-
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB)
|
|
627
|
-
}, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth) && {
|
|
600
|
+
onClick: setTableAlignmentWithAnalytics(editorAnalyticsAPI)(value, currentLayout, INPUT_METHOD.FLOATING_TB, CHANGE_ALIGNMENT_REASON.TOOLBAR_OPTION_CHANGED)
|
|
601
|
+
}, isLayoutOptionDisabled(tableObject.node, getEditorContainerWidth, getDomRef, editorView) && {
|
|
628
602
|
disabled: value !== 'center'
|
|
629
603
|
});
|
|
630
604
|
});
|
|
@@ -654,10 +628,19 @@ export var getSelectedAlignmentIcon = function getSelectedAlignmentIcon(alignmen
|
|
|
654
628
|
return icon.value === normaliseAlignment(selectedAlignment);
|
|
655
629
|
});
|
|
656
630
|
};
|
|
657
|
-
export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth) {
|
|
658
|
-
var
|
|
659
|
-
|
|
660
|
-
|
|
631
|
+
export var isLayoutOptionDisabled = function isLayoutOptionDisabled(selectedNode, getEditorContainerWidth, getDomRef, editorView) {
|
|
632
|
+
var _getEditorContainerWi = getEditorContainerWidth(),
|
|
633
|
+
lineLength = _getEditorContainerWi.lineLength;
|
|
634
|
+
var tableContainerWidth = getTableContainerWidth(selectedNode);
|
|
635
|
+
|
|
636
|
+
// table may be scaled, use the scale percent to calculate the table width
|
|
637
|
+
if (editorView) {
|
|
638
|
+
var tableWrapper = getDomRef(editorView);
|
|
639
|
+
var tableWrapperWidth = (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.clientWidth) || tableContainerWidth;
|
|
640
|
+
var scalePercent = getStaticTableScalingPercent(selectedNode, tableWrapperWidth);
|
|
641
|
+
tableContainerWidth = tableContainerWidth * scalePercent;
|
|
642
|
+
}
|
|
643
|
+
if (selectedNode && lineLength && tableContainerWidth > lineLength) {
|
|
661
644
|
return true;
|
|
662
645
|
}
|
|
663
646
|
return false;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
2
|
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
3
|
export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
|
|
4
|
-
export { DisplayModeIcon } from './DisplayModeIcon';
|
|
5
4
|
export { MinimisedHandleIcon } from './MinimisedHandle';
|
|
6
5
|
export { MergeCellsIcon } from './MergeCellsIcon';
|
|
7
6
|
export { SplitCellIcon } from './SplitCellIcon';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import { isVerticalPosition } from '@atlaskit/editor-common/guideline';
|
|
3
|
-
import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth,
|
|
3
|
+
import { akEditorCalculatedWideLayoutWidth, akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
var numberOfLanesInDefaultLayoutWidth = 12;
|
|
5
5
|
var calculateSubSnappingWidths = function calculateSubSnappingWidths(totalLanes, totalWidth) {
|
|
6
6
|
return new Array(Math.round(totalLanes / 2) - 1).fill(totalWidth / totalLanes).map(function (v, i) {
|
|
@@ -19,7 +19,7 @@ export var calculateDefaultTablePreserveSnappings = function calculateDefaultTab
|
|
|
19
19
|
innerGuidelines: false,
|
|
20
20
|
breakoutPoints: false
|
|
21
21
|
};
|
|
22
|
-
var dynamicFullWidthLine = editorContainerWith -
|
|
22
|
+
var dynamicFullWidthLine = editorContainerWith - akEditorGutterPaddingDynamic() * 2 >= akEditorFullWidthLayoutWidth ? akEditorFullWidthLayoutWidth : editorContainerWith - akEditorGutterPaddingDynamic() * 2;
|
|
23
23
|
var guides = [dynamicFullWidthLine - lengthOffset];
|
|
24
24
|
if (!exclude.breakoutPoints) {
|
|
25
25
|
guides.unshift(akEditorDefaultLayoutWidth + lengthOffset, akEditorCalculatedWideLayoutWidth + lengthOffset);
|
|
@@ -37,7 +37,7 @@ export var defaultTablePreserveSnappingWidths = function defaultTablePreserveSna
|
|
|
37
37
|
innerGuidelines: false,
|
|
38
38
|
breakoutPoints: false
|
|
39
39
|
};
|
|
40
|
-
return editorContainerWidth -
|
|
40
|
+
return editorContainerWidth - akEditorGutterPaddingDynamic() * 2 > akEditorFullWidthLayoutWidth ? calculateDefaultSnappings() : calculateDefaultTablePreserveSnappings(lengthOffset, editorContainerWidth, exclude); // lengthOffset was hardcoded 0 here, created PRESERVE_TABLE_SNAPPING_LENGTH_OFFSET instead.
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
/**
|
|
@@ -4,7 +4,7 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
* Table layout toggle logic
|
|
5
5
|
* default -> wide -> full-width -> default
|
|
6
6
|
*/
|
|
7
|
-
export declare const getNextLayout: (currentLayout: TableLayout) => "
|
|
7
|
+
export declare const getNextLayout: (currentLayout: TableLayout) => "wide" | "default" | "full-width";
|
|
8
8
|
export declare const toggleHeaderRow: Command;
|
|
9
9
|
export declare const toggleHeaderColumn: Command;
|
|
10
10
|
export declare const toggleNumberColumn: Command;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
2
|
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
4
|
-
import { INPUT_METHOD
|
|
4
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { type CHANGE_ALIGNMENT_REASON } from '@atlaskit/editor-common/src/analytics/types/table-events';
|
|
6
7
|
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { type NodeWithPos } from '@atlaskit/editor-prosemirror/dist/types/utils';
|
|
7
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
|
|
8
|
-
import type
|
|
10
|
+
import { type Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
11
|
import type { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
10
12
|
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
11
13
|
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
|
|
@@ -28,5 +30,6 @@ export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: Editor
|
|
|
28
30
|
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
29
31
|
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
30
32
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const setTableAlignmentWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: TableLayout, inputMethod: INPUT_METHOD.FLOATING_TB) => Command;
|
|
33
|
+
export declare const toggleFixedColumnWidthsOptionAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, inputMethod: INPUT_METHOD.FLOATING_TB) => Command;
|
|
34
|
+
export declare const setTableAlignmentWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: TableLayout, inputMethod: INPUT_METHOD.FLOATING_TB, reason: CHANGE_ALIGNMENT_REASON) => Command;
|
|
35
|
+
export declare const setTableAlignmentWithTableContentWithPosWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: AlignmentOptions | null, tableNodeWithPos: NodeWithPos, inputMethod: INPUT_METHOD.AUTO, reason: CHANGE_ALIGNMENT_REASON) => Command;
|
|
@@ -23,7 +23,7 @@ export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeS
|
|
|
23
23
|
export declare const evenSelectedColumnsWidths: (resizeState: ResizeState, rect: Rect) => ResizeState;
|
|
24
24
|
export declare const bulkColumnsResize: (resizeState: ResizeState, columnsIndexes: number[], sourceColumnIndex: number) => ResizeState;
|
|
25
25
|
export declare const areColumnsEven: (resizeState: ResizeState) => boolean;
|
|
26
|
-
export declare const normaliseTableLayout: (input: string | undefined | null) => "
|
|
26
|
+
export declare const normaliseTableLayout: (input: string | undefined | null) => "wide" | "default" | "full-width";
|
|
27
27
|
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
28
28
|
node: Node;
|
|
29
29
|
offset: number;
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -7,19 +7,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
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
|
-
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
10
|
+
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
|
|
11
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, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
-
export declare const getLockBtnConfig: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableScalingWithFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
16
15
|
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
17
16
|
type AlignmentIcon = {
|
|
18
17
|
id?: string;
|
|
19
18
|
value: AlignmentOptions;
|
|
20
19
|
icon: React.ComponentClass<any>;
|
|
21
20
|
};
|
|
22
|
-
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
|
|
21
|
+
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => Array<FloatingToolbarDropdown<Command>>;
|
|
23
22
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
24
|
-
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
|
|
23
|
+
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => boolean;
|
|
25
24
|
export {};
|
|
@@ -116,6 +116,7 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
|
|
|
116
116
|
to: number;
|
|
117
117
|
mark: import("prosemirror-model").Mark;
|
|
118
118
|
}) => boolean;
|
|
119
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
119
120
|
};
|
|
120
121
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
121
122
|
pluginConfiguration?: {
|
|
@@ -216,6 +217,7 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
|
|
|
216
217
|
to: number;
|
|
217
218
|
mark: import("prosemirror-model").Mark;
|
|
218
219
|
}) => boolean;
|
|
220
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
219
221
|
};
|
|
220
222
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
221
223
|
pluginConfiguration?: {
|
|
@@ -97,6 +97,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
97
97
|
to: number;
|
|
98
98
|
mark: import("prosemirror-model").Mark;
|
|
99
99
|
}) => boolean;
|
|
100
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
100
101
|
};
|
|
101
102
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
102
103
|
pluginConfiguration?: {
|
|
@@ -197,6 +198,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
197
198
|
to: number;
|
|
198
199
|
mark: import("prosemirror-model").Mark;
|
|
199
200
|
}) => boolean;
|
|
201
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
200
202
|
};
|
|
201
203
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
202
204
|
pluginConfiguration?: {
|
|
@@ -308,6 +310,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
308
310
|
to: number;
|
|
309
311
|
mark: import("prosemirror-model").Mark;
|
|
310
312
|
}) => boolean;
|
|
313
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
311
314
|
};
|
|
312
315
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
313
316
|
pluginConfiguration?: {
|
|
@@ -408,6 +411,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
408
411
|
to: number;
|
|
409
412
|
mark: import("prosemirror-model").Mark;
|
|
410
413
|
}) => boolean;
|
|
414
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
411
415
|
};
|
|
412
416
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
413
417
|
pluginConfiguration?: {
|
|
@@ -125,6 +125,7 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
|
|
|
125
125
|
to: number;
|
|
126
126
|
mark: import("prosemirror-model").Mark;
|
|
127
127
|
}) => boolean;
|
|
128
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
128
129
|
};
|
|
129
130
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
130
131
|
pluginConfiguration?: {
|
|
@@ -225,6 +226,7 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
|
|
|
225
226
|
to: number;
|
|
226
227
|
mark: import("prosemirror-model").Mark;
|
|
227
228
|
}) => boolean;
|
|
229
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
228
230
|
};
|
|
229
231
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>];
|
|
230
232
|
pluginConfiguration?: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
2
|
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
3
|
export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
|
|
4
|
-
export { DisplayModeIcon } from './DisplayModeIcon';
|
|
5
4
|
export { MinimisedHandleIcon } from './MinimisedHandle';
|
|
6
5
|
export { MergeCellsIcon } from './MergeCellsIcon';
|
|
7
6
|
export { SplitCellIcon } from './SplitCellIcon';
|
|
@@ -4,7 +4,7 @@ import type { Command } from '@atlaskit/editor-common/types';
|
|
|
4
4
|
* Table layout toggle logic
|
|
5
5
|
* default -> wide -> full-width -> default
|
|
6
6
|
*/
|
|
7
|
-
export declare const getNextLayout: (currentLayout: TableLayout) => "
|
|
7
|
+
export declare const getNextLayout: (currentLayout: TableLayout) => "wide" | "default" | "full-width";
|
|
8
8
|
export declare const toggleHeaderRow: Command;
|
|
9
9
|
export declare const toggleHeaderColumn: Command;
|
|
10
10
|
export declare const toggleNumberColumn: Command;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { IntlShape } from 'react-intl-next/src/types';
|
|
2
2
|
import type { TableLayout } from '@atlaskit/adf-schema';
|
|
3
3
|
import type { TableSortOrder as SortOrder } from '@atlaskit/custom-steps';
|
|
4
|
-
import { INPUT_METHOD
|
|
4
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
6
|
+
import { type CHANGE_ALIGNMENT_REASON } from '@atlaskit/editor-common/src/analytics/types/table-events';
|
|
6
7
|
import type { Command, GetEditorContainerWidth } from '@atlaskit/editor-common/types';
|
|
8
|
+
import { type NodeWithPos } from '@atlaskit/editor-prosemirror/dist/types/utils';
|
|
7
9
|
import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
|
|
8
|
-
import type
|
|
10
|
+
import { type Rect } from '@atlaskit/editor-tables/table-map';
|
|
9
11
|
import type { ResizeStateWithAnalytics } from './pm-plugins/table-resizing/utils';
|
|
10
12
|
import type { AlignmentOptions, InsertRowMethods, InsertRowOptions, RowInsertPosition } from './types';
|
|
11
13
|
export declare const emptyMultipleCellsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.KEYBOARD | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, targetCellPosition?: number) => Command;
|
|
@@ -28,5 +30,6 @@ export declare const toggleTableLayoutWithAnalytics: (editorAnalyticsAPI: Editor
|
|
|
28
30
|
export declare const sortColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, columnIndex: number, sortOrder: SortOrder) => Command;
|
|
29
31
|
export declare const distributeColumnsWidthsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, { resizeState, table, attributes }: ResizeStateWithAnalytics) => Command;
|
|
30
32
|
export declare const wrapTableInExpandWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const setTableAlignmentWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: TableLayout, inputMethod: INPUT_METHOD.FLOATING_TB) => Command;
|
|
33
|
+
export declare const toggleFixedColumnWidthsOptionAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, inputMethod: INPUT_METHOD.FLOATING_TB) => Command;
|
|
34
|
+
export declare const setTableAlignmentWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: TableLayout, inputMethod: INPUT_METHOD.FLOATING_TB, reason: CHANGE_ALIGNMENT_REASON) => Command;
|
|
35
|
+
export declare const setTableAlignmentWithTableContentWithPosWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (newAlignment: AlignmentOptions, previousAlignment: AlignmentOptions | null, tableNodeWithPos: NodeWithPos, inputMethod: INPUT_METHOD.AUTO, reason: CHANGE_ALIGNMENT_REASON) => Command;
|
|
@@ -23,7 +23,7 @@ export declare const evenAllColumnsWidths: (resizeState: ResizeState) => ResizeS
|
|
|
23
23
|
export declare const evenSelectedColumnsWidths: (resizeState: ResizeState, rect: Rect) => ResizeState;
|
|
24
24
|
export declare const bulkColumnsResize: (resizeState: ResizeState, columnsIndexes: number[], sourceColumnIndex: number) => ResizeState;
|
|
25
25
|
export declare const areColumnsEven: (resizeState: ResizeState) => boolean;
|
|
26
|
-
export declare const normaliseTableLayout: (input: string | undefined | null) => "
|
|
26
|
+
export declare const normaliseTableLayout: (input: string | undefined | null) => "wide" | "default" | "full-width";
|
|
27
27
|
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
28
28
|
node: Node;
|
|
29
29
|
offset: number;
|
|
@@ -7,19 +7,18 @@ import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
|
7
7
|
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
|
-
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => FloatingToolbarItem<Command>;
|
|
10
|
+
export declare const getToolbarMenuConfig: (config: ToolbarMenuConfig, state: ToolbarMenuState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => FloatingToolbarItem<Command>;
|
|
11
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, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
-
export declare const getLockBtnConfig: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableScalingWithFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
16
15
|
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
17
16
|
type AlignmentIcon = {
|
|
18
17
|
id?: string;
|
|
19
18
|
value: AlignmentOptions;
|
|
20
19
|
icon: React.ComponentClass<any>;
|
|
21
20
|
};
|
|
22
|
-
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth) => Array<FloatingToolbarDropdown<Command>>;
|
|
21
|
+
export declare const getAlignmentOptionsConfig: (editorState: EditorState, { formatMessage }: ToolbarMenuContext, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => Array<FloatingToolbarDropdown<Command>>;
|
|
23
22
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
24
|
-
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth) => boolean;
|
|
23
|
+
export declare const isLayoutOptionDisabled: (selectedNode: PMNode, getEditorContainerWidth: GetEditorContainerWidth, getDomRef: (editorView: EditorView) => HTMLElement | undefined, editorView: EditorView | null) => boolean;
|
|
25
24
|
export {};
|
|
@@ -140,6 +140,7 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
|
|
|
140
140
|
to: number;
|
|
141
141
|
mark: import("prosemirror-model").Mark;
|
|
142
142
|
}) => boolean;
|
|
143
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
143
144
|
};
|
|
144
145
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
145
146
|
];
|
|
@@ -265,6 +266,7 @@ export declare const ColumnControls: ({ editorView, tableActive, tableRef, hover
|
|
|
265
266
|
to: number;
|
|
266
267
|
mark: import("prosemirror-model").Mark;
|
|
267
268
|
}) => boolean;
|
|
269
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
268
270
|
};
|
|
269
271
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
270
272
|
];
|
|
@@ -121,6 +121,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
121
121
|
to: number;
|
|
122
122
|
mark: import("prosemirror-model").Mark;
|
|
123
123
|
}) => boolean;
|
|
124
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
124
125
|
};
|
|
125
126
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
126
127
|
];
|
|
@@ -246,6 +247,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
246
247
|
to: number;
|
|
247
248
|
mark: import("prosemirror-model").Mark;
|
|
248
249
|
}) => boolean;
|
|
250
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
249
251
|
};
|
|
250
252
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
251
253
|
];
|
|
@@ -383,6 +385,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
383
385
|
to: number;
|
|
384
386
|
mark: import("prosemirror-model").Mark;
|
|
385
387
|
}) => boolean;
|
|
388
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
386
389
|
};
|
|
387
390
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
388
391
|
];
|
|
@@ -508,6 +511,7 @@ export declare const DragCornerControlsWithSelection: React.FC<import("react-int
|
|
|
508
511
|
to: number;
|
|
509
512
|
mark: import("prosemirror-model").Mark;
|
|
510
513
|
}) => boolean;
|
|
514
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
511
515
|
};
|
|
512
516
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
513
517
|
];
|
|
@@ -149,6 +149,7 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
|
|
|
149
149
|
to: number;
|
|
150
150
|
mark: import("prosemirror-model").Mark;
|
|
151
151
|
}) => boolean;
|
|
152
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
152
153
|
};
|
|
153
154
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
154
155
|
];
|
|
@@ -274,6 +275,7 @@ export declare const TableFloatingControls: ({ editorView, tableRef, tableNode,
|
|
|
274
275
|
to: number;
|
|
275
276
|
mark: import("prosemirror-model").Mark;
|
|
276
277
|
}) => boolean;
|
|
278
|
+
isRemoteReplaceDocumentTransaction: (tr: import("prosemirror-state").Transaction) => boolean;
|
|
277
279
|
};
|
|
278
280
|
}, import("@atlaskit/editor-plugin-collab-edit").PrivateCollabEditOptions>
|
|
279
281
|
];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { DragHandleIcon } from './DragHandleIcon';
|
|
2
2
|
export { DragInMotionIcon } from './DragInMotionIcon';
|
|
3
3
|
export { DragHandleDisabledIcon } from './DragHandleDisabledIcon';
|
|
4
|
-
export { DisplayModeIcon } from './DisplayModeIcon';
|
|
5
4
|
export { MinimisedHandleIcon } from './MinimisedHandle';
|
|
6
5
|
export { MergeCellsIcon } from './MergeCellsIcon';
|
|
7
6
|
export { SplitCellIcon } from './SplitCellIcon';
|