@malloy-publisher/server 0.0.79 → 0.0.80

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.
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-BzdkHCNs.js","assets/index-EoKisyOf.js","assets/index-BKC-ikb3.css"])))=>i.map(i=>d[i]);
2
- import{j as a,r as c,_ as w}from"./index-EoKisyOf.js";const x=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:d}=await w(async()=>{const{MalloyRenderer:i}=await import("./index.umd-BzdkHCNs.js").then(l=>l.i);return{MalloyRenderer:i}},__vite__mapDeps([0,1,2]));return new d({onClick:e}).createViz()};function m({result:e,height:d,isFillElement:i,onSizeChange:l,onDrill:y}){const u=c.useRef(null),[g,f]=c.useState(!1);return c.useLayoutEffect(()=>{if(!u.current||!e)return;let t=!0;const r=u.current;for(;r.firstChild;)r.removeChild(r.firstChild);return x(y).then(o=>{if(!t)return;const n=new MutationObserver(s=>{for(const h of s)if(h.type==="childList"&&h.addedNodes.length>0&&Array.from(h.addedNodes).some(p=>p.nodeType===Node.ELEMENT_NODE)){n.disconnect(),setTimeout(()=>{t&&f(!0)},50);break}});n.observe(r,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(e)),o.render(r)}catch(s){console.error("Error rendering visualization:",s),n.disconnect(),t&&f(!0)}}).catch(o=>{console.error("Failed to create renderer:",o),t&&f(!0)}),()=>{t=!1}},[e,y]),c.useEffect(()=>{if(!u.current||!g)return;const t=u.current,r=()=>{if(t){const s=t.offsetHeight;s>0?l&&l(s):i&&t.firstChild&&(t.firstChild.offsetHeight==0?i(!0):i(!1))}},o=setTimeout(r,100);let n=null;return n=new MutationObserver(r),n.observe(t,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(o),n?.disconnect()}},[l,e,i,g]),a.jsx("div",{ref:u,style:{width:"100%",height:d?`${d}px`:"100%"}})}function E(e){return typeof window>"u"?a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):a.jsx(c.Suspense,{fallback:a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:a.jsx(m,{...e})})}export{E as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.umd-DoxV6txm.js","assets/index-DtRl_5zk.js","assets/index-BKC-ikb3.css"])))=>i.map(i=>d[i]);
2
+ import{j as a,r as c,_ as w}from"./index-DtRl_5zk.js";const x=async e=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:d}=await w(async()=>{const{MalloyRenderer:i}=await import("./index.umd-DoxV6txm.js").then(l=>l.i);return{MalloyRenderer:i}},__vite__mapDeps([0,1,2]));return new d({onClick:e}).createViz()};function m({result:e,height:d,isFillElement:i,onSizeChange:l,onDrill:y}){const u=c.useRef(null),[g,f]=c.useState(!1);return c.useLayoutEffect(()=>{if(!u.current||!e)return;let t=!0;const r=u.current;for(;r.firstChild;)r.removeChild(r.firstChild);return x(y).then(o=>{if(!t)return;const n=new MutationObserver(s=>{for(const h of s)if(h.type==="childList"&&h.addedNodes.length>0&&Array.from(h.addedNodes).some(p=>p.nodeType===Node.ELEMENT_NODE)){n.disconnect(),setTimeout(()=>{t&&f(!0)},50);break}});n.observe(r,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(e)),o.render(r)}catch(s){console.error("Error rendering visualization:",s),n.disconnect(),t&&f(!0)}}).catch(o=>{console.error("Failed to create renderer:",o),t&&f(!0)}),()=>{t=!1}},[e,y]),c.useEffect(()=>{if(!u.current||!g)return;const t=u.current,r=()=>{if(t){const s=t.offsetHeight;s>0?l&&l(s):i&&t.firstChild&&(t.firstChild.offsetHeight==0?i(!0):i(!1))}},o=setTimeout(r,100);let n=null;return n=new MutationObserver(r),n.observe(t,{childList:!0,subtree:!0,attributes:!0}),()=>{clearTimeout(o),n?.disconnect()}},[l,e,i,g]),a.jsx("div",{ref:u,style:{width:"100%",height:d?`${d}px`:"100%"}})}function E(e){return typeof window>"u"?a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading..."}):a.jsx(c.Suspense,{fallback:a.jsx("div",{style:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"#666"},children:"Loading visualization..."}),children:a.jsx(m,{...e})})}export{E as default};