@abtasty/promotional-banner 1.4.6 → 1.4.7
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/form.js +1 -0
- package/dist/main.js +1 -0
- package/package.json +1 -1
package/dist/form.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@abtasty/widget-utils/dist/constants"),require("@abtasty/widget-utils/dist/forms")):"function"==typeof define&&define.amd?define(["@abtasty/widget-utils/dist/constants","@abtasty/widget-utils/dist/forms"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).widgetForm=e(t.constants,t.forms)}(this,function(t,e){"use strict";e.layoutGroup.collapsed=!1;var r=e.layoutGroup.children[0];r.value="bannerBottom",r.options=r.options.filter(function(t){return"popin"!==t.value});var o=[{category:t.LAYOUT,type:t.INLINE_NOTIFICATION,label:"widget_promotionalBanner_closable_alert_text",hrefUrl:"widget_promotionalBanner_closable_alert_link"},e.layoutGroup,e.zindexInformations,e.zindexGroup];function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,o)}return r}function u(t,e,r){return(e=function(t){var e=function(t){if("object"!==n(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===n(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var a={category:t.CONTENT,type:t.SEPARATOR},l=[{category:t.CONTENT,type:t.TEXT_AREA,propName:"message",label:"widget_common_content_label_message",value:"widget_common_content_paragraph_default",rows:6},function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){u(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({},a),e.linkGroup];e.buttonsGroup.children=e.buttonsGroup.children.filter(function(t){return"buttonsAlign"!==t.propName}),e.buttonsGroup.condition=function(t){var e=t.linkType;return"string"==typeof e&&e.includes("button")},e.textGroup.collapsed=!1;var c,s=[e.textGroup,e.buttonsGroup,e.containerGroup,e.bordersGroup,e.closeButtonGroup],p=e.recurrencesGroup.children.find(function(t){return"validationRecurrence"===t.propName}),f=[{field:"linkType",value:function(t){return!1!==t&&!t.includes("Close")}}];p.label="widget_common_conditions_recurrence_label_widgetDisplayedAfterClick",p.conditions=f,e.autoHideForm.conditions=f,(c=e.timeHideForm.conditions).push.apply(c,f),e.triggersGroup.collapsed=!1,e.triggersGroup.children.push(e.autoHideForm),e.triggersGroup.children.push(e.timeHideForm);var d=[e.triggersGroup,e.recurrencesGroup,e.animationsGroup];function y(t){return function(t){if(Array.isArray(t))return b(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return b(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}return[].concat(y(o),y(l),y(s),y(d))});
|
package/dist/main.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var i=function(){function e(t){var n=t.parentContainer;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentContainer=n,this.baseClassName="promotionalbanner_container",this.className="".concat(this.baseClassName,"_").concat(n.uniqueId),this.contentElement=this.getContentElement(),this.styleElement=this.getStyleElement()}var i,o;return i=e,o=[{key:"insertIn",value:function(e,t){return document.head.insertAdjacentElement("beforeend",this.styleElement),e.insertAdjacentElement(t,this.contentElement),this}},{key:"remove",value:function(){var e=this,t=DATA.animationDuration;setTimeout(function(){return e.parentContainer.remove()},1.05*(void 0===t?1e3:t))}},{key:"addCloseEvent",value:function(e){var n=this;e&&e.addEventListener("click",function(e){t.avoidEventDetection(e),t.isOnEditor()||n.parentContainer.recurrence.setClosingRecurrence(),n.parentContainer.hide(),n.remove()},{capture:!0,passive:!1})}},{key:"addRedirectionEvent",value:function(e){var n=this;!t.isOnEditor()&&e&&e.addEventListener("click",function(){var e=DATA,i=e.autoHide,o=e.timeHide;i&&setTimeout(function(){n.parentContainer.hide(),n.remove()},1e3*o),t.isOnEditor()||n.parentContainer.recurrence.setValidationRecurrence()},{capture:!0,passive:!0})}},{key:"getButtons",value:function(){var e=this,t=function(t,n,i,o){var a=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=document.createElement("a");return a&&(r.className="second_link"),r.innerHTML="<span>".concat(t,"</span>"),r.href="button"===n?i:"#","button"===n?(r.target=o?"_blank":"_self",e.addRedirectionEvent(r)):(r.dataset.abtastyActionnable="true",e.addCloseEvent(r)),r},n=DATA,i=n.linkType,o=n.buttonText,a=n.redirectionUrl,r=n.openInNewTab,c=n.secondLink,s=n.secondLinkText,l=n.secondLinkType,u=n.secondLinkURL,d=n.secondLinkOpenInNewTab,m=[t(o,i,a,r)];if(c){var p=t(s,l,u,d,c);m.push(p)}return m}},{key:"getContentElement",value:function(){var e=DATA,t=e.message,n=e.linkType,i=e.buttonText,o=e.redirectionUrl,a=e.openInNewTab,r="string"==typeof t&&t.length?"<p>".concat(t,"</p>"):"",c=document.createElement("string"==typeof n&&n.includes("widget")?"a":"div");if(c.className=this.className,"widget"===n?(c.href=o,a&&(c.target="_blank"),this.addRedirectionEvent(c)):"widgetClose"===n&&(c.href="#",c.dataset.abtastyActionnable="true",this.addCloseEvent(c)),c.innerHTML=r,[n,i].every(function(e){return"string"==typeof e})&&n.includes("button")&&i.length){var s=this.getButtons(),l=document.createElement("div");l.className="buttons_container",s.forEach(function(e){return l.appendChild(e)}),c.appendChild(l)}return c}},{key:"getStyleElement",value:function(){var e=DATA,n=e.textColor,i=e.textAlign,o=e.fontName,a=e.fontStyle,r=e.fontSize,c="#".concat(this.parentContainer.widgetContainerId," .").concat(this.className),s=void 0!==n?"color: ".concat(n,";"):"",l=void 0!==i?"text-align: ".concat(i,";"):"",u=o&&"inherit"!==o?"font-family:".concat(o,";"):a||"",d=r?"font-size: ".concat(r,"px;"):"",m=document.createElement("style");return m.type="text/css",t.isOnEditor()&&m.setAttribute("abtasty-script-added","true"),m.textContent=["".concat(c," > * {"),"display: inline-block;","vertical-align: middle;","}","".concat(c," p {"),"margin: 0;","white-space: pre-line;",s,l,u,d,"}","".concat(c," .buttons_container a {"),"padding: 6px 16px;","}","".concat(c," .buttons_container {"),"display: inline;","}","@media screen and (min-width: 1024px) {","".concat(c," p {"),"width: auto;","max-width: 70%;","}","".concat(c," .buttons_container a {"),"margin-left: 4%;","width: auto;","max-width: calc(30% - 4%);","}","}","@media screen and (max-width: 1023px) {","".concat(c," p {"),"width: 100%;","}","".concat(c," .buttons_container a {"),"margin-top: 14px;","}","}"].join(""),m}}],o&&function(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,(a=function(e){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(o.key),"symbol"===n(a)?a:String(a)),o)}var a}(i.prototype,o),Object.defineProperty(i,"prototype",{writable:!1}),e}();!function(){t.widgetLog("Widget launch");var n=e.getWidgetContainer(),o=n.domElement.querySelector(".".concat(n.contentClassName)),a=new i({parentContainer:n});n.children=a,a.insertIn(o,"beforeend"),n.init(!0).then(function(e){e.response&&n.show()})}()}(classes,helpers);
|