@sanity/client 7.8.0 → 7.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2122,27 +2122,32 @@ with `operation: {type: 'image-description'}`.
2122
2122
  Custom instructions for image description targets will be used to generate the description.
2123
2123
 
2124
2124
  ###### Targeting image fields
2125
+
2125
2126
  If a target is a descendant field of an image object, no `sourcePath` is required in the operation:
2126
2127
 
2127
2128
  For example:
2129
+
2128
2130
  - `target: {path: ['image', 'description'], operation: {type: 'image-description'} }`
2129
2131
  - `target: {path: ['array', {_key: 'abc'}, 'alt'], operation: {type: 'image-description'} } //assuming the item in the array on the key-ed path is an image`
2130
2132
  - `target: {path: ['image'], include: ['portableTextField'], operation: {type: 'image-description'}, instruction: 'Use formatting and headings to describe the image in great detail' }`
2131
2133
 
2132
2134
  ###### Targeting non-image fields
2135
+
2133
2136
  If the target image description lives outside an image object, use the `sourcePath` option to specify the path to the image field.
2134
2137
  `sourcePath` must be an image or image asset field.
2135
2138
 
2136
2139
  For example:
2140
+
2137
2141
  - `target: {path: ['description'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }`
2138
2142
  - `target: {path: ['wrapper', 'title'], operation: {type: 'image-description', sourcePath: ['array', {_key: 'abc'}, 'image'] }`
2139
2143
  - `target: {path: ['wrapper'], include: ['portableTextField'], operation: {type: 'image-description', sourcePath: ['image', 'asset'] }, instruction: 'Use formatting and headings to describe the image in great detail' }`
2140
2144
 
2141
-
2142
2145
  ###### Targeting images outside the document (URL)
2146
+
2143
2147
  If the source image is available on a https URL outside the target document, it is possible to get a description for it using `imageUrl`.
2144
2148
 
2145
2149
  Example:
2150
+
2146
2151
  - `target: {path: ['description'], operation: operation: {type: 'image-description', imageUrL: 'https://www.sanity.io/static/images/favicons/android-icon-192x192.png?v=2' }`
2147
2152
 
2148
2153
  ##### Example: Field-based transformation