🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More
Socket
Book a DemoSign in
Socket

@sanity/visual-editing

Package Overview
Dependencies
Maintainers
112
Versions
300
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/visual-editing - npm Package Compare versions

Comparing version
5.3.2
to
5.3.3
+3
-3
package.json
{
"name": "@sanity/visual-editing",
"version": "5.3.2",
"version": "5.3.3",
"keywords": [

@@ -64,5 +64,5 @@ "overlays",

"xstate": "^5.26.0",
"@sanity/preview-url-secret": "^4.0.4",
"@sanity/insert-menu": "^3.0.4",
"@sanity/visual-editing-csm": "^3.0.6"
"@sanity/visual-editing-csm": "^3.0.6",
"@sanity/preview-url-secret": "^4.0.4"
},

@@ -69,0 +69,0 @@ "devDependencies": {

@@ -232,3 +232,3 @@ import type {ClientPerspective} from '@sanity/client'

isDragging: false,
perspective: null,
perspective: 'published',
wasMaybeCollapsed: false,

@@ -257,13 +257,6 @@ dragMinimapTransition: false,

usePerspectiveSync(comlink, dispatch)
usePerspectiveSync(comlink, dispatch, onPerspectiveChange)
useEffect(() => {
if (!onPerspectiveChange || perspective === null) return undefined
useReportDocuments(comlink, elements, perspective)
const raf = requestAnimationFrame(() => startTransition(() => onPerspectiveChange(perspective)))
return () => cancelAnimationFrame(raf)
}, [onPerspectiveChange, perspective])
useReportDocuments(comlink, elements, perspective ?? 'published')
const updateDragPreviewCustomProps = useCallback(

@@ -471,3 +464,3 @@ (x: number, y: number) => {

>
<DocumentReporter documentIds={documentIds} perspective={perspective ?? 'published'} />
<DocumentReporter documentIds={documentIds} perspective={perspective} />
<OverlaysController

@@ -474,0 +467,0 @@ comlink={comlink}

@@ -25,3 +25,3 @@ import type {ClientPerspective} from '@sanity/client'

wasMaybeCollapsed: boolean
perspective: ClientPerspective | null
perspective: ClientPerspective
isDragging: boolean

@@ -28,0 +28,0 @@ dragInsertPosition: DragInsertPosition

import type {VisualEditingControllerMsg} from '@sanity/presentation-comlink'
import {useEffect} from 'react'
import {useEffect, useEffectEvent} from 'react'
import type {OverlayMsg, VisualEditingNode} from '../types'
import type { ClientPerspective } from '@sanity/client'

@@ -10,3 +11,8 @@ export function usePerspectiveSync(

dispatch: (value: OverlayMsg | VisualEditingControllerMsg) => void,
onPerspectiveChange?: (perspective: ClientPerspective) => void,
): void {
const handlePerspective = useEffectEvent((data: {perspective: ClientPerspective}) => {
dispatch({type: 'presentation/perspective', data})
onPerspectiveChange?.(data.perspective)
})
useEffect(() => {

@@ -20,3 +26,3 @@ const controller = new AbortController()

.then((data) => {
dispatch({type: 'presentation/perspective', data})
handlePerspective(data)
})

@@ -29,3 +35,3 @@ .catch(() => {

const unsub = comlink?.on('presentation/perspective', (data) => {
dispatch({type: 'presentation/perspective', data})
handlePerspective(data)
})

@@ -32,0 +38,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display