Skip to content

Commit ace25f1

Browse files
authored
feat: add support for react 19 (#726)
1 parent 3f91c05 commit ace25f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+15178
-11181
lines changed

.changeset/angry-panthers-type.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@craftjs/layers': patch
3+
'@craftjs/utils': patch
4+
'@craftjs/core': patch
5+
---
6+
7+
Add support for react 19

examples/basic/components/Header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { useEditor } from '@craftjs/core';
22
import {
33
Box,
44
Typography,
5-
Grid,
5+
Grid2 as Grid,
66
Button as MaterialButton,
7-
} from '@material-ui/core';
7+
} from '@mui/material';
88
import React from 'react';
99

1010
import { Button } from './user/Button';

examples/basic/components/SettingsPanel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Grid,
66
Typography,
77
Button as MaterialButton,
8-
} from '@material-ui/core';
8+
} from '@mui/material';
99
import React from 'react';
1010

1111
export const SettingsPanel = () => {

examples/basic/components/Toolbox.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { useEditor, Element } from '@craftjs/core';
2-
import {
3-
Box,
4-
Typography,
5-
Grid,
6-
Button as MaterialButton,
7-
} from '@material-ui/core';
2+
import { Box, Typography, Grid, Button as MaterialButton } from '@mui/material';
83
import React from 'react';
94

105
import { Button } from './user/Button';

examples/basic/components/Topbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
DialogActions,
1212
TextField,
1313
Snackbar,
14-
} from '@material-ui/core';
14+
} from '@mui/material';
1515
import copy from 'copy-to-clipboard';
1616
import lz from 'lzutf8';
1717
import React, { useState } from 'react';

examples/basic/components/user/Button.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
RadioGroup,
77
Radio,
88
FormControlLabel,
9-
} from '@material-ui/core';
9+
} from '@mui/material';
1010
import React from 'react';
1111

1212
export const Button = ({ size, variant, color, text, ...props }) => {

examples/basic/components/user/Container.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { useNode } from '@craftjs/core';
2-
import { Slider } from '@material-ui/core';
3-
import { Paper, FormControl, FormLabel } from '@material-ui/core';
4-
import ColorPicker from 'material-ui-color-picker';
2+
import { Slider, Paper, FormControl, FormLabel } from '@mui/material';
53
import React from 'react';
4+
import { HexColorPicker } from 'react-colorful';
65

76
export const Container = ({ background, padding, children, ...props }) => {
87
const {
@@ -33,9 +32,9 @@ export const ContainerSettings = () => {
3332
<div>
3433
<FormControl fullWidth={true} margin="normal" component="fieldset">
3534
<FormLabel component="legend">Background</FormLabel>
36-
<ColorPicker
35+
<HexColorPicker
3736
name="background-color"
38-
value={background}
37+
color={background}
3938
onChange={(color) => {
4039
setProp((props) => (props.background = color), 500);
4140
}}

examples/basic/components/user/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useNode } from '@craftjs/core';
2-
import { Slider, FormControl, FormLabel } from '@material-ui/core';
2+
import { Slider, FormControl, FormLabel } from '@mui/material';
33
import React, { useState, useEffect } from 'react';
44
import ContentEditable from 'react-contenteditable';
55

examples/basic/next.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
module.exports = {
2+
output: 'export',
23
assetPrefix: process.env.NODE_ENV === 'production' ? '/examples/basic' : '/',
34
};

examples/basic/package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@
44
"private": true,
55
"dependencies": {
66
"@craftjs/core": "workspace:*",
7-
"@material-ui/core": "4.5.2",
7+
"@emotion/react": "^11.14.0",
8+
"@emotion/styled": "^11.14.0",
9+
"@mui/material": "^6.4.3",
810
"clsx": "latest",
911
"copy-to-clipboard": "3.2.0",
1012
"lzutf8": "0.5.5",
11-
"material-ui-color-picker": "3.2.0",
12-
"next": "13.1.6",
13+
"next": "15.1.6",
1314
"prop-types": "latest",
14-
"react": "18.2.0",
15+
"react": "19.0.0",
16+
"react-colorful": "^5.6.1",
1517
"react-contenteditable": "3.3.3",
16-
"react-dom": "18.2.0"
18+
"react-dom": "19.0.0"
1719
},
1820
"scripts": {
1921
"start": "next dev -p 3002",
2022
"build": "next build",
21-
"export": "next export",
2223
"clean": "rimraf lib .next out dist"
2324
},
2425
"devDependencies": {
26+
"@types/react": "19.0.8",
27+
"@types/react-dom": "19.0.3",
2528
"cross-env": "6.0.3"
2629
}
2730
}

0 commit comments

Comments
 (0)