@malloy-publisher/sdk 0.0.38 → 0.0.40

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/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BH85bTLt.cjs");exports.BrowserNotebookStorage=e.BrowserNotebookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.Home=e.Home;exports.Loading=e.Loading;exports.Model=e.Model;exports.MutableNotebook=e.MutableNotebook;exports.Notebook=e.Notebook;exports.NotebookStorageProvider=e.NotebookStorageProvider;exports.Package=e.Package;exports.PackageProvider=e.PackageProvider;exports.Project=e.Project;exports.ProjectProvider=e.ProjectProvider;exports.PublisherPackageProvider=e.PackageProvider;exports.QueryResult=e.QueryResult;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.useNotebookStorage=e.useNotebookStorage;exports.usePackage=e.usePackage;exports.useProject=e.useProject;exports.usePublisherPackage=e.usePackage;exports.useRouterClickHandler=e.useRouterClickHandler;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-xo1oaGoD.cjs");exports.BrowserNotebookStorage=e.BrowserNotebookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.Home=e.Home;exports.Loading=e.Loading;exports.Model=e.Model;exports.MutableNotebook=e.MutableNotebook;exports.Notebook=e.Notebook;exports.NotebookStorageProvider=e.NotebookStorageProvider;exports.Package=e.Package;exports.PackageProvider=e.PackageProvider;exports.Project=e.Project;exports.ProjectProvider=e.ProjectProvider;exports.PublisherPackageProvider=e.PackageProvider;exports.QueryResult=e.QueryResult;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.useNotebookStorage=e.useNotebookStorage;exports.usePackage=e.usePackage;exports.useProject=e.useProject;exports.usePublisherPackage=e.usePackage;exports.useRouterClickHandler=e.useRouterClickHandler;
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as a, C as r, H as s, L as t, M as P, b as u, N as c, c as k, P as g, e as l, g as b, h as i, e as d, Q as n, a as N, S, d as p, f as j, j as v, f as x, u as C } from "./index-fYVnpzww.js";
1
+ import { B as a, C as r, H as s, L as t, M as P, b as u, N as c, c as k, P as g, e as l, g as b, h as i, e as d, Q as n, a as N, S, d as p, f as j, j as v, f as x, u as C } from "./index-DCLrfHfE.js";
2
2
  export {
3
3
  a as BrowserNotebookStorage,
4
4
  r as ConnectionExplorer,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.38",
4
+ "version": "0.0.40",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -1,5 +1,4 @@
1
1
  import { Typography } from "@mui/material";
2
- import React from "react";
3
2
 
4
3
  export interface ApiError extends Error {
5
4
  status?: number;
@@ -27,7 +26,6 @@ export function ApiErrorDisplay({ error, context }: ApiErrorDisplayProps) {
27
26
  style={{
28
27
  whiteSpace: "pre-wrap",
29
28
  color: "red",
30
- backgroundColor: "black",
31
29
  padding: "10px",
32
30
  margin: "auto",
33
31
  }}
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { Box, CircularProgress, Typography } from "@mui/material";
3
2
 
4
3
  export interface LoadingProps {
@@ -8,7 +7,7 @@ export interface LoadingProps {
8
7
  text?: string;
9
8
  /**
10
9
  * The size of the CircularProgress component
11
- * @default 40
10
+ * @default 20
12
11
  */
13
12
  size?: number | string;
14
13
  /**
@@ -16,13 +15,13 @@ export interface LoadingProps {
16
15
  * @default "primary"
17
16
  */
18
17
  color?:
19
- | "primary"
20
- | "secondary"
21
- | "error"
22
- | "info"
23
- | "success"
24
- | "warning"
25
- | "inherit";
18
+ | "primary"
19
+ | "secondary"
20
+ | "error"
21
+ | "info"
22
+ | "success"
23
+ | "warning"
24
+ | "inherit";
26
25
  /**
27
26
  * The thickness of the circular progress
28
27
  * @default 3.6
@@ -43,28 +42,28 @@ export interface LoadingProps {
43
42
  * @default "body1"
44
43
  */
45
44
  textVariant?:
46
- | "h1"
47
- | "h2"
48
- | "h3"
49
- | "h4"
50
- | "h5"
51
- | "h6"
52
- | "subtitle1"
53
- | "subtitle2"
54
- | "body1"
55
- | "body2"
56
- | "caption"
57
- | "overline";
45
+ | "h1"
46
+ | "h2"
47
+ | "h3"
48
+ | "h4"
49
+ | "h5"
50
+ | "h6"
51
+ | "subtitle1"
52
+ | "subtitle2"
53
+ | "body1"
54
+ | "body2"
55
+ | "caption"
56
+ | "overline";
58
57
  }
59
58
 
60
59
  export function Loading({
61
60
  text,
62
- size = 40,
61
+ size = 20,
63
62
  color = "primary",
64
63
  thickness = 3.6,
65
64
  centered = true,
66
65
  spacing = 2,
67
- textVariant = "body1",
66
+ textVariant = "body2",
68
67
  }: LoadingProps) {
69
68
  const content = (
70
69
  <Box
@@ -10,15 +10,15 @@ import {
10
10
  } from "@mui/material";
11
11
  import Stack from "@mui/material/Stack";
12
12
  import { QueryClient, useQuery } from "@tanstack/react-query";
13
+ import { AxiosError } from "axios";
13
14
  import React, { useEffect } from "react";
14
- import { Configuration, NotebooksApi, CompiledNotebook } from "../../client";
15
+ import { CompiledNotebook, Configuration, NotebooksApi } from "../../client";
16
+ import { ApiError, ApiErrorDisplay } from "../ApiErrorDisplay";
15
17
  import { highlight } from "../highlighter";
18
+ import { Loading } from "../Loading";
16
19
  import { usePackage } from "../Package";
17
20
  import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
18
21
  import { NotebookCell } from "./NotebookCell";
19
- import { ApiErrorDisplay, ApiError } from "../ApiErrorDisplay";
20
- import { AxiosError } from "axios";
21
- import { Loading } from "../Loading";
22
22
 
23
23
  const notebooksApi = new NotebooksApi(new Configuration());
24
24
  const queryClient = new QueryClient();
@@ -213,14 +213,14 @@ export default function Notebook({
213
213
  key={index}
214
214
  />
215
215
  ))}
216
- {isError && error.data?.code === 404 && (
217
- <Typography>
216
+ {isError && error.status === 404 && (
217
+ <Typography variant="body2">
218
218
  <code>{`${projectName} > ${packageName} > ${notebookPath}`}</code>{" "}
219
219
  not found.
220
220
  </Typography>
221
221
  )}
222
222
 
223
- {isError && error.data?.code !== 404 && (
223
+ {isError && error.status !== 404 && (
224
224
  <ApiErrorDisplay
225
225
  error={error}
226
226
  context={`${projectName} > ${packageName} > ${notebookPath}`}
@@ -8,11 +8,11 @@ import {
8
8
  Typography,
9
9
  } from "@mui/material";
10
10
  import { QueryClient, useQuery } from "@tanstack/react-query";
11
- import axios from "axios";
12
11
  import { Configuration, PackagesApi } from "../../client";
12
+ import { ApiErrorDisplay } from "../ApiErrorDisplay";
13
+ import { Loading } from "../Loading";
13
14
  import { StyledCard, StyledCardContent } from "../styles";
14
15
  import { usePackage } from "./PackageProvider";
15
- import { ApiErrorDisplay } from "../ApiErrorDisplay";
16
16
 
17
17
  const packagesApi = new PackagesApi(new Configuration());
18
18
  const queryClient = new QueryClient();
@@ -58,7 +58,7 @@ export default function Config() {
58
58
  </ListItem>
59
59
  {!isSuccess && !isError && (
60
60
  <Typography variant="body2" sx={{ p: "20px", m: "auto" }}>
61
- Fethching Package Metadata...
61
+ <Loading text="Fetching Package Metadata..." />
62
62
  </Typography>
63
63
  )}
64
64
  {isSuccess &&
@@ -70,20 +70,20 @@ export default function Config() {
70
70
  />
71
71
  </ListItem>
72
72
  )) || (
73
- <ListItem
74
- disablePadding={true}
75
- dense={true}
76
- sx={{ mt: "20px" }}
77
- >
78
- <ErrorIcon
79
- sx={{
80
- color: "grey.600",
81
- mr: "10px",
82
- }}
83
- />
84
- <ListItemText primary={"No package manifest"} />
85
- </ListItem>
86
- ))}
73
+ <ListItem
74
+ disablePadding={true}
75
+ dense={true}
76
+ sx={{ mt: "20px" }}
77
+ >
78
+ <ErrorIcon
79
+ sx={{
80
+ color: "grey.600",
81
+ mr: "10px",
82
+ }}
83
+ />
84
+ <ListItemText primary={"No package manifest"} />
85
+ </ListItem>
86
+ ))}
87
87
  {isError && (
88
88
  <ApiErrorDisplay
89
89
  error={error}
@@ -2,11 +2,11 @@ import { Box, Divider, Typography } from "@mui/material";
2
2
  import { QueryClient, useQuery } from "@tanstack/react-query";
3
3
  import axios from "axios";
4
4
  import { Configuration, ModelsApi } from "../../client";
5
+ import { ApiErrorDisplay } from "../ApiErrorDisplay";
6
+ import { Loading } from "../Loading";
5
7
  import { StyledCard, StyledCardContent } from "../styles";
6
8
  import { FileTreeView } from "./FileTreeView";
7
9
  import { usePackage } from "./PackageProvider";
8
- import { ApiErrorDisplay } from "../ApiErrorDisplay";
9
- import { Loading } from "../Loading";
10
10
 
11
11
  axios.defaults.baseURL = "http://localhost:4000";
12
12
  const modelsApi = new ModelsApi(new Configuration());
@@ -22,7 +22,7 @@ export default function Models({ navigate }: ModelsProps) {
22
22
  const { server, projectName, packageName, versionId, accessToken } =
23
23
  usePackage();
24
24
 
25
- const { data, isError, error, isLoading, isSuccess } = useQuery(
25
+ const { data, isError, error, isSuccess } = useQuery(
26
26
  {
27
27
  queryKey: ["models", server, projectName, packageName, versionId],
28
28
  queryFn: () =>
@@ -70,7 +70,7 @@ export default function Models({ navigate }: ModelsProps) {
70
70
  />
71
71
  )}
72
72
  {isSuccess && data.data.length === 0 && (
73
- <Typography>No models found.</Typography>
73
+ <Typography variant="body2">No models found</Typography>
74
74
  )}
75
75
  </Box>
76
76
  </StyledCardContent>
@@ -1,11 +1,11 @@
1
1
  import { Box, Divider, Typography } from "@mui/material";
2
2
  import { QueryClient, useQuery } from "@tanstack/react-query";
3
3
  import { Configuration, NotebooksApi } from "../../client";
4
+ import { ApiErrorDisplay } from "../ApiErrorDisplay";
5
+ import { Loading } from "../Loading";
4
6
  import { StyledCard, StyledCardContent } from "../styles";
5
7
  import { FileTreeView } from "./FileTreeView";
6
8
  import { usePackage } from "./PackageProvider";
7
- import { ApiErrorDisplay } from "../ApiErrorDisplay";
8
- import { Loading } from "../Loading";
9
9
 
10
10
  const notebooksApi = new NotebooksApi(new Configuration());
11
11
  const queryClient = new QueryClient();
@@ -70,7 +70,7 @@ export default function Notebooks({ navigate }: NotebooksProps) {
70
70
  />
71
71
  )}
72
72
  {isSuccess && data.data.length === 0 && (
73
- <Typography>No notebooks found.</Typography>
73
+ <Typography variant="body2">No notebooks found</Typography>
74
74
  )}
75
75
  </Box>
76
76
  </StyledCardContent>