@atlaskit/editor-plugin-toolbar-lists-indentation
Version:
Toolbar lists and indentation plugin for @atlaskit/editor-core
58 lines (57 loc) • 2.67 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getListsIndentationGroupForPrimaryToolbar = void 0;
var _react = _interopRequireDefault(require("react"));
var _toolbar = require("@atlaskit/editor-common/toolbar");
var _editorToolbar = require("@atlaskit/editor-toolbar");
var ListsIndentationGroup = function ListsIndentationGroup(_ref) {
var children = _ref.children;
var _useEditorToolbar = (0, _toolbar.useEditorToolbar)(),
editorAppearance = _useEditorToolbar.editorAppearance;
if (editorAppearance === 'full-page') {
return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
above: "xl"
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
}
};
var ListsIndentationGroupCollapsed = function ListsIndentationGroupCollapsed(_ref2) {
var children = _ref2.children;
var _useEditorToolbar2 = (0, _toolbar.useEditorToolbar)(),
editorAppearance = _useEditorToolbar2.editorAppearance;
if (editorAppearance === 'full-page') {
return /*#__PURE__*/_react.default.createElement(_editorToolbar.Show, {
below: "xl"
}, /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children));
}
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarButtonGroup, null, children);
};
var getListsIndentationGroupForPrimaryToolbar = exports.getListsIndentationGroupForPrimaryToolbar = function getListsIndentationGroupForPrimaryToolbar() {
return [{
type: _toolbar.LISTS_INDENTATION_GROUP.type,
key: _toolbar.LISTS_INDENTATION_GROUP.key,
parents: [{
type: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR.type,
key: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR.key,
rank: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR_RANK[_toolbar.LISTS_INDENTATION_GROUP.key]
}],
component: function component(_ref3) {
var children = _ref3.children;
return /*#__PURE__*/_react.default.createElement(ListsIndentationGroup, null, children);
}
}, {
type: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED.type,
key: _toolbar.LISTS_INDENTATION_GROUP_COLLAPSED.key,
parents: [{
type: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR.type,
key: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR.key,
rank: _toolbar.TEXT_SECTION_PRIMARY_TOOLBAR_RANK[_toolbar.LISTS_INDENTATION_GROUP.key]
}],
component: function component(_ref4) {
var children = _ref4.children;
return /*#__PURE__*/_react.default.createElement(ListsIndentationGroupCollapsed, null, children);
}
}];
};