Skip to content

Conversation

@Nowely
Copy link
Owner

@Nowely Nowely commented Nov 21, 2025

Introduces a comprehensive set of SingleEditable components for flexible content editing:

  • SingleEditableControlled - Controlled component for managing plain text content with HTML rendering
  • SingleEditableMarkdown - Specialized component for markdown content editing with bidirectional conversion (HTML ↔ Markdown)
  • SingleEditableUncontrolled - Uncontrolled variant for managing state internally
  • Storybook Stories - Interactive examples and documentation for all components

## Summary
- Introduced a new Storybook story for the `MarkedInput` component showcasing a single contentEditable approach.
- Implemented a `CustomContainer` component to handle content editing with native browser support.
- Added utility functions for managing selection and converting HTML to plain text with markup.
- Demonstrated both controlled and uncontrolled editing approaches, highlighting the benefits of using MutationObserver for a smoother editing experience.

## Key Changes
1. **Custom Components**: Created `CustomContainer`, `PlainTextSpan`, and `HTMLMark` for rendering editable content.
2. **Utility Functions**: Added functions for saving and restoring selection, and converting HTML to plain text.
3. **Story Examples**: Provided examples of controlled vs uncontrolled editing, emphasizing the advantages of the uncontrolled approach.

## Benefits
- Enhanced user experience for editing content with a more natural cursor behavior.
- Clear demonstration of the component's capabilities in Storybook.
## Summary
- Introduced a new story for the `MarkedInput` component demonstrating a single contentEditable approach.
- Implemented `CustomContainer`, `PlainTextSpan`, and `HTMLMark` components for enhanced editing capabilities.
- Added utility functions for converting HTML to plain text with markup.
- Showcased both controlled and uncontrolled editing methods, emphasizing the advantages of using MutationObserver for a smoother user experience.

## Key Changes
1. **Custom Components**: Created components to manage editable content effectively.
2. **Utility Functions**: Added functions for HTML conversion and text processing.
3. **Story Examples**: Provided examples illustrating the differences between controlled and uncontrolled editing approaches.

## Benefits
- Improved user experience with natural cursor behavior during editing.
- Clear demonstration of the component's functionality in Storybook.
…ntEditable stories

## Summary
- Introduced `MarkedInputControlled` and `MarkedInputUncontrolled` components to demonstrate controlled and uncontrolled contentEditable behavior.
- Enhanced the editing experience by addressing cursor position issues in controlled components and utilizing MutationObserver in uncontrolled components.
- Updated story examples to utilize the new components, improving clarity on their usage and benefits.

## Key Changes
1. **New Components**: Added `MarkedInputControlled` for controlled editing and `MarkedInputUncontrolled` for uncontrolled editing.
2. **Story Updates**: Refactored story examples to use the new components, showcasing their functionality and differences.

## Benefits
- Improved user experience with better cursor management during editing.
- Clearer demonstration of controlled vs uncontrolled editing approaches in Storybook.
## Summary
- Renamed `MarkedInputControlled` and `MarkedInputUncontrolled` components to `SingleEditableControlled` and `SingleEditableUncontrolled` for clarity and consistency.
- Updated associated interfaces and story examples to reflect the new naming, enhancing the overall readability and understanding of the components.

## Key Changes
1. **Component Renaming**: Changed component names to better represent their functionality as single editable components.
2. **Interface Updates**: Adjusted interfaces to match the new component names.
3. **Story Adjustments**: Modified story examples to utilize the renamed components, ensuring consistency across the documentation.

## Benefits
- Improved clarity in component naming, making it easier for developers to understand their purpose.
- Enhanced documentation and story examples for better user experience in Storybook.
## Summary
- Introduced `SingleEditableControlled` and `SingleEditableUncontrolled` components to manage contentEditable behavior effectively.
- Implemented a `CustomContainer`, `PlainTextSpan`, and `HTMLMark` for enhanced editing capabilities.
- Added utility functions for converting HTML to plain text with markup.

## Key Changes
1. **New Components**: Created `SingleEditableControlled` for controlled editing and `SingleEditableUncontrolled` for uncontrolled editing.
2. **Custom Components**: Developed supporting components to facilitate editing and rendering of content.
3. **Utility Functions**: Included functions for HTML conversion and text processing.

## Benefits
- Improved user experience with better cursor management during editing.
- Clear demonstration of controlled vs uncontrolled editing approaches in Storybook.
<message>
- Introduced `SingleEditableMarkdown`, an uncontrolled markdown editor that supports various formatting options including bold, italic, code, links, headings, and blockquotes.
- Implemented a `MarkdownContainer` for contentEditable functionality, ensuring smooth editing with a MutationObserver.
- Added utility functions for converting HTML to markdown format and parsing markdown into structured tokens for rendering.

## Key Changes
1. **New Component**: Created `SingleEditableMarkdown` for markdown editing with real-time preview.
2. **Supporting Components**: Developed `MarkdownContainer`, `MarkdownText`, and `MarkdownMark` for rendering and editing markdown content.
3. **Utility Functions**: Included `htmlToMarkdown` and `parseMarkdown` for handling markdown conversion.

## Benefits
- Enhanced user experience with native markdown editing capabilities.
- Clear demonstration of markdown features in Storybook.
@vercel
Copy link

vercel bot commented Nov 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marked-input Ready Ready Preview Comment Nov 21, 2025 11:30am

…r improved readability

## Summary
- Cleaned up the formatting of the `handleInput` function in `SingleEditableControlled` for better readability.
- Removed unnecessary line breaks in the `MarkdownContainer` component to streamline the code structure.
- Simplified the return statement in the `htmlToMarkdown` utility function for clarity.

## Key Changes
1. **Code Formatting**: Enhanced the readability of the `handleInput` function by adjusting its structure.
2. **Component Cleanup**: Removed extraneous line breaks in `MarkdownContainer` to improve code flow.
3. **Utility Function Simplification**: Streamlined the return statement in `htmlToMarkdown` for better clarity.

## Benefits
- Improved code maintainability and readability for future development.
- Enhanced clarity in component functionality and utility operations.
@Nowely Nowely merged commit f796306 into next Nov 21, 2025
7 checks passed
@Nowely Nowely deleted the new-story branch November 21, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants