github sanity-io/sanity v3.0.0-dev-preview.22

latest releases: v3.64.0, v2.36.6, v2.36.5...
pre-release2 years ago

NOTE: with this release we highly recommend to upgrade @sanity/ui in package.json to:

"@sanity/ui": "1.0.0-beta.30"

✨ Highlights

At-a-glance

This version introduces several breaking changes that we are really excited to share with everyone:

  • Improved Components API
  • Consolidated sanity package and exports
  • React 18 as new baseline version
  • Removing the Schema namespace

These changes will make the Studio's customization API easier to discover and will vastly improve DX when implementing plugins and customizations moving forward.

NOTE: This release vastly reduces the number of breaking changes that will be introduced as we are getting closer to the first official stable v3 release.

Components API

We have made changes to the new Components API that allows a lot more flexibility in terms of wrapping, replacing, and modifying components in the Studio.

These components are now available for customization:

  • Studio components: the general components of the studio. In this iteration, the components that can be customized are navbar, tool menu, layout and logo.
  • Form components: field, input, item and preview.

Example:

import {createConfig} from 'sanity'

export default createConfig({
  // ...,

  form: {
    components: {
      field: MyField,
      input: MyInput,
      item: MyItem,
      preview: MyPreview,
    },
  },

  studio: {
    components: {
      layout: MyLayout,
      logo: MyLogo,
      navbar: MyNavbar,
      toolMenu: MyToolMenu,
    },
  },
})

The components available in this API are rendered using a middleware pattern. This means that plugin customizations are applied in a chain. Each plugin may call props.renderDefault(props) to defer to default rendering (this API was next(props) in 3.0.0-dev-preview.20).

What is renderDefault?

The props for each component available in the API includes a callback function called renderDefault. As the name implies, renderDefault renders the default component. When you call renderDefault, you also pass the props needed to render the default component, and these props can be modified. In the example below, we create a custom tool menu plugin that filters out the vision tool when the studio is running in non-development mode:

import {useMemo} from 'react'
import {
  ToolMenuProps,
  createConfig,
  createPlugin,
  isDev,
} from 'sanity'

// Plugin's `ToolMenu` component
function MyToolMenu(props: ToolMenuProps) {
  const {renderDefault, tools} = props
    
  const filteredTools = useMemo(() => {
    return isDev ? tools : tools.filter((t) => t.name !== 'vision')
  }, [isDev, tools])

  return renderDefault({
    ...props,
    tools: filteredTools, // Pass the custom array of tools
  })
}

// Plugin
const toolPlugin = createPlugin({
  name: 'tool-plugin',
  studio: {
    components: {
      toolMenu: MyToolMenu,
    },
  },
})

// Config
export default createConfig({
  ...,
  name: 'studio-config',
  plugins: [toolPlugin()],
})

If yet another plugin makes customizations of toolMenu – then the props received in that plugin will be the result of the previous customization (that is, no vision tool in non-development mode).

NOTE: If renderDefault is not called, the middleware chain stops and the next plugin will have no effect.

Using renderDefault in schema

The renderDefault function may also be used directly in a schema definition to render a default component. In the example below, we create a component that renders the default string input with a character counter, directly in the schema:

import {Stack, Text} from '@sanity/ui'
import {defineField, StringInputProps} from 'sanity'

function StringInputCharacterCount(props: StringInputProps) {
  return (
    <Stack space={2}>
      {/* Render the default string input */}
      {props.renderDefault(props)}

      <Text align="right" size={1}>
        Characters: <strong>{props.value?.length || 0}</strong>
      </Text>
    </Stack>
  )
}

export const myDocument = defineField({
  type: 'document',
  name: 'myDocument',
  fields: [
    {
      name: 'title',
      type: 'string',
      title: 'Title',
      components: {
        input: StringInputCharacterCount,
      },
    },
  ],
})

Result:
Screen Shot 2022-10-03 at 11 16 42

Consolidated sanity package and exports

Breaking changes to export bundles

The sanity package is now split up into these export bundles:

  • sanity
  • sanity/cli
  • sanity/desk
  • sanity/router

There have been necessary changes made in order to make the exports clean and independent bundles: no API member is now exported twice (as was the case before). And there are no longer cyclic dependencies between exports.

Export Change
sanity unchanged
sanity/_internal unchanged
sanity/_unstable ➡️ merged into sanity
sanity/cli unchanged
sanity/desk unchanged
sanity/form ➡️ merged into sanity
sanity/router ⤵️ separated from sanity

Why? These changes are mainly introduced to prevent API confusion.

// Before: this is not great
import {Chunk} from 'sanity'
import {Chunk} from 'sanity/desk'
import {Chunk} from 'sanity/form'

// Now: an API member is only available in one of the exports
import {Chunk} from 'sanity'

