prismic-client icon indicating copy to clipboard operation
prismic-client copied to clipboard

feat: support image captions

Open angeloashmore opened this issue 1 year ago • 1 comments

Types of changes

  • [ ] Chore (a non-breaking change which is related to package maintenance)
  • [ ] Bug fix (a non-breaking change which fixes an issue)
  • [x] New feature (a non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR adds support for image captions. It does this by:

  • Add a boolean allowCaption config property to the Image widget.
  • Add a caption property to ImageContent that holds string | null.
  • Ensures the caption image property is not treated as a thumbnail in asImageWidthSrcSet.

The changes in this package mirror the changes in @prismicio/types-internal. See https://github.com/prismicio/prismic-types-internal/pull/69 for details.

Checklist:

  • [ ] My change requires an update to the official documentation.
  • [x] All TSDoc comments are up-to-date and new ones have been added where necessary.
  • [x] All new and existing tests are passing.

🦚

angeloashmore avatar Mar 21 '24 23:03 angeloashmore

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.97%. Comparing base (bd55071) to head (9cb5ae7).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #334      +/-   ##
==========================================
- Coverage   99.97%   99.97%   -0.01%     
==========================================
  Files          61       61              
  Lines        6885     6881       -4     
  Branches      381      381              
==========================================
- Hits         6883     6879       -4     
  Misses          2        2              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Mar 21 '24 23:03 codecov-commenter