@sanity/presentation
Advanced tools
Comparing version 1.6.1 to 1.7.0
# Changelog | ||
## [1.7.0](https://github.com/sanity-io/visual-editing/compare/presentation-v1.6.1...presentation-v1.7.0) (2024-01-22) | ||
### Features | ||
* **presentation:** support create intent and document navigation ([#731](https://github.com/sanity-io/visual-editing/issues/731)) ([1579971](https://github.com/sanity-io/visual-editing/commit/157997105bf461e332a21972ee1853220db09f73)) | ||
## [1.6.1](https://github.com/sanity-io/visual-editing/compare/presentation-v1.6.0...presentation-v1.6.1) (2024-01-19) | ||
@@ -5,0 +12,0 @@ |
@@ -79,3 +79,9 @@ /// <reference types="react" /> | ||
export declare type PresentationNavigateContextValue = (preview: string) => void | ||
export declare type PresentationNavigateContextValue = ( | ||
preview: string | undefined, | ||
document?: { | ||
type: string | ||
id: string | ||
}, | ||
) => void | ||
@@ -82,0 +88,0 @@ export declare interface PresentationParams |
@@ -1,1 +0,1 @@ | ||
export{p as presentationTool,u as usePresentationNavigate,e as usePresentationParams}from"./_chunks/index-nfty5GbG.js";//# sourceMappingURL=index.js.map | ||
export{p as presentationTool,u as usePresentationNavigate,e as usePresentationParams}from"./_chunks/index-Ku2cP-pD.js";//# sourceMappingURL=index.js.map |
{ | ||
"name": "@sanity/presentation", | ||
"version": "1.6.1", | ||
"version": "1.7.0", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/presentation#readme", | ||
@@ -110,2 +110,3 @@ "bugs": { | ||
"@sanity/preview-url-secret": "^1.5.3", | ||
"@sanity/uuid": "3.0.2", | ||
"@types/lodash.isequal": "^4.5.8", | ||
@@ -126,3 +127,3 @@ "fast-deep-equal": "3.1.3", | ||
"@sanity/visual-editing-helpers": "0.2.4", | ||
"happy-dom": "^13.1.4", | ||
"happy-dom": "^13.2.1", | ||
"react": "^18.2.0", | ||
@@ -129,0 +130,0 @@ "react-dom": "^18.2.0", |
@@ -0,1 +1,2 @@ | ||
import { uuid } from '@sanity/uuid' | ||
import { getPublishedId } from 'sanity' | ||
@@ -27,3 +28,11 @@ import { SearchParam } from 'sanity/router' | ||
} | ||
if (intent === 'create') { | ||
searchParams.preview = searchParams.preview || '/' | ||
return { | ||
type: type || '*', | ||
id: id || uuid(), | ||
_searchParams: Object.entries(searchParams), | ||
} | ||
} | ||
return { intent, params, payload } | ||
} |
import { createContext } from 'react' | ||
export type PresentationNavigateContextValue = (preview: string) => void | ||
export type PresentationNavigateContextValue = ( | ||
preview: string | undefined, | ||
document?: { type: string; id: string }, | ||
) => void | ||
export const PresentationNavigateContext = | ||
createContext<PresentationNavigateContextValue | null>(null) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
802753
6041
12
+ Added@sanity/uuid@3.0.2