Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@invrs/ads

Package Overview
Dependencies
Maintainers
4
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@invrs/ads - npm Package Compare versions

Comparing version 0.20.28 to 1.0.0

.prettierignore

9

dist/config.js
"use strict";
var _Object$defineProperty = require("@babel/runtime/core-js/object/define-property");
var _Object$keys = require("@babel/runtime/core-js/object/keys");
Object.defineProperty(exports, "__esModule", {

@@ -17,7 +13,6 @@ value: true

_Object$keys(_data).forEach(function (key) {
Object.keys(_data).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
_Object$defineProperty(exports, key, {
Object.defineProperty(exports, key, {
enumerable: true,

@@ -24,0 +19,0 @@ get: function get() {

@@ -10,3 +10,2 @@ "use strict";

// Ad sizes
var rail_sizes = [[1, 1], [300, 250], [300, 600], "fluid"];
var ads = {

@@ -19,5 +18,5 @@ top1: [[1, 1], [300, 50], [300, 100], [300, 250], [728, 90], [970, 90], [970, 250], [1920, 300], "fluid"],

content1: [[1, 1], [300, 50], [300, 100], [300, 250], [728, 90], [1920, 400], [1920, 500], "fluid"],
rail1: rail_sizes,
rail2: rail_sizes,
rail3: rail_sizes // OOP slots
rail1: [[1, 1], [300, 250], "fluid"],
rail2: [[1, 1], [300, 250], [300, 600], "fluid"],
rail3: [[1, 1], [300, 250], [300, 600], "fluid"] // OOP slots

@@ -24,0 +23,0 @@ };

@@ -5,6 +5,2 @@ "use strict";

var _Object$defineProperty = require("@babel/runtime/core-js/object/define-property");
var _Object$keys = require("@babel/runtime/core-js/object/keys");
Object.defineProperty(exports, "__esModule", {

@@ -17,3 +13,2 @@ value: true

display: true,
createCard: true,
destroy: true,

@@ -25,8 +20,5 @@ target: true

exports.display = display;
exports.createCard = createCard;
exports.destroy = destroy;
exports.target = target;
var _promise = _interopRequireDefault(require("@babel/runtime/core-js/promise"));
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

@@ -36,11 +28,10 @@

var _flatironStore = require("@invrs/flatiron-store");
var _dotStore = _interopRequireDefault(require("dot-store"));
var _config = require("./config");
_Object$keys(_config).forEach(function (key) {
Object.keys(_config).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
_Object$defineProperty(exports, key, {
Object.defineProperty(exports, key, {
enumerable: true,

@@ -59,8 +50,8 @@ get: function get() {

var _url = require("./url");
// Packages
// Helpers
// Exports
// Initializers
// Constants
var store = (0, _dotStore.default)(); // Initializers
init(); // Functions

@@ -82,7 +73,7 @@

_context.next = 3;
return _flatironStore.store.set("article.dfp.viewportMaps", _config.viewports);
return store.set("article.dfp.viewportMaps", _config.viewports);
case 3:
_context.next = 5;
return _flatironStore.store.onceExists("article.dfp.loaded").then(_googletag.initGoogletag);
return store.onceEmitted("article.dfp.loaded").then(_googletag.initGoogletag);

@@ -114,3 +105,3 @@ case 5:

_context2.next = 3;
return _flatironStore.store.onceExists("article.iframes.".concat(id, ".").concat(event)).then(fn);
return store.onceEmitted("article.iframes.".concat(id, ".").concat(event)).then(fn);

@@ -147,3 +138,3 @@ case 3:

return _context3.abrupt("return", _flatironStore.store);
return _context3.abrupt("return", store);

@@ -155,33 +146,17 @@ case 3:

});
if (!(unit == "card")) {
_context3.next = 8;
break;
}
_context3.next = 7;
return createCard({
id: id,
targets: targets
});
case 7:
return _context3.abrupt("return", _context3.sent);
case 8:
path = (0, _ids.unitPath)({
slide: slide,
store: _flatironStore.store,
store: store,
unit: unit
});
dfpUnit = _flatironStore.store.get("article.dfp.units.".concat(unit));
iframe = _flatironStore.store.get("article.iframes.".concat(id));
dfpUnit = store.get("article.dfp.units.".concat(unit));
iframe = store.get("article.iframes.".concat(id));
if (dfpUnit) {
_context3.next = 14;
_context3.next = 10;
break;
}
_context3.next = 14;
return _flatironStore.store.set("article.dfp.units.".concat(unit), {
_context3.next = 10;
return store.set("article.dfp.units.".concat(unit), {
id: unit,

@@ -195,18 +170,18 @@ sizes: _config.ads[unit],

case 14:
case 10:
if (!iframe) {
_context3.next = 19;
_context3.next = 15;
break;
}
_context3.next = 13;
return store.time("article.iframes.".concat(id, ".refresh"));
case 13:
_context3.next = 17;
return _flatironStore.store.time("article.iframes.".concat(id, ".refresh"));
case 17:
_context3.next = 21;
break;
case 19:
_context3.next = 21;
return _flatironStore.store.set("article.iframes.".concat(id), {
case 15:
_context3.next = 17;
return store.set("article.iframes.".concat(id), {
dfp: {

@@ -218,3 +193,3 @@ a9: true,

index: index,
store: _flatironStore.store,
store: store,
targets: targets,

@@ -228,6 +203,6 @@ unit: unit

case 21:
return _context3.abrupt("return", _flatironStore.store);
case 17:
return _context3.abrupt("return", store);
case 22:
case 18:
case "end":

@@ -242,71 +217,3 @@ return _context3.stop();

function createCard(_x5) {
return _createCard.apply(this, arguments);
}
function _createCard() {
_createCard = (0, _asyncToGenerator2.default)(
/*#__PURE__*/
_regenerator.default.mark(function _callee4(_ref2) {
var id, targets, parent_section, section, atype;
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context4.prev = _context4.next) {
case 0:
id = _ref2.id, targets = _ref2.targets;
if (!_flatironStore.store.get("article.iframes.".concat(id))) {
_context4.next = 3;
break;
}
return _context4.abrupt("return");
case 3:
parent_section = targets.parent_section, section = targets.section;
atype = targets.atype;
_flatironStore.store.onceExists("article.iframes.".concat(id, ".loaded"), function (options) {
var store = options.store;
var iframe = store.get("article.iframes.".concat(id));
var divId = iframe.divId;
if (iframe.dfp) {
return;
}
if (divId) {
store.time("postMessage.targets.".concat(divId));
}
if (atype === "long") {
store.set("article.longform", true);
}
store.set("article.section", parent_section || section || "");
store.set("article.cardId", id);
});
_context4.next = 8;
return _flatironStore.store.set("article.iframes.".concat(id), {
active: true,
divId: id,
url: (0, _url.archUrl)("/poll"),
width: "100%"
});
case 8:
return _context4.abrupt("return", _context4.sent);
case 9:
case "end":
return _context4.stop();
}
}
}, _callee4, this);
}));
return _createCard.apply(this, arguments);
}
function destroy(_x6) {
function destroy(_x5) {
return _destroy.apply(this, arguments);

@@ -318,9 +225,9 @@ }

/*#__PURE__*/
_regenerator.default.mark(function _callee5(_ref3) {
_regenerator.default.mark(function _callee4(_ref2) {
var index, unit, id;
return _regenerator.default.wrap(function _callee5$(_context5) {
return _regenerator.default.wrap(function _callee4$(_context4) {
while (1) {
switch (_context5.prev = _context5.next) {
switch (_context4.prev = _context4.next) {
case 0:
index = _ref3.index, unit = _ref3.unit;
index = _ref2.index, unit = _ref2.unit;
id = (0, _ids.divId)({

@@ -330,14 +237,14 @@ index: index,

});
_context5.next = 4;
return _promise.default.all([_flatironStore.store.delete("article.iframes.".concat(id)), _flatironStore.store.delete("postMessage.targets.".concat(id))]);
_context4.next = 4;
return store.delete("article.iframes.".concat(id));
case 4:
return _context5.abrupt("return", _flatironStore.store);
return _context4.abrupt("return", store);
case 5:
case "end":
return _context5.stop();
return _context4.stop();
}
}
}, _callee5, this);
}, _callee4, this);
}));

@@ -347,3 +254,3 @@ return _destroy.apply(this, arguments);

function target(_x7) {
function target(_x6) {
return _target.apply(this, arguments);

@@ -355,32 +262,32 @@ }

/*#__PURE__*/
_regenerator.default.mark(function _callee6(targets) {
return _regenerator.default.wrap(function _callee6$(_context6) {
_regenerator.default.mark(function _callee5(targets) {
return _regenerator.default.wrap(function _callee5$(_context5) {
while (1) {
switch (_context6.prev = _context6.next) {
switch (_context5.prev = _context5.next) {
case 0:
if (targets) {
_context6.next = 2;
_context5.next = 2;
break;
}
return _context6.abrupt("return");
return _context5.abrupt("return");
case 2:
_context6.next = 4;
return _flatironStore.store.merge("article.dfp.rawTargets", targets);
_context5.next = 4;
return store.merge("article.dfp.rawTargets", targets);
case 4:
targets = _flatironStore.store.get("article.dfp.rawTargets");
_context6.next = 7;
return _flatironStore.store.merge("article.dfp.targets", (0, _targets.targetMap)(targets));
targets = store.get("article.dfp.rawTargets");
_context5.next = 7;
return store.merge("article.dfp.targets", (0, _targets.targetMap)(targets));
case 7:
return _context6.abrupt("return", _flatironStore.store);
return _context5.abrupt("return", store);
case 8:
case "end":
return _context6.stop();
return _context5.stop();
}
}
}, _callee6, this);
}, _callee5, this);
}));

@@ -387,0 +294,0 @@ return _target.apply(this, arguments);

@@ -17,4 +17,2 @@ "use strict";

var _getIterator2 = _interopRequireDefault(require("@babel/runtime/core-js/get-iterator"));
var _config = require("./config");

@@ -39,7 +37,7 @@

try {
for (var _iterator = (0, _getIterator2.default)(_config.viewports), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var _viewport = _step.value;
for (var _iterator = _config.viewports[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var viewport = _step.value;
if (width > _viewport[0] && height > _viewport[1]) {
return _viewport;
if (width > viewport[0] && height > viewport[1]) {
return viewport;
}

@@ -46,0 +44,0 @@ }

{
"name": "@invrs/ads",
"version": "0.20.28",
"version": "1.0.0",
"description": "Inverse ad code",

@@ -11,30 +11,34 @@ "keywords": [

"type": "git",
"url": "git+ssh://git@github.com/invrs/arch.git"
"url": "git+ssh://git@github.com/invrs/ads.git"
},
"license": "MIT",
"main": "dist/index.js",
"homepage": "https://github.com/invrs/arch/tree/master/packages/ads#readme",
"scripts": {
"build": "babel lib --out-dir dist --source-maps",
"fix": "npm run lint -- --fix",
"prepublishOnly": "rimraf dist; npm run build",
"pretty": "prettier --write **/*.css **/*.json **/*.md",
"lint": "eslint --ignore-path .gitignore --ext=js .",
"test": "jest",
"watch": "rimraf dist; babel lib --watch --out-dir dist --source-maps"
"links": {
"dot-store": "../../dot-store-core"
},
"license": "MIT",
"homepage": "https://github.com/invrs/ads#readme",
"dependencies": {
"@babel/runtime": "7.0.0-beta.42",
"@invrs/flatiron-store": "^0.20.25"
"@babel/runtime": "^7.0.0",
"dot-store": "^4.8.0"
},
"devDependencies": {
"@babel/cli": "7.0.0-beta.42",
"@babel/core": "7.0.0-beta.42",
"@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.42",
"@babel/plugin-transform-runtime": "7.0.0-beta.42",
"@babel/preset-env": "7.0.0-beta.42",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-transform-react-jsx": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"babel-core": "^7.0.0-bridge.0",
"fxtr": "1",
"jest": "22",
"rimraf": "2"
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.1.0",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-react": "^7.10.0",
"husky": "^1.0.0-rc.15",
"jest": "^23.6.0",
"lint-staged": "^7.3.0",
"prettier": "^1.14.3",
"rimraf": "^2.6.2"
},

@@ -55,5 +59,7 @@ "babel": {

}
]
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread",

@@ -63,2 +69,117 @@ "@babel/plugin-transform-runtime"

},
"scripts": {
"build": "babel lib --out-dir dist --source-maps",
"prepublishOnly": "rimraf dist; npm run build",
"watch": "rimraf dist; babel lib --watch --out-dir dist --source-maps",
"fix": "npm run lint -- --fix",
"lint": "eslint --ignore-path .gitignore --ext=js .",
"pretty": "prettier --write **/*.css **/*.json **/*.md",
"test": "jest"
},
"eslintConfig": {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:react/recommended"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
},
"ecmaVersion": 8,
"sourceType": "module"
},
"rules": {
"curly": "error",
"indent": [
"error",
2,
{
"SwitchCase": 1
}
],
"linebreak-style": [
"error",
"unix"
],
"max-len": [
"error",
{
"code": 60,
"ignoreRegExpLiterals": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
],
"no-console": [
"error",
{
"allow": [
"warn",
"error"
]
}
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "h",
"varsIgnorePattern": "h"
}
],
"quotes": [
"error",
"double"
],
"react/display-name": "off",
"react/no-find-dom-node": "off",
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"semi": [
"error",
"never"
],
"sort-keys": [
"error",
"asc",
{
"caseSensitive": true,
"natural": false
}
],
"sort-vars": [
"error",
{
"ignoreCase": true
}
],
"strict": 0
}
},
"prettier": {
"printWidth": 60,
"semi": false,
"trailingComma": "es5"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged && npm test"
}
},
"lint-staged": {
"*.{css,json,md}": [
"prettier --write",
"git add"
],
"*.js": [
"eslint --ignore-path .gitignore --fix",
"git add"
]
},
"jest": {

@@ -72,11 +193,2 @@ "setupFiles": [

},
"starters": [
"babel",
"babel-scripts",
"babel-web",
"basics",
"jest",
"jest-scripts",
"watchman-babel"
],
"watchman": {

@@ -83,0 +195,0 @@ "triggers": [

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc