Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@sanity/overlays

sanity-io5.5kMITdeprecated2.3.59TypeScript support: included

migrate to @sanity/visual-editing

npm stat [npm version](https://www.npmjs.com/pack

sanity.io, visual-editing, presentation, preview

readme

@sanity/overlays — Visual Editing

npm stat npm version gzip size size

[!WARNING]
This package is replaced by @sanity/visual-editing.

Migrate to @sanity/visual-editing

Replace the dependency:

npm uninstall @sanity/overlays
npm install @sanity/visual-editing

Replace import statements:

-import { enableOverlays, type DisableOverlays } from '@sanity/overlays'
+import { enableVisualEditing, type DisableVisualEditing } from '@sanity/visual-editing'

[!NOTE]
Note that there's now a built-in <VisualEditing> component for Next.js App Router in next-sanity, and for Next.js Pages Router in @sanity/visual-editing/next-pages-router, and for Remix in @sanity/visual-editing/remix.

changelog

📓 Changelog

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.0.1 to 1.1.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.1.0 to 1.2.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.2.0 to 1.2.1

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.2.1 to 1.2.2

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.2.2 to 1.3.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.3.1 to 1.4.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.4.0 to 1.5.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.5.0 to 1.5.1

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.5.1 to 1.5.2

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.5.2 to 1.6.0

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.7.0 to 1.7.1

2.3.59 (2024-08-12)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped to 2.1.9

2.3.58 (2024-08-05)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.7 to 2.1.8

2.3.57 (2024-08-02)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.6 to 2.1.7

2.3.56 (2024-07-03)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.5 to 2.1.6

2.3.55 (2024-06-13)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.4 to 2.1.5

2.3.54 (2024-06-07)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.3 to 2.1.4

2.3.53 (2024-05-30)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.2 to 2.1.3

2.3.52 (2024-05-29)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.1 to 2.1.2

2.3.51 (2024-05-29)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.1.0 to 2.1.1

2.3.50 (2024-05-28)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 2.0.0 to 2.1.0

2.3.49 (2024-05-28)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.22 to 2.0.0

2.3.48 (2024-05-27)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.21 to 1.8.22

2.3.47 (2024-05-15)

Bug Fixes

  • improve lazy loading of enableVisualEditing (#1528) (2f83a85)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped to 1.8.21

2.3.46 (2024-05-15)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.19 to 1.8.20

2.3.45 (2024-05-13)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.18 to 1.8.19

2.3.44 (2024-05-05)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.17 to 1.8.18

2.3.43 (2024-05-02)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.16 to 1.8.17

2.3.42 (2024-04-26)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.15 to 1.8.16

2.3.41 (2024-04-22)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.14 to 1.8.15

2.3.40 (2024-04-19)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.13 to 1.8.14

2.3.39 (2024-04-19)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.12 to 1.8.13

2.3.38 (2024-04-17)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.11 to 1.8.12

2.3.37 (2024-04-17)

Bug Fixes

  • inline async-cache-dedupe to improve ESM interop (cb53fbd)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.10 to 1.8.11

2.3.36 (2024-04-16)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.9 to 1.8.10

2.3.35 (2024-04-16)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.8 to 1.8.9

2.3.34 (2024-04-11)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.7 to 1.8.8

2.3.33 (2024-04-05)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.6 to 1.8.7

2.3.32 (2024-04-05)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.5 to 1.8.6

2.3.31 (2024-04-02)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.4 to 1.8.5

2.3.30 (2024-03-21)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.3 to 1.8.4

2.3.29 (2024-03-20)

Bug Fixes

  • ship TS Node16 compatible typings (a21794d)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.2 to 1.8.3

2.3.28 (2024-03-18)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.1 to 1.8.2

2.3.27 (2024-03-15)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.8.0 to 1.8.1

2.3.26 (2024-03-15)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.7.1 to 1.8.0

2.3.24 (2024-03-07)

Bug Fixes

  • don't render overlays if the Vercel Toolbar is present (#1075) (296e1c7)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped to 1.7.0

2.3.23 (2024-03-06)

Bug Fixes

  • docs: fixed typo and added reference to <VisualEditing> (#1061) (13ff98c)

2.3.17 (2024-02-16)

Bug Fixes

  • console warn about deprecation (3c0d1e5)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped from 1.3.0 to 1.3.1

2.3.11 (2024-02-05)

Bug Fixes

  • rename @sanity/overlays to @sanity/visual-editing (#834) (1d28908)

Dependencies

  • The following workspace dependencies were updated
    • dependencies
      • @sanity/visual-editing bumped to 1.0.1

2.3.10 (2024-02-05)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing bumped to 1.0.0

2.3.9 (2024-01-29)

Bug Fixes

  • deps: Update dependency @floating-ui/react-dom to v2.0.8 (#784) (2427ad3)
  • deps: update dependency @sanity/client to ^6.12.3 (#787) (634d8a3)
  • improve bundling (#790) (33fd712)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.2.5 to 0.2.6

2.3.8 (2024-01-26)

Bug Fixes

  • deps: Update dependency @floating-ui/react-dom to v2.0.7 (#767) (2beacd8)
  • deps: update dependency @sanity/client to ^6.11.2 (#745) (7f24dd6)
  • deps: update dependency @sanity/client to ^6.11.3 (#755) (148ce5a)
  • deps: update dependency @sanity/client to ^6.12.1 (#774) (4ba2074)
  • overlays: prevent overlay controller duplication (dfdb578)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.2.4 to 0.2.5

2.3.7 (2024-01-19)

Bug Fixes

  • deps: Update dependency @floating-ui/react-dom to v2.0.6 (#723) (8694caf)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.2.3 to 0.2.4

2.3.6 (2024-01-16)

Bug Fixes

  • deps: Update dependency @sanity/color to v3.0.0 (#688) (5eca472)
  • overlays: prevent incorrect element positioning in rtl layouts (b105aa0)

2.3.5 (2024-01-10)

Bug Fixes

  • deps: update dependency @sanity/client to ^6.11.1 (#666) (487d552)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.2.2 to 0.2.3

2.3.4 (2024-01-10)

Bug Fixes

  • deps: Update dependency @sanity/ui to v2.0.0-beta.17 (#656) (be117bb)

2.3.3 (2024-01-10)

Bug Fixes

  • deps: update dependency @sanity/client to ^6.11.0 (#649) (b94f848)
  • deps: Update dependency @sanity/ui to v2.0.0-beta.16 (#647) (350d5e9)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/channels bumped from 0.3.0 to 0.4.0
      • @sanity/visual-editing-helpers bumped from 0.2.1 to 0.2.2

2.3.2 (2024-01-05)

Bug Fixes

  • deps: Update dependency @sanity/ui to v2.0.0-beta.15 (#625) (3ac44bc)

2.3.1 (2024-01-04)

Bug Fixes

  • deps: Update dependency @sanity/ui to v2.0.0-beta.14 (#604) (67fa54a)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.2.0 to 0.2.1

2.3.0 (2023-12-19)

Features

  • deps: update sanity to ^3.23.0, update @sanity/ui to 2.0.0-beta.13 (9ea150d)

Bug Fixes

  • deps: update @sanity/color to 3.0.0-beta.9 (0eb257d)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.1.4 to 0.2.0

2.2.1 (2023-12-13)

Bug Fixes

  • deps: Update dependency @sanity/icons to v2.8.0 (#564) (074d186)

2.2.0 (2023-12-12)

Features

  • channels: simplify implementation and API (#542) (4854e7f)

Bug Fixes

  • deprecate allowStudioOrigin, as it's no longer needed (7ad52a0)
  • deps: update dependency @sanity/client to ^6.10.0 (#551) (5dc24c9)

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/channels bumped from 0.1.0 to 0.2.0
      • @sanity/visual-editing-helpers bumped from 0.1.3 to 0.1.4

2.1.4 (2023-12-07)

Bug Fixes

Dependencies

  • The following workspace dependencies were updated
    • devDependencies
      • @sanity/visual-editing-helpers bumped from 0.1.1 to 0.1.2

2.1.3 (2023-12-07)

Bug Fixes

  • deps: declared used dependencies (5e2d993)

2.1.0 (2023-12-05)

Features

Bug Fixes

  • types: add missing exports (fd52637)

2.0.4 (2023-11-29)

Bug Fixes

  • deps: update dependency @sanity/client to ^6.9.0 (#434) (c7c8ec5)
  • deps: update dependency @sanity/client to ^6.9.1 (#437) (6974b0d)

2.0.3 (2023-11-27)

Bug Fixes

  • overlays: only render overlays in iframe if channel is connected (#411) (1aa40fc)

2.0.2 (2023-11-21)

Bug Fixes

  • overlays: use getComputedStyle over computedStyleMap (#412) (63398e4)

2.0.1 (2023-11-16)

Bug Fixes

  • deps: update dependency @sanity/client to ^6.8.6 (#374) (f62967a)

2.0.0 (2023-11-15)

Features

2.3.4-pink-lizard (2023-11-15)

Bug Fixes

  • overlays: add mode=presentation to intent links (a838cd8)

2.3.3-pink-lizard (2023-11-13)

Bug Fixes

  • click-to-edit links in overlays pass in preview params of the current page (d90ec9e)
  • deps: Update dependency @sanity/client to ^6.8.4 (5dbbe06)
  • deps: Update dependency @sanity/client to ^6.8.5 (#361) (e8e61c1)
  • deps: Update dependency @sanity/ui to ^1.9.3 (#355) (e10f6a7)
  • make allowStudioOrigin required (700e140)
  • use createEditUrl from @sanity/client (e83bb2b)

2.3.2-pink-lizard (2023-11-11)

Bug Fixes

  • deps: Update dependency @sanity/ui to ^1.9.2 (#335) (5b17c77)

2.3.1-pink-lizard (2023-11-10)

Bug Fixes

  • presentation: prevent iframe from taking focus (fbd02fd)
  • presentation: prevent scrolling when array items close (da2ad22)
  • remove initial url sender (badda86)
  • send initial URL on load (3caf2e3)
  • types: add HistoryAdapterNavigate exported type (7e8340f)

2.3.0-pink-lizard (2023-11-09)

Features

  • overlays: toggle overlay using mod key (#228) (60484e1)

Bug Fixes

  • presentation: complete keyboard implementation (a931b1b)

2.2.1-pink-lizard (2023-11-08)

Bug Fixes

  • use studioPath utils from @sanity/client/csm (a804364)

2.2.0-pink-lizard (2023-11-08)

⚠ BREAKING CHANGES

  • lazy load live mode (#281)
  • renamed studioUrl to allowStudioOriginto clarify it's CORS related

Bug Fixes

  • lazy load live mode (#281) (e52991c)
  • renamed studioUrl to allowStudioOriginto clarify it's CORS related (589a7c2)

2.1.2-pink-lizard (2023-11-07)

Bug Fixes

  • deps: Update dependency @sanity/ui to ^1.9.0 (#274) (4b971e3)

2.1.1-pink-lizard (2023-11-04)

Bug Fixes

  • scroll into view if needed (dfbbdbb)

2.1.0-pink-lizard (2023-11-04)

Features

  • use the new @sanity/client/stega features (#252) (fa08bb2)

Bug Fixes

  • handle stega nodes in a way that supports focus (#254) (dce801f)

2.0.2-pink-lizard (2023-11-03)

Bug Fixes

  • overlays: flash overlays when mounting (6a9a86d)

2.0.1-pink-lizard (2023-11-02)

Bug Fixes

  • attempt bundling @sanity/ui and styled-components for hydrogen compat (b39f58a)
  • CHANGELOG: restore continuity (c9f19cd)
  • don't bundle uuid (6e11ca5)

2.0.0-pink-lizard (2023-11-02)

Bug Fixes

  • README: add badges and links (0fcf516)

0.1.16-pink-lizard (2023-11-02)

Bug Fixes

  • bundle valibot (6b07f06)
  • move peer deps to regular deps (91489dc)
  • remove unused @sanity/icons package (09c1954)
  • remove unused dep history (9fb2447)

0.1.15-pink-lizard (2023-11-02)

Bug Fixes

  • remove sanity peer dep (30ff225)
  • remove unused nanoid dependency (142b3dd)

0.1.14-pink-lizard (2023-11-02)

Bug Fixes

0.1.13-pink-lizard (2023-11-02)

Bug Fixes

  • always bundle private packages (6be3f74)
  • deps: Update sanity monorepo to v3.18.2-pink-lizard.172 (#233) (c5e6c5d)
  • load src directly (94308f0)
  • move @sanity/csm into visual-editing-helpers (257a4ad)
  • overlays: improve element detection in mutation handler (eda5fbd)
  • prepare release (f2ce9cb)

0.1.12-pink-lizard (2023-10-31)

Bug Fixes

  • deps: Update dependency valibot to ^0.20.0 (#211) (8fe3fc1)

0.1.11-pink-lizard (2023-10-27)

Bug Fixes

  • deps: Update sanity monorepo to v3.18.2-pink-lizard.162 (#197) (6d962b1)
  • refactor: composer to pages (#202) (e46f475)

0.1.10-pink-lizard (2023-10-25)

Bug Fixes

  • deps: upgrade @sanity/pkg-utils (9236c86)

0.1.9-pink-lizard (2023-10-24)

Bug Fixes

  • temp disable minify for debugging (93265ae)

0.1.8-pink-lizard (2023-10-24)

Bug Fixes

0.1.7-pink-lizard (2023-10-24)

Bug Fixes

  • overlays: initialise observers on activate method (475b4bf)

0.1.6-pink-lizard (2023-10-23)

Bug Fixes

  • disable minification to ease debugging (666f8e0)

0.1.5-pink-lizard (2023-10-23)

Bug Fixes

  • generate typings from bundled packages (8201fa7)

0.1.4-pink-lizard (2023-10-23)

Bug Fixes

  • deps: Update dependency @sanity/ui to ^1.8.3 (#171) (7612ac4)
  • remove debug console loggers (84f4b1d)

0.1.3-pink-lizard (2023-10-23)

Bug Fixes

  • deps: update sanity monorepo (#166) (2f6232f)
  • pink-lizard: remove unnecessary suffix (c7409aa)

0.1.2-pink-lizard.0 (2023-10-19)

Bug Fixes

  • overlays: calculate rect on element scroll (70101f8)

0.1.1-pink-lizard.0 (2023-10-19)

Bug Fixes

  • include CHANGELOG.md files in private packages (9967f1c)

1.0.6 (2023-09-12)

Bug Fixes

  • overlays not always rendering as top item or clickable (#32) (8d905a1)

1.0.5 (2023-09-05)

Bug Fixes

  • deps: update dependency @floating-ui/react-dom to ^2.0.2 (#12) (0132187)
  • deps: Update dependency @sanity/ui to ^1.8.2 (#13) (2c0a38c)
  • deps: Update dependency react-intersection-observer to ^9.5.2 (#14) (ccf55e7)
  • deps: update dependency styled-components to ^5.3.11 (#15) (532f436)
  • prevent multiple instantiations (#28) (6f6e8ee)
  • reenable mutationObserver cleanup (#27) (c634dbf)

1.0.4 (2023-09-04)

Bug Fixes

1.0.3 (2023-07-20)

Bug Fixes

  • deps: use @vercel/stega 0.1.0 (0f26889)

1.0.2 (2023-07-13)

Bug Fixes

  • deps: update non-major (#3) (cc9251b)
  • prevent opening edit links twice (f60c29e)

1.0.1 (2023-07-05)

Bug Fixes

  • docs: visual editing doc link (ee97f2b)

1.0.0 (2023-07-05)

Features