@creaditor/web-starterkit 1.0.63 → 1.0.64
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.
- package/dist/112.creaditor.bundle.js.gz +0 -0
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/1317.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/1396.creaditor.bundle.js.gz +0 -0
- package/dist/1403.creaditor.bundle.js.gz +0 -0
- package/dist/1456.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/168.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/175.creaditor.bundle.js.gz +0 -0
- package/dist/1972.creaditor.bundle.js.gz +0 -0
- package/dist/2001.creaditor.bundle.js +335 -0
- package/dist/2001.creaditor.bundle.js.LICENSE.txt +11 -0
- package/dist/{6442.creaditor.bundle.js.LICENSE.txt.gz → 2001.creaditor.bundle.js.LICENSE.txt.gz} +0 -0
- package/dist/2001.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2112.creaditor.bundle.js.gz +0 -0
- package/dist/2154.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2298.creaditor.bundle.js.gz +0 -0
- package/dist/235.creaditor.bundle.js.gz +0 -0
- package/dist/2350.creaditor.bundle.js.gz +0 -0
- package/dist/2377.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2397.creaditor.bundle.js.gz +0 -0
- package/dist/2409.creaditor.bundle.js.gz +0 -0
- package/dist/2547.creaditor.bundle.js.gz +0 -0
- package/dist/2550.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/2655.creaditor.bundle.js +16 -0
- package/dist/2655.creaditor.bundle.js.gz +0 -0
- package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2706.creaditor.bundle.js.gz +0 -0
- package/dist/271.creaditor.bundle.js.gz +0 -0
- package/dist/2717.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2773.creaditor.bundle.js.gz +0 -0
- package/dist/2833.creaditor.bundle.js.gz +0 -0
- package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/2837.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/2963.creaditor.bundle.js.gz +0 -0
- package/dist/3105.creaditor.bundle.js.gz +0 -0
- package/dist/3233.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +2 -11
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/3545.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3600.creaditor.bundle.js +1 -0
- package/dist/3600.creaditor.bundle.js.gz +0 -0
- package/dist/3606.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/380.creaditor.bundle.js.gz +0 -0
- package/dist/3827.creaditor.bundle.js.gz +0 -0
- package/dist/3847.creaditor.bundle.js +9 -9
- package/dist/3847.creaditor.bundle.js.gz +0 -0
- package/dist/3875.creaditor.bundle.js.gz +0 -0
- package/dist/3971.creaditor.bundle.js.gz +0 -0
- package/dist/4000.creaditor.bundle.js +1 -0
- package/dist/4000.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/407.creaditor.bundle.js.gz +0 -0
- package/dist/4074.creaditor.bundle.js.gz +0 -0
- package/dist/4100.creaditor.bundle.js.gz +0 -0
- package/dist/4109.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/4161.creaditor.bundle.js.gz +0 -0
- package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/4186.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4413.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4615.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/467.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/{6323.creaditor.bundle.js → 4819.creaditor.bundle.js} +7 -7
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/4947.creaditor.bundle.js.gz +0 -0
- package/dist/4987.creaditor.bundle.js.gz +0 -0
- package/dist/4988.creaditor.bundle.js.gz +0 -0
- package/dist/5133.creaditor.bundle.js.gz +0 -0
- package/dist/5156.creaditor.bundle.js.gz +0 -0
- package/dist/5284.creaditor.bundle.js.gz +0 -0
- package/dist/5379.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5411.creaditor.bundle.js.gz +0 -0
- package/dist/5501.creaditor.bundle.js.gz +0 -0
- package/dist/5530.creaditor.bundle.js.gz +0 -0
- package/dist/5666.creaditor.bundle.js.gz +0 -0
- package/dist/567.creaditor.bundle.js.gz +0 -0
- package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/5713.creaditor.bundle.js.gz +0 -0
- package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/574.creaditor.bundle.js.gz +0 -0
- package/dist/578.creaditor.bundle.js.gz +0 -0
- package/dist/5791.creaditor.bundle.js +288 -0
- package/dist/5791.creaditor.bundle.js.gz +0 -0
- package/dist/5839.creaditor.bundle.js.gz +0 -0
- package/dist/5849.creaditor.bundle.js.gz +0 -0
- package/dist/5850.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +8 -8
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/59.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +1 -1
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6036.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/6216.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6442.creaditor.bundle.js +214 -155
- package/dist/6442.creaditor.bundle.js.gz +0 -0
- package/dist/6496.creaditor.bundle.js.gz +0 -0
- package/dist/653.creaditor.bundle.js.gz +0 -0
- package/dist/6751.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/6937.creaditor.bundle.js.gz +0 -0
- package/dist/7051.creaditor.bundle.js +162 -0
- package/dist/{6442.creaditor.bundle.js.LICENSE.txt → 7051.creaditor.bundle.js.LICENSE.txt} +0 -6
- package/dist/7051.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7051.creaditor.bundle.js.gz +0 -0
- package/dist/7055.creaditor.bundle.js.gz +0 -0
- package/dist/715.creaditor.bundle.js +142 -0
- package/dist/715.creaditor.bundle.js.LICENSE.txt +11 -0
- package/dist/715.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/715.creaditor.bundle.js.gz +0 -0
- package/dist/7155.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/7255.creaditor.bundle.js.gz +0 -0
- package/dist/{8547.creaditor.bundle.js → 7348.creaditor.bundle.js} +66 -131
- package/dist/7348.creaditor.bundle.js.gz +0 -0
- package/dist/738.creaditor.bundle.js.gz +0 -0
- package/dist/7380.creaditor.bundle.js.gz +0 -0
- package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7463.creaditor.bundle.js.gz +0 -0
- package/dist/7466.creaditor.bundle.js.gz +0 -0
- package/dist/7493.creaditor.bundle.js +48 -0
- package/dist/7493.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7523.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7654.creaditor.bundle.js.gz +0 -0
- package/dist/767.creaditor.bundle.js.gz +0 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7789.creaditor.bundle.js.gz +0 -0
- package/dist/7838.creaditor.bundle.js.gz +0 -0
- package/dist/7997.creaditor.bundle.js.gz +0 -0
- package/dist/8042.creaditor.bundle.js.gz +0 -0
- package/dist/8064.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/8173.creaditor.bundle.js.gz +0 -0
- package/dist/8196.creaditor.bundle.js.gz +0 -0
- package/dist/823.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8251.creaditor.bundle.js.gz +0 -0
- package/dist/8299.creaditor.bundle.js.gz +0 -0
- package/dist/8315.creaditor.bundle.js.gz +0 -0
- package/dist/8443.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8533.creaditor.bundle.js.gz +0 -0
- package/dist/8570.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/8854.creaditor.bundle.js.gz +0 -0
- package/dist/8878.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/8921.creaditor.bundle.js.gz +0 -0
- package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/898.creaditor.bundle.js.gz +0 -0
- package/dist/8983.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/9158.creaditor.bundle.js.gz +0 -0
- package/dist/9250.creaditor.bundle.js.gz +0 -0
- package/dist/9386.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9453.creaditor.bundle.js.gz +0 -0
- package/dist/9570.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/975.creaditor.bundle.js.gz +0 -0
- package/dist/976.creaditor.bundle.js.gz +0 -0
- package/dist/9986.creaditor.bundle.js.gz +0 -0
- package/dist/9990.creaditor.bundle.js.gz +0 -0
- package/dist/9994.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +800 -345
- package/dist/creaditor.bundle.js.LICENSE.txt +6 -0
- package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/index.html.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/dist/workbox-f3063069.js.gz +0 -0
- package/package.json +1 -1
- package/dist/1204.creaditor.bundle.js +0 -236
- package/dist/1204.creaditor.bundle.js.gz +0 -0
- package/dist/3601.creaditor.bundle.js +0 -288
- package/dist/3601.creaditor.bundle.js.gz +0 -0
- package/dist/507.creaditor.bundle.js +0 -334
- package/dist/507.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +0 -48
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/6323.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +0 -51
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8088.creaditor.bundle.js +0 -141
- package/dist/8088.creaditor.bundle.js.gz +0 -0
- package/dist/8547.creaditor.bundle.js.gz +0 -0
|
@@ -665,7 +665,7 @@
|
|
|
665
665
|
.value="${b}"
|
|
666
666
|
></cdtr-input>
|
|
667
667
|
</cdtr-row>
|
|
668
|
-
`}function L(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);let a=n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||g("phone",n.href||"")||n.url||"";try{a=decodeURIComponent(a)}catch(t){}const l=a.replace(/\D+/g,"");if(!l)return null;const c=s||n.params&&(n.params.text||n.params.body)||"",h=c?encodeURIComponent(c):"";let d=`https://wa.me/${l}`;h&&(d+=`?text=${h}`);const p=new r.A(d);return p.target=o||p.target||"_blank",{url:p,params:p.params,protocol:"whatsapp:"}}(t,e,i,s,n):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function R(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function
|
|
668
|
+
`}function L(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);let a=n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||g("phone",n.href||"")||n.url||"";try{a=decodeURIComponent(a)}catch(t){}const l=a.replace(/\D+/g,"");if(!l)return null;const c=s||n.params&&(n.params.text||n.params.body)||"",h=c?encodeURIComponent(c):"";let d=`https://wa.me/${l}`;h&&(d+=`?text=${h}`);const p=new r.A(d);return p.target=o||p.target||"_blank",{url:p,params:p.params,protocol:"whatsapp:"}}(t,e,i,s,n):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function R(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function U(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e,i)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e,label:i||e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name,e.anchor.label):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}const C="automation:";function M(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return s.qy`
|
|
669
669
|
<cdtr-dropdown @change=${t=>i(t.target.value)}>
|
|
670
670
|
<cdtr-dropdown-button
|
|
671
671
|
minWidth=${100}
|
|
@@ -682,7 +682,7 @@
|
|
|
682
682
|
value="${t.type}"
|
|
683
683
|
><lang-text text="${t.text}"></lang-text>
|
|
684
684
|
</cdtr-dropdown-item>`)}
|
|
685
|
-
${o.length?s.qy`<cdtr-dropdown-item value="${
|
|
685
|
+
${o.length?s.qy`<cdtr-dropdown-item value="${C}" class="special-links-item">
|
|
686
686
|
<span class="special-links-label">
|
|
687
687
|
<span class="special-links-title">
|
|
688
688
|
<svg viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -1078,9 +1078,9 @@
|
|
|
1078
1078
|
</cdtr-row>
|
|
1079
1079
|
</div>
|
|
1080
1080
|
</div>
|
|
1081
|
-
`}}}(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=L(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=R(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=
|
|
1081
|
+
`}}}(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=L(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=R(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=U()}onChangeType(t){if(t===C)return void this.onAutomationsClick();const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),this.compact&&e.clearParams)return this.href="",this.params={},void(this._urlInputRawValue="");if(e.forceProtocolChange){const t=new r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.A(this.href);const t=String(this.href?.href||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[p];(e||i)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){const t=void 0===this._lastBodySyncHref;this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");(0,m.r_)(n)||i.params&&i.params[p]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,t&&this.openAutomations&&B().length&&this.onAutomationsClick())}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const h=String(i.href||""),d=(0,m.r_)(h),g=i.params&&i.params[p];if(d)c=h;else if(g){const t=u,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const f=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const x=B(),v={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,k=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&w&&!k;$&&!A?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const L=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,R={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:L},U="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();if(this.showAutomations)return s.qy` <div class="root ${U?"rtl":""}">${this.renderAutomationsView()}</div>`;if(this.compact){const t=!this.protocol||"https:"===this.protocol||"http:"===this.protocol;return s.qy`<div class="compact">
|
|
1082
1082
|
<div class="compact-row">
|
|
1083
|
-
${
|
|
1083
|
+
${M(b,this.protocol,this.onChangeType.bind(this),x)}
|
|
1084
1084
|
${"anchor:"===this.protocol?null:S({...R,value:L,onChange:R.onChangeLink,placeholder:o.M.get("lang",f)||"",style:"width:100%;--cdtr-input-height:32px;",width:"100%",coach:!1})}
|
|
1085
1085
|
</div>
|
|
1086
1086
|
${_(this.protocol,v)}
|
|
@@ -1096,16 +1096,16 @@
|
|
|
1096
1096
|
<lang-text text="open_in_new_tab"></lang-text>
|
|
1097
1097
|
</div>`:null}
|
|
1098
1098
|
</div>`}return s.qy` <div class="root">
|
|
1099
|
-
${
|
|
1099
|
+
${E=this.label,E?s.qy`<cdtr-title
|
|
1100
1100
|
style="font-weight: 700;
|
|
1101
1101
|
font-size: 14.4px;
|
|
1102
1102
|
margin-bottom: 0.6rem;
|
|
1103
1103
|
color: #000000b0;"
|
|
1104
|
-
><lang-text text=${
|
|
1104
|
+
><lang-text text=${E}></lang-text
|
|
1105
1105
|
><cdtr-divider></cdtr-divider
|
|
1106
1106
|
></cdtr-title>`:null}
|
|
1107
1107
|
<cdtr-row alignItems="center" justify="space-between" spacing="10">
|
|
1108
|
-
${
|
|
1108
|
+
${M(this.options,this.protocol,this.onChangeType.bind(this),x)}
|
|
1109
1109
|
${F=this.target,T=this.onChangeTarget.bind(this),s.qy`
|
|
1110
1110
|
<cdtr-dropdown @change=${t=>T(t)} style="min-width: 120px;">
|
|
1111
1111
|
<cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
|
|
@@ -1150,10 +1150,10 @@
|
|
|
1150
1150
|
></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
|
|
1151
1151
|
</div>
|
|
1152
1152
|
|
|
1153
|
-
${
|
|
1153
|
+
${C=this.hasButton,q=this.onClickOk.bind(this),C?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
|
|
1154
1154
|
<cdtr-row justify="flex-end" mt="1">
|
|
1155
1155
|
<paper-button fullWidth @click=${q} raised class="add-button">
|
|
1156
1156
|
<lang-text text="add_now"></lang-text>
|
|
1157
1157
|
</paper-button>
|
|
1158
1158
|
</cdtr-row>`:null}
|
|
1159
|
-
</div>`;var
|
|
1159
|
+
</div>`;var C,q,I,j,F,T,E}}F.styles=n,F.properties={href:{type:String,reflect:!0},value:{type:Object},protocol:{type:String},name:{type:String},label:{type:String},target:{type:String},hasButton:{type:Boolean},params:{type:Object},explain:{type:String},anchors:{type:Array},link:{},body:{type:String},subject:{type:String},autofocus:{type:Boolean},onRequest:{type:Function},openAutomations:{type:Boolean},compact:{type:Boolean}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",F)},88385(t,e,i){i.d(e,{A:()=>a});const s=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function r(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let r,n=-1!==o?t.substring(o+1):"";for(;null!==(r=i.exec(n));){const t=s(r[1]),i=s(r[2]);t&&(e[t]=i)}return e}function n(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class a{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\](?:\?|$)/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...r(t)};const i=t.indexOf("?");return this.url=i>-1?t.slice(0,i):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol||this.protocol||a.getProtocol(this.href);const i=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=s(i),this.isPhone=o(i),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...r(this.href)},this.url=n(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const i in this.params){const s=this.params[i],o=encodeURIComponent(i).replace(/%24/g,"$");if(s){const i=encodeURIComponent(s).replace(/%24/g,"$");t+=`${o}=${i}&`,e+=`${o}=${i}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const i=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return i(this.protocol+"//"+t);if(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${t}`):"";if("whatsapp:"===this.protocol){const s=this.extractPhoneFromTextUsingRegex(t);return s.length>0?i("https://wa.me/"+s[0]+e):i("https://wa.me/"+e)}return i(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}a.resetURL=n}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4e3],{84e3(e,n,t){t.d(n,{default:()=>F});var r=t(47493);const o=e=>{let{helpers:n,editor:t,getFocused:r}=e;return{set:(e,o,i)=>{switch(o){case"style":return e[o]=n.deepMerge(e[o],i),!0;case"text":return e.text=i,r()||t.chain().setContent(i).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[o]=i,!0;case"onClick":if(i.link)return e[o]=i,!0}}}};var i=t(72591),s=t.n(i),a=t(88639),l=t.n(a),c=t(88128),A=t.n(c),d=t(30855),u=t.n(d),p=t(93051),m=t.n(p),h=t(49536),E={};E.setAttributes=u(),E.insert=A().bind(null,"head"),E.domAPI=l(),E.insertStyleElement=m();s()(h.A,E);const C=h.A&&h.A.locals?h.A.locals:void 0;var b=t(81318),g=t(1366),f=t(67291),y=t(85194),B=t(28396);const x=b.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const F=()=>{const e="button";return{name:e,create:n=>{const{createElement:t,compose:i,helpers:s}=n,{arrayToString:a,mergeDiff:l}=s;let c=!1;const A=document.createElement("div"),d=document.createElement("div"),{editor:u}=function(e){let{content:n,element:t}=e;return{element:t,editor:new b.KE({element:t,extensions:[g.A,f.A,B.A,y.Ay,x],content:n})}}({content:i.props.text,element:d});A.appendChild(d);u.view.dom.setAttribute("dir","auto");const p=()=>{let e="";try{e=u.getText()||""}catch(n){e=""}A.setAttribute("dir",function(e){if(!e)return null;for(const n of String(e)){if(/[\u0590-\u05FF\u0600-\u07BF\u0860-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/.test(n))return"rtl";if(/\p{L}/u.test(n))return"ltr"}return null}(e)||"ltr")};return p(),u.on("update",e=>{let{editor:n}=e;const t=n.getText();p(),i.editor.store().updateComponent(i,"text",t)}),u.on("focus",e=>{let{event:n,editor:t}=e;c=!0}),u.on("blur",e=>{let{event:n,editor:t}=e;c=!1}),A.className=C.button,t({name:e,id:i.id,template:A,commands:{insertContent:e=>{u.commands.insertContent(e),u.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{i.props.style.display="",i.props.style.direction=""}catch(e){console.error(e)}l(A,{style:i.props.style});const e=i.props.hasIcon,n=i.props.iconUrl,t=i.props.iconDirection,r=i.props.iconSize,o="icon_in_button";p();let s=A.querySelector(`.${o}`)||document.createElement("img");e&&n?(s.className=o,s.src=n,s.style.width=(r||16)+"px",s.style.height=(r||16)+"px",s.style.marginRight="8px",s.style.marginLeft="8px","right"===t?A.appendChild(s):A.insertBefore(s,A.firstChild)):s.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>A,resizeAxis:"xy",handleBar:!0,validator:o({template:A,helpers:s,editor:u,getFocused:function(){return c}}),schema:i.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:i,destroy:()=>{u.destroy()},remove:()=>{A.remove()},createEditor:r.A})}}}},49536(e,n,t){t.d(n,{A:()=>a});var r=t(82001),o=t.n(r),i=t(40935),s=t.n(i)()(o());s.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),s.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const a=s},67291(e,n,t){t.d(n,{A:()=>o});var r=t(81318);const o=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4819],{84819(t,e,i){i.r(e),i.d(e,{NameAndSubjectPlugin:()=>c});var o=i(59929),r=i(49410);i(78533);function s(){return window.___cdtr_isConsoleLogged||console.log("%cWe run on production, if you want to point to dev server, please add ?dev=1 at the url","color:green"),window.___cdtr_isConsoleLogged=!0,!1}window.___cdtr_isConsoleLogged=window.___cdtr_isConsoleLogged||!1,s(),s(),s(),s(),s(),s();const n=`${s()?"http://127.0.0.1:8000":"https://studio.creaditor.ai"}/api/email-subject`;async function a(t,e){const i=Array.from(document.querySelectorAll(".text-component")).map(t=>(t.textContent||"").trim()).filter(Boolean).join("\n");if(!i)throw new Error("The newsletter has no text yet");const o=JSON.stringify({content:i,field:t,...e.current?{current:e.current}:{},...e.subject?{subject:e.subject}:{},...e.docId?{doc_id:e.docId}:{}}),r=async t=>{const i=e.getToken?await e.getToken(t):null;return fetch(n,{method:"POST",headers:{"Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}},body:o})};let s=await r(!1);if(401===s.status&&(s=await r(!0)),!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const a=await s.json(),l="subject"===t?a.subject:a.preheader;if(!l)throw new Error("Empty result");return l}var l=Object.defineProperty,d=(t,e,i,o)=>{for(var r,s=void 0,n=t.length-1;n>=0;n--)(r=t[n])&&(s=r(e,i,s)||s);return s&&l(e,i,s),s};typeof window<"u"&&!window.__polymerElementsLoaded&&(window.__polymerElementsLoaded=!0,(async()=>{try{const t=["paper-dropdown-menu","paper-item","paper-listbox"].filter(t=>customElements.get(t));if(t.length>0)return void console.warn(`Polymer elements already loaded: ${t.join(", ")}. Skipping imports to prevent conflicts.`);if(customElements.get("dom-module"))return void console.warn("dom-module already defined, skipping Polymer element imports to prevent conflicts");await Promise.all([Promise.all([i.e(59),i.e(9158),i.e(7789),i.e(574)]).then(i.bind(i,50574)),i.e(898).then(i.bind(i,90898)),Promise.all([i.e(6216),i.e(7463)]).then(i.bind(i,97463))]),console.log("Polymer elements loaded successfully")}catch(t){console.warn("Failed to load Polymer elements:",t)}})().catch(console.error));const p="cdtr-name-and-subject-plugin",u=class extends o.WF{constructor(){super(...arguments),this.bgColor="#000",this.textColor="#000000",this.headerText="Details",this.nameLabel="Name",this.subjectLabel="Subject",this.subtitleLabel="Subtitle",this.saveButtonText="Save",this.subjectPlaceholder="Enter subject",this.mergeTags=[],this.name="",this.subject="",this.subtitle="",this.save=()=>{},this.docId="",this.isGeneratingSubject=!1,this.isGeneratingSubtitle=!1}getTextDirection(t){return/[\u0590-\u05FF]/.test(t)?"rtl":"ltr"}getPlaceholderStyle(){const t=this.getTextDirection(this.subjectPlaceholder);return`direction: ${t}; text-align: ${"rtl"===t?"right":"left"};`}handleSave(){"string"!=typeof this.subtitle&&(this.subtitle=""),"string"!=typeof this.subject&&(this.subject=""),this.dispatchEvent(new CustomEvent("save",{detail:{name:this.name,subject:this.subject,subtitle:this.subtitle}})),this.save(),setTimeout(()=>{var t,e;null==(e=null==(t=this.shadowRoot)?void 0:t.querySelector("#name-popover"))||e.close()},200)}handleFieldClick(t){this.subject+=t.value,this.requestUpdate()}handleEmojiSelect(t){const e=t.detail.unicode;this.subject=this.subject+e,this.requestUpdate()}open(){var t,e;null==(e=null==(t=this.shadowRoot)?void 0:t.querySelector("#name-popover"))||e.open()}focusInputs(t){var e;this.open();const i=null==(e=this.shadowRoot)?void 0:e.querySelectorAll("input");if(i)if(i.forEach(t=>t.classList.remove("shake")),t){const e=Array.from(i).find(e=>{var i;const o=e.previousElementSibling;return null==(i=null==o?void 0:o.textContent)?void 0:i.toLowerCase().includes(t.toLowerCase())});e&&(e.focus(),e.classList.add("shake"))}else i.forEach(t=>{t.focus(),t.classList.add("shake")})}handleGenerateSubject(){if(this.isGeneratingSubject)return;const t=this.subject||"";this.subject="",this.isGeneratingSubject=!0,this.requestUpdate(),async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{t(await a("subject",e))}catch(t){throw console.error("Error generating subject:",t),t}}(t=>{this.subject+=t,this.requestUpdate()},{getToken:this.studioTokenProvider,current:t,docId:this.docId}).catch(()=>{this.subject=t}).finally(()=>{this.isGeneratingSubject=!1,this.requestUpdate()})}handleGenerateSubtitle(){if(this.isGeneratingSubtitle)return;const t=this.subtitle||"";this.subtitle="",this.isGeneratingSubtitle=!0,this.requestUpdate(),async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{t(await a("preheader",e))}catch(t){throw console.error("Error generating subtitle:",t),t}}(t=>{this.subtitle+=t,this.requestUpdate()},{getToken:this.studioTokenProvider,current:t,subject:this.subject,docId:this.docId}).catch(()=>{this.subtitle=t}).finally(()=>{this.isGeneratingSubtitle=!1,this.requestUpdate()})}render(){return o.qy`
|
|
2
2
|
<div class="subject-input">
|
|
3
3
|
<div class="subject-input-left">
|
|
4
4
|
<cdtr-popover width="400px">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
</div>
|
|
29
29
|
</cdtr-popover>
|
|
30
30
|
|
|
31
|
-
${this.mergeTags.length>0?
|
|
31
|
+
${this.mergeTags.length>0?o.qy` <cdtr-popover>
|
|
32
32
|
<paper-button
|
|
33
33
|
style=${`color:${this.textColor}`}
|
|
34
34
|
size="sm"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
<div class="popover-header">
|
|
53
53
|
<h3 dir="auto">${this.headerText}</h3>
|
|
54
54
|
</div>
|
|
55
|
-
${this.mergeTags.map(t=>
|
|
55
|
+
${this.mergeTags.map(t=>o.qy`
|
|
56
56
|
<div
|
|
57
57
|
class="field-item"
|
|
58
58
|
@click=${()=>this.handleFieldClick(t)}
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
?disabled=${this.isGeneratingSubject}
|
|
120
120
|
class="generate-button"
|
|
121
121
|
>
|
|
122
|
-
${this.isGeneratingSubject?
|
|
122
|
+
${this.isGeneratingSubject?o.qy` <div class="loading-spinner"></div> `:o.qy`
|
|
123
123
|
<svg
|
|
124
124
|
xmlns="http://www.w3.org/2000/svg"
|
|
125
125
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
@@ -166,7 +166,7 @@
|
|
|
166
166
|
?disabled=${this.isGeneratingSubtitle}
|
|
167
167
|
class="generate-button"
|
|
168
168
|
>
|
|
169
|
-
${this.isGeneratingSubtitle?
|
|
169
|
+
${this.isGeneratingSubtitle?o.qy` <div class="loading-spinner"></div> `:o.qy`
|
|
170
170
|
<svg
|
|
171
171
|
xmlns="http://www.w3.org/2000/svg"
|
|
172
172
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
</div>
|
|
218
218
|
</cdtr-popover>
|
|
219
219
|
</div>
|
|
220
|
-
`}}
|
|
220
|
+
`}};u.styles=o.AH`
|
|
221
221
|
* {
|
|
222
222
|
box-sizing: border-box;
|
|
223
223
|
}
|
|
@@ -404,4 +404,4 @@
|
|
|
404
404
|
--button-active-background: #f1f3f5;
|
|
405
405
|
--font-size: 14px;
|
|
406
406
|
}
|
|
407
|
-
|
|
407
|
+
`;let c=u;d([(0,r.MZ)({type:String})],c.prototype,"bgColor"),d([(0,r.MZ)({type:String})],c.prototype,"textColor"),d([(0,r.MZ)({type:String})],c.prototype,"headerText"),d([(0,r.MZ)({type:String})],c.prototype,"nameLabel"),d([(0,r.MZ)({type:String})],c.prototype,"subjectLabel"),d([(0,r.MZ)({type:String})],c.prototype,"subtitleLabel"),d([(0,r.MZ)({type:String})],c.prototype,"saveButtonText"),d([(0,r.MZ)({type:String})],c.prototype,"subjectPlaceholder"),d([(0,r.MZ)({type:Array})],c.prototype,"mergeTags"),d([(0,r.MZ)({type:String})],c.prototype,"name"),d([(0,r.MZ)({type:String})],c.prototype,"subject"),d([(0,r.MZ)({type:String})],c.prototype,"subtitle"),d([(0,r.MZ)({attribute:!1})],c.prototype,"save"),d([(0,r.MZ)({attribute:!1})],c.prototype,"studioTokenProvider"),d([(0,r.MZ)({type:String})],c.prototype,"docId"),d([(0,r.MZ)({type:Boolean})],c.prototype,"isGeneratingSubject"),d([(0,r.MZ)({type:Boolean})],c.prototype,"isGeneratingSubtitle"),customElements.get(p)||customElements.define(p,c)}}]);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|