npm @sanity/client 8.8.0
v8.8.0

6 hours ago

Minor Changes

  • collaboration: accept comment anchor, deprecate range (#1346) (4ce6968)

    Create and update now take a typed anchor (type: "portable-text" with optional fieldValue on the anchor). Deprecated range + top-level fieldValue (and range: null) are still accepted and sent as anchor.

  • export getCommentTargetDocumentRef from @sanity/client/collaboration (#1343) (71d414a)

    Builds the global document reference a collaboration comment stores in target.document._ref from a resource and a document ID, with no client involved. client.collaboration.comments.getTargetDocumentRef is 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)

Don't miss a new client release

NewReleases is sending notifications on new releases.