Release 4.0.0-0
Pre-release
Pre-release
npm install react-image-turntable@next
pnpm install react-image-turntable@next
yarn add react-image-turntable@next
import { ReactImageTurntable, useReactImageTurntable } from 'react-image-turntable';
const images = ['https://placehold.co/600x400?text=1', 'https://placehold.co/600x400?text=2', /*...*/];
const Example = () => {
const turntableProps = useReactImageTurntable({
autoRotate, // Optional
initialImageIndex: 0, // Optional
images, // Required
movementSensitivity, // Optional
onIndexChange, // Optional
});
return <ReactImageTurntable {...turntableProps} />;
}
Features
- Turntable is now controllable from the parent via the
useReactImageTurntable
hook, closes #24 - Adds
autoRotate.counterClockwise
prop to reverse the autorotation direction - Right clicking the turntable now shows the active image, closes #35
Breaking Changes
useReactImageTurntable
hook is required to use the turntable
Bug Fixes
- Allow touch devices to scroll past the slider, closes #36
- Automatically set
activeImageIndex
images.length
when images length changes
Build Changes
use client
added to all modules, closes #25.cjs
modules are now published to work with non-esm libararies
Changelog
- chore: update package.json formatting (ff51b3f)
- build: bump publint and attw, only check node16 for attw (63121bc)
- build(example): use glob for lib package version (6206471)
- build: bump deps (8eeb330)
- ci: add step to check package (b881ec6)
- ci: update publish package job (cb61e4d)
- chore: update contrib guide (1be99ed)
- build: don't minify the lib build when the
ANALYZE
environment veriable is set to ensure coverage report is consistent (388d504) - ci: add esbuild bundle action (672eaf6)
- ci: add test summary step (51c41ec)
- ci: update compressed size action for the last time hopefully (33775c9)
- ci: update compressed action scripts (e9f32c7)
- ci: add install script to compressed size action (dae60b6)
- ci: update working directory of compressed size action (52c0249)
- ci: remove install script from compressed size action (ecbe677)
- ci: set wd for coverage action (91f5a38)
- ci: copy src folder for coverage upload again again again (526c985)
- ci: copy src folder for coverage upload again again (ae9994e)
- ci: copy src folder for coverage upload again (edfd1bd)
- ci: copy src folder for coverage upload (3a201f1)
- chore: remove eslint tsconfig (4d26d8c)
- ci: bump codeclimate action (cf627c4)
- test: update target browsers (cf5470a)
- ci: run build before tests (b513cae)
- build: update setup script in example (a877d27)
- build: make bootstrap script work with npm (d194a58)
- dx: do not error when biome doesn't find any matching files in pre-commit (176984b)
- ci: add publish preview workflow (a18856f)
- feat: make current image clickable, closes #35 (30097c2)
- fix: use
pan-y
instead ofnone
to allow scrolling on touch devices, closes #36 (5744d62) - build: bump pnpm version (3ab9ddd)
- style: replace eslint and prettier with biome and run biome on whole repo (d4ac3a8)
- test: update playwright tests and reporters, move tests to example folder (33a066d)
- test: move tests into example folder and add granular interactivity tests (3c12712)
- refactor: merge with dev, fix conflicts (b92e6fb)
- build(deps): force repo to resolve
react-image-turntable
to workspace version, not npm (20d2201) - test: fix hanging promises (ad40df3)
- style: enable stricter eslint settings to catch handing promises (97ac38d)
- docs(example): make buttons and inputs consistently space numbers to avoid jitter when changing between 18 and 36 images (166659e)
- refactor: wrap turntable in
forwardRef
and renameturntableRef
fromuseReactImageTurntable
toref
(528f5cf) - docs: update readme (0ba7999)
- style: update eslint (5ae16a3)
- docs: add controls to example and add advanced/basic demos (6fc22c7)
- refactor: move autorotate timeout handler inside effect and reset active index to zero when image count changes to a length below the active index (d5cc07e)
- build: bump deps and remove lib scripts from package.json (e2a5f05)
- chore: merge with main, fix conflicts (e56ea8b)
- build: update build config and deps (93e77ea)
- refactor: move main code to
lib
, only build esm and replace np with release it, closes #25 #26 (f1cfacb) - chore: use
latest
in example to avoid issues when it's used in isolation (5e11d09) - fix: automatically set
activeImageIndex
images.length
whenimages
length changes (204d4f6) - style: update linter to forbid any unused vars except prefixed ones (71a27bd)
- feat: make turntable completely controllable from the parent element, closes #24 (f43b532)
Full Changelog: v3.1.2...v4.0.0-0