From cea12dd14a618af332ece6bc2de854a723936f7a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 07:21:33 +0100 Subject: [PATCH 01/15] Bump vitest to 2.1.9 [SECURITY] (#4659) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- packages/toolpad-core/package.json | 2 +- packages/toolpad-utils/package.json | 2 +- pnpm-lock.yaml | 176 ++++++++++++++++++---------- 4 files changed, 117 insertions(+), 65 deletions(-) diff --git a/package.json b/package.json index 1cead1f0592..203a68eb6ae 100644 --- a/package.json +++ b/package.json @@ -126,7 +126,7 @@ "semver": "7.6.3", "tsup": "8.3.6", "tsx": "4.19.2", - "vitest": "2.1.8", + "vitest": "2.1.9", "yargs": "17.7.2", "zod": "3.23.8", "zod-to-json-schema": "3.23.5" diff --git a/packages/toolpad-core/package.json b/packages/toolpad-core/package.json index 61ec421e3aa..b76d7149707 100644 --- a/packages/toolpad-core/package.json +++ b/packages/toolpad-core/package.json @@ -78,7 +78,7 @@ "playwright": "^1.47.2", "react-router": "7.1.5", "sinon": "^19.0.2", - "vitest": "2.1.8" + "vitest": "2.1.9" }, "peerDependencies": { "@mui/icons-material": "5 - 6", diff --git a/packages/toolpad-utils/package.json b/packages/toolpad-utils/package.json index ac27b09ddd0..25b01432560 100644 --- a/packages/toolpad-utils/package.json +++ b/packages/toolpad-utils/package.json @@ -71,6 +71,6 @@ "@types/react": "^19.0.8", "@types/react-is": "^19.0.0", "@types/title": "3.4.3", - "vitest": "2.1.8" + "vitest": "2.1.9" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f320fc4304e..cc17e5220d9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,7 +17,7 @@ importers: version: 4.17.15 '@vitest/browser': specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) archiver: specifier: 7.0.1 version: 7.0.1 @@ -49,8 +49,8 @@ importers: specifier: 4.19.2 version: 4.19.2 vitest: - specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + specifier: 2.1.9 + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) yargs: specifier: 17.7.2 version: 17.7.2 @@ -147,7 +147,7 @@ importers: version: 7.18.0(eslint@8.57.1)(typescript@5.5.4) '@vitest/coverage-v8': specifier: 2.1.8 - version: 2.1.8(@vitest/browser@2.1.8)(vitest@2.1.8) + version: 2.1.8(@vitest/browser@2.1.8)(vitest@2.1.9) babel-plugin-react-remove-properties: specifier: 0.3.0 version: 0.3.0 @@ -264,10 +264,10 @@ importers: version: 5.0.0 vitest-dom: specifier: 0.1.1 - version: 0.1.1(vitest@2.1.8) + version: 0.1.1(vitest@2.1.9) vitest-fail-on-console: specifier: 0.7.1 - version: 0.7.1(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + version: 0.7.1(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) docs: dependencies: @@ -655,7 +655,7 @@ importers: version: 17.0.3 '@vitest/browser': specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) next: specifier: ^15.1.6 version: 15.1.6(@babel/core@7.26.0)(@playwright/test@1.47.2)(babel-plugin-macros@3.1.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -672,8 +672,8 @@ importers: specifier: ^19.0.2 version: 19.0.2 vitest: - specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + specifier: 2.1.9 + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) publishDirectory: build packages/toolpad-studio: @@ -1196,8 +1196,8 @@ importers: specifier: 3.4.3 version: 3.4.3 vitest: - specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + specifier: 2.1.9 + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) playground/nextjs: devDependencies: @@ -4544,8 +4544,8 @@ packages: '@vitest/browser': optional: true - '@vitest/expect@2.1.8': - resolution: {integrity: sha512-8ytZ/fFHq2g4PJVAtDX57mayemKgDR6X3Oa2Foro+EygiOJHUXhCqBAAKQYYajZpFoIfvBCF1j6R6IYRSIUFuw==} + '@vitest/expect@2.1.9': + resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} '@vitest/mocker@2.1.8': resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==} @@ -4558,21 +4558,41 @@ packages: vite: optional: true + '@vitest/mocker@2.1.9': + resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/pretty-format@2.1.8': resolution: {integrity: sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==} - '@vitest/runner@2.1.8': - resolution: {integrity: sha512-17ub8vQstRnRlIU5k50bG+QOMLHRhYPAna5tw8tYbj+jzjcspnwnwtPtiOlkuKC4+ixDPTuLZiqiWWQ2PSXHVg==} + '@vitest/pretty-format@2.1.9': + resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} + + '@vitest/runner@2.1.9': + resolution: {integrity: sha512-ZXSSqTFIrzduD63btIfEyOmNcBmQvgOVsPNPe0jYtESiXkhd8u2erDLnMxmGrDCwHCCHE7hxwRDCT3pt0esT4g==} - '@vitest/snapshot@2.1.8': - resolution: {integrity: sha512-20T7xRFbmnkfcmgVEz+z3AU/3b0cEzZOt/zmnvZEctg64/QZbSDJEVm9fLnnlSi74KibmRsO9/Qabi+t0vCRPg==} + '@vitest/snapshot@2.1.9': + resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} '@vitest/spy@2.1.8': resolution: {integrity: sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==} + '@vitest/spy@2.1.9': + resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} + '@vitest/utils@2.1.8': resolution: {integrity: sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==} + '@vitest/utils@2.1.9': + resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} + '@webassemblyjs/ast@1.12.1': resolution: {integrity: sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==} @@ -10327,8 +10347,8 @@ packages: victory-vendor@36.9.2: resolution: {integrity: sha512-PnpQQMuxlwYdocC8fIJqVXvkeViHYzotI+NJrCuav0ZYFoq912ZHBk3mCeuj+5/VpodOjPe1z0Fk2ihgzlXqjQ==} - vite-node@2.1.8: - resolution: {integrity: sha512-uPAwSr57kYjAUux+8E2j0q0Fxpn8M9VoyfGiRI8Kfktz9NcYMCenwY5RnZxnF1WTu3TGiYipirIzacLL3VVGFg==} + vite-node@2.1.9: + resolution: {integrity: sha512-AM9aQ/IPrW/6ENLQg3AGY4K1N2TGZdR5e4gu/MmmR2xR3Ll1+dib+nook92g4TV3PXVyeyxdWwtaCAiUL0hMxA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -10374,15 +10394,15 @@ packages: vite: '>=4.5.2' vitest: '>=0.26.2' - vitest@2.1.8: - resolution: {integrity: sha512-1vBKTZskHw/aosXqQUlVWWlGUxSJR8YtiyZDJAFeW2kPAeX6S3Sool0mjspO+kXLuxVWlEDDowBAeqeAQefqLQ==} + vitest@2.1.9: + resolution: {integrity: sha512-MSmPM9REYqDGBI8439mA4mWhV5sKmDlBKWIYbA3lRb2PTHACE0mgKwA8yQ2xq9vxDTuk4iPrECBAEW2aoFXY0Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^20.17.16 - '@vitest/browser': 2.1.8 - '@vitest/ui': 2.1.8 + '@vitest/browser': 2.1.9 + '@vitest/ui': 2.1.9 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -14285,7 +14305,7 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8)': + '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) @@ -14295,7 +14315,7 @@ snapshots: msw: 2.6.5(@types/node@20.17.16)(typescript@5.5.4) sirv: 3.0.0 tinyrainbow: 1.2.0 - vitest: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) ws: 8.18.0 optionalDependencies: playwright: 1.48.2 @@ -14306,7 +14326,7 @@ snapshots: - utf-8-validate - vite - '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8)': + '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) @@ -14316,7 +14336,7 @@ snapshots: msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) sirv: 3.0.0 tinyrainbow: 1.2.0 - vitest: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) ws: 8.18.0 optionalDependencies: playwright: 1.48.2 @@ -14327,7 +14347,7 @@ snapshots: - utf-8-validate - vite - '@vitest/coverage-v8@2.1.8(@vitest/browser@2.1.8)(vitest@2.1.8)': + '@vitest/coverage-v8@2.1.8(@vitest/browser@2.1.8)(vitest@2.1.9)': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -14341,16 +14361,16 @@ snapshots: std-env: 3.8.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) optionalDependencies: - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) transitivePeerDependencies: - supports-color - '@vitest/expect@2.1.8': + '@vitest/expect@2.1.9': dependencies: - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 chai: 5.1.2 tinyrainbow: 1.2.0 @@ -14372,18 +14392,40 @@ snapshots: msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) + '@vitest/mocker@2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))': + dependencies: + '@vitest/spy': 2.1.9 + estree-walker: 3.0.3 + magic-string: 0.30.12 + optionalDependencies: + msw: 2.6.5(@types/node@20.17.16)(typescript@5.5.4) + vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) + + '@vitest/mocker@2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))': + dependencies: + '@vitest/spy': 2.1.9 + estree-walker: 3.0.3 + magic-string: 0.30.12 + optionalDependencies: + msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) + vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) + '@vitest/pretty-format@2.1.8': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.8': + '@vitest/pretty-format@2.1.9': dependencies: - '@vitest/utils': 2.1.8 + tinyrainbow: 1.2.0 + + '@vitest/runner@2.1.9': + dependencies: + '@vitest/utils': 2.1.9 pathe: 1.1.2 - '@vitest/snapshot@2.1.8': + '@vitest/snapshot@2.1.9': dependencies: - '@vitest/pretty-format': 2.1.8 + '@vitest/pretty-format': 2.1.9 magic-string: 0.30.12 pathe: 1.1.2 @@ -14391,12 +14433,22 @@ snapshots: dependencies: tinyspy: 3.0.2 + '@vitest/spy@2.1.9': + dependencies: + tinyspy: 3.0.2 + '@vitest/utils@2.1.8': dependencies: '@vitest/pretty-format': 2.1.8 loupe: 3.1.2 tinyrainbow: 1.2.0 + '@vitest/utils@2.1.9': + dependencies: + '@vitest/pretty-format': 2.1.9 + loupe: 3.1.2 + tinyrainbow: 1.2.0 + '@webassemblyjs/ast@1.12.1': dependencies: '@webassemblyjs/helper-numbers': 1.11.6 @@ -21189,7 +21241,7 @@ snapshots: d3-time: 3.1.0 d3-timer: 3.0.1 - vite-node@2.1.8(@types/node@20.17.16)(terser@5.36.0): + vite-node@2.1.9(@types/node@20.17.16)(terser@5.36.0): dependencies: cac: 6.7.14 debug: 4.3.7 @@ -21217,7 +21269,7 @@ snapshots: fsevents: 2.3.3 terser: 5.36.0 - vitest-dom@0.1.1(vitest@2.1.8): + vitest-dom@0.1.1(vitest@2.1.9): dependencies: aria-query: 5.3.2 chalk: 5.3.0 @@ -21225,23 +21277,23 @@ snapshots: dom-accessibility-api: 0.6.3 lodash-es: 4.17.21 redent: 4.0.0 - vitest: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) - vitest-fail-on-console@0.7.1(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8): + vitest-fail-on-console@0.7.1(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9): dependencies: chalk: 5.3.0 vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - vitest: 2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) - vitest@2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0): + vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0): dependencies: - '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) - '@vitest/pretty-format': 2.1.8 - '@vitest/runner': 2.1.8 - '@vitest/snapshot': 2.1.8 - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 + '@vitest/expect': 2.1.9 + '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.9 + '@vitest/runner': 2.1.9 + '@vitest/snapshot': 2.1.9 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 chai: 5.1.2 debug: 4.3.7 expect-type: 1.1.0 @@ -21253,11 +21305,11 @@ snapshots: tinypool: 1.0.1 tinyrainbow: 1.2.0 vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - vite-node: 2.1.8(@types/node@20.17.16)(terser@5.36.0) + vite-node: 2.1.9(@types/node@20.17.16)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.17.16 - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) jsdom: 25.0.1 transitivePeerDependencies: - less @@ -21270,15 +21322,15 @@ snapshots: - supports-color - terser - vitest@2.1.8(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0): + vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0): dependencies: - '@vitest/expect': 2.1.8 - '@vitest/mocker': 2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) - '@vitest/pretty-format': 2.1.8 - '@vitest/runner': 2.1.8 - '@vitest/snapshot': 2.1.8 - '@vitest/spy': 2.1.8 - '@vitest/utils': 2.1.8 + '@vitest/expect': 2.1.9 + '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) + '@vitest/pretty-format': 2.1.9 + '@vitest/runner': 2.1.9 + '@vitest/snapshot': 2.1.9 + '@vitest/spy': 2.1.9 + '@vitest/utils': 2.1.9 chai: 5.1.2 debug: 4.3.7 expect-type: 1.1.0 @@ -21290,11 +21342,11 @@ snapshots: tinypool: 1.0.1 tinyrainbow: 1.2.0 vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - vite-node: 2.1.8(@types/node@20.17.16)(terser@5.36.0) + vite-node: 2.1.9(@types/node@20.17.16)(terser@5.36.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.17.16 - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.8) + '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) jsdom: 25.0.1 transitivePeerDependencies: - less From f1c165cf3e78d6b25e89093c23a8d34acd8f932b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 5 Feb 2025 08:27:35 +0100 Subject: [PATCH 02/15] Bump @vitest/browser to 2.1.9 [SECURITY] (#4658) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- packages/toolpad-core/package.json | 2 +- pnpm-lock.yaml | 108 ++++++++--------------------- 3 files changed, 30 insertions(+), 82 deletions(-) diff --git a/package.json b/package.json index 203a68eb6ae..b74bf09c90b 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ }, "dependencies": { "@types/lodash": "4.17.15", - "@vitest/browser": "2.1.8", + "@vitest/browser": "2.1.9", "archiver": "7.0.1", "cross-env": "7.0.3", "dotenv-cli": "7.4.4", diff --git a/packages/toolpad-core/package.json b/packages/toolpad-core/package.json index b76d7149707..1c9fadc7508 100644 --- a/packages/toolpad-core/package.json +++ b/packages/toolpad-core/package.json @@ -72,7 +72,7 @@ "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", "@types/sinon": "^17.0.3", - "@vitest/browser": "2.1.8", + "@vitest/browser": "2.1.9", "next": "^15.1.6", "next-router-mock": "^0.9.13", "playwright": "^1.47.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cc17e5220d9..8054a9ce321 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,8 +16,8 @@ importers: specifier: 4.17.15 version: 4.17.15 '@vitest/browser': - specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) + specifier: 2.1.9 + version: 2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) archiver: specifier: 7.0.1 version: 7.0.1 @@ -50,7 +50,7 @@ importers: version: 4.19.2 vitest: specifier: 2.1.9 - version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) yargs: specifier: 17.7.2 version: 17.7.2 @@ -147,7 +147,7 @@ importers: version: 7.18.0(eslint@8.57.1)(typescript@5.5.4) '@vitest/coverage-v8': specifier: 2.1.8 - version: 2.1.8(@vitest/browser@2.1.8)(vitest@2.1.9) + version: 2.1.8(@vitest/browser@2.1.9)(vitest@2.1.9) babel-plugin-react-remove-properties: specifier: 0.3.0 version: 0.3.0 @@ -654,8 +654,8 @@ importers: specifier: ^17.0.3 version: 17.0.3 '@vitest/browser': - specifier: 2.1.8 - version: 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) + specifier: 2.1.9 + version: 2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) next: specifier: ^15.1.6 version: 15.1.6(@babel/core@7.26.0)(@playwright/test@1.47.2)(babel-plugin-macros@3.1.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -673,7 +673,7 @@ importers: version: 19.0.2 vitest: specifier: 2.1.9 - version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) publishDirectory: build packages/toolpad-studio: @@ -1197,7 +1197,7 @@ importers: version: 3.4.3 vitest: specifier: 2.1.9 - version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + version: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) playground/nextjs: devDependencies: @@ -4520,12 +4520,12 @@ packages: peerDependencies: vite: ^4.2.0 || ^5.0.0 || ^6.0.0 - '@vitest/browser@2.1.8': - resolution: {integrity: sha512-OWVvEJThRgxlNMYNVLEK/9qVkpRcLvyuKLngIV3Hob01P56NjPHprVBYn+rx4xAJudbM9yrCrywPIEuA3Xyo8A==} + '@vitest/browser@2.1.9': + resolution: {integrity: sha512-AHDanTP4Ed6J5R6wRBcWRQ+AxgMnNJxsbaa229nFQz5KOMFZqlW11QkIDoLgCjBOpQ1+c78lTN5jVxO8ME+S4w==} peerDependencies: playwright: '*' safaridriver: '*' - vitest: 2.1.8 + vitest: 2.1.9 webdriverio: '*' peerDependenciesMeta: playwright: @@ -4547,17 +4547,6 @@ packages: '@vitest/expect@2.1.9': resolution: {integrity: sha512-UJCIkTBenHeKT1TTlKMJWy1laZewsRIzYighyYiJKZreqtdxSos/S1t+ktRMQWu2CKqaarrkeszJx1cgC5tGZw==} - '@vitest/mocker@2.1.8': - resolution: {integrity: sha512-7guJ/47I6uqfttp33mgo6ga5Gr1VnL58rcqYKyShoRK9ebu8T5Rs6HN3s1NABiBeVTdWNrwUMcHH54uXZBN4zA==} - peerDependencies: - msw: ^2.4.9 - vite: ^5.0.0 - peerDependenciesMeta: - msw: - optional: true - vite: - optional: true - '@vitest/mocker@2.1.9': resolution: {integrity: sha512-tVL6uJgoUdi6icpxmdrn5YNo3g3Dxv+IHJBr0GXHaEdTcw3F+cPKnsXFhli6nO+f/6SDKPHEK1UN+k+TQv0Ehg==} peerDependencies: @@ -4569,9 +4558,6 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.8': - resolution: {integrity: sha512-9HiSZ9zpqNLKlbIDRWOnAWqgcA7xu+8YxXSekhr0Ykab7PAYFkhkwoqVArPOtJhPmYeE2YHgKZlj3CP36z2AJQ==} - '@vitest/pretty-format@2.1.9': resolution: {integrity: sha512-KhRIdGV2U9HOUzxfiHmY8IFHTdqtOhIzCpd8WRdJiE7D/HUcZVD0EgQCVjm+Q9gkUXWgBvMmTtZgIG48wq7sOQ==} @@ -4581,15 +4567,9 @@ packages: '@vitest/snapshot@2.1.9': resolution: {integrity: sha512-oBO82rEjsxLNJincVhLhaxxZdEtV0EFHMK5Kmx5sJ6H9L183dHECjiefOAdnqpIgT5eZwT04PoggUnW88vOBNQ==} - '@vitest/spy@2.1.8': - resolution: {integrity: sha512-5swjf2q95gXeYPevtW0BLk6H8+bPlMb4Vw/9Em4hFxDcaOxS+e0LOX4yqNxoHzMR2akEB2xfpnWUzkZokmgWDg==} - '@vitest/spy@2.1.9': resolution: {integrity: sha512-E1B35FwzXXTs9FHNK6bDszs7mtydNi5MIfUWpceJ8Xbfb1gBMscAnwLbEu+B44ed6W3XjL9/ehLPHR1fkf1KLQ==} - '@vitest/utils@2.1.8': - resolution: {integrity: sha512-dwSoui6djdwbfFmIgbIjX2ZhIoG7Ex/+xpxyiEgIGzjliY8xGkcpITKTlp6B4MgtGkF2ilvm97cPM96XZaAgcA==} - '@vitest/utils@2.1.9': resolution: {integrity: sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==} @@ -14305,17 +14285,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': + '@vitest/browser@2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) - '@vitest/mocker': 2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) - '@vitest/utils': 2.1.8 + '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) + '@vitest/utils': 2.1.9 magic-string: 0.30.12 msw: 2.6.5(@types/node@20.17.16)(typescript@5.5.4) sirv: 3.0.0 tinyrainbow: 1.2.0 - vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) ws: 8.18.0 optionalDependencies: playwright: 1.48.2 @@ -14326,17 +14306,17 @@ snapshots: - utf-8-validate - vite - '@vitest/browser@2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': + '@vitest/browser@2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9)': dependencies: '@testing-library/dom': 10.4.0 '@testing-library/user-event': 14.5.2(@testing-library/dom@10.4.0) - '@vitest/mocker': 2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) - '@vitest/utils': 2.1.8 + '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) + '@vitest/utils': 2.1.9 magic-string: 0.30.12 msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) sirv: 3.0.0 tinyrainbow: 1.2.0 - vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0) ws: 8.18.0 optionalDependencies: playwright: 1.48.2 @@ -14347,7 +14327,7 @@ snapshots: - utf-8-validate - vite - '@vitest/coverage-v8@2.1.8(@vitest/browser@2.1.8)(vitest@2.1.9)': + '@vitest/coverage-v8@2.1.8(@vitest/browser@2.1.9)(vitest@2.1.9)': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 @@ -14361,9 +14341,9 @@ snapshots: std-env: 3.8.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) optionalDependencies: - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) + '@vitest/browser': 2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) transitivePeerDependencies: - supports-color @@ -14374,24 +14354,6 @@ snapshots: chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))': - dependencies: - '@vitest/spy': 2.1.8 - estree-walker: 3.0.3 - magic-string: 0.30.12 - optionalDependencies: - msw: 2.6.5(@types/node@20.17.16)(typescript@5.5.4) - vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - - '@vitest/mocker@2.1.8(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))': - dependencies: - '@vitest/spy': 2.1.8 - estree-walker: 3.0.3 - magic-string: 0.30.12 - optionalDependencies: - msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) - vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - '@vitest/mocker@2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))': dependencies: '@vitest/spy': 2.1.9 @@ -14410,10 +14372,6 @@ snapshots: msw: 2.6.5(@types/node@20.17.16)(typescript@5.7.2) vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - '@vitest/pretty-format@2.1.8': - dependencies: - tinyrainbow: 1.2.0 - '@vitest/pretty-format@2.1.9': dependencies: tinyrainbow: 1.2.0 @@ -14429,20 +14387,10 @@ snapshots: magic-string: 0.30.12 pathe: 1.1.2 - '@vitest/spy@2.1.8': - dependencies: - tinyspy: 3.0.2 - '@vitest/spy@2.1.9': dependencies: tinyspy: 3.0.2 - '@vitest/utils@2.1.8': - dependencies: - '@vitest/pretty-format': 2.1.8 - loupe: 3.1.2 - tinyrainbow: 1.2.0 - '@vitest/utils@2.1.9': dependencies: '@vitest/pretty-format': 2.1.9 @@ -21277,15 +21225,15 @@ snapshots: dom-accessibility-api: 0.6.3 lodash-es: 4.17.21 redent: 4.0.0 - vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) vitest-fail-on-console@0.7.1(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9): dependencies: chalk: 5.3.0 vite: 5.4.12(@types/node@20.17.16)(terser@5.36.0) - vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) + vitest: 2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0) - vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0): + vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(terser@5.36.0): dependencies: '@vitest/expect': 2.1.9 '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.5.4))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) @@ -21309,7 +21257,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.17.16 - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) + '@vitest/browser': 2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.5.4)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) jsdom: 25.0.1 transitivePeerDependencies: - less @@ -21322,7 +21270,7 @@ snapshots: - supports-color - terser - vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.8)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0): + vitest@2.1.9(@types/node@20.17.16)(@vitest/browser@2.1.9)(jsdom@25.0.1)(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(terser@5.36.0): dependencies: '@vitest/expect': 2.1.9 '@vitest/mocker': 2.1.9(msw@2.6.5(@types/node@20.17.16)(typescript@5.7.2))(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0)) @@ -21346,7 +21294,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.17.16 - '@vitest/browser': 2.1.8(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) + '@vitest/browser': 2.1.9(@types/node@20.17.16)(playwright@1.48.2)(typescript@5.7.2)(vite@5.4.12(@types/node@20.17.16)(terser@5.36.0))(vitest@2.1.9) jsdom: 25.0.1 transitivePeerDependencies: - less From 717543c22b386803d4ce3ac83ff5cf676b84d2e0 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Wed, 5 Feb 2025 12:31:51 +0100 Subject: [PATCH 03/15] [docs] Fix typos (#4660) Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> --- docs/data/toolpad/studio/concepts/custom-server.md | 2 +- docs/data/toolpad/studio/concepts/deployment.md | 2 +- docs/data/toolpad/studio/concepts/page-properties.md | 4 ++-- docs/data/toolpad/studio/concepts/queries.md | 4 ++-- .../data/toolpad/studio/how-to-guides/connect-to-databases.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/data/toolpad/studio/concepts/custom-server.md b/docs/data/toolpad/studio/concepts/custom-server.md index 4a3ec5389ed..b6054577568 100644 --- a/docs/data/toolpad/studio/concepts/custom-server.md +++ b/docs/data/toolpad/studio/concepts/custom-server.md @@ -33,7 +33,7 @@ app.use('/my-app', handler); app.listen(3001); ``` -To run the custom server you'll have to update the scripts in your your package.json +To run the custom server you'll have to update the scripts in your package.json ```json { diff --git a/docs/data/toolpad/studio/concepts/deployment.md b/docs/data/toolpad/studio/concepts/deployment.md index f217eb9dd51..91f3680f83b 100644 --- a/docs/data/toolpad/studio/concepts/deployment.md +++ b/docs/data/toolpad/studio/concepts/deployment.md @@ -18,7 +18,7 @@ ## Install step -Install required depdencies via: +Install required dependencies via: diff --git a/docs/data/toolpad/studio/concepts/page-properties.md b/docs/data/toolpad/studio/concepts/page-properties.md index 31ce9a23625..424f75ae845 100644 --- a/docs/data/toolpad/studio/concepts/page-properties.md +++ b/docs/data/toolpad/studio/concepts/page-properties.md @@ -8,7 +8,7 @@ ### Options -The possible options for the the display mode are: +The possible options for the display mode are: - **App shell**: Pages with their display mode set to this value will render within the navigation sidebar on the left, allowing for easy navigation between all pages. @@ -52,7 +52,7 @@ Page parameters allow you to pass external data into the Toolpad Studio page sta ### Setting parameters -You can set page parameters from the Page tab in the **Inspector panel** on right. You can add multiple parameters along with a default value for each. +You can set page parameters from the Page tab in the **Inspector panel** on the right. You can add multiple parameters along with a default value for each. ### Using parameters diff --git a/docs/data/toolpad/studio/concepts/queries.md b/docs/data/toolpad/studio/concepts/queries.md index 0bf82c26492..92692b91789 100644 --- a/docs/data/toolpad/studio/concepts/queries.md +++ b/docs/data/toolpad/studio/concepts/queries.md @@ -24,7 +24,7 @@ Queries allow you to bring backend data to your Toolpad Studio page. They are ca You can use this option to enable or disable the query from running -Queries may be programatically re-fetched via the `refetch` function available on these query objects. For example, for a query named `getOrders`, you can add +Queries may be programmatically re-fetched via the `refetch` function available on these query objects. For example, for a query named `getOrders`, you can add ```js getOrders.refetch(); @@ -34,7 +34,7 @@ in the `onClick` binding of a Button component. ## Actions -Actions allow performing updates to remote data sources (edit, update, delete) on a user interaction. Actions are not automatically called, they must be programtically called a JavaScript expression in a binding. For example, for a query named `createCustomer`, we can add +Actions allow performing updates to remote data sources (edit, update, delete) on a user interaction. Actions are not automatically called, they must be programmatically called a JavaScript expression in a binding. For example, for a query named `createCustomer`, we can add ```js createCustomer.call(); diff --git a/docs/data/toolpad/studio/how-to-guides/connect-to-databases.md b/docs/data/toolpad/studio/how-to-guides/connect-to-databases.md index 92ce1bb6811..869776ba18d 100644 --- a/docs/data/toolpad/studio/how-to-guides/connect-to-databases.md +++ b/docs/data/toolpad/studio/how-to-guides/connect-to-databases.md @@ -3,7 +3,7 @@

Toolpad Studio allows you to connect to any database, fast.

You can write a custom function to connect to any database that you need to. -You can focus on writing database queries, while the data fetching and displaying is handled by Toolpad Studio. +You can focus on writing database queries, while the data fetching and displaying are handled by Toolpad Studio. ## Connecting to MySQL From 576be7c338adeaed5356422e2a9a99e2a3e3d717 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Wed, 5 Feb 2025 23:54:36 +0100 Subject: [PATCH 04/15] [core] Page should have h1 (#4641) --- packages/toolpad-core/src/SignInPage/SignInPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/toolpad-core/src/SignInPage/SignInPage.tsx b/packages/toolpad-core/src/SignInPage/SignInPage.tsx index 5a5c489d992..8789ced513c 100644 --- a/packages/toolpad-core/src/SignInPage/SignInPage.tsx +++ b/packages/toolpad-core/src/SignInPage/SignInPage.tsx @@ -332,6 +332,7 @@ function SignInPage(props: SignInPageProps) { ) : ( Date: Mon, 10 Feb 2025 09:17:41 +0100 Subject: [PATCH 05/15] fix: typos in documentation files (#4666) Signed-off-by: Maxim Evtush <154841002+maximevtush@users.noreply.github.com> --- examples/core/auth-nextjs-email/README.md | 2 +- test/integration/data-grid/custom.spec.ts | 2 +- test/integration/undo-redo/basic.spec.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/core/auth-nextjs-email/README.md b/examples/core/auth-nextjs-email/README.md index 5b8b2c95b21..804f8ed65b9 100644 --- a/examples/core/auth-nextjs-email/README.md +++ b/examples/core/auth-nextjs-email/README.md @@ -20,7 +20,7 @@ docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgre npx prisma migrate dev --schema=./src/prisma/schema.prisma ``` -5. You also need to supply the following enviroment variables for the email server to work: +5. You also need to supply the following environment variables for the email server to work: ```bash EMAIL_SERVER_HOST= diff --git a/test/integration/data-grid/custom.spec.ts b/test/integration/data-grid/custom.spec.ts index ea5b953319a..d2629327805 100644 --- a/test/integration/data-grid/custom.spec.ts +++ b/test/integration/data-grid/custom.spec.ts @@ -29,7 +29,7 @@ test('Code component cell', async ({ page }) => { ).toBeVisible(); await expect(editorModel.pageRoot.getByText('field: "customField"')).toBeVisible(); - // Can use cusom component for id field + // Can use custom component for id field await expect(editorModel.pageRoot.getByText('[id:0]')).toBeVisible(); }); diff --git a/test/integration/undo-redo/basic.spec.ts b/test/integration/undo-redo/basic.spec.ts index 444f97c6422..3dc6c557cb7 100644 --- a/test/integration/undo-redo/basic.spec.ts +++ b/test/integration/undo-redo/basic.spec.ts @@ -77,6 +77,6 @@ test('test batching text input actions into single undo entry', async ({ page }) // Undo changes await page.keyboard.press('Control+Z'); - // Asssert that batched changes were reverted + // Assert that batched changes were reverted await expect(input).toHaveValue('some value'); }); From 9ed67d0cb78421d86854d846542ef402b8276a05 Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Mon, 10 Feb 2025 23:49:20 -0800 Subject: [PATCH 06/15] [docx] Fix codeblock typo (#4668) --- docs/data/toolpad/core/integrations/react-router.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/data/toolpad/core/integrations/react-router.md b/docs/data/toolpad/core/integrations/react-router.md index 933af08b05d..7547a810d67 100644 --- a/docs/data/toolpad/core/integrations/react-router.md +++ b/docs/data/toolpad/core/integrations/react-router.md @@ -334,7 +334,7 @@ import DashboardIcon from '@mui/icons-material/Dashboard'; import ShoppingCartIcon from '@mui/icons-material/ShoppingCart'; import { ReactRouterAppProvider } from '@toolpad/core/react-router'; import { Outlet, useNavigate } from 'react-router'; -import type { Navigation, Session } from '@toolpad/core'; +import type { Navigation } from '@toolpad/core'; import { firebaseSignOut, signInWithGoogle, From b7077eb31658a8be7131b123e99621e79f2cb142 Mon Sep 17 00:00:00 2001 From: Prakhar Gupta <92228082+prakhargupta1@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:51:17 +0530 Subject: [PATCH 07/15] [docs] Remove the planned components (#4667) --- docs/data/toolpad/core/pages.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/data/toolpad/core/pages.ts b/docs/data/toolpad/core/pages.ts index 4e8d6831433..d178c4b369e 100644 --- a/docs/data/toolpad/core/pages.ts +++ b/docs/data/toolpad/core/pages.ts @@ -84,11 +84,6 @@ const pages: MuiPage[] = [ pathname: '/toolpad/core/react-page-container', title: 'Page Container', }, - { - pathname: '/toolpad/core/react-notification-center', - title: 'Notification Center', - planned: true, - }, ], }, { @@ -103,16 +98,6 @@ const pages: MuiPage[] = [ pathname: '/toolpad/core/react-account', title: 'Account', }, - { - pathname: '/toolpad/core/react-sign-up-page', - title: 'Sign-up Page', - planned: true, - }, - { - pathname: '/toolpad/core/react-rbac', - title: 'RBAC', - planned: true, - }, ], }, { @@ -124,11 +109,6 @@ const pages: MuiPage[] = [ title: 'CRUD', planned: true, }, - { - pathname: '/toolpad/core/react-stat-card', - title: 'Stats Card', - planned: true, - }, ], }, { From 3967dce65921f847cee0b3abbd9c754a985204dd Mon Sep 17 00:00:00 2001 From: Gil Obradors Date: Tue, 11 Feb 2025 10:15:49 +0100 Subject: [PATCH 08/15] [DashboardLayout] link `line-heigth` to `font-size` in `AppTitle` (#4648) Signed-off-by: Gil Obradors --- packages/toolpad-core/src/DashboardLayout/AppTitle.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/toolpad-core/src/DashboardLayout/AppTitle.tsx b/packages/toolpad-core/src/DashboardLayout/AppTitle.tsx index e0876019187..4c393e01b51 100644 --- a/packages/toolpad-core/src/DashboardLayout/AppTitle.tsx +++ b/packages/toolpad-core/src/DashboardLayout/AppTitle.tsx @@ -37,6 +37,7 @@ export function AppTitle(props: AppTitleProps) { fontWeight: '700', ml: 1, whiteSpace: 'nowrap', + lineHeight: 1, }} > {title} From 09a1f82978a81586224fc524c9558c86e36dffea Mon Sep 17 00:00:00 2001 From: Remi Kristelijn Date: Tue, 11 Feb 2025 11:19:48 +0100 Subject: [PATCH 09/15] fix: package.json pretty print Closes #4643 (#4644) Co-authored-by: Bharat Kashyap --- packages/create-toolpad-app/src/generateProject.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-toolpad-app/src/generateProject.ts b/packages/create-toolpad-app/src/generateProject.ts index 0ea3b8e7641..82f9b3d9cb1 100644 --- a/packages/create-toolpad-app/src/generateProject.ts +++ b/packages/create-toolpad-app/src/generateProject.ts @@ -62,7 +62,7 @@ export default function generateProject( [ 'package.json', { - content: JSON.stringify(packageJson(options)), + content: JSON.stringify(packageJson(options), null, 2), }, ], ]); From d27e3a984bc482c2927a9a56baa07dfdab4a7c55 Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Tue, 11 Feb 2025 23:11:51 -0800 Subject: [PATCH 10/15] [docs] Improve outdated installation instructions (#4633) --- .../toolpad/core/introduction/installation.md | 67 +++++++++++++------ 1 file changed, 47 insertions(+), 20 deletions(-) diff --git a/docs/data/toolpad/core/introduction/installation.md b/docs/data/toolpad/core/introduction/installation.md index a53251c4146..64cf7873af3 100644 --- a/docs/data/toolpad/core/introduction/installation.md +++ b/docs/data/toolpad/core/introduction/installation.md @@ -64,7 +64,7 @@ yarn create toolpad-app
-2. Follow the instructions presented. Once the installation ends, run: +2. You will be asked to choose amongst your preferred frameworks (Next.js/Vite), routers and authentication providers. Once the installation ends, run: @@ -87,28 +87,55 @@ yarn dev 3. Visit **http://localhost:3000/** in your browser to open the application. -4. The CLI bootstraps the following directory: +4. A sample directory structure with the Next.js App router will look like this: - ```bash - ├── app - │ ├── auth - │ ├──── [...path] - │ └────── page.tsx - │ ├── api - │ ├──── auth - │ ├────── [...nextAuth] - │ └───────── route.tsx - │ ├── (dashboard) - | ├──── layout.tsx - │ ├──── page - │ └────── page.tsx - ├──── layout.tsx - └──── page.tsx + **Without Authentication:** + ```bash + ├── app + │ ├── (dashboard) + │ │ ├── layout.tsx + │ │ ├── page.tsx + │ │ └── orders + │ │ └── page.tsx + │ └── layout.tsx + ├── .env + ├── .env.local + ├── .eslintrc.json + ├── .gitignore + ├── next.config.js + ├── package.json + ├── README.md + └── tsconfig.json ``` - and the following page appears when you run the project locally: + **With Authentication:** + + ```bash + ├── app + │ ├── auth + │ │ └── signin + │ │ └── page.tsx + │ ├── api + │ │ └── auth + │ │ └── [...nextauth] + │ │ └── route.ts + │ ├── (dashboard) + │ │ ├── layout.tsx + │ │ ├── page.tsx + │ │ └── orders + │ │ └── page.tsx + │ └── layout.tsx + ├── .env + ├── .env.local + ├── .eslintrc.json + ├── .gitignore + ├── next.config.js + ├── package.json + ├── README.md + └── tsconfig.json + ``` -{{"component": "modules/components/DocsImage.tsx", "src": "/static/toolpad/docs/core/bootstrap.png", "srcDark": "/static/toolpad/docs/core/bootstrap-dark.png","alt": "Toolpad Core entry point", "caption": "Starting with Toolpad Core", "zoom": true, "indent": 1 }} +5. Installation is complete! Begin building your project by making edits to `(dashboard)/page.tsx`. To understand how to leverage Toolpad Core to build dashboards quickly, [see the detailed tutorial](/toolpad/core/introduction/tutorial/). -5. Installation is complete! Begin building your project by making edits to `(dashboard)/page/page.tsx`. To understand how to leverage Toolpad Core to build dashboards quickly, [see the detailed tutorial](/toolpad/core/introduction/tutorial/). +6. If you selected authentication, you will need to provide values to the `.env` files that have been created. See more information on the [usage with authentication libraries section](https://mui.com/toolpad/core/react-sign-in-page/#usage-with-authentication-libraries). From e145f124d3237ef7c4f164a26bfed1d92f8f93d6 Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Tue, 11 Feb 2025 23:12:46 -0800 Subject: [PATCH 11/15] [docs] Add CLI install instructions to docs (#4639) --- .../toolpad/core/introduction/examples.md | 20 ++++ .../toolpad/core/introduction/tutorial.md | 2 +- .../components/examples/ExamplesFeatured.tsx | 29 +++++ .../components/examples/ExamplesGrid.tsx | 107 +++++++++++------- examples/core/auth-nextjs-email/README.md | 2 +- .../auth-nextjs-pages-nextauth-4/README.md | 2 +- examples/core/auth-nextjs-pages/README.md | 2 +- examples/core/auth-nextjs-passkey/README.md | 2 +- examples/core/auth-nextjs-themed/README.md | 2 +- examples/core/auth-nextjs/README.md | 2 +- examples/core/auth-vite/README.md | 2 +- examples/core/firebase-vite/README.md | 2 +- examples/core/tutorial/README.md | 2 +- examples/core/vite/README.md | 2 +- pnpm-lock.yaml | 8 +- 15 files changed, 132 insertions(+), 54 deletions(-) diff --git a/docs/data/toolpad/core/introduction/examples.md b/docs/data/toolpad/core/introduction/examples.md index 975af850692..587a877e407 100644 --- a/docs/data/toolpad/core/introduction/examples.md +++ b/docs/data/toolpad/core/introduction/examples.md @@ -7,6 +7,26 @@ title: Examples

Browse a collection of Toolpad Core examples to help you get started quickly.

+## Installation + +You can create a new project based on any of these examples using the `create-toolpad-app` command: + + + +```bash npm +npx create-toolpad-app@latest --example "example-name" +``` + +```bash pnpm +pnpm create toolpad-app --example "example-name" +``` + +```bash yarn +yarn create toolpad-app --example "example-name" +``` + + + ## Featured examples {{"component": "modules/components/examples/CoreFeaturedExamples.tsx"}} diff --git a/docs/data/toolpad/core/introduction/tutorial.md b/docs/data/toolpad/core/introduction/tutorial.md index 2da0269d33c..8cae1c5e245 100644 --- a/docs/data/toolpad/core/introduction/tutorial.md +++ b/docs/data/toolpad/core/introduction/tutorial.md @@ -19,7 +19,7 @@ npx create-toolpad-app@latest --example tutorial ``` ```bash pnpm -pnpm dlx create toolpad-app --example tutorial +pnpm create toolpad-app --example tutorial ``` ```bash yarn diff --git a/docs/src/modules/components/examples/ExamplesFeatured.tsx b/docs/src/modules/components/examples/ExamplesFeatured.tsx index 96015ca917d..38026a299ee 100644 --- a/docs/src/modules/components/examples/ExamplesFeatured.tsx +++ b/docs/src/modules/components/examples/ExamplesFeatured.tsx @@ -15,6 +15,9 @@ import CodeRoundedIcon from '@mui/icons-material/CodeRounded'; import OpenInNewRoundedIcon from '@mui/icons-material/OpenInNewRounded'; import { useTheme } from '@mui/material/styles'; import { sxChip } from 'docs/src/modules/components/AppNavDrawerItem'; +import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'; +import CheckRounded from '@mui/icons-material/CheckRounded'; +import copy from 'clipboard-copy'; import { Example, versionGitHubLink } from './examplesUtils'; interface FeaturedExamplesProps { @@ -23,6 +26,13 @@ interface FeaturedExamplesProps { export default function ExamplesFeatured(props: FeaturedExamplesProps) { const t = useTranslate(); + const [copiedId, setCopiedId] = React.useState(null); + + const handleCopy = React.useCallback((text: string, id: string) => { + copy(text); + setCopiedId(id); + setTimeout(() => setCopiedId(null), 2000); + }, []); const examples = props.examples.filter((example: Example) => example.featured === true); const docsTheme = useTheme(); @@ -32,6 +42,9 @@ export default function ExamplesFeatured(props: FeaturedExamplesProps) { {examples.map((example: Example) => { const computedSrc = docsTheme?.palette?.mode === 'dark' && example.srcDark ? example.srcDark : example.src; + const exampleName = example.source.split('/').pop(); + const installCommand = `pnpm create toolpad-app --example ${exampleName}`; + return ( @@ -160,6 +173,22 @@ export default function ExamplesFeatured(props: FeaturedExamplesProps) { + + + - - {example.stackBlitz === true ? ( - - - - - - ) : null} - {example.codeSandbox === true ? ( - - - - - - ) : null} - + + + + + + + {example.stackBlitz === true ? ( + + + + + + ) : null} + + {example.codeSandbox === true ? ( + + + + + + ) : null} + + + { + handleCopy(installCommand, example.title); + }} + > + {copiedId === example.title ? ( + + ) : ( + + )} + + diff --git a/examples/core/auth-nextjs-email/README.md b/examples/core/auth-nextjs-email/README.md index 804f8ed65b9..32a708341eb 100644 --- a/examples/core/auth-nextjs-email/README.md +++ b/examples/core/auth-nextjs-email/README.md @@ -51,7 +51,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-nextjs-email # or -pnpm dlx create-toolpad-app --example auth-nextjs-email +pnpm create toolpad-app --example auth-nextjs-email ``` and follow the instructions in the terminal. diff --git a/examples/core/auth-nextjs-pages-nextauth-4/README.md b/examples/core/auth-nextjs-pages-nextauth-4/README.md index 77aebd49469..e4012aa91bc 100644 --- a/examples/core/auth-nextjs-pages-nextauth-4/README.md +++ b/examples/core/auth-nextjs-pages-nextauth-4/README.md @@ -25,7 +25,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-nextjs-pages-nextauth-4 # or -pnpm dlx create-toolpad-app --example auth-nextjs-pages-nextauth-4 +pnpm create toolpad-app --example auth-nextjs-pages-nextauth-4 ``` and follow the instructions in the terminal. diff --git a/examples/core/auth-nextjs-pages/README.md b/examples/core/auth-nextjs-pages/README.md index 7657d8d54a2..eb51ac7da78 100644 --- a/examples/core/auth-nextjs-pages/README.md +++ b/examples/core/auth-nextjs-pages/README.md @@ -47,7 +47,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-nextjs-pages # or -pnpm dlx create-toolpad-app --example auth-nextjs-pages +pnpm create toolpad-app --example auth-nextjs-pages ``` and follow the instructions in the terminal. diff --git a/examples/core/auth-nextjs-passkey/README.md b/examples/core/auth-nextjs-passkey/README.md index 83f5b255091..a047667c976 100644 --- a/examples/core/auth-nextjs-passkey/README.md +++ b/examples/core/auth-nextjs-passkey/README.md @@ -41,7 +41,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-nextjs-passkey # or -pnpm dlx create-toolpad-app --example auth-nextjs-passkey +pnpm create toolpad-app --example auth-nextjs-passkey ``` and follow the instructions in the terminal. diff --git a/examples/core/auth-nextjs-themed/README.md b/examples/core/auth-nextjs-themed/README.md index bfa85485846..7f7d0161f09 100644 --- a/examples/core/auth-nextjs-themed/README.md +++ b/examples/core/auth-nextjs-themed/README.md @@ -25,7 +25,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-nextjs-themed # or -pnpm dlx create-toolpad-app --example auth-nextjs-themed +pnpm create toolpad-app --example auth-nextjs-themed ``` and follow the instructions in the terminal. diff --git a/examples/core/auth-nextjs/README.md b/examples/core/auth-nextjs/README.md index d14529ee516..ab74ab1942a 100644 --- a/examples/core/auth-nextjs/README.md +++ b/examples/core/auth-nextjs/README.md @@ -35,7 +35,7 @@ GITHUB_CLIENT_SECRET= ```bash npx auth secret # or -pnpm dlx create-toolpad-app --example auth-nextjs +pnpm create toolpad-app --example auth-nextjs ``` ### GitHub configuration diff --git a/examples/core/auth-vite/README.md b/examples/core/auth-vite/README.md index fb547a323e5..7383208c58e 100644 --- a/examples/core/auth-vite/README.md +++ b/examples/core/auth-vite/README.md @@ -9,7 +9,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example auth-vite # or -pnpm dlx create-toolpad-app --example auth-vite +pnpm create toolpad-app --example auth-vite ``` ## Getting Started diff --git a/examples/core/firebase-vite/README.md b/examples/core/firebase-vite/README.md index 776f5774572..65eeb1ab3e2 100644 --- a/examples/core/firebase-vite/README.md +++ b/examples/core/firebase-vite/README.md @@ -9,7 +9,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example firebase-vite # or -pnpm dlx create-toolpad-app --example firebase-vite +pnpm create toolpad-app --example firebase-vite ``` ## Setting up diff --git a/examples/core/tutorial/README.md b/examples/core/tutorial/README.md index fe43dc017bf..8f8045d42d1 100644 --- a/examples/core/tutorial/README.md +++ b/examples/core/tutorial/README.md @@ -25,7 +25,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example tutorial # or -pnpm dlx create-toolpad-app --example tutorial +pnpm create toolpad-app --example tutorial ``` and follow the instructions in the terminal. diff --git a/examples/core/vite/README.md b/examples/core/vite/README.md index 99dceef9a44..8a5982080bd 100644 --- a/examples/core/vite/README.md +++ b/examples/core/vite/README.md @@ -9,7 +9,7 @@ To copy this example and customize it for your needs, run ```bash npx create-toolpad-app@latest --example vite # or -pnpm dlx create-toolpad-app --example vite +pnpm create toolpad-app --example vite ``` and follow the instructions in the terminal. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8054a9ce321..e61f0eb987f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -201,7 +201,7 @@ importers: version: 7.37.4(eslint@8.57.1) eslint-plugin-react-compiler: specifier: latest - version: 19.0.0-beta-714736e-20250131(eslint@8.57.1) + version: 19.0.0-beta-30d8a17-20250209(eslint@8.57.1) eslint-plugin-react-hooks: specifier: 5.1.0 version: 5.1.0(eslint@8.57.1) @@ -6092,8 +6092,8 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-plugin-react-compiler@19.0.0-beta-714736e-20250131: - resolution: {integrity: sha512-iTPUaHzvBejGqicSwZLCDBgWBxLzU1Dvqjs31loNoOPRnsey5dcOupaZajECKVvXmB1wcbIWNp6/VR5+dM9d6w==} + eslint-plugin-react-compiler@19.0.0-beta-30d8a17-20250209: + resolution: {integrity: sha512-D2wohyvsW27KSQV8IhyjL9UhYKs4f7Y8WPIuNOeiYylOaredvb2vW/AAE2m36BWLsn3Q9xRYz1UZj2AXR15w/g==} engines: {node: ^14.17.0 || ^16.0.0 || >= 18.0.0} peerDependencies: eslint: '>=7' @@ -16287,7 +16287,7 @@ snapshots: globals: 13.24.0 rambda: 7.5.0 - eslint-plugin-react-compiler@19.0.0-beta-714736e-20250131(eslint@8.57.1): + eslint-plugin-react-compiler@19.0.0-beta-30d8a17-20250209(eslint@8.57.1): dependencies: '@babel/core': 7.26.0 '@babel/parser': 7.26.2 From 27a24347d9b3bbe12fe62469e78441244861ed3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 09:28:07 +0100 Subject: [PATCH 12/15] Bump esbuild to 0.25.0 [SECURITY] (#4671) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/toolpad-studio/package.json | 2 +- pnpm-lock.yaml | 317 ++++++++++++++++++++++++++- 2 files changed, 309 insertions(+), 10 deletions(-) diff --git a/packages/toolpad-studio/package.json b/packages/toolpad-studio/package.json index 7fb23d76216..cd3b6115f07 100644 --- a/packages/toolpad-studio/package.json +++ b/packages/toolpad-studio/package.json @@ -99,7 +99,7 @@ "csstype": "3.1.3", "dayjs": "1.11.13", "dotenv": "16.4.7", - "esbuild": "0.24.2", + "esbuild": "0.25.0", "execa": "9.5.2", "express": "4.21.2", "find-up": "7.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e61f0eb987f..ab76d3acb40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -808,8 +808,8 @@ importers: specifier: 16.4.7 version: 16.4.7 esbuild: - specifier: 0.24.2 - version: 0.24.2 + specifier: 0.25.0 + version: 0.25.0 execa: specifier: 9.5.2 version: 9.5.2 @@ -896,7 +896,7 @@ importers: version: 19.0.0 react-dev-utils: specifier: 12.0.1 - version: 12.0.1(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.24.2)) + version: 12.0.1(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.25.0)) react-dom: specifier: ^19.0.0 version: 19.0.0(react@19.0.0) @@ -1035,7 +1035,7 @@ importers: version: 4.4.5(react-dom@19.0.0(react@19.0.0))(react@19.0.0) webpack: specifier: 5.96.1 - version: 5.96.1(esbuild@0.24.2) + version: 5.96.1(esbuild@0.25.0) packages/toolpad-studio-components: dependencies: @@ -2240,6 +2240,12 @@ packages: cpu: [ppc64] os: [aix] + '@esbuild/aix-ppc64@0.25.0': + resolution: {integrity: sha512-O7vun9Sf8DFjH2UtqK8Ku3LkquL9SZL8OLY1T5NZkA34+wG3OQF7cl4Ql8vdNzM6fzBbYfLaiRLIOZ+2FOCgBQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.21.5': resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==} engines: {node: '>=12'} @@ -2258,6 +2264,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.25.0': + resolution: {integrity: sha512-grvv8WncGjDSyUBjN9yHXNt+cq0snxXbDxy5pJtzMKGmmpPxeAmAhWxXI+01lU5rwZomDgD3kJwulEnhTRUd6g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.21.5': resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==} engines: {node: '>=12'} @@ -2276,6 +2288,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.25.0': + resolution: {integrity: sha512-PTyWCYYiU0+1eJKmw21lWtC+d08JDZPQ5g+kFyxP0V+es6VPPSUhM6zk8iImp2jbV6GwjX4pap0JFbUQN65X1g==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.21.5': resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==} engines: {node: '>=12'} @@ -2294,6 +2312,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.25.0': + resolution: {integrity: sha512-m/ix7SfKG5buCnxasr52+LI78SQ+wgdENi9CqyCXwjVR2X4Jkz+BpC3le3AoBPYTC9NHklwngVXvbJ9/Akhrfg==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.21.5': resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==} engines: {node: '>=12'} @@ -2312,6 +2336,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.25.0': + resolution: {integrity: sha512-mVwdUb5SRkPayVadIOI78K7aAnPamoeFR2bT5nszFUZ9P8UpK4ratOdYbZZXYSqPKMHfS1wdHCJk1P1EZpRdvw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.21.5': resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==} engines: {node: '>=12'} @@ -2330,6 +2360,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.25.0': + resolution: {integrity: sha512-DgDaYsPWFTS4S3nWpFcMn/33ZZwAAeAFKNHNa1QN0rI4pUjgqf0f7ONmXf6d22tqTY+H9FNdgeaAa+YIFUn2Rg==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.21.5': resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==} engines: {node: '>=12'} @@ -2348,6 +2384,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.25.0': + resolution: {integrity: sha512-VN4ocxy6dxefN1MepBx/iD1dH5K8qNtNe227I0mnTRjry8tj5MRk4zprLEdG8WPyAPb93/e4pSgi1SoHdgOa4w==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.21.5': resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==} engines: {node: '>=12'} @@ -2366,6 +2408,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.25.0': + resolution: {integrity: sha512-mrSgt7lCh07FY+hDD1TxiTyIHyttn6vnjesnPoVDNmDfOmggTLXRv8Id5fNZey1gl/V2dyVK1VXXqVsQIiAk+A==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.21.5': resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==} engines: {node: '>=12'} @@ -2384,6 +2432,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.25.0': + resolution: {integrity: sha512-9QAQjTWNDM/Vk2bgBl17yWuZxZNQIF0OUUuPZRKoDtqF2k4EtYbpyiG5/Dk7nqeK6kIJWPYldkOcBqjXjrUlmg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.21.5': resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} @@ -2402,6 +2456,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.25.0': + resolution: {integrity: sha512-vkB3IYj2IDo3g9xX7HqhPYxVkNQe8qTK55fraQyTzTX/fxaDtXiEnavv9geOsonh2Fd2RMB+i5cbhu2zMNWJwg==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.21.5': resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==} engines: {node: '>=12'} @@ -2420,6 +2480,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.25.0': + resolution: {integrity: sha512-43ET5bHbphBegyeqLb7I1eYn2P/JYGNmzzdidq/w0T8E2SsYL1U6un2NFROFRg1JZLTzdCoRomg8Rvf9M6W6Gg==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.21.5': resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==} engines: {node: '>=12'} @@ -2438,6 +2504,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.25.0': + resolution: {integrity: sha512-fC95c/xyNFueMhClxJmeRIj2yrSMdDfmqJnyOY4ZqsALkDrrKJfIg5NTMSzVBr5YW1jf+l7/cndBfP3MSDpoHw==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.21.5': resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==} engines: {node: '>=12'} @@ -2456,6 +2528,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.25.0': + resolution: {integrity: sha512-nkAMFju7KDW73T1DdH7glcyIptm95a7Le8irTQNO/qtkoyypZAnjchQgooFUDQhNAy4iu08N79W4T4pMBwhPwQ==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.21.5': resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==} engines: {node: '>=12'} @@ -2474,6 +2552,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.25.0': + resolution: {integrity: sha512-NhyOejdhRGS8Iwv+KKR2zTq2PpysF9XqY+Zk77vQHqNbo/PwZCzB5/h7VGuREZm1fixhs4Q/qWRSi5zmAiO4Fw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.21.5': resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==} engines: {node: '>=12'} @@ -2492,6 +2576,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.25.0': + resolution: {integrity: sha512-5S/rbP5OY+GHLC5qXp1y/Mx//e92L1YDqkiBbO9TQOvuFXM+iDqUNG5XopAnXoRH3FjIUDkeGcY1cgNvnXp/kA==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.21.5': resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==} engines: {node: '>=12'} @@ -2510,6 +2600,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.25.0': + resolution: {integrity: sha512-XM2BFsEBz0Fw37V0zU4CXfcfuACMrppsMFKdYY2WuTS3yi8O1nFOhil/xhKTmE1nPmVyvQJjJivgDT+xh8pXJA==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.21.5': resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==} engines: {node: '>=12'} @@ -2528,12 +2624,24 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.25.0': + resolution: {integrity: sha512-9yl91rHw/cpwMCNytUDxwj2XjFpxML0y9HAOH9pNVQDpQrBxHy01Dx+vaMu0N1CKa/RzBD2hB4u//nfc+Sd3Cw==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-arm64@0.24.2': resolution: {integrity: sha512-wuLK/VztRRpMt9zyHSazyCVdCXlpHkKm34WUyinD2lzK07FAHTq0KQvZZlXikNWkDGoT6x3TD51jKQ7gMVpopw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] + '@esbuild/netbsd-arm64@0.25.0': + resolution: {integrity: sha512-RuG4PSMPFfrkH6UwCAqBzauBWTygTvb1nxWasEJooGSJ/NwRw7b2HOwyRTQIU97Hq37l3npXoZGYMy3b3xYvPw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + '@esbuild/netbsd-x64@0.21.5': resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==} engines: {node: '>=12'} @@ -2552,6 +2660,12 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.25.0': + resolution: {integrity: sha512-jl+qisSB5jk01N5f7sPCsBENCOlPiS/xptD5yxOx2oqQfyourJwIKLRA2yqWdifj3owQZCL2sn6o08dBzZGQzA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + '@esbuild/openbsd-arm64@0.23.1': resolution: {integrity: sha512-3x37szhLexNA4bXhLrCC/LImN/YtWis6WXr1VESlfVtVeoFJBRINPJ3f0a/6LV8zpikqoUg4hyXw0sFBt5Cr+Q==} engines: {node: '>=18'} @@ -2564,6 +2678,12 @@ packages: cpu: [arm64] os: [openbsd] + '@esbuild/openbsd-arm64@0.25.0': + resolution: {integrity: sha512-21sUNbq2r84YE+SJDfaQRvdgznTD8Xc0oc3p3iW/a1EVWeNj/SdUCbm5U0itZPQYRuRTW20fPMWMpcrciH2EJw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.21.5': resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==} engines: {node: '>=12'} @@ -2582,6 +2702,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.25.0': + resolution: {integrity: sha512-2gwwriSMPcCFRlPlKx3zLQhfN/2WjJ2NSlg5TKLQOJdV0mSxIcYNTMhk3H3ulL/cak+Xj0lY1Ym9ysDV1igceg==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.21.5': resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==} engines: {node: '>=12'} @@ -2600,6 +2726,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.25.0': + resolution: {integrity: sha512-bxI7ThgLzPrPz484/S9jLlvUAHYMzy6I0XiU1ZMeAEOBcS0VePBFxh1JjTQt3Xiat5b6Oh4x7UC7IwKQKIJRIg==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.21.5': resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==} engines: {node: '>=12'} @@ -2618,6 +2750,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.25.0': + resolution: {integrity: sha512-ZUAc2YK6JW89xTbXvftxdnYy3m4iHIkDtK3CLce8wg8M2L+YZhIvO1DKpxrd0Yr59AeNNkTiic9YLf6FTtXWMw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.21.5': resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==} engines: {node: '>=12'} @@ -2636,6 +2774,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.25.0': + resolution: {integrity: sha512-eSNxISBu8XweVEWG31/JzjkIGbGIJN/TrRoiSVZwZ6pkC6VX4Im/WV2cz559/TXLcYbcrDN8JtKgd9DJVIo8GA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.21.5': resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==} engines: {node: '>=12'} @@ -2654,6 +2798,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.25.0': + resolution: {integrity: sha512-ZENoHJBxA20C2zFzh6AI4fT6RraMzjYw4xKWemRTRmRVtN9c5DcH9r/f2ihEkMjOW5eGgrwCslG/+Y/3bL+DHQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@eslint-community/eslint-utils@4.4.1': resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -5957,6 +6107,11 @@ packages: engines: {node: '>=18'} hasBin: true + esbuild@0.25.0: + resolution: {integrity: sha512-BXq5mqc8ltbaN34cDqWuYKyNhX8D/Z0J1xdtdQ8UcIIIyJyz+ZMKUt58tF3SrZ85jcfN/PZYhjR5uDQAYNVbuw==} + engines: {node: '>=18'} + hasBin: true + escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -11800,6 +11955,9 @@ snapshots: '@esbuild/aix-ppc64@0.24.2': optional: true + '@esbuild/aix-ppc64@0.25.0': + optional: true + '@esbuild/android-arm64@0.21.5': optional: true @@ -11809,6 +11967,9 @@ snapshots: '@esbuild/android-arm64@0.24.2': optional: true + '@esbuild/android-arm64@0.25.0': + optional: true + '@esbuild/android-arm@0.21.5': optional: true @@ -11818,6 +11979,9 @@ snapshots: '@esbuild/android-arm@0.24.2': optional: true + '@esbuild/android-arm@0.25.0': + optional: true + '@esbuild/android-x64@0.21.5': optional: true @@ -11827,6 +11991,9 @@ snapshots: '@esbuild/android-x64@0.24.2': optional: true + '@esbuild/android-x64@0.25.0': + optional: true + '@esbuild/darwin-arm64@0.21.5': optional: true @@ -11836,6 +12003,9 @@ snapshots: '@esbuild/darwin-arm64@0.24.2': optional: true + '@esbuild/darwin-arm64@0.25.0': + optional: true + '@esbuild/darwin-x64@0.21.5': optional: true @@ -11845,6 +12015,9 @@ snapshots: '@esbuild/darwin-x64@0.24.2': optional: true + '@esbuild/darwin-x64@0.25.0': + optional: true + '@esbuild/freebsd-arm64@0.21.5': optional: true @@ -11854,6 +12027,9 @@ snapshots: '@esbuild/freebsd-arm64@0.24.2': optional: true + '@esbuild/freebsd-arm64@0.25.0': + optional: true + '@esbuild/freebsd-x64@0.21.5': optional: true @@ -11863,6 +12039,9 @@ snapshots: '@esbuild/freebsd-x64@0.24.2': optional: true + '@esbuild/freebsd-x64@0.25.0': + optional: true + '@esbuild/linux-arm64@0.21.5': optional: true @@ -11872,6 +12051,9 @@ snapshots: '@esbuild/linux-arm64@0.24.2': optional: true + '@esbuild/linux-arm64@0.25.0': + optional: true + '@esbuild/linux-arm@0.21.5': optional: true @@ -11881,6 +12063,9 @@ snapshots: '@esbuild/linux-arm@0.24.2': optional: true + '@esbuild/linux-arm@0.25.0': + optional: true + '@esbuild/linux-ia32@0.21.5': optional: true @@ -11890,6 +12075,9 @@ snapshots: '@esbuild/linux-ia32@0.24.2': optional: true + '@esbuild/linux-ia32@0.25.0': + optional: true + '@esbuild/linux-loong64@0.21.5': optional: true @@ -11899,6 +12087,9 @@ snapshots: '@esbuild/linux-loong64@0.24.2': optional: true + '@esbuild/linux-loong64@0.25.0': + optional: true + '@esbuild/linux-mips64el@0.21.5': optional: true @@ -11908,6 +12099,9 @@ snapshots: '@esbuild/linux-mips64el@0.24.2': optional: true + '@esbuild/linux-mips64el@0.25.0': + optional: true + '@esbuild/linux-ppc64@0.21.5': optional: true @@ -11917,6 +12111,9 @@ snapshots: '@esbuild/linux-ppc64@0.24.2': optional: true + '@esbuild/linux-ppc64@0.25.0': + optional: true + '@esbuild/linux-riscv64@0.21.5': optional: true @@ -11926,6 +12123,9 @@ snapshots: '@esbuild/linux-riscv64@0.24.2': optional: true + '@esbuild/linux-riscv64@0.25.0': + optional: true + '@esbuild/linux-s390x@0.21.5': optional: true @@ -11935,6 +12135,9 @@ snapshots: '@esbuild/linux-s390x@0.24.2': optional: true + '@esbuild/linux-s390x@0.25.0': + optional: true + '@esbuild/linux-x64@0.21.5': optional: true @@ -11944,9 +12147,15 @@ snapshots: '@esbuild/linux-x64@0.24.2': optional: true + '@esbuild/linux-x64@0.25.0': + optional: true + '@esbuild/netbsd-arm64@0.24.2': optional: true + '@esbuild/netbsd-arm64@0.25.0': + optional: true + '@esbuild/netbsd-x64@0.21.5': optional: true @@ -11956,12 +12165,18 @@ snapshots: '@esbuild/netbsd-x64@0.24.2': optional: true + '@esbuild/netbsd-x64@0.25.0': + optional: true + '@esbuild/openbsd-arm64@0.23.1': optional: true '@esbuild/openbsd-arm64@0.24.2': optional: true + '@esbuild/openbsd-arm64@0.25.0': + optional: true + '@esbuild/openbsd-x64@0.21.5': optional: true @@ -11971,6 +12186,9 @@ snapshots: '@esbuild/openbsd-x64@0.24.2': optional: true + '@esbuild/openbsd-x64@0.25.0': + optional: true + '@esbuild/sunos-x64@0.21.5': optional: true @@ -11980,6 +12198,9 @@ snapshots: '@esbuild/sunos-x64@0.24.2': optional: true + '@esbuild/sunos-x64@0.25.0': + optional: true + '@esbuild/win32-arm64@0.21.5': optional: true @@ -11989,6 +12210,9 @@ snapshots: '@esbuild/win32-arm64@0.24.2': optional: true + '@esbuild/win32-arm64@0.25.0': + optional: true + '@esbuild/win32-ia32@0.21.5': optional: true @@ -11998,6 +12222,9 @@ snapshots: '@esbuild/win32-ia32@0.24.2': optional: true + '@esbuild/win32-ia32@0.25.0': + optional: true + '@esbuild/win32-x64@0.21.5': optional: true @@ -12007,6 +12234,9 @@ snapshots: '@esbuild/win32-x64@0.24.2': optional: true + '@esbuild/win32-x64@0.25.0': + optional: true + '@eslint-community/eslint-utils@4.4.1(eslint@8.57.1)': dependencies: eslint: 8.57.1 @@ -16059,6 +16289,34 @@ snapshots: '@esbuild/win32-ia32': 0.24.2 '@esbuild/win32-x64': 0.24.2 + esbuild@0.25.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.0 + '@esbuild/android-arm': 0.25.0 + '@esbuild/android-arm64': 0.25.0 + '@esbuild/android-x64': 0.25.0 + '@esbuild/darwin-arm64': 0.25.0 + '@esbuild/darwin-x64': 0.25.0 + '@esbuild/freebsd-arm64': 0.25.0 + '@esbuild/freebsd-x64': 0.25.0 + '@esbuild/linux-arm': 0.25.0 + '@esbuild/linux-arm64': 0.25.0 + '@esbuild/linux-ia32': 0.25.0 + '@esbuild/linux-loong64': 0.25.0 + '@esbuild/linux-mips64el': 0.25.0 + '@esbuild/linux-ppc64': 0.25.0 + '@esbuild/linux-riscv64': 0.25.0 + '@esbuild/linux-s390x': 0.25.0 + '@esbuild/linux-x64': 0.25.0 + '@esbuild/netbsd-arm64': 0.25.0 + '@esbuild/netbsd-x64': 0.25.0 + '@esbuild/openbsd-arm64': 0.25.0 + '@esbuild/openbsd-x64': 0.25.0 + '@esbuild/sunos-x64': 0.25.0 + '@esbuild/win32-arm64': 0.25.0 + '@esbuild/win32-ia32': 0.25.0 + '@esbuild/win32-x64': 0.25.0 + escalade@3.2.0: {} escape-html@1.0.3: {} @@ -16774,7 +17032,7 @@ snapshots: cross-spawn: 7.0.6 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.24.2)): + fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.25.0)): dependencies: '@babel/code-frame': 7.26.2 '@types/json-schema': 7.0.15 @@ -16790,7 +17048,7 @@ snapshots: semver: 7.6.3 tapable: 1.1.3 typescript: 5.5.4 - webpack: 5.96.1(esbuild@0.24.2) + webpack: 5.96.1(esbuild@0.25.0) optionalDependencies: eslint: 8.57.1 @@ -19638,7 +19896,7 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dev-utils@12.0.1(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.24.2)): + react-dev-utils@12.0.1(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.25.0)): dependencies: '@babel/code-frame': 7.26.2 address: 1.2.2 @@ -19649,7 +19907,7 @@ snapshots: escape-string-regexp: 4.0.0 filesize: 8.0.7 find-up: 5.0.0 - fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.24.2)) + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.1)(typescript@5.5.4)(webpack@5.96.1(esbuild@0.25.0)) global-modules: 2.0.0 globby: 11.1.0 gzip-size: 6.0.0 @@ -19664,7 +19922,7 @@ snapshots: shell-quote: 1.8.1 strip-ansi: 6.0.1 text-table: 0.2.0 - webpack: 5.96.1(esbuild@0.24.2) + webpack: 5.96.1(esbuild@0.25.0) optionalDependencies: typescript: 5.5.4 transitivePeerDependencies: @@ -20732,6 +20990,17 @@ snapshots: optionalDependencies: esbuild: 0.24.2 + terser-webpack-plugin@5.3.10(esbuild@0.25.0)(webpack@5.96.1(esbuild@0.25.0)): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + jest-worker: 27.5.1 + schema-utils: 3.3.0 + serialize-javascript: 6.0.2 + terser: 5.36.0 + webpack: 5.96.1(esbuild@0.25.0) + optionalDependencies: + esbuild: 0.25.0 + terser@5.36.0: dependencies: '@jridgewell/source-map': 0.3.6 @@ -21384,6 +21653,36 @@ snapshots: - esbuild - uglify-js + webpack@5.96.1(esbuild@0.25.0): + dependencies: + '@types/eslint-scope': 3.7.7 + '@types/estree': 1.0.6 + '@webassemblyjs/ast': 1.12.1 + '@webassemblyjs/wasm-edit': 1.12.1 + '@webassemblyjs/wasm-parser': 1.12.1 + acorn: 8.14.0 + browserslist: 4.24.2 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.17.1 + es-module-lexer: 1.5.4 + eslint-scope: 5.1.1 + events: 3.3.0 + glob-to-regexp: 0.4.1 + graceful-fs: 4.2.11 + json-parse-even-better-errors: 2.3.1 + loader-runner: 4.3.0 + mime-types: 2.1.35 + neo-async: 2.6.2 + schema-utils: 3.3.0 + tapable: 2.2.1 + terser-webpack-plugin: 5.3.10(esbuild@0.25.0)(webpack@5.96.1(esbuild@0.25.0)) + watchpack: 2.4.2 + webpack-sources: 3.2.3 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - uglify-js + whatwg-encoding@3.1.1: dependencies: iconv-lite: 0.6.3 From cc00ace3082f3bd362328f69e1ff2c90bb3c09d9 Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Wed, 12 Feb 2025 16:12:41 +0530 Subject: [PATCH 13/15] [docs] Add Trending badge (#4670) Signed-off-by: Bharat Kashyap --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index c79361ba1d7..cf2e50fa7e4 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ +
+ mui%2Ftoolpad | Trendshift +
+ ## Product walkthrough - [Toolpad Core](https://mui.com/toolpad/core/introduction/) is a set of high level React components that abstract common concepts such as layout navigation and routing. It aims at helping you build and maintain dashboards and internal tooling faster. It's built on top of [Material UI](http://github.com/mui/material-ui/). From ea0e2c6ee106a7356e13ba90dde3b2b46466fd44 Mon Sep 17 00:00:00 2001 From: Bharat Kashyap Date: Wed, 12 Feb 2025 19:43:51 +0530 Subject: [PATCH 14/15] [core] Add `LocalizationProvider` (#4620) --- .../account/AccountCustomLocaleText.js | 24 ++- .../account/AccountCustomLocaleText.tsx | 28 ++- .../AccountCustomLocaleText.tsx.preview | 4 +- .../account/AccountCustomSlotProps.js | 56 +++--- .../account/AccountCustomSlotProps.tsx | 60 +++--- .../account/AccountCustomUserDetails.js | 22 +-- .../account/AccountCustomUserDetails.tsx | 22 +-- .../components/account/AccountDemoSignedIn.js | 14 +- .../account/AccountDemoSignedIn.tsx | 18 +- .../account/AccountDemoSignedOut.js | 20 +- .../account/AccountDemoSignedOut.tsx | 15 +- .../account/AccountDemoSignedOut.tsx.preview | 12 +- .../account/AccountSlotsAccountSwitcher.js | 22 +-- .../account/AccountSlotsAccountSwitcher.tsx | 26 +-- .../core/components/account/account.md | 4 +- .../sign-in-page/LocaleSignInPage.js | 36 ++++ .../sign-in-page/LocaleSignInPage.tsx | 42 ++++ .../sign-in-page/LocaleSignInPage.tsx.preview | 9 + .../components/sign-in-page/sign-in-page.md | 28 ++- .../core/introduction/base-concepts.md | 123 ++++++++++++ docs/data/toolpad/core/pagesApi.js | 1 + docs/pages/toolpad/core/api/account.json | 7 +- docs/pages/toolpad/core/api/app-provider.json | 1 + .../toolpad/core/api/dashboard-layout.json | 2 +- .../toolpad/core/api/localization-provider.js | 23 +++ .../core/api/localization-provider.json | 11 ++ docs/pages/toolpad/core/api/sign-in-page.json | 1 + .../api-docs/app-provider/app-provider.json | 1 + .../localization-provider.json | 5 + .../api-docs/sign-in-page/sign-in-page.json | 1 + packages/toolpad-core/src/Account/Account.tsx | 187 ++++++++++-------- .../src/Account/AccountLocaleContext.tsx | 7 + .../src/Account/AccountPreview.tsx | 11 +- .../toolpad-core/src/Account/SignInButton.tsx | 11 +- .../src/Account/SignOutButton.tsx | 11 +- .../src/AppProvider/AppProvider.tsx | 30 ++- .../src/AppProvider/LocalizationProvider.tsx | 106 ++++++++++ .../toolpad-core/src/AppProvider/index.ts | 1 + .../src/DashboardLayout/DashboardLayout.tsx | 6 +- .../src/SignInPage/SignInPage.tsx | 81 ++++++-- packages/toolpad-core/src/locales/en.tsx | 41 ++++ .../src/locales/getLocalization.ts | 13 ++ packages/toolpad-core/src/locales/hiIN.tsx | 41 ++++ .../src/shared/locales/LocaleContext.tsx | 39 ---- .../toolpad-core/src/shared/locales/en.tsx | 9 - .../src/useDialogs/useDialogs.tsx | 37 +++- .../NotificationsProvider.tsx | 17 +- scripts/generateProptypes.ts | 4 + 48 files changed, 914 insertions(+), 376 deletions(-) create mode 100644 docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.js create mode 100644 docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx create mode 100644 docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx.preview create mode 100644 docs/pages/toolpad/core/api/localization-provider.js create mode 100644 docs/pages/toolpad/core/api/localization-provider.json create mode 100644 docs/translations/api-docs/localization-provider/localization-provider.json create mode 100644 packages/toolpad-core/src/Account/AccountLocaleContext.tsx create mode 100644 packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx create mode 100644 packages/toolpad-core/src/locales/en.tsx create mode 100644 packages/toolpad-core/src/locales/getLocalization.ts create mode 100644 packages/toolpad-core/src/locales/hiIN.tsx delete mode 100644 packages/toolpad-core/src/shared/locales/LocaleContext.tsx delete mode 100644 packages/toolpad-core/src/shared/locales/en.tsx diff --git a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.js b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.js index 5ed35873c32..3074a0f94d2 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.js +++ b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; const demoSession = { @@ -31,17 +31,15 @@ export default function AccountCustomLocaleText() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx index c74db6789c7..9fd5e3f3783 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx +++ b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx @@ -1,9 +1,5 @@ import * as React from 'react'; -import { - AuthenticationContext, - Session, - SessionContext, -} from '@toolpad/core/AppProvider'; +import { AppProvider, type Session } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; const demoSession = { @@ -35,17 +31,15 @@ export default function AccountCustomLocaleText() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx.preview b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx.preview index 882b98486be..1a812378926 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx.preview +++ b/docs/data/toolpad/core/components/account/AccountCustomLocaleText.tsx.preview @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/docs/data/toolpad/core/components/account/AccountCustomSlotProps.js b/docs/data/toolpad/core/components/account/AccountCustomSlotProps.js index 3995c7e1345..4c3544e3cec 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomSlotProps.js +++ b/docs/data/toolpad/core/components/account/AccountCustomSlotProps.js @@ -1,7 +1,7 @@ import * as React from 'react'; import Logout from '@mui/icons-material/Logout'; import { Account } from '@toolpad/core/Account'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; const demoSession = { user: { @@ -32,36 +32,34 @@ export default function AccountCustomSlotProps() { }, []); return ( - - - {/* preview-start */} - , - }, - preview: { - variant: 'expanded', - slotProps: { - avatarIconButton: { - sx: { - width: 'fit-content', - margin: 'auto', - }, - }, - avatar: { - variant: 'rounded', + + {/* preview-start */} + , + }, + preview: { + variant: 'expanded', + slotProps: { + avatarIconButton: { + sx: { + width: 'fit-content', + margin: 'auto', }, }, + avatar: { + variant: 'rounded', + }, }, - }} - /> - {/* preview-end */} - - + }, + }} + /> + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountCustomSlotProps.tsx b/docs/data/toolpad/core/components/account/AccountCustomSlotProps.tsx index fcfa8bd028c..abfcf8085fe 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomSlotProps.tsx +++ b/docs/data/toolpad/core/components/account/AccountCustomSlotProps.tsx @@ -1,11 +1,7 @@ import * as React from 'react'; import Logout from '@mui/icons-material/Logout'; import { Account } from '@toolpad/core/Account'; -import { - AuthenticationContext, - SessionContext, - Session, -} from '@toolpad/core/AppProvider'; +import { AppProvider, Session } from '@toolpad/core/AppProvider'; const demoSession = { user: { @@ -36,36 +32,34 @@ export default function AccountCustomSlotProps() { }, []); return ( - - - {/* preview-start */} - , - }, - preview: { - variant: 'expanded', - slotProps: { - avatarIconButton: { - sx: { - width: 'fit-content', - margin: 'auto', - }, - }, - avatar: { - variant: 'rounded', + + {/* preview-start */} + , + }, + preview: { + variant: 'expanded', + slotProps: { + avatarIconButton: { + sx: { + width: 'fit-content', + margin: 'auto', }, }, + avatar: { + variant: 'rounded', + }, }, - }} - /> - {/* preview-end */} - - + }, + }} + /> + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountCustomUserDetails.js b/docs/data/toolpad/core/components/account/AccountCustomUserDetails.js index f9ebd5d6e1a..b43327cd9d3 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomUserDetails.js +++ b/docs/data/toolpad/core/components/account/AccountCustomUserDetails.js @@ -1,6 +1,6 @@ import * as React from 'react'; import { Account } from '@toolpad/core/Account'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; import { UserOrg } from '../UserOrg'; const demoSession = { @@ -30,16 +30,14 @@ export default function AccountCustomUserDetails() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountCustomUserDetails.tsx b/docs/data/toolpad/core/components/account/AccountCustomUserDetails.tsx index 11aecc9f557..b2fc8ee9705 100644 --- a/docs/data/toolpad/core/components/account/AccountCustomUserDetails.tsx +++ b/docs/data/toolpad/core/components/account/AccountCustomUserDetails.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Account } from '@toolpad/core/Account'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; import { UserOrg, CustomSession } from '../UserOrg'; const demoSession: CustomSession = { @@ -32,16 +32,14 @@ export default function AccountCustomUserDetails() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountDemoSignedIn.js b/docs/data/toolpad/core/components/account/AccountDemoSignedIn.js index 5f8ea177353..d9602d020d6 100644 --- a/docs/data/toolpad/core/components/account/AccountDemoSignedIn.js +++ b/docs/data/toolpad/core/components/account/AccountDemoSignedIn.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; const demoSession = { @@ -24,12 +24,10 @@ export default function AccountDemoSignedIn() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountDemoSignedIn.tsx b/docs/data/toolpad/core/components/account/AccountDemoSignedIn.tsx index 718b4ed60fa..de5de86d2b5 100644 --- a/docs/data/toolpad/core/components/account/AccountDemoSignedIn.tsx +++ b/docs/data/toolpad/core/components/account/AccountDemoSignedIn.tsx @@ -1,9 +1,5 @@ import * as React from 'react'; -import { - AuthenticationContext, - SessionContext, - type Session, -} from '@toolpad/core/AppProvider'; +import { AppProvider, type Session } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; const demoSession = { @@ -28,12 +24,10 @@ export default function AccountDemoSignedIn() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.js b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.js index c63ddabcf9a..673420426a4 100644 --- a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.js +++ b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.js @@ -1,5 +1,9 @@ import * as React from 'react'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { + AuthenticationContext, + LocalizationProvider, + SessionContext, +} from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; const demoSession = { @@ -24,10 +28,14 @@ export default function AccountDemoSignedOut() { }, []); return ( - - - - - + // preview-start + + + + + + + + // preview-end ); } diff --git a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx index 1ca57c63430..a0a8d01e75e 100644 --- a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx +++ b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx @@ -1,6 +1,7 @@ import * as React from 'react'; import { AuthenticationContext, + LocalizationProvider, SessionContext, type Session, } from '@toolpad/core/AppProvider'; @@ -28,10 +29,14 @@ export default function AccountDemoSignedOut() { }, []); return ( - - - - - + // preview-start + + + + + + + + // preview-end ); } diff --git a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx.preview b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx.preview index b0489ce20ca..f3af4f1a296 100644 --- a/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx.preview +++ b/docs/data/toolpad/core/components/account/AccountDemoSignedOut.tsx.preview @@ -1,5 +1,7 @@ - - - - - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.js b/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.js index c938fa78e17..b0b354e8e8e 100644 --- a/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.js +++ b/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.js @@ -1,5 +1,5 @@ import * as React from 'react'; -import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; +import { AppProvider } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; import CustomMenu from './CustomMenu'; @@ -25,16 +25,14 @@ export default function AccountSlotsAccountSwitcher() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.tsx b/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.tsx index 7e89f9663a3..2558e0c1d22 100644 --- a/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.tsx +++ b/docs/data/toolpad/core/components/account/AccountSlotsAccountSwitcher.tsx @@ -1,9 +1,5 @@ import * as React from 'react'; -import { - AuthenticationContext, - SessionContext, - type Session, -} from '@toolpad/core/AppProvider'; +import { AppProvider, type Session } from '@toolpad/core/AppProvider'; import { Account } from '@toolpad/core/Account'; import CustomMenu from './CustomMenu'; @@ -29,16 +25,14 @@ export default function AccountSlotsAccountSwitcher() { }, []); return ( - - - {/* preview-start */} - - {/* preview-end */} - - + + {/* preview-start */} + + {/* preview-end */} + ); } diff --git a/docs/data/toolpad/core/components/account/account.md b/docs/data/toolpad/core/components/account/account.md index c506aca73b7..cfc30537fbd 100644 --- a/docs/data/toolpad/core/components/account/account.md +++ b/docs/data/toolpad/core/components/account/account.md @@ -26,7 +26,7 @@ If a `session` object is present, the component is rendered as a dropdown contai When signed out, the component renders as an inline sign in button within the dashboard layout. -{{"demo": "AccountDemoSignedOut.js", "bg": "outlined", "defaultCodeOpen": false }} +{{"demo": "AccountDemoSignedOut.js", "bg": "outlined", "defaultCodeOpen": false}} ## Customization @@ -61,7 +61,7 @@ You can build advanced menus – such as a tenant switcher – by passing in a c {{"demo": "AccountSlotsAccountSwitcher.js", "bg": "outlined"}} -### Labels +### Localization You can pass in custom labels – including of different languages – using the `localeText` prop. diff --git a/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.js b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.js new file mode 100644 index 00000000000..0e5ff86e899 --- /dev/null +++ b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.js @@ -0,0 +1,36 @@ +import * as React from 'react'; +import { AppProvider } from '@toolpad/core/AppProvider'; +import { SignInPage } from '@toolpad/core/SignInPage'; +import hiIN from '@toolpad/core/locales/hiIN'; + +const providers = [ + { id: 'github', name: 'GitHub' }, + { id: 'google', name: 'Google' }, + { id: 'credentials', name: 'Email and Password' }, +]; + +const signIn = async (provider) => { + const promise = new Promise((resolve) => { + setTimeout(() => { + console.log(`Sign in with ${provider.id}`); + resolve({ error: 'This is a mock error message.' }); + }, 500); + }); + return promise; +}; + +export default function LocaleSignInPage() { + return ( + // preview-start + + + + // preview-end + ); +} diff --git a/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx new file mode 100644 index 00000000000..cc64d7cc187 --- /dev/null +++ b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx @@ -0,0 +1,42 @@ +import * as React from 'react'; +import { AppProvider } from '@toolpad/core/AppProvider'; +import { + SignInPage, + type AuthProvider, + type AuthResponse, +} from '@toolpad/core/SignInPage'; +import hiIN from '@toolpad/core/locales/hiIN'; + +const providers = [ + { id: 'github', name: 'GitHub' }, + { id: 'google', name: 'Google' }, + { id: 'credentials', name: 'Email and Password' }, +]; + +const signIn: (provider: AuthProvider) => void | Promise = async ( + provider, +) => { + const promise = new Promise((resolve) => { + setTimeout(() => { + console.log(`Sign in with ${provider.id}`); + resolve({ error: 'This is a mock error message.' }); + }, 500); + }); + return promise; +}; + +export default function LocaleSignInPage() { + return ( + // preview-start + + + + // preview-end + ); +} diff --git a/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx.preview b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx.preview new file mode 100644 index 00000000000..49d7fc1ee6f --- /dev/null +++ b/docs/data/toolpad/core/components/sign-in-page/LocaleSignInPage.tsx.preview @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/docs/data/toolpad/core/components/sign-in-page/sign-in-page.md b/docs/data/toolpad/core/components/sign-in-page/sign-in-page.md index 9abf4d7bef6..32fffc5edea 100644 --- a/docs/data/toolpad/core/components/sign-in-page/sign-in-page.md +++ b/docs/data/toolpad/core/components/sign-in-page/sign-in-page.md @@ -1,7 +1,7 @@ --- productId: toolpad-core title: Sign-in Page -components: SignInPage, Account, NotificationsProvider +components: SignInPage, Account, NotificationsProvider, LocalizationProvider --- # Sign-in Page @@ -14,6 +14,26 @@ If this is your first time using Toolpad Core, it's recommended to read about th The `SignInPage` component is a quick way to generate a ready-to-use authentication page with multiple OAuth providers, or a credentials form. +## Basic Usage + +```tsx +import { AppProvider } from '@toolpad/core/AppProvider'; +import { SignInPage } from '@toolpad/core/SignInPage'; + +export default function App() { + return ( + + { + // Your sign in logic + }} + /> + + ); +} +``` + ## OAuth The `SignInPage` component can be set up with an OAuth provider by passing in a list of providers in the `providers` prop, along with a `signIn` function that accepts the `provider` as a parameter. @@ -264,6 +284,12 @@ You can use the `slotProps` prop to pass props to the underlying components of e {{"demo": "SlotPropsSignIn.js", "iframe": true, "height": 600 }} +### Localization + +Beyond the [global localization options](/toolpad/core/introduction/base-concepts/#localization) possible, you can customize the labels of the `SignInPage` using the `localeText` prop: + +{{"demo": "LocaleSignInPage.js", "iframe": true, "height": 700 }} + ### 🚧 Layouts The `SignInPage` component has versions with different layouts for authentication - one column, two column and others such. The APIs of these components are identical. This is in progress. diff --git a/docs/data/toolpad/core/introduction/base-concepts.md b/docs/data/toolpad/core/introduction/base-concepts.md index ae008ad48dc..463979dfac6 100644 --- a/docs/data/toolpad/core/introduction/base-concepts.md +++ b/docs/data/toolpad/core/introduction/base-concepts.md @@ -105,3 +105,126 @@ In this example: - The `slots` prop allows you to replace entire parts of the component. - The `slotProps` prop lets you pass additional props to specific slots. + +## Localization + +Toolpad components support translations between languages. You can modify text and translations inside Toolpad components in several ways. + +The default locale is English (United States). To use other locales, follow the instructions below. + +### Set translations globally + +#### Using the theme + +To translate all your Toolpad components, you can provide translations through the theme: + +```tsx +import { createTheme, ThemeProvider } from '@mui/material/styles'; +import { hiIN as coreHiIn } from '@mui/material/locale'; +import hiIN from '@toolpad/core/locales/hiIN'; + +const theme = createTheme({ + { + palette: { + primary: { main: '#1976d2' }, + }, + }, + coreHiIn, + hiIN, +}); + + // ... + {children}; + +``` + +#### Using the `localeText` prop + +If you want to pass language translations without using `createTheme`, you can directly provide them through the `localeText` prop on the `AppProvider`: + +```tsx +import { AppProvider } from '@toolpad/core/AppProvider'; +import hiIN from '@toolpad/core/locales/hiIN'; + +function App({ children }) { + return ( + + {children} + + ); +} +``` + +If you are not using the `AppProvider` in your app, you can just use the `LocalizationProvider`: + +```tsx +import { LocalizationProvider } from '@toolpad/core/AppProvider'; +import hiIN from '@toolpad/core/locales/hiIN'; + +function App({ children }) { + return ( + + {children} + + ); +} +``` + +### Set translations locally + +If you want to customize some translations on a specific component, you can use the `localeText` prop exposed by all components. + +```tsx + +``` + +### Priority order + +The localization system follows a specific priority order when applying translations: + +1. `localeText` prop provided directly to a specific component (highest priority) +2. `localeText` prop provided directly to `AppProvider` +3. Translations provided through the theme +4. Default English translations (lowest priority) + +:::info +If you pass a locale text through the `AppProvider` or the theme, and you provide translation keys through the `localeText` prop of a component at the same time, then the latter will override the former to the extent of the keys which it has available: + +  + +```tsx + + + +``` + +  + +This will produce the following result: + +- `SignInPage` title with text **Sign In** taken from the `AppProvider` `localeText` prop +- `Account` with title **Compte** overridden by the `Account` `localeText` prop + +::: + +### Access localization keys + +You can access your localization keys in custom components using the `useLocaleText()` hook. + +```tsx +import { useLocaleText } from '@toolpad/core/AppProvider'; + +function CustomMenu() { + // ... + const localeText = useLocaleText(); + // ... +} +``` diff --git a/docs/data/toolpad/core/pagesApi.js b/docs/data/toolpad/core/pagesApi.js index c36b8e189db..94f6be469bd 100644 --- a/docs/data/toolpad/core/pagesApi.js +++ b/docs/data/toolpad/core/pagesApi.js @@ -6,6 +6,7 @@ module.exports = [ { pathname: '/toolpad/core/api/app-provider' }, { pathname: '/toolpad/core/api/dashboard-layout' }, { pathname: '/toolpad/core/api/dialogs-provider' }, + { pathname: '/toolpad/core/api/localization-provider' }, { pathname: '/toolpad/core/api/notifications-provider' }, { pathname: '/toolpad/core/api/page-container' }, { pathname: '/toolpad/core/api/page-header' }, diff --git a/docs/pages/toolpad/core/api/account.json b/docs/pages/toolpad/core/api/account.json index b762be1d771..94c2412ee67 100644 --- a/docs/pages/toolpad/core/api/account.json +++ b/docs/pages/toolpad/core/api/account.json @@ -1,11 +1,6 @@ { "props": { - "localeText": { - "type": { - "name": "shape", - "description": "{ iconButtonAriaLabel?: string, signInLabel?: string, signOutLabel?: string }" - } - }, + "localeText": { "type": { "name": "object" } }, "slotProps": { "type": { "name": "shape", diff --git a/docs/pages/toolpad/core/api/app-provider.json b/docs/pages/toolpad/core/api/app-provider.json index 6918852f106..a36f529b3f8 100644 --- a/docs/pages/toolpad/core/api/app-provider.json +++ b/docs/pages/toolpad/core/api/app-provider.json @@ -12,6 +12,7 @@ }, "default": "null" }, + "localeText": { "type": { "name": "object" } }, "navigation": { "type": { "name": "arrayOf", diff --git a/docs/pages/toolpad/core/api/dashboard-layout.json b/docs/pages/toolpad/core/api/dashboard-layout.json index 6cb95c85aa3..890347a56fd 100644 --- a/docs/pages/toolpad/core/api/dashboard-layout.json +++ b/docs/pages/toolpad/core/api/dashboard-layout.json @@ -25,7 +25,7 @@ "slotProps": { "type": { "name": "shape", - "description": "{ appTitle?: { branding?: { homeUrl?: string, logo?: node, title?: string } }, sidebarFooter?: { mini: bool }, toolbarAccount?: { localeText?: { iconButtonAriaLabel?: string, signInLabel?: string, signOutLabel?: string }, slotProps?: { popover?: object, popoverContent?: object, preview?: object, signInButton?: object, signOutButton?: object }, slots?: { popover?: elementType, popoverContent?: elementType, preview?: elementType, signInButton?: elementType, signOutButton?: elementType } }, toolbarActions?: object }" + "description": "{ appTitle?: { branding?: { homeUrl?: string, logo?: node, title?: string } }, sidebarFooter?: { mini: bool }, toolbarAccount?: { localeText?: object, slotProps?: { popover?: object, popoverContent?: object, preview?: object, signInButton?: object, signOutButton?: object }, slots?: { popover?: elementType, popoverContent?: elementType, preview?: elementType, signInButton?: elementType, signOutButton?: elementType } }, toolbarActions?: object }" }, "default": "{}" }, diff --git a/docs/pages/toolpad/core/api/localization-provider.js b/docs/pages/toolpad/core/api/localization-provider.js new file mode 100644 index 00000000000..0c8377e375e --- /dev/null +++ b/docs/pages/toolpad/core/api/localization-provider.js @@ -0,0 +1,23 @@ +import * as React from 'react'; +import ApiPage from 'docs/src/modules/components/ApiPage'; +import mapApiPageTranslations from 'docs/src/modules/utils/mapApiPageTranslations'; +import jsonPageContent from './localization-provider.json'; + +export default function Page(props) { + const { descriptions, pageContent } = props; + return ; +} + +Page.getInitialProps = () => { + const req = require.context( + 'docs-toolpad/translations/api-docs/localization-provider', + false, + /\.\/localization-provider.*.json$/, + ); + const descriptions = mapApiPageTranslations(req); + + return { + descriptions, + pageContent: jsonPageContent, + }; +}; diff --git a/docs/pages/toolpad/core/api/localization-provider.json b/docs/pages/toolpad/core/api/localization-provider.json new file mode 100644 index 00000000000..23113be29b7 --- /dev/null +++ b/docs/pages/toolpad/core/api/localization-provider.json @@ -0,0 +1,11 @@ +{ + "props": { "localeText": { "type": { "name": "object" } } }, + "name": "LocalizationProvider", + "imports": ["import { LocalizationProvider } from '@toolpad/core/AppProvider';"], + "classes": [], + "muiName": "LocalizationProvider", + "filename": "/packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx", + "inheritance": null, + "demos": "", + "cssComponent": false +} diff --git a/docs/pages/toolpad/core/api/sign-in-page.json b/docs/pages/toolpad/core/api/sign-in-page.json index 132fb1607bc..352edafcc96 100644 --- a/docs/pages/toolpad/core/api/sign-in-page.json +++ b/docs/pages/toolpad/core/api/sign-in-page.json @@ -1,5 +1,6 @@ { "props": { + "localeText": { "type": { "name": "object" } }, "providers": { "type": { "name": "arrayOf", "description": "Array<{ id: string, name: string }>" }, "default": "[]" diff --git a/docs/translations/api-docs/app-provider/app-provider.json b/docs/translations/api-docs/app-provider/app-provider.json index 7450a9fa118..7e60f68b465 100644 --- a/docs/translations/api-docs/app-provider/app-provider.json +++ b/docs/translations/api-docs/app-provider/app-provider.json @@ -4,6 +4,7 @@ "authentication": { "description": "Authentication methods." }, "branding": { "description": "Branding options for the app." }, "children": { "description": "The content of the app provider." }, + "localeText": { "description": "Locale text for components" }, "navigation": { "description": "Navigation definition for the app." }, "router": { "description": "Router implementation used inside Toolpad components." }, "session": { "description": "Session info about the current user." }, diff --git a/docs/translations/api-docs/localization-provider/localization-provider.json b/docs/translations/api-docs/localization-provider/localization-provider.json new file mode 100644 index 00000000000..4b8c01172af --- /dev/null +++ b/docs/translations/api-docs/localization-provider/localization-provider.json @@ -0,0 +1,5 @@ +{ + "componentDescription": "", + "propDescriptions": { "localeText": { "description": "Locale for components texts" } }, + "classDescriptions": {} +} diff --git a/docs/translations/api-docs/sign-in-page/sign-in-page.json b/docs/translations/api-docs/sign-in-page/sign-in-page.json index de36472fb55..d72225d77de 100644 --- a/docs/translations/api-docs/sign-in-page/sign-in-page.json +++ b/docs/translations/api-docs/sign-in-page/sign-in-page.json @@ -1,6 +1,7 @@ { "componentDescription": "", "propDescriptions": { + "localeText": { "description": "The labels for the account component." }, "providers": { "description": "The list of authentication providers to display." }, "signIn": { "description": "Callback fired when a user signs in.", diff --git a/packages/toolpad-core/src/Account/Account.tsx b/packages/toolpad-core/src/Account/Account.tsx index c63be63b1ff..2b097611b86 100644 --- a/packages/toolpad-core/src/Account/Account.tsx +++ b/packages/toolpad-core/src/Account/Account.tsx @@ -10,7 +10,16 @@ import { AccountPreview, AccountPreviewProps } from './AccountPreview'; import { AccountPopoverHeader } from './AccountPopoverHeader'; import { AccountPopoverFooter } from './AccountPopoverFooter'; import { SessionContext, AuthenticationContext } from '../AppProvider/AppProvider'; -import { LocaleProvider, useLocaleText } from '../shared/locales/LocaleContext'; +import { useLocaleText, type LocaleText } from '../AppProvider/LocalizationProvider'; +import { AccountLocaleContext } from './AccountLocaleContext'; + +interface AccountLocaleText { + accountSignInLabel: string; + accountSignOutLabel: string; + + accountPreviewIconButtonLabel: string; + accountPreviewTitle: string; +} export interface AccountSlots { /** @@ -58,9 +67,16 @@ export interface AccountProps { /** * The labels for the account component. */ - localeText?: Partial>; + localeText?: Partial; } +const defaultAccountLocaleText: Pick = { + accountPreviewIconButtonLabel: 'Current User', + accountPreviewTitle: 'Account', + accountSignInLabel: 'Sign in', + accountSignOutLabel: 'Sign out', +}; + /** * * Demos: @@ -74,7 +90,12 @@ export interface AccountProps { * - [Account API](https://mui.com/toolpad/core/api/account) */ function Account(props: AccountProps) { - const { localeText } = props; + const { localeText: propsLocaleText } = props; + const globalLocaleText = useLocaleText(); + const localeText = React.useMemo( + () => ({ ...defaultAccountLocaleText, ...globalLocaleText, ...propsLocaleText }), + [globalLocaleText, propsLocaleText], + ); const { slots, slotProps } = props; const [anchorEl, setAnchorEl] = React.useState(null); const session = React.useContext(SessionContext); @@ -93,88 +114,92 @@ function Account(props: AccountProps) { return null; } + let accountContent = null; + if (!session?.user) { - return ( - - {slots?.signInButton ? ( - + accountContent = slots?.signInButton ? ( + + ) : ( + + ); + } else { + accountContent = ( + + {slots?.preview ? ( + ) : ( - + )} - + {slots?.popover ? ( + + ) : ( + + `drop-shadow(0px 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.10)' : 'rgba(0,0,0,0.32)'})`, + mt: 1, + '&::before': { + content: '""', + display: 'block', + position: 'absolute', + top: 0, + right: 14, + width: 10, + height: 10, + bgcolor: 'background.paper', + transform: 'translateY(-50%) rotate(45deg)', + zIndex: 0, + }, + }, + }, + ...slotProps?.popover?.slotProps, + }} + > + {slots?.popoverContent ? ( + + ) : ( + + + + + + + + + + )} + + )} + ); } return ( - - {slots?.preview ? ( - - ) : ( - - )} - {slots?.popover ? ( - - ) : ( - - `drop-shadow(0px 2px 8px ${theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.10)' : 'rgba(0,0,0,0.32)'})`, - mt: 1, - '&::before': { - content: '""', - display: 'block', - position: 'absolute', - top: 0, - right: 14, - width: 10, - height: 10, - bgcolor: 'background.paper', - transform: 'translateY(-50%) rotate(45deg)', - zIndex: 0, - }, - }, - }, - ...slotProps?.popover?.slotProps, - }} - > - {slots?.popoverContent ? ( - - ) : ( - - - - - - - - - - )} - - )} - + + {accountContent} + ); } @@ -186,11 +211,7 @@ Account.propTypes /* remove-proptypes */ = { /** * The labels for the account component. */ - localeText: PropTypes.shape({ - iconButtonAriaLabel: PropTypes.string, - signInLabel: PropTypes.string, - signOutLabel: PropTypes.string, - }), + localeText: PropTypes.object, /** * The props used for each slot inside. */ diff --git a/packages/toolpad-core/src/Account/AccountLocaleContext.tsx b/packages/toolpad-core/src/Account/AccountLocaleContext.tsx new file mode 100644 index 00000000000..4479c4b2b66 --- /dev/null +++ b/packages/toolpad-core/src/Account/AccountLocaleContext.tsx @@ -0,0 +1,7 @@ +import * as React from 'react'; +import type { LocaleText } from '../AppProvider/LocalizationProvider'; + +/** + * @ignore - internal component. + */ +export const AccountLocaleContext = React.createContext | null>(null); diff --git a/packages/toolpad-core/src/Account/AccountPreview.tsx b/packages/toolpad-core/src/Account/AccountPreview.tsx index 0875eca70f4..a5f41386680 100644 --- a/packages/toolpad-core/src/Account/AccountPreview.tsx +++ b/packages/toolpad-core/src/Account/AccountPreview.tsx @@ -8,7 +8,8 @@ import Stack from '@mui/material/Stack'; import IconButton, { IconButtonProps } from '@mui/material/IconButton'; import MoreVertIcon from '@mui/icons-material/MoreVert'; import { SessionContext } from '../AppProvider'; -import { useLocaleText } from '../shared/locales/LocaleContext'; +import { useLocaleText } from '../AppProvider/LocalizationProvider'; +import { AccountLocaleContext } from './AccountLocaleContext'; export type AccountPreviewVariant = 'condensed' | 'expanded'; @@ -79,7 +80,9 @@ export interface AccountPreviewProps { function AccountPreview(props: AccountPreviewProps) { const { slots, variant = 'condensed', slotProps, open, handleClick, sx } = props; const session = React.useContext(SessionContext); - const localeText = useLocaleText(); + const globalLocaleText = useLocaleText(); + const accountLocaleText = React.useContext(AccountLocaleContext); + const localeText = { ...globalLocaleText, ...accountLocaleText }; if (!session || !session.user) { return null; @@ -128,14 +131,14 @@ function AccountPreview(props: AccountPreviewProps) { } return ( - + {slots?.avatarIconButton ? ( ) : ( - {localeText?.signInLabel || 'Sign In'} + {localeText?.accountSignInLabel} ); } diff --git a/packages/toolpad-core/src/Account/SignOutButton.tsx b/packages/toolpad-core/src/Account/SignOutButton.tsx index e9d8e1701b8..45add1b6fec 100644 --- a/packages/toolpad-core/src/Account/SignOutButton.tsx +++ b/packages/toolpad-core/src/Account/SignOutButton.tsx @@ -2,8 +2,9 @@ import * as React from 'react'; import PropTypes from 'prop-types'; import Button, { ButtonProps } from '@mui/material/Button'; import LogoutIcon from '@mui/icons-material/Logout'; -import { AuthenticationContext } from '../AppProvider/AppProvider'; -import { useLocaleText } from '../shared/locales/LocaleContext'; +import { AuthenticationContext } from '../AppProvider'; +import { useLocaleText } from '../AppProvider/LocalizationProvider'; +import { AccountLocaleContext } from './AccountLocaleContext'; export type SignOutButtonProps = ButtonProps; @@ -19,7 +20,9 @@ export type SignOutButtonProps = ButtonProps; */ function SignOutButton(props: SignOutButtonProps) { const authentication = React.useContext(AuthenticationContext); - const localeText = useLocaleText(); + const globalLocaleText = useLocaleText(); + const accountLocaleText = React.useContext(AccountLocaleContext); + const localeText = { ...globalLocaleText, ...accountLocaleText }; return ( ); } diff --git a/packages/toolpad-core/src/AppProvider/AppProvider.tsx b/packages/toolpad-core/src/AppProvider/AppProvider.tsx index 0de8c74eec7..557827f819c 100644 --- a/packages/toolpad-core/src/AppProvider/AppProvider.tsx +++ b/packages/toolpad-core/src/AppProvider/AppProvider.tsx @@ -11,6 +11,7 @@ import { WindowContext, } from '../shared/context'; import { AppThemeProvider } from './AppThemeProvider'; +import { LocalizationProvider, type LocaleText } from './LocalizationProvider'; export interface NavigateOptions { history?: 'auto' | 'push' | 'replace'; @@ -103,6 +104,10 @@ export interface AppProviderProps { * @default null */ router?: Router; + /** + * Locale text for components + */ + localeText?: Partial; /** * Session info about the current user. * @default null @@ -147,6 +152,7 @@ function AppProvider(props: AppProviderProps) { theme = createTheme(), branding = null, navigation = [], + localeText, router = null, authentication = null, session = null, @@ -159,15 +165,17 @@ function AppProvider(props: AppProviderProps) { - - - - - {children} - - - - + + + + + + {children} + + + + + @@ -202,6 +210,10 @@ AppProvider.propTypes /* remove-proptypes */ = { * The content of the app provider. */ children: PropTypes.node, + /** + * Locale text for components + */ + localeText: PropTypes.object, /** * Navigation definition for the app. * @default [] diff --git a/packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx b/packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx new file mode 100644 index 00000000000..5a4a3fd327f --- /dev/null +++ b/packages/toolpad-core/src/AppProvider/LocalizationProvider.tsx @@ -0,0 +1,106 @@ +'use client'; +import * as React from 'react'; +import PropTypes from 'prop-types'; +import { useTheme } from '@mui/material/styles'; +import DEFAULT_LOCALE from '../locales/en'; + +export interface LocaleText { + // Account + accountSignInLabel: string; + accountSignOutLabel: string; + + // AccountPreview + accountPreviewIconButtonLabel: string; + accountPreviewTitle: string; + + // SignInPage + signInTitle: string; + signInSubtitle: string; + oauthSignInTitle: string; + passkeySignInTitle: string; + magicLinkSignInTitle: string; + signInRememberMe: string; + + // Common authentication labels + email: string; + passkey: string; + username: string; + password: string; + + // Common action labels + or: string; + to: string; + with: string; + save: string; + cancel: string; + ok: string; + close: string; + delete: string; + alert: string; + confirm: string; + loading: string; +} + +export interface LocalizationProviderProps { + children?: React.ReactNode; + /** + * Locale for components texts + */ + localeText?: Partial; +} + +export const LocalizationContext = React.createContext>({}); + +const LocalizationProvider = function LocalizationProvider(props: LocalizationProviderProps) { + const { localeText: propsLocaleText, children } = props; + + const theme = useTheme(); + // @ts-ignore + const themeLocaleText = theme?.components?.MuiLocalizationProvider?.defaultProps?.localeText; + + const defaultLocaleText = + DEFAULT_LOCALE.components.MuiLocalizationProvider.defaultProps.localeText; + + /* The order of overrides is: + * 1. The `localeText` prop of the `AppProvider` supersedes + * 2. The localeText provided as an argument to the `createTheme` function, which supersedes + * 3. The default locale text + */ + + const localeText = React.useMemo( + () => ({ ...defaultLocaleText, ...themeLocaleText, ...propsLocaleText }), + [defaultLocaleText, themeLocaleText, propsLocaleText], + ); + + return {children}; +}; + +LocalizationProvider.propTypes /* remove-proptypes */ = { + // ┌────────────────────────────── Warning ──────────────────────────────┐ + // │ These PropTypes are generated from the TypeScript type definitions. │ + // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │ + // └─────────────────────────────────────────────────────────────────────┘ + /** + * @ignore + */ + children: PropTypes.node, + /** + * Locale for components texts + */ + localeText: PropTypes.object, +} as any; + +export { LocalizationProvider }; +/** + * + * Demos: + * + * - [Sign-in Page](https://mui.com/toolpad/core/react-sign-in-page/) + * + * API: + * + * - [LocalizationProvider API](https://mui.com/toolpad/core/api/localization-provider) + */ +export function useLocaleText() { + return React.useContext(LocalizationContext); +} diff --git a/packages/toolpad-core/src/AppProvider/index.ts b/packages/toolpad-core/src/AppProvider/index.ts index bd2c0cdccb2..007fe400d13 100644 --- a/packages/toolpad-core/src/AppProvider/index.ts +++ b/packages/toolpad-core/src/AppProvider/index.ts @@ -1 +1,2 @@ export * from './AppProvider'; +export * from './LocalizationProvider'; diff --git a/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx b/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx index 9146f9a53b0..136c500076f 100644 --- a/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx +++ b/packages/toolpad-core/src/DashboardLayout/DashboardLayout.tsx @@ -545,11 +545,7 @@ DashboardLayout.propTypes /* remove-proptypes */ = { mini: PropTypes.bool.isRequired, }), toolbarAccount: PropTypes.shape({ - localeText: PropTypes.shape({ - iconButtonAriaLabel: PropTypes.string, - signInLabel: PropTypes.string, - signOutLabel: PropTypes.string, - }), + localeText: PropTypes.object, slotProps: PropTypes.shape({ popover: PropTypes.object, popoverContent: PropTypes.object, diff --git a/packages/toolpad-core/src/SignInPage/SignInPage.tsx b/packages/toolpad-core/src/SignInPage/SignInPage.tsx index 8789ced513c..51414737ccf 100644 --- a/packages/toolpad-core/src/SignInPage/SignInPage.tsx +++ b/packages/toolpad-core/src/SignInPage/SignInPage.tsx @@ -37,6 +37,7 @@ import KeycloakIcon from './icons/Keycloak'; import OktaIcon from './icons/Okta'; import FusionAuthIcon from './icons/FusionAuth'; import { BrandingContext, RouterContext } from '../shared/context'; +import { useLocaleText, type LocaleText } from '../AppProvider/LocalizationProvider'; const mergeSlotSx = (defaultSx: SxProps, slotProps?: { sx?: SxProps }) => { if (Array.isArray(slotProps?.sx)) { @@ -135,6 +136,18 @@ const IconProviderMap = new Map([ ['fusionauth', ], ]); +interface SignInPageLocaleText { + signInTitle: string; + signInSubtitle: string; + signInRememberMe: string; + email: string; + password: string; + or: string; + with: string; + passkey: string; + to: string; +} + export interface AuthProvider { /** * The unique identifier of the authentication provider. @@ -260,8 +273,24 @@ export interface SignInPageProps { * The prop used to customize the styles on the `SignInPage` container */ sx?: SxProps; + /** + * The labels for the account component. + */ + localeText?: Partial; } +const defaultLocaleText: Pick = { + signInTitle: 'Sign in', + signInSubtitle: 'Please sign in to continue', + signInRememberMe: 'Remember me', + email: 'Email', + password: 'Password', + or: 'or', + with: 'with', + passkey: 'Passkey', + to: 'to', +}; + /** * * Demos: @@ -273,10 +302,13 @@ export interface SignInPageProps { * - [SignInPage API](https://mui.com/toolpad/core/api/sign-in-page) */ function SignInPage(props: SignInPageProps) { - const { providers, signIn, slots, slotProps, sx } = props; + const { providers, signIn, slots, slotProps, sx, localeText: propsLocaleText } = props; const theme = useTheme(); const branding = React.useContext(BrandingContext); const router = React.useContext(RouterContext); + const globalLocaleText = useLocaleText(); + const localeText = { ...defaultLocaleText, ...globalLocaleText, ...propsLocaleText }; + const passkeyProvider = providers?.find((provider) => provider.id === 'passkey'); const credentialsProvider = providers?.find((provider) => provider.id === 'credentials'); const emailProvider = providers?.find((provider) => provider.id === 'nodemailer'); @@ -340,14 +372,15 @@ function SignInPage(props: SignInPageProps) { fontWeight: 600, }} > - Sign in {branding?.title ? `to ${branding.title}` : null} + {localeText.signInTitle}{' '} + {branding?.title ? `${localeText.to?.toLocaleLowerCase()} ${branding.title}` : null} )} {slots?.subtitle ? ( ) : ( - Welcome, please sign in to continue + {localeText?.signInSubtitle} )} @@ -392,7 +425,11 @@ function SignInPage(props: SignInPageProps) { textTransform: 'capitalize', }} > - Sign in with {provider.name} + + {localeText.oauthSignInTitle || + `${localeText.signInTitle} ${localeText.with}`}{' '} + {provider.name} + ); @@ -401,7 +438,9 @@ function SignInPage(props: SignInPageProps) { {passkeyProvider ? ( - {singleProvider ? null : or} + {singleProvider ? null : ( + {localeText.or} + )} {error && selectedProviderId === 'passkey' ? ( {error} @@ -430,7 +469,7 @@ function SignInPage(props: SignInPageProps) { ) : ( - Sign in with {passkeyProvider.name || 'Passkey'} + {localeText.passkeySignInTitle || + `${localeText.signInTitle} ${localeText.with}`}{' '} + {passkeyProvider.name || localeText.passkey} )} @@ -469,7 +510,9 @@ function SignInPage(props: SignInPageProps) { {emailProvider ? ( - {singleProvider ? null : or} + {singleProvider ? null : ( + {localeText.or} + )} {error && selectedProviderId === 'nodemailer' ? ( {error} @@ -504,7 +547,7 @@ function SignInPage(props: SignInPageProps) { ) : ( - Sign in with Email + {localeText.magicLinkSignInTitle || + `${localeText.signInTitle} ${localeText.with}`}{' '} + {localeText.email} )} @@ -543,7 +588,9 @@ function SignInPage(props: SignInPageProps) { {credentialsProvider ? ( - {singleProvider ? null : or} + {singleProvider ? null : ( + {localeText.or} + )} {error && selectedProviderId === 'credentials' ? ( {error} @@ -577,7 +624,7 @@ function SignInPage(props: SignInPageProps) { ) : ( } - label="Remember me" + label={localeText.signInRememberMe} {...slotProps?.rememberMe} slotProps={{ typography: { @@ -658,7 +705,7 @@ function SignInPage(props: SignInPageProps) { }} {...slotProps?.submitButton} > - Sign in + {localeText.signInTitle} )} @@ -682,6 +729,10 @@ SignInPage.propTypes /* remove-proptypes */ = { // │ These PropTypes are generated from the TypeScript type definitions. │ // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │ // └─────────────────────────────────────────────────────────────────────┘ + /** + * The labels for the account component. + */ + localeText: PropTypes.object, /** * The list of authentication providers to display. * @default [] diff --git a/packages/toolpad-core/src/locales/en.tsx b/packages/toolpad-core/src/locales/en.tsx new file mode 100644 index 00000000000..0f55d82cd64 --- /dev/null +++ b/packages/toolpad-core/src/locales/en.tsx @@ -0,0 +1,41 @@ +import type { LocaleText } from '../AppProvider'; +import { getLocalization } from './getLocalization'; + +const en: LocaleText = { + // Account + accountSignInLabel: 'Sign In', + accountSignOutLabel: 'Sign Out', + + // AccountPreview + accountPreviewTitle: 'Account', + accountPreviewIconButtonLabel: 'Current User', + + // SignInPage + signInTitle: 'Sign In', + signInSubtitle: 'Welcome user, please sign in to continue', + signInRememberMe: 'Remember Me', + oauthSignInTitle: 'Sign in with OAuth', + passkeySignInTitle: 'Sign in with Passkey', + magicLinkSignInTitle: 'Sign in with Magic Link', + + // Common authentication labels + email: 'Email', + password: 'Password', + username: 'Username', + passkey: 'Passkey', + + // Common action labels + save: 'Save', + cancel: 'Cancel', + ok: 'Ok', + or: 'Or', + to: 'To', + with: 'With', + close: 'Close', + delete: 'Delete', + alert: 'Alert', + confirm: 'Confirm', + loading: 'Loading...', +}; + +export default getLocalization(en); diff --git a/packages/toolpad-core/src/locales/getLocalization.ts b/packages/toolpad-core/src/locales/getLocalization.ts new file mode 100644 index 00000000000..a99a3b5d418 --- /dev/null +++ b/packages/toolpad-core/src/locales/getLocalization.ts @@ -0,0 +1,13 @@ +import type { LocaleText } from '../AppProvider'; + +export const getLocalization = (translations: Partial) => { + return { + components: { + MuiLocalizationProvider: { + defaultProps: { + localeText: { ...translations }, + }, + }, + }, + }; +}; diff --git a/packages/toolpad-core/src/locales/hiIN.tsx b/packages/toolpad-core/src/locales/hiIN.tsx new file mode 100644 index 00000000000..16175c45125 --- /dev/null +++ b/packages/toolpad-core/src/locales/hiIN.tsx @@ -0,0 +1,41 @@ +import type { LocaleText } from '../AppProvider'; +import { getLocalization } from './getLocalization'; + +const hiINLabels: Partial = { + // Account + accountSignInLabel: 'साइन इन करें', + accountSignOutLabel: 'साइन आउट करें', + + // AccountPreview + accountPreviewTitle: 'खाता', + accountPreviewIconButtonLabel: 'वर्तमान उपयोगकर्ता', + + // SignInPage + signInTitle: 'साइन इन करें', + signInSubtitle: 'स्वागत है उपयोगकर्ता, कृपया जारी रखने के लिए साइन इन करें', + signInRememberMe: 'मुझे याद रखें', + oauthSignInTitle: 'साइन इन विकल्प', + passkeySignInTitle: 'साइन इन विकल्प', + magicLinkSignInTitle: 'साइन इन विकल्प', + + // Common authentication labels + email: 'ईमेल', + password: 'पासवर्ड', + username: 'उपयोगकर्ता नाम', + passkey: 'पासकी', + + // Common action labels + save: 'सहेजें', + cancel: 'रद्द करें', + ok: 'ठीक है', + or: 'या', + to: 'को', + with: 'के साथ', + close: 'बंद करें', + delete: 'हटाएं', + alert: 'सूचना', + confirm: 'पुष्टि करें', + loading: 'लोड हो रहा है...', +}; + +export default getLocalization(hiINLabels); diff --git a/packages/toolpad-core/src/shared/locales/LocaleContext.tsx b/packages/toolpad-core/src/shared/locales/LocaleContext.tsx deleted file mode 100644 index abfb38d6d5d..00000000000 --- a/packages/toolpad-core/src/shared/locales/LocaleContext.tsx +++ /dev/null @@ -1,39 +0,0 @@ -'use client'; - -import * as React from 'react'; -import DEFAULT_LOCALE_TEXT from './en'; - -export type LocaleContextType = { - // Account - signInLabel?: string; - signOutLabel?: string; - // Account Preview - iconButtonAriaLabel?: string; -}; - -export const LocaleContext = React.createContext(DEFAULT_LOCALE_TEXT); - -export interface LocaleProviderProps { - localeText?: Partial; - children: React.ReactNode; -} - -/** - * @ignore - internal component. - */ -export function LocaleProvider({ localeText, children }: LocaleProviderProps) { - const mergedLocaleText = React.useMemo( - () => ({ ...DEFAULT_LOCALE_TEXT, ...localeText }), - [localeText], - ); - - return {children}; -} - -/** - * @ignore - internal hook. - */ - -export function useLocaleText() { - return React.useContext(LocaleContext); -} diff --git a/packages/toolpad-core/src/shared/locales/en.tsx b/packages/toolpad-core/src/shared/locales/en.tsx deleted file mode 100644 index 9717c8b3a3c..00000000000 --- a/packages/toolpad-core/src/shared/locales/en.tsx +++ /dev/null @@ -1,9 +0,0 @@ -const TOOLPAD_CORE_DEFAULT_LOCALE_TEXT = { - // Account - signInLabel: 'Sign In', - signOutLabel: 'Sign Out', - // Account Preview - iconButtonAriaLabel: 'Current User', -}; - -export default TOOLPAD_CORE_DEFAULT_LOCALE_TEXT; diff --git a/packages/toolpad-core/src/useDialogs/useDialogs.tsx b/packages/toolpad-core/src/useDialogs/useDialogs.tsx index 192b20aac0a..f84417c42c0 100644 --- a/packages/toolpad-core/src/useDialogs/useDialogs.tsx +++ b/packages/toolpad-core/src/useDialogs/useDialogs.tsx @@ -11,6 +11,21 @@ import { useNonNullableContext } from '@toolpad/utils/react'; import invariant from 'invariant'; import * as React from 'react'; import { DialogsContext } from './DialogsContext'; +import { useLocaleText, type LocaleText } from '../AppProvider/LocalizationProvider'; + +interface DialogsProviderLocaleText { + alert: string; + confirm: string; + cancel: string; + ok: string; +} + +const defaultLocaleText: Pick = { + alert: 'Alert', + confirm: 'Confirm', + cancel: 'Cancel', + ok: 'Ok', +}; export interface OpenDialogOptions { /** @@ -192,14 +207,16 @@ export interface AlertDialogPayload extends AlertOptions { export interface AlertDialogProps extends DialogProps {} export function AlertDialog({ open, payload, onClose }: AlertDialogProps) { + const globalLocaleText = useLocaleText(); + const localeText = { ...defaultLocaleText, ...globalLocaleText }; const okButtonProps = useDialogLoadingButton(() => onClose()); return ( onClose()}> - {payload.title ?? 'Alert'} + {payload.title ?? localeText.alert} {payload.msg} - {payload.okText ?? 'Ok'} + {payload.okText ?? localeText.ok} @@ -213,18 +230,20 @@ export interface ConfirmDialogPayload extends ConfirmOptions { export interface ConfirmDialogProps extends DialogProps {} export function ConfirmDialog({ open, payload, onClose }: ConfirmDialogProps) { + const globalLocaleText = useLocaleText(); + const localeText = { ...defaultLocaleText, ...globalLocaleText }; const cancelButtonProps = useDialogLoadingButton(() => onClose(false)); const okButtonProps = useDialogLoadingButton(() => onClose(true)); return ( onClose(false)}> - {payload.title ?? 'Confirm'} + {payload.title ?? localeText.confirm} {payload.msg} - {payload.cancelText ?? 'Cancel'} + {payload.cancelText ?? localeText.cancel} - {payload.okText ?? 'Ok'} + {payload.okText ?? localeText.ok} @@ -238,6 +257,8 @@ export interface PromptDialogPayload extends PromptOptions { export interface PromptDialogProps extends DialogProps {} export function PromptDialog({ open, payload, onClose }: PromptDialogProps) { + const globalLocaleText = useLocaleText(); + const localeText = { ...defaultLocaleText, ...globalLocaleText }; const [input, setInput] = React.useState(''); const cancelButtonProps = useDialogLoadingButton(() => onClose(null)); @@ -266,7 +287,7 @@ export function PromptDialog({ open, payload, onClose }: PromptDialogProps) { }, }} > - {payload.title ?? 'Confirm'} + {payload.title ?? localeText.confirm} {payload.msg} - {payload.cancelText ?? 'Cancel'} + {payload.cancelText ?? localeText.cancel} - {payload.okText ?? 'Ok'} + {payload.okText ?? localeText.ok} diff --git a/packages/toolpad-core/src/useNotifications/NotificationsProvider.tsx b/packages/toolpad-core/src/useNotifications/NotificationsProvider.tsx index 8a7ab8cabb2..12a35999c42 100644 --- a/packages/toolpad-core/src/useNotifications/NotificationsProvider.tsx +++ b/packages/toolpad-core/src/useNotifications/NotificationsProvider.tsx @@ -19,8 +19,7 @@ import type { ShowNotification, ShowNotificationOptions, } from './useNotifications'; - -const closeText = 'Close'; +import { useLocaleText, type LocaleText } from '../AppProvider/LocalizationProvider'; export interface NotificationsProviderSlotProps { snackbar: SnackbarProps; @@ -36,6 +35,14 @@ export interface NotificationsProviderSlots { const RootPropsContext = React.createContext(null); +interface NotificationsProviderLocaleText { + close: string; +} + +const defaultLocaleText: Pick = { + close: 'Close', +}; + interface NotificationProps { notificationKey: string; badge: string | null; @@ -45,6 +52,8 @@ interface NotificationProps { } function Notification({ notificationKey, open, message, options, badge }: NotificationProps) { + const globalLocaleText = useLocaleText(); + const localeText = { ...defaultLocaleText, ...globalLocaleText }; const { close } = useNonNullableContext(NotificationsContext); const { severity, actionText, onAction, autoHideDuration } = options; @@ -68,8 +77,8 @@ function Notification({ notificationKey, open, message, options, badge }: Notifi ) : null} diff --git a/scripts/generateProptypes.ts b/scripts/generateProptypes.ts index ad49871579a..f165029a996 100644 --- a/scripts/generateProptypes.ts +++ b/scripts/generateProptypes.ts @@ -55,6 +55,10 @@ async function generateProptypes( filePath: tsFile, project, shouldResolveObject: ({ name }) => { + const propsToNotResolve = ['localeText']; + if (propsToNotResolve.includes(name)) { + return false; + } if ( name.toLowerCase().endsWith('classes') || name === 'theme' || From 6dc29bee3555b5a41ef5048ba548bdff0b3390e6 Mon Sep 17 00:00:00 2001 From: Filip Niklas <118931755+Firgrep@users.noreply.github.com> Date: Wed, 12 Feb 2025 16:06:32 +0100 Subject: [PATCH 15/15] [docs] add customization section to notifications (#4672) Signed-off-by: Filip Niklas <118931755+Firgrep@users.noreply.github.com> Signed-off-by: Jan Potoms <2109932+Janpot@users.noreply.github.com> Co-authored-by: Jan Potoms <2109932+Janpot@users.noreply.github.com> --- .../use-notifications/use-notifications.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/data/toolpad/core/components/use-notifications/use-notifications.md b/docs/data/toolpad/core/components/use-notifications/use-notifications.md index d47afbe6c18..82cf71456ff 100644 --- a/docs/data/toolpad/core/components/use-notifications/use-notifications.md +++ b/docs/data/toolpad/core/components/use-notifications/use-notifications.md @@ -75,6 +75,20 @@ Notification providers can be nested. That way you can scope the notifications t {{"demo": "ScopedNotification.js"}} +## Customization + +To customize the notification experience, such as the position of the notification, provide a custom [`Snackbar`](https://mui.com/material-ui/react-snackbar/) configuration to the `NotificationsProvider`. When applied at the provider level, this configuration globally sets the behavior for all notifications in your application. + +```tsx + +``` + ## 🚧 Notification center When multiple notifications are available, click the badge to open the notification center to show a scrollable list of all available notifications. This feature is not available yet.