Skip to content

Conversation

@Nowely
Copy link
Owner

@Nowely Nowely commented Feb 1, 2026

Summary

  • Introduce MarkHandler class to encapsulate mark state management with proper getters/setters
  • Reorganize folder structure: utilslib with classes, hooks, utils subdirectories
  • Rename Piece component to MarkRenderer for clarity
  • Simplify Token component rendering logic with early returns
  • Add findToken utility for traversing token tree

Breaking Changes

  • labelcontent: Renamed property for displayed text of the mark
  • childrentokens: Renamed property for child tokens array
  • change() signature: Updated from {label, value} to {content, value?, meta?}

Nowely added 12 commits February 1, 2026 13:35
- Replaced direct child rendering logic in Piece with useMark hook to manage children as ReactNode.
- Introduced useMark hook to encapsulate mark handling, including depth, parent, and child token management.
- Updated related tests and documentation to reflect changes in child handling and mark properties.
- Adjusted Storybook examples to use updated mark properties for consistency.
…ular dependency resolution

- Updated Piece component to render children directly, eliminating the use of the useMark hook for child rendering, thus breaking the circular import.
- Introduced MarkTokenComponent and TextTokenComponent in the Token component for better type discrimination and compile-time safety.
- Enhanced MarkHandler class to compute depth, parent, and child tokens lazily, improving performance and clarity.
- Updated documentation links in API references to reflect changes in the useMark hook and MarkHandler interface.
- Adjusted related tests and Storybook examples to align with the new component structure and type safety improvements.
… functionality

- Simplified the useListener implementation in the Container component for better readability.
- Refactored the MarkHandler class to enhance the management of mark properties, including the introduction of content as a key property instead of label.
- Updated the change method to accept a more structured props object, allowing for simultaneous updates to content, value, and meta.
- Adjusted related documentation to reflect changes in the MarkHandler interface and its properties.
- Modified tests to ensure compatibility with the updated MarkHandler structure and behavior.
- Introduced the MarkHandler class to encapsulate mark management, including content, value, and meta properties.
- Implemented methods for changing mark properties and removing marks, enhancing interaction with the store.
- Added utility functions for calculating nesting depth and finding parent marks, improving mark structure handling.
- Refactored useMark hook to utilize the new MarkHandler class, streamlining mark-related logic and improving clarity.
…tation

- Updated the MarkHandler class to streamline property management by consolidating change notifications into a private method.
- Enhanced documentation for properties and methods, improving clarity and organization.
- Removed redundant comments and improved the structure of the code for better readability.
- Adjusted the export path for MarkHandler in the index file to reflect the new class location.
…t retrieval

- Replaced the calculateDepth and findParent functions with a new findToken utility to streamline the retrieval of depth and parent mark tokens.
- Improved the MarkHandler class by enhancing the efficiency of depth and parent property calculations.
- Removed redundant helper functions, simplifying the code structure and improving maintainability.
… safety

- Removed separate MarkTokenComponent and TextTokenComponent, consolidating rendering logic within the Token component.
- Enhanced type safety by directly using TokenProvider for both mark and text rendering.
- Streamlined the component structure for better readability and maintainability.
…rove type safety

- Renamed Piece component to MarkRenderer for clarity.
- Simplified child rendering logic by directly mapping children tokens.
- Enhanced type safety by ensuring MarkProps are constructed correctly based on children presence.
- Streamlined the child rendering logic by directly mapping children tokens.
- Improved code clarity by removing unnecessary line breaks in the rendering process.
@vercel
Copy link

vercel bot commented Feb 1, 2026

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

Project Deployment Actions Updated (UTC)
marked-input Ready Ready Preview, Comment Feb 1, 2026 0:46am
markput-website Ready Ready Preview, Comment Feb 1, 2026 0:46am

@Nowely Nowely merged commit 98bdb1e into next Feb 1, 2026
8 checks passed
@Nowely Nowely deleted the update-use-mark branch February 1, 2026 12:47
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