@malloy-publisher/sdk 0.0.198-dev → 0.0.198

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 (40) hide show
  1. package/dist/components/Package/ContentTypeIcon.d.ts +16 -0
  2. package/dist/components/Package/index.d.ts +0 -1
  3. package/dist/components/styles.d.ts +16 -0
  4. package/dist/{core-w79IMXAG.es.js → core-CbsC6R_Y.es.js} +1 -1
  5. package/dist/{core-7-3Jcsb0.cjs.js → core-WV2T5KIQ.cjs.js} +1 -1
  6. package/dist/{index-CN0_kZSF.es.js → index-BIdK-n2r.es.js} +17654 -20603
  7. package/dist/index-BZ3efB1x.cjs.js +228 -0
  8. package/dist/index.cjs.js +1 -1
  9. package/dist/index.es.js +33 -34
  10. package/package.json +5 -5
  11. package/src/components/Environment/AddPackageDialog.tsx +116 -79
  12. package/src/components/Environment/DeletePackageDialog.tsx +3 -2
  13. package/src/components/Environment/Environment.tsx +44 -23
  14. package/src/components/Environment/Packages.tsx +164 -156
  15. package/src/components/Home/DeleteEnvironmentDialog.tsx +3 -2
  16. package/src/components/Home/Home.tsx +272 -389
  17. package/src/components/Model/Model.tsx +2 -2
  18. package/src/components/Model/ModelCell.tsx +1 -1
  19. package/src/components/Model/ModelExplorerDialog.tsx +1 -1
  20. package/src/components/Model/SourcesExplorer.tsx +4 -4
  21. package/src/components/Notebook/Notebook.tsx +4 -9
  22. package/src/components/Notebook/NotebookCell.tsx +10 -7
  23. package/src/components/Package/ContentTypeIcon.tsx +79 -0
  24. package/src/components/Package/Package.tsx +387 -55
  25. package/src/components/Package/index.ts +0 -1
  26. package/src/components/QueryResult/QueryResult.tsx +1 -1
  27. package/src/components/RenderedResult/RenderedResult.tsx +9 -8
  28. package/src/components/ResultsDialog.tsx +1 -1
  29. package/src/components/styles.ts +28 -15
  30. package/dist/components/Package/Config.d.ts +0 -5
  31. package/dist/components/Package/Databases.d.ts +0 -5
  32. package/dist/components/Package/FileTreeView.d.ts +0 -9
  33. package/dist/components/Package/Models.d.ts +0 -6
  34. package/dist/components/Package/Notebooks.d.ts +0 -6
  35. package/dist/index-Xo_ADux9.cjs.js +0 -233
  36. package/src/components/Package/Config.tsx +0 -97
  37. package/src/components/Package/Databases.tsx +0 -228
  38. package/src/components/Package/FileTreeView.tsx +0 -241
  39. package/src/components/Package/Models.tsx +0 -68
  40. package/src/components/Package/Notebooks.tsx +0 -77
@@ -1,77 +0,0 @@
1
- import { Box, Typography } from "@mui/material";
2
- import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
3
- import { ApiErrorDisplay } from "../ApiErrorDisplay";
4
- import { Loading } from "../Loading";
5
- import {
6
- PackageCard,
7
- PackageCardContent,
8
- PackageSectionTitle,
9
- } from "../styles";
10
- import { FileTreeView } from "./FileTreeView";
11
- import { parseResourceUri } from "../../utils/formatting";
12
- import { useServer } from "../ServerProvider";
13
-
14
- const DEFAULT_EXPANDED_FOLDERS = ["notebooks/"];
15
-
16
- interface NotebooksProps {
17
- onClickNotebookFile: (to: string, event?: React.MouseEvent) => void;
18
- resourceUri: string;
19
- }
20
-
21
- export default function Notebooks({
22
- onClickNotebookFile,
23
- resourceUri,
24
- }: NotebooksProps) {
25
- const { apiClients } = useServer();
26
- const {
27
- environmentName: environmentName,
28
- packageName: packageName,
29
- versionId: versionId,
30
- } = parseResourceUri(resourceUri);
31
-
32
- const { data, isError, error, isSuccess } = useQueryWithApiError({
33
- queryKey: ["notebooks", environmentName, packageName, versionId],
34
- queryFn: () =>
35
- apiClients.notebooks.listNotebooks(
36
- environmentName,
37
- packageName,
38
- versionId,
39
- ),
40
- });
41
-
42
- return (
43
- <PackageCard>
44
- <PackageCardContent>
45
- <PackageSectionTitle>Notebooks</PackageSectionTitle>
46
- <Box
47
- sx={{
48
- maxHeight: "200px",
49
- overflowY: "auto",
50
- }}
51
- >
52
- {!isSuccess && !isError && (
53
- <Loading text="Fetching Notebooks..." />
54
- )}
55
- {isError && (
56
- <ApiErrorDisplay
57
- error={error}
58
- context={`${environmentName} > ${packageName} > Notebooks`}
59
- />
60
- )}
61
- {isSuccess && data.data.length > 0 && (
62
- <FileTreeView
63
- items={data.data.sort((a, b) => {
64
- return a.path.localeCompare(b.path);
65
- })}
66
- defaultExpandedItems={DEFAULT_EXPANDED_FOLDERS}
67
- onClickTreeNode={onClickNotebookFile}
68
- />
69
- )}
70
- {isSuccess && data.data.length === 0 && (
71
- <Typography variant="body2">No notebooks found</Typography>
72
- )}
73
- </Box>
74
- </PackageCardContent>
75
- </PackageCard>
76
- );
77
- }