# ✨ Highlights
## At-a-glance
This version (`dev-preview.??`) 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 developer experience 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.
[Let us know your thoughts and questions on GitHub Discussions](https://github.com/sanity-io/sanity/discussions)
## Components API
The new Components API allows for 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`, `toolMenu`, `layout`, and `logo`.
- **Form components**: `field`, `input`, `item`, and `preview`. The `diff` component property is still being worked on.
Example:
```ts
import {createConfig} from 'sanity'
export default createConfig({
// ...,
form: {
components: {
field: MyField,
input: MyInput,
item: MyItem,
preview: MyPreview,
// diff: MyDiff
},
},
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)` up and to `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:
```tsx
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:
```tsx
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:
<img width="635" alt="A string input with the text API exports showing the customized character count with the number 11" src="https://user-images.githubusercontent.com/15094168/193543059-4588ebe5-7b00-4349-9601-8221a33f2cf3.png" style="border: 1px solid currentColor; max-width: 100%;">
## 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` |
This means that if you have used functions like `set` and `unset` from `sanity/form`, you'll need to move these to `sanity`:
```jsx
// Before `dev-preview.??`
import {set, unset} from 'sanity/form'
// Now
import {set, unset} from 'sanity'
```
We made these changes mainly to prevent API confusion:
```ts
// 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.
### Studio API release tags
All the API members in the `sanity` package now have API release tags. These are [TSDoc release tags](https://tsdoc.org/pages/tags/alpha/) that are understood by IntelliSense and can be seen in your IDE. These tags are helpful indicators for what are considered stable and safe to use APIs.
Example:
<img width="947" alt="VS Code showing a popup for DocumentActionDescription with a beta tag" src="https://user-images.githubusercontent.com/406933/193587452-b48e9558-719f-45ea-b84b-ddec689484e4.png">
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](https://github.com/sanity-io/sanity/pull/3612)
The Studio internals are upgraded to[ React 18](https://reactjs.org/blog/2022/03/29/react-v18.html) and use the [new concurrent renderer](https://reactjs.org/blog/2022/03/29/react-v18.html#what-is-concurrent-react).
**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.
Since the Studio is a real-time collaborative environment, there are times where it's useful to prioritize showing UI updates that's relevant to a user's own interactions, and down-prioritize everyone else's. React 18 gives us better tools to optimize this real-time experience with new APIs like `startTransition`, `useTransition`, `useDeferredValue` and `Suspense`.
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
If you have customizations that uses React, then we recommend [React's official guide on how to upgrade](https://reactjs.org/blog/2022/03/08/react-18-upgrade-guide.html#updates-to-client-rendering-apis) to get a sense of what components you might need to give a little refactor.
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`.
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.](https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html)
- 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.](https://beta.reactjs.org/learn/synchronizing-with-effects)
- 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](https://github.com/eps1lon/types-react-codemod). Or hold off on upgrading `@types/react` until you have the bandwidth to fix the problems that the stricter typings uncover in your code.
#### Upgrade `@sanity/ui` to `0.38`
If you have a dependency on `@sanity/ui` and use it in your project make sure to bump it to `0.38` as it's upgraded to support the new concurrent renderer.
## [React Strict Mode](https://github.com/sanity-io/sanity/pull/3721)
You can opt-in to [React's Strict Mode](https://reactjs.org/docs/strict-mode.html) 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 this environment variable while starting the sanity developer server: `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.
```ts
// Before
import {Schema} from 'sanity'
const stringDef: Schema.StringDefinition = {...}
// Now
import {StringDefinition} from 'sanity'
const stringDef: StringDefinition = {...}
```
It is now possible to augment definition interfaces using declaration merging. This allows us to improve typesafety and improve IntelliSense support for `defineType` and `defineField` schema helpers for plugins moving forward.
[See the TSDoc on `defineType` for examples on this.](https://github.com/sanity-io/sanity/blob/v3/packages/%40sanity/types/src/schema/define.ts#L13-L171)
## Other features
### Slug functions context
Slug options `source` and `slugify` are now passed a context parameter as the last argument. It contains `getClient`, `schema` and `currentUser`.
### Improved Studio embedding support
`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? ⛵](https://codesandbox.io/s/sanity-studio-v3-in-a-web-component-0ukdfl?file=/index.html)
```html
<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](https://codesandbox.io/s/sanity-studio-v3-in-a-web-component-0ukdfl?file=/index.html) with example using Sanity Studio v3 in a web component.
# 🐛 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.
# 📓 Full changelog
Author | Message | Commit
------------ | ------------- | -------------
Marius Lundgård | build: use `@sanity/pkg-utils` | 2778e0ca00
Marius Lundgård | chore: alphabetize package.json scripts | 8090909e5b
Marius Lundgård | fix(deps): fix dependency configurations | 4677879c37
Marius Lundgård | fix: remove asterix imports of react | a60dc16789
Marius Lundgård | chore: disable tsdoc syntax in jest configuration files | 4180f00d58
Marius Lundgård | chore(cli): do not bundle `get-it` | 0f3ff0163e
Marius Lundgård | chore(deps): add `@types/babel__traverse` dependency | 3ee5ada67a
Marius Lundgård | chore: set TS target | 12de8f72aa
Marius Lundgård | ci: remove `exports-check` action | aae8c5eb3c
Marius Lundgård | chore(cli): do not bundle `@babel/traverse` | 0395767fcb
Espen Hovlandsdal | chore: normalize dependencies | 801d336f32
Herman Wikner | refactor(sanity): rename `ToolMenu` to `StudioToolMenu`, update API and add test id:s | 501a56da48
Herman Wikner | feat(sanity): rename `Navbar` to `StudioNavbar` + implement `Logo` and `ToolMenu` from `studio.components` | 2cea78a8a1
Herman Wikner | feat(sanity): add `StudioLogo` component | a80fc644ef
Herman Wikner | feat(sanity): implement `ToolMenu` from `studio.components` in `NavDrawer` | 6b0887dbca
Herman Wikner | feat(sanity): implement `Navbar` from `studio.components` in `StudioLayout` | 8aa93932ba
Herman Wikner | feat(sanity): implement `Layout` from `components.studio` in `Studio` | 9a75c819a7
Herman Wikner | feat(sanity): add studio components API | 1283603921
Herman Wikner | refactor(sanity): spread rest props on `CollapseMenu` to enable adding test id | 451ce02c7e
Herman Wikner | feat(sanity): update exports | 9294ada76c
Herman Wikner | test(sanity): add components API test | 889e8c1b18
Herman Wikner | test(test-studio): update custom `ToolMenu` | 89d682e529
Herman Wikner | test(sanity): update `NavbarStory` | e5d8ccdf51
Herman Wikner | feat(sanity): remove `logo` from config type | 7bfe3b1649
Espen Hovlandsdal | feat(form): future-proof patch types | b84b844188
Espen Hovlandsdal | feat(desk)!: drop `preserveInstance` option on custom user panes | 1d17b614cc
Espen Hovlandsdal | feat(desk)!: drop `urlParams` on custom user panes | 13b4567f65
Per-Kristian Nordnes | feature(form): improve focus handling for PT-input | c0afe6c377
Per-Kristian Nordnes | chore(form): remove unused imports | f7a817db38
Per-Kristian Nordnes | fix(portable-text-editor): don't memoize isEmpty, lookup directly in decorator fn. | fb9fbe2778
Per-Kristian Nordnes | refactor(portable-text-editor): improve placeholder block handling | 1c5e976e00
Per-Kristian Nordnes | test(portable-text-editor): add undo/redo test fn. | 37ef240376
Per-Kristian Nordnes | fix(portable-text-editor): improve validation error message | d20ec24f90
Per-Kristian Nordnes | test(portable-text-editor): add test for clearing document | 438032d204
Per-Kristian Nordnes | fix(form): improve error message | 8b53398a9c
Per-Kristian Nordnes | refactor(portable-text-editor): rename fn. to make more sense | 2d2d48bffa
Per-Kristian Nordnes | fix(portable-text-editor): ensure correct selection being emitted | 8acf9604ad
Per-Kristian Nordnes | test(portable-text-editor): adjust snapshot after selection fix | a6318cd2f9
Per-Kristian Nordnes | chore(portable-text-editor): remove unused import | 1e191be306
Per-Kristian Nordnes | refactor(form): reconcile PT member validation | 6d2f18e7b0
Per-Kristian Nordnes | refactor(form): memoize PT markers | 247d6bba11
Per-Kristian Nordnes | test(form): debug render util. for PT-input | 40c319cace
Per-Kristian Nordnes | refactor(form): refactor tooltip enabling for PT block object | a17efef294
Per-Kristian Nordnes | fix(portable-text-editor): don't sync if empty patches | 96771dffa3
Per-Kristian Nordnes | fix(portable-text-editor): fix potential re-rendering issue | f542cd2802
Per-Kristian Nordnes | test(portable-text-editor): add own test ts-config | fc9ef8c7c9
Per-Kristian Nordnes | fix(form): optimize AnnotationToolbarPopover | 11b3a6e7f0
Per-Kristian Nordnes | test(portable-text-editor): add button to test toggling readOnly state | 0b477a4803
Per-Kristian Nordnes | refactor(portable-text-editor): inherit readOnly status from PortableTextEditor in Editable | 5897465f5f
Per-Kristian Nordnes | refactor(portable-text-editor): make it possible to re-initialize the plugin chain | 0b88facdcf
Per-Kristian Nordnes | test(portable-text-editor): update tests to match the latest changes | 7368d43333
Per-Kristian Nordnes | wip: ensure up to date PortableTextSelection + fix issues with undo/redo + tests | 80bd1f5f3b
Per-Kristian Nordnes | test(form): turn off PT-input render debugging | d020ed1a16
Per-Kristian Nordnes | fix(portable-text-editor): run empty check directly into decorate fn. | 9fcbc5c2db
Per-Kristian Nordnes | test(portable-text-editor): disable unstable test for now | 13674f933c
Per-Kristian Nordnes | fix(portable-text-editor): emit PT selections also in readOnly version | bd1fc339dd
Per-Kristian Nordnes | refactor(portable-text-editor): simplify plugin options + make sure editableAPI plugin is always present | d9546dbfbb
Per-Kristian Nordnes | fix(form): support patch symbols for PT-input PTE patches | f120f6de8d
Bjørge Næss | refactor(base): clean up document operation typings | 534fb50a11
Bjørge Næss | refactor(base): replace commit handler with stream of commit requests | 44e2f1b8ef
Bjørge Næss | refactor: handle latency better during document publish | 93a38c1373
Bjørge Næss | fix(desk-tool): add useCondionalToast hook as workaround for missing @sanity/ui feature | 57ad2ae2a6
Bjørge Næss | fix(base): improve correctness of error check | b21196ec81
Per-Kristian Nordnes | fix(form-builder): workaround weird Chrome bug related to flex and spellchecking | 2f6d16066f
Bjørge Næss | perf(desk-tool): optimize useTimeAgo | aa31b7d1ba
Per-Kristian Nordnes | feature(react-hooks): add low priority modality to useEditState hook | dcaad2442a
Bjørge Næss | test(validation): drop test asserting eager execution of nested validation checks | 90449654f2
Bjørge Næss | fix(validation): add requestIdleCallback shim for Safari | 6cd45cbe23
Bjørge Næss | perf(validation): refactor validation to be based on observables instead of promises, run in idle callback | 8b32bf9247
Bjørge Næss | deps(base): upgrade to latest rxjs-exhaustmap-with-trailing | 2567e1aba6
Bjørge Næss | refactor(base): optimize validation scheduling | 581df88dd7
Bjørge Næss | test(base): tweak tests after validation schedule optimizations | 0e90d2c288
Bjørge Næss | fix(base): keep reference existence listener alive between document versions | 091820cca4
Bjørge Næss | fix(base): inline getDocumentExists and make it look up already existing info | 156952619a
Bjørge Næss | chore: cleanup & simplify preview observer code | 44adf9c564
Bjørge Næss | fix(desk-tool): make sure validation result is about current revision before publishing | 6d38e04653
Bjørge Næss | fix(sanity): fix preview issue | 9fa5aff3ee
Espen Hovlandsdal | fix(cli): stub css files when mocking browser environment | c306d0bcaa
Marius Lundgård | fix(portable-text-editor): fix cyclic dependency | d15e4841fe
Marius Lundgård | build: upgrade `@sanity/pkg-utils` | e2f2c4ed06
Marius Lundgård | build(sanity): use correct file extensions when replacing version strings | b47ea653e9
Marius Lundgård | ci: remove `type-check` and `verify_format` actions | f2f04ed4d9
Marius Lundgård | chore: add `check:format` script | eedd5139a3
Marius Lundgård | ci: add format checking to `test` action | 3ea485a1e7
Marius Lundgård | test(portable-text-editor): move constant to allow testing without building | b5590e37ca
Marius Lundgård | test(portable-text-editor): fix tsconfig | 597bbef029
Marius Lundgård | chore(deps): upgrade `typescript` | 1b7d6a370e
Marius Lundgård | chore: add alias for `@sanity/util/fs` | 9f22a146ea
Marius Lundgård | chore(portable-text-editor): add missing dependency | 292415c24b
Snorre Eskeland Brekke | chore: fix broken type-tests | 34a9b6080c
Marius Lundgård | chore: rename files to *.cjs | 92fdc2df81
Marius Lundgård | chore: configure eslint | 8debf983ae
Marius Lundgård | chore(sanity): fix eslint errors | b9db3772aa
Marius Lundgård | chore: update .cjs files | 536b2d9eff
Marius Lundgård | chore: improve jest config | 3a71e152e5
Per-Kristian Nordnes | fix(form): respect enableHiddenCheck condition in formState | 7f20cca48f
Bjørge Næss | test(block-tools): use snapshots instead of fixture imports | b55cea07bc
RitaDias | refactor(sanity): rename `StudioFormBuilderProvider` and related (#3675) | 6cca17e94f
Cody Olsen | chore(typings): prepare for react 18 by using stricter typings (#3693) | 0d13e12baf
Per-Kristian Nordnes | feature(form): improve readOnly mode for PT-input with v2 parity | a7b2f8158e
Per-Kristian Nordnes | fix(form): fix layering issue with PT-input | aa8561c1bb
Per-Kristian Nordnes | fix(form): fix issue with PT-input open close state for modals | 32e302b745
Espen Hovlandsdal | fix(cli): use same process when executing scripts | e640b72856
Espen Hovlandsdal | fix(cli): correct worker strategy for new bundling | 881fd5e0a0
Cody Olsen | feat: move to react `18` (#3612) | 45e485b33e
Bjørge Næss | perf(desk-tool): optimize useTimeAgo | 44a922e6ea
Marius Lundgård | chore(deps): align versions | ba99e74d55
Marius Lundgård | refactor(sanity): remove unused code | fe7d861bd4
Cody Olsen | chore: fix deps versions for react 18 (#3696) | 3874af72e5
Marius Lundgård | build(sanity): remove unused paths config | 5d6d41151b
Marius Lundgård | chore(deps): remove duplicate dependency | 97ebb40c6c
Per-Kristian Nordnes | fix(form): Fix React 18 issue with PT-input | 193fe7eb2b
Marius Lundgård | chore: upgrade `@sanity/pkg-utils` | febf7a6270
Marius Lundgård | fix(cli): add missing exports | 3d95732483
Marius Lundgård | chore(deps): add missing deps | f2e32f3443
Marius Lundgård | chore(block-tools): add missing TS references | 36844ea3be
Marius Lundgård | chore(cypress): fix lint errors | f3dc853221
Marius Lundgård | chore(deps): add missing dependencies | 39df6f7130
Marius Lundgård | chore: simplify scripts | 9f354de82b
Marius Lundgård | ci: update GitHub actions | 603de03fbc
Snorre Eskeland Brekke | fix: added context with client and schema to slugify and source options (#3711) | 8d0f1a487c
Cody Olsen | fix: migrate class components to functions+hooks (#3701) | 829e5ecca0
Cody Olsen | chore(ci): reduce PR builds (#3716) | 841121a2ae
Snorre Eskeland Brekke | feature!: replaced Schema namespace with plain exports for schema-definitions (#3699) | 05068d814b
Marius Lundgård | build(sanity): configure API linting rules | cae59f1343
Marius Lundgård | chore(sanity): ignore `etc/*.json` files | b32e4f5664
Marius Lundgård | refactor(sanity): simplify asset source resolution | bc6e17ed66
Marius Lundgård | refactor(sanity): fix lint errors | 5608c2681b
Marius Lundgård | test(sanity): convert to TypeScript | 91dd6e1d04
Marius Lundgård | test(sanity): move tests to `src/` | 3e9e685830
Marius Lundgård | refactor(sanity): remove underscore prefix on internal members | a4092b2f81
Marius Lundgård | refactor(sanity): remove `NodePresence` since it's a copy of `FormFieldPresence` | cc10714d32
Marius Lundgård | refactor(sanity): clean up `react-track-elements` | 129b270f7f
Marius Lundgård | build(sanity): move to root `exports` directory | 7382ae14d1
Marius Lundgård | fix(sanity): remove duplicate exports | 3464a00508
Marius Lundgård | refactor(sanity): group source code by export boundaries | 71ec8b38ac
Marius Lundgård | refactor(sanity): move `router` to separate export | e68e742bf9
Marius Lundgård | refactor(sanity): add `Route*` prefix | e267849850
Marius Lundgård | refactor(vision): use `sanity/router` import | aba0fe0c12
Marius Lundgård | refactor(sanity): merge `sanity/_unstable` into `sanity` | e04434a953
Marius Lundgård | refactor(sanity): clean up | 12d35c8b74
Marius Lundgård | docs(sanity): convert comment to TSDoc | 1b9aa9ae0e
Marius Lundgård | refactor(sanity): add missing return types | c5e663bb5f
Marius Lundgård | feat(sanity): export file and image inputs | 06b03ce7a5
Marius Lundgård | refactor(sanity): convert to function | 981751c63a
Marius Lundgård | refactor(sanity): use self-referencing imports between export boundaries | 2ddf5bd9ee
Marius Lundgård | refactor(sanity): move `hookCollection` to `sanity` | 5f0944b1cf
Marius Lundgård | refactor(sanity): move asset sources to files | ac825dd9a3
Marius Lundgård | refactor(sanity): rename asset source directory | 1036d41565
Marius Lundgård | feat(sanity): export used `ResourceCacheProviderProps` interface | 0cdd0fddba
Marius Lundgård | refactor(sanity): move document actions/badges to core | 7b27a15f15
Marius Lundgård | refactor(sanity): move `datastores` to `store/_legacy` | 27510e7abf
Marius Lundgård | refactor(sanity): merge `sanity/form` into `sanity` | d33af518cf
Marius Lundgård | refactor(sanity): remove duplicate `PreviewCard` component | b751525c24
Marius Lundgård | refactor(sanity): simplify `IntentButton` prop types | f8ed8553d8
Marius Lundgård | refactor(sanity): do not export styled components | 82c70dcc62
Marius Lundgård | refactor(sanity): move helpers to separate file | e775bbceee
Marius Lundgård | fix(sanity): add missing exports | 96bdc11025
Marius Lundgård | refactor(sanity): remove duplicate `PreviewCard` | e0e38991b3
Marius Lundgård | refactor(sanity): rename `FileInput` to `BaseFileInput` | f5aed747f6
Marius Lundgård | refactor(sanity): rename `ImageInput` to `BaseImageInput` | d43a03b65e
Marius Lundgård | refactor(sanity): workaround to fix TS error | 5d0b5919b7
Marius Lundgård | refactor(sanity): add missing exports | 97fda78436
Marius Lundgård | refactor(sanity): refer to exports by name | 1b8194f94f
Marius Lundgård | chore(sanity): add `sanity` to depcheck ignore list | 8422752425
Marius Lundgård | chore(sanity): configure eslint boundaries | 3d0adf75ae
Marius Lundgård | refactor(sanity): move `FormInput` to components directory | 9632978130
Marius Lundgård | docs(sanity): fix typo | 10b417212b
Marius Lundgård | docs(sanity): add missing TSDoc release tags | ec5b530a31
Marius Lundgård | refactor(sanity): move `changeIndicators` out of `components` | 1e17d76c5c
Marius Lundgård | refactor(sanity): remove exports from `components` which causes test failure | c3883a51f2
Marius Lundgård | fix(sanity): avoid complex TS features to make `@microsoft/api-extractor` build | d751a05ac4
Marius Lundgård | chore(diff): fix lint errors | 33942cb23e
Marius Lundgård | refactor(cli): update imports | db3ba900e9
Marius Lundgård | chore(types): ignore `etc/*.json` files | 9de4268e28
Marius Lundgård | refactor(types): export ambient members | 8785639d5f
Marius Lundgård | docs(types): add missing TSDoc release tags | 72c46768df
Marius Lundgård | build(types): require TSDoc release tags | f31798a751
Marius Lundgård | build: configure package.json and tsconfig.json | a0d539ec4f
Marius Lundgård | refactor(test-studio): update imports | e9d5ad47cc
Marius Lundgård | refactor(ecommerce-studio): update imports | 3c030e3608
Marius Lundgård | refactor(sanity): export all structure members | 70186c425a
Marius Lundgård | refactor(sanity): remove duplicate `PatchOperations` interface | 2af022e194
Marius Lundgård | feat(types): add `merge` property to `PatchOperations` | 8bb8a03a48
Marius Lundgård | refactor: rename `NodeValidation => FormNodeValidation` | 2c2b85fd46
Marius Lundgård | refactor: rename `FormFieldValidation => FormNodePresence` | 9111c4442f
Marius Lundgård | fix(sanity): use `ref` prop | 7aff92534d
Cody Olsen | feature(cli): add `reactStrictMode` option (#3721) | 5ecbbd9412
Marius Lundgård | build(util): configure build | 6d3c53ad04
Marius Lundgård | feat(sanity): render global font and background color | 27d50853f2
Espen Hovlandsdal | test(cli): provide full cli tests for both v2 and v3 | 5412ca8097
Espen Hovlandsdal | fix(cli): print job completition message on successful dataset copy | 6da4556be1
Espen Hovlandsdal | ci: expose cli token secret as env var | cd3de5d776
Espen Hovlandsdal | ci: build cli prior to running tests | bb354b6a41
Espen Hovlandsdal | ci: use node version from strategy matrix | 401ba4265c
Espen Hovlandsdal | ci: print node + npm version prior to build/test | 15b28555df
Espen Hovlandsdal | chore: drop empty `exclude` from tsconfig | 316a2ff86a
Espen Hovlandsdal | test(cli): work around jest not respecting test timeout | 0b7070b065
Espen Hovlandsdal | chore(cli): alphabetize jest config properties | b31386978c
Espen Hovlandsdal | test(cli): test for contents of tarball instead of size | 79e6c1e1c6
Espen Hovlandsdal | chore(cli): address a few lint issues in tests | b76846b44b
Espen Hovlandsdal | chore(cli): remove unnecessary tsconfig ignore | 5b68365fce
Espen Hovlandsdal | fix(cli): reject with an error when trying to reach dev server | 2450e5631e
Snorre Eskeland Brekke | * fix: form state now correctly updates members when hidden state changes (#3719) | ea48fa3159
Herman Wikner | feat(sanity): add components API | e9b09b4e0b
Herman Wikner | feat(sanity): update input, field, item and preview types with `renderDefault` | 865c27ee0c
Herman Wikner | refactor(sanity): remove `schemaType` from `RenderPreviewCallback` type (added to `PreviewProps`) | 9f5ec39970
Herman Wikner | feat(sanity): use middleware components in `StudioNavbar` | 4b37654de1
Herman Wikner | feat(sanity): use middleware components in `NavDrawer` | c22906f108
Herman Wikner | feat(sanity): use middleware components in `StudioLayout` | db3751eab5
Herman Wikner | feat(sanity): use middleware components in `Studio` | 36ddbc558a
Herman Wikner | feat(sanity): use middleware components in `FormProvider` | 99e89d0546
Herman Wikner | refactor(sanity): omit `renderDefault` from components | 0455b03f5b
Herman Wikner | feat(sanity): add `renderItem` to `ArrayInput` | 0f27c41c6c
Herman Wikner | feat(sanity): add `renderItem` to `ArrayOfPrimitivesInput` | 037cc28bac
Herman Wikner | feat(sanity): improve `SanityPreview` to work with the components API | 00ad73a965
Herman Wikner | refactor(sanity): add test id:s to form components | 60aa8935da
Herman Wikner | test(sanity): pass noop `renderDefault` to form input tests | 279ce8d3e0
Herman Wikner | test(sanity): add components API tests | 6f4165328d
Herman Wikner | dev(sanity): update workshop stories with components API | 287b20dfb2
Herman Wikner | refactor(types): update components typings | 85a8f103d7
Herman Wikner | dev(test-studio): add components API schema and plugins + update `sanity.config` | 0a7ce76758
Herman Wikner | test(sanity): update `FormBuilder` test | 088612e516
Herman Wikner | refactor(sanity): update form and config typings to work with components API | e885e447ea
Fred Carlsen | fix(sanity): fix controls for custom block components preview (#3722) | 0cfd150bb0
Bjørge Næss | fix(sanity): upgrade json-reduce to 3.0 | f711cb4df
Bjørge Næss | chore(sanity): replace useId from @reach/auto-id with useId from react | b7f36cfb2
Espen Hovlandsdal | chore: drop dev-preview peer dependencies | f6f5801cd
Espen Hovlandsdal | chore: use forked react-sortable-hoc with react 18 peer compat | 7f4255ace
Espen Hovlandsdal | test(cli): include desk tool in v3 test fixture | 5981d8a5f
Marius Lundgård | build: update `@sanity/pkg-utils` | 328c0da4d
Marius Lundgård | chore(deps): update dependencies | e1e9c8ce3
Per-Kristian Nordnes | fix(form): prevent default event on click space to activate | bb29189b7
Marius Lundgård | chore(deps): update dependencies | 74dcc24ae
Marius Lundgård | chore: clean `dev` projects | 4d8f772f7
Per-Kristian Nordnes | fix(desk): don't call handleChange if documentPane isn't ready yet | 8b04f2154
Per-Kristian Nordnes | Revert "fix(form): Fix React 18 issue with PT-input" | 6c5936bc8
Cody Olsen | chore(test-studio): re-enable mux plugin | 7b0673ebd
Cody Olsen | fix: hook factory strict mode errors (#3730) | e3eac1206