From 9d267144bf808dd5434382338d83e73ada15557c Mon Sep 17 00:00:00 2001 From: Catherine Wise Date: Thu, 28 Nov 2024 14:15:09 +1100 Subject: [PATCH] 2024-11-28 --- CHANGELOG.md | 8 + examples/i18n/app.tsx | 30 +-- .../tests/__snapshots__/app.tests.tsx.snap | 6 +- examples/i18n/tests/app.tests.tsx | 8 +- package-lock.json | 252 ++++++------------ package.json | 6 +- 6 files changed, 111 insertions(+), 199 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cad0b3b..6870a25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2024-11-28 + +### 🔧 Changed + +- Upgraded `@canva/app-ui-kit` to version `4.4.0` Please see the [changelog](https://www.canva.dev/docs/apps/app-ui-kit/changelog/) for the list of changes. +- Upgraded `@canva/app-i18n-kit` to version `1.0.1` +- Upgraded `react-intl` to version `6.8.7` + ## 2024-11-13 ### 🧰 Added diff --git a/examples/i18n/app.tsx b/examples/i18n/app.tsx index b334eb9..f23a27a 100644 --- a/examples/i18n/app.tsx +++ b/examples/i18n/app.tsx @@ -90,9 +90,9 @@ export const App = ({ /> {/* ==================== Plurals ==================== */} - - - + + + {/* ==================== Rich Text ==================== */} ( diff --git a/examples/i18n/tests/__snapshots__/app.tests.tsx.snap b/examples/i18n/tests/__snapshots__/app.tests.tsx.snap index d83216c..023bc6e 100644 --- a/examples/i18n/tests/__snapshots__/app.tests.tsx.snap +++ b/examples/i18n/tests/__snapshots__/app.tests.tsx.snap @@ -5,7 +5,7 @@ exports[`app Renders token counts consistently 🎉 1`] = `

- You've used 0 tokens out of 25. + Use 5 of 50 credits

`; @@ -15,7 +15,7 @@ exports[`app Renders token counts consistently 🎉 2`] = `

- You've used 1 token out of 25. + Use 1 of 1 credit

`; @@ -25,7 +25,7 @@ exports[`app Renders token counts consistently 🎉 3`] = `

- You've used 10 tokens out of 25. + Use 1 of 0 credits

