-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pte): add
hideToolbar
and fullscreen
props to `PortableTextI…
…nput` (#6621) * feat(form/inputs): add prop to hide the toolbar in PT-input * feat(form/inputs): control PT-input fullscreen from props * chore(test-studio): add example document type with custom block editor variants * refactor: rename `fullscreen` to `initialFullscreen` * refactor: don't unnecessarily alias `initialFullscreen` prop --------- Co-authored-by: Per-Kristian Nordnes <[email protected]>
- Loading branch information
1 parent
04aa760
commit d4ad9b0
Showing
7 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
dev/test-studio/schema/standard/portableText/customBlockEditors.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import {BlockEditor, defineType, type PortableTextInputProps} from 'sanity' | ||
|
||
export const ptCustomBlockEditors = defineType({ | ||
name: 'pt_customBlockEditors', | ||
title: 'BlockEditor examples', | ||
type: 'document', | ||
fields: [ | ||
{ | ||
name: 'title', | ||
title: 'Title', | ||
type: 'string', | ||
}, | ||
{ | ||
name: 'default', | ||
title: 'Default', | ||
type: 'array', | ||
of: [{type: 'block'}], | ||
}, | ||
{ | ||
name: 'hiddenToolbar', | ||
title: 'Hidden toolbar', | ||
description: 'hideToolbar=true', | ||
type: 'array', | ||
components: { | ||
input: (props: PortableTextInputProps) => <BlockEditor {...props} hideToolbar />, | ||
}, | ||
of: [{type: 'block'}], | ||
}, | ||
{ | ||
name: 'readOnly', | ||
title: 'Read only', | ||
description: 'readOnly=true', | ||
type: 'array', | ||
components: { | ||
input: (props: PortableTextInputProps) => <BlockEditor {...props} readOnly />, | ||
}, | ||
of: [{type: 'block'}], | ||
}, | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters