@malloy-publisher/sdk 0.0.51 → 0.0.53

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.
@@ -21,12 +21,7 @@ export default function Package({ navigate }: PackageProps) {
21
21
  }
22
22
 
23
23
  return (
24
- <Grid
25
- container
26
- spacing={2}
27
- columns={12}
28
- sx={{ mb: (theme) => theme.spacing(2) }}
29
- >
24
+ <Grid container spacing={2} columns={12}>
30
25
  <Grid size={{ xs: 12, md: 4 }}>
31
26
  <Config />
32
27
  </Grid>
@@ -1,11 +1,11 @@
1
- import { Divider, Typography } from "@mui/material";
2
- import { Configuration, ProjectsApi } from "../../client";
1
+ import { Typography } from "@mui/material";
3
2
  import Markdown from "markdown-to-jsx";
4
- import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
5
- import { useProject } from "./Project";
3
+ import { Configuration, ProjectsApi } from "../../client";
4
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
6
5
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
7
6
  import { Loading } from "../Loading";
8
- import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
7
+ import { StyledCard } from "../styles";
8
+ import { useProject } from "./Project";
9
9
 
10
10
  const projectsApi = new ProjectsApi(new Configuration());
11
11
 
@@ -21,16 +21,13 @@ export default function About() {
21
21
  <>
22
22
  {!isSuccess && !isError && <Loading text="Fetching About..." />}
23
23
  {isSuccess && (
24
- <StyledCard variant="outlined">
25
- <StyledCardContent>
26
- <Typography variant="overline" fontWeight="bold">
27
- Readme
28
- </Typography>
29
- <Divider />
30
- </StyledCardContent>
31
- <StyledCardMedia>
24
+ <StyledCard variant="outlined" sx={{ p: 2 }}>
25
+ <Typography variant="overline" fontWeight="bold" sx={{ mb: 1 }}>
26
+ Readme
27
+ </Typography>
28
+ <StyledCard sx={{ p: 1 }}>
32
29
  <Markdown>{data.data.readme}</Markdown>
33
- </StyledCardMedia>
30
+ </StyledCard>
34
31
  </StyledCard>
35
32
  )}
36
33
  {isError && (
@@ -1,10 +1,10 @@
1
- import { Box, Divider, Grid, Typography } from "@mui/material";
1
+ import { Box, Grid, Typography } from "@mui/material";
2
2
  import { Configuration, PackagesApi } from "../../client";
3
- import { StyledCard, StyledCardContent, StyledCardMedia } from "../styles";
4
- import { useProject } from "./Project";
3
+ import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
5
4
  import { ApiErrorDisplay } from "../ApiErrorDisplay";
6
5
  import { Loading } from "../Loading";
7
- import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
6
+ import { StyledCard, StyledCardContent } from "../styles";
7
+ import { useProject } from "./Project";
8
8
 
9
9
  const packagesApi = new PackagesApi(new Configuration());
10
10
 
@@ -24,61 +24,54 @@ export default function Packages({ navigate }: PackagesProps) {
24
24
  <>
25
25
  {!isSuccess && !isError && <Loading text="Fetching Packages..." />}
26
26
  {isSuccess && (
27
- <StyledCard variant="outlined">
28
- <StyledCardContent>
29
- <Typography variant="overline" fontWeight="bold">
30
- Packages
31
- </Typography>
32
- <Divider />
33
- </StyledCardContent>
34
- <StyledCardMedia>
35
- <Grid
36
- container
37
- spacing={2}
38
- columns={12}
39
- sx={{ mb: (theme) => theme.spacing(2) }}
40
- >
41
- {data.data
42
- .sort((a, b) => {
43
- return a.name.localeCompare(b.name);
44
- })
45
- .map((p) => (
46
- <Grid
47
- size={{ xs: 12, sm: 12, md: 12, lg: 4 }}
48
- key={p.name}
27
+ <StyledCard variant="outlined" sx={{ p: 2 }}>
28
+ <Typography variant="overline" fontWeight="bold" sx={{ mb: 1 }}>
29
+ Packages
30
+ </Typography>
31
+ <Grid container spacing={2} columns={12}>
32
+ {data.data
33
+ .sort((a, b) => {
34
+ return a.name.localeCompare(b.name);
35
+ })
36
+ .map((p) => (
37
+ <Grid
38
+ size={{ xs: 12, sm: 12, md: 12, lg: 4 }}
39
+ key={p.name}
40
+ >
41
+ <StyledCard
42
+ variant="outlined"
43
+ sx={{
44
+ cursor: "pointer",
45
+ transition: "all 0.2s ease-in-out",
46
+ "&:hover": {
47
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
48
+ transform: "translateY(-2px)",
49
+ },
50
+ }}
51
+ onClick={(event) => navigate(p.name + "/", event)}
49
52
  >
50
- <StyledCard
51
- variant="outlined"
52
- sx={{ padding: "10px", cursor: "pointer" }}
53
- onClick={(event) =>
54
- navigate(p.name + "/", event)
55
- }
56
- >
57
- <StyledCardContent>
58
- <Typography
59
- variant="overline"
60
- color="primary.main"
61
- >
62
- {p.name}
53
+ <StyledCardContent>
54
+ <Typography
55
+ variant="overline"
56
+ color="primary.main"
57
+ >
58
+ {p.name}
59
+ </Typography>
60
+ <Box
61
+ sx={{
62
+ maxHeight: "120px",
63
+ overflowY: "auto",
64
+ }}
65
+ >
66
+ <Typography variant="body2">
67
+ {p.description}
63
68
  </Typography>
64
- <Divider />
65
- <Box
66
- sx={{
67
- mt: "10px",
68
- maxHeight: "100px",
69
- overflowY: "auto",
70
- }}
71
- >
72
- <Typography variant="body2">
73
- {p.description}
74
- </Typography>
75
- </Box>
76
- </StyledCardContent>
77
- </StyledCard>
78
- </Grid>
79
- ))}
80
- </Grid>
81
- </StyledCardMedia>
69
+ </Box>
70
+ </StyledCardContent>
71
+ </StyledCard>
72
+ </Grid>
73
+ ))}
74
+ </Grid>
82
75
  </StyledCard>
83
76
  )}
84
77
  {isError && (
@@ -1,7 +1,7 @@
1
1
  import { Grid } from "@mui/material";
2
+ import { createContext, ReactNode, useContext } from "react";
2
3
  import About from "./About";
3
4
  import Packages from "./Packages";
4
- import { createContext, useContext, ReactNode } from "react";
5
5
 
6
6
  export interface ProjectContextProps {
7
7
  projectName: string;
@@ -11,27 +11,28 @@ const ProjectContext = createContext<ProjectContextProps | undefined>(
11
11
  undefined,
12
12
  );
13
13
 
14
- interface ProjectProviderProps extends ProjectContextProps {
14
+ export function useProject(): ProjectContextProps {
15
+ const context = useContext(ProjectContext);
16
+ if (!context) {
17
+ throw new Error("useProject must be used within a ProjectProvider");
18
+ }
19
+ return context;
20
+ }
21
+
22
+ interface ProjectProviderProps {
15
23
  children: ReactNode;
24
+ projectName: string;
16
25
  }
17
26
 
18
- export const ProjectProvider = ({
19
- projectName,
27
+ export function ProjectProvider({
20
28
  children,
21
- }: ProjectProviderProps) => {
29
+ projectName,
30
+ }: ProjectProviderProps) {
22
31
  return (
23
32
  <ProjectContext.Provider value={{ projectName }}>
24
33
  {children}
25
34
  </ProjectContext.Provider>
26
35
  );
27
- };
28
-
29
- export function useProject() {
30
- const context = useContext(ProjectContext);
31
- if (!context) {
32
- throw new Error("useProject must be used within a ProjectProvider");
33
- }
34
- return context;
35
36
  }
36
37
 
37
38
  interface ProjectProps {
@@ -40,12 +41,7 @@ interface ProjectProps {
40
41
 
41
42
  export default function Project({ navigate }: ProjectProps) {
42
43
  return (
43
- <Grid
44
- container
45
- spacing={2}
46
- columns={12}
47
- sx={{ mb: (theme) => theme.spacing(2) }}
48
- >
44
+ <Grid container spacing={2} columns={12}>
49
45
  <Grid size={{ xs: 12, md: 12 }}>
50
46
  <Packages navigate={navigate} />
51
47
  </Grid>
@@ -79,7 +79,7 @@ export default function ResultContainer({
79
79
  if (!result) {
80
80
  return null;
81
81
  }
82
- const loading = <Loading text="Loading..." centered={false} size={32} />;
82
+ const loading = <Loading text="Loading..." centered={true} size={32} />;
83
83
  const renderedHeight = isFillElement
84
84
  ? isExpanded
85
85
  ? maxHeight - 40
@@ -87,9 +87,9 @@ export default function ResultContainer({
87
87
  : undefined;
88
88
  const height = explicitHeight
89
89
  ? {
90
- minHeight: `${explicitHeight}px`,
91
- height: `100%`,
92
- }
90
+ minHeight: `${explicitHeight}px`,
91
+ height: `100%`,
92
+ }
93
93
  : { height: `100%` };
94
94
  return (
95
95
  <>
@@ -1,4 +1,4 @@
1
- import { styled, Card, CardContent, CardMedia } from "@mui/material";
1
+ import { Card, CardContent, CardMedia, styled } from "@mui/material";
2
2
 
3
3
  export const StyledCard = styled(Card)({
4
4
  display: "flex",
@@ -9,15 +9,12 @@ export const StyledCard = styled(Card)({
9
9
  export const StyledCardContent = styled(CardContent)({
10
10
  display: "flex",
11
11
  flexDirection: "column",
12
- padding: "0px 4px 4px 4px",
12
+ padding: "10px",
13
13
  flexGrow: 1,
14
- "&:last-child": {
15
- paddingBottom: 0,
16
- },
17
14
  });
18
15
 
19
16
  export const StyledCardMedia = styled(CardMedia)({
20
- padding: "0px 4px 0px 4px",
17
+ padding: "10px",
21
18
  });
22
19
 
23
20
  export const StyledExplorerPage = styled("div")({
@@ -30,7 +27,7 @@ export const StyledExplorerBanner = styled("div")({
30
27
  height: "30px",
31
28
  backgroundColor: "rgba(225, 240, 255, 1)",
32
29
  display: "flex",
33
- padding: "2px 10px",
30
+ padding: "4px",
34
31
  alignItems: "center",
35
32
  });
36
33