@abtasty/christmas-hat
Advanced tools
Comparing version 1.1.6 to 1.1.7-0
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.widgetForm=t()}(this,function(){"use strict";return[{category:"content",type:"paragraph",text:{en:"Please select an element on the page to display the Christmas hat.",fr:"Veuillez choisir un élément dans le page sur lequel ajouter le chapeau de Noël.",es:"Por favor, selecciona un elemento de la página sobre el que mostrar el gorro navideño.",de:"Bitte wählen Sie ein Element auf der Seite, auf dem die Weihnachtsmütze angezeigt werden soll."}},{category:"content",label:{fr:"Element",en:"Element"},value:"body",type:"selectelement",propName:"selector"},{category:"style",value:"left",type:"radioImage",propName:"hatOrientation",label:{en:"Position",fr:"Position",es:"Posición",de:"Position"},options:[{label:{en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},value:"left",src:"https://dp8v87cz8a7qa.cloudfront.net/24424/5a3795d71b6331513592279.png"},{label:{en:"Right",fr:"Droite",es:"Derecha",de:"Rechts"},value:"right",src:"https://dp8v87cz8a7qa.cloudfront.net/24424/5a37959537b661513592213.png"}]},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Size",fr:"Taille",es:"Tamaño",de:"Größe"},propName:"hatSize",value:1,min:.1,max:10,step:.1},{category:"style",type:"paragraph",text:{en:"Please keep in mind that the size of the widget \nis directly dependent of the size of the location \n(hosting element). You can influence/adjust that by \nmodifying the size variable above.",fr:"Pour information, la taille de ce widget \nest relative à la taille de l'image cible. \nUne valeur de 2 équivaut à une taille de 200%.",es:"Ten en cuenta que el tamaño del widget \ndepende del tamaño del elemento sobre el que se muestra.",de:"Bitte beachten Sie, dass die Größe des Widgets \nvon der Größe des Elements abhängt, \nauf dem das Widget angezeigt werden soll."}},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Vertical alignment (pixels)",fr:"Alignement verticale (pixels)",es:"Alineación vertical (px)",de:"Vertikale Ausrichtung (Pixel)"},propName:"topPosition",value:0,min:-1e3,max:1e3,step:1},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Horizontal alignment (pixels)",fr:"Alignement horizontal (pixels)",es:"Alineación horizontal (px)",de:"Horizontale Ausrichtung (Pixel)"},propName:"horizontalPosition",value:0,min:-1e3,max:1e3,step:1}]}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).widgetForm=t()}(this,(function(){"use strict";return[{category:"content",type:"paragraph",text:{en:"Please select an element on the page to display the Christmas hat.",fr:"Veuillez choisir un élément dans le page sur lequel ajouter le chapeau de Noël.",es:"Por favor, selecciona un elemento de la página sobre el que mostrar el gorro navideño.",de:"Bitte wählen Sie ein Element auf der Seite, auf dem die Weihnachtsmütze angezeigt werden soll."}},{category:"content",label:{fr:"Element",en:"Element"},value:"body",type:"selectelement",propName:"selector"},{category:"style",value:"left",type:"radioImage",propName:"hatOrientation",label:{en:"Position",fr:"Position",es:"Posición",de:"Position"},options:[{label:{en:"Left",fr:"Gauche",es:"Izquierda",de:"Links"},value:"left",src:"https://dp8v87cz8a7qa.cloudfront.net/24424/5a3795d71b6331513592279.png"},{label:{en:"Right",fr:"Droite",es:"Derecha",de:"Rechts"},value:"right",src:"https://dp8v87cz8a7qa.cloudfront.net/24424/5a37959537b661513592213.png"}]},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Size",fr:"Taille",es:"Tamaño",de:"Größe"},propName:"hatSize",value:1,min:.1,max:10,step:.1},{category:"style",type:"paragraph",text:{en:"Please keep in mind that the size of the widget \nis directly dependent of the size of the location \n(hosting element). You can influence/adjust that by \nmodifying the size variable above.",fr:"Pour information, la taille de ce widget \nest relative à la taille de l'image cible. \nUne valeur de 2 équivaut à une taille de 200%.",es:"Ten en cuenta que el tamaño del widget \ndepende del tamaño del elemento sobre el que se muestra.",de:"Bitte beachten Sie, dass die Größe des Widgets \nvon der Größe des Elements abhängt, \nauf dem das Widget angezeigt werden soll."}},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Vertical alignment (pixels)",fr:"Alignement verticale (pixels)",es:"Alineación vertical (px)",de:"Vertikale Ausrichtung (Pixel)"},propName:"topPosition",value:0,min:-1e3,max:1e3,step:1},{category:"style",type:"separator"},{category:"style",type:"number",label:{en:"Horizontal alignment (pixels)",fr:"Alignement horizontal (pixels)",es:"Alineación horizontal (px)",de:"Horizontale Ausrichtung (Pixel)"},propName:"horizontalPosition",value:0,min:-1e3,max:1e3,step:1}]})); |
@@ -1,1 +0,1 @@ | ||
!function(){"use strict";var t=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];t.unshift("[AB Tasty Widget] "+PACKAGE+":"),console.log.apply(console,t)},e=document.createElement("img"),o=DATA.hatOrientation,n=void 0!==window.ABTastyEditor,i=void 0,r=void 0,a=void 0,d=void 0,u=void 0,s=void 0,l=function(t){var o=d,n=o.hatSize,a=o.topPosition,s=o.horizontalPosition,l="none"===window.getComputedStyle(i).display,c=i.getBoundingClientRect(),f=c.left,p=c.top;"absolute"===u&&(f+=window.pageXOffset,p+=window.pageYOffset),"right"===t?(f+=r-n,f-=parseFloat(s)):f+=parseFloat(s),p+=parseFloat(a),e.style.top=p+"px",e.style.left=f+"px",e.style.display="block",l&&(e.style.display="none")},c=function(t,o,r){e.style.width=o+"px";var a=void 0;"left"===t?a="https://dp8v87cz8a7qa.cloudfront.net/24424/5a3795d71b6331513592279.png":"right"===t&&(a="https://dp8v87cz8a7qa.cloudfront.net/24424/5a37959537b661513592213.png"),e.setAttribute("src",a),document.body.appendChild(e),e.style.position=r,e.style.zIndex=function t(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e===document.body)return o+1;var n=e,i=Number(window.getComputedStyle(n).zIndex),r=o;return i>o&&(r=i),t(n.parentNode,r)}(i),n||(e.style.pointerEvents="none")},f=function(t){return function(t){for(var e=t;e!==document.body;){if("fixed"===window.getComputedStyle(e).position)return!0;e=e.parentNode}return!1}(t)?"fixed":"absolute"};!function(e,o,n){var i=0,r=0;try{document.querySelector(e)}catch(o){var a='Selector "'+e+'" not valid.';return t(a),"function"==typeof n&&n(a)}i=setTimeout(function(){clearInterval(r);var o="Can't find element \""+e+'".';return t(o),"function"==typeof n&&n(o)},1e4),r=setInterval(function(){var t=document.querySelector(e);if(null!==t)return clearTimeout(i),clearInterval(r),"function"==typeof o&&o(t)},200)}(DATA.selector,function(){i=document.querySelector(DATA.selector),r=i.offsetWidth,a=i.offsetHeight,d=function(){var t="landscape";r/a<1&&(t="portrait");var e=void 0;"landscape"===t?e=a/1.1:"portrait"===t&&(e=r/2.5);var o=(e*=DATA.hatSize)/3*-1;o+=Number(DATA.topPosition);var n=e/3.5*-1;return n+=Number(DATA.horizontalPosition),(e=Math.round(e))>200&&(e=200),o=Math.round(o),n=Math.round(n),{hatSize:e,topPosition:o,horizontalPosition:n}}(),e.className="abtasty-christmas-hat",u=f(i),c(o,d.hatSize,u),l(o),document.addEventListener("scroll",function(){var t=f(i);u!==t&&(u=t,e.style.position=u,function t(e,n,i){var r=e;i||clearTimeout(s),l(o),(r-=1)&&(s=setTimeout(function(){t(r,n,!0)},n))}(200,20))}),window.addEventListener("resize",function(){l(o)});new MutationObserver(function(){l(o)}).observe(document,{childList:!0,subtree:!0})})}(); | ||
!function(){"use strict";const e=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),t=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},n=()=>t()||!!window.ABTasty.getTestsOnPage()[TEST_ID],r="remove",i="rebuild",s=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`},o=()=>{const e=s();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},a=n=>{if((()=>{if(e()||t())return!1;const n=ABTasty.getTestsOnPage()[TEST_ID];return!!n&&Object.keys(n.targetings.qaParameters).length>0})()){const e=o();window.console.log(`%c${e} - QA Mode for campaign ${TEST_ID}\n${n}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},c=(e,t,n)=>{let r=0,i=0;try{document.querySelector(e)}catch(t){const r=`Selector «${e}» not valid.`;return a(r),"function"==typeof n&&n(r)}function s(){clearInterval(i),clearTimeout(r)}return r=setTimeout((()=>{s();const t=`Can't find element «${e}».`;return a(t),"function"==typeof n&&n(t)}),1e4),i=setInterval((()=>{const n=document.querySelector(e);return null!==n?(s(),"function"==typeof t&&t(n)):n}),200),{clear:s}};class l{constructor(e,t,n){this.recurrence=e,this.isWidgetApplied=t,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=n(),{type:s}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1},o=()=>e&&"display"===s||this.recurrenceIsDone();return!this.isWidgetApplied()&&t&&o()?(this.clearWatcher(),this.callback(i,e)):(!this.isWidgetApplied()||t&&o())&&(this.isWidgetApplied()||t)||(this.clearWatcher(),this.callback(r,e),this.watch()),this}eventHandler(){let e=n();return[250,500].forEach((t=>setTimeout((()=>500===t&&n()===e?this:(e=n(),this.decisionHandler(!1))),t))),this}observerHandler(e){const t=e.some((({removedNodes:e})=>e&&e.length)),n=e.some((({addedNodes:e})=>e&&e.length));return t||n?(this.decisionHandler(!0),this):this}watch(){if(e())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const t=c("body",(e=>{const n=[e,{childList:!0,subtree:!0}];this.observer.observe(...n),this.elementsWaiters=this.elementsWaiters.filter((e=>e!==t))}));return this.elementsWaiters.push(t),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach((e=>e.clear())),this.elementsWaiters=[]),this.observer.disconnect(),this}}var d,u,h,p,m,f,v,y=document.createElement("img"),b=DATA.hatOrientation,g=e(),w=new MutationObserver(P),A=function(){return document.body.contains(y)},T=function(){document.removeEventListener("scroll",L),window.removeEventListener("resize",$),w.disconnect(),y.remove()},E=function(e,t){switch(e){case r:T();break;case i:t?D(A):(T(),z())}},D=function(e){(v=v||new l(!1,e,E)).watch()};function P(){var e=p,t=e.hatSize,n=e.topPosition,r=e.horizontalPosition,i="none"===window.getComputedStyle(d).display,s=d.getBoundingClientRect(),o=s.left,a=s.top;"absolute"===m&&(o+=window.pageXOffset,a+=window.pageYOffset),"right"===b?(o+=u-t,o-=parseFloat(r)):o+=parseFloat(r),a+=parseFloat(n),y.style.top="".concat(a,"px"),y.style.left="".concat(o,"px"),y.style.display="block",i&&(y.style.display="none")}var S=function e(t,n,r){var i=t;r||clearTimeout(f),P(),(i-=1)&&(f=setTimeout((function(){e(i,n,!0)}),n))},W=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t===document.body)return n+1;var r=t,i=Number(window.getComputedStyle(r).zIndex),s=n;return i>n&&(s=i),e(r.parentNode,s)},I=function(e,t,n){y.style.width="".concat(t,"px"),y.setAttribute("src","".concat("https://widgets-images.abtasty.com/","christmas-hat-").concat(e,".png")),document.body.appendChild(y),y.style.position=n,y.style.zIndex=W(d),g||(y.style.pointerEvents="none")},_=function(e){return function(e){for(var t=e;t!==document.body;){if("fixed"===window.getComputedStyle(t).position)return!0;t=t.parentNode}return!1}(e)?"fixed":"absolute"},L=function(){var e=_(d);m!==e&&(m=e,y.style.position=m,S(200,20))},$=function(){P()},z=function(){d=document.querySelector(DATA.selector),u=d.offsetWidth,h=d.offsetHeight,p=function(){var e,t="landscape";u/h<1&&(t="portrait"),"landscape"===t?e=h/1.1:"portrait"===t&&(e=u/2.5);var n=(e*=DATA.hatSize)/3*-1;n+=Number(DATA.topPosition);var r=e/3.5*-1;return r+=Number(DATA.horizontalPosition),(e=Math.round(e))>200&&(e=200),{hatSize:e,topPosition:n=Math.round(n),horizontalPosition:r=Math.round(r)}}(),y.className="abtasty-christmas-hat ab_widget_container_".concat(s()),y.id=`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,m=_(d),I(b,p.hatSize,m),P(),document.addEventListener("scroll",L,{passive:!0}),window.addEventListener("resize",$),w.observe(document,{childList:!0,subtree:!0}),e()||D(A)};c(DATA.selector,(function(){window.ABTastyEvent("".concat(o()," displayed"),null,DATA.TEST_ID),z()}))}(); |
{ | ||
"name": "@abtasty/christmas-hat", | ||
"description": "AB Tasty Widget", | ||
"version": "1.1.6", | ||
"version": "1.1.7-0", | ||
"icon": "icon.png", | ||
@@ -22,18 +22,23 @@ "form": "dist/form.js", | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-preset-es2015-rollup": "^3.0.0", | ||
"concurrently": "^3.5.0", | ||
"eslint": "^4.10.0", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"rollup": "^0.51.1", | ||
"rollup-plugin-babel": "^3.0.2", | ||
"rollup-plugin-eslint": "^4.0.0", | ||
"rollup-plugin-node-resolve": "^3.0.0", | ||
"rollup-plugin-uglify": "^2.0.1", | ||
"rollup-watch": "^4.3.1" | ||
"@babel/core": "^7.12.8", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.12.1", | ||
"@babel/preset-env": "^7.12.7", | ||
"@babel/runtime": "^7.12.5", | ||
"@rollup/plugin-babel": "^5.2.2", | ||
"@rollup/plugin-node-resolve": "^11.0.0", | ||
"babel-eslint": "^10.0.3", | ||
"babel-plugin-minify-dead-code-elimination": "^0.5.1", | ||
"concurrently": "^5.3.0", | ||
"eslint": "^7.15.0", | ||
"eslint-config-airbnb-base": "^14.2.1", | ||
"eslint-config-prettier": "^7.0.0", | ||
"eslint-import-resolver-node": "^0.3.2", | ||
"eslint-plugin-import": "^2.22.1", | ||
"rollup": "^2.35.1", | ||
"rollup-plugin-eslint": "^7.0.0", | ||
"rollup-plugin-terser": "^7.0.0" | ||
}, | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.10.0" | ||
"@abtasty/widget-utils": "^1.17.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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
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
9005
30
17
2
1