@brizy/ui
Version:
React elements in Brizy style
35 lines (34 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formats = exports.customSize = exports.makeBackground = exports.getCustomSize = exports.getBackground = exports.NOTHING_IN_QUILL = void 0;
const ramda_1 = require("ramda");
const utils_1 = require("../utils");
const constants_1 = require("../constants");
exports.NOTHING_IN_QUILL = "<p><br></p>";
const getBackground = (color) => {
return { [`--${constants_1.BRZ_PREFIX}-rich-text-background`]: (0, utils_1.getHexByColorType)(color) };
};
exports.getBackground = getBackground;
const getCustomSize = (size) => {
return { [`--${constants_1.BRZ_PREFIX}-rich-text-height`]: `${size}px` };
};
exports.getCustomSize = getCustomSize;
exports.makeBackground = (0, ramda_1.ifElse)(utils_1.isString, exports.getBackground, utils_1.emptyStyles);
exports.customSize = (0, ramda_1.ifElse)(utils_1.isNumber, exports.getCustomSize, utils_1.emptyStyles);
exports.formats = [
"bold",
"italic",
"underline",
"strike",
"align",
"list",
"indent",
"size",
"header",
"link",
"video",
"color",
"background",
"clean",
"blockquote",
];