@abtasty/before-after-image
Advanced tools
Comparing version 0.0.4-1 to 0.0.4
@@ -1,1 +0,1 @@ | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).widgetForm=o()}(this,(function(){"use strict";const e="style",o="layout",t="content",l="conditions",a="short-separator",n="text",i="select",r="colorpicker",c="number",_="selectelement",p="radio",d="radioImage",m="switch",g="slider",u="mediaupload",s="group",b="https://widgets-images.abtasty.com/",y="week",v="month",w=[{label:"widget_common_conditions_recurrence_option_everyTime",value:"everytime"},{label:"widget_common_conditions_recurrence_option_everySession",value:"session"},{label:"widget_common_conditions_recurrence_option_everyXDays",value:"day"},{label:"widget_common_conditions_recurrence_option_everyXWeeks",value:y},{label:"widget_common_conditions_recurrence_option_everyXMonths",value:v},{label:"widget_common_conditions_recurrence_option_once",value:"once"}],f={category:l,type:g,min:1},h=[{...f,propName:"day",label:"widget_common_conditions_recurrence_ifOptionVariable_labelDays",value:5,max:395},{...f,propName:y,label:"widget_common_conditions_recurrence_ifOptionVariable_labelWeeks",value:2,max:56},{...f,propName:v,label:"widget_common_conditions_recurrence_ifOptionVariable_labelMonths",value:1,max:13}],N={category:l,type:i,options:w,value:"everytime"},k={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayed",propName:"displayRecurrence"},I={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterClosure",propName:"closingRecurrence"},x={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"},B=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${k.propName}_${t}`,conditions:[{field:k.propName,value:t}]}))),S=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${I.propName}_${t}`,conditions:[{field:I.propName,value:t}]}))),A=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${x.propName}_${t}`,conditions:[{field:x.propName,value:t}]}))),T={category:l,type:a};I.condition=({closeButton:e,layout:o,overlay:t,overlayClickable:l,linkType:a})=>!("string"!=typeof a||!a.includes("Close"))||("popin"!==o||!1!==e||!1!==t&&!1!==l)&&(void 0===o||"popin"===o||!1!==e);const P={category:l,type:s,label:"widget_common_conditions_recurrence_blockTitle",collapsible:!0,children:[k,...B,{...T,condition:I.condition},I,...S,{...T},x,...A]},C="triggerEvent",U={category:l,type:g,propName:"triggerEventDelay",label:"widget_common_conditions_triggering_delay_label",min:0,max:60,value:0},O={...U,propName:"triggerEventReengageDelay",value:10,max:180},z={category:l,type:_,propName:"triggerEventClick",value:"body"},E={...z,propName:"triggerEventElementVisible"},R={category:l,type:"codeeditor",label:"widget_common_conditions_triggering_label_customTriggerJSCode",propName:"triggerEventCustomScript",value:"/* In this example snippet, the widget will be triggered as soon as any scroll is detected.\nCreate your own by resolving resolve() with true (which does trigger) or false (which doesn't trigger) */\n\nfunction launchIfScroll() {\n\treturn new Promise(resolve => {\n\t\tdocument.addEventListener('scroll', () => resolve(true), {once: true});\n\t});\n}\n\nconst result = await launchIfScroll();\nreturn resolve(result);",rows:15},W={pageLoad:{label:"widget_common_conditions_triggering_option_pageload",value:"pageLoad"},direct:{label:"widget_common_conditions_triggering_option_asap",value:"direct"},exitIntent:{label:"widget_common_conditions_triggering_option_exitIntent",value:"exitIntent"},reengage:{label:"widget_common_conditions_triggering_option_afterXSecondsOfInactivity",value:"reengage"},click:{label:"widget_common_conditions_triggering_option_click",value:"click"},elementVisible:{label:"widget_common_conditions_triggering_option_elementVisible",value:"elementVisible"},customScript:{label:"widget_common_conditions_triggering_option_customTrigger",value:"script"}},D={category:l,type:m,propName:"isOncePerPageTrigger",value:!0,label:"widget_common_conditions_triggering_label_triggerOnlyOnce"},L={category:l,type:i,label:"widget_common_conditions_triggering_label",options:[W.pageLoad,W.direct,W.exitIntent,W.reengage,W.click,W.elementVisible,W.customScript],propName:C,value:"pageLoad"};z.conditions=[{field:C,value:"click"}],O.conditions=[{field:C,value:"reengage"}],E.conditions=[{field:C,value:"elementVisible"}],R.conditions=[{field:C,value:"script"}],U.conditions=[{field:C,value:e=>"reengage"!==e}],D.conditions=[{field:C,value:e=>"click"===e||"script"===e}];const $={category:l,type:s,label:"widget_common_conditions_triggering_blockTitle",collapsible:!0,children:[L,z,E,R,D,O,U]},H={category:o,type:d,propName:"layout",label:"widget_common_layout_label_selectALayout",value:"popin",style:"big",options:[{label:"widget_common_layout_option_modal",value:"popin",src:`${b}layout/icon-layout-modal.png`},{label:"widget_common_layout_option_topBanner",value:"bannerTop",src:`${b}layout/icon-layout-topBanner.png`},{label:"widget_common_layout_option_bottomBanner",value:"bannerBottom",src:`${b}layout/icon-layout-bottomBanner.png`},{label:"widget_common_layout_option_freePlacement",value:"free",src:`${b}layout/icon-layout-freePlacement.png`}]},V={category:o,type:_,propName:"elementReferrer",label:"widget_common_layout_label_selectElementContainWidget",value:"body"},j={category:o,type:p,propName:"referrerInsertType",value:"afterbegin",label:"widget_common_layout_positioning_label_selectPosition",options:[{label:"widget_common_layout_positioning_option_before",value:"beforebegin"},{label:"widget_common_layout_positioning_option_atTheBeginning",value:"afterbegin"},{label:"widget_common_layout_positioning_option_atTheEnd",value:"beforeend"},{label:"widget_common_layout_positioning_option_after",value:"afterend"}]},M={category:o,type:"positioninput",propName:"popinPosition",label:"widget_common_layout_blockTitle_layout",value:[{x:1,y:1}],condition:({layout:e})=>"popin"===e},X=[{field:"layout",value:"free"}];V.conditions=X,j.conditions=X;const F={category:o,type:s,label:"widget_common_layout_blockTitle_layout",collapsible:!0,children:[H,V,M,j]},J={category:o,type:m,label:"widget_common_layout_toggler_widgetDimensionsBasedOnContent",propName:"autoWidth",value:!0},q=[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"vw (% of viewport width)",value:"vw"},{label:"vh (% of viewport height)",value:"vh"},{label:"vmin (% of viewport minimum size)",value:"vmin"},{label:"vmax (% of viewport maximum size)",value:"vmax"}],G={category:o,type:m,propName:"autoHeight",label:"widget_common_layout_toggler_label_keepHeightAuto",value:!0},K={category:o,type:i,propName:"widthUnit",value:"vw",options:q},Q={category:o,type:i,propName:"heightUnit",value:"vh",condition:({autoHeight:e})=>!e,options:q},Y={category:o,type:c,label:"widget_common_layout_popinDimensions_label_width",propName:"popinPercentWidth",value:50,max:100,condition:({widthUnit:e,layout:o})=>"px"!==e&&"popin"===o},Z={category:o,type:c,label:"widget_common_layout_popinDimensions_label_width",propName:"popinPixelsWidth",value:parseInt(window.innerWidth/2.5,10),max:window.innerWidth,condition:({widthUnit:e,layout:o})=>"px"===e&&"popin"===o},ee={category:o,type:c,label:"widget_common_layout_popinDimensions_label_height",propName:"popinPercentHeight",value:50,max:100,condition:({autoHeight:e,heightUnit:o,layout:t})=>!e&&"px"!==o&&"popin"===t},oe={category:o,type:c,label:"widget_common_layout_popinDimensions_label_height",propName:"popinPixelsHeight",value:parseInt(window.innerHeight/2.5,10),max:window.innerHeight,condition:({autoHeight:e,heightUnit:o,layout:t})=>!e&&"px"===o&&"popin"===t},te=({autoWidth:e})=>!e;K.condition=te,G.condition=te;const le=Y.condition;Y.condition=e=>le(e)&&te(e);const ae=Z.condition;Z.condition=e=>ae(e)&&te(e);const ne=ee.condition;ee.condition=e=>ne(e)&&te(e);const ie=oe.condition;oe.condition=e=>ie(e)&&te(e);const re=Q.condition;Q.condition=e=>re(e)&&te(e);const ce={category:o,type:s,collapsible:!0,label:"widget_common_layout_blockTitle_dimensions",children:[J,Y,Z,K,G,ee,oe,Q],conditions:[{field:"layout",value:"popin"}]},_e={category:o,type:"inlinenotification",label:"widget_common_layout_zindex_alert_text",hrefUrl:"widget_common_layout_zindex_alert_link"},pe={category:o,type:s,label:"widget_common_layout_blockTitle_layering",collapsible:!0,children:[{category:o,type:p,propName:"zindex",value:"9999",label:"widget_common_layout_zIndex_label",options:[{label:"widget_common_layout_zIndex_radio_option_above",value:"2147483647"},{label:"widget_common_layout_zIndex_radio_option_default",value:"9999"},{label:"widget_common_layout_zIndex_radio_option_auto",value:"auto"},{label:"widget_common_layout_zIndex_radio_option_under",value:"-1"},{label:"widget_common_layout_zIndex_radio_option_custom",value:"custom"}]},{category:o,type:c,propName:"zindexCustom",label:"widget_common_layout_zIndex_custom_numberInput_label",value:1,min:-2147483647,max:2147483647,conditions:[{field:"zindex",value:"custom"}]}],conditions:[{field:"layout",value:e=>"free"!==e}]},de={field:"isBackgroundImage",value:!0},me={field:"backgroundSize",value:e=>"100% 100%"!==e},ge={category:e,type:r,label:"widget_common_style_container_label_backgroundColor",propName:"backgroundColor",value:"rgba(247, 247, 247, 1)"},ue={category:e,type:m,label:"widget_common_style_toggler_label_backgroundImage",propName:"isBackgroundImage",value:!1},se={category:e,type:u,label:"widget_common_style_toggler_label_backgroundImage",propName:"backgroundImage",value:"",conditions:[de]},be={category:e,type:p,label:"widget_common_style_backgroundImageUploader_imageOptions_label",propName:"backgroundSize",value:"cover",options:[{label:"widget_common_style_backgroundImageUploader_imageOptions_option_cover",value:"cover"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_contain",value:"contain"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_fill",value:"100% 100%"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_none",value:"auto"}],conditions:[de]},ye={category:e,type:i,label:"widget_common_style_backgroundImageUploader_imagePosition_select_label",propName:"backgroundPosition",value:"center",options:[{label:"widget_common_style_backgroundImageUploader_imagePosition_option_top",value:"top"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottom",value:"bottom"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_center",value:"center"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_left",value:"left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_right",value:"right"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_topLeft",value:"top left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_topRight",value:"top right"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottomLeft",value:"bottom left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottomRight",value:"bottom right"}],conditions:[de,me]},ve={category:e,type:m,label:"widget_common_style_backgroundImageUploader_toggler_repeatBackgroundImage",propName:"backgroundRepeat",value:!1,conditions:[de,me,{field:"backgroundSize",value:e=>"cover"!==e}]},we={category:e,type:r,label:"widget_common_style_border_label_borderColor",propName:"borderColor",value:"rgba(0, 127, 145, 1)"},fe={category:e,type:g,label:"widget_common_style_border_label_borderRadius",propName:"borderRadius",value:4,unit:"px"},he={category:e,type:g,label:"widget_common_style_border_label_borderThickness",propName:"borderWidth",value:2,min:0,max:50,unit:"px"},Ne={category:e,type:"areainput"},ke={...Ne,label:"widget_common_style_container_label_margin",propName:"containerMargin",value:[{top:0,left:0,bottom:0,right:0}]},Ie={...Ne,label:"widget_common_style_container_label_padding",propName:"containerPadding",value:[{top:35,left:60,bottom:35,right:60}]},xe={category:e,type:m,label:"widget_common_style_container_dropShadow_blockTitle",propName:"dropShadow",value:!1},Be={category:e,type:r,label:"widget_common_style_container_dropShadow_label_color",propName:"dropShadowColor",value:"rgba(57, 57, 57, 0.25);"},Se={category:e,type:g,label:"widget_common_style_container_dropShadow_label_blurRadius",propName:"dropShadowBlur",value:10,unit:"px"},Ae={category:e,type:m,label:"widget_common_style_closeButton_label_displayCloseButton",propName:"closeButton",value:!0},Te={category:e,type:p,label:"widget_common_style_closeButton_radio_closeButtonPosition",propName:"closeButtonPosition",value:"in",options:[{label:"widget_common_style_closeButton_radio_closeButtonPosition_option_inside",value:"in"},{label:"widget_common_style_closeButton_radio_closeButtonPosition_option_outside",value:"out"}]},Pe={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonSize",propName:"closeButtonSize",value:16,min:10,max:50},Ce={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonColor",propName:"closeButtonColor",value:"rgba(119, 119, 119, 1)",condition:({closeButtonBorderWidth:e})=>e>0},Ue={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBackgroundColor",propName:"closeButtonBackgroundColor",value:"rgba(255, 255, 255, 0)"},Oe={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonBorderRadius",propName:"closeButtonBorderRadius",value:0,min:0,max:50},ze={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonBorderThickness",propName:"closeButtonBorderWidth",value:0,min:0,max:50},Ee={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBorderColor",propName:"closeButtonBorderColor",value:"rgba(57, 57, 57, 1)"},Re={category:e,type:m,propName:"overlay",label:"widget_common_style_blockTitle_overlay",value:!0},We={category:e,type:r,label:"widget_common_style_overlay_label_overlayColor",propName:"overlayColor",value:"rgba(0, 0, 0, 0.6)"},De={category:e,type:m,label:"widget_common_style_overlay_label_overlayClickable",propName:"overlayClickable",value:!0},Le=[ge,ue,se,be,ye,ve],$e=[{field:he.propName,value:e=>e>0}];we.conditions=$e;const He={category:e,type:s,label:"widget_common_style_blockTitle_border",collapsible:!0,children:[he,we,fe]},Ve={category:e,type:a},je=[{field:"dropShadow",value:!0}];Be.conditions=je,Se.conditions=je;const Me={category:e,type:s,label:"widget_common_style_blockTitle_container",collapsible:!0,children:[ke,Ie,{...Ve},...Le,{...Ve},xe,Be,Se]},Xe=[{field:"overlay"}];We.conditions=Xe,De.conditions=Xe;const Fe={category:e,type:s,label:"widget_common_style_blockTitle_overlay",collapsible:!0,children:[Re,We,De],conditions:[{field:"layout",value:"popin"}]},Je=({closeButton:e})=>e,qe={category:e,type:a,condition:Je},Ge=Ce.condition;Te.condition=Je,Pe.condition=Je,Ce.condition=e=>Ge(e)&&Je(e),Ue.condition=Je,Oe.condition=Je,ze.condition=Je,Ee.condition=Je;const Ke={category:e,type:s,label:"widget_common_style_blockTitle_closeButton",collapsible:!0,children:[Ae,Te,{...qe},Pe,Ce,Ue,{...qe},Oe,ze,Ee]};var Qe="draggableSeparator",Ye=[{category:o,type:d,label:"widget_beforeAfter_layout_sublayout_label",propName:"subLayout",value:Qe,style:"big",options:[{label:"widget_beforeAfter_layout_sublayout_option_draggableSeparator",value:Qe,src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-draggable.png"},{label:"widget_beforeAfter_layout_sublayout_option_nextToEachOther",value:"nextEachOther",src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-nextEachOther.png"},{label:"widget_beforeAfter_layout_sublayout_option_onTopOfEachOther",value:"onTopEachOther",src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-topEachOther.png"}]}],Ze=[{category:t,propName:"titleSwitch",type:m,label:"widget_beforeAfter_content_title_label_switch",value:!1},{category:t,propName:"titleInput",type:n,label:"widget_beforeAfter_content_title_label_input",value:"widget_beforeAfter_content_title_placeholder_input",condition:function(e){return e.titleSwitch}},{category:t,propName:"catchSwitch",type:m,label:"widget_beforeAfter_content_catchline_label_switch",value:!1},{category:t,propName:"catchInput",type:"textarea",label:"widget_beforeAfter_content_catchline_label_input",value:"widget_beforeAfter_content_catchline_placeholder_input",condition:function(e){return e.catchSwitch}},{category:t,propName:"topImage",type:u,label:"widget_beforeAfter_content_select_topImage_label",value:""},{category:t,propName:"backImage",type:u,label:"widget_beforeAfter_content_select_backImage_label",value:""},{category:t,propName:"switchLabelImgs",type:m,label:"widget_beforeAfter_content_labels_label_switch",value:!1},{category:t,propName:"labelTopImgInput",type:n,label:"widget_beforeAfter_content_topImage_label_label_input",value:"widget_beforeAfter_content_topImage_label_placeholder_input",condition:function(e){return e.switchLabelImgs}},{category:t,propName:"labelBackImgInput",type:n,label:"widget_beforeAfter_content_backImage_label_label_input",value:"widget_beforeAfter_content_backImage_label_placeholder_input",condition:function(e){return e.switchLabelImgs}}];function eo(e){return function(e){if(Array.isArray(e))return oo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(!e)return;if("string"==typeof e)return oo(e,o);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oo(e,o)}(e)||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 oo(e,o){(null==o||o>e.length)&&(o=e.length);for(var t=0,l=new Array(o);t<o;t++)l[t]=e[t];return l}Me.collapsed=!1,$.collapsed=!1;var to=F.children.find((function(e){return"layout"===e.propName}));to.options=to.options.filter((function(e){return!e.value.includes("banner")})),P.children=P.children.filter((function(e,o){return!e.propName&&"validationRecurrence"!==P.children[o+1].propName||e.propName&&!e.propName.includes("validationRecurrence")})),Me.children.find((function(e){return"containerPadding"===e.propName})).value=[{top:0,left:0,bottom:0,right:0}],He.children.find((function(e){return"borderWidth"===e.propName})).value=0,ce.children.find((function(e){return"autoWidth"===e.propName})).value=!0;var lo=ce.children.find((function(e){return"widthUnit"===e.propName}));return lo.options=lo.options.filter((function(e){return"%"!==e.value})),[].concat(eo(F.children),eo(Ye),[ce,_e,pe],eo(Ze),[Me,He,Fe,Ke,$,P])})); | ||
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(e="undefined"!=typeof globalThis?globalThis:e||self).widgetForm=o()}(this,(function(){"use strict";const e="style",o="layout",t="content",l="conditions",a="short-separator",n="text",i="select",r="colorpicker",c="number",_="selectelement",p="radio",d="radioImage",m="switch",g="slider",u="mediaupload",s="group",b="https://widgets-images.abtasty.com/",y="week",v="month",w=[{label:"widget_common_conditions_recurrence_option_everyTime",value:"everytime"},{label:"widget_common_conditions_recurrence_option_everySession",value:"session"},{label:"widget_common_conditions_recurrence_option_everyXDays",value:"day"},{label:"widget_common_conditions_recurrence_option_everyXWeeks",value:y},{label:"widget_common_conditions_recurrence_option_everyXMonths",value:v},{label:"widget_common_conditions_recurrence_option_once",value:"once"}],f={category:l,type:g,min:1},h=[{...f,propName:"day",label:"widget_common_conditions_recurrence_ifOptionVariable_labelDays",value:5,max:395},{...f,propName:y,label:"widget_common_conditions_recurrence_ifOptionVariable_labelWeeks",value:2,max:56},{...f,propName:v,label:"widget_common_conditions_recurrence_ifOptionVariable_labelMonths",value:1,max:13}],N={category:l,type:i,options:w,value:"everytime"},k={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayed",propName:"displayRecurrence"},I={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterClosure",propName:"closingRecurrence"},x={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"},B=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${k.propName}_${t}`,conditions:[{field:k.propName,value:t}]}))),S=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${I.propName}_${t}`,conditions:[{field:I.propName,value:t}]}))),A=h.map((({type:e,min:o,propName:t,label:a,value:n,max:i})=>({category:l,type:e,min:o,max:i,label:a,value:n,propName:`${x.propName}_${t}`,conditions:[{field:x.propName,value:t}]}))),T={category:l,type:a};I.condition=({closeButton:e,layout:o,overlay:t,overlayClickable:l,linkType:a})=>!("string"!=typeof a||!a.includes("Close"))||("popin"!==o||!1!==e||!1!==t&&!1!==l)&&(void 0===o||"popin"===o||!1!==e);const P={category:l,type:s,label:"widget_common_conditions_recurrence_blockTitle",collapsible:!0,children:[k,...B,{...T,condition:I.condition},I,...S,{...T},x,...A]},C="triggerEvent",U={category:l,type:g,propName:"triggerEventDelay",label:"widget_common_conditions_triggering_delay_label",min:0,max:60,value:0},O={...U,propName:"triggerEventReengageDelay",value:10,max:180},z={category:l,type:_,propName:"triggerEventClick",value:"body"},E={...z,propName:"triggerEventElementVisible"},R={category:l,type:"codeeditor",label:"widget_common_conditions_triggering_label_customTriggerJSCode",propName:"triggerEventCustomScript",value:"/* In this example snippet, the widget will be triggered as soon as any scroll is detected.\nCreate your own by resolving resolve() with true (which does trigger) or false (which doesn't trigger) */\n\nfunction launchIfScroll() {\n\treturn new Promise(resolve => {\n\t\tdocument.addEventListener('scroll', () => resolve(true), {once: true});\n\t});\n}\n\nconst result = await launchIfScroll();\nreturn resolve(result);",rows:15},W={pageLoad:{label:"widget_common_conditions_triggering_option_pageload",value:"pageLoad"},direct:{label:"widget_common_conditions_triggering_option_asap",value:"direct"},exitIntent:{label:"widget_common_conditions_triggering_option_exitIntent",value:"exitIntent"},reengage:{label:"widget_common_conditions_triggering_option_afterXSecondsOfInactivity",value:"reengage"},click:{label:"widget_common_conditions_triggering_option_click",value:"click"},elementVisible:{label:"widget_common_conditions_triggering_option_elementVisible",value:"elementVisible"},customScript:{label:"widget_common_conditions_triggering_option_customTrigger",value:"script"}},D={category:l,type:m,propName:"isOncePerPageTrigger",value:!0,label:"widget_common_conditions_triggering_label_triggerOnlyOnce"},L={category:l,type:i,label:"widget_common_conditions_triggering_label",options:[W.pageLoad,W.direct,W.exitIntent,W.reengage,W.click,W.elementVisible,W.customScript],propName:C,value:"pageLoad"};z.conditions=[{field:C,value:"click"}],O.conditions=[{field:C,value:"reengage"}],E.conditions=[{field:C,value:"elementVisible"}],R.conditions=[{field:C,value:"script"}],U.conditions=[{field:C,value:e=>"reengage"!==e}],D.conditions=[{field:C,value:e=>"click"===e||"script"===e}];const $={category:l,type:s,label:"widget_common_conditions_triggering_blockTitle",collapsible:!0,children:[L,z,E,R,D,O,U]},H={category:o,type:d,propName:"layout",label:"widget_common_layout_label_selectALayout",value:"popin",style:"big",options:[{label:"widget_common_layout_option_modal",value:"popin",src:`${b}layout/icon-layout-modal.png`},{label:"widget_common_layout_option_topBanner",value:"bannerTop",src:`${b}layout/icon-layout-topBanner.png`},{label:"widget_common_layout_option_bottomBanner",value:"bannerBottom",src:`${b}layout/icon-layout-bottomBanner.png`},{label:"widget_common_layout_option_freePlacement",value:"free",src:`${b}layout/icon-layout-freePlacement.png`}]},V={category:o,type:_,propName:"elementReferrer",label:"widget_common_layout_label_selectElementContainWidget",value:"body"},j={category:o,type:p,propName:"referrerInsertType",value:"afterbegin",label:"widget_common_layout_positioning_label_selectPosition",options:[{label:"widget_common_layout_positioning_option_before",value:"beforebegin"},{label:"widget_common_layout_positioning_option_atTheBeginning",value:"afterbegin"},{label:"widget_common_layout_positioning_option_atTheEnd",value:"beforeend"},{label:"widget_common_layout_positioning_option_after",value:"afterend"}]},M={category:o,type:"positioninput",propName:"popinPosition",label:"widget_common_layout_blockTitle_layout",value:[{x:1,y:1}],condition:({layout:e})=>"popin"===e},X=[{field:"layout",value:"free"}];V.conditions=X,j.conditions=X;const F={category:o,type:s,label:"widget_common_layout_blockTitle_layout",collapsible:!0,children:[H,V,M,j]},J={category:o,type:m,label:"widget_common_layout_toggler_widgetDimensionsBasedOnContent",propName:"autoWidth",value:!0},q=[{label:"px",value:"px"},{label:"%",value:"%"},{label:"em",value:"em"},{label:"vw (% of viewport width)",value:"vw"},{label:"vh (% of viewport height)",value:"vh"},{label:"vmin (% of viewport minimum size)",value:"vmin"},{label:"vmax (% of viewport maximum size)",value:"vmax"}],G={category:o,type:m,propName:"autoHeight",label:"widget_common_layout_toggler_label_keepHeightAuto",value:!0},K={category:o,type:i,propName:"widthUnit",value:"vw",options:q},Q={category:o,type:i,propName:"heightUnit",value:"vh",condition:({autoHeight:e})=>!e,options:q},Y={category:o,type:c,label:"widget_common_layout_popinDimensions_label_width",propName:"popinPercentWidth",value:50,max:100,condition:({widthUnit:e,layout:o})=>"px"!==e&&"popin"===o},Z={category:o,type:c,label:"widget_common_layout_popinDimensions_label_width",propName:"popinPixelsWidth",value:parseInt(window.innerWidth/2.5,10),max:window.innerWidth,condition:({widthUnit:e,layout:o})=>"px"===e&&"popin"===o},ee={category:o,type:c,label:"widget_common_layout_popinDimensions_label_height",propName:"popinPercentHeight",value:50,max:100,condition:({autoHeight:e,heightUnit:o,layout:t})=>!e&&"px"!==o&&"popin"===t},oe={category:o,type:c,label:"widget_common_layout_popinDimensions_label_height",propName:"popinPixelsHeight",value:parseInt(window.innerHeight/2.5,10),max:window.innerHeight,condition:({autoHeight:e,heightUnit:o,layout:t})=>!e&&"px"===o&&"popin"===t},te=({autoWidth:e})=>!e;K.condition=te,G.condition=te;const le=Y.condition;Y.condition=e=>le(e)&&te(e);const ae=Z.condition;Z.condition=e=>ae(e)&&te(e);const ne=ee.condition;ee.condition=e=>ne(e)&&te(e);const ie=oe.condition;oe.condition=e=>ie(e)&&te(e);const re=Q.condition;Q.condition=e=>re(e)&&te(e);const ce={category:o,type:s,collapsible:!0,label:"widget_common_layout_blockTitle_dimensions",children:[J,Y,Z,K,G,ee,oe,Q],conditions:[{field:"layout",value:"popin"}]},_e={category:o,type:"inlinenotification",label:"widget_common_layout_zindex_alert_text",hrefUrl:"widget_common_layout_zindex_alert_link"},pe={category:o,type:s,label:"widget_common_layout_blockTitle_layering",collapsible:!0,children:[{category:o,type:p,propName:"zindex",value:"9999",label:"widget_common_layout_zIndex_label",options:[{label:"widget_common_layout_zIndex_radio_option_above",value:"2147483647"},{label:"widget_common_layout_zIndex_radio_option_default",value:"9999"},{label:"widget_common_layout_zIndex_radio_option_auto",value:"auto"},{label:"widget_common_layout_zIndex_radio_option_under",value:"-1"},{label:"widget_common_layout_zIndex_radio_option_custom",value:"custom"}]},{category:o,type:c,propName:"zindexCustom",label:"widget_common_layout_zIndex_custom_numberInput_label",value:1,min:-2147483647,max:2147483647,conditions:[{field:"zindex",value:"custom"}]}],conditions:[{field:"layout",value:e=>"free"!==e}]},de={field:"isBackgroundImage",value:!0},me={field:"backgroundSize",value:e=>"100% 100%"!==e},ge={category:e,type:r,label:"widget_common_style_container_label_backgroundColor",propName:"backgroundColor",value:"rgba(247, 247, 247, 1)"},ue={category:e,type:m,label:"widget_common_style_toggler_label_backgroundImage",propName:"isBackgroundImage",value:!1},se={category:e,type:u,label:"widget_common_style_toggler_label_backgroundImage",propName:"backgroundImage",value:"",conditions:[de]},be={category:e,type:p,label:"widget_common_style_backgroundImageUploader_imageOptions_label",propName:"backgroundSize",value:"cover",options:[{label:"widget_common_style_backgroundImageUploader_imageOptions_option_cover",value:"cover"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_contain",value:"contain"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_fill",value:"100% 100%"},{label:"widget_common_style_backgroundImageUploader_imageOptions_option_none",value:"auto"}],conditions:[de]},ye={category:e,type:i,label:"widget_common_style_backgroundImageUploader_imagePosition_select_label",propName:"backgroundPosition",value:"center",options:[{label:"widget_common_style_backgroundImageUploader_imagePosition_option_top",value:"top"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottom",value:"bottom"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_center",value:"center"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_left",value:"left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_right",value:"right"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_topLeft",value:"top left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_topRight",value:"top right"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottomLeft",value:"bottom left"},{label:"widget_common_style_backgroundImageUploader_imagePosition_option_bottomRight",value:"bottom right"}],conditions:[de,me]},ve={category:e,type:m,label:"widget_common_style_backgroundImageUploader_toggler_repeatBackgroundImage",propName:"backgroundRepeat",value:!1,conditions:[de,me,{field:"backgroundSize",value:e=>"cover"!==e}]},we={category:e,type:r,label:"widget_common_style_border_label_borderColor",propName:"borderColor",value:"rgba(0, 127, 145, 1)"},fe={category:e,type:g,label:"widget_common_style_border_label_borderRadius",propName:"borderRadius",value:4,unit:"px"},he={category:e,type:g,label:"widget_common_style_border_label_borderThickness",propName:"borderWidth",value:2,min:0,max:50,unit:"px"},Ne={category:e,type:"areainput"},ke={...Ne,label:"widget_common_style_container_label_margin",propName:"containerMargin",value:[{top:0,left:0,bottom:0,right:0}]},Ie={...Ne,label:"widget_common_style_container_label_padding",propName:"containerPadding",value:[{top:35,left:60,bottom:35,right:60}]},xe={category:e,type:m,label:"widget_common_style_container_dropShadow_blockTitle",propName:"dropShadow",value:!1},Be={category:e,type:r,label:"widget_common_style_container_dropShadow_label_color",propName:"dropShadowColor",value:"rgba(57, 57, 57, 0.25);"},Se={category:e,type:g,label:"widget_common_style_container_dropShadow_label_blurRadius",propName:"dropShadowBlur",value:10,unit:"px"},Ae={category:e,type:m,label:"widget_common_style_closeButton_label_displayCloseButton",propName:"closeButton",value:!0},Te={category:e,type:p,label:"widget_common_style_closeButton_radio_closeButtonPosition",propName:"closeButtonPosition",value:"in",options:[{label:"widget_common_style_closeButton_radio_closeButtonPosition_option_inside",value:"in"},{label:"widget_common_style_closeButton_radio_closeButtonPosition_option_outside",value:"out"}]},Pe={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonSize",propName:"closeButtonSize",value:16,min:10,max:50},Ce={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonColor",propName:"closeButtonColor",value:"rgba(119, 119, 119, 1)"},Ue={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBackgroundColor",propName:"closeButtonBackgroundColor",value:"rgba(255, 255, 255, 0)"},Oe={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonBorderRadius",propName:"closeButtonBorderRadius",value:0,min:0,max:50},ze={category:e,type:g,label:"widget_common_style_closeButton_label_closeButtonBorderThickness",propName:"closeButtonBorderWidth",value:0,min:0,max:50},Ee={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBorderColor",propName:"closeButtonBorderColor",value:"rgba(57, 57, 57, 1)",condition:({closeButtonBorderWidth:e})=>e>0},Re={category:e,type:m,propName:"overlay",label:"widget_common_style_blockTitle_overlay",value:!0},We={category:e,type:r,label:"widget_common_style_overlay_label_overlayColor",propName:"overlayColor",value:"rgba(0, 0, 0, 0.6)"},De={category:e,type:m,label:"widget_common_style_overlay_label_overlayClickable",propName:"overlayClickable",value:!0},Le=[ge,ue,se,be,ye,ve],$e=[{field:he.propName,value:e=>e>0}];we.conditions=$e;const He={category:e,type:s,label:"widget_common_style_blockTitle_border",collapsible:!0,children:[he,we,fe]},Ve={category:e,type:a},je=[{field:"dropShadow",value:!0}];Be.conditions=je,Se.conditions=je;const Me={category:e,type:s,label:"widget_common_style_blockTitle_container",collapsible:!0,children:[ke,Ie,{...Ve},...Le,{...Ve},xe,Be,Se]},Xe=[{field:"overlay"}];We.conditions=Xe,De.conditions=Xe;const Fe={category:e,type:s,label:"widget_common_style_blockTitle_overlay",collapsible:!0,children:[Re,We,De],conditions:[{field:"layout",value:"popin"}]},Je=({closeButton:e})=>e,qe={category:e,type:a,condition:Je},Ge=Ee.condition;Te.condition=Je,Pe.condition=Je,Ce.condition=Je,Ue.condition=Je,Oe.condition=Je,ze.condition=Je,Ee.condition=e=>Ge(e)&&Je(e);const Ke={category:e,type:s,label:"widget_common_style_blockTitle_closeButton",collapsible:!0,children:[Ae,Te,{...qe},Pe,Ce,Ue,{...qe},Oe,ze,Ee]};var Qe="draggableSeparator",Ye=[{category:o,type:d,label:"widget_beforeAfter_layout_sublayout_label",propName:"subLayout",value:Qe,style:"big",options:[{label:"widget_beforeAfter_layout_sublayout_option_draggableSeparator",value:Qe,src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-draggable.png"},{label:"widget_beforeAfter_layout_sublayout_option_nextToEachOther",value:"nextEachOther",src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-nextEachOther.png"},{label:"widget_beforeAfter_layout_sublayout_option_onTopOfEachOther",value:"onTopEachOther",src:"https://widgets-images.abtasty.com/layout/icon-layout-beforeAfter-topEachOther.png"}]}],Ze=[{category:t,propName:"titleSwitch",type:m,label:"widget_beforeAfter_content_title_label_switch",value:!1},{category:t,propName:"titleInput",type:n,label:"widget_beforeAfter_content_title_label_input",value:"widget_beforeAfter_content_title_placeholder_input",condition:function(e){return e.titleSwitch}},{category:t,propName:"catchSwitch",type:m,label:"widget_beforeAfter_content_catchline_label_switch",value:!1},{category:t,propName:"catchInput",type:"textarea",label:"widget_beforeAfter_content_catchline_label_input",value:"widget_beforeAfter_content_catchline_placeholder_input",condition:function(e){return e.catchSwitch}},{category:t,propName:"topImage",type:u,label:"widget_beforeAfter_content_select_topImage_label",value:""},{category:t,propName:"backImage",type:u,label:"widget_beforeAfter_content_select_backImage_label",value:""},{category:t,propName:"switchLabelImgs",type:m,label:"widget_beforeAfter_content_labels_label_switch",value:!1},{category:t,propName:"labelTopImgInput",type:n,label:"widget_beforeAfter_content_topImage_label_label_input",value:"widget_beforeAfter_content_topImage_label_placeholder_input",condition:function(e){return e.switchLabelImgs}},{category:t,propName:"labelBackImgInput",type:n,label:"widget_beforeAfter_content_backImage_label_label_input",value:"widget_beforeAfter_content_backImage_label_placeholder_input",condition:function(e){return e.switchLabelImgs}}];function eo(e){return function(e){if(Array.isArray(e))return oo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(!e)return;if("string"==typeof e)return oo(e,o);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oo(e,o)}(e)||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 oo(e,o){(null==o||o>e.length)&&(o=e.length);for(var t=0,l=new Array(o);t<o;t++)l[t]=e[t];return l}Me.collapsed=!1,$.collapsed=!1;var to=F.children.find((function(e){return"layout"===e.propName}));to.options=to.options.filter((function(e){return!e.value.includes("banner")})),P.children=P.children.filter((function(e,o){return!e.propName&&"validationRecurrence"!==P.children[o+1].propName||e.propName&&!e.propName.includes("validationRecurrence")})),Me.children.find((function(e){return"containerPadding"===e.propName})).value=[{top:0,left:0,bottom:0,right:0}],He.children.find((function(e){return"borderWidth"===e.propName})).value=0,ce.children.find((function(e){return"autoWidth"===e.propName})).value=!0;var lo=ce.children.find((function(e){return"widthUnit"===e.propName}));return lo.options=lo.options.filter((function(e){return"%"!==e.value})),[].concat(eo(F.children),eo(Ye),[ce,_e,pe],eo(Ze),[Me,He,Fe,Ke,$,P])})); |
{ | ||
"name": "@abtasty/before-after-image", | ||
"description": "Widget for AB Tasty", | ||
"version": "0.0.4-1", | ||
"version": "0.0.4", | ||
"form": "dist/form.js", | ||
@@ -37,4 +37,4 @@ "main": "dist/main.js", | ||
"dependencies": { | ||
"@abtasty/widget-utils": "^1.18.14" | ||
"@abtasty/widget-utils": "^1.18.15" | ||
} | ||
} |
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
98
2
63023