From 726a19b43fd00edceefc2a8b453074accd8ca92a Mon Sep 17 00:00:00 2001 From: YIZHUANG Date: Wed, 18 Dec 2019 15:37:57 +0200 Subject: [PATCH] Update changelog, rename app to dev, remove static values from getState --- CHANGELOG.md | 137 +++++++++++++++++++++++ README.md | 2 +- contributing.md | 2 +- {app => dev}/.gitignore | 0 {app => dev}/.snyk | 0 {app => dev}/README.md | 0 {app => dev}/babel.config.js | 0 {app => dev}/components/card.tsx | 0 {app => dev}/components/image.tsx | 0 {app => dev}/components/menu.tsx | 0 {app => dev}/next.config.js | 0 {app => dev}/nodemon.json | 0 {app => dev}/package-lock.json | 0 {app => dev}/package.json | 0 {app => dev}/pages/HomePage/HomePage.tsx | 2 +- {app => dev}/pages/_app.tsx | 2 +- {app => dev}/pages/_document.tsx | 0 {app => dev}/postcss.config.js | 0 {app => dev}/routes/index.ts | 0 {app => dev}/server/index.ts | 0 {app => dev}/src/getPageContext.ts | 0 {app => dev}/tsconfig.json | 0 {app => dev}/tsconfig.server.json | 0 package-lock.json | 60 ++++++++++ package.json | 5 +- src/Carousel.tsx | 6 +- src/types.ts | 7 +- 27 files changed, 209 insertions(+), 14 deletions(-) rename {app => dev}/.gitignore (100%) rename {app => dev}/.snyk (100%) rename {app => dev}/README.md (100%) rename {app => dev}/babel.config.js (100%) rename {app => dev}/components/card.tsx (100%) rename {app => dev}/components/image.tsx (100%) rename {app => dev}/components/menu.tsx (100%) rename {app => dev}/next.config.js (100%) rename {app => dev}/nodemon.json (100%) rename {app => dev}/package-lock.json (100%) rename {app => dev}/package.json (100%) rename {app => dev}/pages/HomePage/HomePage.tsx (98%) rename {app => dev}/pages/_app.tsx (98%) rename {app => dev}/pages/_document.tsx (100%) rename {app => dev}/postcss.config.js (100%) rename {app => dev}/routes/index.ts (100%) rename {app => dev}/server/index.ts (100%) rename {app => dev}/src/getPageContext.ts (100%) rename {app => dev}/tsconfig.json (100%) rename {app => dev}/tsconfig.server.json (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e03bc2fc..421a1714 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,143 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v2.5.0](https://github.com/YIZHUANG/react-multi-carousel/compare/2.4.2...v2.5.0) + +> 18 December 2019 + +- [Snyk] Fix for 1 vulnerabilities [`#116`](https://github.com/YIZHUANG/react-multi-carousel/pull/116) +- [Snyk] Fix for 1 vulnerabilities [`#117`](https://github.com/YIZHUANG/react-multi-carousel/pull/117) +- Remove partialVisibilityGutter when there is not enough children [`#111`](https://github.com/YIZHUANG/react-multi-carousel/pull/111) +- added :active psuedo class to botton along with hover [`#118`](https://github.com/YIZHUANG/react-multi-carousel/pull/118) +- [Snyk] Fix for 1 vulnerabilities [`#113`](https://github.com/YIZHUANG/react-multi-carousel/pull/113) +- fix: app/package.json & app/package-lock.json to reduce vulnerabilities [`e2dcb07`](https://github.com/YIZHUANG/react-multi-carousel/commit/e2dcb0706a636bcf3ce9fa1a942f6164b1d546dc) +- fix: app/package.json, app/package-lock.json & app/.snyk to reduce vulnerabilities [`e6fb07b`](https://github.com/YIZHUANG/react-multi-carousel/commit/e6fb07babedbda3464994a5c0fbe155f84a56bf1) +- fix: examples/ssr/package.json, examples/ssr/package-lock.json & examples/ssr/.snyk to reduce vulnerabilities [`efbc527`](https://github.com/YIZHUANG/react-multi-carousel/commit/efbc52727321dba1ffa674a8aa45ad33fb6b62b7) + +#### [2.4.2](https://github.com/YIZHUANG/react-multi-carousel/compare/2.4.1...2.4.2) + +> 18 November 2019 + +- Fixed last pr has incorrect call order to disable dot when there is n… [`#107`](https://github.com/YIZHUANG/react-multi-carousel/pull/107) +- docs: add benhodgson87 as a contributor [`#105`](https://github.com/YIZHUANG/react-multi-carousel/pull/105) +- Fixed last pr has incorrect call order to disable dot when there is not enough children [`0ad75c5`](https://github.com/YIZHUANG/react-multi-carousel/commit/0ad75c53265c849d3971497c8bf9bf6b09e1284e) +- docs: update .all-contributorsrc [`a129c0a`](https://github.com/YIZHUANG/react-multi-carousel/commit/a129c0a53d0590c0e5e98e837f155a19356120c1) +- docs: update README.md [`ea5e882`](https://github.com/YIZHUANG/react-multi-carousel/commit/ea5e8827a19497873b39807660e9f7578829b5e4) + +#### [2.4.1](https://github.com/YIZHUANG/react-multi-carousel/compare/2.4.0...2.4.1) + +> 18 November 2019 + +- [#103] Do not render default dots if only one slide [`#104`](https://github.com/YIZHUANG/react-multi-carousel/pull/104) +- resetTotalItems on children changes [`#102`](https://github.com/YIZHUANG/react-multi-carousel/pull/102) +- reverted to old changes from PR#71 [`#101`](https://github.com/YIZHUANG/react-multi-carousel/pull/101) +- Add prop + logic to allow removing dots if only one slide [`f63263c`](https://github.com/YIZHUANG/react-multi-carousel/commit/f63263ce43212c5dafd05ad70670b7f8fc03c922) +- Remove prop, make hiding dots default behaviour [`4ed3f77`](https://github.com/YIZHUANG/react-multi-carousel/commit/4ed3f779894988d5c8a9fa91c638464b908ce959) +- Use notEnoughChildren helper for dot count check [`f1ecc55`](https://github.com/YIZHUANG/react-multi-carousel/commit/f1ecc5568a9e8e4aa749ae82cd68b050a94b7e8b) + +#### [2.4.0](https://github.com/YIZHUANG/react-multi-carousel/compare/2.3.0...2.4.0) + +> 30 October 2019 + +- fixed typo keeping backward compatibility [`#93`](https://github.com/YIZHUANG/react-multi-carousel/pull/93) +- Improve performance for mouse/touch moving the Carousel. [`#89`](https://github.com/YIZHUANG/react-multi-carousel/pull/89) +- configure husky [`#76`](https://github.com/YIZHUANG/react-multi-carousel/pull/76) +- Improve performance by manipulating dom directly [`4ca7029`](https://github.com/YIZHUANG/react-multi-carousel/commit/4ca70294f80d28cc9d646fcf0f618bcd8da1fb89) +- Fixed test [`6ecd08c`](https://github.com/YIZHUANG/react-multi-carousel/commit/6ecd08c6aff11ac0a02cf52243a68e1cb86fa653) +- Update .eslintrc.js [`8629961`](https://github.com/YIZHUANG/react-multi-carousel/commit/862996198497b9d5381aab16452f3ca8888fc9c6) + +#### [2.3.0](https://github.com/YIZHUANG/react-multi-carousel/compare/2.2.7...2.3.0) + +> 16 October 2019 + +- docs: add Martinretrou as a contributor [`#86`](https://github.com/YIZHUANG/react-multi-carousel/pull/86) +- Add aria-label to arrows buttons [`#85`](https://github.com/YIZHUANG/react-multi-carousel/pull/85) +- docs: add neamatmim as a contributor [`#84`](https://github.com/YIZHUANG/react-multi-carousel/pull/84) +- docs: add OscarBarrett as a contributor [`#83`](https://github.com/YIZHUANG/react-multi-carousel/pull/83) +- docs: add abhinavdalal-iconnect as a contributor [`#82`](https://github.com/YIZHUANG/react-multi-carousel/pull/82) +- docs: add raajnadar as a contributor [`#81`](https://github.com/YIZHUANG/react-multi-carousel/pull/81) +- docs: add tpinne as a contributor [`#79`](https://github.com/YIZHUANG/react-multi-carousel/pull/79) +- docs: add revskill10 as a contributor [`#78`](https://github.com/YIZHUANG/react-multi-carousel/pull/78) +- Added option to skip callbacks [`#75`](https://github.com/YIZHUANG/react-multi-carousel/pull/75) +- Migrate to eslint [`#69`](https://github.com/YIZHUANG/react-multi-carousel/pull/69) +- clean up code [`#68`](https://github.com/YIZHUANG/react-multi-carousel/pull/68) +- [Snyk] Fix for 1 vulnerabilities [`#67`](https://github.com/YIZHUANG/react-multi-carousel/pull/67) +- [Snyk] Fix for 1 vulnerabilities [`#66`](https://github.com/YIZHUANG/react-multi-carousel/pull/66) +- setup eslint [`0f7c34c`](https://github.com/YIZHUANG/react-multi-carousel/commit/0f7c34c435180d95eda0873087f2c651d15b3a12) +- fix: examples/ssr/package.json, examples/ssr/package-lock.json & examples/ssr/.snyk to reduce vulnerabilities [`fa5bcfc`](https://github.com/YIZHUANG/react-multi-carousel/commit/fa5bcfcbb496ab0a88c5b74fcaf911f896010c6c) +- fix: app/package.json, app/package-lock.json & app/.snyk to reduce vulnerabilities [`b8c36a3`](https://github.com/YIZHUANG/react-multi-carousel/commit/b8c36a312f5575ec5ba952327829eb41d7d02c3f) + +#### [2.2.7](https://github.com/YIZHUANG/react-multi-carousel/compare/2.2.4...2.2.7) + +> 2 October 2019 + +- clones = children if children.length < slidesToShow [`#64`](https://github.com/YIZHUANG/react-multi-carousel/pull/64) +- Fixed className undefined and Doc improvement [`302d216`](https://github.com/YIZHUANG/react-multi-carousel/commit/302d216d4ace05b5d7e057d9a28e628f9a19a755) +- Improve unit test and allow button group to be render outside [`4014721`](https://github.com/YIZHUANG/react-multi-carousel/commit/4014721b75fd3071cb05f48686b83b80f31496ef) +- Changed type namings [`3d0e0a9`](https://github.com/YIZHUANG/react-multi-carousel/commit/3d0e0a94f353c04e9f8115155558c95b129e264d) + +#### [2.2.4](https://github.com/YIZHUANG/react-multi-carousel/compare/2.2.2...2.2.4) + +> 18 August 2019 + +- Fixed typo for paritialVisibilityGutter [`#55`](https://github.com/YIZHUANG/react-multi-carousel/pull/55) +- remove useless next config [`#52`](https://github.com/YIZHUANG/react-multi-carousel/pull/52) +- Update package-lock.json [`9995c82`](https://github.com/YIZHUANG/react-multi-carousel/commit/9995c82c5f00436ad52ce6e2e5b44caee894e0e0) +- Update dependencies [`9804b29`](https://github.com/YIZHUANG/react-multi-carousel/commit/9804b29a884a08a58205a08d13b4be8e1b3997dc) +- Fixed typings and turn mangle to false for code transformation [`6453f87`](https://github.com/YIZHUANG/react-multi-carousel/commit/6453f87c80418b6dc9f97626d9c60eaa6fbf9abc) + +#### [2.2.2](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.1.4...2.2.2) + +> 28 July 2019 + +- Fixed deployment gets run in PR [`#51`](https://github.com/YIZHUANG/react-multi-carousel/pull/51) +- Feature/move clones to render method [`#50`](https://github.com/YIZHUANG/react-multi-carousel/pull/50) +- Fixed test [`3737028`](https://github.com/YIZHUANG/react-multi-carousel/commit/37370289cf5ece853ae31c2f6b270ced3d81c012) +- Move clones to render method [`e865fab`](https://github.com/YIZHUANG/react-multi-carousel/commit/e865fab932e874b2dc1b292a1c46e7c54ae8acec) +- Update documentation [`896a343`](https://github.com/YIZHUANG/react-multi-carousel/commit/896a3436312e07c17cabde7f7337cff7739d839d) + +#### [v2.1.4](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.1.3...v2.1.4) + +> 26 July 2019 + +#### [v2.1.3](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.1.2...v2.1.3) + +> 26 July 2019 + +- Fixed deployment pipeline [`#47`](https://github.com/YIZHUANG/react-multi-carousel/pull/47) + +#### [v2.1.2](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.1.1...v2.1.2) + +> 20 July 2019 + +- Updates types.ts to provide typings for ref usage [`#45`](https://github.com/YIZHUANG/react-multi-carousel/pull/45) +- Fixed CI [`#46`](https://github.com/YIZHUANG/react-multi-carousel/pull/46) +- Bump lodash from 4.17.11 to 4.17.14 [`#43`](https://github.com/YIZHUANG/react-multi-carousel/pull/43) +- Added more typings [`2b2f9dc`](https://github.com/YIZHUANG/react-multi-carousel/commit/2b2f9dcb8cbc622b5fa7fc1044748fd4f258f7a0) + +#### [v2.1.1](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.1.0...v2.1.1) + +> 12 July 2019 + +- [Feature] Basic styled components support [`#42`](https://github.com/YIZHUANG/react-multi-carousel/pull/42) +- Fetch upstream [`#1`](https://github.com/YIZHUANG/react-multi-carousel/pull/1) +- Add basic support for styled-components [`b3cfeba`](https://github.com/YIZHUANG/react-multi-carousel/commit/b3cfeba92833b651c0d3e9f80e3dc23a1c7fa425) + +#### [v2.1.0](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.0.1...v2.1.0) + +> 8 July 2019 + +- Update documentation of for the renderDotsOutside props [`#41`](https://github.com/YIZHUANG/react-multi-carousel/pull/41) +- Adds new option renderDotsOutside [`#40`](https://github.com/YIZHUANG/react-multi-carousel/pull/40) + +#### [v2.0.1](https://github.com/YIZHUANG/react-multi-carousel/compare/v2.0.0...v2.0.1) + +> 7 July 2019 + +- Update documentation [`efdd223`](https://github.com/YIZHUANG/react-multi-carousel/commit/efdd22336824b1c01812fc517a435cfb7c61e21e) +- Update ssr demo [`d8f3b6c`](https://github.com/YIZHUANG/react-multi-carousel/commit/d8f3b6c5a2789c8e024ac7f2d62fc9bb3384d7cf) +- Update documentation [`97758f5`](https://github.com/YIZHUANG/react-multi-carousel/commit/97758f54654f3865c57b5c119b3f61109649cddf) + ### [v2.0.0](https://github.com/YIZHUANG/react-multi-carousel/compare/1.4.5...v2.0.0) > 6 July 2019 diff --git a/README.md b/README.md index 65fe8d8a..a6299cba 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,7 @@ You custom dots will receive a list of props/state that's passed back by the car ```js const CustomDot = ({ onClick, ...rest }) => { const { onMove, index, active, carouselState: { currentSlide, deviceType } } = rest; - const carouselItems = [ this.setState({ isMoving: true })} afterChange={() => this.setState({ isMoving: false })} - containerClass="first-carousel-container container" + containerClass="container" slidesToSlide={1} deviceType={this.props.deviceType} > diff --git a/app/pages/_app.tsx b/dev/pages/_app.tsx similarity index 98% rename from app/pages/_app.tsx rename to dev/pages/_app.tsx index 6e811ebb..81037a33 100644 --- a/app/pages/_app.tsx +++ b/dev/pages/_app.tsx @@ -6,7 +6,7 @@ import CssBaseline from '@material-ui/core/CssBaseline'; import JssProvider from 'react-jss/lib/JssProvider'; import Typography from '@material-ui/core/Typography'; import "react-multi-carousel/lib/styles.css"; -import '../styles/main.css'; + import Menu from '../components/menu'; import getPageContext from '../src/getPageContext'; diff --git a/app/pages/_document.tsx b/dev/pages/_document.tsx similarity index 100% rename from app/pages/_document.tsx rename to dev/pages/_document.tsx diff --git a/app/postcss.config.js b/dev/postcss.config.js similarity index 100% rename from app/postcss.config.js rename to dev/postcss.config.js diff --git a/app/routes/index.ts b/dev/routes/index.ts similarity index 100% rename from app/routes/index.ts rename to dev/routes/index.ts diff --git a/app/server/index.ts b/dev/server/index.ts similarity index 100% rename from app/server/index.ts rename to dev/server/index.ts diff --git a/app/src/getPageContext.ts b/dev/src/getPageContext.ts similarity index 100% rename from app/src/getPageContext.ts rename to dev/src/getPageContext.ts diff --git a/app/tsconfig.json b/dev/tsconfig.json similarity index 100% rename from app/tsconfig.json rename to dev/tsconfig.json diff --git a/app/tsconfig.server.json b/dev/tsconfig.server.json similarity index 100% rename from app/tsconfig.server.json rename to dev/tsconfig.server.json diff --git a/package-lock.json b/package-lock.json index bf2b07cd..0c75987e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2901,6 +2901,54 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, + "auto-changelog": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/auto-changelog/-/auto-changelog-1.16.2.tgz", + "integrity": "sha512-QL7zKH5FBBHz6tECO8CjZ8LpdevVSJoDskDzzPeoB9Bfe6LyXmRzXUoTIFKJXXdVaX8ydMpDO9Oa8ihZ4Au+CA==", + "dev": true, + "requires": { + "commander": "^3.0.1", + "core-js": "^3.2.1", + "handlebars": "^4.1.2", + "lodash.uniqby": "^4.7.0", + "node-fetch": "^2.6.0", + "parse-github-url": "^1.0.2", + "regenerator-runtime": "^0.13.3", + "semver": "^6.3.0" + }, + "dependencies": { + "commander": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", + "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==", + "dev": true + }, + "core-js": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.5.0.tgz", + "integrity": "sha512-Ifh3kj78gzQ7NAoJXeTu+XwzDld0QRIwjBLRqAMhuLhP3d2Av5wmgE9ycfnvK6NAEjTkQ1sDPeoEZAWO3Hx1Uw==", + "dev": true + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz", + "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "autoprefixer": { "version": "9.4.9", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.4.9.tgz", @@ -10226,6 +10274,12 @@ "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=", "dev": true }, + "lodash.uniqby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz", + "integrity": "sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI=", + "dev": true + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -11491,6 +11545,12 @@ "safe-buffer": "^5.1.1" } }, + "parse-github-url": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/parse-github-url/-/parse-github-url-1.0.2.tgz", + "integrity": "sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==", + "dev": true + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", diff --git a/package.json b/package.json index c4504b2e..dfeec7f0 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,15 @@ "storybook": "start-storybook -p 6006", "export": "build-storybook -c .storybook -o .out", "build-storybook": "build-storybook", + "dev": "cd dev && npm run dev", "after-build": "cd src && copyfiles -f assets/* ../lib && npm run minify", "publish-ssr": "cd examples/ssr && now && now alias react-multi-carousel.now.sh", "prettier": "prettier --write {examples,src,stories,test}/**/*.{js,ts,tsx}", "lint-staged": "lint-staged", "lint": "eslint src/**/*{.ts,.tsx}", "lint:fix": "eslint --fix src/**/*{.ts,.tsx}", - "minify": "node minify.js" + "minify": "node minify.js", + "auto-changelog": "auto-changelog" }, "repository": { "type": "git", @@ -102,6 +104,7 @@ "@types/react-dom": "^16.8.2", "@typescript-eslint/eslint-plugin": "^2.3.2", "@typescript-eslint/parser": "^2.3.2", + "auto-changelog": "^1.16.2", "awesome-typescript-loader": "^5.2.1", "babel-loader": "^8.0.5", "classnames": "^2.2.6", diff --git a/src/Carousel.tsx b/src/Carousel.tsx index 7c72ace7..c070071d 100644 --- a/src/Carousel.tsx +++ b/src/Carousel.tsx @@ -615,11 +615,7 @@ class Carousel extends React.Component { ); } public getState(): StateCallBack { - return { - ...this.state, - onMove: this.onMove, - direction: this.direction - }; + return this.state; } public renderLeftArrow(): React.ReactNode { const { customLeftArrow } = this.props; diff --git a/src/types.ts b/src/types.ts index 75ee0ee9..8e1b55a2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -57,10 +57,9 @@ export interface CarouselProps { additionalTransfrom?: number; // this is only used if you want to add additional transfrom to the current transform } -export interface StateCallBack extends CarouselInternalState { - onMove: boolean; - direction: Direction; -} + +export type StateCallBack = CarouselInternalState; + export type Direction = "left" | "right" | "" | undefined; export type SkipCallbackOptions = | boolean