@wordpress/block-editor
Version:
8 lines (7 loc) • 1.42 kB
Source Map (JSON)
{
"version": 3,
"sources": ["../../../src/components/line-height-control/utils.js"],
"sourcesContent": ["export const BASE_DEFAULT_VALUE = 1.5;\nexport const STEP = 0.01;\n/**\n * A spin factor of 10 allows the spin controls to increment/decrement by 0.1.\n * e.g. A line-height value of 1.55 will increment to 1.65.\n */\nexport const SPIN_FACTOR = 10;\n/**\n * There are varying value types within LineHeightControl:\n *\n * {undefined} Initial value. No changes from the user.\n * {string} Input value. Value consumed/outputted by the input. Empty would be ''.\n * {number} Block attribute type. Input value needs to be converted for attribute setting.\n *\n * Note: If the value is undefined, the input requires it to be an empty string ('')\n * in order to be considered \"controlled\" by props (rather than internal state).\n */\nexport const RESET_VALUE = '';\n\n/**\n * Determines if the lineHeight attribute has been properly defined.\n *\n * @param {any} lineHeight The value to check.\n *\n * @return {boolean} Whether the lineHeight attribute is valid.\n */\nexport function isLineHeightDefined( lineHeight ) {\n\treturn lineHeight !== undefined && lineHeight !== RESET_VALUE;\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,qBAAqB;AAC3B,IAAM,OAAO;AAKb,IAAM,cAAc;AAWpB,IAAM,cAAc;AASpB,SAAS,oBAAqB,YAAa;AACjD,SAAO,eAAe,UAAa,eAAe;AACnD;",
"names": []
}