1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
|
"use strict";exports.id=9732,exports.ids=[9732],exports.modules={81897:(e,t,a)=>{a.d(t,{A:()=>_});var l=a(8732),r=a(82015),s=a.n(r),d=a(32415),i=a(93669),n=a(40373),o=a(1976),c=a.n(o);function u({editor:e,rootElement:t}){return(0,l.jsx)("div",{className:"embed-popup-form-content-wrapper text-sm mt-2 flex-wrap bg-white p-10 rounded max-w-2xl w-full",children:(0,l.jsxs)("form",{onSubmit:a=>{a.preventDefault();let l=a.target["embed-text-area"].value;if(!l?.match(/./))return alert("Please Enter HTML Text to continue.");e.insertContent(l),document.body.removeChild(t)},className:"w-full flex flex-col items-stretch gap-2",children:[(0,l.jsx)("h3",{className:"m-0 text-center text-lg",children:"Enter HTML code"}),(0,l.jsx)("textarea",{name:"embed-text-area",id:"embed-text-area",cols:30,rows:10,placeholder:"Paste Code here ..."}),(0,l.jsx)("button",{type:"submit",children:"Embed"})]})})}function m({editor:e}){navigator.clipboard.writeText(e?.getContent()||"").then(()=>{alert("Html Copied to Clipboard!")})}var p=a(58150);function f({editor:e,rootElement:t}){e.getContent();let a=s().useRef(),r=s().useRef(),[d,i]=s().useState(null);return(0,l.jsxs)("div",{onKeyUp:e=>{e.ctrlKey&&"Enter"==e.key&&r.current?.click()},children:[(0,l.jsx)("div",{className:"embed-popup-form-content-wrapper relative flex flex-col items-center justify-center",children:(0,l.jsxs)("div",{className:"max-w-[1200px] rounded-md overflow-hidden bg-white w-[90vw] items-start justify-start relative",children:[(0,l.jsx)("div",{ref:a,className:"w-full h-[80vh] text-[18px]"}),(0,l.jsx)("button",{className:"absolute bottom-4 right-4",onClick:a=>{if(d){let a=d.getValue();e.setContent(a),setTimeout(()=>{document.body.removeChild(t)},200)}},ref:r,children:"Save"})]})}),(0,l.jsx)("button",{className:"absolute top-4 right-8 rounded-full white",onClick:()=>{try{document.body.removeChild(t)}catch(e){}},style:{width:"40px",height:"40px",padding:"0",zIndex:"12039800000"},children:(0,l.jsx)(p.A,{})})]})}function x({editor:e}){let t=document.createElement("div");t.style.position="fixed",t.style.width="100vw",t.style.height="100vh",t.style.zIndex="123000000000000000",t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.top="0",t.style.left="0",document.body.append(t),t.onclick=e=>{e.target.closest(".embed-popup-form-content-wrapper")||document.body.removeChild(t)},e&&c().createRoot(t).render((0,l.jsx)(f,{editor:e,rootElement:t}))}function h({editor:e}){let t=document.createElement("div");t.style.position="fixed",t.style.width="100vw",t.style.height="100vh",t.style.zIndex="123000000000000000",t.style.backgroundColor="rgba(0,0,0,0.8)",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.top="0",t.style.left="0",document.body.append(t),t.onclick=e=>{if(e.target.closest(".embed-popup-form-content-wrapper")){console.log("Still In Form");return}document.body.removeChild(t)},e&&c().createRoot(t).render((0,l.jsx)(u,{editor:e,rootElement:t}))}function y({fieldObject:e,dataTypeSchema:t,richTextEditors:a,entry:r,currentRichTextEditorForms:o,entryPage:c,formButtonId:u}){let[p,f]=s().useState(!1),y=s().useRef(),b=s().useRef();return(0,l.jsxs)("div",{className:"flex flex-col items-start gap-0 w-full rich-text-editor-wrapper",children:[(0,l.jsxs)("label",{className:"font-bold text-slate-700 dark:text-slate-300 text-base px-3 py-1 bg-slate-100 dark:bg-slate-700 rounded-t-md border border-solid border-slate-300 dark:border-slate-300/20 flex items-center gap-2",htmlFor:e.fieldName,children:[e.encrypted&&(0,l.jsx)(i.A,{fontSize:"small",className:"opacity-50"}),(0,l.jsx)("span",{children:e.fieldName})]}),(0,l.jsxs)("div",{ref:y,id:e.fieldName,className:"w-full p-0 sm:p-4 flex-col items-stretch bg-slate-100 relative dark:bg-slate-700 border border-solid border-slate-300 dark:border-slate-300/20",style:{borderRadius:"0 5px 5px 5px",marginTop:"-1px"},children:[!p&&(0,l.jsx)(d.A,{}),p&&(0,l.jsx)(s().Fragment,{children:(0,l.jsx)(n.Editor,{tinymceScriptSrc:"/tinymce/tinymce.min.js",onInit:(e,
|