From 53de16302f044a236349dce3855e77627453d98e Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Tue, 7 Jan 2025 17:18:41 +0100
Subject: [PATCH 01/18] Supports react 19
---
examples/crm/package.json | 8 +-
.../crm/src/contacts/ContactImportDialog.tsx | 19 +-
examples/crm/vite.config.ts | 2 +-
examples/demo/package.json | 8 +-
examples/demo/vite.config.ts | 2 +-
examples/no-code/package.json | 6 +-
examples/simple/package.json | 10 +-
examples/tutorial/package.json | 4 +-
package.json | 4 +-
packages/create-react-admin/package.json | 2 +-
packages/ra-core/package.json | 5 +-
packages/ra-input-rich-text/package.json | 10 +-
packages/ra-no-code/package.json | 8 +-
packages/ra-ui-materialui/package.json | 11 +-
.../src/input/ArrayInput/ArrayInput.spec.tsx | 7 +-
.../src/input/AutocompleteInput.tsx | 1 -
packages/react-admin/package.json | 6 +-
yarn.lock | 413 +++++++-----------
18 files changed, 211 insertions(+), 315 deletions(-)
diff --git a/examples/crm/package.json b/examples/crm/package.json
index c6b0cb2ede0..a3f028d1f41 100644
--- a/examples/crm/package.json
+++ b/examples/crm/package.json
@@ -5,8 +5,8 @@
"type": "module",
"dependencies": {
"@hello-pangea/dnd": "^16.3.0",
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"@nivo/bar": "^0.80.0",
"@nivo/core": "^0.80.0",
"clsx": "^2.1.1",
@@ -15,10 +15,10 @@
"lodash": "~4.17.5",
"papaparse": "^5.4.1",
"ra-data-fakerest": "^5.3.0",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"react-admin": "^5.3.0",
"react-cropper": "^2.3.3",
- "react-dom": "^18.3.1",
+ "react-dom": "^19.0.0",
"react-error-boundary": "^4.0.3",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/examples/crm/src/contacts/ContactImportDialog.tsx b/examples/crm/src/contacts/ContactImportDialog.tsx
index bf1a29f22be..2b026ce6c69 100644
--- a/examples/crm/src/contacts/ContactImportDialog.tsx
+++ b/examples/crm/src/contacts/ContactImportDialog.tsx
@@ -1,10 +1,15 @@
-import { Box, CircularProgress, Stack, Typography } from '@mui/material';
-import Alert from '@mui/material/Alert';
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogTitle from '@mui/material/DialogTitle';
-import MuiLink from '@mui/material/Link';
+import {
+ Alert,
+ Box,
+ CircularProgress,
+ Dialog,
+ DialogActions,
+ DialogContent,
+ DialogTitle,
+ Link as MuiLink,
+ Stack,
+ Typography,
+} from '@mui/material';
import {
Button,
FileField,
diff --git a/examples/crm/vite.config.ts b/examples/crm/vite.config.ts
index 4df87129ffd..39214bd049b 100644
--- a/examples/crm/vite.config.ts
+++ b/examples/crm/vite.config.ts
@@ -14,7 +14,7 @@ export default defineConfig(async () => {
// eslint-disable-next-line prettier/prettier
const packageJson = await import(
path.resolve(__dirname, '../../packages', dirName, 'package.json'),
- { assert: { type: 'json' } }
+ { with: { type: 'json' } }
);
aliases[packageJson.default.name] = path.resolve(
__dirname,
diff --git a/examples/demo/package.json b/examples/demo/package.json
index b67a86d278e..b67af5c9f17 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -5,8 +5,8 @@
"type": "module",
"dependencies": {
"@apollo/client": "^3.3.19",
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"@types/recharts": "^1.8.10",
"@vitejs/plugin-react": "^2.2.0",
"clsx": "^2.1.1",
@@ -26,9 +26,9 @@
"ra-input-rich-text": "^5.0.0",
"ra-language-english": "^5.0.0",
"ra-language-french": "^5.0.0",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"react-admin": "^5.0.0",
- "react-dom": "^18.3.1",
+ "react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"recharts": "^2.1.15"
diff --git a/examples/demo/vite.config.ts b/examples/demo/vite.config.ts
index a0c445c7462..11e558db873 100644
--- a/examples/demo/vite.config.ts
+++ b/examples/demo/vite.config.ts
@@ -19,7 +19,7 @@ export default defineConfig(async () => {
// eslint-disable-next-line prettier/prettier
const packageJson = await import(
path.resolve(__dirname, '../../packages', dirName, 'package.json'),
- { assert: { type: 'json' } }
+ { with: { type: 'json' } }
);
aliases[packageJson.default.name] = path.resolve(
__dirname,
diff --git a/examples/no-code/package.json b/examples/no-code/package.json
index 8fbb2180005..f8eb697eb7b 100644
--- a/examples/no-code/package.json
+++ b/examples/no-code/package.json
@@ -8,12 +8,12 @@
"serve": "vite preview"
},
"dependencies": {
- "@mui/material": "^5.15.20",
+ "@mui/material": "^5.16.12",
"ra-data-local-storage": "^5.0.0",
"ra-no-code": "^5.0.0",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"react-admin": "^5.0.0",
- "react-dom": "^18.3.1"
+ "react-dom": "^19.0.0"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index 6efd10223ce..119f4611b17 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -10,10 +10,8 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
- "@emotion/react": "^11.7.1",
- "@emotion/styled": "^11.6.0",
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"@tanstack/react-query": "^5.21.7",
"@tanstack/react-query-devtools": "^5.21.7",
"jsonexport": "^3.2.0",
@@ -23,9 +21,9 @@
"ra-input-rich-text": "^5.4.3",
"ra-language-english": "^5.4.3",
"ra-language-french": "^5.4.3",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"react-admin": "^5.4.3",
- "react-dom": "^18.3.1",
+ "react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/examples/tutorial/package.json b/examples/tutorial/package.json
index cbe93de12ea..d281ea5c4f1 100644
--- a/examples/tutorial/package.json
+++ b/examples/tutorial/package.json
@@ -10,9 +10,9 @@
},
"dependencies": {
"ra-data-json-server": "^5.0.0",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"react-admin": "^5.0.0",
- "react-dom": "^18.3.1"
+ "react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^18.3.3",
diff --git a/package.json b/package.json
index 499cba7418a..be2d218e177 100644
--- a/package.json
+++ b/package.json
@@ -56,8 +56,8 @@
"lolex": "~2.3.2",
"prettier": "~3.2.5",
"raf": "~3.4.1",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
"storybook": "^8.4.4",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3",
diff --git a/packages/create-react-admin/package.json b/packages/create-react-admin/package.json
index 1787c168ff1..e296d9fba0e 100644
--- a/packages/create-react-admin/package.json
+++ b/packages/create-react-admin/package.json
@@ -27,7 +27,7 @@
"ink-text-input": "^6.0.0",
"lodash": "~4.17.5",
"meow": "^9.0.0",
- "react": "^18.3.1",
+ "react": "^19.0.0",
"yn": "^5.0.0"
},
"devDependencies": {
diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json
index 02fbf33e007..3c86d18cc62 100644
--- a/packages/ra-core/package.json
+++ b/packages/ra-core/package.json
@@ -38,12 +38,11 @@
"expect": "^27.4.6",
"ignore-styles": "~5.0.1",
"jscodeshift": "^0.15.2",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
- "react-test-renderer": "^18.2.0",
"recharts": "^2.1.15",
"rimraf": "^3.0.2",
"typescript": "^5.1.3",
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json
index d6864e87473..0454db581cb 100644
--- a/packages/ra-input-rich-text/package.json
+++ b/packages/ra-input-rich-text/package.json
@@ -38,8 +38,8 @@
"clsx": "^2.1.1"
},
"peerDependencies": {
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"ra-core": "^5.0.0",
"ra-ui-materialui": "^5.0.0",
"react": "^18.0.0 || ^19.0.0",
@@ -47,7 +47,7 @@
},
"devDependencies": {
"@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/material": "^5.16.12",
"@testing-library/react": "^15.0.7",
"@tiptap/extension-mention": "^2.0.3",
"@tiptap/suggestion": "^2.0.3",
@@ -55,8 +55,8 @@
"ra-core": "^5.4.3",
"ra-data-fakerest": "^5.4.3",
"ra-ui-materialui": "^5.4.3",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"rimraf": "^3.0.2",
"tippy.js": "^6.3.7",
diff --git a/packages/ra-no-code/package.json b/packages/ra-no-code/package.json
index 8f12d16ccc5..987c5f99a32 100644
--- a/packages/ra-no-code/package.json
+++ b/packages/ra-no-code/package.json
@@ -28,16 +28,16 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"cross-env": "^5.2.0",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"rimraf": "^3.0.2",
"typescript": "^5.1.3"
},
"peerDependencies": {
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index 51cc6bfca48..c34b2cf5ab0 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -26,9 +26,9 @@
"watch": "tsc --outDir dist/esm --module es2015 --watch"
},
"devDependencies": {
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
- "@mui/utils": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
+ "@mui/utils": "^5.16.12",
"@testing-library/react": "^15.0.7",
"@types/dompurify": "^3.0.2",
"@types/react": "^18.3.3",
@@ -42,13 +42,12 @@
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
- "react": "^18.3.1",
- "react-dom": "^18.3.1",
+ "react": "^19.0.0",
+ "react-dom": "^19.0.0",
"react-hook-form": "^7.53.0",
"react-is": "^18.2.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
- "react-test-renderer": "^18.2.0",
"rimraf": "^3.0.2",
"typescript": "^5.1.3"
},
diff --git a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
index 8d777068e7d..54ef3bcc657 100644
--- a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
+++ b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
@@ -384,7 +384,7 @@ describe('', () => {
});
describe('used within a form with global validation', () => {
- it('should display an error if the array is required and empty', async () => {
+ it.only('should display an error if the array is required and empty', async () => {
render();
await screen.findByDisplayValue('Leo Tolstoy');
const RemoveButtons = screen.getAllByLabelText('Remove');
@@ -393,12 +393,11 @@ describe('', () => {
await waitFor(() => {
expect(screen.queryAllByLabelText('Remove')).toHaveLength(0);
});
+ await screen.findByText('Required');
const SaveButton = screen.getByText('Save');
fireEvent.click(SaveButton);
await screen.findByText(
- 'The form is not valid. Please check for errors',
- undefined,
- { timeout: 3000 }
+ 'The form is not valid. Please check for errors'
);
});
it('should display an error if one of the required field is empty', async () => {
diff --git a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
index e3ae0a3bb20..ab0621ae7bc 100644
--- a/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
+++ b/packages/ra-ui-materialui/src/input/AutocompleteInput.tsx
@@ -692,7 +692,6 @@ If you provided a React element for the optionText prop, you must also provide t
onInputChange={handleInputChange}
renderOption={(props, record: RaRecord) => {
// We have to extract the key because react 19 does not allow to spread the key prop
- // @ts-expect-error The key is indeed inside props but MUI does not provide the correct type
const { key: ignoredKey, ...rest } = props;
// We don't use MUI key which is generated from the option label because we may have options with the same label but with different values
const key = getChoiceValue(record);
diff --git a/packages/react-admin/package.json b/packages/react-admin/package.json
index d346d72d95a..6609bd7be33 100644
--- a/packages/react-admin/package.json
+++ b/packages/react-admin/package.json
@@ -36,10 +36,8 @@
"react-dom": "^18.0.0 || ^19.0.0"
},
"dependencies": {
- "@emotion/react": "^11.4.1",
- "@emotion/styled": "^11.3.0",
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
diff --git a/yarn.lock b/yarn.lock
index dbff39fa5a0..66d420ee580 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1784,16 +1784,16 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/cache@npm:^11.11.0, @emotion/cache@npm:^11.7.1":
- version: 11.11.0
- resolution: "@emotion/cache@npm:11.11.0"
- dependencies:
- "@emotion/memoize": "npm:^0.8.1"
- "@emotion/sheet": "npm:^1.2.2"
- "@emotion/utils": "npm:^1.2.1"
- "@emotion/weak-memoize": "npm:^0.3.1"
+"@emotion/cache@npm:^11.13.5, @emotion/cache@npm:^11.7.1":
+ version: 11.14.0
+ resolution: "@emotion/cache@npm:11.14.0"
+ dependencies:
+ "@emotion/memoize": "npm:^0.9.0"
+ "@emotion/sheet": "npm:^1.4.0"
+ "@emotion/utils": "npm:^1.4.2"
+ "@emotion/weak-memoize": "npm:^0.4.0"
stylis: "npm:4.2.0"
- checksum: a23ab5ab2fd08e904698106d58ad3536fed51cc1aa0ef228e95bb640eaf11f560dbd91a395477b0d84e1e3c20150263764b4558517cf6576a89d2d6cc5253688
+ checksum: 3fa3e7a431ab6f8a47c67132a00ac8358f428c1b6c8421d4b20de9df7c18e95eec04a5a6ff5a68908f98d3280044f247b4965ac63df8302d2c94dba718769724
languageName: node
linkType: hard
@@ -1813,21 +1813,14 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/memoize@npm:^0.7.4, @emotion/memoize@npm:^0.7.5":
- version: 0.7.5
- resolution: "@emotion/memoize@npm:0.7.5"
- checksum: 28d061ec9fb9b8c495d58b4e2dcc62207d75d4e8d8f4e6a0b42342d6e7c649d41461e807363d1a0a2c33d2235f6ee59dd6394fbec88b7da65e3d5852fc34387e
+"@emotion/memoize@npm:^0.7.4, @emotion/memoize@npm:^0.7.5, @emotion/memoize@npm:^0.9.0":
+ version: 0.9.0
+ resolution: "@emotion/memoize@npm:0.9.0"
+ checksum: 13f474a9201c7f88b543e6ea42f55c04fb2fdc05e6c5a3108aced2f7e7aa7eda7794c56bba02985a46d8aaa914fcdde238727a98341a96e2aec750d372dadd15
languageName: node
linkType: hard
-"@emotion/memoize@npm:^0.8.1":
- version: 0.8.1
- resolution: "@emotion/memoize@npm:0.8.1"
- checksum: dffed372fc3b9fa2ba411e76af22b6bb686fb0cb07694fdfaa6dd2baeb0d5e4968c1a7caa472bfcf06a5997d5e7c7d16b90e993f9a6ffae79a2c3dbdc76dfe78
- languageName: node
- linkType: hard
-
-"@emotion/react@npm:^11.1.5, @emotion/react@npm:^11.4.1, @emotion/react@npm:^11.7.1":
+"@emotion/react@npm:^11.1.5":
version: 11.7.1
resolution: "@emotion/react@npm:11.7.1"
dependencies:
@@ -1863,14 +1856,14 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/sheet@npm:^1.1.0, @emotion/sheet@npm:^1.2.2":
- version: 1.2.2
- resolution: "@emotion/sheet@npm:1.2.2"
- checksum: 69827a1bfa43d7b188f1d8cea42163143a36312543fdade5257c459a2b3efd7ce386aac84ba152bc2517a4f7e54384c04800b26adb382bb284ac7e4ad40e584b
+"@emotion/sheet@npm:^1.1.0, @emotion/sheet@npm:^1.4.0":
+ version: 1.4.0
+ resolution: "@emotion/sheet@npm:1.4.0"
+ checksum: 3ca72d1650a07d2fbb7e382761b130b4a887dcd04e6574b2d51ce578791240150d7072a9bcb4161933abbcd1e38b243a6fb4464a7fe991d700c17aa66bb5acc7
languageName: node
linkType: hard
-"@emotion/styled@npm:^11.3.0, @emotion/styled@npm:^11.6.0":
+"@emotion/styled@npm:^11.3.0":
version: 11.6.0
resolution: "@emotion/styled@npm:11.6.0"
dependencies:
@@ -1899,24 +1892,17 @@ __metadata:
languageName: node
linkType: hard
-"@emotion/utils@npm:^1.0.0, @emotion/utils@npm:^1.2.1":
- version: 1.2.1
- resolution: "@emotion/utils@npm:1.2.1"
- checksum: db43ca803361740c14dfb1cca1464d10d27f4c8b40d3e8864e6932ccf375d1450778ff4e4eadee03fb97f2aeb18de9fae98294905596a12ff7d4cd1910414d8d
- languageName: node
- linkType: hard
-
-"@emotion/weak-memoize@npm:^0.2.5":
- version: 0.2.5
- resolution: "@emotion/weak-memoize@npm:0.2.5"
- checksum: cabfaaecabbb407d323098afc0bb2dd2ec9aaea0672f8f2c54b84b99d5f8cc680356cf166583fd5593330ceef29f2c26554c2c65dff06c0a8f5f8c7da69d89f1
+"@emotion/utils@npm:^1.0.0, @emotion/utils@npm:^1.4.2":
+ version: 1.4.2
+ resolution: "@emotion/utils@npm:1.4.2"
+ checksum: 7d0010bf60a2a8c1a033b6431469de4c80e47aeb8fd856a17c1d1f76bbc3a03161a34aeaa78803566e29681ca551e7bf9994b68e9c5f5c796159923e44f78d9a
languageName: node
linkType: hard
-"@emotion/weak-memoize@npm:^0.3.1":
- version: 0.3.1
- resolution: "@emotion/weak-memoize@npm:0.3.1"
- checksum: ed514b3cb94bbacece4ac2450d98898066c0a0698bdeda256e312405ca53634cb83c75889b25cd8bbbe185c80f4c05a1f0a0091e1875460ba6be61d0334f0b8a
+"@emotion/weak-memoize@npm:^0.2.5, @emotion/weak-memoize@npm:^0.4.0":
+ version: 0.4.0
+ resolution: "@emotion/weak-memoize@npm:0.4.0"
+ checksum: 64376af11f1266042d03b3305c30b7502e6084868e33327e944b539091a472f089db307af69240f7188f8bc6b319276fd7b141a36613f1160d73d12a60f6ca1a
languageName: node
linkType: hard
@@ -2284,44 +2270,6 @@ __metadata:
languageName: node
linkType: hard
-"@floating-ui/core@npm:^1.0.0":
- version: 1.6.0
- resolution: "@floating-ui/core@npm:1.6.0"
- dependencies:
- "@floating-ui/utils": "npm:^0.2.1"
- checksum: 667a68036f7dd5ed19442c7792a6002ca02d1799221c4396691bbe0b6008b48f6ccad581225e81fa266bb91232f6c66838a5f825f554217e1ec886178b93381b
- languageName: node
- linkType: hard
-
-"@floating-ui/dom@npm:^1.6.1":
- version: 1.6.3
- resolution: "@floating-ui/dom@npm:1.6.3"
- dependencies:
- "@floating-ui/core": "npm:^1.0.0"
- "@floating-ui/utils": "npm:^0.2.0"
- checksum: d6cac10877918ce5a8d1a24b21738d2eb130a0191043d7c0dd43bccac507844d3b4dc5d4107d3891d82f6007945ca8fb4207a1252506e91c37e211f0f73cf77e
- languageName: node
- linkType: hard
-
-"@floating-ui/react-dom@npm:^2.0.8":
- version: 2.0.8
- resolution: "@floating-ui/react-dom@npm:2.0.8"
- dependencies:
- "@floating-ui/dom": "npm:^1.6.1"
- peerDependencies:
- react: ">=16.8.0"
- react-dom: ">=16.8.0"
- checksum: 4d87451e2dcc54b4753a0d81181036e47821cfd0d4c23f7e9c31590c7c91fb15fb0a5a458969a5ddabd61601eca5875ebd4e40bff37cee31f373b8f1ccc64518
- languageName: node
- linkType: hard
-
-"@floating-ui/utils@npm:^0.2.0, @floating-ui/utils@npm:^0.2.1":
- version: 0.2.1
- resolution: "@floating-ui/utils@npm:0.2.1"
- checksum: ee77756712cf5b000c6bacf11992ffb364f3ea2d0d51cc45197a7e646a17aeb86ea4b192c0b42f3fbb29487aee918a565e84f710b8c3645827767f406a6b4cc9
- languageName: node
- linkType: hard
-
"@gar/promisify@npm:^1.0.1, @gar/promisify@npm:^1.1.3":
version: 1.1.3
resolution: "@gar/promisify@npm:1.1.3"
@@ -2867,73 +2815,51 @@ __metadata:
languageName: node
linkType: hard
-"@mui/base@npm:5.0.0-beta.40":
- version: 5.0.0-beta.40
- resolution: "@mui/base@npm:5.0.0-beta.40"
- dependencies:
- "@babel/runtime": "npm:^7.23.9"
- "@floating-ui/react-dom": "npm:^2.0.8"
- "@mui/types": "npm:^7.2.14"
- "@mui/utils": "npm:^5.15.14"
- "@popperjs/core": "npm:^2.11.8"
- clsx: "npm:^2.1.0"
- prop-types: "npm:^15.8.1"
- peerDependencies:
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
- peerDependenciesMeta:
- "@types/react":
- optional: true
- checksum: 631b4ee389e23d82c16c5845c2849af43000f52f1def639b9bb5bf39fd09f4eab93787d32950b715a7de7b689faab53bb7c9a78f6fd12b663876cf8128d45de1
- languageName: node
- linkType: hard
-
-"@mui/core-downloads-tracker@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/core-downloads-tracker@npm:5.15.20"
- checksum: 0e1f9aa9c85d5f60fa5937edc22dfbebd512671379e3adb7c99a8ef0928bf42daed98cede41a407e810a225554943675e9d976bc0ae17acdc20445c8d2f121b3
+"@mui/core-downloads-tracker@npm:^5.16.14":
+ version: 5.16.14
+ resolution: "@mui/core-downloads-tracker@npm:5.16.14"
+ checksum: eb866003ee4564c40423aadc4513b4c7d72c69723fe7dee4697ac70c19951e6e11093bb190761dc51a8f4d2731e562034ecb284930eec931bae1a56b8e18ca60
languageName: node
linkType: hard
-"@mui/icons-material@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/icons-material@npm:5.15.20"
+"@mui/icons-material@npm:^5.15.20, @mui/icons-material@npm:^5.16.12":
+ version: 5.16.14
+ resolution: "@mui/icons-material@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
peerDependencies:
"@mui/material": ^5.0.0
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@types/react":
optional: true
- checksum: 3765340625ad0c5181cffbec1a9a52185e9add4d2eda1f8c3e262b11bf9ca1e8cdf87f67f550b300d8c3c31277b7c8bb38261c964f6180d31b3e928a1dc03315
+ checksum: 11632d1f9904fda0a751e442d3d948a83977cd9ba81481cda4e61b9dfdbd80b0616e27750728c066a4dc505035d7ad6aa29ff7c6160a9b52a2b313fc89aa4be3
languageName: node
linkType: hard
-"@mui/material@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/material@npm:5.15.20"
+"@mui/material@npm:^5.16.12":
+ version: 5.16.14
+ resolution: "@mui/material@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
- "@mui/base": "npm:5.0.0-beta.40"
- "@mui/core-downloads-tracker": "npm:^5.15.20"
- "@mui/system": "npm:^5.15.20"
- "@mui/types": "npm:^7.2.14"
- "@mui/utils": "npm:^5.15.20"
+ "@mui/core-downloads-tracker": "npm:^5.16.14"
+ "@mui/system": "npm:^5.16.14"
+ "@mui/types": "npm:^7.2.15"
+ "@mui/utils": "npm:^5.16.14"
+ "@popperjs/core": "npm:^2.11.8"
"@types/react-transition-group": "npm:^4.4.10"
clsx: "npm:^2.1.0"
csstype: "npm:^3.1.3"
prop-types: "npm:^15.8.1"
- react-is: "npm:^18.2.0"
+ react-is: "npm:^19.0.0"
react-transition-group: "npm:^4.4.5"
peerDependencies:
"@emotion/react": ^11.5.0
"@emotion/styled": ^11.3.0
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
- react-dom: ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@emotion/react":
optional: true
@@ -2941,65 +2867,65 @@ __metadata:
optional: true
"@types/react":
optional: true
- checksum: 0882661f83f5b73c06d6402ddd9c0f8e471198b838c4a456db03a5256d8febc688abc41645156d155536106a44bd28798efcfdaec00b665ab91dbd5c9dee83eb
+ checksum: e313c1274f18a245f7128c9ccbd6444d6edb91a99fef7b6ec9ece4d2d19da0fec9a484afc24c0c35e9fcc53fb090dc524083d682c78428754a1c5b6cebb70a63
languageName: node
linkType: hard
-"@mui/private-theming@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/private-theming@npm:5.15.20"
+"@mui/private-theming@npm:^5.16.14":
+ version: 5.16.14
+ resolution: "@mui/private-theming@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
- "@mui/utils": "npm:^5.15.20"
+ "@mui/utils": "npm:^5.16.14"
prop-types: "npm:^15.8.1"
peerDependencies:
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@types/react":
optional: true
- checksum: d6707ef884769a58a9dac23328138cd2dbb3dbdcfbf46beae406638628a77b2975aaf787f863143ae97ea2d5f6eca8d0ff929f2159f3f9b58bcedb2e01c7bce6
+ checksum: 9723b63bd19000c096884f5a8900dc228afbe829d880d371865ae29387448cc669c10160bb55369210f3e903afb577ba832a39bc565427351bc27b42591c8099
languageName: node
linkType: hard
-"@mui/styled-engine@npm:^5.15.14":
- version: 5.15.14
- resolution: "@mui/styled-engine@npm:5.15.14"
+"@mui/styled-engine@npm:^5.16.14":
+ version: 5.16.14
+ resolution: "@mui/styled-engine@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
- "@emotion/cache": "npm:^11.11.0"
+ "@emotion/cache": "npm:^11.13.5"
csstype: "npm:^3.1.3"
prop-types: "npm:^15.8.1"
peerDependencies:
"@emotion/react": ^11.4.1
"@emotion/styled": ^11.3.0
- react: ^17.0.0 || ^18.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@emotion/react":
optional: true
"@emotion/styled":
optional: true
- checksum: 0d262ea0b3c117f865af1cd52b992592c24432e491b35e712159bb49adfd776ee9a532abbc4ab08889f308e75d30082a0fee809119d5d61a82b3277212655319
+ checksum: cd512faea4ad3ff5a9b315e136a518223ea3e4e34462fe70c56d1f166c46bee0a885ed982773d75c1d56ead62b95989cc5907601e8d65bfa75494b3f3288c2ad
languageName: node
linkType: hard
-"@mui/system@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/system@npm:5.15.20"
+"@mui/system@npm:^5.16.14":
+ version: 5.16.14
+ resolution: "@mui/system@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
- "@mui/private-theming": "npm:^5.15.20"
- "@mui/styled-engine": "npm:^5.15.14"
- "@mui/types": "npm:^7.2.14"
- "@mui/utils": "npm:^5.15.20"
+ "@mui/private-theming": "npm:^5.16.14"
+ "@mui/styled-engine": "npm:^5.16.14"
+ "@mui/types": "npm:^7.2.15"
+ "@mui/utils": "npm:^5.16.14"
clsx: "npm:^2.1.0"
csstype: "npm:^3.1.3"
prop-types: "npm:^15.8.1"
peerDependencies:
"@emotion/react": ^11.5.0
"@emotion/styled": ^11.3.0
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@emotion/react":
optional: true
@@ -3007,37 +2933,39 @@ __metadata:
optional: true
"@types/react":
optional: true
- checksum: 7561d14d613e882cbe8959cbb779e6641542242e5a79974bad306c59c1505b5924cb2b866619b55d064aae1a1e8421dc3a613ad1a4cf330be7eebd1881170cff
+ checksum: d7ab8dfd9fbecbde4423a0d432e63f45cd8c96bb4e48116f9f9b46cb001c2e32df3a1f09727f8b30c1bc182774cc33e338b1475287a2985dba795ee5486fc4cb
languageName: node
linkType: hard
-"@mui/types@npm:^7.2.14":
- version: 7.2.14
- resolution: "@mui/types@npm:7.2.14"
+"@mui/types@npm:^7.2.15":
+ version: 7.2.21
+ resolution: "@mui/types@npm:7.2.21"
peerDependencies:
- "@types/react": ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@types/react":
optional: true
- checksum: d4e0a9fce4bddfb5e0b7b6be1b15b591df33bb90ef0087e4bd5fe85f00f62776c7ed0e4698e7fb43213e1f04064aac1695b53ca52aaeaee7dbba248a792bdd1e
+ checksum: c0038ae402a3cfb2805a19167362fb5ac2ca1403f0ef3dad688d1e2276afe757b69d5fb1e3af4cd0e985b9221d287fd863c5b00f29fd07a276c7de9e3423a0f3
languageName: node
linkType: hard
-"@mui/utils@npm:^5.15.14, @mui/utils@npm:^5.15.20":
- version: 5.15.20
- resolution: "@mui/utils@npm:5.15.20"
+"@mui/utils@npm:^5.16.12, @mui/utils@npm:^5.16.14":
+ version: 5.16.14
+ resolution: "@mui/utils@npm:5.16.14"
dependencies:
"@babel/runtime": "npm:^7.23.9"
- "@types/prop-types": "npm:^15.7.11"
+ "@mui/types": "npm:^7.2.15"
+ "@types/prop-types": "npm:^15.7.12"
+ clsx: "npm:^2.1.1"
prop-types: "npm:^15.8.1"
- react-is: "npm:^18.2.0"
+ react-is: "npm:^19.0.0"
peerDependencies:
- "@types/react": ^17.0.0 || ^18.0.0
- react: ^17.0.0 || ^18.0.0
+ "@types/react": ^17.0.0 || ^18.0.0 || ^19.0.0
+ react: ^17.0.0 || ^18.0.0 || ^19.0.0
peerDependenciesMeta:
"@types/react":
optional: true
- checksum: d745895db047ef016681482f3d4710aa487f9e7bcd457ac2a395bdaf719a6a98f8bf5f1920d4729b0bc69f7ef2153624aa6a565ec0e31f76c33d7167397ac4d9
+ checksum: 5148dedb8597a76df193df4c3b4ff4bb3c19d99f3b69df8b9d6c9905c5cc5eb750a71429aea7e52a03ad8b858c7ec48d04e5670ecf4e39b8c3a6a84f1a83721a
languageName: node
linkType: hard
@@ -5064,10 +4992,10 @@ __metadata:
languageName: node
linkType: hard
-"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.11":
- version: 15.7.11
- resolution: "@types/prop-types@npm:15.7.11"
- checksum: e53423cf9d510515ef8b47ff42f4f1b65a7b7b37c8704e2dbfcb9a60defe0c0e1f3cb1acfdeb466bad44ca938d7c79bffdd51b48ffb659df2432169d0b27a132
+"@types/prop-types@npm:*, @types/prop-types@npm:^15.7.12":
+ version: 15.7.14
+ resolution: "@types/prop-types@npm:15.7.14"
+ checksum: 1ec775160bfab90b67a782d735952158c7e702ca4502968aa82565bd8e452c2de8601c8dfe349733073c31179116cf7340710160d3836aa8a1ef76d1532893b1
languageName: node
linkType: hard
@@ -7658,7 +7586,7 @@ __metadata:
ink-text-input: "npm:^6.0.0"
lodash: "npm:~4.17.5"
meow: "npm:^9.0.0"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
typescript: "npm:^5.1.3"
yn: "npm:^5.0.0"
bin:
@@ -8247,8 +8175,8 @@ __metadata:
resolution: "demo@workspace:examples/demo"
dependencies:
"@apollo/client": "npm:^3.3.19"
- "@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
+ "@mui/material": "npm:^5.16.12"
"@types/fetch-mock": "npm:^7.3.2"
"@types/jest": "npm:^29.5.2"
"@types/node": "npm:^20.10.7"
@@ -8273,9 +8201,9 @@ __metadata:
ra-input-rich-text: "npm:^5.0.0"
ra-language-english: "npm:^5.0.0"
ra-language-french: "npm:^5.0.0"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.0.0"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
recharts: "npm:^2.1.15"
@@ -14045,13 +13973,13 @@ __metadata:
version: 0.0.0-use.local
resolution: "no-code@workspace:examples/no-code"
dependencies:
- "@mui/material": "npm:^5.15.20"
+ "@mui/material": "npm:^5.16.12"
"@vitejs/plugin-react": "npm:^4.2.1"
ra-data-local-storage: "npm:^5.0.0"
ra-no-code: "npm:^5.0.0"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.0.0"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
@@ -15849,14 +15777,13 @@ __metadata:
jsonexport: "npm:^3.2.0"
lodash: "npm:^4.17.21"
query-string: "npm:^7.1.3"
- react: "npm:^18.3.1"
- react-dom: "npm:^18.3.1"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
react-is: "npm:^18.2.0"
react-router: "npm:^6.25.1"
react-router-dom: "npm:^6.25.1"
- react-test-renderer: "npm:^18.2.0"
recharts: "npm:^2.1.15"
rimraf: "npm:^3.0.2"
typescript: "npm:^5.1.3"
@@ -16009,7 +15936,7 @@ __metadata:
resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text"
dependencies:
"@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
+ "@mui/material": "npm:^5.16.12"
"@testing-library/react": "npm:^15.0.7"
"@tiptap/core": "npm:^2.0.3"
"@tiptap/extension-color": "npm:^2.0.3"
@@ -16030,15 +15957,15 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-data-fakerest: "npm:^5.4.3"
ra-ui-materialui: "npm:^5.4.3"
- react: "npm:^18.3.1"
- react-dom: "npm:^18.3.1"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
react-hook-form: "npm:^7.53.0"
rimraf: "npm:^3.0.2"
tippy.js: "npm:^6.3.7"
typescript: "npm:^5.1.3"
peerDependencies:
- "@mui/icons-material": ^5.15.20
- "@mui/material": ^5.15.20
+ "@mui/icons-material": ^5.16.12
+ "@mui/material": ^5.16.12
ra-core: ^5.0.0
ra-ui-materialui: ^5.0.0
react: ^18.0.0 || ^19.0.0
@@ -16080,17 +16007,17 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.3.0"
ra-data-local-storage: "npm:^5.4.3"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.4.3"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
react-dropzone: "npm:^14.2.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
rimraf: "npm:^3.0.2"
typescript: "npm:^5.1.3"
peerDependencies:
- "@mui/icons-material": ^5.15.20
- "@mui/material": ^5.15.20
+ "@mui/icons-material": ^5.16.12
+ "@mui/material": ^5.16.12
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
languageName: unknown
@@ -16100,9 +16027,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "ra-ui-materialui@workspace:packages/ra-ui-materialui"
dependencies:
- "@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
- "@mui/utils": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
+ "@mui/material": "npm:^5.16.12"
+ "@mui/utils": "npm:^5.16.12"
"@tanstack/react-query": "npm:^5.21.7"
"@testing-library/react": "npm:^15.0.7"
"@types/dompurify": "npm:^3.0.2"
@@ -16125,15 +16052,14 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-i18n-polyglot: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
- react: "npm:^18.3.1"
- react-dom: "npm:^18.3.1"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
react-dropzone: "npm:^14.2.3"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
react-is: "npm:^18.2.0"
react-router: "npm:^6.25.1"
react-router-dom: "npm:^6.25.1"
- react-test-renderer: "npm:^18.2.0"
react-transition-group: "npm:^4.4.5"
rimraf: "npm:^3.0.2"
typescript: "npm:^5.1.3"
@@ -16200,8 +16126,8 @@ __metadata:
resolution: "react-admin-crm@workspace:examples/crm"
dependencies:
"@hello-pangea/dnd": "npm:^16.3.0"
- "@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
+ "@mui/material": "npm:^5.16.12"
"@nivo/bar": "npm:^0.80.0"
"@nivo/core": "npm:^0.80.0"
"@testing-library/jest-dom": "npm:^6.4.5"
@@ -16221,10 +16147,10 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.4.1"
ra-data-fakerest: "npm:^5.3.0"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.3.0"
react-cropper: "npm:^2.3.3"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
react-error-boundary: "npm:^4.0.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -16272,8 +16198,8 @@ __metadata:
lolex: "npm:~2.3.2"
prettier: "npm:~3.2.5"
raf: "npm:~3.4.1"
- react: "npm:^18.3.1"
- react-dom: "npm:^18.3.1"
+ react: "npm:^19.0.0"
+ react-dom: "npm:^19.0.0"
storybook: "npm:^8.4.4"
ts-jest: "npm:^29.1.0"
typescript: "npm:^5.1.3"
@@ -16288,10 +16214,8 @@ __metadata:
version: 0.0.0-use.local
resolution: "react-admin@workspace:packages/react-admin"
dependencies:
- "@emotion/react": "npm:^11.4.1"
- "@emotion/styled": "npm:^11.3.0"
- "@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
+ "@mui/material": "npm:^5.16.12"
cross-env: "npm:^5.2.0"
expect: "npm:^27.4.6"
ra-core: "npm:^5.4.3"
@@ -16347,15 +16271,14 @@ __metadata:
languageName: node
linkType: hard
-"react-dom@npm:^18.3.1":
- version: 18.3.1
- resolution: "react-dom@npm:18.3.1"
+"react-dom@npm:^19.0.0":
+ version: 19.0.0
+ resolution: "react-dom@npm:19.0.0"
dependencies:
- loose-envify: "npm:^1.1.0"
- scheduler: "npm:^0.23.2"
+ scheduler: "npm:^0.25.0"
peerDependencies:
- react: ^18.3.1
- checksum: a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85
+ react: ^19.0.0
+ checksum: a36ce7ab507b237ae2759c984cdaad4af4096d8199fb65b3815c16825e5cfeb7293da790a3fc2184b52bfba7ba3ff31c058c01947aff6fd1a3701632aabaa6a9
languageName: node
linkType: hard
@@ -16417,17 +16340,24 @@ __metadata:
languageName: node
linkType: hard
-"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.0.0, react-is@npm:^18.2.0":
+"react-is@npm:^17.0.1":
+ version: 17.0.2
+ resolution: "react-is@npm:17.0.2"
+ checksum: 2bdb6b93fbb1820b024b496042cce405c57e2f85e777c9aabd55f9b26d145408f9f74f5934676ffdc46f3dcff656d78413a6e43968e7b3f92eea35b3052e9053
+ languageName: node
+ linkType: hard
+
+"react-is@npm:^18.0.0, react-is@npm:^18.2.0":
version: 18.2.0
resolution: "react-is@npm:18.2.0"
checksum: 6eb5e4b28028c23e2bfcf73371e72cd4162e4ac7ab445ddae2afe24e347a37d6dc22fae6e1748632cd43c6d4f9b8f86dcf26bf9275e1874f436d129952528ae0
languageName: node
linkType: hard
-"react-is@npm:^17.0.1":
- version: 17.0.2
- resolution: "react-is@npm:17.0.2"
- checksum: 2bdb6b93fbb1820b024b496042cce405c57e2f85e777c9aabd55f9b26d145408f9f74f5934676ffdc46f3dcff656d78413a6e43968e7b3f92eea35b3052e9053
+"react-is@npm:^19.0.0":
+ version: 19.0.0
+ resolution: "react-is@npm:19.0.0"
+ checksum: d1be8e8500cf04f76df71942a21ef3a71266397a383d7ec8885f35190df818d35c65efd35aed7be47a89ad99aaff2c52e0c4e39e8930844a6b997622e50625a8
languageName: node
linkType: hard
@@ -16525,18 +16455,6 @@ __metadata:
languageName: node
linkType: hard
-"react-shallow-renderer@npm:^16.15.0":
- version: 16.15.0
- resolution: "react-shallow-renderer@npm:16.15.0"
- dependencies:
- object-assign: "npm:^4.1.1"
- react-is: "npm:^16.12.0 || ^17.0.0 || ^18.0.0"
- peerDependencies:
- react: ^16.0.0 || ^17.0.0 || ^18.0.0
- checksum: c194d741792e86043a4ae272f7353c1cb9412bc649945c4220c6a101a6ea5410cceb3d65d5a4d750f11a24f7426e8eec7977e8a4e3ad5d3ee235ca2b18166fa8
- languageName: node
- linkType: hard
-
"react-simple-animate@npm:^3.3.12":
version: 3.3.12
resolution: "react-simple-animate@npm:3.3.12"
@@ -16561,19 +16479,6 @@ __metadata:
languageName: node
linkType: hard
-"react-test-renderer@npm:^18.2.0":
- version: 18.2.0
- resolution: "react-test-renderer@npm:18.2.0"
- dependencies:
- react-is: "npm:^18.2.0"
- react-shallow-renderer: "npm:^16.15.0"
- scheduler: "npm:^0.23.0"
- peerDependencies:
- react: ^18.2.0
- checksum: 53dfada1da1e8dd0498a5601e9eea3dc6ca23c6c2694d1cab9712faea869c11e4ce1c9a618d674cb668a668b41fb6bcf9a7b0a078cd853b1922f002fa22f42c8
- languageName: node
- linkType: hard
-
"react-transition-group@npm:2.9.0":
version: 2.9.0
resolution: "react-transition-group@npm:2.9.0"
@@ -16604,12 +16509,10 @@ __metadata:
languageName: node
linkType: hard
-"react@npm:^18.3.1":
- version: 18.3.1
- resolution: "react@npm:18.3.1"
- dependencies:
- loose-envify: "npm:^1.1.0"
- checksum: 283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3
+"react@npm:^19.0.0":
+ version: 19.0.0
+ resolution: "react@npm:19.0.0"
+ checksum: 9cad8f103e8e3a16d15cb18a0d8115d8bd9f9e1ce3420310aea381eb42aa0a4f812cf047bb5441349257a05fba8a291515691e3cb51267279b2d2c3253f38471
languageName: node
linkType: hard
@@ -17338,12 +17241,10 @@ __metadata:
languageName: node
linkType: hard
-"scheduler@npm:^0.23.0, scheduler@npm:^0.23.2":
- version: 0.23.2
- resolution: "scheduler@npm:0.23.2"
- dependencies:
- loose-envify: "npm:^1.1.0"
- checksum: 26383305e249651d4c58e6705d5f8425f153211aef95f15161c151f7b8de885f24751b377e4a0b3dd42cce09aad3f87a61dab7636859c0d89b7daf1a1e2a5c78
+"scheduler@npm:^0.23.0, scheduler@npm:^0.23.2, scheduler@npm:^0.25.0":
+ version: 0.25.0
+ resolution: "scheduler@npm:0.25.0"
+ checksum: a4bb1da406b613ce72c1299db43759526058fdcc413999c3c3e0db8956df7633acf395cb20eb2303b6a65d658d66b6585d344460abaee8080b4aa931f10eaafe
languageName: node
linkType: hard
@@ -17592,11 +17493,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "simple@workspace:examples/simple"
dependencies:
- "@emotion/react": "npm:^11.7.1"
- "@emotion/styled": "npm:^11.6.0"
"@hookform/devtools": "npm:^4.0.2"
- "@mui/icons-material": "npm:^5.15.20"
- "@mui/material": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
+ "@mui/material": "npm:^5.16.12"
"@tanstack/react-query": "npm:^5.21.7"
"@tanstack/react-query-devtools": "npm:^5.21.7"
"@vitejs/plugin-react": "npm:^4.2.1"
@@ -17607,9 +17506,9 @@ __metadata:
ra-input-rich-text: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
ra-language-french: "npm:^5.4.3"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.4.3"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
react-hook-form: "npm:^7.53.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -18706,9 +18605,9 @@ __metadata:
"@types/react-dom": "npm:^18.3.0"
"@vitejs/plugin-react": "npm:^4.2.1"
ra-data-json-server: "npm:^5.0.0"
- react: "npm:^18.3.1"
+ react: "npm:^19.0.0"
react-admin: "npm:^5.0.0"
- react-dom: "npm:^18.3.1"
+ react-dom: "npm:^19.0.0"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
From cefb09828a9a8d539cc7e1f4c6ed7960d9915ca2 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Wed, 8 Jan 2025 11:07:20 +0100
Subject: [PATCH 02/18] Stabilize cypress tests
---
cypress/support/LoginPage.js | 4 ++++
examples/simple/vite.config.ts | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/cypress/support/LoginPage.js b/cypress/support/LoginPage.js
index 00cc33f136c..a91820b5e82 100644
--- a/cypress/support/LoginPage.js
+++ b/cypress/support/LoginPage.js
@@ -1,8 +1,10 @@
export default url => ({
elements: {
+ appLoader: '.app-loader',
username: "input[name='username']",
password: "input[name='password']",
submitButton: 'button',
+ title: '#react-admin-title',
},
navigate() {
@@ -18,5 +20,7 @@ export default url => ({
cy.get(this.elements.username).clear().type(username);
cy.get(this.elements.password).clear().type(password);
cy.get(this.elements.submitButton).click();
+ cy.get(this.elements.title);
+ cy.get(this.elements.appLoader);
},
});
diff --git a/examples/simple/vite.config.ts b/examples/simple/vite.config.ts
index 67c3f022156..716ada2c9f4 100644
--- a/examples/simple/vite.config.ts
+++ b/examples/simple/vite.config.ts
@@ -25,7 +25,7 @@ export default defineConfig(async () => {
dirName,
'package.json'
),
- { assert: { type: 'json' } }
+ { with: { type: 'json' } }
);
aliases.push({
find: new RegExp(`^${packageJson.default.name}$`),
From 6ac6fa48670930cd22d549701658998282b8f1e8 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Wed, 8 Jan 2025 11:26:05 +0100
Subject: [PATCH 03/18] Fix auth tests
---
cypress/e2e/auth.cy.js | 2 +-
cypress/support/LoginPage.js | 8 +++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/cypress/e2e/auth.cy.js b/cypress/e2e/auth.cy.js
index 94c4fbfad53..6d69eb75851 100644
--- a/cypress/e2e/auth.cy.js
+++ b/cypress/e2e/auth.cy.js
@@ -20,7 +20,7 @@ describe('Authentication', () => {
it('should not login with incorrect credentials', () => {
ListPage.navigate();
ListPage.logout();
- LoginPage.login('foo', 'bar');
+ LoginPage.login('foo', 'bar', true);
cy.contains('Authentication failed, please retry');
});
it('should login with correct credentials', () => {
diff --git a/cypress/support/LoginPage.js b/cypress/support/LoginPage.js
index a91820b5e82..1df9965a9cc 100644
--- a/cypress/support/LoginPage.js
+++ b/cypress/support/LoginPage.js
@@ -16,11 +16,13 @@ export default url => ({
cy.get(this.elements.username);
},
- login(username = 'login', password = 'password') {
+ login(username = 'login', password = 'password', shouldFail = false) {
cy.get(this.elements.username).clear().type(username);
cy.get(this.elements.password).clear().type(password);
cy.get(this.elements.submitButton).click();
- cy.get(this.elements.title);
- cy.get(this.elements.appLoader);
+ if (!shouldFail) {
+ cy.get(this.elements.title);
+ cy.get(this.elements.appLoader);
+ }
},
});
From 8d6fd0e1b341695a1d9d417afd9124c5d16e2c06 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Wed, 8 Jan 2025 15:57:04 +0100
Subject: [PATCH 04/18] Fix SimpleList does not propagate its resource prop
---
packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx | 2 ++
.../ra-ui-materialui/src/list/SimpleList/SimpleListItem.tsx | 1 +
2 files changed, 3 insertions(+)
diff --git a/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx b/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx
index d16d6195f09..d9c03362c2d 100644
--- a/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx
+++ b/packages/ra-ui-materialui/src/list/SimpleList/SimpleList.tsx
@@ -85,6 +85,7 @@ export const SimpleList = (
ref,
rowSx,
rowStyle,
+ resource,
...rest
} = props;
const { data, isPending, total } =
@@ -121,6 +122,7 @@ export const SimpleList = (
rowClick={rowClick}
rowSx={rowSx}
rowStyle={rowStyle}
+ resource={resource}
>
(
typeof linkType === 'function' || typeof rowClick === 'function';
const pathForRecord = useGetPathForRecord({
link: isFunctionLink ? false : linkType ?? rowClick,
+ resource,
});
const getPathForRecord = useGetPathForRecordCallback();
const handleClick = useEvent(async () => {
From c4775c93284e1f5ed3b618dd89e00917bcbacc0a Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 09:48:04 +0100
Subject: [PATCH 05/18] Revert devDependency upgrade to react-19 in react-admin
packages
---
examples/crm/package.json | 4 +-
examples/no-code/package.json | 4 +-
examples/simple/package.json | 4 +-
package.json | 4 +-
packages/create-react-admin/package.json | 2 +-
packages/ra-core/package.json | 4 +-
packages/ra-input-rich-text/package.json | 4 +-
packages/ra-no-code/package.json | 4 +-
packages/ra-ui-materialui/package.json | 4 +-
yarn.lock | 55 ++++++++++++++++--------
10 files changed, 55 insertions(+), 34 deletions(-)
diff --git a/examples/crm/package.json b/examples/crm/package.json
index a3f028d1f41..e73bae35864 100644
--- a/examples/crm/package.json
+++ b/examples/crm/package.json
@@ -15,10 +15,10 @@
"lodash": "~4.17.5",
"papaparse": "^5.4.1",
"ra-data-fakerest": "^5.3.0",
- "react": "^19.0.0",
+ "react": "18.3.1",
"react-admin": "^5.3.0",
"react-cropper": "^2.3.3",
- "react-dom": "^19.0.0",
+ "react-dom": "18.3.1",
"react-error-boundary": "^4.0.3",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/examples/no-code/package.json b/examples/no-code/package.json
index f8eb697eb7b..04f5cf5cb85 100644
--- a/examples/no-code/package.json
+++ b/examples/no-code/package.json
@@ -11,9 +11,9 @@
"@mui/material": "^5.16.12",
"ra-data-local-storage": "^5.0.0",
"ra-no-code": "^5.0.0",
- "react": "^19.0.0",
+ "react": "18.3.1",
"react-admin": "^5.0.0",
- "react-dom": "^19.0.0"
+ "react-dom": "18.3.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index 119f4611b17..c4fbf57794d 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -21,9 +21,9 @@
"ra-input-rich-text": "^5.4.3",
"ra-language-english": "^5.4.3",
"ra-language-french": "^5.4.3",
- "react": "^19.0.0",
+ "react": "18.3.1",
"react-admin": "^5.4.3",
- "react-dom": "^19.0.0",
+ "react-dom": "18.3.1",
"react-hook-form": "^7.53.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/package.json b/package.json
index be2d218e177..9753823fa99 100644
--- a/package.json
+++ b/package.json
@@ -56,8 +56,8 @@
"lolex": "~2.3.2",
"prettier": "~3.2.5",
"raf": "~3.4.1",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "react": "18.3.1",
+ "react-dom": "18.3.1",
"storybook": "^8.4.4",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3",
diff --git a/packages/create-react-admin/package.json b/packages/create-react-admin/package.json
index e296d9fba0e..6525d5b7d3c 100644
--- a/packages/create-react-admin/package.json
+++ b/packages/create-react-admin/package.json
@@ -27,7 +27,7 @@
"ink-text-input": "^6.0.0",
"lodash": "~4.17.5",
"meow": "^9.0.0",
- "react": "^19.0.0",
+ "react": "18.3.1",
"yn": "^5.0.0"
},
"devDependencies": {
diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json
index 3c86d18cc62..3705b8ed8f8 100644
--- a/packages/ra-core/package.json
+++ b/packages/ra-core/package.json
@@ -38,8 +38,8 @@
"expect": "^27.4.6",
"ignore-styles": "~5.0.1",
"jscodeshift": "^0.15.2",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "react": "18.3.1",
+ "react-dom": "18.3.1",
"react-hook-form": "^7.53.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json
index 0454db581cb..0836a61658d 100644
--- a/packages/ra-input-rich-text/package.json
+++ b/packages/ra-input-rich-text/package.json
@@ -55,8 +55,8 @@
"ra-core": "^5.4.3",
"ra-data-fakerest": "^5.4.3",
"ra-ui-materialui": "^5.4.3",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "react": "18.3.1",
+ "react-dom": "18.3.1",
"react-hook-form": "^7.53.0",
"rimraf": "^3.0.2",
"tippy.js": "^6.3.7",
diff --git a/packages/ra-no-code/package.json b/packages/ra-no-code/package.json
index 987c5f99a32..433917365ff 100644
--- a/packages/ra-no-code/package.json
+++ b/packages/ra-no-code/package.json
@@ -28,8 +28,8 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"cross-env": "^5.2.0",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "react": "18.3.1",
+ "react-dom": "18.3.1",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"rimraf": "^3.0.2",
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index c34b2cf5ab0..abfffb648f5 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -42,8 +42,8 @@
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "react": "18.3.1",
+ "react-dom": "18.3.1",
"react-hook-form": "^7.53.0",
"react-is": "^18.2.0",
"react-router": "^6.25.1",
diff --git a/yarn.lock b/yarn.lock
index 66d420ee580..15dc78f2c49 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7586,7 +7586,7 @@ __metadata:
ink-text-input: "npm:^6.0.0"
lodash: "npm:~4.17.5"
meow: "npm:^9.0.0"
- react: "npm:^19.0.0"
+ react: "npm:18.3.1"
typescript: "npm:^5.1.3"
yn: "npm:^5.0.0"
bin:
@@ -13977,9 +13977,9 @@ __metadata:
"@vitejs/plugin-react": "npm:^4.2.1"
ra-data-local-storage: "npm:^5.0.0"
ra-no-code: "npm:^5.0.0"
- react: "npm:^19.0.0"
+ react: "npm:18.3.1"
react-admin: "npm:^5.0.0"
- react-dom: "npm:^19.0.0"
+ react-dom: "npm:18.3.1"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
@@ -15777,8 +15777,8 @@ __metadata:
jsonexport: "npm:^3.2.0"
lodash: "npm:^4.17.21"
query-string: "npm:^7.1.3"
- react: "npm:^19.0.0"
- react-dom: "npm:^19.0.0"
+ react: "npm:18.3.1"
+ react-dom: "npm:18.3.1"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
react-is: "npm:^18.2.0"
@@ -15957,8 +15957,8 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-data-fakerest: "npm:^5.4.3"
ra-ui-materialui: "npm:^5.4.3"
- react: "npm:^19.0.0"
- react-dom: "npm:^19.0.0"
+ react: "npm:18.3.1"
+ react-dom: "npm:18.3.1"
react-hook-form: "npm:^7.53.0"
rimraf: "npm:^3.0.2"
tippy.js: "npm:^6.3.7"
@@ -16007,9 +16007,9 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.3.0"
ra-data-local-storage: "npm:^5.4.3"
- react: "npm:^19.0.0"
+ react: "npm:18.3.1"
react-admin: "npm:^5.4.3"
- react-dom: "npm:^19.0.0"
+ react-dom: "npm:18.3.1"
react-dropzone: "npm:^14.2.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -16052,8 +16052,8 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-i18n-polyglot: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
- react: "npm:^19.0.0"
- react-dom: "npm:^19.0.0"
+ react: "npm:18.3.1"
+ react-dom: "npm:18.3.1"
react-dropzone: "npm:^14.2.3"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
@@ -16147,10 +16147,10 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.4.1"
ra-data-fakerest: "npm:^5.3.0"
- react: "npm:^19.0.0"
+ react: "npm:18.3.1"
react-admin: "npm:^5.3.0"
react-cropper: "npm:^2.3.3"
- react-dom: "npm:^19.0.0"
+ react-dom: "npm:18.3.1"
react-error-boundary: "npm:^4.0.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -16198,8 +16198,8 @@ __metadata:
lolex: "npm:~2.3.2"
prettier: "npm:~3.2.5"
raf: "npm:~3.4.1"
- react: "npm:^19.0.0"
- react-dom: "npm:^19.0.0"
+ react: "npm:18.3.1"
+ react-dom: "npm:18.3.1"
storybook: "npm:^8.4.4"
ts-jest: "npm:^29.1.0"
typescript: "npm:^5.1.3"
@@ -16271,6 +16271,18 @@ __metadata:
languageName: node
linkType: hard
+"react-dom@npm:18.3.1":
+ version: 18.3.1
+ resolution: "react-dom@npm:18.3.1"
+ dependencies:
+ loose-envify: "npm:^1.1.0"
+ scheduler: "npm:^0.23.2"
+ peerDependencies:
+ react: ^18.3.1
+ checksum: a752496c1941f958f2e8ac56239172296fcddce1365ce45222d04a1947e0cc5547df3e8447f855a81d6d39f008d7c32eab43db3712077f09e3f67c4874973e85
+ languageName: node
+ linkType: hard
+
"react-dom@npm:^19.0.0":
version: 19.0.0
resolution: "react-dom@npm:19.0.0"
@@ -16509,6 +16521,15 @@ __metadata:
languageName: node
linkType: hard
+"react@npm:18.3.1":
+ version: 18.3.1
+ resolution: "react@npm:18.3.1"
+ dependencies:
+ loose-envify: "npm:^1.1.0"
+ checksum: 283e8c5efcf37802c9d1ce767f302dd569dd97a70d9bb8c7be79a789b9902451e0d16334b05d73299b20f048cbc3c7d288bbbde10b701fa194e2089c237dbea3
+ languageName: node
+ linkType: hard
+
"react@npm:^19.0.0":
version: 19.0.0
resolution: "react@npm:19.0.0"
@@ -17506,9 +17527,9 @@ __metadata:
ra-input-rich-text: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
ra-language-french: "npm:^5.4.3"
- react: "npm:^19.0.0"
+ react: "npm:18.3.1"
react-admin: "npm:^5.4.3"
- react-dom: "npm:^19.0.0"
+ react-dom: "npm:18.3.1"
react-hook-form: "npm:^7.53.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
From c4765ef1cfa82dac43bbc5068731167e44b2fa26 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 09:48:14 +0100
Subject: [PATCH 06/18] Use react-19 features in demo
---
examples/demo/src/App.tsx | 2 +-
examples/demo/src/products/ProductCreate.tsx | 34 +++-
examples/demo/src/products/ProductEdit.tsx | 164 ++++++++++---------
examples/demo/src/products/ProductList.tsx | 3 +
4 files changed, 125 insertions(+), 78 deletions(-)
diff --git a/examples/demo/src/App.tsx b/examples/demo/src/App.tsx
index c28639a00bd..409f47ff8ea 100644
--- a/examples/demo/src/App.tsx
+++ b/examples/demo/src/App.tsx
@@ -47,7 +47,7 @@ const App = () => {
const darkTheme = themes.find(theme => theme.name === themeName)?.dark;
return (
import('ra-input-rich-text').then(module => ({
@@ -7,8 +16,29 @@ const RichTextInput = React.lazy(() =>
}))
);
+const ProductTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const resource = useResourceContext();
+ const getResourceLabel = useGetResourceLabel();
+ if (!resource) {
+ throw new Error(
+ 'useCreateController requires a non-empty resource prop or context'
+ );
+ }
+ const defaultTitle = translate('ra.page.create', {
+ name: getResourceLabel(resource, 1),
+ });
+ return (
+ <>
+ {`${title} - ${defaultTitle}`}
+ {defaultTitle}
+ >
+ );
+};
+
const ProductCreate = () => (
-
+ }>
);
const ProductTitle = () => {
+ const title = useDefaultTitle();
+
const record = useRecordContext();
- return record ? Poster "{record.reference}" : null;
+ return record ? (
+ <>
+ {`${title} - Poster "${record.reference}`}
+ Poster "{record.reference}"
+ >
+ ) : null;
};
-const ProductEdit = () => (
- }>
-
- }
- >
-
-
-
-
- }
- >
-
-
- }
- >
-
-
- {
+ return (
+ }>
+
+ }
+ >
+
+
+
+
+ }
+ >
+
+
+ }
+ >
+
- }
- path="reviews"
- sx={{ minHeight: 48 }}
- iconPosition="start"
- icon={}
- >
- }
+
+
+ }
+ path="reviews"
+ sx={{ minHeight: 48 }}
+ iconPosition="start"
+ icon={}
>
- }
>
-
-
-
-
-
-
-
-
-
-
-
-
-);
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
const req = [required()];
diff --git a/examples/demo/src/products/ProductList.tsx b/examples/demo/src/products/ProductList.tsx
index 6083d4c01f3..59639312ddb 100644
--- a/examples/demo/src/products/ProductList.tsx
+++ b/examples/demo/src/products/ProductList.tsx
@@ -18,16 +18,19 @@ import {
TopToolbar,
useTranslate,
useGetResourceLabel,
+ useDefaultTitle,
} from 'react-admin';
import ImageList from './GridList';
import Aside from './Aside';
const ProductList = () => {
+ const title = useDefaultTitle();
const getResourceLabel = useGetResourceLabel();
const isSmall = useMediaQuery(theme => theme.breakpoints.down('md'));
return (
+ {`${title} - ${getResourceLabel('products', 2)}`}
From 228a9a444a184d946c793b02581dfcd0063cebb7 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 10:26:49 +0100
Subject: [PATCH 07/18] Update react-is
---
packages/ra-core/package.json | 2 +-
packages/ra-ui-materialui/package.json | 4 ++--
yarn.lock | 10 +++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json
index 3705b8ed8f8..d867f13ad1d 100644
--- a/packages/ra-core/package.json
+++ b/packages/ra-core/package.json
@@ -66,7 +66,7 @@
"lodash": "^4.17.21",
"query-string": "^7.1.3",
"react-error-boundary": "^4.0.13",
- "react-is": "^18.2.0"
+ "react-is": "^18.2.0 || ^19.0.0"
},
"gitHead": "587df4c27bfcec4a756df4f95e5fc14728dfc0d7"
}
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index abfffb648f5..9e638e6bcf3 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -45,7 +45,7 @@
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "^7.53.0",
- "react-is": "^18.2.0",
+ "react-is": "^18.2.0 || ^19.0.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
"rimraf": "^3.0.2",
@@ -59,7 +59,7 @@
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"react-hook-form": "*",
- "react-is": "^18.0.0",
+ "react-is": "^18.0.0 || ^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
},
diff --git a/yarn.lock b/yarn.lock
index 15dc78f2c49..9c349fec3db 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -15781,7 +15781,7 @@ __metadata:
react-dom: "npm:18.3.1"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
- react-is: "npm:^18.2.0"
+ react-is: "npm:^18.2.0 || ^19.0.0"
react-router: "npm:^6.25.1"
react-router-dom: "npm:^6.25.1"
recharts: "npm:^2.1.15"
@@ -16057,7 +16057,7 @@ __metadata:
react-dropzone: "npm:^14.2.3"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
- react-is: "npm:^18.2.0"
+ react-is: "npm:^18.2.0 || ^19.0.0"
react-router: "npm:^6.25.1"
react-router-dom: "npm:^6.25.1"
react-transition-group: "npm:^4.4.5"
@@ -16071,7 +16071,7 @@ __metadata:
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
react-hook-form: "*"
- react-is: ^18.0.0
+ react-is: ^18.0.0 || ^19.0.0
react-router: ^6.22.0
react-router-dom: ^6.22.0
languageName: unknown
@@ -16359,14 +16359,14 @@ __metadata:
languageName: node
linkType: hard
-"react-is@npm:^18.0.0, react-is@npm:^18.2.0":
+"react-is@npm:^18.0.0":
version: 18.2.0
resolution: "react-is@npm:18.2.0"
checksum: 6eb5e4b28028c23e2bfcf73371e72cd4162e4ac7ab445ddae2afe24e347a37d6dc22fae6e1748632cd43c6d4f9b8f86dcf26bf9275e1874f436d129952528ae0
languageName: node
linkType: hard
-"react-is@npm:^19.0.0":
+"react-is@npm:^18.2.0 || ^19.0.0, react-is@npm:^19.0.0":
version: 19.0.0
resolution: "react-is@npm:19.0.0"
checksum: d1be8e8500cf04f76df71942a21ef3a71266397a383d7ec8885f35190df818d35c65efd35aed7be47a89ad99aaff2c52e0c4e39e8930844a6b997622e50625a8
From 7758372130608ee7b63261d5ba3509ebbbc3390e Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 12:00:07 +0100
Subject: [PATCH 08/18] Add more page titles
---
examples/demo/src/categories/CategoryEdit.tsx | 17 +++++--
examples/demo/src/categories/CategoryList.tsx | 19 +++++++
examples/demo/src/invoices/InvoiceList.tsx | 19 +++++++
examples/demo/src/orders/OrderEdit.tsx | 14 +++--
examples/demo/src/orders/OrderList.tsx | 19 +++++++
examples/demo/src/products/ProductCreate.tsx | 17 ++-----
examples/demo/src/products/ProductEdit.tsx | 16 ++++--
examples/demo/src/products/ProductList.tsx | 10 ++--
examples/demo/src/reviews/ReviewCreate.tsx | 20 +++++++-
examples/demo/src/reviews/ReviewList.tsx | 19 +++++++
examples/demo/src/segments/Segments.tsx | 51 ++++++++++---------
examples/demo/src/visitors/VisitorCreate.tsx | 19 ++++++-
examples/demo/src/visitors/VisitorEdit.tsx | 20 ++++++--
examples/demo/src/visitors/VisitorList.tsx | 19 +++++++
14 files changed, 223 insertions(+), 56 deletions(-)
diff --git a/examples/demo/src/categories/CategoryEdit.tsx b/examples/demo/src/categories/CategoryEdit.tsx
index 17c02020d39..8f2f91dbfc4 100644
--- a/examples/demo/src/categories/CategoryEdit.tsx
+++ b/examples/demo/src/categories/CategoryEdit.tsx
@@ -10,6 +10,8 @@ import {
TextInput,
useTranslate,
useRecordContext,
+ useDefaultTitle,
+ useGetResourceLabel,
} from 'react-admin';
import ThumbnailField from '../products/ThumbnailField';
@@ -59,14 +61,21 @@ const CategoryEdit = () => (
);
const CategoryTitle = () => {
+ const appTitle = useDefaultTitle();
const record = useRecordContext();
const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+
+ const pageTitle = translate('ra.page.edit', {
+ name: getResourceLabel('categories', 1),
+ recordRepresentation: `"${record?.name}"`,
+ });
return record ? (
-
- {translate('resources.categories.name', { smart_count: 1 })} "
- {record.name}"
-
+ <>
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
+ >
) : null;
};
diff --git a/examples/demo/src/categories/CategoryList.tsx b/examples/demo/src/categories/CategoryList.tsx
index f9d1dd7d858..5b74805b04b 100644
--- a/examples/demo/src/categories/CategoryList.tsx
+++ b/examples/demo/src/categories/CategoryList.tsx
@@ -3,7 +3,10 @@ import {
EditButton,
List,
RecordContextProvider,
+ useDefaultTitle,
+ useGetResourceLabel,
useListContext,
+ useTranslate,
} from 'react-admin';
import {
Grid,
@@ -18,6 +21,21 @@ import { humanize } from 'inflection';
import LinkToRelatedProducts from './LinkToRelatedProducts';
import { Category } from '../types';
+const CategoriesTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('categories', 2),
+ });
+ return (
+ <>
+ {`${title} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const CategoryList = () => (
(
pagination={false}
component="div"
actions={false}
+ title={}
>
diff --git a/examples/demo/src/invoices/InvoiceList.tsx b/examples/demo/src/invoices/InvoiceList.tsx
index 85ea1108d1f..ed0cca20ff7 100644
--- a/examples/demo/src/invoices/InvoiceList.tsx
+++ b/examples/demo/src/invoices/InvoiceList.tsx
@@ -12,6 +12,9 @@ import {
SelectColumnsButton,
ReferenceInput,
FilterButton,
+ useDefaultTitle,
+ useTranslate,
+ useGetResourceLabel,
} from 'react-admin';
import FullNameField from '../visitors/FullNameField';
@@ -33,12 +36,28 @@ const ListActions = () => (
);
+const InvoicesTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('invoices', 2),
+ });
+ return (
+ <>
+ {`${title} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const InvoiceList = () => (
}
+ title={}
>
(
);
const OrderTitle = () => {
+ const appTitle = useDefaultTitle();
const translate = useTranslate();
const record = useRecordContext();
+ const pageTitle = translate('resources.orders.title', {
+ reference: record?.reference,
+ });
return record ? (
-
- {translate('resources.orders.title', {
- reference: record.reference,
- })}
-
+ <>
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
+ >
) : null;
};
diff --git a/examples/demo/src/orders/OrderList.tsx b/examples/demo/src/orders/OrderList.tsx
index 8e5486283e1..7e3b4ecd4c8 100644
--- a/examples/demo/src/orders/OrderList.tsx
+++ b/examples/demo/src/orders/OrderList.tsx
@@ -19,7 +19,10 @@ import {
SelectColumnsButton,
TextField,
TopToolbar,
+ useDefaultTitle,
+ useGetResourceLabel,
useListContext,
+ useTranslate,
} from 'react-admin';
import { useMediaQuery, Divider, Tabs, Tab, Theme } from '@mui/material';
@@ -36,6 +39,21 @@ const ListActions = () => (
);
+const OrdersTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('orders', 2),
+ });
+ return (
+ <>
+ {`${title} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const OrderList = () => (
(
perPage={25}
filters={orderFilters}
actions={}
+ title={}
>
diff --git a/examples/demo/src/products/ProductCreate.tsx b/examples/demo/src/products/ProductCreate.tsx
index a2ed92ad9c7..d10e0616549 100644
--- a/examples/demo/src/products/ProductCreate.tsx
+++ b/examples/demo/src/products/ProductCreate.tsx
@@ -6,7 +6,6 @@ import {
required,
useDefaultTitle,
useGetResourceLabel,
- useResourceContext,
useTranslate,
} from 'react-admin';
import { ProductEditDetails } from './ProductEditDetails';
@@ -17,22 +16,16 @@ const RichTextInput = React.lazy(() =>
);
const ProductTitle = () => {
- const title = useDefaultTitle();
+ const appTitle = useDefaultTitle();
const translate = useTranslate();
- const resource = useResourceContext();
const getResourceLabel = useGetResourceLabel();
- if (!resource) {
- throw new Error(
- 'useCreateController requires a non-empty resource prop or context'
- );
- }
- const defaultTitle = translate('ra.page.create', {
- name: getResourceLabel(resource, 1),
+ const pageTitle = translate('ra.page.create', {
+ name: getResourceLabel('products', 1),
});
return (
<>
- {`${title} - ${defaultTitle}`}
- {defaultTitle}
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
>
);
};
diff --git a/examples/demo/src/products/ProductEdit.tsx b/examples/demo/src/products/ProductEdit.tsx
index 894fda18a80..248f6163a38 100644
--- a/examples/demo/src/products/ProductEdit.tsx
+++ b/examples/demo/src/products/ProductEdit.tsx
@@ -13,6 +13,8 @@ import {
TextInput,
useRecordContext,
useDefaultTitle,
+ useTranslate,
+ useGetResourceLabel,
} from 'react-admin';
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
import AspectRatioIcon from '@mui/icons-material/AspectRatio';
@@ -33,13 +35,19 @@ const RichTextInput = React.lazy(() =>
);
const ProductTitle = () => {
- const title = useDefaultTitle();
-
+ const appTitle = useDefaultTitle();
+ const translate = useTranslate();
const record = useRecordContext();
+ const getResourceLabel = useGetResourceLabel();
+
+ const pageTitle = translate('ra.page.edit', {
+ name: getResourceLabel('products', 1),
+ recordRepresentation: `"${record?.reference}"`,
+ });
return record ? (
<>
- {`${title} - Poster "${record.reference}`}
- Poster "{record.reference}"
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
>
) : null;
};
diff --git a/examples/demo/src/products/ProductList.tsx b/examples/demo/src/products/ProductList.tsx
index 59639312ddb..68e2568b427 100644
--- a/examples/demo/src/products/ProductList.tsx
+++ b/examples/demo/src/products/ProductList.tsx
@@ -25,13 +25,17 @@ import ImageList from './GridList';
import Aside from './Aside';
const ProductList = () => {
- const title = useDefaultTitle();
+ const appTitle = useDefaultTitle();
+ const translate = useTranslate();
const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('products', 2),
+ });
const isSmall = useMediaQuery(theme => theme.breakpoints.down('md'));
return (
- {`${title} - ${getResourceLabel('products', 2)}`}
-
+ {`${appTitle} - ${pageTitle}`}
+
{isSmall && (
diff --git a/examples/demo/src/reviews/ReviewCreate.tsx b/examples/demo/src/reviews/ReviewCreate.tsx
index c2e83c9988b..b9e730827e1 100644
--- a/examples/demo/src/reviews/ReviewCreate.tsx
+++ b/examples/demo/src/reviews/ReviewCreate.tsx
@@ -10,11 +10,29 @@ import {
useNotify,
useRedirect,
getRecordFromLocation,
+ useDefaultTitle,
+ useTranslate,
+ useGetResourceLabel,
} from 'react-admin';
import { useLocation } from 'react-router';
import StarRatingInput from './StarRatingInput';
+const ReviewTitle = () => {
+ const appTitle = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.create', {
+ name: getResourceLabel('reviews', 1),
+ });
+ return (
+ <>
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const ReviewCreate = () => {
const notify = useNotify();
const redirect = useRedirect();
@@ -31,7 +49,7 @@ const ReviewCreate = () => {
};
return (
-
+ }>
(
);
+const ReviewsTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('reviews', 2),
+ });
+ return (
+ <>
+ {`${title} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const ReviewList = () => {
const isXSmall = useMediaQuery(theme =>
theme.breakpoints.down('sm')
@@ -53,6 +71,7 @@ const ReviewList = () => {
perPage={25}
sort={{ field: 'date', order: 'DESC' }}
actions={}
+ title={}
>
{isXSmall ? (
diff --git a/examples/demo/src/segments/Segments.tsx b/examples/demo/src/segments/Segments.tsx
index b9d3ff5b159..86b8357c6d1 100644
--- a/examples/demo/src/segments/Segments.tsx
+++ b/examples/demo/src/segments/Segments.tsx
@@ -7,40 +7,45 @@ import {
TableHead,
TableRow,
} from '@mui/material';
-import { useTranslate, Title } from 'react-admin';
+import { useTranslate, Title, useDefaultTitle } from 'react-admin';
import LinkToRelatedCustomers from './LinkToRelatedCustomers';
import segments from './data';
const Segments = () => {
+ const appTitle = useDefaultTitle();
const translate = useTranslate();
+ const pageTitle = translate('resources.segments.name', { smart_count: 2 });
return (
-
-
-
-
-
-
- {translate('resources.segments.fields.name')}
-
-
-
-
-
- {segments.map(segment => (
-
- {translate(segment.name)}
+ <>
+ {`${appTitle} - ${pageTitle}`}
+
+
+
+
+
-
+ {translate('resources.segments.fields.name')}
+
- ))}
-
-
-
+
+
+ {segments.map(segment => (
+
+ {translate(segment.name)}
+
+
+
+
+ ))}
+
+
+
+ >
);
};
diff --git a/examples/demo/src/visitors/VisitorCreate.tsx b/examples/demo/src/visitors/VisitorCreate.tsx
index 8d6a0406e73..39d0521b1fe 100644
--- a/examples/demo/src/visitors/VisitorCreate.tsx
+++ b/examples/demo/src/visitors/VisitorCreate.tsx
@@ -7,6 +7,8 @@ import {
useTranslate,
PasswordInput,
email,
+ useDefaultTitle,
+ useGetResourceLabel,
} from 'react-admin';
import { Box, Typography } from '@mui/material';
@@ -35,8 +37,23 @@ export const validateForm = (
return errors;
};
+const VisitorTitle = () => {
+ const appTitle = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.create', {
+ name: getResourceLabel('customers', 1),
+ });
+ return (
+ <>
+ {`${appTitle} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const VisitorCreate = () => (
-
+ }>
{
const translate = useTranslate();
@@ -113,8 +116,19 @@ const VisitorEdit = () => {
);
};
-const VisitorTitle = () => (
-
-);
+const VisitorTitle = () => {
+ const appTitle = useDefaultTitle();
+ const record = useRecordContext();
+ return (
+ <>
+ {`${appTitle} - ${record?.first_name} ${record?.last_name}`}
+
+ >
+ );
+};
export default VisitorEdit;
diff --git a/examples/demo/src/visitors/VisitorList.tsx b/examples/demo/src/visitors/VisitorList.tsx
index c22fcc1a0ef..f0777f18d6c 100644
--- a/examples/demo/src/visitors/VisitorList.tsx
+++ b/examples/demo/src/visitors/VisitorList.tsx
@@ -12,6 +12,9 @@ import {
SearchInput,
SelectColumnsButton,
TopToolbar,
+ useDefaultTitle,
+ useGetResourceLabel,
+ useTranslate,
} from 'react-admin';
import { useMediaQuery, Theme } from '@mui/material';
@@ -38,6 +41,21 @@ const VisitorListActions = () => (
);
+const VisitorTitle = () => {
+ const title = useDefaultTitle();
+ const translate = useTranslate();
+ const getResourceLabel = useGetResourceLabel();
+ const pageTitle = translate('ra.page.list', {
+ name: getResourceLabel('customers', 2),
+ });
+ return (
+ <>
+ {`${title} - ${pageTitle}`}
+ {pageTitle}
+ >
+ );
+};
+
const VisitorList = () => {
const isXsmall = useMediaQuery(theme =>
theme.breakpoints.down('sm')
@@ -50,6 +68,7 @@ const VisitorList = () => {
perPage={25}
aside={}
actions={}
+ title={}
>
{isXsmall ? (
From 5be5a2d97a3ef8dc0c0d24a68388e479865a893b Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 12:51:20 +0100
Subject: [PATCH 09/18] Fix react dependencies
---
examples/crm/package.json | 4 +--
examples/no-code/package.json | 4 +--
examples/simple/package.json | 4 +--
package.json | 4 +--
packages/create-react-admin/package.json | 2 +-
packages/ra-core/package.json | 4 +--
packages/ra-input-rich-text/package.json | 4 +--
packages/ra-no-code/package.json | 4 +--
packages/ra-ui-materialui/package.json | 4 +--
yarn.lock | 38 ++++++++++++------------
10 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/examples/crm/package.json b/examples/crm/package.json
index e73bae35864..33a01cec4d8 100644
--- a/examples/crm/package.json
+++ b/examples/crm/package.json
@@ -15,10 +15,10 @@
"lodash": "~4.17.5",
"papaparse": "^5.4.1",
"ra-data-fakerest": "^5.3.0",
- "react": "18.3.1",
+ "react": "^18.3.1",
"react-admin": "^5.3.0",
"react-cropper": "^2.3.3",
- "react-dom": "18.3.1",
+ "react-dom": "^18.3.1",
"react-error-boundary": "^4.0.3",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/examples/no-code/package.json b/examples/no-code/package.json
index 04f5cf5cb85..5e70f237a9d 100644
--- a/examples/no-code/package.json
+++ b/examples/no-code/package.json
@@ -11,9 +11,9 @@
"@mui/material": "^5.16.12",
"ra-data-local-storage": "^5.0.0",
"ra-no-code": "^5.0.0",
- "react": "18.3.1",
+ "react": "^18.3.1",
"react-admin": "^5.0.0",
- "react-dom": "18.3.1"
+ "react-dom": "^18.3.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index c4fbf57794d..237b8a301de 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -21,9 +21,9 @@
"ra-input-rich-text": "^5.4.3",
"ra-language-english": "^5.4.3",
"ra-language-french": "^5.4.3",
- "react": "18.3.1",
+ "react": "^18.3.1",
"react-admin": "^5.4.3",
- "react-dom": "18.3.1",
+ "react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0"
diff --git a/package.json b/package.json
index 9753823fa99..499cba7418a 100644
--- a/package.json
+++ b/package.json
@@ -56,8 +56,8 @@
"lolex": "~2.3.2",
"prettier": "~3.2.5",
"raf": "~3.4.1",
- "react": "18.3.1",
- "react-dom": "18.3.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"storybook": "^8.4.4",
"ts-jest": "^29.1.0",
"typescript": "^5.1.3",
diff --git a/packages/create-react-admin/package.json b/packages/create-react-admin/package.json
index 6525d5b7d3c..1787c168ff1 100644
--- a/packages/create-react-admin/package.json
+++ b/packages/create-react-admin/package.json
@@ -27,7 +27,7 @@
"ink-text-input": "^6.0.0",
"lodash": "~4.17.5",
"meow": "^9.0.0",
- "react": "18.3.1",
+ "react": "^18.3.1",
"yn": "^5.0.0"
},
"devDependencies": {
diff --git a/packages/ra-core/package.json b/packages/ra-core/package.json
index d867f13ad1d..09b82787f7a 100644
--- a/packages/ra-core/package.json
+++ b/packages/ra-core/package.json
@@ -38,8 +38,8 @@
"expect": "^27.4.6",
"ignore-styles": "~5.0.1",
"jscodeshift": "^0.15.2",
- "react": "18.3.1",
- "react-dom": "18.3.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-router": "^6.25.1",
"react-router-dom": "^6.25.1",
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json
index 0836a61658d..fe1b43ede66 100644
--- a/packages/ra-input-rich-text/package.json
+++ b/packages/ra-input-rich-text/package.json
@@ -55,8 +55,8 @@
"ra-core": "^5.4.3",
"ra-data-fakerest": "^5.4.3",
"ra-ui-materialui": "^5.4.3",
- "react": "18.3.1",
- "react-dom": "18.3.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"rimraf": "^3.0.2",
"tippy.js": "^6.3.7",
diff --git a/packages/ra-no-code/package.json b/packages/ra-no-code/package.json
index 433917365ff..a4934fe589a 100644
--- a/packages/ra-no-code/package.json
+++ b/packages/ra-no-code/package.json
@@ -28,8 +28,8 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"cross-env": "^5.2.0",
- "react": "18.3.1",
- "react-dom": "18.3.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
"rimraf": "^3.0.2",
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index 9e638e6bcf3..8359036b6f7 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -42,8 +42,8 @@
"ra-core": "^5.4.3",
"ra-i18n-polyglot": "^5.4.3",
"ra-language-english": "^5.4.3",
- "react": "18.3.1",
- "react-dom": "18.3.1",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-is": "^18.2.0 || ^19.0.0",
"react-router": "^6.25.1",
diff --git a/yarn.lock b/yarn.lock
index 9c349fec3db..ddc3fffa4b0 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -7586,7 +7586,7 @@ __metadata:
ink-text-input: "npm:^6.0.0"
lodash: "npm:~4.17.5"
meow: "npm:^9.0.0"
- react: "npm:18.3.1"
+ react: "npm:^18.3.1"
typescript: "npm:^5.1.3"
yn: "npm:^5.0.0"
bin:
@@ -13977,9 +13977,9 @@ __metadata:
"@vitejs/plugin-react": "npm:^4.2.1"
ra-data-local-storage: "npm:^5.0.0"
ra-no-code: "npm:^5.0.0"
- react: "npm:18.3.1"
+ react: "npm:^18.3.1"
react-admin: "npm:^5.0.0"
- react-dom: "npm:18.3.1"
+ react-dom: "npm:^18.3.1"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
@@ -15777,8 +15777,8 @@ __metadata:
jsonexport: "npm:^3.2.0"
lodash: "npm:^4.17.21"
query-string: "npm:^7.1.3"
- react: "npm:18.3.1"
- react-dom: "npm:18.3.1"
+ react: "npm:^18.3.1"
+ react-dom: "npm:^18.3.1"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
react-is: "npm:^18.2.0 || ^19.0.0"
@@ -15957,8 +15957,8 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-data-fakerest: "npm:^5.4.3"
ra-ui-materialui: "npm:^5.4.3"
- react: "npm:18.3.1"
- react-dom: "npm:18.3.1"
+ react: "npm:^18.3.1"
+ react-dom: "npm:^18.3.1"
react-hook-form: "npm:^7.53.0"
rimraf: "npm:^3.0.2"
tippy.js: "npm:^6.3.7"
@@ -16007,9 +16007,9 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.3.0"
ra-data-local-storage: "npm:^5.4.3"
- react: "npm:18.3.1"
+ react: "npm:^18.3.1"
react-admin: "npm:^5.4.3"
- react-dom: "npm:18.3.1"
+ react-dom: "npm:^18.3.1"
react-dropzone: "npm:^14.2.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -16052,8 +16052,8 @@ __metadata:
ra-core: "npm:^5.4.3"
ra-i18n-polyglot: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
- react: "npm:18.3.1"
- react-dom: "npm:18.3.1"
+ react: "npm:^18.3.1"
+ react-dom: "npm:^18.3.1"
react-dropzone: "npm:^14.2.3"
react-error-boundary: "npm:^4.0.13"
react-hook-form: "npm:^7.53.0"
@@ -16147,10 +16147,10 @@ __metadata:
lodash: "npm:~4.17.5"
papaparse: "npm:^5.4.1"
ra-data-fakerest: "npm:^5.3.0"
- react: "npm:18.3.1"
+ react: "npm:^18.3.1"
react-admin: "npm:^5.3.0"
react-cropper: "npm:^2.3.3"
- react-dom: "npm:18.3.1"
+ react-dom: "npm:^18.3.1"
react-error-boundary: "npm:^4.0.3"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
@@ -16198,8 +16198,8 @@ __metadata:
lolex: "npm:~2.3.2"
prettier: "npm:~3.2.5"
raf: "npm:~3.4.1"
- react: "npm:18.3.1"
- react-dom: "npm:18.3.1"
+ react: "npm:^18.3.1"
+ react-dom: "npm:^18.3.1"
storybook: "npm:^8.4.4"
ts-jest: "npm:^29.1.0"
typescript: "npm:^5.1.3"
@@ -16271,7 +16271,7 @@ __metadata:
languageName: node
linkType: hard
-"react-dom@npm:18.3.1":
+"react-dom@npm:^18.3.1":
version: 18.3.1
resolution: "react-dom@npm:18.3.1"
dependencies:
@@ -16521,7 +16521,7 @@ __metadata:
languageName: node
linkType: hard
-"react@npm:18.3.1":
+"react@npm:^18.3.1":
version: 18.3.1
resolution: "react@npm:18.3.1"
dependencies:
@@ -17527,9 +17527,9 @@ __metadata:
ra-input-rich-text: "npm:^5.4.3"
ra-language-english: "npm:^5.4.3"
ra-language-french: "npm:^5.4.3"
- react: "npm:18.3.1"
+ react: "npm:^18.3.1"
react-admin: "npm:^5.4.3"
- react-dom: "npm:18.3.1"
+ react-dom: "npm:^18.3.1"
react-hook-form: "npm:^7.53.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
From dcad47fee1e5e2347cac3e87afe3daa77a046101 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 13:14:48 +0100
Subject: [PATCH 10/18] Fix more deps
---
examples/demo/package.json | 4 +-
examples/simple/package.json | 4 +-
packages/ra-ui-materialui/package.json | 6 +-
yarn.lock | 318 ++++++++++++++++++++++---
4 files changed, 293 insertions(+), 39 deletions(-)
diff --git a/examples/demo/package.json b/examples/demo/package.json
index b67af5c9f17..9fb699e71c5 100644
--- a/examples/demo/package.json
+++ b/examples/demo/package.json
@@ -4,7 +4,7 @@
"private": true,
"type": "module",
"dependencies": {
- "@apollo/client": "^3.3.19",
+ "@apollo/client": "^3.12.4",
"@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@types/recharts": "^1.8.10",
@@ -31,7 +31,7 @@
"react-dom": "^19.0.0",
"react-router": "^6.22.0",
"react-router-dom": "^6.22.0",
- "recharts": "^2.1.15"
+ "recharts": "^2.15.0"
},
"scripts": {
"dev": "vite",
diff --git a/examples/simple/package.json b/examples/simple/package.json
index 237b8a301de..4c619b2a4d8 100644
--- a/examples/simple/package.json
+++ b/examples/simple/package.json
@@ -29,8 +29,10 @@
"react-router-dom": "^6.22.0"
},
"devDependencies": {
- "@hookform/devtools": "^4.0.2",
+ "@hookform/devtools": "^4.3.3",
"@vitejs/plugin-react": "^4.2.1",
+ "little-state-machine": "^4.8.1",
+ "react-simple-animate": "^3.5.3",
"typescript": "^5.1.3",
"vite": "^5.0.11"
}
diff --git a/packages/ra-ui-materialui/package.json b/packages/ra-ui-materialui/package.json
index 8359036b6f7..69939a354d6 100644
--- a/packages/ra-ui-materialui/package.json
+++ b/packages/ra-ui-materialui/package.json
@@ -52,9 +52,9 @@
"typescript": "^5.1.3"
},
"peerDependencies": {
- "@mui/icons-material": "^5.15.20",
- "@mui/material": "^5.15.20",
- "@mui/utils": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
+ "@mui/material": "^5.16.12",
+ "@mui/utils": "^5.16.12",
"ra-core": "^5.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
diff --git a/yarn.lock b/yarn.lock
index ddc3fffa4b0..125251ca114 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -32,9 +32,9 @@ __metadata:
languageName: node
linkType: hard
-"@apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11":
- version: 3.9.11
- resolution: "@apollo/client@npm:3.9.11"
+"@apollo/client@npm:^3.12.4, @apollo/client@npm:^3.3.19, @apollo/client@npm:^3.9.11":
+ version: 3.12.4
+ resolution: "@apollo/client@npm:3.12.4"
dependencies:
"@graphql-typed-document-node/core": "npm:^3.1.1"
"@wry/caches": "npm:^1.0.0"
@@ -44,7 +44,7 @@ __metadata:
hoist-non-react-statics: "npm:^3.3.2"
optimism: "npm:^0.18.0"
prop-types: "npm:^15.7.2"
- rehackt: "npm:0.0.6"
+ rehackt: "npm:^0.1.0"
response-iterator: "npm:^0.2.6"
symbol-observable: "npm:^4.0.0"
ts-invariant: "npm:^0.10.3"
@@ -53,8 +53,8 @@ __metadata:
peerDependencies:
graphql: ^15.0.0 || ^16.0.0
graphql-ws: ^5.5.5
- react: ^16.8.0 || ^17.0.0 || ^18.0.0
- react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc
subscriptions-transport-ws: ^0.9.0 || ^0.11.0
peerDependenciesMeta:
graphql-ws:
@@ -65,7 +65,7 @@ __metadata:
optional: true
subscriptions-transport-ws:
optional: true
- checksum: c7657a8e0d62f6d1e0b2da7573e9a9397af879946396e86682166596ffb201c22f7677d11cf65ca2ce97acc8ff2ee8e37c077716cd1b6ae9bb0e3a9cdfdecaf4
+ checksum: 6b30b14d576230cb56b0bb9b328c81f33631640e3d97a1185a20ede7e200dfa79502d695c347920e8c930a36e50870a41f5244ae2167d0123ad56973642528e6
languageName: node
linkType: hard
@@ -2344,9 +2344,9 @@ __metadata:
languageName: node
linkType: hard
-"@hookform/devtools@npm:^4.0.2":
- version: 4.0.2
- resolution: "@hookform/devtools@npm:4.0.2"
+"@hookform/devtools@npm:^4.3.3":
+ version: 4.3.3
+ resolution: "@hookform/devtools@npm:4.3.3"
dependencies:
"@emotion/react": "npm:^11.1.5"
"@emotion/styled": "npm:^11.3.0"
@@ -2354,11 +2354,12 @@ __metadata:
little-state-machine: "npm:^4.1.0"
lodash: "npm:^4.17.21"
react-simple-animate: "npm:^3.3.12"
+ use-deep-compare-effect: "npm:^1.8.1"
+ uuid: "npm:^8.3.2"
peerDependencies:
- react: ">=17.0.2"
- react-dom: ">=17.0.2"
- react-hook-form: ^7.13.0
- checksum: 079eda3b8693c48d140f41f8640febd9ae5491925ffc62b4e5048562ae966d2cf524f7a8ef2357a96828ed8f25704a881357124159ccaf8d3af77acac5a35dc3
+ react: ^16.8.0 || ^17 || ^18 || ^19
+ react-dom: ^16.8.0 || ^17 || ^18 || ^19
+ checksum: eef986545a4a2c0d7d5c20d84048c064ccf121f803bc5490832a46a69024f50af8c6976b0feb78790a05d7c1b722dc0d664ff538d717f0d15ddc8f197e495dc0
languageName: node
linkType: hard
@@ -4689,6 +4690,20 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-array@npm:^3.0.3":
+ version: 3.2.1
+ resolution: "@types/d3-array@npm:3.2.1"
+ checksum: 38bf2c778451f4b79ec81a2288cb4312fe3d6449ecdf562970cc339b60f280f31c93a024c7ff512607795e79d3beb0cbda123bb07010167bce32927f71364bca
+ languageName: node
+ linkType: hard
+
+"@types/d3-color@npm:*":
+ version: 3.1.3
+ resolution: "@types/d3-color@npm:3.1.3"
+ checksum: 65eb0487de606eb5ad81735a9a5b3142d30bc5ea801ed9b14b77cb14c9b909f718c059f13af341264ee189acf171508053342142bdf99338667cea26a2d8d6ae
+ languageName: node
+ linkType: hard
+
"@types/d3-color@npm:^2":
version: 2.0.3
resolution: "@types/d3-color@npm:2.0.3"
@@ -4696,6 +4711,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-ease@npm:^3.0.0":
+ version: 3.0.2
+ resolution: "@types/d3-ease@npm:3.0.2"
+ checksum: aff5a1e572a937ee9bff6465225d7ba27d5e0c976bd9eacdac2e6f10700a7cb0c9ea2597aff6b43a6ed850a3210030870238894a77ec73e309b4a9d0333f099c
+ languageName: node
+ linkType: hard
+
"@types/d3-interpolate@npm:^2.0.0":
version: 2.0.2
resolution: "@types/d3-interpolate@npm:2.0.2"
@@ -4705,6 +4727,22 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-interpolate@npm:^3.0.1":
+ version: 3.0.4
+ resolution: "@types/d3-interpolate@npm:3.0.4"
+ dependencies:
+ "@types/d3-color": "npm:*"
+ checksum: 066ebb8da570b518dd332df6b12ae3b1eaa0a7f4f0c702e3c57f812cf529cc3500ec2aac8dc094f31897790346c6b1ebd8cd7a077176727f4860c2b181a65ca4
+ languageName: node
+ linkType: hard
+
+"@types/d3-path@npm:*":
+ version: 3.1.0
+ resolution: "@types/d3-path@npm:3.1.0"
+ checksum: 85e8b3aa968a60a5b33198ade06ae7ffedcf9a22d86f24859ff58e014b053ccb7141ec163b78d547bc8215bb12bb54171c666057ab6156912814005b686afb31
+ languageName: node
+ linkType: hard
+
"@types/d3-path@npm:^1":
version: 1.0.9
resolution: "@types/d3-path@npm:1.0.9"
@@ -4728,6 +4766,15 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-scale@npm:^4.0.2":
+ version: 4.0.8
+ resolution: "@types/d3-scale@npm:4.0.8"
+ dependencies:
+ "@types/d3-time": "npm:*"
+ checksum: 57de90e4016f640b83cb960b7e3a0ab3ed02e720898840ddc5105264ffcfea73336161442fdc91895377c2d2f91904d637282f16852b8535b77e15a761c8e99e
+ languageName: node
+ linkType: hard
+
"@types/d3-shape@npm:^1":
version: 1.3.8
resolution: "@types/d3-shape@npm:1.3.8"
@@ -4746,6 +4793,22 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-shape@npm:^3.1.0":
+ version: 3.1.7
+ resolution: "@types/d3-shape@npm:3.1.7"
+ dependencies:
+ "@types/d3-path": "npm:*"
+ checksum: 38e59771c1c4c83b67aa1f941ce350410522a149d2175832fdc06396b2bb3b2c1a2dd549e0f8230f9f24296ee5641a515eaf10f55ee1ef6c4f83749e2dd7dcfd
+ languageName: node
+ linkType: hard
+
+"@types/d3-time@npm:*, @types/d3-time@npm:^3.0.0":
+ version: 3.0.4
+ resolution: "@types/d3-time@npm:3.0.4"
+ checksum: 6d9e2255d63f7a313a543113920c612e957d70da4fb0890931da6c2459010291b8b1f95e149a538500c1c99e7e6c89ffcce5554dd29a31ff134a38ea94b6d174
+ languageName: node
+ linkType: hard
+
"@types/d3-time@npm:^2":
version: 2.1.1
resolution: "@types/d3-time@npm:2.1.1"
@@ -4753,6 +4816,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/d3-timer@npm:^3.0.0":
+ version: 3.0.2
+ resolution: "@types/d3-timer@npm:3.0.2"
+ checksum: c644dd9571fcc62b1aa12c03bcad40571553020feeb5811f1d8a937ac1e65b8a04b759b4873aef610e28b8714ac71c9885a4d6c127a048d95118f7e5b506d9e1
+ languageName: node
+ linkType: hard
+
"@types/doctrine@npm:^0.0.9":
version: 0.0.9
resolution: "@types/doctrine@npm:0.0.9"
@@ -7121,7 +7191,7 @@ __metadata:
languageName: node
linkType: hard
-"clsx@npm:^2.1.0, clsx@npm:^2.1.1":
+"clsx@npm:^2.0.0, clsx@npm:^2.1.0, clsx@npm:^2.1.1":
version: 2.1.1
resolution: "clsx@npm:2.1.1"
checksum: c4c8eb865f8c82baab07e71bfa8897c73454881c4f99d6bc81585aecd7c441746c1399d08363dc096c550cceaf97bd4ce1e8854e1771e9998d9f94c4fe075839
@@ -7833,6 +7903,15 @@ __metadata:
languageName: node
linkType: hard
+"d3-array@npm:2 - 3, d3-array@npm:2.10.0 - 3, d3-array@npm:^3.1.6":
+ version: 3.2.4
+ resolution: "d3-array@npm:3.2.4"
+ dependencies:
+ internmap: "npm:1 - 2"
+ checksum: 08b95e91130f98c1375db0e0af718f4371ccacef7d5d257727fe74f79a24383e79aba280b9ffae655483ffbbad4fd1dec4ade0119d88c4749f388641c8bf8c50
+ languageName: node
+ linkType: hard
+
"d3-array@npm:2, d3-array@npm:^2.3.0":
version: 2.12.1
resolution: "d3-array@npm:2.12.1"
@@ -7849,6 +7928,20 @@ __metadata:
languageName: node
linkType: hard
+"d3-color@npm:1 - 3":
+ version: 3.1.0
+ resolution: "d3-color@npm:3.1.0"
+ checksum: a4e20e1115fa696fce041fbe13fbc80dc4c19150fa72027a7c128ade980bc0eeeba4bcf28c9e21f0bce0e0dbfe7ca5869ef67746541dcfda053e4802ad19783c
+ languageName: node
+ linkType: hard
+
+"d3-ease@npm:^3.0.1":
+ version: 3.0.1
+ resolution: "d3-ease@npm:3.0.1"
+ checksum: fec8ef826c0cc35cda3092c6841e07672868b1839fcaf556e19266a3a37e6bc7977d8298c0fcb9885e7799bfdcef7db1baaba9cd4dcf4bc5e952cf78574a88b0
+ languageName: node
+ linkType: hard
+
"d3-format@npm:1 - 2":
version: 2.0.0
resolution: "d3-format@npm:2.0.0"
@@ -7856,6 +7949,13 @@ __metadata:
languageName: node
linkType: hard
+"d3-format@npm:1 - 3":
+ version: 3.1.0
+ resolution: "d3-format@npm:3.1.0"
+ checksum: 049f5c0871ebce9859fc5e2f07f336b3c5bfff52a2540e0bac7e703fce567cd9346f4ad1079dd18d6f1e0eaa0599941c1810898926f10ac21a31fd0a34b4aa75
+ languageName: node
+ linkType: hard
+
"d3-format@npm:^1.4.4":
version: 1.4.5
resolution: "d3-format@npm:1.4.5"
@@ -7872,6 +7972,15 @@ __metadata:
languageName: node
linkType: hard
+"d3-interpolate@npm:1.2.0 - 3, d3-interpolate@npm:^3.0.1":
+ version: 3.0.1
+ resolution: "d3-interpolate@npm:3.0.1"
+ dependencies:
+ d3-color: "npm:1 - 3"
+ checksum: 19f4b4daa8d733906671afff7767c19488f51a43d251f8b7f484d5d3cfc36c663f0a66c38fe91eee30f40327443d799be17169f55a293a3ba949e84e57a33e6a
+ languageName: node
+ linkType: hard
+
"d3-path@npm:1":
version: 1.0.9
resolution: "d3-path@npm:1.0.9"
@@ -7886,6 +7995,13 @@ __metadata:
languageName: node
linkType: hard
+"d3-path@npm:^3.1.0":
+ version: 3.1.0
+ resolution: "d3-path@npm:3.1.0"
+ checksum: dc1d58ec87fa8319bd240cf7689995111a124b141428354e9637aa83059eb12e681f77187e0ada5dedfce346f7e3d1f903467ceb41b379bfd01cd8e31721f5da
+ languageName: node
+ linkType: hard
+
"d3-scale-chromatic@npm:^2.0.0":
version: 2.0.0
resolution: "d3-scale-chromatic@npm:2.0.0"
@@ -7909,6 +8025,19 @@ __metadata:
languageName: node
linkType: hard
+"d3-scale@npm:^4.0.2":
+ version: 4.0.2
+ resolution: "d3-scale@npm:4.0.2"
+ dependencies:
+ d3-array: "npm:2.10.0 - 3"
+ d3-format: "npm:1 - 3"
+ d3-interpolate: "npm:1.2.0 - 3"
+ d3-time: "npm:2.1.1 - 3"
+ d3-time-format: "npm:2 - 4"
+ checksum: 65d9ad8c2641aec30ed5673a7410feb187a224d6ca8d1a520d68a7d6eac9d04caedbff4713d1e8545be33eb7fec5739983a7ab1d22d4e5ad35368c6729d362f1
+ languageName: node
+ linkType: hard
+
"d3-shape@npm:^1.3.5":
version: 1.3.7
resolution: "d3-shape@npm:1.3.7"
@@ -7927,6 +8056,15 @@ __metadata:
languageName: node
linkType: hard
+"d3-shape@npm:^3.1.0":
+ version: 3.2.0
+ resolution: "d3-shape@npm:3.2.0"
+ dependencies:
+ d3-path: "npm:^3.1.0"
+ checksum: f1c9d1f09926daaf6f6193ae3b4c4b5521e81da7d8902d24b38694517c7f527ce3c9a77a9d3a5722ad1e3ff355860b014557b450023d66a944eabf8cfde37132
+ languageName: node
+ linkType: hard
+
"d3-time-format@npm:2 - 3, d3-time-format@npm:^3.0.0":
version: 3.0.0
resolution: "d3-time-format@npm:3.0.0"
@@ -7936,6 +8074,15 @@ __metadata:
languageName: node
linkType: hard
+"d3-time-format@npm:2 - 4":
+ version: 4.1.0
+ resolution: "d3-time-format@npm:4.1.0"
+ dependencies:
+ d3-time: "npm:1 - 3"
+ checksum: 735e00fb25a7fd5d418fac350018713ae394eefddb0d745fab12bbff0517f9cdb5f807c7bbe87bb6eeb06249662f8ea84fec075f7d0cd68609735b2ceb29d206
+ languageName: node
+ linkType: hard
+
"d3-time@npm:1 - 2, d3-time@npm:^2.1.1":
version: 2.1.1
resolution: "d3-time@npm:2.1.1"
@@ -7945,6 +8092,15 @@ __metadata:
languageName: node
linkType: hard
+"d3-time@npm:1 - 3, d3-time@npm:2.1.1 - 3, d3-time@npm:^3.0.0":
+ version: 3.1.0
+ resolution: "d3-time@npm:3.1.0"
+ dependencies:
+ d3-array: "npm:2 - 3"
+ checksum: a984f77e1aaeaa182679b46fbf57eceb6ebdb5f67d7578d6f68ef933f8eeb63737c0949991618a8d29472dbf43736c7d7f17c452b2770f8c1271191cba724ca1
+ languageName: node
+ linkType: hard
+
"d3-time@npm:^1.0.11":
version: 1.1.0
resolution: "d3-time@npm:1.1.0"
@@ -7952,6 +8108,13 @@ __metadata:
languageName: node
linkType: hard
+"d3-timer@npm:^3.0.1":
+ version: 3.0.1
+ resolution: "d3-timer@npm:3.0.1"
+ checksum: d4c63cb4bb5461d7038aac561b097cd1c5673969b27cbdd0e87fa48d9300a538b9e6f39b4a7f0e3592ef4f963d858c8a9f0e92754db73116770856f2fc04561a
+ languageName: node
+ linkType: hard
+
"damerau-levenshtein@npm:^1.0.7":
version: 1.0.8
resolution: "damerau-levenshtein@npm:1.0.8"
@@ -8174,7 +8337,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "demo@workspace:examples/demo"
dependencies:
- "@apollo/client": "npm:^3.3.19"
+ "@apollo/client": "npm:^3.12.4"
"@mui/icons-material": "npm:^5.16.12"
"@mui/material": "npm:^5.16.12"
"@types/fetch-mock": "npm:^7.3.2"
@@ -8206,7 +8369,7 @@ __metadata:
react-dom: "npm:^19.0.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
- recharts: "npm:^2.1.15"
+ recharts: "npm:^2.15.0"
rewire: "npm:^5.0.0"
rollup-plugin-visualizer: "npm:^5.12.0"
rollup-preserve-directives: "npm:^1.1.1"
@@ -9701,6 +9864,13 @@ __metadata:
languageName: node
linkType: hard
+"fast-equals@npm:^5.0.1":
+ version: 5.2.2
+ resolution: "fast-equals@npm:5.2.2"
+ checksum: 2bfeac6317a8959a00e2134749323557e5df6dea3af24e4457297733eace8ce4313fcbca2cf4532f3a6792607461e80442cd8d3af148d5c2e4e98ad996d6e5b5
+ languageName: node
+ linkType: hard
+
"fast-glob@npm:^3.2.9":
version: 3.3.2
resolution: "fast-glob@npm:3.3.2"
@@ -11400,6 +11570,13 @@ __metadata:
languageName: node
linkType: hard
+"internmap@npm:1 - 2":
+ version: 2.0.3
+ resolution: "internmap@npm:2.0.3"
+ checksum: 8cedd57f07bbc22501516fbfc70447f0c6812871d471096fad9ea603516eacc2137b633633daf432c029712df0baefd793686388ddf5737e3ea15074b877f7ed
+ languageName: node
+ linkType: hard
+
"internmap@npm:^1.0.0":
version: 1.0.1
resolution: "internmap@npm:1.0.1"
@@ -13066,12 +13243,12 @@ __metadata:
languageName: node
linkType: hard
-"little-state-machine@npm:^4.1.0":
- version: 4.2.0
- resolution: "little-state-machine@npm:4.2.0"
+"little-state-machine@npm:^4.1.0, little-state-machine@npm:^4.8.1":
+ version: 4.8.1
+ resolution: "little-state-machine@npm:4.8.1"
peerDependencies:
- react: ^16.8.0 || ^17
- checksum: 57fc0997a377349afddca3dc4907ab5de44dae1f6f26479b0bae6a4e9421de1f0eff88c0546bcd087a44ca98d842f8e6aaa7d5e3476035a1116b5001042712fc
+ react: ^16.8.0 || ^17 || ^18 || ^19
+ checksum: 9adc649155a058c8bb345cce7564e6339ddd2666a65ff53e2f6e5ac2ad28d8b21f850ed87980635cf7fdb4fd586142b813e9edcccf80d0fabba8ec5cbe4680bb
languageName: node
linkType: hard
@@ -16373,6 +16550,13 @@ __metadata:
languageName: node
linkType: hard
+"react-is@npm:^18.3.1":
+ version: 18.3.1
+ resolution: "react-is@npm:18.3.1"
+ checksum: f2f1e60010c683479e74c63f96b09fb41603527cd131a9959e2aee1e5a8b0caf270b365e5ca77d4a6b18aae659b60a86150bb3979073528877029b35aecd2072
+ languageName: node
+ linkType: hard
+
"react-lifecycles-compat@npm:^3.0.4":
version: 3.0.4
resolution: "react-lifecycles-compat@npm:3.0.4"
@@ -16467,13 +16651,12 @@ __metadata:
languageName: node
linkType: hard
-"react-simple-animate@npm:^3.3.12":
- version: 3.3.12
- resolution: "react-simple-animate@npm:3.3.12"
+"react-simple-animate@npm:^3.3.12, react-simple-animate@npm:^3.5.3":
+ version: 3.5.3
+ resolution: "react-simple-animate@npm:3.5.3"
peerDependencies:
- react: ^16.8.0 || ^17
- react-dom: ^16.8.0 || ^17
- checksum: 39b10294514abfdda3ec55c7f99a64932023f1525884deef4a5eb49fc5599f42214d65a64c30a7f6346ceb52384216cdcc87bb737282b1a2810c8cb7f9095816
+ react-dom: ^16.8.0 || ^17 || ^18 || ^19
+ checksum: 97b12651899effaf9096a40fb107caec83ae3bbad0469c612aed07b375a915097970d9ecc93f7aa97ee9580b635f2d3ccde1f7229e4a6fdb76763777750f10e7
languageName: node
linkType: hard
@@ -16491,6 +16674,20 @@ __metadata:
languageName: node
linkType: hard
+"react-smooth@npm:^4.0.0":
+ version: 4.0.4
+ resolution: "react-smooth@npm:4.0.4"
+ dependencies:
+ fast-equals: "npm:^5.0.1"
+ prop-types: "npm:^15.8.1"
+ react-transition-group: "npm:^4.4.5"
+ peerDependencies:
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ checksum: d94cb27f808721ec040d320ca1927919199495fd212e54eb9dc8ee3f73ff1d808a34be9f4b09fe49b01f411ac2387fdf0e4bee297f18faf56f94bfbef5fd204c
+ languageName: node
+ linkType: hard
+
"react-transition-group@npm:2.9.0":
version: 2.9.0
resolution: "react-transition-group@npm:2.9.0"
@@ -16714,6 +16911,25 @@ __metadata:
languageName: node
linkType: hard
+"recharts@npm:^2.15.0":
+ version: 2.15.0
+ resolution: "recharts@npm:2.15.0"
+ dependencies:
+ clsx: "npm:^2.0.0"
+ eventemitter3: "npm:^4.0.1"
+ lodash: "npm:^4.17.21"
+ react-is: "npm:^18.3.1"
+ react-smooth: "npm:^4.0.0"
+ recharts-scale: "npm:^0.4.4"
+ tiny-invariant: "npm:^1.3.1"
+ victory-vendor: "npm:^36.6.8"
+ peerDependencies:
+ react: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ react-dom: ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
+ checksum: 9dca8003c22c1d91b895add65e85d58bc1e79a5abc739bf0b61e275384f70b6922ad7247c0c39e0f5650174d2d9b1a006dc9c23d33732b7f4016c7df076826d3
+ languageName: node
+ linkType: hard
+
"redent@npm:^3.0.0":
version: 3.0.0
resolution: "redent@npm:3.0.0"
@@ -16832,9 +17048,9 @@ __metadata:
languageName: node
linkType: hard
-"rehackt@npm:0.0.6":
- version: 0.0.6
- resolution: "rehackt@npm:0.0.6"
+"rehackt@npm:^0.1.0":
+ version: 0.1.0
+ resolution: "rehackt@npm:0.1.0"
peerDependencies:
"@types/react": "*"
react: "*"
@@ -16843,7 +17059,7 @@ __metadata:
optional: true
react:
optional: true
- checksum: 814c9b80b2680dc0572639ecad1ed1961b23b606e53a00976ee4c4876f6ed736ea702381235ac40ed2a5c826fb55641b46ae23343e4ddd6378ced1da3d51ada7
+ checksum: 3d838bfee84ec06c976f21027936f3b0fdb7660ab8a2d4d3f19c65e0daa78a268aa81352311352b8576b89a074714b36ae6cd5bdadb6e975eca079f2b342de73
languageName: node
linkType: hard
@@ -17514,13 +17730,14 @@ __metadata:
version: 0.0.0-use.local
resolution: "simple@workspace:examples/simple"
dependencies:
- "@hookform/devtools": "npm:^4.0.2"
+ "@hookform/devtools": "npm:^4.3.3"
"@mui/icons-material": "npm:^5.16.12"
"@mui/material": "npm:^5.16.12"
"@tanstack/react-query": "npm:^5.21.7"
"@tanstack/react-query-devtools": "npm:^5.21.7"
"@vitejs/plugin-react": "npm:^4.2.1"
jsonexport: "npm:^3.2.0"
+ little-state-machine: "npm:^4.8.1"
lodash: "npm:~4.17.5"
ra-data-fakerest: "npm:^5.4.3"
ra-i18n-polyglot: "npm:^5.4.3"
@@ -17533,6 +17750,7 @@ __metadata:
react-hook-form: "npm:^7.53.0"
react-router: "npm:^6.22.0"
react-router-dom: "npm:^6.22.0"
+ react-simple-animate: "npm:^3.5.3"
typescript: "npm:^5.1.3"
vite: "npm:^5.0.11"
languageName: unknown
@@ -18960,6 +19178,18 @@ __metadata:
languageName: node
linkType: hard
+"use-deep-compare-effect@npm:^1.8.1":
+ version: 1.8.1
+ resolution: "use-deep-compare-effect@npm:1.8.1"
+ dependencies:
+ "@babel/runtime": "npm:^7.12.5"
+ dequal: "npm:^2.0.2"
+ peerDependencies:
+ react: ">=16.13"
+ checksum: f21f4239d774182e5389172321f00db487b415a97f5835abbe99d228eec45e3fd97803a52a25db6216ae6e1e1203b3f523336d94695dc683c661bad36a318891
+ languageName: node
+ linkType: hard
+
"use-memo-one@npm:^1.1.3":
version: 1.1.3
resolution: "use-memo-one@npm:1.1.3"
@@ -19101,6 +19331,28 @@ __metadata:
languageName: node
linkType: hard
+"victory-vendor@npm:^36.6.8":
+ version: 36.9.2
+ resolution: "victory-vendor@npm:36.9.2"
+ dependencies:
+ "@types/d3-array": "npm:^3.0.3"
+ "@types/d3-ease": "npm:^3.0.0"
+ "@types/d3-interpolate": "npm:^3.0.1"
+ "@types/d3-scale": "npm:^4.0.2"
+ "@types/d3-shape": "npm:^3.1.0"
+ "@types/d3-time": "npm:^3.0.0"
+ "@types/d3-timer": "npm:^3.0.0"
+ d3-array: "npm:^3.1.6"
+ d3-ease: "npm:^3.0.1"
+ d3-interpolate: "npm:^3.0.1"
+ d3-scale: "npm:^4.0.2"
+ d3-shape: "npm:^3.1.0"
+ d3-time: "npm:^3.0.0"
+ d3-timer: "npm:^3.0.1"
+ checksum: bad36de3bf4d406834743c2e99a8281d786af324d7e84b7f7a2fc02c27a3779034fb0c3c4707d4c8e68683334d924a67100cfa13985235565e83b9877f8e2ffd
+ languageName: node
+ linkType: hard
+
"vite@npm:^5.0.11":
version: 5.4.6
resolution: "vite@npm:5.4.6"
From 91774e5aed4b14cf354537477dd9ea31ecd9b93a Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 13:14:56 +0100
Subject: [PATCH 11/18] Remove only in tests
---
.../ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
index 54ef3bcc657..e771634acc3 100644
--- a/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
+++ b/packages/ra-ui-materialui/src/input/ArrayInput/ArrayInput.spec.tsx
@@ -384,7 +384,7 @@ describe('', () => {
});
describe('used within a form with global validation', () => {
- it.only('should display an error if the array is required and empty', async () => {
+ it('should display an error if the array is required and empty', async () => {
render();
await screen.findByDisplayValue('Leo Tolstoy');
const RemoveButtons = screen.getAllByLabelText('Remove');
From f8009931185883dcf3af537e12051530ca890f84 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 13:38:48 +0100
Subject: [PATCH 12/18] Missing dep update
---
packages/ra-input-rich-text/package.json | 2 +-
yarn.lock | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/packages/ra-input-rich-text/package.json b/packages/ra-input-rich-text/package.json
index fe1b43ede66..35514ffce1f 100644
--- a/packages/ra-input-rich-text/package.json
+++ b/packages/ra-input-rich-text/package.json
@@ -46,7 +46,7 @@
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
- "@mui/icons-material": "^5.15.20",
+ "@mui/icons-material": "^5.16.12",
"@mui/material": "^5.16.12",
"@testing-library/react": "^15.0.7",
"@tiptap/extension-mention": "^2.0.3",
diff --git a/yarn.lock b/yarn.lock
index 125251ca114..58cd96eb3bf 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2823,7 +2823,7 @@ __metadata:
languageName: node
linkType: hard
-"@mui/icons-material@npm:^5.15.20, @mui/icons-material@npm:^5.16.12":
+"@mui/icons-material@npm:^5.16.12":
version: 5.16.14
resolution: "@mui/icons-material@npm:5.16.14"
dependencies:
@@ -16112,7 +16112,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "ra-input-rich-text@workspace:packages/ra-input-rich-text"
dependencies:
- "@mui/icons-material": "npm:^5.15.20"
+ "@mui/icons-material": "npm:^5.16.12"
"@mui/material": "npm:^5.16.12"
"@testing-library/react": "npm:^15.0.7"
"@tiptap/core": "npm:^2.0.3"
@@ -16241,9 +16241,9 @@ __metadata:
rimraf: "npm:^3.0.2"
typescript: "npm:^5.1.3"
peerDependencies:
- "@mui/icons-material": ^5.15.20
- "@mui/material": ^5.15.20
- "@mui/utils": ^5.15.20
+ "@mui/icons-material": ^5.16.12
+ "@mui/material": ^5.16.12
+ "@mui/utils": ^5.16.12
ra-core: ^5.0.0
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
From 49497adcd78552e4f98c949581e0b814adf698ea Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 14:18:24 +0100
Subject: [PATCH 13/18] Revert unnecessary change
---
examples/demo/src/products/ProductEdit.tsx | 154 ++++++++++-----------
1 file changed, 74 insertions(+), 80 deletions(-)
diff --git a/examples/demo/src/products/ProductEdit.tsx b/examples/demo/src/products/ProductEdit.tsx
index 248f6163a38..0616cbf0edd 100644
--- a/examples/demo/src/products/ProductEdit.tsx
+++ b/examples/demo/src/products/ProductEdit.tsx
@@ -52,89 +52,83 @@ const ProductTitle = () => {
) : null;
};
-const ProductEdit = () => {
- return (
- }>
-
- }
- >
-
-
-
-
- }
- >
-
-
- }
- >
-
-
-
- }
- path="reviews"
- sx={{ minHeight: 48 }}
- iconPosition="start"
- icon={}
- >
- (
+ }>
+
+ }
+ >
+
+
+
+
+ }
+ >
+
+
+ }
+ >
+
+
+ }
+ sx={{ lineHeight: 'inherit' }}
+ />
+ }
+ path="reviews"
+ sx={{ minHeight: 48 }}
+ iconPosition="start"
+ icon={}
+ >
+ }
+ >
+
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-};
+
+
+
+
+
+
+
+
+
+
+
+
+);
const req = [required()];
From a42f048859bbd50990394e67cf5d66063549d307 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 14:38:11 +0100
Subject: [PATCH 14/18] Refactor with usePageTitle
---
examples/demo/src/categories/CategoryList.tsx | 9 ++---
examples/demo/src/invoices/InvoiceList.tsx | 9 ++---
examples/demo/src/orders/OrderEdit.tsx | 13 +++----
examples/demo/src/orders/OrderList.tsx | 9 ++---
examples/demo/src/products/ProductCreate.tsx | 10 ++----
examples/demo/src/products/ProductList.tsx | 8 ++---
examples/demo/src/reviews/ReviewCreate.tsx | 9 ++---
examples/demo/src/reviews/ReviewList.tsx | 9 ++---
examples/demo/src/segments/Segments.tsx | 3 +-
examples/demo/src/usePageTitle.tsx | 36 +++++++++++++++++++
examples/demo/src/visitors/VisitorCreate.tsx | 8 ++---
examples/demo/src/visitors/VisitorEdit.tsx | 7 ++--
examples/demo/src/visitors/VisitorList.tsx | 9 ++---
13 files changed, 65 insertions(+), 74 deletions(-)
create mode 100644 examples/demo/src/usePageTitle.tsx
diff --git a/examples/demo/src/categories/CategoryList.tsx b/examples/demo/src/categories/CategoryList.tsx
index 5b74805b04b..64712b76f35 100644
--- a/examples/demo/src/categories/CategoryList.tsx
+++ b/examples/demo/src/categories/CategoryList.tsx
@@ -4,9 +4,7 @@ import {
List,
RecordContextProvider,
useDefaultTitle,
- useGetResourceLabel,
useListContext,
- useTranslate,
} from 'react-admin';
import {
Grid,
@@ -20,14 +18,11 @@ import { humanize } from 'inflection';
import LinkToRelatedProducts from './LinkToRelatedProducts';
import { Category } from '../types';
+import { usePageTitle } from '../usePageTitle';
const CategoriesTitle = () => {
const title = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('categories', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
{`${title} - ${pageTitle}`}
diff --git a/examples/demo/src/invoices/InvoiceList.tsx b/examples/demo/src/invoices/InvoiceList.tsx
index ed0cca20ff7..be1488fab75 100644
--- a/examples/demo/src/invoices/InvoiceList.tsx
+++ b/examples/demo/src/invoices/InvoiceList.tsx
@@ -13,13 +13,12 @@ import {
ReferenceInput,
FilterButton,
useDefaultTitle,
- useTranslate,
- useGetResourceLabel,
} from 'react-admin';
import FullNameField from '../visitors/FullNameField';
import AddressField from '../visitors/AddressField';
import InvoiceShow from './InvoiceShow';
+import { usePageTitle } from '../usePageTitle';
const listFilters = [
,
@@ -38,11 +37,7 @@ const ListActions = () => (
const InvoicesTitle = () => {
const title = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('invoices', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
{`${title} - ${pageTitle}`}
diff --git a/examples/demo/src/orders/OrderEdit.tsx b/examples/demo/src/orders/OrderEdit.tsx
index 14051cee045..d2e807439e2 100644
--- a/examples/demo/src/orders/OrderEdit.tsx
+++ b/examples/demo/src/orders/OrderEdit.tsx
@@ -17,9 +17,10 @@ import {
} from 'react-admin';
import { Card, CardContent, Box, Grid, Typography, Link } from '@mui/material';
-import { Order, Customer } from '../types';
+import { Customer } from '../types';
import Basket from './Basket';
import Totals from './Totals';
+import { usePageTitle } from '../usePageTitle';
const OrderEdit = () => (
} component="div">
@@ -29,17 +30,13 @@ const OrderEdit = () => (
const OrderTitle = () => {
const appTitle = useDefaultTitle();
- const translate = useTranslate();
- const record = useRecordContext();
- const pageTitle = translate('resources.orders.title', {
- reference: record?.reference,
- });
- return record ? (
+ const pageTitle = usePageTitle({ view: 'edit' });
+ return (
<>
{`${appTitle} - ${pageTitle}`}
{pageTitle}
>
- ) : null;
+ );
};
const CustomerDetails = () => {
diff --git a/examples/demo/src/orders/OrderList.tsx b/examples/demo/src/orders/OrderList.tsx
index 7e3b4ecd4c8..4cf8859526f 100644
--- a/examples/demo/src/orders/OrderList.tsx
+++ b/examples/demo/src/orders/OrderList.tsx
@@ -20,9 +20,7 @@ import {
TextField,
TopToolbar,
useDefaultTitle,
- useGetResourceLabel,
useListContext,
- useTranslate,
} from 'react-admin';
import { useMediaQuery, Divider, Tabs, Tab, Theme } from '@mui/material';
@@ -30,6 +28,7 @@ import CustomerReferenceField from '../visitors/CustomerReferenceField';
import AddressField from '../visitors/AddressField';
import MobileGrid from './MobileGrid';
import { Customer } from '../types';
+import { usePageTitle } from '../usePageTitle';
const ListActions = () => (
@@ -41,11 +40,7 @@ const ListActions = () => (
const OrdersTitle = () => {
const title = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('orders', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
{`${title} - ${pageTitle}`}
diff --git a/examples/demo/src/products/ProductCreate.tsx b/examples/demo/src/products/ProductCreate.tsx
index d10e0616549..499cd872f2f 100644
--- a/examples/demo/src/products/ProductCreate.tsx
+++ b/examples/demo/src/products/ProductCreate.tsx
@@ -5,10 +5,9 @@ import {
TextInput,
required,
useDefaultTitle,
- useGetResourceLabel,
- useTranslate,
} from 'react-admin';
import { ProductEditDetails } from './ProductEditDetails';
+import { usePageTitle } from '../usePageTitle';
const RichTextInput = React.lazy(() =>
import('ra-input-rich-text').then(module => ({
default: module.RichTextInput,
@@ -17,11 +16,8 @@ const RichTextInput = React.lazy(() =>
const ProductTitle = () => {
const appTitle = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.create', {
- name: getResourceLabel('products', 1),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
+
return (
<>
{`${appTitle} - ${pageTitle}`}
diff --git a/examples/demo/src/products/ProductList.tsx b/examples/demo/src/products/ProductList.tsx
index 68e2568b427..7a10e9e0e36 100644
--- a/examples/demo/src/products/ProductList.tsx
+++ b/examples/demo/src/products/ProductList.tsx
@@ -17,20 +17,16 @@ import {
Title,
TopToolbar,
useTranslate,
- useGetResourceLabel,
useDefaultTitle,
} from 'react-admin';
import ImageList from './GridList';
import Aside from './Aside';
+import { usePageTitle } from '../usePageTitle';
const ProductList = () => {
const appTitle = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('products', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
const isSmall = useMediaQuery(theme => theme.breakpoints.down('md'));
return (
diff --git a/examples/demo/src/reviews/ReviewCreate.tsx b/examples/demo/src/reviews/ReviewCreate.tsx
index b9e730827e1..731e53cf0e6 100644
--- a/examples/demo/src/reviews/ReviewCreate.tsx
+++ b/examples/demo/src/reviews/ReviewCreate.tsx
@@ -11,20 +11,15 @@ import {
useRedirect,
getRecordFromLocation,
useDefaultTitle,
- useTranslate,
- useGetResourceLabel,
} from 'react-admin';
import { useLocation } from 'react-router';
import StarRatingInput from './StarRatingInput';
+import { usePageTitle } from '../usePageTitle';
const ReviewTitle = () => {
const appTitle = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.create', {
- name: getResourceLabel('reviews', 1),
- });
+ const pageTitle = usePageTitle({ view: 'create' });
return (
<>
{`${appTitle} - ${pageTitle}`}
diff --git a/examples/demo/src/reviews/ReviewList.tsx b/examples/demo/src/reviews/ReviewList.tsx
index 7b0e7d7d98f..0accf1c94a3 100644
--- a/examples/demo/src/reviews/ReviewList.tsx
+++ b/examples/demo/src/reviews/ReviewList.tsx
@@ -8,8 +8,6 @@ import {
SelectColumnsButton,
TopToolbar,
useDefaultTitle,
- useGetResourceLabel,
- useTranslate,
} from 'react-admin';
import { matchPath, useLocation, useNavigate } from 'react-router-dom';
import { Box, Drawer, useMediaQuery, Theme } from '@mui/material';
@@ -18,6 +16,7 @@ import ReviewListMobile from './ReviewListMobile';
import ReviewListDesktop from './ReviewListDesktop';
import reviewFilters from './reviewFilters';
import ReviewEdit from './ReviewEdit';
+import { usePageTitle } from '../usePageTitle';
const ReviewListActions = () => (
@@ -30,11 +29,7 @@ const ReviewListActions = () => (
const ReviewsTitle = () => {
const title = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('reviews', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
{`${title} - ${pageTitle}`}
diff --git a/examples/demo/src/segments/Segments.tsx b/examples/demo/src/segments/Segments.tsx
index 86b8357c6d1..5067350f12c 100644
--- a/examples/demo/src/segments/Segments.tsx
+++ b/examples/demo/src/segments/Segments.tsx
@@ -11,11 +11,12 @@ import { useTranslate, Title, useDefaultTitle } from 'react-admin';
import LinkToRelatedCustomers from './LinkToRelatedCustomers';
import segments from './data';
+import { usePageTitle } from '../usePageTitle';
const Segments = () => {
const appTitle = useDefaultTitle();
const translate = useTranslate();
- const pageTitle = translate('resources.segments.name', { smart_count: 2 });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
diff --git a/examples/demo/src/usePageTitle.tsx b/examples/demo/src/usePageTitle.tsx
new file mode 100644
index 00000000000..eee414a8537
--- /dev/null
+++ b/examples/demo/src/usePageTitle.tsx
@@ -0,0 +1,36 @@
+import {
+ HintedString,
+ RaRecord,
+ useGetRecordRepresentation,
+ useGetResourceLabel,
+ useRecordContext,
+ useResourceContext,
+ useTranslate,
+} from 'react-admin';
+
+export const usePageTitle = (props: {
+ view: HintedString<'list' | 'edit' | 'show' | 'create'>;
+ record?: RaRecord;
+ resource?: string;
+ count?: number;
+}) => {
+ const { view, count = view === 'list' ? 2 : 1 } = props;
+ const translate = useTranslate();
+ const record = useRecordContext(props);
+ const resource = useResourceContext(props);
+ const getResourceLabel = useGetResourceLabel();
+ const getRecordRepresentation = useGetRecordRepresentation();
+
+ if (!resource) {
+ throw new Error(
+ 'usePageTitle must be used inside a component or provide a resource prop'
+ );
+ }
+
+ const pageTitle = translate(`ra.page.${view}`, {
+ name: getResourceLabel(resource, count),
+ recordRepresentation: getRecordRepresentation(record),
+ });
+
+ return pageTitle;
+};
diff --git a/examples/demo/src/visitors/VisitorCreate.tsx b/examples/demo/src/visitors/VisitorCreate.tsx
index 39d0521b1fe..5d0547f1386 100644
--- a/examples/demo/src/visitors/VisitorCreate.tsx
+++ b/examples/demo/src/visitors/VisitorCreate.tsx
@@ -8,9 +8,9 @@ import {
PasswordInput,
email,
useDefaultTitle,
- useGetResourceLabel,
} from 'react-admin';
import { Box, Typography } from '@mui/material';
+import { usePageTitle } from '../usePageTitle';
export const validateForm = (
values: Record
@@ -39,11 +39,7 @@ export const validateForm = (
const VisitorTitle = () => {
const appTitle = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.create', {
- name: getResourceLabel('customers', 1),
- });
+ const pageTitle = usePageTitle({ view: 'create' });
return (
<>
{`${appTitle} - ${pageTitle}`}
diff --git a/examples/demo/src/visitors/VisitorEdit.tsx b/examples/demo/src/visitors/VisitorEdit.tsx
index aab524674e5..050029c35f9 100644
--- a/examples/demo/src/visitors/VisitorEdit.tsx
+++ b/examples/demo/src/visitors/VisitorEdit.tsx
@@ -8,7 +8,6 @@ import {
SimpleForm,
useTranslate,
useDefaultTitle,
- useRecordContext,
} from 'react-admin';
import { Grid, Box, Typography } from '@mui/material';
@@ -16,7 +15,7 @@ import Aside from './Aside';
import FullNameField from './FullNameField';
import SegmentsInput from './SegmentsInput';
import { validateForm } from './VisitorCreate';
-import { Customer } from '../types';
+import { usePageTitle } from '../usePageTitle';
const VisitorEdit = () => {
const translate = useTranslate();
@@ -118,10 +117,10 @@ const VisitorEdit = () => {
const VisitorTitle = () => {
const appTitle = useDefaultTitle();
- const record = useRecordContext();
+ const pageTitle = usePageTitle({ view: 'edit' });
return (
<>
- {`${appTitle} - ${record?.first_name} ${record?.last_name}`}
+ {`${appTitle} - ${pageTitle}`}
,
@@ -43,11 +42,7 @@ const VisitorListActions = () => (
const VisitorTitle = () => {
const title = useDefaultTitle();
- const translate = useTranslate();
- const getResourceLabel = useGetResourceLabel();
- const pageTitle = translate('ra.page.list', {
- name: getResourceLabel('customers', 2),
- });
+ const pageTitle = usePageTitle({ view: 'list' });
return (
<>
{`${title} - ${pageTitle}`}
From 152a586c44c5f51cf2240465610c5a9f11bbeb1d Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 14:40:45 +0100
Subject: [PATCH 15/18] Fix ProductCreate
---
examples/demo/src/products/ProductCreate.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/demo/src/products/ProductCreate.tsx b/examples/demo/src/products/ProductCreate.tsx
index 499cd872f2f..f50c81b190c 100644
--- a/examples/demo/src/products/ProductCreate.tsx
+++ b/examples/demo/src/products/ProductCreate.tsx
@@ -16,7 +16,7 @@ const RichTextInput = React.lazy(() =>
const ProductTitle = () => {
const appTitle = useDefaultTitle();
- const pageTitle = usePageTitle({ view: 'list' });
+ const pageTitle = usePageTitle({ view: 'create' });
return (
<>
From c36525e65798524457ad8892d4d979ce02e07ee5 Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 14:54:28 +0100
Subject: [PATCH 16/18] Fix segments page
---
examples/demo/src/segments/Segments.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/examples/demo/src/segments/Segments.tsx b/examples/demo/src/segments/Segments.tsx
index 5067350f12c..e53fa78ed9c 100644
--- a/examples/demo/src/segments/Segments.tsx
+++ b/examples/demo/src/segments/Segments.tsx
@@ -16,7 +16,7 @@ import { usePageTitle } from '../usePageTitle';
const Segments = () => {
const appTitle = useDefaultTitle();
const translate = useTranslate();
- const pageTitle = usePageTitle({ view: 'list' });
+ const pageTitle = usePageTitle({ view: 'list', resource: 'segments' });
return (
<>
From ccd047d3e533e0c180fa72f92965f6d82368739e Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 15:10:54 +0100
Subject: [PATCH 17/18] Add title tot ReviewEdit
---
examples/demo/src/reviews/ReviewEdit.tsx | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/examples/demo/src/reviews/ReviewEdit.tsx b/examples/demo/src/reviews/ReviewEdit.tsx
index 224168a5ad7..d52679ebde6 100644
--- a/examples/demo/src/reviews/ReviewEdit.tsx
+++ b/examples/demo/src/reviews/ReviewEdit.tsx
@@ -6,6 +6,8 @@ import {
SimpleForm,
DateField,
Labeled,
+ useDefaultTitle,
+ useRecordContext,
} from 'react-admin';
import { Box, Grid, Stack, IconButton, Typography } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';
@@ -15,16 +17,25 @@ import CustomerReferenceField from '../visitors/CustomerReferenceField';
import StarRatingField from './StarRatingField';
import ReviewEditToolbar from './ReviewEditToolbar';
import { Review } from '../types';
+import { usePageTitle } from '../usePageTitle';
interface ReviewEditProps {
id: Review['id'];
onCancel: () => void;
}
+const ReviewTitle = () => {
+ const appTitle = useDefaultTitle();
+ const pageTitle = usePageTitle({ view: 'edit' });
+ return {`${appTitle} - ${pageTitle}`};
+};
+
const ReviewEdit = ({ id, onCancel }: ReviewEditProps) => {
const translate = useTranslate();
return (
+
+
From 6c93dc44b57f8d19c1c1f8044a1761e34968642a Mon Sep 17 00:00:00 2001
From: Gildas <1122076+djhi@users.noreply.github.com>
Date: Thu, 9 Jan 2025 15:11:07 +0100
Subject: [PATCH 18/18] cleanup
---
examples/demo/src/reviews/ReviewEdit.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/examples/demo/src/reviews/ReviewEdit.tsx b/examples/demo/src/reviews/ReviewEdit.tsx
index d52679ebde6..464e09720b3 100644
--- a/examples/demo/src/reviews/ReviewEdit.tsx
+++ b/examples/demo/src/reviews/ReviewEdit.tsx
@@ -7,7 +7,6 @@ import {
DateField,
Labeled,
useDefaultTitle,
- useRecordContext,
} from 'react-admin';
import { Box, Grid, Stack, IconButton, Typography } from '@mui/material';
import CloseIcon from '@mui/icons-material/Close';