Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,57 @@ it according to semantic versioning. For example, if your PR adds a breaking cha
should change the heading of the (upcoming) version to include a major version bump.

-->
# 6.0.0-beta.24

## @rjsf/antd

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/chakra-ui

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/core

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/daisyui

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/fluentui-rc

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/mantine

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/mui

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/primereact

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/react-bootstrap

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/semantic-ui

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## @rjsf/shadcn

- Updated the `README.md` to show the theme snapshot with the latest theme UI from the playground, making it a link to the theme

## Dev / docs / playground

- Updated the playground to modernize the UI using MUI components
- Updated the documentation to switch to using an animated gif based on the latest modernized playground UI

# 6.0.0-beta.23

## @rjsf/core
Expand All @@ -23,6 +74,7 @@ should change the heading of the (upcoming) version to include a major version b
- Updated `Form` to support the new feature to do `onBlur` handling of `liveValidate` and `liveOmit`

## Dev / docs / playground

- Updated the playground to switch `liveValidate` and `liveOmit` from checkboxes to radio buttons for the new options
- Updated `form-props.md` and `v6x upgrade guide.md` to document the new feature and deprecation

Expand Down Expand Up @@ -127,6 +179,7 @@ should change the heading of the (upcoming) version to include a major version b
- BREAKING CHANGE: Renamed `ArrayFieldItemButtonsTemplateType` to `ArrayFieldItemButtonsTemplateProps` and updated it to replace the `onAddIndexClick()`, `onCopyIndexClick()`, `onDropIndexClick()` and `onReorderClick()` callback-generator props with the `onAddItem()`, `onCopyItem()`, `onMoveUpItem()`, `onMoveDownItem()` and `onRemoveItem()` callback props

## Dev / docs / playground

- Updated the `formTests.tsx` snapshots to add an `anyOf` of all arrays with different item types and removed the disabling of the optional data controls feature for the optional object with oneOfs
- Updated the snapshots in all of the themes accordingly
- Updated the playground to make the same changes as `formTests.tsx` in the `optionalDataControls.ts` sample, moving the `experimental_defaultFormStateBehavior` inside of a `liveSettings` block
Expand Down
2 changes: 2 additions & 0 deletions packages/antd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

Ant Design theme, fields and widgets for `react-jsonschema-form`.

[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/antd)

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
Expand Down
Binary file modified packages/antd/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/chakra-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

## About The Project

