UNPKG

@atlaskit/editor-core

Version:

A package contains Atlassian editor core functionality

15 lines (14 loc) 915 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPrimaryToolbarComponents = void 0; // Primary toolbar doesn't actually use plugin state so the state selector doesn't update as intended // We need a proper API to deal with non-prosemirror based state in plugins but until then we can retrieve // the latest var getPrimaryToolbarComponents = exports.getPrimaryToolbarComponents = function getPrimaryToolbarComponents(editorAPI, components) { var _editorAPI$primaryToo; return { components: components !== null && components !== void 0 ? components : editorAPI === null || editorAPI === void 0 || (_editorAPI$primaryToo = editorAPI.primaryToolbar) === null || _editorAPI$primaryToo === void 0 || (_editorAPI$primaryToo = _editorAPI$primaryToo.sharedState.currentState()) === null || _editorAPI$primaryToo === void 0 ? void 0 : _editorAPI$primaryToo.components }; };