
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@sanity/overlays
Advanced tools
[](https://npm-stat.com/charts.html?package=@sanity/overlays) [](https://www.np
Warning
This is an experimental package. Breaking changes may be introduced at any time. It's not production ready.
Install the package along with either @sanity/react-loader
, @sanity/nuxt-loader
, @sanity/svelte-loader
or @sanity/core-loader
depending on your project.
The other peer dependencies are required and will be loaded asynchronously when Visual Editing is enabled.
# For React.js applications
npm install --save-exact @sanity/overlays@pink-lizard @sanity/react-loader@pink-lizard
# Framework agnostic JavaScript libraries
npm install --save-exact @sanity/overlays@pink-lizard @sanity/core-loader@pink-lizard
TODO, link to the docs for each loader
TODO, how to set the data-sanity
attributes
Ensure the overlay is only enabled in non-production environments.
import { enableOverlays } from '@sanity/overlays'
const disable = enableOverlays() // Enables Visual Editing overlay
disable() // Disables Visual Editing overlay
In React you could enable the feature in a useEffect()
hook, where disable()
will run on unmount:
import { enableOverlays } from '@sanity/overlays'
useEffect(enableOverlays, [])
When enabled, you should see clickable "Edit in Sanity Studio" buttons for every element which contains encoded metadata from Content Source Maps.
data-sanity-edit-target
You can choose which element to render the "Edit in Sanity Studio" buttons on by adding a data-sanity-edit-target
attribute to the element you want to be clickable. This allows you to move the edit container to a parent wrapper element.
In this example, by default the edit button would be placed on the <h1>
tag
<section>
<h1>{dynamicTitle}</h1>
<div>Hardcoded Tagline</div>
</section>
But by adding the data-sanity-edit-target
attribute to the <section>
tag, the edit button will be placed on it instead.
<section data-sanity-edit-target>
<h1>{dynamicTitle}</h1>
<div>Hardcoded Tagline</div>
</section>
Manually setting the edit target will use the first element it finds with encoded metadata and remove clickable buttons from all other child elements.
Docs on how to use the new stega enhanced client in @sanity/client/stega
which replaces @sanity/preview-kit/client
.
A note on usage that's compatible with Vercel.
FAQs
[](https://npm-stat.com/charts.html?package=@sanity/overlays) [](https://www.npmjs.com/pack
The npm package @sanity/overlays receives a total of 1,225 weekly downloads. As such, @sanity/overlays popularity was classified as popular.
We found that @sanity/overlays demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.