@malloy-publisher/server 0.9.7 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/api-doc.yaml +727 -361
- package/dist/app/assets/EnvironmentPage-1dxk_vne.js +1 -0
- package/dist/app/assets/{HomePage-BM31X4Y8.js → HomePage-DOCeWyiv.js} +1 -1
- package/dist/app/assets/MainPage-Baqv8q6B.js +1 -0
- package/dist/app/assets/ModelPage-BuMKFY0Q.js +2 -0
- package/dist/app/assets/PackagePage-DMRAjKE6.js +1 -0
- package/dist/app/assets/{RenderedResult-CkUS04tl.es-CNz9JsEK.js → RenderedResult-DZj-FnOJ.es-8Pxk7Ln2.js} +2 -2
- package/dist/app/assets/{RouteError-DLJlCtRG.js → RouteError-CXf8Frkp.js} +1 -1
- package/dist/app/assets/{ThemeEditorPage-Ck4rJ1vv.js → ThemeEditorPage-BzjDFaw6.js} +1 -1
- package/dist/app/assets/ToggleButtonGroup-o0Gqmq5F.js +1 -0
- package/dist/app/assets/documentRoutes-B2MDvZ3y.js +1 -0
- package/dist/app/assets/{index-BcsfsLm3.js → index-Buv5Qzfs.js} +1 -1
- package/dist/app/assets/{index-D3HZqxOW.js → index-BuyzVBLU.js} +1 -1
- package/dist/app/assets/index-CDTd6FbM.js +483 -0
- package/dist/app/assets/{index-wawGd6k1.js → index-CvMqTqVr.js} +1 -1
- package/dist/app/assets/index.es-CECvOvgr.js +195 -0
- package/dist/app/index.html +1 -1
- package/dist/package_load_worker.mjs +15899 -17181
- package/dist/server.mjs +11292 -11153
- package/dist/sshcrypto-cqb52edz.node +0 -0
- package/package.json +1 -1
- package/dist/app/assets/EnvironmentPage-V6cQ_Kpr.js +0 -1
- package/dist/app/assets/MainPage-CQW3P4wB.js +0 -1
- package/dist/app/assets/ModelPage-dBHaHb6u.js +0 -2
- package/dist/app/assets/PackagePage-B-ruDCyR.js +0 -1
- package/dist/app/assets/ToggleButtonGroup-Bwj7gIJm.js +0 -1
- package/dist/app/assets/documentRoutes-DGm_-EUy.js +0 -1
- package/dist/app/assets/index-hnA8HjeH.js +0 -484
- package/dist/app/assets/index.es-B2kJpnhe.js +0 -195
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r,C as t,j as e,ab as i,ax as o}from"./index-CDTd6FbM.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as t,j as o,$ as a}from"./index-CDTd6FbM.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as y,j as t,s as z,B as Se,m as Q,e as ce,g as xe,a as me,r as h,u as fe,d as Me,f as W,h as ge,T as K,i as G,k as Ee,l as Pe,n as Ce,o as ye,p as ze,q as Ie,t as de,v as De,w as Te,x as O,y as H,M as Re,P as Be,z as Le,S as $e,A as J,C as Z,D as He,E as Ne,F as Oe,G as pe,N as Ae,b as ee,H as u,I as We,J as Y,K as V,L as te,W as Ve,O as Fe,Q as ue,R as Ue,U as re,V as ne,X as oe,Y as _e,Z as Xe,_ as Ye,a0 as qe}from"./index-CDTd6FbM.js";import{i as Qe,w as Ke,a as Ge}from"./documentRoutes-B2MDvZ3y.js";const Je=y(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Ze=z(Se,{name:"MuiBreadcrumbCollapsed"})(Q(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),et=z(Je)({width:24,height:16});function tt(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(Ze,{focusRipple:!0,...n,ownerState:s,children:t.jsx(et,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function rt(e){return xe("MuiBreadcrumbs",e)}const nt=me("MuiBreadcrumbs",["root","ol","li","separator"]),ot=e=>{const{classes:r}=e;return ge({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},rt,r)},st=z(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${nt.li}`]:r.li},r.root]})({}),at=z("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),it=z("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function lt(e,r,o,n){return e.reduce((s,l,a)=>(a<e.length-1?s=s.concat(l,t.jsx(it,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${a}`)):s.push(l),s),[])}const ct=h.forwardRef(function(r,o){const n=fe({props:r,name:"MuiBreadcrumbs"}),{children:s,className:l,component:a="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:x=1,itemsBeforeCollapse:v=1,maxItems:g=8,separator:k="/",...$}=n,[I,E]=h.useState(!1),j={...n,component:a,expanded:I,expandText:p,itemsAfterCollapse:x,itemsBeforeCollapse:v,maxItems:g,separator:k},P=ot(j),D=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:j}),w=h.useRef(null),S=c=>{const M=()=>{E(!0);const b=w.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return v+x>=c.length?c:[...c.slice(0,v),t.jsx(tt,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:M},"ellipsis"),...c.slice(c.length-x,c.length)]},T=h.Children.toArray(s).filter(c=>h.isValidElement(c)).map((c,M)=>t.jsx("li",{className:P.li,children:c},`child-${M}`));return t.jsx(st,{ref:o,component:a,color:"textSecondary",className:W(P.root,l),ownerState:j,...$,children:t.jsx(at,{className:P.ol,ref:w,ownerState:j,children:lt(I||g&&T.length<=g?T:S(T),P.separator,k,j)})})});function dt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),l=ye(r);let a;if(r.fakeTransform)a=r.fakeTransform;else{const p=l.getComputedStyle(r);a=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(a&&a!=="none"&&typeof a=="string"){const p=a.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${l.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${l.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function pt(e){return typeof e=="function"?e():e}function A(e,r,o){const n=pt(o),s=dt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ut=h.forwardRef(function(r,o){const n=G(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:d=!0,children:m,container:p,direction:x="down",easing:v=s,in:g,onEnter:k,onEntered:$,onEntering:I,onExit:E,onExited:j,onExiting:P,style:D,timeout:w=l,TransitionComponent:S=Ee,...T}=r,c=h.useRef(null),M=Pe(Ce(m),c,o),b=i=>f=>{i&&(f===void 0?i(c.current):i(c.current,f))},F=b((i,f)=>{A(x,i,p),Ie(i),k&&k(i,f)}),ae=b((i,f)=>{const L=de({timeout:w,style:D,easing:v},{mode:"enter"});i.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),i.style.transition=n.transitions.create("transform",{...L}),i.style.webkitTransform="none",i.style.transform="none",I&&I(i,f)}),R=b($),B=b(P),C=b(i=>{const f=de({timeout:w,style:D,easing:v},{mode:"exit"});i.style.webkitTransition=n.transitions.create("-webkit-transform",f),i.style.transition=n.transitions.create("transform",f),A(x,i,p),E&&E(i)}),U=b(i=>{i.style.webkitTransition="",i.style.transition="",j&&j(i)}),_=i=>{a&&a(c.current,i)},N=h.useCallback(()=>{c.current&&A(x,c.current,p)},[x,p]);return h.useEffect(()=>{if(g||x==="down"||x==="right")return;const i=ze(()=>{c.current&&A(x,c.current,p)}),f=ye(c.current);return f.addEventListener("resize",i),()=>{i.clear(),f.removeEventListener("resize",i)}},[x,g,p]),h.useEffect(()=>{g||N()},[g,N]),t.jsx(S,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:C,onExited:U,onExiting:B,addEndListener:_,appear:d,in:g,timeout:w,...T,children:(i,{ownerState:f,...L})=>h.cloneElement(m,{ref:M,style:{visibility:i==="exited"&&!g?"hidden":void 0,...D,...m.props.style},...L})})});function ht(e){return xe("MuiDrawer",e)}me("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const be=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},xt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${H(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${H(o)}`,n!=="temporary"&&`paperAnchorDocked${H(o)}`]};return ge(s,ht,r)},mt=z(Re,{name:"MuiDrawer",slot:"Root",overridesResolver:be})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ft=z("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:be})({flex:"0 0 auto"}),gt=z(Be,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${H(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${H(o.anchor)}`]]}})(Q(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ve={left:"right",right:"left",top:"down",bottom:"up"};function yt(e){return["left","right"].includes(e)}function bt({direction:e},r){return e==="rtl"&&yt(r)?ve[r]:r}const vt=h.forwardRef(function(r,o){const n=fe({props:r,name:"MuiDrawer"}),s=G(),l=De(),a={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:x,elevation:v=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:k,...$}={},onClose:I,open:E=!1,PaperProps:j={},SlideProps:P,TransitionComponent:D,transitionDuration:w=a,variant:S="temporary",slots:T={},slotProps:c={},...M}=n,b=h.useRef(!1);h.useEffect(()=>{b.current=!0},[]);const F=bt({direction:l?"rtl":"ltr"},d),R={...n,anchor:d,elevation:v,open:E,variant:S,...M},B=xt(R),C={slots:{transition:D,...T},slotProps:{paper:j,transition:P,...c,backdrop:Te(c.backdrop||{...m,...k},{transitionDuration:w})}},[U,_]=O("root",{ref:o,elementType:mt,className:W(B.root,B.modal,x),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...C,...M,...$},additionalProps:{open:E,onClose:I,hideBackdrop:g,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,i]=O("paper",{elementType:gt,shouldForwardComponentProp:!0,className:W(B.paper,j.className),ownerState:R,externalForwardedProps:C,additionalProps:{elevation:S==="temporary"?v:0,square:!0,...S==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,L]=O("docked",{elementType:ft,ref:o,className:W(B.root,B.docked,x),ownerState:R,externalForwardedProps:C,additionalProps:M}),[ke,we]=O("transition",{elementType:ut,ownerState:R,externalForwardedProps:C,additionalProps:{in:E,direction:ve[F],timeout:w,appear:b.current}}),ie=t.jsx(N,{...i,children:p});if(S==="permanent")return t.jsx(f,{...L,children:ie});const le=t.jsx(ke,{...we,children:ie});return S==="persistent"?t.jsx(f,{...L,children:le}):t.jsx(U,{..._,children:le})}),jt=y([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),kt=y(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),wt=y(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),St=y(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Mt=y(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),Et=y(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),Pt=y(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),Ct=y(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),zt=y(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),It=y(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Dt=y([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]),Tt=y(t.jsx("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7"}));function q(e){return t.jsxs($e,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}const Rt=/\.malloy(nb)?$/;function Bt(){const{pathname:e,search:r}=J(),o=Z(),n=He(),s=Ne(),l=o.environmentName??"",a=o.packageName??"",d=o["*"]??"",m=l!==""&&a!==""&&d!==""&&!Rt.test(d),{reports:p,settled:x}=Oe(l,a,void 0,m);if(!m||s)return null;const v=d.replace(/\/$/,""),g=Qe(r),k=e.replace(/\/$/,"");return g?t.jsx(pe,{label:"View",icon:t.jsx(Tt,{}),onClick:()=>n(`${k}${Ke(r)}`)}):(x?Ae(`${v}.malloy`,p):void 0)?.editable?t.jsx(pe,{label:"Edit",icon:t.jsx(Et,{}),onClick:()=>n(`${k}${Ge(r)}`)}):null}function X({label:e,onClick:r}){return t.jsx(We,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:o=>({backgroundColor:"transparent",border:`1px solid ${o.palette.divider}`,color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:o.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function Lt(){const e=Z(),r=e["*"]?e["*"].replace(/\/$/,""):void 0,o=ee();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ct,{"aria-label":"breadcrumb",separator:t.jsx(wt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,onClick:n=>o(`/${e.environmentName}/`,n)}),e.packageName&&t.jsx(X,{label:e.packageName,onClick:n=>o(`/${e.environmentName}/${e.packageName}/`,n)}),r&&t.jsx(X,{label:r,onClick:n=>o(`/${e.environmentName}/${e.packageName}/${r}`,n)})]})})}const $t=260,Ht=64;function je({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?Ht:$t,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Nt,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Ot,{isCollapsed:e}),t.jsx(At,{isCollapsed:e})]}),t.jsx(Wt,{isCollapsed:e})]})}function Nt({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Ot({isCollapsed:e}){const o=J().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Ct,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function At({isCollapsed:e}){const{apiClients:r}=Ve(),o=Z(),{data:n}=Fe({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(te,{sx:{py:0},children:s.map(l=>{const a=l.name??"";return t.jsx(se,{icon:t.jsx(Pt,{fontSize:"small"}),label:a,to:`/${a}`,selected:o.environmentName===a,isCollapsed:e},a)})})]})}function Wt({isCollapsed:e}){const{pathname:r}=J(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(jt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(It,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(St,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(_t,{isCollapsed:e}),o.map(n=>t.jsx(Vt,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const l=ee(),a=t.jsxs(re,{selected:n,onClick:d=>l(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:a})}):a}function Vt({label:e,href:r,icon:o,external:n,isCollapsed:s}){const l=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:l})}):l}const Ft={light:"dark",dark:"auto",auto:"light"},Ut={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},he={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function _t({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Ue();if(!s)return null;const l=o??r,a=l==="auto"?kt:l==="dark"?Mt:zt,d=t.jsxs(re,{"aria-label":he[l],onClick:()=>n(Ft[l]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(a,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Ut[l],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:he[l],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function Xt({open:e,onClose:r,logoHeader:o}){return t.jsx(vt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(je,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Qt({headerProps:e}){const r=G(),o=_e(r.breakpoints.up("md")),[n,s]=h.useState(!1),[l,a]=h.useState(!1);return h.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(je,{isCollapsed:l,onToggleCollapse:()=>a(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Xe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Lt,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Bt,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(h.Suspense,{fallback:t.jsx(qe,{}),children:t.jsx(Ye,{})})})]}),t.jsx(Xt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Qt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-CECvOvgr.js","assets/index-CDTd6FbM.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-o0Gqmq5F.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as Y,a as J,a1 as k,a2 as Q,r as d,u as X,i as Z,j as n,f as ee,y as M,h as ne,s as te,T as g,m as se,a3 as ae,a4 as N,b as _,F as V,a5 as oe,a6 as re,a7 as D,a8 as z,a9 as B,E as ie,H as p,aa as le,ab as C,ac as ce,ad as O,ae as ue,af as de,ag as pe,a0 as R,ah as $,ai as xe,A as W,aj as he,ak as me,al as I,am as fe,an as q,N as ye,ao as ge,ap as ve,aq as je,C as be,W as ke,ar as Ce,as as T,at as we}from"./index-CDTd6FbM.js";import{i as S,a as G,l as Ee}from"./documentRoutes-B2MDvZ3y.js";function Le(e){return Y("MuiLink",e)}const De=J("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Re=({theme:e,ownerState:s})=>{const t=s.color;if("colorSpace"in e&&e.colorSpace){const c=k(e,`palette.${t}.main`)||k(e,`palette.${t}`)||s.color;return e.alpha(c,.4)}const o=k(e,`palette.${t}.main`,!1)||k(e,`palette.${t}`,!1)||s.color,a=k(e,`palette.${t}.mainChannel`)||k(e,`palette.${t}Channel`);return"vars"in e&&a?`rgba(${a} / 0.4)`:Q(o,.4)},F={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},$e=e=>{const{classes:s,component:t,focusVisible:o,underline:a}=e,c={root:["root",`underline${M(a)}`,t==="button"&&"button",o&&"focusVisible"]};return ne(c,Le,s)},Se=te(g,{name:"MuiLink",slot:"Root",overridesResolver:(e,s)=>{const{ownerState:t}=e;return[s.root,s[`underline${M(t.underline)}`],t.component==="button"&&s.button]}})(se(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:s,ownerState:t})=>s==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:s,ownerState:t})=>s==="always"&&t.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(ae()).map(([s])=>({props:{underline:"always",color:s},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[s].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${De.focusVisible}`]:{outline:"auto"}}}]}))),We=d.forwardRef(function(s,t){const o=X({props:s,name:"MuiLink"}),a=Z(),{className:c,color:l="primary",component:u="a",onBlur:r,onFocus:i,TypographyClasses:m,underline:f="always",variant:x="inherit",sx:h,...v}=o,[L,w]=d.useState(!1),j=y=>{N(y.target)||w(!1),r&&r(y)},E=y=>{N(y.target)&&w(!0),i&&i(y)},b={...o,color:l,component:u,focusVisible:L,underline:f,variant:x},P=$e(b);return n.jsx(Se,{color:l,className:ee(P.root,c),classes:m,component:u,onBlur:j,onFocus:E,ref:t,ownerState:b,variant:x,...v,sx:[...F[l]===void 0?[{color:l}]:[],...Array.isArray(h)?h:[h]],style:{...v.style,...f==="always"&&l!=="inherit"&&!F[l]&&{"--Link-underlineColor":Re({theme:a,ownerState:b})}}})});function Pe(e,s){const t=_(),{reports:o,settled:a,isError:c}=V(e,s),l=a&&!c;return d.useCallback((u,r)=>{const i=u.path;if(!oe(i))return"malformed";const m=re(i,o),f=D(e,s,m.kind==="path"?m.report.path:i),x=new URLSearchParams(u.givens).toString();return t(f+(x?`?${x}`:""),r),m.kind==="path"?"resolved":l?"unresolved":"unverified"},[t,e,s,o,l])}function H({environmentName:e,packageName:s,path:t,editable:o=t.endsWith(".malloy")}){const{params:a,onGivensChange:c}=z(),l=Pe(e,s),u=_(),r=d.useMemo(()=>B({environmentName:e,packageName:s}),[e,s]),i=ie();return d.useEffect(()=>{if(!o||i)return;const m=()=>void O(()=>import("./index.es-CECvOvgr.js"),__vite__mapDeps([0,1,2,3])),f=window.requestIdleCallback;if(f){const h=f(m);return()=>window.cancelIdleCallback?.(h)}const x=setTimeout(m,1500);return()=>clearTimeout(x)},[o,i]),n.jsx(p,{sx:{p:3,maxWidth:1600,mx:"auto"},children:t.endsWith(".malloynb")?n.jsx(le,{resourceUri:C({environmentName:e,packageName:s,modelPath:t}),givens:a,onGivensChange:c,onNavigate:u,onDrillNavigate:l,maxResultSize:1024*1024}):n.jsx(ce,{resourceUri:C({environmentName:e,packageName:s}),path:t,givens:a,onGivensChange:c,onNavigate:l,onLinkNavigate:u,onEvent:r,maxResultSize:1024*1024})})}function Ne(){const[e,s]=d.useState(!1),t=d.useRef(!1),o=d.useRef(!1),a=d.useCallback(r=>{t.current=r,s(r)},[]),c=d.useCallback(()=>{o.current=!0},[]),l=ue(d.useCallback(({currentLocation:r,nextLocation:i})=>t.current&&!o.current&&(r.pathname!==i.pathname||S(r.search)!==S(i.search)),[]));d.useEffect(()=>{if(!e)return;const r=i=>{i.preventDefault(),i.returnValue=""};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[e]);const u=n.jsx(de,{open:l.state==="blocked",canSave:!1,onKeepEditing:()=>l.reset?.(),onDiscard:()=>l.proceed?.()});return{onDirtyChange:a,leaving:c,dialog:u}}const Te=xe.lazy(()=>O(()=>import("./index.es-CECvOvgr.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.ReportEditor})));function U({environmentName:e,packageName:s,path:t,layout:o="grid"}){const a=Ne(),c=d.useMemo(()=>B({environmentName:e,packageName:s}),[e,s]);return n.jsxs(p,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[n.jsx(pe,{children:n.jsx(d.Suspense,{fallback:n.jsx(R,{text:$.opening("builder")}),children:n.jsx(Te,{resourceUri:C({environmentName:e,packageName:s}),path:t,layout:o,onDirtyChange:a.onDirtyChange,onEvent:c},`${e}/${s}/${t}`)})}),a.dialog]})}function Fe({environmentName:e,packageName:s,routePath:t,edit:o,reports:a,children:c}){const{search:l}=W(),u=he(t);if(!u)return n.jsx(n.Fragment,{children:c});const r=me(u.name,a,u.prefer);return"found"in r?n.jsx(I,{replace:!0,to:`${D(e,s,r.found.path)}${o?G(l):l}`}):"ambiguous"in r?n.jsxs(p,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[n.jsxs(g,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",u.name]}),n.jsx(g,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This is an old link, which names a report by its file name alone. Open one by its path:"}),n.jsx(p,{component:"ul",sx:{mt:1},children:r.ambiguous.map(i=>n.jsx("li",{children:n.jsx(fe,{to:D(e,s,i),style:{fontFamily:q},children:i})},i))})]}):n.jsx(n.Fragment,{children:c})}function Ue({environmentName:e,packageName:s,routePath:t,edit:o,notFound:a,notFoundUntilListed:c=!1}){const{reports:l,settled:u,isFetching:r,isError:i,refetch:m}=V(e,s),{search:f}=W(),x=`${t}.malloy`,h=u?ye(x,l):void 0,v=u&&!r&&!i,[L,w]=d.useState();d.useEffect(()=>{v&&w(x)},[v,x]);const j=h!==void 0||v||L===x,E=ge(e,s,x,o&&j&&!h),b=K=>n.jsx(Fe,{environmentName:e,packageName:s,routePath:t,edit:o,reports:l,children:K});if(!j&&(c&&!o&&!h))return b(a);if(!j&&i&&!r)return n.jsx(p,{sx:{p:3,maxWidth:1200,mx:"auto"},children:n.jsxs(ve,{severity:"warning",action:n.jsx(je,{color:"inherit",size:"small",onClick:()=>void m(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",t,"."]})});if(!j)return n.jsx(R,{text:$.opening()});if(h)return o?n.jsx(U,{environmentName:e,packageName:s,path:h.path,layout:h.layout}):n.jsx(H,{environmentName:e,packageName:s,path:h.path,editable:h.editable});const y=o?void 0:Ee(t);return y!==void 0?n.jsx(I,{replace:!0,to:`/${e}/${s}/${y.split("/").map(encodeURIComponent).join("/")}${G(f)}`}):b(o?E.settled?n.jsx(U,{environmentName:e,packageName:s,path:x,layout:E.layout??"grid"}):n.jsx(R,{text:$.opening()}):a)}function _e(){const e=be(),{search:s}=W(),t=e["*"],{server:o}=ke(),{params:a,onGivensChange:c}=z();if(!e.environmentName)return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})});const l={p:3,maxWidth:1200,mx:"auto"};if(t!==void 0&&t!==""&&!t.endsWith(".malloy")&&!t.endsWith(".malloynb")){const r=t.replace(/\/$/,""),i=r.startsWith("data-apps/"),m=i?n.jsx(Ce,{resourceUri:C({environmentName:e.environmentName,packageName:e.packageName,modelPath:r.slice(10)})}):n.jsx(A,{environmentName:e.environmentName,packageName:e.packageName,modelPath:t,staticUrl:T({server:o,environmentName:e.environmentName,packageName:e.packageName,path:t})});return n.jsx(Ue,{environmentName:e.environmentName,packageName:e.packageName,routePath:r,edit:S(s),notFound:m,notFoundUntilListed:i})}const u=C({environmentName:e.environmentName,packageName:e.packageName,modelPath:t});return t?.endsWith(".malloy")?n.jsx(p,{sx:l,children:n.jsx(we,{resourceUri:u,runOnDemand:!0,maxResultSize:512*1024,givens:a,onGivensChange:c})}):t?.endsWith(".malloynb")?n.jsx(H,{environmentName:e.environmentName,packageName:e.packageName,path:t,editable:!1}):n.jsx(A,{environmentName:e.environmentName,packageName:e.packageName,modelPath:t??"",staticUrl:T({server:o,environmentName:e.environmentName,packageName:e.packageName,path:t??""})})}function A({packageName:e,modelPath:s,staticUrl:t}){const o=/\.[^./]+$/.test(s),a={fontFamily:q};return n.jsxs(p,{sx:{p:3,maxWidth:1200,mx:"auto"},children:[n.jsx(g,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),n.jsxs(g,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[n.jsx(p,{component:"span",sx:a,children:s})," ","does not name a report, a"," ",n.jsx(p,{component:"span",sx:a,children:".malloy"})," ","or a"," ",n.jsx(p,{component:"span",sx:a,children:".malloynb"})," ","file in package"," ",n.jsx(p,{component:"span",sx:a,children:e}),". This address opens reports by their path without"," ",n.jsx(p,{component:"span",sx:a,children:".malloy"}),", and"," ",n.jsx(p,{component:"span",sx:a,children:".malloy"})," ","and"," ",n.jsx(p,{component:"span",sx:a,children:".malloynb"})," ","files."]}),o&&n.jsxs(g,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",n.jsx(p,{component:"span",sx:a,children:"public/"})," ","directory is served at ",n.jsx(We,{href:t,children:t}),"."]}),n.jsx(g,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{_e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as m,b as p,r as u,a9 as g,j as n,ab as l,au as d}from"./index-CDTd6FbM.js";import{d as x}from"./documentRoutes-B2MDvZ3y.js";function j(){const{environmentName:e,packageName:a}=m(),s=p(),r=u.useMemo(()=>g({environmentName:e??"",packageName:a??""}),[e,a]);if(e)if(a){const t=l({environmentName:e,packageName:a});return n.jsx(d,{onClickPackageFile:s,onOpenDocument:({path:o,mode:i},c)=>s(x(e,a,o,i),c),resourceUri:t,onEvent:r})}else return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})});else return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})})}export{j as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as
|
|
1
|
+
import{j as M,H as oe,r as p,aW as he,R as ue,i as me,aX as be,aE as ye,aY as J,aZ as pe,a_ as fe,a$ as ge,b0 as ve,b1 as we,b2 as ke,b3 as ne}from"./index-CDTd6FbM.js";const v="publisher-drill";function xe(e,r){const t=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return t}const o=new Set;for(const a of l)!a||r(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!r(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||t.add(n)}return t}function D(e){const r=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return r?r[1]:void 0}function Ce(e,r){if(r.size!==0)for(const t of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===t,o=new Set;for(const n of t.querySelectorAll(".column-cell.th")){if(!l(n))continue;const i=(n.textContent??"").replace(/\u200b/g,"").trim(),b=D(n);b&&r.has(i)&&o.add(b)}if(o.size===0)continue;const a=new Set;for(const n of t.querySelectorAll(`.${v}[tabindex="0"]`)){if(!l(n))continue;const i=D(n);i&&(a.has(i)?n.tabIndex=-1:a.add(i))}for(const n of t.querySelectorAll(".column-cell.td")){if(!l(n))continue;const i=D(n),b=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(i&&b&&o.has(i)&&!n.querySelector(".malloy-table")){if(n.classList.add(v),n.tabIndex===0)a.add(i);else{const f=a.has(i);f||a.add(i),n.tabIndex=f?-1:0}n.setAttribute("role","button")}}}}function Ae(e){const r=e.closest(".malloy-table"),t=D(e);return!r||!t?[]:Array.from(r.querySelectorAll(`.${v}`)).filter(l=>l.closest(".malloy-table")===r&&D(l)===t)}function le(e,r){const t=Ae(e),l=t.indexOf(e);if(l===-1)return;const o=r==="first"?t[0]:r==="last"?t[t.length-1]:t[Math.min(Math.max(l+r,0),t.length-1)];if(o){for(const a of t)a.tabIndex=a===o?0:-1;return o}}function Se(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function Ee(e){const{foreground:r,axisFaint:t,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:r,font:o.family},axis:{labelColor:r,titleColor:r,domainColor:t,tickColor:t,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:r,titleColor:r,labelFont:o.family,titleFont:o.family},header:{labelColor:r,titleColor:r},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return i=>i==="shape_map"?n:a}function ze(e){if(!e)return;const r=e.tag("theme");if(!r)return;const t={},l=r.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const i of he){const b=l.tag(i);if(!b)continue;const f={},x=b.text("light"),w=b.text("dark");x&&(f.light=x),w&&(f.dark=w),Object.keys(f).length>0&&(a[i]=f)}Object.keys(a).length>0&&(t.palette=a)}const o=r.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(a.size=i),Object.keys(a).length>0&&(t.font=a)}return Object.keys(t).length>0?t:void 0}const B="data-publisher-fill",Re=async(e,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await fe();return new t({onClick:r,vegaConfigOverride:Ee(e),theme:Se(e),onError:l=>{console.error("Error rendering visualization:",typeof l,l)}}).createViz()};async function je(e){if(!e||typeof e!="object")return;const r=e,t=[...Array.isArray(r.model_annotations)?r.model_annotations:[],...Array.isArray(r.source_annotations)?r.source_annotations:[],...Array.isArray(r.annotations)?r.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(t.length===0)return;let l;try{({parseAnnotation:l}=await pe())}catch{return}try{const{tag:o}=l(t);return ze(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:t});return}}function Te(e,r,t){const l=ge(r,t);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const Fe=`
|
|
2
2
|
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
3
3
|
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
4
4
|
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
@@ -150,4 +150,4 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
|
150
150
|
color: var(--publisher-drill-link) !important;
|
|
151
151
|
text-decoration: underline;
|
|
152
152
|
}
|
|
153
|
-
`,se="publisher-malloy-renderer-overrides";function Oe(){if(typeof document>"u"||document.getElementById(se))return;const e=document.createElement("style");e.id=se,e.textContent=
|
|
153
|
+
`,se="publisher-malloy-renderer-overrides";function Oe(){if(typeof document>"u"||document.getElementById(se))return;const e=document.createElement("style");e.id=se,e.textContent=Fe,document.head.appendChild(e)}function $e({result:e,height:r,drill:t,onSizeChange:l,onSizing:o,fill:a}){const n=p.useRef(null),i=p.useRef(t);i.current=t;const b=p.useCallback(c=>{i.current?.onClick(c)},[]),f=t!==void 0,x=p.useRef(!1),w=p.useRef(null),q=p.useRef(0),{theme:K,layers:W,mode:X}=ue(),Y=me().shape.borderRadius,U=p.useMemo(()=>({radius:`${Y}px`,padding:`${be}px`}),[Y]);return p.useEffect(()=>()=>{q.current+=1;const c=w.current;c?.viz.remove(),c?.node.remove(),w.current=null},[]),p.useLayoutEffect(()=>{if(!n.current||!e)return;Oe();const c=n.current,ie=q.current+=1;let P=!1;const H=()=>!P&&ie===q.current;let d,m,_=null,V=0,I=null,L=null,N=null,j=null,T=null,F=null,Z=null,Q=0,A=null;x.current=!1;let g,S;const G=k=>{if(P||!k.firstElementChild||J(g,S)==="container")return;const O=ve(g,S);if(x.current&&!O)return;const $=c.hasAttribute(B);$&&c.removeAttribute(B);const E=we(k,ne(g));$&&c.setAttribute(B,""),E>0&&(x.current=!0,l&&E!==Q&&(Q=E,l(E)));const h=ke(k,ne(g));O&&h&&Z!==h&&(Z=h,F?.disconnect(),F=new ResizeObserver(()=>G(k)),F.observe(h))};return(async()=>{let k;try{k=JSON.parse(e)}catch(y){console.error("Error parsing visualization result:",y);return}const O=await je(k),$=O?ye([...W,O],X):K;if(!H())return;try{m=await Re($,b)}catch(y){console.error("Failed to create renderer:",y);return}if(!H()){m.remove(),m=void 0;return}const E=w.current;d=document.createElement("div"),d.style.width="100%",d.style.height="100%",Te(d,$,U),c.childElementCount>0&&(c.style.position="relative",d.style.position="absolute",d.style.inset="0",d.style.visibility="hidden"),c.appendChild(d);const h=d;j=new MutationObserver(()=>{T&&clearTimeout(T),T=setTimeout(()=>{G(h),x.current&&j?.disconnect()},100)}),j.observe(d,{childList:!0,subtree:!0,attributes:!0});const de=m;let ee=!1;const re=()=>{if(!(ee||!H())){ee=!0,A&&(clearTimeout(A),A=null),E?.viz.remove();for(const y of Array.from(c.children))y!==h&&c.removeChild(y);h.style.position="",h.style.inset="",h.style.visibility="",c.style.position="",w.current={viz:de,node:h},G(h)}};try{m.setResult(k);try{const C=m.getMetadata(),z=C?.getRootField();g=z?.renderAs(),S=z?C?.getPluginsForField(z.key)?.[0]?.sizingStrategy:void 0}catch{g=void 0,S=void 0}o?.(J(g,S)),d.dataset.malloyRenderAs=g??"unknown",d.dataset.malloySizing=J(g,S),m.render(d);const y=i.current;try{if(y){const C=xe(m,y.canDrill),z=()=>{try{Ce(h,C)}catch(s){console.warn("Drill affordance skipped:",s)}};z();const te=s=>{const u=s.querySelector(".cell-content")??s,R=u.getBoundingClientRect();u.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:u.ownerDocument.defaultView,clientX:Math.round(R.left+R.width/2),clientY:Math.round(R.bottom)}))},ae=s=>s.target?.closest?.(`.${v}`)??null,ce=(s,u)=>{le(s,u)?.focus()};I=s=>{const u=ae(s);if(!u)return;const R=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(R!==void 0){s.preventDefault(),ce(u,R);return}s.key==="Enter"?(s.preventDefault(),te(u)):s.key===" "&&s.preventDefault()},L=s=>{if(s.key!==" ")return;const u=ae(s);u&&(s.preventDefault(),te(u))},N=s=>{const u=s.target?.closest?.(`.${v}`);u&&le(u,0)},h.addEventListener("keydown",I),h.addEventListener("keyup",L),h.addEventListener("focusin",N),C.size>0&&typeof MutationObserver<"u"&&(_=new MutationObserver(()=>{cancelAnimationFrame(V),V=requestAnimationFrame(z)}),_.observe(h,{childList:!0,subtree:!0}))}}catch(C){console.warn("Drill affordance skipped:",C)}m.onReady(re),A=setTimeout(re,1e4)}catch(y){console.error("Error rendering visualization:",y),j?.disconnect(),F?.disconnect(),_?.disconnect(),m.remove(),m=void 0,h.parentNode===c&&c.removeChild(h)}})(),()=>{P=!0,j?.disconnect(),F?.disconnect(),T&&clearTimeout(T),A&&clearTimeout(A),d&&w.current?.node!==d&&(I&&d.removeEventListener("keydown",I),L&&d.removeEventListener("keyup",L),N&&d.removeEventListener("focusin",N),_?.disconnect(),cancelAnimationFrame(V),m?.remove(),d.parentNode===c&&c.removeChild(d),c.style.position="")}},[e,b,f,l,o,K,W,X,U]),M.jsx("div",{ref:n,...a?{[B]:""}:{},style:{width:"100%",height:r?`${r}px`:"400px"}})}function Me(e){return typeof window>"u"?M.jsx(oe,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):M.jsx(p.Suspense,{fallback:M.jsx(oe,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:M.jsx($e,{...e})})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:Me},Symbol.toStringTag,{value:"Module"}));export{v as D,Me as R,Ee as a,Se as b,De as c,xe as d,Ce as m,ze as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ay as o,j as r,az as s,aA as n,H as t,T as a}from"./index-CDTd6FbM.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
|