diff --git a/package-lock.json b/package-lock.json index 2f626293..6db447a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -342,7 +342,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", "dev": true }, "arr-union": { @@ -735,7 +735,7 @@ "babel-loader": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-7.1.2.tgz", - "integrity": "sha1-9svhInEPGqKvTYgcbVtUNYyiQSY=", + "integrity": "sha512-jRwlFbINAeyDStqK6Dd5YuY0k5YuzQUvlz2ZamuXrXmxav3pNqe9vfJ402+2G+OmlJSXxCOpB6Uz0INM7RQe2A==", "dev": true, "requires": { "find-cache-dir": "1.0.0", @@ -1367,7 +1367,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { "cache-base": "1.0.1", @@ -1390,7 +1390,7 @@ "base64-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha1-qRlH2h9KUW6jjltOwOw3c2deCIY=", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", "dev": true }, "basic-auth": { @@ -1418,7 +1418,7 @@ "big.js": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", - "integrity": "sha1-pfwpi4G54Nyi5FiCR4S2XFK6WI4=", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", "dev": true }, "binary-extensions": { @@ -1718,7 +1718,7 @@ "buffer-indexof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", - "integrity": "sha1-Uvq8xqYG0aADAoAmSO9o9jnaJow=", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", "dev": true }, "buffer-xor": { @@ -1748,7 +1748,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { "collection-visit": "1.0.0", @@ -1889,7 +1889,7 @@ "check-dependencies": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/check-dependencies/-/check-dependencies-1.1.0.tgz", - "integrity": "sha1-OqLfQGF3AXnY6I6L+TFcU3It3/Q=", + "integrity": "sha512-GDrbGzzJ6Gc6tQh87HBMGhrJ4UWIlR9MKJwgvlrJyj/gWvTYYb2jQetKbajt/EYK5Y8/4g7gH2LEvq8GdUWTag==", "dev": true, "requires": { "bower-config": "1.4.1", @@ -1903,7 +1903,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { "color-convert": "1.9.0" @@ -1912,7 +1912,7 @@ "chalk": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", - "integrity": "sha1-rFvs8U+iG5nGySynp9fP1bF+dD4=", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", "dev": true, "requires": { "ansi-styles": "3.2.0", @@ -1941,7 +1941,7 @@ "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -1984,7 +1984,7 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", "dev": true }, "class-utils": { @@ -2012,7 +2012,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -2029,7 +2029,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true }, "lazy-cache": { @@ -2246,7 +2246,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -2386,7 +2386,7 @@ "cosmiconfig": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-3.1.0.tgz", - "integrity": "sha1-ZAqUv5hH8yGABAPNJzr2BmXHM5c=", + "integrity": "sha512-zedsBhLSbPBms+kE7AH4vHg6JsKDz6epSv2/+5XHs8ILHlgDciSJfSWf8sX9aQ52Jb7KI7VswUTsLpR/G0cr2Q==", "dev": true, "requires": { "is-directory": "0.3.1", @@ -2398,13 +2398,13 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, "js-yaml": { "version": "3.10.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha1-LnhEFka9RoLpY/IrbpKCPDCcYtw=", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", "dev": true, "requires": { "argparse": "1.0.9", @@ -2789,7 +2789,7 @@ "dns-packet": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.2.2.tgz", - "integrity": "sha1-qKJr7HZGQ4lj/Ibgb4+LFtbIv3o=", + "integrity": "sha512-kN+DjfGF7dJGUL7nWRktL9Z18t1rWP3aQlyZdY8XlpvU3Nc6GeFTQApftcjtWKxAZfiggZSGrCEoszNgvnpwDg==", "dev": true, "requires": { "ip": "1.1.5", @@ -3098,7 +3098,7 @@ "escodegen": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.0.tgz", - "integrity": "sha1-mBGi8mXcHNOJRCDuNxcGS2MriFI=", + "integrity": "sha512-v0MYvNQ32bzwoG2OSFzWAkuahDQHK92JBN0pTAALJ4RIxEZe766QJPDR8Hqy7XNUy5K3fnVL76OqYAdc4TZEIw==", "dev": true, "requires": { "esprima": "3.1.3", @@ -3394,7 +3394,7 @@ "exec-sh": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", - "integrity": "sha1-FjuYpuiea2W0fCoo0hW8H2OYnDg=", + "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", "dev": true, "requires": { "merge": "1.2.0" @@ -3777,7 +3777,7 @@ "extglob": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.2.tgz", - "integrity": "sha1-MpD0YgjbGy6OuL4MlO2eatgO2+I=", + "integrity": "sha512-I0+eZBH+jFGL8F5BnIz2ON2nKCjTS3AS3H/5PeSmCp7UVC70Ym8IhdRiQly2juKYQ//f7z1aj1BRpQniFJoU1w==", "dev": true, "requires": { "array-unique": "0.3.2", @@ -3805,7 +3805,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -3857,13 +3857,13 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true }, "micromatch": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.0.tgz", - "integrity": "sha1-UQLU6vILaZfWAI46z+HESj+oFeI=", + "integrity": "sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==", "dev": true, "requires": { "arr-diff": "4.0.0", @@ -4927,7 +4927,7 @@ "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "1.0.0", @@ -4960,7 +4960,7 @@ "global-modules": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", - "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { "global-prefix": "1.0.2", @@ -4984,7 +4984,7 @@ "globals": { "version": "9.18.0", "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha1-qjiWs+abSH8X4x7SFD1pqOMMLYo=", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, "globby": { @@ -5256,7 +5256,7 @@ "hosted-git-info": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", "dev": true }, "hpack.js": { @@ -5333,7 +5333,7 @@ "http-parser-js": { "version": "0.4.8", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.8.tgz", - "integrity": "sha1-dj91xLdxoLtEZTsHBwv/bKe8VWE=", + "integrity": "sha512-jmHp99g6/fLx0pRNJqzsQgjsclCHAY7NhIeA3/U+bsGNvgbvUCQFQY9m5AYpqpAxY/2VcikfbKpjQozSTiz0jA==", "dev": true }, "http-proxy": { @@ -5396,7 +5396,7 @@ "iconv-lite": { "version": "0.4.19", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", - "integrity": "sha1-90aPYBNfXl2tM5nAqBvpoWA6CCs=", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==", "dev": true }, "ieee754": { @@ -5718,7 +5718,7 @@ "is-descriptor": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.1.tgz", - "integrity": "sha1-LGAjWZveLenV0si5qdlAggNrbvI=", + "integrity": "sha512-G3fFVFTqfaqu7r4YuSBHKBAuOaLz8Sy7ekklUpFEliaLMP1Y2ZjoN9jS62YWCAPQrQpMUQSitRlrzibbuCZjdA==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -5729,7 +5729,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -5868,7 +5868,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { "isobject": "3.0.1" @@ -6035,7 +6035,7 @@ "istanbul-lib-coverage": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", - "integrity": "sha1-c7+5mIhSmUFck9OKPprfeEp3qdo=", + "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", "dev": true }, "istanbul-lib-hook": { @@ -7305,7 +7305,7 @@ "json-loader": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", - "integrity": "sha1-3KFKcCNf+C8KyaOr62DTN6NlGF0=", + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", "dev": true }, "json-parse-better-errors": { @@ -7583,7 +7583,7 @@ "log-symbols": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz", - "integrity": "sha1-81+mDieIMrU43E3dy7R4pF0+O+Y=", + "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==", "dev": true, "requires": { "chalk": "2.3.0" @@ -7592,7 +7592,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { "color-convert": "1.9.0" @@ -7623,7 +7623,7 @@ "loglevel": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.5.0.tgz", - "integrity": "sha1-OGOYSiwya5hvu5ZfN4dYptyKQyQ=", + "integrity": "sha512-OQ2jhWI5G2qsvO0UFNyCQWgKl/tFiwuPIXxELzACeUO2FqstN/R7mmL09+nhv6xOWVPPojQO1A90sCEoJSgBcQ==", "dev": true }, "longest": { @@ -7660,7 +7660,7 @@ "lru-cache": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -7721,7 +7721,7 @@ "match-at": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/match-at/-/match-at-0.1.1.tgz", - "integrity": "sha1-JdBA0pF3dwTV5lVru3kjDsLeBUA=" + "integrity": "sha512-h4Yd392z9mST+dzc+yjuybOGFNOZjmXIPKWjxBd1Bb23r4SmDOsk2NYCU2BMUBGbSpZqwVsZYNq26QS3xfaT3Q==" }, "mathml-tag-names": { "version": "2.0.1", @@ -8011,7 +8011,7 @@ "nanomatch": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.3.tgz", - "integrity": "sha1-FeHALc+ZDCeig7CMC6GAHOJJpqY=", + "integrity": "sha512-HqDMQWJlwpXbfKDpAnkc6AJQh5PFqVlrjYbruDjYVAS+05TQUb1qhIde4G9jMzHbs/u6bgEok1jMAV4yJzoh+w==", "dev": true, "requires": { "arr-diff": "4.0.0", @@ -8042,7 +8042,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -8111,7 +8111,7 @@ "timers-browserify": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha1-lspT9LeUpefA4b18yIo3Ipj6AeY=", + "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", "dev": true, "requires": { "setimmediate": "1.0.5" @@ -8169,7 +8169,7 @@ "normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { "hosted-git-info": "2.5.0", @@ -8261,7 +8261,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -8272,7 +8272,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -8381,7 +8381,7 @@ "opn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/opn/-/opn-5.1.0.tgz", - "integrity": "sha1-cs4jBqF9vqWP8QQYUzUrSo/HdRk=", + "integrity": "sha512-iPNl7SyM8L30Rm1sjGdLLheyHVw5YXVfi3SKWJzBI7efxRwHojfRFjwE/OLM6qp9xJYMgab8WicTU1cPoY+Hpg==", "dev": true, "requires": { "is-wsl": "1.1.0" @@ -8858,7 +8858,7 @@ "postcss-reporter": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-5.0.0.tgz", - "integrity": "sha1-oUF3/RNCgp0pFlPyeG79ZxEDMsM=", + "integrity": "sha512-rBkDbaHAu5uywbCR2XE8a25tats3xSOsGNx6mppK6Q9kSFGKc/FyAzfci+fWM2l+K402p1D0pNcfDGxeje5IKg==", "dev": true, "requires": { "chalk": "2.3.0", @@ -8870,7 +8870,7 @@ "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g=", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", "dev": true, "requires": { "color-convert": "1.9.0" @@ -9026,7 +9026,7 @@ "promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", - "integrity": "sha1-BktyYCsY+Q8pGSuLG8QY/9Hr078=", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "dev": true, "optional": true, "requires": { @@ -9107,7 +9107,7 @@ "randomatic": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", "dev": true, "requires": { "is-number": "3.0.0", @@ -9148,7 +9148,7 @@ "randombytes": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", - "integrity": "sha1-3ACaJGuNCaF3tLegrne8Vw9LG3k=", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -9574,7 +9574,7 @@ "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { "glob": "7.1.2" @@ -9617,7 +9617,7 @@ "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, "sane": { @@ -9827,7 +9827,7 @@ "set-value": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { "extend-shallow": "2.0.1", @@ -9839,7 +9839,7 @@ "split-string": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.0.2.tgz", - "integrity": "sha1-YSm8knMXFuWqH7c8MzB48LfBFMg=", + "integrity": "sha512-d6myUSfwmBz1izkY4r7r7I0PL41rh21qUDYK1OgclmGHeoqQoujduGxMbzw6BlF3HKmJR4sMpbWVo7/Xzg4YBQ==", "dev": true, "requires": { "extend-shallow": "2.0.1" @@ -9919,7 +9919,7 @@ "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", - "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true }, "signal-exit": { @@ -9979,7 +9979,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -9990,7 +9990,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -9998,7 +9998,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { "define-property": "1.0.0", @@ -10017,7 +10017,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { "kind-of": "3.2.2" @@ -10079,7 +10079,7 @@ "source-list-map": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", - "integrity": "sha1-qqR0A/eyRakvvJfqCPJQ1gh+0IU=", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", "dev": true }, "source-map": { @@ -10103,7 +10103,7 @@ "source-map-support": { "version": "0.4.18", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", - "integrity": "sha1-Aoam3ovkJkEzhZTpfM6nXwosWF8=", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { "source-map": "0.5.6" @@ -10178,7 +10178,7 @@ "specificity": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/specificity/-/specificity-0.3.2.tgz", - "integrity": "sha1-meZRHs7vD42bV5JJN6rCyxPRPEI=", + "integrity": "sha512-Nc/QN/A425Qog7j9aHmwOrlwX2e7pNI47ciwxwy4jOlvbbMHkNNJchit+FX+UjF3IAdiaaV5BKeWuDUnws6G1A==", "dev": true }, "split-string": { @@ -10260,7 +10260,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -10271,7 +10271,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -10311,7 +10311,7 @@ "stream-http": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha1-QKBQ7I3DtTsz2ZCUFcAsC/Gr+60=", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", "dev": true, "requires": { "builtin-status-codes": "3.0.0", @@ -10876,7 +10876,7 @@ "test-exclude": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-4.1.1.tgz", - "integrity": "sha1-TYSWSwlmsAh+zDNKLOAC09k0HiY=", + "integrity": "sha512-35+Asrsk3XHJDBgf/VRFexPgh3UyETv8IAn/LRTiZjVy6rjPVqdEk8dJcJYBzl1w0XCJM48lvTy8SfEsCWS4nA==", "dev": true, "requires": { "arrify": "1.0.1", @@ -10991,7 +10991,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -11002,7 +11002,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true } } @@ -11423,7 +11423,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { "is-accessor-descriptor": "0.1.6", @@ -11440,7 +11440,7 @@ "kind-of": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.0.2.tgz", - "integrity": "sha1-9Xvskz2aIgn/qWxcCDQ2B7cDX9o=", + "integrity": "sha512-ru8+TQHbN8956c7ZlkgK5Imjx0GMat3jN45GNIthpPeb+SzLrqSg/NG7llQtIqUTbrdu5Oi0lSnIoJmDTwwSzw==", "dev": true }, "lazy-cache": { @@ -11496,7 +11496,7 @@ "uuid": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha1-PdPT55Crwk17DToDT/q6vijrvAQ=", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", "dev": true }, "validate-npm-package-license": { @@ -11632,13 +11632,13 @@ "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha1-qFWYCx8LazWbodXZ+zmulB+qY60=", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", "dev": true }, "webpack": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.6.0.tgz", - "integrity": "sha1-qJqSn77iBdNaT6LMSHvpy+yImLw=", + "integrity": "sha512-OsHT3D0W0KmPPh60tC7asNnOmST6bKTiR90UyEdT9QYoaJ4OYN4Gg7WK1k3VxHK07ZoiYWPsKvlS/gAjwL/vRA==", "dev": true, "requires": { "acorn": "5.1.2", @@ -11668,7 +11668,7 @@ "acorn": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", - "integrity": "sha1-kRy1PgNoB88Pp3jcXTcPvYZCRtc=", + "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", "dev": true }, "ajv": { @@ -11764,7 +11764,7 @@ "os-locale": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", - "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { "execa": "0.7.0", @@ -11832,7 +11832,7 @@ "supports-color": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", - "integrity": "sha1-iD992rwWUUKyphQn8zUt7RldGj4=", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", "dev": true, "requires": { "has-flag": "2.0.0" @@ -12029,7 +12029,7 @@ "webpack-sources": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.1.tgz", - "integrity": "sha1-xzVkNqTRMSO+LiQmoF0drZy+Zc8=", + "integrity": "sha512-05tMxipUCwHqYaVS8xc7sYPTly8PzXayRCB4dTxLhWTqlKUiwH6ezmEe0OSreL1c30LAuA3Zqmc+uEBUGFJDjw==", "dev": true, "requires": { "source-list-map": "2.0.0", diff --git a/src/buildCommon.js b/src/buildCommon.js index 226d261e..e351308a 100644 --- a/src/buildCommon.js +++ b/src/buildCommon.js @@ -391,6 +391,7 @@ type VListElem = {| elem: DomChildNode, marginLeft?: string, marginRight?: string, + wrapperClasses?: string[], |}; type VListElemAndShift = {| type: "elem", @@ -398,6 +399,7 @@ type VListElemAndShift = {| shift: number, marginLeft?: string, marginRight?: string, + wrapperClasses?: string[], |}; type VListKern = {| type: "kern", size: number |}; @@ -527,8 +529,9 @@ const makeVList = function(params: VListParam, options: Options): domTree.span { currPos += child.size; } else { const elem = child.elem; + const classes = child.wrapperClasses || []; - const childWrap = makeSpan([], [pstrut, elem]); + const childWrap = makeSpan(classes, [pstrut, elem]); childWrap.style.top = (-pstrutSize - currPos - elem.depth) + "em"; if (child.marginLeft) { childWrap.style.marginLeft = child.marginLeft; diff --git a/src/buildHTML.js b/src/buildHTML.js index 61f72c46..0435046e 100644 --- a/src/buildHTML.js +++ b/src/buildHTML.js @@ -11,7 +11,6 @@ import ParseError from "./ParseError"; import Style from "./Style"; import buildCommon from "./buildCommon"; -import delimiter from "./delimiter"; import domTree from "./domTree"; import { calculateSize } from "./units"; import utils from "./utils"; @@ -193,7 +192,7 @@ const shouldHandleSupSub = function(group, options) { (options.style.size === Style.DISPLAY.size || base.value.alwaysHandleSupSub); } else if (base.type === "accent") { - return isCharacterBox(base.value.base); + return utils.isCharacterBox(base.value.base); } else if (base.type === "horizBrace") { const isSup = (group.value.sub ? false : true); return (isSup === base.value.isOver); @@ -203,52 +202,6 @@ const shouldHandleSupSub = function(group, options) { } }; -/** - * Sometimes we want to pull out the innermost element of a group. In most - * cases, this will just be the group itself, but when ordgroups and colors have - * a single element, we want to pull that out. - */ -const getBaseElem = function(group) { - if (!group) { - return false; - } else if (group.type === "ordgroup") { - if (group.value.length === 1) { - return getBaseElem(group.value[0]); - } else { - return group; - } - } else if (group.type === "color") { - if (group.value.value.length === 1) { - return getBaseElem(group.value.value[0]); - } else { - return group; - } - } else if (group.type === "font") { - return getBaseElem(group.value.body); - } else { - return group; - } -}; - -/** - * TeXbook algorithms often reference "character boxes", which are simply groups - * with a single character in them. To decide if something is a character box, - * we find its innermost group, and see if it is a single character. - */ -const isCharacterBox = function(group) { - const baseElem = getBaseElem(group); - - // These are all they types of groups which hold single characters - return baseElem.type === "mathord" || - baseElem.type === "textord" || - baseElem.type === "bin" || - baseElem.type === "rel" || - baseElem.type === "inner" || - baseElem.type === "open" || - baseElem.type === "close" || - baseElem.type === "punct"; -}; - export const makeNullDelimiter = function(options, classes) { const moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses()); return makeSpan(classes.concat(moreClasses)); @@ -329,7 +282,7 @@ groupTypes.supsub = function(group, options) { if (group.value.sup) { newOptions = options.havingStyle(options.style.sup()); supm = buildGroup(group.value.sup, newOptions, options); - if (!isCharacterBox(group.value.base)) { + if (!utils.isCharacterBox(group.value.base)) { supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier; } @@ -338,7 +291,7 @@ groupTypes.supsub = function(group, options) { if (group.value.sub) { newOptions = options.havingStyle(options.style.sub()); subm = buildGroup(group.value.sub, newOptions, options); - if (!isCharacterBox(group.value.base)) { + if (!utils.isCharacterBox(group.value.base)) { subShift = base.depth + newOptions.fontMetrics().subDrop * newOptions.sizeMultiplier / options.sizeMultiplier; } @@ -452,94 +405,6 @@ groupTypes.spacing = function(group, options) { } }; -groupTypes.sqrt = function(group, options) { - // Square roots are handled in the TeXbook pg. 443, Rule 11. - - // First, we do the same steps as in overline to build the inner group - // and line - let inner = buildGroup(group.value.body, options.havingCrampedStyle()); - if (inner.height === 0) { - // Render a small surd. - inner.height = options.fontMetrics().xHeight; - } - - // Some groups can return document fragments. Handle those by wrapping - // them in a span. - if (inner instanceof domTree.documentFragment) { - inner = makeSpan([], [inner], options); - } - - // Calculate the minimum size for the \surd delimiter - const metrics = options.fontMetrics(); - const theta = metrics.defaultRuleThickness; - - let phi = theta; - if (options.style.id < Style.TEXT.id) { - phi = options.fontMetrics().xHeight; - } - - // Calculate the clearance between the body and line - let lineClearance = theta + phi / 4; - - const minDelimiterHeight = (inner.height + inner.depth + - lineClearance + theta) * options.sizeMultiplier; - - // Create a sqrt SVG of the required minimum size - const {span: img, ruleWidth} = delimiter.sqrtImage(minDelimiterHeight, options); - - const delimDepth = img.height - ruleWidth; - - // Adjust the clearance based on the delimiter size - if (delimDepth > inner.height + inner.depth + lineClearance) { - lineClearance = - (lineClearance + delimDepth - inner.height - inner.depth) / 2; - } - - // Shift the sqrt image - const imgShift = img.height - inner.height - lineClearance - ruleWidth; - - inner.style.paddingLeft = img.advanceWidth + "em"; - - // Overlay the image and the argument. - const body = buildCommon.makeVList({ - positionType: "firstBaseline", - children: [ - {type: "elem", elem: inner}, - {type: "kern", size: -(inner.height + imgShift)}, - {type: "elem", elem: img}, - {type: "kern", size: ruleWidth}, - ], - }, options); - body.children[0].children[0].classes.push("svg-align"); - - if (!group.value.index) { - return makeSpan(["mord", "sqrt"], [body], options); - } else { - // Handle the optional root index - - // The index is always in scriptscript style - const newOptions = options.havingStyle(Style.SCRIPTSCRIPT); - const rootm = buildGroup(group.value.index, newOptions, options); - - // The amount the index is shifted by. This is taken from the TeX - // source, in the definition of `\r@@t`. - const toShift = 0.6 * (body.height - body.depth); - - // Build a VList with the superscript shifted up correctly - const rootVList = buildCommon.makeVList({ - positionType: "shift", - positionData: -toShift, - children: [{type: "elem", elem: rootm}], - }, options); - // Add a class surrounding it so we can add on the appropriate - // kerning - const rootVListWrap = makeSpan(["root"], [rootVList]); - - return makeSpan(["mord", "sqrt"], - [rootVListWrap, body], options); - } -}; - function sizingGroup(value, options, baseOptions) { const inner = buildExpression(value, options, false); const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; @@ -594,30 +459,6 @@ groupTypes.font = function(group, options) { return buildGroup(group.value.body, options.withFontFamily(font)); }; -groupTypes.verb = function(group, options) { - const text = buildCommon.makeVerb(group, options); - const body = []; - // \verb enters text mode and therefore is sized like \textstyle - const newOptions = options.havingStyle(options.style.text()); - for (let i = 0; i < text.length; i++) { - if (text[i] === '\xA0') { // spaces appear as nonbreaking space - // The space character isn't in the Typewriter-Regular font, - // so we implement it as a kern of the same size as a character. - // 0.525 is the width of a texttt character in LaTeX. - // It automatically gets scaled by the font size. - const rule = makeSpan(["mord", "rule"], [], newOptions); - rule.style.marginLeft = "0.525em"; - body.push(rule); - } else { - body.push(buildCommon.makeSymbol(text[i], "Typewriter-Regular", - group.mode, newOptions, ["mathtt"])); - } - } - buildCommon.tryCombineChars(body); - return makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), - body, newOptions); -}; - groupTypes.accent = function(group, options) { // Accents are handled in the TeXbook pg. 443, rule 12. let base = group.value.base; @@ -650,7 +491,7 @@ groupTypes.accent = function(group, options) { const body = buildGroup(base, options.havingCrampedStyle()); // Does the accent need to shift for the skew of a character? - const mustShift = group.value.isShifty && isCharacterBox(base); + const mustShift = group.value.isShifty && utils.isCharacterBox(base); // Calculate the skew of the accent. This is based on the line "If the // nucleus is not a single character, let s = 0; otherwise set s to the @@ -661,7 +502,7 @@ groupTypes.accent = function(group, options) { if (mustShift) { // If the base is a character box, then we want the skew of the // innermost character. To do that, we find the innermost character: - const baseChar = getBaseElem(base); + const baseChar = utils.getBaseElem(base); // Then, we render its group to get the symbol inside it const baseGroup = buildGroup(baseChar, options.havingCrampedStyle()); // Finally, we pull the skew off of the symbol. @@ -882,78 +723,6 @@ groupTypes.accentUnder = function(group, options) { return makeSpan(["mord", "accentunder"], [vlist], options); }; -groupTypes.enclose = function(group, options) { - // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox - const inner = buildGroup(group.value.body, options); - - const label = group.value.label.substr(1); - const scale = options.sizeMultiplier; - let img; - let imgShift = 0; - const isColorbox = /color/.test(label); - - if (label === "sout") { - img = makeSpan(["stretchy", "sout"]); - img.height = options.fontMetrics().defaultRuleThickness / scale; - imgShift = -0.5 * options.fontMetrics().xHeight; - - } else { - // Add horizontal padding - inner.classes.push(/cancel/.test(label) ? "cancel-pad" : "boxpad"); - - // Add vertical padding - let vertPad = 0; - // ref: LaTeX source2e: \fboxsep = 3pt; \fboxrule = .4pt - // ref: cancel package: \advance\totalheight2\p@ % "+2" - if (/box/.test(label)) { - vertPad = label === "colorbox" ? 0.3 : 0.34; - } else { - vertPad = isCharacterBox(group.value.body) ? 0.2 : 0; - } - - img = stretchy.encloseSpan(inner, label, vertPad, options); - imgShift = inner.depth + vertPad; - - if (isColorbox) { - img.style.backgroundColor = group.value.backgroundColor.value; - if (label === "fcolorbox") { - img.style.borderColor = group.value.borderColor.value; - } - } - } - - let vlist; - if (isColorbox) { - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [ - // Put the color background behind inner; - {type: "elem", elem: img, shift: imgShift}, - {type: "elem", elem: inner, shift: 0}, - ], - }, options); - } else { - vlist = buildCommon.makeVList({ - positionType: "individualShift", - children: [ - // Write the \cancel stroke on top of inner. - {type: "elem", elem: inner, shift: 0}, - {type: "elem", elem: img, shift: imgShift}, - ], - }, options); - } - - if (/cancel/.test(label)) { - vlist.children[0].children[0].children[1].classes.push("svg-align"); - - // cancel does not create horiz space for its line extension. - // That is, not when adjacent to a mord. - return makeSpan(["mord", "cancel-lap"], [vlist], options); - } else { - return makeSpan(["mord"], [vlist], options); - } -}; - groupTypes.xArrow = function(group, options) { const style = options.style; diff --git a/src/buildMathML.js b/src/buildMathML.js index 4631de95..e23b5d4a 100644 --- a/src/buildMathML.js +++ b/src/buildMathML.js @@ -225,22 +225,6 @@ groupTypes.supsub = function(group, options) { return node; }; -groupTypes.sqrt = function(group, options) { - let node; - if (group.value.index) { - node = new mathMLTree.MathNode( - "mroot", [ - buildGroup(group.value.body, options), - buildGroup(group.value.index, options), - ]); - } else { - node = new mathMLTree.MathNode( - "msqrt", [buildGroup(group.value.body, options)]); - } - - return node; -}; - groupTypes.accent = function(group, options) { let accentNode; if (group.value.isStretchy) { @@ -330,13 +314,6 @@ groupTypes.sizing = function(group, options) { return node; }; -groupTypes.verb = function(group, options) { - const text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options)); - const node = new mathMLTree.MathNode("mtext", [text]); - node.setAttribute("mathvariant", buildCommon.fontMap["mathtt"].variant); - return node; -}; - groupTypes.accentUnder = function(group, options) { const accentNode = stretchy.mathMLnode(group.value.label); const node = new mathMLTree.MathNode( @@ -347,39 +324,6 @@ groupTypes.accentUnder = function(group, options) { return node; }; -groupTypes.enclose = function(group, options) { - const node = new mathMLTree.MathNode( - "menclose", [buildGroup(group.value.body, options)]); - switch (group.value.label) { - case "\\cancel": - node.setAttribute("notation", "updiagonalstrike"); - break; - case "\\bcancel": - node.setAttribute("notation", "downdiagonalstrike"); - break; - case "\\sout": - node.setAttribute("notation", "horizontalstrike"); - break; - case "\\fbox": - node.setAttribute("notation", "box"); - break; - case "\\colorbox": - node.setAttribute("mathbackground", - group.value.backgroundColor.value); - break; - case "\\fcolorbox": - node.setAttribute("mathbackground", - group.value.backgroundColor.value); - // TODO(ron): I don't know any way to set the border color. - node.setAttribute("notation", "box"); - break; - default: - // xcancel - node.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); - } - return node; -}; - groupTypes.horizBrace = function(group, options) { const accentNode = stretchy.mathMLnode(group.value.label); return new mathMLTree.MathNode( diff --git a/src/functions.js b/src/functions.js index 057195f9..7476bca4 100644 --- a/src/functions.js +++ b/src/functions.js @@ -26,19 +26,7 @@ const defineFunction = function( _defineFunction({names, props, handler}); }; -// A normal square root -defineFunction(["\\sqrt"], { - numArgs: 1, - numOptionalArgs: 1, -}, function(context, args, optArgs) { - const index = optArgs[0]; - const body = args[0]; - return { - type: "sqrt", - body: body, - index: index, - }; -}); +import "./functions/sqrt"; import "./functions/color"; @@ -52,41 +40,7 @@ defineFunction(["\\color"], { argTypes: ["color"], }, null); -// colorbox -defineFunction(["\\colorbox"], { - numArgs: 2, - allowedInText: true, - greediness: 3, - argTypes: ["color", "text"], -}, function(context, args) { - const color = args[0]; - const body = args[1]; - return { - type: "enclose", - label: context.funcName, - backgroundColor: color, - body: body, - }; -}); - -// fcolorbox -defineFunction(["\\fcolorbox"], { - numArgs: 3, - allowedInText: true, - greediness: 3, - argTypes: ["color", "color", "text"], -}, function(context, args) { - const borderColor = args[0]; - const backgroundColor = args[1]; - const body = args[2]; - return { - type: "enclose", - label: context.funcName, - backgroundColor: backgroundColor, - borderColor: borderColor, - body: body, - }; -}); +import "./functions/enclose"; import "./functions/overline"; @@ -370,18 +324,6 @@ defineFunction([ }; }); -// enclose -defineFunction(["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\fbox"], { - numArgs: 1, -}, function(context, args) { - const body = args[0]; - return { - type: "enclose", - label: context.funcName, - body: body, - }; -}); - // Infix generalized fractions defineFunction(["\\over", "\\choose", "\\atop"], { numArgs: 0, @@ -457,17 +399,7 @@ defineFunction(["\\raisebox"], { }; }); -// \verb and \verb* are dealt with directly in Parser.js. -// If we end up here, it's because of a failure to match the two delimiters -// in the regex in Lexer.js. LaTeX raises the following error when \verb is -// terminated by end of line (or file). -defineFunction(["\\verb"], { - numArgs: 0, - allowedInText: true, -}, function(context) { - throw new ParseError( - "\\verb ended by end of line instead of matching delimiter"); -}); +import "./functions/verb"; // Hyperlinks import "./functions/href"; diff --git a/src/functions/enclose.js b/src/functions/enclose.js new file mode 100644 index 00000000..d0a5755b --- /dev/null +++ b/src/functions/enclose.js @@ -0,0 +1,188 @@ +// @flow +import defineFunction from "../defineFunction"; +import buildCommon from "../buildCommon"; +import mathMLTree from "../mathMLTree"; +import utils from "../utils"; +import stretchy from "../stretchy"; + +import * as html from "../buildHTML"; +import * as mml from "../buildMathML"; + + +const htmlBuilder = (group, options) => { + // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox + const inner = html.buildGroup(group.value.body, options); + + const label = group.value.label.substr(1); + const scale = options.sizeMultiplier; + let img; + let imgShift = 0; + const isColorbox = /color/.test(label); + + if (label === "sout") { + img = buildCommon.makeSpan(["stretchy", "sout"]); + img.height = options.fontMetrics().defaultRuleThickness / scale; + imgShift = -0.5 * options.fontMetrics().xHeight; + + } else { + // Add horizontal padding + inner.classes.push(/cancel/.test(label) ? "cancel-pad" : "boxpad"); + + // Add vertical padding + let vertPad = 0; + // ref: LaTeX source2e: \fboxsep = 3pt; \fboxrule = .4pt + // ref: cancel package: \advance\totalheight2\p@ % "+2" + if (/box/.test(label)) { + vertPad = label === "colorbox" ? 0.3 : 0.34; + } else { + vertPad = utils.isCharacterBox(group.value.body) ? 0.2 : 0; + } + + img = stretchy.encloseSpan(inner, label, vertPad, options); + imgShift = inner.depth + vertPad; + + if (isColorbox) { + img.style.backgroundColor = group.value.backgroundColor.value; + if (label === "fcolorbox") { + img.style.borderColor = group.value.borderColor.value; + } + } + } + + let vlist; + if (isColorbox) { + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Put the color background behind inner; + {type: "elem", elem: img, shift: imgShift}, + {type: "elem", elem: inner, shift: 0}, + ], + }, options); + } else { + vlist = buildCommon.makeVList({ + positionType: "individualShift", + children: [ + // Write the \cancel stroke on top of inner. + { + type: "elem", + elem: inner, + shift: 0, + }, + { + type: "elem", + elem: img, + shift: imgShift, + wrapperClasses: /cancel/.test(label) ? ["svg-align"] : [], + }, + ], + }, options); + } + + if (/cancel/.test(label)) { + // cancel does not create horiz space for its line extension. + // That is, not when adjacent to a mord. + return buildCommon.makeSpan(["mord", "cancel-lap"], [vlist], options); + } else { + return buildCommon.makeSpan(["mord"], [vlist], options); + } +}; + +const mathmlBuilder = (group, options) => { + const node = new mathMLTree.MathNode( + "menclose", [mml.buildGroup(group.value.body, options)]); + switch (group.value.label) { + case "\\cancel": + node.setAttribute("notation", "updiagonalstrike"); + break; + case "\\bcancel": + node.setAttribute("notation", "downdiagonalstrike"); + break; + case "\\sout": + node.setAttribute("notation", "horizontalstrike"); + break; + case "\\fbox": + node.setAttribute("notation", "box"); + break; + case "\\colorbox": + node.setAttribute("mathbackground", + group.value.backgroundColor.value); + break; + case "\\fcolorbox": + node.setAttribute("mathbackground", + group.value.backgroundColor.value); + // TODO(ron): I don't know any way to set the border color. + node.setAttribute("notation", "box"); + break; + default: + // xcancel + node.setAttribute("notation", "updiagonalstrike downdiagonalstrike"); + } + return node; +}; + +defineFunction({ + type: "enclose", + names: ["\\colorbox"], + props: { + numArgs: 2, + allowedInText: true, + greediness: 3, + argTypes: ["color", "text"], + }, + handler(context, args, optArgs) { + const color = args[0]; + const body = args[1]; + return { + type: "enclose", + label: context.funcName, + backgroundColor: color, + body: body, + }; + }, + htmlBuilder, + mathmlBuilder, +}); + +defineFunction({ + type: "enclose", + names: ["\\fcolorbox"], + props: { + numArgs: 3, + allowedInText: true, + greediness: 3, + argTypes: ["color", "color", "text"], + }, + handler(context, args, optArgs) { + const borderColor = args[0]; + const backgroundColor = args[1]; + const body = args[2]; + return { + type: "enclose", + label: context.funcName, + backgroundColor: backgroundColor, + borderColor: borderColor, + body: body, + }; + }, + htmlBuilder, + mathmlBuilder, +}); + +defineFunction({ + type: "enclose", + names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\fbox"], + props: { + numArgs: 1, + }, + handler(context, args, optArgs) { + const body = args[0]; + return { + type: "enclose", + label: context.funcName, + body: body, + }; + }, + htmlBuilder, + mathmlBuilder, +}); diff --git a/src/functions/sqrt.js b/src/functions/sqrt.js new file mode 100644 index 00000000..8d72ba0e --- /dev/null +++ b/src/functions/sqrt.js @@ -0,0 +1,130 @@ +// @flow +import defineFunction from "../defineFunction"; +import buildCommon from "../buildCommon"; +import domTree from "../domTree"; +import mathMLTree from "../mathMLTree"; +import delimiter from "../delimiter"; +import Style from "../Style"; + +import * as html from "../buildHTML"; +import * as mml from "../buildMathML"; + +defineFunction({ + type: "sqrt", + names: ["\\sqrt"], + props: { + numArgs: 1, + numOptionalArgs: 1, + }, + handler(context, args, optArgs) { + const index = optArgs[0]; + const body = args[0]; + return { + type: "sqrt", + body: body, + index: index, + }; + }, + htmlBuilder(group, options) { + // Square roots are handled in the TeXbook pg. 443, Rule 11. + + // First, we do the same steps as in overline to build the inner group + // and line + let inner = html.buildGroup(group.value.body, options.havingCrampedStyle()); + if (inner.height === 0) { + // Render a small surd. + inner.height = options.fontMetrics().xHeight; + } + + // Some groups can return document fragments. Handle those by wrapping + // them in a span. + if (inner instanceof domTree.documentFragment) { + inner = buildCommon.makeSpan([], [inner], options); + } + + // Calculate the minimum size for the \surd delimiter + const metrics = options.fontMetrics(); + const theta = metrics.defaultRuleThickness; + + let phi = theta; + if (options.style.id < Style.TEXT.id) { + phi = options.fontMetrics().xHeight; + } + + // Calculate the clearance between the body and line + let lineClearance = theta + phi / 4; + + const minDelimiterHeight = (inner.height + inner.depth + + lineClearance + theta) * options.sizeMultiplier; + + // Create a sqrt SVG of the required minimum size + const {span: img, ruleWidth} = + delimiter.sqrtImage(minDelimiterHeight, options); + + const delimDepth = img.height - ruleWidth; + + // Adjust the clearance based on the delimiter size + if (delimDepth > inner.height + inner.depth + lineClearance) { + lineClearance = + (lineClearance + delimDepth - inner.height - inner.depth) / 2; + } + + // Shift the sqrt image + const imgShift = img.height - inner.height - lineClearance - ruleWidth; + + inner.style.paddingLeft = img.advanceWidth + "em"; + + // Overlay the image and the argument. + const body = buildCommon.makeVList({ + positionType: "firstBaseline", + children: [ + {type: "elem", elem: inner, wrapperClasses: ["svg-align"]}, + {type: "kern", size: -(inner.height + imgShift)}, + {type: "elem", elem: img}, + {type: "kern", size: ruleWidth}, + ], + }, options); + + if (!group.value.index) { + return buildCommon.makeSpan(["mord", "sqrt"], [body], options); + } else { + // Handle the optional root index + + // The index is always in scriptscript style + const newOptions = options.havingStyle(Style.SCRIPTSCRIPT); + const rootm = html.buildGroup(group.value.index, newOptions, options); + + // The amount the index is shifted by. This is taken from the TeX + // source, in the definition of `\r@@t`. + const toShift = 0.6 * (body.height - body.depth); + + // Build a VList with the superscript shifted up correctly + const rootVList = buildCommon.makeVList({ + positionType: "shift", + positionData: -toShift, + children: [{type: "elem", elem: rootm}], + }, options); + // Add a class surrounding it so we can add on the appropriate + // kerning + const rootVListWrap = buildCommon.makeSpan(["root"], [rootVList]); + + return buildCommon.makeSpan(["mord", "sqrt"], + [rootVListWrap, body], options); + } + }, + mathmlBuilder(group, options) { + let node; + if (group.value.index) { + node = new mathMLTree.MathNode( + "mroot", [ + mml.buildGroup(group.value.body, options), + mml.buildGroup(group.value.index, options), + ]); + } else { + node = new mathMLTree.MathNode( + "msqrt", [mml.buildGroup(group.value.body, options)]); + } + + return node; + }, +}); diff --git a/src/functions/verb.js b/src/functions/verb.js new file mode 100644 index 00000000..7e225daa --- /dev/null +++ b/src/functions/verb.js @@ -0,0 +1,55 @@ +// @flow +import defineFunction from "../defineFunction"; +import buildCommon from "../buildCommon"; +import mathMLTree from "../mathMLTree"; +import ParseError from "../ParseError"; + +defineFunction({ + type: "verb", + names: ["\\verb"], + props: { + numArgs: 0, + allowedInText: true, + }, + handler(context, args, optArgs) { + // \verb and \verb* are dealt with directly in Parser.js. + // If we end up here, it's because of a failure to match the two delimiters + // in the regex in Lexer.js. LaTeX raises the following error when \verb is + // terminated by end of line (or file). + throw new ParseError( + "\\verb ended by end of line instead of matching delimiter"); + }, + htmlBuilder(group, options) { + const text = buildCommon.makeVerb(group, options); + const body = []; + // \verb enters text mode and therefore is sized like \textstyle + const newOptions = options.havingStyle(options.style.text()); + for (let i = 0; i < text.length; i++) { + if (text[i] === '\xA0') { // spaces appear as nonbreaking space + // The space character isn't in the Typewriter-Regular font, + // so we implement it as a kern of the same size as a character. + // 0.525 is the width of a texttt character in LaTeX. + // It automatically gets scaled by the font size. + const rule = buildCommon.makeSpan(["mord", "rule"], [], newOptions); + rule.style.marginLeft = "0.525em"; + body.push(rule); + } else { + body.push(buildCommon.makeSymbol(text[i], "Typewriter-Regular", + group.mode, newOptions, ["mathtt"])); + } + } + buildCommon.tryCombineChars(body); + return buildCommon.makeSpan( + ["mord", "text"].concat(newOptions.sizingClasses(options)), + // tryCombinChars expects CombinableDomNode[] while makeSpan expects + // DomChildNode[]. + // $FlowFixMe: CombinableDomNode[] is not compatible with DomChildNode[] + body, newOptions); + }, + mathmlBuilder(group, options) { + const text = new mathMLTree.TextNode(buildCommon.makeVerb(group, options)); + const node = new mathMLTree.MathNode("mtext", [text]); + node.setAttribute("mathvariant", buildCommon.fontMap["mathtt"].variant); + return node; + }, +}); diff --git a/src/utils.js b/src/utils.js index 4e0ccf1f..dcf4a2fb 100644 --- a/src/utils.js +++ b/src/utils.js @@ -89,6 +89,85 @@ function clearNode(node: Node) { setTextContent(node, ""); } +type BaseElem = {| + type: "mathord", +|} | {| + type: "textord", +|} | {| + type: "bin", +|} | {| + type: "rel", +|} | {| + type: "inner", +|} | {| + type: "open", +|} | {| + type: "close", +|} | {| + type: "punct", +|}; + +type Group = {| + type: "ordgroup", + value: Group[], +|} | {| + type: "color", + value: {| + value: Group[], + |}, +|} | {| + type: "font", + value: {| + body: Group, + |}, +|} | BaseElem; + +/** + * Sometimes we want to pull out the innermost element of a group. In most + * cases, this will just be the group itself, but when ordgroups and colors have + * a single element, we want to pull that out. + */ +const getBaseElem = function(group: Group): Group | boolean { + if (!group) { + return false; + } else if (group.type === "ordgroup") { + if (group.value.length === 1) { + return getBaseElem(group.value[0]); + } else { + return group; + } + } else if (group.type === "color") { + if (group.value.value.length === 1) { + return getBaseElem(group.value.value[0]); + } else { + return group; + } + } else if (group.type === "font") { + return getBaseElem(group.value.body); + } else { + return group; + } +}; + +/** + * TeXbook algorithms often reference "character boxes", which are simply groups + * with a single character in them. To decide if something is a character box, + * we find its innermost group, and see if it is a single character. + */ +const isCharacterBox = function(group: Group): boolean { + const baseElem = getBaseElem(group); + + // These are all they types of groups which hold single characters + return baseElem.type === "mathord" || + baseElem.type === "textord" || + baseElem.type === "bin" || + baseElem.type === "rel" || + baseElem.type === "inner" || + baseElem.type === "open" || + baseElem.type === "close" || + baseElem.type === "punct"; +}; + export default { contains, deflt, @@ -97,4 +176,6 @@ export default { indexOf, setTextContent, clearNode, + getBaseElem, + isCharacterBox, };