@enerex/template-studio 1.1.36 → 1.1.37
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.
|
@@ -585,7 +585,7 @@ const z = `<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:
|
|
|
585
585
|
className: a = "",
|
|
586
586
|
...c
|
|
587
587
|
}) => /* @__PURE__ */ $(H.Group, { className: a + " mb-1", children: [
|
|
588
|
-
t ? /* @__PURE__ */ $(H.Label, { className: "mb-3 d-block form-label", children: [
|
|
588
|
+
t ? /* @__PURE__ */ $(H.Label, { className: "mb-3 d-block form-label ts-label-height", children: [
|
|
589
589
|
t,
|
|
590
590
|
i && /* @__PURE__ */ l("label", { className: "text-danger", children: "*" })
|
|
591
591
|
] }) : null,
|
|
@@ -822,7 +822,7 @@ const he = /* @__PURE__ */ et(nt), be = (t) => t.data.isSeparator ? /* @__PURE__
|
|
|
822
822
|
error: r,
|
|
823
823
|
...e
|
|
824
824
|
}) => /* @__PURE__ */ $(H.Group, { className: "mb-1", children: [
|
|
825
|
-
t && /* @__PURE__ */ $(H.Label, { className: "mb-3 d-block form-label", children: [
|
|
825
|
+
t && /* @__PURE__ */ $(H.Label, { className: "mb-3 d-block form-label ts-label-height", children: [
|
|
826
826
|
t,
|
|
827
827
|
" ",
|
|
828
828
|
e.required && /* @__PURE__ */ l("span", { className: "text-danger", children: "*" })
|
|
@@ -354,8 +354,8 @@
|
|
|
354
354
|
</div>\r
|
|
355
355
|
</body>\r
|
|
356
356
|
</html>\r
|
|
357
|
-
`,oe=d.createContext(void 0),be=({children:t,configs:l})=>{const[a,i]=d.useState(l.clientId),[s,e]=d.useState(l.apiKey),[o,p]=d.useState(l.enerexIdentifier),[v,g]=d.useState(l.projectId),[E,h]=d.useState(l.userEmail),[A,D]=d.useState(l.isAdmin),[C,b]=d.useState(l.meBaseUrl),[T,f]=d.useState(l.defaultSelector),u=w=>{e(w.apiKey),i(w.clientId),g(w.projectId),p(w.enerexIdentifier),h(w.userEmail),D(w.isAdmin),f(w.defaultSelector),b(w.meBaseUrl)};return n.jsx(oe.Provider,{value:{clientId:a,apiKey:s,setConfiguration:u,enerexIdentifier:o,projectId:v,userEmail:E,isAdmin:A,defaultSelector:T,meBaseUrl:C},children:t})},P=()=>{const t=d.useContext(oe);if(!t)throw new Error("widgetConfig must be used within a ConfigProvider");return t},ae=(t="",l)=>({get:async(s,e)=>{try{const o=await le.get(`${t}${s}`,e??l);if(o.status===200)return o.data}catch(o){throw o}},post:async(s,e,o)=>{try{const p=await le.post(`${t}${s}`,e,o??l);if(p.status===200)return p.data}catch(p){throw p}}}),de=d.createContext({get:()=>{throw new Error("HttpClientContext.get not implemented")},post:()=>{throw new Error("HttpClientContext.post not implemented")}}),Te=({children:t})=>{const{clientId:l,apiKey:a,isAdmin:i,meBaseUrl:s}=P(),e={headers:{client_id:l,"x-api-key":a,"Security-Context":i?"admin":"viewer"}},{get:o,post:p}=ae(s,e);return n.jsx(de.Provider,{value:{get:o,post:p},children:t})},we=({children:t})=>{const l=new O.QueryClient;return n.jsx(Te,{children:n.jsx(O.QueryClientProvider,{client:l,children:t})})},J={EDITOR_SCRIPT_URL:"https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",EDITOR_PLUGIN_ID:"1afdc3161ec7409a8627a1c8561d45f5",EDITOR_SECRET_KEY:"54ba748ed7e94f2e929555783acb03da"},ve=t=>{const l=Array.from(new Set(t.map(i=>i.category))),a=[];return l.forEach(i=>{const s=t.filter(e=>e.category===i).map(e=>({label:e.label,value:e.value,hint:e.hint,hidden:e.hidden}));a.push({category:i,entries:s})}),a},H=()=>{const t=d.useContext(de);if(t)return t;throw new Error("useHttpClient must be used within a HttpClientProvider")},G={Template_list:"/Template/list/",Template:"/Template/GetTemplate/",MergeTags:"/Template/TemplateMergeTags/",ExcludeCategory:"/Template/GetExcludeCategories/",SaveTemplate:"/Template/save-update/",TemplateTypes:"/Template/TemplateTypes/"},Se=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplateTags"],queryFn:async s=>await t.get(`${G.MergeTags}${a}/${l}`)})},xe=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getExcludeCategory"],queryFn:async s=>await t.get(`${G.ExcludeCategory}${a}/${l}`)})},Ee=({templateHTML:t,className:l="",loading:a=!1,onEditorInitialized:i})=>{const{post:s}=ae(),{data:e}=Se(),{data:o}=xe(),[p,v]=d.useState(t??{html:B,css:""}),{userEmail:g}=P(),E=d.useRef(null),h="https://plugin.stripocdn.email/content/guids/CABINET_eab4e7d5a4603ac03f4120652a3a5a540f0c79c688514939f095f67433ed4a67/images/photo256.png",A="https://plugins.stripo.email/api/v1/auth";d.useEffect(()=>{(async()=>(await D(),e&&o&&await C(J.EDITOR_SCRIPT_URL)))()},[e,o]);async function D(){window.Zone||await new Promise((T,f)=>{const u=document.createElement("script");u.src="https://unpkg.com/zone.js@0.13.1/bundles/zone.umd.min.js";const w=document.querySelector("script[nonce]")?.nonce;w&&u.setAttribute("nonce",w),u.onload=()=>T(),u.onerror=()=>f(new Error("Failed to load zone.js")),document.head.appendChild(u)})}async function C(T){let f=document.getElementById("UiEditorScript");f||(f=document.createElement("script"),f.id="UiEditorScript",f.src=T,f.onload=async()=>{await b()},document.body.appendChild(f)),await new Promise(u=>f.addEventListener("load",()=>u(),{once:!0}))}const b=async()=>{const T=E.current;if(!T){console.error("Missing #stripoEditorContainer in DOM");return}if(!window.UIEditor||typeof window.UIEditor.initEditor!="function"){console.error("UIEditor script not loaded or not exposing initEditor");return}const f={html:p.html,css:p.css,modulesExcludedCategories:o??[],forceRecreate:!0,metadata:{emailId:g,userId:"1",avatarUrl:h},locale:"en",onTokenRefreshRequest:async u=>{const w={pluginId:J.EDITOR_PLUGIN_ID,secretKey:J.EDITOR_SECRET_KEY,userId:g,role:"user"},M=await s(A,w);M?.token&&u(M.token)},onTemplateLoaded:()=>{i&&i(!0)},mergeTags:ve(e??[])};for(const[u,w]of Object.entries({codeEditorButtonSelector:"#codeEditor",undoButtonSelector:"#undoButton",redoButtonSelector:"#redoButton",mobileViewButtonSelector:"#mobileViewButton",desktopViewButtonSelector:"#desktopViewButton"}))T.ownerDocument&&T.getRootNode()instanceof ShadowRoot&&T.getRootNode().querySelector(w)&&(f[u]=w);await window.UIEditor.initEditor(T,f)};return n.jsx("div",{className:"position-relative",children:n.jsxs("div",{className:`editor-container ${l}`,children:[a&&n.jsx("div",{className:"loading-overlay",children:n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})})}),n.jsx("div",{id:"externalSystemContainer"}),n.jsx("div",{id:"stripoEditorContainer",ref:E})]})})},ce=({label:t,register:l,validation:a,required:i=!1,name:s,error:e,className:o="",...p})=>n.jsxs(y.Form.Group,{className:o+" mb-1",children:[t?n.jsxs(y.Form.Label,{className:"mb-3 d-block form-label",children:[t,i&&n.jsx("label",{className:"text-danger",children:"*"})]}):null,n.jsx(y.Form.Control,{name:s,type:"text",...p,isInvalid:!!(e&&e[s]),...l?l(s,{...a}):{},className:`react-select__control ${e&&e[s]&&"border border-danger"}`}),e&&e[s]?n.jsx(y.Form.Control.Feedback,{type:"invalid",children:e[s].message}):null]}),Ce=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplatesList"],queryFn:async s=>await t.get(`${G.Template_list}${a}/${l}`)})};function X(t){return t.sort((l,a)=>l.name.localeCompare(a.name))}function Ie(t){const l=new Map,a=[];t.forEach(e=>l.set(e.id,e));let i=t.filter(e=>e.parent_id===0),s=0;for(;i.length>0;){a.push({level:s,data:i});const e=i.map(p=>p.id);i=t.filter(p=>e.includes(p.parent_id)),s++}return a}function Z(t,l){const i=Ie(t).find(s=>s.level===l);return i?i.data:[]}const Ne=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useMutation({mutationKey:["getTemplate"],mutationFn:async({id:s})=>{if(s)return await t.get(`${G.Template}${l}/${s}/${a}`)}})},_e=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplateTypes"],queryFn:async s=>await t.get(`${G.TemplateTypes}${l}/${a}`)})};function Ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Q={exports:{}};/*!
|
|
357
|
+
`,oe=d.createContext(void 0),be=({children:t,configs:l})=>{const[a,i]=d.useState(l.clientId),[s,e]=d.useState(l.apiKey),[o,p]=d.useState(l.enerexIdentifier),[v,g]=d.useState(l.projectId),[E,h]=d.useState(l.userEmail),[A,D]=d.useState(l.isAdmin),[C,b]=d.useState(l.meBaseUrl),[T,f]=d.useState(l.defaultSelector),u=w=>{e(w.apiKey),i(w.clientId),g(w.projectId),p(w.enerexIdentifier),h(w.userEmail),D(w.isAdmin),f(w.defaultSelector),b(w.meBaseUrl)};return n.jsx(oe.Provider,{value:{clientId:a,apiKey:s,setConfiguration:u,enerexIdentifier:o,projectId:v,userEmail:E,isAdmin:A,defaultSelector:T,meBaseUrl:C},children:t})},P=()=>{const t=d.useContext(oe);if(!t)throw new Error("widgetConfig must be used within a ConfigProvider");return t},ae=(t="",l)=>({get:async(s,e)=>{try{const o=await le.get(`${t}${s}`,e??l);if(o.status===200)return o.data}catch(o){throw o}},post:async(s,e,o)=>{try{const p=await le.post(`${t}${s}`,e,o??l);if(p.status===200)return p.data}catch(p){throw p}}}),de=d.createContext({get:()=>{throw new Error("HttpClientContext.get not implemented")},post:()=>{throw new Error("HttpClientContext.post not implemented")}}),Te=({children:t})=>{const{clientId:l,apiKey:a,isAdmin:i,meBaseUrl:s}=P(),e={headers:{client_id:l,"x-api-key":a,"Security-Context":i?"admin":"viewer"}},{get:o,post:p}=ae(s,e);return n.jsx(de.Provider,{value:{get:o,post:p},children:t})},we=({children:t})=>{const l=new O.QueryClient;return n.jsx(Te,{children:n.jsx(O.QueryClientProvider,{client:l,children:t})})},J={EDITOR_SCRIPT_URL:"https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",EDITOR_PLUGIN_ID:"1afdc3161ec7409a8627a1c8561d45f5",EDITOR_SECRET_KEY:"54ba748ed7e94f2e929555783acb03da"},ve=t=>{const l=Array.from(new Set(t.map(i=>i.category))),a=[];return l.forEach(i=>{const s=t.filter(e=>e.category===i).map(e=>({label:e.label,value:e.value,hint:e.hint,hidden:e.hidden}));a.push({category:i,entries:s})}),a},H=()=>{const t=d.useContext(de);if(t)return t;throw new Error("useHttpClient must be used within a HttpClientProvider")},G={Template_list:"/Template/list/",Template:"/Template/GetTemplate/",MergeTags:"/Template/TemplateMergeTags/",ExcludeCategory:"/Template/GetExcludeCategories/",SaveTemplate:"/Template/save-update/",TemplateTypes:"/Template/TemplateTypes/"},Se=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplateTags"],queryFn:async s=>await t.get(`${G.MergeTags}${a}/${l}`)})},xe=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getExcludeCategory"],queryFn:async s=>await t.get(`${G.ExcludeCategory}${a}/${l}`)})},Ee=({templateHTML:t,className:l="",loading:a=!1,onEditorInitialized:i})=>{const{post:s}=ae(),{data:e}=Se(),{data:o}=xe(),[p,v]=d.useState(t??{html:B,css:""}),{userEmail:g}=P(),E=d.useRef(null),h="https://plugin.stripocdn.email/content/guids/CABINET_eab4e7d5a4603ac03f4120652a3a5a540f0c79c688514939f095f67433ed4a67/images/photo256.png",A="https://plugins.stripo.email/api/v1/auth";d.useEffect(()=>{(async()=>(await D(),e&&o&&await C(J.EDITOR_SCRIPT_URL)))()},[e,o]);async function D(){window.Zone||await new Promise((T,f)=>{const u=document.createElement("script");u.src="https://unpkg.com/zone.js@0.13.1/bundles/zone.umd.min.js";const w=document.querySelector("script[nonce]")?.nonce;w&&u.setAttribute("nonce",w),u.onload=()=>T(),u.onerror=()=>f(new Error("Failed to load zone.js")),document.head.appendChild(u)})}async function C(T){let f=document.getElementById("UiEditorScript");f||(f=document.createElement("script"),f.id="UiEditorScript",f.src=T,f.onload=async()=>{await b()},document.body.appendChild(f)),await new Promise(u=>f.addEventListener("load",()=>u(),{once:!0}))}const b=async()=>{const T=E.current;if(!T){console.error("Missing #stripoEditorContainer in DOM");return}if(!window.UIEditor||typeof window.UIEditor.initEditor!="function"){console.error("UIEditor script not loaded or not exposing initEditor");return}const f={html:p.html,css:p.css,modulesExcludedCategories:o??[],forceRecreate:!0,metadata:{emailId:g,userId:"1",avatarUrl:h},locale:"en",onTokenRefreshRequest:async u=>{const w={pluginId:J.EDITOR_PLUGIN_ID,secretKey:J.EDITOR_SECRET_KEY,userId:g,role:"user"},M=await s(A,w);M?.token&&u(M.token)},onTemplateLoaded:()=>{i&&i(!0)},mergeTags:ve(e??[])};for(const[u,w]of Object.entries({codeEditorButtonSelector:"#codeEditor",undoButtonSelector:"#undoButton",redoButtonSelector:"#redoButton",mobileViewButtonSelector:"#mobileViewButton",desktopViewButtonSelector:"#desktopViewButton"}))T.ownerDocument&&T.getRootNode()instanceof ShadowRoot&&T.getRootNode().querySelector(w)&&(f[u]=w);await window.UIEditor.initEditor(T,f)};return n.jsx("div",{className:"position-relative",children:n.jsxs("div",{className:`editor-container ${l}`,children:[a&&n.jsx("div",{className:"loading-overlay",children:n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})})}),n.jsx("div",{id:"externalSystemContainer"}),n.jsx("div",{id:"stripoEditorContainer",ref:E})]})})},ce=({label:t,register:l,validation:a,required:i=!1,name:s,error:e,className:o="",...p})=>n.jsxs(y.Form.Group,{className:o+" mb-1",children:[t?n.jsxs(y.Form.Label,{className:"mb-3 d-block form-label ts-label-height",children:[t,i&&n.jsx("label",{className:"text-danger",children:"*"})]}):null,n.jsx(y.Form.Control,{name:s,type:"text",...p,isInvalid:!!(e&&e[s]),...l?l(s,{...a}):{},className:`react-select__control ${e&&e[s]&&"border border-danger"}`}),e&&e[s]?n.jsx(y.Form.Control.Feedback,{type:"invalid",children:e[s].message}):null]}),Ce=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplatesList"],queryFn:async s=>await t.get(`${G.Template_list}${a}/${l}`)})};function X(t){return t.sort((l,a)=>l.name.localeCompare(a.name))}function Ie(t){const l=new Map,a=[];t.forEach(e=>l.set(e.id,e));let i=t.filter(e=>e.parent_id===0),s=0;for(;i.length>0;){a.push({level:s,data:i});const e=i.map(p=>p.id);i=t.filter(p=>e.includes(p.parent_id)),s++}return a}function Z(t,l){const i=Ie(t).find(s=>s.level===l);return i?i.data:[]}const Ne=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useMutation({mutationKey:["getTemplate"],mutationFn:async({id:s})=>{if(s)return await t.get(`${G.Template}${l}/${s}/${a}`)}})},_e=()=>{const t=H(),{enerexIdentifier:l,projectId:a}=P();return O.useQuery({queryKey:["getTemplateTypes"],queryFn:async s=>await t.get(`${G.TemplateTypes}${l}/${a}`)})};function Ae(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Q={exports:{}};/*!
|
|
358
358
|
Copyright (c) 2018 Jed Watson.
|
|
359
359
|
Licensed under the MIT License (MIT), see
|
|
360
360
|
http://jedwatson.github.io/classnames
|
|
361
|
-
*/var pe;function qe(){return pe||(pe=1,function(t){(function(){var l={}.hasOwnProperty;function a(){for(var e="",o=0;o<arguments.length;o++){var p=arguments[o];p&&(e=s(e,i(p)))}return e}function i(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var p in e)l.call(e,p)&&e[p]&&(o=s(o,p));return o}function s(e,o){return o?e?e+" "+o:e+o:e}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(Q)),Q.exports}var je=qe();const me=Ae(je),ue=t=>t.data.isSeparator?n.jsx("div",{style:{padding:0,margin:"2px 0"},children:n.jsx("hr",{style:{border:0,borderTop:"1px solid #bdbdbdff",padding:0,margin:0}})}):n.jsx(z.components.Option,{...t}),Le=({name:t="",control:l,options:a,multiple:i=!1,placeholder:s,validation:e,labelKey:o="name",disabled:p,isInvalid:v,value:g,onChange:E,uncontrolled:h,menuPlacement:A="auto",closeOnSelect:D=!0})=>{const C={control:b=>({...b,minHeight:"33px",borderColor:v?"var(--bs-form-invalid-border-color) !important":"var(--ct-input-border-color)",backgroundImage:v?'url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23fa5c7c%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23fa5c7c%27 stroke=%27none%27/%3e%3c/svg%3e")':"none",backgroundRepeat:"no-repeat",backgroundPosition:"right calc(0.375em + 0.225rem) center",backgroundSize:"calc(0.75em + 0.45rem) calc(0.75em + 0.45rem)","&:hover":{borderColor:v?"var(--bs-form-invalid-border-color)":"var(--ct-input-border-color)"},"& .react-select__single-value":{color:"var(--ct-input-color) !important"},"& .react-select__placeholder":{color:"var(--ct-input-placeholder-color) !important"},"& .react-select__indicators":{display:"none"}}),menu:b=>({...b,marginTop:0,width:"max-content",minWidth:"100%"}),menuPortal:b=>({...b,zIndex:9999}),multiValueRemove:b=>({...b,display:p?"none":"block"})};return h?n.jsx(z,{components:{Option:ue},isOptionDisabled:b=>!!b.isSeparator,className:me({"is-invalid":v}),styles:C,classNamePrefix:"react-select",isMulti:i,options:a,onChange:E,placeholder:s,menuPortalTarget:document.body,value:g,getOptionLabel:typeof o=="string"?b=>b[o]:o,getOptionValue:b=>b.id,isDisabled:p,menuPlacement:A,closeMenuOnSelect:D}):n.jsx(ie.Controller,{control:l,name:t,rules:e,render:({field:{onChange:b,value:T,onBlur:f}})=>n.jsx(z,{components:{Option:ue},isOptionDisabled:u=>!!u.isSeparator,className:me({"is-invalid":v}),styles:C,classNamePrefix:"react-select",isMulti:i,options:a,onBlur:f,onChange:b,placeholder:s,menuPortalTarget:document.body,value:T,getOptionLabel:typeof o=="string"?u=>u[o]:o,getOptionValue:u=>u.id,isDisabled:p,menuPlacement:A,closeMenuOnSelect:D},T?JSON.stringify(T):"reset")})},W=({label:t,name:l,validation:a,control:i,error:s,...e})=>n.jsxs(y.Form.Group,{className:"mb-1",children:[t&&n.jsxs(y.Form.Label,{className:"mb-3 d-block form-label",children:[t," ",e.required&&n.jsx("span",{className:"text-danger",children:"*"})]}),n.jsx(Le,{control:i,disabled:e.disabled,options:e.options??[],validation:a,isInvalid:s&&!!s[l],name:l}),s&&s[l]?n.jsx(y.Form.Control.Feedback,{type:"invalid",children:s[l].message}):null]}),Oe=()=>{const t=H();O.useQueryClient();const{enerexIdentifier:l,projectId:a}=P();return O.useMutation({mutationKey:["saveTemplate"],mutationFn:async s=>(s.enerexIdentifier=l??"",s.projectId=a??"",await t.post(`${G.SaveTemplate}`,s))})},K={id:"",name:"New (Blank)"},fe={id:"",name:"Separator",isSeparator:!0},Pe=({onSelectItem:t,templateLoading:l,onReset:a,editorInitialized:i})=>{const{isAdmin:s,defaultSelector:e}=P(),{register:o,handleSubmit:p,clearErrors:v,setValue:g,control:E,watch:h,reset:A,setError:D,formState:{errors:C}}=ie.useForm({defaultValues:{templateName:"",subTemplateType:void 0,subTemplateType2:void 0,subject:"",templateType:void 0,template:K},mode:"onChange"}),{data:b,refetch:T,isLoading:f}=Ce(),[u,w]=d.useState([]),[M,ke]=d.useState(!1),[U,R]=d.useState(),[Y,V]=d.useState(),{mutateAsync:ee,isPending:I}=Ne(),{mutateAsync:ye,isPending:N}=Oe(),{data:F,isLoading:k}=_e(),[te,$e]=d.useState([]),[j,ne]=d.useState([]),[L,re]=d.useState([]);d.useEffect(()=>{if(F){let r=F.filter(m=>m.id!=null),c=Z(r,0);$e(X(c))}},[F]);const Me=(r,c)=>{let m=[];return r.forEach((_,S)=>{c.includes(S)&&S!==0&&m.push(fe),m.push(_)}),m};d.useEffect(()=>{l(!!(f||I||N||k||!i))},[f,I,N,k,i]),d.useEffect(()=>{b?.sort((r,c)=>r.readonly!==c.readonly?(r.readonly?0:1)-(c.readonly?0:1):r.name.localeCompare(c.name)),w(b??[])},[b]);const Ue=async r=>{R(r),r&&(s||!r.readonly)?(g("templateName",r?.name),v()):(g("templateName",""),g("subject",""));const c=await ee({id:r?.id});V(c||void 0)};d.useEffect(()=>{if((e===void 0||e.templateId===void 0||M)&&g("template",K),h("templateType")){let r=F?.filter(m=>m.id!==void 0)??[],c=Z(r,1);ne(X(c.filter(m=>m.parent_id.toString()===`${h("templateType")?.id}`))),g("subTemplateType",void 0),g("subTemplateType2",void 0)}},[h("templateType")]),d.useEffect(()=>{if((e===void 0||e.templateId===void 0)&&g("template",K),h("subTemplateType")){let r=F?.filter(m=>m.id!==void 0)??[],c=Z(r,2);re(X(c.filter(m=>m.parent_id.toString()===`${h("subTemplateType")?.id}`))),g("subTemplateType2",void 0)}},[h("subTemplateType")]),d.useEffect(()=>{const r=he();r.length>0&&r[0].id!==""?(e===void 0||e.templateId===void 0||M)&&g("template",r[0]):(e===void 0||e.templateId===void 0||M)&&g("template",K)},[h("subTemplateType2")]),d.useEffect(()=>{let r=u.find(c=>c.id===h("template")?.id);Ue(r)},[h("template")]);const[Fe,ge]=d.useState(!1);d.useEffect(()=>{Fe||(Y&&U&&i?(ge(!0),t(Y),g("subject",Y.subject??""),setTimeout(()=>{ge(!1)},1e3)):t(void 0))},[Y,U,t,i]);const he=()=>{let r=[K],c="templateType";L.length>0?c="subTemplateType2":j.length>0&&(c="subTemplateType");let m=u.filter(S=>(S.type?.toString()===h(c)?.id.toString()||S.type===null)&&h(c)?.id!=null),_=Me(m,[m.findIndex(S=>!S.readonly)]);return _.length>0&&(_[0].readonly===!0&&!s?r=[]:r.push(fe),r=[...r,..._.map(q=>({id:q.id,name:He(m,q.id),isSeparator:q.isSeparator}))]),r.length?r:[]};d.useEffect(()=>{if(e&&e.type1){const r=te?.find(c=>`${c.id}`===e.type1);g("templateType",r)}},[F,te]),d.useEffect(()=>{if(e&&e.type2){const r=j?.find(c=>`${c.id}`===e.type2);g("subTemplateType",r)}},[F,j]),d.useEffect(()=>{if(e&&e.type3){const r=L?.find(c=>`${c.id}`===e.type3);g("subTemplateType2",r)}},[F,L]),d.useEffect(()=>{if(e&&e.templateId&&u&&u.length>0&&!M&&i){const r=u?.find(c=>`${c.id}`===e.templateId);ke(!0),r&&(R(r),g("template",r))}},[u,i]);const He=(r,c)=>{let m=r.find(_=>_.id===c);return m?`${m.displayName}`:""},Ge=r=>{window.StripoEditorApi.actionsApi.getTemplateData(async c=>{let m=r.template.id,_="";U?.readonly&&(m="",_=r.template.id);let S=u.find($=>$.name===r.templateName.trim());if(S&&S.id!==m){D("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let q=r.templateType.id;L&&L.length>0?q=r.subTemplateType2.id:j&&j.length>0&&(q=r.subTemplateType.id);const se={enerexIdentifier:"",projectId:"",templateId:m,templateType:q,name:r.templateName.trim(),html:c.html,css:c.css,subject:r.templateType.id==="2"?r?.subject??"":"",parent_id:_};if(await ye(se)){if(v(),U?.readonly&&!s)A(),ne([]),re([]);else{const $=await ee({id:m});V($||void 0)}T()}})},Ve=r=>{window.StripoEditorApi.actionsApi.getTemplateData(async c=>{let m=r.template.id,_="",S=u.find($=>$.name===r.templateName.trim());if(S&&S.id!==m){D("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let q=r.templateType.id;L&&L.length>0?q=r.subTemplateType2.id:j&&j.length>0&&(q=r.subTemplateType.id);const se={enerexIdentifier:"",projectId:"",templateId:m,templateType:q,name:r.templateName.trim(),html:c.html,css:c.css,subject:r.templateType.id==="2"?r?.subject??"":"",parent_id:_};if(await ye(se)){v();const $=await ee({id:m});V($||void 0),T()}})};return n.jsx(y.Card,{className:"border border-0 text-start",children:n.jsx(y.Card.Body,{className:"pe-0 ps-2",children:n.jsx("form",{children:n.jsx("div",{className:"template-list-container gap-3",children:n.jsxs(y.Row,{children:[n.jsx(y.Col,{children:n.jsx(W,{label:"Category",control:E,error:C,options:te,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a category"}},...o("templateType")})}),j&&j.length>0&&n.jsx(y.Col,{children:n.jsx(W,{label:"Type",control:E,error:C,options:j,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a type"}},...o("subTemplateType")})}),L&&L.length>0&&n.jsx(y.Col,{children:n.jsx(W,{label:"Sub Type",control:E,error:C,options:L,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a subtype"}},...o("subTemplateType2")})}),n.jsx(y.Col,{children:n.jsx(W,{label:"Template",control:E,error:C,disabled:f||I||N||k||!i,options:he(),required:!1,...o("template")})}),n.jsx(y.Col,{children:n.jsx(ce,{label:"Name",register:o,error:C,required:!0,name:"templateName",validation:{required:{value:!0,message:"Enter a name"}}})}),h("templateType")?.id==="2"&&n.jsx(y.Col,{children:n.jsx(ce,{label:"Subject",register:o,error:C,required:!1,name:"subject"})}),n.jsxs(y.Col,{className:"d-flex align-self-start justify-content-end gap-2 mb-1 btn-padding",children:[n.jsx(y.Button,{style:{width:"70px"},variant:"primary",disabled:f||I||N||k||!i,onClick:()=>{R(void 0),A(),ne([]),re([]),a()},children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):"Clear"}),(h("templateType")?.id.toString()!=="2"||(h("templateType")?.id.toString()==="2"&&(U?.id??""))!=="")&&n.jsxs(n.Fragment,{children:[!(U?.readonly&&s)&&n.jsx(y.Button,{type:"button",onClick:p(Ge),variant:"primary",style:{width:"80px"},disabled:f||I||N||k||!i,children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):U?.readonly?"Save as":"Save"}),U?.readonly&&s&&n.jsx(y.Button,{type:"button",onClick:p(Ve),variant:"primary",style:{width:"80px"},disabled:f||I||N||k||!i,children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):"Save"})]})]})]})})})})})},De=({config:t})=>{const[l,a]=d.useState(!1),[i,s]=d.useState(),[e,o]=d.useState(!1);d.useEffect(()=>{t.isAdmin||o(!0)},[]);const[p,v]=d.useState(!1),g=h=>{if(s(h),t.isAdmin&&o(!0),window.StripoEditorApi&&window.StripoEditorApi.actionsApi){let A=B;window.StripoEditorApi.actionsApi.updateHtmlAndCss(h?.html??A,h?.css??"","")}},E=()=>{v(!1),s(void 0),window.StripoEditorApi&&window.StripoEditorApi.actionsApi&&window.StripoEditorApi.actionsApi.updateHtmlAndCss(B,"","")};return n.jsx(be,{configs:t,children:n.jsx(we,{children:n.jsxs("div",{className:"root-widget",children:[n.jsx(Pe,{templateLoading:v,onSelectItem:g,editorInitialized:l,onReset:E}),e&&n.jsx(Ee,{onEditorInitialized:a,templateHTML:{css:i?.css??"",html:i?.html??B},loading:p,className:"col-span-5"})]})})})};x.EditorWidget=De,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
361
|
+
*/var pe;function qe(){return pe||(pe=1,function(t){(function(){var l={}.hasOwnProperty;function a(){for(var e="",o=0;o<arguments.length;o++){var p=arguments[o];p&&(e=s(e,i(p)))}return e}function i(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var o="";for(var p in e)l.call(e,p)&&e[p]&&(o=s(o,p));return o}function s(e,o){return o?e?e+" "+o:e+o:e}t.exports?(a.default=a,t.exports=a):window.classNames=a})()}(Q)),Q.exports}var je=qe();const me=Ae(je),ue=t=>t.data.isSeparator?n.jsx("div",{style:{padding:0,margin:"2px 0"},children:n.jsx("hr",{style:{border:0,borderTop:"1px solid #bdbdbdff",padding:0,margin:0}})}):n.jsx(z.components.Option,{...t}),Le=({name:t="",control:l,options:a,multiple:i=!1,placeholder:s,validation:e,labelKey:o="name",disabled:p,isInvalid:v,value:g,onChange:E,uncontrolled:h,menuPlacement:A="auto",closeOnSelect:D=!0})=>{const C={control:b=>({...b,minHeight:"33px",borderColor:v?"var(--bs-form-invalid-border-color) !important":"var(--ct-input-border-color)",backgroundImage:v?'url("data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 12 12%27 width=%2712%27 height=%2712%27 fill=%27none%27 stroke=%27%23fa5c7c%27%3e%3ccircle cx=%276%27 cy=%276%27 r=%274.5%27/%3e%3cpath stroke-linejoin=%27round%27 d=%27M5.8 3.6h.4L6 6.5z%27/%3e%3ccircle cx=%276%27 cy=%278.2%27 r=%27.6%27 fill=%27%23fa5c7c%27 stroke=%27none%27/%3e%3c/svg%3e")':"none",backgroundRepeat:"no-repeat",backgroundPosition:"right calc(0.375em + 0.225rem) center",backgroundSize:"calc(0.75em + 0.45rem) calc(0.75em + 0.45rem)","&:hover":{borderColor:v?"var(--bs-form-invalid-border-color)":"var(--ct-input-border-color)"},"& .react-select__single-value":{color:"var(--ct-input-color) !important"},"& .react-select__placeholder":{color:"var(--ct-input-placeholder-color) !important"},"& .react-select__indicators":{display:"none"}}),menu:b=>({...b,marginTop:0,width:"max-content",minWidth:"100%"}),menuPortal:b=>({...b,zIndex:9999}),multiValueRemove:b=>({...b,display:p?"none":"block"})};return h?n.jsx(z,{components:{Option:ue},isOptionDisabled:b=>!!b.isSeparator,className:me({"is-invalid":v}),styles:C,classNamePrefix:"react-select",isMulti:i,options:a,onChange:E,placeholder:s,menuPortalTarget:document.body,value:g,getOptionLabel:typeof o=="string"?b=>b[o]:o,getOptionValue:b=>b.id,isDisabled:p,menuPlacement:A,closeMenuOnSelect:D}):n.jsx(ie.Controller,{control:l,name:t,rules:e,render:({field:{onChange:b,value:T,onBlur:f}})=>n.jsx(z,{components:{Option:ue},isOptionDisabled:u=>!!u.isSeparator,className:me({"is-invalid":v}),styles:C,classNamePrefix:"react-select",isMulti:i,options:a,onBlur:f,onChange:b,placeholder:s,menuPortalTarget:document.body,value:T,getOptionLabel:typeof o=="string"?u=>u[o]:o,getOptionValue:u=>u.id,isDisabled:p,menuPlacement:A,closeMenuOnSelect:D},T?JSON.stringify(T):"reset")})},W=({label:t,name:l,validation:a,control:i,error:s,...e})=>n.jsxs(y.Form.Group,{className:"mb-1",children:[t&&n.jsxs(y.Form.Label,{className:"mb-3 d-block form-label ts-label-height",children:[t," ",e.required&&n.jsx("span",{className:"text-danger",children:"*"})]}),n.jsx(Le,{control:i,disabled:e.disabled,options:e.options??[],validation:a,isInvalid:s&&!!s[l],name:l}),s&&s[l]?n.jsx(y.Form.Control.Feedback,{type:"invalid",children:s[l].message}):null]}),Oe=()=>{const t=H();O.useQueryClient();const{enerexIdentifier:l,projectId:a}=P();return O.useMutation({mutationKey:["saveTemplate"],mutationFn:async s=>(s.enerexIdentifier=l??"",s.projectId=a??"",await t.post(`${G.SaveTemplate}`,s))})},K={id:"",name:"New (Blank)"},fe={id:"",name:"Separator",isSeparator:!0},Pe=({onSelectItem:t,templateLoading:l,onReset:a,editorInitialized:i})=>{const{isAdmin:s,defaultSelector:e}=P(),{register:o,handleSubmit:p,clearErrors:v,setValue:g,control:E,watch:h,reset:A,setError:D,formState:{errors:C}}=ie.useForm({defaultValues:{templateName:"",subTemplateType:void 0,subTemplateType2:void 0,subject:"",templateType:void 0,template:K},mode:"onChange"}),{data:b,refetch:T,isLoading:f}=Ce(),[u,w]=d.useState([]),[M,ke]=d.useState(!1),[U,R]=d.useState(),[Y,V]=d.useState(),{mutateAsync:ee,isPending:I}=Ne(),{mutateAsync:ye,isPending:N}=Oe(),{data:F,isLoading:k}=_e(),[te,$e]=d.useState([]),[j,ne]=d.useState([]),[L,re]=d.useState([]);d.useEffect(()=>{if(F){let r=F.filter(m=>m.id!=null),c=Z(r,0);$e(X(c))}},[F]);const Me=(r,c)=>{let m=[];return r.forEach((_,S)=>{c.includes(S)&&S!==0&&m.push(fe),m.push(_)}),m};d.useEffect(()=>{l(!!(f||I||N||k||!i))},[f,I,N,k,i]),d.useEffect(()=>{b?.sort((r,c)=>r.readonly!==c.readonly?(r.readonly?0:1)-(c.readonly?0:1):r.name.localeCompare(c.name)),w(b??[])},[b]);const Ue=async r=>{R(r),r&&(s||!r.readonly)?(g("templateName",r?.name),v()):(g("templateName",""),g("subject",""));const c=await ee({id:r?.id});V(c||void 0)};d.useEffect(()=>{if((e===void 0||e.templateId===void 0||M)&&g("template",K),h("templateType")){let r=F?.filter(m=>m.id!==void 0)??[],c=Z(r,1);ne(X(c.filter(m=>m.parent_id.toString()===`${h("templateType")?.id}`))),g("subTemplateType",void 0),g("subTemplateType2",void 0)}},[h("templateType")]),d.useEffect(()=>{if((e===void 0||e.templateId===void 0)&&g("template",K),h("subTemplateType")){let r=F?.filter(m=>m.id!==void 0)??[],c=Z(r,2);re(X(c.filter(m=>m.parent_id.toString()===`${h("subTemplateType")?.id}`))),g("subTemplateType2",void 0)}},[h("subTemplateType")]),d.useEffect(()=>{const r=he();r.length>0&&r[0].id!==""?(e===void 0||e.templateId===void 0||M)&&g("template",r[0]):(e===void 0||e.templateId===void 0||M)&&g("template",K)},[h("subTemplateType2")]),d.useEffect(()=>{let r=u.find(c=>c.id===h("template")?.id);Ue(r)},[h("template")]);const[Fe,ge]=d.useState(!1);d.useEffect(()=>{Fe||(Y&&U&&i?(ge(!0),t(Y),g("subject",Y.subject??""),setTimeout(()=>{ge(!1)},1e3)):t(void 0))},[Y,U,t,i]);const he=()=>{let r=[K],c="templateType";L.length>0?c="subTemplateType2":j.length>0&&(c="subTemplateType");let m=u.filter(S=>(S.type?.toString()===h(c)?.id.toString()||S.type===null)&&h(c)?.id!=null),_=Me(m,[m.findIndex(S=>!S.readonly)]);return _.length>0&&(_[0].readonly===!0&&!s?r=[]:r.push(fe),r=[...r,..._.map(q=>({id:q.id,name:He(m,q.id),isSeparator:q.isSeparator}))]),r.length?r:[]};d.useEffect(()=>{if(e&&e.type1){const r=te?.find(c=>`${c.id}`===e.type1);g("templateType",r)}},[F,te]),d.useEffect(()=>{if(e&&e.type2){const r=j?.find(c=>`${c.id}`===e.type2);g("subTemplateType",r)}},[F,j]),d.useEffect(()=>{if(e&&e.type3){const r=L?.find(c=>`${c.id}`===e.type3);g("subTemplateType2",r)}},[F,L]),d.useEffect(()=>{if(e&&e.templateId&&u&&u.length>0&&!M&&i){const r=u?.find(c=>`${c.id}`===e.templateId);ke(!0),r&&(R(r),g("template",r))}},[u,i]);const He=(r,c)=>{let m=r.find(_=>_.id===c);return m?`${m.displayName}`:""},Ge=r=>{window.StripoEditorApi.actionsApi.getTemplateData(async c=>{let m=r.template.id,_="";U?.readonly&&(m="",_=r.template.id);let S=u.find($=>$.name===r.templateName.trim());if(S&&S.id!==m){D("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let q=r.templateType.id;L&&L.length>0?q=r.subTemplateType2.id:j&&j.length>0&&(q=r.subTemplateType.id);const se={enerexIdentifier:"",projectId:"",templateId:m,templateType:q,name:r.templateName.trim(),html:c.html,css:c.css,subject:r.templateType.id==="2"?r?.subject??"":"",parent_id:_};if(await ye(se)){if(v(),U?.readonly&&!s)A(),ne([]),re([]);else{const $=await ee({id:m});V($||void 0)}T()}})},Ve=r=>{window.StripoEditorApi.actionsApi.getTemplateData(async c=>{let m=r.template.id,_="",S=u.find($=>$.name===r.templateName.trim());if(S&&S.id!==m){D("templateName",{type:"validate",message:"Template name already exists. Please choose a different name."});return}let q=r.templateType.id;L&&L.length>0?q=r.subTemplateType2.id:j&&j.length>0&&(q=r.subTemplateType.id);const se={enerexIdentifier:"",projectId:"",templateId:m,templateType:q,name:r.templateName.trim(),html:c.html,css:c.css,subject:r.templateType.id==="2"?r?.subject??"":"",parent_id:_};if(await ye(se)){v();const $=await ee({id:m});V($||void 0),T()}})};return n.jsx(y.Card,{className:"border border-0 text-start",children:n.jsx(y.Card.Body,{className:"pe-0 ps-2",children:n.jsx("form",{children:n.jsx("div",{className:"template-list-container gap-3",children:n.jsxs(y.Row,{children:[n.jsx(y.Col,{children:n.jsx(W,{label:"Category",control:E,error:C,options:te,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a category"}},...o("templateType")})}),j&&j.length>0&&n.jsx(y.Col,{children:n.jsx(W,{label:"Type",control:E,error:C,options:j,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a type"}},...o("subTemplateType")})}),L&&L.length>0&&n.jsx(y.Col,{children:n.jsx(W,{label:"Sub Type",control:E,error:C,options:L,required:!0,disabled:f||I||N||k||!i,validation:{required:{value:!0,message:"Select a subtype"}},...o("subTemplateType2")})}),n.jsx(y.Col,{children:n.jsx(W,{label:"Template",control:E,error:C,disabled:f||I||N||k||!i,options:he(),required:!1,...o("template")})}),n.jsx(y.Col,{children:n.jsx(ce,{label:"Name",register:o,error:C,required:!0,name:"templateName",validation:{required:{value:!0,message:"Enter a name"}}})}),h("templateType")?.id==="2"&&n.jsx(y.Col,{children:n.jsx(ce,{label:"Subject",register:o,error:C,required:!1,name:"subject"})}),n.jsxs(y.Col,{className:"d-flex align-self-start justify-content-end gap-2 mb-1 btn-padding",children:[n.jsx(y.Button,{style:{width:"70px"},variant:"primary",disabled:f||I||N||k||!i,onClick:()=>{R(void 0),A(),ne([]),re([]),a()},children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):"Clear"}),(h("templateType")?.id.toString()!=="2"||(h("templateType")?.id.toString()==="2"&&(U?.id??""))!=="")&&n.jsxs(n.Fragment,{children:[!(U?.readonly&&s)&&n.jsx(y.Button,{type:"button",onClick:p(Ge),variant:"primary",style:{width:"80px"},disabled:f||I||N||k||!i,children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):U?.readonly?"Save as":"Save"}),U?.readonly&&s&&n.jsx(y.Button,{type:"button",onClick:p(Ve),variant:"primary",style:{width:"80px"},disabled:f||I||N||k||!i,children:I||N?n.jsx(y.Spinner,{animation:"border",style:{width:"11px",height:"11px"},size:"sm",role:"status",className:"me-1",children:n.jsx("span",{className:"visually-hidden",children:"Loading..."})}):"Save"})]})]})]})})})})})},De=({config:t})=>{const[l,a]=d.useState(!1),[i,s]=d.useState(),[e,o]=d.useState(!1);d.useEffect(()=>{t.isAdmin||o(!0)},[]);const[p,v]=d.useState(!1),g=h=>{if(s(h),t.isAdmin&&o(!0),window.StripoEditorApi&&window.StripoEditorApi.actionsApi){let A=B;window.StripoEditorApi.actionsApi.updateHtmlAndCss(h?.html??A,h?.css??"","")}},E=()=>{v(!1),s(void 0),window.StripoEditorApi&&window.StripoEditorApi.actionsApi&&window.StripoEditorApi.actionsApi.updateHtmlAndCss(B,"","")};return n.jsx(be,{configs:t,children:n.jsx(we,{children:n.jsxs("div",{className:"root-widget",children:[n.jsx(Pe,{templateLoading:v,onSelectItem:g,editorInitialized:l,onReset:E}),e&&n.jsx(Ee,{onEditorInitialized:a,templateHTML:{css:i?.css??"",html:i?.html??B},loading:p,className:"col-span-5"})]})})})};x.EditorWidget=De,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
package/dist/template-studio.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.root-widget{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif,Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;-moz-osx-font-smoothing:grayscale;line-height:1.5;font-weight:400;-webkit-font-smoothing:antialiased}.root-widget code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.root-widget .ng-star-inserted{display:none}.root-widget .wraped-text{text-wrap:nowrap;overflow:hidden;text-overflow:ellipsis}.root-widget .required:after{content:" *";color:#fa5c7c}.root-widget button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}.root-widget button:hover{border-color:#646cff}.root-widget button:focus,.root-widget button:focus-visible{outline:4px auto -webkit-focus-ring-color}.root-widget .loader-container{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw}.root-widget .info-icon{height:14px}.root-widget .info-icon img{width:100%;height:100%}.dark-popover{left:50%;transform:translate(-50%) translateY(-8px);z-index:9999;width:50px!important;font-size:.85rem!important;padding:.5rem;background-color:#1e1e1e!important;color:#f1f1f1;border:1px solid #444}.dark-popover.bs-popover-top>.popover-arrow:before,.dark-popover.bs-popover-bottom>.popover-arrow:before,.dark-popover.bs-popover-left>.popover-arrow:before,.dark-popover.bs-popover-right>.popover-arrow:before{border-color:transparent!important}.dark-popover.bs-popover-top>.popover-arrow:after{border-top-color:#1e1e1e!important}.dark-popover.bs-popover-bottom>.popover-arrow:after{border-bottom-color:#1e1e1e!important}.dark-popover.bs-popover-left>.popover-arrow:after{border-left-color:#1e1e1e!important}.dark-popover.bs-popover-right>.popover-arrow:after{border-right-color:#1e1e1e!important}.template-list-container{max-height:350px;overflow-y:auto}.react-select__control--is-focused{border-color:var(--ct-input-border-color)!important;box-shadow:none!important}.react-select__option{color:var(--ct-input-color)!important;background-color:#fff!important}.react-select__option:hover,.react-select__option--is-focused,.react-select__option--is-selected{color:var(--ct-input-color)!important;background-color:#deebff!important}.root-widget label{font-weight:600!important}.root-widget input{padding-block:1px!important;padding-inline:2px!important}.root-widget .form-control{display:block!important;min-height:33px;outline:none!important;box-shadow:none!important;width:100%!important;font-weight:400!important;line-height:1.5!important;color:var(--ct-input-color)!important;background-color:var(--ct-input-bg)!important;background-clip:padding-box!important;border:1px solid var(--ct-input-border-color)!important;appearance:none!important;border-radius:.25rem!important;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out!important}.root-widget .btn{--bs-btn-padding-x: 12px !important;--bs-btn-padding-y: 5px !important;--bs-btn-font-size: .9rem !important;--bs-btn-font-weight: 400 !important;--bs-btn-line-height: 1.5 !important;--bs-btn-color: #6c757d !important;--bs-btn-bg: transparent !important;--bs-btn-border-width: 1px !important;--bs-btn-border-color: transparent !important;--bs-btn-border-radius: .15rem !important;--bs-btn-hover-border-color: transparent !important;--bs-btn-box-shadow: 0px 2px 6px 0px !important;--bs-btn-disabled-opacity: .65 !important;--bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(var(--bs-btn-focus-shadow-rgb), .5) !important;display:inline-block!important;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x)!important;font-family:var(--bs-btn-font-family)!important;font-size:var(--bs-btn-font-size)!important;font-weight:var(--bs-btn-font-weight)!important;line-height:var(--bs-btn-line-height)!important;color:var(--bs-btn-color)!important;text-align:center!important;vertical-align:middle!important;cursor:pointer!important;-webkit-user-select:none!important;user-select:none!important;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color)!important;border-radius:var(--bs-btn-border-radius)!important;background-color:var(--bs-btn-bg)!important;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out!important}.root-widget .btn-primary{--bs-btn-color: #fff !important;--bs-btn-bg: #131c45 !important;--bs-btn-border-color: #131c45 !important;--bs-btn-hover-color: #fff !important;--bs-btn-hover-bg: #10183b !important;--bs-btn-hover-border-color: #0f1637 !important;--bs-btn-focus-shadow-rgb: 54, 62, 97 !important;--bs-btn-active-color: #fff !important;--bs-btn-active-bg: #0f1637 !important;--bs-btn-active-border-color: #0e1534 !important;--bs-btn-active-shadow: var(--ct-btn-active-box-shadow) !important;--bs-btn-disabled-color: #fff !important;--bs-btn-disabled-bg: #131c45 !important;--bs-btn-disabled-border-color: #131c45 !important}.root-widget .logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.root-widget .logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.root-widget .logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}.root-widget .requiredField:after{content:"";font-family:FontAwesome;position:absolute;left:10px;top:10px;color:red}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.root-widget .card{padding:.3em}.root-widget .read-the-docs{color:#888}.root-widget .row{margin:0!important}.root-widget{--ct-input-border-color: #ced4da !important}.root-widget .btn-padding{padding-top:40px}#stripoEditorContainer{height:calc(100% + -0px)}.editor-container{height:100vh;position:absolute;min-width:1200px;width:100%;overflow:auto}.root-widget .loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;display:flex;justify-content:center;align-items:center;z-index:1000}
|
|
1
|
+
.root-widget{margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif,Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;-moz-osx-font-smoothing:grayscale;line-height:1.5;font-weight:400;-webkit-font-smoothing:antialiased}.root-widget code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}.root-widget .ng-star-inserted{display:none}.root-widget .wraped-text{text-wrap:nowrap;overflow:hidden;text-overflow:ellipsis}.root-widget .required:after{content:" *";color:#fa5c7c}.root-widget button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}.root-widget button:hover{border-color:#646cff}.root-widget button:focus,.root-widget button:focus-visible{outline:4px auto -webkit-focus-ring-color}.root-widget .loader-container{display:flex;justify-content:center;align-items:center;height:100vh;width:100vw}.root-widget .info-icon{height:14px}.root-widget .info-icon img{width:100%;height:100%}.dark-popover{left:50%;transform:translate(-50%) translateY(-8px);z-index:9999;width:50px!important;font-size:.85rem!important;padding:.5rem;background-color:#1e1e1e!important;color:#f1f1f1;border:1px solid #444}.dark-popover.bs-popover-top>.popover-arrow:before,.dark-popover.bs-popover-bottom>.popover-arrow:before,.dark-popover.bs-popover-left>.popover-arrow:before,.dark-popover.bs-popover-right>.popover-arrow:before{border-color:transparent!important}.dark-popover.bs-popover-top>.popover-arrow:after{border-top-color:#1e1e1e!important}.dark-popover.bs-popover-bottom>.popover-arrow:after{border-bottom-color:#1e1e1e!important}.dark-popover.bs-popover-left>.popover-arrow:after{border-left-color:#1e1e1e!important}.dark-popover.bs-popover-right>.popover-arrow:after{border-right-color:#1e1e1e!important}.template-list-container{max-height:350px;overflow-y:auto}.react-select__control--is-focused{border-color:var(--ct-input-border-color)!important;box-shadow:none!important}.react-select__option{color:var(--ct-input-color)!important;background-color:#fff!important}.react-select__option:hover,.react-select__option--is-focused,.react-select__option--is-selected{color:var(--ct-input-color)!important;background-color:#deebff!important}.root-widget label{font-weight:600!important}.root-widget input{padding-block:1px!important;padding-inline:2px!important}.root-widget .form-control{display:block!important;min-height:33px;outline:none!important;box-shadow:none!important;width:100%!important;font-weight:400!important;line-height:1.5!important;color:var(--ct-input-color)!important;background-color:var(--ct-input-bg)!important;background-clip:padding-box!important;border:1px solid var(--ct-input-border-color)!important;appearance:none!important;border-radius:.25rem!important;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out!important}.root-widget .btn{--bs-btn-padding-x: 12px !important;--bs-btn-padding-y: 5px !important;--bs-btn-font-size: .9rem !important;--bs-btn-font-weight: 400 !important;--bs-btn-line-height: 1.5 !important;--bs-btn-color: #6c757d !important;--bs-btn-bg: transparent !important;--bs-btn-border-width: 1px !important;--bs-btn-border-color: transparent !important;--bs-btn-border-radius: .15rem !important;--bs-btn-hover-border-color: transparent !important;--bs-btn-box-shadow: 0px 2px 6px 0px !important;--bs-btn-disabled-opacity: .65 !important;--bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(var(--bs-btn-focus-shadow-rgb), .5) !important;display:inline-block!important;padding:var(--bs-btn-padding-y) var(--bs-btn-padding-x)!important;font-family:var(--bs-btn-font-family)!important;font-size:var(--bs-btn-font-size)!important;font-weight:var(--bs-btn-font-weight)!important;line-height:var(--bs-btn-line-height)!important;color:var(--bs-btn-color)!important;text-align:center!important;vertical-align:middle!important;cursor:pointer!important;-webkit-user-select:none!important;user-select:none!important;border:var(--bs-btn-border-width) solid var(--bs-btn-border-color)!important;border-radius:var(--bs-btn-border-radius)!important;background-color:var(--bs-btn-bg)!important;transition:color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out!important}.root-widget .btn-primary{--bs-btn-color: #fff !important;--bs-btn-bg: #131c45 !important;--bs-btn-border-color: #131c45 !important;--bs-btn-hover-color: #fff !important;--bs-btn-hover-bg: #10183b !important;--bs-btn-hover-border-color: #0f1637 !important;--bs-btn-focus-shadow-rgb: 54, 62, 97 !important;--bs-btn-active-color: #fff !important;--bs-btn-active-bg: #0f1637 !important;--bs-btn-active-border-color: #0e1534 !important;--bs-btn-active-shadow: var(--ct-btn-active-box-shadow) !important;--bs-btn-disabled-color: #fff !important;--bs-btn-disabled-bg: #131c45 !important;--bs-btn-disabled-border-color: #131c45 !important}.root-widget .logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.root-widget .logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.root-widget .logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}.root-widget .requiredField:after{content:"";font-family:FontAwesome;position:absolute;left:10px;top:10px;color:red}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.root-widget .card{padding:.3em}.root-widget .read-the-docs{color:#888}.root-widget .row{margin:0!important}.root-widget{--ct-input-border-color: #ced4da !important}.root-widget .btn-padding{padding-top:40px}.root-widget .ts-label-height{height:16.5px!important}#stripoEditorContainer{height:calc(100% + -0px)}.editor-container{height:100vh;position:absolute;min-width:1200px;width:100%;overflow:auto}.root-widget .loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#fffc;display:flex;justify-content:center;align-items:center;z-index:1000}
|