@creaditor/web-starterkit 1.0.6 → 1.0.7
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/1260.creaditor.bundle.js +260 -128
- 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/1529.creaditor.bundle.js +1 -1
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +237 -73
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +11 -5
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +33 -17
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -2
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +91 -58
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +11 -9
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js +1 -1
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +3 -3
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js +1 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +1 -1
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +141 -108
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +198 -235
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +1 -1
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +125 -36
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +24 -31
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6937.creaditor.bundle.js +1 -0
- package/dist/6937.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +2 -3
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js +3 -3
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +3 -7
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +63 -115
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8196.creaditor.bundle.js +51 -0
- package/dist/8196.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +6 -6
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8478.creaditor.bundle.js +1 -0
- package/dist/8478.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js +1 -1
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +1 -0
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js +4 -4
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +1 -1
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +4 -3
- package/dist/9162.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 +1683 -558
- 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([[5119],{15119(e,t,n){n.d(t,{default:()=>I});var o=n(96374),i=n(86319);const r=e=>{{const{component:t,commands:n,helpers:r}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:r,changeTab:a,tabs:s}=e;return[{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===r.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;n.execCommand("text",t)}},{type:"divider",active:()=>"design"===r.text},{type:"divider",active:()=>"design"===r.text},{type:"typography",active:()=>"design"===r.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;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const i="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:i})}}},{type:"divider",active:()=>"design"===r.text},{type:"fontFamily",active:()=>"design"===r.text,value:t.props.style.fontFamily,weight:"web"===i.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})},onWeightChange:e=>{n.execCommand("style",{fontWeight:e.detail.value})}},{type:"divider",active:()=>"design"===r.text},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===r.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"divider",active:()=>"design"===r.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===r.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"divider",active:()=>"design"===r.text},{type:"colorpicker",alpha:!1,title:"button_background",active:()=>"design"===r.text,value:t.props.style.background,onChange:e=>{const i=e.target.value,r=(0,o.w)(t.props.style.color,i);n.execCommand("style",{color:r}),n.execCommand("style",{background:i,backgroundColor:null})}},{type:"divider",active:()=>"design"===r.text},{type:"colorpicker",title:"font_color",alpha:!1,active:()=>"design"===r.text,value:t.props.style.color,onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}},{type:"divider",active:()=>"design"===r.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===r.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;n.execCommand("style",{borderRadius:t+"px"})}},{type:"divider",active:()=>"design"===r.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===r.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===r.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===r.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;n.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===r.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===r.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.execCommand("iconUrl",t.src)}},{type:"divider",active:()=>"design"===r.text},{type:"borderpicker",title:"border",active:()=>"design"===r.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===r.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;n.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===r.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.execCommand("style",{borderColor:t})}},{type:"divider",active:()=>"design"===r.text},{type:"spacingPicker",active:()=>"design"===r.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,o=e.target.bottomValue,i=e.target.leftValue,r=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:i+"px",paddingRight:r+"px",padding:null})}}]}}}},a=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,i,r)=>{switch(i){case"style":return e[i]=t.deepMerge(e[i],r),!0;case"text":return e.text=r,o()||n.chain().setContent(r).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":return e[i]=r,!0;case"onClick":if(r.link)return e[i]=r,!0}}}};var s=n(72591),l=n.n(s),c=n(88639),d=n.n(c),p=n(88128),u=n.n(p),g=n(30855),m=n.n(g),A=n(93051),h=n.n(A),y=n(49536),x={};x.setAttributes=m(),x.insert=u().bind(null,"head"),x.domAPI=d(),x.insertStyleElement=h();l()(y.A,x);const C=y.A&&y.A.locals?y.A.locals:void 0;var v=n(81318),b=n(1366),f=n(67291),E=n(85194),k=n(28396);const B=v.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const I=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:i}=t,{arrayToString:s,mergeDiff:l}=i;let c=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:u}=function(e){let{content:t,element:n}=e;return{element:n,editor:new v.KE({element:n,extensions:[b.A,f.A,k.A,E.Ay,B],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return u.view.dom.setAttribute("dir","auto"),u.on("update",e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)}),u.on("focus",e=>{let{event:t,editor:n}=e;c=!0}),u.on("blur",e=>{let{event:t,editor:n}=e;c=!1}),d.className=C.button,n({name:e,id:o.id,template:d,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{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}l(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,i=o.props.iconSize,r="icon_in_button";let a=d.querySelector(`.${r}`)||document.createElement("img");e&&t?(a.className=r,a.src=t,a.style.width=(i||16)+"px",a.style.height=(i||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===n?d.insertBefore(a,d.firstChild):d.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:a({template:d,helpers:i,editor:u,getFocused:function(){return c}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{u.destroy()},remove:()=>{d.remove()},createEditor:r})}}}},49536(e,t,n){n.d(t,{A:()=>s});var o=n(82001),i=n.n(o),r=n(40935),a=n.n(r)()(i());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 s=a},67291(e,t,n){n.d(t,{A:()=>i});var o=n(81318);const i=o.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,o.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,n){n.d(t,{default:()=>w});var o=n(96374),i=n(86319);const a=e=>{{const{component:t,commands:n,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=[{text:"design",selected:!0},{text:"link"},{text:"icons"},..."web"===i.M.get("config","channel")?[{text:"animations"}]:[],{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:a,changeTab:r,tabs:s}=e;return[{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;n.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;n.execCommand("style",{fontWeight:e});break;case"italic":const o="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:o});break;case"underline":const i="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:i})}}},{type:"fontFamily",active:()=>"design"===a.text,value:t.props.style.fontFamily,weight:"web"===i.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})},onWeightChange:e=>{n.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;n.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;n.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 i=e.target.value;if(!i.includes("gradient(")){const e=(0,o.w)(t.props.style.color,i);n.execCommand("style",{color:e})}n.execCommand("style",{background:i,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;n.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;n.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;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;n.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;n.execCommand("style",{borderColor:t})}},{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};n.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===a.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.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;n.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;n.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;n.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,o=e.target.bottomValue,i=e.target.leftValue,a=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:i+"px",paddingRight:a+"px",padding:null})}}]}}}},r=e=>{let{helpers:t,editor:n,getFocused:o}=e;return{set:(e,i,a)=>{switch(i){case"style":return e[i]=t.deepMerge(e[i],a),!0;case"text":return e.text=a,o()||n.chain().setContent(a).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":return e[i]=a,!0;case"onClick":if(a.link)return e[i]=a,!0}}}};var s=n(72591),l=n.n(s),c=n(88639),d=n.n(c),p=n(88128),u=n.n(p),g=n(30855),m=n.n(g),A=n(93051),h=n.n(A),y=n(49536),x={};x.setAttributes=m(),x.insert=u().bind(null,"head"),x.domAPI=d(),x.insertStyleElement=h();l()(y.A,x);const C=y.A&&y.A.locals?y.A.locals:void 0;var b=n(81318),f=n(1366),v=n(67291),E=n(85194),k=n(28396);const B=b.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const w=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:i}=t,{arrayToString:s,mergeDiff:l}=i;let c=!1;const d=document.createElement("div"),p=document.createElement("div"),{editor:u}=function(e){let{content:t,element:n}=e;return{element:n,editor:new b.KE({element:n,extensions:[f.A,v.A,k.A,E.Ay,B],content:t})}}({content:o.props.text,element:p});d.appendChild(p);return u.view.dom.setAttribute("dir","auto"),u.on("update",e=>{let{editor:t}=e;const n=t.getText();o.editor.store().updateComponent(o,"text",n)}),u.on("focus",e=>{let{event:t,editor:n}=e;c=!0}),u.on("blur",e=>{let{event:t,editor:n}=e;c=!1}),d.className=C.button,n({name:e,id:o.id,template:d,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{o.props.style.display="",o.props.style.direction=""}catch(e){console.error(e)}l(d,{style:o.props.style}),d.style.height="auto";const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,i=o.props.iconSize,a="icon_in_button";let r=d.querySelector(`.${a}`)||document.createElement("img");e&&t?(r.className=a,r.src=t,r.style.width=(i||16)+"px",r.style.height=(i||16)+"px",r.style.marginRight="8px",r.style.marginLeft="8px","left"===n?d.insertBefore(r,d.firstChild):d.appendChild(r)):r.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,handleBar:!0,validator:r({template:d,helpers:i,editor:u,getFocused:function(){return c}}),schema:o.schema,onSelect:e=>{d.classList.add(e)},onDeselect:e=>{d.classList.remove(e)},elementProps:o,destroy:()=>{u.destroy()},remove:()=>{d.remove()},createEditor:a})}}}},49536(e,t,n){n.d(t,{A:()=>s});var o=n(82001),i=n.n(o),a=n(40935),r=n.n(a)()(i());r.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:""}]),r.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const s=r},67291(e,t,n){n.d(t,{A:()=>i});var o=n(81318);const i=o.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,o.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,38 +1,99 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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);class s extends n.WF{constructor(){super(),this.label="",this.open=!0}toggle(){this.open=!this.open}render(){return n.qy`
|
|
2
|
+
<div class="section">
|
|
3
|
+
<div class="header" @click=${this.toggle}>
|
|
4
|
+
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
5
|
+
<svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
6
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
7
|
+
</svg>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="content ${this.open?"open":""}">
|
|
10
|
+
<div class="content-inner">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`}}s.styles=n.AH`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
direction: var(--direction-locale, ltr);
|
|
19
|
+
--editor-container-inline-padding: 0;
|
|
20
|
+
}
|
|
21
|
+
.section {
|
|
22
|
+
border-bottom: 1px solid #eaeaee;
|
|
23
|
+
}
|
|
24
|
+
.header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
padding: 12px 16px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
.title {
|
|
33
|
+
font-size: 12.5px;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
color: #222;
|
|
36
|
+
letter-spacing: 0.01em;
|
|
37
|
+
}
|
|
38
|
+
.chevron {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
|
|
42
|
+
color: #ccc;
|
|
43
|
+
}
|
|
44
|
+
.header:hover .chevron {
|
|
45
|
+
color: #888;
|
|
46
|
+
}
|
|
47
|
+
.chevron.open {
|
|
48
|
+
transform: rotate(180deg);
|
|
49
|
+
}
|
|
50
|
+
.content {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
53
|
+
max-height: 0;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
.content.open {
|
|
57
|
+
max-height: 1200px;
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
.content-inner {
|
|
61
|
+
padding: 0 16px 12px 16px;
|
|
62
|
+
}
|
|
63
|
+
`,s.properties={label:{type:String},open:{type:Boolean}},customElements.define("cdtr-editor-section",s);const i=(e,t)=>n.qy`
|
|
64
|
+
<cdtr-editor-section
|
|
65
|
+
.label=${e.label}
|
|
66
|
+
.open=${!1!==e.open}
|
|
67
|
+
>
|
|
68
|
+
${t}
|
|
69
|
+
</cdtr-editor-section>
|
|
70
|
+
`},45340(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>l});var n=o(59929),s=o(86319),i=o(36565),c=(o(12258),o(79307));class l extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{i.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){i.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){i.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(i.Ay.components.length>0){const e=i.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(),i.Ay.on("select",this.onInspect),i.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),i.Ay.off("select",this.onInspect),i.Ay.off("update",this.onInspect)}render(){const e="block"===i.Ay.getSelectedComponent()[0].type,t="web"===s.M.get("config","channel");return n.qy`
|
|
71
|
+
${e&&t?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
|
|
72
|
+
<div class="device-toggle-row">
|
|
73
|
+
<div
|
|
74
|
+
class="device-toggle-btn ${this.show_on_desktop?"active":""}"
|
|
75
|
+
@click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
|
|
8
76
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<cdtr-checkbox
|
|
16
|
-
.checked=${this.show_on_tablet}
|
|
17
|
-
@change="${t=>this.cmds.onToggleDisplayMode("tablet",!t.target.checked)}"
|
|
77
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.oe}</svg>
|
|
78
|
+
<lang-text text="desktop"></lang-text>
|
|
79
|
+
</div>
|
|
80
|
+
<div
|
|
81
|
+
class="device-toggle-btn ${this.show_on_tablet?"active":""}"
|
|
82
|
+
@click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
|
|
18
83
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.checked=${this.show_on_mobile}
|
|
26
|
-
@change="${t=>this.cmds.onToggleDisplayMode("mobile",!t.target.checked)}"
|
|
84
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.kN}</svg>
|
|
85
|
+
<lang-text text="tablet"></lang-text>
|
|
86
|
+
</div>
|
|
87
|
+
<div
|
|
88
|
+
class="device-toggle-btn ${this.show_on_mobile?"active":""}"
|
|
89
|
+
@click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
|
|
27
90
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<cdtr-accordion-item isOpen="true" label="properties">
|
|
35
|
-
<cdtr-editor-container>
|
|
91
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.S9}</svg>
|
|
92
|
+
<lang-text text="mobile"></lang-text>
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
</cdtr-editor-section>`:n.qy``}
|
|
96
|
+
<cdtr-editor-section label="properties" .open=${!0}>
|
|
36
97
|
<cdtr-row mt="1">
|
|
37
98
|
<cdtr-title><lang-text text="name"></lang-text></cdtr-title>
|
|
38
99
|
</cdtr-row>
|
|
@@ -57,10 +118,38 @@
|
|
|
57
118
|
style="width:100%"
|
|
58
119
|
></cdtr-input>
|
|
59
120
|
</cdtr-row>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`}}s.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},s.styles=n.AH`
|
|
121
|
+
</cdtr-editor-section>
|
|
122
|
+
`}}l.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},l.styles=n.AH`
|
|
63
123
|
:host {
|
|
64
124
|
direction: var(--direction-locale);
|
|
65
125
|
}
|
|
66
|
-
|
|
126
|
+
.device-toggle-row {
|
|
127
|
+
display: flex;
|
|
128
|
+
gap: 6px;
|
|
129
|
+
}
|
|
130
|
+
.device-toggle-btn {
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 4px;
|
|
134
|
+
padding: 7px 8px;
|
|
135
|
+
border: none;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
color: #bbb;
|
|
139
|
+
background: #f4f4f6;
|
|
140
|
+
transition: all 0.15s;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
}
|
|
143
|
+
.device-toggle-btn:hover {
|
|
144
|
+
background: #eaeaed;
|
|
145
|
+
color: #888;
|
|
146
|
+
}
|
|
147
|
+
.device-toggle-btn svg {
|
|
148
|
+
fill: currentColor;
|
|
149
|
+
flex-shrink: 0;
|
|
150
|
+
}
|
|
151
|
+
.device-toggle-btn.active {
|
|
152
|
+
background: color-mix(in srgb, var(--accent, #5B5FC7) 12%, transparent);
|
|
153
|
+
color: var(--accent, #5B5FC7);
|
|
154
|
+
}
|
|
155
|
+
`,customElements.define("cdtr-setting-editor",l)}}]);
|
|
Binary file
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,i){i.r(e),i.d(e,{EditorTabs:()=>s});var n=i(59929),o=i(36565);i.e(7937).then(i.bind(i,67937));class s extends n.WF{constructor(){super(),this.onConnected=this.onConnected.bind(this),this.onArrowNavigation=this.onArrowNavigation.bind(this),this.tabs=[]}onClickItem(t){let{target:e}=t;const i=this.value=e.value,n=[...this.tabs],o=n.findIndex(t=>t.text===i);-1!==o&&(n.forEach(t=>{t.selected=!1}),n[o].selected=!0),this.tabs=n;const s=new UIEvent("tabChanged",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(s)}firstUpdated(){super.firstUpdated()}onConnected(t){let{name:e}=t;this.onClickItem({target:{value:e}})}onArrowNavigation(t){const{key:e,currentIcon:i}=t.detail,n=this.tabs.findIndex(t=>t.text===i);if(-1===n)return;let o=n;switch(e){case"ArrowUp":case"ArrowLeft":o=n>0?n-1:this.tabs.length-1;break;case"ArrowDown":case"ArrowRight":o=n<this.tabs.length-1?n+1:0;break;default:return}const s=this.tabs[o];s&&(this.onClickItem({target:{value:s.text}}),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(`cdtr-editor-tab-item[icon="${s.text}"]`);t&&t.focus()}))}connectedCallback(){super.connectedCallback(),o.Ay.on("editor-tabs",this.onConnected)}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("editor-tabs",this.onConnected)}renderContent(){switch(this.value){case"animations":return i.e(3553).then(i.bind(i,3553)),n.qy`<cdtr-animations-editor>
|
|
2
2
|
<cdtr-block-loader></cdtr-block-loader
|
|
3
|
-
></cdtr-animations-editor>`;case"settings":case"setting":return
|
|
3
|
+
></cdtr-animations-editor>`;case"settings":case"setting":return i.e(5340).then(i.bind(i,45340)),n.qy`<cdtr-setting-editor>
|
|
4
4
|
<cdtr-block-loader></cdtr-block-loader
|
|
5
|
-
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return n.qy`<cdtr-row
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
15
|
-
tabindex="0"
|
|
16
|
-
@change=${this.onClickItem}
|
|
17
|
-
.labelMode=${this.labelMode}
|
|
18
|
-
icon=${t.text}
|
|
19
|
-
text=${t.text}
|
|
20
|
-
.selected=${t.selected}
|
|
21
|
-
></cdtr-editor-tab-item>`)}
|
|
22
|
-
</cdtr-row>
|
|
5
|
+
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return this.tabs.length>0&&!this.tabs.some(t=>t.selected)&&(this.tabs[0].selected=!0,this.value=this.tabs[0].text),n.qy`<cdtr-row class="main">
|
|
6
|
+
<div class="icon-tabs" @arrow-navigation=${this.onArrowNavigation}>
|
|
7
|
+
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
8
|
+
tabindex="0"
|
|
9
|
+
@change=${this.onClickItem}
|
|
10
|
+
icon=${t.text}
|
|
11
|
+
text=${t.text}
|
|
12
|
+
.selected=${t.selected}
|
|
13
|
+
></cdtr-editor-tab-item>`)}
|
|
23
14
|
</div>
|
|
24
15
|
<cdtr-col class="content"> ${this.renderContent()} </cdtr-col>
|
|
25
16
|
</cdtr-row>`}}s.styles=n.AH`
|
|
@@ -32,23 +23,25 @@
|
|
|
32
23
|
overflow: hidden;
|
|
33
24
|
}
|
|
34
25
|
cdtr-editor-tab-item:focus {
|
|
35
|
-
background: #e1e1e1;
|
|
36
26
|
outline: none;
|
|
37
27
|
}
|
|
38
28
|
cdtr-editor-tab-item {
|
|
39
29
|
width: 100%;
|
|
40
30
|
}
|
|
41
31
|
.icon-tabs {
|
|
42
|
-
padding
|
|
43
|
-
background: #
|
|
44
|
-
width:
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
background: #fafafa;
|
|
34
|
+
width: 52px;
|
|
45
35
|
height: 100%;
|
|
46
36
|
min-height: 400px;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
border-left: 1px solid #eaeaee;
|
|
38
|
+
direction: ltr;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 2px;
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
|
|
52
45
|
.main {
|
|
53
46
|
height: 100%;
|
|
54
47
|
direction: rtl;
|
|
@@ -56,8 +49,8 @@
|
|
|
56
49
|
.content {
|
|
57
50
|
overflow-y: auto;
|
|
58
51
|
overflow-x: hidden;
|
|
59
|
-
max-height:
|
|
52
|
+
max-height: calc(100vh - 170px);
|
|
60
53
|
min-height: 80%;
|
|
61
|
-
padding-top:
|
|
54
|
+
padding-top: 12px;
|
|
62
55
|
}
|
|
63
|
-
`,s.properties={tabs:{type:Array},
|
|
56
|
+
`,s.properties={tabs:{type:Array},value:{type:String}},customElements.define("cdtr-editor-tabs",s)}}]);
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[6937],{66937(e,t,a){a.d(t,{default:()=>w});var r=a(5441);const n=e=>{{const{component:t,commands:a,helpers:r}=e;return{select:e=>{let{changeTab:t,tab:a}=e;"design"!==a.text&&t("design")},tabs:e=>{const t=[{text:"design"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:r,changeTab:n,tabs:l}=e;return[{type:"info",text:"edit_data"},{type:"table",width:"500px",editableColor:!0,data:t.props.data,onChangeHeader:(e,t,r)=>{a.execCommand("data",e)},onChangeValue:(e,t,r)=>{a.execCommand("data",e)}},{type:"divider"},{type:"slider",title:"width",value:parseInt(t.props.width),max:800,min:100,onChange:e=>{const t=e.target.value;a.execCommand("width",t)}},{type:"slider",title:"height",value:parseInt(t.props.height),max:500,min:100,onChange:e=>{const t=e.target.value;a.execCommand("height",t)}},{type:"dropdown",title:"type",selected:t.props.type,value:t.props.type,items:[{key:"barChart",value:"barChart"},{key:"lineChart",value:"lineChart"}],onChange:e=>{const t=e.target.value;a.execCommand("type",t)}}]}}}},l=e=>{let{helpers:t,template:a,reRender:r}=e;return{set:(e,t,a)=>{switch(t){case"data":return Array.isArray(a)&&(e[t]=a,r()),!0;case"type":case"width":case"height":return e[t]=a,r(),!0}}}};a(14041);var o=a(46421),s=a(12012),d=a(98331),h=a(51492),i=a(7578),c=a(89701),p=a(92679);const m=e=>(0,r.A)(o.E,{width:e.width||500,height:e.height||300,data:e.data},(0,r.A)(s.d,{strokeDasharray:"3 3"}),(0,r.A)(d.W,{dataKey:"name"}),(0,r.A)(h.h,null),(0,r.A)(i.m,null),(0,r.A)(c.s,null),e.headers.map((e,t)=>(0,r.A)(p.y,{key:t,dataKey:e.name,fill:e.color})));var u=a(37142),y=a(64174);const g=e=>(0,r.A)(u.b,{width:e.width||500,height:e.height||300,data:e.data,margin:{top:5,right:30,left:20,bottom:5}},(0,r.A)(s.d,{strokeDasharray:"3 3"}),(0,r.A)(d.W,{dataKey:e.headers[0].name}),(0,r.A)(h.h,null),(0,r.A)(i.m,null),(0,r.A)(c.s,null),e.headers.map((e,t)=>(0,r.A)(y.N,{key:t,type:"monotone",dataKey:e.name,stroke:e.color}))),f=["#1c1c1c","#222222","#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#262626"],v=e=>{const{data:t}=e,a=t[0].items.map(e=>({name:e.key}));t.forEach((e,t)=>{a[t]&&(a[t].color||(a[t].color=""),a[t].color=e.color||f[t])});const n=t.map(e=>{const t={};return e.items.forEach(e=>{t[e.key]=e.value}),t});return(0,r.A)(e=>{switch(e.type){case"lineChart":return(0,r.A)(g,e);case"barChart":return(0,r.A)(m,e)}},{type:e.type,width:e.width,height:e.height,data:n,headers:a})};var C=a(25873);const w=()=>{const e="bar-chart";return{name:e,menu:t=>{let{Compose:a}=t;return new a(()=>({type:e,props:{style:{},type:"barChart",width:500,height:300,data:[{items:[{key:"uv",value:4e3},{key:"pv",value:2400}],color:"red"},{items:[{key:"uv",value:3e3},{key:"pv",value:2400}],color:"black"}]}}),{group:"elements",name:e,puzzle:['<svg width="21" height="24" viewBox="0 0 21 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <rect width="6" height="24" rx="0.5" fill="#5C5CE0"/>\n <rect x="7.5" y="6" width="6" height="18" rx="0.5" fill="#5C5CE0"/>\n <rect x="15" y="14" width="6" height="10" rx="0.5" fill="#5C5CE0"/>\n </svg>\n \n '],tags:[e],index:null})},create:t=>{let{createElement:a,compose:o,helpers:s}=t;const d=document.createElement("div"),h=document.createElement("div"),i=document.createElement("cdtr-move-handle-bar");i.for=o.id,d.append(h,i);const c=C.H(h);return c.render((0,r.A)(v,o.props)),a({name:e,id:o.id,template:d,defaultProps:{},validator:l({template:d,helpers:s,reRender:()=>{c.render((0,r.A)(v,o.props))}}),schema:o.schema,onSelect:()=>{},onDeselect:()=>{},elementProps:o,remove:()=>{d.remove()},createEditor:n})}}}}}]);
|
|
Binary file
|
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
color: white;
|
|
624
624
|
font-weight: bold;
|
|
625
625
|
}
|
|
626
|
-
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=[...e]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=[...e]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
|
|
626
|
+
`,u.properties={isVisible:{type:Boolean},fileName:{type:String},status:{type:String},progress:{type:Number},timeElapsed:{type:Number}},customElements.define("cdtr-upload-progress-monitor",u);var f=s(18396),m=s(13681);class g extends i.WF{constructor(){super(),this.sortBy="ASC",this.files=[],this.folders=[],this.uploadStatus={},this.onSearch=this.onSearch.bind(this),this.close=this.close.bind(this),this.reset=this.reset.bind(this);const e=new f.A;this.eventEmitter=e;const t=o.M.get("config","editor","configure","mediaGalleryManager");e.files=this.files,e.close=this.close,"function"==typeof t&&(e.render=this.reset,console.log("init mediaGalleryManager"),t(e)),this.reset()}reset(){this.dirId=null,this.eventEmitter.dispatch("load-folders",{resolve:e=>{this.folders=e}}),this.eventEmitter.dispatch("load-files",{resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}})}uploadFile(e){this.folders||(this.folders=[]);const t=e.detail,s=this.folders.find(e=>e.selected),i=`${t.name}-${Date.now()}`;this.uploadStatus[i]={fileName:t.name,status:"uploading",progress:0,error:null},console.log("Dispatching cdtr-upload-start event for:",t.name),this.dispatchEvent(new CustomEvent("cdtr-upload-start",{detail:{uploadId:i,fileName:t.name,file:t},bubbles:!0,composed:!0})),console.log("Event dispatched"),this.eventEmitter.dispatch("upload-file",{file:t,dirId:s?s.id:null,uploadId:i,execCommand:(e,t)=>{o.M.get("editor").store().execCommand(e,t)},options:{},onProgress:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].progress=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("upload-progress",{detail:{uploadId:i,fileName:t.name,progress:e},bubbles:!0,composed:!0})))},onComplete:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="completed",this.uploadStatus[i].progress=100,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-complete",{detail:{uploadId:i,fileName:t.name,result:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},3e3))},onError:e=>{this.uploadStatus[i]&&(this.uploadStatus[i].status="error",this.uploadStatus[i].error=e,this.requestUpdate("uploadStatus"),this.dispatchEvent(new CustomEvent("cdtr-upload-error",{detail:{uploadId:i,fileName:t.name,error:e},bubbles:!0,composed:!0})),setTimeout(()=>{delete this.uploadStatus[i],this.requestUpdate("uploadStatus")},5e3))}}),this.opened=!1}onSearch(e){const{value:t,isLiked:s}=e.detail;s?this.eventEmitter.dispatch("load-files",{isLiked:s,resolve:e=>{Array.isArray(e)?this.files=[...e]:console.error("files is not array",e)}}):t.trim().length>2?this.eventEmitter.dispatch("load-files",{filter:"name",search:t,resolve:e=>{this.files=Array.isArray(e)?[...e]:[]}}):0===t.trim().length&&this.reset()}onFilter(e){const t=e.detail;this.eventEmitter.dispatch("load-files",{filter:"name",search:t.value})}onSelectFolder(e){const t=e.detail,s=this.sortBy,i=t.id;this.dirId=i,this.eventEmitter.dispatch("load-files",{filter:"dir",dirId:i,sortBy:s,resolve:e=>{this.files=e}})}oncreateNewFolder(e){const t=e.detail;this.eventEmitter.dispatch("create-folder",{name:t,resolve:e=>{this.folders||(this.folders=[]);const t=[...this.folders];t.forEach(e=>e.selected=!1),e.selected=!0,t.unshift(e),this.folders=t,this.onSelectFolder({detail:e})}})}onMoveFile(e){const t=e.detail;this.eventEmitter.dispatch("on-move-file",{data:t,resolve:e=>{if(this.folders||(this.folders=[]),this.dirId===t.folderId)return;const s=this.files.findIndex(e=>e.id===t.fileId);if(-1!==s){const e=[...this.files];e[s].moved=!0,this.files=e}const i=this.folders.findIndex(e=>e.id===t.folderId);if(-1!==i){const e=[...this.folders];e[i].file_count+=1,this.folders=e}}})}onLike(e){const t=e.detail;this.eventEmitter.dispatch("on-like",{fileId:t.id,resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e[s].isLiked=!e[s].isLiked,this.files=e}}})}onselectFile(e){const t={detail:e.detail,bubbles:!1,composed:!1};this.dispatchEvent(new CustomEvent("file",t))}close(){this.dispatchEvent(new CustomEvent("close",{}))}onDleteFile(e){const t=e.detail;this.eventEmitter.dispatch("delete-file",{id:t.id,type:"image",resolve:e=>{const s=this.files.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.files];e.splice(s,1),this.files=e}}})}onLoadMore(){this.eventEmitter.dispatch("lazy-load-files-on-scroll",{resolve:e=>{if(Array.isArray(e)&&e.length>0){const t=[...this.files,...e];this.files=t}}})}onDeleteFolder(e){const t=e.detail;this.eventEmitter.dispatch("delete-folder",{id:t.id,resolve:e=>{this.folders||(this.folders=[]);const s=this.folders.findIndex(e=>e.id===t.id);if(-1!==s){const e=[...this.folders];e.splice(s,1),this.folders=e}}})}connectedCallback(){super.connectedCallback(),m.vP.on("on:upload-file","gallery:on:upload-file",async e=>{let{image:t,type:s}=e;if("base64"===s){const e=t.split(",")[1]||t,s=atob(e),i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=s.charCodeAt(e);const r=new Uint8Array(i),o=new Blob([r],{type:"image/png"}),l=new File([o],"uploaded-image.png",{type:"image/png"});this.uploadFile({detail:l})}else if("url"===s){const e=await fetch(t),s=await e.blob(),i=new File([s],"uploaded-image.png",{type:s.type||"image/png"});this.uploadFile({detail:i})}})}render(){return i.qy`
|
|
627
627
|
<cdtr-upload-loading></cdtr-upload-loading>
|
|
628
628
|
<cdtr-upload-progress-monitor></cdtr-upload-progress-monitor>
|
|
629
629
|
<cdtr-drawer
|
|
@@ -653,8 +653,7 @@
|
|
|
653
653
|
></cdtr-gallery-files>
|
|
654
654
|
</cdtr-drawer>`}}g.styles=i.AH``,g.properties={folders:{type:Array},files:{type:Array},pageCount:{type:Number},prevUrl:{type:String},nextUrl:{type:String},opened:{type:Boolean},multi:{type:Boolean},uploadStatus:{type:Object}},customElements.define("cdtr-gallery",g)},2590(e,t,s){s.r(t),s.d(t,{TitleEditor:()=>o});var i=s(59929),r=s(86319);class o extends i.WF{constructor(){super(),this.text="",this.whiteSpace="pre"}connectedCallback(){super.connectedCallback(),this.style.fontFamily="var(--font-family)",this.bold&&(this.style.fontWeight="bold")}render(){const e=r.M.get("theme");e&&(this.style.direction=e.direction,this.style.textAlign=this.textAlign||e.textAlign);const t=r.M.get("lang",this.text);return i.qy`<slot
|
|
655
655
|
><span
|
|
656
|
-
style="-webkit-font-smoothing: antialiased;text-
|
|
657
|
-
display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
656
|
+
style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
658
657
|
>${t||this.text}</span
|
|
659
658
|
></slot
|
|
660
659
|
>`}}o.properties={text:{type:String,reflect:!1},whiteSpace:{type:String},textAlign:{type:String},bold:{type:Boolean}},customElements.get("lang-text")||customElements.define("lang-text",o)},13681(e,t,s){s.d(t,{vP:()=>c});const i=window.cdtrSignalKey||`___${Math.random().toString(36).substr(2,9)}`;window.cdtrSignalKey=i,window[i]||(window[i]={});const r=window[i],o=window.__cdtrEvents||{};function l(e){return crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then(e=>Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join(""))}function a(e){if(e.length%2!=0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let s=0;s<e.length;s+=2)t[s/2]=parseInt(e.substr(s,2),16);return t}async function n(e){const t=await l(e),s=r[t];if(s){const e=await crypto.subtle.importKey("raw",a(t),{name:"AES-GCM"},!1,["encrypt","decrypt"]),i=await async function(e,t,s){const i=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,s);return(new TextDecoder).decode(i)}(e,s.iv,s.encrypted);return JSON.parse(i)}return null}function d(e,t){if(o[e])for(const s in o[e])Object.prototype.hasOwnProperty.call(o[e],s)&&o[e][s].forEach(e=>e(t));Array.isArray(o["*"])&&o["*"].forEach(e=>e(t))}window.__cdtrEvents=o;const c={set:async function(e,t){const s=JSON.parse(JSON.stringify(t)),i=await l(e),n=await crypto.subtle.importKey("raw",a(i),{name:"AES-GCM"},!1,["encrypt","decrypt"]),c=await async function(e,t){const s=crypto.getRandomValues(new Uint8Array(12)),i=(new TextEncoder).encode(t),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},e,i);return{iv:s,encrypted:new Uint8Array(r)}}(n,JSON.stringify(s));r[i]=c,o.set&&o.set[i]&&o.set[i].forEach(e=>e(s)),Array.isArray(o["*"])&&o["*"].forEach(e=>e(s)),d(e,s)},get:n,remove:async function(e){const t=await l(e);delete r[t]},on:async function(e,t,s){o[e]||(o[e]={});const i=await l(t);o[e][i]||(o[e][i]=[]),o[e][i].push(e=>{!function(){const e=(new Error).stack;if(e&&e.indexOf(" at <anonymous>:1")>-1)throw console.warn("Function call blocked: Detected console execution."),new Error("Function call blocked: Detected console execution.")}(),s(e)});const r=await n(t);return r&&s(r),i},off:function(e,t){o[e]&&o[e][t]&&delete o[e][t]},dispatch:d,OPTIONS:{SET:"set"}}}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7238],{97238(t,e,n){n.r(e),n.d(e,{TextEditorPlugin:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[7238],{97238(t,e,n){n.r(e),n.d(e,{TextEditorPlugin:()=>d});var i=n(59929),o=n(36565),r=n(40120),s=n(86319),c=n(75068),a=n.n(c),l=n(18057);class d extends i.WF{constructor(){super(),this.setHeading=t=>{this.editors.forEach(e=>{e.chain().setHeading({level:t}).run()})},this.onchangeFontFamily=t=>{const e=t.target.value,n=this.fontFamilies.find(t=>t.name===e);n?(this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontFamily(n).run():t.chain().setFontFamily(n).run()}),this.fontFamily=e):console.error("cant set font family, font family not founded..")},this.fontSizeDebouncer=new l.A,this.onChangeFontSize=t=>{const e=t.target.device;this.device=e;const n=t.target.value;"phone"===e?this.fontSizeDebouncer.run(()=>{o.Ay.execCommand("breakpoints",t=>{const e=t.props.breakpoints?.sm||{};return{sm:a()({},e,{style:{fontSize:n+"px"}})}})}):this.editors.forEach(t=>{const e=t.view.state.selection;e.from===e.to?t.chain().selectAll().setFontSize(n).run():t.chain().setFontSize(n).run()}),this.fontSize=n},this.onChangeLineHeight=t=>{const e=parseFloat(t.target.value);this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLineHeight(e).run():t.chain().setLineHeight(e).run()}),this.lineHeight=e},this.onChangeletterSpace=t=>{const e=t.target.value+"px";this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setLetterSpacing(e).run():t.chain().setLetterSpacing(e).run()}),this.letterSpacing=e},this.onChangeImage=t=>{},this.onFilteredFonts=t=>{const e=t.target.value;this.filteredFonts=this.fontFamilies.filter(t=>t.name.toLowerCase().includes(e.toLowerCase()))},this.onChangeFontColor=t=>{const e=t.target.value;this.editors.forEach(t=>{const n=t.view.state.selection;n.from===n.to?t.chain().selectAll().setColor(e).run():t.chain().setColor(e).run()}),this.fontColor=e},this.editors=[],this.hasTextComponent=!0,this.filteredFonts=[],this.fontFamilies=[],this.onConnect=this.onConnect.bind(this),this.THEMES=[{type:"paragraph",onClick:()=>{this.editors.forEach(t=>{t.chain().setParagraph().run()})}},{type:"h1",onClick:()=>this.setHeading(1)},{type:"h2",onClick:()=>this.setHeading(2)},{type:"h3",onClick:()=>this.setHeading(3)},{type:"h4",onClick:()=>this.setHeading(4)},{type:"h5",onClick:()=>this.setHeading(5)},{type:"h5",onClick:()=>this.setHeading(5)}]}onConnect(){setTimeout(()=>{this.editors=[];const t=o.Ay.getSelectedComponent({find:"text"});if(this.hasTextComponent=t.length>0,t.forEach(t=>{"text"===t.type&&this.editors.push(t.editor)}),this.editors.length>0){const e=this.editors[0];if(e){const n={...e.getAttributes("paragraph"),...e.getAttributes("heading")};"phone"===this.device?this.fontSize=parseInt(t[0].props?.breakpoints?.sm?.style?.fontSize):this.fontSize=parseInt(e.getAttributes("textStyle").fontSize)||16,this.fontColor=e.getAttributes("textStyle").color||"#000",this.fontFamily=e.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"")||"Arial",n.lineHeight&&(this.lineHeight=parseFloat(n.lineHeight)),n.letterSpacing&&(this.letterSpacing=parseInt(n.letterSpacing)||1),this.themeType=e.isActive("heading",{level:1})?"h1":e.isActive("heading",{level:2})?"h2":e.isActive("heading",{level:3})?"h3":e.isActive("heading",{level:4})?"h4":e.isActive("heading",{level:5})?"h5":e.isActive("heading",{level:6})?"h6":"paragraph"}}},0)}connectedCallback(){super.connectedCallback(),o.Ay.on("select",this.onConnect),o.Ay.on("update",this.onConnect),this.onConnect(),(0,r.VH)().then(t=>{this.filteredFonts=this.fontFamilies=t})}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("select",this.onConnect),o.Ay.off("update",this.onConnect)}render(){const t=i.qy`
|
|
2
2
|
<cdtr-editor-container>
|
|
3
3
|
<cdtr-title style="color:var(--micro-info-color)">
|
|
4
4
|
<i>
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
min="8"
|
|
125
125
|
></cdtr-range-device-editor>
|
|
126
126
|
</cdtr-editor-container>
|
|
127
|
-
`;return this.hasTextComponent?i.qy`${t} `:null}}
|
|
127
|
+
`;return this.hasTextComponent?i.qy`${t} `:null}}d.properties={themeType:{type:String},fontFamily:{type:String},fontSize:{type:Number},fontColor:{type:String},lineHeight:{type:Number},letterSpacing:{type:Number},fontFamilies:{type:Array},filteredFonts:{type:Array},hasTextComponent:{type:Boolean},accordion:{type:Boolean},isOpen:{type:Boolean},device:{type:String}},d.styles=i.AH`
|
|
128
128
|
.dropdown-button {
|
|
129
129
|
min-width: 100px;
|
|
130
130
|
}
|
|
131
|
-
`,customElements.define("cdtr-text-editor-plugin",
|
|
131
|
+
`,customElements.define("cdtr-text-editor-plugin",d)}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[752],{40752(t,e
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[752],{40752(t,i,e){e.r(i),e.d(i,{EditorContainer:()=>a});var n=e(59929);class a extends n.WF{constructor(){super(),this.pt="10px",this.isAnimate=!0}render(){return n.qy`<div
|
|
2
2
|
style="padding-top:${this.pt}"
|
|
3
3
|
class="container ${this.isAnimate?"animate":""}"
|
|
4
4
|
>
|
|
@@ -11,16 +11,12 @@
|
|
|
11
11
|
:host *{
|
|
12
12
|
direction: var(--direction-locale);
|
|
13
13
|
}
|
|
14
|
-
.container:hover {
|
|
15
|
-
background: #9c9c9c0b;
|
|
16
|
-
}
|
|
17
14
|
.container {
|
|
18
|
-
padding-
|
|
19
|
-
padding-right: 15px;
|
|
15
|
+
padding-inline: var(--editor-container-inline-padding, 16px);
|
|
20
16
|
display: block;
|
|
21
17
|
width: 100%;
|
|
22
18
|
min-height: 20px;
|
|
23
|
-
padding-bottom:
|
|
19
|
+
padding-bottom: 8px;
|
|
24
20
|
box-sizing: border-box;
|
|
25
21
|
}
|
|
26
22
|
.animate {
|
|
Binary file
|