This also means we have removed duplicate code in the export bundles, which could cause issues with React contexts and bundle size.

API release tags

All the API members in the sanity package now have API release tags. These are TSDoc release tags that are understood by Intellisense and can be seen in your IDE.

Example:
image

How to reason about the various tags:

Tag Description
@internal Internal API. Use at your own risk.
@alpha Early stage API. Will likely change or even be removed. Use at your own risk.
@beta Early stage API. Will likely change. Use at your own risk.
@public Stable API. Safe to use.

React 18

The Studio internals are upgraded to React 18 and use the new concurrent renderer. Support for React v17 is dropped and v18 is the new baseline in order to make full use of the new features and performance improvements.

Why we're doing this now

Structured content creation should be a delightful and exceptional experience. Everything should feel responsive. That means the UI needs to keep up with your interactions no matter what. If 300 people are editing the same document as you are and your phone's CPU just can't keep up that's ok. Everyone else's changes can wait for a second or two before they show up. As long as you can type as fast as you want without ever feeling held back by a sluggish text field that struggles to keep up with your thoughts. The edits of your peers have time to render whenever you stop to gather your thoughts. It's more important for you to stay in the zone, and for the studio to prioritize responding to your interactions.

With new APIs like startTransition, useTransition, useDeferredValue and Suspense we can start moving towards making this vision a reality.

While it is possible to do this in a way that gives theoretical support for both react v17 and v18, we ultimately decided against it after a thorough evaluation with the goal of maintaining compatibility with v17. It came down to which option allow us to deliver the highest quality product, and unless everything is tested on both versions of react for every release we'll either:

  • Have good v17 support but unable to adopt v18 features that can't be shimmed on v17. Such as startTransition, useTransition and useDeferredValue.
  • Great v18 support but the v17 becomes increasingly buggy and slow as devs become used to how v18 behaves. For example v18 automatically batches state updates while v17 does not. A component that in v18 have few re-renders might have a ton of re-renders in v17 if the component author isn't aware of this difference and there's great v17 testing routines in place.

Upgrade info

Official guide: https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis
If you're on react v17 today and don't see any warnings in your console when running your studio locally then upgrading is pretty much just a matter of bumping react, react-dom and react-is to ^18 in your package.json.

Read the official upgrade guide to get a sense of what components you might need to give a little refactor.
While migrating studio internals we found that if there's a problem in a component it's usually related to one of these factors:

  • A class component that is using lifecycle method with a UNSAFE_ prefix, for example UNSAFE_componentWillMount or UNSAFE_componentWillReceiveProps. Detailed guide.
  • The component had useEffect logic that assumed that useEffect(() => () => teardown(), []) the teardown() is only called once, and on unmount. Get a refresher on how useEffect works to make it easier to find and resolve these bugs.
  • Incorrect dependency arrays in hooks like useEffect, useMemo, useCallback and such either because they were suppressed in the linter due to // eslint-disable or custom hooks and layers of abstractions made the linter unable to detect them.
  • If you're on TypeScript and are seeing a lot of typing errors you can try the automated migration script. Or hold off on upgrading @types/react until you have the bandwidth to fix the problems that the stricter typings uncover in your code.

@sanity/ui

If you have a dependency on @sanity/ui and use it in your project make sure to bump it to v1 as it's upgraded to support the new concurrent renderer.

Other changes

renderStudio now returns a function for unmounting it, to make it easier to use in other libraries such as vue, svelte, solid, angular, jqueryui, mootools, whatever floats your boat. How about as a Web Component? ⛵

<script type="module">
import {createConfig, renderStudio} from 'sanity'
import {deskTool} from 'sanity/desk'

customElements.define(
  'sanity-studio',
  class extends HTMLElement {
    connectedCallback() {
      const config = createConfig({
        projectId: this.getAttribute("projectId"),
        dataset: this.getAttribute("dataset"),
        plugins: [deskTool()],
        schema: {
          types: []
        }
      })

      this.unmount = renderStudio(this, config)
    }

    disconnectedCallback() {
      this.unmount?.()
    }
  }
)
</script>

<sanity-studio projectId="pnkijp0b" dataset="codesandbox"></sanity-studio>

See Codesandbox with example using Sanity Studio v3 in a web component.

React Strict Mode

You can opt-in to React's Strict Mode checks for your custom studio components in these ways:

  • Add reactStrictMode: true to your sanity.cli.ts file.
  • Create a .env.development file and add SANITY_STUDIO_REACT_STRICT_MODE=true to it.
  • Set the env var while starting sanity: SANITY_STUDIO_REACT_STRICT_MODE=true sanity start

We strongly suggest you opt-in to better prepare your custom studio for the future of React. This only affects development mode, production mode or sanity build is unaffected by this setting.

