yet-another-react-lightbox 2.1.1 → 2.1.3
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.
|
@@ -11,4 +11,4 @@ export declare type ImageSlideProps = {
|
|
|
11
11
|
onLoad?: (image: HTMLImageElement) => void;
|
|
12
12
|
style?: React.CSSProperties;
|
|
13
13
|
};
|
|
14
|
-
export declare const ImageSlide: ({ slide, offset, render, rect, imageFit, onClick, onLoad, style, }: ImageSlideProps) => JSX.Element;
|
|
14
|
+
export declare const ImageSlide: ({ slide: image, offset, render, rect, imageFit, onClick, onLoad, style, }: ImageSlideProps) => JSX.Element;
|
|
@@ -2,12 +2,12 @@ import * as React from "react";
|
|
|
2
2
|
export const useMotionPreference = () => {
|
|
3
3
|
const [reduceMotion, setReduceMotion] = React.useState(false);
|
|
4
4
|
React.useEffect(() => {
|
|
5
|
-
var _a;
|
|
5
|
+
var _a, _b;
|
|
6
6
|
const mediaQuery = (_a = window.matchMedia) === null || _a === void 0 ? void 0 : _a.call(window, "(prefers-reduced-motion: reduce)");
|
|
7
7
|
setReduceMotion(mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.matches);
|
|
8
|
-
const listener = () => setReduceMotion(
|
|
9
|
-
mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.addEventListener("change", listener);
|
|
10
|
-
return () => mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.removeEventListener("change", listener);
|
|
8
|
+
const listener = (event) => setReduceMotion(event.matches);
|
|
9
|
+
(_b = mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.addEventListener) === null || _b === void 0 ? void 0 : _b.call(mediaQuery, "change", listener);
|
|
10
|
+
return () => { var _a; return (_a = mediaQuery === null || mediaQuery === void 0 ? void 0 : mediaQuery.removeEventListener) === null || _a === void 0 ? void 0 : _a.call(mediaQuery, "change", listener); };
|
|
11
11
|
}, []);
|
|
12
12
|
return reduceMotion;
|
|
13
13
|
};
|
|
@@ -182,7 +182,9 @@ export const Controller = ({ children, ...props }) => {
|
|
|
182
182
|
...(swipeState === SwipeState.SWIPE
|
|
183
183
|
? { [cssVar("swipe_offset")]: `${Math.round(swipeOffset.current)}px` }
|
|
184
184
|
: null),
|
|
185
|
-
...(controller.touchAction !== "none"
|
|
185
|
+
...(controller.touchAction !== "none"
|
|
186
|
+
? { [cssVar("controller_touch_action")]: controller.touchAction }
|
|
187
|
+
: null),
|
|
186
188
|
...styles.container,
|
|
187
189
|
}, ...(controller.aria ? { role: "presentation", "aria-live": "polite" } : null), tabIndex: -1, ...registerSensors }, containerRect && React.createElement(ControllerContext.Provider, { value: context }, children)));
|
|
188
190
|
};
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yet-another-react-lightbox",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Modern React lightbox component",
|
|
5
5
|
"author": "Igor Danchenko",
|
|
6
6
|
"license": "MIT",
|
|
@@ -97,35 +97,35 @@
|
|
|
97
97
|
"@testing-library/jest-dom": "^5.16.5",
|
|
98
98
|
"@testing-library/react": "^13.4.0",
|
|
99
99
|
"@testing-library/user-event": "^14.4.3",
|
|
100
|
-
"@types/jest": "^
|
|
101
|
-
"@types/react": "^18.0.
|
|
100
|
+
"@types/jest": "^29.1.2",
|
|
101
|
+
"@types/react": "^18.0.21",
|
|
102
102
|
"@types/react-dom": "^18.0.6",
|
|
103
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
104
|
-
"@typescript-eslint/parser": "^5.
|
|
105
|
-
"autoprefixer": "^10.4.
|
|
106
|
-
"eslint": "^8.
|
|
103
|
+
"@typescript-eslint/eslint-plugin": "^5.39.0",
|
|
104
|
+
"@typescript-eslint/parser": "^5.39.0",
|
|
105
|
+
"autoprefixer": "^10.4.12",
|
|
106
|
+
"eslint": "^8.24.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",
|
|
110
110
|
"eslint-plugin-import": "^2.26.0",
|
|
111
111
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
112
112
|
"eslint-plugin-prettier": "^4.2.1",
|
|
113
|
-
"eslint-plugin-react": "^7.31.
|
|
113
|
+
"eslint-plugin-react": "^7.31.8",
|
|
114
114
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
115
115
|
"husky": "^8.0.1",
|
|
116
|
-
"jest": "^
|
|
117
|
-
"jest-environment-jsdom": "^
|
|
116
|
+
"jest": "^29.1.2",
|
|
117
|
+
"jest-environment-jsdom": "^29.1.2",
|
|
118
118
|
"lint-staged": "^13.0.3",
|
|
119
119
|
"npm-run-all": "^4.1.5",
|
|
120
|
-
"postcss": "^8.4.
|
|
120
|
+
"postcss": "^8.4.17",
|
|
121
121
|
"postcss-cli": "^10.0.0",
|
|
122
122
|
"prettier": "^2.7.1",
|
|
123
123
|
"react": "^18.2.0",
|
|
124
124
|
"react-dom": "^18.2.0",
|
|
125
125
|
"rimraf": "^3.0.2",
|
|
126
|
-
"sass": "^1.
|
|
127
|
-
"ts-jest": "^
|
|
128
|
-
"typescript": "^4.8.
|
|
126
|
+
"sass": "^1.55.0",
|
|
127
|
+
"ts-jest": "^29.0.3",
|
|
128
|
+
"typescript": "^4.8.4"
|
|
129
129
|
},
|
|
130
130
|
"keywords": [
|
|
131
131
|
"react",
|