@malloy-publisher/server 0.9.1 → 0.9.3
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/README.docker.md +14 -0
- package/dist/app/api-doc.yaml +414 -98
- package/dist/app/assets/EnvironmentPage-uo3igcP9.js +1 -0
- package/dist/app/assets/{HomePage-D3MvQaZn.js → HomePage-0OQVchl4.js} +1 -1
- package/dist/app/assets/MainPage-D4SOACdm.js +1 -0
- package/dist/app/assets/ModelPage-B5CpdEDl.js +2 -0
- package/dist/app/assets/PackagePage-BzUfTQKy.js +1 -0
- package/dist/app/assets/RenderedResult-DwB0-9Yx.es-1MzhmBXH.js +141 -0
- package/dist/app/assets/{RouteError-BQnzPJvb.js → RouteError-BXcrPjvD.js} +1 -1
- package/dist/app/assets/ThemeEditorPage-FpYg5NPt.js +1 -0
- package/dist/app/assets/{ToggleButtonGroup-CJT2JKTC.js → ToggleButtonGroup-Vkkjsbxx.js} +1 -1
- package/dist/app/assets/documentRoutes-BWHzvbNO.js +1 -0
- package/dist/app/assets/index-BZEvIUf-.js +484 -0
- package/dist/app/assets/index-CprgMbE_.js +1 -0
- package/dist/app/assets/{index-ufFZR_K-.js → index-DFvJYp4Q.js} +7 -7
- package/dist/app/assets/index-NVPzfbUZ.js +1317 -0
- package/dist/app/assets/{index-ireHUsv_.js → index-sKcoT1e_.js} +422 -427
- package/dist/app/assets/index.es-D2Ts8adM.js +195 -0
- package/dist/app/index.html +1 -1
- package/dist/package_load_worker.mjs +801 -80
- package/dist/server.mjs +21707 -17510
- package/package.json +15 -15
- package/dist/app/assets/EnvironmentPage-UMS7Py4Q.js +0 -1
- package/dist/app/assets/LightMode-e1lNBfpL.js +0 -1
- package/dist/app/assets/MainPage-B0ozqtQO.js +0 -2
- package/dist/app/assets/ModelPage-lQj4Axqu.js +0 -2
- package/dist/app/assets/PackagePage-BT0YKNKU.js +0 -1
- package/dist/app/assets/RenderedResult-BRgIgxWh.es-DiE7kPNX.js +0 -136
- package/dist/app/assets/ThemeEditorPage-D6t7w9Js.js +0 -1
- package/dist/app/assets/index-ByieDZlo.js +0 -23
- package/dist/app/assets/index-CCNqF0-G.js +0 -1
- package/dist/app/assets/index-CKmZ4HG7.js +0 -1322
- package/dist/app/assets/index-CdExa3Pk.js +0 -1
- package/dist/app/assets/index-TiWjmdoW.js +0 -450
- package/dist/app/assets/index.es-iUV0gCYk.js +0 -111
- package/dist/sshcrypto-cqb52edz.node +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as r,E as t,j as e,a5 as i,am as o}from"./index-BZEvIUf-.js";function c(){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{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{q as t,j as o,J as a}from"./index-BZEvIUf-.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as g,j as t,s as E,B as Se,m as Q,e as le,g as he,a as xe,r as u,u as me,b as Me,d as V,f as fe,T as G,h as K,i as Ce,k as Pe,l as Ee,o as ge,n as ze,p as Ie,t as ce,v as De,w as Te,x as N,y as $,M as Re,P as Be,z as Le,S as He,A as Z,C as $e,D as Oe,I as de,E as ye,q as J,F as p,G as Ne,H as Y,K as W,L as ee,N as Ae,O as Ve,Q as pe,R as We,U as te,V as re,W as ne,X as Fe,Y as Ue,Z as _e,_ as Xe}from"./index-BZEvIUf-.js";import{e as Ye,s as qe}from"./documentRoutes-BWHzvbNO.js";const Qe=g(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"})),Ge=E(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:le(e.palette.grey[200],.12)}:{backgroundColor:le(e.palette.grey[600],.12)}}}))),Ke=E(Qe)({width:24,height:16});function Ze(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(Ge,{focusRipple:!0,...n,ownerState:s,children:t.jsx(Ke,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function Je(e){return he("MuiBreadcrumbs",e)}const et=xe("MuiBreadcrumbs",["root","ol","li","separator"]),tt=e=>{const{classes:r}=e;return fe({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Je,r)},rt=E(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${et.li}`]:r.li},r.root]})({}),nt=E("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ot=E("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function st(e,r,o,n){return e.reduce((s,l,i)=>(i<e.length-1?s=s.concat(l,t.jsx(ot,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(l),s),[])}const at=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiBreadcrumbs"}),{children:s,className:l,component:i="nav",slots:d={},slotProps:f={},expandText:h="Show path",itemsAfterCollapse:m=1,itemsBeforeCollapse:v=1,maxItems:y=8,separator:z="/",...H}=n,[I,M]=u.useState(!1),j={...n,component:i,expanded:I,expandText:h,itemsAfterCollapse:m,itemsBeforeCollapse:v,maxItems:y,separator:z},C=tt(j),D=Me({elementType:d.CollapsedIcon,externalSlotProps:f.collapsedIcon,ownerState:j}),k=u.useRef(null),w=c=>{const S=()=>{M(!0);const b=k.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return v+m>=c.length?c:[...c.slice(0,v),t.jsx(Ze,{"aria-label":h,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:D},onClick:S},"ellipsis"),...c.slice(c.length-m,c.length)]},T=u.Children.toArray(s).filter(c=>u.isValidElement(c)).map((c,S)=>t.jsx("li",{className:C.li,children:c},`child-${S}`));return t.jsx(rt,{ref:o,component:i,color:"textSecondary",className:V(C.root,l),ownerState:j,...H,children:t.jsx(nt,{className:C.ol,ref:k,ownerState:j,children:st(I||y&&T.length<=y?T:w(T),C.separator,z,j)})})});function it(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),l=ge(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const h=l.getComputedStyle(r);i=h.getPropertyValue("-webkit-transform")||h.getPropertyValue("transform")}let d=0,f=0;if(i&&i!=="none"&&typeof i=="string"){const h=i.split("(")[1].split(")")[0].split(",");d=parseInt(h[4],10),f=parseInt(h[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+f-n.top}px)`:`translateY(${l.innerHeight+f-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-f}px)`:`translateY(-${n.top+n.height-f}px)`}function lt(e){return typeof e=="function"?e():e}function A(e,r,o){const n=lt(o),s=it(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ct=u.forwardRef(function(r,o){const n=K(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},l={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:f,container:h,direction:m="down",easing:v=s,in:y,onEnter:z,onEntered:H,onEntering:I,onExit:M,onExited:j,onExiting:C,style:D,timeout:k=l,TransitionComponent:w=Ce,...T}=r,c=u.useRef(null),S=Pe(Ee(f),c,o),b=a=>x=>{a&&(x===void 0?a(c.current):a(c.current,x))},F=b((a,x)=>{A(m,a,h),Ie(a),z&&z(a,x)}),se=b((a,x)=>{const L=ce({timeout:k,style:D,easing:v},{mode:"enter"});a.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),a.style.transition=n.transitions.create("transform",{...L}),a.style.webkitTransform="none",a.style.transform="none",I&&I(a,x)}),R=b(H),B=b(C),P=b(a=>{const x=ce({timeout:k,style:D,easing:v},{mode:"exit"});a.style.webkitTransition=n.transitions.create("-webkit-transform",x),a.style.transition=n.transitions.create("transform",x),A(m,a,h),M&&M(a)}),U=b(a=>{a.style.webkitTransition="",a.style.transition="",j&&j(a)}),_=a=>{i&&i(c.current,a)},O=u.useCallback(()=>{c.current&&A(m,c.current,h)},[m,h]);return u.useEffect(()=>{if(y||m==="down"||m==="right")return;const a=ze(()=>{c.current&&A(m,c.current,h)}),x=ge(c.current);return x.addEventListener("resize",a),()=>{a.clear(),x.removeEventListener("resize",a)}},[m,y,h]),u.useEffect(()=>{y||O()},[y,O]),t.jsx(w,{nodeRef:c,onEnter:F,onEntered:R,onEntering:se,onExit:P,onExited:U,onExiting:B,addEndListener:_,appear:d,in:y,timeout:k,...T,children:(a,{ownerState:x,...L})=>u.cloneElement(f,{ref:S,style:{visibility:a==="exited"&&!y?"hidden":void 0,...D,...f.props.style},...L})})});function dt(e){return he("MuiDrawer",e)}xe("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]},pt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return fe(s,dt,r)},ut=E(Re,{name:"MuiDrawer",slot:"Root",overridesResolver:be})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ht=E("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:be})({flex:"0 0 auto"}),xt=E(Be,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(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}`}}]}))),je={left:"right",right:"left",top:"down",bottom:"up"};function mt(e){return["left","right"].includes(e)}function ft({direction:e},r){return e==="rtl"&&mt(r)?je[r]:r}const gt=u.forwardRef(function(r,o){const n=me({props:r,name:"MuiDrawer"}),s=K(),l=De(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:f,children:h,className:m,elevation:v=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:z,...H}={},onClose:I,open:M=!1,PaperProps:j={},SlideProps:C,TransitionComponent:D,transitionDuration:k=i,variant:w="temporary",slots:T={},slotProps:c={},...S}=n,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const F=ft({direction:l?"rtl":"ltr"},d),R={...n,anchor:d,elevation:v,open:M,variant:w,...S},B=pt(R),P={slots:{transition:D,...T},slotProps:{paper:j,transition:C,...c,backdrop:Te(c.backdrop||{...f,...z},{transitionDuration:k})}},[U,_]=N("root",{ref:o,elementType:ut,className:V(B.root,B.modal,m),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...P,...S,...H},additionalProps:{open:M,onClose:I,hideBackdrop:y,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[O,a]=N("paper",{elementType:xt,shouldForwardComponentProp:!0,className:V(B.paper,j.className),ownerState:R,externalForwardedProps:P,additionalProps:{elevation:w==="temporary"?v:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[x,L]=N("docked",{elementType:ht,ref:o,className:V(B.root,B.docked,m),ownerState:R,externalForwardedProps:P,additionalProps:S}),[ke,we]=N("transition",{elementType:ct,ownerState:R,externalForwardedProps:P,additionalProps:{in:M,direction:je[F],timeout:k,appear:b.current}}),ae=t.jsx(O,{...a,children:h});if(w==="permanent")return t.jsx(x,{...L,children:ae});const ie=t.jsx(ke,{...we,children:ae});return w==="persistent"?t.jsx(x,{...L,children:ie}):t.jsx(U,{..._,children:ie})}),yt=g([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")]),bt=g(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"})),jt=g(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),vt=g(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"})),kt=g(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"})),wt=g(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"})),St=g(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"})),Mt=g(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Ct=g(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"})),Pt=g(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"})),Et=g([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")]),zt=g(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(He,{...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 It=/^(.*\/[^/]+\/[^/]+\/(?:dashboards|notebooks)\/([^/]+?))(\/edit)?\/?$/,Dt=/\.malloy(nb)?$/;function Tt(){const{pathname:e}=Z(),r=$e(),o=Oe(),n=It.exec(e);if(!n||o)return null;const[,s,l,i]=n;return Dt.test(l)?null:i?t.jsx(de,{label:"View",icon:t.jsx(zt,{}),onClick:()=>r(s)}):t.jsx(de,{label:"Edit",icon:t.jsx(wt,{}),onClick:()=>r(Ye(s))})}function X({label:e,onClick:r}){return t.jsx(Ne,{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 Rt(){const e=ye(),r=e["*"]?qe(e["*"]).path:void 0,o=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(p,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(at,{"aria-label":"breadcrumb",separator:t.jsx(jt,{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 Bt=260,Lt=64;function ve({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(p,{sx:{height:"100dvh",width:e?Lt:Bt,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(Ht,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(p,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx($t,{isCollapsed:e}),t.jsx(Ot,{isCollapsed:e})]}),t.jsx(Nt,{isCollapsed:e})]})}function Ht({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=J();return o?t.jsxs(p,{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(p,{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(p,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(p,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(G,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(W,{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 $t({isCollapsed:e}){const o=Z().pathname==="/";return t.jsx(ee,{sx:{py:0},children:t.jsx(oe,{icon:t.jsx(Mt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Ot({isCollapsed:e}){const{apiClients:r}=Ae(),o=ye(),{data:n}=Ve({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(p,{sx:{mt:1},children:[!e&&t.jsx(G,{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(ee,{sx:{py:0},children:s.map(l=>{const i=l.name??"";return t.jsx(oe,{icon:t.jsx(St,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Nt({isCollapsed:e}){const{pathname:r}=Z(),o=[{label:"Malloy Docs",href:pe.docsHome,icon:t.jsx(yt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:pe.publishing,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(vt,{fontSize:"small"}),external:!1}];return t.jsxs(ee,{sx:{py:1},children:[t.jsx(oe,{icon:t.jsx(Et,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Ft,{isCollapsed:e}),o.map(n=>t.jsx(At,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function oe({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const l=J(),i=t.jsxs(te,{selected:n,onClick:d=>l(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(ne,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:r,placement:"right",children:t.jsx(p,{children:i})}):i}function At({label:e,href:r,icon:o,external:n,isCollapsed:s}){const l=t.jsxs(te,{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(re,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(ne,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(W,{title:e,placement:"right",children:t.jsx(p,{children:l})}):l}const Vt={light:"dark",dark:"auto",auto:"light"},Wt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},ue={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Ft({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=We();if(!s)return null;const l=o??r,i=l==="auto"?bt:l==="dark"?kt:Ct,d=t.jsxs(te,{"aria-label":ue[l],onClick:()=>n(Vt[l]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(re,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(ne,{primary:Wt[l],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(W,{title:ue[l],placement:"right",disableHoverListener:!e,children:t.jsx(p,{children:d})})}function Ut({open:e,onClose:r,logoHeader:o}){return t.jsx(gt,{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(ve,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Yt({headerProps:e}){const r=K(),o=Fe(r.breakpoints.up("md")),[n,s]=u.useState(!1),[l,i]=u.useState(!1);return u.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(p,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(ve,{isCollapsed:l,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(p,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(p,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Ue.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(p,{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(p,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Rt,{})}),t.jsxs(p,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Tt,{}),e?.endCap]})]}),t.jsx(p,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(_e,{})})})]}),t.jsx(Ut,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Yt as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-D2Ts8adM.js","assets/index-BZEvIUf-.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-Vkkjsbxx.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as q,a as B,$ as f,a0 as G,r as d,u as O,h as H,j as o,d as K,y as P,f as J,s as Q,T as b,m as X,a1 as Y,a2 as L,q as S,a3 as C,D as _,F as m,a4 as Z,a5 as g,a6 as w,a7 as ee,a8 as ne,a9 as T,aa as te,ab as oe,_ as U,ac as F,ad as se,ae,af as re,E as ie,N as le,ag as ce,ah as ue,ai as de,aj as x}from"./index-BZEvIUf-.js";import{s as R}from"./documentRoutes-BWHzvbNO.js";function pe(e){return q("MuiLink",e)}const me=B("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),he=({theme:e,ownerState:n})=>{const t=n.color;if("colorSpace"in e&&e.colorSpace){const a=f(e,`palette.${t}.main`)||f(e,`palette.${t}`)||n.color;return e.alpha(a,.4)}const s=f(e,`palette.${t}.main`,!1)||f(e,`palette.${t}`,!1)||n.color,l=f(e,`palette.${t}.mainChannel`)||f(e,`palette.${t}Channel`);return"vars"in e&&l?`rgba(${l} / 0.4)`:G(s,.4)},$={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},xe=e=>{const{classes:n,component:t,focusVisible:s,underline:l}=e,a={root:["root",`underline${P(l)}`,t==="button"&&"button",s&&"focusVisible"]};return J(a,pe,n)},fe=Q(b,{name:"MuiLink",slot:"Root",overridesResolver:(e,n)=>{const{ownerState:t}=e;return[n.root,n[`underline${P(t.underline)}`],t.component==="button"&&n.button]}})(X(({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:n,ownerState:t})=>n==="always"&&t.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:n,ownerState:t})=>n==="always"&&t.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(Y()).map(([n])=>({props:{underline:"always",color:n},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[n].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"},[`&.${me.focusVisible}`]:{outline:"auto"}}}]}))),ye=d.forwardRef(function(n,t){const s=O({props:n,name:"MuiLink"}),l=H(),{className:a,color:r="primary",component:u="a",onBlur:i,onFocus:c,TypographyClasses:p,underline:h="always",variant:v="inherit",sx:k,...D}=s,[M,E]=d.useState(!1),N=y=>{L(y.target)||E(!1),i&&i(y)},I=y=>{L(y.target)&&E(!0),c&&c(y)},j={...s,color:r,component:u,focusVisible:M,underline:h,variant:v},z=xe(j);return o.jsx(fe,{color:r,className:K(z.root,a),classes:p,component:u,onBlur:N,onFocus:I,ref:t,ownerState:j,variant:v,...D,sx:[...$[r]===void 0?[{color:r}]:[],...Array.isArray(k)?k:[k]],style:{...D.style,...h==="always"&&r!=="inherit"&&!$[r]&&{"--Link-underlineColor":he({theme:l,ownerState:j})}}})});function V(e,n){const t=S();return d.useCallback((s,l)=>{const a=new URLSearchParams(s.givens).toString(),r=encodeURIComponent(e),u=encodeURIComponent(n),i=encodeURIComponent(s.dashboard);t(`/${r}/${u}/dashboards/${i}`+(a?`?${a}`:""),l)},[t,e,n])}function A({environmentName:e,packageName:n,notebookPath:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=S(),u=t.endsWith(".malloy"),i=_();return d.useEffect(()=>{if(!u||i)return;const c=()=>void w(()=>import("./index.es-D2Ts8adM.js"),__vite__mapDeps([0,1,2,3])),p=window.requestIdleCallback;if(p){const v=p(c);return()=>window.cancelIdleCallback?.(v)}const h=setTimeout(c,1500);return()=>clearTimeout(h)},[u,i]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(Z,{resourceUri:g({environmentName:e,packageName:n,modelPath:t}),maxResultSize:1024*1024,givens:s,onGivensChange:l,onNavigate:r,onDrillNavigate:a})})}function be(){const[e,n]=d.useState(!1),t=d.useRef(!1),s=d.useRef(!1),l=d.useCallback(i=>{t.current=i,n(i)},[]),a=d.useCallback(()=>{s.current=!0},[]),r=ee(d.useCallback(({currentLocation:i,nextLocation:c})=>t.current&&!s.current&&i.pathname!==c.pathname,[]));d.useEffect(()=>{if(!e)return;const i=c=>{c.preventDefault(),c.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const u=o.jsx(ne,{open:r.state==="blocked",canSave:!1,onKeepEditing:()=>r.reset?.(),onDiscard:()=>r.proceed?.()});return{onDirtyChange:l,leaving:a,dialog:u}}const ge=se.lazy(()=>w(()=>import("./index.es-D2Ts8adM.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.DashboardEditor})));function ve({environmentName:e,packageName:n,dashboardName:t,kind:s="dashboard",path:l}){const a=be(),r=d.useMemo(()=>s==="dashboard"?T({environmentName:e,packageName:n,dashboardName:t}):te({environmentName:e,packageName:n,notebookName:t}),[s,e,n,t]);return o.jsxs(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:[o.jsx(oe,{children:o.jsx(d.Suspense,{fallback:o.jsx(U,{text:F.opening("builder")}),children:o.jsx(ge,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,kind:s,path:l,onDirtyChange:a.onDirtyChange,onEvent:r},`${e}/${n}/${s}/${t}`)})}),a.dialog]})}function ke({environmentName:e,packageName:n,dashboardName:t}){const{params:s,onGivensChange:l}=C(),a=V(e,n),r=d.useMemo(()=>T({environmentName:e,packageName:n,dashboardName:t}),[e,n,t]),u=_();return d.useEffect(()=>{if(u)return;const i=()=>void w(()=>import("./index.es-D2Ts8adM.js"),__vite__mapDeps([0,1,2,3])),c=window.requestIdleCallback;if(c){const h=c(i);return()=>window.cancelIdleCallback?.(h)}const p=setTimeout(i,1500);return()=>clearTimeout(p)},[u]),o.jsx(m,{sx:{p:3,maxWidth:1600,mx:"auto"},children:o.jsx(ae,{resourceUri:g({environmentName:e,packageName:n}),dashboard:t,givens:s,onGivensChange:l,onNavigate:a,onEvent:r,maxResultSize:1024*1024})})}function W({environmentName:e,packageName:n,routeKind:t,slug:s,edit:l}){const{location:a,settled:r}=re(e,n,t,s);if(!r)return o.jsx(U,{text:F.opening()});const u=a?.kind??t;return l?o.jsx(ve,{environmentName:e,packageName:n,dashboardName:s,kind:u,...a?{path:a.path}:{}}):u==="dashboard"?o.jsx(ke,{environmentName:e,packageName:n,dashboardName:s}):o.jsx(A,{environmentName:e,packageName:n,notebookPath:a?.path??`notebooks/${s}.malloy`})}function we(){const e=ie(),n=e["*"],{server:t}=le(),{params:s,onGivensChange:l}=C();if(!e.environmentName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return o.jsx("div",{children:o.jsx("h2",{children:"Missing package name"})});const a={p:3,maxWidth:1200,mx:"auto"};if(n?.startsWith("dashboards/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(11),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"dashboard",slug:p,edit:h})}if(n?.startsWith("notebooks/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),{path:p,edit:h}=R(c);return o.jsx(W,{environmentName:e.environmentName,packageName:e.packageName,routeKind:"notebook",slug:p,edit:h})}if(n?.startsWith("data-apps/")&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const c=n.slice(10),p=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:c});return o.jsx(ce,{resourceUri:p})}const r=g({environmentName:e.environmentName,packageName:e.packageName,modelPath:n});if(n?.endsWith(".malloy"))return o.jsx(m,{sx:a,children:o.jsx(ue,{resourceUri:r,runOnDemand:!0,maxResultSize:512*1024,givens:s,onGivensChange:l})});if(n?.endsWith(".malloynb"))return o.jsx(A,{environmentName:e.environmentName,packageName:e.packageName,notebookPath:n});const u=/\.[^./]+$/.test(n??""),i=de({server:t,environmentName:e.environmentName,packageName:e.packageName,path:n??""});return o.jsxs(m,{sx:a,children:[o.jsx(b,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[o.jsx(m,{component:"span",sx:{fontFamily:x},children:n})," ","does not name a"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","or"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","file in package"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:e.packageName}),". This address opens"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloy"})," ","and"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:".malloynb"})," ","files."]}),u&&o.jsxs(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",o.jsx(m,{component:"span",sx:{fontFamily:x},children:"public/"})," ","directory is served at ",o.jsx(ye,{href:i,children:i}),"."]}),o.jsx(b,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its models, notebooks, and data apps."})]})}export{we as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as m,q as u,j as e,a5 as d,ak as l}from"./index-BZEvIUf-.js";import{d as g}from"./documentRoutes-BWHzvbNO.js";function h(){const{environmentName:n,packageName:a}=m(),s=u();if(n)if(a){const i=d({environmentName:n,packageName:a});return e.jsx(l,{onClickPackageFile:s,onOpenDocument:({kind:r,slug:t,mode:o},c)=>s(g(n,a,r,t,o),c),resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{h as default};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import{j as $,F as oe,r as f,aN as he,R as ue,h as me,aO as be,at as ye,aP as K,aQ as fe,aR as pe,aS as ge,aT as ve,aU as we,aV as ke,aW as ne}from"./index-BZEvIUf-.js";const v="publisher-drill";function xe(e,t){const r=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return r}const a=new Set;for(const o of l)!o||t(o)||o.tag?.tag("hidden")===void 0&&a.add(o.tag?.text("label")??o.name);for(const o of l){if(!o||!t(o))continue;const n=o.tag?.text("label")??o.name;a.has(n)||r.add(n)}return r}function D(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function Ce(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===r,a=new Set;for(const n of r.querySelectorAll(".column-cell.th")){if(!l(n))continue;const i=(n.textContent??"").replace(/\u200b/g,"").trim(),b=D(n);b&&t.has(i)&&a.add(b)}if(a.size===0)continue;const o=new Set;for(const n of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!l(n))continue;const i=D(n);i&&(o.has(i)?n.tabIndex=-1:o.add(i))}for(const n of r.querySelectorAll(".column-cell.td")){if(!l(n))continue;const i=D(n),b=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(i&&b&&a.has(i)&&!n.querySelector(".malloy-table")){if(n.classList.add(v),n.tabIndex===0)o.add(i);else{const p=o.has(i);p||o.add(i),n.tabIndex=p?-1:0}n.setAttribute("role","button")}}}}function Ae(e){const t=e.closest(".malloy-table"),r=D(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(l=>l.closest(".malloy-table")===t&&D(l)===r)}function le(e,t){const r=Ae(e),l=r.indexOf(e);if(l===-1)return;const a=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(l+t,0),r.length-1)];if(a){for(const o of r)o.tabIndex=o===a?0:-1;return a}}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:t,axisFaint:r,gridline:l,font:a}=e,o={background:e.background,font:a.family,title:{color:t,font:a.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:l,labelFont:a.family,titleFont:a.family},legend:{labelColor:t,titleColor:t,labelFont:a.family,titleFont:a.family},header:{labelColor:t,titleColor:t},range:{category:e.series}};return n=>o}function Fe(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},l=t.tag("palette");if(l){const o={},n=l.textArray("series");n&&n.length>0&&(o.series=n);for(const i of he){const b=l.tag(i);if(!b)continue;const p={},x=b.text("light"),w=b.text("dark");x&&(p.light=x),w&&(p.dark=w),Object.keys(p).length>0&&(o[i]=p)}Object.keys(o).length>0&&(r.palette=o)}const a=t.tag("font");if(a){const o={},n=a.text("family");n&&(o.family=n);const i=a.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(o.size=i),Object.keys(o).length>0&&(r.font=o)}return Object.keys(r).length>0?r:void 0}const B="data-publisher-fill",ze=async(e,t)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:r}=await pe();return new r({onClick:t,vegaConfigOverride:Ee(e),theme:Se(e),onError:l=>{console.error("Error rendering visualization:",typeof l,l)}}).createViz()};async function Re(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(a=>typeof a?.value=="string"?a.value:void 0).filter(a=>!!a);if(r.length===0)return;let l;try{({parseAnnotation:l}=await fe())}catch{return}try{const{tag:a}=l(r);return Fe(a)}catch(a){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:a,lines:r});return}}function je(e,t,r){const l=ge(t,r);for(const[a,o]of Object.entries(l))e.style.setProperty(a,o)}const Oe=`
|
|
2
|
+
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
3
|
+
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
4
|
+
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
5
|
+
inherited from our wrapper loses to that declaration however early it is set:
|
|
6
|
+
this has to be a rule on the same element, at higher specificity. Doubling the
|
|
7
|
+
class does that, and then no !important is needed — which matters, because
|
|
8
|
+
!important here also lands on .dashboard-item-borderless and repaints a card
|
|
9
|
+
the author asked to have no card. */
|
|
10
|
+
.malloy-render.malloy-render {
|
|
11
|
+
--malloy-theme--dashboard-card-radius: var(--publisher-dashboard-card-radius);
|
|
12
|
+
--malloy-theme--dashboard-card-padding: var(--publisher-dashboard-card-padding);
|
|
13
|
+
}
|
|
14
|
+
/* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
|
|
15
|
+
and .dashboard-row-header, which would paint light grey in dark
|
|
16
|
+
mode and also bleed an operator-picked palette.background across
|
|
17
|
+
the panel chrome in light. Both surfaces use
|
|
18
|
+
--malloy-render--background here, which buildMalloyExplicitTheme
|
|
19
|
+
wires to dashboardRoot: a mode-keyed neutral that stays decoupled
|
|
20
|
+
from palette.background (the chart canvas) on purpose. Selectors
|
|
21
|
+
are duplicated at higher specificity to beat the renderer s own
|
|
22
|
+
scoped rules. */
|
|
23
|
+
.malloy-render .malloy-dashboard,
|
|
24
|
+
.malloy-render.malloy-render .malloy-dashboard,
|
|
25
|
+
div.malloy-render .malloy-dashboard {
|
|
26
|
+
/* --publisher-dashboard-root is set on the outer Publisher wrapper
|
|
27
|
+
(see buildTableCssVars) and stays decoupled from
|
|
28
|
+
--malloy-render--background, which gets shadowed inside the
|
|
29
|
+
renderer when a theme.background annotation is present. The
|
|
30
|
+
dedicated var means the panel between tiles always paints the
|
|
31
|
+
operator neutral dashboardRoot regardless of annotations. */
|
|
32
|
+
background: var(--publisher-dashboard-root) !important;
|
|
33
|
+
background-color: var(--publisher-dashboard-root) !important;
|
|
34
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
35
|
+
}
|
|
36
|
+
.malloy-render .malloy-dashboard .dashboard-row,
|
|
37
|
+
.malloy-render .malloy-dashboard .dashboard-row-body,
|
|
38
|
+
.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
39
|
+
.malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
|
|
40
|
+
div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
41
|
+
/* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
|
|
42
|
+
to #f7f9fc, and row / row-body have no explicit background but
|
|
43
|
+
get caught in any annotation-driven inline writes. Force all of
|
|
44
|
+
them to the neutral panel colour. */
|
|
45
|
+
background: var(--publisher-dashboard-root) !important;
|
|
46
|
+
background-color: var(--publisher-dashboard-root) !important;
|
|
47
|
+
}
|
|
48
|
+
.malloy-render .malloy-dashboard .dashboard-item:not(.dashboard-item-borderless) {
|
|
49
|
+
/* Tile padding around each chart / table. Uses our custom
|
|
50
|
+
--malloy-render--tile-background so the operator can theme the
|
|
51
|
+
tile separately from the table header row (which paints from
|
|
52
|
+
--malloy-render--table-pinned-background below).
|
|
53
|
+
|
|
54
|
+
A flat bordered card rather than the renderer's shadow ring, which is what
|
|
55
|
+
makes it match the composite tile's Paper. :not(borderless) because
|
|
56
|
+
# borderless asks for no card at all, and an !important background and
|
|
57
|
+
border drew one anyway. */
|
|
58
|
+
background: var(--malloy-render--tile-background) !important;
|
|
59
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
60
|
+
box-shadow: none !important;
|
|
61
|
+
/* The card edge, not the table gridline: --publisher-dashboard-card-border,
|
|
62
|
+
the same value TileCard paints, so the renderer's card and the composite
|
|
63
|
+
one are outlined identically. */
|
|
64
|
+
border: var(--publisher-dashboard-card-border) !important;
|
|
65
|
+
}
|
|
66
|
+
/* The renderer's big-value card — the small card a "# big_value" measure sits
|
|
67
|
+
in, several to a row inside one tile. (No backticks in here: this is inside
|
|
68
|
+
a template literal.) Its own CSS gives it a 0.55px edge in
|
|
69
|
+
#e5e7eb: a sub-pixel width, and a grey off the slate ramp everything else on
|
|
70
|
+
the page is on. It is a dashboard card like any other, so it takes the card
|
|
71
|
+
edge and stops being the one card outlined in a hairline nobody can see. */
|
|
72
|
+
.malloy-render .malloy-big-value-card {
|
|
73
|
+
border: var(--publisher-dashboard-card-border) !important;
|
|
74
|
+
/* Its shadow is a four-layer Tailwind stack, and only two of those layers
|
|
75
|
+
are a shadow: the other is "0 0 0 1px #e5e7eb", a spread ring drawn as a
|
|
76
|
+
second border OVER the real one. So the border above was landing
|
|
77
|
+
underneath a ring in the renderer's own grey, and the card kept both a
|
|
78
|
+
lifted look the flat cards around it do not have and an edge we did not
|
|
79
|
+
pick. Dropped whole rather than rebuilt layer by layer: the ring's job is
|
|
80
|
+
the border's job, and the border is already doing it. */
|
|
81
|
+
box-shadow: none !important;
|
|
82
|
+
}
|
|
83
|
+
.malloy-render .malloy-dashboard .dashboard-row-header-separator {
|
|
84
|
+
background: var(--malloy-render--table-border) !important;
|
|
85
|
+
}
|
|
86
|
+
/* !important because the malloy-explorer stylesheet pins these same properties with it. */
|
|
87
|
+
[${B}] .malloy-table.root {
|
|
88
|
+
height: 100% !important;
|
|
89
|
+
align-content: start !important;
|
|
90
|
+
grid-template-columns: repeat(var(--total-header-size), minmax(max-content, 1fr)) !important;
|
|
91
|
+
}
|
|
92
|
+
.malloy-render .malloy-table .th.column-cell {
|
|
93
|
+
/* Non-pinned tables have no header background in the renderer's
|
|
94
|
+
own CSS (only pinned scrolled tables paint the pinned-header
|
|
95
|
+
with this var). Force the same value here so every table has a
|
|
96
|
+
visible header band reflecting the operator's choice. */
|
|
97
|
+
background: var(--malloy-render--table-pinned-background) !important;
|
|
98
|
+
}
|
|
99
|
+
.malloy-render .dashboard-item-title,
|
|
100
|
+
.malloy-render .dashboard-dimension-name {
|
|
101
|
+
color: var(--malloy-render--label-color) !important;
|
|
102
|
+
}
|
|
103
|
+
.malloy-render .dashboard-item-value,
|
|
104
|
+
.malloy-render .dashboard-item-value-measure,
|
|
105
|
+
.malloy-render .dashboard-dimension-value {
|
|
106
|
+
color: var(--malloy-render--value-color) !important;
|
|
107
|
+
}
|
|
108
|
+
.malloy-render .malloy-table,
|
|
109
|
+
.malloy-render .malloy-list {
|
|
110
|
+
color: var(--malloy-render--table-body-color) !important;
|
|
111
|
+
}
|
|
112
|
+
.malloy-render .column-cell.th,
|
|
113
|
+
.malloy-render .cell-content.header {
|
|
114
|
+
color: var(--malloy-render--table-header-color) !important;
|
|
115
|
+
}
|
|
116
|
+
/* A cell whose column declares a "# drill" this surface can honor, marked
|
|
117
|
+
by markDrillableCells. Ordinary text with a pointer cursor until hovered,
|
|
118
|
+
then it reads as a link: the same affordance Malloyyo gives the same tag,
|
|
119
|
+
and the only thing that tells a reader a cell navigates. Kept off the
|
|
120
|
+
resting state deliberately: a column painted blue competes with the data.
|
|
121
|
+
(No backticks in here: this is inside a template literal.) */
|
|
122
|
+
.malloy-render .${v} {
|
|
123
|
+
cursor: pointer;
|
|
124
|
+
}
|
|
125
|
+
.malloy-render .${v}:hover > .cell-content {
|
|
126
|
+
color: var(--publisher-drill-link) !important;
|
|
127
|
+
text-decoration: underline;
|
|
128
|
+
}
|
|
129
|
+
/* Keyboard focus reads the same as hover, plus a ring: a hover colour is not
|
|
130
|
+
something a keyboard user can produce, and a focus ring is not something a
|
|
131
|
+
mouse user sees. focus-visible rather than focus, so a click does not leave a
|
|
132
|
+
ring behind it. (No backticks in here: this is inside a template literal.) */
|
|
133
|
+
.malloy-render .${v}:focus-visible {
|
|
134
|
+
outline: 2px solid var(--publisher-drill-link);
|
|
135
|
+
outline-offset: -2px;
|
|
136
|
+
}
|
|
137
|
+
.malloy-render .${v}:focus-visible > .cell-content {
|
|
138
|
+
color: var(--publisher-drill-link) !important;
|
|
139
|
+
text-decoration: underline;
|
|
140
|
+
}
|
|
141
|
+
`,se="publisher-malloy-renderer-overrides";function Te(){if(typeof document>"u"||document.getElementById(se))return;const e=document.createElement("style");e.id=se,e.textContent=Oe,document.head.appendChild(e)}function Me({result:e,height:t,drill:r,onSizeChange:l,onSizing:a,fill:o}){const n=f.useRef(null),i=f.useRef(r);i.current=r;const b=f.useCallback(c=>{i.current?.onClick(c)},[]),p=r!==void 0,x=f.useRef(!1),w=f.useRef(null),P=f.useRef(0),{theme:W,layers:G,mode:J}=ue(),Q=me().shape.borderRadius,X=f.useMemo(()=>({radius:`${Q}px`,padding:`${be}px`}),[Q]);return f.useEffect(()=>()=>{P.current+=1;const c=w.current;c?.viz.remove(),c?.node.remove(),w.current=null},[]),f.useLayoutEffect(()=>{if(!n.current||!e)return;Te();const c=n.current,ie=P.current+=1;let q=!1;const V=()=>!q&&ie===P.current;let d,m,L=null,H=0,I=null,N=null,_=null,R=null,j=null,O=null,Y=null,Z=0,A=null;x.current=!1;let g,S;const U=k=>{if(q||!k.firstElementChild||K(g,S)==="container")return;const T=ve(g,S);if(x.current&&!T)return;const M=c.hasAttribute(B);M&&c.removeAttribute(B);const E=we(k,ne(g));M&&c.setAttribute(B,""),E>0&&(x.current=!0,l&&E!==Z&&(Z=E,l(E)));const h=ke(k,ne(g));T&&h&&Y!==h&&(Y=h,O?.disconnect(),O=new ResizeObserver(()=>U(k)),O.observe(h))};return(async()=>{let k;try{k=JSON.parse(e)}catch(y){console.error("Error parsing visualization result:",y);return}const T=await Re(k),M=T?ye([...G,T],J):W;if(!V())return;try{m=await ze(M,b)}catch(y){console.error("Failed to create renderer:",y);return}if(!V()){m.remove(),m=void 0;return}const E=w.current;d=document.createElement("div"),d.style.width="100%",d.style.height="100%",je(d,M,X),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;R=new MutationObserver(()=>{j&&clearTimeout(j),j=setTimeout(()=>{U(h),x.current&&R?.disconnect()},100)}),R.observe(d,{childList:!0,subtree:!0,attributes:!0});const de=m;let ee=!1;const te=()=>{if(!(ee||!V())){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},U(h)}};try{m.setResult(k);try{const C=m.getMetadata(),F=C?.getRootField();g=F?.renderAs(),S=F?C?.getPluginsForField(F.key)?.[0]?.sizingStrategy:void 0}catch{g=void 0,S=void 0}a?.(K(g,S)),d.dataset.malloyRenderAs=g??"unknown",d.dataset.malloySizing=K(g,S),m.render(d);const y=i.current;try{if(y){const C=xe(m,y.canDrill),F=()=>{try{Ce(h,C)}catch(s){console.warn("Drill affordance skipped:",s)}};F();const re=s=>{const u=s.querySelector(".cell-content")??s,z=u.getBoundingClientRect();u.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:u.ownerDocument.defaultView,clientX:Math.round(z.left+z.width/2),clientY:Math.round(z.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 z=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(z!==void 0){s.preventDefault(),ce(u,z);return}s.key==="Enter"?(s.preventDefault(),re(u)):s.key===" "&&s.preventDefault()},N=s=>{if(s.key!==" ")return;const u=ae(s);u&&(s.preventDefault(),re(u))},_=s=>{const u=s.target?.closest?.(`.${v}`);u&&le(u,0)},h.addEventListener("keydown",I),h.addEventListener("keyup",N),h.addEventListener("focusin",_),C.size>0&&typeof MutationObserver<"u"&&(L=new MutationObserver(()=>{cancelAnimationFrame(H),H=requestAnimationFrame(F)}),L.observe(h,{childList:!0,subtree:!0}))}}catch(C){console.warn("Drill affordance skipped:",C)}m.onReady(te),A=setTimeout(te,1e4)}catch(y){console.error("Error rendering visualization:",y),R?.disconnect(),O?.disconnect(),L?.disconnect(),m.remove(),m=void 0,h.parentNode===c&&c.removeChild(h)}})(),()=>{q=!0,R?.disconnect(),O?.disconnect(),j&&clearTimeout(j),A&&clearTimeout(A),d&&w.current?.node!==d&&(I&&d.removeEventListener("keydown",I),N&&d.removeEventListener("keyup",N),_&&d.removeEventListener("focusin",_),L?.disconnect(),cancelAnimationFrame(H),m?.remove(),d.parentNode===c&&c.removeChild(d),c.style.position="")}},[e,b,p,l,a,W,G,J,X]),$.jsx("div",{ref:n,...o?{[B]:""}:{},style:{width:"100%",height:t?`${t}px`:"400px"}})}function $e(e){return typeof window>"u"?$.jsx(oe,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):$.jsx(f.Suspense,{fallback:$.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:$.jsx(Me,{...e})})}const De=Object.freeze(Object.defineProperty({__proto__:null,default:$e},Symbol.toStringTag,{value:"Module"}));export{v as D,$e as R,Ee as a,Se as b,De as c,xe as d,Ce as m,Fe as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{an as o,j as r,ao as s,ap as n,F as t,T as a}from"./index-BZEvIUf-.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};
|