Schema namespace removed

The Schema namespace has been removed. The same types can now be accessed as regular imports from the sanity package.

// Before
import {Schema} from 'sanity'

const stringDef: Schema.StringDefinition = {...}

// Now
import {StringDefinition} from 'sanity'

const stringDef: StringDefinition = {...}

With this change it is now be possible to augment definition interfaces using declaration merging. This allows us to improve typesafety and intellisense in defineType schema helpers for plugins moving forward.

See TSDoc on defineType for examples on this.

Support for v2 theming

import {buildLegacyTheme} from 'sanity'

export default createConfig({
  // ... studio config ...
  
  theme: buildLegacyTheme({
    // here you can add CSS properties that
    // were used to customize Studio v2 theming
    '--black': '#000',
    '--default-button-color': '#666',
    // etc
  })
})

Improved search 🕵️

Improved search

  • Adds support for filtering search results by any number of document types. You can also browse documents from any number of types without entering a search query.
  • Search is now toggleable with a hotkey (Command/Control-K) and fully navigable by keyboard.
  • Recent searches (including selected document types) are stored for later use
  • Search terms and results are retained upon close: handy if you want to quickly revisit or amend your last search
  • Improves performance when rendering and scrolling through large result sets
  • The search dialog is wider, giving you more space for the search result listing

NOTE: Documents listed in search results will no longer resolve custom components for block content and array views

Slug functions context

Slug options source and slugify are now passed a context parameter as the last argument. It contains getClient, schema and currentUser.

🐛 Notable bugfixes

  • The Studio now includes global CSS with font-family, and will no longer use serif in cases where you don't use <Text> from @sanity/ui.
  • Various minor bug fixes in the Portable Text Editor.
  • Fixes various bugs related to React 18 support.
  • Adds strict validation of predefined list options for array types.
  • Fixes various issues with array inputs and makes sure all variations of array inputs have parity with v2.

📓 Full changelog

