Skip to content

Commit

Permalink
Add new Structure field type (#7936)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 23, 2022
1 parent f22bbc7 commit 57e9527
Show file tree
Hide file tree
Showing 20 changed files with 1,596 additions and 95 deletions.
5 changes: 5 additions & 0 deletions .changeset/late-ties-multiply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-6/fields-document": minor
---

Adds a new `integer` component field type
5 changes: 5 additions & 0 deletions .changeset/late-ties-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@keystone-6/fields-document": minor
---

Adds a new `structure` field type, a composable JSON data structure with a powerful GraphQL API
5 changes: 4 additions & 1 deletion docs/pages/docs/guides/document-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,9 @@ component({
`@keystone-6/core/component-blocks` ships with a set of form fields for common purposes:

- `fields.text({ label: '...', defaultValue: '...' })`
{% if $nextRelease %}
- `fields.integer({ label: '...', defaultValue: '...' })`
{% /if %}
- `fields.url({ label: '...', defaultValue: '...' })`
- `fields.select({ label: '...', options: [{ label:'A', value:'a' }, { label:'B', value:'b' }] defaultValue: 'a' })`
- `fields.checkbox({ label: '...', defaultValue: false })`
Expand Down Expand Up @@ -869,4 +872,4 @@ heading="Document Field Demo"
href="/docs/guides/document-field-demo" %}
Test drive the many features of Keystone’s Document field on this website.
{% /well %}
{% /related-content %}
{% /related-content %}
11 changes: 9 additions & 2 deletions packages/fields-document/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"module": "./primitives/dist/keystone-6-fields-document-primitives.esm.js",
"default": "./primitives/dist/keystone-6-fields-document-primitives.cjs.js"
},
"./structure-views": {
"module": "./structure-views/dist/keystone-6-fields-document-structure-views.esm.js",
"default": "./structure-views/dist/keystone-6-fields-document-structure-views.cjs.js"
},
"./component-blocks": {
"module": "./component-blocks/dist/keystone-6-fields-document-component-blocks.esm.js",
"default": "./component-blocks/dist/keystone-6-fields-document-component-blocks.cjs.js"
Expand All @@ -28,14 +32,16 @@
"dist",
"component-blocks",
"primitives",
"views"
"views",
"structure-views"
],
"preconstruct": {
"entrypoints": [
"component-blocks.tsx",
"index.ts",
"primitives.ts",
"views.tsx"
"views.tsx",
"structure-views.tsx"
]
},
"peerDependencies": {
Expand All @@ -53,6 +59,7 @@
"@keystone-ui/core": "^5.0.2",
"@keystone-ui/fields": "^7.1.2",
"@keystone-ui/icons": "^6.0.2",
"@keystone-ui/modals": "^6.0.2",
"@keystone-ui/popover": "^6.0.2",
"@keystone-ui/tooltip": "^6.0.2",
"@types/react": "^18.0.9",
Expand Down
Loading

1 comment on commit 57e9527

@vercel
Copy link

@vercel vercel bot commented on 57e9527 Nov 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.