All notable changes to this project will be documented in this file.
- Added prop
htmlWidth
andhtmlHeight
to theImageComponent
component to allow the user to set the explicit width and height of the image in the HTML. IfhtmlWidth
and/orhtmlHeight
are set, thewidth
andheight
will be added to the<img />
element in the HTML. The defaultwidth
andheight
props could not be used because they are used for the image optimization.
- Updated dependencies to the latest versions.
- Fixed issue where a prop
placeholder
was required on theImageComponent
/ImageHandler
component and caused a TypeScript error when it was not set.
- Created missing build files from previous release version
1.6.1
.
- Created missing build files from previous release (version
1.6.1
).
- Fixed issue in
ImageComponent
where the prop valuelazyLoading=false
was not working for GIFs whenoptimizeGif
was set totrue
and not working for SVGs whenoptimizeSvg
was set totrue
in theImageHandlerContext
context config.
- Updated the
ImageComponent
component withforwardRef
to allow the user to pass a ref to the component. - Extended the filter options by the 'watermark' filter. Updated also all related resources: types
ImageFilterType
andWatermarkFilterType
, filter mapper functionmapFilterObjectToUrl()
- Added
"use client"
directive toImageComponent
,ConfigurationContext
andImageHandlerContext
which updated the components to client-components. This adds support for the Next.js app router and React 18.
- Added ability to configure global image filter in the
ImageHandlerContext
which will be applied to every image request expect for those where the filters are override by image-specific filters. - Extended type definition
ConfigurationContextType
byglobalFilters
. - Updated type definition
ImageFilterType
for filter options to allow also custom string values forbackgroundColor
andfill
instead of just Hex color values. - Fixed issue in helper function
generateImgSrc()
where operator>
was unsed on a string value. - Fixed issue in helper function
mapFilterObjectToUrl()
where theblur
filter was applied even if it is was set toundefined
.
- Added output of GIF images when
optimizeGif
is set tofalse
toImage
component. - Updated type
ConfigurationContextType
with new config optionoptimizeGif
. - Updated
ImageHandlerContext
with new config optionoptimizeGif
and set it's default value tofalse
. - Updated example app.
- Added new prop
lazyLoading
to theImage
component to give the user the option to disable the lazy loading and progressive image loading on single images.
- Added new helper functions
getImgSrc()
andgetImgSrcSet()
to generate a image src and src-set outside of theImage
component. - Added fallback to
ImageHandler
context withconsole.error
if the configuration context is missing. - Updated targets for query selector of image observer for lazy loading.
First major release.
- Fixed issue with
defaultStyles
in config object which were overridden by the user'sdefaultStyles
object.
- Changed way of implementing Intersection Observer to prevent issues in Next.js and Gatsby.js.
- New installation on dev server.
- Added global context with configuration options and custom type for configuration context options.
- Added image component to output the image.
- Added type for available image filters.
- Added general helper functions:
checkFiletype()
- Added function
mapFilterObjectToUrl()
to map for filters a string for the URL. - Added function
generateImgSrc()
to create image source URLs. - Added function
prepareSrc()
to prepare thesrc
value before using it. - Added function
generateSrcSet()
to generate a string of image sources for thesrcSet
attribute. - Added lazy-loading for progressive image loading and some helper functions. The functions
addLazyLoading()
andremoveLazyLoading()
are exported from the package to allow the consumer to add and remove lazy loading from the site by using theuseEffect
hook. - Added a browserslist to the
package.json
file. - Renamed library from
@feichtmedia/imagehandler-react-component
to@feichtmedia/imagehandler-react-sdk
. - Renamed image component from
Image
toImageHandler
.
Initial commit