@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
26 lines • 574 B
JavaScript
const breakoutLayouts = new Set(['full-width', 'wide']);
const shouldRespectBreakoutForAppearance = appearance => {
if (!appearance) {
return true;
}
if (appearance === 'full-width') {
return false;
}
if (appearance === 'max') {
return false;
}
return true;
};
export const shouldExtensionBreakout = ({
layout,
isTopLevelNode = true,
editorAppearance
}) => {
if (!layout || !breakoutLayouts.has(layout)) {
return false;
}
if (!isTopLevelNode) {
return false;
}
return shouldRespectBreakoutForAppearance(editorAppearance);
};