Upgrade the Command Line Interface (CLI) with
npm install --global @sanity/cli
Upgrade the Content Studio with:
sanity upgrade
✨ Highlights
Introducing: Initial Value Templates
export default {
name: 'post',
type: 'document',
title: 'Blog post',
initialValue: () => ({
publishedAt: new Date().toISOString()
}),
fields: [
// ... all the fields
]
}
With the newest version of Sanity Studio, you can now set initial values for all your document types. It’s a great way to save your editors time and effort spent on repetitive tasks.
- Prefill fields with minimal configuration.
- Fetch content from APIs for new documents.
- Add multiple templates for quick document creation.
📓 Full changelog
Author | Message | Commit |
---|---|---|
Espen Hovlandsdal | [structure] Expose initial template building functions | 16abeef |
Espen Hovlandsdal | [desk-tool] Pass loading message as props, making pane more reusable | 5eec395 |
Espen Hovlandsdal | [desk-tool] Remove unused props from withDocumentType HOC | 7485d40 |
Espen Hovlandsdal | [base] Expose initial values utilities | 51ef96c |
Kristoffer Sivertsen | [components, desk-tool] CreateDocumentPreview and list | 8ece00e |
Kristoffer Sivertsen | [default-layout] Use createDocument list on actionModal | c168958 |
Kristoffer Sivertsen | [desk-tool] LoadingPane to take title as prop | f806ca7 |
Kristoffer Sivertsen | [all] Initial values view cleanup | 724a1fc |
Espen Hovlandsdal | [initial-value-templates] Move initial value logic to separate module | d63181f |
Espen Hovlandsdal | [default-layout] Use templates for global action modal | ece7f38 |
Kristoffer Sivertsen | [initial-value] Minor visual tweaks | 61ff6a0 |
Kristoffer Sivertsen | [desk-tool] Mobile pane working on initial value | cbdf23a |
Kristoffer Sivertsen | [initial-value-templates] Display correct names & visual fix | e465f27 |
Kristoffer Sivertsen | [initial-value-templates] Add support for description | d29fc3c |
Kristoffer Sivertsen | [components] Fullscreen dialog tweaks | a28e7a7 |
Espen Hovlandsdal | [desk-tool] Fix itemIsSelection check not checking ID of selected item | 7e59f49 |
Espen Hovlandsdal | [desk-tool] Center content of error pane | c37b3ac |
Espen Hovlandsdal | [initial-value-templates] Allow templates to specify parameters schema | 6d5d4af |
Espen Hovlandsdal | [structure] Make document list editor slightly more readable | 0bf527b |
Espen Hovlandsdal | [structure] Add initial value templates to editor spec | c1c0c61 |
Espen Hovlandsdal | [structure] Simplify default editor for document type lists | b9501cf |
Espen Hovlandsdal | [structure] Remove template() in favor of initialValueTemplates() | a136f41 |
Espen Hovlandsdal | [desk-tool] Always pass urlParameters to pane | 74c3ce9 |
Espen Hovlandsdal | [structure] Introduce editorWithInitialValueTemplate(), initialValueTemplateById() | a10c2d7 |
Espen Hovlandsdal | [desk-tool] Only show initial value templates without parameters | 078869b |
Espen Hovlandsdal | [test-studio] Add example of deep pane using initial value template | 51c7e76 |
Espen Hovlandsdal | [structure] Update tests to reflect new editor behavior | fdb8b9d |
Espen Hovlandsdal | [initial-value-templates] Use new JSON parameters for intents | cb53716 |
Espen Hovlandsdal | [initial-value-templates] Refactor to define templates on lists | 78c10c4 |
Espen Hovlandsdal | [storybook] Hack around build issues | df44f63 |
Espen Hovlandsdal | [desk-tool] Make "new document" button use initial value templates | 4e99a5d |
Victoria Bergquist | [desk-tool] Style broken references errors and warnings (#1525) | a0599fa |
Victoria Bergquist | [components] style dropdown menu for templates | 47d79fb |
Victoria Bergquist | [initial-value-templates] fix template icons and refactor | 0844611 |
Espen Hovlandsdal | [chore] Bring version numbers in line with next | b9c5c12 |
Victoria Bergquist | [initial-values] add schema type icon fallback | efa783e |
Bjørge Næss | [structure] Guard against possible undefined value | 4665033 |
Espen Hovlandsdal | [desk-tool] Prevent initial value re-render transition | ce24303 |
Espen Hovlandsdal | [desk-tool] Use observable pattern for withInitialValue | 456b4c8 |
Espen Hovlandsdal | [base] Fix incorrect filename for initial value template builder | 09c2f0f |
Espen Hovlandsdal | [initial-value-templates] Remove templates for asset types | f6853c9 |
Espen Hovlandsdal | [default-layout] Add validation of new document structure items | 7de1663 |
Espen Hovlandsdal | [default-layout] Prefer template item title over template title | 7f5c2d3 |
Espen Hovlandsdal | [desk-tool] Provide fallback for missing urlParameters | 835f1a8 |
Espen Hovlandsdal | [structure] Add setter/getters for template item descriptions | 46e13ba |
Espen Hovlandsdal | [default-layout] Fix parameterized items not appearing in "new document" menu | 85795f6 |
Espen Hovlandsdal | [test-studio] Add new document structure fixture | 5ca7191 |
Espen Hovlandsdal | [initial-value-templates] Add validation for references, multidimensional arrays | edd6f63 |
Espen Hovlandsdal | [chore] Rename initialValue property to initialValues | 10c35c1 |
Espen Hovlandsdal | [form-builder] Fix tsconfig causing output to root directory | baf5990 |
Espen Hovlandsdal | [desk-tool] Fix "published"-snackbar disappearing immediately | 1799c28 |
Espen Hovlandsdal | [base] Add missing dependency | d7c5ebb |
Espen Hovlandsdal | [initial-value-templates] Fix type declaration for value property | af3dbd2 |
Espen Hovlandsdal | [initial-value-templates] Add validation for plural values mismatch | b9398ff |
Espen Hovlandsdal | [all] Revert to singular initialValue | 600d524 |
Espen Hovlandsdal | [schema] Fix wording for initial value validation | 9fad225 |
Espen Hovlandsdal | [mutator] Add type definitions for diff-match-patch (#1561) | aa8f70e |