react-image-gallery 1.2.12 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.json CHANGED
@@ -1,24 +1,47 @@
1
1
  {
2
- "env": {
3
- "browser": true,
4
- "es2021": true
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true
5
+ },
6
+ "extends": [
7
+ "eslint:recommended",
8
+ "plugin:react/recommended",
9
+ "plugin:prettier/recommended", // Enable eslint-plugin-prettier and eslint-config-prettier
10
+ "plugin:import/errors", // Enable eslint-plugin-import
11
+ "plugin:import/warnings",
12
+ "plugin:jsx-a11y/recommended", // Enable eslint-plugin-jsx-a11y
13
+ "plugin:react-hooks/recommended",
14
+ "plugin:jest/recommended"
15
+ ],
16
+ "parser": "babel-eslint",
17
+ "parserOptions": {
18
+ "ecmaFeatures": {
19
+ "jsx": true
5
20
  },
6
- "extends": [
7
- "eslint:recommended",
8
- "plugin:react/recommended"
9
- ],
10
- "parser": "babel-eslint",
11
- "parserOptions": {
12
- "ecmaFeatures": {
13
- "jsx": true
14
- },
15
- "ecmaVersion": 12,
16
- "sourceType": "module"
21
+ "ecmaVersion": 12,
22
+ "sourceType": "module"
23
+ },
24
+ "plugins": ["react", "jest"],
25
+ "rules": {
26
+ "react/display-name": "off"
27
+ },
28
+ "settings": {
29
+ "react": {
30
+ "version": "detect"
17
31
  },
18
- "plugins": [
19
- "react"
20
- ],
21
- "rules": {
22
- "react/display-name": "off"
32
+ "import/resolver": {
33
+ "alias": {
34
+ "map": [["src", "./src"]],
35
+ "extensions": [".ts", ".js", ".jsx", ".json"]
36
+ }
23
37
  }
38
+ },
39
+ "overrides": [
40
+ {
41
+ "files": ["*.js", "*.jsx"],
42
+ "rules": {
43
+ "prettier/prettier": ["error", { "trailingComma": "es5" }]
44
+ }
45
+ }
46
+ ]
24
47
  }
@@ -0,0 +1,56 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # ESLint is a tool for identifying and reporting on patterns
6
+ # found in ECMAScript/JavaScript code.
7
+ # More details at https://github.com/eslint/eslint
8
+ # and https://eslint.org
9
+
10
+ name: workflow
11
+
12
+ on:
13
+ push:
14
+ branches: ["master"]
15
+ pull_request:
16
+ # The branches below must be a subset of the branches above
17
+ branches: ["master"]
18
+ schedule:
19
+ - cron: "35 15 * * 3"
20
+
21
+ jobs:
22
+ eslint:
23
+ name: Eslint
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: read
27
+ security-events: write
28
+ actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29
+ steps:
30
+ - name: Checkout code
31
+ uses: actions/checkout@v3
32
+
33
+ - name: Install Packages
34
+ run: yarn
35
+
36
+ - name: Run ESLint
37
+ run: yarn lint
38
+ continue-on-error: false
39
+
40
+ jest:
41
+ name: Jest
42
+ runs-on: ubuntu-latest
43
+ permissions:
44
+ contents: read
45
+ security-events: write
46
+ actions: read
47
+ steps:
48
+ - name: Checkout code
49
+ uses: actions/checkout@v3
50
+
51
+ - name: Install Packages
52
+ run: yarn
53
+
54
+ - name: Run Jest
55
+ run: yarn jest
56
+ continue-on-error: false
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- React Image Gallery
2
- ===
1
+ # React Image Gallery
3
2
 
4
3
  [![npm version](https://badge.fury.io/js/react-image-gallery.svg)](https://badge.fury.io/js/react-image-gallery)
5
4
  [![Download Count](http://img.shields.io/npm/dm/react-image-gallery.svg?style=flat)](https://www.npmjs.com/package/react-image-gallery)
6
5
  [![Bundle size](https://badgen.net/bundlephobia/minzip/react-image-gallery)](https://bundlephobia.com/package/react-image-gallery)
7
6
 
8
7
  ### Live Demo (try it on mobile for swipe support)
8
+
9
9
  [`linxtion.com/demo/react-image-gallery`](http://linxtion.com/demo/react-image-gallery)
10
10
 
11
11
  ![demo gif](https://github.com/xiaolin/react-image-gallery/raw/master/static/image_gallery_v1.0.2.gif)
@@ -14,13 +14,13 @@ React image gallery is a React component for building image galleries and carous
14
14
 
15
15
  ## Features
16
16
 
17
- * Mobile swipe gestures
18
- * Thumbnail navigation
19
- * Fullscreen support
20
- * Custom rendered slides
21
- * RTL support
22
- * Responsive design
23
- * Tons of customization options (see props below)
17
+ - Mobile swipe gestures
18
+ - Thumbnail navigation
19
+ - Fullscreen support
20
+ - Custom rendered slides
21
+ - RTL support
22
+ - Responsive design
23
+ - Tons of customization options (see props below)
24
24
 
25
25
  ## Getting started
26
26
 
@@ -31,6 +31,7 @@ npm install react-image-gallery
31
31
  ```
32
32
 
33
33
  ### Style import (with webpack)
34
+
34
35
  ```
35
36
  # SCSS
36
37
  @import "~react-image-gallery/styles/scss/image-gallery.scss";
@@ -40,22 +41,24 @@ npm install react-image-gallery
40
41
  ```
41
42
 
42
43
  ### Example
44
+
43
45
  Need more example? See [`example/app.js`](https://github.com/xiaolin/react-image-gallery/blob/master/example/app.js)
46
+
44
47
  ```js
45
- import ImageGallery from 'react-image-gallery';
48
+ import ImageGallery from "react-image-gallery";
46
49
 
47
50
  const images = [
48
51
  {
49
- original: 'https://picsum.photos/id/1018/1000/600/',
50
- thumbnail: 'https://picsum.photos/id/1018/250/150/',
52
+ original: "https://picsum.photos/id/1018/1000/600/",
53
+ thumbnail: "https://picsum.photos/id/1018/250/150/",
51
54
  },
52
55
  {
53
- original: 'https://picsum.photos/id/1015/1000/600/',
54
- thumbnail: 'https://picsum.photos/id/1015/250/150/',
56
+ original: "https://picsum.photos/id/1015/1000/600/",
57
+ thumbnail: "https://picsum.photos/id/1015/250/150/",
55
58
  },
56
59
  {
57
- original: 'https://picsum.photos/id/1019/1000/600/',
58
- thumbnail: 'https://picsum.photos/id/1019/250/150/',
60
+ original: "https://picsum.photos/id/1019/1000/600/",
61
+ thumbnail: "https://picsum.photos/id/1019/250/150/",
59
62
  },
60
63
  ];
61
64
 
@@ -68,174 +71,174 @@ class MyGallery extends React.Component {
68
71
 
69
72
  # Props
70
73
 
71
- * `items`: (required) Array of objects, see example above,
72
- * Available Properties
73
- * `original` - image src url
74
- * `thumbnail` - image thumbnail src url
75
- * `fullscreen` - image for fullscreen (defaults to original)
76
- * `originalHeight` - image height (html5 attribute)
77
- * `originalWidth` - image width (html5 attribute)
78
- * `loading` - image loading. Either "lazy" or "eager" (html5 attribute)
79
- * `thumbnailHeight` - image height (html5 attribute)
80
- * `thumbnailWidth` - image width (html5 attribute)
81
- * `thumbnailLoading` - image loading. Either "lazy" or "eager" (html5 attribute)
82
- * `originalClass` - custom image class
83
- * `thumbnailClass` - custom thumbnail class
84
- * `renderItem` - Function for custom rendering a specific slide (see renderItem below)
85
- * `renderThumbInner` - Function for custom thumbnail renderer (see renderThumbInner below)
86
- * `originalAlt` - image alt
87
- * `thumbnailAlt` - thumbnail image alt
88
- * `originalTitle` - image title
89
- * `thumbnailTitle` - thumbnail image title
90
- * `thumbnailLabel` - label for thumbnail
91
- * `description` - description for image
92
- * `srcSet` - image srcset (html5 attribute)
93
- * `sizes` - image sizes (html5 attribute)
94
- * `bulletClass` - extra class for the bullet of the item
95
- * `bulletOnClick` - `callback({item, itemIndex, currentIndex})`
96
- * A function that will be called upon bullet click.
97
- * `infinite`: Boolean, default `true`
98
- * infinite sliding
99
- * `lazyLoad`: Boolean, default `false`
100
- * `showNav`: Boolean, default `true`
101
- * `showThumbnails`: Boolean, default `true`
102
- * `thumbnailPosition`: String, default `bottom`
103
- * available positions: `top, right, bottom, left`
104
- * `showFullscreenButton`: Boolean, default `true`
105
- * `useBrowserFullscreen`: Boolean, default `true`
106
- * if false, fullscreen will be done via css within the browser
107
- * `useTranslate3D`: Boolean, default `true`
108
- * if false, will use `translate` instead of `translate3d` css property to transition slides
109
- * `showPlayButton`: Boolean, default `true`
110
- * `isRTL`: Boolean, default `false`
111
- * if true, gallery's direction will be from right-to-left (to support right-to-left languages)
112
- * `showBullets`: Boolean, default `false`
113
- * `showIndex`: Boolean, default `false`
114
- * `autoPlay`: Boolean, default `false`
115
- * `disableThumbnailScroll`: Boolean, default `false`
116
- * disables the thumbnail container from adjusting
117
- * `disableKeyDown`: Boolean, default `false`
118
- * disables keydown listener for keyboard shortcuts (left arrow, right arrow, esc key)
119
- * `disableSwipe`: Boolean, default `false`
120
- * `disableThumbnailSwipe`: Boolean, default `false`
121
- * `onErrorImageURL`: String, default `undefined`
122
- * an image src pointing to your default image if an image fails to load
123
- * handles both slide image, and thumbnail image
124
- * `indexSeparator`: String, default `' / '`, ignored if `showIndex` is false
125
- * `slideDuration`: Number, default `450`
126
- * transition duration during image slide in milliseconds
127
- * `swipingTransitionDuration`: Number, default `0`
128
- * transition duration while swiping in milliseconds
129
- * `slideInterval`: Number, default `3000`
130
- * `slideOnThumbnailOver`: Boolean, default `false`
131
- * `flickThreshold`: Number (float), default `0.4`
132
- * Determines the max velocity of a swipe before it's considered a flick (lower = more sensitive)
133
- * `swipeThreshold`: Number, default `30`
134
- * A percentage of how far the offset of the current slide is swiped to trigger a slide event.
74
+ - `items`: (required) Array of objects, see example above,
75
+ - Available Properties
76
+ - `original` - image src url
77
+ - `thumbnail` - image thumbnail src url
78
+ - `fullscreen` - image for fullscreen (defaults to original)
79
+ - `originalHeight` - image height (html5 attribute)
80
+ - `originalWidth` - image width (html5 attribute)
81
+ - `loading` - image loading. Either "lazy" or "eager" (html5 attribute)
82
+ - `thumbnailHeight` - image height (html5 attribute)
83
+ - `thumbnailWidth` - image width (html5 attribute)
84
+ - `thumbnailLoading` - image loading. Either "lazy" or "eager" (html5 attribute)
85
+ - `originalClass` - custom image class
86
+ - `thumbnailClass` - custom thumbnail class
87
+ - `renderItem` - Function for custom rendering a specific slide (see renderItem below)
88
+ - `renderThumbInner` - Function for custom thumbnail renderer (see renderThumbInner below)
89
+ - `originalAlt` - image alt
90
+ - `thumbnailAlt` - thumbnail image alt
91
+ - `originalTitle` - image title
92
+ - `thumbnailTitle` - thumbnail image title
93
+ - `thumbnailLabel` - label for thumbnail
94
+ - `description` - description for image
95
+ - `srcSet` - image srcset (html5 attribute)
96
+ - `sizes` - image sizes (html5 attribute)
97
+ - `bulletClass` - extra class for the bullet of the item
98
+ - `infinite`: Boolean, default `true`
99
+ - infinite sliding
100
+ - `lazyLoad`: Boolean, default `false`
101
+ - `showNav`: Boolean, default `true`
102
+ - `showThumbnails`: Boolean, default `true`
103
+ - `thumbnailPosition`: String, default `bottom`
104
+ - available positions: `top, right, bottom, left`
105
+ - `showFullscreenButton`: Boolean, default `true`
106
+ - `useBrowserFullscreen`: Boolean, default `true`
107
+ - if false, fullscreen will be done via css within the browser
108
+ - `useTranslate3D`: Boolean, default `true`
109
+ - if false, will use `translate` instead of `translate3d` css property to transition slides
110
+ - `showPlayButton`: Boolean, default `true`
111
+ - `isRTL`: Boolean, default `false`
112
+ - if true, gallery's direction will be from right-to-left (to support right-to-left languages)
113
+ - `showBullets`: Boolean, default `false`
114
+ - `showIndex`: Boolean, default `false`
115
+ - `autoPlay`: Boolean, default `false`
116
+ - `disableThumbnailScroll`: Boolean, default `false`
117
+ - disables the thumbnail container from adjusting
118
+ - `disableKeyDown`: Boolean, default `false`
119
+ - disables keydown listener for keyboard shortcuts (left arrow, right arrow, esc key)
120
+ - `disableSwipe`: Boolean, default `false`
121
+ - `disableThumbnailSwipe`: Boolean, default `false`
122
+ - `onErrorImageURL`: String, default `undefined`
123
+ - an image src pointing to your default image if an image fails to load
124
+ - handles both slide image, and thumbnail image
125
+ - `indexSeparator`: String, default `' / '`, ignored if `showIndex` is false
126
+ - `slideDuration`: Number, default `450`
127
+ - transition duration during image slide in milliseconds
128
+ - `swipingTransitionDuration`: Number, default `0`
129
+ - transition duration while swiping in milliseconds
130
+ - `slideInterval`: Number, default `3000`
131
+ - `slideOnThumbnailOver`: Boolean, default `false`
132
+ - `flickThreshold`: Number (float), default `0.4`
133
+ - Determines the max velocity of a swipe before it's considered a flick (lower = more sensitive)
134
+ - `swipeThreshold`: Number, default `30`
135
+ - A percentage of how far the offset of the current slide is swiped to trigger a slide event.
135
136
  e.g. If the current slide is swiped less than 30% to the left or right, it will not trigger a slide event.
136
- * `stopPropagation`: Boolean, default `false`
137
- * Automatically calls stopPropagation on all 'swipe' events.
138
- * `startIndex`: Number, default `0`
139
- * `onImageError`: Function, `callback(event)`
140
- * overrides onErrorImage
141
- * `onThumbnailError`: Function, `callback(event)`
142
- * overrides onErrorImage
143
- * `onThumbnailClick`: Function, `callback(event, index)`
144
- * `onImageLoad`: Function, `callback(event)`
145
- * `onSlide`: Function, `callback(currentIndex)`
146
- * `onBeforeSlide`: Function, `callback(nextIndex)`
147
- * `onScreenChange`: Function, `callback(boolean)`
148
- * When fullscreen is toggled a boolean is passed to the callback
149
- * `onPause`: Function, `callback(currentIndex)`
150
- * `onPlay`: Function, `callback(currentIndex)`
151
- * `onClick`: Function, `callback(event)`
152
- * `onTouchMove`: Function, `callback(event) on gallery slide`
153
- * `onTouchEnd`: Function, `callback(event) on gallery slide`
154
- * `onTouchStart`: Function, `callback(event) on gallery slide`
155
- * `onMouseOver`: Function, `callback(event) on gallery slide`
156
- * `onMouseLeave`: Function, `callback(event) on gallery slide`
157
- * `additionalClass`: String,
158
- * Additional class that will be added to the root node of the component.
159
- * `renderCustomControls`: Function, custom controls rendering
160
- * Use this to render custom controls or other elements on the currently displayed image (like the fullscreen button)
137
+ - `stopPropagation`: Boolean, default `false`
138
+ - Automatically calls stopPropagation on all 'swipe' events.
139
+ - `startIndex`: Number, default `0`
140
+ - `onImageError`: Function, `callback(event)`
141
+ - overrides onErrorImage
142
+ - `onThumbnailError`: Function, `callback(event)`
143
+ - overrides onErrorImage
144
+ - `onThumbnailClick`: Function, `callback(event, index)`
145
+ - `onBulletClick`: Function, `callback(event, index)`
146
+ - `onImageLoad`: Function, `callback(event)`
147
+ - `onSlide`: Function, `callback(currentIndex)`
148
+ - `onBeforeSlide`: Function, `callback(nextIndex)`
149
+ - `onScreenChange`: Function, `callback(boolean)`
150
+ - When fullscreen is toggled a boolean is passed to the callback
151
+ - `onPause`: Function, `callback(currentIndex)`
152
+ - `onPlay`: Function, `callback(currentIndex)`
153
+ - `onClick`: Function, `callback(event)`
154
+ - `onTouchMove`: Function, `callback(event) on gallery slide`
155
+ - `onTouchEnd`: Function, `callback(event) on gallery slide`
156
+ - `onTouchStart`: Function, `callback(event) on gallery slide`
157
+ - `onMouseOver`: Function, `callback(event) on gallery slide`
158
+ - `onMouseLeave`: Function, `callback(event) on gallery slide`
159
+ - `additionalClass`: String,
160
+ - Additional class that will be added to the root node of the component.
161
+ - `renderCustomControls`: Function, custom controls rendering
162
+ - Use this to render custom controls or other elements on the currently displayed image (like the fullscreen button)
161
163
  ```javascript
162
164
  _renderCustomControls() {
163
165
  return <a href='' className='image-gallery-custom-action' onClick={this._customAction.bind(this)}/>
164
166
  }
165
167
  ```
166
- * `renderItem`: Function, custom item rendering
167
- * NOTE: Highly suggest looking into a render cache such as React.memo if you plan to override renderItem
168
- * On a specific item `[{thumbnail: '...', renderItem: this.myRenderItem}]`
169
- * As a prop passed into `ImageGallery` to completely override `renderItem`, see source for renderItem implementation
170
- * `renderThumbInner`: Function, custom thumbnail rendering
171
- * On a specific item `[{thumbnail: '...', renderThumbInner: this.myRenderThumbInner}]`
172
- * As a prop passed into `ImageGallery` to completely override `_renderThumbInner`, see source for reference
173
-
174
- * `renderLeftNav`: Function, custom left nav component
175
- * See [`<LeftNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/controls/LeftNav.js)
176
- * Use this to render a custom left nav control
177
- * Args:
178
- * `onClick` callback that will slide to the previous item
179
- * `disabled` boolean for when the nav is disabled
168
+ - `renderItem`: Function, custom item rendering
169
+ - NOTE: Highly suggest looking into a render cache such as React.memo if you plan to override renderItem
170
+ - On a specific item `[{thumbnail: '...', renderItem: this.myRenderItem}]`
171
+ - As a prop passed into `ImageGallery` to completely override `renderItem`, see source for renderItem implementation
172
+ - `renderThumbInner`: Function, custom thumbnail rendering
173
+
174
+ - On a specific item `[{thumbnail: '...', renderThumbInner: this.myRenderThumbInner}]`
175
+ - As a prop passed into `ImageGallery` to completely override `_renderThumbInner`, see source for reference
176
+
177
+ - `renderLeftNav`: Function, custom left nav component
178
+ - See [`<LeftNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/LeftNav.js)
179
+ - Use this to render a custom left nav control
180
+ - Args:
181
+ - `onClick` callback that will slide to the previous item
182
+ - `disabled` boolean for when the nav is disabled
180
183
  ```javascript
181
- renderLeftNav: (onClick, disabled) => (
182
- <LeftNav onClick={onClick} disabled={disabled} />
183
- )
184
+ renderLeftNav: (onClick, disabled) => (
185
+ <LeftNav onClick={onClick} disabled={disabled} />
186
+ );
184
187
  ```
185
- * `renderRightNav`: Function, custom right nav component
186
- * See [`<RightNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/controls/RightNav.js)
187
- * Use this to render a custom right nav control
188
- * Args:
189
- * `onClick` callback that will slide to the next item
190
- * `disabled` boolean for when the nav is disabled
188
+ - `renderRightNav`: Function, custom right nav component
189
+ - See [`<RightNav />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/RightNav.js)
190
+ - Use this to render a custom right nav control
191
+ - Args:
192
+ - `onClick` callback that will slide to the next item
193
+ - `disabled` boolean for when the nav is disabled
191
194
  ```javascript
192
- renderRightNav: (onClick, disabled) => (
193
- <RightNav onClick={onClick} disabled={disabled} />
194
- )
195
+ renderRightNav: (onClick, disabled) => (
196
+ <RightNav onClick={onClick} disabled={disabled} />
197
+ );
195
198
  ```
196
- * `renderPlayPauseButton`: Function, play pause button component
197
- * See [`<PlayPause />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/controls/PlayPause.js)
198
- * Use this to render a custom play pause button
199
- * Args:
200
- * `onClick` callback that will toggle play/pause
201
- * `isPlaying` boolean for when gallery is playing
199
+ - `renderPlayPauseButton`: Function, play pause button component
200
+ - See [`<PlayPause />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/PlayPause.js)
201
+ - Use this to render a custom play pause button
202
+ - Args:
203
+ - `onClick` callback that will toggle play/pause
204
+ - `isPlaying` boolean for when gallery is playing
202
205
  ```javascript
203
- renderPlayPauseButton: (onClick, isPlaying) => (
204
- <PlayPause onClick={onClick} isPlaying={isPlaying} />
205
- )
206
+ renderPlayPauseButton: (onClick, isPlaying) => (
207
+ <PlayPause onClick={onClick} isPlaying={isPlaying} />
208
+ );
206
209
  ```
207
- * `renderFullscreenButton`: Function, custom fullscreen button component
208
- * See [`<Fullscreen />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/controls/Fullscreen.js)
209
- * Use this to render a custom fullscreen button
210
- * Args:
211
- * `onClick` callback that will toggle fullscreen
212
- * `isFullscreen` argument for when fullscreen is active
210
+ - `renderFullscreenButton`: Function, custom fullscreen button component
211
+ - See [`<Fullscreen />`](https://github.com/xiaolin/react-image-gallery/blob/master/src/components/controls/Fullscreen.js)
212
+ - Use this to render a custom fullscreen button
213
+ - Args:
214
+ - `onClick` callback that will toggle fullscreen
215
+ - `isFullscreen` argument for when fullscreen is active
213
216
  ```javascript
214
217
  renderFullscreenButton: (onClick, isFullscreen) => (
215
218
  <Fullscreen onClick={onClick} isFullscreen={isFullscreen} />
216
219
  ),
217
220
  ```
218
- * `useWindowKeyDown`: Boolean, default `true`
219
- * If `true`, listens to keydown events on window (window.addEventListener)
220
- * If `false`, listens to keydown events on image gallery element (imageGalleryElement.addEventListener)
221
+ - `useWindowKeyDown`: Boolean, default `true`
222
+ - If `true`, listens to keydown events on window (window.addEventListener)
223
+ - If `false`, listens to keydown events on image gallery element (imageGalleryElement.addEventListener)
221
224
 
222
225
  # Functions
223
226
 
224
227
  The following functions can be accessed using [refs](https://reactjs.org/docs/refs-and-the-dom.html)
225
228
 
226
- * `play()`: plays the slides
227
- * `pause()`: pauses the slides
228
- * `toggleFullScreen()`: toggles full screen
229
- * `slideToIndex(index)`: slides to a specific index
230
- * `getCurrentIndex()`: returns the current index
229
+ - `play()`: plays the slides
230
+ - `pause()`: pauses the slides
231
+ - `toggleFullScreen()`: toggles full screen
232
+ - `slideToIndex(index)`: slides to a specific index
233
+ - `getCurrentIndex()`: returns the current index
231
234
 
232
235
  # Contributing
233
236
 
234
- Each PR should be specific and isolated to the issue you're trying to fix. Please do not stack features/chores/refactors/enhancements in one PR. Describe your feature/implementation in the PR. If you're unsure its useful or if it is a major change, please open an issue first and get feedback.
237
+ Each pull request (PR) should be specific and isolated to the issue you're trying to fix. Please do not stack features, chores, refactors, or enhancements in one PR. Describe your feature/implementation in the PR. If you're unsure whether it's useful or if it involves a major change, please open an issue first and seek feedback.
235
238
 
236
- * Follow eslint provided
237
- * Comment your code
238
- * Write [clean](https://github.com/ryanmcdermott/clean-code-javascript) code
239
+ - Follow eslint provided
240
+ - Comment your code
241
+ - Write [clean](https://github.com/ryanmcdermott/clean-code-javascript) code
239
242
 
240
243
  # Build the example locally (requires node >= 12.13)
241
244
 
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ["@babel/preset-env", "@babel/preset-react"],
3
+ };