view x/static/js/3614.af493134.chunk.js @ 125:49f3d3878413 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/jbrowse2 commit 5ea1f9c1eef1de76232e69aa6d34cda77d90d566
author fubar
date Sat, 05 Oct 2024 23:58:05 +0000
parents
children
line wrap: on
line source

"use strict";(globalThis.webpackChunk_jbrowse_web=globalThis.webpackChunk_jbrowse_web||[]).push([[3614],{13614:(e,t,n)=>{n.r(t),n.d(t,{default:()=>he});var a=n(7552),l=n(63011),r=n(41578),o=n(36715),c=n(63165),s=n(83867),i=n(75785),m=n(68446),u=n(36422),d=n(93091),p=n(13476),E=n(68584),v=n(7720),g=n(99546),b=n(49823),A=n(23550),h=n(1343),f=n(2859),y=n(29629),C=n(943),x=n(61723),k=n(70996),N=n(17125),T=n(58181),w=n(45331),S=n(93117),j=n(5401),M=n(25467),L=n(25762);const F=(0,m.observer)((function({slot:e}){const[t,n]=(0,a.useState)(""),[l,r]=(0,a.useState)(!1);return a.createElement(a.Fragment,null,e.name?a.createElement(N.A,null,e.name):null,a.createElement(T.A,{disablePadding:!0},e.value.map(((t,n)=>a.createElement(w.Ay,{key:`${JSON.stringify(t)}-${n}`,disableGutters:!0},a.createElement(h.A,{value:t,onChange:t=>{e.setAtIndex(n,t.target.value)},InputProps:{endAdornment:a.createElement(S.A,{position:"end"},a.createElement(x.A,{onClick:()=>{e.removeAtIndex(n)}},a.createElement(L.A,null)))}})))),l?a.createElement(w.Ay,{disableGutters:!0},a.createElement(h.A,{value:t,placeholder:"add new",onChange:e=>{n(e.target.value)},InputProps:{endAdornment:a.createElement(S.A,{position:"end"},a.createElement(a.Fragment,null,a.createElement(j.A,{color:"primary",variant:"contained",style:{margin:2},"data-testid":`stringArrayAdd-${e.name}`,onClick:()=>{r(!1),e.add(t),n("")}},"OK"),a.createElement(j.A,{color:"primary",variant:"contained",style:{margin:2},onClick:()=>{r(!1),n("")}},"Cancel")))}})):null,a.createElement(j.A,{color:"primary",variant:"contained",style:{margin:4},disabled:l,onClick:()=>{r(!0)}},"Add item")),a.createElement(M.A,null,e.description))}));var I=n(89003),O=n(43283),P=n(25914);const $='Consolas, "Andale Mono WT", "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace',W=(0,i.n9)()((e=>({callbackEditor:{marginTop:"16px",borderBottom:`1px solid ${e.palette.divider}`,width:"100%",fontFamily:$},textAreaFont:{fontFamily:$},callbackContainer:{width:"100%",overflowX:"auto"},error:{color:"red",fontSize:"0.8em"}}))),H=(0,m.observer)((function({slot:e}){const{classes:t}=W(),[n,l]=(0,a.useState)(e.value),[r,o]=(0,a.useState)(),c=(0,g.useDebounce)(n,400);return(0,a.useEffect)((()=>{try{const t=c.startsWith("jexl:")?c:`jexl:${c}`;if("jexl:"===t)throw new Error("Empty jexl expression is not valid");(0,O.A)(t,(0,u.getEnv)(e).pluginManager?.jexl),e.set(t),o(void 0)}catch(e){console.error({e}),o(e)}}),[c,e]),a.createElement(a.Fragment,null,r?a.createElement("p",{className:t.error},`${r}`):null,a.createElement("div",{className:t.callbackContainer},a.createElement(h.A,{multiline:!0,className:t.callbackEditor,value:n.startsWith("jexl:")?n.split("jexl:")[1]:n,onChange:e=>{l(e.target.value)},style:{background:r?"#fdd":void 0},InputProps:{classes:{input:t.textAreaFont}}}),a.createElement("p",null,e.description),a.createElement(I.A,{title:a.createElement("div",null,"Callbacks are written in Jexl format. Click to learn more.",a.createElement("br",null)," Names of available context items: ",e.contextVariable),arrow:!0},a.createElement(x.A,{color:"primary",onClick:()=>{const e=window.open("https://github.com/TomFrost/Jexl","_blank","noopener,noreferrer");e&&(e.opener=null)}},a.createElement(P.A,null)))))}));var V=n(66395);function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},D.apply(null,arguments)}const _=e=>{const{value:t="#000",label:n="",TextFieldProps:l={},onChange:r}=e,[o,c]=(0,a.useState)(!1);return a.createElement("div",{style:{display:"flex"}},a.createElement(h.A,D({value:t,label:n,onClick:()=>{c(!o)},onChange:e=>{r(e.target.value)}},l)),a.createElement("div",{style:{marginTop:10}},a.createElement(a.Suspense,{fallback:null},a.createElement(V.Ay,{color:t,onChange:e=>{r(e)}}))))},K=(0,m.observer)((function(e){const{slot:t}=e;return a.createElement(_,{label:t.name,value:t.value,onChange:e=>{t.set(e)},TextFieldProps:{helperText:t.description,fullWidth:!0}})}));var z=n(64248),B=n(1773),J=n(26875),U=n(25355),G=n(374);const X=(0,i.n9)()((e=>({card:{marginTop:e.spacing(1)}}))),R=(0,m.observer)((function({slot:e}){const{classes:t}=X(),[n,l]=(0,a.useState)("");return a.createElement(a.Fragment,null,a.createElement(N.A,null,e.name),[...e.value].map((([n,l])=>a.createElement(B.A,{raised:!0,key:n,className:t.card},a.createElement(J.A,{title:n,action:a.createElement(x.A,{onClick:()=>{e.remove(n)}},a.createElement(L.A,null))}),a.createElement(U.A,null,a.createElement(F,{slot:{name:e.name,value:l,description:`Values associated with entry ${n}`,setAtIndex:(t,a)=>{e.setAtKeyIndex(n,t,a)},removeAtIndex:t=>{e.removeAtKeyIndex(n,t)},add:t=>{e.addToKey(n,t)}}}))))),a.createElement(B.A,{raised:!0,className:t.card},a.createElement(J.A,{disableTypography:!0,title:a.createElement(h.A,{fullWidth:!0,value:n,placeholder:"add new",onChange:e=>{l(e.target.value)},InputProps:{endAdornment:a.createElement(S.A,{position:"end"},a.createElement(x.A,{disabled:""===n,onClick:()=>{e.add(n,[]),l("")}},a.createElement(G.A,null)))}})})),a.createElement(M.A,null,e.description))}));function Z(){return Z=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Z.apply(null,arguments)}function q(e){const{helperText:t}=e;return a.createElement(h.A,Z({},e,{helperText:a.createElement(b.SanitizedHTML,{html:t||""}),FormHelperTextProps:{component:"div"},fullWidth:!0}))}const Q=(0,m.observer)((function({slot:e}){const[t,n]=(0,a.useState)(e.value);return(0,a.useEffect)((()=>{const n=Number.parseFloat(t);Number.isNaN(n)?e.reset?.():e.set(n)}),[e,t]),a.createElement(q,{label:e.name,helperText:e.description,value:t,type:"number",onChange:e=>{n(e.target.value)}})})),Y=(0,i.n9)()((e=>({card:{marginTop:e.spacing(1)}}))),ee=(0,m.observer)((function({slot:e}){const{classes:t}=Y(),[n,l]=(0,a.useState)("");return a.createElement(a.Fragment,null,a.createElement(N.A,null,e.name),[...e.value].map((([n,l])=>a.createElement(B.A,{raised:!0,key:n,className:t.card},a.createElement(J.A,{title:n,action:a.createElement(x.A,{onClick:()=>{e.remove(n)}},a.createElement(L.A,null))}),a.createElement(U.A,null,a.createElement(Q,{slot:{value:l,set:t=>{e.add(n,t)}}}))))),a.createElement(B.A,{raised:!0,className:t.card},a.createElement(J.A,{disableTypography:!0,title:a.createElement(h.A,{fullWidth:!0,value:n,placeholder:"add new",onChange:e=>{l(e.target.value)},InputProps:{endAdornment:a.createElement(S.A,{position:"end"},a.createElement(x.A,{disabled:""===n,onClick:()=>{e.add(n,0),l("")}},a.createElement(G.A,null)))}})})),a.createElement(M.A,null,e.description))}));var te=n(48171),ne=n(33371),ae=n(32808);const le=(0,m.observer)((function({slot:e}){return a.createElement(te.A,null,a.createElement(ne.A,{label:e.name,control:a.createElement(ae.A,{checked:e.value,onChange:t=>{e.set(t.target.checked)}})}),a.createElement(M.A,null,e.description))})),re=(0,i.n9)()((e=>({paper:{display:"flex",marginBottom:e.spacing(2),position:"relative"},paperContent:{width:"100%"},slotModeSwitch:{width:24,background:e.palette.secondary.light,display:"flex",justifyContent:"center",alignItems:"center"}}))),oe=(0,m.observer)((function({slot:e}){return a.createElement(q,{label:e.name,helperText:e.description,value:e.value,onChange:t=>{e.set(t.target.value)}})})),ce=(0,m.observer)((function({slot:e}){return a.createElement(h.A,{label:e.name,helperText:e.description,multiline:!0,value:e.value,onChange:t=>{e.set(t.target.value)}})})),se=()=>a.createElement(f.A,null,a.createElement("path",{d:"M20.41,3C21.8,5.71 22.35,8.84 22,12C21.8,15.16 20.7,18.29 18.83,21L17.3,20C18.91,17.57 19.85,14.8 20,12C20.34,9.2 19.89,6.43 18.7,4L20.41,3M5.17,3L6.7,4C5.09,6.43 4.15,9.2 4,12C3.66,14.8 4.12,17.57 5.3,20L3.61,21C2.21,18.29 1.65,15.17 2,12C2.2,8.84 3.3,5.71 5.17,3M12.08,10.68L14.4,7.45H16.93L13.15,12.45L15.35,17.37H13.09L11.71,14L9.28,17.33H6.76L10.66,12.21L8.53,7.45H10.8L12.08,10.68Z"})),ie=(0,m.observer)((function({slot:e}){const[t,n]=(0,a.useState)(e.value);return(0,a.useEffect)((()=>{const n=Number.parseInt(t,10);Number.isNaN(n)||e.set(n)}),[e,t]),a.createElement(q,{label:e.name,helperText:e.description,value:t,type:"number",onChange:e=>{n(e.target.value)}})})),me=(0,m.observer)((function({slot:e,slotSchema:t}){const n=(0,u.getPropertyMembers)((0,A.getSubType)(t)),l=(0,A.getUnionSubTypes)((0,A.getUnionSubTypes)((0,A.getSubType)(n.properties.value))[1]).map((e=>e.value));return a.createElement(q,{value:e.value,label:e.name,select:!0,helperText:e.description,onChange:t=>{e.set(t.target.value)}},l.map((e=>a.createElement(y.A,{key:e,value:e},e))))})),ue=(0,m.observer)((function({slot:e}){return a.createElement(b.FileSelector,{location:e.value,setLocation:t=>{e.set(t)},name:e.name,description:e.description,rootModel:(0,g.getEnv)(e).pluginManager?.rootModel})})),de={string:oe,text:ce,fileLocation:ue,stringArray:F,stringArrayMap:R,numberMap:ee,number:Q,integer:ie,color:K,stringEnum:me,boolean:le,frozen:z.A,configRelationships:z.A},pe=(0,m.observer)((function({slot:e,slotSchema:t}){const{classes:n}=re(),{type:l}=e;let r=e.isCallback?H:de[l];return r||(console.warn(`no slot editor defined for ${l}, editing as string`),r=oe),l in de||console.warn(`SlotEditor needs to implement ${l}`),a.createElement(C.A,{className:n.paper},a.createElement("div",{className:n.paperContent},a.createElement(r,{slot:e,slotSchema:t})),a.createElement("div",{className:n.slotModeSwitch},e.contextVariable.length?a.createElement(x.A,{onClick:()=>e.isCallback?e.convertToValue():e.convertToCallback(),title:"convert to "+(e.isCallback?"regular value":"callback")},e.isCallback?a.createElement(se,null):a.createElement(k.A,null)):null))})),Ee=(0,m.observer)((function({typeNameChoices:e,slot:t,slotName:n,onChange:l}){const{classes:r}=re();return a.createElement(C.A,{className:r.paper},a.createElement("div",{className:r.paperContent},a.createElement(h.A,{value:t.type,label:"Type",select:!0,helperText:`Type of ${n} to use`,fullWidth:!0,onChange:l},e.map((e=>a.createElement(y.A,{key:e,value:e},e))))))}));function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ve.apply(null,arguments)}const ge=(0,i.n9)()((e=>({icon:{color:e.palette.tertiary.contrastText||"#fff"},expansionPanelDetails:{display:"block",padding:e.spacing(1)},accordion:{border:`1px solid ${e.palette.text.primary}`},noOverflow:{width:"100%",overflowX:"auto"}}))),be=(0,m.observer)((function(e){const{classes:t}=ge(),{slotName:n,slotSchema:i,schema:m,slot:u=m[n],path:p=[]}=e;if((0,E.isConfigurationSchemaType)(i)){if(u.length)return u.map(((t,l)=>{const r=t.type?`${(0,d.singular)(n)} ${t.type}`:`${(0,d.singular)(n)} ${l+1}`;return a.createElement(be,ve({key:r},e,{slot:t,slotName:r}))}));const g=(0,E.getTypeNamesFromExplicitlyTypedUnion)(i);return a.createElement(l.A,{defaultExpanded:!0,className:t.accordion},a.createElement(r.A,{expandIcon:a.createElement(v.A,{className:t.icon})},a.createElement(o.A,null,[...p,n].join("➔"))),a.createElement(c.A,{className:t.expansionPanelDetails},g.length?a.createElement(Ee,{typeNameChoices:g,slotName:n,slot:u,onChange:e=>{e.target.value!==u.type&&m.setSubschema(n,{type:e.target.value})}}):null,a.createElement(s.A,{className:t.noOverflow},a.createElement(Ae,{schema:u,path:[...p,n]}))))}return(0,E.isConfigurationSlotType)(i)?a.createElement(pe,{key:n,slot:u,slotSchema:i}):null})),Ae=(0,m.observer)((function({schema:e,path:t=[]}){const n=(0,u.getMembers)(e).properties;return a.createElement(a.Fragment,null,Object.entries(n).map((([n,l])=>a.createElement(be,{key:n,slotName:n,slotSchema:l,path:t,schema:e}))))})),he=(0,m.observer)((function({model:e}){const{classes:t}=ge(),{target:n}=e,s=(0,E.readConfObject)(n,"trackId"),i=(0,E.readConfObject)(n,"name");return a.createElement(l.A,{key:s,defaultExpanded:!0,className:t.accordion},a.createElement(r.A,{expandIcon:a.createElement(v.A,{className:t.icon})},a.createElement(o.A,null,a.createElement(p.A,{html:i??"Configuration"}))),a.createElement(c.A,{className:t.expansionPanelDetails,"data-testid":"configEditor"},a.createElement(Ae,{schema:n})))}))}}]);
//# sourceMappingURL=3614.af493134.chunk.js.map