@creaditor/web-starterkit 1.0.33 → 1.0.35

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.
@@ -45,4 +45,4 @@
45
45
  </button>
46
46
  </div>
47
47
  </cdtr-editor-container>
48
- `},{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,o.w)(t.props.style.color,r);n.execCommand("style",{color:e})}n.execCommand("style",{background:r,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:"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;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 r="underline"===t.props.style.textDecoration?"none":"underline";n.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;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:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px"})}},{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;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"slider",title:"height",min:20,max:300,active:()=>"style"===a.text,value:parseInt(t.props.style.height)||(()=>{const e=document.querySelector(`[data-id="${t.id}"]`);return e&&Math.round(e.getBoundingClientRect().height)||40})(),sizes:[{name:r.M.get("lang","auto")||"auto",value:"auto"}],onInput:e=>{const t=e.target.value;n.execCommand("style",{height:"auto"===t?"auto":parseInt(t)+"px"})}},{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;n.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;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===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:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.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=>{n.execCommand("style",{boxShadow:e})}},{type:"heading",level:6,text:"link",active:()=>"interactions"===a.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===a.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"heading",level:6,text:"open_modal",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"info",text:c.length?"modal_pick_hint":"modal_none_hint",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"dropdown",title:"modal_block",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel"),value:u,selected:p,items:d,onChange:e=>{n.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"icons",active:()=>"style"===a.text},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"style"===a.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"style"===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:()=>"style"===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:()=>"style"===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:()=>"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,o=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}},...g]}}}},i=e=>{let{helpers:t,editor:n,getFocused:o}=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,o()||n.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 s=n(72591),c=n.n(s),d=n(88639),p=n.n(d),u=n(88128),g=n.n(u),m=n(30855),y=n.n(m),h=n(93051),x=n.n(h),b=n(49536),A={};A.setAttributes=y(),A.insert=g().bind(null,"head"),A.domAPI=p(),A.insertStyleElement=x();c()(b.A,A);const f=b.A&&b.A.locals?b.A.locals:void 0;var C=n(81318),v=n(1366),w=n(67291),k=n(85194),E=n(28396);const B=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const S=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:r}=t,{arrayToString:l,mergeDiff:s}=r;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 C.KE({element:n,extensions:[v.A,w.A,E.A,k.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=f.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)}s(d,{style:o.props.style});const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,r=o.props.iconSize,l="icon_in_button";let a=d.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"===n?d.insertBefore(a,d.firstChild):d.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,resizeAxis:"xy",handleBar:!0,validator:i({template:d,helpers:r,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:()=>i});var o=n(82001),r=n.n(o),l=n(40935),a=n.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 i=a},67291(e,t,n){n.d(t,{A:()=>r});var o=n(81318);const r=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()}}})}}]);
48
+ `},{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,o.w)(t.props.style.color,r);n.execCommand("style",{color:e})}n.execCommand("style",{background:r,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:"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;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 r="underline"===t.props.style.textDecoration?"none":"underline";n.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;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:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;n.execCommand("style",{fontSize:t+"px"})}},{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;n.execCommand("style",{width:t+"px",minWidth:null})}},{type:"slider",title:"height",min:20,max:300,active:()=>"style"===a.text,value:parseInt(t.props.style.height)||(()=>{const e=document.querySelector(`[data-id="${t.id}"]`);return e&&Math.round(e.getBoundingClientRect().height)||40})(),sizes:[{name:r.M.get("lang","auto")||"auto",value:"auto"}],onInput:e=>{const t=e.target.value;n.execCommand("style",{height:"auto"===t?"auto":parseInt(t)+"px"})}},{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;n.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;n.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===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:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;n.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=>{n.execCommand("style",{boxShadow:e})}},{type:"heading",level:6,text:"link",active:()=>"interactions"===a.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===a.text,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"heading",level:6,text:"open_modal",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"info",text:c.length?"modal_pick_hint":"modal_none_hint",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"dropdown",title:"modal_block",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel"),value:u,selected:p,items:d,onChange:e=>{n.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"icons",active:()=>"style"===a.text},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"style"===a.text,onChange:e=>{const t=e.target.checked;n.execCommand("hasIcon",t),n.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"style"===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:()=>"style"===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:()=>"style"===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:()=>"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,o=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;n.execCommand("style",{paddingTop:t+"px",paddingBottom:o+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}},...g]}}}},i=e=>{let{helpers:t,editor:n,getFocused:o}=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,o()||n.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 s=n(72591),c=n.n(s),d=n(88639),p=n.n(d),u=n(88128),g=n.n(u),m=n(30855),y=n.n(m),h=n(93051),x=n.n(h),b=n(49536),A={};A.setAttributes=y(),A.insert=g().bind(null,"head"),A.domAPI=p(),A.insertStyleElement=x();c()(b.A,A);const f=b.A&&b.A.locals?b.A.locals:void 0;var C=n(81318),v=n(1366),w=n(67291),k=n(85194),E=n(28396);const B=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const S=()=>{const e="button";return{name:e,create:t=>{const{createElement:n,compose:o,helpers:r}=t,{arrayToString:l,mergeDiff:s}=r;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 C.KE({element:n,extensions:[v.A,w.A,E.A,k.Ay,B],content:t})}}({content:o.props.text,element:p});d.appendChild(p);u.view.dom.setAttribute("dir","auto");const g=()=>{let e="";try{e=u.getText()||""}catch(t){e=""}d.setAttribute("dir",function(e){if(!e)return null;for(const t of String(e)){if(/[\u0590-\u05FF\u0600-\u07BF\u0860-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/.test(t))return"rtl";if(/\p{L}/u.test(t))return"ltr"}return null}(e)||"ltr")};return g(),u.on("update",e=>{let{editor:t}=e;const n=t.getText();g(),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=f.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)}s(d,{style:o.props.style});const e=o.props.hasIcon,t=o.props.iconUrl,n=o.props.iconDirection,r=o.props.iconSize,l="icon_in_button";g();let a=d.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","right"===n?d.appendChild(a):d.insertBefore(a,d.firstChild)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>d,resizeAxis:"xy",handleBar:!0,validator:i({template:d,helpers:r,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:()=>i});var o=n(82001),r=n.n(o),l=n(40935),a=n.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 i=a},67291(e,t,n){n.d(t,{A:()=>r});var o=n(81318);const r=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
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8878],{98878(e,t,o){o.d(t,{default:()=>H});var n=o(86319),r=o(61919),a=o(96374);const i={"var(--cdtr-primary)":"--cdtr-primary-contrast","var(--cdtr-secondary)":"--cdtr-secondary-contrast"},c=["headerStyle","contentStyle"];function l(e,t){const o={...e||{},...t||{}};return Object.keys(o).length?o:void 0}function d(e){return!(!e||!e.backgroundColor&&!e.background)}function s(e,t){return{item:l(e&&e.itemStyle,t&&t.itemStyle),header:l(e&&e.headerStyle,t&&t.headerStyle),content:l(e&&e.contentStyle,t&&t.contentStyle)}}function p(e,t,o){const n={...e||{}};c.forEach(e=>{const o={...n[e]||{}};t?o.backgroundColor=t:delete o.backgroundColor,Object.keys(o).length?n[e]=o:delete n[e]});const r={...n.itemStyle||{}};return t&&o?r.color=o:delete r.color,Object.keys(r).length?n.itemStyle=r:delete n.itemStyle,n}function u(e,t,o){if(!e)return"";const n=/var\(/i.test(e)&&"function"==typeof o?o(e):e,r=n?(0,a.w)(t||"#000000",n,4.5):"",c=String(e).replace(/\s+/g,"").toLowerCase(),l=i[c];return l?`var(${l}, ${r||"#FFFFFF"})`:r}function g(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length?"000000":t}function h(e){const t=e.iconCategory||"Arrows",o=e.iconName||"arrow-down-s-line",n=g(e.iconColor);return`https://img.creaditor.ai/icons/serve/${encodeURIComponent(t)}/${encodeURIComponent(o)}.png?width=40&height=40&color=${n}`}const m={he:{itemsTab:"פריטים",itemsDesc:"פאנלים",arrowTab:"חץ",settingsTab:"הגדרות",settingsDesc:"גודל והתנהגות",panel:e=>`פאנל ${e}`,panelDesc:"שנו סדר, קבעו מצב פתיחה או הסירו פאנל. עריכת הטקסט מתבצעת ישירות על הקנבס.",openDefault:"פתוח כברירת מחדל",openDefaultDesc:"הצג פאנל זה פתוח בטעינת העמוד.",moveUp:"הזז למעלה",moveUpDesc:"העבר פאנל זה מיקום אחד למעלה.",moveDown:"הזז למטה",moveDownDesc:"העבר פאנל זה מיקום אחד למטה.",removePanel:"הסר פאנל",removePanelDesc:"מחק פאנל זה.",addPanel:"הוסף פאנל",addPanelDesc:"הוסף פאנל חדש לאקורדיון.",arrowIcon:"סמל החץ",arrowColor:"צבע החץ",arrowSide:"צד החץ",arrowSideDesc:"באיזה צד של הכותרת יופיע החץ.",arrowAuto:"אוטומטי (לפי כיוון הטקסט)",arrowLeft:"שמאל",arrowRight:"ימין",width:"רוחב",widthDesc:"הרוחב הכולל של האקורדיון.",maxWidth:"רוחב מרבי",maxWidthDesc:"הרוחב המרבי של האקורדיון.",multipleOpen:"מספר פאנלים פתוחים בו-זמנית",singleOpen:"פאנל אחד פתוח בכל פעם",allowMultipleDesc:"קבע האם ניתן לפתוח כמה פאנלים יחד.",borderColor:"צבע גבול",panelBackground:"צבע רקע הפאנל",panelBackgroundDesc:"צובע את הכותרת ואת התוכן של פאנל זה.",globalBackground:"צבע רקע לכל הפאנלים",globalBackgroundDesc:"ברירת המחדל לפאנלים שלא הוגדר להם צבע משלהם.",clearBackground:"הסר רקע",clearBackgroundDesc:"חזרה לפאנל שקוף.",designTab:"עיצוב",designDesc:"גופן, גדלים, צבעים וחץ",fontFamily:"גופן",fontFamilyDesc:"חל על כל הפאנלים באקורדיון.",headings:"כותרות",headingSize:"גודל כותרת",contentHeading:"תוכן",contentSize:"גודל טקסט",textColor:"צבע טקסט",textColorDesc:"חל על כל הפאנלים באקורדיון.",globalTypographyNote:"שינוי כאן חל על כל הפאנלים ומחליף עיצוב שהוגדר על מילים בודדות.",spacing:"מרווחים",gap:"מרווח בין פאנלים",paddingX:"ריווח פנימי אופקי",paddingY:"ריווח פנימי אנכי",dividerHeading:"קו מפריד",showDivider:"הצג קו מפריד",hideDivider:"הסתר קו מפריד",showDividerDesc:"הקו שמפריד בין הפאנלים.",dividerWidth:"עובי הקו",dividerStyle:"סוג הקו",checkmark:" ✓"},en:{itemsTab:"Items",itemsDesc:"Panels",arrowTab:"Arrow",settingsTab:"Settings",settingsDesc:"Size & behavior",panel:e=>`Panel ${e}`,panelDesc:"Reorder, set default state, or remove this panel. Edit its text directly on the canvas.",openDefault:"Open by default",openDefaultDesc:"Show this panel expanded when the page loads.",moveUp:"Move Up",moveUpDesc:"Move this panel one position up.",moveDown:"Move Down",moveDownDesc:"Move this panel one position down.",removePanel:"Remove Panel",removePanelDesc:"Delete this panel.",addPanel:"Add Panel",addPanelDesc:"Add a new panel to the accordion.",arrowIcon:"Arrow icon",arrowColor:"Arrow color",arrowSide:"Arrow side",arrowSideDesc:"Which side of the title the arrow sits on.",arrowAuto:"Auto (follow text direction)",arrowLeft:"Left",arrowRight:"Right",width:"Width",widthDesc:"Overall width of the accordion.",maxWidth:"Max Width",maxWidthDesc:"Maximum width of the accordion.",multipleOpen:"Multiple panels open",singleOpen:"One panel open at a time",allowMultipleDesc:"Toggle whether several panels can be expanded at once.",borderColor:"Border Color",panelBackground:"Panel background",panelBackgroundDesc:"Colors both the header and the content of this panel.",globalBackground:"Background for all panels",globalBackgroundDesc:"The default for panels with no color of their own.",clearBackground:"Remove background",clearBackgroundDesc:"Back to a transparent panel.",designTab:"Design",designDesc:"Font, sizes, colors & arrow",fontFamily:"Font",fontFamilyDesc:"Applies to every panel in the accordion.",headings:"Headings",headingSize:"Heading size",contentHeading:"Content",contentSize:"Text size",textColor:"Text color",textColorDesc:"Applies to every panel in the accordion.",globalTypographyNote:"Changing these restyles every panel and replaces formatting set on individual words.",spacing:"Spacing",gap:"Gap between panels",paddingX:"Horizontal padding",paddingY:"Vertical padding",dividerHeading:"Divider",showDivider:"Show divider",hideDivider:"Hide divider",showDividerDesc:"The line separating the panels.",dividerWidth:"Divider thickness",dividerStyle:"Divider style",checkmark:" ✓"}};let y=null;function f(e){let{component:t,commands:o}=e;const a=function(){try{return"en"!==n.M.get("config","language")}catch(e){return!1}}()?m.he:m.en,i=Array.isArray(t.props.items)?t.props.items:[],c=t.props.style||{},l=t.accordion||{},d=!1!==t.props.allowMultiple,p=!1!==t.props.showDivider,u=(e,o)=>{const n=function(e,t){const o=s(e,t);return o.header&&o.header.backgroundColor||o.content&&o.content.backgroundColor||""}(t.props,e);return[{type:"colorpicker",title:a.panelBackground,description:a.panelBackgroundDesc,alpha:!1,value:n||"#ffffff",onChange:e=>l.setPanelBackground&&l.setPanelBackground(o,e.target.value)},{type:"option",text:a.clearBackground,description:a.clearBackgroundDesc,active:!!n,onClick:()=>l.setPanelBackground&&l.setPanelBackground(o,"")}]},f=i.map((e,t)=>({type:"accordion",label:a.panel(t+1),isOpen:!1,description:a.panelDesc,onToggle:()=>{},children:[{type:"option",text:e.isOpen?a.openDefault+a.checkmark:a.openDefault,description:a.openDefaultDesc,active:!0,onClick:()=>l.setDefaultOpen&&l.setDefaultOpen(t,!e.isOpen)},{type:"option",text:a.moveUp,description:a.moveUpDesc,active:t>0,onClick:()=>l.moveItem&&l.moveItem(t,t-1)},{type:"option",text:a.moveDown,description:a.moveDownDesc,active:t<i.length-1,onClick:()=>l.moveItem&&l.moveItem(t,t+1)},{type:"divider"},...u(e,t),{type:"divider"},{type:"option",text:a.removePanel,icon:"remove",color:"red",description:a.removePanelDesc,onClick:()=>l.removeItem&&l.removeItem(t)},{type:"divider"}]})),v=()=>t.props.arrowSide||"auto",w=()=>[{value:"auto",label:a.arrowAuto},{value:"left",label:a.arrowLeft},{value:"right",label:a.arrowRight}],C=()=>{const e=v(),t=w().find(t=>t.value===e);return t?t.label:a.arrowAuto},x=(e,n,r)=>{const a=parseInt(e.target.value,10);var i;a&&a!==t.props[n]&&(o.execCommand(n,a),i=()=>r&&r(a),clearTimeout(y),y=setTimeout(i,200))},b=e=>x(e,"headingFontSize",l.setHeadingFontSize),D=e=>x(e,"contentFontSize",l.setContentFontSize);return{tabs:e=>{const t=[{text:a.itemsTab,description:a.itemsDesc},{text:a.designTab,description:a.designDesc},{text:a.settingsTab,description:a.settingsDesc}];return t.forEach(t=>{t.selected=t.text===e}),t},layout:e=>{let{tab:n}=e;return n.text===a.designTab?[{type:"info",text:a.globalTypographyNote},{type:"fontFamily",title:a.fontFamily,description:a.fontFamilyDesc,value:t.props.fontFamily||"Arial",onChange:e=>{o.execCommand("fontFamily",e.target.name||e.target.value),l.setFontFamily&&l.setFontFamily(e.target.value)}},{type:"divider"},{type:"heading",level:4,text:a.headings},{type:"slider",title:a.headingSize,unit:"px",min:8,max:72,value:t.props.headingFontSize||16,onInput:e=>b(e),onChange:e=>b(e)},{type:"divider"},{type:"heading",level:4,text:a.contentHeading},{type:"slider",title:a.contentSize,unit:"px",min:8,max:72,value:t.props.contentFontSize||14,onInput:e=>D(e),onChange:e=>D(e)},{type:"divider"},{type:"colorpicker",title:a.textColor,description:a.textColorDesc,alpha:!1,value:t.props.textColor||"#000000",onChange:e=>{o.execCommand("textColor",e.target.value),l.setTextColor&&l.setTextColor(e.target.value)}},{type:"divider"},{type:"heading",level:4,text:a.arrowTab},{type:"icons",title:a.arrowIcon,useIconsApi:!0,selectedIcon:h(t.props),iconColor:g(t.props.iconColor),iconSize:24,onChange:e=>{const n=e.detail;if(!n)return;null!=n.category&&null!=n.name&&(o.execCommand("iconCategory",n.category),o.execCommand("iconName",n.name));const r=(null!=n.color?n.color:t.props.iconColor||"000000").toString().replace(/^#/,"");o.execCommand("iconColor",r)}},{type:"colorpicker",title:a.arrowColor,alpha:!1,value:t.props.iconColor?t.props.iconColor.startsWith("#")?t.props.iconColor:"#"+t.props.iconColor:"#000000",onChange:e=>{o.execCommand("iconColor",(0,r.A)(e.target.value).toHex())}},{type:"dropdown",title:a.arrowSide,description:a.arrowSideDesc,value:C(),selected:v(),items:w(),onChange:e=>{let{target:t}=e;return o.execCommand("arrowSide",t.value)}}]:n.text===a.settingsTab?[{type:"input",title:a.width,description:a.widthDesc,value:c.width||"",onInput:e=>{let{target:t}=e;return o.execCommand("style",{width:t.value})}},{type:"input",title:a.maxWidth,description:a.maxWidthDesc,value:c.maxWidth||"",onInput:e=>{let{target:t}=e;return o.execCommand("style",{maxWidth:t.value})}},{type:"option",text:d?a.multipleOpen+a.checkmark:a.singleOpen,description:a.allowMultipleDesc,active:!0,onClick:()=>o.execCommand("allowMultiple",!d)},{type:"colorpicker",title:a.borderColor,alpha:!1,value:t.props.borderColor||"#e6e6e6",onChange:e=>o.execCommand("borderColor",e.target.value)},{type:"divider"},{type:"colorpicker",title:a.globalBackground,description:a.globalBackgroundDesc,alpha:!1,value:t.props.headerStyle&&t.props.headerStyle.backgroundColor||"#ffffff",onChange:e=>l.setGlobalBackground&&l.setGlobalBackground(e.target.value)},{type:"option",text:a.clearBackground,description:a.clearBackgroundDesc,active:!(!t.props.headerStyle||!t.props.headerStyle.backgroundColor),onClick:()=>l.setGlobalBackground&&l.setGlobalBackground("")},{type:"divider"},{type:"heading",level:4,text:a.spacing},{type:"slider",title:a.gap,unit:"px",min:0,max:60,value:parseInt(t.props.gap,10)||0,onInput:e=>{let{target:t}=e;return o.execCommand("gap",`${t.value}px`)}},{type:"slider",title:a.paddingX,unit:"px",min:0,max:60,value:parseInt(t.props.paddingX,10)||(i.some(e=>e.headerStyle&&e.headerStyle.backgroundColor||e.contentStyle&&e.contentStyle.backgroundColor||t.props.headerStyle&&t.props.headerStyle.backgroundColor)?16:4),onInput:e=>{let{target:t}=e;return o.execCommand("paddingX",`${t.value}px`)}},{type:"slider",title:a.paddingY,unit:"px",min:0,max:60,value:parseInt(t.props.paddingY,10)||14,onInput:e=>{let{target:t}=e;return o.execCommand("paddingY",`${t.value}px`)}},{type:"divider"},{type:"heading",level:4,text:a.dividerHeading},{type:"option",text:p?a.showDivider+a.checkmark:a.hideDivider,description:a.showDividerDesc,active:!0,onClick:()=>o.execCommand("showDivider",!p)},{type:"slider",title:a.dividerWidth,unit:"px",min:0,max:10,value:parseInt(t.props.dividerWidth,10)||1,onInput:e=>{let{target:t}=e;return o.execCommand("dividerWidth",`${t.value}px`)}},{type:"dropdown",title:a.dividerStyle,value:t.props.dividerStyle||"solid",selected:t.props.dividerStyle||"solid",items:[{value:"solid"},{value:"dashed"},{value:"dotted"},{value:"double"}],onChange:e=>{let{target:t}=e;return o.execCommand("dividerStyle",t.value)}}]:[...f,{type:"option",text:a.addPanel,icon:"add",description:a.addPanelDesc,onClick:()=>l.addItem&&l.addItem()}]}}}function v(e){let{helpers:t,controller:o}=e;return{set:(e,n,r)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n]||{},r),o.applyStyle(),!0;case"items":return!!Array.isArray(r)&&(e[n]=r,o.reconcile(r),!0);case"headerStyle":case"contentStyle":case"itemStyle":case"gap":case"paddingX":case"paddingY":case"showDivider":case"dividerWidth":case"dividerStyle":case"arrowSide":return e[n]=r,o.applyItemStyles(),!0;case"fontFamily":case"headingFontSize":case"contentFontSize":case"textColor":case"allowMultiple":return e[n]=r,!0;case"borderColor":return e[n]=r,o.applyStyle(),!0;case"iconCategory":case"iconName":case"iconColor":return e[n]=r,o.refreshArrows(),!0;default:return!1}}}}var w=o(84488),C=o.n(w);const x="cdtr-accordion-styles",b=[];let D=!1,S=null;function k(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function A(e,t){if(!e)return;(e.__cdtrAppliedStyleKeys||[]).forEach(t=>e.style.removeProperty(t));const o=[];for(const n in t||{})Object.prototype.hasOwnProperty.call(t,n)&&(e.style.setProperty(k(n),t[n]),o.push(k(n)));e.__cdtrAppliedStyleKeys=o}function E(e){const t=e.iconCategory||"Arrows",o=e.iconName||"arrow-down-s-line",n=function(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length?"000000":t}(e.iconColor);return`${`https://img.creaditor.ai/icons/serve/${encodeURIComponent(t)}/${encodeURIComponent(o)}.png`}?${new URLSearchParams({width:"40",height:"40",color:n}).toString()}`}function F(e){const t=B();return{type:"doc",content:[{type:"paragraph",attrs:{lineHeight:"1.4",direction:t?"rtl":"ltr",textAlign:t?"right":"left"},content:e?[{type:"text",text:String(e)}]:[]}]}}function B(){try{return"en"!==n.M.get("config","language")}catch(e){return!1}}function O(e){if(!e||"string"!=typeof e)return;const t="$%^$%^";if(0===e.replace(/[^\P{L}a-z][^a-z]*/giu,t).indexOf(t))return!0;const o=e.replace(/[0-9]/g,"").replace(/\n/g,"");return/^[\u0590-\u05FF ,.,!,?,/,*,#,@,&,(,)'-]+$/i.test(o)}function I(e){let t="";const o=e=>{e&&("string"==typeof e.text&&(t+=e.text+" "),Array.isArray(e.content)&&e.content.forEach(o))};return e&&Array.isArray(e.content)&&e.content.forEach(o),t}const T={title:"label",content:"description"};function P(e,t){const o=e||{};return function(e){return e&&"object"==typeof e&&e.childNodes?{childNodes:e.childNodes}:{childNodes:F("string"==typeof e?e:"")}}(null!=o[t]?o[t]:o[T[t]])}function N(e){const t=e&&"object"==typeof e?{...e}:{};return delete t.label,delete t.description,{...t,title:P(e,"title"),content:P(e,"content"),isOpen:!(!e||!e.isOpen)}}const z=[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,40,44,48,56,64,72];function M(e){return[{type:"fontFamily",fonts:e||[],useCloud:!0},{type:"fontSize",sizes:z},{type:"bold"},{type:"italic"},{type:"underline"},{type:"fontColor"},{type:"backcolor"},{type:"direction"},{type:"left"},{type:"center"},{type:"right"},{type:"clearFormat"}]}function $(e){return[{type:"fontFamily",fonts:e||[],useCloud:!0},{type:"fontSize",sizes:z},{type:"bold"},{type:"italic"},{type:"underline"},{type:"strike"},{type:"fontColor"},{type:"backcolor"},{type:"bullet"},{type:"numbered"},{type:"link"},{type:"unLink"},{type:"direction"},{type:"left"},{type:"center"},{type:"right"},{type:"clearFormat"}]}const H=()=>{const e="accordion";return{name:e,create:t=>{const{createElement:o,compose:r,helpers:a}=t,i=document.createElement("div");i.classList.add("cdtr-acc-root"),function(e){if(!e||!e.head||e.getElementById(x))return;const t=e.createElement("style");t.id=x,t.textContent='\n.cdtr-acc-root { display: block; }\n.cdtr-acc-item {\n border-bottom: var(--cdtr-acc-border-width, 1px)\n var(--cdtr-acc-border-style, solid) var(--cdtr-acc-border, #e6e6e6);\n}\n/* Adjacent-sibling so the gap never adds a stray margin above the first panel.\n A legacy per-item itemStyle.marginTop is inline and still overrides this. */\n.cdtr-acc-item + .cdtr-acc-item { margin-top: var(--cdtr-acc-gap, 0); }\n.cdtr-acc-header {\n display: flex; align-items: center; justify-content: space-between;\n gap: 12px; cursor: pointer;\n padding: var(--cdtr-acc-pad-y, 14px) var(--cdtr-acc-pad-x, 4px);\n}\n.cdtr-acc-title-host { flex: 1 1 auto; min-width: 0; font-weight: 600; }\n.cdtr-acc-arrow {\n flex: 0 0 auto; width: 20px; height: 20px; user-select: none;\n transition: transform .3s ease; pointer-events: none;\n}\n.cdtr-acc-item.is-open > .cdtr-acc-header .cdtr-acc-arrow { transform: rotate(180deg); }\n/* Order works along the flex main axis, which already follows the item\'s dir,\n so "start" is the left in LTR and the right in RTL. That is what lets one\n rule serve both an explicit side and either reading direction. */\n.cdtr-acc-item.cdtr-acc-arrow-start > .cdtr-acc-header .cdtr-acc-arrow { order: -1; }\n.cdtr-acc-panel {\n display: grid; grid-template-rows: 0fr;\n transition: grid-template-rows .3s ease;\n}\n.cdtr-acc-item.is-open > .cdtr-acc-panel { grid-template-rows: 1fr; }\n.cdtr-acc-panel-inner { overflow: hidden; min-height: 0; }\n.cdtr-acc-content-host {\n padding: 4px var(--cdtr-acc-pad-x, 4px) var(--cdtr-acc-pad-y, 14px);\n}\n',e.head.appendChild(t)}(i.ownerDocument||document);let l=n.M.get("config","target");"string"==typeof l&&(l=document.querySelector(l)),l||(l=document.body);const g=n.M.get("config","editor","configure","editorProps","fonts");let h=[],m=null,y=!1,w=!1,k=null;const F=()=>Array.isArray(r.props.items)?r.props.items:[],T=()=>F().map(e=>N(e)),z=()=>{const e=r.props.style||{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(i.style[t]=e[t]);r.props.borderColor&&i.style.setProperty("--cdtr-acc-border",r.props.borderColor)},H=()=>{const e=F();let t=!1;h.forEach((o,n)=>{const a=s(r.props,e[n]),i=function(e){return d(e.header)||d(e.content)||d(e.item)}(a);i&&(t=!0);const c=function(e){const t=O(I(P(e,"title").childNodes)),o=void 0===t?O(I(P(e,"content").childNodes)):t;return void 0===o?B()?"rtl":"ltr":o?"rtl":"ltr"}(e[n]);o.node.getAttribute("dir")!==c&&o.node.setAttribute("dir",c),o.node.classList.toggle("cdtr-acc-arrow-start",function(e,t){return"left"===e?"ltr"===t:"right"===e&&"rtl"===t}(r.props.arrowSide,c)),A(o.node,{...!0!==r.props.showDivider&&i?{borderBottom:"none"}:{},...a.item||{},direction:c}),A(o.header,a.header),A(o.contentHost,a.content)}),(e=>{const t=r.props,o=(e,t)=>{null==t||""===t?i.style.removeProperty(e):i.style.setProperty(e,t)};o("--cdtr-acc-gap",t.gap),o("--cdtr-acc-pad-y",t.paddingY),o("--cdtr-acc-pad-x",t.paddingX||(e?"16px":"")),o("--cdtr-acc-border-width",!1===t.showDivider?"0":t.dividerWidth),o("--cdtr-acc-border-style",t.dividerStyle)})(t)},W=function(e){let{structural:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};k&&(y=t,k.commands.execCommand("items",e),y=!1)},L=(e,t,o)=>{const n=P(F()[o],t).childNodes,r=C()({element:e,container:l||document.body,editable:!0,offsetTop:40,defaultDirection:B()?"rtl":"ltr",content:n,ignoresBlurByQuerySelectors:[".ignore-events"],builder:"title"===t?M(g):$(g),onFocus:()=>{if(!D||S===r||null===S){if(D=!0,S=r,m={index:o,field:t},b.length>0)for(b.forEach(e=>{e!==r&&e.hideEditor()});b.length>0;)b.pop();b.push(r),setTimeout(()=>{S===r&&D&&r.showEditor()},100)}},onBlur:()=>{m&&m.index===o&&m.field===t&&(m=null),S===r&&(S=null),setTimeout(()=>{S!==r&&(D=!1)},150)},onUpdate:e=>{let{editor:n,transaction:r}=e;if(0===r.steps.length||w)return;m={index:o,field:t};const a=T();a[o]&&(a[o][t]={childNodes:n.getJSON()},W(a))}});return r},R=e=>{const t=F()[e],o=document.createElement("div");o.className="cdtr-acc-item",t&&t.isOpen&&o.classList.add("is-open");const n=document.createElement("div");n.className="cdtr-acc-header";const a=document.createElement("div");a.className="cdtr-acc-title-host";const i=document.createElement("img");i.className="cdtr-acc-arrow",i.alt="",i.setAttribute("draggable","false"),i.src=E(r.props),n.append(a,i);const c=document.createElement("div");c.className="cdtr-acc-panel";const l=document.createElement("div");l.className="cdtr-acc-panel-inner";const d=document.createElement("div");return d.className="cdtr-acc-content-host",l.appendChild(d),c.appendChild(l),o.append(n,c),n.addEventListener("click",t=>{a.contains(t.target)||function(e){const t=!1!==r.props.allowMultiple,o=T();if(!o[e])return;const n=!o[e].isOpen;o.forEach((o,r)=>{o.isOpen=t?r===e?n:o.isOpen:r===e&&n}),h.forEach((e,t)=>{e.node&&e.node.classList.toggle("is-open",!!o[t].isOpen)}),W(o,{structural:!0})}(e)}),{itemNode:o,header:n,arrow:i,titleHost:a,panelInner:l,contentHost:d}},U=()=>{h.forEach(e=>{try{e.title&&e.title.hideEditor&&e.title.hideEditor(),e.content&&e.content.hideEditor&&e.content.hideEditor()}catch(e){}}),h=[]},j=()=>{U(),i.innerHTML="",F().forEach((e,t)=>{const{itemNode:o,header:n,arrow:r,titleHost:a,panelInner:c,contentHost:l}=R(t);i.appendChild(o);const d=L(a,"title",t);a.parentElement!==n&&n.insertBefore(a,r);const s=L(l,"content",t);l.parentElement!==c&&c.appendChild(l),h.push({title:d,content:s,node:o,header:n,contentHost:l})}),H()};const X=e=>t=>{const o=e&&e.ownerDocument||document,n=o.defaultView||window,r=o.createElement("span");r.style.cssText="display:none",r.style.color=t,(e||o.body).appendChild(r);const a=n.getComputedStyle(r).color;return r.remove(),a||""},Y=e=>{if(!e)return"";return((e.ownerDocument||document).defaultView||window).getComputedStyle(e).color||""},G=(e,t)=>{if(!h.length)return;w=!0;try{h.forEach(o=>{e.forEach(e=>{const n=o[e];if(n)try{n.chain().setMeta("addToHistory",!1).selectAll().setMark("textStyle",t).run()}catch(e){}})})}finally{w=!1}m=null;const o=T();h.forEach((t,n)=>{o[n]&&e.forEach(e=>{const r=t[e];r&&(o[n][e]={childNodes:r.getJSON()})})}),W(o,{structural:!0})},J=["title","content"],_={reconcile:e=>{!y&&Array.isArray(e)&&(e.length===h.length?(e.forEach((e,t)=>{["title","content"].forEach(o=>{const n=h[t]&&h[t][o],r=P(e,o).childNodes;if(n&&r&&(!m||m.index!==t||m.field!==o))try{JSON.stringify(n.getJSON())!==JSON.stringify(r)&&n.chain().setContent(r).run()}catch(e){}});const o=h[t]&&h[t].node;o&&o.classList.toggle("is-open",!!e.isOpen)}),H()):j())},applyStyle:z,refreshArrows:()=>{const e=E(r.props);h.forEach(t=>{const o=t.node&&t.node.querySelector(".cdtr-acc-arrow");o&&(o.src=e)})},applyItemStyles:H};return j(),z(),k=o({name:e,id:r.id,template:i,defaultProps:{style:{},items:[],allowMultiple:!0,iconCategory:"Arrows",iconName:"arrow-down-s-line",iconColor:"000000"},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>i,handleBar:!0,validator:v({helpers:a,controller:_}),schema:r.schema,onSelect:e=>i.classList.add(e),onDeselect:e=>i.classList.remove(e),elementProps:r,remove:()=>{U(),i.remove()},createEditor:f}),k.addProp("accordion",{addItem:()=>{const e=T(),t=e.length+1,o=B();e.push(N({title:o?`כותרת ${t}`:`Accordion title ${t}`,content:o?`תוכן הסעיף ${t}`:`Accordion content ${t}`})),W(e,{structural:!0}),j()},removeItem:e=>{const t=T();e<0||e>=t.length||(t.splice(e,1),W(t,{structural:!0}),j())},moveItem:(e,t)=>{const o=T();if(t<0||t>=o.length||e<0||e>=o.length)return;const[n]=o.splice(e,1);o.splice(t,0,n),W(o,{structural:!0}),j()},setDefaultOpen:(e,t)=>{const o=T();o[e]&&(o[e].isOpen=!!t,t&&!1===r.props.allowMultiple&&o.forEach((t,o)=>{o!==e&&(t.isOpen=!1)}),h.forEach((e,t)=>{e.node&&e.node.classList.toggle("is-open",!!o[t].isOpen)}),W(o,{structural:!0}))},setPanelBackground:(e,t)=>{const o=T();if(!o[e])return;const n=h[e]&&h[e].node||i;o[e]=p(o[e],t,u(t,Y(n),X(n))),W(o,{structural:!0}),H()},setGlobalBackground:e=>{if(!k)return;const t=p(r.props,e,u(e,Y(i),X(i)));[...c,"itemStyle"].forEach(e=>{k.commands.execCommand(e,t[e]||{})}),H()},setFontFamily:e=>G(J,{fontFamily:e}),setHeadingFontSize:e=>G(["title"],{fontSize:`${e}px`}),setContentFontSize:e=>G(["content"],{fontSize:`${e}px`}),setTextColor:e=>G(J,{color:e})}),k}}}}}]);
Binary file