@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
35 lines • 1.54 kB
JavaScript
import React from 'react';
import { TOOLBARS } from '@atlaskit/editor-common/toolbar';
import { isToolbar } from '../../../utils/toolbar';
import { ToolbarNext } from '../../Toolbar/Toolbar';
/**
* Primary toolbar driven by components registered by `editor-plugin-toolbar`, introduced in `platform_editor_toolbar_aifc`.
*/
export var CommentToolbar = function CommentToolbar(_ref) {
var _editorAPI$toolbar;
var editorAPI = _ref.editorAPI,
editorView = _ref.editorView,
editorAppearance = _ref.editorAppearance,
disabled = _ref.disabled,
popupsBoundariesElement = _ref.popupsBoundariesElement,
popupsMountPoint = _ref.popupsMountPoint,
popupsScrollableElement = _ref.popupsScrollableElement;
var components = editorAPI === null || editorAPI === void 0 || (_editorAPI$toolbar = editorAPI.toolbar) === null || _editorAPI$toolbar === void 0 ? void 0 : _editorAPI$toolbar.actions.getComponents();
var toolbar = components === null || components === void 0 ? void 0 : components.find(function (component) {
return component.key === TOOLBARS.PRIMARY_TOOLBAR;
});
if (!components || !isToolbar(toolbar)) {
return null;
}
return /*#__PURE__*/React.createElement(ToolbarNext, {
toolbar: toolbar,
components: components,
editorView: editorView,
editorAPI: editorAPI,
editorAppearance: editorAppearance,
isDisabled: disabled,
popupsBoundariesElement: popupsBoundariesElement,
popupsScrollableElement: popupsScrollableElement,
popupsMountPoint: popupsMountPoint
});
};