Skip to content

Commit 6cba0a8

Browse files
authored
Merge pull request #183 from itoldya/v1
Release v1.0.0
2 parents edc11bd + a87aeee commit 6cba0a8

File tree

70 files changed

+10164
-11891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+10164
-11891
lines changed

.babelrc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2-
"presets": ["@babel/preset-env", "@babel/preset-react"],
2+
"presets": [
3+
"@babel/preset-typescript",
4+
"@babel/preset-env",
5+
["@babel/preset-react", {
6+
"runtime": "automatic"
7+
}]
8+
],
39
"plugins": []
410
}

.github/workflows/pages.yml

-41
This file was deleted.

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ dist/
66
lib/
77
.publish
88
.DS_Store
9-
.idea
9+
.idea
10+
.cache

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# react-grid-gallery
1+
# CHANGELOG
2+
3+
The most recent changelog is available on the [releases page](https://github.com/benhowell/react-grid-gallery/releases).
4+
5+
### v0.5.6 / 2022-08-23
6+
7+
* Fixed grid breakdown when container width is decimal [#170](https://github.com/benhowell/react-grid-gallery/pull/170), closes [#84](https://github.com/benhowell/react-grid-gallery/issues/84)
8+
* TypeScript declaration file added [#173](https://github.com/benhowell/react-grid-gallery/pull/173), closes [#145](https://github.com/benhowell/react-grid-gallery/issues/145)
9+
* Added defaultContainerWidth option for SSR rendering support [#175](https://github.com/benhowell/react-grid-gallery/pull/175)
210

311
### v0.5.5 / 2019-06-20
412

README.md

+72-133
Large diffs are not rendered by default.

UPGRADE_GUIDE.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# From v0.5.x
2+
3+
The biggest change from v0.5.x to 1.x.x is that now this library has no lightbox functionality.
4+
Read [this discussion](https://github.com/benhowell/react-grid-gallery/discussions/179) to learn more about the motivation for that decision.
5+
So if you want need lightbox integration please check out our [examples](https://benhowell.github.io/react-grid-gallery/).
6+
7+
## API changes
8+
Also, we made API polishing and renamed some props, and changed event handler signatures.
9+
10+
### Gallery Options changes
11+
- `onSelectImage` renamed to `onSelect`
12+
- `onClickThumbnail` renamed to `onClick`
13+
14+
Both event handlers now receive the same arguments:
15+
```ts
16+
(index: number, item: Image, event: MouseEvent<HTMLElement>) => void
17+
```
18+
19+
Styling props such as `thumbnailStyle`, `tagStyle`, `tileViewportStyle` now get some extra data as arguments, read more in [the docs](https://github.com/benhowell/react-grid-gallery#gallery-options).
20+
21+
In [v0.5.x docs](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6#programmers-notes) there was a hacky access to `this` in event handlers.
22+
After lightbox functionality was stripped out it's not needed and removed.
23+
24+
In [v0.5.x](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6), there was [hacky access](https://github.com/benhowell/react-grid-gallery/tree/v0.5.6#programmers-notes) to `this` in event handlers. After lightbox functionality was stripped out this hack was removed as well.
25+
26+
### Image Options changes
27+
- `thumbnail` renamed to `src`
28+
- `thumbnailWidth` renamed to `width`
29+
- `thumbnailHeight` renamed to `height`
30+
31+
So now the minimum image object looks like this
32+
33+
```json
34+
{
35+
"src": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Apples.jpg/320px-Apples.jpg",
36+
"width": 320,
37+
"height": 480
38+
}
39+
```
40+
41+
42+
## No default import
43+
44+
React grid gallery now uses only named export. Please update import to
45+
```js
46+
import { Gallery } from "react-grid-gallery";
47+
```

0 commit comments

Comments
 (0)