@advertol/core
Advanced tools
Comparing version 1.0.0-alpha.0 to 1.0.0
@@ -286,4 +286,4 @@ 'use strict'; | ||
function Control() { | ||
this._triggerResultsCache = {}; | ||
this._loadResultsCache = {}; | ||
this._shouldTriggerControlCache = {}; | ||
this._onInitialControlTriggerCache = {}; | ||
} | ||
@@ -315,3 +315,3 @@ /** | ||
_proto.afterZoneLoad = function afterZoneLoad() { | ||
_proto.onInitialControlTrigger = function onInitialControlTrigger() { | ||
return Promise.resolve(); | ||
@@ -323,3 +323,3 @@ } | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -334,3 +334,3 @@ */ | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -345,3 +345,3 @@ */ | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -413,3 +413,3 @@ */ | ||
key: id, | ||
cache: control._triggerResultsCache, | ||
cache: control._shouldTriggerControlCache, | ||
result: function result() { | ||
@@ -438,5 +438,5 @@ return control.shouldTriggerControl({ | ||
key: id, | ||
cache: control._loadResultsCache, | ||
cache: control._onInitialControlTriggerCache, | ||
result: function result() { | ||
return control.afterZoneLoad({ | ||
return control.onInitialControlTrigger({ | ||
isEmpty: isEmpty, | ||
@@ -449,3 +449,3 @@ element: element, | ||
return loadPromise; | ||
}).then(function (loadResult) { | ||
}).then(function (initialControlTriggerResult) { | ||
var isVisible = zone.isVisible; | ||
@@ -458,3 +458,3 @@ | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -468,3 +468,3 @@ } | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -489,3 +489,3 @@ } | ||
this.controls.forEach(function (control) { | ||
var loadResults = control._loadResultsCache; | ||
var onInitialControlTriggerCache = control._onInitialControlTriggerCache; | ||
@@ -496,3 +496,3 @@ _this2.zones.forEach(function (_ref2) { | ||
isEmpty = _ref2.isEmpty; | ||
var loadResult = loadResults[id] || Promise.resolve(); | ||
var initialControlTriggerResult = onInitialControlTriggerCache[id] || Promise.resolve(); | ||
control.destroy({ | ||
@@ -502,3 +502,3 @@ isEmpty: isEmpty, | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -786,5 +786,6 @@ }); | ||
exports.default = index; | ||
exports.Context = Context; | ||
exports.Control = Control; | ||
exports.Context = Context; | ||
exports.Service = Service; | ||
exports.default = index; | ||
//# sourceMappingURL=index.cjs.js.map |
@@ -282,4 +282,4 @@ function _extends() { | ||
function Control() { | ||
this._triggerResultsCache = {}; | ||
this._loadResultsCache = {}; | ||
this._shouldTriggerControlCache = {}; | ||
this._onInitialControlTriggerCache = {}; | ||
} | ||
@@ -311,3 +311,3 @@ /** | ||
_proto.afterZoneLoad = function afterZoneLoad() { | ||
_proto.onInitialControlTrigger = function onInitialControlTrigger() { | ||
return Promise.resolve(); | ||
@@ -319,3 +319,3 @@ } | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -330,3 +330,3 @@ */ | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -341,3 +341,3 @@ */ | ||
* @param {string} options.id | ||
* @param {Promise} options.loadResult | ||
* @param {*} options.initialControlTriggerResult | ||
* @param {boolean} [options.isEmpty] | ||
@@ -409,3 +409,3 @@ */ | ||
key: id, | ||
cache: control._triggerResultsCache, | ||
cache: control._shouldTriggerControlCache, | ||
result: function result() { | ||
@@ -434,5 +434,5 @@ return control.shouldTriggerControl({ | ||
key: id, | ||
cache: control._loadResultsCache, | ||
cache: control._onInitialControlTriggerCache, | ||
result: function result() { | ||
return control.afterZoneLoad({ | ||
return control.onInitialControlTrigger({ | ||
isEmpty: isEmpty, | ||
@@ -445,3 +445,3 @@ element: element, | ||
return loadPromise; | ||
}).then(function (loadResult) { | ||
}).then(function (initialControlTriggerResult) { | ||
var isVisible = zone.isVisible; | ||
@@ -454,3 +454,3 @@ | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -464,3 +464,3 @@ } | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -485,3 +485,3 @@ } | ||
this.controls.forEach(function (control) { | ||
var loadResults = control._loadResultsCache; | ||
var onInitialControlTriggerCache = control._onInitialControlTriggerCache; | ||
@@ -492,3 +492,3 @@ _this2.zones.forEach(function (_ref2) { | ||
isEmpty = _ref2.isEmpty; | ||
var loadResult = loadResults[id] || Promise.resolve(); | ||
var initialControlTriggerResult = onInitialControlTriggerCache[id] || Promise.resolve(); | ||
control.destroy({ | ||
@@ -498,3 +498,3 @@ isEmpty: isEmpty, | ||
id: id, | ||
loadResult: loadResult | ||
initialControlTriggerResult: initialControlTriggerResult | ||
}); | ||
@@ -783,2 +783,3 @@ }); | ||
export default index; | ||
export { Control, Context, Service }; | ||
export { Context, Control, Service }; | ||
//# sourceMappingURL=index.esm.js.map |
{ | ||
"name": "@advertol/core", | ||
"version": "1.0.0-alpha.0", | ||
"version": "1.0.0", | ||
"description": "Advertisement zones manager.", | ||
@@ -10,4 +10,5 @@ "main": "index.cjs.js", | ||
"files": [ | ||
"index.cjs.js", | ||
"index.esm.js", | ||
"index.cjs.{js,js.map}", | ||
"index.esm.{js,js.map}", | ||
"CHANGELOG.md", | ||
"LICENSE.md", | ||
@@ -23,2 +24,3 @@ "README.md" | ||
"lint": "eslint '{index,lib/**/*,test/**/*}.js'", | ||
"postpublish": "GITHUB_TOKEN=$GITHUB_RELEASE_TOKEN github-release-from-changelog", | ||
"prepublishOnly": "npm run build", | ||
@@ -28,3 +30,4 @@ "release": "np", | ||
"test:automated": "BABEL_ENV=test karma start", | ||
"test:automated:watch": "npm run test:automated -- --auto-watch --no-single-run" | ||
"test:automated:watch": "npm run test:automated -- --auto-watch --no-single-run", | ||
"version": "version-changelog CHANGELOG.md && changelog-verify CHANGELOG.md && git add CHANGELOG.md" | ||
}, | ||
@@ -39,2 +42,4 @@ "devDependencies": { | ||
"babel-preset-niksy": "^4.1.0", | ||
"changelog-verify": "^1.1.2", | ||
"core-js": "^2.6.5", | ||
"eslint": "^5.4.0", | ||
@@ -49,6 +54,7 @@ "eslint-config-niksy": "^6.1.0", | ||
"esm": "^3.0.51", | ||
"github-release-from-changelog": "^1.3.2", | ||
"istanbul-instrumenter-loader": "^3.0.1", | ||
"karma": "^1.1.0", | ||
"karma": "^4.0.1", | ||
"karma-browserstack-launcher": "^1.0.0", | ||
"karma-chrome-launcher": "^1.0.1", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-coverage-istanbul-reporter": "^2.0.1", | ||
@@ -66,2 +72,3 @@ "karma-fixture": "^0.2.6", | ||
"sinon": "^2.4.1", | ||
"version-changelog": "^3.1.1", | ||
"webpack": "^4.12.0" | ||
@@ -82,9 +89,8 @@ }, | ||
"type": "git", | ||
"url": "git+https://github.com/niksy/advertol.git" | ||
"url": "git+https://github.com/niksy/advertol-core.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/niksy/advertol/issues" | ||
"url": "https://github.com/niksy/advertol-core/issues" | ||
}, | ||
"homepage": "https://github.com/niksy/advertol#readme", | ||
"gitHead": "e83640d93effb6e4c14d54bb504351e9d98097db" | ||
"homepage": "https://github.com/niksy/advertol-core#readme" | ||
} |
@@ -122,8 +122,8 @@ # @advertol/core | ||
[ci]: https://travis-ci.com/niksy/advertol | ||
[ci-img]: https://travis-ci.com/niksy/advertol.svg?branch=master | ||
[ci]: https://travis-ci.com/niksy/advertol-core | ||
[ci-img]: https://travis-ci.com/niksy/advertol-core.svg?branch=master | ||
[browserstack]: https://www.browserstack.com/ | ||
[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=MXdvSXc0TVVSUG1lQWlCV25Sc0xlTlYvRTdzaFVNM09JRXNXYStGSytQND0tLUs4OUVYWkFEY3JNZDJmMlBIeTdnV0E9PQ==--f371818440411f6e9a295345dc5ee488fce79ce1 | ||
[browserstack-img]: https://www.browserstack.com/automate/badge.svg?badge_key=YWxaem45M0tCRHNpTkdZdHdlcGx4WDg4eVB1RUlqUy8wWk5kSFowQXJrcz0tLURaMU5NcUJMOERDQ1pnNkZwcTM3bGc9PQ==--761e47cbb39133df6ee49bbb87b2f53c6c5ef579 | ||
[service]: https://github.com/niksy/advertol/docs/service.md | ||
[control]: https://github.com/niksy/advertol/docs/control.md | ||
[context]: https://github.com/niksy/advertol/docs/context.md |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
94355
8
1304
0
37