@malloy-publisher/sdk 0.0.45 → 0.0.46
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/{RenderedResult-wM3HaFcq.js → RenderedResult-Bn1ONmkh.js} +2 -2
- package/dist/{RenderedResult-qA34vdbd.cjs → RenderedResult-eQGiBJrZ.cjs} +1 -1
- package/dist/components/Home/Home.d.ts +1 -2
- package/dist/components/Package/PackageProvider.d.ts +1 -3
- package/dist/components/Project/Project.d.ts +1 -3
- package/dist/components/ServerProvider.d.ts +12 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/hooks/useQueryWithApiError.d.ts +4 -3
- package/dist/{index-nsXS-gBw.cjs → index-CRJL0zjn.cjs} +558 -573
- package/dist/{index-ClVlSQMk.js → index-GV49y9rz.js} +16580 -16687
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +12 -10
- package/dist/{vendor-BKsYdkmG.js → vendor-Cr_5VY0T.js} +6361 -6352
- package/dist/{vendor-hHfbZ4ZT.cjs → vendor-CxEyd3N4.cjs} +120 -120
- package/package.json +1 -1
- package/src/components/Home/Home.tsx +3 -10
- package/src/components/Model/Model.tsx +6 -26
- package/src/components/Model/ModelCell.tsx +0 -16
- package/src/components/Model/NamedQueries.tsx +3 -10
- package/src/components/Model/SourcesExplorer.tsx +3 -10
- package/src/components/MutableNotebook/ModelPicker.tsx +4 -11
- package/src/components/MutableNotebook/MutableNotebook.tsx +4 -3
- package/src/components/Notebook/Notebook.tsx +6 -44
- package/src/components/Package/Config.tsx +10 -11
- package/src/components/Package/Connections.tsx +3 -10
- package/src/components/Package/Databases.tsx +9 -11
- package/src/components/Package/Models.tsx +4 -12
- package/src/components/Package/Notebooks.tsx +6 -15
- package/src/components/Package/Package.tsx +0 -1
- package/src/components/Package/PackageProvider.tsx +1 -7
- package/src/components/Package/Schedules.tsx +9 -11
- package/src/components/Project/About.tsx +3 -10
- package/src/components/Project/ConnectionExplorer.tsx +16 -36
- package/src/components/Project/Packages.tsx +3 -10
- package/src/components/Project/Project.tsx +1 -5
- package/src/components/QueryResult/QueryResult.tsx +3 -11
- package/src/components/ServerProvider.tsx +37 -0
- package/src/components/index.ts +2 -0
- package/src/hooks/useQueryWithApiError.ts +28 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { j as C } from "./vendor-
|
|
2
|
-
import { i as E } from "./index-
|
|
1
|
+
import { j as C } from "./vendor-Cr_5VY0T.js";
|
|
2
|
+
import { i as E } from "./index-GV49y9rz.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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./vendor-CxEyd3N4.cjs"),x=require("./index-CRJL0zjn.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,6 +1,5 @@
|
|
|
1
1
|
interface HomeProps {
|
|
2
|
-
server?: string;
|
|
3
2
|
navigate?: (to: string, event?: React.MouseEvent) => void;
|
|
4
3
|
}
|
|
5
|
-
export default function Home({
|
|
4
|
+
export default function Home({ navigate }: HomeProps): import("react/jsx-runtime").JSX.Element;
|
|
6
5
|
export {};
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface PackageContextProps {
|
|
3
|
-
server?: string;
|
|
4
3
|
projectName: string;
|
|
5
4
|
packageName: string;
|
|
6
5
|
versionId?: string;
|
|
7
|
-
accessToken?: string;
|
|
8
6
|
}
|
|
9
7
|
interface PackageProviderProps extends PackageContextProps {
|
|
10
8
|
children: ReactNode;
|
|
11
9
|
}
|
|
12
|
-
export declare const PackageProvider: ({
|
|
10
|
+
export declare const PackageProvider: ({ projectName, packageName, versionId, children, }: PackageProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
11
|
export declare function usePackage(): PackageContextProps;
|
|
14
12
|
export {};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export interface ProjectContextProps {
|
|
3
|
-
server?: string;
|
|
4
3
|
projectName: string;
|
|
5
|
-
accessToken?: string;
|
|
6
4
|
}
|
|
7
5
|
interface ProjectProviderProps extends ProjectContextProps {
|
|
8
6
|
children: ReactNode;
|
|
9
7
|
}
|
|
10
|
-
export declare const ProjectProvider: ({
|
|
8
|
+
export declare const ProjectProvider: ({ projectName, children, }: ProjectProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
9
|
export declare function useProject(): ProjectContextProps;
|
|
12
10
|
interface ProjectProps {
|
|
13
11
|
navigate: (to: string, event?: React.MouseEvent) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
export interface ServerContextValue {
|
|
3
|
+
server: string;
|
|
4
|
+
accessToken?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ServerProviderProps {
|
|
7
|
+
server?: string;
|
|
8
|
+
accessToken?: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare const ServerProvider: React.FC<ServerProviderProps>;
|
|
12
|
+
export declare const useServer: () => ServerContextValue;
|
|
@@ -7,3 +7,5 @@ export * from './QueryResult';
|
|
|
7
7
|
export * from './Home';
|
|
8
8
|
export * from './Loading';
|
|
9
9
|
export { useRouterClickHandler } from './click_helper';
|
|
10
|
+
export { ServerProvider, useServer } from './ServerProvider';
|
|
11
|
+
export type { ServerContextValue, ServerProviderProps } from './ServerProvider';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { QueryClient, UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
|
|
2
2
|
import { ApiError } from '../components/ApiErrorDisplay';
|
|
3
|
+
import { RawAxiosRequestConfig } from 'axios';
|
|
3
4
|
declare const globalQueryClient: QueryClient;
|
|
4
5
|
export declare function useQueryWithApiError<TData = unknown, TError = ApiError>(options: Omit<UseQueryOptions<TData, TError>, "throwOnError" | "retry"> & {
|
|
5
|
-
queryFn: () => Promise<TData>;
|
|
6
|
+
queryFn: (config: RawAxiosRequestConfig) => Promise<TData>;
|
|
6
7
|
}): 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>;
|
|
8
|
+
export declare function useMutationWithApiError<TData = unknown, TError = ApiError, TVariables = void>(options: Omit<UseMutationOptions<TData, TError, TVariables>, "throwOnError" | "retry" | "mutationFn"> & {
|
|
9
|
+
mutationFn: (variables: TVariables, config: RawAxiosRequestConfig) => Promise<TData>;
|
|
9
10
|
}): UseMutationResult<TData, TError, TVariables>;
|
|
10
11
|
export { globalQueryClient };
|