import { Fun } from '@ephox/katamari';
import { Css, Height } from '@ephox/sugar';
// applies the max-height as determined by Bounder
const setMaxHeight = (element, maxHeight) => {
    Height.setMax(element, Math.floor(maxHeight));
};
// adds both max-height and overflow to constrain it
const anchored = Fun.constant((element, available) => {
    setMaxHeight(element, available);
    Css.setAll(element, {
        'overflow-x': 'hidden',
        'overflow-y': 'auto'
    });
});
/*
 * This adds max height, but not overflow - the effect of this is that elements can grow beyond the max height,
 * but if they run off the top they're pushed down.
 *
 * If the element expands below the screen height it will be cut off, but we were already doing that.
 */
const expandable = Fun.constant((element, available) => {
    setMaxHeight(element, available);
});
export { anchored, expandable };
//# sourceMappingURL=MaxHeight.js.map