Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b25469e
fix: make parentId param optional in actions.add() (#635)
prevwong May 13, 2024
4fa9b46
fix: improve resolver performance (#623)
Traveller23 May 16, 2024
1212856
chore(docs): update type of state.events.selected in useNode hook (#621)
zzzhrookie May 17, 2024
cb45f2c
feat: SSR support (#637)
tomas-c May 17, 2024
03f87eb
chore: release (#636)
github-actions[bot] May 17, 2024
cb3f594
chore: readme (#616)
MoonlightSmile May 28, 2024
e99cafe
chore: sponsors
prevwong May 28, 2024
c069dff
fix: creating linked node in strict mode (#653)
prevwong May 31, 2024
9eff6b8
chore: cleanup React.FC prop types (#655)
prevwong May 31, 2024
0f6ecb1
chore: release (#654)
github-actions[bot] Jun 4, 2024
62cb06a
chore: export dnd utils (#656)
mateusz-oi Jun 19, 2024
6b64687
chore: release (#661)
github-actions[bot] Jun 24, 2024
46eb68e
fix(site): typography panel summary stuck on bold (#664)
MaziyarMK Jun 26, 2024
b0a9e0b
feat: allow customising dnd indicator classname/style (#683)
prevwong Jul 25, 2024
8f2b7e7
chore: rollup config
prevwong Jul 26, 2024
07dc0db
chore: release (#684)
github-actions[bot] Jul 26, 2024
cd13881
hotfix: regression missing types
prevwong Jul 27, 2024
39ea4ab
chore: release (#687)
github-actions[bot] Jul 27, 2024
48cb5cb
fix: update styled-components (#707)
pixel-toys-chris-evans Oct 23, 2024
2f133d9
feat: allow layers to utilise CoreEventHandler mouseleave options (#…
itsbjoern Oct 24, 2024
218733c
chore: release (#708)
github-actions[bot] Oct 24, 2024
1231d0b
chore: sponsors ❤️
prevwong Nov 22, 2024
552a1f3
chore: update sponsors
prevwong Dec 27, 2024
0bac19d
chore: typo in core concepts docs (#725)
svenweb Feb 5, 2025
3f91c05
chore(docs): update history methods api doc (#712)
Maders Feb 5, 2025
ace25f1
feat: add support for react 19 (#726)
prevwong Feb 14, 2025
fdcae89
fix: styles
prevwong Feb 14, 2025
23f44f3
chore: release (#729)
github-actions[bot] Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/many-toys-rescue.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/olive-countries-approve.md

This file was deleted.

4 changes: 2 additions & 2 deletions examples/basic/components/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { useEditor } from '@craftjs/core';
import {
Box,
Typography,
Grid,
Grid2 as Grid,
Button as MaterialButton,
} from '@material-ui/core';
} from '@mui/material';
import React from 'react';

import { Button } from './user/Button';
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/SettingsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Grid,
Typography,
Button as MaterialButton,
} from '@material-ui/core';
} from '@mui/material';
import React from 'react';

export const SettingsPanel = () => {
Expand Down
7 changes: 1 addition & 6 deletions examples/basic/components/Toolbox.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { useEditor, Element } from '@craftjs/core';
import {
Box,
Typography,
Grid,
Button as MaterialButton,
} from '@material-ui/core';
import { Box, Typography, Grid, Button as MaterialButton } from '@mui/material';
import React from 'react';

import { Button } from './user/Button';
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/Topbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
DialogActions,
TextField,
Snackbar,
} from '@material-ui/core';
} from '@mui/material';
import copy from 'copy-to-clipboard';
import lz from 'lzutf8';
import React, { useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/user/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
RadioGroup,
Radio,
FormControlLabel,
} from '@material-ui/core';
} from '@mui/material';
import React from 'react';

export const Button = ({ size, variant, color, text, ...props }) => {
Expand Down
9 changes: 4 additions & 5 deletions examples/basic/components/user/Container.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useNode } from '@craftjs/core';
import { Slider } from '@material-ui/core';
import { Paper, FormControl, FormLabel } from '@material-ui/core';
import ColorPicker from 'material-ui-color-picker';
import { Slider, Paper, FormControl, FormLabel } from '@mui/material';
import React from 'react';
import { HexColorPicker } from 'react-colorful';

export const Container = ({ background, padding, children, ...props }) => {
const {
Expand Down Expand Up @@ -33,9 +32,9 @@ export const ContainerSettings = () => {
<div>
<FormControl fullWidth={true} margin="normal" component="fieldset">
<FormLabel component="legend">Background</FormLabel>
<ColorPicker
<HexColorPicker
name="background-color"
value={background}
color={background}
onChange={(color) => {
setProp((props) => (props.background = color), 500);
}}
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/user/Text.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNode } from '@craftjs/core';
import { Slider, FormControl, FormLabel } from '@material-ui/core';
import { Slider, FormControl, FormLabel } from '@mui/material';
import React, { useState, useEffect } from 'react';
import ContentEditable from 'react-contenteditable';

Expand Down
1 change: 1 addition & 0 deletions examples/basic/next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
output: 'export',
assetPrefix: process.env.NODE_ENV === 'production' ? '/examples/basic' : '/',
};
15 changes: 9 additions & 6 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@
"private": true,
"dependencies": {
"@craftjs/core": "workspace:*",
"@material-ui/core": "4.5.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/material": "^6.4.3",
"clsx": "latest",
"copy-to-clipboard": "3.2.0",
"lzutf8": "0.5.5",
"material-ui-color-picker": "3.2.0",
"next": "13.1.6",
"next": "15.1.6",
"prop-types": "latest",
"react": "18.2.0",
"react": "19.0.0",
"react-colorful": "^5.6.1",
"react-contenteditable": "3.3.3",
"react-dom": "18.2.0"
"react-dom": "19.0.0"
},
"scripts": {
"start": "next dev -p 3002",
"build": "next build",
"export": "next export",
"clean": "rimraf lib .next out dist"
},
"devDependencies": {
"@types/react": "19.0.8",
"@types/react-dom": "19.0.3",
"cross-env": "6.0.3"
}
}
4 changes: 2 additions & 2 deletions examples/basic/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CssBaseline from '@material-ui/core/CssBaseline';
import { ThemeProvider } from '@material-ui/core/styles';
import CssBaseline from '@mui/material/CssBaseline';
import { ThemeProvider } from '@mui/material/styles';
import App from 'next/app';
import Head from 'next/head';
import React from 'react';
Expand Down
72 changes: 27 additions & 45 deletions examples/basic/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
import { ServerStyleSheets } from '@material-ui/core/styles';
import Document, { Html, Head, Main, NextScript } from 'next/document';
import React from 'react';
import { ServerStyleSheet } from 'styled-components';

import theme from '../src/theme';

export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const sheet = new ServerStyleSheet();
const originalRenderPage = ctx.renderPage;

try {
ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) =>
sheet.collectStyles(<App {...props} />),
});

const initialProps = await Document.getInitialProps(ctx);
return {
...initialProps,
styles: (
<>
{initialProps.styles}
{sheet.getStyleElement()}
</>
),
};
} finally {
sheet.seal();
}
}

render() {
return (
<Html lang="en">
Expand All @@ -29,47 +55,3 @@ export default class MyDocument extends Document {
);
}
}

MyDocument.getInitialProps = async (ctx) => {
// Resolution order
//
// On the server:
// 1. app.getInitialProps
// 2. page.getInitialProps
// 3. document.getInitialProps
// 4. app.render
// 5. page.render
// 6. document.render
//
// On the server with error:
// 1. document.getInitialProps
// 2. app.render
// 3. page.render
// 4. document.render
//
// On the client
// 1. app.getInitialProps
// 2. page.getInitialProps
// 3. app.render
// 4. page.render

// Render app and page and get the context of the page with collected side effects.
const sheets = new ServerStyleSheets();
const originalRenderPage = ctx.renderPage;

ctx.renderPage = () =>
originalRenderPage({
enhanceApp: (App) => (props) => sheets.collect(<App {...props} />),
});

const initialProps = await Document.getInitialProps(ctx);

return {
...initialProps,
// Styles fragment is rendered after the app and page rendering finish.
styles: [
...React.Children.toArray(initialProps.styles),
sheets.getStyleElement(),
],
};
};
45 changes: 0 additions & 45 deletions examples/basic/pages/about.js

This file was deleted.

21 changes: 9 additions & 12 deletions examples/basic/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Editor, Frame, Element } from '@craftjs/core';
import { Typography, Paper, Grid, makeStyles } from '@material-ui/core';
import { Typography, Paper, Grid2 as Grid } from '@mui/material';
import React from 'react';

import { SettingsPanel } from '../components/SettingsPanel';
Expand All @@ -10,15 +10,7 @@ import { Card, CardBottom, CardTop } from '../components/user/Card';
import { Container } from '../components/user/Container';
import { Text } from '../components/user/Text';

const useStyles = makeStyles(() => ({
root: {
padding: 0,
background: 'rgb(252, 253, 253)',
},
}));
export default function App() {
const classes = useStyles();

return (
<div style={{ margin: '0 auto', width: '800px' }}>
<Typography style={{ margin: '20px 0' }} variant="h5" align="center">
Expand All @@ -36,7 +28,7 @@ export default function App() {
>
<Topbar />
<Grid container spacing={5} style={{ paddingTop: '10px' }}>
<Grid item xs>
<Grid size={8}>
<Frame>
<Element
canvas
Expand Down Expand Up @@ -64,8 +56,13 @@ export default function App() {
</Element>
</Frame>
</Grid>
<Grid item xs={4}>
<Paper className={classes.root}>
<Grid item size={4}>
<Paper
sx={{
padding: 0,
background: 'rgb(252, 253, 253)',
}}
>
<Toolbox />
<SettingsPanel />
</Paper>
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/src/Link.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable jsx-a11y/anchor-has-content */
import MuiLink from '@material-ui/core/Link';
import { Link as MuiLink } from '@mui/material';
import clsx from 'clsx';
import NextLink from 'next/link';
import { useRouter } from 'next/router';
Expand Down
37 changes: 0 additions & 37 deletions examples/basic/src/ProTip.js

This file was deleted.

8 changes: 2 additions & 6 deletions examples/basic/src/theme.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { red } from '@material-ui/core/colors';
import { createMuiTheme } from '@material-ui/core/styles';
import { createTheme } from '@mui/material/styles';

// Create a theme instance.
const theme = createMuiTheme({
const theme = createTheme({
palette: {
primary: {
main: '#556cd6',
},
secondary: {
main: '#19857b',
},
error: {
main: red.A400,
},
background: {
default: '#fff',
},
Expand Down
Loading