@sanity/visual-editing-csm
Advanced tools
Comparing version 1.0.1 to 2.0.0
# Changelog | ||
## [2.0.0](https://github.com/sanity-io/visual-editing/compare/visual-editing-csm-v1.0.1...visual-editing-csm-v2.0.0) (2025-01-22) | ||
### ⚠ BREAKING CHANGES | ||
* remove `DRAFTS_PREFIX` export ([#2542](https://github.com/sanity-io/visual-editing/issues/2542)) | ||
### Bug Fixes | ||
* remove `DRAFTS_PREFIX` export ([#2542](https://github.com/sanity-io/visual-editing/issues/2542)) ([7d463c3](https://github.com/sanity-io/visual-editing/commit/7d463c3ac38db060696da24c94990f85a85802cd)) | ||
* use new `@sanity/client/csm` utils ([#2540](https://github.com/sanity-io/visual-editing/issues/2540)) ([e9ec432](https://github.com/sanity-io/visual-editing/commit/e9ec4329926172cf5af8953dcdf78cbe6b3348ff)) | ||
### Dependencies | ||
* The following workspace dependencies were updated | ||
* dependencies | ||
* @sanity/visual-editing-types bumped to 1.0.2 | ||
## [1.0.1](https://github.com/sanity-io/visual-editing/compare/visual-editing-csm-v1.0.0...visual-editing-csm-v1.0.1) (2025-01-21) | ||
@@ -4,0 +23,0 @@ |
@@ -86,4 +86,2 @@ import type {Path} from '@sanity/client/csm' | ||
export declare const DRAFTS_PREFIX = 'drafts.' | ||
/** | ||
@@ -90,0 +88,0 @@ * Transforms sanity node data into an encoded string |
@@ -1,4 +0,4 @@ | ||
import { getPublishedId, studioPath } from "@sanity/client/csm"; | ||
import { getPublishedId, studioPath, isDraftId } from "@sanity/client/csm"; | ||
import { pipe, string, minLength, optional, object, is, record, unknown, safeParse, parse } from "valibot"; | ||
const DRAFTS_PREFIX = "drafts.", lengthyStr$1 = pipe(string(), minLength(1)), optionalLengthyStr = optional(lengthyStr$1), sanityNodeSchema = object({ | ||
const lengthyStr$1 = pipe(string(), minLength(1)), optionalLengthyStr = optional(lengthyStr$1), sanityNodeSchema = object({ | ||
baseUrl: lengthyStr$1, | ||
@@ -51,3 +51,3 @@ dataset: optionalLengthyStr, | ||
["tool", tool], | ||
["isDraft", _id.startsWith(DRAFTS_PREFIX)] | ||
["isDraft", isDraftId(_id)] | ||
].filter(([, value]) => !!value).map((part) => { | ||
@@ -188,3 +188,2 @@ const [key, value] = part; | ||
export { | ||
DRAFTS_PREFIX, | ||
createDataAttribute, | ||
@@ -191,0 +190,0 @@ decodeSanityNodeData, |
{ | ||
"name": "@sanity/visual-editing-csm", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"homepage": "https://github.com/sanity-io/visual-editing/tree/main/packages/visual-editing-csm#readme", | ||
@@ -44,6 +44,6 @@ "bugs": { | ||
"valibot": "0.31.1", | ||
"@sanity/visual-editing-types": "^1.0.1" | ||
"@sanity/visual-editing-types": "^1.0.2" | ||
}, | ||
"devDependencies": { | ||
"@sanity/client": "^6.25.0", | ||
"@sanity/client": "^6.26.0", | ||
"@sanity/pkg-utils": "6.13.4", | ||
@@ -53,7 +53,7 @@ "eslint": "^8.57.1", | ||
"vitest": "^3.0.2", | ||
"@repo/package.config": "0.0.0", | ||
"@repo/eslint-config": "0.0.0" | ||
"@repo/eslint-config": "0.0.0", | ||
"@repo/package.config": "0.0.0" | ||
}, | ||
"peerDependencies": { | ||
"@sanity/client": "^6.25.0" | ||
"@sanity/client": "^6.26.0" | ||
}, | ||
@@ -60,0 +60,0 @@ "engines": { |
@@ -1,4 +0,3 @@ | ||
import {getPublishedId, studioPath} from '@sanity/client/csm' | ||
import {getPublishedId, isDraftId, studioPath} from '@sanity/client/csm' | ||
import type {SanityNode} from '@sanity/visual-editing-types' | ||
import {DRAFTS_PREFIX} from './constants' | ||
import {isValidSanityNode} from './isValidSanityNode' | ||
@@ -27,3 +26,3 @@ import {pathToUrlString} from './pathToUrlString' | ||
['tool', tool], | ||
['isDraft', _id.startsWith(DRAFTS_PREFIX)], | ||
['isDraft', isDraftId(_id)], | ||
] | ||
@@ -30,0 +29,0 @@ |
@@ -10,4 +10,3 @@ export { | ||
export {decodeSanityNodeData} from './decodeSanityNodeData' | ||
export {DRAFTS_PREFIX} from './constants' | ||
export {pathToUrlString} from './pathToUrlString' | ||
export type {SanityNode, SanityStegaNode} from '@sanity/visual-editing-types' |
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
67242
19
842