@malloy-publisher/app 0.14.0 → 0.16.0
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/api-doc.yaml +1141 -384
- package/dist/assets/{EnvironmentPage-CX8dwMPh.js → EnvironmentPage-Y9IWPC9J.js} +1 -1
- package/dist/assets/{HomePage-C7yrR-ec.js → HomePage-BOUo0MEl.js} +1 -1
- package/dist/assets/{MainPage-BKs7CeWW.js → MainPage-BkM5UDRU.js} +1 -1
- package/dist/assets/ModelPage-PgDTkS5C.js +2 -0
- package/dist/assets/{PackagePage-Bd5y7ILU.js → PackagePage-Dn7FrQ5r.js} +1 -1
- package/dist/assets/PackageSplatRoute-BLC29ek-.js +2 -0
- package/dist/assets/{RenderedResult-D0kAzSrP.es-DldjGxsY.js → RenderedResult-vyM2wQbC.es-ha8dF24T.js} +7 -7
- package/dist/assets/{RouteError-BJHAXzBN.js → RouteError-BolMqTuz.js} +1 -1
- package/dist/assets/{ThemeEditorPage-yUJpFBCR.js → ThemeEditorPage-CPv1eHkI.js} +1 -1
- package/dist/assets/{ToggleButtonGroup-BoCnLGaG.js → ToggleButtonGroup-DZtImN0S.js} +1 -1
- package/dist/assets/{documentRoutes-CIhmKz4i.js → documentRoutes-DI5cX3ty.js} +1 -1
- package/dist/assets/{editPageMounted-B5IyuuMZ.js → editPageMounted-C--4kcld.js} +2 -2
- package/dist/assets/{index-DTKG_ab2.js → index-CbsrzNSp.js} +1 -1
- package/dist/assets/{index-DrMbh_v4.js → index-D9wSfMZN.js} +1 -1
- package/dist/assets/{index-DqJz_hGj.js → index-DLToSg1f.js} +140 -140
- package/dist/assets/{index-B6DUq-GT.js → index-DyYEltlF.js} +1 -1
- package/dist/assets/{index.es-VBpWc8yM.js → index.es-D8SVyfmS.js} +19 -19
- package/dist/assets/usePackageLinkNavigate-DxHGKrmZ.js +1 -0
- package/dist/assets/{usePackageRoute-CTkLtO3i.js → usePackageRoute-A_YQMrax.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/mcp-app/report.js +477 -477
- package/package.json +2 -2
- package/dist/assets/ModelPage-BGlX8geE.js +0 -2
- package/dist/assets/PackageSplatRoute-Cw-yA9CE.js +0 -2
- package/dist/assets/usePackageLinkNavigate-BcERmCFv.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/app",
|
|
3
3
|
"description": "Malloy Publisher Console (the built-in web UI)",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.16.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test:playwright:headed": "bunx playwright test --config=playwright.config.ts --headed"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@malloy-publisher/sdk": "^0.
|
|
45
|
+
"@malloy-publisher/sdk": "^0.16.0",
|
|
46
46
|
"@modelcontextprotocol/ext-apps": "1.7.5",
|
|
47
47
|
"@mui/icons-material": "^7.0.2",
|
|
48
48
|
"@mui/material": "^7.0.2",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-VBpWc8yM.js","assets/index-DqJz_hGj.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-BoCnLGaG.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{W as te,E as W,r as f,d7 as se,d8 as ne,d9 as B,da as U,a5 as q,X as z,j as t,G as x,db as re,a7 as E,dc as I,a4 as oe,az as ae,dd as ie,bn as ce,de as le,C as de,z as k,df as ue,as as fe,a2 as O,a3 as G,dg as he,dh as pe,a6 as N,T as w,di as xe,dj as V,F as me,dk as ge,a1 as ve,a0 as P,dl as _,A as je,N as ye,dm as be,dn as F,dp as we,dq as Ee}from"./index-DqJz_hGj.js";import{i as D,w as Re,a as X,l as ke}from"./documentRoutes-CIhmKz4i.js";import{v as Ce,w as A,u as H}from"./usePackageRoute-CTkLtO3i.js";import{u as Se}from"./usePackageLinkNavigate-BcERmCFv.js";import{T as K,P as C}from"./PackageSplatRoute-Cw-yA9CE.js";import{a as De,l as Y}from"./editPageMounted-B5IyuuMZ.js";function Ae(e,s,n){const r=te(),{reports:a,settled:h,isError:c}=W(e,s,Ce(n)),o=h&&!c;return f.useCallback((i,l)=>{const u=i.path;if(!se(u))return"malformed";const d=ne(u,a),p=A(B(e,s,d.kind==="path"?d.report.path:u),e,s,n),g=new URLSearchParams(i.givens).toString();return r(p+(g?`?${g}`:""),l),d.kind==="path"?"resolved":o?"unresolved":"unverified"},[r,e,s,n,a,o])}const Te='[data-tile-kind="query"]',$e=".malloy-render, .malloy-table, [role='alert'], .MuiAlert-root",Me=3e3;function J(e,s,n,r){const a=f.useRef(n);a.current=n;const h=f.useRef(!1);f.useEffect(()=>{if(!a.current||h.current)return;let c=0;const o={},i=()=>{clearTimeout(u),o.beat!==void 0&&clearInterval(o.beat),cancelAnimationFrame(c),o.observer?.disconnect()},l=()=>{h.current||(h.current=!0,i(),a.current?.())},u=setTimeout(l,Me);if(!s)return()=>clearTimeout(u);const d=()=>{const p=e.current;if(!p||r&&p.querySelector(r)===null)return;const g=window.innerHeight;[...p.querySelectorAll(Te)].filter(m=>{if(m.getBoundingClientRect().top>=g)return!1;const j=m.querySelector($e);return!j||j.getBoundingClientRect().height<8}).length===0&&c===0&&(c=requestAnimationFrame(()=>{c=requestAnimationFrame(l)}))};return o.observer=new MutationObserver(d),e.current&&o.observer.observe(e.current,{childList:!0,subtree:!0}),o.beat=setInterval(d,50),d(),i},[s,e,r])}function Q({environmentName:e,packageName:s,versionId:n,path:r,editable:a=r.endsWith(".malloy"),onReady:h}){const c=f.useRef(null);J(c,!0,h,`.${ae.report}`);const{params:o,onGivensChange:i}=U(),{versionSegment:l}=H(),u=Ae(e,s,l),d=Se(e,s,l),p=f.useMemo(()=>q({environmentName:e,packageName:s}),[e,s]),g=z();return f.useEffect(()=>{if(!a||g)return;const y=()=>void oe(()=>import("./index.es-VBpWc8yM.js"),__vite__mapDeps([0,1,2,3])),m=window.requestIdleCallback;if(m){const j=m(y);return()=>window.cancelIdleCallback?.(j)}const v=setTimeout(y,1500);return()=>clearTimeout(v)},[a,g]),t.jsx(x,{ref:c,sx:K,children:r.endsWith(".malloynb")?t.jsx(re,{resourceUri:E({environmentName:e,packageName:s,modelPath:r,versionId:n}),givens:o,onGivensChange:i,onNavigate:d,onDrillNavigate:u,maxResultSize:1024*1024}):t.jsx(I,{resourceUri:E({environmentName:e,packageName:s,versionId:n}),path:r,givens:o,onGivensChange:i,onNavigate:u,onLinkNavigate:d,onEvent:p,maxResultSize:1024*1024})})}function Pe(){const[e,s]=f.useState(!1),n=f.useRef(!1),r=f.useRef(!1),a=f.useCallback(i=>{n.current=i,s(i)},[]),h=f.useCallback(()=>{r.current=!0},[]),c=ie(f.useCallback(({currentLocation:i,nextLocation:l})=>n.current&&!r.current&&(i.pathname!==l.pathname||D(i.search)!==D(l.search)),[]));f.useEffect(()=>{if(!e)return;const i=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const o=t.jsx(ce,{open:c.state==="blocked",canSave:!1,onKeepEditing:()=>c.reset?.(),onDiscard:()=>c.proceed?.()});return{onDirtyChange:a,leaving:h,dialog:o}}const _e=G.lazy(()=>Y().then(e=>({default:e.ReportEditor}))),Fe=G.lazy(()=>Y().then(e=>({default:e.BuilderBar})));function Le(){const[e,s]=f.useState(null);return f.useEffect(()=>{s(document.getElementById("header-actions-portal"))},[]),e}function Z({environmentName:e,packageName:s,path:n,layout:r="grid",onReady:a,quietLoading:h=!1,offstage:c=!1}){const o=Pe();De();const[i]=f.useState(le),l=de(),{pathname:u,search:d}=k(),p=Le(),[g,y]=f.useState(),m=f.useRef(null),v=z();J(m,g!==void 0||v,a);const j=()=>l(`${u.replace(/\/$/,"")}${Re(d)}`),S=f.useMemo(()=>q({environmentName:e,packageName:s}),[e,s]),R=t.jsx(I,{resourceUri:E({environmentName:e,packageName:s}),path:n,manifestStaleTime:1e4});return t.jsxs(x,{ref:m,sx:K,children:[t.jsx(ue,{children:t.jsx(f.Suspense,{fallback:h?null:R,children:t.jsx(_e,{resourceUri:E({environmentName:e,packageName:s}),path:n,layout:r,keepDraft:i,onDirtyChange:o.onDirtyChange,onExit:j,onOpenModel:b=>l(`/${[e,s,...b.split("/")].map(encodeURIComponent).join("/")}`),onEvent:S,loading:h?null:R,onControlsChange:y},`${e}/${s}/${n}`)})}),o.dialog,p&&!c&&fe.createPortal(t.jsx(f.Suspense,{fallback:t.jsx(O,{variant:"contained",disableElevation:!0,onClick:j,children:"Done"}),children:t.jsx(Fe,{controls:g,onDone:j})}),p)]})}function We({environmentName:e,packageName:s,versionSegment:n,routePath:r,edit:a,reports:h,children:c}){const{search:o}=k(),i=d=>A(B(e,s,d),e,s,n),l=he(r);if(!l)return t.jsx(t.Fragment,{children:c});const u=pe(l.name,h,l.prefer);return"found"in u?t.jsx(N,{replace:!0,to:`${i(u.found.path)}${a?X(o):o}`}):"ambiguous"in u?t.jsxs(x,{sx:C,children:[t.jsxs(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",l.name]}),t.jsx(w,{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:"}),t.jsx(x,{component:"ul",sx:{mt:1},children:u.ambiguous.map(d=>t.jsx("li",{children:t.jsx(xe,{to:i(d),style:{fontFamily:V},children:d})},d))})]}):t.jsx(t.Fragment,{children:c})}function Be({environmentName:e,packageName:s,routePath:n,edit:r,notFound:a,notFoundUntilListed:h=!1,versionId:c,versionSegment:o,readOnly:i=!1}){const{reports:l,settled:u,isFetching:d,isError:p,refetch:g}=W(e,s,c),{search:y}=k(),m=`${n}.malloy`,v=u?me(m,l):void 0,j=u&&!d&&!p,[S,R]=f.useState();f.useEffect(()=>{j&&R(m)},[j,m]);const b=v!==void 0||j||S===m,T=ge(e,s,m,r&&!i&&b&&!v),$=ee=>t.jsx(We,{environmentName:e,packageName:s,...o!==void 0?{versionSegment:o}:{},routePath:n,edit:r,reports:l,children:ee});if(!b&&(h&&!r&&!v))return $(a);if(!b&&p&&!d)return t.jsx(x,{sx:C,children:t.jsxs(ve,{severity:"warning",action:t.jsx(O,{color:"inherit",size:"small",onClick:()=>void g(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",n,"."]})});if(!b)return t.jsx(P,{text:_.opening()});if(v)return t.jsx(Ue,{environmentName:e,packageName:s,...c!==void 0?{versionId:c}:{},path:v.path,editable:i?!1:v.editable,layout:v.layout,edit:r&&!i});const M=r?void 0:ke(n);return M!==void 0?t.jsx(N,{replace:!0,to:`${A(`/${e}/${s}/${M.split("/").map(encodeURIComponent).join("/")}`,e,s,o)}${X(y)}`}):$(r&&!i?T.settled?t.jsx(Z,{environmentName:e,packageName:s,path:m,layout:T.layout??"grid"}):t.jsx(P,{text:_.opening()}):a)}function Ue({environmentName:e,packageName:s,versionId:n,path:r,editable:a,layout:h,edit:c}){const[o,i]=f.useState(c?"editor":"reader"),l=c?"editor":"reader",u=l==="reader"||o==="reader",d=l==="editor"||o==="editor",p={position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",overflow:"hidden"};return t.jsxs(x,{sx:{position:"relative"},"data-switching":u&&d||void 0,children:[u&&t.jsx(x,{sx:o==="reader"?void 0:p,"aria-hidden":o!=="reader"||void 0,children:t.jsx(Q,{environmentName:e,packageName:s,...n!==void 0?{versionId:n}:{},path:r,...a!==void 0?{editable:a}:{},onReady:()=>{c||i("reader")}})},"reader"),d&&t.jsx(x,{sx:o==="editor"?void 0:p,"aria-hidden":o!=="editor"||void 0,children:t.jsx(Z,{environmentName:e,packageName:s,path:r,...h?{layout:h}:{},quietLoading:u,offstage:l!=="editor"||o!=="editor",onReady:()=>{c&&i("editor")}})},"editor")]})}function Xe(){const e=je(),{search:s}=k(),{path:n,versionId:r,versionSegment:a,writable:h}=H({always:!0}),{server:c}=ye(),{params:o,onGivensChange:i,setParam:l}=U();if(!e.environmentName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing package name"})});if(n!==void 0&&n!==""&&!n.endsWith(".malloy")&&!n.endsWith(".malloynb")){const d=n.replace(/\/$/,""),p=d.startsWith("data-apps/"),g=p?t.jsx(be,{resourceUri:E({environmentName:e.environmentName,packageName:e.packageName,modelPath:d.slice(10),versionId:r})}):t.jsx(L,{environmentName:e.environmentName,packageName:e.packageName,modelPath:n,staticUrl:F({server:c,environmentName:e.environmentName,packageName:e.packageName,path:n,...r!==void 0?{versionId:r}:{}})});return t.jsx(Be,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},...a!==void 0?{versionSegment:a}:{},readOnly:!h,routePath:d,edit:D(s),notFound:g,notFoundUntilListed:p})}const u=E({environmentName:e.environmentName,packageName:e.packageName,modelPath:n,versionId:r});return n?.endsWith(".malloy")?t.jsx(x,{sx:C,children:t.jsx(we,{resourceUri:u,runOnDemand:!0,sourceName:o.source,onSourceChange:d=>l("source",d),givens:o,onGivensChange:i,maxResultSize:512*1024})}):n?.endsWith(".malloynb")?t.jsx(Q,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},path:n,editable:!1}):t.jsx(L,{environmentName:e.environmentName,packageName:e.packageName,modelPath:n??"",staticUrl:F({server:c,environmentName:e.environmentName,packageName:e.packageName,path:n??"",...r!==void 0?{versionId:r}:{}})})}function L({packageName:e,modelPath:s,staticUrl:n}){const r=/\.[^./]+$/.test(s),a={fontFamily:V};return t.jsxs(x,{sx:C,children:[t.jsx(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[t.jsx(x,{component:"span",sx:a,children:s})," ","does not name a report, a"," ",t.jsx(x,{component:"span",sx:a,children:".malloy"})," ","or a"," ",t.jsx(x,{component:"span",sx:a,children:".malloynb"})," ","file in package"," ",t.jsx(x,{component:"span",sx:a,children:e}),". This address opens reports by their path without"," ",t.jsx(x,{component:"span",sx:a,children:".malloy"}),", and"," ",t.jsx(x,{component:"span",sx:a,children:".malloy"})," ","and"," ",t.jsx(x,{component:"span",sx:a,children:".malloynb"})," ","files."]}),r&&t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",t.jsx(x,{component:"span",sx:a,children:"public/"})," ","directory is served at ",t.jsx(Ee,{href:n,children:n}),"."]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{Xe as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ModelPage-BGlX8geE.js","assets/index-DqJz_hGj.js","assets/index-DUqldpo0.css","assets/documentRoutes-CIhmKz4i.js","assets/usePackageRoute-CTkLtO3i.js","assets/usePackageLinkNavigate-BcERmCFv.js","assets/editPageMounted-B5IyuuMZ.js","assets/PackagePage-Bd5y7ILU.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{z as P,C as g,r as h,j as e,G as x,a1 as f,a2 as A,a3 as c,a4 as d}from"./index-DqJz_hGj.js";import{u as R,w as S,L as T}from"./usePackageRoute-CTkLtO3i.js";const j=1200,u={p:3,maxWidth:j,mx:"auto"},G={...u,pt:6},y=c.lazy(()=>d(()=>import("./ModelPage-BGlX8geE.js"),__vite__mapDeps([0,1,2,3,4,5,6]))),k=c.lazy(()=>d(()=>import("./PackagePage-Bd5y7ILU.js"),__vite__mapDeps([7,1,2,3,4,5])));function L(){const{environmentName:l,packageName:_,versionSegment:s,path:a,versioned:p,deciding:m,undecided:v,retry:E}=R({always:!0}),{pathname:o,search:r,hash:n}=P(),i=g(),t=p&&s===void 0?S(o,l??"",_??"",T):void 0;return h.useEffect(()=>{t!==void 0&&t!==o&&i(`${t}${r}${n}`,{replace:!0})},[t,o,r,n,i]),m?null:v?e.jsx(x,{sx:u,children:e.jsx(f,{severity:"error",action:e.jsx(A,{color:"inherit",size:"small",onClick:E,children:"Retry"}),children:"Could not read this package's versions, so this address can't be opened yet."})}):s!==void 0&&(a===void 0||a===""||a==="/")?e.jsx(k,{}):e.jsx(y,{})}const b=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));export{u as P,G as T,b as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{W as u,r as c}from"./index-DqJz_hGj.js";import{w as e}from"./usePackageRoute-CTkLtO3i.js";function p(t,a,r){const s=u();return c.useCallback((o,i)=>s(e(o,t,a,r),i),[s,t,a,r])}export{p as u};
|