npm @sanity/default-layout 0.136.2
v0.136.2

latest releases: 2.36.6, 2.36.4, 2.36.2...
5 years ago

Upgrade the Command Line Interface (CLI) with

npm install --global @sanity/cli

Upgrade the Content Studio with:

sanity upgrade

✨ Highlights

Hide original filenames

When uploading files and images, the original filenames are persisted by default. If the filenames can contain sensitive information, you can now opt out of this behavior by setting the storeOriginalFilename option to false. See the file or image documentation for more info.

Specify field validation overrides

In certain cases, you may have defined a top-level object type that you are reusing for multiple fields. Previously there was no way to set validation rules on fields within the object based on the parent field it was being used in.

In this release, we've added a feature that allows you to call Rule.fields() with an object, where the keys represent the field name and the values being the field-level validation to apply.

For instance:

{
  name: 'title',
  title: 'Title',
  type: 'localizedString',
  validation => Rule.fields({
    en: fieldRule => fieldRule.required(),
    nb: fieldRule => fieldRule.min(5).max(200)
  })
}

Note that this will override the validation rules set on the parent types fields (localizedString in the above example).

🐛 Notable bugfixes

  • Fixed bug where @sanity/client could not be used in React Native environments
  • Removed root-prefix for results in Vision tool

📓 Full changelog

Author Message Commit
Espen Hovlandsdal [validation] Allow specifying field validation overrides for top-level objects (#1030) ed68970
Espen Hovlandsdal [validation] Fix incorrect call signature of inferFromSchemaType 7640710
Espen Hovlandsdal [base] Hoist unnamed object types (#1033) ef37acf
Espen Hovlandsdal [color-input] Hoist color types, add _type to objects (#1036) 748b6f8
Espen Hovlandsdal [color-input] Update readme to reflect latest changes 3071dbf
Espen Hovlandsdal [schema] Fix media field inference crash for certain types (#1037) 1f29d69
Dan Rosenshain [vision] Fix bug in vision plugin not remembering last used dataset (#1050) d44c699
Espen Hovlandsdal [client] Check for presence of window.location to determine if browser env (#1054) 87a2121
Espen Hovlandsdal [vision] Remove "root"-prefix in results (#1055) cef26b2
Espen Hovlandsdal [form-builder] Add ability to disable original filename for assets (#1056) 1d02c2c
Bjørge Næss [default-layout] Only select _id and _type when searching (#1057) c7271c6
Espen Hovlandsdal [structure] Add @types/node for proper node.js typings (#1058) 2a74e9e

Don't miss a new default-layout release

NewReleases is sending notifications on new releases.