@atlaskit/editor-plugin-table 22.2.24 → 22.3.1
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/pm-plugins/main.js +4 -3
- package/dist/cjs/tablePlugin.js +5 -0
- package/dist/cjs/ui/FloatingDragMenu/index.js +9 -4
- package/dist/cjs/ui/TableMenu/row/RowMenu.compiled.css +6 -0
- package/dist/cjs/ui/TableMenu/row/RowMenu.js +35 -0
- package/dist/cjs/ui/TableMenu/row/RowMenuItems.js +130 -0
- package/dist/cjs/ui/TableMenu/row/getRowMenuComponents.js +189 -0
- package/dist/cjs/ui/TableMenu/row/keys.js +77 -0
- package/dist/cjs/ui/TableMenu/shared/consts.js +7 -0
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +11 -0
- package/dist/cjs/ui/TableMenu/shared/items/BackgroundColorItem.js +68 -0
- package/dist/cjs/ui/TableMenu/shared/items/ClearCellsItem.js +31 -0
- package/dist/es2019/pm-plugins/main.js +14 -11
- package/dist/es2019/tablePlugin.js +5 -0
- package/dist/es2019/ui/FloatingDragMenu/index.js +10 -5
- package/dist/es2019/ui/TableMenu/row/RowMenu.compiled.css +6 -0
- package/dist/es2019/ui/TableMenu/row/RowMenu.js +27 -0
- package/dist/es2019/ui/TableMenu/row/RowMenuItems.js +126 -0
- package/dist/es2019/ui/TableMenu/row/getRowMenuComponents.js +155 -0
- package/dist/es2019/ui/TableMenu/row/keys.js +87 -0
- package/dist/es2019/ui/TableMenu/shared/consts.js +1 -0
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +11 -0
- package/dist/es2019/ui/TableMenu/shared/items/BackgroundColorItem.js +60 -0
- package/dist/es2019/ui/TableMenu/shared/items/ClearCellsItem.js +26 -0
- package/dist/esm/pm-plugins/main.js +5 -4
- package/dist/esm/tablePlugin.js +5 -0
- package/dist/esm/ui/FloatingDragMenu/index.js +10 -5
- package/dist/esm/ui/TableMenu/row/RowMenu.compiled.css +6 -0
- package/dist/esm/ui/TableMenu/row/RowMenu.js +28 -0
- package/dist/esm/ui/TableMenu/row/RowMenuItems.js +123 -0
- package/dist/esm/ui/TableMenu/row/getRowMenuComponents.js +183 -0
- package/dist/esm/ui/TableMenu/row/keys.js +70 -0
- package/dist/esm/ui/TableMenu/shared/consts.js +1 -0
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.compiled.css +11 -0
- package/dist/esm/ui/TableMenu/shared/items/BackgroundColorItem.js +60 -0
- package/dist/esm/ui/TableMenu/shared/items/ClearCellsItem.js +24 -0
- package/dist/types/tablePluginType.d.ts +3 -1
- package/dist/types/ui/TableMenu/row/RowMenu.d.ts +7 -0
- package/dist/types/ui/TableMenu/row/RowMenuItems.d.ts +8 -0
- package/dist/types/ui/TableMenu/row/getRowMenuComponents.d.ts +9 -0
- package/dist/types/ui/TableMenu/row/keys.d.ts +20 -0
- package/dist/types/ui/TableMenu/shared/consts.d.ts +1 -0
- package/dist/types/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +10 -0
- package/dist/types/ui/TableMenu/shared/items/ClearCellsItem.d.ts +6 -0
- package/dist/types-ts4.5/tablePluginType.d.ts +3 -1
- package/dist/types-ts4.5/ui/TableMenu/row/RowMenu.d.ts +7 -0
- package/dist/types-ts4.5/ui/TableMenu/row/RowMenuItems.d.ts +8 -0
- package/dist/types-ts4.5/ui/TableMenu/row/getRowMenuComponents.d.ts +9 -0
- package/dist/types-ts4.5/ui/TableMenu/row/keys.d.ts +20 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/consts.d.ts +1 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/items/BackgroundColorItem.d.ts +10 -0
- package/dist/types-ts4.5/ui/TableMenu/shared/items/ClearCellsItem.d.ts +6 -0
- package/package.json +9 -5
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { bind } from 'bind-event-listener';
|
|
5
5
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
7
|
-
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
7
|
+
import { insideTable, isSSR } from '@atlaskit/editor-common/core-utils';
|
|
8
8
|
import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
9
9
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
10
10
|
import { transformSliceToRemoveOpenBodiedExtension, transformSliceToRemoveOpenExpand, transformSliceToRemoveOpenLayoutNodes, transformSliceToRemoveOpenMultiBodiedExtension, transformSliceToRemoveOpenNestedExpand } from '@atlaskit/editor-common/transforms';
|
|
@@ -59,7 +59,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
59
59
|
return editorView.state;
|
|
60
60
|
};
|
|
61
61
|
var getNodeView = function getNodeView() {
|
|
62
|
-
return {
|
|
62
|
+
return _objectSpread(_objectSpread({}, expValEquals('platform_editor_editor_ssr_streaming', 'isEnabled', true) && isSSR() ? {} : {
|
|
63
63
|
table: tableView({
|
|
64
64
|
portalProviderAPI: portalProviderAPI,
|
|
65
65
|
eventDispatcher: eventDispatcher,
|
|
@@ -70,7 +70,8 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
70
70
|
isCommentEditor: isCommentEditor,
|
|
71
71
|
isChromelessEditor: isChromelessEditor,
|
|
72
72
|
allowFixedColumnWidthOption: allowFixedColumnWidthOption
|
|
73
|
-
})
|
|
73
|
+
})
|
|
74
|
+
}), {}, {
|
|
74
75
|
tableRow: tableRowView({
|
|
75
76
|
eventDispatcher: eventDispatcher,
|
|
76
77
|
pluginInjectionApi: pluginInjectionApi
|
|
@@ -83,7 +84,7 @@ export var createPlugin = function createPlugin(dispatchAnalyticsEvent, dispatch
|
|
|
83
84
|
eventDispatcher: eventDispatcher,
|
|
84
85
|
pluginInjectionApi: pluginInjectionApi
|
|
85
86
|
})
|
|
86
|
-
};
|
|
87
|
+
});
|
|
87
88
|
};
|
|
88
89
|
var nodeViews = getNodeView();
|
|
89
90
|
return new SafePlugin({
|
package/dist/esm/tablePlugin.js
CHANGED
|
@@ -46,6 +46,7 @@ import { getHeightInfoPayload, getWidthInfoPayload } from './pm-plugins/utils/an
|
|
|
46
46
|
import { createTableWithWidth } from './pm-plugins/utils/create';
|
|
47
47
|
import { createPlugin as createViewModeSortPlugin } from './pm-plugins/view-mode-sort';
|
|
48
48
|
import { ContentComponent } from './ui/ContentComponent';
|
|
49
|
+
import { getRowMenuComponents } from './ui/TableMenu/row/getRowMenuComponents';
|
|
49
50
|
import { getToolbarConfig } from './ui/toolbar';
|
|
50
51
|
var defaultGetEditorFeatureFlags = function defaultGetEditorFeatureFlags() {
|
|
51
52
|
return {};
|
|
@@ -82,6 +83,10 @@ var tablePlugin = function tablePlugin(_ref) {
|
|
|
82
83
|
var isTableSelectorEnabled =
|
|
83
84
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
84
85
|
!(options !== null && options !== void 0 && options.isChromelessEditor) && !(options !== null && options !== void 0 && options.isCommentEditor) && (options === null || options === void 0 || (_options$getEditorFea2 = options.getEditorFeatureFlags) === null || _options$getEditorFea2 === void 0 ? void 0 : _options$getEditorFea2.call(options).tableSelector) && editorExperiment('platform_editor_controls', 'variant1');
|
|
86
|
+
if (expValEquals('platform_editor_table_menu_updates', 'isEnabled', true)) {
|
|
87
|
+
var _api$uiControlRegistr;
|
|
88
|
+
api === null || api === void 0 || (_api$uiControlRegistr = api.uiControlRegistry) === null || _api$uiControlRegistr === void 0 || _api$uiControlRegistr.actions.register(getRowMenuComponents());
|
|
89
|
+
}
|
|
85
90
|
return {
|
|
86
91
|
name: 'table',
|
|
87
92
|
// Use getSharedState to store fullWidthEnabled and wasFullWidthModeEnabled to guarantee access
|
|
@@ -3,9 +3,13 @@ import { Popup } from '@atlaskit/editor-common/ui';
|
|
|
3
3
|
import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
6
7
|
import { TableCssClassName as ClassName } from '../../types';
|
|
7
|
-
import { dragMenuDropdownWidth, tablePopupMenuFitHeight } from '../consts';
|
|
8
|
+
import { dragMenuDropdownWidth, dragTableInsertColumnButtonSize, tablePopupMenuFitHeight } from '../consts';
|
|
9
|
+
import { RowMenu } from '../TableMenu/row/RowMenu';
|
|
10
|
+
import { newMenuWidth } from '../TableMenu/shared/consts';
|
|
8
11
|
import DragMenu from './DragMenu';
|
|
12
|
+
var rowMenuOffset = dragTableInsertColumnButtonSize + 4;
|
|
9
13
|
var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
10
14
|
var _getEditorFeatureFlag;
|
|
11
15
|
var mountPoint = _ref.mountPoint,
|
|
@@ -32,7 +36,6 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
32
36
|
}
|
|
33
37
|
var inStickyMode = (stickyHeaders === null || stickyHeaders === void 0 ? void 0 : stickyHeaders.sticky) || (tableWrapper === null || tableWrapper === void 0 ? void 0 : tableWrapper.classList.contains(ClassName.TABLE_NODE_WRAPPER_NO_OVERFLOW)) && fg('platform_editor_table_sticky_header_patch_7');
|
|
34
38
|
var targetHandleRef = direction === 'row' ? document.querySelector('#drag-handle-button-row') : document.querySelector('#drag-handle-button-column');
|
|
35
|
-
var offset = direction === 'row' ? [-9, 0] : [0, -7];
|
|
36
39
|
if (!targetHandleRef || !(editorView.state.selection instanceof CellSelection)) {
|
|
37
40
|
return null;
|
|
38
41
|
}
|
|
@@ -50,7 +53,7 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
50
53
|
mountTo: mountPoint,
|
|
51
54
|
boundariesElement: boundariesElement,
|
|
52
55
|
scrollableElement: scrollableElement,
|
|
53
|
-
fitWidth: dragMenuDropdownWidth,
|
|
56
|
+
fitWidth: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? newMenuWidth : dragMenuDropdownWidth,
|
|
54
57
|
fitHeight: tablePopupMenuFitHeight
|
|
55
58
|
// z-index value below is to ensure that this menu is above other floating menu
|
|
56
59
|
// in table, but below floating dialogs like typeaheads, pickers, etc.
|
|
@@ -58,9 +61,11 @@ var FloatingDragMenu = function FloatingDragMenu(_ref) {
|
|
|
58
61
|
,
|
|
59
62
|
zIndex: inStickyMode ? akEditorFloatingDialogZIndex : akEditorFloatingOverlapPanelZIndex,
|
|
60
63
|
forcePlacement: true,
|
|
61
|
-
offset:
|
|
64
|
+
offset: expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? [rowMenuOffset, 0] : direction === 'row' ? [-9, 0] : [0, -7],
|
|
62
65
|
stick: true
|
|
63
|
-
}, /*#__PURE__*/React.createElement(
|
|
66
|
+
}, expValEquals('platform_editor_table_menu_updates', 'isEnabled', true) ? /*#__PURE__*/React.createElement(RowMenu, {
|
|
67
|
+
api: api
|
|
68
|
+
}) : /*#__PURE__*/React.createElement(DragMenu, {
|
|
64
69
|
editorView: editorView,
|
|
65
70
|
isOpen: isOpen,
|
|
66
71
|
tableNode: tableNode,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
3
|
+
._18m915vq{overflow-y:hidden}
|
|
4
|
+
._1bsb1178{width:280px}
|
|
5
|
+
._1reo15vq{overflow-x:hidden}
|
|
6
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* RowMenu.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./RowMenu.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
6
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
7
|
+
import { ROW_MENU } from './keys';
|
|
8
|
+
var rowMenuContainerStyles = {
|
|
9
|
+
container: "_2rko1qi0 _1reo15vq _18m915vq _1bsb1178 _16qs130s _bfhk1bhr"
|
|
10
|
+
};
|
|
11
|
+
export var RowMenu = function RowMenu(_ref) {
|
|
12
|
+
var _api$uiControlRegistr, _api$uiControlRegistr2;
|
|
13
|
+
var api = _ref.api;
|
|
14
|
+
var rowMenuComponents = (_api$uiControlRegistr = api === null || api === void 0 || (_api$uiControlRegistr2 = api.uiControlRegistry) === null || _api$uiControlRegistr2 === void 0 ? void 0 : _api$uiControlRegistr2.actions.getComponents(ROW_MENU.key)) !== null && _api$uiControlRegistr !== void 0 ? _api$uiControlRegistr : [];
|
|
15
|
+
var surface = rowMenuComponents.find(function (c) {
|
|
16
|
+
return c.type === ROW_MENU.type;
|
|
17
|
+
});
|
|
18
|
+
if (!surface) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
22
|
+
xcss: rowMenuContainerStyles.container,
|
|
23
|
+
testId: "row-handle-menu"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(SurfaceRenderer, {
|
|
25
|
+
surface: surface,
|
|
26
|
+
components: rowMenuComponents
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { addRowAfter, addRowBefore, deleteRow, moveRowDown, moveRowDownOld, moveRowUp, moveRowUpOld, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { DeleteIcon, TableRowAddAboveIcon, TableRowAddBelowIcon, TableRowMoveDownIcon, TableRowMoveUpIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
|
+
import Toggle from '@atlaskit/toggle';
|
|
8
|
+
export var HeaderRowToggleItem = function HeaderRowToggleItem() {
|
|
9
|
+
var _useIntl = useIntl(),
|
|
10
|
+
formatMessage = _useIntl.formatMessage;
|
|
11
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
12
|
+
testId: "row-menu-header-row-toggle",
|
|
13
|
+
elemAfter: /*#__PURE__*/React.createElement(Toggle, {
|
|
14
|
+
id: "row-menu-toggle-header-row",
|
|
15
|
+
label: formatMessage(messages.headerRow),
|
|
16
|
+
isChecked: false
|
|
17
|
+
})
|
|
18
|
+
}, formatMessage(messages.headerRow));
|
|
19
|
+
};
|
|
20
|
+
export var NumberedRowsToggleItem = function NumberedRowsToggleItem() {
|
|
21
|
+
var _useIntl2 = useIntl(),
|
|
22
|
+
formatMessage = _useIntl2.formatMessage;
|
|
23
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
24
|
+
testId: "row-menu-numbered-rows-toggle",
|
|
25
|
+
elemAfter: /*#__PURE__*/React.createElement(Toggle, {
|
|
26
|
+
id: "row-menu-toggle-numbered-rows",
|
|
27
|
+
label: formatMessage(messages.numberedRows),
|
|
28
|
+
isChecked: false
|
|
29
|
+
})
|
|
30
|
+
}, formatMessage(messages.numberedRows));
|
|
31
|
+
};
|
|
32
|
+
var getMoveRowUpShortcut = function getMoveRowUpShortcut() {
|
|
33
|
+
return tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowUp : moveRowUpOld);
|
|
34
|
+
};
|
|
35
|
+
var getMoveRowDownShortcut = function getMoveRowDownShortcut() {
|
|
36
|
+
return tooltip(expValEquals('editor-a11y-fy26-keyboard-move-row-column', 'isEnabled', true) ? moveRowDown : moveRowDownOld);
|
|
37
|
+
};
|
|
38
|
+
export var AddRowAboveItem = function AddRowAboveItem() {
|
|
39
|
+
var _tooltip;
|
|
40
|
+
var _useIntl3 = useIntl(),
|
|
41
|
+
formatMessage = _useIntl3.formatMessage;
|
|
42
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
43
|
+
testId: "row-menu-add-row-above",
|
|
44
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowAddAboveIcon, {
|
|
45
|
+
color: "currentColor",
|
|
46
|
+
label: "",
|
|
47
|
+
size: "small"
|
|
48
|
+
}),
|
|
49
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
50
|
+
shortcut: (_tooltip = tooltip(addRowBefore)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
51
|
+
})
|
|
52
|
+
}, formatMessage(messages.addRowAbove));
|
|
53
|
+
};
|
|
54
|
+
export var AddRowBelowItem = function AddRowBelowItem() {
|
|
55
|
+
var _tooltip2;
|
|
56
|
+
var _useIntl4 = useIntl(),
|
|
57
|
+
formatMessage = _useIntl4.formatMessage;
|
|
58
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
59
|
+
testId: "row-menu-add-row-below",
|
|
60
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowAddBelowIcon, {
|
|
61
|
+
color: "currentColor",
|
|
62
|
+
label: "",
|
|
63
|
+
size: "small"
|
|
64
|
+
}),
|
|
65
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
66
|
+
shortcut: (_tooltip2 = tooltip(addRowAfter)) !== null && _tooltip2 !== void 0 ? _tooltip2 : ''
|
|
67
|
+
})
|
|
68
|
+
}, formatMessage(messages.addRowBelow));
|
|
69
|
+
};
|
|
70
|
+
export var MoveRowUpItem = function MoveRowUpItem() {
|
|
71
|
+
var _getMoveRowUpShortcut;
|
|
72
|
+
var _useIntl5 = useIntl(),
|
|
73
|
+
formatMessage = _useIntl5.formatMessage;
|
|
74
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
75
|
+
testId: "row-menu-move-row-up",
|
|
76
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowMoveUpIcon, {
|
|
77
|
+
color: "currentColor",
|
|
78
|
+
label: "",
|
|
79
|
+
size: "small"
|
|
80
|
+
}),
|
|
81
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
82
|
+
shortcut: (_getMoveRowUpShortcut = getMoveRowUpShortcut()) !== null && _getMoveRowUpShortcut !== void 0 ? _getMoveRowUpShortcut : ''
|
|
83
|
+
})
|
|
84
|
+
}, formatMessage(messages.moveRowUp, {
|
|
85
|
+
0: 1
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
export var MoveRowDownItem = function MoveRowDownItem() {
|
|
89
|
+
var _getMoveRowDownShortc;
|
|
90
|
+
var _useIntl6 = useIntl(),
|
|
91
|
+
formatMessage = _useIntl6.formatMessage;
|
|
92
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
93
|
+
testId: "row-menu-move-row-down",
|
|
94
|
+
elemBefore: /*#__PURE__*/React.createElement(TableRowMoveDownIcon, {
|
|
95
|
+
color: "currentColor",
|
|
96
|
+
label: "",
|
|
97
|
+
size: "small"
|
|
98
|
+
}),
|
|
99
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
100
|
+
shortcut: (_getMoveRowDownShortc = getMoveRowDownShortcut()) !== null && _getMoveRowDownShortc !== void 0 ? _getMoveRowDownShortc : ''
|
|
101
|
+
})
|
|
102
|
+
}, formatMessage(messages.moveRowDown, {
|
|
103
|
+
0: 1
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
export var DeleteRowItem = function DeleteRowItem() {
|
|
107
|
+
var _tooltip3;
|
|
108
|
+
var _useIntl7 = useIntl(),
|
|
109
|
+
formatMessage = _useIntl7.formatMessage;
|
|
110
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
111
|
+
testId: "row-menu-delete-row",
|
|
112
|
+
elemBefore: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
113
|
+
color: "currentColor",
|
|
114
|
+
label: "",
|
|
115
|
+
size: "small"
|
|
116
|
+
}),
|
|
117
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
118
|
+
shortcut: (_tooltip3 = tooltip(deleteRow)) !== null && _tooltip3 !== void 0 ? _tooltip3 : ''
|
|
119
|
+
})
|
|
120
|
+
}, formatMessage(messages.removeRows, {
|
|
121
|
+
0: 1
|
|
122
|
+
}));
|
|
123
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToolbarDropdownItemSection } from '@atlaskit/editor-toolbar';
|
|
3
|
+
import { BackgroundColorItem } from '../shared/items/BackgroundColorItem';
|
|
4
|
+
import { ClearCellsItem } from '../shared/items/ClearCellsItem';
|
|
5
|
+
import { ROW_MENU, ROW_TOGGLE_SECTION, ROW_BACKGROUND_SECTION, ROW_ADD_SECTION, ROW_DANGER_SECTION, ROW_SECTION_RANK, HEADER_ROW_TOGGLE_ITEM, NUMBERED_ROWS_TOGGLE_ITEM, BACKGROUND_COLOR_ITEM, ADD_ROW_ABOVE_ITEM, ADD_ROW_BELOW_ITEM, MOVE_ROW_UP_ITEM, MOVE_ROW_DOWN_ITEM, CLEAR_CELLS_ITEM, DELETE_ROW_ITEM, TOGGLE_SECTION_ITEM_RANK, BACKGROUND_SECTION_ITEM_RANK, ADD_SECTION_ITEM_RANK, DANGER_SECTION_ITEM_RANK } from './keys';
|
|
6
|
+
import { HeaderRowToggleItem, NumberedRowsToggleItem, AddRowAboveItem, AddRowBelowItem, MoveRowUpItem, MoveRowDownItem, DeleteRowItem } from './RowMenuItems';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns the RegisterComponent[] array defining the row menu surface.
|
|
10
|
+
*
|
|
11
|
+
* This is a **UI-only stub** — all items are always visible with no conditional
|
|
12
|
+
* logic and no wired actions. Functional behaviour (actions, conditional visibility)
|
|
13
|
+
* will be connected in follow-up tickets.
|
|
14
|
+
*/
|
|
15
|
+
export var getRowMenuComponents = function getRowMenuComponents() {
|
|
16
|
+
return [
|
|
17
|
+
// --- Menu surface ---
|
|
18
|
+
{
|
|
19
|
+
type: ROW_MENU.type,
|
|
20
|
+
key: ROW_MENU.key
|
|
21
|
+
},
|
|
22
|
+
// --- Toggle section (Header row, Numbered rows) ---
|
|
23
|
+
{
|
|
24
|
+
type: ROW_TOGGLE_SECTION.type,
|
|
25
|
+
key: ROW_TOGGLE_SECTION.key,
|
|
26
|
+
parents: [{
|
|
27
|
+
type: ROW_MENU.type,
|
|
28
|
+
key: ROW_MENU.key,
|
|
29
|
+
rank: ROW_SECTION_RANK[ROW_TOGGLE_SECTION.key]
|
|
30
|
+
}],
|
|
31
|
+
component: function component(props) {
|
|
32
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, null, props.children);
|
|
33
|
+
}
|
|
34
|
+
}, {
|
|
35
|
+
type: HEADER_ROW_TOGGLE_ITEM.type,
|
|
36
|
+
key: HEADER_ROW_TOGGLE_ITEM.key,
|
|
37
|
+
parents: [{
|
|
38
|
+
type: ROW_TOGGLE_SECTION.type,
|
|
39
|
+
key: ROW_TOGGLE_SECTION.key,
|
|
40
|
+
rank: TOGGLE_SECTION_ITEM_RANK[HEADER_ROW_TOGGLE_ITEM.key]
|
|
41
|
+
}],
|
|
42
|
+
component: function component() {
|
|
43
|
+
return /*#__PURE__*/React.createElement(HeaderRowToggleItem, null);
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
type: NUMBERED_ROWS_TOGGLE_ITEM.type,
|
|
47
|
+
key: NUMBERED_ROWS_TOGGLE_ITEM.key,
|
|
48
|
+
parents: [{
|
|
49
|
+
type: ROW_TOGGLE_SECTION.type,
|
|
50
|
+
key: ROW_TOGGLE_SECTION.key,
|
|
51
|
+
rank: TOGGLE_SECTION_ITEM_RANK[NUMBERED_ROWS_TOGGLE_ITEM.key]
|
|
52
|
+
}],
|
|
53
|
+
component: function component() {
|
|
54
|
+
return /*#__PURE__*/React.createElement(NumberedRowsToggleItem, null);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
// --- Background color section ---
|
|
58
|
+
{
|
|
59
|
+
type: ROW_BACKGROUND_SECTION.type,
|
|
60
|
+
key: ROW_BACKGROUND_SECTION.key,
|
|
61
|
+
parents: [{
|
|
62
|
+
type: ROW_MENU.type,
|
|
63
|
+
key: ROW_MENU.key,
|
|
64
|
+
rank: ROW_SECTION_RANK[ROW_BACKGROUND_SECTION.key]
|
|
65
|
+
}],
|
|
66
|
+
component: function component(props) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
68
|
+
hasSeparator: true
|
|
69
|
+
}, props.children);
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
type: BACKGROUND_COLOR_ITEM.type,
|
|
73
|
+
key: BACKGROUND_COLOR_ITEM.key,
|
|
74
|
+
parents: [{
|
|
75
|
+
type: ROW_BACKGROUND_SECTION.type,
|
|
76
|
+
key: ROW_BACKGROUND_SECTION.key,
|
|
77
|
+
rank: BACKGROUND_SECTION_ITEM_RANK[BACKGROUND_COLOR_ITEM.key]
|
|
78
|
+
}],
|
|
79
|
+
component: function component() {
|
|
80
|
+
return /*#__PURE__*/React.createElement(BackgroundColorItem, {
|
|
81
|
+
testId: "row-menu-background-color"
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
// --- Add / Move section ---
|
|
86
|
+
{
|
|
87
|
+
type: ROW_ADD_SECTION.type,
|
|
88
|
+
key: ROW_ADD_SECTION.key,
|
|
89
|
+
parents: [{
|
|
90
|
+
type: ROW_MENU.type,
|
|
91
|
+
key: ROW_MENU.key,
|
|
92
|
+
rank: ROW_SECTION_RANK[ROW_ADD_SECTION.key]
|
|
93
|
+
}],
|
|
94
|
+
component: function component(props) {
|
|
95
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
96
|
+
hasSeparator: true
|
|
97
|
+
}, props.children);
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
type: ADD_ROW_ABOVE_ITEM.type,
|
|
101
|
+
key: ADD_ROW_ABOVE_ITEM.key,
|
|
102
|
+
parents: [{
|
|
103
|
+
type: ROW_ADD_SECTION.type,
|
|
104
|
+
key: ROW_ADD_SECTION.key,
|
|
105
|
+
rank: ADD_SECTION_ITEM_RANK[ADD_ROW_ABOVE_ITEM.key]
|
|
106
|
+
}],
|
|
107
|
+
component: function component() {
|
|
108
|
+
return /*#__PURE__*/React.createElement(AddRowAboveItem, null);
|
|
109
|
+
}
|
|
110
|
+
}, {
|
|
111
|
+
type: ADD_ROW_BELOW_ITEM.type,
|
|
112
|
+
key: ADD_ROW_BELOW_ITEM.key,
|
|
113
|
+
parents: [{
|
|
114
|
+
type: ROW_ADD_SECTION.type,
|
|
115
|
+
key: ROW_ADD_SECTION.key,
|
|
116
|
+
rank: ADD_SECTION_ITEM_RANK[ADD_ROW_BELOW_ITEM.key]
|
|
117
|
+
}],
|
|
118
|
+
component: function component() {
|
|
119
|
+
return /*#__PURE__*/React.createElement(AddRowBelowItem, null);
|
|
120
|
+
}
|
|
121
|
+
}, {
|
|
122
|
+
type: MOVE_ROW_UP_ITEM.type,
|
|
123
|
+
key: MOVE_ROW_UP_ITEM.key,
|
|
124
|
+
parents: [{
|
|
125
|
+
type: ROW_ADD_SECTION.type,
|
|
126
|
+
key: ROW_ADD_SECTION.key,
|
|
127
|
+
rank: ADD_SECTION_ITEM_RANK[MOVE_ROW_UP_ITEM.key]
|
|
128
|
+
}],
|
|
129
|
+
component: function component() {
|
|
130
|
+
return /*#__PURE__*/React.createElement(MoveRowUpItem, null);
|
|
131
|
+
}
|
|
132
|
+
}, {
|
|
133
|
+
type: MOVE_ROW_DOWN_ITEM.type,
|
|
134
|
+
key: MOVE_ROW_DOWN_ITEM.key,
|
|
135
|
+
parents: [{
|
|
136
|
+
type: ROW_ADD_SECTION.type,
|
|
137
|
+
key: ROW_ADD_SECTION.key,
|
|
138
|
+
rank: ADD_SECTION_ITEM_RANK[MOVE_ROW_DOWN_ITEM.key]
|
|
139
|
+
}],
|
|
140
|
+
component: function component() {
|
|
141
|
+
return /*#__PURE__*/React.createElement(MoveRowDownItem, null);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
// --- Danger section (Clear cells, Delete row) ---
|
|
145
|
+
{
|
|
146
|
+
type: ROW_DANGER_SECTION.type,
|
|
147
|
+
key: ROW_DANGER_SECTION.key,
|
|
148
|
+
parents: [{
|
|
149
|
+
type: ROW_MENU.type,
|
|
150
|
+
key: ROW_MENU.key,
|
|
151
|
+
rank: ROW_SECTION_RANK[ROW_DANGER_SECTION.key]
|
|
152
|
+
}],
|
|
153
|
+
component: function component(props) {
|
|
154
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
155
|
+
hasSeparator: true
|
|
156
|
+
}, props.children);
|
|
157
|
+
}
|
|
158
|
+
}, {
|
|
159
|
+
type: CLEAR_CELLS_ITEM.type,
|
|
160
|
+
key: CLEAR_CELLS_ITEM.key,
|
|
161
|
+
parents: [{
|
|
162
|
+
type: ROW_DANGER_SECTION.type,
|
|
163
|
+
key: ROW_DANGER_SECTION.key,
|
|
164
|
+
rank: DANGER_SECTION_ITEM_RANK[CLEAR_CELLS_ITEM.key]
|
|
165
|
+
}],
|
|
166
|
+
component: function component() {
|
|
167
|
+
return /*#__PURE__*/React.createElement(ClearCellsItem, {
|
|
168
|
+
testId: "row-menu-clear-cells"
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
type: DELETE_ROW_ITEM.type,
|
|
173
|
+
key: DELETE_ROW_ITEM.key,
|
|
174
|
+
parents: [{
|
|
175
|
+
type: ROW_DANGER_SECTION.type,
|
|
176
|
+
key: ROW_DANGER_SECTION.key,
|
|
177
|
+
rank: DANGER_SECTION_ITEM_RANK[DELETE_ROW_ITEM.key]
|
|
178
|
+
}],
|
|
179
|
+
component: function component() {
|
|
180
|
+
return /*#__PURE__*/React.createElement(DeleteRowItem, null);
|
|
181
|
+
}
|
|
182
|
+
}];
|
|
183
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
// --- Menu surface ---
|
|
3
|
+
|
|
4
|
+
export var ROW_MENU = {
|
|
5
|
+
type: 'menu',
|
|
6
|
+
key: 'row-handle-menu'
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// --- Sections ---
|
|
10
|
+
|
|
11
|
+
export var ROW_TOGGLE_SECTION = {
|
|
12
|
+
type: 'menu-section',
|
|
13
|
+
key: 'row-toggle-section'
|
|
14
|
+
};
|
|
15
|
+
export var ROW_BACKGROUND_SECTION = {
|
|
16
|
+
type: 'menu-section',
|
|
17
|
+
key: 'row-background-section'
|
|
18
|
+
};
|
|
19
|
+
export var ROW_ADD_SECTION = {
|
|
20
|
+
type: 'menu-section',
|
|
21
|
+
key: 'row-add-section'
|
|
22
|
+
};
|
|
23
|
+
export var ROW_DANGER_SECTION = {
|
|
24
|
+
type: 'menu-section',
|
|
25
|
+
key: 'row-danger-section'
|
|
26
|
+
};
|
|
27
|
+
export var ROW_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ROW_TOGGLE_SECTION.key, 100), ROW_BACKGROUND_SECTION.key, 200), ROW_ADD_SECTION.key, 300), ROW_DANGER_SECTION.key, 400);
|
|
28
|
+
export var HEADER_ROW_TOGGLE_ITEM = {
|
|
29
|
+
type: 'menu-item',
|
|
30
|
+
key: 'header-row-toggle'
|
|
31
|
+
};
|
|
32
|
+
export var NUMBERED_ROWS_TOGGLE_ITEM = {
|
|
33
|
+
type: 'menu-item',
|
|
34
|
+
key: 'numbered-rows-toggle'
|
|
35
|
+
};
|
|
36
|
+
export var BACKGROUND_COLOR_ITEM = {
|
|
37
|
+
type: 'menu-item',
|
|
38
|
+
key: 'background-color'
|
|
39
|
+
};
|
|
40
|
+
export var ADD_ROW_ABOVE_ITEM = {
|
|
41
|
+
type: 'menu-item',
|
|
42
|
+
key: 'add-row-above'
|
|
43
|
+
};
|
|
44
|
+
export var ADD_ROW_BELOW_ITEM = {
|
|
45
|
+
type: 'menu-item',
|
|
46
|
+
key: 'add-row-below'
|
|
47
|
+
};
|
|
48
|
+
export var MOVE_ROW_UP_ITEM = {
|
|
49
|
+
type: 'menu-item',
|
|
50
|
+
key: 'move-row-up'
|
|
51
|
+
};
|
|
52
|
+
export var MOVE_ROW_DOWN_ITEM = {
|
|
53
|
+
type: 'menu-item',
|
|
54
|
+
key: 'move-row-down'
|
|
55
|
+
};
|
|
56
|
+
export var CLEAR_CELLS_ITEM = {
|
|
57
|
+
type: 'menu-item',
|
|
58
|
+
key: 'clear-cells'
|
|
59
|
+
};
|
|
60
|
+
export var DELETE_ROW_ITEM = {
|
|
61
|
+
type: 'menu-item',
|
|
62
|
+
key: 'delete-row'
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// --- Item ranks within their sections ---
|
|
66
|
+
|
|
67
|
+
export var TOGGLE_SECTION_ITEM_RANK = _defineProperty(_defineProperty({}, HEADER_ROW_TOGGLE_ITEM.key, 100), NUMBERED_ROWS_TOGGLE_ITEM.key, 200);
|
|
68
|
+
export var BACKGROUND_SECTION_ITEM_RANK = _defineProperty({}, BACKGROUND_COLOR_ITEM.key, 100);
|
|
69
|
+
export var ADD_SECTION_ITEM_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ADD_ROW_ABOVE_ITEM.key, 100), ADD_ROW_BELOW_ITEM.key, 200), MOVE_ROW_UP_ITEM.key, 300), MOVE_ROW_DOWN_ITEM.key, 400);
|
|
70
|
+
export var DANGER_SECTION_ITEM_RANK = _defineProperty(_defineProperty({}, CLEAR_CELLS_ITEM.key, 100), DELETE_ROW_ITEM.key, 200);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export var newMenuWidth = 280;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
|
+
._zulp1b66{gap:var(--ds-space-050,4px)}._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
4
|
+
._1dqonqa1{border-style:solid}
|
|
5
|
+
._1h6d1l7x{border-color:var(--ds-border,#0b120e24)}
|
|
6
|
+
._1rjcu2gc{padding-block:var(--ds-space-100,8px)}
|
|
7
|
+
._1bsbdlk8{width:14px}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1o9zidpf{flex-shrink:0}
|
|
10
|
+
._4cvr1h6o{align-items:center}
|
|
11
|
+
._4t3idlk8{height:14px}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* BackgroundColorItem.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./BackgroundColorItem.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React, { useCallback, useMemo } from 'react';
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
|
+
import { backgroundPaletteTooltipMessages, cellBackgroundColorPalette, ColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
8
|
+
import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
|
|
9
|
+
import { NestedDropdownRightIcon, PaintBucketIcon, ToolbarNestedDropdownMenu } from '@atlaskit/editor-toolbar';
|
|
10
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
11
|
+
var colorPaletteColumns = 7;
|
|
12
|
+
var colorPaletteStyles = {
|
|
13
|
+
container: "_1rjcu2gc",
|
|
14
|
+
elemAfter: "_zulp1b66 _1e0c1txw _4cvr1h6o",
|
|
15
|
+
colorPreview: "_2rko12b0 _1h6d1l7x _1dqonqa1 _189ee4h9 _1bsbdlk8 _4t3idlk8 _1o9zidpf"
|
|
16
|
+
};
|
|
17
|
+
export var BackgroundColorItem = function BackgroundColorItem(_ref) {
|
|
18
|
+
var testId = _ref.testId;
|
|
19
|
+
var _useIntl = useIntl(),
|
|
20
|
+
formatMessage = _useIntl.formatMessage;
|
|
21
|
+
var selectedColor = '#ffffff';
|
|
22
|
+
var onClick = useCallback(function () {}, []);
|
|
23
|
+
var colorPreviewStyle = useMemo(function () {
|
|
24
|
+
return {
|
|
25
|
+
backgroundColor: selectedColor
|
|
26
|
+
};
|
|
27
|
+
}, [selectedColor]);
|
|
28
|
+
var paletteOptions = useMemo(function () {
|
|
29
|
+
return {
|
|
30
|
+
palette: cellBackgroundColorPalette,
|
|
31
|
+
paletteColorTooltipMessages: backgroundPaletteTooltipMessages,
|
|
32
|
+
hexToPaletteColor: hexToEditorBackgroundPaletteColor
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
|
|
36
|
+
testId: testId,
|
|
37
|
+
elemBefore: /*#__PURE__*/React.createElement(PaintBucketIcon, {
|
|
38
|
+
color: "currentColor",
|
|
39
|
+
label: "",
|
|
40
|
+
size: "small"
|
|
41
|
+
}),
|
|
42
|
+
elemAfter: /*#__PURE__*/React.createElement(Box, {
|
|
43
|
+
xcss: colorPaletteStyles.elemAfter
|
|
44
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
style: colorPreviewStyle,
|
|
46
|
+
className: ax([colorPaletteStyles.colorPreview])
|
|
47
|
+
}), /*#__PURE__*/React.createElement(NestedDropdownRightIcon, {
|
|
48
|
+
label: "",
|
|
49
|
+
size: "small"
|
|
50
|
+
})),
|
|
51
|
+
text: formatMessage(messages.backgroundColor)
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
53
|
+
xcss: colorPaletteStyles.container
|
|
54
|
+
}, /*#__PURE__*/React.createElement(ColorPalette, {
|
|
55
|
+
cols: colorPaletteColumns,
|
|
56
|
+
onClick: onClick,
|
|
57
|
+
selectedColor: selectedColor,
|
|
58
|
+
paletteOptions: paletteOptions
|
|
59
|
+
})));
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl';
|
|
3
|
+
import { backspace, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
4
|
+
import { tableMessages as messages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { CrossIcon, ToolbarDropdownItem, ToolbarKeyboardShortcutHint } from '@atlaskit/editor-toolbar';
|
|
6
|
+
export var ClearCellsItem = function ClearCellsItem(_ref) {
|
|
7
|
+
var _tooltip;
|
|
8
|
+
var testId = _ref.testId;
|
|
9
|
+
var _useIntl = useIntl(),
|
|
10
|
+
formatMessage = _useIntl.formatMessage;
|
|
11
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
12
|
+
testId: testId,
|
|
13
|
+
elemBefore: /*#__PURE__*/React.createElement(CrossIcon, {
|
|
14
|
+
color: "currentColor",
|
|
15
|
+
label: "",
|
|
16
|
+
size: "small"
|
|
17
|
+
}),
|
|
18
|
+
elemAfter: /*#__PURE__*/React.createElement(ToolbarKeyboardShortcutHint, {
|
|
19
|
+
shortcut: (_tooltip = tooltip(backspace)) !== null && _tooltip !== void 0 ? _tooltip : ''
|
|
20
|
+
})
|
|
21
|
+
}, formatMessage(messages.clearCells, {
|
|
22
|
+
0: 1
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
@@ -12,6 +12,7 @@ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
|
12
12
|
import type { LimitedModePlugin } from '@atlaskit/editor-plugin-limited-mode';
|
|
13
13
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
14
14
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
15
|
+
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
15
16
|
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
16
17
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
17
18
|
import type { PluginConfig, TableSharedState } from './types';
|
|
@@ -67,7 +68,8 @@ export type TablePluginDependencies = [
|
|
|
67
68
|
OptionalPlugin<ExtensionPlugin>,
|
|
68
69
|
OptionalPlugin<InteractionPlugin>,
|
|
69
70
|
OptionalPlugin<UserIntentPlugin>,
|
|
70
|
-
OptionalPlugin<ToolbarPlugin
|
|
71
|
+
OptionalPlugin<ToolbarPlugin>,
|
|
72
|
+
OptionalPlugin<UiControlRegistryPlugin>
|
|
71
73
|
];
|
|
72
74
|
export type TablePlugin = NextEditorPlugin<'table', {
|
|
73
75
|
actions: TablePluginActions;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const HeaderRowToggleItem: () => React.JSX.Element;
|
|
3
|
+
export declare const NumberedRowsToggleItem: () => React.JSX.Element;
|
|
4
|
+
export declare const AddRowAboveItem: () => React.JSX.Element;
|
|
5
|
+
export declare const AddRowBelowItem: () => React.JSX.Element;
|
|
6
|
+
export declare const MoveRowUpItem: () => React.JSX.Element;
|
|
7
|
+
export declare const MoveRowDownItem: () => React.JSX.Element;
|
|
8
|
+
export declare const DeleteRowItem: () => React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RegisterComponent } from '@atlaskit/editor-ui-control-model';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the RegisterComponent[] array defining the row menu surface.
|
|
4
|
+
*
|
|
5
|
+
* This is a **UI-only stub** — all items are always visible with no conditional
|
|
6
|
+
* logic and no wired actions. Functional behaviour (actions, conditional visibility)
|
|
7
|
+
* will be connected in follow-up tickets.
|
|
8
|
+
*/
|
|
9
|
+
export declare const getRowMenuComponents: () => RegisterComponent[];
|