yet-another-react-lightbox 2.2.3 → 2.2.5

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.
@@ -41,6 +41,15 @@ export const usePointerSwipe = (subscribeSensors, isSwipeValid, containerWidth,
41
41
  const onPointerMove = useEventCallback((event) => {
42
42
  const pointer = pointers.current.find((p) => p.pointerId === event.pointerId);
43
43
  if (pointer) {
44
+ const isCurrentPointer = activePointer.current === event.pointerId;
45
+ if (event.buttons === 0) {
46
+ if (isCurrentPointer && offset.current > 0) {
47
+ onSwipeCancel(offset.current);
48
+ offset.current = 0;
49
+ }
50
+ clearPointer(pointer);
51
+ return;
52
+ }
44
53
  const deltaX = event.clientX - pointer.clientX;
45
54
  const deltaY = event.clientY - pointer.clientY;
46
55
  if (!activePointer.current &&
@@ -52,7 +61,7 @@ export const usePointerSwipe = (subscribeSensors, isSwipeValid, containerWidth,
52
61
  startTime.current = Date.now();
53
62
  onSwipeStart();
54
63
  }
55
- else if (activePointer.current === event.pointerId) {
64
+ else if (isCurrentPointer) {
56
65
  offset.current = deltaX;
57
66
  onSwipeProgress(deltaX);
58
67
  }
@@ -9,7 +9,7 @@ export const Video = ({ augment }) => {
9
9
  render: {
10
10
  slide: (slide, offset, rect) => {
11
11
  if (slide.type === "video") {
12
- return React.createElement(VideoSlide, { slide: slide, offset: offset });
12
+ return (React.createElement(VideoSlide, { key: `${slide.sources.map((source) => source.src).join(" ")}`, slide: slide, offset: offset }));
13
13
  }
14
14
  return renderSlide === null || renderSlide === void 0 ? void 0 : renderSlide(slide, offset, rect);
15
15
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yet-another-react-lightbox",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Modern React lightbox component",
5
5
  "author": "Igor Danchenko",
6
6
  "license": "MIT",
@@ -99,11 +99,11 @@
99
99
  "@testing-library/user-event": "^14.4.3",
100
100
  "@types/jest": "^29.2.4",
101
101
  "@types/react": "^18.0.26",
102
- "@types/react-dom": "^18.0.9",
103
- "@typescript-eslint/eslint-plugin": "^5.45.1",
104
- "@typescript-eslint/parser": "^5.45.1",
102
+ "@types/react-dom": "^18.0.10",
103
+ "@typescript-eslint/eslint-plugin": "^5.47.0",
104
+ "@typescript-eslint/parser": "^5.47.0",
105
105
  "autoprefixer": "^10.4.13",
106
- "eslint": "^8.29.0",
106
+ "eslint": "^8.30.0",
107
107
  "eslint-config-airbnb": "^19.0.4",
108
108
  "eslint-config-airbnb-typescript": "^17.0.0",
109
109
  "eslint-config-prettier": "^8.5.0",
@@ -117,15 +117,15 @@
117
117
  "jest-environment-jsdom": "^29.3.1",
118
118
  "lint-staged": "^13.1.0",
119
119
  "npm-run-all": "^4.1.5",
120
- "postcss": "^8.4.19",
120
+ "postcss": "^8.4.20",
121
121
  "postcss-cli": "^10.1.0",
122
122
  "prettier": "^2.8.1",
123
123
  "react": "^18.2.0",
124
124
  "react-dom": "^18.2.0",
125
125
  "rimraf": "^3.0.2",
126
- "sass": "^1.56.1",
126
+ "sass": "^1.57.1",
127
127
  "ts-jest": "^29.0.3",
128
- "typescript": "^4.9.3"
128
+ "typescript": "^4.9.4"
129
129
  },
130
130
  "keywords": [
131
131
  "react",