Skip to content

Commit 1529bc9

Browse files
committed
[docs] Update README files to reflect changes in v2
1 parent 93713c5 commit 1529bc9

File tree

14 files changed

+94
-74
lines changed

14 files changed

+94
-74
lines changed

README.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,65 @@ Unofficial port of [react-jsonschema-form](https://github.com/rjsf-team/react-js
88

99
## Installation
1010

11-
Install the library and `ajv` for validation.
11+
Install the library, basic theme and `ajv` for validation.
1212

1313
```shell
14-
npm install @sjsf/form @sjsf/ajv8-validator ajv@8
14+
npm install @sjsf/form @sjsf/basic-theme @sjsf/ajv8-validator ajv@8
1515
```
1616

1717
## Usage
1818

1919
```svelte
2020
<script lang="ts">
21-
import { createForm3, RawForm, type Schema } from '@sjsf/form';
21+
import { createForm, BasicForm, type Schema } from '@sjsf/form';
22+
import { resolver } from '@sjsf/form/resolvers/basic';
2223
import { translation } from '@sjsf/form/translations/en';
23-
import { theme } from '@sjsf/form/basic-theme';
24-
import { createValidator2 } from "@sjsf/ajv8-validator";
24+
import { theme } from '@sjsf/basic-theme';
25+
import { createFormValidator } from "@sjsf/ajv8-validator";
2526
26-
const validator = createValidator2();
27+
const validator = createFormValidator();
2728
2829
const schema: Schema = {
29-
type: 'object',
30-
properties: {
31-
name: {
32-
type: 'string',
33-
title: 'Name',
34-
},
35-
description: {
36-
type: 'string',
37-
title: 'Description',
30+
title: 'Tasks',
31+
type: 'array',
32+
items: {
33+
type: 'object',
34+
properties: {
35+
name: {
36+
type: 'string',
37+
title: 'Name',
38+
},
39+
description: {
40+
type: 'string',
41+
title: 'Description',
42+
},
3843
},
44+
required: ["name"]
3945
},
40-
required: ["name"]
4146
}
4247
43-
const form = createForm3({
44-
...theme,
48+
const form = createForm({
49+
theme,
4550
schema,
51+
resolver
4652
validator,
4753
translation,
48-
onSubmit: console.log,
54+
onSubmit: console.log
4955
})
5056
</script>
5157
52-
<RawForm {form} />
58+
<BasicForm {form} />
5359
```
5460

5561
## License
5662

5763
This project includes modifications of code from [react-jsonschema-form](https://github.com/rjsf-team/react-jsonschema-form), which is licensed under the Apache License, Version 2.0.
5864
The rest of the project is under the MIT license.
5965

60-
See [LICENSE-MIT](packages/form/LICENSE-MIT) and [LICENSE-APACHE](packages/form/LICENSE-APACHE) for details.
66+
See [LICENSE-MIT](LICENSE) and [LICENSE-APACHE](LICENSE-APACHE) for details.
6167

6268
## See also
6369

6470
- [Other JSON Schema to Web UI tools](https://json-schema.org/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=schema-to-web-UI)
6571
- [Converting JSON to table](https://github.com/x0k/json-to-table)
66-
- Simple build automation tool [mk](https://github.com/x0k/mk)
72+
- [Simple build automation tool - mk](https://github.com/x0k/mk)

packages/ajv8-validator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ npm install @sjsf/ajv8-validator ajv@8
1414
## Usage
1515

1616
```typescript
17-
import { createValidator2 } from "@sjsf/ajv8-validator";
17+
import { createFormValidator } from "@sjsf/ajv8-validator";
1818

19-
const validator = createValidator2()
19+
const validator = createFormValidator()
2020
```
2121

2222
## License

packages/basic-theme/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ npm install @sjsf/form @sjsf/basic-theme
1010

1111
## Usage
1212

13-
```ts
14-
import { createForm } from '@sjsf/form';
15-
import { themeResolver } from '@sjsf/basic-theme';
16-
17-
const theme = createTheme(themeResolver);
13+
```svelte
14+
<script lang="ts">
15+
import { createForm } from '@sjsf/form';
16+
import { theme } from '@sjsf/basic-theme';
17+
18+
const form = createForm({
19+
theme,
20+
...
21+
})
22+
</script>
1823
```
1924

2025
## License

packages/cfworker-validator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ npm install @sjsf/cfworker-validator @cfworker/json-schema
1414
## Usage
1515

1616
```typescript
17-
import { createValidator } from "@sjsf/cfworker-validator";
17+
import { createFormValidator } from "@sjsf/cfworker-validator";
1818

19-
const validator = createValidator()
19+
const validator = createFormValidator()
2020
```
2121

2222
## License

packages/daisyui-theme/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @sjsf/daisyui-theme
22

3-
The [daisyui](https://github.com/saadeghi/daisyui) based theme for [svelte-jsonschema-form](https://github.com/x0k/svelte-jsonschema-form).
3+
The [daisyui](https://github.com/saadeghi/daisyui) v4 based theme for [svelte-jsonschema-form](https://github.com/x0k/svelte-jsonschema-form).
44

55
- [Documentation](https://x0k.github.io/svelte-jsonschema-form/themes/daisyui/)
66
- [Playground](https://x0k.github.io/svelte-jsonschema-form/playground/)
@@ -52,11 +52,12 @@ import themeStyles from "@sjsf/daisyui-theme/styles.css?inline";
5252

5353
```svelte
5454
<script lang="ts">
55-
import { createForm3 } from '@sjsf/form';
55+
import { createForm } from '@sjsf/form';
5656
import { theme } from '@sjsf/daisyui-theme';
5757
58-
const form = createForm3({
59-
...theme
58+
const form = createForm({
59+
theme,
60+
...
6061
})
6162
</script>
6263
```

packages/daisyui5-theme/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ npm install @sjsf/form @sjsf/daisyui5-theme
1515

1616
```svelte
1717
<script lang="ts">
18-
import { createForm3 } from '@sjsf/form';
18+
import { createForm } from '@sjsf/form';
1919
import { theme } from '@sjsf/daisyui5-theme';
2020
21-
const form = createForm3({
22-
...theme
21+
const form = createForm({
22+
theme,
23+
...
2324
})
2425
</script>
2526
```

packages/flowbite-icons/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ import flowbiteIconsStyles from "@sjsf/flowbite-icons/styles.css?inline";
5050

5151
```svelte
5252
<script lang="ts">
53-
import { createForm3 } from '@sjsf/form';
53+
import { createForm } from '@sjsf/form';
5454
import { icons } from '@sjsf/flowbite-icons';
5555
5656
const form = createForm3({
57-
icons
57+
icons,
58+
...
5859
})
5960
</script>
6061
```

packages/flowbite-theme/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# @sjsf/flowbite-theme
22

3-
The [flowbite-svelte](https://github.com/themesberg/flowbite-svelte) based theme for [svelte-jsonschema-form](https://github.com/x0k/svelte-jsonschema-form).
3+
The [flowbite-svelte](https://github.com/themesberg/flowbite-svelte) (tailwind v3) based theme for [svelte-jsonschema-form](https://github.com/x0k/svelte-jsonschema-form).
44

55
- [Documentation](https://x0k.github.io/svelte-jsonschema-form/themes/flowbite/)
66
- [Playground](https://x0k.github.io/svelte-jsonschema-form/playground/)
@@ -52,11 +52,12 @@ import themeStyles from "@sjsf/flowbite-theme/styles.css?inline";
5252

5353
```svelte
5454
<script lang="ts">
55-
import { createForm3 } from '@sjsf/form';
55+
import { createForm } from '@sjsf/form';
5656
import { theme } from '@sjsf/flowbite-theme';
5757
58-
const form = createForm3({
59-
...theme,
58+
const form = createForm({
59+
theme,
60+
...
6061
})
6162
</script>
6263
```

packages/form/README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,23 @@ Unofficial port of [react-jsonschema-form](https://github.com/rjsf-team/react-js
88

99
## Installation
1010

11-
Install the library and `ajv` for validation.
11+
Install the library, basic theme and `ajv` for validation.
1212

1313
```shell
14-
npm install @sjsf/form @sjsf/ajv8-validator ajv@8
14+
npm install @sjsf/form @sjsf/basic-theme @sjsf/ajv8-validator ajv@8
1515
```
1616

1717
## Usage
1818

1919
```svelte
2020
<script lang="ts">
21-
import { createForm3, RawForm, type Schema } from '@sjsf/form';
21+
import { createForm, BasicForm, type Schema } from '@sjsf/form';
22+
import { resolver } from '@sjsf/form/resolvers/basic';
2223
import { translation } from '@sjsf/form/translations/en';
23-
import { theme } from '@sjsf/form/basic-theme';
24-
import { createValidator2 } from "@sjsf/ajv8-validator";
24+
import { theme } from '@sjsf/basic-theme';
25+
import { createFormValidator } from "@sjsf/ajv8-validator";
2526
26-
const validator = createValidator2();
27+
const validator = createFormValidator();
2728
2829
const schema: Schema = {
2930
title: 'Tasks',
@@ -44,16 +45,17 @@ npm install @sjsf/form @sjsf/ajv8-validator ajv@8
4445
},
4546
}
4647
47-
const form = createForm3({
48-
...theme,
48+
const form = createForm({
49+
theme,
4950
schema,
51+
resolver
5052
validator,
5153
translation,
5254
onSubmit: console.log
5355
})
5456
</script>
5557
56-
<RawForm {form} />
58+
<BasicForm {form} />
5759
```
5860

5961
## License
@@ -67,4 +69,4 @@ See [LICENSE-MIT](LICENSE) and [LICENSE-APACHE](LICENSE-APACHE) for details.
6769

6870
- [Other JSON Schema to Web UI tools](https://json-schema.org/tools?query=&sortBy=name&sortOrder=ascending&groupBy=toolingTypes&licenses=&languages=&drafts=&toolingTypes=schema-to-web-UI)
6971
- [Converting JSON to table](https://github.com/x0k/json-to-table)
70-
- Simple build automation tool [mk](https://github.com/x0k/mk)
72+
- [Simple build automation tool - mk](https://github.com/x0k/mk)

packages/lucide-icons/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ npm install @sjsf/form @sjsf/lucide-icons
1515

1616
```svelte
1717
<script lang="ts">
18-
import { createForm3 } from '@sjsf/form';
18+
import { createForm } from '@sjsf/form';
1919
import { icons } from '@sjsf/lucide-icons';
2020
21-
const form = createForm3({
22-
icons
21+
const form = createForm({
22+
icons,
23+
...
2324
})
2425
</script>
2526
```

0 commit comments

Comments
 (0)