File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ export const AIMenu = (props: AIMenuProps) => {
7979
8080 useEffect ( ( ) => {
8181 // this is a bit hacky to run a useeffect to reset the prompt when the AI response is done
82- if ( aiResponseStatus === "user-reviewing" || aiResponseStatus === "error" ) {
82+ if (
83+ aiResponseStatus === "ai-writing" ||
84+ aiResponseStatus === "user-reviewing" ||
85+ aiResponseStatus === "error"
86+ ) {
8387 setPrompt ( "" ) ;
8488 }
8589 } , [ aiResponseStatus ] ) ;
@@ -130,7 +134,7 @@ export const AIMenu = (props: AIMenuProps) => {
130134 props . onManualPromptSubmit || onManualPromptSubmitDefault
131135 }
132136 items = { items }
133- promptText = { aiResponseStatus === "user-input" ? prompt : undefined }
137+ promptText = { prompt }
134138 onPromptTextChange = { setPrompt }
135139 placeholder = { placeholder }
136140 disabled = {
Original file line number Diff line number Diff line change @@ -2,10 +2,11 @@ import {
22 BlockPopover ,
33 FloatingUIOptions ,
44 useBlockNoteEditor ,
5+ useExtension ,
6+ useExtensionState ,
57} from "@blocknote/react" ;
6- import { FC , useMemo } from "react" ;
7- import { useExtension , useExtensionState } from "@blocknote/react" ;
88import { offset , size } from "@floating-ui/react" ;
9+ import { FC , useMemo } from "react" ;
910
1011import { AIExtension } from "../../AIExtension.js" ;
1112import { AIMenu , AIMenuProps } from "./AIMenu.js" ;
@@ -59,7 +60,8 @@ export const AIMenuController = (props: {
5960 enabled :
6061 aiMenuState === "closed" || aiMenuState . status === "user-input" ,
6162 // We should just be able to set `referencePress: true` instead of
62- // using this listener, but for some reason it doesn't seem to trigger.
63+ // using this listener, but this doesn't seem to trigger.
64+ // (probably because we don't assign the referenceProps to the reference element)
6365 outsidePress : ( event ) => {
6466 if ( event . target instanceof Element ) {
6567 const blockElement = event . target . closest ( ".bn-block" ) ;
You can’t perform that action at this time.
0 commit comments