@atlaskit/editor-core
Version:
A package contains Atlassian editor core functionality
9 lines • 770 B
JavaScript
// 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
export const getPrimaryToolbarComponents = (editorAPI, components) => {
var _editorAPI$primaryToo, _editorAPI$primaryToo2;
return {
components: components !== null && components !== void 0 ? components : editorAPI === null || editorAPI === void 0 ? void 0 : (_editorAPI$primaryToo = editorAPI.primaryToolbar) === null || _editorAPI$primaryToo === void 0 ? void 0 : (_editorAPI$primaryToo2 = _editorAPI$primaryToo.sharedState.currentState()) === null || _editorAPI$primaryToo2 === void 0 ? void 0 : _editorAPI$primaryToo2.components
};
};