@malloy-publisher/sdk 0.0.41 → 0.0.42

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.
Files changed (31) hide show
  1. package/dist/{RenderedResult-gQPXZIVQ.js → RenderedResult-D4wHWzQL.js} +2 -2
  2. package/dist/{RenderedResult-BX2zW03q.cjs → RenderedResult-DR4Ejhm0.cjs} +1 -1
  3. package/dist/components/Notebook/Notebook.d.ts +4 -3
  4. package/dist/hooks/useQueryWithApiError.d.ts +10 -0
  5. package/dist/{index-xo1oaGoD.cjs → index-C7HUzsul.cjs} +522 -522
  6. package/dist/{index-DCLrfHfE.js → index-wBKeSKqo.js} +21302 -21344
  7. package/dist/index.cjs.js +1 -1
  8. package/dist/index.es.js +16 -15
  9. package/dist/{vendor-BCM56_2K.js → vendor-BKsYdkmG.js} +5456 -5458
  10. package/dist/{vendor-Bg9-K32d.cjs → vendor-hHfbZ4ZT.cjs} +30 -30
  11. package/openapitools.json +1 -1
  12. package/package.json +2 -2
  13. package/src/components/ApiErrorDisplay.tsx +12 -12
  14. package/src/components/Home/Home.tsx +9 -14
  15. package/src/components/Model/Model.tsx +18 -45
  16. package/src/components/Model/NamedQueries.tsx +38 -42
  17. package/src/components/Model/SourcesExplorer.tsx +47 -51
  18. package/src/components/MutableNotebook/ModelPicker.tsx +12 -18
  19. package/src/components/Notebook/Notebook.tsx +37 -60
  20. package/src/components/Package/Config.tsx +28 -34
  21. package/src/components/Package/Connections.tsx +12 -18
  22. package/src/components/Package/Databases.tsx +12 -18
  23. package/src/components/Package/Models.tsx +12 -20
  24. package/src/components/Package/Notebooks.tsx +13 -12
  25. package/src/components/Package/Schedules.tsx +12 -18
  26. package/src/components/Project/About.tsx +12 -18
  27. package/src/components/Project/ConnectionExplorer.tsx +49 -65
  28. package/src/components/Project/Packages.tsx +12 -18
  29. package/src/components/QueryResult/QueryResult.tsx +24 -30
  30. package/src/hooks/useQueryWithApiError.ts +114 -0
  31. package/src/index.ts +5 -0
@@ -1,5 +1,5 @@
1
- import { j as C } from "./vendor-BCM56_2K.js";
2
- import { i as E } from "./index-DCLrfHfE.js";
1
+ import { j as C } from "./vendor-BKsYdkmG.js";
2
+ import { i as E } from "./index-wBKeSKqo.js";
3
3
  import { useRef as m, useState as R, useLayoutEffect as M, useEffect as w } from "react";
