Minor Changes
-
collaboration: accept comment
anchor, deprecaterange(#1346) (4ce6968)Create and update now take a typed
anchor(type: "portable-text"with optionalfieldValueon the anchor). Deprecatedrange+ top-levelfieldValue(andrange: null) are still accepted and sent asanchor. -
export
getCommentTargetDocumentReffrom@sanity/client/collaboration(#1343) (71d414a)Builds the global document reference a collaboration comment stores in
target.document._reffrom a resource and a document ID, with no client involved.client.collaboration.comments.getTargetDocumentRefis unchanged and now calls it, reading the resource off the client's configuration.Until now the reference could only be built through a client instance, which meant code that needs it somewhere a client should not be fetched or created, such as a state selector, had to reach for one anyway. Pass the same value
ClientConfig['resource']takes, for example{type: 'dataset', id: 'abc123.production'}.import { getCommentTargetDocumentRef } from "@sanity/client/collaboration"; getCommentTargetDocumentRef( { type: "dataset", id: "abc123.production" }, "drafts.doc-1" ); // 'dataset:abc123.production:doc-1'
-
collaboration: send clientVersion on comment writes (#1347) (da15b5e)
-
update client.context types to the latest Context API (#1348) (69ccdd4)