diff --git a/README.md b/README.md index 2f3c4f2848..614dbfd92c 100644 --- a/README.md +++ b/README.md @@ -69,11 +69,13 @@ Tools and utilities hosted in the repository. [![Nimble Tokens NPM version and repo link](https://img.shields.io/npm/v/@ni/nimble-tokens.svg?label=@ni/nimble-tokens)](https://www.npmjs.com/package/@ni/nimble-tokens) [![Jasmine parameterized NPM version and repo link](https://img.shields.io/npm/v/@ni/jasmine-parameterized.svg?label=@ni/jasmine-parameterized)](https://www.npmjs.com/package/@ni/jasmine-parameterized) +[![Unit Format NPM version and repo link](https://img.shields.io/npm/v/@ni/unit-format.svg?label=@ni/unit-format)](https://www.npmjs.com/package/@ni/unit-format) [![XLIFF to JSON Converter for Angular NPM version and repo link](https://img.shields.io/npm/v/@ni/xliff-to-json-converter.svg?label=@ni/xliff-to-json-converter)](https://www.npmjs.com/package/@ni/xliff-to-json-converter) - [`@ni/nimble-tokens`](/packages/nimble-tokens/) - Base design tokens used by the Nimble and Spright component packages. -- [`@ni/jasmine-parameterized`](/packages/jasmine-parameterized/) - a utility for writing [Jasmine](https://jasmine.github.io/) parameterized tests. -- [`@ni/xliff-to-json-converter`](/packages/xliff-to-json-converter/) - a utility to convert translation files from XLIFF to JSON for Angular localization. +- [`@ni/jasmine-parameterized`](/packages/jasmine-parameterized/) - A utility for writing [Jasmine](https://jasmine.github.io/) parameterized tests. +- [`@ni/unit-format`](/packages/unit-format/) - A library that provides multiple ways to format numbers with units. +- [`@ni/xliff-to-json-converter`](/packages/xliff-to-json-converter/) - A utility to convert translation files from XLIFF to JSON for Angular localization. The above packages follow [Semantic Versioning](https://semver.org). Consult the `CHANGELOG.md` for each package to see the changes in each version, including instructions for adapting your application in response to breaking changes. diff --git a/change/@ni-nimble-angular-4bbf8b02-27a1-4694-a47c-70da12f40be8.json b/change/@ni-nimble-angular-4bbf8b02-27a1-4694-a47c-70da12f40be8.json new file mode 100644 index 0000000000..da6e717ce3 --- /dev/null +++ b/change/@ni-nimble-angular-4bbf8b02-27a1-4694-a47c-70da12f40be8.json @@ -0,0 +1,7 @@ +{ + "type": "major", + "comment": "Breaking: `@ni/nimble-angular/pipes` unit scales renamed, i.e. `byteUnitScale` to `unitScaleByte`", + "packageName": "@ni/nimble-angular", + "email": "rajsite@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@ni-nimble-components-3ee33c61-aa6a-46d6-8c9e-7c7aa4cb422a.json b/change/@ni-nimble-components-3ee33c61-aa6a-46d6-8c9e-7c7aa4cb422a.json new file mode 100644 index 0000000000..32d0f8b6ad --- /dev/null +++ b/change/@ni-nimble-components-3ee33c61-aa6a-46d6-8c9e-7c7aa4cb422a.json @@ -0,0 +1,7 @@ +{ + "type": "major", + "comment": "Breaking: Rename `NumberTextUnitFormat` to `UnitFormatNumberText`", + "packageName": "@ni/nimble-components", + "email": "rajsite@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/@ni-unit-format-2428c33b-44f1-4a82-9c10-4bcee0b0779c.json b/change/@ni-unit-format-2428c33b-44f1-4a82-9c10-4bcee0b0779c.json new file mode 100644 index 0000000000..2e6e1f9ca4 --- /dev/null +++ b/change/@ni-unit-format-2428c33b-44f1-4a82-9c10-4bcee0b0779c.json @@ -0,0 +1,7 @@ +{ + "type": "major", + "comment": "First release of `@ni/unit-format` 🎉", + "packageName": "@ni/unit-format", + "email": "rajsite@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/package-lock.json b/package-lock.json index 461cd62511..98585db81d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "packages/jasmine-extensions", "packages/jasmine-parameterized", "packages/xliff-to-json-converter", + "packages/unit-format", "packages/nimble-tokens", "packages/nimble-components", "packages/spright-components", @@ -234,6 +235,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -315,6 +317,7 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -404,6 +407,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -523,6 +527,7 @@ "resolved": "https://registry.npmjs.org/@angular-eslint/builder/-/builder-19.8.1.tgz", "integrity": "sha512-NOMkw0xgDoDVCLkL5nkkvdd3ouDYkOGqtEmabTR7N4/kQnk1R4coOTWGCqAgMXCFdxlyjuxquDwuJ+yni81pRg==", "license": "MIT", + "peer": true, "dependencies": { "@angular-devkit/architect": ">= 0.1900.0 < 0.2000.0", "@angular-devkit/core": ">= 19.0.0 < 20.0.0" @@ -536,13 +541,15 @@ "version": "19.8.1", "resolved": "https://registry.npmjs.org/@angular-eslint/bundled-angular-compiler/-/bundled-angular-compiler-19.8.1.tgz", "integrity": "sha512-WXi1YbSs7SIQo48u+fCcc5Nt14/T4QzYQPLZUnjtsUXPgQG7ZoahhcGf7PPQ+n0V3pSopHOlSHwqK+tSsYK87A==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@angular-eslint/eslint-plugin": { "version": "19.8.1", "resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin/-/eslint-plugin-19.8.1.tgz", "integrity": "sha512-wZEBMPwD2TRhifG751hcj137EMIEaFmsxRB2EI+vfINCgPnFGSGGOHXqi8aInn9fXqHs7VbXkAzXYdBsvy1m4Q==", "license": "MIT", + "peer": true, "dependencies": { "@angular-eslint/bundled-angular-compiler": "19.8.1", "@angular-eslint/utils": "19.8.1" @@ -558,6 +565,7 @@ "resolved": "https://registry.npmjs.org/@angular-eslint/eslint-plugin-template/-/eslint-plugin-template-19.8.1.tgz", "integrity": "sha512-0ZVQldndLrDfB0tzFe/uIwvkUcakw8qGxvkEU0l7kSbv/ngNQ/qrkRi7P64otB15inIDUNZI2jtmVat52dqSfQ==", "license": "MIT", + "peer": true, "dependencies": { "@angular-eslint/bundled-angular-compiler": "19.8.1", "@angular-eslint/utils": "19.8.1", @@ -577,6 +585,7 @@ "resolved": "https://registry.npmjs.org/@angular-eslint/schematics/-/schematics-19.8.1.tgz", "integrity": "sha512-MKzfO3puOCuQFgP8XDUkEr5eaqcCQLAdYLLMcywEO/iRs1eRHL46+rkW+SjDp1cUqlxKtu+rLiTYr0T/O4fi9Q==", "license": "MIT", + "peer": true, "dependencies": { "@angular-devkit/core": ">= 19.0.0 < 20.0.0", "@angular-devkit/schematics": ">= 19.0.0 < 20.0.0", @@ -592,6 +601,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 4" } @@ -601,6 +611,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", "license": "ISC", + "peer": true, "bin": { "semver": "bin/semver.js" }, @@ -628,6 +639,7 @@ "resolved": "https://registry.npmjs.org/@angular-eslint/utils/-/utils-19.8.1.tgz", "integrity": "sha512-gVDKYWmAjeTPtaYmddT/HS03fCebXJtrk8G1MouQIviZbHqLjap6TbVlzlkBigRzaF0WnFnrDduQslkJzEdceA==", "license": "MIT", + "peer": true, "dependencies": { "@angular-eslint/bundled-angular-compiler": "19.8.1" }, @@ -642,7 +654,6 @@ "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-19.2.17.tgz", "integrity": "sha512-6VTet2fzTpSHEjxcVVzL8ZIyNGo/qsUs4XF/3wh9Iwu6qfWx711qXKlqGD/IHWzMTumzvQXbTV4hzvnO7fJvIQ==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1108,7 +1119,6 @@ "integrity": "sha512-+Oxm7q9hDoLMyJOYfUYBuHQo+dkAloi33apOPP56pzj+vsdJDzr+j1NISE5pyaAuKL4A3UD34qd0lx5+kfKp2g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -1623,7 +1633,6 @@ "resolved": "https://registry.npmjs.org/@angular/common/-/common-19.2.17.tgz", "integrity": "sha512-yFUXAdpvOFirGD/EGDwp1WHravHzI4sdyRE2iH7i8im9l8IE2VZ6D1KDJp8VVpMJt38LNlRAWYek3s+z6OcAkg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1640,7 +1649,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-19.2.17.tgz", "integrity": "sha512-qo8psYASAlDiQ8fAL8i/E2JfWH2nPTpZDKKZxSWvgBVA8o+zUEjYAJu6/k6btnu+4Qcb425T0rmM/zao6EU9Aw==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1653,7 +1661,6 @@ "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-19.2.17.tgz", "integrity": "sha512-KG82fh2A0odttc6+FxlQmFfHY/Giq8rYeV1qtdafafJ8hdWIiMr4r37xwhZOl8uk2/XSLM66bxUMFHYm+zt87Q==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.26.9", "@jridgewell/sourcemap-codec": "^1.4.14", @@ -1727,7 +1734,6 @@ "resolved": "https://registry.npmjs.org/@angular/core/-/core-19.2.17.tgz", "integrity": "sha512-nVu0ryxfiXUZ9M+NV21TY+rJZkPXTYo9U0aJb19hvByPpG+EvuujXUOgpulz6vxIzGy7pz/znRa+K9kxuuC+yQ==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1744,7 +1750,6 @@ "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-19.2.17.tgz", "integrity": "sha512-INgGGmMbwXuT+niAjMiCsJrZVEGWKZOep1vCRHoKlVnGUQSRKc3UW8ztmKDKMua/io/Opi03pRMpwbYQcTBr5A==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1763,7 +1768,6 @@ "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-19.2.17.tgz", "integrity": "sha512-euGGEFgrruehyTMYBIiPNYtt5VwP/lIUZHV8Qd+0ipEkyRckMeptVC08G5WQnKav3jRm1UU9NjUId03Fdmv/TA==", "license": "MIT", - "peer": true, "dependencies": { "@babel/core": "7.26.9", "@types/babel__core": "7.20.5", @@ -1833,7 +1837,6 @@ "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-19.2.17.tgz", "integrity": "sha512-Rn23nIQwYMSeGXWFHI/X8bGHAkdahRxH9UIGUlJKxW61MSkK6AW4kCHG/Ev1TvDq9HjijsMjcqcsd6/Sb8aBXg==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1874,7 +1877,6 @@ "resolved": "https://registry.npmjs.org/@angular/router/-/router-19.2.17.tgz", "integrity": "sha512-B3Vk+E8UHQwg06WEjGuvYaKNiIXxjHN9pN8S+hDE8xwRgIS5ojEwS94blEvsGQ4QsIja6WjZMOfDUBUPlgUSuA==", "license": "MIT", - "peer": true, "dependencies": { "tslib": "^2.3.0" }, @@ -1916,7 +1918,6 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.26.10.tgz", "integrity": "sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==", "license": "MIT", - "peer": true, "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.26.2", @@ -4057,6 +4058,7 @@ "integrity": "sha512-o1uhUASyo921r2XtHYOHy7gdkGLge8ghBEQHMWmyJFoXlpU58kIrhhN3w26lpQb6dspetweapMn2CSNwQ8I4wg==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" @@ -4068,6 +4070,7 @@ "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "tslib": "^2.4.0" } @@ -4078,6 +4081,7 @@ "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "tslib": "^2.4.0" } @@ -4093,6 +4097,7 @@ "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.71.0.tgz", "integrity": "sha512-2p9+dXWNQnp5Kq/V0XVWZiVAabzlX6rUW8vXXvtX8Yc1CkKgD93IPDEnv1sYZFkkS6HMvg6H0RMZfob/Co0YXA==", "license": "MIT", + "peer": true, "dependencies": { "@types/estree": "^1.0.8", "@typescript-eslint/types": "^8.46.0", @@ -4526,6 +4531,7 @@ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "license": "MIT", + "peer": true, "dependencies": { "eslint-visitor-keys": "^3.4.3" }, @@ -4544,6 +4550,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "license": "Apache-2.0", + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -4556,6 +4563,7 @@ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "license": "MIT", + "peer": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -4565,6 +4573,7 @@ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.1.tgz", "integrity": "sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/object-schema": "^2.1.7", "debug": "^4.3.1", @@ -4579,6 +4588,7 @@ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/core": "^0.17.0" }, @@ -4591,6 +4601,7 @@ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@types/json-schema": "^7.0.15" }, @@ -4603,6 +4614,7 @@ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", "license": "MIT", + "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -4626,6 +4638,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -4641,13 +4654,15 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@eslint/js": { "version": "9.39.2", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "license": "MIT", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -4684,6 +4699,7 @@ "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", "license": "Apache-2.0", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } @@ -4693,6 +4709,7 @@ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@eslint/core": "^0.17.0", "levn": "^0.4.1" @@ -4762,6 +4779,7 @@ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=18.18.0" } @@ -4771,6 +4789,7 @@ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.4.0" @@ -4784,6 +4803,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=12.22" }, @@ -4797,6 +4817,7 @@ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=18.18" }, @@ -5131,7 +5152,6 @@ "integrity": "sha512-G1ytyOoHh5BphmEBxSwALin3n1KGNYB6yImbICcRQdzXfOGbuJ9Jske/Of5Sebk339NSGGNfUshnzK8YWkTPsQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@inquirer/checkbox": "^4.1.2", "@inquirer/confirm": "^5.1.6", @@ -6044,6 +6064,7 @@ "resolved": "https://registry.npmjs.org/@mdit-vue/shared/-/shared-3.0.2.tgz", "integrity": "sha512-anFGls154h0iVzUt5O43EaqYvPwzfUxQ34QpNQsUQML7pbEJMhcgkRNvYw9hZBspab+/TP45agdPw5joh6/BBA==", "license": "MIT", + "peer": true, "dependencies": { "@mdit-vue/types": "3.0.2", "@types/markdown-it": "^14.1.2", @@ -6058,6 +6079,7 @@ "resolved": "https://registry.npmjs.org/@mdit-vue/types/-/types-3.0.2.tgz", "integrity": "sha512-00aAZ0F0NLik6I6Yba2emGbHLxv+QYrPH00qQ5dFKXlAo1Ll2RHDXwY7nN2WAfrx2pP+WrvSRFTGFCNGdzBDHw==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" } @@ -6493,6 +6515,7 @@ "integrity": "sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@emnapi/core": "^1.4.3", "@emnapi/runtime": "^1.4.3", @@ -6560,7 +6583,6 @@ "resolved": "https://registry.npmjs.org/@ni/eslint-config-angular/-/eslint-config-angular-11.0.1.tgz", "integrity": "sha512-722/NeHcTrTCJUTAB00LnH0/McggEQewbPvXl7DYT5KfXsuzA83D2XTSouUM6CMe7dajSBW50S1rQpcZA8tb/Q==", "license": "MIT", - "peer": true, "peerDependencies": { "@ni/eslint-config-javascript": "^5.1.4", "@ni/eslint-config-typescript": "^5.0.5", @@ -6572,7 +6594,6 @@ "resolved": "https://registry.npmjs.org/@ni/eslint-config-javascript/-/eslint-config-javascript-5.1.4.tgz", "integrity": "sha512-UvWMiPlRmTqS4GH4efxP/M6R2Mw2IEBpibgVSMU/0vrPqhs32BBKoIyewTPrMcxNEA0EAMYZETQqK+g5WrskgQ==", "license": "MIT", - "peer": true, "peerDependencies": { "@stylistic/eslint-plugin": "^5.4.0", "eslint": "^9.36.0", @@ -6681,6 +6702,10 @@ "resolved": "packages/react-workspace/spright-react", "link": true }, + "node_modules/@ni/unit-format": { + "resolved": "packages/unit-format", + "link": true + }, "node_modules/@ni/xliff-to-json-converter": { "resolved": "packages/xliff-to-json-converter", "link": true @@ -7428,6 +7453,7 @@ "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.2.9.tgz", "integrity": "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==", "license": "MIT", + "peer": true, "engines": { "node": "^12.20.0 || ^14.18.0 || >=16.0.0" }, @@ -7461,7 +7487,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz", "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@rolldown/pluginutils": { "version": "1.0.0-beta.47", @@ -7971,7 +7998,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@schematics/angular": { "version": "19.2.19", @@ -8921,6 +8949,7 @@ "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.1.tgz", "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "license": "MIT", + "peer": true, "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", @@ -8940,6 +8969,7 @@ "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz", "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "license": "Apache-2.0", + "peer": true, "dependencies": { "dequal": "^2.0.3" } @@ -8987,7 +9017,6 @@ "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.14.0.tgz", "integrity": "sha512-nm0VWVA1Vq/jaKY3wyRXViL/kf78yMdH7qETpv4qZXDQLU+pdWV3IGoRTQTKESc7d8L1wL/2uCeByLNUJfrSIw==", "license": "MIT", - "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -9170,7 +9199,6 @@ "resolved": "https://registry.npmjs.org/@tiptap/suggestion/-/suggestion-3.14.0.tgz", "integrity": "sha512-B9BQ9Tck8HsISDc6jZmtaSpl8KK69JbKHfU0ntILxgj8aBASElewO+W8WE49JSTxuyJGRgnhGSgaGpM4LhbLAg==", "license": "MIT", - "peer": true, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -9263,6 +9291,7 @@ "integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==", "license": "MIT", "optional": true, + "peer": true, "dependencies": { "tslib": "^2.4.0" } @@ -9271,7 +9300,8 @@ "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/babel__core": { "version": "7.20.5", @@ -9349,13 +9379,15 @@ "version": "5.2.3", "resolved": "https://registry.npmjs.org/@types/command-line-args/-/command-line-args-5.2.3.tgz", "integrity": "sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/command-line-usage": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/command-line-usage/-/command-line-usage-5.0.4.tgz", "integrity": "sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/connect": { "version": "3.4.38", @@ -9568,13 +9600,15 @@ "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/katex": { "version": "0.16.7", "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.7.tgz", "integrity": "sha512-HMwFiRujE5PjrgwHQ25+bsLJgowjGjm5Z8FVSf0N6PwgJrwxH0QxzHYDcKsTfV3wva0vzrpqMTJS2jXPr5BMEQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@types/linkify-it": { "version": "5.0.0", @@ -9633,7 +9667,6 @@ "integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -9695,7 +9728,6 @@ "resolved": "https://registry.npmjs.org/@types/react/-/react-19.2.7.tgz", "integrity": "sha512-MWtvHrGZLFttgeEj28VXHxpmwYbor/ATPYbBfSFZEIRK0ecCFLl2Qo55z52Hss+UV9CRN7trSeq1zbgx7YDWWg==", "license": "MIT", - "peer": true, "dependencies": { "csstype": "^3.2.2" } @@ -9833,6 +9865,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.50.1.tgz", "integrity": "sha512-PKhLGDq3JAg0Jk/aK890knnqduuI/Qj+udH7wCf0217IGi4gt+acgCyPVe79qoT+qKUvHMDQkwJeKW9fwl8Cyw==", "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.50.1", @@ -9861,6 +9894,7 @@ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 4" } @@ -9895,6 +9929,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.50.1.tgz", "integrity": "sha512-E1ur1MCVf+YiP89+o4Les/oBAVzmSbeRB0MQLfSlYtbWU17HPxZ6Bhs5iYmKZRALvEuBoXIZMOIRRc/P++Ortg==", "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.50.1", "@typescript-eslint/types": "^8.50.1", @@ -9916,6 +9951,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.50.1.tgz", "integrity": "sha512-mfRx06Myt3T4vuoHaKi8ZWNTPdzKPNBhiblze5N50//TSHOAQQevl/aolqA/BcqqbJ88GUnLqjjcBc8EWdBcVw==", "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/types": "8.50.1", "@typescript-eslint/visitor-keys": "8.50.1" @@ -9933,6 +9969,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.50.1.tgz", "integrity": "sha512-ooHmotT/lCWLXi55G4mvaUF60aJa012QzvLK0Y+Mp4WdSt17QhMhWOaBWeGTFVkb2gDgBe19Cxy1elPXylslDw==", "license": "MIT", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -9949,6 +9986,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.50.1.tgz", "integrity": "sha512-7J3bf022QZE42tYMO6SL+6lTPKFk/WphhRPe9Tw/el+cEwzLz1Jjz2PX3GtGQVxooLDKeMVmMt7fWpYRdG5Etg==", "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/types": "8.50.1", "@typescript-eslint/typescript-estree": "8.50.1", @@ -9987,6 +10025,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.50.1.tgz", "integrity": "sha512-woHPdW+0gj53aM+cxchymJCrh0cyS7BTIdcDxWUNsclr9VDkOSbqC13juHzxOmQ22dDkMZEpZB+3X1WpUvzgVQ==", "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/project-service": "8.50.1", "@typescript-eslint/tsconfig-utils": "8.50.1", @@ -10014,6 +10053,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", + "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -10023,6 +10063,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "license": "ISC", + "peer": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -10062,6 +10103,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.50.1.tgz", "integrity": "sha512-IrDKrw7pCRUR94zeuCSUWQ+w8JEf5ZX5jl/e6AHGSLi1/zIr0lgutfn/7JpfCey+urpgQEdrZVYzCaVVKiTwhQ==", "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/types": "8.50.1", "eslint-visitor-keys": "^4.2.1" @@ -10085,7 +10127,8 @@ "optional": true, "os": [ "android" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-android-arm64": { "version": "1.11.1", @@ -10098,7 +10141,8 @@ "optional": true, "os": [ "android" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-darwin-arm64": { "version": "1.11.1", @@ -10111,7 +10155,8 @@ "optional": true, "os": [ "darwin" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-darwin-x64": { "version": "1.11.1", @@ -10124,7 +10169,8 @@ "optional": true, "os": [ "darwin" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-freebsd-x64": { "version": "1.11.1", @@ -10137,7 +10183,8 @@ "optional": true, "os": [ "freebsd" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-arm-gnueabihf": { "version": "1.11.1", @@ -10150,7 +10197,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-arm-musleabihf": { "version": "1.11.1", @@ -10163,7 +10211,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-arm64-gnu": { "version": "1.11.1", @@ -10176,7 +10225,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-arm64-musl": { "version": "1.11.1", @@ -10189,7 +10239,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-ppc64-gnu": { "version": "1.11.1", @@ -10202,7 +10253,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-riscv64-gnu": { "version": "1.11.1", @@ -10215,7 +10267,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-riscv64-musl": { "version": "1.11.1", @@ -10228,7 +10281,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-s390x-gnu": { "version": "1.11.1", @@ -10241,7 +10295,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-x64-gnu": { "version": "1.11.1", @@ -10254,7 +10309,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-linux-x64-musl": { "version": "1.11.1", @@ -10267,7 +10323,8 @@ "optional": true, "os": [ "linux" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-wasm32-wasi": { "version": "1.11.1", @@ -10278,6 +10335,7 @@ ], "license": "MIT", "optional": true, + "peer": true, "dependencies": { "@napi-rs/wasm-runtime": "^0.2.11" }, @@ -10296,7 +10354,8 @@ "optional": true, "os": [ "win32" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-win32-ia32-msvc": { "version": "1.11.1", @@ -10309,7 +10368,8 @@ "optional": true, "os": [ "win32" - ] + ], + "peer": true }, "node_modules/@unrs/resolver-binding-win32-x64-msvc": { "version": "1.11.1", @@ -10322,7 +10382,8 @@ "optional": true, "os": [ "win32" - ] + ], + "peer": true }, "node_modules/@vitejs/plugin-react-swc": { "version": "4.2.2", @@ -10665,7 +10726,6 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -10678,6 +10738,7 @@ "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "license": "MIT", + "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -10756,7 +10817,6 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -10913,6 +10973,7 @@ "resolved": "https://registry.npmjs.org/apache-arrow/-/apache-arrow-21.1.0.tgz", "integrity": "sha512-kQrYLxhC+NTVVZ4CCzGF6L/uPVOzJmD1T3XgbiUnP7oTeVFOFgEUu6IKNwCDkpFoBVqDKQivlX4RUFqqnWFlEA==", "license": "Apache-2.0", + "peer": true, "dependencies": { "@swc/helpers": "^0.5.11", "@types/command-line-args": "^5.2.3", @@ -10933,6 +10994,7 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.4.tgz", "integrity": "sha512-vnDVpYPMzs4wunl27jHrfmwojOGKya0xyM3sH+UE5iv5uPS6vX7UIoh6m+vQc5LGBq52HBKPIn/zcSZVzeDEZg==", "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -10942,6 +11004,7 @@ "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", "license": "MIT", + "peer": true, "engines": { "node": ">=14" } @@ -10966,6 +11029,7 @@ "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", "license": "MIT", + "peer": true, "engines": { "node": ">=12.17" } @@ -11051,6 +11115,7 @@ "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.6.tgz", "integrity": "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==", "license": "MIT", + "peer": true, "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", @@ -11254,6 +11319,7 @@ "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", "license": "Apache-2.0", + "peer": true, "engines": { "node": ">= 0.4" } @@ -11717,7 +11783,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "baseline-browser-mapping": "^2.9.0", "caniuse-lite": "^1.0.30001759", @@ -11965,6 +12030,7 @@ "resolved": "https://registry.npmjs.org/chalk-template/-/chalk-template-0.4.0.tgz", "integrity": "sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==", "license": "MIT", + "peer": true, "dependencies": { "chalk": "^4.1.2" }, @@ -12449,6 +12515,7 @@ "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-6.0.1.tgz", "integrity": "sha512-Jr3eByUjqyK0qd8W0SGFW1nZwqCaNCtbXjRo2cRJC1OYxWl3MZ5t1US3jq+cO4sPavqgw4l9BMGX0CBe+trepg==", "license": "MIT", + "peer": true, "dependencies": { "array-back": "^6.2.2", "find-replace": "^5.0.2", @@ -12472,6 +12539,7 @@ "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-7.0.3.tgz", "integrity": "sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q==", "license": "MIT", + "peer": true, "dependencies": { "array-back": "^6.2.2", "chalk-template": "^0.4.0", @@ -12497,6 +12565,7 @@ "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", "license": "MIT", + "peer": true, "engines": { "node": ">= 12.0.0" } @@ -13032,14 +13101,14 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/cross-env": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-10.1.0.tgz", "integrity": "sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==", "license": "MIT", - "peer": true, "dependencies": { "@epic-web/invariant": "^1.0.0", "cross-spawn": "^7.0.6" @@ -13334,7 +13403,6 @@ "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz", "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", "license": "ISC", - "peer": true, "engines": { "node": ">=12" } @@ -13538,7 +13606,8 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -13727,8 +13796,7 @@ "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1467305.tgz", "integrity": "sha512-LxwMLqBoPPGpMdRL4NkLFRNy3QLp6Uqa7GNp1v6JaBheop2QrB9Q7q0A/q/CYYP9sBfZdHOyszVx4gc9zyk7ow==", "dev": true, - "license": "BSD-3-Clause", - "peer": true + "license": "BSD-3-Clause" }, "node_modules/di": { "version": "0.0.1", @@ -13742,6 +13810,7 @@ "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "license": "MIT", + "peer": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -13788,7 +13857,8 @@ "version": "0.5.16", "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz", "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/dom-serialize": { "version": "2.2.1", @@ -13976,6 +14046,7 @@ "resolved": "https://registry.npmjs.org/emoji-regex-xs/-/emoji-regex-xs-2.0.1.tgz", "integrity": "sha512-1QFuh8l7LqUcKe24LsPUNzjrzJQ7pgRwp1QMcZ5MX6mFplk2zQ08NVCM84++1cveaUUYtcCYHmeFEuNg16sU4g==", "license": "MIT", + "peer": true, "engines": { "node": ">=10.0.0" } @@ -14572,6 +14643,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-context/-/eslint-import-context-0.1.9.tgz", "integrity": "sha512-K9Hb+yRaGAGUbwjhFNHvSmmkZs9+zbuoe3kFQ4V1wYjrepUFYM2dZAfNtjbbj3qsPfUfsA68Bx/ICWQMi+C8Eg==", "license": "MIT", + "peer": true, "dependencies": { "get-tsconfig": "^4.10.1", "stable-hash-x": "^0.2.0" @@ -14596,6 +14668,7 @@ "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", "license": "MIT", + "peer": true, "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", @@ -14607,6 +14680,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -14651,6 +14725,7 @@ "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.1.tgz", "integrity": "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==", "license": "MIT", + "peer": true, "dependencies": { "debug": "^3.2.7" }, @@ -14668,6 +14743,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -14711,6 +14787,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "license": "MIT", + "peer": true, "dependencies": { "ms": "^2.1.1" } @@ -14720,6 +14797,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "license": "ISC", + "peer": true, "bin": { "semver": "bin/semver.js" } @@ -14729,6 +14807,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-60.8.3.tgz", "integrity": "sha512-4191bTMvnd5WUtopCdzNhQchvv/MxtPD86ZGl3vem8Ibm22xJhKuIyClmgSxw+YERtorVc/NhG+bGjfFVa6+VQ==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "@es-joy/jsdoccomment": "~0.71.0", "are-docs-informative": "^0.0.2", @@ -14755,6 +14834,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -14767,6 +14847,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-markdown-links/-/eslint-plugin-markdown-links-0.7.1.tgz", "integrity": "sha512-c6HAhdS3GmNLOzEuauGZ1+kkr20ruAHuF5rzwT48PdfZLTvPLeXa1Mb6HLdG8koLvwiLaIsXd8CntO/dt6UZug==", "license": "MIT", + "peer": true, "dependencies": { "@mdit-vue/shared": "^3.0.2", "entities": "^7.0.0", @@ -14792,6 +14873,7 @@ "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.0.tgz", "integrity": "sha512-FDWG5cmEYf2Z00IkYRhbFrwIwvdFKH07uV8dvNy0omp/Qb1xcyCWp2UDtcwJF4QZZvk0sLudP6/hAu42TaqVhQ==", "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=0.12" }, @@ -14804,6 +14886,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-markdown-preferences/-/eslint-plugin-markdown-preferences-0.38.0.tgz", "integrity": "sha512-7DQ60sgg/y7xXghkrNIrTHIiwNcMKWiAXTygwWgtgIb8tHL0zrDCDNEJwUOEgIilOCNRUYQUEj7dKYWjw4rjrQ==", "license": "MIT", + "peer": true, "dependencies": { "diff-sequences": "^29.6.3", "emoji-regex-xs": "^2.0.1", @@ -14835,6 +14918,7 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.1.0.tgz", "integrity": "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg==", "license": "MIT", + "peer": true, "dependencies": { "get-east-asian-width": "^1.3.0", "strip-ansi": "^7.1.0" @@ -14956,6 +15040,7 @@ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -14972,6 +15057,7 @@ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "license": "Apache-2.0", + "peer": true, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -14984,6 +15070,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -15000,6 +15087,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -15012,6 +15100,7 @@ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "license": "ISC", + "peer": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -15023,13 +15112,15 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/espree": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", @@ -15060,6 +15151,7 @@ "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "license": "BSD-3-Clause", + "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -15348,7 +15440,8 @@ "url": "https://opencollective.com/fastify" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -15383,13 +15476,15 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-uri": { "version": "3.1.0", @@ -15421,6 +15516,7 @@ "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz", "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==", "license": "MIT", + "peer": true, "dependencies": { "format": "^0.2.0" }, @@ -15487,6 +15583,7 @@ "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "license": "MIT", + "peer": true, "dependencies": { "flat-cache": "^4.0.0" }, @@ -15574,6 +15671,7 @@ "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-5.0.2.tgz", "integrity": "sha512-Y45BAiE3mz2QsrN2fb5QEtO4qb44NcS7en/0y9PEVsg351HsLeVclP8QPMH79Le9sH3rs5RSwJu99W0WPZO43Q==", "license": "MIT", + "peer": true, "engines": { "node": ">=14" }, @@ -15591,6 +15689,7 @@ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "license": "MIT", + "peer": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -15627,6 +15726,7 @@ "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "license": "MIT", + "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" @@ -15639,7 +15739,8 @@ "version": "25.9.23", "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-25.9.23.tgz", "integrity": "sha512-MI1qs7Lo4Syw0EOzUl0xjs2lsoeqFku44KpngfIduHBYvzm8h2+7K8YMQh1JtVVVrUvhLpNwqVi4DERegUJhPQ==", - "license": "Apache-2.0" + "license": "Apache-2.0", + "peer": true }, "node_modules/flatted": { "version": "3.3.3", @@ -15984,6 +16085,7 @@ "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.13.0.tgz", "integrity": "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==", "license": "MIT", + "peer": true, "dependencies": { "resolve-pkg-maps": "^1.0.0" }, @@ -16031,7 +16133,8 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/glob": { "version": "10.5.0", @@ -16131,7 +16234,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", "license": "MIT", - "peer": true, "engines": { "node": ">=18" }, @@ -16445,7 +16547,8 @@ "url": "https://patreon.com/mdevils" } ], - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/html-escaper": { "version": "2.0.2", @@ -17220,6 +17323,7 @@ "resolved": "https://registry.npmjs.org/is-bun-module/-/is-bun-module-2.0.0.tgz", "integrity": "sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==", "license": "MIT", + "peer": true, "dependencies": { "semver": "^7.7.1" } @@ -17958,7 +18062,6 @@ "integrity": "sha512-oLCXIhEb5e0zzjn9GyuvcuisvLBwUjmgz7a0RNGWKwQtJCDld4m+vwKUpAIJVLB5vbmQFdtKhT86/tIZlJ5gYw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "glob": "^10.2.2", "jasmine-core": "~5.13.0" @@ -17972,8 +18075,7 @@ "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-5.13.0.tgz", "integrity": "sha512-vsYjfh7lyqvZX5QgqKc4YH8phs7g96Z8bsdIFNEU3VqXhlHaq+vov/Fgn/sr6MiUczdZkyXRC3TX369Ll4Nzbw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/jest-worker": { "version": "27.5.1", @@ -18012,7 +18114,6 @@ "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", "devOptional": true, "license": "MIT", - "peer": true, "bin": { "jiti": "bin/jiti.js" } @@ -18136,6 +18237,7 @@ "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-6.6.0.tgz", "integrity": "sha512-3hSD14nXx66Rspx1RMnz1Pj4JacrMBAsC0CrF9lZYO/Qsp5/oIr6KqujVUNhQu94B6mMip2ukki8MpEWZwyhKA==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.0.0" } @@ -18156,6 +18258,7 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/json-bignum/-/json-bignum-0.0.3.tgz", "integrity": "sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg==", + "peer": true, "engines": { "node": ">=0.8" } @@ -18164,7 +18267,8 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", @@ -18203,7 +18307,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json5": { "version": "2.2.3", @@ -18278,7 +18383,6 @@ "integrity": "sha512-LrtUxbdvt1gOpo3gxG+VAJlJAEMhbWlM4YrFQgql98FwF7+K8K12LYO4hnDdUkNjeztYrOXEMqgTajSWgmtI/w==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@colors/colors": "1.5.0", "body-parser": "^1.19.0", @@ -18413,7 +18517,6 @@ "integrity": "sha512-i/zQLFrfEpRyQoJF9fsCdTMOF5c2dK7C7OmsuKg2D0YSsuZSfQDiLuaiktbuio6F2wiCsZSnSnieIQ0ant/uzQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "jasmine-core": "^4.1.0" }, @@ -18753,6 +18856,7 @@ "https://github.com/sponsors/katex" ], "license": "MIT", + "peer": true, "dependencies": { "commander": "^8.3.0" }, @@ -18765,6 +18869,7 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", "license": "MIT", + "peer": true, "engines": { "node": ">= 12" } @@ -18774,6 +18879,7 @@ "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "license": "MIT", + "peer": true, "dependencies": { "json-buffer": "3.0.1" } @@ -18832,7 +18938,6 @@ "integrity": "sha512-tkuLHQlvWUTeQ3doAqnHbNn8T6WX1KA8yvbKG9x4VtKtIjHsVKQZCH11zRgAfbDAXC2UNIg/K9BYAAcEzUIrNg==", "dev": true, "license": "Apache-2.0", - "peer": true, "dependencies": { "copy-anything": "^2.0.1", "parse-node-version": "^1.0.1", @@ -18911,6 +19016,7 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -19290,6 +19396,7 @@ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "license": "MIT", + "peer": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -19338,7 +19445,8 @@ "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/lodash.snakecase": { "version": "4.1.1", @@ -19647,6 +19755,7 @@ "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", "license": "MIT", + "peer": true, "bin": { "lz-string": "bin/bin.js" } @@ -19811,6 +19920,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz", "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==", "license": "MIT", + "peer": true, "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", @@ -19829,6 +19939,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -19942,6 +20053,7 @@ "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz", "integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==", "license": "MIT", + "peer": true, "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", @@ -20163,6 +20275,7 @@ "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz", "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==", "license": "MIT", + "peer": true, "dependencies": { "fault": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -20300,6 +20413,7 @@ "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz", "integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==", "license": "MIT", + "peer": true, "dependencies": { "@types/katex": "^0.16.0", "devlop": "^1.0.0", @@ -21149,6 +21263,7 @@ "resolved": "https://registry.npmjs.org/napi-postinstall/-/napi-postinstall-0.3.4.tgz", "integrity": "sha512-PHI5f1O0EP5xJ9gQmFGMS6IZcrVvTjpXjz7Na41gTE7eE2hK11lg04CECCYEEjdc17EV4DO+fkGEtt7TpTaTiQ==", "license": "MIT", + "peer": true, "bin": { "napi-postinstall": "lib/cli.js" }, @@ -21163,7 +21278,8 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/needle": { "version": "3.3.1", @@ -21216,7 +21332,6 @@ "integrity": "sha512-dFuwFsDJMBSd1YtmLLcX5bNNUCQUlRqgf34aXA+79PmkOP+0eF8GP2949wq3+jMjmFTNm80Oo8IUYiSLwklKCQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@rollup/plugin-json": "^6.1.0", "@rollup/wasm-node": "^4.24.0", @@ -22004,6 +22119,7 @@ "resolved": "https://registry.npmjs.org/object-deep-merge/-/object-deep-merge-1.0.5.tgz", "integrity": "sha512-3DioFgOzetbxbeUq8pB2NunXo8V0n4EvqsWM/cJoI6IA9zghd7cl/2pBOuWRf4dlvA+fcg5ugFMZaN2/RuoaGg==", "license": "MIT", + "peer": true, "dependencies": { "type-fest": "4.2.0" } @@ -22105,6 +22221,7 @@ "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", "license": "MIT", + "peer": true, "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", @@ -22209,6 +22326,7 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "license": "MIT", + "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -22358,6 +22476,7 @@ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "license": "MIT", + "peer": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -22886,6 +23005,7 @@ "resolved": "https://registry.npmjs.org/parse-imports-exports/-/parse-imports-exports-0.2.4.tgz", "integrity": "sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==", "license": "MIT", + "peer": true, "dependencies": { "parse-statements": "1.0.11" } @@ -22933,7 +23053,8 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/parse-statements/-/parse-statements-1.0.11.tgz", "integrity": "sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/parse-url": { "version": "9.2.0", @@ -23382,7 +23503,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "nanoid": "^3.3.8", "picocolors": "^1.1.1", @@ -23520,6 +23640,7 @@ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -23545,6 +23666,7 @@ "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "license": "MIT", + "peer": true, "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", @@ -23559,6 +23681,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -23568,6 +23691,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -23579,7 +23703,8 @@ "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/prismjs": { "version": "1.30.0", @@ -23684,6 +23809,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz", "integrity": "sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-transform": "^1.0.0" } @@ -23693,6 +23819,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz", "integrity": "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-state": "^1.0.0" } @@ -23702,6 +23829,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz", "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", @@ -23713,6 +23841,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz", "integrity": "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0", @@ -23724,6 +23853,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.0.tgz", "integrity": "sha512-z00qvurSdCEWUIulij/isHaqu4uLS8r/Fi61IbjdIPJEonQgggbJsLnstW7Lgdk4zQ68/yr6B6bf7sJXowIgdQ==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-keymap": "^1.0.0", "prosemirror-model": "^1.0.0", @@ -23736,6 +23866,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz", "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-state": "^1.2.2", "prosemirror-transform": "^1.0.0", @@ -23748,6 +23879,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz", "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.0.0" @@ -23758,6 +23890,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz", "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-state": "^1.0.0", "w3c-keyname": "^2.2.0" @@ -23779,6 +23912,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz", "integrity": "sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ==", "license": "MIT", + "peer": true, "dependencies": { "crelt": "^1.0.0", "prosemirror-commands": "^1.0.0", @@ -23791,7 +23925,6 @@ "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.4.tgz", "integrity": "sha512-PIM7E43PBxKce8OQeezAs9j4TP+5yDpZVbuurd1h5phUxEKIu+G2a+EUZzIC5nS1mJktDJWzbqS23n1tsAf5QA==", "license": "MIT", - "peer": true, "dependencies": { "orderedmap": "^2.0.0" } @@ -23801,6 +23934,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.4.tgz", "integrity": "sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-model": "^1.25.0" } @@ -23810,6 +23944,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz", "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", @@ -23821,7 +23956,6 @@ "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz", "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==", "license": "MIT", - "peer": true, "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-transform": "^1.0.0", @@ -23833,6 +23967,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.5.tgz", "integrity": "sha512-V/0cDCsHKHe/tfWkeCmthNUcEp1IVO3p6vwN8XtwE9PZQLAZJigbw3QoraAdfJPir4NKJtNvOB8oYGKRl+t0Dw==", "license": "MIT", + "peer": true, "dependencies": { "prosemirror-keymap": "^1.2.3", "prosemirror-model": "^1.25.4", @@ -23846,6 +23981,7 @@ "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz", "integrity": "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ==", "license": "MIT", + "peer": true, "dependencies": { "@remirror/core-constants": "3.0.0", "escape-string-regexp": "^4.0.0" @@ -23861,6 +23997,7 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "license": "MIT", + "peer": true, "engines": { "node": ">=10" }, @@ -23882,7 +24019,6 @@ "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.41.4.tgz", "integrity": "sha512-WkKgnyjNncri03Gjaz3IFWvCAE94XoiEgvtr0/r2Xw7R8/IjK3sKLSiDoCHWcsXSAinVaKlGRZDvMCsF1kbzjA==", "license": "MIT", - "peer": true, "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", @@ -24180,7 +24316,6 @@ "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -24190,7 +24325,6 @@ "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", "license": "MIT", - "peer": true, "dependencies": { "scheduler": "^0.27.0" }, @@ -24567,6 +24701,7 @@ "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", "license": "MIT", + "peer": true, "funding": { "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" } @@ -24702,6 +24837,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-13.0.0.tgz", "integrity": "sha512-tvZgpqk6fz4BaNZ66ZsRaZnbHvP/jG3uKJvAZOwEVUL4RTA5nJeeLYfyN9/VA8NX/V3IBG+hkeuGpKjvELkVhA==", "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "minimatch": "^10.1.1", "minipass": "^7.1.2", @@ -24719,6 +24855,7 @@ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.4.tgz", "integrity": "sha512-B5Y16Jr9LB9dHVkh6ZevG+vAbOsNOYCX+sXvFWFu7B3Iz5mijW3zdbMyhsh8ANd2mSWBYdJgnqi+mL7/LrOPYg==", "license": "BlueOak-1.0.0", + "peer": true, "engines": { "node": "20 || >=22" } @@ -24728,6 +24865,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "@isaacs/brace-expansion": "^5.0.0" }, @@ -24743,6 +24881,7 @@ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "license": "ISC", + "peer": true, "engines": { "node": ">=16 || 14 >=14.17" } @@ -24752,6 +24891,7 @@ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.1.tgz", "integrity": "sha512-oWyT4gICAu+kaA7QWk/jvCHWarMKNs6pXOGWKDTr7cw4IGcUbW+PeTfbaQiLGheFRpjo6O9J0PmyMfQPjH71oA==", "license": "BlueOak-1.0.0", + "peer": true, "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" @@ -24779,7 +24919,6 @@ "integrity": "sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/estree": "1.0.8" }, @@ -24865,7 +25004,8 @@ "version": "1.3.4", "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/run-applescript": { "version": "7.1.0", @@ -24917,7 +25057,6 @@ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", "license": "Apache-2.0", - "peer": true, "dependencies": { "tslib": "^2.1.0" } @@ -25007,7 +25146,6 @@ "integrity": "sha512-3ToiC1xZ1Y8aU7+CkgCI/tqyuPXEmYGJXO7H4uqp0xkLXUqp88rQQ4j1HmP37xSJLbCJPaIiv+cT1y+grssrww==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "chokidar": "^4.0.0", "immutable": "^5.0.2", @@ -25119,6 +25257,7 @@ "resolved": "https://registry.npmjs.org/sdbm/-/sdbm-3.0.0.tgz", "integrity": "sha512-9FHNk9qJKuRxkUeQQdRp8WLCFaL4hvPtYz/2xNAOkuZzQ3ZqMMkZ1CrkKPDA4lxbenMml0JRKHGyTyucK/JBBg==", "license": "MIT", + "peer": true, "engines": { "node": ">=20" }, @@ -25820,6 +25959,7 @@ "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", "license": "MIT", + "peer": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -25913,6 +26053,7 @@ "resolved": "https://registry.npmjs.org/stable-hash-x/-/stable-hash-x-0.2.0.tgz", "integrity": "sha512-o3yWv49B/o4QZk5ZcsALc6t0+eCelPc44zZsLtCQnZPDwFpDYSWcDnrv2TtMmMbQ7uKo3J0HTURCqckw23czNQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=12.0.0" } @@ -25945,7 +26086,6 @@ "resolved": "https://registry.npmjs.org/storybook/-/storybook-10.1.10.tgz", "integrity": "sha512-oK0t0jEogiKKfv5Z1ao4Of99+xWw1TMUGuGRYDQS4kp2yyBsJQEgu7NI7OLYsCDI6gzt5p3RPtl1lqdeVLUi8A==", "license": "MIT", - "peer": true, "dependencies": { "@storybook/global": "^5.0.0", "@storybook/icons": "^2.0.0", @@ -26313,6 +26453,7 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "license": "MIT", + "peer": true, "engines": { "node": ">=4" } @@ -26344,6 +26485,7 @@ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "license": "MIT", + "peer": true, "engines": { "node": ">=8" }, @@ -26589,6 +26731,7 @@ "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.11.11.tgz", "integrity": "sha512-MeQTA1r0litLUf0Rp/iisCaL8761lKAZHaimlbGK4j0HysC4PLfqygQj9srcs0m2RdtDYnF8UuYyKpbjHYp7Jw==", "license": "MIT", + "peer": true, "dependencies": { "@pkgr/core": "^0.2.9" }, @@ -26610,6 +26753,7 @@ "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-4.1.1.tgz", "integrity": "sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==", "license": "MIT", + "peer": true, "dependencies": { "array-back": "^6.2.2", "wordwrapjs": "^5.1.0" @@ -26758,7 +26902,6 @@ "integrity": "sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw==", "dev": true, "license": "BSD-2-Clause", - "peer": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -27052,6 +27195,7 @@ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "license": "MIT", + "peer": true, "engines": { "node": ">=18.12" }, @@ -27074,6 +27218,7 @@ "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", "license": "MIT", + "peer": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", @@ -27086,6 +27231,7 @@ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", "license": "MIT", + "peer": true, "dependencies": { "minimist": "^1.2.0" }, @@ -27097,8 +27243,7 @@ "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/tuf-js": { "version": "3.1.0", @@ -27452,6 +27597,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -27464,6 +27610,7 @@ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.2.0.tgz", "integrity": "sha512-5zknd7Dss75pMSED270A1RQS3KloqRJA9XbXLe0eCxyw7xXFb3rd+9B0UQ/0E+LQT6lnrLviEolYORlRWamn4w==", "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=16" }, @@ -27588,7 +27735,6 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -27626,6 +27772,7 @@ "resolved": "https://registry.npmjs.org/typical/-/typical-7.3.0.tgz", "integrity": "sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==", "license": "MIT", + "peer": true, "engines": { "node": ">=12.17" } @@ -27686,6 +27833,7 @@ "resolved": "https://registry.npmjs.org/undici/-/undici-7.16.0.tgz", "integrity": "sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==", "license": "MIT", + "peer": true, "engines": { "node": ">=20.18.1" } @@ -27830,6 +27978,7 @@ "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", "license": "MIT", + "peer": true, "dependencies": { "@types/unist": "^3.0.0", "unist-util-visit": "^5.0.0" @@ -27987,6 +28136,7 @@ "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "license": "BSD-2-Clause", + "peer": true, "dependencies": { "punycode": "^2.1.0" } @@ -27996,6 +28146,7 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "license": "MIT", + "peer": true, "engines": { "node": ">=6" } @@ -28141,7 +28292,6 @@ "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", @@ -28859,7 +29009,8 @@ "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/watchpack": { "version": "2.4.2", @@ -28922,7 +29073,6 @@ "integrity": "sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", @@ -29000,7 +29150,6 @@ "integrity": "sha512-QcQ72gh8a+7JO63TAx/6XZf/CWhgMzu5m0QirvPfGvptOusAxG12w2+aua1Jkjr7hzaWDnJ2n6JFeexMHI+Zjg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@types/bonjour": "^3.5.13", "@types/connect-history-api-fallback": "^1.5.4", @@ -29433,6 +29582,7 @@ "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -29442,6 +29592,7 @@ "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-5.1.1.tgz", "integrity": "sha512-0yweIbkINJodk27gX9LBGMzyQdBDan3s/dEAiwBOj+Mf0PPyWL6/rikalkv8EeD0E8jm4o5RXEOrFTP3NXbhJg==", "license": "MIT", + "peer": true, "engines": { "node": ">=12.17" } @@ -29681,7 +29832,6 @@ "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", "dev": true, "license": "ISC", - "peer": true, "bin": { "yaml": "bin.mjs" }, @@ -29802,7 +29952,6 @@ "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -29824,8 +29973,7 @@ "version": "0.15.1", "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.15.1.tgz", "integrity": "sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/zwitch": { "version": "2.0.4", @@ -29853,6 +30001,7 @@ "@ni/nimble-components": "*", "@ni/ok-components": "*", "@ni/spright-components": "*", + "@ni/unit-format": "*", "rxjs": "^7.4.0", "tslib": "^2.2.0", "zone.js": "^0.15.1" @@ -29897,7 +30046,8 @@ "@angular/forms": "^19.2.17", "@angular/localize": "^19.2.17", "@angular/router": "^19.2.17", - "@ni/nimble-components": "^34.10.3" + "@ni/nimble-components": "^34.10.3", + "@ni/unit-format": "^0.0.1" } }, "packages/angular-workspace/ok-angular": { @@ -30134,6 +30284,7 @@ "@ni/fast-foundation": "^10.1.2", "@ni/fast-web-utilities": "^10.0.0", "@ni/nimble-tokens": "^8.13.6", + "@ni/unit-format": "^0.0.1", "@tanstack/table-core": "^8.19.3", "@tanstack/virtual-core": "^3.10.6", "@tiptap/core": "^3.10.1", @@ -30418,6 +30569,40 @@ "globals": "^14.0.0" } }, + "packages/unit-format": { + "name": "@ni/unit-format", + "version": "0.0.1", + "license": "MIT", + "devDependencies": { + "@ni-private/eslint-config-nimble": "*", + "@ni/jasmine-parameterized": "^1.0.6", + "@types/jasmine": "^5.1.4", + "jasmine": "^5.1.0", + "jasmine-core": "^5.1.2", + "karma": "^6.3.0", + "karma-chrome-launcher": "^3.1.0", + "karma-jasmine": "^5.1.0", + "karma-jasmine-html-reporter": "^2.0.0", + "karma-spec-reporter": "^0.0.36", + "karma-vite": "^1.0.5", + "playwright": "1.54.1", + "typescript": "~5.4.5" + } + }, + "packages/unit-format/node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "packages/xliff-to-json-converter": { "name": "@ni/xliff-to-json-converter", "version": "1.1.14", diff --git a/package.json b/package.json index 4364b05ef3..e98df3cf5f 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "packages/jasmine-extensions", "packages/jasmine-parameterized", "packages/xliff-to-json-converter", + "packages/unit-format", "packages/nimble-tokens", "packages/nimble-components", "packages/spright-components", diff --git a/packages/angular-workspace/example-client-app/src/tests/pipes.spec.ts b/packages/angular-workspace/example-client-app/src/tests/pipes.spec.ts index 7c84638989..b058702dd9 100644 --- a/packages/angular-workspace/example-client-app/src/tests/pipes.spec.ts +++ b/packages/angular-workspace/example-client-app/src/tests/pipes.spec.ts @@ -1,4 +1,4 @@ -import { DurationPipe, NumberTextPipe, byteUnitScale, byte1024UnitScale, celsiusUnitScale, fahrenheitUnitScale, voltUnitScale } from '@ni/nimble-angular/pipes'; +import { DurationPipe, NumberTextPipe, unitScaleByte, unitScaleByte1024, unitScaleCelsius, unitScaleFahrenheit, unitScaleVolt } from '@ni/nimble-angular/pipes'; describe('Pipes', () => { it('exports DurationPipe', () => { @@ -9,23 +9,23 @@ describe('Pipes', () => { expect(new NumberTextPipe('en')).toBeTruthy(); }); - it('exports byteUnitScale', () => { - expect(byteUnitScale).toBeTruthy(); + it('exports unitScaleByte', () => { + expect(unitScaleByte).toBeTruthy(); }); - it('exports byte1024UnitScale', () => { - expect(byte1024UnitScale).toBeTruthy(); + it('exports unitScaleByte1024', () => { + expect(unitScaleByte1024).toBeTruthy(); }); - it('exports celsiusUnitScale', () => { - expect(celsiusUnitScale).toBeTruthy(); + it('exports unitScaleCelsius', () => { + expect(unitScaleCelsius).toBeTruthy(); }); - it('exports fahrenheitUnitScale', () => { - expect(fahrenheitUnitScale).toBeTruthy(); + it('exports unitScaleFahrenheit', () => { + expect(unitScaleFahrenheit).toBeTruthy(); }); - it('exports voltUnitScale', () => { - expect(voltUnitScale).toBeTruthy(); + it('exports unitScaleVolt', () => { + expect(unitScaleVolt).toBeTruthy(); }); }); \ No newline at end of file diff --git a/packages/angular-workspace/nimble-angular/package.json b/packages/angular-workspace/nimble-angular/package.json index ac0e0f3b92..3112fde07e 100644 --- a/packages/angular-workspace/nimble-angular/package.json +++ b/packages/angular-workspace/nimble-angular/package.json @@ -32,7 +32,8 @@ "@angular/forms": "^19.2.17", "@angular/localize": "^19.2.17", "@angular/router": "^19.2.17", - "@ni/nimble-components": "^34.10.3" + "@ni/nimble-components": "^34.10.3", + "@ni/unit-format": "^0.0.1" }, "dependencies": { "tslib": "^2.2.0" diff --git a/packages/angular-workspace/nimble-angular/pipes/number-text.pipe.ts b/packages/angular-workspace/nimble-angular/pipes/number-text.pipe.ts index 2cc0ad87b6..71b82c6348 100644 --- a/packages/angular-workspace/nimble-angular/pipes/number-text.pipe.ts +++ b/packages/angular-workspace/nimble-angular/pipes/number-text.pipe.ts @@ -1,5 +1,5 @@ import { Inject, LOCALE_ID, Pipe, type PipeTransform } from '@angular/core'; -import { NumberTextUnitFormat, type NumberTextUnitFormatOptions } from '@ni/nimble-components/dist/esm/table-column/number-text/models/number-text-unit-format'; +import { UnitFormatNumberText, type UnitFormatNumberTextOptions } from '@ni/nimble-components/dist/esm/table-column/number-text/models/unit-format-number-text'; /** * A pipe that transforms a number into a string with optional unit @@ -12,14 +12,14 @@ export class NumberTextPipe implements PipeTransform { /** * @internal */ - public numberTextUnitFormat?: NumberTextUnitFormat; + public unitFormatNumberText?: UnitFormatNumberText; public constructor(@Inject(LOCALE_ID) private readonly locale: string) {} - public transform(value: number, options?: NumberTextUnitFormatOptions): string { - if (!this.numberTextUnitFormat?.optionsMatch(options)) { - this.numberTextUnitFormat = new NumberTextUnitFormat(this.locale, options); + public transform(value: number, options?: UnitFormatNumberTextOptions): string { + if (!this.unitFormatNumberText?.optionsMatch(options)) { + this.unitFormatNumberText = new UnitFormatNumberText(this.locale, options); } - return this.numberTextUnitFormat.format(value); + return this.unitFormatNumberText.format(value); } } diff --git a/packages/angular-workspace/nimble-angular/pipes/public-api.ts b/packages/angular-workspace/nimble-angular/pipes/public-api.ts index de1a50f5e2..fd5b4795bb 100644 --- a/packages/angular-workspace/nimble-angular/pipes/public-api.ts +++ b/packages/angular-workspace/nimble-angular/pipes/public-api.ts @@ -1,8 +1,8 @@ export * from './diacritic-insensitive.pipe'; export * from './duration.pipe'; export * from './number-text.pipe'; -export { byteUnitScale } from '@ni/nimble-components/dist/esm/utilities/unit-format/unit-scale/byte-unit-scale'; -export { byte1024UnitScale } from '@ni/nimble-components/dist/esm/utilities/unit-format/unit-scale/byte-1024-unit-scale'; -export { celsiusUnitScale } from '@ni/nimble-components/dist/esm/utilities/unit-format/unit-scale/celsius-unit-scale'; -export { fahrenheitUnitScale } from '@ni/nimble-components/dist/esm/utilities/unit-format/unit-scale/fahrenheit-unit-scale'; -export { voltUnitScale } from '@ni/nimble-components/dist/esm/utilities/unit-format/unit-scale/volt-unit-scale'; +export { unitScaleByte } from '@ni/unit-format/unit-scale/byte'; +export { unitScaleByte1024 } from '@ni/unit-format/unit-scale/byte-1024'; +export { unitScaleCelsius } from '@ni/unit-format/unit-scale/celsius'; +export { unitScaleFahrenheit } from '@ni/unit-format/unit-scale/fahrenheit'; +export { unitScaleVolt } from '@ni/unit-format/unit-scale/volt'; diff --git a/packages/angular-workspace/nimble-angular/pipes/tests/number-text.pipe.spec.ts b/packages/angular-workspace/nimble-angular/pipes/tests/number-text.pipe.spec.ts index fbd5ae88ce..a4c43fb3fb 100644 --- a/packages/angular-workspace/nimble-angular/pipes/tests/number-text.pipe.spec.ts +++ b/packages/angular-workspace/nimble-angular/pipes/tests/number-text.pipe.spec.ts @@ -3,7 +3,7 @@ import { type ComponentFixture, TestBed } from '@angular/core/testing'; import { parameterizeSpec } from '@ni/jasmine-parameterized'; import { NumberTextPipe } from '../number-text.pipe'; import { NumberTextFormat } from '../../table-column/number-text/nimble-table-column-number-text.directive'; -import { byteUnitScale } from '../public-api'; +import { unitScaleByte } from '../public-api'; describe('NumberTextPipe', () => { const testCases = [ @@ -20,7 +20,7 @@ describe('NumberTextPipe', () => { value: 3000, expected: '3 kB', options: { - unitScale: byteUnitScale, + unitScale: unitScaleByte, } }, { @@ -90,7 +90,7 @@ describe('NumberTextPipe', () => { it('honors change to unitScale argument in subsequent call to transform()', () => { const pipe = new NumberTextPipe('en'); expect(pipe.transform(100)).toEqual('100'); - expect(pipe.transform(100, { unitScale: byteUnitScale })).toEqual('100 bytes'); + expect(pipe.transform(100, { unitScale: unitScaleByte })).toEqual('100 bytes'); }); it('honors changes to multiple arguments in subsequent call to transform()', () => { @@ -99,7 +99,7 @@ describe('NumberTextPipe', () => { expect(pipe.transform(100.12345, { numberTextFormat: NumberTextFormat.decimal, decimalMaximumDigits: 1, - unitScale: byteUnitScale + unitScale: unitScaleByte })).toEqual('100.1 bytes'); }); @@ -108,12 +108,12 @@ describe('NumberTextPipe', () => { const args = { numberTextFormat: NumberTextFormat.decimal, maximumDecimalDigits: 3, - unitScale: byteUnitScale + unitScale: unitScaleByte }; pipe.transform(1, args); - const initialFormatter = pipe.numberTextUnitFormat; + const initialFormatter = pipe.unitFormatNumberText; pipe.transform(1, args); - expect(pipe.numberTextUnitFormat).toBe(initialFormatter); + expect(pipe.unitFormatNumberText).toBe(initialFormatter); }); describe('in component template', () => { diff --git a/packages/angular-workspace/package.json b/packages/angular-workspace/package.json index 1177f9efe3..6552a70906 100644 --- a/packages/angular-workspace/package.json +++ b/packages/angular-workspace/package.json @@ -46,6 +46,7 @@ "@ni/nimble-components": "*", "@ni/ok-components": "*", "@ni/spright-components": "*", + "@ni/unit-format": "*", "rxjs": "^7.4.0", "tslib": "^2.2.0", "zone.js": "^0.15.1" diff --git a/packages/nimble-components/package.json b/packages/nimble-components/package.json index 66eb097525..e5cfb99157 100644 --- a/packages/nimble-components/package.json +++ b/packages/nimble-components/package.json @@ -49,6 +49,7 @@ "@ni/fast-foundation": "^10.1.2", "@ni/fast-web-utilities": "^10.0.0", "@ni/nimble-tokens": "^8.13.6", + "@ni/unit-format": "^0.0.1", "@tanstack/table-core": "^8.19.3", "@tanstack/virtual-core": "^3.10.6", "@tiptap/core": "^3.10.1", diff --git a/packages/nimble-components/src/table-column/number-text/index.ts b/packages/nimble-components/src/table-column/number-text/index.ts index aa96bdf693..e297fff81a 100644 --- a/packages/nimble-components/src/table-column/number-text/index.ts +++ b/packages/nimble-components/src/table-column/number-text/index.ts @@ -7,6 +7,7 @@ import { observable, type Subscriber } from '@ni/fast-element'; +import type { UnitFormat } from '@ni/unit-format'; import { styles } from '../base/styles'; import { template } from './template'; import { TableColumnAlignment, type TableNumberField } from '../../table/types'; @@ -16,8 +17,7 @@ import { tableColumnNumberTextGroupHeaderTag } from './group-header-view'; import { tableColumnNumberTextCellViewTag } from './cell-view'; import type { ColumnInternalsOptions } from '../base/models/column-internals'; import { NumberTextAlignment, NumberTextFormat } from './types'; -import type { UnitFormat } from '../../utilities/unit-format/unit-format'; -import { NumberTextUnitFormat } from './models/number-text-unit-format'; +import { UnitFormatNumberText } from './models/unit-format-number-text'; import { TableColumnNumberTextValidator } from './models/table-column-number-text-validator'; import { lang } from '../../theme-provider'; import { Unit } from '../../unit/base/unit'; @@ -184,7 +184,7 @@ export class TableColumnNumberText extends mixinTextBase( private createFormatter(): UnitFormat { const unitScale = this.unit?.resolvedUnitScale; - return new NumberTextUnitFormat(lang.getValueFor(this), { + return new UnitFormatNumberText(lang.getValueFor(this), { // Attribute values sometimes resolve to either null or undefined // See https://github.com/microsoft/fast/issues/6630 numberTextFormat: this.format ?? undefined, diff --git a/packages/nimble-components/src/table-column/number-text/models/tests/number-text-unit-format.spec.ts b/packages/nimble-components/src/table-column/number-text/models/tests/unit-format-number-text.spec.ts similarity index 89% rename from packages/nimble-components/src/table-column/number-text/models/tests/number-text-unit-format.spec.ts rename to packages/nimble-components/src/table-column/number-text/models/tests/unit-format-number-text.spec.ts index bdd73c946b..1ecf50ef1a 100644 --- a/packages/nimble-components/src/table-column/number-text/models/tests/number-text-unit-format.spec.ts +++ b/packages/nimble-components/src/table-column/number-text/models/tests/unit-format-number-text.spec.ts @@ -1,11 +1,11 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; +import { unitScaleByte } from '@ni/unit-format/unit-scale/byte'; +import { unitScaleByte1024 } from '@ni/unit-format/unit-scale/byte-1024'; +import { unitScalePassthrough } from '@ni/unit-format/unit-scale/passthrough'; import { NumberTextFormat } from '../../types'; -import { NumberTextUnitFormat } from '../number-text-unit-format'; -import { byteUnitScale } from '../../../../utilities/unit-format/unit-scale/byte-unit-scale'; -import { byte1024UnitScale } from '../../../../utilities/unit-format/unit-scale/byte-1024-unit-scale'; -import { passthroughUnitScale } from '../../../../utilities/unit-format/unit-scale/passthrough-unit-scale'; +import { UnitFormatNumberText } from '../unit-format-number-text'; -describe('NumberTextUnitFormat', () => { +describe('UnitFormatNumberText', () => { const testCases = [ { name: 'honors locale', @@ -63,7 +63,7 @@ describe('NumberTextUnitFormat', () => { format: NumberTextFormat.decimal, decimalDigits: undefined, decimalMaximumDigits: undefined, - unitScale: byteUnitScale, + unitScale: unitScaleByte, number: 0.0123456, expected: '0.01 bytes' }, @@ -73,14 +73,14 @@ describe('NumberTextUnitFormat', () => { format: NumberTextFormat.default, decimalDigits: undefined, decimalMaximumDigits: undefined, - unitScale: byteUnitScale, + unitScale: unitScaleByte, number: 0.0123456, expected: '0.01235 bytes' } ] as const; parameterizeSpec(testCases, (spec, name, value) => { spec(name, () => { - const formatter = new NumberTextUnitFormat(value.locale ?? 'en', { + const formatter = new UnitFormatNumberText(value.locale ?? 'en', { numberTextFormat: value.format, decimalDigits: value.decimalDigits, decimalMaximumDigits: value.decimalMaximumDigits, @@ -92,7 +92,7 @@ describe('NumberTextUnitFormat', () => { it('throws error when format=decimal and decimalDigits and decimalMaximumDigits both specified', () => { expect(() => { - void new NumberTextUnitFormat('en', { + void new UnitFormatNumberText('en', { numberTextFormat: NumberTextFormat.decimal, decimalDigits: 0, decimalMaximumDigits: 0 @@ -104,7 +104,7 @@ describe('NumberTextUnitFormat', () => { it('does not throw error when format=default and decimalDigits specified', () => { expect(() => { - void new NumberTextUnitFormat('en', { + void new UnitFormatNumberText('en', { numberTextFormat: NumberTextFormat.default, decimalDigits: 0 }); @@ -113,7 +113,7 @@ describe('NumberTextUnitFormat', () => { it('does not throw error when format=default and decimalMaximumDigits specified', () => { expect(() => { - void new NumberTextUnitFormat('en', { + void new UnitFormatNumberText('en', { numberTextFormat: NumberTextFormat.default, decimalMaximumDigits: 0 }); @@ -237,27 +237,27 @@ describe('NumberTextUnitFormat', () => { { name: 'with different unitScale values', options1: { - unitScale: byteUnitScale + unitScale: unitScaleByte }, options2: { - unitScale: byte1024UnitScale + unitScale: unitScaleByte1024 }, expected: false }, { name: 'with same unitScale values', options1: { - unitScale: byteUnitScale + unitScale: unitScaleByte }, options2: { - unitScale: byteUnitScale + unitScale: unitScaleByte }, expected: true }, { - name: 'defaults unitScale to passthroughUnitScale', + name: 'defaults unitScale to passthrough', options1: { - unitScale: passthroughUnitScale + unitScale: unitScalePassthrough }, options2: {}, expected: true @@ -277,7 +277,7 @@ describe('NumberTextUnitFormat', () => { ] as const; parameterizeSpec(optionsMatchTestCases, (spec, name, value) => { spec(name, () => { - const format = new NumberTextUnitFormat('en', value.options1); + const format = new UnitFormatNumberText('en', value.options1); expect(format.optionsMatch(value.options2)).toBe( value.expected ); diff --git a/packages/nimble-components/src/table-column/number-text/models/number-text-unit-format.ts b/packages/nimble-components/src/table-column/number-text/models/unit-format-number-text.ts similarity index 67% rename from packages/nimble-components/src/table-column/number-text/models/number-text-unit-format.ts rename to packages/nimble-components/src/table-column/number-text/models/unit-format-number-text.ts index e0774316d4..6ffa634e54 100644 --- a/packages/nimble-components/src/table-column/number-text/models/number-text-unit-format.ts +++ b/packages/nimble-components/src/table-column/number-text/models/unit-format-number-text.ts @@ -1,29 +1,29 @@ import { UnitFormat, type UnitFormatOptions -} from '../../../utilities/unit-format/unit-format'; -import { passthroughUnitScale } from '../../../utilities/unit-format/unit-scale/passthrough-unit-scale'; +} from '@ni/unit-format'; +import { unitScalePassthrough } from '@ni/unit-format/unit-scale/passthrough'; +import { UnitFormatDefault } from '@ni/unit-format/default'; +import { UnitFormatDecimal } from '@ni/unit-format/decimal'; import { NumberTextFormat } from '../types'; -import { DefaultUnitFormat } from '../../../utilities/unit-format/default-unit-format'; -import { DecimalUnitFormat } from '../../../utilities/unit-format/decimal-unit-format'; -export interface NumberTextUnitFormatOptions extends UnitFormatOptions { +export interface UnitFormatNumberTextOptions extends UnitFormatOptions { numberTextFormat?: NumberTextFormat; decimalDigits?: number; decimalMaximumDigits?: number; } -type ResolvedNumberTextUnitFormatOptions = NumberTextUnitFormatOptions +type UnitFormatNumberTextResolvedOptions = UnitFormatNumberTextOptions & Required; /** * Format for numbers (with optional units) in a number-text table column. */ -export class NumberTextUnitFormat extends UnitFormat { +export class UnitFormatNumberText extends UnitFormat { private static readonly defaultDecimalDigits = 2; - private readonly resolvedUnitFormat: DefaultUnitFormat | DecimalUnitFormat; - private readonly _resolvedOptions: ResolvedNumberTextUnitFormatOptions; + private readonly resolvedUnitFormat: UnitFormatDefault | UnitFormatDecimal; + private readonly _resolvedOptions: UnitFormatNumberTextResolvedOptions; - public constructor(locale: string, options?: NumberTextUnitFormatOptions) { + public constructor(locale: string, options?: UnitFormatNumberTextOptions) { super(); this._resolvedOptions = this.resolveOptions(options); this.resolvedUnitFormat = this.resolveUnitFormat( @@ -32,11 +32,11 @@ export class NumberTextUnitFormat extends UnitFormat { ); } - public override resolvedOptions(): ResolvedNumberTextUnitFormatOptions { + public override resolvedOptions(): UnitFormatNumberTextResolvedOptions { return { ...this._resolvedOptions }; } - public optionsMatch(targetOptions?: NumberTextUnitFormatOptions): boolean { + public optionsMatch(targetOptions?: UnitFormatNumberTextOptions): boolean { const targetResolvedOptions = this.resolveOptions(targetOptions); return ( this._resolvedOptions.decimalDigits @@ -55,8 +55,8 @@ export class NumberTextUnitFormat extends UnitFormat { private resolveUnitFormat( locale: string, - options: ResolvedNumberTextUnitFormatOptions - ): DefaultUnitFormat | DecimalUnitFormat { + options: UnitFormatNumberTextResolvedOptions + ): UnitFormatDefault | UnitFormatDecimal { const { numberTextFormat, decimalMaximumDigits, @@ -65,18 +65,18 @@ export class NumberTextUnitFormat extends UnitFormat { } = options; if (numberTextFormat === NumberTextFormat.default) { - return new DefaultUnitFormat(locale, { + return new UnitFormatDefault(locale, { unitScale }); } if (typeof decimalDigits === 'number') { - return new DecimalUnitFormat(locale, { + return new UnitFormatDecimal(locale, { minimumFractionDigits: decimalDigits, maximumFractionDigits: decimalDigits, unitScale }); } - return new DecimalUnitFormat(locale, { + return new UnitFormatDecimal(locale, { minimumFractionDigits: 0, maximumFractionDigits: decimalMaximumDigits, unitScale @@ -84,14 +84,14 @@ export class NumberTextUnitFormat extends UnitFormat { } private resolveOptions( - options?: NumberTextUnitFormatOptions - ): ResolvedNumberTextUnitFormatOptions { + options?: UnitFormatNumberTextOptions + ): UnitFormatNumberTextResolvedOptions { if (!options || options.numberTextFormat === NumberTextFormat.default) { return { numberTextFormat: NumberTextFormat.default, decimalDigits: undefined, decimalMaximumDigits: undefined, - unitScale: options?.unitScale ?? passthroughUnitScale + unitScale: options?.unitScale ?? unitScalePassthrough }; } const hasDecimalDigits = typeof options.decimalDigits === 'number'; @@ -104,16 +104,16 @@ export class NumberTextUnitFormat extends UnitFormat { if (!hasDecimalDigits && !hasDecimalMaximumDigits) { return { numberTextFormat: NumberTextFormat.decimal, - decimalDigits: NumberTextUnitFormat.defaultDecimalDigits, + decimalDigits: UnitFormatNumberText.defaultDecimalDigits, decimalMaximumDigits: undefined, - unitScale: options.unitScale ?? passthroughUnitScale + unitScale: options.unitScale ?? unitScalePassthrough }; } return { numberTextFormat: NumberTextFormat.decimal, decimalDigits: options.decimalDigits, decimalMaximumDigits: options.decimalMaximumDigits, - unitScale: options.unitScale ?? passthroughUnitScale + unitScale: options.unitScale ?? unitScalePassthrough }; } } diff --git a/packages/nimble-components/src/unit/base/unit.ts b/packages/nimble-components/src/unit/base/unit.ts index daa9c245bf..152c63282e 100644 --- a/packages/nimble-components/src/unit/base/unit.ts +++ b/packages/nimble-components/src/unit/base/unit.ts @@ -1,6 +1,6 @@ import { observable } from '@ni/fast-element'; import { FoundationElement } from '@ni/fast-foundation'; -import type { UnitScale } from '../../utilities/unit-format/unit-scale/unit-scale'; +import type { UnitScale } from '@ni/unit-format/unit-scale'; /** * The base class for an element that provides a unit scale for scaled unit conversions diff --git a/packages/nimble-components/src/unit/byte/index.ts b/packages/nimble-components/src/unit/byte/index.ts index 104aee3cf6..43738b2932 100644 --- a/packages/nimble-components/src/unit/byte/index.ts +++ b/packages/nimble-components/src/unit/byte/index.ts @@ -1,8 +1,8 @@ import { attr } from '@ni/fast-element'; import { DesignSystem } from '@ni/fast-foundation'; +import { unitScaleByte1024 } from '@ni/unit-format/unit-scale/byte-1024'; +import { unitScaleByte } from '@ni/unit-format/unit-scale/byte'; import { template } from '../base/template'; -import { byte1024UnitScale } from '../../utilities/unit-format/unit-scale/byte-1024-unit-scale'; -import { byteUnitScale } from '../../utilities/unit-format/unit-scale/byte-unit-scale'; import { Unit } from '../base/unit'; import { styles } from '../base/styles'; @@ -25,13 +25,13 @@ export class UnitByte extends Unit { public constructor() { super(); - this.resolvedUnitScale = byteUnitScale; + this.resolvedUnitScale = unitScaleByte; } private binaryChanged(): void { this.resolvedUnitScale = this.binary - ? byte1024UnitScale - : byteUnitScale; + ? unitScaleByte1024 + : unitScaleByte; } } diff --git a/packages/nimble-components/src/unit/byte/tests/unit-byte.spec.ts b/packages/nimble-components/src/unit/byte/tests/unit-byte.spec.ts index fd19f4f540..15de00b5fd 100644 --- a/packages/nimble-components/src/unit/byte/tests/unit-byte.spec.ts +++ b/packages/nimble-components/src/unit/byte/tests/unit-byte.spec.ts @@ -1,8 +1,8 @@ import { html } from '@ni/fast-element'; +import { unitScaleByte1024 } from '@ni/unit-format/unit-scale/byte-1024'; +import { unitScaleByte } from '@ni/unit-format/unit-scale/byte'; import { type Fixture, fixture } from '../../../utilities/tests/fixture'; import { UnitByte, unitByteTag } from '..'; -import { byte1024UnitScale } from '../../../utilities/unit-format/unit-scale/byte-1024-unit-scale'; -import { byteUnitScale } from '../../../utilities/unit-format/unit-scale/byte-unit-scale'; async function setup(binary: boolean): Promise> { return await fixture(html` @@ -19,17 +19,17 @@ describe('Byte unit', () => { expect(document.createElement(unitByteTag)).toBeInstanceOf(UnitByte); }); - it('returns Byte1024UnitScale when "binary" attribute is set', async () => { + it('returns unitScaleByte1024 when "binary" attribute is set', async () => { ({ element, connect, disconnect } = await setup(true)); await connect(); - expect(element.resolvedUnitScale).toBe(byte1024UnitScale); + expect(element.resolvedUnitScale).toBe(unitScaleByte1024); await disconnect(); }); it('returns ByteScale when "binary" attribute is unset', async () => { ({ element, connect, disconnect } = await setup(false)); await connect(); - expect(element.resolvedUnitScale).toBe(byteUnitScale); + expect(element.resolvedUnitScale).toBe(unitScaleByte); await disconnect(); }); }); diff --git a/packages/nimble-components/src/unit/celsius/index.ts b/packages/nimble-components/src/unit/celsius/index.ts index 3518e9a8af..d57c00e7c3 100644 --- a/packages/nimble-components/src/unit/celsius/index.ts +++ b/packages/nimble-components/src/unit/celsius/index.ts @@ -1,7 +1,7 @@ import { DesignSystem } from '@ni/fast-foundation'; +import { unitScaleCelsius } from '@ni/unit-format/unit-scale/celsius'; import { template } from '../base/template'; import { Unit } from '../base/unit'; -import { celsiusUnitScale } from '../../utilities/unit-format/unit-scale/celsius-unit-scale'; import { styles } from '../base/styles'; declare global { @@ -16,7 +16,7 @@ declare global { export class UnitCelsius extends Unit { public constructor() { super(); - this.resolvedUnitScale = celsiusUnitScale; + this.resolvedUnitScale = unitScaleCelsius; } } diff --git a/packages/nimble-components/src/unit/celsius/tests/unit-celsius.spec.ts b/packages/nimble-components/src/unit/celsius/tests/unit-celsius.spec.ts index 8041486134..80ca3e014b 100644 --- a/packages/nimble-components/src/unit/celsius/tests/unit-celsius.spec.ts +++ b/packages/nimble-components/src/unit/celsius/tests/unit-celsius.spec.ts @@ -1,5 +1,5 @@ +import { unitScaleCelsius } from '@ni/unit-format/unit-scale/celsius'; import { UnitCelsius, unitCelsiusTag } from '..'; -import { celsiusUnitScale } from '../../../utilities/unit-format/unit-scale/celsius-unit-scale'; describe('Celsius unit', () => { it('can construct an element instance', () => { @@ -10,6 +10,6 @@ describe('Celsius unit', () => { it('returns expected formatter', () => { const element = document.createElement(unitCelsiusTag); - expect(element.resolvedUnitScale).toBe(celsiusUnitScale); + expect(element.resolvedUnitScale).toBe(unitScaleCelsius); }); }); diff --git a/packages/nimble-components/src/unit/fahrenheit/index.ts b/packages/nimble-components/src/unit/fahrenheit/index.ts index b422d3acb9..8427952e46 100644 --- a/packages/nimble-components/src/unit/fahrenheit/index.ts +++ b/packages/nimble-components/src/unit/fahrenheit/index.ts @@ -1,7 +1,7 @@ import { DesignSystem } from '@ni/fast-foundation'; +import { unitScaleFahrenheit } from '@ni/unit-format/unit-scale/fahrenheit'; import { template } from '../base/template'; import { Unit } from '../base/unit'; -import { fahrenheitUnitScale } from '../../utilities/unit-format/unit-scale/fahrenheit-unit-scale'; import { styles } from '../base/styles'; declare global { @@ -16,7 +16,7 @@ declare global { export class UnitFahrenheit extends Unit { public constructor() { super(); - this.resolvedUnitScale = fahrenheitUnitScale; + this.resolvedUnitScale = unitScaleFahrenheit; } } diff --git a/packages/nimble-components/src/unit/fahrenheit/tests/unit-fahrenheit.spec.ts b/packages/nimble-components/src/unit/fahrenheit/tests/unit-fahrenheit.spec.ts index 51267151b1..7194b3f643 100644 --- a/packages/nimble-components/src/unit/fahrenheit/tests/unit-fahrenheit.spec.ts +++ b/packages/nimble-components/src/unit/fahrenheit/tests/unit-fahrenheit.spec.ts @@ -1,5 +1,5 @@ +import { unitScaleFahrenheit } from '@ni/unit-format/unit-scale/fahrenheit'; import { UnitFahrenheit, unitFahrenheitTag } from '..'; -import { fahrenheitUnitScale } from '../../../utilities/unit-format/unit-scale/fahrenheit-unit-scale'; describe('Fahrenheit unit', () => { it('can construct an element instance', () => { @@ -10,6 +10,6 @@ describe('Fahrenheit unit', () => { it('returns expected formatter', () => { const element = document.createElement(unitFahrenheitTag); - expect(element.resolvedUnitScale).toBe(fahrenheitUnitScale); + expect(element.resolvedUnitScale).toBe(unitScaleFahrenheit); }); }); diff --git a/packages/nimble-components/src/unit/volt/index.ts b/packages/nimble-components/src/unit/volt/index.ts index eb70b6a2cd..19faee1c06 100644 --- a/packages/nimble-components/src/unit/volt/index.ts +++ b/packages/nimble-components/src/unit/volt/index.ts @@ -1,7 +1,7 @@ import { DesignSystem } from '@ni/fast-foundation'; +import { unitScaleVolt } from '@ni/unit-format/unit-scale/volt'; import { template } from '../base/template'; import { Unit } from '../base/unit'; -import { voltUnitScale } from '../../utilities/unit-format/unit-scale/volt-unit-scale'; import { styles } from '../base/styles'; declare global { @@ -16,7 +16,7 @@ declare global { export class UnitVolt extends Unit { public constructor() { super(); - this.resolvedUnitScale = voltUnitScale; + this.resolvedUnitScale = unitScaleVolt; } } diff --git a/packages/nimble-components/src/unit/volt/tests/unit-volt.spec.ts b/packages/nimble-components/src/unit/volt/tests/unit-volt.spec.ts index cedff5b800..e54ca2a345 100644 --- a/packages/nimble-components/src/unit/volt/tests/unit-volt.spec.ts +++ b/packages/nimble-components/src/unit/volt/tests/unit-volt.spec.ts @@ -1,5 +1,5 @@ +import { unitScaleVolt } from '@ni/unit-format/unit-scale/volt'; import { UnitVolt, unitVoltTag } from '..'; -import { voltUnitScale } from '../../../utilities/unit-format/unit-scale/volt-unit-scale'; describe('Volt unit', () => { it('can construct an element instance', () => { @@ -8,6 +8,6 @@ describe('Volt unit', () => { it('returns expected formatter', () => { const element = document.createElement(unitVoltTag); - expect(element.resolvedUnitScale).toBe(voltUnitScale); + expect(element.resolvedUnitScale).toBe(unitScaleVolt); }); }); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/celsius-unit-scale.ts b/packages/nimble-components/src/utilities/unit-format/unit-scale/celsius-unit-scale.ts deleted file mode 100644 index f700efbf9d..0000000000 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/celsius-unit-scale.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { IntlNumberFormatScaledUnitFormat } from '../scaled-unit-format/intl-number-format-scaled-unit-format'; -import { UnitScale } from './unit-scale'; - -const celsiusUnitScaleOptions = [[1, 'celsius', 'short']] as const; - -/** - * Degrees Celsius units - */ -class CelsiusUnitScale extends UnitScale { - public constructor() { - super( - celsiusUnitScaleOptions.map( - ([scaleFactor, unit, unitDisplay]) => new ScaledUnit( - scaleFactor, - IntlNumberFormatScaledUnitFormat.createFactory({ - style: 'unit', - unit, - unitDisplay - }) - ) - ) - ); - } -} - -export const celsiusUnitScale = new CelsiusUnitScale(); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/fahrenheit-unit-scale.ts b/packages/nimble-components/src/utilities/unit-format/unit-scale/fahrenheit-unit-scale.ts deleted file mode 100644 index 5cc909d0be..0000000000 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/fahrenheit-unit-scale.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { IntlNumberFormatScaledUnitFormat } from '../scaled-unit-format/intl-number-format-scaled-unit-format'; -import { UnitScale } from './unit-scale'; - -const fahrenheitUnitScaleOptions = [[1, 'fahrenheit', 'short']] as const; - -/** - * Degrees Fahrenheit units - */ -class FahrenheitUnitScale extends UnitScale { - public constructor() { - super( - fahrenheitUnitScaleOptions.map( - ([scaleFactor, unit, unitDisplay]) => new ScaledUnit( - scaleFactor, - IntlNumberFormatScaledUnitFormat.createFactory({ - style: 'unit', - unit, - unitDisplay - }) - ) - ) - ); - } -} - -export const fahrenheitUnitScale = new FahrenheitUnitScale(); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/passthrough-unit-scale.ts b/packages/nimble-components/src/utilities/unit-format/unit-scale/passthrough-unit-scale.ts deleted file mode 100644 index 085a1104ff..0000000000 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/passthrough-unit-scale.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { IntlNumberFormatScaledUnitFormat } from '../scaled-unit-format/intl-number-format-scaled-unit-format'; -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from './unit-scale'; - -/** - * Unit scale that is used to passthrough a number without applying scaling or units - */ -class PassthroughUnitScale extends UnitScale { - public constructor() { - super([ - new ScaledUnit( - 10 ** 0, - IntlNumberFormatScaledUnitFormat.createFactory({}) - ) - ]); - } -} - -export const passthroughUnitScale = new PassthroughUnitScale(); diff --git a/packages/storybook/src/nimble/table-column/number-text/table-column-number-text.mdx b/packages/storybook/src/nimble/table-column/number-text/table-column-number-text.mdx index 083d7eb996..427b8f232a 100644 --- a/packages/storybook/src/nimble/table-column/number-text/table-column-number-text.mdx +++ b/packages/storybook/src/nimble/table-column/number-text/table-column-number-text.mdx @@ -72,8 +72,8 @@ To use it: omitted. `decimalDigits` and `decimalMaximumDigits` cannot both be set at the same time. The value must be in the range 0 - 20 (inclusive). - `unitScale` - A `UnitScale` object indicating units to display. Possible - values are `byteUnitScale`, `byte1024UnitScale`, `celsiusUnitScale`, - `fahrenheitUnitScale`, and `voltUnitScale` which are exported from + values are `unitScaleByte`, `unitScaleByte1024`, `unitScaleCelsius`, + `unitScaleFahrenheit`, and `unitScaleVolt` which are exported from `@ni/nimble-angular/pipes`. {/* ## Examples */} diff --git a/packages/unit-format/.npmignore b/packages/unit-format/.npmignore new file mode 100644 index 0000000000..8529ba2a33 --- /dev/null +++ b/packages/unit-format/.npmignore @@ -0,0 +1,4 @@ +* +!/dist/*.* +!/dist/esm/** +/dist/esm/**/tests diff --git a/packages/unit-format/CONTRIBUTING.md b/packages/unit-format/CONTRIBUTING.md new file mode 100644 index 0000000000..5b5e739182 --- /dev/null +++ b/packages/unit-format/CONTRIBUTING.md @@ -0,0 +1,39 @@ +# Contributing + +## Getting Started + +Make sure you have the following prerequisites installed: +- [`node.js` LTS release](https://nodejs.org/en/download/) + +### Workflows + +All workflows are executed from the repo root: + +- Installing dependencies: + ``` + npm install + ``` + +- Building: + ``` + npm run build -w @ni/unit-format + ``` + +- Linting: + ``` + npm run lint -w @ni/unit-format + ``` + +- Formatting: + ``` + npm run format -w @ni/unit-format + ``` + +- Packing the package: + ``` + npm run pack -w @ni/unit-format + ``` + +### Running tests + +To build and run tests locally, run `npm run tdd -w @ni/unit-format`. To run tests without rebuilding, `npm run test -w @ni/unit-format`. diff --git a/packages/nimble-components/src/utilities/unit-format/README.md b/packages/unit-format/README.md similarity index 76% rename from packages/nimble-components/src/utilities/unit-format/README.md rename to packages/unit-format/README.md index feffce2156..b3f68cc09d 100644 --- a/packages/nimble-components/src/utilities/unit-format/README.md +++ b/packages/unit-format/README.md @@ -1,8 +1,12 @@ -# UnitFormat +
+

ni | unit format

+
-## Overvew +# Unit Format -The `UnitFormat` library provides a way to format numbers with units. The library: +[![NPM Version](https://img.shields.io/npm/v/@ni/unit-format.svg)](https://www.npmjs.com/package/@ni/unit-format) + +The `@ni/unit-format` library provides a way to format numbers with units. The library: - Provides opinionated number formatters that are well-suited for: - numbers that can appear in large ranges (very small or very large). @@ -12,13 +16,13 @@ The `UnitFormat` library provides a way to format numbers with units. The librar The library is intended to align well with the [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) API to make it relatively straightforward to swap in. -## Usage +## Getting Started Choose a `UnitFormat` and create an instance with an optional `UnitScale` reference: ```ts -const formatter = new DefaultUnitFormat('en', { - unitScale: byteUnitScale +const formatter = new UnitFormatDefault('en', { + unitScale: unitScaleByte }); console.log(formatter.format(1000)); // Output: '1 kB' @@ -30,7 +34,7 @@ console.log(formatter.format(1000)); There are multiple `UnitFormat`s that represent different configurations for formatting numbers. These represent wrappers around `Intl.NumberFormat` with opinionated configurations. -For example, the `DefaultUnitFormat` will represent "very large" and "very small" numbers with an exponential notation and numbers between those ranges as decimal. The different `UnitFormat`s take an optional `unitScale` that provides units and automatic conversions of numbers for that unit scale. +For example, the `UnitFormatDefault` will represent "very large" and "very small" numbers with an exponential notation and numbers between those ranges as decimal. The different `UnitFormat`s take an optional `unitScale` that provides units and automatic conversions of numbers for that unit scale. ### UnitScale @@ -47,18 +51,22 @@ A `ScaledUnitFormat` is an object for formatting a particular `ScaledUnit` on th There are two main types of `ScaledUnitFormat`s: -- `IntlNumberFormatScaledUnitFormat` which are scaled units can be translated by [`Intl.NumberFormat`](https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers). -- `ManuallyTranslatedScaledUnitFormat` which are scaled units manually translated for a set of supported languages via `UnitTranslation` string collections. +- `ScaledUnitFormatIntlNumberFormat` which are scaled units can be translated by [`Intl.NumberFormat`](https://tc39.es/ecma402/#table-sanctioned-single-unit-identifiers). +- `ScaledUnitFormatManuallyTranslated` which are scaled units manually translated for a set of supported languages via `UnitTranslation` string collections. The different `ScaledUnitFormat` objects have a static function to assist with their factory creation, for example: ```ts new ScaledUnit( 10 ** 3, - IntlNumberFormatScaledUnitFormat.createFactory({ + ScaledUnitFormatIntlNumberFormat.createFactory({ style: 'unit', unit: 'kilobyte', unitDisplay: 'short' }) ), ``` + +## Contributing + +See `Getting Started` in [`CONTRIBUTING.md`](/packages/unit-format/CONTRIBUTING.md#getting-started). diff --git a/packages/unit-format/eslint.config.mjs b/packages/unit-format/eslint.config.mjs new file mode 100644 index 0000000000..b2f0ca90ba --- /dev/null +++ b/packages/unit-format/eslint.config.mjs @@ -0,0 +1,23 @@ +import { defineConfig, globalIgnores } from 'eslint/config'; +import { lintNimbleConfig, javascriptNimbleConfig, typescriptNimbleConfig } from '@ni-private/eslint-config-nimble'; + +export default defineConfig([ + globalIgnores(['**/dist/']), + lintNimbleConfig, + { + files: ['*.js', '*.cjs'], + extends: javascriptNimbleConfig, + rules: { + // Configuration scripts will not be in published package and are allowed to use devDependencies + 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], + }, + }, + { + files: ['*.ts'], + extends: typescriptNimbleConfig, + parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: import.meta.dirname, + }, + }, +]); diff --git a/packages/unit-format/karma.conf.cjs b/packages/unit-format/karma.conf.cjs new file mode 100644 index 0000000000..0021e0499f --- /dev/null +++ b/packages/unit-format/karma.conf.cjs @@ -0,0 +1,103 @@ +const playwright = require('playwright'); + +process.env.CHROME_BIN = playwright.chromium.executablePath(); + +const path = require('path'); +const karmaVite = require('karma-vite'); +const karmaJasmine = require('karma-jasmine'); +const karmaJasmineHtmlReporter = require('karma-jasmine-html-reporter'); +const karmaChromeLauncher = require('karma-chrome-launcher'); + +const basePath = path.resolve(__dirname); +const commonChromeFlags = [ + '--no-default-browser-check', + '--no-first-run', + '--no-sandbox', + '--no-managed-user-acknowledgment-check', + '--disable-background-timer-throttling', + '--disable-backing-store-limit', + '--disable-boot-animation', + '--disable-cloud-import', + '--disable-contextual-search', + '--disable-default-apps', + '--disable-extensions', + '--disable-infobars', + '--disable-translate', + '--force-prefers-reduced-motion', + '--lang=en-US', + '--time-zone-for-testing=America/Chicago' +]; + +module.exports = config => { + const options = { + basePath, + browserDisconnectTimeout: 10000, + processKillTimeout: 10000, + frameworks: [ + 'vite', + 'jasmine', + ], + plugins: [ + karmaVite, + karmaJasmine, + karmaJasmineHtmlReporter, + karmaChromeLauncher + ], + files: [ + { + pattern: 'src/**/*.spec.ts', + type: 'module', + watched: false, + served: false + }, + ], + mime: { + 'text/x-typescript': ['ts'] + }, + reporters: ['kjhtml'], + browsers: ['ChromeHeadlessOpt'], + customLaunchers: { + ChromeDebugging: { + base: 'Chrome', + flags: [...commonChromeFlags, '--remote-debugging-port=9333'], + debug: true + }, + ChromeHeadlessOpt: { + base: 'ChromeHeadless', + flags: [...commonChromeFlags] + } + }, + client: { + jasmine: { + stopSpecOnExpectationFailure: false + }, + captureConsole: true + }, + // to disable the WARN 404 for image requests + logLevel: config.LOG_ERROR, + customHeaders: [ + // Test under the OWASP Basic non-strict CSP Policy + // See: https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html#basic-non-strict-csp-policy + // Need script-src 'unsafe-inline' to support karma behavior + // See https://github.com/karma-runner/karma/issues/3260 + { + match: '\\.html', + name: 'Content-Security-Policy', + value: "default-src 'self'; frame-ancestors 'self'; form-action 'self'; object-src 'none'; script-src 'self' 'unsafe-inline';" + } + ], + vite: { + autoInit: true, + config: { + clearScreen: false, + resolve: { + alias: { + '/base': '', + } + } + } + } + }; + + config.set(options); +}; diff --git a/packages/unit-format/package.json b/packages/unit-format/package.json new file mode 100644 index 0000000000..e47463c825 --- /dev/null +++ b/packages/unit-format/package.json @@ -0,0 +1,64 @@ +{ + "name": "@ni/unit-format", + "version": "0.0.1", + "description": "Utilities to write parameterized jasmine tests", + "keywords": [ + + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "format": "eslint . --fix", + "pack": "npm pack", + "invoke-publish": "npm publish", + "tdd": "npm run build && npm run test", + "test": "npm run test:node && npm run test:browser", + "test:node": "jasmine", + "test:browser": "karma start karma.conf.cjs --browsers=ChromeHeadlessOpt --single-run", + "test:browser:debugger": "karma start karma.conf.cjs --browsers=ChromeDebugging" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ni/nimble.git" + }, + "publishConfig": { + "access": "public" + }, + "type": "module", + "exports": { + "./package.json": "./package.json", + ".": { + "types": "./dist/esm/index.d.ts", + "import": "./dist/esm/index.js" + }, + "./*": { + "types": "./dist/esm/*.d.ts", + "import": "./dist/esm/*/index.js" + } + }, + "typesVersions": { + "*": { + "*": [ + "dist/esm/*", + "dist/esm/*/index.d.ts" + ] + } + }, + "author": "National Instruments", + "license": "MIT", + "devDependencies": { + "@ni/jasmine-parameterized": "^1.0.6", + "@ni-private/eslint-config-nimble": "*", + "@types/jasmine": "^5.1.4", + "jasmine": "^5.1.0", + "jasmine-core": "^5.1.2", + "karma": "^6.3.0", + "karma-chrome-launcher": "^3.1.0", + "karma-jasmine": "^5.1.0", + "karma-jasmine-html-reporter": "^2.0.0", + "karma-spec-reporter": "^0.0.36", + "karma-vite": "^1.0.5", + "playwright": "1.54.1", + "typescript": "~5.4.5" + } +} diff --git a/packages/unit-format/spec/support/jasmine.json b/packages/unit-format/spec/support/jasmine.json new file mode 100644 index 0000000000..4692f41030 --- /dev/null +++ b/packages/unit-format/spec/support/jasmine.json @@ -0,0 +1,10 @@ +{ + "spec_dir": ".", + "spec_files": [ + "dist/esm/**/*.spec.js" + ], + "env": { + "stopSpecOnExpectationFailure": false, + "random": true + } +} diff --git a/packages/nimble-components/src/utilities/unit-format/decimal-unit-format.ts b/packages/unit-format/src/decimal/index.ts similarity index 75% rename from packages/nimble-components/src/utilities/unit-format/decimal-unit-format.ts rename to packages/unit-format/src/decimal/index.ts index b47e8573e7..b3c3337f2b 100644 --- a/packages/nimble-components/src/utilities/unit-format/decimal-unit-format.ts +++ b/packages/unit-format/src/decimal/index.ts @@ -1,18 +1,18 @@ -import { UnitFormat, type UnitFormatOptions } from './unit-format'; -import type { ScaledUnitFormat } from './scaled-unit-format/scaled-unit-format'; -import type { UnitScale } from './unit-scale/unit-scale'; -import { passthroughUnitScale } from './unit-scale/passthrough-unit-scale'; +import { UnitFormat, type UnitFormatOptions } from '../index.js'; +import type { ScaledUnitFormat } from '../scaled-unit-format/index.js'; +import type { UnitScale } from '../unit-scale/index.js'; +import { unitScalePassthrough } from '../unit-scale/passthrough/index.js'; -interface DecimalUnitFormatOptions extends UnitFormatOptions { +interface UnitFormatDecimalOptions extends UnitFormatOptions { minimumFractionDigits?: number; maximumFractionDigits?: number; } -type ResolvedDecimalUnitFormatOptions = Required; +type UnitFormatDecimalResolvedOptions = Required; /** * Format for decimal numbers with units. */ -export class DecimalUnitFormat extends UnitFormat { +export class UnitFormatDecimal extends UnitFormat { private readonly unitScale: UnitScale; private readonly minimumFractionDigits: number; private readonly maximumFractionDigits: number; @@ -24,11 +24,11 @@ export class DecimalUnitFormat extends UnitFormat { { minimumFractionDigits = 0, maximumFractionDigits = Math.max(3, minimumFractionDigits), - unitScale = passthroughUnitScale - }: DecimalUnitFormatOptions = { + unitScale = unitScalePassthrough + }: UnitFormatDecimalOptions = { minimumFractionDigits: 0, maximumFractionDigits: 3, - unitScale: passthroughUnitScale + unitScale: unitScalePassthrough } ) { super(); @@ -55,7 +55,7 @@ export class DecimalUnitFormat extends UnitFormat { this.maximumFractionDigits = maximumFractionDigits; } - public override resolvedOptions(): ResolvedDecimalUnitFormatOptions { + public override resolvedOptions(): UnitFormatDecimalResolvedOptions { return { unitScale: this.unitScale, maximumFractionDigits: this.maximumFractionDigits, diff --git a/packages/nimble-components/src/utilities/unit-format/default-unit-format.ts b/packages/unit-format/src/default/index.ts similarity index 77% rename from packages/nimble-components/src/utilities/unit-format/default-unit-format.ts rename to packages/unit-format/src/default/index.ts index d2c1022dbb..42c6b8d129 100644 --- a/packages/nimble-components/src/utilities/unit-format/default-unit-format.ts +++ b/packages/unit-format/src/default/index.ts @@ -1,7 +1,7 @@ -import { UnitFormat, type UnitFormatOptions } from './unit-format'; -import type { ScaledUnitFormat } from './scaled-unit-format/scaled-unit-format'; -import type { UnitScale } from './unit-scale/unit-scale'; -import { passthroughUnitScale } from './unit-scale/passthrough-unit-scale'; +import { UnitFormat, type UnitFormatOptions } from '../index.js'; +import type { ScaledUnitFormat } from '../scaled-unit-format/index.js'; +import type { UnitScale } from '../unit-scale/index.js'; +import { unitScalePassthrough } from '../unit-scale/passthrough/index.js'; // Workaround to avoid ts errors about signDisplay not accepting the value 'negative'. // It has been supported by browsers since 8/23, but TypeScript still hasn't @@ -10,14 +10,14 @@ const signDisplay = 'negative' as Intl.NumberFormatOptions['signDisplay']; // Allow consistent pattern for defining Options and ResolvedOptions // eslint-disable-next-line @typescript-eslint/no-empty-object-type -interface DefaultUnitFormatOptions extends UnitFormatOptions {} -type ResolvedDefaultUnitFormatOptions = Required; +interface UnitFormatDefaultOptions extends UnitFormatOptions {} +type UnitFormatDefaultResolvedOptions = Required; /** * Format for numbers with units to show in a tabular form. * Large and tiny numbers are shown exponentially and the rest as decimal. */ -export class DefaultUnitFormat extends UnitFormat { +export class UnitFormatDefault extends UnitFormat { // The maximum number of digits that should be rendered for any given value. private static readonly maximumDigits = 6; @@ -33,8 +33,8 @@ export class DefaultUnitFormat extends UnitFormat { private readonly unitScale: UnitScale; // Format options to use by default. It renders the number with a maximum of 6 signficant digits (including zero before decimal point). private readonly defaultIntlNumberFormatOptions: Intl.NumberFormatOptions = { - maximumSignificantDigits: DefaultUnitFormat.maximumDigits, - maximumFractionDigits: DefaultUnitFormat.maximumDigits - 1, + maximumSignificantDigits: UnitFormatDefault.maximumDigits, + maximumFractionDigits: UnitFormatDefault.maximumDigits - 1, roundingPriority: 'lessPrecision', signDisplay }; @@ -47,7 +47,7 @@ export class DefaultUnitFormat extends UnitFormat { // Format options for numbers that should be displayed in exponential notation. This should be used // for numbers with magintudes over 'exponentialUpperBound' or under 'exponentialLowerBound'. private readonly exponentialIntlNumberFormatOptions: Intl.NumberFormatOptions = { - maximumSignificantDigits: DefaultUnitFormat.maximumDigits, + maximumSignificantDigits: UnitFormatDefault.maximumDigits, notation: 'scientific', signDisplay }; @@ -56,8 +56,8 @@ export class DefaultUnitFormat extends UnitFormat { public constructor( locale: string, - { unitScale = passthroughUnitScale }: DefaultUnitFormatOptions = { - unitScale: passthroughUnitScale + { unitScale = unitScalePassthrough }: UnitFormatDefaultOptions = { + unitScale: unitScalePassthrough } ) { super(); @@ -77,7 +77,7 @@ export class DefaultUnitFormat extends UnitFormat { this.unitScale = unitScale; } - public override resolvedOptions(): ResolvedDefaultUnitFormatOptions { + public override resolvedOptions(): UnitFormatDefaultResolvedOptions { return { unitScale: this.unitScale }; @@ -88,8 +88,8 @@ export class DefaultUnitFormat extends UnitFormat { const absoluteValue = Math.abs(scaledValue); const useExponential = absoluteValue !== 0 - && (absoluteValue >= DefaultUnitFormat.exponentialUpperBound - || absoluteValue < DefaultUnitFormat.exponentialLowerBound); + && (absoluteValue >= UnitFormatDefault.exponentialUpperBound + || absoluteValue < UnitFormatDefault.exponentialLowerBound); return useExponential ? this.exponentialScaledUnitFormatter.format(number) : this.defaultScaledUnitFormatters diff --git a/packages/unit-format/src/global-type-extensions.d.ts b/packages/unit-format/src/global-type-extensions.d.ts new file mode 100644 index 0000000000..4982fff833 --- /dev/null +++ b/packages/unit-format/src/global-type-extensions.d.ts @@ -0,0 +1,20 @@ +// Note: This file should be kept in sync with other copies of global-type-extensions.d.ts in the monorepo + +// This file has modifications to global types used for nimble-components builds: +// - The types file should not be in the build output +// - You should not see a file with these types created in the dist build +// - Type additions added to this file should not appear in any public API definitions +// - The fields added to global types should not be observable in any built .d.ts file by TypeScript. To verify you can do a text search of generated .d.ts files in the dist folder for the fields being added and verify they are not associated with the augmented types. +// - This file should only impact the nimble-components library build and not users of nimble-components. Any type changes that impact clients should not be placed here. + +declare namespace Intl { + // roundingPriority has been supported by browsers since 8/23, but TypeScript still hasn't + // added it to the type definition. See https://github.com/microsoft/TypeScript/issues/56269 + interface NumberFormatOptions { + roundingPriority?: + | 'auto' + | 'morePrecision' + | 'lessPrecision' + | undefined; + } +} diff --git a/packages/nimble-components/src/utilities/unit-format/unit-format.ts b/packages/unit-format/src/index.ts similarity index 92% rename from packages/nimble-components/src/utilities/unit-format/unit-format.ts rename to packages/unit-format/src/index.ts index c8e60ef481..2a7a50df2f 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-format.ts +++ b/packages/unit-format/src/index.ts @@ -1,4 +1,4 @@ -import type { UnitScale } from './unit-scale/unit-scale'; +import type { UnitScale } from './unit-scale/index.js'; export interface UnitFormatOptions { unitScale?: UnitScale; diff --git a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/scaled-unit-format.ts b/packages/unit-format/src/scaled-unit-format/index.ts similarity index 97% rename from packages/nimble-components/src/utilities/unit-format/scaled-unit-format/scaled-unit-format.ts rename to packages/unit-format/src/scaled-unit-format/index.ts index b97cf47e16..8390f988c6 100644 --- a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/scaled-unit-format.ts +++ b/packages/unit-format/src/scaled-unit-format/index.ts @@ -1,4 +1,4 @@ -import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/scaled-unit'; +import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/index.js'; /** * A class that knows how to format a numeric value as a string that includes units. diff --git a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/intl-number-format-scaled-unit-format.ts b/packages/unit-format/src/scaled-unit-format/intl-number-format/index.ts similarity index 78% rename from packages/nimble-components/src/utilities/unit-format/scaled-unit-format/intl-number-format-scaled-unit-format.ts rename to packages/unit-format/src/scaled-unit-format/intl-number-format/index.ts index 73ef8d13e6..a67972fbf1 100644 --- a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/intl-number-format-scaled-unit-format.ts +++ b/packages/unit-format/src/scaled-unit-format/intl-number-format/index.ts @@ -1,10 +1,10 @@ -import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/scaled-unit'; -import { ScaledUnitFormat } from './scaled-unit-format'; +import type { ScaledUnitFormatFactoryOptions } from '../../scaled-unit/index.js'; +import { ScaledUnitFormat } from '../index.js'; /** * A formatter for units that can be formatted/translated by Intl.NumberFormat */ -export class IntlNumberFormatScaledUnitFormat extends ScaledUnitFormat { +export class ScaledUnitFormatIntlNumberFormat extends ScaledUnitFormat { private readonly formatter: Intl.NumberFormat; protected constructor( @@ -24,7 +24,7 @@ export class IntlNumberFormatScaledUnitFormat extends ScaledUnitFormat { ) { return ( scaledUnitFormatFactoryOptions: ScaledUnitFormatFactoryOptions - ): IntlNumberFormatScaledUnitFormat => new IntlNumberFormatScaledUnitFormat( + ): ScaledUnitFormatIntlNumberFormat => new ScaledUnitFormatIntlNumberFormat( scaledUnitFormatFactoryOptions, unitSpecificIntlNumberFormatOptions ); diff --git a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/manually-translated-scaled-unit-format.ts b/packages/unit-format/src/scaled-unit-format/manually-translated/index.ts similarity index 88% rename from packages/nimble-components/src/utilities/unit-format/scaled-unit-format/manually-translated-scaled-unit-format.ts rename to packages/unit-format/src/scaled-unit-format/manually-translated/index.ts index cd9f26ee91..40e9821d5c 100644 --- a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/manually-translated-scaled-unit-format.ts +++ b/packages/unit-format/src/scaled-unit-format/manually-translated/index.ts @@ -1,6 +1,6 @@ /* eslint-disable max-classes-per-file */ -import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/scaled-unit'; -import { ScaledUnitFormat } from './scaled-unit-format'; +import type { ScaledUnitFormatFactoryOptions } from '../../scaled-unit/index.js'; +import { ScaledUnitFormat } from '../index.js'; /** * Representations of a unit in a particular language @@ -16,7 +16,7 @@ export class UnitTranslation { * A map of locales of string format "[lang]" or "[lang]-[region]", for example "en" and / or "en-us", to UnitTranslation objects */ export type UnitTranslations = ReadonlyMap; -export interface ManuallyTranslatedScaledUnitFormatOptions { +export interface ScaledUnitFormatManuallyTranslatedOptions { /** * Translations for the unit by locale string. * The locale strings must be of the form [lang] or [lang]-[region], for example "en" and / or "en-us". @@ -35,7 +35,7 @@ export interface ManuallyTranslatedScaledUnitFormatOptions { /** * A formatter for units that are not supported by Intl.NumberFormat */ -export class ManuallyTranslatedScaledUnitFormat extends ScaledUnitFormat { +export class ScaledUnitFormatManuallyTranslated extends ScaledUnitFormat { private readonly pluralRules: Intl.PluralRules; private readonly formatter: Intl.NumberFormat; private readonly unitTranslation: UnitTranslation; @@ -46,7 +46,7 @@ export class ManuallyTranslatedScaledUnitFormat extends ScaledUnitFormat { { unitTranslations, scaledPrefixText - }: ManuallyTranslatedScaledUnitFormatOptions + }: ScaledUnitFormatManuallyTranslatedOptions ) { super(scaledUnitFormatFactoryOptions); if (!unitTranslations.get('en')) { @@ -67,13 +67,13 @@ export class ManuallyTranslatedScaledUnitFormat extends ScaledUnitFormat { } public static createFactory( - manuallyTranslatedScaledUnitFormatOptions: ManuallyTranslatedScaledUnitFormatOptions + scaledUnitFormatManuallyTranslatedOptions: ScaledUnitFormatManuallyTranslatedOptions ) { return ( scaledUnitFormatFactoryOptions: ScaledUnitFormatFactoryOptions - ): ManuallyTranslatedScaledUnitFormat => new ManuallyTranslatedScaledUnitFormat( + ): ScaledUnitFormatManuallyTranslated => new ScaledUnitFormatManuallyTranslated( scaledUnitFormatFactoryOptions, - manuallyTranslatedScaledUnitFormatOptions + scaledUnitFormatManuallyTranslatedOptions ); } diff --git a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/tests/manually-translated-scaled-unit-format.spec.ts b/packages/unit-format/src/scaled-unit-format/tests/scaled-unit-format-manually-translated.spec.ts similarity index 89% rename from packages/nimble-components/src/utilities/unit-format/scaled-unit-format/tests/manually-translated-scaled-unit-format.spec.ts rename to packages/unit-format/src/scaled-unit-format/tests/scaled-unit-format-manually-translated.spec.ts index eb10b9d565..aaa21059fc 100644 --- a/packages/nimble-components/src/utilities/unit-format/scaled-unit-format/tests/manually-translated-scaled-unit-format.spec.ts +++ b/packages/unit-format/src/scaled-unit-format/tests/scaled-unit-format-manually-translated.spec.ts @@ -1,10 +1,10 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; import { - ManuallyTranslatedScaledUnitFormat, + ScaledUnitFormatManuallyTranslated, UnitTranslation -} from '../manually-translated-scaled-unit-format'; +} from '../manually-translated/index.js'; -describe('ManuallyTranslatedScaledUnitFormat', () => { +describe('ScaledUnitFormatManuallyTranslated', () => { const unitTranslations = new Map([ ['en', new UnitTranslation('en-singular', 'en-plural', 'en-abbrev')], ['fr', new UnitTranslation('fr-singular', 'fr-plural', 'fr-abbrev')], @@ -50,7 +50,7 @@ describe('ManuallyTranslatedScaledUnitFormat', () => { parameterizeSpec(translationTestCases, (spec, name, value) => { spec(name, () => { - const scaledUnitFormatter = ManuallyTranslatedScaledUnitFormat.createFactory({ + const scaledUnitFormatter = ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText })({ @@ -63,7 +63,7 @@ describe('ManuallyTranslatedScaledUnitFormat', () => { }); it('uses unit prefix and symbol whenever unit prefix is provided', () => { - const scaledUnitFormatter = ManuallyTranslatedScaledUnitFormat.createFactory({ + const scaledUnitFormatter = ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText: '1.' })({ @@ -73,7 +73,7 @@ describe('ManuallyTranslatedScaledUnitFormat', () => { }); it('uses given formatter options', () => { - const scaledUnitFormatter = ManuallyTranslatedScaledUnitFormat.createFactory({ + const scaledUnitFormatter = ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText })({ @@ -87,7 +87,7 @@ describe('ManuallyTranslatedScaledUnitFormat', () => { const unitTranslationsMissingEn = new Map([ ['foo', new UnitTranslation('byte', 'bytes', 'B')] ]); - const scaledUnitFormatterFactory = ManuallyTranslatedScaledUnitFormat.createFactory({ + const scaledUnitFormatterFactory = ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations: unitTranslationsMissingEn, scaledPrefixText }); @@ -173,7 +173,7 @@ describe('ManuallyTranslatedScaledUnitFormat', () => { parameterizeSpec(pluralizationTestCases, (spec, name, value) => { spec(`uses expected pluralization for ${name}`, () => { - const scaledUnitFormatter = ManuallyTranslatedScaledUnitFormat.createFactory({ + const scaledUnitFormatter = ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText })({ diff --git a/packages/nimble-components/src/utilities/unit-format/scaled-unit/scaled-unit.ts b/packages/unit-format/src/scaled-unit/index.ts similarity index 87% rename from packages/nimble-components/src/utilities/unit-format/scaled-unit/scaled-unit.ts rename to packages/unit-format/src/scaled-unit/index.ts index 7fd8c709c3..18e4453086 100644 --- a/packages/nimble-components/src/utilities/unit-format/scaled-unit/scaled-unit.ts +++ b/packages/unit-format/src/scaled-unit/index.ts @@ -1,4 +1,4 @@ -import type { ScaledUnitFormat } from '../scaled-unit-format/scaled-unit-format'; +import type { ScaledUnitFormat } from '../scaled-unit-format/index.js'; export interface ScaledUnitFormatFactoryOptions { readonly locale: string; diff --git a/packages/nimble-components/src/utilities/unit-format/tests/test-scaled-unit-format.ts b/packages/unit-format/src/tests/scaled-unit-format-test.ts similarity index 59% rename from packages/nimble-components/src/utilities/unit-format/tests/test-scaled-unit-format.ts rename to packages/unit-format/src/tests/scaled-unit-format-test.ts index 61ea1ce65d..fc68cba574 100644 --- a/packages/nimble-components/src/utilities/unit-format/tests/test-scaled-unit-format.ts +++ b/packages/unit-format/src/tests/scaled-unit-format-test.ts @@ -1,10 +1,10 @@ -import { IntlNumberFormatScaledUnitFormat } from '../scaled-unit-format/intl-number-format-scaled-unit-format'; -import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/scaled-unit'; +import { ScaledUnitFormatIntlNumberFormat } from '../scaled-unit-format/intl-number-format/index.js'; +import type { ScaledUnitFormatFactoryOptions } from '../scaled-unit/index.js'; /** - * A ScaledUnitFormat that behaves like IntlNumberFormatScaledUnitFormat but also includes the scaleFactor in the formatted number + * A ScaledUnitFormat that behaves like ScaledUnitFormatIntlNumberFormat but also includes the scaleFactor in the formatted number */ -export class TestScaledUnitFormat extends IntlNumberFormatScaledUnitFormat { +export class ScaledUnitFormatTest extends ScaledUnitFormatIntlNumberFormat { protected constructor( scaledUnitFormatFactoryOptions: ScaledUnitFormatFactoryOptions, private readonly scaleFactor: number @@ -14,10 +14,10 @@ export class TestScaledUnitFormat extends IntlNumberFormatScaledUnitFormat { public static createTestFactory( scaleFactor: number - ): (options: ScaledUnitFormatFactoryOptions) => TestScaledUnitFormat { + ): (options: ScaledUnitFormatFactoryOptions) => ScaledUnitFormatTest { return ( scaledUnitFormatFactoryOptions: ScaledUnitFormatFactoryOptions - ) => new TestScaledUnitFormat( + ) => new ScaledUnitFormatTest( scaledUnitFormatFactoryOptions, scaleFactor ); diff --git a/packages/nimble-components/src/utilities/unit-format/tests/decimal-unit-format.spec.ts b/packages/unit-format/src/tests/unit-format-decimal.spec.ts similarity index 81% rename from packages/nimble-components/src/utilities/unit-format/tests/decimal-unit-format.spec.ts rename to packages/unit-format/src/tests/unit-format-decimal.spec.ts index afba1499f4..5f276d7507 100644 --- a/packages/nimble-components/src/utilities/unit-format/tests/decimal-unit-format.spec.ts +++ b/packages/unit-format/src/tests/unit-format-decimal.spec.ts @@ -1,11 +1,11 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { DecimalUnitFormat } from '../decimal-unit-format'; -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from '../unit-scale/unit-scale'; -import { passthroughUnitScale } from '../unit-scale/passthrough-unit-scale'; -import { TestScaledUnitFormat } from './test-scaled-unit-format'; +import { UnitFormatDecimal } from '../decimal/index.js'; +import { ScaledUnit } from '../scaled-unit/index.js'; +import { UnitScale } from '../unit-scale/index.js'; +import { unitScalePassthrough } from '../unit-scale/passthrough/index.js'; +import { ScaledUnitFormatTest } from './scaled-unit-format-test.js'; -describe('DecimalUnitFormat', () => { +describe('UnitFormatDecimal', () => { const testCases = [ { name: 'NEGATIVE_INFINITY renders as -∞', @@ -124,15 +124,15 @@ describe('DecimalUnitFormat', () => { const options = { minimumFractionDigits: value.minDigits, maximumFractionDigits: value.maxDigits, - unitScale: passthroughUnitScale + unitScale: unitScalePassthrough } as const; - const formatterEn = new DecimalUnitFormat('en', options); + const formatterEn = new UnitFormatDecimal('en', options); expect(formatterEn.format(value.value)).toEqual( value.expectedFormattedValue.en ); - const formatterDe = new DecimalUnitFormat('de', options); + const formatterDe = new UnitFormatDecimal('de', options); expect(formatterDe.format(value.value)).toEqual( value.expectedFormattedValue.de ); @@ -140,58 +140,58 @@ describe('DecimalUnitFormat', () => { }); describe('with unit', () => { - class TestUnitScale extends UnitScale { + class UnitScaleTest extends UnitScale { public constructor() { super([ new ScaledUnit( 0.001, - TestScaledUnitFormat.createTestFactory(0.001) + ScaledUnitFormatTest.createTestFactory(0.001) ), new ScaledUnit( 1, - TestScaledUnitFormat.createTestFactory(1) + ScaledUnitFormatTest.createTestFactory(1) ), new ScaledUnit( 2, - TestScaledUnitFormat.createTestFactory(2) + ScaledUnitFormatTest.createTestFactory(2) ), - new ScaledUnit(4, TestScaledUnitFormat.createTestFactory(4)) + new ScaledUnit(4, ScaledUnitFormatTest.createTestFactory(4)) ]); } } describe('and default values', () => { it('unconfigured', () => { - const formatter = new DecimalUnitFormat('en'); + const formatter = new UnitFormatDecimal('en'); const resolvedOptions = formatter.resolvedOptions(); expect(resolvedOptions.minimumFractionDigits).toBe(0); expect(resolvedOptions.maximumFractionDigits).toBe(3); - expect(resolvedOptions.unitScale).toBe(passthroughUnitScale); + expect(resolvedOptions.unitScale).toBe(unitScalePassthrough); }); it('minimum configured less than default maximum', () => { - const formatter = new DecimalUnitFormat('en', { + const formatter = new UnitFormatDecimal('en', { minimumFractionDigits: 1 }); const resolvedOptions = formatter.resolvedOptions(); expect(resolvedOptions.minimumFractionDigits).toBe(1); expect(resolvedOptions.maximumFractionDigits).toBe(3); - expect(resolvedOptions.unitScale).toBe(passthroughUnitScale); + expect(resolvedOptions.unitScale).toBe(unitScalePassthrough); }); it('minimum configured greater than default maximum', () => { - const formatter = new DecimalUnitFormat('en', { + const formatter = new UnitFormatDecimal('en', { minimumFractionDigits: 10 }); const resolvedOptions = formatter.resolvedOptions(); expect(resolvedOptions.minimumFractionDigits).toBe(10); expect(resolvedOptions.maximumFractionDigits).toBe(10); - expect(resolvedOptions.unitScale).toBe(passthroughUnitScale); + expect(resolvedOptions.unitScale).toBe(unitScalePassthrough); }); it('all configured', () => { - const unitScale = new TestUnitScale(); - const formatter = new DecimalUnitFormat('en', { + const unitScale = new UnitScaleTest(); + const formatter = new UnitFormatDecimal('en', { minimumFractionDigits: 10, maximumFractionDigits: 20, unitScale @@ -222,10 +222,10 @@ describe('DecimalUnitFormat', () => { ] as const; parameterizeSpec(appendedLabelUnitTestCases, (spec, name, value) => { spec(name, () => { - const formatter = new DecimalUnitFormat('en', { + const formatter = new UnitFormatDecimal('en', { minimumFractionDigits: 2, maximumFractionDigits: 2, - unitScale: new TestUnitScale() + unitScale: new UnitScaleTest() }); expect(formatter.format(value.value)).toEqual( value.expectedFormattedValue diff --git a/packages/nimble-components/src/utilities/unit-format/tests/default-unit-format.spec.ts b/packages/unit-format/src/tests/unit-format-default.spec.ts similarity index 87% rename from packages/nimble-components/src/utilities/unit-format/tests/default-unit-format.spec.ts rename to packages/unit-format/src/tests/unit-format-default.spec.ts index 15cde4f495..9e520823d0 100644 --- a/packages/nimble-components/src/utilities/unit-format/tests/default-unit-format.spec.ts +++ b/packages/unit-format/src/tests/unit-format-default.spec.ts @@ -1,11 +1,11 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { DefaultUnitFormat } from '../default-unit-format'; -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from '../unit-scale/unit-scale'; -import { passthroughUnitScale } from '../unit-scale/passthrough-unit-scale'; -import { TestScaledUnitFormat } from './test-scaled-unit-format'; +import { UnitFormatDefault } from '../default/index.js'; +import { ScaledUnit } from '../scaled-unit/index.js'; +import { UnitScale } from '../unit-scale/index.js'; +import { unitScalePassthrough } from '../unit-scale/passthrough/index.js'; +import { ScaledUnitFormatTest } from './scaled-unit-format-test.js'; -describe('DefaultUnitFormat', () => { +describe('UnitFormatDefault', () => { const testCases = [ { name: 'NEGATIVE_INFINITY renders as -∞', @@ -212,15 +212,15 @@ describe('DefaultUnitFormat', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(name, () => { const options = { - unitScale: passthroughUnitScale + unitScale: unitScalePassthrough } as const; - const formatterEn = new DefaultUnitFormat('en', options); + const formatterEn = new UnitFormatDefault('en', options); expect(formatterEn.format(value.value)).toEqual( value.expectedFormattedValue.en ); - const formatterDe = new DefaultUnitFormat('de', options); + const formatterDe = new UnitFormatDefault('de', options); expect(formatterDe.format(value.value)).toEqual( value.expectedFormattedValue.de ); @@ -228,24 +228,24 @@ describe('DefaultUnitFormat', () => { }); describe('with unit', () => { - class TestUnitScale extends UnitScale { + class UnitScaleTest extends UnitScale { public constructor() { super([ new ScaledUnit( 0.01, - TestScaledUnitFormat.createTestFactory(0.01) + ScaledUnitFormatTest.createTestFactory(0.01) ), new ScaledUnit( 1, - TestScaledUnitFormat.createTestFactory(1) + ScaledUnitFormatTest.createTestFactory(1) ), new ScaledUnit( 100, - TestScaledUnitFormat.createTestFactory(100) + ScaledUnitFormatTest.createTestFactory(100) ), new ScaledUnit( 1000, - TestScaledUnitFormat.createTestFactory(1000) + ScaledUnitFormatTest.createTestFactory(1000) ) ]); } @@ -253,13 +253,13 @@ describe('DefaultUnitFormat', () => { describe('and default values', () => { it('unconfigured', () => { - const formatter = new DefaultUnitFormat('en'); + const formatter = new UnitFormatDefault('en'); const resolvedOptions = formatter.resolvedOptions(); - expect(resolvedOptions.unitScale).toBe(passthroughUnitScale); + expect(resolvedOptions.unitScale).toBe(unitScalePassthrough); }); it('unconfigured', () => { - const unitScale = new TestUnitScale(); - const formatter = new DefaultUnitFormat('en', { + const unitScale = new UnitScaleTest(); + const formatter = new UnitFormatDefault('en', { unitScale }); const resolvedOptions = formatter.resolvedOptions(); @@ -285,8 +285,8 @@ describe('DefaultUnitFormat', () => { ] as const; parameterizeSpec(appendedLabelUnitTestCases, (spec, name, value) => { spec(name, () => { - const formatterForAppendedLabel = new DefaultUnitFormat('en', { - unitScale: new TestUnitScale() + const formatterForAppendedLabel = new UnitFormatDefault('en', { + unitScale: new UnitScaleTest() }); expect(formatterForAppendedLabel.format(value.value)).toEqual( value.expectedFormattedValue diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/byte-1024-unit-scale.ts b/packages/unit-format/src/unit-scale/byte-1024/index.ts similarity index 71% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/byte-1024-unit-scale.ts rename to packages/unit-format/src/unit-scale/byte-1024/index.ts index 74de7bee49..5836d42d5a 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/byte-1024-unit-scale.ts +++ b/packages/unit-format/src/unit-scale/byte-1024/index.ts @@ -1,10 +1,10 @@ -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from './unit-scale'; +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { UnitScale } from '../index.js'; import { - ManuallyTranslatedScaledUnitFormat, + ScaledUnitFormatManuallyTranslated, type UnitTranslations, UnitTranslation -} from '../scaled-unit-format/manually-translated-scaled-unit-format'; +} from '../../scaled-unit-format/manually-translated/index.js'; const unitTranslations: UnitTranslations = new Map([ ['en', new UnitTranslation('byte', 'bytes', 'B')], @@ -26,13 +26,13 @@ const byte1024Prefixes = [ /** * Byte units (1024-based) */ -class Byte1024UnitScale extends UnitScale { +class UnitScaleByte1024 extends UnitScale { public constructor() { super( byte1024Prefixes.map( ([scaleFactor, scaledPrefixText]) => new ScaledUnit( scaleFactor, - ManuallyTranslatedScaledUnitFormat.createFactory({ + ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText }) @@ -42,4 +42,4 @@ class Byte1024UnitScale extends UnitScale { } } -export const byte1024UnitScale = new Byte1024UnitScale(); +export const unitScaleByte1024 = new UnitScaleByte1024(); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/byte-unit-scale.ts b/packages/unit-format/src/unit-scale/byte/index.ts similarity index 58% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/byte-unit-scale.ts rename to packages/unit-format/src/unit-scale/byte/index.ts index cb5cde7ae2..1d67ff479c 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/byte-unit-scale.ts +++ b/packages/unit-format/src/unit-scale/byte/index.ts @@ -1,8 +1,8 @@ -import { IntlNumberFormatScaledUnitFormat } from '../scaled-unit-format/intl-number-format-scaled-unit-format'; -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from './unit-scale'; +import { ScaledUnitFormatIntlNumberFormat } from '../../scaled-unit-format/intl-number-format/index.js'; +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { UnitScale } from '../index.js'; -const byteUnitScaleOptions = [ +const unitScaleByteConfig = [ [1000 ** 0, 'byte', 'long'], [1000 ** 1, 'kilobyte', 'short'], [1000 ** 2, 'megabyte', 'short'], @@ -14,13 +14,13 @@ const byteUnitScaleOptions = [ /** * Byte units (1000-based) */ -class ByteUnitScale extends UnitScale { +class UnitScaleByte extends UnitScale { public constructor() { super( - byteUnitScaleOptions.map( + unitScaleByteConfig.map( ([scaleFactor, unit, unitDisplay]) => new ScaledUnit( scaleFactor, - IntlNumberFormatScaledUnitFormat.createFactory({ + ScaledUnitFormatIntlNumberFormat.createFactory({ style: 'unit', unit, unitDisplay @@ -31,4 +31,4 @@ class ByteUnitScale extends UnitScale { } } -export const byteUnitScale = new ByteUnitScale(); +export const unitScaleByte = new UnitScaleByte(); diff --git a/packages/unit-format/src/unit-scale/celsius/index.ts b/packages/unit-format/src/unit-scale/celsius/index.ts new file mode 100644 index 0000000000..4bf5f3013b --- /dev/null +++ b/packages/unit-format/src/unit-scale/celsius/index.ts @@ -0,0 +1,27 @@ +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { ScaledUnitFormatIntlNumberFormat } from '../../scaled-unit-format/intl-number-format/index.js'; +import { UnitScale } from '../index.js'; + +const unitScaleCelsiusConfig = [[1, 'celsius', 'short']] as const; + +/** + * Degrees Celsius units + */ +class UnitScaleCelsius extends UnitScale { + public constructor() { + super( + unitScaleCelsiusConfig.map( + ([scaleFactor, unit, unitDisplay]) => new ScaledUnit( + scaleFactor, + ScaledUnitFormatIntlNumberFormat.createFactory({ + style: 'unit', + unit, + unitDisplay + }) + ) + ) + ); + } +} + +export const unitScaleCelsius = new UnitScaleCelsius(); diff --git a/packages/unit-format/src/unit-scale/fahrenheit/index.ts b/packages/unit-format/src/unit-scale/fahrenheit/index.ts new file mode 100644 index 0000000000..bc8523311e --- /dev/null +++ b/packages/unit-format/src/unit-scale/fahrenheit/index.ts @@ -0,0 +1,27 @@ +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { ScaledUnitFormatIntlNumberFormat } from '../../scaled-unit-format/intl-number-format/index.js'; +import { UnitScale } from '../index.js'; + +const unitScaleFahrenheitConfig = [[1, 'fahrenheit', 'short']] as const; + +/** + * Degrees Fahrenheit units + */ +class UnitScaleFahrenheit extends UnitScale { + public constructor() { + super( + unitScaleFahrenheitConfig.map( + ([scaleFactor, unit, unitDisplay]) => new ScaledUnit( + scaleFactor, + ScaledUnitFormatIntlNumberFormat.createFactory({ + style: 'unit', + unit, + unitDisplay + }) + ) + ) + ); + } +} + +export const unitScaleFahrenheit = new UnitScaleFahrenheit(); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/unit-scale.ts b/packages/unit-format/src/unit-scale/index.ts similarity index 97% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/unit-scale.ts rename to packages/unit-format/src/unit-scale/index.ts index 7d6b808957..88f8ecd1fa 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/unit-scale.ts +++ b/packages/unit-format/src/unit-scale/index.ts @@ -1,4 +1,4 @@ -import type { ScaledUnit } from '../scaled-unit/scaled-unit'; +import type { ScaledUnit } from '../scaled-unit/index.js'; interface ScaledNumber { readonly scaledValue: number; diff --git a/packages/unit-format/src/unit-scale/passthrough/index.ts b/packages/unit-format/src/unit-scale/passthrough/index.ts new file mode 100644 index 0000000000..7b5f0b2b11 --- /dev/null +++ b/packages/unit-format/src/unit-scale/passthrough/index.ts @@ -0,0 +1,19 @@ +import { ScaledUnitFormatIntlNumberFormat } from '../../scaled-unit-format/intl-number-format/index.js'; +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { UnitScale } from '../index.js'; + +/** + * Unit scale that is used to passthrough a number without applying scaling or units + */ +class UnitScalePassthrough extends UnitScale { + public constructor() { + super([ + new ScaledUnit( + 10 ** 0, + ScaledUnitFormatIntlNumberFormat.createFactory({}) + ) + ]); + } +} + +export const unitScalePassthrough = new UnitScalePassthrough(); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-1024-unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale-byte-1024.spec.ts similarity index 94% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-1024-unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale-byte-1024.spec.ts index 3e34f3f2d1..70594dd87e 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-1024-unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale-byte-1024.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { byte1024UnitScale } from '../byte-1024-unit-scale'; +import { unitScaleByte1024 } from '../byte-1024/index.js'; -describe('Byte1024UnitScale', () => { +describe('UnitScaleByte1024', () => { const testCases = [ { name: '0', @@ -80,7 +80,7 @@ describe('Byte1024UnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(`gets expected unit for ${name}`, () => { - const { scaledValue, scaledUnit } = byte1024UnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleByte1024.scaleNumber( value.number ); expect( diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale-byte.spec.ts similarity index 90% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale-byte.spec.ts index 21c4ef971d..6fd26bce72 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/byte-unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale-byte.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { byteUnitScale } from '../byte-unit-scale'; +import { unitScaleByte } from '../byte/index.js'; -describe('ByteUnitScale', () => { +describe('UnitScaleByte', () => { const testCases = [ { name: '0', @@ -52,7 +52,7 @@ describe('ByteUnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(`gets expected unit for ${name}`, () => { - const { scaledValue, scaledUnit } = byteUnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleByte.scaleNumber( value.number ); expect( @@ -69,7 +69,7 @@ describe('ByteUnitScale', () => { }); it('uses bytes unit instead of kilobytes if number would round up to 1000', () => { - const { scaledValue, scaledUnit } = byteUnitScale.scaleNumber(999); + const { scaledValue, scaledUnit } = unitScaleByte.scaleNumber(999); expect( scaledUnit .scaledUnitFormatFactory({ diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/celsius-unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale-celsius.spec.ts similarity index 92% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/celsius-unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale-celsius.spec.ts index 300b3aaba6..73e7cef2ee 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/celsius-unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale-celsius.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { celsiusUnitScale } from '../celsius-unit-scale'; +import { unitScaleCelsius } from '../celsius/index.js'; -describe('CelsiusUnitScale', () => { +describe('UnitScaleCelsius', () => { const testCases = [ { name: '10 ** -1', @@ -33,7 +33,7 @@ describe('CelsiusUnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(`gets expected unit for ${name}`, () => { - const { scaledValue, scaledUnit } = celsiusUnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleCelsius.scaleNumber( value.number ); expect( diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/fahrenheit-unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale-fahrenheit.spec.ts similarity index 91% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/fahrenheit-unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale-fahrenheit.spec.ts index f1d9eb5da6..41151c1ff3 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/fahrenheit-unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale-fahrenheit.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { fahrenheitUnitScale } from '../fahrenheit-unit-scale'; +import { unitScaleFahrenheit } from '../fahrenheit/index.js'; -describe('FahrenheitUnitScale', () => { +describe('UnitScaleFahrenheit', () => { const testCases = [ { name: '10 ** -1', @@ -33,7 +33,7 @@ describe('FahrenheitUnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(`gets expected unit for ${name}`, () => { - const { scaledValue, scaledUnit } = fahrenheitUnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleFahrenheit.scaleNumber( value.number ); expect( diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/volt-unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale-volt.spec.ts similarity index 95% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/volt-unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale-volt.spec.ts index 069b63172e..8b57fe2a84 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/volt-unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale-volt.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { voltUnitScale } from '../volt-unit-scale'; +import { unitScaleVolt } from '../volt/index.js'; -describe('VoltUnitScale', () => { +describe('UnitScaleVolt', () => { const testCases = [ { name: '10 ** -18', @@ -104,7 +104,7 @@ describe('VoltUnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(`gets expected unit for ${name}`, () => { - const { scaledValue, scaledUnit } = voltUnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleVolt.scaleNumber( value.number ); expect( @@ -136,7 +136,7 @@ describe('VoltUnitScale', () => { }); it('uses femtovolts unit instead of volts if number would round down to 0', () => { - const { scaledValue, scaledUnit } = voltUnitScale.scaleNumber( + const { scaledValue, scaledUnit } = unitScaleVolt.scaleNumber( 10 ** -17 ); expect( diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/unit-scale.spec.ts b/packages/unit-format/src/unit-scale/tests/unit-scale.spec.ts similarity index 85% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/tests/unit-scale.spec.ts rename to packages/unit-format/src/unit-scale/tests/unit-scale.spec.ts index 326b5621e0..21539443b8 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/tests/unit-scale.spec.ts +++ b/packages/unit-format/src/unit-scale/tests/unit-scale.spec.ts @@ -1,7 +1,7 @@ import { parameterizeSpec } from '@ni/jasmine-parameterized'; -import { ScaledUnit } from '../../scaled-unit/scaled-unit'; -import { UnitScale } from '../unit-scale'; -import type { ScaledUnitFormat } from '../../scaled-unit-format/scaled-unit-format'; +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { UnitScale } from '../index.js'; +import type { ScaledUnitFormat } from '../../scaled-unit-format/index.js'; describe('UnitScale', () => { const noopScaledUnitFormatFactory = (): ScaledUnitFormat => { @@ -16,7 +16,7 @@ describe('UnitScale', () => { const kiloScaledUnit = new ScaledUnit(10 ** 3, noopScaledUnitFormatFactory); const megaScaledUnit = new ScaledUnit(10 ** 6, noopScaledUnitFormatFactory); - class TestUnitScale extends UnitScale { + class UnitScaleTest extends UnitScale { public constructor() { super([ milliScaledUnit, @@ -92,7 +92,7 @@ describe('UnitScale', () => { parameterizeSpec(testCases, (spec, name, value) => { spec(name, () => { - const unitScale = new TestUnitScale(); + const unitScale = new UnitScaleTest(); const { scaledValue, scaledUnit } = unitScale.scaleNumber( value.value ); @@ -104,39 +104,39 @@ describe('UnitScale', () => { }); it('can return the base scaled unit', () => { - expect(new TestUnitScale().baseScaledUnit).toBe(baseScaledUnit); + expect(new UnitScaleTest().baseScaledUnit).toBe(baseScaledUnit); }); describe('with incorrect ScaledUnits', () => { it('out of order', () => { - class TestOutOfOrderUnitScale extends UnitScale { + class UnitScaleTestOutOfOrder extends UnitScale { public constructor() { super([baseScaledUnit, milliScaledUnit]); } } - expect(() => new TestOutOfOrderUnitScale()).toThrowError( + expect(() => new UnitScaleTestOutOfOrder()).toThrowError( /must have unique and ordered scale factors/ ); }); it('duplicated', () => { - class TestDuplicateUnitScale extends UnitScale { + class UnitScaleTestDuplicate extends UnitScale { public constructor() { super([milliScaledUnit, milliScaledUnit, baseScaledUnit]); } } - expect(() => new TestDuplicateUnitScale()).toThrowError( + expect(() => new UnitScaleTestDuplicate()).toThrowError( /must have unique and ordered scale factors/ ); }); it('missing base unit', () => { - class TestNoBaseUnitScale extends UnitScale { + class UnitScaleTestNoBase extends UnitScale { public constructor() { super([milliScaledUnit, kiloScaledUnit, megaScaledUnit]); } } - expect(() => new TestNoBaseUnitScale()).toThrowError( + expect(() => new UnitScaleTestNoBase()).toThrowError( /must include a base scaled unit/ ); }); diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/utilities/metrix-prefixes.ts b/packages/unit-format/src/unit-scale/utilities/metric-prefixes.ts similarity index 100% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/utilities/metrix-prefixes.ts rename to packages/unit-format/src/unit-scale/utilities/metric-prefixes.ts diff --git a/packages/nimble-components/src/utilities/unit-format/unit-scale/volt-unit-scale.ts b/packages/unit-format/src/unit-scale/volt/index.ts similarity index 64% rename from packages/nimble-components/src/utilities/unit-format/unit-scale/volt-unit-scale.ts rename to packages/unit-format/src/unit-scale/volt/index.ts index 3ffe4459fe..2abab69753 100644 --- a/packages/nimble-components/src/utilities/unit-format/unit-scale/volt-unit-scale.ts +++ b/packages/unit-format/src/unit-scale/volt/index.ts @@ -1,11 +1,11 @@ -import { ScaledUnit } from '../scaled-unit/scaled-unit'; -import { UnitScale } from './unit-scale'; -import { metricPrefixes } from './utilities/metrix-prefixes'; +import { ScaledUnit } from '../../scaled-unit/index.js'; +import { UnitScale } from '../index.js'; +import { metricPrefixes } from '../utilities/metric-prefixes.js'; import { - ManuallyTranslatedScaledUnitFormat, + ScaledUnitFormatManuallyTranslated, type UnitTranslations, UnitTranslation -} from '../scaled-unit-format/manually-translated-scaled-unit-format'; +} from '../../scaled-unit-format/manually-translated/index.js'; const unitTranslations: UnitTranslations = new Map([ ['en', new UnitTranslation('volt', 'volts', 'V')], @@ -18,13 +18,13 @@ const unitTranslations: UnitTranslations = new Map([ /** * Voltage unit scale */ -class VoltUnitScale extends UnitScale { +class UnitScaleVolt extends UnitScale { public constructor() { super( metricPrefixes.map( ([scaleFactor, scaledPrefixText]) => new ScaledUnit( scaleFactor, - ManuallyTranslatedScaledUnitFormat.createFactory({ + ScaledUnitFormatManuallyTranslated.createFactory({ unitTranslations, scaledPrefixText }) @@ -34,4 +34,4 @@ class VoltUnitScale extends UnitScale { } } -export const voltUnitScale = new VoltUnitScale(); +export const unitScaleVolt = new UnitScaleVolt(); diff --git a/packages/unit-format/tsconfig.json b/packages/unit-format/tsconfig.json new file mode 100644 index 0000000000..7fc8661ac1 --- /dev/null +++ b/packages/unit-format/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "Node16", + "moduleResolution": "Node16", + "outDir": "./dist/esm", + "importHelpers": false, + "strict": true, + "declaration": true, + "sourceMap": true, + "inlineSources": true + }, + "include": [ + "src" + ] +}