@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/dist/index.esm.js +6 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/fieldActions/assistFieldActions.tsx +7 -16
package/dist/index.esm.js
CHANGED
|
@@ -4342,18 +4342,18 @@ const assistFieldActions = {
|
|
|
4342
4342
|
}, [fieldAssist == null ? void 0 : fieldAssist.instructions]);
|
|
4343
4343
|
const instructions = useMemo(() => [...privateInstructions, ...sharedInstructions], [privateInstructions, sharedInstructions]);
|
|
4344
4344
|
const runInstructionsGroup = useMemo(() => {
|
|
4345
|
-
return (instructions == null ? void 0 : instructions.length) ? node({
|
|
4345
|
+
return (instructions == null ? void 0 : instructions.length) || imageCaptionAction ? node({
|
|
4346
4346
|
type: "group",
|
|
4347
4347
|
icon: () => null,
|
|
4348
4348
|
title: "Run instructions",
|
|
4349
|
-
children: [...instructions.map(instruction => instructionItem({
|
|
4349
|
+
children: [...(instructions == null ? void 0 : instructions.map(instruction => instructionItem({
|
|
4350
4350
|
instruction,
|
|
4351
4351
|
isPrivate: Boolean(instruction.userId && instruction.userId === (currentUser == null ? void 0 : currentUser.id)),
|
|
4352
4352
|
onInstructionAction,
|
|
4353
4353
|
hidden: isHidden,
|
|
4354
4354
|
documentIsNew: !!documentIsNew,
|
|
4355
4355
|
assistSupported
|
|
4356
|
-
})), imageCaptionAction].filter(Boolean),
|
|
4356
|
+
}))), imageCaptionAction].filter(Boolean),
|
|
4357
4357
|
expanded: true
|
|
4358
4358
|
}) : void 0;
|
|
4359
4359
|
}, [instructions, currentUser == null ? void 0 : currentUser.id, onInstructionAction, isHidden, documentIsNew, assistSupported, imageCaptionAction]);
|
|
@@ -4369,23 +4369,13 @@ const assistFieldActions = {
|
|
|
4369
4369
|
type: "group",
|
|
4370
4370
|
icon: SparklesIcon,
|
|
4371
4371
|
title: pluginTitleShort,
|
|
4372
|
-
children: [runInstructionsGroup,
|
|
4373
|
-
/* documentIsNew && {
|
|
4374
|
-
type: 'action',
|
|
4375
|
-
disabled: true,
|
|
4376
|
-
title: `Document is new. Make an edit to enable `,
|
|
4377
|
-
icon: WarningOutlineIcon,
|
|
4378
|
-
tone: 'caution',
|
|
4379
|
-
status: 'warning',
|
|
4380
|
-
onAction: () => {},
|
|
4381
|
-
},*/
|
|
4382
|
-
manageInstructionsItem].filter(c => !!c),
|
|
4372
|
+
children: [runInstructionsGroup, assistSupported && manageInstructionsItem].filter(c => !!c),
|
|
4383
4373
|
expanded: false,
|
|
4384
4374
|
renderAsButton: true,
|
|
4385
|
-
hidden: !assistSupported
|
|
4375
|
+
hidden: !assistSupported && !imageCaptionAction
|
|
4386
4376
|
}), [
|
|
4387
4377
|
//documentIsNew,
|
|
4388
|
-
runInstructionsGroup, manageInstructionsItem, assistSupported]);
|
|
4378
|
+
runInstructionsGroup, manageInstructionsItem, assistSupported, imageCaptionAction]);
|
|
4389
4379
|
const emptyAction = useMemo(() => node({
|
|
4390
4380
|
type: "action",
|
|
4391
4381
|
hidden: !assistSupported,
|