Skip to content

Releases: sanity-io/sanity

v0.132.6

14 Aug 19:04
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

Get a list of Sanity projects in the command line

Some of us have acquired quite a few Sanity projects and for sure manage.sanity.io has the list, but who has time to open a browser? So now you can $ sanity projects list in your command line of choice, and get a fine responsive table of all your projects with their IDs and studio URLs for your logged in user.

🐛 Notable bugfixes

Order list of documents by fields on referenced documents (#908)

The sort orders now support ordering by a field on a referenced document, e.g.

// on book schema where author is a reference to an author doc
orderings: [
  {
    title: 'Author name',
    name: 'authorName',
    by: [{field: 'author.name', direction: 'asc'}]
  }
]

Arrays now tolerate items with missing keys (#919)

Quashed a bug that made the Content Studio crash when opening a document that had an array field where one or more items were missing a _key. This is now handled, and the user is presented with a way to quickly set keys on items that lack it.

Fix missing _keys in the Studio interface

📓 Full changelog

Author Message Commit
Espen Hovlandsdal [chore] Appveyor tests (#899) 8cc4986
Espen Hovlandsdal [cli] Use ESM for clean template schema (#904) fdffb1a
Espen Hovlandsdal [image-url] Allow using materialized assets (#903) 097d6ac
Espen Hovlandsdal [chore] Upgrade dependencies (#901) dd27787
Knut Melvær [import] Add check for valid prefixes in asset import strings (#866) 9a6368a
Bjørge Næss [import] Clarify the types of arguments that can be passed to sanityImport(…) (#898) f210598
Kristoffer J. Sivertsen [all] Using native scrollbars (#905) 3f4fc7f
Knut Melvær [core] More helpful CLI messages (#875) f56694d
Bjørge Næss [desk-tool] Support ordering by fields on referenced documents. Fixes #908 (#909) 39ec7b7
Espen Hovlandsdal [base] Add browser support + javascript check (#902) 17ef5f7
Knut Melvær [cli] Add project list command (#918) 14d0e67
Bjørge Næss [form-builder] Tolerate array items with missing keys and provide a way of fixing (#919) 532578b

v0.132.5

28 Jun 13:10
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

"Clean" project template

If you've tried out Sanity before and know how the schemas fit together, it can be nice to bootstrap a new project without any existing schemas. We've (re)introduced this feature to the CLI!

Asset metadata extraction on per-field basis

The Sanity asset backend can extract and generate metadata from images - things like GPS location, exif data, low-quality image placeholders, palette information and similar. You may now specify which data you want to extract on a per-field basis in your schemas. For more information on this feature, see the documentation.

Create and delete documents from the command line

You can now create and delete documents from the command line with sanity documents create myDocument.json and sanity documents delete <document ID>. You can also create a new document from your favorite text editor by running sanity create document and have Sanity watch for changes with sanity document create --watch. Check the documentation for more infomation about these features.

🐛 Notable bugfixes

  • Datepicker does not close when choosing a date 🐞
  • Datepicker allows edit the date inline 🐛
  • The CLI tool would sometimes take very long to respond because of an update check that was blocking execution. This update check now has a timeout before proceeding.
  • Reference fields now correctly displays any validation errors.
  • Passing a transaction instance created outside the scope of a Sanity client to the mutate() method now serializes the transaction correctly.

📓 Full changelog

Author Message Commit
Knut Melvær [cli] Add option for initiating sanity with a clean template (#874) f2ac755
Espen Hovlandsdal [core] Fix missing 'dataset' prefix in import/export help (#873) c6b4fc5
Espen Hovlandsdal [form-builder] Allow specifying metadata to extract for images/files (#871) 5f45f24
Espen Hovlandsdal [core] Add sanity documents create, sanity documents delete commands (#872) e485934
Kristoffer J. Sivertsen [components] Dialog with functions height fix (#870) d2609d4
Espen Hovlandsdal [cli] Make update check actually respect timeout (#881) fbe2b41
Bjørge Næss [form-builder] Let InvalidValueInput be focusable like any other input (#883) 0def148
Espen Hovlandsdal [validation] Remove promise concurrency limitation for now (#884) d5302ab
Espen Hovlandsdal [form-builder] Show validation status in reference inputs (#885) 6932379
Espen Hovlandsdal [client] Fix passing clientless transaction to mutate() (#890) be45196
Espen Hovlandsdal [color-input] Add documentation for color input (#888) af44aec
Bjørge Næss [form-builder] Optimize reference search query (#892) c74b90e
Espen Hovlandsdal [chore] Only build on next, drone-ci branches 0fa8cb9
Espen Hovlandsdal [chore] Add UMD build targets and unpkg fields for client + image-url modules (#895) beb024b
Kristoffer J. Sivertsen [form-builder] Make datepicker stay open on change, reset inputValue when edit raw is valid (#896) 8f844dd
Kristoffer J. Sivertsen [form-builder] Not send inn the defaultList class in arrayInput (#878) 9af40e3

v0.132.4

13 Jun 13:50
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

Various visual fixes and a few bugfixes

🐛 Notable bugfixes

Fixed a bug with sanity export causing custom image/file fields (e.g. caption) to be lost in exported files

📓 Full changelog

Author Message Commit
Thomas Drevon [default-login] Use dedicated styles for CookieTest component (#837) 851a2d2
Knut Melvær [readme] Add link for Block Content to Markdown (#853) 4475c06
Espen Hovlandsdal [chore] Add Drone CI (#854) 079cc20
Kristoffer J. Sivertsen [form-builder] Functions padding on array of primitives 9920d5b
Kristoffer J. Sivertsen [components] Larger max-height on dialog (#864) f72978a
Kristoffer J. Sivertsen Design fixes (#858) ce114c1
Kristoffer J. Sivertsen Fix confirm button (#863) ff7f57d
Bjørge Næss [export] Make sure we export other attributes on fields containing asset references (#867) 6492e96

v0.132.2

01 Jun 10:52
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

🚜More reliable import

The sanity dataset import CLI command is now more fault tolerant, retrying in the case of network failures and similar (up to a maximum number of retries, obviously).

➡️Pass arguments to sanity exec scripts

You can now pass arguments to scripts executed through sanity exec by using subargs:

sanity exec --with-user-token -- --your-script --flags=here

👻 External CSS without CSS modules

When using third-party React components and want to import related CSS files, Sanity will by default convert the CSS to CSS modules. This won't usually work as expected, since the class names change. To force Sanity to use unprefixed CSS classes, you can import using the raw query parameter. For instance:

import 'some-react-component/styles.css?raw'

See PR #849 for more background information.

🐛 Notable bugfixes

  • Fix a bug where selecting a paragraph style from within a dialog would close the dialog
  • The block editor will no longer crash when selecting a block from an array without any text blocks
  • The --visibility flag on sanity dataset create now actually works 😳
  • @sanity/image-url can now parse full asset URLs, enabling you to add image transformation parameters to the URL programatically.

📓 Full changelog

Author Message Commit
Espen Hovlandsdal [import] Add retry handling on write operations (#832) d8e9f17
Espen Hovlandsdal [plugin-loader] Fix loading of namespaced configs (#836) 6f7e340
Espen Hovlandsdal [core] Fix visibility mode flag on dataset creation (#833) 77c7f3b
Espen Hovlandsdal [preview] Log EventListenerOptions warning only in development mode (#838) 752e80e
Bjørge Næss [preview] Refactor and expose WithVisibility helper component (#840) 10f78f0
Bjørge Næss [chore] Upgrade prettier and add prettify script (#841) f9de6fb
Bjørge Næss [chore] Run prettier on all js files e0edb42
Espen Hovlandsdal [import] Fix serialization of numeric object keys (#842) 86fda82
Espen Hovlandsdal [chore] Add --all flag to symlink script to blindly symlink all Sanity-modules (#844) b726667
Espen Hovlandsdal [form-builder] Pass parent path of slug field to source function (#845) 6c17675
Espen Hovlandsdal [image-url] Support parsing asset objects with only URL (#846) da74950
Espen Hovlandsdal [test-studio] Add array of objects containing blocks to blocks schema fb1a0ef
Knut Melvær [readme] Add slack badge (#850) bf9b4d7
Espen Hovlandsdal [core] Pass subargs onto exec target (#848) b72c68b
Thomas Drevon [form-builder] Remove patchChannel prop requirement (#851) b298cab
Kristoffer J. Sivertsen [components] Fix bug where nested block input dialogs would close when selecting style (#847) 2f8defb
Kristoffer J. Sivertsen [desk-tool] Less text on publish button. Explanation in tooltip (#839) 5e3bb02
Espen Hovlandsdal [server] Allow importing CSS with ?raw to bypass CSS modules (#849) 3a5cfca

v0.132.1

24 May 15:25
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

🐛 Notable bugfixes

Fixed a bug causing the delete button on array items to not respond to mouse clicks

📓 Full changelog

Author Message Commit
Bjørge Næss [components] Prevent inner element in button from stealing focus (#834) 892e0ce

v0.132.0

24 May 13:25
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

This is a bugfix and maintenance release and includes several improvements and stability fixes

✨🐞 Notable improvements and bugfixes

  • Not displaying delete button when editing "empty" array items, instead showing "cancel" (#810)
  • Fixed a bug when drag-drop batch uploading images that caused an edit dialog to pop open for the last array item (#811)
  • When deleting array items, the confirm delete button is now focused by default, and focus is properly restored to the item when closing it (#783)
  • Fixed a bug causing text selection on Safari when dragging to reorder array items (#814)
  • Fixed various dialog sizing issues (#809, #815)
  • Upgraded RxJS to 6.1 and deprecated the @sanity/observable package (#768)
  • Upgraded react-json-inspector (#821)
  • Fixed a race condition that would sometimes display a document as deleted (for a brief period) when publishing it (#822)
  • Fixed a bug causing the style select to not pop up when editing block text in fullscreen mode (#823)
  • The studio base path can now be overridden using an environment variable. Thanks @dan-dr for putting this together! (#819)
  • The studio will now switch to responsive mode when resizing (#807)
  • Fixed a bug causing editing of inline objects to fail (#826)
  • Fixed an issue where buttons got wrong spacing in some cases (#824, #825)
  • Improved detail level of error messages on import failures (#831)

📓 Full changelog

Author Message Commit
Bjørge Næss [form-builder] Show cancel and hide delete buttons if edited item is empty (#810) 972c697
Bjørge Næss [form-builder] Don't open edit dialog for uploaded items (#811) 667659f
Bjørge Næss [form-builder] Fix tab/focus on confirm delete button (#783) 128d801
Bjørge Næss [components] Remove hard coded distance prop on Sortable components and prevent default on sort start (#814) 67fb139
Kristoffer J. Sivertsen Force poppersize when containing blockeditor (#809) c1e21ea
Bjørge Næss [chore] Replace @sanity/observable with RxJS (#768) 13565e3
Kristoffer J. Sivertsen DialogContent component for sizing dialogs (#815) a51044f
Espen Hovlandsdal [chore] Upgrade react-json-inspector (#821) 6358be0
Bjørge Næss [misc] Checkout draft/published as a pair instead of separately (#822) 2080144
Kristoffer J. Sivertsen [components] Fixing styleselect portal (#823) e5e1684
dan-dr [core] Add ability to override project basePath with environment variable (#819) 765fe2c
Kristoffer J. Sivertsen [components] Switch to mobile on resize. No need to refresh browser (#807) bdc174e
Bjørge Næss [form-builder] Use FocusManager with inline items (#826) 69e3bbd
Kristoffer J. Sivertsen Buttons collection and forms spacing (#824) b784101
Kristoffer J. Sivertsen [components] Spacing when using forms outside form-builder (#825) d3b8c54
Bjørge Næss [preview] Fix intersection observable fallback d060f6d
Bjørge Næss [client] Fix wrong import 7fcf9a3
Thomas Drevon [form-builder] Export withValuePath (#829) 29a8802
Espen Hovlandsdal [core] Throw on dataset import failure instead of only printing error (#831) 460a81f

v0.131.2

18 May 20:23
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

🐛 Notable bugfixes

  • Fixed a bug causing ecommerce studios to fail on first deploy

📓 Full changelog

Author Message Commit
Thomas Drevon [cli] Add missing folder to ecommerce template (#820) 9cb6161

v0.131.1

15 May 12:49
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

🐛 Notable bugfixes

  • Fixes a bug causing the add-button on array of primitives to not work

📓 Full changelog

Author Message Commit
Bjørge Næss [form-builder] Fix invalid prop (#812) 5156a96

v0.131.0

14 May 12:56
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

✨ Highlights

⌨️ CORS management through CLI

The command line tool now allows you to manage CORS origins without going through the management interface: sanity cors add, sanity cors list and sanity cors delete are your new friends!

📭 Removing empty values

A common complaint has been that "empty" array items sometimes keep hanging around. For example, if you add an item to an array, then closes the add dialog immediately, then the added item was not removed again. This has now been fixed, and if array items are empty when the edit dialog is closed, the item will be removed from the array (see #780 for more details).

🗑 Dropping React 15 support

We launced with React 16 support as of v0.127.0, which was released two months ago. Since then, we have been developing against React 16.2, and since tracking usage of React 16 specific features is hard, we have decided to make it explicit that the studio needs React 16.2 or newer to run. In case you missed it, here's how to upgrade React in your Sanity studio.

🍱 Use layout: 'grid' on your array of images

Make an array look more like an image gallery. Just add options: {layout: 'grid'} to your array. Uses CSS Grid layout to autosize the columns.

ProTip: You can use the layout: 'grid'-option on arrays of any type, not only images.

layout: grid

🗝 Part-ify rendering of login providers

You can now take complete control of how your Studio renders your login providers. Create your own implementation of the LoginDialogContent.js component. Then wire it up in sanity.json:

{
  "implements": "part:@sanity/base/login-dialog-content",
  "path": "MyLoginDialogContent.js"
}

🐛 Notable bugfixes

  • Improved display of the tokenized tags input in readOnly mode
  • Fixed a bug causing errors when geopoint types were used in an array
  • Fixed a bug causing the sanity command to complain about incompatible version for prereleases
  • Fixed a bug causing preview components to erroneously identify numbers and empty values as invalid preview values

📓 Full changelog

Author Message Commit
Espen Hovlandsdal [plugin-loader] Add option to stub CSS loading (#771) 49e6f09
Kristoffer J. Sivertsen [components] Make tags textfield display readOnly correct (#776) 86f73dd
Kristoffer J. Sivertsen Styleselect and official react popper (#777) ba8aadf
Kristoffer J. Sivertsen Responsive dialogs width (#775) 468769f
Bjørge Næss [form-builder] Remove empty values when array dialog closes and pass down undefined as item values if empty (#780) acf0a3b
Bjørge Næss [google-maps-input] Don't overwrite value, just set lat/lng (#781) 0dbbf5c
Bjørge Næss [schema] Remove geopoint as core type (#782) c0495a4
Espen Hovlandsdal [test-studio] Add custom reference input example (#778) 4847a79
Espen Hovlandsdal [chore] Normalize package fields a339d6d
Espen Hovlandsdal [default-layout] Ensure error message inclusion in error boundary (#789) 3fcdd21
Espen Hovlandsdal [test-studio] Add inline object without preview select to objects schema a79db5b
Kristoffer J. Sivertsen Overflowing switch description (#788) 4df78c8
Kristoffer J. Sivertsen [desk-tool] Fix syncing icon and publish button spacing (#787) 39bd39f
Espen Hovlandsdal [core] Add CLI-commands for managing CORS-origins (#790) 7bb4700
even westvang [ecommerce-studio] Change blurb to from localText to localeString (#779) c025d46
Thomas Drevon [default-login] Part-ify rendering of login providers (#793) c6658b2
Espen Hovlandsdal [image-url] Allow using actual query parameters instead of aliases (#792) d36b714
Espen Hovlandsdal [schema] Add missing fields for reference and slug types (#784) 9a79e5b
Espen Hovlandsdal [form-builder] Add overridable part for array input functionality (#795) 7b4bcb1
Knut Melvær [cli] Make upgrade message less confusing (#773) fd93e7d
Kristoffer J. Sivertsen Fix array grid view (#786) 6da04a0
Thomas Drevon [movies-studio] Update google maps api key 0849c5b
Thomas Drevon Fix typo in readme c57680f
Bjørge Næss [chore] Drop support for React 15 (#802) ec41631
Espen Hovlandsdal [image-url] Allow passing asset documents as source (#803) 2f6a7af
Kristoffer J. Sivertsen Button spacing & click to close on dropdown (#794) d98b3bf
Thomas Drevon [cli] Coerce @sanity/core version string before performing satisfaction check (#804) aa5eef2
Bjørge Næss [preview] Don't fail on numbers, booleans and empty values (#805) 869c8c9

v0.130.1

03 May 11:56
Compare
Choose a tag to compare

Upgrade with:

sanity upgrade

And install the latest Command Line Interface (CLI) with:

npm install --global @sanity/cli

🐛 Notable bugfixes

  • Fixed bug where sanity upgrade would fail to upgrade modules because of inexplicable yarn bug

📓 Full changelog

Author Message Commit
Espen Hovlandsdal Delete Sanity-modules that needs upgrading to work around yarn bug (#774) ceb237c