[![@rjsf/chakra-ui Screen Shot][product-screenshot]](https://rjsf-team.github.io/@rjsf/chakra-ui)
[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/chakra-ui)

Exports `chakra-ui` theme, fields and widgets for `react-jsonschema-form`.

Expand Down
Binary file modified packages/chakra-ui/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

Core logic and classic Bootstrap 3 theme for `react-jsonschema-form`.

[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/core)

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
Expand Down
Binary file modified packages/core/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions packages/daisyui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ This package integrates [DaisyUI](https://daisyui.com/), [Tailwind CSS](https://

## Screenshots

![DaisyUI Form Example 1](daisy-screenshot1.png)
![DaisyUI Form Example 2](daisy-screenshot2.png)
[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/daisyui)

## Features

Expand Down
Binary file removed packages/daisyui/daisy-screenshot1.png
Binary file not shown.
Binary file removed packages/daisyui/daisy-screenshot2.png
Binary file not shown.
Binary file added packages/daisyui/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/docs/docs/00-introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ A simple [React](https://reactjs.org/) component capable of building HTML forms
A [live playground](https://rjsf-team.github.io/react-jsonschema-form/) is hosted on GitHub Pages:

<a target='_blank' href='https://rjsf-team.github.io/react-jsonschema-form/'>
<img alt='Playground' src='https://i.imgur.com/M8ZCES5.gif'/>
![Playground](./rjsf-playground.gif)
</a>

## Philosophy
Expand Down
Binary file added packages/docs/docs/rjsf-playground.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/fluentui-rc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

Fluent UI React Components (v9) theme, fields and widgets for `react-jsonschema-form`.

[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/fluentui-rc)

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
Expand Down
Binary file modified packages/fluentui-rc/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/mantine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

`Mantine` theme, fields and widgets for `react-jsonschema-form`.

[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/mantine)

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
Expand Down
Binary file modified packages/mantine/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/mui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@

## About The Project

[![@rjsf/mui Screen Shot][product-screenshot]](https://rjsf-team.github.io/@rjsf/mui)

Exports `MUI` version 5 theme, fields, and widgets for `react-jsonschema-form`.

[<img src="./screenshot.png" alt="product-screenshot" width="800" />](https://rjsf-team.github.io/@rjsf/mui)

### Built With

- [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form/)
Expand Down
Binary file modified packages/mui/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions packages/playground/src/components/CopyLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ export default function CopyLink({ shareURL, onShare }: CopyLinkProps) {
navigator.clipboard.writeText(input.current?.value ?? '');
}

const style = { maxWidth: '21.525rem', margin: '5px 0' };
if (!shareURL) {
return (
<button className='btn btn-default' type='button' onClick={onShare}>
Share
<button className='btn btn-default' type='button' onClick={onShare} style={style}>
Share Playground
</button>
);
}

return (
<div className='input-group'>
<div className='input-group' style={style}>
<input type='text' ref={input} className='form-control' defaultValue={shareURL} />
<span className='input-group-btn'>
<button className='btn btn-default' type='button' onClick={onCopyClick}>
Expand Down
92 changes: 73 additions & 19 deletions packages/playground/src/components/Editors.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
import { useCallback, useState } from 'react';
import { Dispatch, SetStateAction, useCallback, useState } from 'react';
import { styled } from '@mui/material/styles';
import Accordion from '@mui/material/Accordion';
import MuiAccordionSummary from '@mui/material/AccordionSummary';
import AccordionDetails from '@mui/material/AccordionDetails';
import Grid from '@mui/material/Grid';
import Typography from '@mui/material/Typography';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import MonacoEditor from '@monaco-editor/react';
import { ErrorSchema, RJSFSchema, UiSchema } from '@rjsf/utils';
import isEqualWith from 'lodash/isEqualWith';

import ThemeSelector, { ThemesType } from './ThemeSelector';
import SubthemeSelector, { SubthemeType } from './SubthemeSelector';

const monacoEditorOptions = {
minimap: {
enabled: false,
},
automaticLayout: true,
};

const AccordionSummary = styled(MuiAccordionSummary)({
'.MuiAccordionSummary-content': {
margin: 0,
},
});

type EditorProps = {
title: string;
code: string;
Expand Down Expand Up @@ -70,6 +86,12 @@ type EditorsProps = {
setExtraErrors: React.Dispatch<React.SetStateAction<ErrorSchema | undefined>>;
setShareURL: React.Dispatch<React.SetStateAction<string | null>>;
hasUiSchemaGenerator: boolean;
themes: { [themeName: string]: ThemesType };
theme: string;
subtheme: string | null;
onThemeSelected: (theme: string, themeObj: ThemesType) => void;
setSubtheme: Dispatch<SetStateAction<string | null>>;
setStylesheet: Dispatch<SetStateAction<string | null>>;
};

export default function Editors({
Expand All @@ -83,7 +105,20 @@ export default function Editors({
setShareURL,
setUiSchema,
hasUiSchemaGenerator,
themes,
theme,
subtheme,
onThemeSelected,
setSubtheme,
setStylesheet,
}: EditorsProps) {
const onSubthemeSelected = useCallback(
(subtheme: any, { stylesheet }: SubthemeType) => {
setSubtheme(subtheme);
setStylesheet(stylesheet || null);
},
[setSubtheme, setStylesheet],
);
const onSchemaEdited = useCallback(
(newSchema: any) => {
setSchema(newSchema);
Expand Down Expand Up @@ -127,23 +162,42 @@ export default function Editors({
const uiSchemaTitle = hasUiSchemaGenerator ? 'UISchema (regenerated on theme change)' : 'UiSchema';

return (
<div className='col-sm-7'>
<Editor title='JSONSchema' code={toJson(schema)} onChange={onSchemaEdited} />
<div className='row'>
<div className='col-sm-6'>
<Editor title={uiSchemaTitle} code={toJson(uiSchema)} onChange={onUISchemaEdited} />
</div>
<div className='col-sm-6'>
<Editor title='formData' code={toJson(formData)} onChange={onFormDataEdited} />
</div>
</div>
{extraErrors && (
<div className='row'>
<div className='col'>
<Editor title='extraErrors' code={toJson(extraErrors || {})} onChange={onExtraErrorsEdited} />
</div>
</div>
)}
</div>
<Accordion defaultExpanded disableGutters>
<AccordionSummary expandIcon={<ExpandMoreIcon fontSize='large' />} title='Toggle Editors'>
<Grid container spacing={1} sx={{ width: '100%' }}>
<Grid size={6}>
<Typography component='div' variant='h2' sx={{ pr: 1 }}>
react-jsonschema-form
</Typography>
</Grid>
<Grid size={3}>
<ThemeSelector themes={themes} theme={theme} select={onThemeSelected} />
</Grid>
<Grid size={3}>
{themes[theme] && themes[theme].subthemes && (
<SubthemeSelector subthemes={themes[theme].subthemes!} subtheme={subtheme} select={onSubthemeSelected} />
)}
</Grid>
</Grid>
</AccordionSummary>
<AccordionDetails sx={{ p: 0 }}>
<Grid container spacing={0.5}>
<Grid size={extraErrors ? 3 : 4}>
<Editor title='JSONSchema' code={toJson(schema)} onChange={onSchemaEdited} />
</Grid>
<Grid size={extraErrors ? 3 : 4}>
<Editor title={uiSchemaTitle} code={toJson(uiSchema)} onChange={onUISchemaEdited} />
</Grid>
<Grid size={extraErrors ? 3 : 4}>
<Editor title='formData' code={toJson(formData)} onChange={onFormDataEdited} />
</Grid>
{extraErrors && (
<Grid size={3}>
<Editor title='extraErrors' code={toJson(extraErrors || {})} onChange={onExtraErrorsEdited} />
</Grid>
)}
</Grid>
</AccordionDetails>
</Accordion>
);
}
Loading