@atlaskit/editor-plugin-layout 10.8.1 → 10.9.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 +22 -0
- package/dist/cjs/layoutPlugin.js +2 -5
- package/dist/cjs/pm-plugins/actions.js +112 -115
- package/dist/cjs/pm-plugins/utils/layout-column-selection.js +63 -96
- package/dist/cjs/ui/LayoutColumnMenu/DeleteColumnDropdownItem.js +7 -2
- package/dist/cjs/ui/LayoutColumnMenu/DistributeColumnsDropdownItem.js +16 -6
- package/dist/cjs/ui/LayoutColumnMenu/InsertColumnDropdownItem.js +4 -4
- package/dist/cjs/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +1 -1
- package/dist/cjs/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +2 -2
- package/dist/cjs/ui/LayoutColumnMenu/components.js +20 -9
- package/dist/cjs/ui/LayoutColumnMenu/index.js +6 -2
- package/dist/cjs/ui/LayoutColumnMenu/keys.js +8 -3
- package/dist/cjs/ui/LayoutColumnMenu/useSelectedLayoutColumns.js +4 -3
- package/dist/cjs/ui/LayoutColumnMenu/verticalAlignIcons.js +6 -6
- package/dist/cjs/ui/toolbar.js +69 -11
- package/dist/es2019/layoutPlugin.js +2 -5
- package/dist/es2019/pm-plugins/actions.js +45 -51
- package/dist/es2019/pm-plugins/utils/layout-column-selection.js +62 -91
- package/dist/es2019/ui/LayoutColumnMenu/DeleteColumnDropdownItem.js +8 -3
- package/dist/es2019/ui/LayoutColumnMenu/DistributeColumnsDropdownItem.js +18 -7
- package/dist/es2019/ui/LayoutColumnMenu/InsertColumnDropdownItem.js +4 -4
- package/dist/es2019/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +1 -1
- package/dist/es2019/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +2 -2
- package/dist/es2019/ui/LayoutColumnMenu/components.js +23 -10
- package/dist/es2019/ui/LayoutColumnMenu/index.js +6 -2
- package/dist/es2019/ui/LayoutColumnMenu/keys.js +10 -3
- package/dist/es2019/ui/LayoutColumnMenu/useSelectedLayoutColumns.js +6 -4
- package/dist/es2019/ui/LayoutColumnMenu/verticalAlignIcons.js +6 -6
- package/dist/es2019/ui/toolbar.js +67 -11
- package/dist/esm/layoutPlugin.js +3 -6
- package/dist/esm/pm-plugins/actions.js +113 -116
- package/dist/esm/pm-plugins/utils/layout-column-selection.js +62 -95
- package/dist/esm/ui/LayoutColumnMenu/DeleteColumnDropdownItem.js +8 -3
- package/dist/esm/ui/LayoutColumnMenu/DistributeColumnsDropdownItem.js +17 -7
- package/dist/esm/ui/LayoutColumnMenu/InsertColumnDropdownItem.js +4 -4
- package/dist/esm/ui/LayoutColumnMenu/VerticalAlignDropdownItem.js +1 -1
- package/dist/esm/ui/LayoutColumnMenu/VerticalAlignNestedMenu.js +2 -2
- package/dist/esm/ui/LayoutColumnMenu/components.js +21 -10
- package/dist/esm/ui/LayoutColumnMenu/index.js +6 -2
- package/dist/esm/ui/LayoutColumnMenu/keys.js +7 -2
- package/dist/esm/ui/LayoutColumnMenu/useSelectedLayoutColumns.js +5 -4
- package/dist/esm/ui/LayoutColumnMenu/verticalAlignIcons.js +6 -6
- package/dist/esm/ui/toolbar.js +70 -12
- package/dist/types/layoutPluginType.d.ts +3 -1
- package/dist/types/pm-plugins/actions.d.ts +5 -1
- package/dist/types/pm-plugins/utils/layout-column-selection.d.ts +9 -8
- package/dist/types/ui/LayoutColumnMenu/keys.d.ts +2 -0
- package/dist/types/ui/LayoutColumnMenu/verticalAlignIcons.d.ts +2 -2
- package/dist/types-ts4.5/layoutPluginType.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +5 -1
- package/dist/types-ts4.5/pm-plugins/utils/layout-column-selection.d.ts +9 -8
- package/dist/types-ts4.5/ui/LayoutColumnMenu/keys.d.ts +2 -0
- package/dist/types-ts4.5/ui/LayoutColumnMenu/verticalAlignIcons.d.ts +2 -2
- package/package.json +4 -3
|
@@ -3,21 +3,21 @@ import { useIntl } from 'react-intl';
|
|
|
3
3
|
import { layoutMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { TableColumnAddLeftIcon, TableColumnAddRightIcon, ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
5
5
|
import { getEffectiveMaxLayoutColumns } from '../../pm-plugins/actions';
|
|
6
|
-
import { getLayoutSectionColumnCount } from '../../pm-plugins/utils/layout-column-selection';
|
|
7
6
|
import { useSelectedLayoutColumns } from './useSelectedLayoutColumns';
|
|
8
7
|
var INSERT_COLUMN_OPTIONS = {
|
|
9
8
|
left: {
|
|
10
9
|
Icon: TableColumnAddLeftIcon,
|
|
11
|
-
label: layoutMessages.
|
|
10
|
+
label: layoutMessages.addColumnLeft,
|
|
12
11
|
side: 'left'
|
|
13
12
|
},
|
|
14
13
|
right: {
|
|
15
14
|
Icon: TableColumnAddRightIcon,
|
|
16
|
-
label: layoutMessages.
|
|
15
|
+
label: layoutMessages.addColumnRight,
|
|
17
16
|
side: 'right'
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
19
|
export var InsertColumnDropdownItem = function InsertColumnDropdownItem(_ref) {
|
|
20
|
+
var _selectedLayoutColumn, _selectedLayoutColumn2;
|
|
21
21
|
var api = _ref.api,
|
|
22
22
|
side = _ref.side;
|
|
23
23
|
var _useIntl = useIntl(),
|
|
@@ -26,7 +26,7 @@ export var InsertColumnDropdownItem = function InsertColumnDropdownItem(_ref) {
|
|
|
26
26
|
Icon = _INSERT_COLUMN_OPTION.Icon,
|
|
27
27
|
label = _INSERT_COLUMN_OPTION.label;
|
|
28
28
|
var selectedLayoutColumns = useSelectedLayoutColumns(api);
|
|
29
|
-
var columnCount =
|
|
29
|
+
var columnCount = (_selectedLayoutColumn = selectedLayoutColumns === null || selectedLayoutColumns === void 0 || (_selectedLayoutColumn2 = selectedLayoutColumns.layoutSectionNode) === null || _selectedLayoutColumn2 === void 0 ? void 0 : _selectedLayoutColumn2.childCount) !== null && _selectedLayoutColumn !== void 0 ? _selectedLayoutColumn : 0;
|
|
30
30
|
var maxColumnCount = getEffectiveMaxLayoutColumns();
|
|
31
31
|
var canInsertColumn = selectedLayoutColumns !== undefined && columnCount < maxColumnCount;
|
|
32
32
|
var onClick = useCallback(function () {
|
|
@@ -12,7 +12,7 @@ export var VerticalAlignDropdownItem = function VerticalAlignDropdownItem(_ref)
|
|
|
12
12
|
var _useIntl = useIntl(),
|
|
13
13
|
formatMessage = _useIntl.formatMessage;
|
|
14
14
|
var selectedLayoutColumns = useSelectedLayoutColumns(api);
|
|
15
|
-
var isSelected = (_selectedLayoutColumn = selectedLayoutColumns === null || selectedLayoutColumns === void 0 ? void 0 : selectedLayoutColumns.
|
|
15
|
+
var isSelected = (_selectedLayoutColumn = selectedLayoutColumns === null || selectedLayoutColumns === void 0 ? void 0 : selectedLayoutColumns.selectedLayoutColumns.every(function (_ref2) {
|
|
16
16
|
var node = _ref2.node;
|
|
17
17
|
return getLayoutColumnValign(node) === value;
|
|
18
18
|
})) !== null && _selectedLayoutColumn !== void 0 ? _selectedLayoutColumn : false;
|
|
@@ -12,7 +12,7 @@ export var VerticalAlignNestedMenu = function VerticalAlignNestedMenu(_ref) {
|
|
|
12
12
|
formatMessage = _useIntl.formatMessage;
|
|
13
13
|
var selectedLayoutColumns = useSelectedLayoutColumns(api);
|
|
14
14
|
var currentValign = useMemo(function () {
|
|
15
|
-
var selectedColumns = selectedLayoutColumns === null || selectedLayoutColumns === void 0 ? void 0 : selectedLayoutColumns.
|
|
15
|
+
var selectedColumns = selectedLayoutColumns === null || selectedLayoutColumns === void 0 ? void 0 : selectedLayoutColumns.selectedLayoutColumns;
|
|
16
16
|
var firstColumn = selectedColumns === null || selectedColumns === void 0 ? void 0 : selectedColumns[0];
|
|
17
17
|
var firstValign = getLayoutColumnValign(firstColumn === null || firstColumn === void 0 ? void 0 : firstColumn.node);
|
|
18
18
|
if (!firstValign || !(selectedColumns !== null && selectedColumns !== void 0 && selectedColumns.every(function (_ref2) {
|
|
@@ -23,7 +23,7 @@ export var VerticalAlignNestedMenu = function VerticalAlignNestedMenu(_ref) {
|
|
|
23
23
|
}
|
|
24
24
|
return firstValign;
|
|
25
25
|
}, [selectedLayoutColumns]);
|
|
26
|
-
var TriggerIcon = currentValign ? VERTICAL_ALIGN_ICONS[currentValign] : VERTICAL_ALIGN_ICONS.
|
|
26
|
+
var TriggerIcon = currentValign ? VERTICAL_ALIGN_ICONS[currentValign] : VERTICAL_ALIGN_ICONS.middle;
|
|
27
27
|
return /*#__PURE__*/React.createElement(ToolbarNestedDropdownMenu, {
|
|
28
28
|
elemBefore: /*#__PURE__*/React.createElement(TriggerIcon, {
|
|
29
29
|
label: "",
|
|
@@ -9,7 +9,7 @@ import { ToolbarMenuContainer } from '@atlaskit/editor-toolbar/toolbar-menu-cont
|
|
|
9
9
|
import { DeleteColumnDropdownItem } from './DeleteColumnDropdownItem';
|
|
10
10
|
import { DistributeColumnsDropdownItem } from './DistributeColumnsDropdownItem';
|
|
11
11
|
import { InsertColumnDropdownItem } from './InsertColumnDropdownItem';
|
|
12
|
-
import { DELETE_COLUMN_MENU_ITEM, DISTRIBUTE_COLUMNS_MENU_ITEM, INSERT_COLUMN_LEFT_MENU_ITEM, INSERT_COLUMN_RIGHT_MENU_ITEM, LAYOUT_COLUMN_MENU, LAYOUT_COLUMN_MENU_RANK, LAYOUT_COLUMN_MENU_SECTION, LAYOUT_COLUMN_MENU_SECTION_RANK, LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION, VERTICAL_ALIGN_BOTTOM_MENU_ITEM, VERTICAL_ALIGN_MENU, VERTICAL_ALIGN_MENU_RANK, VERTICAL_ALIGN_MENU_SECTION_RANK, VERTICAL_ALIGN_MIDDLE_MENU_ITEM, VERTICAL_ALIGN_TOP_MENU_ITEM } from './keys';
|
|
12
|
+
import { DELETE_COLUMN_MENU_ITEM, DISTRIBUTE_COLUMNS_MENU_ITEM, INSERT_COLUMN_LEFT_MENU_ITEM, INSERT_COLUMN_RIGHT_MENU_ITEM, LAYOUT_COLUMN_DANGER_SECTION, LAYOUT_COLUMN_DANGER_SECTION_RANK, LAYOUT_COLUMN_MENU, LAYOUT_COLUMN_MENU_RANK, LAYOUT_COLUMN_MENU_SECTION, LAYOUT_COLUMN_MENU_SECTION_RANK, LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION, VERTICAL_ALIGN_BOTTOM_MENU_ITEM, VERTICAL_ALIGN_MENU, VERTICAL_ALIGN_MENU_RANK, VERTICAL_ALIGN_MENU_SECTION_RANK, VERTICAL_ALIGN_MIDDLE_MENU_ITEM, VERTICAL_ALIGN_TOP_MENU_ITEM } from './keys';
|
|
13
13
|
import { VerticalAlignDropdownItem } from './VerticalAlignDropdownItem';
|
|
14
14
|
import { VerticalAlignNestedMenu } from './VerticalAlignNestedMenu';
|
|
15
15
|
var LayoutColumnMenuContainer = function LayoutColumnMenuContainer(_ref) {
|
|
@@ -62,15 +62,6 @@ export var getLayoutColumnMenuComponents = function getLayoutColumnMenuComponent
|
|
|
62
62
|
parents: [_objectSpread(_objectSpread({}, LAYOUT_COLUMN_MENU_SECTION), {}, {
|
|
63
63
|
rank: LAYOUT_COLUMN_MENU_SECTION_RANK[DISTRIBUTE_COLUMNS_MENU_ITEM.key]
|
|
64
64
|
})]
|
|
65
|
-
}), _objectSpread(_objectSpread({}, DELETE_COLUMN_MENU_ITEM), {}, {
|
|
66
|
-
component: function component() {
|
|
67
|
-
return /*#__PURE__*/React.createElement(DeleteColumnDropdownItem, {
|
|
68
|
-
api: api
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
parents: [_objectSpread(_objectSpread({}, LAYOUT_COLUMN_MENU_SECTION), {}, {
|
|
72
|
-
rank: LAYOUT_COLUMN_MENU_SECTION_RANK[DELETE_COLUMN_MENU_ITEM.key]
|
|
73
|
-
})]
|
|
74
65
|
}), _objectSpread(_objectSpread({}, VERTICAL_ALIGN_MENU), {}, {
|
|
75
66
|
component: function component(_ref4) {
|
|
76
67
|
var children = _ref4.children;
|
|
@@ -118,5 +109,25 @@ export var getLayoutColumnMenuComponents = function getLayoutColumnMenuComponent
|
|
|
118
109
|
parents: [_objectSpread(_objectSpread({}, LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION), {}, {
|
|
119
110
|
rank: VERTICAL_ALIGN_MENU_SECTION_RANK[VERTICAL_ALIGN_BOTTOM_MENU_ITEM.key]
|
|
120
111
|
})]
|
|
112
|
+
}), // --- Danger section (Delete column) ---
|
|
113
|
+
_objectSpread(_objectSpread({}, LAYOUT_COLUMN_DANGER_SECTION), {}, {
|
|
114
|
+
component: function component(_ref5) {
|
|
115
|
+
var children = _ref5.children;
|
|
116
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItemSection, {
|
|
117
|
+
hasSeparator: true
|
|
118
|
+
}, children);
|
|
119
|
+
},
|
|
120
|
+
parents: [_objectSpread(_objectSpread({}, LAYOUT_COLUMN_MENU), {}, {
|
|
121
|
+
rank: LAYOUT_COLUMN_MENU_RANK[LAYOUT_COLUMN_DANGER_SECTION.key]
|
|
122
|
+
})]
|
|
123
|
+
}), _objectSpread(_objectSpread({}, DELETE_COLUMN_MENU_ITEM), {}, {
|
|
124
|
+
component: function component() {
|
|
125
|
+
return /*#__PURE__*/React.createElement(DeleteColumnDropdownItem, {
|
|
126
|
+
api: api
|
|
127
|
+
});
|
|
128
|
+
},
|
|
129
|
+
parents: [_objectSpread(_objectSpread({}, LAYOUT_COLUMN_DANGER_SECTION), {}, {
|
|
130
|
+
rank: LAYOUT_COLUMN_DANGER_SECTION_RANK[DELETE_COLUMN_MENU_ITEM.key]
|
|
131
|
+
})]
|
|
121
132
|
})];
|
|
122
133
|
};
|
|
@@ -3,6 +3,7 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
3
3
|
import { DRAG_HANDLE_SELECTOR } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { withReactEditorViewOuterListeners } from '@atlaskit/editor-common/ui-react';
|
|
6
|
+
import { UserIntentPopupWrapper } from '@atlaskit/editor-common/user-intent';
|
|
6
7
|
import { akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
8
|
import { ToolbarDropdownMenuProvider } from '@atlaskit/editor-toolbar';
|
|
8
9
|
import { SurfaceRenderer } from '@atlaskit/editor-ui-control-model';
|
|
@@ -18,7 +19,7 @@ var TOOLBAR_MENU_SELECTOR = '[data-toolbar-component="menu"]';
|
|
|
18
19
|
*/
|
|
19
20
|
var getLayoutColumnMenuTarget = function getLayoutColumnMenuTarget(editorView, selection, anchorPosFromHandle) {
|
|
20
21
|
var _columnDomRef$parentE;
|
|
21
|
-
var anchorPos = getLayoutColumnMenuAnchorPos(selection, anchorPosFromHandle);
|
|
22
|
+
var anchorPos = selection && getLayoutColumnMenuAnchorPos(selection, anchorPosFromHandle);
|
|
22
23
|
if (anchorPos === undefined) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
@@ -96,6 +97,9 @@ export var LayoutColumnMenu = /*#__PURE__*/React.memo(function LayoutColumnMenu(
|
|
|
96
97
|
offset: LAYOUT_COLUMN_MENU_POPUP_OFFSET,
|
|
97
98
|
handleClickOutside: handleClickOutside,
|
|
98
99
|
handleEscapeKeydown: closeLayoutColumnMenu
|
|
100
|
+
}, /*#__PURE__*/React.createElement(UserIntentPopupWrapper, {
|
|
101
|
+
api: api,
|
|
102
|
+
userIntent: "layoutColumnMenuPopupOpen"
|
|
99
103
|
}, /*#__PURE__*/React.createElement(ToolbarDropdownMenuProvider, {
|
|
100
104
|
isOpen: isLayoutColumnMenuOpen,
|
|
101
105
|
setIsOpen: handleSetIsOpen
|
|
@@ -103,5 +107,5 @@ export var LayoutColumnMenu = /*#__PURE__*/React.memo(function LayoutColumnMenu(
|
|
|
103
107
|
components: components,
|
|
104
108
|
fallbacks: LAYOUT_COLUMN_MENU_FALLBACKS,
|
|
105
109
|
surface: LAYOUT_COLUMN_MENU
|
|
106
|
-
})));
|
|
110
|
+
}))));
|
|
107
111
|
});
|
|
@@ -16,7 +16,11 @@ export var LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION = {
|
|
|
16
16
|
type: 'menu-section',
|
|
17
17
|
key: 'layout-column-vertical-align-menu-section'
|
|
18
18
|
};
|
|
19
|
-
export var
|
|
19
|
+
export var LAYOUT_COLUMN_DANGER_SECTION = {
|
|
20
|
+
type: 'menu-section',
|
|
21
|
+
key: 'layout-column-danger-section'
|
|
22
|
+
};
|
|
23
|
+
export var LAYOUT_COLUMN_MENU_RANK = _defineProperty(_defineProperty({}, LAYOUT_COLUMN_MENU_SECTION.key, 100), LAYOUT_COLUMN_DANGER_SECTION.key, 200);
|
|
20
24
|
|
|
21
25
|
// --- Menus ---
|
|
22
26
|
|
|
@@ -58,6 +62,7 @@ export var DELETE_COLUMN_MENU_ITEM = {
|
|
|
58
62
|
|
|
59
63
|
// --- Item ranks within sections ---
|
|
60
64
|
|
|
61
|
-
export var LAYOUT_COLUMN_MENU_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty(
|
|
65
|
+
export var LAYOUT_COLUMN_MENU_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, VERTICAL_ALIGN_MENU.key, 100), INSERT_COLUMN_LEFT_MENU_ITEM.key, 200), INSERT_COLUMN_RIGHT_MENU_ITEM.key, 300), DISTRIBUTE_COLUMNS_MENU_ITEM.key, 400);
|
|
66
|
+
export var LAYOUT_COLUMN_DANGER_SECTION_RANK = _defineProperty({}, DELETE_COLUMN_MENU_ITEM.key, 100);
|
|
62
67
|
export var VERTICAL_ALIGN_MENU_RANK = _defineProperty({}, LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION.key, 100);
|
|
63
68
|
export var VERTICAL_ALIGN_MENU_SECTION_RANK = _defineProperty(_defineProperty(_defineProperty({}, VERTICAL_ALIGN_TOP_MENU_ITEM.key, 100), VERTICAL_ALIGN_MIDDLE_MENU_ITEM.key, 200), VERTICAL_ALIGN_BOTTOM_MENU_ITEM.key, 300);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
2
|
-
import {
|
|
2
|
+
import { getSelectedLayoutColumnsFromSelection } from '../../pm-plugins/utils/layout-column-selection';
|
|
3
3
|
export var useSelectedLayoutColumns = function useSelectedLayoutColumns(api) {
|
|
4
|
-
return useSharedPluginStateWithSelector(api, ['selection'], function (
|
|
5
|
-
var
|
|
6
|
-
|
|
4
|
+
return useSharedPluginStateWithSelector(api, ['selection'], function (_ref) {
|
|
5
|
+
var selectionState = _ref.selectionState;
|
|
6
|
+
var selectedLayoutColumns = (selectionState === null || selectionState === void 0 ? void 0 : selectionState.selection) && getSelectedLayoutColumnsFromSelection(selectionState.selection);
|
|
7
|
+
return selectedLayoutColumns !== null && selectedLayoutColumns !== void 0 && selectedLayoutColumns.selectedLayoutColumns.length ? selectedLayoutColumns : undefined;
|
|
7
8
|
});
|
|
8
9
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Disable no-re-export here, this is a useful mapping file for icon lookup used in multiple places
|
|
2
2
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
4
|
+
import AlignPositionBottomIcon from '@atlaskit/icon-lab/core/align-position-bottom';
|
|
5
|
+
import AlignPositionCenterVerticalIcon from '@atlaskit/icon-lab/core/align-position-center-vertical';
|
|
6
|
+
import AlignPositionTopIcon from '@atlaskit/icon-lab/core/align-position-top';
|
|
7
7
|
export var VERTICAL_ALIGN_ICONS = {
|
|
8
|
-
top:
|
|
9
|
-
middle:
|
|
10
|
-
bottom:
|
|
8
|
+
top: AlignPositionTopIcon,
|
|
9
|
+
middle: AlignPositionCenterVerticalIcon,
|
|
10
|
+
bottom: AlignPositionBottomIcon
|
|
11
11
|
};
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -16,8 +16,11 @@ import LayoutThreeColumnsSidebarsIcon from '@atlaskit/icon/core/layout-three-col
|
|
|
16
16
|
import LayoutTwoColumnsIcon from '@atlaskit/icon/core/layout-two-columns';
|
|
17
17
|
import LayoutTwoColumnsSidebarLeftIcon from '@atlaskit/icon/core/layout-two-columns-sidebar-left';
|
|
18
18
|
import LayoutTwoColumnsSidebarRightIcon from '@atlaskit/icon/core/layout-two-columns-sidebar-right';
|
|
19
|
+
import TableColumnsDistributeIcon from '@atlaskit/icon/core/table-columns-distribute';
|
|
20
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
19
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
20
|
-
import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
|
|
22
|
+
import { deleteActiveLayoutNode, distributeLayoutColumns, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
|
|
23
|
+
import { isDistributedUniformly } from '../pm-plugins/utils/layout-column-distribution';
|
|
21
24
|
import { EditorLayoutFiveColumnsIcon, EditorLayoutFourColumnsIcon } from './icons/LayoutColumnsIcon';
|
|
22
25
|
import { LayoutThreeWithLeftSidebarsIcon } from './icons/LayoutThreeWithLeftSidebars';
|
|
23
26
|
import { LayoutThreeWithRightSidebarsIcon } from './icons/LayoutThreeWithRightSidebars';
|
|
@@ -56,7 +59,7 @@ var SIDEBAR_LAYOUT_TYPES = [{
|
|
|
56
59
|
}];
|
|
57
60
|
|
|
58
61
|
// These are used for advanced layout options
|
|
59
|
-
var
|
|
62
|
+
var LAYOUT_WITH_TWO_COL_DISTRIBUTION_OLD = [{
|
|
60
63
|
id: 'editor.layout.twoEquals',
|
|
61
64
|
type: 'two_equal',
|
|
62
65
|
title: toolbarMessages.twoColumns,
|
|
@@ -72,7 +75,7 @@ var LAYOUT_WITH_TWO_COL_DISTRIBUTION = [{
|
|
|
72
75
|
title: toolbarMessages.leftSidebar,
|
|
73
76
|
icon: LayoutTwoColumnsSidebarLeftIcon
|
|
74
77
|
}];
|
|
75
|
-
var
|
|
78
|
+
var LAYOUT_WITH_THREE_COL_DISTRIBUTION_OLD = [{
|
|
76
79
|
id: 'editor.layout.threeEquals',
|
|
77
80
|
type: 'three_equal',
|
|
78
81
|
title: toolbarMessages.threeColumns,
|
|
@@ -95,6 +98,35 @@ var LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
|
|
|
95
98
|
icon: LayoutThreeWithLeftSidebarsIcon,
|
|
96
99
|
iconFallback: LayoutThreeWithLeftSidebarsIcon
|
|
97
100
|
}];
|
|
101
|
+
var LAYOUT_WITH_TWO_COL_DISTRIBUTION = [{
|
|
102
|
+
id: 'editor.layout.twoRightSidebar',
|
|
103
|
+
type: 'two_right_sidebar',
|
|
104
|
+
title: toolbarMessages.rightSidebar,
|
|
105
|
+
icon: LayoutTwoColumnsSidebarRightIcon
|
|
106
|
+
}, {
|
|
107
|
+
id: 'editor.layout.twoLeftSidebar',
|
|
108
|
+
type: 'two_left_sidebar',
|
|
109
|
+
title: toolbarMessages.leftSidebar,
|
|
110
|
+
icon: LayoutTwoColumnsSidebarLeftIcon
|
|
111
|
+
}];
|
|
112
|
+
var LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
|
|
113
|
+
id: 'editor.layout.threeWithSidebars',
|
|
114
|
+
type: 'three_with_sidebars',
|
|
115
|
+
title: toolbarMessages.threeColumnsWithSidebars,
|
|
116
|
+
icon: LayoutThreeColumnsSidebarsIcon
|
|
117
|
+
}, {
|
|
118
|
+
id: 'editor.layout.threeRightSidebars',
|
|
119
|
+
type: 'three_right_sidebars',
|
|
120
|
+
title: toolbarMessages.threeColumnsWithRightSidebars,
|
|
121
|
+
icon: LayoutThreeWithRightSidebarsIcon,
|
|
122
|
+
iconFallback: LayoutThreeWithRightSidebarsIcon
|
|
123
|
+
}, {
|
|
124
|
+
id: 'editor.layout.threeLeftSidebars',
|
|
125
|
+
type: 'three_left_sidebars',
|
|
126
|
+
title: toolbarMessages.threeColumnsWithLeftSidebars,
|
|
127
|
+
icon: LayoutThreeWithLeftSidebarsIcon,
|
|
128
|
+
iconFallback: LayoutThreeWithLeftSidebarsIcon
|
|
129
|
+
}];
|
|
98
130
|
var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
|
|
99
131
|
return {
|
|
100
132
|
id: item.id,
|
|
@@ -109,7 +141,9 @@ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, ed
|
|
|
109
141
|
};
|
|
110
142
|
};
|
|
111
143
|
export var layoutToolbarTitle = 'Layout floating controls';
|
|
112
|
-
var iconPlaceholder = LayoutTwoColumnsIcon
|
|
144
|
+
var iconPlaceholder = /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
|
|
145
|
+
label: ""
|
|
146
|
+
}); // TODO: ED-25466 - Replace with proper icon
|
|
113
147
|
|
|
114
148
|
var getLayoutColumnsIcons = function getLayoutColumnsIcons(colCount) {
|
|
115
149
|
if (!editorExperiment('single_column_layouts', true) && !editorExperiment('platform_editor_controls', 'variant1')) {
|
|
@@ -136,11 +170,15 @@ var getLayoutColumnsIcons = function getLayoutColumnsIcons(colCount) {
|
|
|
136
170
|
return undefined;
|
|
137
171
|
}
|
|
138
172
|
};
|
|
173
|
+
var getLayoutColumnWidths = function getLayoutColumnWidths(node) {
|
|
174
|
+
return node.children.map(function (child) {
|
|
175
|
+
return child.attrs.width;
|
|
176
|
+
});
|
|
177
|
+
};
|
|
139
178
|
var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
140
179
|
var addSidebarLayouts = _ref.addSidebarLayouts,
|
|
141
180
|
intl = _ref.intl,
|
|
142
181
|
editorAnalyticsAPI = _ref.editorAnalyticsAPI,
|
|
143
|
-
state = _ref.state,
|
|
144
182
|
node = _ref.node,
|
|
145
183
|
nodeType = _ref.nodeType,
|
|
146
184
|
separator = _ref.separator,
|
|
@@ -148,7 +186,8 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
|
148
186
|
currentLayout = _ref.currentLayout,
|
|
149
187
|
allowAdvancedSingleColumnLayout = _ref.allowAdvancedSingleColumnLayout;
|
|
150
188
|
var numberOfColumns = node.content.childCount || 2;
|
|
151
|
-
var
|
|
189
|
+
var isLayoutColumnMenuEnabled = expValEqualsNoExposure('platform_editor_layout_column_menu', 'isEnabled', true);
|
|
190
|
+
var distributionOptions = isLayoutColumnMenuEnabled ? numberOfColumns === 2 ? LAYOUT_WITH_TWO_COL_DISTRIBUTION : numberOfColumns === 3 ? LAYOUT_WITH_THREE_COL_DISTRIBUTION : [] : numberOfColumns === 2 ? LAYOUT_WITH_TWO_COL_DISTRIBUTION_OLD : numberOfColumns === 3 ? LAYOUT_WITH_THREE_COL_DISTRIBUTION_OLD : [];
|
|
152
191
|
var columnOptions = [{
|
|
153
192
|
title: intl.formatMessage(layoutMessages.columnOption, {
|
|
154
193
|
count: 2
|
|
@@ -182,7 +221,7 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
|
182
221
|
onClick: setPresetLayout(editorAnalyticsAPI)('five_equal'),
|
|
183
222
|
selected: numberOfColumns === 5
|
|
184
223
|
}];
|
|
185
|
-
var
|
|
224
|
+
var dropdownOptions = [].concat(_toConsumableArray(allowAdvancedSingleColumnLayout ? [{
|
|
186
225
|
title: intl.formatMessage(layoutMessages.columnOption, {
|
|
187
226
|
count: 1
|
|
188
227
|
}),
|
|
@@ -190,19 +229,39 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
|
190
229
|
icon: getLayoutColumnsIcons(1) || iconPlaceholder,
|
|
191
230
|
onClick: setPresetLayout(editorAnalyticsAPI)('single'),
|
|
192
231
|
selected: numberOfColumns === 1
|
|
193
|
-
} : [];
|
|
232
|
+
}] : []), columnOptions);
|
|
233
|
+
var distributeColumnsButton = isLayoutColumnMenuEnabled && numberOfColumns > 1 ? {
|
|
234
|
+
disabled: isDistributedUniformly(getLayoutColumnWidths(node)),
|
|
235
|
+
icon: TableColumnsDistributeIcon,
|
|
236
|
+
onClick: function onClick(editorState, dispatch) {
|
|
237
|
+
var tr = distributeLayoutColumns(editorAnalyticsAPI)({
|
|
238
|
+
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
239
|
+
target: 'allColumns'
|
|
240
|
+
})({
|
|
241
|
+
tr: editorState.tr
|
|
242
|
+
});
|
|
243
|
+
if (!tr) {
|
|
244
|
+
return false;
|
|
245
|
+
}
|
|
246
|
+
dispatch === null || dispatch === void 0 || dispatch(tr);
|
|
247
|
+
return true;
|
|
248
|
+
},
|
|
249
|
+
testId: 'layout-distribute-columns',
|
|
250
|
+
title: intl.formatMessage(layoutMessages.distributeColumns),
|
|
251
|
+
type: 'button'
|
|
252
|
+
} : undefined;
|
|
194
253
|
return [{
|
|
195
254
|
type: 'dropdown',
|
|
196
255
|
title: intl.formatMessage(layoutMessages.columnOption, {
|
|
197
256
|
count: numberOfColumns
|
|
198
257
|
}),
|
|
199
258
|
//`${numberOfColumns}-columns`,
|
|
200
|
-
options:
|
|
259
|
+
options: dropdownOptions,
|
|
201
260
|
showSelected: true,
|
|
202
261
|
testId: 'column-options-button'
|
|
203
|
-
}].concat(_toConsumableArray(distributionOptions.length > 0 ? [separator] : []), _toConsumableArray(addSidebarLayouts ? distributionOptions.map(function (i) {
|
|
262
|
+
}].concat(_toConsumableArray(distributionOptions.length > 0 || distributeColumnsButton ? [separator] : []), _toConsumableArray(addSidebarLayouts ? distributionOptions.map(function (i) {
|
|
204
263
|
return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
|
|
205
|
-
}) : []));
|
|
264
|
+
}) : []), _toConsumableArray(distributeColumnsButton ? [distributeColumnsButton] : []));
|
|
206
265
|
};
|
|
207
266
|
var fullHeightSeparator = {
|
|
208
267
|
type: 'separator',
|
|
@@ -291,7 +350,6 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
|
|
|
291
350
|
addSidebarLayouts: addSidebarLayouts,
|
|
292
351
|
intl: intl,
|
|
293
352
|
editorAnalyticsAPI: editorAnalyticsAPI,
|
|
294
|
-
state: state,
|
|
295
353
|
nodeType: nodeType,
|
|
296
354
|
node: node,
|
|
297
355
|
separator: separator,
|
|
@@ -8,6 +8,7 @@ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
|
8
8
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
9
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
10
10
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
11
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
11
12
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
12
13
|
import type { deleteLayoutColumn, distributeLayoutColumns, InsertLayoutColumnSide, insertLayoutColumnsWithAnalytics, setLayoutColumnValign, toggleLayoutColumnMenu } from './pm-plugins/actions';
|
|
13
14
|
import type { LayoutState } from './pm-plugins/types';
|
|
@@ -22,7 +23,8 @@ export type LayoutPluginDependencies = [
|
|
|
22
23
|
OptionalPlugin<InteractionPlugin>,
|
|
23
24
|
OptionalPlugin<BlockMenuPlugin>,
|
|
24
25
|
OptionalPlugin<ToolbarPlugin>,
|
|
25
|
-
OptionalPlugin<UiControlRegistryPlugin
|
|
26
|
+
OptionalPlugin<UiControlRegistryPlugin>,
|
|
27
|
+
OptionalPlugin<UserIntentPlugin>
|
|
26
28
|
];
|
|
27
29
|
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
28
30
|
actions: {
|
|
@@ -35,7 +35,11 @@ export type InsertLayoutColumnSide = 'left' | 'right';
|
|
|
35
35
|
export declare function getEffectiveMaxLayoutColumns(): number;
|
|
36
36
|
export declare const insertLayoutColumn: (side: InsertLayoutColumnSide, editorAnalyticsAPI?: EditorAnalyticsAPI) => EditorCommand;
|
|
37
37
|
export declare const setLayoutColumnValign: (valign: Valign, editorAnalyticsAPI?: EditorAnalyticsAPI) => EditorCommand;
|
|
38
|
-
|
|
38
|
+
type DistributeLayoutColumnsOptions = {
|
|
39
|
+
inputMethod?: INPUT_METHOD.LAYOUT_COLUMN_MENU | INPUT_METHOD.FLOATING_TB;
|
|
40
|
+
target?: 'selectedColumns' | 'allColumns';
|
|
41
|
+
};
|
|
42
|
+
export declare const distributeLayoutColumns: (editorAnalyticsAPI?: EditorAnalyticsAPI) => ({ inputMethod, target, }?: DistributeLayoutColumnsOptions) => EditorCommand;
|
|
39
43
|
export declare const toggleLayoutColumnMenu: ({ anchorPos, isOpen }: {
|
|
40
44
|
anchorPos?: number;
|
|
41
45
|
isOpen?: boolean;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { Valign } from '@atlaskit/adf-schema/layout-column';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type
|
|
4
|
-
|
|
5
|
-
index: number;
|
|
3
|
+
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
type FoundNode = {
|
|
6
5
|
node: PMNode;
|
|
7
6
|
pos: number;
|
|
8
7
|
};
|
|
9
8
|
export type SelectedLayoutColumns = {
|
|
9
|
+
endIndex: number;
|
|
10
10
|
layoutSectionNode: PMNode;
|
|
11
11
|
layoutSectionPos: number;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
selectedLayoutColumns: FoundNode[];
|
|
13
|
+
startIndex: number;
|
|
14
14
|
};
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
15
|
+
export declare const getSelectedLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
|
|
16
|
+
export declare const getAllLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
|
|
17
17
|
export declare const getLayoutColumnValign: (layoutColumn: PMNode | undefined) => Valign | undefined;
|
|
18
|
-
export declare const getLayoutColumnMenuAnchorPos: (selection: Selection
|
|
18
|
+
export declare const getLayoutColumnMenuAnchorPos: (selection: Selection, anchorPosFromHandle?: number) => number | undefined;
|
|
19
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import type { MenuItemType, MenuSectionType, MenuType, NestedMenuType } from '@a
|
|
|
2
2
|
export declare const LAYOUT_COLUMN_MENU: MenuType;
|
|
3
3
|
export declare const LAYOUT_COLUMN_MENU_SECTION: MenuSectionType;
|
|
4
4
|
export declare const LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION: MenuSectionType;
|
|
5
|
+
export declare const LAYOUT_COLUMN_DANGER_SECTION: MenuSectionType;
|
|
5
6
|
export declare const LAYOUT_COLUMN_MENU_RANK: Record<string, number>;
|
|
6
7
|
export declare const VERTICAL_ALIGN_MENU: NestedMenuType;
|
|
7
8
|
export declare const INSERT_COLUMN_LEFT_MENU_ITEM: MenuItemType;
|
|
@@ -12,5 +13,6 @@ export declare const VERTICAL_ALIGN_MIDDLE_MENU_ITEM: MenuItemType;
|
|
|
12
13
|
export declare const VERTICAL_ALIGN_BOTTOM_MENU_ITEM: MenuItemType;
|
|
13
14
|
export declare const DELETE_COLUMN_MENU_ITEM: MenuItemType;
|
|
14
15
|
export declare const LAYOUT_COLUMN_MENU_SECTION_RANK: Record<string, number>;
|
|
16
|
+
export declare const LAYOUT_COLUMN_DANGER_SECTION_RANK: Record<string, number>;
|
|
15
17
|
export declare const VERTICAL_ALIGN_MENU_RANK: Record<string, number>;
|
|
16
18
|
export declare const VERTICAL_ALIGN_MENU_SECTION_RANK: Record<string, number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Valign } from '@atlaskit/adf-schema/layout-column';
|
|
2
|
-
import
|
|
3
|
-
type VerticalAlignIcon = typeof
|
|
2
|
+
import AlignPositionTopIcon from '@atlaskit/icon-lab/core/align-position-top';
|
|
3
|
+
type VerticalAlignIcon = typeof AlignPositionTopIcon;
|
|
4
4
|
export declare const VERTICAL_ALIGN_ICONS: Record<Valign, VerticalAlignIcon>;
|
|
5
5
|
export {};
|
|
@@ -8,6 +8,7 @@ import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
|
8
8
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
9
|
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
10
10
|
import type { UiControlRegistryPlugin } from '@atlaskit/editor-plugin-ui-control-registry';
|
|
11
|
+
import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
|
|
11
12
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
12
13
|
import type { deleteLayoutColumn, distributeLayoutColumns, InsertLayoutColumnSide, insertLayoutColumnsWithAnalytics, setLayoutColumnValign, toggleLayoutColumnMenu } from './pm-plugins/actions';
|
|
13
14
|
import type { LayoutState } from './pm-plugins/types';
|
|
@@ -22,7 +23,8 @@ export type LayoutPluginDependencies = [
|
|
|
22
23
|
OptionalPlugin<InteractionPlugin>,
|
|
23
24
|
OptionalPlugin<BlockMenuPlugin>,
|
|
24
25
|
OptionalPlugin<ToolbarPlugin>,
|
|
25
|
-
OptionalPlugin<UiControlRegistryPlugin
|
|
26
|
+
OptionalPlugin<UiControlRegistryPlugin>,
|
|
27
|
+
OptionalPlugin<UserIntentPlugin>
|
|
26
28
|
];
|
|
27
29
|
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
28
30
|
actions: {
|
|
@@ -35,7 +35,11 @@ export type InsertLayoutColumnSide = 'left' | 'right';
|
|
|
35
35
|
export declare function getEffectiveMaxLayoutColumns(): number;
|
|
36
36
|
export declare const insertLayoutColumn: (side: InsertLayoutColumnSide, editorAnalyticsAPI?: EditorAnalyticsAPI) => EditorCommand;
|
|
37
37
|
export declare const setLayoutColumnValign: (valign: Valign, editorAnalyticsAPI?: EditorAnalyticsAPI) => EditorCommand;
|
|
38
|
-
|
|
38
|
+
type DistributeLayoutColumnsOptions = {
|
|
39
|
+
inputMethod?: INPUT_METHOD.LAYOUT_COLUMN_MENU | INPUT_METHOD.FLOATING_TB;
|
|
40
|
+
target?: 'selectedColumns' | 'allColumns';
|
|
41
|
+
};
|
|
42
|
+
export declare const distributeLayoutColumns: (editorAnalyticsAPI?: EditorAnalyticsAPI) => ({ inputMethod, target, }?: DistributeLayoutColumnsOptions) => EditorCommand;
|
|
39
43
|
export declare const toggleLayoutColumnMenu: ({ anchorPos, isOpen }: {
|
|
40
44
|
anchorPos?: number;
|
|
41
45
|
isOpen?: boolean;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { Valign } from '@atlaskit/adf-schema/layout-column';
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type
|
|
4
|
-
|
|
5
|
-
index: number;
|
|
3
|
+
import { type Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
type FoundNode = {
|
|
6
5
|
node: PMNode;
|
|
7
6
|
pos: number;
|
|
8
7
|
};
|
|
9
8
|
export type SelectedLayoutColumns = {
|
|
9
|
+
endIndex: number;
|
|
10
10
|
layoutSectionNode: PMNode;
|
|
11
11
|
layoutSectionPos: number;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
selectedLayoutColumns: FoundNode[];
|
|
13
|
+
startIndex: number;
|
|
14
14
|
};
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
15
|
+
export declare const getSelectedLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
|
|
16
|
+
export declare const getAllLayoutColumnsFromSelection: (selection: Selection) => SelectedLayoutColumns | undefined;
|
|
17
17
|
export declare const getLayoutColumnValign: (layoutColumn: PMNode | undefined) => Valign | undefined;
|
|
18
|
-
export declare const getLayoutColumnMenuAnchorPos: (selection: Selection
|
|
18
|
+
export declare const getLayoutColumnMenuAnchorPos: (selection: Selection, anchorPosFromHandle?: number) => number | undefined;
|
|
19
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import type { MenuItemType, MenuSectionType, MenuType, NestedMenuType } from '@a
|
|
|
2
2
|
export declare const LAYOUT_COLUMN_MENU: MenuType;
|
|
3
3
|
export declare const LAYOUT_COLUMN_MENU_SECTION: MenuSectionType;
|
|
4
4
|
export declare const LAYOUT_COLUMN_VERTICAL_ALIGN_MENU_SECTION: MenuSectionType;
|
|
5
|
+
export declare const LAYOUT_COLUMN_DANGER_SECTION: MenuSectionType;
|
|
5
6
|
export declare const LAYOUT_COLUMN_MENU_RANK: Record<string, number>;
|
|
6
7
|
export declare const VERTICAL_ALIGN_MENU: NestedMenuType;
|
|
7
8
|
export declare const INSERT_COLUMN_LEFT_MENU_ITEM: MenuItemType;
|
|
@@ -12,5 +13,6 @@ export declare const VERTICAL_ALIGN_MIDDLE_MENU_ITEM: MenuItemType;
|
|
|
12
13
|
export declare const VERTICAL_ALIGN_BOTTOM_MENU_ITEM: MenuItemType;
|
|
13
14
|
export declare const DELETE_COLUMN_MENU_ITEM: MenuItemType;
|
|
14
15
|
export declare const LAYOUT_COLUMN_MENU_SECTION_RANK: Record<string, number>;
|
|
16
|
+
export declare const LAYOUT_COLUMN_DANGER_SECTION_RANK: Record<string, number>;
|
|
15
17
|
export declare const VERTICAL_ALIGN_MENU_RANK: Record<string, number>;
|
|
16
18
|
export declare const VERTICAL_ALIGN_MENU_SECTION_RANK: Record<string, number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Valign } from '@atlaskit/adf-schema/layout-column';
|
|
2
|
-
import
|
|
3
|
-
type VerticalAlignIcon = typeof
|
|
2
|
+
import AlignPositionTopIcon from '@atlaskit/icon-lab/core/align-position-top';
|
|
3
|
+
type VerticalAlignIcon = typeof AlignPositionTopIcon;
|
|
4
4
|
export declare const VERTICAL_ALIGN_ICONS: Record<Valign, VerticalAlignIcon>;
|
|
5
5
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.9.1",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-selection": "^10.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-toolbar": "^7.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-ui-control-registry": "^4.1.0",
|
|
43
|
+
"@atlaskit/editor-plugin-user-intent": "^8.2.0",
|
|
43
44
|
"@atlaskit/editor-plugin-width": "^11.1.0",
|
|
44
45
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
45
46
|
"@atlaskit/editor-shared-styles": "^3.11.0",
|
|
46
|
-
"@atlaskit/editor-toolbar": "^1.
|
|
47
|
+
"@atlaskit/editor-toolbar": "^1.9.0",
|
|
47
48
|
"@atlaskit/editor-ui-control-model": "^1.2.0",
|
|
48
49
|
"@atlaskit/icon": "^35.3.0",
|
|
49
50
|
"@atlaskit/icon-lab": "^6.12.0",
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
"bind-event-listener": "^3.0.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^114.
|
|
59
|
+
"@atlaskit/editor-common": "^114.54.0",
|
|
59
60
|
"react": "^18.2.0",
|
|
60
61
|
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
61
62
|
},
|