@creaditor/newsletter-starterkit 1.0.60 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[823],{30823(e,t,n){n.d(t,{default:()=>B});var a=n(61919),i=n(79795),o=n(29180);const l=[{value:"dot",label:"ask_ai_variant_dot"},{value:"pill",label:"ask_ai_variant_pill"},{value:"plain",label:"ask_ai_variant_plain"}],r=e=>{const{component:t,commands:n}=e;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("content")},tabs:e=>{const t=[{text:"content",selected:!0},{text:"engines"},{text:"style"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r}=e;const s=()=>"content"===r.text,p=()=>"engines"===r.text,c=()=>"style"===r.text,d=t.props.prompt||"",A=t.props.variant||"dot",m=(0,o.x8)(t.props);var u,g;return[{type:"info",active:s,text:"ask_ai_external_notice"},{type:"heading",level:6,text:"ask_ai_prompt",active:s},{type:"info",active:s,text:"ask_ai_placeholders_hint"},{type:"input",title:"ask_ai_prompt",multiline:!0,row:16,active:s,value:d,onDebounce:e=>{n.execCommand("prompt",e.target.value)}},{type:"info",active:()=>s()&&(0,o.Jq)(d,m).length>o.Ep,text:"ask_ai_prompt_too_long"},{type:"heading",level:6,text:"ask_ai_engines",active:p},...i.ug.map(e=>({type:"checkbox",title:e.label,active:p,checked:(t.props.engines||[]).includes(e.key),onChange:a=>((e,a)=>{const o=t.props.engines||[],l=i.ug.map(e=>e.key).filter(t=>t===e?a:o.includes(t));l.length&&n.execCommand("engines",l)})(e.key,!!a.target.checked)})),{type:"dropdown",title:"ask_ai_variant",active:c,value:l.find(e=>e.value===A)?.label,selected:A,items:l,onChange:e=>n.execCommand("variant",e.target.value)},{type:"input",title:"ask_ai_leading_text",active:c,value:t.props.leadingText||"",onDebounce:e=>n.execCommand("leadingText",e.target.value)},{type:"slider",title:"size",min:16,max:96,active:c,value:parseInt(t.props.iconSize,10)||34,onInput:e=>n.execCommand("iconSize",e.target.value)},{type:"slider",title:"spacing",min:0,max:60,active:c,value:parseFloat(t.props.style?.gap)||0,onInput:e=>n.execCommand("style",{gap:e.target.value+"px"})},{type:"justifyContent",active:c,value:t.props.style?.justifyContent||"flex-start",onChange:e=>n.execCommand("style",{justifyContent:e.target.value})},{type:"divider",active:c},{type:"checkbox",title:"ask_ai_brand_colors",active:c,checked:!t.props.iconColor,onChange:e=>n.execCommand("iconColor",e.target.checked?"":"000000")},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>c()&&!!t.props.iconColor,value:(u=t.props.iconColor,g="#000000",u?u.startsWith("#")?u:"#"+u:g),onChange:e=>{const t=(0,a.A)(e.target.value).toHex();n.execCommand("iconColor",t)}},{type:"colorpicker",title:"backgroundColor",active:()=>c()&&"plain"!==t.props.variant,value:t.props.bgColor||"#f2f2f2",onChange:e=>n.execCommand("bgColor",e.target.value)},{type:"colorpicker",title:"color",active:()=>c()&&("pill"===t.props.variant||!!t.props.leadingText),value:t.props.textColor||"#000000",onChange:e=>n.execCommand("textColor",e.target.value)}]}}},s=e=>{let{helpers:t}=e;return{set:(e,n,a)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n],a),!0;case"engines":return!!Array.isArray(a)&&(e[n]=a.filter(e=>"string"==typeof e),!0);case"items":return!!Array.isArray(a)&&(e[n]=a,!0);case"iconSize":return e[n]=Math.min(128,Math.max(12,parseInt(a,10)||34)),!0;case"variant":return!!["dot","pill","plain"].includes(a)&&(e[n]=a,!0);case"prompt":case"leadingText":case"itemAriaLabel":case"iconColor":case"bgColor":case"textColor":case"pageUrl":case"pageTitle":case"pageDescription":case"businessName":return e[n]=a,!0}return!1}}};var p=n(72591),c=n.n(p),d=n(88639),A=n.n(d),m=n(88128),u=n.n(m),g=n(30855),C=n.n(g),h=n(93051),x=n.n(h),v=n(49606),y={};y.setAttributes=C(),y.insert=u().bind(null,"head"),y.domAPI=A(),y.insertStyleElement=x();c()(v.A,y);const f=v.A&&v.A.locals?v.A.locals:void 0;var E=n(40856);const b="ask-ai",B=()=>({name:b,create:e=>{let{createElement:t,compose:n,helpers:a}=e;const l=document.createElement("div"),p=document.createElement("div");p.classList.add(f.root),l.appendChild(p);return t({name:b,id:n.id,template:l,defaultProps:{style:{gap:"10px",justifyContent:"flex-start"},variant:"dot",engines:i.up,prompt:(0,o.Mc)(),iconSize:34,iconColor:"",bgColor:"#f2f2f2",textColor:"",leadingText:"",itemAriaLabel:"Ask {{engine}} about this page",items:[]},draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=n.props,t=(0,E.z)(e);for((0,E.S)(t,e.items)||setTimeout(()=>{n.editor?.updateComponent?.(n.id,"items",t)},0);p.firstChild;)p.removeChild(p.firstChild);if(a.mergeDiff(p,{style:e.style}),e.leadingText){const t=document.createElement("span");t.classList.add(f.leading),t.textContent=e.leadingText,e.textColor&&(t.style.color=e.textColor),p.appendChild(t)}t.forEach(t=>p.appendChild(((e,t)=>{const n=document.createElement("a");n.classList.add(f.item),"dot"===t.variant&&n.classList.add(f.dot),"pill"===t.variant&&n.classList.add(f.pill),n.setAttribute("data-id",e.id),n.href=e.href,n.target="_blank",n.rel="noopener noreferrer",n.setAttribute("aria-label",(t.itemAriaLabel||"Ask {{engine}} about this page").replace("{{engine}}",e.label)),n.title=e.label,"plain"!==t.variant&&t.bgColor&&(n.style.backgroundColor=t.bgColor),t.textColor&&(n.style.color=t.textColor);const a=document.createElement("img");a.src=e.src,a.alt="",a.setAttribute("aria-hidden","true");const i=(parseInt(t.iconSize,10)||34)+"px";if(a.style.width=i,a.style.height=i,n.appendChild(a),"pill"===t.variant){const t=document.createElement("span");t.classList.add(f.label),t.textContent=e.label,n.appendChild(t)}return n.addEventListener("click",e=>e.preventDefault()),n})(t,e)))},handleBar:!0,validator:s({helpers:a}),schema:n.schema,onSelect:e=>{l.classList.add(e)},onDeselect:e=>{l.classList.remove(e)},elementProps:n,remove:()=>{l.remove()},createEditor:r})}})},49606(e,t,n){n.d(t,{A:()=>r});var a=n(82001),i=n.n(a),o=n(40935),l=n.n(o)()(i());l.push([e.id,'.icTm1UFc5X5A8tag7W_Q {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.WiVzPdjkN11lPSsmSGBB {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n text-decoration: none;\n line-height: 0;\n transition: transform 0.15s ease, opacity 0.15s ease;\n}\n\n.WiVzPdjkN11lPSsmSGBB:hover {\n transform: translateY(-1px);\n opacity: 0.85;\n}\n\n/* "dot" variant — the circular chip the pattern is usually seen as. */\n._lQONL1oIiZTe42CyXuB {\n border-radius: 999px;\n padding: 8px;\n line-height: 0;\n}\n\n/* "pill" variant — icon plus the engine name. */\n.bTqTp8uamOPSh67_0QtJ {\n border-radius: 999px;\n padding: 6px 14px 6px 10px;\n line-height: 1;\n font-size: 14px;\n}\n\n.fY4pheZcfQxg8DP_HYgE {\n /* Inherits the block\'s font; only the icon is sized by iconSize. */\n white-space: nowrap;\n}\n\n.cnAwK9OBcEyRXbAuQ14D {\n white-space: nowrap;\n}\n\n.SCB1TtYJtUVEle7tVBiu {\n outline: 2px solid #1a73e8;\n outline-offset: 2px;\n}\n',"",{version:3,sources:["webpack://./../web-editors/ask-ai-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,aAAa;EACb,mBAAmB;EACnB,eAAe;EACf,SAAS;AACX;;AAEA;EACE,oBAAoB;EACpB,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,qBAAqB;EACrB,cAAc;EACd,oDAAoD;AACtD;;AAEA;EACE,2BAA2B;EAC3B,aAAa;AACf;;AAEA,sEAAsE;AACtE;EACE,oBAAoB;EACpB,YAAY;EACZ,cAAc;AAChB;;AAEA,gDAAgD;AAChD;EACE,oBAAoB;EACpB,0BAA0B;EAC1B,cAAc;EACd,eAAe;AACjB;;AAEA;EACE,mEAAmE;EACnE,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,0BAA0B;EAC1B,mBAAmB;AACrB",sourcesContent:['.root {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n}\n\n.item {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n text-decoration: none;\n line-height: 0;\n transition: transform 0.15s ease, opacity 0.15s ease;\n}\n\n.item:hover {\n transform: translateY(-1px);\n opacity: 0.85;\n}\n\n/* "dot" variant — the circular chip the pattern is usually seen as. */\n.dot {\n border-radius: 999px;\n padding: 8px;\n line-height: 0;\n}\n\n/* "pill" variant — icon plus the engine name. */\n.pill {\n border-radius: 999px;\n padding: 6px 14px 6px 10px;\n line-height: 1;\n font-size: 14px;\n}\n\n.label {\n /* Inherits the block\'s font; only the icon is sized by iconSize. */\n white-space: nowrap;\n}\n\n.leading {\n white-space: nowrap;\n}\n\n.selected {\n outline: 2px solid #1a73e8;\n outline-offset: 2px;\n}\n'],sourceRoot:""}]),l.locals={root:"icTm1UFc5X5A8tag7W_Q",item:"WiVzPdjkN11lPSsmSGBB",dot:"_lQONL1oIiZTe42CyXuB",pill:"bTqTp8uamOPSh67_0QtJ",label:"fY4pheZcfQxg8DP_HYgE",leading:"cnAwK9OBcEyRXbAuQ14D",selected:"SCB1TtYJtUVEle7tVBiu"};const r=l}}]);
Binary file