@abtasty/before-after-image 0.0.2 → 0.0.3-0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/dist/form.js +1 -1
  2. package/package.json +1 -1
package/dist/form.js CHANGED
@@ -1 +1 @@
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",g="radioImage",m="switch",d="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:d,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"},B={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"},x=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:`${B.propName}_${t}`,conditions:[{field:B.propName,value:t}]}))),P={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 T={category:l,type:s,label:"widget_common_conditions_recurrence_blockTitle",collapsible:!0,children:[k,...x,{...P,condition:I.condition},I,...S,{...P},B,...A]},C="triggerEvent",U={category:l,type:d,propName:"triggerEventDelay",label:"widget_common_conditions_triggering_delay_label",min:0,max:60,value:0},O={...U,propName:"triggerEventReengageDelay",value:10,max:180},E={category:l,type:_,propName:"triggerEventClick",value:"body"},R={...E,propName:"triggerEventElementVisible"},L={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},D={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"}},W={category:l,type:m,propName:"isOncePerPageTrigger",value:!0,label:"widget_common_conditions_triggering_label_triggerOnlyOnce"},$={category:l,type:i,label:"widget_common_conditions_triggering_label",options:[D.pageLoad,D.direct,D.exitIntent,D.reengage,D.click,D.elementVisible,D.customScript],propName:C,value:"pageLoad"};E.conditions=[{field:C,value:"click"}],O.conditions=[{field:C,value:"reengage"}],R.conditions=[{field:C,value:"elementVisible"}],L.conditions=[{field:C,value:"script"}],U.conditions=[{field:C,value:e=>"reengage"!==e}],W.conditions=[{field:C,value:e=>"click"===e||"script"===e}];const H={category:l,type:s,label:"widget_common_conditions_triggering_blockTitle",collapsible:!0,children:[$,E,R,L,W,O,U]},V={category:o,type:g,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`}]},z={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"}];z.conditions=X,j.conditions=X;const F={category:o,type:s,label:"widget_common_layout_blockTitle_layout",collapsible:!0,children:[V,z,M,j]},J=[{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"}],q={category:o,type:m,propName:"autoHeight",label:"widget_common_layout_toggler_label_keepHeightAuto",value:!0},G={category:o,type:i,propName:"widthUnit",value:"vw",options:J},K={category:o,type:i,propName:"heightUnit",value:"vh",condition:({autoHeight:e})=>!e,options:J},Q={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},Y={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},Z={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},ee={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},oe=({autoWidth:e})=>!e,te=([Q,Y,G,q,Z,ee,K].reduce(((e,o)=>{let t;const{condition:l}=o;return t=l?{...o,condition:e=>l(e)&&oe(e)}:{...o,condition:oe},[...e,t]}),[]),{field:"isBackgroundImage",value:!0}),le={field:"backgroundSize",value:e=>"100% 100%"!==e},ae={category:e,type:r,label:"widget_common_style_container_label_backgroundColor",propName:"backgroundColor",value:"rgba(247, 247, 247, 1)"},ne={category:e,type:m,label:"widget_common_style_toggler_label_backgroundImage",propName:"isBackgroundImage",value:!1},ie={category:e,type:u,label:"widget_common_style_toggler_label_backgroundImage",propName:"backgroundImage",value:"",conditions:[te]},re={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:[te]},ce={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:[te,le]},_e={category:e,type:m,label:"widget_common_style_backgroundImageUploader_toggler_repeatBackgroundImage",propName:"backgroundRepeat",value:!1,conditions:[te,le,{field:"backgroundSize",value:e=>"cover"!==e}]},pe={category:e,type:r,label:"widget_common_style_border_label_borderColor",propName:"borderColor",value:"rgba(0, 127, 145, 1)"},ge={category:e,type:d,label:"widget_common_style_border_label_borderRadius",propName:"borderRadius",value:4,unit:"px"},me={category:e,type:d,label:"widget_common_style_border_label_borderThickness",propName:"borderWidth",value:2,min:0,max:50,unit:"px"},de={category:e,type:"areainput"},ue={...de,label:"widget_common_style_container_label_margin",propName:"containerMargin",value:[{top:0,left:0,bottom:0,right:0}]},se={...de,label:"widget_common_style_container_label_padding",propName:"containerPadding",value:[{top:35,left:60,bottom:35,right:60}]},be={category:e,type:m,label:"widget_common_style_container_dropShadow_blockTitle",propName:"dropShadow",value:!1},ye={category:e,type:r,label:"widget_common_style_container_dropShadow_label_color",propName:"dropShadowColor",value:"rgba(57, 57, 57, 0.25);"},ve={category:e,type:d,label:"widget_common_style_container_dropShadow_label_blurRadius",propName:"dropShadowBlur",value:10,unit:"px"},we={category:e,type:m,label:"widget_common_style_closeButton_label_displayCloseButton",propName:"closeButton",value:!0},fe={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"}]},he={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonSize",propName:"closeButtonSize",value:16,min:10,max:50},Ne={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonColor",propName:"closeButtonColor",value:"rgba(119, 119, 119, 1)",condition:({closeButtonBorderWidth:e})=>e>0},ke={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBackgroundColor",propName:"closeButtonBackgroundColor",value:"rgba(255, 255, 255, 0)"},Ie={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonBorderRadius",propName:"closeButtonBorderRadius",value:0,min:0,max:50},Be={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonBorderThickness",propName:"closeButtonBorderWidth",value:0,min:0,max:50},xe={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBorderColor",propName:"closeButtonBorderColor",value:"rgba(57, 57, 57, 1)"},Se={category:e,type:m,propName:"overlay",label:"widget_common_style_blockTitle_overlay",value:!0},Ae={category:e,type:r,label:"widget_common_style_overlay_label_overlayColor",propName:"overlayColor",value:"rgba(0, 0, 0, 0.6)"},Pe={category:e,type:m,label:"widget_common_style_overlay_label_overlayClickable",propName:"overlayClickable",value:!0},Te=[ae,ne,ie,re,ce,_e],Ce=[{field:me.propName,value:e=>e>0}];pe.conditions=Ce;const Ue={category:e,type:s,label:"widget_common_style_blockTitle_border",collapsible:!0,children:[me,pe,ge]},Oe={category:e,type:a},Ee=[{field:"dropShadow",value:!0}];ye.conditions=Ee,ve.conditions=Ee;const Re={category:e,type:s,label:"widget_common_style_blockTitle_container",collapsible:!0,children:[ue,se,{...Oe},...Te,{...Oe},be,ye,ve]},Le=[{field:"overlay"}];Ae.conditions=Le,Pe.conditions=Le;const De={category:e,type:s,label:"widget_common_style_blockTitle_overlay",collapsible:!0,children:[Se,Ae,Pe],conditions:[{field:"layout",value:"popin"}]},We={category:e,type:a},$e=({closeButton:e})=>e,He=[fe,{...We},he,Ne,ke,{...We},Ie,Be,xe].reduce(((e,o)=>{let t;const{condition:l}=o;return t=l?{...o,condition:e=>$e(e)&&l(e)}:{...o,condition:$e},[...e,t]}),[]),Ve={category:e,type:s,label:"widget_common_style_blockTitle_closeButton",collapsible:!0,children:[we,...He]};var ze="draggableSeparator",je=[{category:o,type:g,label:"widget_beforeAfter_layout_sublayout_label",propName:"subLayout",value:ze,style:"big",options:[{label:"widget_beforeAfter_layout_sublayout_option_draggableSeparator",value:ze,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"}]}],Me=[{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 Xe(e){return function(e){if(Array.isArray(e))return Fe(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 Fe(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 Fe(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 Fe(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}Re.collapsed=!1,H.collapsed=!1,Re.children.find((function(e){return"containerPadding"===e.propName})).value=[{top:16,left:16,bottom:16,right:16}];var Je=F.children.find((function(e){return"layout"===e.propName}));return Je.options=Je.options.filter((function(e){return!e.value.includes("banner")})),T.children=T.children.filter((function(e){return!e.propName.includes("validationRecurrence")})),[].concat(Xe(F.children),Xe(je),[M],Xe(Me),[Re,Ue,De,Ve,H,T])}));
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",g="radioImage",m="switch",d="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:d,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"},B={...N,label:"widget_common_conditions_recurrence_label_widgetDisplayedAfterSubmission",propName:"validationRecurrence"},x=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:`${B.propName}_${t}`,conditions:[{field:B.propName,value:t}]}))),P={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 T={category:l,type:s,label:"widget_common_conditions_recurrence_blockTitle",collapsible:!0,children:[k,...x,{...P,condition:I.condition},I,...S,{...P},B,...A]},C="triggerEvent",U={category:l,type:d,propName:"triggerEventDelay",label:"widget_common_conditions_triggering_delay_label",min:0,max:60,value:0},O={...U,propName:"triggerEventReengageDelay",value:10,max:180},E={category:l,type:_,propName:"triggerEventClick",value:"body"},R={...E,propName:"triggerEventElementVisible"},L={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},D={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"}},W={category:l,type:m,propName:"isOncePerPageTrigger",value:!0,label:"widget_common_conditions_triggering_label_triggerOnlyOnce"},$={category:l,type:i,label:"widget_common_conditions_triggering_label",options:[D.pageLoad,D.direct,D.exitIntent,D.reengage,D.click,D.elementVisible,D.customScript],propName:C,value:"pageLoad"};E.conditions=[{field:C,value:"click"}],O.conditions=[{field:C,value:"reengage"}],R.conditions=[{field:C,value:"elementVisible"}],L.conditions=[{field:C,value:"script"}],U.conditions=[{field:C,value:e=>"reengage"!==e}],W.conditions=[{field:C,value:e=>"click"===e||"script"===e}];const H={category:l,type:s,label:"widget_common_conditions_triggering_blockTitle",collapsible:!0,children:[$,E,R,L,W,O,U]},V={category:o,type:g,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`}]},z={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"}];z.conditions=X,j.conditions=X;const F={category:o,type:s,label:"widget_common_layout_blockTitle_layout",collapsible:!0,children:[V,z,M,j]},J=[{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"}],q={category:o,type:m,propName:"autoHeight",label:"widget_common_layout_toggler_label_keepHeightAuto",value:!0},G={category:o,type:i,propName:"widthUnit",value:"vw",options:J},K={category:o,type:i,propName:"heightUnit",value:"vh",condition:({autoHeight:e})=>!e,options:J},Q={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},Y={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},Z={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},ee={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},oe=({autoWidth:e})=>!e,te=([Q,Y,G,q,Z,ee,K].reduce(((e,o)=>{let t;const{condition:l}=o;return t=l?{...o,condition:e=>l(e)&&oe(e)}:{...o,condition:oe},[...e,t]}),[]),{field:"isBackgroundImage",value:!0}),le={field:"backgroundSize",value:e=>"100% 100%"!==e},ae={category:e,type:r,label:"widget_common_style_container_label_backgroundColor",propName:"backgroundColor",value:"rgba(247, 247, 247, 1)"},ne={category:e,type:m,label:"widget_common_style_toggler_label_backgroundImage",propName:"isBackgroundImage",value:!1},ie={category:e,type:u,label:"widget_common_style_toggler_label_backgroundImage",propName:"backgroundImage",value:"",conditions:[te]},re={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:[te]},ce={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:[te,le]},_e={category:e,type:m,label:"widget_common_style_backgroundImageUploader_toggler_repeatBackgroundImage",propName:"backgroundRepeat",value:!1,conditions:[te,le,{field:"backgroundSize",value:e=>"cover"!==e}]},pe={category:e,type:r,label:"widget_common_style_border_label_borderColor",propName:"borderColor",value:"rgba(0, 127, 145, 1)"},ge={category:e,type:d,label:"widget_common_style_border_label_borderRadius",propName:"borderRadius",value:4,unit:"px"},me={category:e,type:d,label:"widget_common_style_border_label_borderThickness",propName:"borderWidth",value:2,min:0,max:50,unit:"px"},de={category:e,type:"areainput"},ue={...de,label:"widget_common_style_container_label_margin",propName:"containerMargin",value:[{top:0,left:0,bottom:0,right:0}]},se={...de,label:"widget_common_style_container_label_padding",propName:"containerPadding",value:[{top:35,left:60,bottom:35,right:60}]},be={category:e,type:m,label:"widget_common_style_container_dropShadow_blockTitle",propName:"dropShadow",value:!1},ye={category:e,type:r,label:"widget_common_style_container_dropShadow_label_color",propName:"dropShadowColor",value:"rgba(57, 57, 57, 0.25);"},ve={category:e,type:d,label:"widget_common_style_container_dropShadow_label_blurRadius",propName:"dropShadowBlur",value:10,unit:"px"},we={category:e,type:m,label:"widget_common_style_closeButton_label_displayCloseButton",propName:"closeButton",value:!0},fe={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"}]},he={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonSize",propName:"closeButtonSize",value:16,min:10,max:50},Ne={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonColor",propName:"closeButtonColor",value:"rgba(119, 119, 119, 1)",condition:({closeButtonBorderWidth:e})=>e>0},ke={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBackgroundColor",propName:"closeButtonBackgroundColor",value:"rgba(255, 255, 255, 0)"},Ie={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonBorderRadius",propName:"closeButtonBorderRadius",value:0,min:0,max:50},Be={category:e,type:d,label:"widget_common_style_closeButton_label_closeButtonBorderThickness",propName:"closeButtonBorderWidth",value:0,min:0,max:50},xe={category:e,type:r,label:"widget_common_style_closeButton_label_closeButtonBorderColor",propName:"closeButtonBorderColor",value:"rgba(57, 57, 57, 1)"},Se={category:e,type:m,propName:"overlay",label:"widget_common_style_blockTitle_overlay",value:!0},Ae={category:e,type:r,label:"widget_common_style_overlay_label_overlayColor",propName:"overlayColor",value:"rgba(0, 0, 0, 0.6)"},Pe={category:e,type:m,label:"widget_common_style_overlay_label_overlayClickable",propName:"overlayClickable",value:!0},Te=[ae,ne,ie,re,ce,_e],Ce=[{field:me.propName,value:e=>e>0}];pe.conditions=Ce;const Ue={category:e,type:s,label:"widget_common_style_blockTitle_border",collapsible:!0,children:[me,pe,ge]},Oe={category:e,type:a},Ee=[{field:"dropShadow",value:!0}];ye.conditions=Ee,ve.conditions=Ee;const Re={category:e,type:s,label:"widget_common_style_blockTitle_container",collapsible:!0,children:[ue,se,{...Oe},...Te,{...Oe},be,ye,ve]},Le=[{field:"overlay"}];Ae.conditions=Le,Pe.conditions=Le;const De={category:e,type:s,label:"widget_common_style_blockTitle_overlay",collapsible:!0,children:[Se,Ae,Pe],conditions:[{field:"layout",value:"popin"}]},We={category:e,type:a},$e=({closeButton:e})=>e,He=[fe,{...We},he,Ne,ke,{...We},Ie,Be,xe].reduce(((e,o)=>{let t;const{condition:l}=o;return t=l?{...o,condition:e=>$e(e)&&l(e)}:{...o,condition:$e},[...e,t]}),[]),Ve={category:e,type:s,label:"widget_common_style_blockTitle_closeButton",collapsible:!0,children:[we,...He]};var ze="draggableSeparator",je=[{category:o,type:g,label:"widget_beforeAfter_layout_sublayout_label",propName:"subLayout",value:ze,style:"big",options:[{label:"widget_beforeAfter_layout_sublayout_option_draggableSeparator",value:ze,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"}]}],Me=[{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 Xe(e){return function(e){if(Array.isArray(e))return Fe(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 Fe(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 Fe(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 Fe(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}Re.collapsed=!1,H.collapsed=!1,Re.children.find((function(e){return"containerPadding"===e.propName})).value=[{top:16,left:16,bottom:16,right:16}];var Je=F.children.find((function(e){return"layout"===e.propName}));return Je.options=Je.options.filter((function(e){return!e.value.includes("banner")})),T.children=T.children.filter((function(e,o){return!e.propName&&"validationRecurrence"!==T.children[o+1].propName||e.propName&&!e.propName.includes("validationRecurrence")})),[].concat(Xe(F.children),Xe(je),[M],Xe(Me),[Re,Ue,De,Ve,H,T])}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@abtasty/before-after-image",
3
3
  "description": "Widget for AB Tasty",
4
- "version": "0.0.2",
4
+ "version": "0.0.3-0",
5
5
  "form": "dist/form.js",
6
6
  "main": "dist/main.js",
7
7
  "files": [