@creaditor/web-starterkit 1.0.11 → 1.0.12
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/1142.creaditor.bundle.js +1 -1
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1260.creaditor.bundle.js +63 -26
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -1
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js +2 -2
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js +121 -1
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js +1 -1
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js +1 -1
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js +1 -1
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/3778.creaditor.bundle.js +1 -0
- package/dist/3778.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js +1 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js +1 -1
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js +10 -10
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js +1 -1
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +1 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js +3 -3
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js +3 -3
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +2 -2
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +2 -2
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +19 -18
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +91 -0
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +1 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +49 -20
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +1 -1
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js +1 -1
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +98 -56
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js +1 -1
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +4 -1
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js +1 -1
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +20 -24
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js +7 -7
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +13 -15
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js +1 -1
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js +1 -1
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +968 -583
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4061],{84061(e,t,n){n.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4061],{84061(e,t,n){n.d(t,{default:()=>g});const r=e=>{const{component:t,commands:n}=e;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("iframe")},tabs:e=>{const t=[{text:"iframe",selected:!0},{text:"style"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r}=e;return[{type:"info",text:"this_is_empty_iframe_start_add_url_link",active:()=>"iframe"===r.text},{type:"input",title:"urlAddress",active:()=>"iframe"===r.text,value:t.props.src||"",onChange:e=>{const t=e.target.value;n.execCommand("src",t)}},{type:"slider",title:"width",min:100,max:1200,active:()=>"style"===r.text,value:parseInt(t.props.style?.width,10)||400,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"slider",title:"height",min:100,max:800,active:()=>"style"===r.text,value:parseInt(t.props.style?.height,10)||300,onInput:e=>{const t=e.target.value;n.execCommand("style",{height:t+"px"})}}]}}},a=e=>{let{helpers:t}=e;return{set:(e,n,r)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n],r),!0;case"src":return e[n]=r,!0;default:return!1}}}};var s=n(72591),i=n.n(s),o=n(88639),l=n.n(o),A=n(88128),d=n.n(A),c=n(30855),m=n.n(c),p=n(93051),h=n.n(p),u=n(22800),C={};C.setAttributes=m(),C.insert=d().bind(null,"head"),C.domAPI=l(),C.insertStyleElement=h();i()(u.A,C);const f=u.A&&u.A.locals?u.A.locals:void 0,g=()=>{const e="iframe";return{name:e,create:t=>{const{createElement:n,compose:s,helpers:i}=t,{arrayToString:o,mergeDiff:l}=i,A=document.createElement("div");A.setAttribute("data-id",s.id),A.setAttribute("draggable-element","element"),A.setAttribute("droppable-element","element"),A.className=o("iframe-component",f.main);const d=document.createElement("div");d.style.cssText="position:relative;max-width:100%;height:100%;width:100%;",A.appendChild(d);const c=document.createElement("iframe");c.style.cssText="width:100%;height:100%;border:none;",d.appendChild(c);const m=document.createElement("div");m.className=f.emptyIframeHolder;const p=document.createElement("h1");p.setAttribute("align","center");const h=document.createElement("lang-text");h.setAttribute("text","this_is_empty_iframe_start_add_url_link"),p.appendChild(h),m.appendChild(p),d.appendChild(m);return n({name:e,id:s.id,template:A,defaultProps:{style:{display:"block",margin:"auto",width:"400px",height:"300px"},src:""},draggable:{group:"element"},droppable:{group:"element"},render:()=>{l(c,{style:s.props.style,src:s.props.src||""}),s.props.src?m.style.display="none":m.style.display="flex"},resizeable:()=>d,handleBar:!0,validator:a({helpers:i}),schema:s.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:s,remove:()=>{A.remove()},createEditor:r})}}}},22800(e,t,n){n.d(t,{A:()=>o});var r=n(82001),a=n.n(r),s=n(40935),i=n.n(s)()(a());i.push([e.id,'.dwbwX3rm1rCfFBXzg4l5 {\n position: relative;\n width: 100%;\n}\n\n.dwbwX3rm1rCfFBXzg4l5:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: #000;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.dwbwX3rm1rCfFBXzg4l5 iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.TNFcnLszwFUVJerzzPS8 {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n z-index: 15;\n gap: 15px;\n}\n\n.TNFcnLszwFUVJerzzPS8 h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n',"",{version:3,sources:["webpack://./../web-editors/iframe-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,OAAO;EACP,MAAM;EACN,WAAW;EACX,YAAY;EACZ,gBAAgC;EAAhC,gCAAgC;EAChC,YAAY;EACZ,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,gCAAgC;EAChC,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;EACtB,WAAW;EACX,SAAS;AACX;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,0BAA0B;AAC5B",sourcesContent:['.main {\n position: relative;\n width: 100%;\n}\n\n.main:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.main iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.emptyIframeHolder {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n z-index: 15;\n gap: 15px;\n}\n\n.emptyIframeHolder h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n'],sourceRoot:""}]),i.locals={main:"dwbwX3rm1rCfFBXzg4l5",emptyIframeHolder:"TNFcnLszwFUVJerzzPS8"};const o=i}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4288],{64288(t,e,o){o.r(e),o.d(e,{ElementHandleBar:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4288],{64288(t,e,o){o.r(e),o.d(e,{ElementHandleBar:()=>n});var s=o(59929),i=o(86319),r=o(90142);class n extends s.WF{constructor(){super(),this.show_click_message=!0,this.onRemove=this.onRemove.bind(this)}onRemove(){const t={detail:this.closest(this.target),bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("remove",t))}onClone(){const t={detail:this.closest(this.target),bubbles:!0,composed:!0};this.dispatchEvent(new CustomEvent("clone",t))}render(){const t="20",e="20",o=i.M.get("config","editor","configure","onSaveBlock");return s.qy`<cdtr-row
|
|
2
2
|
alignItems="center"
|
|
3
3
|
justify="space-evenly"
|
|
4
4
|
class="wrapper"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
></cdtr-dupicate-icon>
|
|
38
38
|
</cdtr-tooltip>
|
|
39
39
|
</div>
|
|
40
|
-
${o&&
|
|
40
|
+
${o&&s.qy` <div class="button" @mouseup=${r.A}>
|
|
41
41
|
<cdtr-tooltip content="save_block">
|
|
42
42
|
<svg
|
|
43
43
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
<cdtr-remove-icon width=${t} height=${e}></cdtr-remove-icon>
|
|
58
58
|
</cdtr-tooltip>
|
|
59
59
|
</div>
|
|
60
|
-
</cdtr-row>`}}
|
|
60
|
+
</cdtr-row>`}}n.properties={target:{type:String},show_click_message:{type:Boolean}},n.styles=s.AH`
|
|
61
61
|
:host {
|
|
62
62
|
position: absolute;
|
|
63
63
|
top: 0;
|
|
64
64
|
right: 0;
|
|
65
65
|
height: 25px;
|
|
66
66
|
background: transparent;
|
|
67
|
-
z-index:
|
|
67
|
+
z-index: var(--z-dropdown, 100);
|
|
68
68
|
display: flex;
|
|
69
69
|
align-items: center;
|
|
70
70
|
width: 40%;
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
.wrapper {
|
|
74
74
|
position: absolute;
|
|
75
75
|
right: 0;
|
|
76
|
-
padding:
|
|
76
|
+
padding: var(--space-1, 4px);
|
|
77
77
|
height: 100%;
|
|
78
78
|
width: auto;
|
|
79
|
-
box-shadow:
|
|
79
|
+
box-shadow: var(--shadow-sm);
|
|
80
80
|
transform: translateY(-30%);
|
|
81
|
-
background: #fff;
|
|
82
|
-
border-radius:
|
|
81
|
+
background: var(--color-bg, #fff);
|
|
82
|
+
border-radius: var(--radius-sm, 6px);
|
|
83
83
|
}
|
|
84
84
|
.button {
|
|
85
|
-
padding:
|
|
85
|
+
padding: var(--space-1, 4px) var(--space-2, 8px);
|
|
86
86
|
min-width: auto;
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -95,4 +95,4 @@
|
|
|
95
95
|
.drag_block:active {
|
|
96
96
|
cursor: grabbing !important;
|
|
97
97
|
}
|
|
98
|
-
`,customElements.define("cdtr-element-handle-bar",
|
|
98
|
+
`,customElements.define("cdtr-element-handle-bar",n)}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4639],{84639(e,t,r){r.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4639],{84639(e,t,r){r.d(t,{default:()=>l});const s=e=>{const{component:t,commands:r}=e;return{select:e=>{let{changeTab:t,tab:r}=e;r.text||t("qr")},tabs:e=>{const t=[{text:"qr",selected:!0},{text:"style"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:s}=e;return[{type:"linkpicker",href:t.props.link,protocol:t.props.link?.protocol,target:t.props.link?.target,autofocus:!0,active:()=>"qr"===s.text,title:"QR link",onChange:e=>{const t=e.target.value;r.execCommand("link",t)}},{type:"slider",title:"size",min:100,max:600,active:()=>"style"===s.text,value:parseInt(t.props.size,10)||200,onInput:e=>{const t=parseInt(e.target.value,10);r.execCommand("size",t),r.execCommand("style",{width:t+"px",height:t+"px"})}}]}}},n=e=>{let{helpers:t}=e;return{set:(e,r,s)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],s),!0;case"link":case"size":return e[r]=s,!0;default:return!1}}}},a=200;const l=()=>({name:"qr",create:e=>{const{createElement:t,compose:r,helpers:l}=e,{mergeDiff:o}=l,i=document.createElement("div"),c=document.createElement("img");c.alt="QR code",i.appendChild(c);return t({name:"qr",id:r.id,template:i,defaultProps:{style:{width:a+"px",height:a+"px",display:"block"},link:"",size:a},draggable:{group:"element"},droppable:{group:"element"},render:()=>{o(c,{style:r.props.style});const e=function(e,t){if("object"==typeof e&&(e=e.fullHref||e.href),!e||"string"!=typeof e||!e.trim())return"";const r=Math.min(600,Math.max(100,parseInt(t,10)||a));return`https://img.creaditor.ai/images/qr?${new URLSearchParams({link:e.trim(),size:String(r)}).toString()}`}(r.props.link,r.props.size);o(c,{src:e})},resizeable:()=>i,handleBar:!0,validator:n({helpers:l}),schema:r.schema,onSelect:e=>{i.classList.add(e)},onDeselect:e=>{i.classList.remove(e)},elementProps:r,remove:()=>i.remove(),createEditor:s})}})}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4739],{54739(e,t,n){n.d(t,{default:()=>k});var o=n(86319);function i(){const e="undefined"!=typeof window&&window.location.hostname||"";return/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$/.test(e)}function a(){const e=o.M.get("config","mcpUrl");if("string"==typeof e&&e)return e;return`${i()?"http://localhost:3000":"https://api.creaditor.ai"}/v1/mcp`}const r="https://claude.ai/settings/connectors";function c(){const e="undefined"!=typeof window?window.open("about:blank","_blank"):null,t=t=>{e?e.location=t:"undefined"!=typeof window&&window.open(t,"_blank","noopener,noreferrer")};(async function(){const e=o.M.get("editor");if(!e)return null;if("function"==typeof e.studioTokenProvider)try{const t=await e.studioTokenProvider({});if("string"==typeof t&&t)return t}catch(e){}return"string"==typeof e.studioToken&&e.studioToken?e.studioToken:null})().then(async e=>{if(!e)return t(r);const n=await fetch(`${a().replace(/\/v1\/mcp\/?$/,"")}/oauth/connect/ticket`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return t(r);const{sessionUrl:o}=await n.json();t(o||r)}).catch(()=>t(r))}function s(e,t){return o.M.get("lang",e)||t}function l(e,t,n){const o=()=>{return e=t,o=n,void("undefined"!=typeof window&&"function"==typeof window.snackbar&&window.snackbar({text:s(e,o)}));var e,o};"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(o).catch(()=>d(e,o)):d(e,o)}function d(e,t){try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch{}}const A=e=>{const{component:t,commands:n}=e,r=t.id;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("ai")},tabs:e=>{const t=[{text:"ai",selected:!0},{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4739],{54739(e,t,n){n.d(t,{default:()=>k});var o=n(86319);function i(){const e="undefined"!=typeof window&&window.location.hostname||"";return/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$/.test(e)}function a(){const e=o.M.get("config","mcpUrl");if("string"==typeof e&&e)return e;return`${i()?"http://localhost:3000":"https://api.creaditor.ai"}/v1/mcp`}const r="https://claude.ai/settings/connectors";function c(){const e="undefined"!=typeof window?window.open("about:blank","_blank"):null,t=t=>{e?e.location=t:"undefined"!=typeof window&&window.open(t,"_blank","noopener,noreferrer")};(async function(){const e=o.M.get("editor");if(!e)return null;if("function"==typeof e.studioTokenProvider)try{const t=await e.studioTokenProvider({});if("string"==typeof t&&t)return t}catch(e){}return"string"==typeof e.studioToken&&e.studioToken?e.studioToken:null})().then(async e=>{if(!e)return t(r);const n=await fetch(`${a().replace(/\/v1\/mcp\/?$/,"")}/oauth/connect/ticket`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return t(r);const{sessionUrl:o}=await n.json();t(o||r)}).catch(()=>t(r))}function s(e,t){return o.M.get("lang",e)||t}function l(e,t,n){const o=()=>{return e=t,o=n,void("undefined"!=typeof window&&"function"==typeof window.snackbar&&window.snackbar({text:s(e,o)}));var e,o};"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(o).catch(()=>d(e,o)):d(e,o)}function d(e,t){try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch{}}const A=e=>{const{component:t,commands:n}=e,r=t.id;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("ai")},tabs:e=>{const t=[{text:"ai",selected:!0},{text:"style"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:s}=e;const d=()=>"ai"===s.text;return[{type:"info",text:"ai_connect_intro",active:d},{type:"button",text:"ai_connect_btn",bgColor:"#6c47ff",color:"#ffffff",active:d,onClick:()=>{l(a(),"ai_connect_link_copied","Connection link copied — paste it in Claude's connector settings."),c()}},{type:"info",text:"ai_connect_localhost_note",active:()=>d()&&i()},{type:"input",title:"ai_connect_url_label",active:d,value:a(),onChange:e=>{e&&e.target&&(e.target.value=a())}},{type:"button",text:"ai_connect_prompt_btn",active:d,onClick:()=>{l(function(e){const t=o.M.get("app"),n=t&&t._id,i=n?`the AI element with id \`${e}\` on site \`${n}\``:`the AI element with id \`${e}\``;return[`Connect to my Creaditor site builder via its MCP connector at ${a()}.`,"",`Then use the write_element_html tool to build a complete, modern, responsive landing page into ${i}.`,"","If you're not sure what the page should be about, ask me first."].join("\n")}(r),"ai_connect_prompt_copied","Prompt copied — paste it into a Claude chat.")}},{type:"input",title:"elementId",active:d,value:r,onChange:()=>{}},{type:"slider",title:"height",min:200,max:2400,active:()=>"style"===s.text,value:parseInt(t.props.style?.height,10)||900,onInput:e=>{const t=e.target.value;n.execCommand("style",{height:t+"px"})}}]}}},p=e=>{let{helpers:t}=e;return{set:(e,n,o)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n],o),!0;case"html":return e[n]=o,!0;default:return!1}}}};var u=n(72591),h=n.n(u),m=n(88639),f=n.n(m),g=n(88128),y=n.n(g),C=n(30855),b=n.n(C),E=n(93051),v=n.n(E),w=n(79646),B={};B.setAttributes=b(),B.insert=y().bind(null,"head"),B.domAPI=f(),B.insertStyleElement=v();h()(w.A,B);const x=w.A&&w.A.locals?w.A.locals:void 0,k=()=>({name:"ai",create:e=>{const{createElement:t,compose:n,helpers:o}=e,{arrayToString:i,mergeDiff:a}=o,r=document.createElement("div");r.setAttribute("data-id",n.id),r.setAttribute("draggable-element","element"),r.setAttribute("droppable-element","element"),r.className=i("ai-component",x.main);const c=document.createElement("div");c.style.cssText="position:relative;max-width:100%;height:100%;width:100%;",r.appendChild(c);const s=document.createElement("iframe");s.style.cssText="width:100%;height:100%;border:none;display:block;",c.appendChild(s);const l=document.createElement("div");l.className=x.emptyAiHolder;const d=document.createElement("h1");d.setAttribute("align","center");const u=document.createElement("lang-text");u.setAttribute("text","ai_element_empty_connect_claude"),d.appendChild(u),l.appendChild(d),c.appendChild(l);return t({name:"ai",id:n.id,template:r,defaultProps:{style:{display:"block",width:"100%",height:"100vh"},html:""},draggable:{group:"element"},droppable:{group:"element"},render:()=>{a(s,{style:n.props.style});const e=n.props.html||"";e?(s.srcdoc!==e&&(s.srcdoc=e),s.style.display="block",l.style.display="none"):(s.removeAttribute("srcdoc"),s.style.display="none",l.style.display="flex")},resizeable:()=>c,handleBar:!0,validator:p({helpers:o}),schema:n.schema,onSelect:e=>{r.classList.add(e)},onDeselect:e=>{r.classList.remove(e)},elementProps:n,remove:()=>{r.remove()},createEditor:A})}})},79646(e,t,n){n.d(t,{A:()=>c});var o=n(82001),i=n.n(o),a=n(40935),r=n.n(a)()(i());r.push([e.id,'.NBtRDhA9L9rE8tvMRYXh {\n position: relative;\n width: 100%;\n}\n\n.NBtRDhA9L9rE8tvMRYXh:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: #000;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.NBtRDhA9L9rE8tvMRYXh iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.BwJnFUnLniO8YoMqBrOB {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 15px;\n z-index: 15;\n width: 100%;\n padding: 24px;\n text-align: center;\n}\n\n.BwJnFUnLniO8YoMqBrOB h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n',"",{version:3,sources:["webpack://./../web-editors/ai-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,OAAO;EACP,MAAM;EACN,WAAW;EACX,YAAY;EACZ,gBAAgC;EAAhC,gCAAgC;EAChC,YAAY;EACZ,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,gCAAgC;EAChC,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;EACtB,SAAS;EACT,WAAW;EACX,WAAW;EACX,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,0BAA0B;AAC5B",sourcesContent:['.main {\n position: relative;\n width: 100%;\n}\n\n.main:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.main iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.emptyAiHolder {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 15px;\n z-index: 15;\n width: 100%;\n padding: 24px;\n text-align: center;\n}\n\n.emptyAiHolder h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n'],sourceRoot:""}]),r.locals={main:"NBtRDhA9L9rE8tvMRYXh",emptyAiHolder:"BwJnFUnLniO8YoMqBrOB"};const c=r}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4762],{64762(e,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4762],{64762(t,e,r){r.r(e),r.d(e,{Page500:()=>o});var a=r(59929);class o extends a.WF{constructor(){super()}render(){return a.qy`<div class="root">
|
|
2
2
|
<div class="container">
|
|
3
3
|
<cdtr-row spacing="1rem">
|
|
4
4
|
<h1><lang-text text="connection_error"></lang-text></h1>
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
height: 100vh;
|
|
26
26
|
left: 0;
|
|
27
27
|
top: 0;
|
|
28
|
-
z-index:
|
|
28
|
+
z-index: var(--z-blocking, 2147483646);
|
|
29
29
|
background-color: #0000001f;
|
|
30
30
|
}
|
|
31
31
|
.container {
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
transform: translate(-50%, -50%);
|
|
36
36
|
background: #fff;
|
|
37
37
|
width: 700px;
|
|
38
|
-
z-index:
|
|
38
|
+
z-index: var(--z-toast, 1100);
|
|
39
39
|
max-width: 100%;
|
|
40
40
|
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
|
|
41
41
|
padding: 3rem;
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4770],{94770(e,t,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4770],{94770(e,t,i){i.r(t),i.d(t,{RangeByDeviceEditor:()=>n});var c=i(59929);class n extends c.WF{constructor(e){super(),this.device="desktop",this.deviceEvent=new UIEvent("device",{view:window,bubbles:!0,cancelable:!0}),this.inputEvent=new UIEvent("input",{view:window,bubbles:!0,cancelable:!0}),this.changeEvent=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0})}connectedCallback(){super.connectedCallback(),this.device="desktop"}disconnectedCallback(){super.disconnectedCallback()}onChange(e){const t=e.target.value;this.value=t,this.dispatchEvent(this.changeEvent)}onInput(e){const t=e.target.value;this.value=t,this.dispatchEvent(this.inputEvent)}pickerDevice(e){this.device=e.detail?.device??e.target.device,this.dispatchEvent(this.deviceEvent)}render(){return c.qy` <cdtr-row class="container">
|
|
2
2
|
<cdtr-col sm="12">
|
|
3
3
|
<cdtr-row alignItems="center">
|
|
4
4
|
<cdtr-title pb="0"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<cdtr-col class="device-picker" sm="4">
|
|
8
8
|
<cdtr-device-picker
|
|
9
9
|
device=${this.device}
|
|
10
|
-
@
|
|
10
|
+
@device-change=${this.pickerDevice}
|
|
11
11
|
></cdtr-device-picker>
|
|
12
12
|
</cdtr-col>
|
|
13
13
|
</cdtr-row>
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
min="${this.min}"
|
|
23
23
|
></cdtr-range-input
|
|
24
24
|
></cdtr-col>
|
|
25
|
-
</cdtr-row>`}}n.styles=
|
|
25
|
+
</cdtr-row>`}}n.styles=c.AH`
|
|
26
26
|
.device-picker {
|
|
27
27
|
opacity: 0;
|
|
28
28
|
}
|
|
Binary file
|
|
@@ -1167,7 +1167,7 @@
|
|
|
1167
1167
|
`:null}
|
|
1168
1168
|
</cdtr-row>
|
|
1169
1169
|
</cdtr-editor-container>
|
|
1170
|
-
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return W(t);case"linkpicker":return F(t);case"input":return s(t);case"dropdown":return n(t);case"fontSize":return d(t);case"fontFamily":return c(t);case"mergeTags":return G(t);case"boxShadow":return x(t);case"colorpicker":return p(t);case"slider":return h(t);case"divider":return w(t);case"heading":return v(t);case"option":return $(t);case"checkbox":return z(t);case"stringListBuilder":return _(t);case"chipsInput":return L(t);case"typography":return H(t);case"icons":return r.qy`<icons-gallery
|
|
1170
|
+
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return W(t);case"linkpicker":return F(t);case"input":return s(t);case"dropdown":return n(t);case"fontSize":return d(t);case"fontFamily":return c(t);case"mergeTags":return G(t);case"boxShadow":return x(t);case"colorpicker":return p(t);case"slider":return h(t);case"divider":return w(t);case"heading":return v(t);case"option":return $(t);case"checkbox":return z(t);case"stringListBuilder":return _(t);case"chipsInput":return L(t);case"typography":return H(t);case"icons":return r.qy`<icons-gallery
|
|
1171
1171
|
.selectedIcon=${t.selectedIcon}
|
|
1172
1172
|
.useIconsApi=${!0===t.useIconsApi}
|
|
1173
1173
|
.iconColor=${t.iconColor??"000000"}
|
|
@@ -1182,7 +1182,7 @@
|
|
|
1182
1182
|
.isOpen=${t.isOpen}
|
|
1183
1183
|
>
|
|
1184
1184
|
${t.children.map(t=>this.factory(t))}
|
|
1185
|
-
</cdtr-accordion-item>`;case"imagePrompt":return document.createElement("cdtr-image-prompt-builder");case"spacingPicker":return st(t);case"section":return(0,nt.A)(t,(t.children||[]).map((t,e)=>this.factory(t,e)));case"colorSwatchGroup":return(0,ct.A)(t)}}execCommandWrapper(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a.components=[this.component],l.Ay.store().execCommand(t,e,a)}commandsBuilder(){return{tab:this.tabName,helpers:{Url:C.A,deepMerge:I()},commands:{execCommand:this.execCommandWrapper,injectEditor:o.M.get("injectEditor")}}}changeTab(t){this.tabName=t,this.editor=this.component.createEditor(this.commandsBuilder())}getColElementData(t){const e=t[0]?.closest("col");return e?{colElement:e,justifyValue:e.props.justify,alignItemsValue:e.props.alignItems,colElementRect:e.element.getBoundingClientRect()}:null}shouldShowDesignControls(t,e){const a=t[0]?.element.getBoundingClientRect(),r=t[0]?.type,o=e.find(t=>t.selected)?.text;let i=("design"===o||void 0===o)&&!["root","section","block","row","col"].includes(r);const s=this.getColElementData(t);return s&&s.colElementRect.width===a.width&&(i=!1),i}handleJustifyContent(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("justify",e,{find:"col"})}handleAlignItems(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("alignItems",e,{find:"col"})}renderJustifyAlignControls(t){return t?(0,nt.A)({label:"alignment",open:!1},[P({value:t.justifyValue,onChange:this.handleJustifyContent}),P({value:t.alignItemsValue,type:"alignItems",title:"alignItems",onChange:this.handleAlignItems})]):null}preprocessLayout(t){if(!t||0===t.length)return t;if(t.some(t=>t&&"section"===t.type))return this._applyPersistedOpen(t);t=t.filter(t=>!!t&&("boolean"==typeof t.active?t.active:"function"!=typeof t.active||!1!==t.active()));const e=[];let a=[];for(const r of t)r&&("function"!=typeof r?"divider"===r.type?(a.length>0&&e.push(a),a=[]):"heading"===r.type?(a.length>0&&e.push(a),a=[r]):a.push(r):a.push(r));a.length>0&&e.push(a);const r=[];let o=0;for(let t=0;t<e.length;t++){const a=e[t];if(a[0]&&"heading"===a[0].type){const t=a[0].text||"settings",e=a.slice(1);e.length>0&&(o++,r.push({type:"section",label:t,open:!0,children:e}))}else r.push(...a)}if(o>=4)for(const t of r)"section"===t.type&&(t.open=!1);return this._applyPersistedOpen(r)}createRenderRoot(){return this}render(){if(!this.editor)return;if("function"!=typeof this.editor.tabs)return;const t=l.Ay.getSelectedComponent(),e=this.editor?.tabs(this.tabName),a=this.getColElementData(t),o=this.shouldShowDesignControls(t,e),i=this.preprocessLayout(this.editor.layout({tabs:e,tab:e.find(t=>t.selected)||{text:"
|
|
1185
|
+
</cdtr-accordion-item>`;case"imagePrompt":return document.createElement("cdtr-image-prompt-builder");case"spacingPicker":return st(t);case"section":return(0,nt.A)(t,(t.children||[]).map((t,e)=>this.factory(t,e)));case"colorSwatchGroup":return(0,ct.A)(t)}}execCommandWrapper(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a.components=[this.component],l.Ay.store().execCommand(t,e,a)}commandsBuilder(){return{tab:this.tabName,helpers:{Url:C.A,deepMerge:I()},commands:{execCommand:this.execCommandWrapper,injectEditor:o.M.get("injectEditor")}}}changeTab(t){this.tabName=t,"function"==typeof this.component?.createEditor&&(this.editor=this.component.createEditor(this.commandsBuilder()))}getColElementData(t){const e=t[0]?.closest("col");return e?{colElement:e,justifyValue:e.props.justify,alignItemsValue:e.props.alignItems,colElementRect:e.element.getBoundingClientRect()}:null}shouldShowDesignControls(t,e){const a=t[0]?.element.getBoundingClientRect(),r=t[0]?.type,o=e.find(t=>t.selected)?.text;let i=("design"===o||void 0===o)&&!["root","section","block","row","col"].includes(r);const s=this.getColElementData(t);return s&&s.colElementRect.width===a.width&&(i=!1),i}handleJustifyContent(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("justify",e,{find:"col"})}handleAlignItems(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("alignItems",e,{find:"col"})}renderJustifyAlignControls(t){return t?(0,nt.A)({label:"alignment",open:!1},[P({value:t.justifyValue,onChange:this.handleJustifyContent}),P({value:t.alignItemsValue,type:"alignItems",title:"alignItems",onChange:this.handleAlignItems})]):null}preprocessLayout(t){if(!t||0===t.length)return t;if(t.some(t=>t&&"section"===t.type))return this._applyPersistedOpen(t);t=t.filter(t=>!!t&&("boolean"==typeof t.active?t.active:"function"!=typeof t.active||!1!==t.active()));const e=[];let a=[];for(const r of t)r&&("function"!=typeof r?"divider"===r.type?(a.length>0&&e.push(a),a=[]):"heading"===r.type?(a.length>0&&e.push(a),a=[r]):a.push(r):a.push(r));a.length>0&&e.push(a);const r=[];let o=0;for(let t=0;t<e.length;t++){const a=e[t];if(a[0]&&"heading"===a[0].type){const t=a[0].text||"settings",e=a.slice(1);e.length>0&&(o++,r.push({type:"section",label:t,open:!0,children:e}))}else r.push(...a)}if(o>=4)for(const t of r)"section"===t.type&&(t.open=!1);return this._applyPersistedOpen(r)}createRenderRoot(){return this}render(){if(!this.editor)return;if("function"!=typeof this.editor.tabs)return;const t=l.Ay.getSelectedComponent(),e=this.editor?.tabs(this.tabName),a=this.getColElementData(t),o=this.shouldShowDesignControls(t,e),i=this.preprocessLayout(this.editor.layout({tabs:e,tab:e.find(t=>t.selected)||e[0]||{text:"style"},changeTab:this.changeTab})),s=i.filter(t=>t&&"section"===t.type).length>=3;return r.qy`<cdtr-editor-tabs
|
|
1186
1186
|
.value=${this.tabName}
|
|
1187
1187
|
@tabChanged=${t=>this.changeTab(t.target.value)}
|
|
1188
1188
|
.tabs=${e}
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=r.M.get("config","channel"),o=[{text:"style",selected:!0},..."web"===t?[{text:"styles"}]:[],{text:"link"},{text:"icons"},..."web"===t?[{text:"animations"},{text:"modal"}]:[],{text:"settings"}];return o.forEach(t=>t.selected=t.selected=t.text===e),o},layout:e=>{let{tab:a,changeTab:d,tabs:i}=e;const s=(r.M.get("components")||[]).filter(e=>e&&"block"===e.type&&e.props?.modalable),c=[{value:"",label:"modal_none"},...s.map((e,t)=>({value:e.id,label:e.props?.modalName||`modal ${t+1}`}))],p=t.props.modalBlockId||"",b=c.find(e=>e.value===p)?.label||"modal_none";return[{type:"custom",active:()=>"styles"===a.text,node:()=>{const e="web"===r.M.get("config","channel"),n={cart:"http://app.creaditor.com/assets/bullets/images/cart-icon.png",arrowRight:"http://app.creaditor.com/assets/bullets/images/1469020585_ic_keyboard_arrow_right_48px.png"},a=[{category:"Basic",presets:[{name:"Solid",style:{background:"#111111",color:"#ffffff",borderRadius:"6px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Pill",style:{background:"#2563eb",color:"#ffffff",borderRadius:"999px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Outline",style:{background:"transparent",color:"#111111",borderRadius:"6px",border:"1px solid #111111",borderWidth:"1px",borderColor:"#111111",boxShadow:null}},{name:"Soft",style:{background:"#eef2ff",color:"#3730a3",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"Gradients",presets:[{name:"Sunset",style:{background:"linear-gradient(135deg,#ff6a00,#ee0979)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Ocean",style:{background:"linear-gradient(135deg,#2193b0,#6dd5ed)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Grape",webOnly:!0,style:{background:"linear-gradient(135deg,#7b2ff7,#f107a3)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Lime",webOnly:!0,style:{background:"linear-gradient(135deg,#11998e,#38ef7d)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"3D blocks",presets:[{name:"Orange",webOnly:!0,style:{background:"#ed8936",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #b45309"}},{name:"Green",webOnly:!0,style:{background:"#38a169",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #276749"}},{name:"Blue",webOnly:!0,style:{background:"#3182ce",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #2151a1"}},{name:"Red",webOnly:!0,style:{background:"#e53e3e",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #9b2c2c"}},{name:"Purple",webOnly:!0,style:{background:"#805ad5",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #553c9a"}},{name:"Dark",webOnly:!0,style:{background:"#2d3748",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #1a202c"}}]},{category:"Effects",presets:[{name:"Neon",webOnly:!0,style:{background:"#0a0a0a",color:"#39ff14",borderRadius:"8px",border:"1px solid #39ff14",borderWidth:"1px",borderColor:"#39ff14",boxShadow:"0 0 10px #39ff14, 0 0 22px rgba(57,255,20,0.5)"}},{name:"Glow",webOnly:!0,style:{background:"#7b2ff7",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 24px rgba(123,47,247,0.55)"}},{name:"Glass",webOnly:!0,style:{background:"rgba(255,255,255,0.18)",color:"#111111",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.6)",borderWidth:"1px",borderColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(8px)",boxShadow:"0 4px 30px rgba(0,0,0,0.1)"}},{name:"Shadow",webOnly:!0,style:{background:"#ffffff",color:"#111111",borderRadius:"12px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 10px 24px rgba(0,0,0,0.18)"}},{name:"Emboss",webOnly:!0,style:{background:"#e2e8f0",color:"#2d3748",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"inset 0 2px 4px rgba(255,255,255,0.9), inset 0 -2px 4px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1)"}}]},{category:"Premium gradients",presets:[{name:"Aurora",webOnly:!0,style:{background:"linear-gradient(135deg,#667eea,#764ba2)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(118,75,162,0.4)"}},{name:"Peach",webOnly:!0,style:{background:"linear-gradient(135deg,#ff9a9e,#fecfef)",color:"#7a2e3a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(255,154,158,0.45)"}},{name:"Gold",webOnly:!0,style:{background:"linear-gradient(135deg,#f6d365,#fda085)",color:"#5a3a1a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(253,160,133,0.45)"}},{name:"Midnight",webOnly:!0,style:{background:"linear-gradient(135deg,#0f2027,#203a43,#2c5364)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(15,32,39,0.5)"}},{name:"Candy",webOnly:!0,style:{background:"linear-gradient(135deg,#f093fb,#f5576c)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(245,87,108,0.45)"}}]},{category:"With icon",presets:[{name:"Buy now",icon:{src:n.cart,direction:"left",size:18},style:{background:"#16a34a",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Continue",icon:{src:n.arrowRight,direction:"right",size:18},style:{background:"linear-gradient(135deg,#2563eb,#1e3a8a)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]}].map(t=>({...t,presets:t.presets.filter(t=>e||!t.webOnly)})).filter(e=>e.presets.length>0),d=t.props.text||"Button",i=e=>e.icon?l.qy`<img
|
|
2
2
|
src="${e.icon.src}"
|
|
3
3
|
style="width:16px;height:16px;object-fit:contain;vertical-align:middle;${"right"===e.icon.direction?"margin-left:6px;order:2;":"margin-right:6px;"}"
|
|
4
4
|
/>`:"",s=e=>l.qy`
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
`)}
|
|
32
32
|
</div>
|
|
33
33
|
</cdtr-editor-container>
|
|
34
|
-
`}},{type:"heading",level:6,text:"open_modal",active:()=>"modal"===a.text},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"modal"===a.text},{type:"dropdown",title:"modal_block",active:()=>"modal"===a.text,value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"settings",active:()=>"design"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"typography",active:()=>"design"===a.text},{type:"typography",active:()=>"design"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"design"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"design"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"colors",active:()=>"design"===a.text},{type:"colorSwatchGroup",active:()=>"design"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"border_design",active:()=>"design"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"design"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"design"===a.text},{type:"boxShadow",active:()=>"design"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"design"===a.text},{type:"spacingPicker",active:()=>"design"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}}]}}}},d=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var i=o(72591),s=o.n(i),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),g=o(30855),x=o.n(g),f=o(93051),h=o.n(f),m=o(49536),y={};y.setAttributes=x(),y.insert=u().bind(null,"head"),y.domAPI=p(),y.insertStyleElement=h();s()(m.A,y);const A=m.A&&m.A.locals?m.A.locals:void 0;var C=o(81318),w=o(1366),v=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:i}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[w.A,v.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}i(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:d({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>d});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.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:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const d=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
34
|
+
`}},{type:"heading",level:6,text:"open_modal",active:()=>"modal"===a.text},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"modal"===a.text},{type:"dropdown",title:"modal_block",active:()=>"modal"===a.text,value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"settings",active:()=>"style"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"style"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"colors",active:()=>"style"===a.text},{type:"colorSwatchGroup",active:()=>"style"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"typography",active:()=>"style"===a.text},{type:"typography",active:()=>"style"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"style"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"style"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"style"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"border_design",active:()=>"style"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"style"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"style"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"style"===a.text},{type:"boxShadow",active:()=>"style"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"style"===a.text},{type:"spacingPicker",active:()=>"style"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}}]}}}},d=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var i=o(72591),s=o.n(i),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),x=o(30855),f=o.n(x),g=o(93051),h=o.n(g),m=o(49536),y={};y.setAttributes=f(),y.insert=u().bind(null,"head"),y.domAPI=p(),y.insertStyleElement=h();s()(m.A,y);const A=m.A&&m.A.locals?m.A.locals:void 0;var C=o(81318),w=o(1366),v=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:i}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[w.A,v.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}i(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:d({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>d});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.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:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const d=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.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
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>i});var n=o(59929),s=o(40648);class r extends n.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,s.Q)(this.persistKey,this.open)}render(){return n.qy`
|
|
2
2
|
<div class="section">
|
|
3
3
|
<div class="header" @click=${this.toggle}>
|
|
4
4
|
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
`}}
|
|
15
|
+
`}}r.styles=n.AH`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
direction: var(--direction-locale, ltr);
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
.content-inner {
|
|
61
61
|
padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,r.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",r);const i=(e,t)=>n.qy`
|
|
64
64
|
<cdtr-editor-section
|
|
65
65
|
.label=${e.label}
|
|
66
66
|
.open=${!1!==e.open}
|
|
@@ -68,28 +68,28 @@
|
|
|
68
68
|
>
|
|
69
69
|
${t}
|
|
70
70
|
</cdtr-editor-section>
|
|
71
|
-
`},40648(e,t,o){o.d(t,{Q:()=>
|
|
71
|
+
`},40648(e,t,o){o.d(t,{Q:()=>i,i:()=>r});const n="cdtr:section-open";function s(){try{const e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return{}}}function r(e){if(!e)return;const t=s();return Object.prototype.hasOwnProperty.call(t,e)?!!t[e]:void 0}function i(e,t){if(!e)return;const o=s();o[e]=!!t,function(e){try{localStorage.setItem(n,JSON.stringify(e))}catch(e){}}(o)}},45340(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>a});var n=o(59929),s=o(86319),r=o(36565),i=(o(12258),o(79307));class a extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{r.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){r.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){r.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(r.Ay.components.length>0){const e=r.Ay.components[0].props;this.show_on_desktop=!!e.show_on_desktop,this.show_on_tablet=!!e.show_on_tablet,this.show_on_mobile=!!e.show_on_mobile,this.name=e.name||"",this.element_ID=e.element_ID||""}}connectedCallback(){super.connectedCallback(),r.Ay.on("select",this.onInspect),r.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),r.Ay.off("select",this.onInspect),r.Ay.off("update",this.onInspect)}render(){const e="block"===r.Ay.getSelectedComponent()[0].type,t="web"===s.M.get("config","channel");return n.qy`
|
|
72
72
|
${e&&t?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
|
|
73
73
|
<div class="device-toggle-row">
|
|
74
74
|
<div
|
|
75
75
|
class="device-toggle-btn ${this.show_on_desktop?"active":""}"
|
|
76
76
|
@click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
|
|
77
77
|
>
|
|
78
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
78
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.oe}</svg>
|
|
79
79
|
<lang-text text="desktop"></lang-text>
|
|
80
80
|
</div>
|
|
81
81
|
<div
|
|
82
82
|
class="device-toggle-btn ${this.show_on_tablet?"active":""}"
|
|
83
83
|
@click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
|
|
84
84
|
>
|
|
85
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
85
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.kN}</svg>
|
|
86
86
|
<lang-text text="tablet"></lang-text>
|
|
87
87
|
</div>
|
|
88
88
|
<div
|
|
89
89
|
class="device-toggle-btn ${this.show_on_mobile?"active":""}"
|
|
90
90
|
@click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
|
|
91
91
|
>
|
|
92
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
92
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.S9}</svg>
|
|
93
93
|
<lang-text text="mobile"></lang-text>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
@@ -126,31 +126,32 @@
|
|
|
126
126
|
}
|
|
127
127
|
.device-toggle-row {
|
|
128
128
|
display: flex;
|
|
129
|
-
gap:
|
|
129
|
+
gap: var(--space-2, 8px);
|
|
130
130
|
}
|
|
131
131
|
.device-toggle-btn {
|
|
132
132
|
display: flex;
|
|
133
133
|
align-items: center;
|
|
134
|
-
gap: 4px;
|
|
135
|
-
padding:
|
|
134
|
+
gap: var(--space-1, 4px);
|
|
135
|
+
padding: var(--space-2, 8px) var(--space-3, 12px);
|
|
136
136
|
border: none;
|
|
137
|
-
border-radius: 6px;
|
|
137
|
+
border-radius: var(--radius-sm, 6px);
|
|
138
138
|
cursor: pointer;
|
|
139
|
-
color: #bbb;
|
|
140
|
-
background: #f4f4f6;
|
|
141
|
-
transition:
|
|
142
|
-
|
|
139
|
+
color: var(--color-text-faint, #bbb);
|
|
140
|
+
background: var(--color-bg-muted, #f4f4f6);
|
|
141
|
+
transition: background var(--duration-fast, 120ms) var(--ease-default, ease),
|
|
142
|
+
color var(--duration-fast, 120ms) var(--ease-default, ease);
|
|
143
|
+
font-size: var(--text-xs, 12px);
|
|
143
144
|
}
|
|
144
145
|
.device-toggle-btn:hover {
|
|
145
146
|
background: #eaeaed;
|
|
146
|
-
color: #888;
|
|
147
|
+
color: var(--color-text-muted, #888);
|
|
147
148
|
}
|
|
148
149
|
.device-toggle-btn svg {
|
|
149
150
|
fill: currentColor;
|
|
150
151
|
flex-shrink: 0;
|
|
151
152
|
}
|
|
152
153
|
.device-toggle-btn.active {
|
|
153
|
-
background: color-
|
|
154
|
-
color: var(--
|
|
154
|
+
background: var(--color-primary-soft, rgba(99, 102, 241, 0.08));
|
|
155
|
+
color: var(--color-primary, #6366f1);
|
|
155
156
|
}
|
|
156
157
|
`,customElements.define("cdtr-setting-editor",a)}}]);
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5884],{55884(e,t,r){r.d(t,{default:()=>L});var o=r(12106),s=r(59929);let i={};function n(e){i.selected=e}function c(e){return i.selected}var a=r(83423),l=r(81444);const d="https://img.creaditor.ai";function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.width??24,o=t.height??24;let s=t.color??"000000";s.startsWith("#")&&(s=s.slice(1));const i=`${d}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${r}&height=${o}`;return(0,l.tG)(i,s)}class h extends s.WF{constructor(){super(),this.searchQuery="",this.iconColor="000000",this.iconSize=34,this.selectedSrc="",this._icons=[],this._loading=!1,this._error=""}willUpdate(e){e.has("searchQuery")&&this.searchQuery?this._fetchIcons():e.has("searchQuery")&&!this.searchQuery&&(this._icons=[],this._error="")}async _fetchIcons(){const e=(this.searchQuery||"").trim();if(e){this._loading=!0,this._error="";try{const t=new URLSearchParams({q:e,limit:"20"}),r=await fetch(`${d}/icons/search?${t.toString()}`);if(!r.ok)throw new Error(r.statusText);const o=await r.json();this._icons=o.icons||[]}catch(e){this._icons=[],this._error=e.message||"Failed to load icons"}finally{this._loading=!1}}else this._icons=[]}_onSelect(e){const t=(this.iconColor||"000000").replace(/^#/,""),r=Number(this.iconSize)||34,o=p(e,{width:r,height:r,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:o,icon:e},bubbles:!0,composed:!0}))}render(){if(!this.searchQuery?.trim())return s.qy``;if(this._loading)return s.qy`<div class="loading"><span class="spinner"></span>Loading icons…</div>`;if(this._error)return s.qy`<div class="error">${this._error}</div>`;if(!this._icons.length)return s.qy``;const e=(this.iconColor||"000000").replace(/^#/,"");return s.qy`
|
|
2
|
+
|
|
3
|
+
<div class="grid">
|
|
4
|
+
${this._icons.map(t=>{const r=p(t,{width:24,height:24,color:e}),o=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return s.qy`
|
|
5
|
+
<button
|
|
6
|
+
type="button"
|
|
7
|
+
class="icon-wrap ${o?"selected":""}"
|
|
8
|
+
title="${t.name}"
|
|
9
|
+
@click=${()=>this._onSelect(t)}
|
|
10
|
+
>
|
|
11
|
+
<img src="${r}" alt="${t.name}" loading="lazy" />
|
|
12
|
+
</button>
|
|
13
|
+
`})}
|
|
14
|
+
</div>
|
|
15
|
+
`}}h.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},h.styles=s.AH`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
}
|
|
20
|
+
.label {
|
|
21
|
+
margin-bottom: 6px;
|
|
22
|
+
color: var(--secondary-text, #666);
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
}
|
|
25
|
+
.grid {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: 6px;
|
|
29
|
+
}
|
|
30
|
+
.icon-wrap {
|
|
31
|
+
width: 36px;
|
|
32
|
+
height: 36px;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
border: 2px solid transparent;
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
background: var(--input-bg, #f5f5f5);
|
|
40
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
41
|
+
}
|
|
42
|
+
.icon-wrap:hover {
|
|
43
|
+
border-color: var(--primary, #007bff);
|
|
44
|
+
box-shadow: 0 0 0 1px var(--primary, #007bff);
|
|
45
|
+
}
|
|
46
|
+
.icon-wrap.selected {
|
|
47
|
+
border-color: var(--primary, #007bff);
|
|
48
|
+
background: color-mix(in srgb, var(--primary, #007bff) 12%, transparent);
|
|
49
|
+
}
|
|
50
|
+
.icon-wrap img {
|
|
51
|
+
width: 24px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
object-fit: contain;
|
|
54
|
+
}
|
|
55
|
+
.loading,
|
|
56
|
+
.error {
|
|
57
|
+
padding: 8px 0;
|
|
58
|
+
color: var(--secondary-text, #666);
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
}
|
|
63
|
+
.spinner {
|
|
64
|
+
width: 16px;
|
|
65
|
+
height: 16px;
|
|
66
|
+
border: 2px solid var(--input-bg, #e0e0e0);
|
|
67
|
+
border-top-color: var(--primary, #007bff);
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
animation: spin 0.7s linear infinite;
|
|
70
|
+
flex: 0 0 auto;
|
|
71
|
+
}
|
|
72
|
+
@keyframes spin {
|
|
73
|
+
to {
|
|
74
|
+
transform: rotate(360deg);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.error {
|
|
78
|
+
color: var(--error-color, #c00);
|
|
79
|
+
}
|
|
80
|
+
`,customElements.define("social-icon-suggestions",h);var m=r(61919);const f=e=>{{const{component:t,commands:r}=e,o=()=>{let e=c();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:n,tabs:c}=e;const d=o(),p=[{type:"node",node:()=>s.qy`<img
|
|
81
|
+
style="padding:10px;display:block;margin:auto"
|
|
82
|
+
width="52"
|
|
83
|
+
height="52"
|
|
84
|
+
src=${d?.src?(0,l.tG)(d.src,d.fgColor||d.iconColor):""}
|
|
85
|
+
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const s=o();if(!s)return;const i=[...t.props.items];if(i.length<2)return;const n=i.findIndex(e=>e.id===s.id);-1!==n&&(i.splice(n,1),r.execCommand("items",i))}},{type:"divider"},{type:"gallery",active:"image"===i.text,src:d?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const s=o();if(!s)return;let i=e.detail;Array.isArray(i)&&(i=i[0]);const n=t.props,c=JSON.parse(JSON.stringify(n.items)),a=c.findIndex(e=>e.id===s.id);-1!==a&&(c[a].src=i.src,r.execCommand("items",c))}},{type:"custom",active:()=>{const e=d?.link?.href||d?.url,t=e?(0,l.IE)(a.A,e):null;return("link"===i.text||"image"===i.text)&&!!t},node:()=>{const e=d?.link?.href||d?.url,i=e&&(0,l.IE)(a.A,e)||"";return s.qy`<cdtr-editor-container><social-icon-suggestions
|
|
86
|
+
.searchQuery=${i}
|
|
87
|
+
.iconColor=${d?.fgColor||d?.iconColor||"000000"}
|
|
88
|
+
.iconSize=${parseInt(d?.style?.width,10)||34}
|
|
89
|
+
.selectedSrc=${d?.src||""}
|
|
90
|
+
@icon-selected=${e=>{const s=o();if(!s)return;const i=t.props,n=JSON.parse(JSON.stringify(i.items)),c=n.findIndex(e=>e.id===s.id);-1!==c&&(n[c].src=e.detail.src,r.execCommand("items",n))}}
|
|
91
|
+
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:d?.link||d?.url,active:()=>"link"===i.text&&!!d,onChange:e=>{const s=o();if(!s)return;const i=e.target.value,n=t.props,c=JSON.parse(JSON.stringify(n.items)),d=c.findIndex(e=>e.id===s.id);if(-1!==d){const e=c[d].fgColor||c[d].iconColor,t=function(e,t){const r=(0,l.IE)(a.A,e),o=r?a.A.find(e=>e.type===r):null,s=o?o.src:null;return s?(0,l.tG)(s,t):null}(i.href,e);t&&(c[d].src=t),c[d].url=i.href,c[d].link=i,r.execCommand("items",c)}}},{type:"slider",title:"size",active:"design"===i.text,value:parseInt(d?.style?.width),min:10,max:80,onInput:e=>{const o=e.target.value,s=[...t.props.items];s.forEach(e=>{e.style.width=o+"px",e.style.height=o+"px"}),r.execCommand("items",s)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===i.text&&!!d,value:d?.fgColor?d.fgColor.startsWith("#")?d.fgColor:"#"+d.fgColor:"#000000",onChange:e=>{const s=o();if(!s)return;let i=e.target.value;i=(0,m.A)(i).toHex(),i.startsWith("#")&&(i=i.slice(1)),8===i.length&&/^[0-9a-fA-F]+$/.test(i)&&(i=i.slice(0,6));const n=t.props,c=JSON.parse(JSON.stringify(n.items));if(!0===n.applyColorToAll)c.forEach(e=>{e.fgColor=i});else{const e=c.findIndex(e=>e.id===s.id);-1!==e&&(c[e].fgColor=i)}r.execCommand("items",c)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===i.text&&!!d,onChange:e=>{const t=!!e.target.checked;r.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===i.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;r.execCommand("style",{gap:t+"px"})}}];return p}}}};var u=r(52144);const g=()=>({set:(e,t,r)=>{switch(t){case"style":if("object"==typeof r)return e[t]=(0,u.A)(e[t],r),!0;break;case"items":if(e[t]=r,Array.isArray(r)){const e=c(),t=r.find(t=>t.id===e?.id);t&&n(t)}return!0;case"src":const o=c();if(o&&Array.isArray(e.items)){const t=[...e.items],s=t.findIndex(e=>e.id===o.id);if(-1!==s)return t[s].src=r,e.items=t,!0}break;case"applyColorToAll":return e[t]=r,!0}}});var y=r(72591),x=r.n(y),b=r(88639),C=r.n(b),v=r(88128),A=r.n(v),k=r(30855),_=r.n(k),w=r(93051),S=r.n(w),I=r(89820),E={};E.setAttributes=_(),E.insert=A().bind(null,"head"),E.domAPI=C(),E.insertStyleElement=S();x()(I.A,E);const $=I.A&&I.A.locals?I.A.locals:void 0;var O=r(23571),T=r(91597);const L=()=>{const e="social";return{name:e,create:t=>{let{createElement:r,compose:s,helpers:i}=t;const d=(0,T.S)(),p=document.createElement("div"),h=document.createElement("div");h.classList.add($.root);new O.Ay(h,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(s.props.items)),{oldIndex:r,newIndex:o}=e,[i]=t.splice(r,1);t.splice(o,0,i),s.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});p.appendChild(h);const m=r({name:e,id:s.id,template:p,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=s.props.items;let t=!1;const r=e.map(e=>{const r=e.url||e.link?.link||"";if(!e.src&&r){const o=(0,l.IE)(a.A,r),s=o?a.A.find(e=>e.type===o):null;if(s)return t=!0,{...e,src:s.src}}return e});t&&setTimeout(()=>s.editor.store().execCommand("items",r),0);const d=t?r:e;for(;h.firstChild;)h.removeChild(h.firstChild);i.mergeDiff(h,{style:s.props.style});const p=c();d.forEach(e=>{const t=document.createElement("img");p?.id===e.id&&t.classList.add($.selected),t.addEventListener("click",()=>{n(e),Array.from(h.children).forEach(e=>{e.classList.remove($.selected)}),t.classList.add($.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);const r=(0,l.fm)(h);t.src=(0,l.Ff)(e,{color:e.fgColor||e.iconColor,bg:r})||"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png",i.mergeDiff(t,{style:e.style}),h.append(t)});const m=document.createElement("paper-button");m.style.minWidth="0",m.style.padding=0,m.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",h.append(m),m.addEventListener("click",()=>{setTimeout(()=>{const e=s.props.items[s.props.items.length-1],t={id:(0,o.A)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},r=[...s.props.items];r.push(t),n(t),s.editor.store().execCommand("items",r)},200)})},handleBar:!0,defaultProps:{},validator:g(),schema:s.schema,onSelect:e=>{const t=c();if(t){const r=document.querySelector(`[data-id="${t.id}"]`);r?(window.___social_cdtr_item=r,r.classList.add("selected_underlined")):p.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),p?.classList?.remove(e)},elementProps:s,remove:()=>{p.remove()},createEditor:f});return m.app.on("update",()=>{d.run(()=>{const e=(0,l.fm)(h);if(!e)return;const t=h.querySelectorAll("img"),r=s.props.items;t.forEach((t,o)=>{const s=r[o];if(!s)return;const i=(0,l.Ff)(s,{color:s.fgColor||s.iconColor,bg:e});i&&(t.src=i)})})}),m}}}},89820(e,t,r){r.d(t,{A:()=>c});var o=r(82001),s=r.n(o),i=r(40935),n=r.n(i)()(s());n.push([e.id,".Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),n.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO"};const c=n}}]);
|
|
Binary file
|