Skip to content

Commit a023dae

Browse files
authoredFeb 28, 2025
Merge pull request #107 from jsonkao/update-deps
React 19 + other upgrades
2 parents ab08bd3 + fe94cb1 commit a023dae

17 files changed

+16431
-36124
lines changed
 

‎.eslintrc

-34
This file was deleted.

‎CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
This file includes all notable changes made to this project (since `v2.4.0`. Before that unfortunately there was not a record maintained)
4+
5+
The format of this file is from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this
6+
project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [2.4.0]
9+
10+
### Added
11+
12+
- This changelog file (#107)
13+
14+
### Changed
15+
16+
- Upgrade to React 19 (#107)

‎README.md

+32-30
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
React Scrollama is a simple and silky library for scrollytelling. It relies on IntersectionObserver and sticky positioning over scroll listeners. It is originally adapted from [Russel Samora's](https://russellsamora.github.io/) [Scrollama](https://github.com/russellgoldenberg/scrollama).
1010

1111
A few examples of ambitious interactive stories that were built with React Scrollama…
12+
1213
<table>
1314
<tbody>
1415
<tr>
@@ -67,6 +68,7 @@ A live demo [lives here](https://jsonkao.github.io/react-scrollama). It was debu
6768
## Install
6869

6970
React Scrollama can be installed as an [npm package](https://www.npmjs.com/package/react-scrollama):
71+
7072
```
7173
$ npm install react-scrollama
7274
```
@@ -138,14 +140,14 @@ React Scrollama components do not render into the DOM. They are meant to set up
138140

139141
These are the props you can set on the `Scrollama` component itself:
140142

141-
| Prop | Type | Default | Description |
142-
|----------------|---------------------------|---------|-----------------------------------------------------------------------------------------|
143-
| offset | `number` (from 0 to 1) or pixel value (e.g. "300px") | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
144-
| threshold | `number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) |
145-
| onStepEnter | `function` | | Callback that fires when the top or bottom edge of a step enters the offset threshold. |
146-
| onStepExit | `function` | | Callback that fires when the top or bottom edge of a step exits the offset threshold. |
147-
| onStepProgress | `function` | | Callback that fires the progress a step has made through the threshold. |
148-
| debug | `boolean` | false | Whether to show visual debugging tools. |
143+
| Prop | Type | Default | Description |
144+
| -------------- | ---------------------------------------------------- | ------- | --------------------------------------------------------------------------------------- |
145+
| offset | `number` (from 0 to 1) or pixel value (e.g. "300px") | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
146+
| threshold | `number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) |
147+
| onStepEnter | `function` | | Callback that fires when the top or bottom edge of a step enters the offset threshold. |
148+
| onStepExit | `function` | | Callback that fires when the top or bottom edge of a step exits the offset threshold. |
149+
| onStepProgress | `function` | | Callback that fires the progress a step has made through the threshold. |
150+
| debug | `boolean` | false | Whether to show visual debugging tools. |
149151

150152
The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, with the following properties:
151153

@@ -179,36 +181,36 @@ A `Step` element can contain one child, which must be a DOM element. To use a Re
179181
These are the props you can set on the `Step` component:
180182

181183
| Prop | Type | Default | Description |
182-
|------|------|---------|------------------------------------------------------------------|
184+
| ---- | ---- | ------- | ---------------------------------------------------------------- |
183185
| data | any | | Data to be given to `<Scrollama>` callbacks when step triggered. |
184186

185187
You will also probably want to set a `key` prop on each `Step` if you're transforming an array of data into a list of `Step` elements (see [Lists and Keys](https://reactjs.org/docs/lists-and-keys.html)).
186188

187189
## Thank you to everyone who made this possible!
188190

189-
* [jsonkao](https://github.com/jsonkao)
190-
* [maerzhase](https://github.com/maerzhase)
191-
* [NicholasLYang](https://github.com/NicholasLYang)
192-
* [jonesbp](https://github.com/jonesbp)
193-
* [kennethormandy](https://github.com/kennethormandy)
194-
* [cedricdelpoux](https://github.com/cedricdelpoux)
195-
* [davidnmora](https://github.com/davidnmora)
196-
* [jefffriesen](https://github.com/jefffriesen)
197-
* [paolocorti](https://github.com/paolocorti)
198-
* [elbertwang3](https://github.com/elbertwang3)
199-
* [michaelgrotton](https://github.com/michaelgrotton)
200-
* [jjrchrds](https://github.com/jjrchrds)
201-
* [goleary](https://github.com/goleary)
202-
* [danieleguido](https://github.com/danieleguido)
203-
* [Lane](https://github.com/Lane)
204-
* [jkjustjoshing](https://github.com/jkjustjoshing)
205-
* [tuckergordon](https://github.com/tuckergordon)
206-
* [fschwander](https://github.com/fschwander)
207-
* [thisispaul](https://github.com/thisispaul)
191+
- [jsonkao](https://github.com/jsonkao)
192+
- [maerzhase](https://github.com/maerzhase)
193+
- [NicholasLYang](https://github.com/NicholasLYang)
194+
- [jonesbp](https://github.com/jonesbp)
195+
- [kennethormandy](https://github.com/kennethormandy)
196+
- [cedricdelpoux](https://github.com/cedricdelpoux)
197+
- [davidnmora](https://github.com/davidnmora)
198+
- [jefffriesen](https://github.com/jefffriesen)
199+
- [paolocorti](https://github.com/paolocorti)
200+
- [elbertwang3](https://github.com/elbertwang3)
201+
- [michaelgrotton](https://github.com/michaelgrotton)
202+
- [jjrchrds](https://github.com/jjrchrds)
203+
- [goleary](https://github.com/goleary)
204+
- [danieleguido](https://github.com/danieleguido)
205+
- [Lane](https://github.com/Lane)
206+
- [jkjustjoshing](https://github.com/jkjustjoshing)
207+
- [tuckergordon](https://github.com/tuckergordon)
208+
- [fschwander](https://github.com/fschwander)
209+
- [thisispaul](https://github.com/thisispaul)
208210

209211
## Features roadmap
210212

211-
* Currently, there is no way to throttle/customize React Scrollama's [resize listener](https://github.com/jsonkao/react-scrollama/blob/master/src/Scrollama.js#L104) 😢. We're working on this in [#44](https://github.com/jsonkao/react-scrollama/issues/44).
212-
* Fire previous step triggers if they were jumped
213+
- Currently, there is no way to throttle/customize React Scrollama's [resize listener](https://github.com/jsonkao/react-scrollama/blob/master/src/Scrollama.js#L104) 😢. We're working on this in [#44](https://github.com/jsonkao/react-scrollama/issues/44).
214+
- Fire previous step triggers if they were jumped
213215

214216
Lmk if you need these features ASAP.

‎eslint.config.mjs

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import globals from 'globals';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import jsxA11y from 'eslint-plugin-jsx-a11y';
6+
import pluginJs from '@eslint/js';
7+
import { includeIgnoreFile } from '@eslint/compat';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const gitignorePath = path.resolve(__dirname, '.gitignore');
12+
13+
export default [
14+
pluginJs.configs.recommended,
15+
reactPlugin.configs.flat.recommended,
16+
reactPlugin.configs.flat['jsx-runtime'],
17+
jsxA11y.flatConfigs.recommended,
18+
includeIgnoreFile(gitignorePath),
19+
{
20+
languageOptions: {
21+
globals: {
22+
...globals.browser,
23+
},
24+
sourceType: 'module',
25+
},
26+
27+
settings: {
28+
react: {
29+
version: 'detect',
30+
},
31+
},
32+
33+
rules: {
34+
'import/no-named-as-default': 0,
35+
'import/no-named-as-default-member': 0,
36+
'import/first': 0,
37+
38+
'react/prop-types': [
39+
2,
40+
{
41+
skipUndeclared: true,
42+
},
43+
],
44+
45+
'arrow-parens': [2, 'as-needed'],
46+
47+
'jsx-a11y/anchor-is-valid': [
48+
'error',
49+
{
50+
components: ['Link'],
51+
specialLink: ['to'],
52+
aspects: ['noHref', 'invalidHref', 'preferButton'],
53+
},
54+
],
55+
},
56+
},
57+
];

0 commit comments

Comments
 (0)
Please sign in to comment.