@atlaskit/editor-plugin-table 7.16.17 → 7.16.19
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 +21 -0
- package/dist/cjs/commands/column-resize.js +4 -3
- package/dist/cjs/commands/delete.js +3 -2
- package/dist/cjs/commands/insert.js +12 -8
- package/dist/cjs/commands-with-analytics.js +10 -7
- package/dist/cjs/event-handlers.js +3 -2
- package/dist/cjs/nodeviews/TableComponent.js +32 -19
- package/dist/cjs/nodeviews/TableContainer.js +4 -0
- package/dist/cjs/nodeviews/TableResizer.js +8 -7
- package/dist/cjs/nodeviews/table.js +6 -4
- package/dist/cjs/plugin.js +9 -6
- package/dist/cjs/pm-plugins/drag-and-drop/plugin.js +12 -13
- package/dist/cjs/pm-plugins/keymap.js +11 -9
- package/dist/cjs/pm-plugins/main.js +4 -1
- package/dist/cjs/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/cjs/pm-plugins/table-resizing/utils/resize-state.js +4 -3
- package/dist/cjs/pm-plugins/table-resizing/utils/scale-table.js +4 -3
- package/dist/cjs/toolbar.js +54 -37
- package/dist/cjs/transforms/column-width.js +3 -3
- package/dist/cjs/transforms/delete-columns.js +3 -2
- package/dist/cjs/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
- package/dist/cjs/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/cjs/ui/FloatingDragMenu/index.js +6 -3
- package/dist/cjs/ui/FloatingInsertButton/index.js +7 -8
- package/dist/cjs/utils/drag-menu.js +5 -4
- package/dist/es2019/commands/column-resize.js +4 -3
- package/dist/es2019/commands/delete.js +2 -2
- package/dist/es2019/commands/insert.js +8 -8
- package/dist/es2019/commands-with-analytics.js +9 -8
- package/dist/es2019/event-handlers.js +2 -2
- package/dist/es2019/nodeviews/TableComponent.js +28 -17
- package/dist/es2019/nodeviews/TableContainer.js +4 -0
- package/dist/es2019/nodeviews/TableResizer.js +9 -8
- package/dist/es2019/nodeviews/table.js +5 -4
- package/dist/es2019/plugin.js +9 -6
- package/dist/es2019/pm-plugins/drag-and-drop/plugin.js +7 -10
- package/dist/es2019/pm-plugins/keymap.js +9 -9
- package/dist/es2019/pm-plugins/main.js +4 -1
- package/dist/es2019/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/es2019/pm-plugins/table-resizing/utils/resize-state.js +4 -4
- package/dist/es2019/pm-plugins/table-resizing/utils/scale-table.js +4 -4
- package/dist/es2019/toolbar.js +51 -39
- package/dist/es2019/transforms/column-width.js +2 -3
- package/dist/es2019/transforms/delete-columns.js +2 -2
- package/dist/es2019/ui/FloatingContextualMenu/ContextualMenu.js +12 -7
- package/dist/es2019/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/es2019/ui/FloatingDragMenu/index.js +5 -3
- package/dist/es2019/ui/FloatingInsertButton/index.js +6 -8
- package/dist/es2019/utils/drag-menu.js +4 -4
- package/dist/esm/commands/column-resize.js +4 -3
- package/dist/esm/commands/delete.js +3 -2
- package/dist/esm/commands/insert.js +12 -8
- package/dist/esm/commands-with-analytics.js +10 -7
- package/dist/esm/event-handlers.js +3 -2
- package/dist/esm/nodeviews/TableComponent.js +32 -19
- package/dist/esm/nodeviews/TableContainer.js +4 -0
- package/dist/esm/nodeviews/TableResizer.js +9 -8
- package/dist/esm/nodeviews/table.js +6 -4
- package/dist/esm/plugin.js +9 -6
- package/dist/esm/pm-plugins/drag-and-drop/plugin.js +12 -13
- package/dist/esm/pm-plugins/keymap.js +11 -9
- package/dist/esm/pm-plugins/main.js +4 -1
- package/dist/esm/pm-plugins/table-resizing/event-handlers.js +10 -9
- package/dist/esm/pm-plugins/table-resizing/utils/resize-state.js +4 -3
- package/dist/esm/pm-plugins/table-resizing/utils/scale-table.js +4 -3
- package/dist/esm/toolbar.js +54 -37
- package/dist/esm/transforms/column-width.js +3 -3
- package/dist/esm/transforms/delete-columns.js +3 -2
- package/dist/esm/ui/FloatingContextualMenu/ContextualMenu.js +21 -15
- package/dist/esm/ui/FloatingDragMenu/DragMenu.js +3 -2
- package/dist/esm/ui/FloatingDragMenu/index.js +6 -3
- package/dist/esm/ui/FloatingInsertButton/index.js +7 -8
- package/dist/esm/utils/drag-menu.js +5 -4
- package/dist/types/commands/column-resize.d.ts +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 +4 -4
- 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/nodeviews/table.d.ts +1 -0
- package/dist/types/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
- package/dist/types/pm-plugins/keymap.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types/toolbar.d.ts +5 -5
- 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/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types/utils/drag-menu.d.ts +1 -1
- package/dist/types-ts4.5/commands/column-resize.d.ts +2 -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 +4 -4
- 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/nodeviews/table.d.ts +1 -0
- package/dist/types-ts4.5/pm-plugins/drag-and-drop/plugin.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/keymap.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/resize-state.d.ts +1 -1
- package/dist/types-ts4.5/pm-plugins/table-resizing/utils/scale-table.d.ts +1 -1
- package/dist/types-ts4.5/toolbar.d.ts +5 -5
- 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/ui/FloatingInsertButton/index.d.ts +1 -0
- package/dist/types-ts4.5/utils/drag-menu.d.ts +1 -1
- package/package.json +5 -8
- package/src/commands/column-resize.ts +6 -6
- package/src/commands/delete.ts +7 -1
- package/src/commands/insert.ts +33 -5
- package/src/commands-with-analytics.ts +14 -2
- package/src/event-handlers.ts +2 -0
- package/src/nodeviews/TableComponent.tsx +28 -28
- package/src/nodeviews/TableContainer.tsx +6 -0
- package/src/nodeviews/TableResizer.tsx +16 -6
- package/src/nodeviews/table.tsx +4 -2
- package/src/plugin.tsx +17 -7
- package/src/pm-plugins/drag-and-drop/plugin.ts +26 -13
- package/src/pm-plugins/keymap.ts +30 -4
- package/src/pm-plugins/main.ts +2 -0
- package/src/pm-plugins/table-resizing/event-handlers.ts +12 -14
- package/src/pm-plugins/table-resizing/utils/resize-state.ts +5 -5
- package/src/pm-plugins/table-resizing/utils/scale-table.ts +6 -4
- package/src/toolbar.tsx +97 -40
- package/src/transforms/column-width.ts +7 -3
- package/src/transforms/delete-columns.ts +6 -2
- package/src/ui/FloatingContextualMenu/ContextualMenu.tsx +12 -4
- package/src/ui/FloatingDragMenu/DragMenu.tsx +3 -0
- package/src/ui/FloatingDragMenu/index.tsx +4 -4
- package/src/ui/FloatingInsertButton/index.tsx +12 -9
- package/src/utils/drag-menu.ts +13 -4
|
@@ -182,7 +182,8 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
182
182
|
boundariesElement = _ref.boundariesElement,
|
|
183
183
|
isTableScalingEnabled = _ref.isTableScalingEnabled,
|
|
184
184
|
tableDuplicateCellColouring = _ref.tableDuplicateCellColouring,
|
|
185
|
-
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent
|
|
185
|
+
shouldUseIncreasedScalingPercent = _ref.shouldUseIncreasedScalingPercent,
|
|
186
|
+
isTableFixedColumnWidthsOptionEnabled = _ref.isTableFixedColumnWidthsOptionEnabled;
|
|
186
187
|
var state = editorView.state,
|
|
187
188
|
dispatch = editorView.dispatch;
|
|
188
189
|
var selection = state.selection;
|
|
@@ -206,7 +207,7 @@ export var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
206
207
|
hasMergedCellsInTable = getMergedCellsPositions(state.tr).length > 0;
|
|
207
208
|
}
|
|
208
209
|
var allowBackgroundColor = (_pluginConfig$allowBa = pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.allowBackgroundColor) !== null && _pluginConfig$allowBa !== void 0 ? _pluginConfig$allowBa : false;
|
|
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);
|
|
210
|
+
var dragMenuConfig = getDragMenuConfig(direction, getEditorContainerWidth, !shouldMoveDisabled, hasMergedCellsInTable, editorView, tableMap, index, targetCellPosition, selectionRect, editorAnalyticsAPI, pluginConfig === null || pluginConfig === void 0 ? void 0 : pluginConfig.isHeaderRowRequired, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent);
|
|
210
211
|
var _convertToDropdownIte = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect),
|
|
211
212
|
menuItems = _convertToDropdownIte.menuItems,
|
|
212
213
|
menuCallback = _convertToDropdownIte.menuCallback;
|
|
@@ -32,8 +32,10 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
32
32
|
}
|
|
33
33
|
var _ref2 = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
34
34
|
_ref2$tableDuplicateC = _ref2.tableDuplicateCellColouring,
|
|
35
|
-
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC
|
|
36
|
-
|
|
35
|
+
tableDuplicateCellColouring = _ref2$tableDuplicateC === void 0 ? false : _ref2$tableDuplicateC,
|
|
36
|
+
_ref2$tableWithFixedC = _ref2.tableWithFixedColumnWidthsOption,
|
|
37
|
+
tableWithFixedColumnWidthsOption = _ref2$tableWithFixedC === void 0 ? false : _ref2$tableWithFixedC;
|
|
38
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
37
39
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
38
40
|
alignX: direction === 'row' ? 'right' : undefined,
|
|
39
41
|
alignY: direction === 'row' ? 'start' : undefined,
|
|
@@ -69,7 +71,8 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
69
71
|
scrollableElement: scrollableElement,
|
|
70
72
|
isTableScalingEnabled: isTableScalingEnabled,
|
|
71
73
|
tableDuplicateCellColouring: tableDuplicateCellColouring,
|
|
72
|
-
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent
|
|
74
|
+
shouldUseIncreasedScalingPercent: shouldUseIncreasedScalingPercent,
|
|
75
|
+
isTableFixedColumnWidthsOptionEnabled: tableWithFixedColumnWidthsOption
|
|
73
76
|
}));
|
|
74
77
|
};
|
|
75
78
|
FloatingDragMenu.displayName = 'FloatingDragMenu';
|
|
@@ -20,7 +20,6 @@ import { TableMap } from '@atlaskit/editor-tables/table-map';
|
|
|
20
20
|
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
21
21
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import { insertColumnWithAnalytics, insertRowWithAnalytics } from '../../commands-with-analytics';
|
|
23
|
-
import { getPluginState } from '../../pm-plugins/plugin-factory';
|
|
24
23
|
import { TableCssClassName as ClassName } from '../../types';
|
|
25
24
|
import { checkIfNumberColumnEnabled } from '../../utils';
|
|
26
25
|
import getPopupOptions from './getPopupOptions';
|
|
@@ -190,19 +189,19 @@ export var FloatingInsertButton = /*#__PURE__*/function (_React$Component) {
|
|
|
190
189
|
editorView = _this$props4.editorView,
|
|
191
190
|
insertColumnButtonIndex = _this$props4.insertColumnButtonIndex,
|
|
192
191
|
editorAnalyticsAPI = _this$props4.editorAnalyticsAPI,
|
|
193
|
-
getEditorFeatureFlags = _this$props4.getEditorFeatureFlags
|
|
192
|
+
getEditorFeatureFlags = _this$props4.getEditorFeatureFlags,
|
|
193
|
+
isTableScalingEnabled = _this$props4.isTableScalingEnabled;
|
|
194
194
|
if (typeof insertColumnButtonIndex !== 'undefined') {
|
|
195
195
|
event.preventDefault();
|
|
196
|
-
var _getPluginState = getPluginState(editorView.state),
|
|
197
|
-
_getPluginState$isTab = _getPluginState.isTableScalingEnabled,
|
|
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');
|
|
200
196
|
var _ref = getEditorFeatureFlags ? getEditorFeatureFlags() : {},
|
|
201
197
|
_ref$tableDuplicateCe = _ref.tableDuplicateCellColouring,
|
|
202
|
-
tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe
|
|
198
|
+
tableDuplicateCellColouring = _ref$tableDuplicateCe === void 0 ? false : _ref$tableDuplicateCe,
|
|
199
|
+
_ref$tableWithFixedCo = _ref.tableWithFixedColumnWidthsOption,
|
|
200
|
+
tableWithFixedColumnWidthsOption = _ref$tableWithFixedCo === void 0 ? false : _ref$tableWithFixedCo;
|
|
201
|
+
var shouldUseIncreasedScalingPercent = isTableScalingEnabled && tableWithFixedColumnWidthsOption && getBooleanFF('platform.editor.table.use-increased-scaling-percent');
|
|
203
202
|
var state = editorView.state,
|
|
204
203
|
dispatch = editorView.dispatch;
|
|
205
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
204
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, tableWithFixedColumnWidthsOption, shouldUseIncreasedScalingPercent)(INPUT_METHOD.BUTTON, insertColumnButtonIndex)(state, dispatch, editorView);
|
|
206
205
|
}
|
|
207
206
|
}
|
|
208
207
|
}]);
|
|
@@ -72,7 +72,8 @@ 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
|
|
75
|
+
var isTableFixedColumnWidthsOptionEnabled = arguments.length > 13 && arguments[13] !== undefined ? arguments[13] : false;
|
|
76
|
+
var shouldUseIncreasedScalingPercent = arguments.length > 14 && arguments[14] !== undefined ? arguments[14] : false;
|
|
76
77
|
var addOptions = direction === 'row' ? [{
|
|
77
78
|
label: 'above',
|
|
78
79
|
offset: 0,
|
|
@@ -157,7 +158,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
157
158
|
moveCursorToInsertedRow: true
|
|
158
159
|
})(state, dispatch);
|
|
159
160
|
} else {
|
|
160
|
-
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
|
|
161
|
+
insertColumnWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, tableDuplicateCellColouring, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, (index !== null && index !== void 0 ? index : 0) + offset)(state, dispatch, editorView);
|
|
161
162
|
}
|
|
162
163
|
return true;
|
|
163
164
|
},
|
|
@@ -170,7 +171,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
170
171
|
onClick: function onClick(state, dispatch) {
|
|
171
172
|
var selectionRect = getClosestSelectionRect(state);
|
|
172
173
|
if (selectionRect) {
|
|
173
|
-
var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled);
|
|
174
|
+
var newResizeState = getNewResizeStateFromSelectedColumns(selectionRect, state, editorView.domAtPos.bind(editorView), getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled);
|
|
174
175
|
if (newResizeState) {
|
|
175
176
|
distributeColumnsWidthsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, newResizeState)(state, dispatch);
|
|
176
177
|
return true;
|
|
@@ -196,7 +197,7 @@ export var getDragMenuConfig = function getDragMenuConfig(direction, getEditorCo
|
|
|
196
197
|
if (direction === 'row') {
|
|
197
198
|
deleteRowsWithAnalytics(editorAnalyticsAPI)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect, !!isHeaderRowRequired)(state, dispatch);
|
|
198
199
|
} else {
|
|
199
|
-
deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
|
|
200
|
+
deleteColumnsWithAnalytics(editorAnalyticsAPI, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, shouldUseIncreasedScalingPercent)(INPUT_METHOD.TABLE_CONTEXT_MENU, selectionRect !== null && selectionRect !== void 0 ? selectionRect : defaultSelectionRect)(state, dispatch, editorView);
|
|
200
201
|
}
|
|
201
202
|
return true;
|
|
202
203
|
},
|
|
@@ -12,10 +12,11 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
|
|
|
12
12
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
13
13
|
getIntl?: (() => IntlShape) | undefined;
|
|
14
14
|
}) => Command;
|
|
15
|
-
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, ariaNotify, getIntl, }: {
|
|
15
|
+
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
|
|
16
16
|
stepSize: number;
|
|
17
17
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
18
18
|
isTableScalingEnabled: boolean;
|
|
19
|
+
isTableFixedColumnWidthsOptionEnabled: boolean;
|
|
19
20
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
20
21
|
getIntl?: (() => IntlShape) | undefined;
|
|
21
22
|
originalTr?: Transaction | undefined;
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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, 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;
|
|
6
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
8
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
@@ -16,11 +16,11 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
|
|
|
16
16
|
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number, editorView?: EditorView | null) => Command;
|
|
17
17
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
18
18
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
19
|
-
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;
|
|
20
|
-
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
|
+
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
20
|
+
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
21
21
|
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;
|
|
22
|
-
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;
|
|
23
|
-
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
22
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
23
|
+
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
24
24
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
25
25
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
26
26
|
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, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
@@ -28,10 +28,11 @@ type ResizableTableContainerProps = {
|
|
|
28
28
|
tableWrapperHeight?: number;
|
|
29
29
|
isWholeTableInDanger?: boolean;
|
|
30
30
|
isTableScalingEnabled?: boolean;
|
|
31
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
31
32
|
isTableAlignmentEnabled?: boolean;
|
|
32
33
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
33
34
|
};
|
|
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>;
|
|
35
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
35
36
|
type TableContainerProps = {
|
|
36
37
|
node: PMNode;
|
|
37
38
|
className: string;
|
|
@@ -46,8 +47,9 @@ type TableContainerProps = {
|
|
|
46
47
|
isWholeTableInDanger?: boolean;
|
|
47
48
|
isTableResizingEnabled: boolean | undefined;
|
|
48
49
|
isTableScalingEnabled?: boolean;
|
|
50
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
49
51
|
isTableAlignmentEnabled?: boolean;
|
|
50
52
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
51
53
|
};
|
|
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;
|
|
54
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
53
55
|
export {};
|
|
@@ -20,6 +20,7 @@ interface TableResizerProps {
|
|
|
20
20
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
21
21
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
22
22
|
isTableScalingEnabled?: boolean;
|
|
23
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
23
24
|
isTableAlignmentEnabled?: boolean;
|
|
24
25
|
isWholeTableInDanger?: boolean;
|
|
25
26
|
isFullWidthModeEnabled?: boolean;
|
|
@@ -29,5 +30,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
|
|
|
29
30
|
onResizeStop?: () => void;
|
|
30
31
|
onResizeStart?: () => void;
|
|
31
32
|
}
|
|
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;
|
|
33
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
33
34
|
export {};
|
|
@@ -16,6 +16,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
16
16
|
eventDispatcher?: EventDispatcher;
|
|
17
17
|
getPos: getPosHandlerNode;
|
|
18
18
|
options: import("./types").TableOptions | undefined;
|
|
19
|
+
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
19
20
|
constructor(props: Props);
|
|
20
21
|
getContentDOM(): {
|
|
21
22
|
dom: HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
|
|
|
27
27
|
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
28
28
|
node: Node;
|
|
29
29
|
offset: number;
|
|
30
|
-
}, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
|
|
30
|
+
}, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
|
|
@@ -16,5 +16,5 @@ export interface ScaleOptions {
|
|
|
16
16
|
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
|
|
17
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
|
-
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => void;
|
|
19
|
+
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
|
|
20
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,17 +8,17 @@ 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, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => 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, shouldUseIncreasedScalingPercent?: 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, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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,
|
|
15
|
-
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
+
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => Command;
|
|
16
16
|
type AlignmentIcon = {
|
|
17
17
|
id?: string;
|
|
18
18
|
value: AlignmentOptions;
|
|
19
19
|
icon: React.ComponentClass<any>;
|
|
20
20
|
};
|
|
21
|
-
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, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
|
|
22
22
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
23
|
-
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, shouldUseIncreasedScalingPercent: boolean) => boolean;
|
|
24
24
|
export {};
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
24
|
+
export declare const rescaleColumns: (isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
4
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -27,8 +27,9 @@ type DragMenuProps = {
|
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
28
|
tableDuplicateCellColouring?: boolean;
|
|
29
29
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
30
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean;
|
|
30
31
|
};
|
|
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>;
|
|
32
|
+
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, isTableFixedColumnWidthsOptionEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
32
33
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
33
34
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
34
35
|
};
|
|
@@ -14,6 +14,7 @@ export interface Props {
|
|
|
14
14
|
isHeaderColumnEnabled?: boolean;
|
|
15
15
|
isHeaderRowEnabled?: boolean;
|
|
16
16
|
isDragAndDropEnabled?: boolean;
|
|
17
|
+
isTableScalingEnabled?: boolean;
|
|
17
18
|
mountPoint?: HTMLElement;
|
|
18
19
|
boundariesElement?: HTMLElement;
|
|
19
20
|
scrollableElement?: HTMLElement;
|
|
@@ -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, shouldUseIncreasedScalingPercent?: 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, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => DragMenuConfig[];
|
|
@@ -12,10 +12,11 @@ export declare const activateNextResizeArea: ({ direction, ariaNotify, getIntl,
|
|
|
12
12
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
13
13
|
getIntl?: (() => IntlShape) | undefined;
|
|
14
14
|
}) => Command;
|
|
15
|
-
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, ariaNotify, getIntl, }: {
|
|
15
|
+
export declare const changeColumnWidthByStep: ({ stepSize, getEditorContainerWidth, isTableScalingEnabled, isTableFixedColumnWidthsOptionEnabled, ariaNotify, getIntl, }: {
|
|
16
16
|
stepSize: number;
|
|
17
17
|
getEditorContainerWidth: GetEditorContainerWidth;
|
|
18
18
|
isTableScalingEnabled: boolean;
|
|
19
|
+
isTableFixedColumnWidthsOptionEnabled: boolean;
|
|
19
20
|
ariaNotify?: ((message: string, ariaLiveElementAttributes?: AriaLiveElementAttributes) => void) | undefined;
|
|
20
21
|
getIntl?: (() => IntlShape) | undefined;
|
|
21
22
|
originalTr?: Transaction | undefined;
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
3
|
+
export declare const deleteColumnsCommand: (rect: Rect, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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, 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;
|
|
6
|
+
export declare function addColumnAt(isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): (column: number, allowAddColumnCustomStep: boolean | undefined, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
7
|
+
export declare const addColumnBefore: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
8
|
+
export declare const addColumnAfter: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
9
|
+
export declare const insertColumn: (isTableScalingEnabled?: boolean, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
@@ -16,11 +16,11 @@ export declare const splitCellWithAnalytics: (editorAnalyticsAPI: EditorAnalytic
|
|
|
16
16
|
export declare const setColorWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.CONTEXT_MENU | INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TABLE_CONTEXT_MENU, cellColor: string, targetCellPosition?: number, editorView?: EditorView | null) => Command;
|
|
17
17
|
export declare const addRowAroundSelection: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (side: RowInsertPosition) => Command;
|
|
18
18
|
export declare const insertRowWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isCellbackgroundDuplicated?: boolean) => (inputMethod: InsertRowMethods, options: InsertRowOptions) => Command;
|
|
19
|
-
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;
|
|
20
|
-
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
|
+
export declare const changeColumnWidthByStepWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (stepSize: number, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled: boolean, isTableFixedColumnWidthsOptionEnabled: boolean, inputMethod: INPUT_METHOD.SHORTCUT, ariaNotify?: ((message: string) => void) | undefined, getIntl?: () => IntlShape) => Command;
|
|
20
|
+
export declare const insertColumnWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isCellbackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
21
21
|
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;
|
|
22
|
-
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;
|
|
23
|
-
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
22
|
+
export declare const deleteColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
23
|
+
export declare const deleteSelectedRowsOrColumnsWithAnalyticsViaShortcut: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => Command;
|
|
24
24
|
export declare const deleteTableWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => Command;
|
|
25
25
|
export declare const deleteTableIfSelectedWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null) => (inputMethod: INPUT_METHOD.FLOATING_TB | INPUT_METHOD.KEYBOARD) => Command;
|
|
26
26
|
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, shouldUseIncreasedScalingPercent?: boolean) => Transaction;
|
|
15
|
+
export declare const handleCut: (oldTr: Transaction, oldState: EditorState, newState: EditorState, editorAnalyticsAPI?: EditorAnalyticsAPI, editorView?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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;
|
|
@@ -28,10 +28,11 @@ type ResizableTableContainerProps = {
|
|
|
28
28
|
tableWrapperHeight?: number;
|
|
29
29
|
isWholeTableInDanger?: boolean;
|
|
30
30
|
isTableScalingEnabled?: boolean;
|
|
31
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
31
32
|
isTableAlignmentEnabled?: boolean;
|
|
32
33
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
33
34
|
};
|
|
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>;
|
|
35
|
+
export declare const ResizableTableContainer: React.MemoExoticComponent<({ children, className, node, containerWidth, lineLength, editorView, getPos, tableRef, isResizing, pluginInjectionApi, tableWrapperHeight, isWholeTableInDanger, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<ResizableTableContainerProps>) => JSX.Element>;
|
|
35
36
|
type TableContainerProps = {
|
|
36
37
|
node: PMNode;
|
|
37
38
|
className: string;
|
|
@@ -46,8 +47,9 @@ type TableContainerProps = {
|
|
|
46
47
|
isWholeTableInDanger?: boolean;
|
|
47
48
|
isTableResizingEnabled: boolean | undefined;
|
|
48
49
|
isTableScalingEnabled?: boolean;
|
|
50
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
49
51
|
isTableAlignmentEnabled?: boolean;
|
|
50
52
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
51
53
|
};
|
|
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;
|
|
54
|
+
export declare const TableContainer: ({ children, node, className, containerWidth: { width: editorWidth, lineLength }, editorView, getPos, tableRef, isNested, tableWrapperHeight, isResizing, pluginInjectionApi, isWholeTableInDanger, isTableResizingEnabled, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, shouldUseIncreasedScalingPercent, }: PropsWithChildren<TableContainerProps>) => JSX.Element;
|
|
53
55
|
export {};
|
|
@@ -20,6 +20,7 @@ interface TableResizerProps {
|
|
|
20
20
|
displayGapCursor: (toggle: boolean) => boolean;
|
|
21
21
|
pluginInjectionApi?: PluginInjectionAPI;
|
|
22
22
|
isTableScalingEnabled?: boolean;
|
|
23
|
+
isTableWithFixedColumnWidthsOptionEnabled?: boolean;
|
|
23
24
|
isTableAlignmentEnabled?: boolean;
|
|
24
25
|
isWholeTableInDanger?: boolean;
|
|
25
26
|
isFullWidthModeEnabled?: boolean;
|
|
@@ -29,5 +30,5 @@ export interface TableResizerImprovementProps extends TableResizerProps {
|
|
|
29
30
|
onResizeStop?: () => void;
|
|
30
31
|
onResizeStart?: () => void;
|
|
31
32
|
}
|
|
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;
|
|
33
|
+
export declare const TableResizer: ({ children, width, maxWidth, containerWidth, lineLength, updateWidth, onResizeStop, onResizeStart, editorView, getPos, node, tableRef, displayGuideline, attachAnalyticsEvent, displayGapCursor, isTableScalingEnabled, isTableWithFixedColumnWidthsOptionEnabled, isTableAlignmentEnabled, isWholeTableInDanger, shouldUseIncreasedScalingPercent, pluginInjectionApi, isFullWidthModeEnabled, }: PropsWithChildren<TableResizerImprovementProps>) => JSX.Element;
|
|
33
34
|
export {};
|
|
@@ -16,6 +16,7 @@ export default class TableView extends ReactNodeView<Props> {
|
|
|
16
16
|
eventDispatcher?: EventDispatcher;
|
|
17
17
|
getPos: getPosHandlerNode;
|
|
18
18
|
options: import("./types").TableOptions | undefined;
|
|
19
|
+
getEditorFeatureFlags: GetEditorFeatureFlags;
|
|
19
20
|
constructor(props: Props);
|
|
20
21
|
getContentDOM(): {
|
|
21
22
|
dom: HTMLElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
4
|
+
export declare const createPlugin: (dispatch: Dispatch, editorAnalyticsAPI?: EditorAnalyticsAPI, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => SafePlugin<import("./types").DragAndDropPluginState>;
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
6
|
+
export declare function keymapPlugin(getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, dragAndDropEnabled?: boolean, isTableScalingEnabled?: boolean, isTableAlignmentEnabled?: boolean, isFullWidthEnabled?: boolean, pluginInjectionApi?: PluginInjectionAPIWithA11y, getIntl?: () => IntlShape, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean): SafePlugin;
|
|
7
7
|
export default keymapPlugin;
|
|
@@ -27,4 +27,4 @@ export declare const normaliseTableLayout: (input: string | undefined | null) =>
|
|
|
27
27
|
export declare const getNewResizeStateFromSelectedColumns: (rect: Rect, state: EditorState, domAtPos: (pos: number) => {
|
|
28
28
|
node: Node;
|
|
29
29
|
offset: number;
|
|
30
|
-
}, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
|
|
30
|
+
}, getEditorContainerWidth: GetEditorContainerWidth, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => ResizeStateWithAnalytics | undefined;
|
|
@@ -16,5 +16,5 @@ export interface ScaleOptions {
|
|
|
16
16
|
export declare const scale: (tableRef: HTMLTableElement, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => ResizeState | undefined;
|
|
17
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
|
-
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean) => void;
|
|
19
|
+
export declare const previewScaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabled?: boolean, isTableWithFixedColumnWidthsOptionEnabled?: boolean) => void;
|
|
20
20
|
export declare const scaleTable: (tableRef: HTMLTableElement | null | undefined, options: ScaleOptions, domAtPos: DomAtPos, isTableScalingEnabledOnCurrentTable?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -8,17 +8,17 @@ 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, isTableScalingWithFixedColumnWidthsOptionShown?: boolean, areTableColumnWidthsFixed?: boolean) => 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, shouldUseIncreasedScalingPercent?: 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, isCellBackgroundDuplicated?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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,
|
|
15
|
-
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean) => Command;
|
|
14
|
+
export declare const getToolbarConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, getEditorFeatureFlags: GetEditorFeatureFlags, getEditorView: () => EditorView | null, options?: TablePluginOptions, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (config: PluginConfig) => FloatingToolbarHandler;
|
|
15
|
+
export declare const getDistributeConfig: (getEditorContainerWidth: GetEditorContainerWidth, editorAnalyticsAPI: EditorAnalyticsAPI | undefined | null, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean) => Command;
|
|
16
16
|
type AlignmentIcon = {
|
|
17
17
|
id?: string;
|
|
18
18
|
value: AlignmentOptions;
|
|
19
19
|
icon: React.ComponentClass<any>;
|
|
20
20
|
};
|
|
21
|
-
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, shouldUseIncreasedScalingPercent: boolean) => Array<FloatingToolbarDropdown<Command>>;
|
|
22
22
|
export declare const getSelectedAlignmentIcon: (alignmentIcons: AlignmentIcon[], selectedNode: PMNode) => AlignmentIcon | undefined;
|
|
23
|
-
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, shouldUseIncreasedScalingPercent: boolean) => boolean;
|
|
24
24
|
export {};
|
|
@@ -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, shouldUseIncreasedScalingPercent?: boolean) => (table: ContentNodeWithPos, view: EditorView | undefined) => (tr: Transaction) => Transaction;
|
|
24
|
+
export declare const rescaleColumns: (isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: 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, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
4
|
+
export declare const deleteColumns: (rect: Rect, allowCustomStep: boolean, view?: EditorView, isTableScalingEnabled?: boolean, isTableFixedColumnWidthsOptionEnabled?: boolean, shouldUseIncreasedScalingPercent?: boolean) => (tr: Transaction) => Transaction;
|
|
@@ -27,8 +27,9 @@ type DragMenuProps = {
|
|
|
27
27
|
isTableScalingEnabled?: boolean;
|
|
28
28
|
tableDuplicateCellColouring?: boolean;
|
|
29
29
|
shouldUseIncreasedScalingPercent?: boolean;
|
|
30
|
+
isTableFixedColumnWidthsOptionEnabled?: boolean;
|
|
30
31
|
};
|
|
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>;
|
|
32
|
+
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, isTableFixedColumnWidthsOptionEnabled, }: DragMenuProps & WrappedComponentProps) => jsx.JSX.Element | null>;
|
|
32
33
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<DragMenuProps & WrappedComponentProps>> & {
|
|
33
34
|
WrappedComponent: React.ComponentType<DragMenuProps & WrappedComponentProps>;
|
|
34
35
|
};
|
|
@@ -14,6 +14,7 @@ export interface Props {
|
|
|
14
14
|
isHeaderColumnEnabled?: boolean;
|
|
15
15
|
isHeaderRowEnabled?: boolean;
|
|
16
16
|
isDragAndDropEnabled?: boolean;
|
|
17
|
+
isTableScalingEnabled?: boolean;
|
|
17
18
|
mountPoint?: HTMLElement;
|
|
18
19
|
boundariesElement?: HTMLElement;
|
|
19
20
|
scrollableElement?: HTMLElement;
|