@sanity/assist 1.1.0 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/assist",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "sanity",
@@ -119,13 +119,13 @@ export const assistFieldActions: DocumentFieldAction = {
119
119
  )
120
120
 
121
121
  const runInstructionsGroup = useMemo(() => {
122
- return instructions?.length
122
+ return instructions?.length || imageCaptionAction
123
123
  ? node({
124
124
  type: 'group',
125
125
  icon: () => null,
126
126
  title: 'Run instructions',
127
127
  children: [
128
- ...instructions.map((instruction) =>
128
+ ...instructions?.map((instruction) =>
129
129
  instructionItem({
130
130
  instruction,
131
131
  isPrivate: Boolean(instruction.userId && instruction.userId === currentUser?.id),
@@ -170,28 +170,19 @@ export const assistFieldActions: DocumentFieldAction = {
170
170
  type: 'group',
171
171
  icon: SparklesIcon,
172
172
  title: pluginTitleShort,
173
- children: [
174
- runInstructionsGroup,
175
- /* documentIsNew && {
176
- type: 'action',
177
- disabled: true,
178
- title: `Document is new. Make an edit to enable `,
179
- icon: WarningOutlineIcon,
180
- tone: 'caution',
181
- status: 'warning',
182
- onAction: () => {},
183
- },*/
184
- manageInstructionsItem,
185
- ].filter((c): c is DocumentFieldActionItem | DocumentFieldActionGroup => !!c),
173
+ children: [runInstructionsGroup, assistSupported && manageInstructionsItem].filter(
174
+ (c): c is DocumentFieldActionItem | DocumentFieldActionGroup => !!c
175
+ ),
186
176
  expanded: false,
187
177
  renderAsButton: true,
188
- hidden: !assistSupported,
178
+ hidden: !assistSupported && !imageCaptionAction,
189
179
  }),
190
180
  [
191
181
  //documentIsNew,
192
182
  runInstructionsGroup,
193
183
  manageInstructionsItem,
194
184
  assistSupported,
185
+ imageCaptionAction,
195
186
  ]
196
187
  )
197
188