@financial-times/ads-display
Advanced tools
Comparing version 4.0.0-beta.1 to 4.0.0-beta.2
@@ -20,6 +20,14 @@ import oTracking from '@financial-times/o-tracking'; | ||
* Returns the margin to apply to the viewport as a percentage string given an object of sizes | ||
* @param {Object} breakpointMargins object with size as key and margin to apply as a value if the size is lower than the breakpoint | ||
* example: { 700: '15%', 500: '10%'} if the viewport size is under 500px then 10% will be applied | ||
* @param {Int} viewportSize current viewport size | ||
* @returns {String} Percentage of margin to apply | ||
* | ||
* breakpointMargins: object with size as key and margin to apply as a value if | ||
* the size is lower than the breakpoint | ||
* Example: | ||
* { 700: '15%', 500: '10%' } if the viewport size is under 500px then 10% will be applied | ||
* | ||
* @param {{ | ||
* breakpointMargins: Record<string, string>, | ||
* viewportSize: number, | ||
* fallbackValue: string | ||
* }} props | ||
* @returns {string} Percentage of margin to apply | ||
*/ | ||
@@ -35,6 +43,6 @@ const calculateViewportMargin = ({ | ||
// find the size that is just higher than the viewportsize | ||
// Find the size that is just higher than the viewportsize | ||
const nextHighestBreakpointKey = Object.keys(breakpointMargins) | ||
.sort() | ||
.find((a) => a > viewportSize); | ||
.find((a) => +a > viewportSize); | ||
@@ -71,3 +79,3 @@ return breakpointMargins[nextHighestBreakpointKey] || fallbackValue | ||
*/ | ||
function hideIframedImagesBelow(collapseBelow = 600) { | ||
function hideIframedImagesBelow(collapseBelow = 740) { | ||
/** | ||
@@ -74,0 +82,0 @@ * @type {EventListener} |
@@ -1,11 +0,6 @@ | ||
module.exports = { | ||
clearMocks: true, | ||
coverageProvider: "v8", | ||
testEnvironment: "jest-environment-jsdom-global", | ||
resolver: "./resolver.js", | ||
"transformIgnorePatterns": [ | ||
"node_modules/(?!@financial-times)" | ||
] | ||
}; | ||
clearMocks: true, | ||
coverageProvider: 'v8', | ||
resolver: './resolver.js', | ||
transformIgnorePatterns: ['node_modules/(?!@financial-times)'], | ||
} |
{ | ||
"name": "@financial-times/ads-display", | ||
"version": "4.0.0-beta.1", | ||
"version": "4.0.0-beta.2", | ||
"description": "Bring ads to your page with the FT specific o-ads configuration", | ||
@@ -40,5 +40,5 @@ "browser": "dist/client.js", | ||
"dependencies": { | ||
"@financial-times/ads-legacy-o-ads": "^4.0.0-beta.1", | ||
"@financial-times/ads-moat-integration": "^4.0.0-beta.1", | ||
"@financial-times/ads-permutive": "^4.0.0-beta.1", | ||
"@financial-times/ads-legacy-o-ads": "^4.0.0-beta.2", | ||
"@financial-times/ads-moat-integration": "^4.0.0-beta.2", | ||
"@financial-times/ads-permutive": "^4.0.0-beta.2", | ||
"@financial-times/n-tracking": "4.0.0", | ||
@@ -58,3 +58,2 @@ "@financial-times/o-tracking": "^4.0.0", | ||
"jest": "^26.0.0", | ||
"jest-environment-jsdom-global": "^2.0.4", | ||
"jest-fetch-mock": "^3.0.3", | ||
@@ -61,0 +60,0 @@ "lint-staged": "^10.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18
946
52934