Skip to content

Releases: gfargo/ink-playing-cards

0.7.1

09 Jan 22:19
d416d57
Compare
Choose a tag to compare

Card Art and Rendering Enhancements

  • Refactor card art and improve code readability by removing redundant line breaks and ensuring consistent formatting across themes. Enhance code readability with replaceAll for string replacements and add type annotations for props in components. Simplify switch cases in UnicodeCardView and improve alignment in text utilities. (a2f3a95)
  • Enhance Card config and clean up tests by improving config to include default pip values, ensuring consistent rendering even when pip is absent in CARD_DIMENSIONS. Adjust robotCard.test.ts import order and update jackOfClubs access method. Remove obsolete UnicodeCard.test.tsx. (5b7bd30)
  • Refactor robot theme and add card art renderer by moving ROBOT_CARD_ART and ROBOT_FEATURES to robotTheme.ts. Introduce cardArtRenderer.ts for dynamic rendering of card art sections. Update Card component to use the new renderer for the robot theme and add tests for robot card rendering. (962a52c)
  • Add theme support for ASCII card art with multiple themes including geometric, animal, robot, pixel, and medieval styles. Update card rendering logic to support theme selection, enhancing customization options. (cd8e418)

UnicodeCard Enhancements

  • Add UnicodeCardView to storybook, introducing UnicodeCardView component for displaying Unicode-based card representations. Enhance navigation in storybook with unicode-card option and update readme.md with usage details. (616c3c6)
  • Add tests and constants to UnicodeCard for accurate rendering of card suits, values, colors, and styles. Implement getCardUnicode for card character retrieval and enhance customization options. (26dd1f0)

Deck and Card Initialization Improvements

  • Enhance deck initialization by updating DeckProvider to initialize deck with createStandardDeck if initialCards is not provided, ensuring a default deck setup. (d416d57)

Code Refactoring and Organization

  • Refactor card rendering logic by moving utility functions and constants to separate modules, simplifying the Card component and improving code organization. (ff97f6e)
  • Enhance card layout variants by updating the simple variant layout, adjusting pip positions, and introducing createAsciiPipLayout for future ascii variant enhancements. (e3bdfc7)

Previous Releases

Additional Changes

  • Add exports for CardGrid components to enhance modularity and ease of access, allowing developers to utilize grid-based card components directly from the main export file. (5828ea4)

Full Changelog: 0.6.0...0.7.1

0.6.0

06 Jan 14:59
e586ab5
Compare
Choose a tag to compare

New Features

  • Add CardGrid component and tests:
    • Introduce CardGrid component to render a grid of cards with various configurations like variants, spacing, and alignment. (3c4fec3)
    • Add comprehensive tests to ensure correct rendering in different scenarios, including face-up/down states, grid sizes, and alignment options. (3c4fec3)
    • Update GridView to use GridCard type for consistency. (3c4fec3)

Component Enhancements

  • Enhance component views and storybook:

    • Make goBack prop readonly across all views to ensure immutability. (e668180)
    • Refactor onSelect handlers to use switch statements for better readability and maintainability. (e668180)
    • Adjust label casing for consistency. (e668180)
    • Improve JSX formatting for indicators and conditional rendering. (e668180)
    • Enhance Storybook component with cleaner conditional rendering and consistent formatting. (e668180)
  • Enhance card visuals and refactor tests:

    • Improve card representation in tests by using Unicode and color codes for clarity. (e586ab5)
    • Refactor getAlignmentStyle in CardStack for readability. (e586ab5)
    • Update CardGrid tests with snapshot verification and use undefined for empty cells. (e586ab5)
    • Enhance Card ASCII art and type safety. (e586ab5)
    • Adjust Deck and MiniCard visuals. (e586ab5)
    • Fix typos in readme.md and src/types. (e586ab5)

Layout Improvements

  • Enhance CardStack with alignment and spacing:
    • Add spacing and alignment properties to CardStack for better layout control. (e779899)
    • Adjust overlap calculation to consider spacing and variant. (e779899)
    • Remove redundant console logs from Card and set overflow to 'hidden'. (e779899)
    • Simplify CardStackView by making margin constant. (e779899)

Full Changelog: 0.5.2...0.6.0

0.5.2

05 Jan 15:29
5b1542f
Compare
Choose a tag to compare

Features

  • Add GridView to showcase grid layout options, allowing customization of rows, columns, spacing, and alignment. (5b1542f)
  • Update CardStackView to include spacing and alignment adjustments, enhancing card stack display flexibility. (2ed0280)

Documentation

  • Revise documentation to reflect new components and features, providing examples for usage and customization. (2ed0280)

Full Changelog: 0.5.1...0.5.2

0.5.1

04 Jan 18:19
cc3d1f5
Compare
Choose a tag to compare

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

0.2.0

18 Dec 19:59
68f31b0
Compare
Choose a tag to compare

New Features

  • Add MiniCard component (749f174)
    • Introduce a compact card display with customizable border and color based on card suit.
    • Support face-up and face-down states for enhanced UI visual cues.
    • Update exports to include MiniCard for broader accessibility.

Enhancements

  • Enhance CustomCard component (7d44fbc)
    • Expand functionality with ASCII art, dynamic sizes, and customizable styles.
    • Update tests to cover new features like different card sizes and face-down rendering.
    • Adjust CustomCardProps to include properties such as asciiArt, symbols, and style options.

Bug Fixes

  • Fix symbol color logic and update ignore files (0f6941a)
    • Correct chalk color method usage in CustomCard to fix symbol color logic.
    • Ensure symbolColor uses chalk.red for specified colors.
    • Update .gitignore and .npmignore to exclude prompts/ and examples/ directories.

Documentation

  • Add and extend examples extensively (700957b)
    • Provide comprehensive examples to demonstrate new and existing functionalities.

Full Changelog: 0.1.1...0.2.0

0.1.1

17 Dec 03:00
7c922a0
Compare
Choose a tag to compare

Full Changelog: 0.1.0...0.1.1

0.1.0

17 Dec 03:00
c06edbb
Compare
Choose a tag to compare