@schibsted/niche-ads
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -13,30 +13,15 @@ export default AdContext; | ||
export namespace AdContextProvider { | ||
namespace propTypes { | ||
let adsConfig: any; | ||
let cdn: any; | ||
let children: any; | ||
let cogwheelCdn: any; | ||
let device: any; | ||
let eids: any; | ||
let glimr: any; | ||
let wallpaper: any; | ||
} | ||
namespace defaultProps { | ||
let cdn_1: string; | ||
export { cdn_1 as cdn }; | ||
let cogwheelCdn_1: string; | ||
export { cogwheelCdn_1 as cogwheelCdn }; | ||
let device_1: null; | ||
export { device_1 as device }; | ||
export namespace eids_1 { | ||
let cdn: string; | ||
let cogwheelCdn: string; | ||
let device: null; | ||
namespace eids { | ||
let required: boolean; | ||
let region: string; | ||
} | ||
export { eids_1 as eids }; | ||
export namespace glimr_1 { | ||
namespace glimr { | ||
export let enabled: boolean; | ||
export { noop as shouldLoad }; | ||
} | ||
export { glimr_1 as glimr }; | ||
export namespace wallpaper_1 { | ||
namespace wallpaper { | ||
let enabled_1: boolean; | ||
@@ -47,3 +32,2 @@ export { enabled_1 as enabled }; | ||
} | ||
export { wallpaper_1 as wallpaper }; | ||
} | ||
@@ -50,0 +34,0 @@ } |
@@ -14,3 +14,2 @@ "use strict"; | ||
const react_1 = require("react"); | ||
const prop_types_1 = require("prop-types"); | ||
const splitEvery_1 = require("./utils/splitEvery"); | ||
@@ -250,101 +249,2 @@ const appnexus_1 = require("./utils/appnexus"); | ||
exports.AdContextProvider = AdContextProvider; | ||
const PlacementPropTypes = prop_types_1.default.shape({ | ||
targetId: prop_types_1.default.string.isRequired, | ||
invCode: prop_types_1.default.string, | ||
sizes: prop_types_1.default.arrayOf(prop_types_1.default.arrayOf(prop_types_1.default.number.isRequired).isRequired).isRequired, | ||
keywords: prop_types_1.default.shape({ | ||
'no-sno-adformat': prop_types_1.default.oneOfType([prop_types_1.default.string, prop_types_1.default.arrayOf(prop_types_1.default.string)]), | ||
}), | ||
}).isRequired; | ||
const PlacementsByPagePropTypes = prop_types_1.default.shape({ | ||
front: prop_types_1.default.arrayOf(PlacementPropTypes), | ||
article: prop_types_1.default.arrayOf(PlacementPropTypes), | ||
other: prop_types_1.default.arrayOf(PlacementPropTypes), | ||
}).isRequired; | ||
AdContextProvider.propTypes = { | ||
adsConfig: prop_types_1.default.shape({ | ||
options: prop_types_1.default.shape({ | ||
member: prop_types_1.default.number.isRequired, | ||
disablePsa: prop_types_1.default.bool, | ||
enableSafeFrame: prop_types_1.default.bool, | ||
}).isRequired, | ||
keywords: prop_types_1.default.shape({ | ||
common: prop_types_1.default.shape({ | ||
'aa-sch-country_code': prop_types_1.default.string, | ||
'aa-sch-publisher': prop_types_1.default.string, | ||
'no-sno-publishergroup': prop_types_1.default.string, | ||
}), | ||
desktop: prop_types_1.default.shape({ | ||
common: prop_types_1.default.shape({ | ||
'aa-sch-supply_type': prop_types_1.default.string, | ||
}), | ||
front: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
article: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
other: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
}), | ||
tablet: prop_types_1.default.shape({ | ||
common: prop_types_1.default.shape({ | ||
'aa-sch-supply_type': prop_types_1.default.string, | ||
}), | ||
front: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
article: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
other: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
}), | ||
mobile: prop_types_1.default.shape({ | ||
common: prop_types_1.default.shape({ | ||
'aa-sch-supply_type': prop_types_1.default.string, | ||
}), | ||
front: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
article: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
other: prop_types_1.default.shape({ | ||
'aa-sch-page_type': prop_types_1.default.string, | ||
}), | ||
}), | ||
}), | ||
placements: prop_types_1.default.shape({ | ||
common: prop_types_1.default.shape({ | ||
noBidIfUnsold: prop_types_1.default.bool, | ||
}), | ||
desktop: PlacementsByPagePropTypes, | ||
tablet: PlacementsByPagePropTypes, | ||
mobile: PlacementsByPagePropTypes, | ||
}).isRequired, | ||
}).isRequired, | ||
cdn: prop_types_1.default.string, | ||
children: prop_types_1.default.node.isRequired, | ||
cogwheelCdn: prop_types_1.default.string, | ||
device: prop_types_1.default.oneOf(['desktop', 'tablet', 'mobile']), | ||
eids: prop_types_1.default.shape({ | ||
required: prop_types_1.default.bool.isRequired, | ||
region: prop_types_1.default.oneOf(['SCHNO', 'SCHSE']).isRequired, | ||
}), | ||
glimr: prop_types_1.default.shape({ | ||
enabled: prop_types_1.default.bool.isRequired, | ||
shouldLoad: prop_types_1.default.func.isRequired, | ||
clientId: prop_types_1.default.string, | ||
localStorageKey: prop_types_1.default.string, | ||
localStorageExpiration: prop_types_1.default.number, | ||
}), | ||
wallpaper: prop_types_1.default.shape({ | ||
enabled: prop_types_1.default.bool.isRequired, | ||
setWallpaperFunction: prop_types_1.default.func.isRequired, | ||
setBackgroundColorFunction: prop_types_1.default.func.isRequired, | ||
}), | ||
}; | ||
AdContextProvider.defaultProps = { | ||
@@ -351,0 +251,0 @@ cdn: 'https://acdn.adnxs.com/ast/ast.js', |
@@ -18,3 +18,2 @@ "use strict"; | ||
function getGlimrTags(options) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -25,3 +24,3 @@ const cachedTags = (0, localStorage_1.getFromLocalStorageWithExpiration)(options.localStorageKey || LOCAL_STORAGE_KEY, options.localStorageExpiration || LOCAL_STORAGE_EXPIRATION); | ||
} | ||
const glimr = (_a = (yield Promise.resolve().then(() => require('glimr-sdk')))) === null || _a === void 0 ? void 0 : _a.default; | ||
const glimr = yield Promise.resolve().then(() => require('glimr-sdk')); | ||
glimr.setTagCacheTimeInSeconds(300); // 300 is max https://developer.glimr.io/docs/retrieving-audiences#settagcachetimeinseconds | ||
@@ -28,0 +27,0 @@ return new Promise((resolve) => { |
{ | ||
"name": "@schibsted/niche-ads", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Package containing ads logic reappearing across our projects", | ||
@@ -26,4 +26,3 @@ "main": "lib/index.js", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"prop-types": "^15.8.1" | ||
"eslint-plugin-react-hooks": "^4.6.0" | ||
}, | ||
@@ -36,3 +35,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "0e815fe9607c465fb447838bce914616181bdea1" | ||
"gitHead": "5a8a82fc1ac371f69ee448fe23840b3421e2288a" | ||
} |
import { createContext, useMemo, useRef, useEffect, useCallback } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import splitEvery from './utils/splitEvery'; | ||
@@ -310,104 +309,2 @@ import { | ||
const PlacementPropTypes = PropTypes.shape({ | ||
targetId: PropTypes.string.isRequired, | ||
invCode: PropTypes.string, | ||
sizes: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.number.isRequired).isRequired).isRequired, | ||
keywords: PropTypes.shape({ | ||
'no-sno-adformat': PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), | ||
}), | ||
}).isRequired; | ||
const PlacementsByPagePropTypes = PropTypes.shape({ | ||
front: PropTypes.arrayOf(PlacementPropTypes), | ||
article: PropTypes.arrayOf(PlacementPropTypes), | ||
other: PropTypes.arrayOf(PlacementPropTypes), | ||
}).isRequired; | ||
AdContextProvider.propTypes = { | ||
adsConfig: PropTypes.shape({ | ||
options: PropTypes.shape({ | ||
member: PropTypes.number.isRequired, | ||
disablePsa: PropTypes.bool, | ||
enableSafeFrame: PropTypes.bool, | ||
}).isRequired, | ||
keywords: PropTypes.shape({ | ||
common: PropTypes.shape({ | ||
'aa-sch-country_code': PropTypes.string, | ||
'aa-sch-publisher': PropTypes.string, | ||
'no-sno-publishergroup': PropTypes.string, | ||
}), | ||
desktop: PropTypes.shape({ | ||
common: PropTypes.shape({ | ||
'aa-sch-supply_type': PropTypes.string, | ||
}), | ||
front: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
article: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
other: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
}), | ||
tablet: PropTypes.shape({ | ||
common: PropTypes.shape({ | ||
'aa-sch-supply_type': PropTypes.string, | ||
}), | ||
front: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
article: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
other: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
}), | ||
mobile: PropTypes.shape({ | ||
common: PropTypes.shape({ | ||
'aa-sch-supply_type': PropTypes.string, | ||
}), | ||
front: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
article: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
other: PropTypes.shape({ | ||
'aa-sch-page_type': PropTypes.string, | ||
}), | ||
}), | ||
}), | ||
placements: PropTypes.shape({ | ||
common: PropTypes.shape({ | ||
noBidIfUnsold: PropTypes.bool, | ||
}), | ||
desktop: PlacementsByPagePropTypes, | ||
tablet: PlacementsByPagePropTypes, | ||
mobile: PlacementsByPagePropTypes, | ||
}).isRequired, | ||
}).isRequired, | ||
cdn: PropTypes.string, | ||
children: PropTypes.node.isRequired, | ||
cogwheelCdn: PropTypes.string, | ||
device: PropTypes.oneOf(['desktop', 'tablet', 'mobile']), | ||
eids: PropTypes.shape({ | ||
required: PropTypes.bool.isRequired, | ||
region: PropTypes.oneOf(['SCHNO', 'SCHSE']).isRequired, | ||
}), | ||
glimr: PropTypes.shape({ | ||
enabled: PropTypes.bool.isRequired, | ||
shouldLoad: PropTypes.func.isRequired, | ||
clientId: PropTypes.string, | ||
localStorageKey: PropTypes.string, | ||
localStorageExpiration: PropTypes.number, | ||
}), | ||
wallpaper: PropTypes.shape({ | ||
enabled: PropTypes.bool.isRequired, | ||
setWallpaperFunction: PropTypes.func.isRequired, | ||
setBackgroundColorFunction: PropTypes.func.isRequired, | ||
}), | ||
}; | ||
AdContextProvider.defaultProps = { | ||
@@ -414,0 +311,0 @@ cdn: 'https://acdn.adnxs.com/ast/ast.js', |
@@ -17,3 +17,3 @@ import { saveToLocalStorageWithExpiration, getFromLocalStorageWithExpiration } from './localStorage'; | ||
const glimr = (await import('glimr-sdk'))?.default; | ||
const glimr = await import('glimr-sdk'); | ||
glimr.setTagCacheTimeInSeconds(300); // 300 is max https://developer.glimr.io/docs/retrieving-audiences#settagcachetimeinseconds | ||
@@ -20,0 +20,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
0
61292
1203