Prevents potential formatting issues by ensuring prompts are single-line and trimmed
Collapses multiple whitespaces and trims prompt text to maintain clean, uniform list rendering in markdown output
Refactors cursor handling to use setCursor instead of setSelection when collapsing selections
Improves timestamp generation by using environment's default locale automatically instead of manually specifying language
Enhances code clarity and simplifies locale handling for timestamp formatting
Uses the user's preferred language locale for timestamp formatting, enhancing regional customization and user experience
Allows automatic fallback to 'en-US' if navigator language is unavailable
Refactors active note validation into a dedicated static method for improved readability and reusability
Enhances code maintainability by centralizing the check for valid editor and view
Refines text insertion handling for writing prompts:
- Collapses text selection before insertion
- Adds more intelligent newline management
- Uses Intl.DateTimeFormat for consistent timestamp generation
Enhances edge case handling for cursor and text positioning
Removes conditional logic for setting the cursor position
after inserting a prompt. Now, the cursor is consistently
placed at the end of the inserted text, regardless of the
previous cursor location. This change ensures consistent behavior
and simplifies the code.
- Replace any types with proper Obsidian API types
- Add App type import for better type safety
- Add ButtonComponent type for settings button parameter
- Add null safety for button text content
- Remove redundant "Settings" from settings tab heading
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Initial implementation of the Freewriting Prompts plugin.
This commit introduces the core functionality for generating
AI-powered writing prompts using Anthropic's Claude API.
It includes:
- API client for interacting with the Anthropic API
- Services for generating and caching prompts
- Commands for displaying staggered prompts and appending prompts to notes
- Settings tab for configuring the plugin