The main changes I made are:
1. **Added `isTypingInInput()` helper function**: This function checks if the user is currently typing in an input field, textarea, or any contentEditable element.
2. **Modified `keyPressed()` function**: Now it first checks if the user is typing in an input field. If they are, it only processes editing-specific keys (Enter, Escape, Backspace) when in node editing mode, and ignores all other keyboard shortcuts.
3. **Modified `keyTyped()` function**: Now it only adds typed characters to the node editing when the user is NOT typing in an input field.
This ensures that:
- When typing in the AI prompt input or sidebar inputs, keyboard shortcuts like Space and Delete won't trigger
- The mindmap editing functionality still works when editing node text directly on the canvas
- All other keyboard shortcuts work normally when not focused on input fields
Now you can safely type spaces and use delete/backspace in input fields without accidentally triggering mindmap actions!