Socket
Socket
Sign inDemoInstall

@sanity/presentation

Package Overview
Dependencies
Maintainers
44
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/presentation - npm Package Compare versions

Comparing version 1.7.6 to 1.8.0

dist/_chunks/index-24umCWhM.cjs

7

CHANGELOG.md

@@ -9,2 +9,9 @@ <!-- markdownlint-disable --><!-- textlint-disable -->

## [1.8.0](https://github.com/sanity-io/visual-editing/compare/presentation-v1.7.6...presentation-v1.8.0) (2024-02-08)
### Features
* **presentation:** support parameterized templates ([#865](https://github.com/sanity-io/visual-editing/issues/865)) ([5708fad](https://github.com/sanity-io/visual-editing/commit/5708fad028d2bc45383432348edb159855c53566))
## [1.7.6](https://github.com/sanity-io/visual-editing/compare/presentation-v1.7.5...presentation-v1.7.6) (2024-02-05)

@@ -11,0 +18,0 @@

1

dist/index.d.ts

@@ -19,2 +19,3 @@ /// <reference types="react" />

template?: string
templateParams?: string
view?: string

@@ -21,0 +22,0 @@ pathKey?: string

2

dist/index.js

@@ -1,1 +0,1 @@

export{p as presentationTool,u as usePresentationNavigate,e as usePresentationParams}from"./_chunks/index-nopaM92l.js";//# sourceMappingURL=index.js.map
export{p as presentationTool,u as usePresentationNavigate,e as usePresentationParams}from"./_chunks/index-xi90aNRZ.js";//# sourceMappingURL=index.js.map
{
"name": "@sanity/presentation",
"version": "1.7.6",
"version": "1.8.0",
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/presentation#readme",

@@ -120,3 +120,3 @@ "bugs": {

"@sanity/client": "^6.12.3",
"@sanity/pkg-utils": "^4.1.2",
"@sanity/pkg-utils": "^4.1.4",
"@sanity/ui": "2.0.1",

@@ -127,3 +127,3 @@ "@sanity/visual-editing-helpers": "0.2.6",

"react-dom": "^18.2.0",
"sanity": "^3.27.1",
"sanity": "^3.28.0",
"styled-components": "6.1.8",

@@ -130,0 +130,0 @@ "typescript": "^5.3.3",

import { uuid } from '@sanity/uuid'
import { getPublishedId } from 'sanity'
import { SearchParam } from 'sanity/router'
import { encodeJsonParams, SearchParam } from 'sanity/router'

@@ -35,2 +35,9 @@ import { PresentationStateParams } from './types'

'/'
if (payload && typeof payload === 'object') {
searchParams.templateParams = encodeJsonParams(
payload as Record<string, unknown>,
)
}
return {

@@ -37,0 +44,0 @@ type: type || '*',

@@ -8,4 +8,4 @@ import { route } from 'sanity/router'

route.intents('/intent'),
route.create('/:type', [route.create('/:id'), route.create('/:id/:path')]),
route.create(':type', [route.create(':id', [route.create(':path')])]),
],
)

@@ -75,2 +75,3 @@ import type { ClientPerspective, QueryParams } from '@sanity/client'

template?: string
templateParams?: string
view?: string

@@ -77,0 +78,0 @@

@@ -56,2 +56,3 @@ import { MutableRefObject, useEffect, useMemo, useRef } from 'react'

template: routerSearchParams.template,
templateParams: routerSearchParams.templateParams,
view: routerSearchParams.view,

@@ -73,2 +74,3 @@ // assist

template: params.template,
templateParams: params.templateParams,
view: params.view,

@@ -83,11 +85,12 @@ // assist

}, [
params.comment,
params.inspect,
params.instruction,
params.path,
params.pathKey,
params.rev,
params.since,
params.template,
params.templateParams,
params.view,
params.pathKey,
params.instruction,
params.comment,
])

@@ -129,2 +132,8 @@

// If the document has changed, clear the template and templateParams
if (routerState.id !== state.id) {
delete searchState.template
delete searchState.templateParams
}
state._searchParams = Object.entries(searchState).reduce(

@@ -131,0 +140,0 @@ (acc, [key, value]) => [...acc, [key, value]],

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc