@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.js CHANGED
@@ -4355,18 +4355,18 @@ const assistFieldActions = {
4355
4355
  }, [fieldAssist == null ? void 0 : fieldAssist.instructions]);
4356
4356
  const instructions = react.useMemo(() => [...privateInstructions, ...sharedInstructions], [privateInstructions, sharedInstructions]);
4357
4357
  const runInstructionsGroup = react.useMemo(() => {
4358
- return (instructions == null ? void 0 : instructions.length) ? node({
4358
+ return (instructions == null ? void 0 : instructions.length) || imageCaptionAction ? node({
4359
4359
  type: "group",
4360
4360
  icon: () => null,
4361
4361
  title: "Run instructions",
4362
- children: [...instructions.map(instruction => instructionItem({
4362
+ children: [...(instructions == null ? void 0 : instructions.map(instruction => instructionItem({
4363
4363
  instruction,
4364
4364
  isPrivate: Boolean(instruction.userId && instruction.userId === (currentUser == null ? void 0 : currentUser.id)),
4365
4365
  onInstructionAction,
4366
4366
  hidden: isHidden,
4367
4367
  documentIsNew: !!documentIsNew,
4368
4368
  assistSupported
4369
- })), imageCaptionAction].filter(Boolean),
4369
+ }))), imageCaptionAction].filter(Boolean),
4370
4370
  expanded: true
4371
4371
  }) : void 0;
4372
4372
  }, [instructions, currentUser == null ? void 0 : currentUser.id, onInstructionAction, isHidden, documentIsNew, assistSupported, imageCaptionAction]);
@@ -4382,23 +4382,13 @@ const assistFieldActions = {
4382
4382
  type: "group",
4383
4383
  icon: icons.SparklesIcon,
4384
4384
  title: pluginTitleShort,
4385
- children: [runInstructionsGroup,
4386
- /* documentIsNew && {
4387
- type: 'action',
4388
- disabled: true,
4389
- title: `Document is new. Make an edit to enable `,
4390
- icon: WarningOutlineIcon,
4391
- tone: 'caution',
4392
- status: 'warning',
4393
- onAction: () => {},
4394
- },*/
4395
- manageInstructionsItem].filter(c => !!c),
4385
+ children: [runInstructionsGroup, assistSupported && manageInstructionsItem].filter(c => !!c),
4396
4386
  expanded: false,
4397
4387
  renderAsButton: true,
4398
- hidden: !assistSupported
4388
+ hidden: !assistSupported && !imageCaptionAction
4399
4389
  }), [
4400
4390
  //documentIsNew,
4401
- runInstructionsGroup, manageInstructionsItem, assistSupported]);
4391
+ runInstructionsGroup, manageInstructionsItem, assistSupported, imageCaptionAction]);
4402
4392
  const emptyAction = react.useMemo(() => node({
4403
4393
  type: "action",
4404
4394
  hidden: !assistSupported,