@atlaskit/editor-plugin-toolbar-lists-indentation
Version:
Toolbar lists and indentation plugin for @atlaskit/editor-core
118 lines (117 loc) • 4.98 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getListsIndentationMenu = void 0;
var _react = _interopRequireDefault(require("react"));
var _toolbar = require("@atlaskit/editor-common/toolbar");
var _BulletedListMenuItem = require("./BulletedListMenuItem");
var _IndentMenuItem = require("./IndentMenuItem");
var _ListsIndentationMenu = require("./ListsIndentationMenu");
var _MenuSection = require("./MenuSection");
var _NumberedListMenuItem = require("./NumberedListMenuItem");
var _OutdentMenuItem = require("./OutdentMenuItem");
var getListsIndentationMenu = exports.getListsIndentationMenu = function getListsIndentationMenu(allowHeadingAndParagraphIndentation, showIndentationButtons, api) {
return [{
type: _toolbar.LISTS_INDENTATION_MENU.type,
key: _toolbar.LISTS_INDENTATION_MENU.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_GROUP.type,
key: _toolbar.LISTS_INDENTATION_GROUP.key,
rank: _toolbar.LISTS_INDENTATION_GROUP_RANK[_toolbar.LISTS_INDENTATION_MENU.key]
}, {
type: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED.type,
key: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED.key,
rank: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED_RANK[_toolbar.LISTS_INDENTATION_MENU.key]
}, {
type: _toolbar.LISTS_INDENTATION_GROUP_INLINE.type,
key: _toolbar.LISTS_INDENTATION_GROUP_INLINE.key,
rank: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED_RANK[_toolbar.LISTS_INDENTATION_MENU.key]
}],
component: function component(_ref) {
var children = _ref.children;
return /*#__PURE__*/_react.default.createElement(_ListsIndentationMenu.ListsIndentationMenu, {
api: api,
allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation
}, children);
}
}, {
type: _toolbar.LISTS_INDENTATION_MENU_SECTION.type,
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_MENU.type,
key: _toolbar.LISTS_INDENTATION_MENU.key,
rank: _toolbar.LISTS_INDENTATION_MENU_RANK[_toolbar.LISTS_INDENTATION_MENU_SECTION.key]
}, {
type: _toolbar.TEXT_COLLAPSED_MENU.type,
key: _toolbar.TEXT_COLLAPSED_MENU.key,
rank: _toolbar.TEXT_COLLAPSED_MENU_RANK[_toolbar.LISTS_INDENTATION_MENU_SECTION.key]
}],
component: _MenuSection.MenuSection
}, {
type: _toolbar.BULLETED_LIST_MENU_ITEM.type,
key: _toolbar.BULLETED_LIST_MENU_ITEM.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_MENU_SECTION.type,
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
rank: _toolbar.LISTS_INDENTATION_MENU_SECTION_RANK[_toolbar.BULLETED_LIST_MENU_ITEM.key]
}],
component: function component(_ref2) {
var parents = _ref2.parents;
return /*#__PURE__*/_react.default.createElement(_BulletedListMenuItem.BulletedListMenuItem, {
api: api,
parents: parents
});
}
}, {
type: _toolbar.NUMBERED_LIST_MENU_ITEM.type,
key: _toolbar.NUMBERED_LIST_MENU_ITEM.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_MENU_SECTION.type,
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
rank: _toolbar.LISTS_INDENTATION_MENU_SECTION_RANK[_toolbar.NUMBERED_LIST_MENU_ITEM.key]
}],
component: function component(_ref3) {
var parents = _ref3.parents;
return /*#__PURE__*/_react.default.createElement(_NumberedListMenuItem.NumberedListMenuItem, {
api: api,
parents: parents
});
}
}, {
type: _toolbar.OUTDENT_MENU_ITEM.type,
key: _toolbar.OUTDENT_MENU_ITEM.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_MENU_SECTION.type,
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
rank: _toolbar.LISTS_INDENTATION_MENU_SECTION_RANK[_toolbar.OUTDENT_MENU_ITEM.key]
}],
component: function component(_ref4) {
var parents = _ref4.parents;
return /*#__PURE__*/_react.default.createElement(_OutdentMenuItem.OutdentMenuItem, {
api: api,
allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation,
showIndentationButtons: showIndentationButtons,
parents: parents
});
}
}, {
type: _toolbar.INDENT_MENU_ITEM.type,
key: _toolbar.INDENT_MENU_ITEM.key,
parents: [{
type: _toolbar.LISTS_INDENTATION_MENU_SECTION.type,
key: _toolbar.LISTS_INDENTATION_MENU_SECTION.key,
rank: _toolbar.LISTS_INDENTATION_MENU_SECTION_RANK[_toolbar.INDENT_MENU_ITEM.key]
}],
component: function component(_ref5) {
var parents = _ref5.parents;
return /*#__PURE__*/_react.default.createElement(_IndentMenuItem.IndentMenuItem, {
api: api,
allowHeadingAndParagraphIndentation: allowHeadingAndParagraphIndentation,
showIndentationButtons: showIndentationButtons,
parents: parents
});
}
}];
};