`; diff --git a/examples/i18n/tests/app.tests.tsx b/examples/i18n/tests/app.tests.tsx index cb5c2d0..fd35942 100644 --- a/examples/i18n/tests/app.tests.tsx +++ b/examples/i18n/tests/app.tests.tsx @@ -2,7 +2,7 @@ import type { RenderResult } from "@testing-library/react"; import { fireEvent, render } from "@testing-library/react"; import { TestAppUiProvider } from "@canva/app-ui-kit"; import { TestAppI18nProvider } from "@canva/app-i18n-kit"; -import { App, TokenCount } from "../app"; +import { App, CreditUsage } from "../app"; function renderInTestProvider(node: React.ReactNode): RenderResult { return render( @@ -49,18 +49,18 @@ describe("app", () => { it("Renders token counts consistently 🎉", () => { const resultToken0 = renderInTestProvider( - , + , ); // The snapshot test can be used to detect unexpected changes in the rendered output. expect(resultToken0.container).toMatchSnapshot(); const resultToken1 = renderInTestProvider( - , + , ); expect(resultToken1.container).toMatchSnapshot(); const resultToken10 = renderInTestProvider( - , + , ); expect(resultToken10.container).toMatchSnapshot(); }); diff --git a/package-lock.json b/package-lock.json index a550fe7..852e19d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,8 +11,8 @@ "./examples/*" ], "dependencies": { - "@canva/app-i18n-kit": "^1.0.0", - "@canva/app-ui-kit": "^4.3.0", + "@canva/app-i18n-kit": "^1.0.1", + "@canva/app-ui-kit": "^4.4.0", "@canva/asset": "^2.0.0", "@canva/design": "^2.2.1", "@canva/error": "^2.0.0", @@ -20,7 +20,7 @@ "@canva/user": "^2.0.0", "react": "18.3.1", "react-dom": "18.3.1", - "react-intl": "6.6.8" + "react-intl": "6.8.7" }, "devDependencies": { "@eslint/eslintrc": "3.1.0", @@ -2199,20 +2199,21 @@ } }, "node_modules/@canva/app-i18n-kit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@canva/app-i18n-kit/-/app-i18n-kit-1.0.0.tgz", - "integrity": "sha512-P6ONMEyWgp1mKiX14ZIZI+J6lOVoJ6q05XeGOHnPr2KxsynA2Sq4EB5RSZBgLZCAdiqz1etJT4wDRyPOSXk/JQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@canva/app-i18n-kit/-/app-i18n-kit-1.0.1.tgz", + "integrity": "sha512-s5VeohUzdsr8McP/3yBmO4Fo4H1a+Y0mPaxtj19+akxQyTIR2xudOr0TazO5aRomRTgJqUCEMwcGuc7q4OB89g==", + "license": "SEE LICENSE IN LICENSE.md", "peerDependencies": { - "intl-messageformat": "10.5.14", + "intl-messageformat": "10.5.14 || ~10.7.6", "react": "18.3.1", "react-dom": "18.3.1", - "react-intl": "6.6.8" + "react-intl": "6.6.8 || ~6.8.7" } }, "node_modules/@canva/app-ui-kit": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@canva/app-ui-kit/-/app-ui-kit-4.3.0.tgz", - "integrity": "sha512-70pzgzqzQ/la1qnLb+JQN9CFh1w7KnzpApNfgDo+/nXBUuxq+q3isukRDjE0VOyG5oXPwRxl9U9uveKfqmQrUQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@canva/app-ui-kit/-/app-ui-kit-4.4.0.tgz", + "integrity": "sha512-MTROhnOZN3TlHI05qjF81MOlFKY3BnHdzGfKwYxCt2Wfs5Bt2V9ye/jxB/UxFRG3EnUYmYdwZ8Vt27HAnTtseA==", "dependencies": { "@floating-ui/react": "^0.26.16", "@seznam/compose-react-refs": "^1.0.4", @@ -2520,50 +2521,59 @@ } }, "node_modules/@formatjs/ecma402-abstract": { - "version": "2.0.0", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.3.tgz", + "integrity": "sha512-aElGmleuReGnk2wtYOzYFmNWYoiWWmf1pPPCYg0oiIQSJj0mjc4eUfzUXaSOJ4S8WzI/cLqnCTWjqz904FT2OQ==", "license": "MIT", "dependencies": { - "@formatjs/intl-localematcher": "0.5.4", - "tslib": "^2.4.0" + "@formatjs/fast-memoize": "2.2.3", + "@formatjs/intl-localematcher": "0.5.7", + "tslib": "2" } }, "node_modules/@formatjs/fast-memoize": { - "version": "2.2.0", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.3.tgz", + "integrity": "sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==", "license": "MIT", "dependencies": { - "tslib": "^2.4.0" + "tslib": "2" } }, "node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.7.8", + "version": "2.9.3", + "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.3.tgz", + "integrity": "sha512-9L99QsH14XjOCIp4TmbT8wxuffJxGK8uLNO1zNhLtcZaVXvv626N0s4A2qgRCKG3dfYWx9psvGlFmvyVBa6u/w==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/icu-skeleton-parser": "1.8.2", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/icu-skeleton-parser": "1.8.7", + "tslib": "2" } }, "node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.8.2", + "version": "1.8.7", + "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.7.tgz", + "integrity": "sha512-fI+6SmS2g7h3srfAKSWa5dwreU5zNEfon2uFo99OToiLF6yxGE+WikvFSbsvMAYkscucvVmTYNlWlaDPp0n5HA==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "tslib": "2" } }, "node_modules/@formatjs/intl": { - "version": "2.10.4", - "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.10.4.tgz", - "integrity": "sha512-56483O+HVcL0c7VucAS2tyH020mt9XTozZO67cwtGg0a7KWDukS/FzW3OnvaHmTHDuYsoPIzO+ZHVfU6fT/bJw==", + "version": "2.10.14", + "resolved": "https://registry.npmjs.org/@formatjs/intl/-/intl-2.10.14.tgz", + "integrity": "sha512-4CA1EO75i/mSMHdjwfpgRj3Rsdsm6WjALeu/nlzYhBmAPxGu/Ha5GIRHAet5SO05TnpmqxmEGOsskWqFm0IeoA==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/fast-memoize": "2.2.0", - "@formatjs/icu-messageformat-parser": "2.7.8", - "@formatjs/intl-displaynames": "6.6.8", - "@formatjs/intl-listformat": "7.5.7", - "intl-messageformat": "10.5.14", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/fast-memoize": "2.2.3", + "@formatjs/icu-messageformat-parser": "2.9.3", + "@formatjs/intl-displaynames": "6.8.4", + "@formatjs/intl-listformat": "7.7.4", + "intl-messageformat": "10.7.6", + "tslib": "2" }, "peerDependencies": { "typescript": "^4.7 || 5" @@ -2575,32 +2585,34 @@ } }, "node_modules/@formatjs/intl-displaynames": { - "version": "6.6.8", - "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.6.8.tgz", - "integrity": "sha512-Lgx6n5KxN16B3Pb05z3NLEBQkGoXnGjkTBNCZI+Cn17YjHJ3fhCeEJJUqRlIZmJdmaXQhjcQVDp6WIiNeRYT5g==", + "version": "6.8.4", + "resolved": "https://registry.npmjs.org/@formatjs/intl-displaynames/-/intl-displaynames-6.8.4.tgz", + "integrity": "sha512-HDVNBspDAOW0yTWluWTPHX2fk/9iBO4oST4R96f/IUaPGsFtjsHrpakwc+XDRPa3U5RniSEU2z34ZY0W78+E6Q==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/intl-localematcher": "0.5.4", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/intl-localematcher": "0.5.7", + "tslib": "2" } }, "node_modules/@formatjs/intl-listformat": { - "version": "7.5.7", - "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.5.7.tgz", - "integrity": "sha512-MG2TSChQJQT9f7Rlv+eXwUFiG24mKSzmF144PLb8m8OixyXqn4+YWU+5wZracZGCgVTVmx8viCf7IH3QXoiB2g==", + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@formatjs/intl-listformat/-/intl-listformat-7.7.4.tgz", + "integrity": "sha512-lipFspH2MZcoeXxR6WSR/Jy9unzJ/iT0w+gbL8vgv25Ap0S9cUtcDVAce4ECEKI1bDtAvEU3b6+9Dha27gAikA==", "license": "MIT", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/intl-localematcher": "0.5.4", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/intl-localematcher": "0.5.7", + "tslib": "2" } }, "node_modules/@formatjs/intl-localematcher": { - "version": "0.5.4", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.7.tgz", + "integrity": "sha512-GGFtfHGQVFe/niOZp24Kal5b2i36eE2bNL0xi9Sg/yd0TR8aLjcteApZdHmismP5QQax1cMnZM9yWySUUjJteA==", "license": "MIT", "dependencies": { - "tslib": "^2.4.0" + "tslib": "2" } }, "node_modules/@formatjs/ts-transformer": { @@ -2627,61 +2639,6 @@ } } }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/ecma402-abstract": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.3.tgz", - "integrity": "sha512-aElGmleuReGnk2wtYOzYFmNWYoiWWmf1pPPCYg0oiIQSJj0mjc4eUfzUXaSOJ4S8WzI/cLqnCTWjqz904FT2OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/fast-memoize": "2.2.3", - "@formatjs/intl-localematcher": "0.5.7", - "tslib": "2" - } - }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/fast-memoize": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.3.tgz", - "integrity": "sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "2" - } - }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.3.tgz", - "integrity": "sha512-9L99QsH14XjOCIp4TmbT8wxuffJxGK8uLNO1zNhLtcZaVXvv626N0s4A2qgRCKG3dfYWx9psvGlFmvyVBa6u/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", - "@formatjs/icu-skeleton-parser": "1.8.7", - "tslib": "2" - } - }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.8.7", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.7.tgz", - "integrity": "sha512-fI+6SmS2g7h3srfAKSWa5dwreU5zNEfon2uFo99OToiLF6yxGE+WikvFSbsvMAYkscucvVmTYNlWlaDPp0n5HA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", - "tslib": "2" - } - }, - "node_modules/@formatjs/ts-transformer/node_modules/@formatjs/intl-localematcher": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.7.tgz", - "integrity": "sha512-GGFtfHGQVFe/niOZp24Kal5b2i36eE2bNL0xi9Sg/yd0TR8aLjcteApZdHmismP5QQax1cMnZM9yWySUUjJteA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "2" - } - }, "node_modules/@headlessui/react": { "version": "1.7.19", "resolved": "https://registry.npmjs.org/@headlessui/react/-/react-1.7.19.tgz", @@ -7323,61 +7280,6 @@ "eslint": "9" } }, - "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/ecma402-abstract": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-2.2.3.tgz", - "integrity": "sha512-aElGmleuReGnk2wtYOzYFmNWYoiWWmf1pPPCYg0oiIQSJj0mjc4eUfzUXaSOJ4S8WzI/cLqnCTWjqz904FT2OQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/fast-memoize": "2.2.3", - "@formatjs/intl-localematcher": "0.5.7", - "tslib": "2" - } - }, - "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/fast-memoize": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/@formatjs/fast-memoize/-/fast-memoize-2.2.3.tgz", - "integrity": "sha512-3jeJ+HyOfu8osl3GNSL4vVHUuWFXR03Iz9jjgI7RwjG6ysu/Ymdr0JRCPHfF5yGbTE6JCrd63EpvX1/WybYRbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "2" - } - }, - "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/icu-messageformat-parser": { - "version": "2.9.3", - "resolved": "https://registry.npmjs.org/@formatjs/icu-messageformat-parser/-/icu-messageformat-parser-2.9.3.tgz", - "integrity": "sha512-9L99QsH14XjOCIp4TmbT8wxuffJxGK8uLNO1zNhLtcZaVXvv626N0s4A2qgRCKG3dfYWx9psvGlFmvyVBa6u/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", - "@formatjs/icu-skeleton-parser": "1.8.7", - "tslib": "2" - } - }, - "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/icu-skeleton-parser": { - "version": "1.8.7", - "resolved": "https://registry.npmjs.org/@formatjs/icu-skeleton-parser/-/icu-skeleton-parser-1.8.7.tgz", - "integrity": "sha512-fI+6SmS2g7h3srfAKSWa5dwreU5zNEfon2uFo99OToiLF6yxGE+WikvFSbsvMAYkscucvVmTYNlWlaDPp0n5HA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@formatjs/ecma402-abstract": "2.2.3", - "tslib": "2" - } - }, - "node_modules/eslint-plugin-formatjs/node_modules/@formatjs/intl-localematcher": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@formatjs/intl-localematcher/-/intl-localematcher-0.5.7.tgz", - "integrity": "sha512-GGFtfHGQVFe/niOZp24Kal5b2i36eE2bNL0xi9Sg/yd0TR8aLjcteApZdHmismP5QQax1cMnZM9yWySUUjJteA==", - "dev": true, - "license": "MIT", - "dependencies": { - "tslib": "2" - } - }, "node_modules/eslint-plugin-formatjs/node_modules/emoji-regex": { "version": "10.4.0", "dev": true, @@ -8629,13 +8531,15 @@ } }, "node_modules/intl-messageformat": { - "version": "10.5.14", + "version": "10.7.6", + "resolved": "https://registry.npmjs.org/intl-messageformat/-/intl-messageformat-10.7.6.tgz", + "integrity": "sha512-IsMU/hqyy3FJwNJ0hxDfY2heJ7MteSuFvcnCebxRp67di4Fhx1gKKE+qS0bBwUF8yXkX9SsPUhLeX/B6h5SKUA==", "license": "BSD-3-Clause", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/fast-memoize": "2.2.0", - "@formatjs/icu-messageformat-parser": "2.7.8", - "tslib": "^2.4.0" + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/fast-memoize": "2.2.3", + "@formatjs/icu-messageformat-parser": "2.9.3", + "tslib": "2" } }, "node_modules/intl-pluralrules": { @@ -12228,21 +12132,21 @@ } }, "node_modules/react-intl": { - "version": "6.6.8", - "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.6.8.tgz", - "integrity": "sha512-M0pkhzcgV31h++2901BiRXWl69hp2zPyLxRrSwRjd1ErXbNoubz/f4M6DrRTd4OiSUrT4ajRQzrmtS5plG4FtA==", + "version": "6.8.7", + "resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.8.7.tgz", + "integrity": "sha512-Ocv8Tg6fXqBdVdkkYohQ79T9rJls3G1lmDSjhqHdK9873BdQFLSeITGgwuGWTRBd6Mg5FL33TBen4FtujCTP0g==", "license": "BSD-3-Clause", "dependencies": { - "@formatjs/ecma402-abstract": "2.0.0", - "@formatjs/icu-messageformat-parser": "2.7.8", - "@formatjs/intl": "2.10.4", - "@formatjs/intl-displaynames": "6.6.8", - "@formatjs/intl-listformat": "7.5.7", - "@types/hoist-non-react-statics": "^3.3.1", + "@formatjs/ecma402-abstract": "2.2.3", + "@formatjs/icu-messageformat-parser": "2.9.3", + "@formatjs/intl": "2.10.14", + "@formatjs/intl-displaynames": "6.8.4", + "@formatjs/intl-listformat": "7.7.4", + "@types/hoist-non-react-statics": "3", "@types/react": "16 || 17 || 18", - "hoist-non-react-statics": "^3.3.2", - "intl-messageformat": "10.5.14", - "tslib": "^2.4.0" + "hoist-non-react-statics": "3", + "intl-messageformat": "10.7.6", + "tslib": "2" }, "peerDependencies": { "react": "^16.6.0 || 17 || 18", diff --git a/package.json b/package.json index 689ba76..d97b454 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "./examples/*" ], "dependencies": { - "@canva/app-i18n-kit": "^1.0.0", - "@canva/app-ui-kit": "^4.3.0", + "@canva/app-i18n-kit": "^1.0.1", + "@canva/app-ui-kit": "^4.4.0", "@canva/asset": "^2.0.0", "@canva/design": "^2.2.1", "@canva/error": "^2.0.0", @@ -36,7 +36,7 @@ "@canva/user": "^2.0.0", "react": "18.3.1", "react-dom": "18.3.1", - "react-intl": "6.6.8" + "react-intl": "6.8.7" }, "devDependencies": { "@eslint/eslintrc": "3.1.0",