Skip to content

0.5.1

Compare
Choose a tag to compare
@gfargo gfargo released this 04 Jan 18:19
· 24 commits to main since this release
cc3d1f5

New Features

  • Add MIT License and Update README: Introduce MIT License to clarify usage rights and responsibilities. Enhance readme.md by adding links to React and Ink for better context. Introduce a new section detailing the interactive component showcase, including setup instructions, features, and navigation tips to aid in development and usage. (91ba52b)

Component Enhancements

  • Add Style Options to CardView: Enhance CardView by adding selected and rounded style options. Update the selector to toggle these styles and adjust the card preview to reflect changes. Modify Card component to accept and display the new styles. Increase ascii card height to 12 for better layout. (a764b02)
  • Simplify Card Artwork Generation: Update generateDefaultBackArtwork to use a '?' placeholder for all variants. This change reduces complexity by standardizing the artwork representation across 'ascii', 'simple', and 'minimal' variants, making the function easier to maintain and understand. (f072c7c)
  • Refactor Card Layout and Styles: Refactor card layout logic by introducing CARD_DIMENSIONS for consistent card size and layout across variants. Simplify pip and special art creation with createPipLayout and createSpecialArt. Update Card component to use new layout functions and add selected and rounded props for styling flexibility. (43ff961)

Storybook and Utility Updates

  • Add Storybook Components and Utils: Introduce new Storybook components including CardStackView, CardView, CustomCardView, DeckView, and MiniCardView. These components provide interactive interfaces for card management and customization. Add EnhancedSelectInput utility for improved user interaction. Update scripts in package.json to support the new Storybook setup. (dcf0325)

CardStack and MiniCard Improvements

  • Add mini and micro Variants to CardStack: Enhance CardStack by introducing mini and micro variants, allowing for more compact card displays. Adjust margins for these new variants to ensure proper alignment. Implement conditional rendering to use MiniCard for mini and micro variants, maintaining flexibility in card presentation. (656fed4)
  • Fix MiniCard Layout and Display Logic: Improve MiniCard component by adjusting layout and display logic. Add overflow property to prevent content overflow. Ensure consistent height for non-mini variants. Refine value and suit symbol rendering to handle single character values correctly and add spacing for symbols in mini variant. (3cca268)

Deck Management Enhancements

  • Refactor Discard Pile Initialization: Introduce newDiscardPile for clearer discard pile initialization in deckReducer. This improves readability and maintains consistency when resetting the discard pile after shuffling. By using a named variable, the code becomes more intuitive and easier to maintain, reducing potential errors. (550744c)
  • Enhance Deck Reset Logic: Update deckReducer to handle optional deck payload during 'RESET' action. Introduce shuffled discard pile as fallback when no deck is provided. Adjust DeckAction type to include payload for 'RESET'. Modify useDeck hook to dispatch 'RESET' with deck payload, ensuring flexibility in deck management. (feacb32)

Miscellaneous

  • Update .gitignore for macOS Files: Add .DS_Store to .gitignore to prevent macOS system files from being tracked in the repository. This helps maintain a cleaner project history and avoids unnecessary clutter in version control. The change ensures that these files are ignored across all environments, improving cross-platform collaboration. (a1aebd9)
  • Update Library Name in README: Rename the library from card-game-library-ink to ink-playing-cards in the README. Update installation instructions and import statements to reflect the new library name. This change ensures consistency and clarity for users integrating the library into their projects. (92885ea)

Full Changelog: 0.2.0...0.5.1