Skip to content

Commit

Permalink
refactor(editor): conditionally run AI actions before calling LLM com…
Browse files Browse the repository at this point in the history
…mands
  • Loading branch information
phodal committed Nov 1, 2024
1 parent da6fb10 commit 2294ac4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion web/core/lib/editor/action/custom-editor-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@ export const CustomEditorCommands = (
runAiAction:
(action: PromptAction) =>
({ editor }: { editor: Editor }) => {
editor.commands.callLlm(action);
if (action.action) {
action.action(editor).then(() => {});
return;
} else {
editor.commands.callLlm(action);
}
},
callQuickAction:
(text: string) =>
Expand Down
2 changes: 1 addition & 1 deletion web/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@studio-b3/web-core",
"version": "0.8.8",
"version": "0.8.9",
"type": "module",
"main": "dist/main.js",
"types": "dist-types/main.d.ts",
Expand Down

0 comments on commit 2294ac4

Please sign in to comment.