Releases: gfargo/ink-playing-cards
Releases · gfargo/ink-playing-cards
0.7.1
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 inUnicodeCardView
and improve alignment in text utilities. (a2f3a95) - Enhance
Card
config and clean up tests by improvingconfig
to include defaultpip
values, ensuring consistent rendering even whenpip
is absent inCARD_DIMENSIONS
. AdjustrobotCard.test.ts
import order and updatejackOfClubs
access method. Remove obsoleteUnicodeCard.test.tsx
. (5b7bd30) - Refactor robot theme and add card art renderer by moving
ROBOT_CARD_ART
andROBOT_FEATURES
torobotTheme.ts
. IntroducecardArtRenderer.ts
for dynamic rendering of card art sections. UpdateCard
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 instorybook
withunicode-card
option and updatereadme.md
with usage details. (616c3c6) - Add tests and constants to
UnicodeCard
for accurate rendering of card suits, values, colors, and styles. ImplementgetCardUnicode
for card character retrieval and enhance customization options. (26dd1f0)
Deck and Card Initialization Improvements
- Enhance deck initialization by updating
DeckProvider
to initializedeck
withcreateStandardDeck
ifinitialCards
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 introducingcreateAsciiPipLayout
for futureascii
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
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 useGridCard
type for consistency. (3c4fec3)
- Introduce
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)
- Make
-
Enhance card visuals and refactor tests:
- Improve card representation in tests by using Unicode and color codes for clarity. (e586ab5)
- Refactor
getAlignmentStyle
inCardStack
for readability. (e586ab5) - Update
CardGrid
tests with snapshot verification and useundefined
for empty cells. (e586ab5) - Enhance
Card
ASCII art and type safety. (e586ab5) - Adjust
Deck
andMiniCard
visuals. (e586ab5) - Fix typos in
readme.md
andsrc/types
. (e586ab5)
Layout Improvements
- Enhance
CardStack
with alignment and spacing:
Full Changelog: 0.5.2...0.6.0
0.5.2
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
New Features
- Add MIT License and Update README: Introduce MIT License to clarify usage rights and responsibilities. Enhance
readme.md
by adding links toReact
andInk
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 addingselected
androunded
style options. Update the selector to toggle these styles and adjust the card preview to reflect changes. ModifyCard
component to accept and display the new styles. Increaseascii
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 withcreatePipLayout
andcreateSpecialArt
. UpdateCard
component to use new layout functions and addselected
androunded
props for styling flexibility. (43ff961)
Storybook and Utility Updates
- Add Storybook Components and Utils: Introduce new Storybook components including
CardStackView
,CardView
,CustomCardView
,DeckView
, andMiniCardView
. These components provide interactive interfaces for card management and customization. AddEnhancedSelectInput
utility for improved user interaction. Update scripts inpackage.json
to support the new Storybook setup. (dcf0325)
CardStack and MiniCard Improvements
- Add
mini
andmicro
Variants to CardStack: EnhanceCardStack
by introducingmini
andmicro
variants, allowing for more compact card displays. Adjust margins for these new variants to ensure proper alignment. Implement conditional rendering to useMiniCard
formini
andmicro
variants, maintaining flexibility in card presentation. (656fed4) - Fix
MiniCard
Layout and Display Logic: ImproveMiniCard
component by adjusting layout and display logic. Addoverflow
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 indeckReducer
. 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. AdjustDeckAction
type to include payload for 'RESET'. ModifyuseDeck
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
toink-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
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 asasciiArt
,symbols
, and style options.
Bug Fixes
- Fix symbol color logic and update ignore files (0f6941a)
- Correct
chalk
color method usage inCustomCard
to fix symbol color logic. - Ensure
symbolColor
useschalk.red
for specified colors. - Update
.gitignore
and.npmignore
to excludeprompts/
andexamples/
directories.
- Correct
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
Full Changelog: 0.1.0...0.1.1
0.1.0
Full Changelog: https://github.com/gfargo/ink-playing-cards/commits/0.1.0