4
4
  function O({
5
5
  result: c,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./vendor-Bg9-K32d.cjs"),x=require("./index-xo1oaGoD.cjs"),t=require("react");function E({result:i,height:m,isFillElement:f,onSizeChange:l,onDrill:v}){const e=t.useRef(null),[a,h]=t.useState(!1),[R,b]=t.useState(!1),[y,M]=t.useState(!1),s=t.useRef(null),n=t.useRef(null);if(t.useLayoutEffect(()=>{if(e.current&&i&&!R){b(!0),s.current||(s.current=new Promise(r=>{n.current=r}));const o=new x.index_umdExports.MalloyRenderer({onClick:v}).createViz();for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const d=new MutationObserver(r=>{for(const c of r)if(c.type==="childList"&&c.addedNodes.length>0&&Array.from(c.addedNodes).some(g=>g.nodeType===Node.ELEMENT_NODE)){d.disconnect(),setTimeout(()=>{h(!0),n.current&&(n.current(),n.current=null,s.current=null)},50);break}});if(e.current){d.observe(e.current,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(i)),o.render(e.current)}catch(r){console.error("Error rendering visualization:",r),d.disconnect(),h(!0),n.current&&(n.current(),n.current=null,s.current=null)}}}},[i,v,R]),t.useEffect(()=>{h(!1),b(!1),s.current=null,n.current=null},[i]),R&&!a&&s.current)throw s.current;return t.useEffect(()=>{if(!e.current||!a)return;const u=e.current,o=()=>{if(u){const c=u.offsetHeight;c>0?l&&l(c):f&&u.firstChild&&(u.firstChild.offsetHeight==0?f(!0):f(!1))}},d=setTimeout(o,100);let r=null;return y||(r=new MutationObserver(o),r.observe(u,{childList:!0,subtree:!0,attributes:!0})),()=>{clearTimeout(d),r?.disconnect()}},[l,i,f,a]),p.jsxRuntimeExports.jsx("div",{ref:e,style:{width:"100%",height:m?`${m}px`:"100%"}})}exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./vendor-hHfbZ4ZT.cjs"),x=require("./index-C7HUzsul.cjs"),t=require("react");function E({result:i,height:m,isFillElement:f,onSizeChange:l,onDrill:v}){const e=t.useRef(null),[a,h]=t.useState(!1),[R,b]=t.useState(!1),[y,M]=t.useState(!1),s=t.useRef(null),n=t.useRef(null);if(t.useLayoutEffect(()=>{if(e.current&&i&&!R){b(!0),s.current||(s.current=new Promise(r=>{n.current=r}));const o=new x.index_umdExports.MalloyRenderer({onClick:v}).createViz();for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const d=new MutationObserver(r=>{for(const c of r)if(c.type==="childList"&&c.addedNodes.length>0&&Array.from(c.addedNodes).some(g=>g.nodeType===Node.ELEMENT_NODE)){d.disconnect(),setTimeout(()=>{h(!0),n.current&&(n.current(),n.current=null,s.current=null)},50);break}});if(e.current){d.observe(e.current,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(i)),o.render(e.current)}catch(r){console.error("Error rendering visualization:",r),d.disconnect(),h(!0),n.current&&(n.current(),n.current=null,s.current=null)}}}},[i,v,R]),t.useEffect(()=>{h(!1),b(!1),s.current=null,n.current=null},[i]),R&&!a&&s.current)throw s.current;return t.useEffect(()=>{if(!e.current||!a)return;const u=e.current,o=()=>{if(u){const c=u.offsetHeight;c>0?l&&l(c):f&&u.firstChild&&(u.firstChild.offsetHeight==0?f(!0):f(!1))}},d=setTimeout(o,100);let r=null;return y||(r=new MutationObserver(o),r.observe(u,{childList:!0,subtree:!0,attributes:!0})),()=>{clearTimeout(d),r?.disconnect()}},[l,i,f,a]),p.jsxRuntimeExports.jsx("div",{ref:e,style:{width:"100%",height:m?`${m}px`:"100%"}})}exports.default=E;
@@ -1,9 +1,10 @@
1
1
  interface NotebookProps {
2
2
  notebookPath: string;
3
- expandCodeCells?: boolean;
4
- hideCodeCellIcons?: boolean;
3
+ versionId?: string;
4
+ expandResults?: boolean;
5
+ hideResultIcons?: boolean;
5
6
  expandEmbeddings?: boolean;
6
7
  hideEmbeddingIcons?: boolean;
7
8
  }
8
- export default function Notebook({ notebookPath, expandCodeCells, hideCodeCellIcons, expandEmbeddings, hideEmbeddingIcons, }: NotebookProps): import("react/jsx-runtime").JSX.Element;
9
+ export default function Notebook({ notebookPath, expandResults, hideResultIcons, expandEmbeddings, hideEmbeddingIcons, }: NotebookProps): import("react/jsx-runtime").JSX.Element;
9
10
  export {};
@@ -0,0 +1,10 @@
1
+ import { QueryClient, UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
2
+ import { ApiError } from '../components/ApiErrorDisplay';
3
+ declare const globalQueryClient: QueryClient;
4
+ export declare function useQueryWithApiError<TData = unknown, TError = ApiError>(options: Omit<UseQueryOptions<TData, TError>, "throwOnError" | "retry"> & {
5
+ queryFn: () => Promise<TData>;
6
+ }): UseQueryResult<TData, TError>;
7
+ export declare function useMutationWithApiError<TData = unknown, TError = ApiError, TVariables = void>(options: Omit<UseMutationOptions<TData, TError, TVariables>, "throwOnError" | "retry"> & {
8
+ mutationFn: (variables: TVariables) => Promise<TData>;
9
+ }): UseMutationResult<TData, TError, TVariables>;
10
+ export { globalQueryClient };