react-photo-album
Advanced tools
Comparing version 1.13.1 to 1.13.2
@@ -653,5 +653,5 @@ 'use strict'; | ||
}; | ||
const resolveResponsiveParameter = (parameter, containerWidth, values) => { | ||
const resolveResponsiveParameter = (parameter, containerWidth, values, minValue = 0) => { | ||
const value = unwrapParameter(parameter, containerWidth); | ||
return value === undefined ? selectResponsiveValue(values, containerWidth) : value; | ||
return Math.round(Math.max(value === undefined ? selectResponsiveValue(values, containerWidth) : value, minValue)); | ||
}; | ||
@@ -664,3 +664,3 @@ | ||
containerWidth, | ||
columns: resolveResponsiveParameter(columns, containerWidth, [5, 4, 3, 2]), | ||
columns: resolveResponsiveParameter(columns, containerWidth, [5, 4, 3, 2], 1), | ||
spacing: resolveResponsiveParameter(spacing, containerWidth, [20, 15, 10, 5]), | ||
@@ -677,5 +677,3 @@ padding: resolveResponsiveParameter(padding, containerWidth, [0, 0, 0, 0, 0]), | ||
}); | ||
const resolveComponentsProps = (componentsProps, containerWidth) => { | ||
return typeof componentsProps === "function" ? componentsProps(containerWidth) : componentsProps; | ||
}; | ||
const resolveComponentsProps = (componentsProps, containerWidth) => typeof componentsProps === "function" ? componentsProps(containerWidth) : componentsProps; | ||
const PhotoAlbum = (props) => { | ||
@@ -682,0 +680,0 @@ const { photos, layout, renderPhoto, renderContainer, renderRowContainer, renderColumnContainer, defaultContainerWidth, resizeObserverProvider, breakpoints, instrumentation, } = props; |
@@ -649,5 +649,5 @@ import { jsx, Fragment } from 'react/jsx-runtime'; | ||
}; | ||
const resolveResponsiveParameter = (parameter, containerWidth, values) => { | ||
const resolveResponsiveParameter = (parameter, containerWidth, values, minValue = 0) => { | ||
const value = unwrapParameter(parameter, containerWidth); | ||
return value === undefined ? selectResponsiveValue(values, containerWidth) : value; | ||
return Math.round(Math.max(value === undefined ? selectResponsiveValue(values, containerWidth) : value, minValue)); | ||
}; | ||
@@ -660,3 +660,3 @@ | ||
containerWidth, | ||
columns: resolveResponsiveParameter(columns, containerWidth, [5, 4, 3, 2]), | ||
columns: resolveResponsiveParameter(columns, containerWidth, [5, 4, 3, 2], 1), | ||
spacing: resolveResponsiveParameter(spacing, containerWidth, [20, 15, 10, 5]), | ||
@@ -673,5 +673,3 @@ padding: resolveResponsiveParameter(padding, containerWidth, [0, 0, 0, 0, 0]), | ||
}); | ||
const resolveComponentsProps = (componentsProps, containerWidth) => { | ||
return typeof componentsProps === "function" ? componentsProps(containerWidth) : componentsProps; | ||
}; | ||
const resolveComponentsProps = (componentsProps, containerWidth) => typeof componentsProps === "function" ? componentsProps(containerWidth) : componentsProps; | ||
const PhotoAlbum = (props) => { | ||
@@ -678,0 +676,0 @@ const { photos, layout, renderPhoto, renderContainer, renderRowContainer, renderColumnContainer, defaultContainerWidth, resizeObserverProvider, breakpoints, instrumentation, } = props; |
{ | ||
"name": "react-photo-album", | ||
"version": "1.13.1", | ||
"version": "1.13.2", | ||
"description": "Responsive photo gallery component for React", | ||
@@ -43,12 +43,12 @@ "author": "Igor Danchenko", | ||
"@commitlint/config-conventional": "^16.2.4", | ||
"@rollup/plugin-node-resolve": "^13.2.1", | ||
"@rollup/plugin-node-resolve": "^13.3.0", | ||
"@semantic-release/changelog": "^6.0.1", | ||
"@semantic-release/github": "^8.0.4", | ||
"@testing-library/react": "^13.1.1", | ||
"@types/jest": "^27.4.1", | ||
"@types/jest": "^27.5.0", | ||
"@types/react": "^18.0.8", | ||
"@types/react-dom": "^18.0.0", | ||
"@types/react-dom": "^18.0.3", | ||
"@types/react-test-renderer": "^18.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.21.0", | ||
"@typescript-eslint/parser": "^5.21.0", | ||
"@typescript-eslint/eslint-plugin": "^5.22.0", | ||
"@typescript-eslint/parser": "^5.22.0", | ||
"eslint": "^8.14.0", | ||
@@ -61,3 +61,4 @@ "eslint-config-prettier": "^8.5.0", | ||
"husky": "^7.0.4", | ||
"jest": "^27.5.1", | ||
"jest": "^28.0.3", | ||
"jest-environment-jsdom": "^28.0.2", | ||
"lint-staged": "^12.4.1", | ||
@@ -69,8 +70,8 @@ "prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.70.2", | ||
"rollup": "^2.71.1", | ||
"rollup-plugin-dts": "^4.2.1", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-typescript2": "^0.31.2", | ||
"ts-jest": "^27.1.4", | ||
"typescript": "^4.6.3" | ||
"ts-jest": "^28.0.0", | ||
"typescript": "^4.6.4" | ||
}, | ||
@@ -77,0 +78,0 @@ "keywords": [ |
81816
33
1472