Author Message Commit
Marius Lundgård build: use @sanity/pkg-utils 2778e0c
Marius Lundgård chore: alphabetize package.json scripts 8090909
Marius Lundgård fix(deps): fix dependency configurations 4677879
Marius Lundgård fix: remove asterix imports of react a60dc16
Marius Lundgård chore: disable tsdoc syntax in jest configuration files 4180f00
Marius Lundgård chore(cli): do not bundle get-it 0f3ff01
Marius Lundgård chore(deps): add @types/babel__traverse dependency 3ee5ada
Marius Lundgård chore: set TS target 12de8f7
Marius Lundgård ci: remove exports-check action aae8c5e
Marius Lundgård chore(cli): do not bundle @babel/traverse 0395767
Espen Hovlandsdal chore: normalize dependencies 801d336
Herman Wikner refactor(sanity): rename ToolMenu to StudioToolMenu, update API and add test id:s 501a56d
Herman Wikner feat(sanity): rename Navbar to StudioNavbar + implement Logo and ToolMenu from studio.components 2cea78a
Herman Wikner feat(sanity): add StudioLogo component a80fc64
Herman Wikner feat(sanity): implement ToolMenu from studio.components in NavDrawer 6b0887d
Herman Wikner feat(sanity): implement Navbar from studio.components in StudioLayout 8aa9393
Herman Wikner feat(sanity): implement Layout from components.studio in Studio 9a75c81
Herman Wikner feat(sanity): add studio components API 1283603
Herman Wikner refactor(sanity): spread rest props on CollapseMenu to enable adding test id 451ce02
Herman Wikner feat(sanity): update exports 9294ada
Herman Wikner test(sanity): add components API test 889e8c1
Herman Wikner test(test-studio): update custom ToolMenu 89d682e
Herman Wikner test(sanity): update NavbarStory e5d8ccd
Herman Wikner feat(sanity): remove logo from config type 7bfe3b1
Espen Hovlandsdal feat(form): future-proof patch types b84b844
Espen Hovlandsdal feat(desk)!: drop preserveInstance option on custom user panes 1d17b61
Espen Hovlandsdal feat(desk)!: drop urlParams on custom user panes 13b4567
Per-Kristian Nordnes feature(form): improve focus handling for PT-input c0afe6c
Per-Kristian Nordnes chore(form): remove unused imports f7a817d
Per-Kristian Nordnes fix(portable-text-editor): don't memoize isEmpty, lookup directly in decorator fn. fb9fbe2
Per-Kristian Nordnes refactor(portable-text-editor): improve placeholder block handling 1c5e976
Per-Kristian Nordnes test(portable-text-editor): add undo/redo test fn. 37ef240
Per-Kristian Nordnes fix(portable-text-editor): improve validation error message d20ec24
Per-Kristian Nordnes test(portable-text-editor): add test for clearing document 438032d
Per-Kristian Nordnes fix(form): improve error message 8b53398
Per-Kristian Nordnes refactor(portable-text-editor): rename fn. to make more sense 2d2d48b
Per-Kristian Nordnes fix(portable-text-editor): ensure correct selection being emitted 8acf960
Per-Kristian Nordnes test(portable-text-editor): adjust snapshot after selection fix a6318cd
Per-Kristian Nordnes chore(portable-text-editor): remove unused import 1e191be
Per-Kristian Nordnes refactor(form): reconcile PT member validation 6d2f18e
Per-Kristian Nordnes refactor(form): memoize PT markers 247d6bb
Per-Kristian Nordnes test(form): debug render util. for PT-input 40c319c
Per-Kristian Nordnes refactor(form): refactor tooltip enabling for PT block object a17efef
Per-Kristian Nordnes fix(portable-text-editor): don't sync if empty patches 96771df
Per-Kristian Nordnes fix(portable-text-editor): fix potential re-rendering issue f542cd2
Per-Kristian Nordnes test(portable-text-editor): add own test ts-config fc9ef8c
Per-Kristian Nordnes fix(form): optimize AnnotationToolbarPopover 11b3a6e
Per-Kristian Nordnes test(portable-text-editor): add button to test toggling readOnly state 0b477a4
Per-Kristian Nordnes refactor(portable-text-editor): inherit readOnly status from PortableTextEditor in Editable 5897465
Per-Kristian Nordnes refactor(portable-text-editor): make it possible to re-initialize the plugin chain 0b88fac
Per-Kristian Nordnes test(portable-text-editor): update tests to match the latest changes 7368d43
Per-Kristian Nordnes wip: ensure up to date PortableTextSelection + fix issues with undo/redo + tests 80bd1f5
Per-Kristian Nordnes test(form): turn off PT-input render debugging d020ed1
Per-Kristian Nordnes fix(portable-text-editor): run empty check directly into decorate fn. 9fcbc5c
Per-Kristian Nordnes test(portable-text-editor): disable unstable test for now 13674f9
Per-Kristian Nordnes fix(portable-text-editor): emit PT selections also in readOnly version bd1fc33
Per-Kristian Nordnes refactor(portable-text-editor): simplify plugin options + make sure editableAPI plugin is always present d9546db
Per-Kristian Nordnes fix(form): support patch symbols for PT-input PTE patches f120f6d
Bjørge Næss refactor(base): clean up document operation typings 534fb50
Bjørge Næss refactor(base): replace commit handler with stream of commit requests 44e2f1b
Bjørge Næss refactor: handle latency better during document publish 93a38c1
Bjørge Næss fix(desk-tool): add useCondionalToast hook as workaround for missing @sanity/ui feature 57ad2ae
Bjørge Næss fix(base): improve correctness of error check b21196e
Per-Kristian Nordnes fix(form-builder): workaround weird Chrome bug related to flex and spellchecking 2f6d160
Bjørge Næss perf(desk-tool): optimize useTimeAgo aa31b7d
Per-Kristian Nordnes feature(react-hooks): add low priority modality to useEditState hook dcaad24
Bjørge Næss test(validation): drop test asserting eager execution of nested validation checks 9044965
Bjørge Næss fix(validation): add requestIdleCallback shim for Safari 6cd45cb
Bjørge Næss perf(validation): refactor validation to be based on observables instead of promises, run in idle callback 8b32bf9
Bjørge Næss deps(base): upgrade to latest rxjs-exhaustmap-with-trailing 2567e1a
Bjørge Næss refactor(base): optimize validation scheduling 581df88
Bjørge Næss test(base): tweak tests after validation schedule optimizations 0e90d2c
Bjørge Næss fix(base): keep reference existence listener alive between document versions 091820c
Bjørge Næss fix(base): inline getDocumentExists and make it look up already existing info 1569526
Bjørge Næss chore: cleanup & simplify preview observer code 44adf9c
Bjørge Næss fix(desk-tool): make sure validation result is about current revision before publishing 6d38e04
Bjørge Næss fix(sanity): fix preview issue 9fa5aff
Espen Hovlandsdal fix(cli): stub css files when mocking browser environment c306d0b
Marius Lundgård fix(portable-text-editor): fix cyclic dependency d15e484
Marius Lundgård build: upgrade @sanity/pkg-utils e2f2c4e
Marius Lundgård build(sanity): use correct file extensions when replacing version strings b47ea65
Marius Lundgård ci: remove type-check and verify_format actions f2f04ed
Marius Lundgård chore: add check:format script eedd513
Marius Lundgård ci: add format checking to test action 3ea485a
Marius Lundgård test(portable-text-editor): move constant to allow testing without building b5590e3
Marius Lundgård test(portable-text-editor): fix tsconfig 597bbef
Marius Lundgård chore(deps): upgrade typescript 1b7d6a3
Marius Lundgård chore: add alias for @sanity/util/fs 9f22a14
Marius Lundgård chore(portable-text-editor): add missing dependency 292415c
Snorre Eskeland Brekke chore: fix broken type-tests 34a9b60
Marius Lundgård chore: rename files to *.cjs 92fdc2d
Marius Lundgård chore: configure eslint 8debf98
Marius Lundgård chore(sanity): fix eslint errors b9db377
Marius Lundgård chore: update .cjs files 536b2d9
Marius Lundgård chore: improve jest config 3a71e15
Per-Kristian Nordnes fix(form): respect enableHiddenCheck condition in formState 7f20cca
Bjørge Næss test(block-tools): use snapshots instead of fixture imports b55cea0
RitaDias refactor(sanity): rename StudioFormBuilderProvider and related (#3675) 6cca17e
Cody Olsen chore(typings): prepare for react 18 by using stricter typings (#3693) 0d13e12
Per-Kristian Nordnes feature(form): improve readOnly mode for PT-input with v2 parity a7b2f81
Per-Kristian Nordnes fix(form): fix layering issue with PT-input aa8561c
Per-Kristian Nordnes fix(form): fix issue with PT-input open close state for modals 32e302b
Espen Hovlandsdal fix(cli): use same process when executing scripts e640b72
Espen Hovlandsdal fix(cli): correct worker strategy for new bundling 881fd5e
Cody Olsen feat: move to react 18 (#3612) 45e485b
Bjørge Næss perf(desk-tool): optimize useTimeAgo 44a922e
Marius Lundgård chore(deps): align versions ba99e74
Marius Lundgård refactor(sanity): remove unused code fe7d861
Cody Olsen chore: fix deps versions for react 18 (#3696) 3874af7
Marius Lundgård build(sanity): remove unused paths config 5d6d411
Marius Lundgård chore(deps): remove duplicate dependency 97ebb40
Per-Kristian Nordnes fix(form): Fix React 18 issue with PT-input 193fe7e
Marius Lundgård chore: upgrade @sanity/pkg-utils febf7a6
Marius Lundgård fix(cli): add missing exports 3d95732
Marius Lundgård chore(deps): add missing deps f2e32f3
Marius Lundgård chore(block-tools): add missing TS references 36844ea
Marius Lundgård chore(cypress): fix lint errors f3dc853
Marius Lundgård chore(deps): add missing dependencies 39df6f7
Marius Lundgård chore: simplify scripts 9f354de
Marius Lundgård ci: update GitHub actions 603de03
Snorre Eskeland Brekke fix: added context with client and schema to slugify and source options (#3711) 8d0f1a4
Cody Olsen fix: migrate class components to functions+hooks (#3701) 829e5ec
Cody Olsen chore(ci): reduce PR builds (#3716) 841121a
Snorre Eskeland Brekke feature!: replaced Schema namespace with plain exports for schema-definitions (#3699) 05068d8
Marius Lundgård build(sanity): configure API linting rules cae59f1
Marius Lundgård chore(sanity): ignore etc/*.json files b32e4f5
Marius Lundgård refactor(sanity): simplify asset source resolution bc6e17e
Marius Lundgård refactor(sanity): fix lint errors 5608c26
Marius Lundgård test(sanity): convert to TypeScript 91dd6e1
Marius Lundgård test(sanity): move tests to src/ 3e9e685
Marius Lundgård refactor(sanity): remove underscore prefix on internal members a4092b2
Marius Lundgård refactor(sanity): remove NodePresence since it's a copy of FormFieldPresence cc10714
Marius Lundgård refactor(sanity): clean up react-track-elements 129b270
Marius Lundgård build(sanity): move to root exports directory 7382ae1
Marius Lundgård fix(sanity): remove duplicate exports 3464a00
Marius Lundgård refactor(sanity): group source code by export boundaries 71ec8b3
Marius Lundgård refactor(sanity): move router to separate export e68e742
Marius Lundgård refactor(sanity): add Route* prefix e267849
Marius Lundgård refactor(vision): use sanity/router import aba0fe0
Marius Lundgård refactor(sanity): merge sanity/_unstable into sanity e04434a
Marius Lundgård refactor(sanity): clean up 12d35c8
Marius Lundgård docs(sanity): convert comment to TSDoc 1b9aa9a
Marius Lundgård refactor(sanity): add missing return types c5e663b
Marius Lundgård feat(sanity): export file and image inputs 06b03ce
Marius Lundgård refactor(sanity): convert to function 981751c
Marius Lundgård refactor(sanity): use self-referencing imports between export boundaries 2ddf5bd
Marius Lundgård refactor(sanity): move hookCollection to sanity 5f0944b
Marius Lundgård refactor(sanity): move asset sources to files ac825dd
Marius Lundgård refactor(sanity): rename asset source directory 1036d41
Marius Lundgård feat(sanity): export used ResourceCacheProviderProps interface 0cdd0fd
Marius Lundgård refactor(sanity): move document actions/badges to core 7b27a15
Marius Lundgård refactor(sanity): move datastores to store/_legacy 27510e7
Marius Lundgård refactor(sanity): merge sanity/form into sanity d33af51
Marius Lundgård refactor(sanity): remove duplicate PreviewCard component b751525
Marius Lundgård refactor(sanity): simplify IntentButton prop types f8ed855
Marius Lundgård refactor(sanity): do not export styled components 82c70dc
Marius Lundgård refactor(sanity): move helpers to separate file e775bbc
Marius Lundgård fix(sanity): add missing exports 96bdc11
Marius Lundgård refactor(sanity): remove duplicate PreviewCard e0e3899
Marius Lundgård refactor(sanity): rename FileInput to BaseFileInput f5aed74
Marius Lundgård refactor(sanity): rename ImageInput to BaseImageInput d43a03b
Marius Lundgård refactor(sanity): workaround to fix TS error 5d0b591
Marius Lundgård refactor(sanity): add missing exports 97fda78
Marius Lundgård refactor(sanity): refer to exports by name 1b8194f
Marius Lundgård chore(sanity): add sanity to depcheck ignore list 8422752
Marius Lundgård chore(sanity): configure eslint boundaries 3d0adf7
Marius Lundgård refactor(sanity): move FormInput to components directory 9632978
Marius Lundgård docs(sanity): fix typo 10b4172
Marius Lundgård docs(sanity): add missing TSDoc release tags ec5b530
Marius Lundgård refactor(sanity): move changeIndicators out of components 1e17d76
Marius Lundgård refactor(sanity): remove exports from components which causes test failure c3883a5
Marius Lundgård fix(sanity): avoid complex TS features to make @microsoft/api-extractor build d751a05
Marius Lundgård chore(diff): fix lint errors 33942cb
Marius Lundgård refactor(cli): update imports db3ba90
Marius Lundgård chore(types): ignore etc/*.json files 9de4268
Marius Lundgård refactor(types): export ambient members 8785639
Marius Lundgård docs(types): add missing TSDoc release tags 72c4676
Marius Lundgård build(types): require TSDoc release tags f31798a
Marius Lundgård build: configure package.json and tsconfig.json a0d539e
Marius Lundgård refactor(test-studio): update imports e9d5ad4
Marius Lundgård refactor(ecommerce-studio): update imports 3c030e3
Marius Lundgård refactor(sanity): export all structure members 70186c4
Marius Lundgård refactor(sanity): remove duplicate PatchOperations interface 2af022e
Marius Lundgård feat(types): add merge property to PatchOperations 8bb8a03
Marius Lundgård refactor: rename NodeValidation => FormNodeValidation 2c2b85f
Marius Lundgård refactor: rename FormFieldValidation => FormNodePresence 9111c44
Marius Lundgård fix(sanity): use ref prop 7aff925
Cody Olsen feature(cli): add reactStrictMode option (#3721) 5ecbbd9
Marius Lundgård build(util): configure build 6d3c53a
Marius Lundgård feat(sanity): render global font and background color 27d5085
Espen Hovlandsdal test(cli): provide full cli tests for both v2 and v3 5412ca8
Espen Hovlandsdal fix(cli): print job completition message on successful dataset copy 6da4556
Espen Hovlandsdal ci: expose cli token secret as env var cd3de5d
Espen Hovlandsdal ci: build cli prior to running tests bb354b6
Espen Hovlandsdal ci: use node version from strategy matrix 401ba42
Espen Hovlandsdal ci: print node + npm version prior to build/test 15b2855
Espen Hovlandsdal chore: drop empty exclude from tsconfig 316a2ff
Espen Hovlandsdal test(cli): work around jest not respecting test timeout 0b7070b
Espen Hovlandsdal chore(cli): alphabetize jest config properties b313869
Espen Hovlandsdal test(cli): test for contents of tarball instead of size 79e6c1e
Espen Hovlandsdal chore(cli): address a few lint issues in tests b76846b
Espen Hovlandsdal chore(cli): remove unnecessary tsconfig ignore 5b68365
Espen Hovlandsdal fix(cli): reject with an error when trying to reach dev server 2450e56
Snorre Eskeland Brekke * fix: form state now correctly updates members when hidden state changes (#3719) ea48fa3
Herman Wikner feat(sanity): add components API e9b09b4
Herman Wikner feat(sanity): update input, field, item and preview types with renderDefault 865c27e
Herman Wikner refactor(sanity): remove schemaType from RenderPreviewCallback type (added to PreviewProps) 9f5ec39
Herman Wikner feat(sanity): use middleware components in StudioNavbar 4b37654
Herman Wikner feat(sanity): use middleware components in NavDrawer c22906f
Herman Wikner feat(sanity): use middleware components in StudioLayout db3751e
Herman Wikner feat(sanity): use middleware components in Studio 36ddbc5
Herman Wikner feat(sanity): use middleware components in FormProvider 99e89d0
Herman Wikner refactor(sanity): omit renderDefault from components 0455b03
Herman Wikner feat(sanity): add renderItem to ArrayInput 0f27c41
Herman Wikner feat(sanity): add renderItem to ArrayOfPrimitivesInput 037cc28
Herman Wikner feat(sanity): improve SanityPreview to work with the components API 00ad73a
Herman Wikner refactor(sanity): add test id:s to form components 60aa893
Herman Wikner test(sanity): pass noop renderDefault to form input tests 279ce8d
Herman Wikner test(sanity): add components API tests 6f41653
Herman Wikner dev(sanity): update workshop stories with components API 287b20d
Herman Wikner refactor(types): update components typings 85a8f10
Herman Wikner dev(test-studio): add components API schema and plugins + update sanity.config 0a7ce76
Herman Wikner test(sanity): update FormBuilder test 088612e
Herman Wikner refactor(sanity): update form and config typings to work with components API e885e44
Fred Carlsen fix(sanity): fix controls for custom block components preview (#3722) 0cfd150
Marius Lundgård v3.0.0-dev-preview.21 fc38fd8
Bjørge Næss fix(sanity): upgrade json-reduce to 3.0 f711cb4
Bjørge Næss chore(sanity): replace useId from @reach/auto-id with useId from react b7f36cf
Espen Hovlandsdal chore: drop dev-preview peer dependencies f6f5801
Espen Hovlandsdal chore: use forked react-sortable-hoc with react 18 peer compat 7f4255a
Espen Hovlandsdal test(cli): include desk tool in v3 test fixture 5981d8a
Marius Lundgård build: update @sanity/pkg-utils 328c0da
Marius Lundgård chore(deps): update dependencies e1e9c8c
Per-Kristian Nordnes fix(form): prevent default event on click space to activate bb29189
Marius Lundgård chore(deps): update dependencies 74dcc24
Marius Lundgård chore: clean dev projects 4d8f772
Per-Kristian Nordnes fix(desk): don't call handleChange if documentPane isn't ready yet 8b04f21
Per-Kristian Nordnes Revert "fix(form): Fix React 18 issue with PT-input" 6c5936b
Cody Olsen chore(test-studio): re-enable mux plugin 7b0673e
Cody Olsen fix: hook factory strict mode errors (#3730) e3eac12
Marius Lundgård build: define __DEV__ global 4aa8648
Marius Lundgård build: define default dist directory a0ffa33
Marius Lundgård refactor(cli): add runnable file to support esbuild-register 408baf0
Marius Lundgård refactor(server): support esbuild-register in workers (dev only) b440fd5
Marius Lundgård refactor(sanity/cli): support esbuild-register 9c01aba
Marius Lundgård chore: use esbuild-register in dev-mode af7e3f8
Marius Lundgård chore(deps): remove unused dependency 7db8a83
Marius Lundgård feat(sanity): buildLegacyTheme() function to enable v2 => v3 porting 222588e
Marius Lundgård chore(test-studio): set up custom themes 66156e3
Marius Lundgård fix(sanity): disable light/dark mode switching for legacy themes 6806ce6
Per-Kristian Nordnes dev(test-studio): modify PT custom markers schema e25b231
Bjørge Næss fix(portable-text-editor): fix double paste event bug 9249fc4
Bjørge Næss fix(portable-text-editor): remove async noop preventDefault ee2ef4f
Bjørge Næss refactor(portable-text-editor): simplify code and make sure preventDefault is always called 365af8e
Per-Kristian Nordnes fix(portable-text-editor): type as clipboardEvent spesifically a2d3643
Per-Kristian Nordnes fix(portable-text-editor): fallback to normal paste 1d37d2e
Per-Kristian Nordnes dev(test-studio): add custom paste handler test 74a2725
Per-Kristian Nordnes fix(portable-text-editor): persist clipboard event 202f6a6
Per-Kristian Nordnes refactor(portable-text-editor): get event sync, remove event.persist() 0e01d36
Cody Olsen chore(test-studio): add tailwind colors test fb249b1
Marius Lundgård chore(deps): upgrade @sanity/ui to v1.0.0-beta.29 a2cdbf0
Marius Lundgård fix: update use of Popover in TimelineMenu a2ce399
Espen Hovlandsdal chore: work around depcheck url import issue fda3ccb
Cody Olsen fix: @sanity/vision includes react in bundle 0623dd1
Espen Hovlandsdal test: add missing disconnect method to mocked resize observer 842c703
Cody Olsen fix: only show "document published" toast once 7926a88
Cody Olsen fix: persist split panes on reload c5b6d80
Cody Olsen fix: unable to navigate back to mounted url de208be
Cody Olsen chore(deps): script for reporting updated deps 3c5bf28
Espen Hovlandsdal fix(cli): fix using incorrect builtin module in bundle ec51e40
Espen Hovlandsdal fix(core): ensure empty basepaths are treated as zero segments bb37692
Espen Hovlandsdal chore: use createRoot instead of ReactDOM.render de79e2d
Espen Hovlandsdal chore: migrate away from @testing-library/react-hooks 71dbb34
Espen Hovlandsdal test(core): add missing act in test call 70466ed
Bjørge Næss fix(validation): fix issue causing mixup of validation errors for different items in array of primitives e682962
Espen Hovlandsdal test(cli): temporarily disable deploy tests 9536f10
Bjørge Næss fix(core): set overflow: hidden on preview media 4d655f9
Herman Wikner fix(desk): timeline button focus ring c546645
Herman Wikner fix(sanity): update workspaces docs url 9890fe6
Herman Wikner fix(sanity): use schemaType passed to renderDefault in schema when resolving default form component 05afc7f
Robin Pyon feat(studio): sortable results, search phrases, experimental config (#3764) ad24282
Herman Wikner feat(sanity): throw error if a tool is named 'tool' 5ce3f81
Espen Hovlandsdal test(portable-text-editor): temporarily disable flakey collaborative test b6c76ab
Bjørge Næss fix(form): allow undefined collapsed state a08730f
Bjørge Næss fix(form): pass onBlur handler to array items e4274e0
Bjørge Næss chore(test-studio): add a simple references debug schema 450bd67
Bjørge Næss fix(preview): remove ReactNode/ReactElement for various preview attributes 6dfd423
Bjørge Næss refactor(form): rename ItemWithMissingType => IncompatibleItemType 9853c3b
Bjørge Næss refactor(form): refactor array inputs to use new apis e595e8f
Bjørge Næss refactor(form): refactor array inputs with predefined options be0e20d
Bjørge Næss feat(form): add universal array input and use as fallback 3134898
Bjørge Næss refactor(form): split up input/field/item resolvers and move renderItem to config level 9d18ac7
Bjørge Næss fix(form): use default Sanity UI dialog autofocus behavior a83078d
Bjørge Næss fix(form): properly support modal.type=popover 2be0b8b
Bjørge Næss fix(form): show incompatible item type header inside popover 32290a2
Bjørge Næss refactor(form): make sure array fields and items uses same logic for initial value resolution a18b99d
Bjørge Næss fix(form): call internal handleChange and remove some duplicated logic ba98c2a
Bjørge Næss fix(form): ensure object array options always gets assigned a _key b51ddbe
Bjørge Næss docs(form): add tsdoc stability tags cb508c0
Bjørge Næss refactor(form): colocate reference item together with reference field and input 55cf027
Bjørge Næss test(form): skip reference input tests for now 3e10797
Cody Olsen fix: direct link to add cors origin (#3755) 3018c05
Marius Lundgård fix(sanity): remove constrainSize property 5271023
Herman Wikner refactor(sanity): update callback names 3a232f9
Bjørge Næss fix(schema): add strict validation for arrays of mixed types 65fd8f7
Bjørge Næss fix(schema): add strict checking of predefined options defined on array types af87045
Herman Wikner feat(sanity): use sanity/ui MenuButton in ImageActionsMenu ed00618
Herman Wikner fix(sanity): focus issues in ImageInput 7210bc2
Herman Wikner fix(sanity): lost focus on selected menu item in presence menu fe81089
Bjørge Næss test(form): fix failing test d51d7ab
Herman Wikner feat(desk): pass changesOpen to useFormState in order to enable disabling of group tabs 906b326
Herman Wikner feat(form): disable document group tabs when review changes pane is open 4ba718e
Bjørge Næss test(portable-text-editor): disable react 18 root api for now 419125e
Herman Wikner fix(sanity): update placement on popover in PaneContextMenuButton 66c7e6c
Herman Wikner fix(sanity): PopoverEditDialog ui b839743
Marius Lundgård fix(sanity): document status bar tooltip placement 30340b6
Marius Lundgård chore(deps): update dependencies 3126529

Don't miss a new sanity release

NewReleases is sending notifications on new releases.