@malloy-publisher/sdk 0.2.7 → 0.3.1
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/README.md +180 -204
- package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +134 -0
- package/dist/DocumentStorageProvider-tGvodI8f.es.js +24268 -0
- package/dist/RenderedResult-CPi6uQWq.cjs.js +115 -0
- package/dist/RenderedResult-mDE-4u8S.es.js +542 -0
- package/dist/{ServerProvider-xXW1HJOJ.cjs.js → ServerProvider-CH71GsoL.cjs.js} +1 -1
- package/dist/{ServerProvider-ksC5Su_x.es.js → ServerProvider-X2Ma0HRs.es.js} +324 -359
- package/dist/builder/index.cjs.js +105 -0
- package/dist/builder/index.d.ts +2 -0
- package/dist/builder/index.es.js +9561 -0
- package/dist/builder-entry.d.ts +8 -0
- package/dist/client/api.d.ts +13 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/ApiErrorDisplay.d.ts +1 -2
- package/dist/components/Dashboard/Dashboard.d.ts +23 -16
- package/dist/components/Dashboard/DashboardGrid.d.ts +67 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +6 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +18 -0
- package/dist/components/Dashboard/RowsDialog.d.ts +47 -0
- package/dist/components/Dashboard/TileCard.d.ts +44 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +40 -0
- package/dist/components/Dashboard/telemetry.d.ts +43 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +35 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +29 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +112 -0
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +32 -0
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/DrillDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +54 -0
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +17 -0
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +20 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +42 -0
- package/dist/components/DashboardBuilder/TileMenu.d.ts +24 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +62 -0
- package/dist/components/DashboardBuilder/controls.d.ts +157 -0
- package/dist/components/DashboardBuilder/diff.d.ts +35 -0
- package/dist/components/DashboardBuilder/document.d.ts +218 -0
- package/dist/components/DashboardBuilder/layout.d.ts +71 -0
- package/dist/components/DashboardBuilder/malloyText.d.ts +45 -0
- package/dist/components/DashboardBuilder/preview.d.ts +60 -0
- package/dist/components/DashboardBuilder/readDocument.d.ts +106 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +51 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +44 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +10 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +22 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +63 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +13 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +65 -0
- package/dist/components/DashboardBuilder/useTileReorder.d.ts +22 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +29 -0
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +14 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +58 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +25 -0
- package/dist/components/DocumentStorage/index.d.ts +3 -0
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/Model/index.d.ts +0 -1
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/RenderedResult.d.ts +12 -0
- package/dist/components/RenderedResult/ResultContainer.d.ts +7 -1
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +2 -0
- package/dist/components/RenderedResult/resultSizing.d.ts +183 -0
- package/dist/components/drill/index.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/drill/useDrillSelf.d.ts +46 -0
- package/dist/components/given/filterValue.d.ts +63 -0
- package/dist/components/given/index.d.ts +1 -0
- package/dist/components/given/useGivenUrlParams.d.ts +39 -0
- package/dist/components/index.d.ts +3 -3
- package/dist/components/styles.d.ts +3 -7
- package/dist/core-8NVBCLZh.cjs.js +148 -0
- package/dist/{core-BY7vB5gN.es.js → core-B8oMW4sm.es.js} +3540 -2335
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/hooks/useSuggestOptions.d.ts +28 -12
- package/dist/index.cjs.js +34 -1
- package/dist/index.es.js +21487 -79
- package/dist/sdk.css +1 -1
- package/dist/styles.css +0 -1
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/package.json +25 -14
- package/src/builder-entry.ts +55 -0
- package/src/components/ApiErrorDisplay.tsx +1 -1
- package/src/components/Connections/EditConnectionDialog.tsx +96 -86
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +184 -229
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +67 -101
- package/src/components/Dashboard/ExploreDialog.tsx +84 -0
- package/src/components/Dashboard/RowsDialog.spec.ts +42 -0
- package/src/components/Dashboard/RowsDialog.tsx +234 -0
- package/src/components/Dashboard/TileCard.tsx +120 -0
- package/src/components/Dashboard/index.ts +2 -0
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +207 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +160 -0
- package/src/components/Dashboard/telemetry.ts +44 -0
- package/src/components/Dashboard/tileGridColumn.spec.ts +1 -1
- package/src/components/DashboardBuilder/AddTileDialog.tsx +249 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +270 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +858 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +653 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +211 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +493 -0
- package/src/components/DashboardBuilder/DiffDialog.tsx +129 -0
- package/src/components/DashboardBuilder/DrillDialog.tsx +281 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +581 -0
- package/src/components/DashboardBuilder/FilterStrip.tsx +125 -0
- package/src/components/DashboardBuilder/SettingsPopover.tsx +168 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +380 -0
- package/src/components/DashboardBuilder/TileMenu.tsx +188 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +215 -0
- package/src/components/DashboardBuilder/catalog.ts +225 -0
- package/src/components/DashboardBuilder/controls.spec.ts +243 -0
- package/src/components/DashboardBuilder/controls.ts +398 -0
- package/src/components/DashboardBuilder/diff.spec.ts +44 -0
- package/src/components/DashboardBuilder/diff.ts +93 -0
- package/src/components/DashboardBuilder/document.ts +209 -0
- package/src/components/DashboardBuilder/keepRowStructure.spec.ts +84 -0
- package/src/components/DashboardBuilder/layout.ts +143 -0
- package/src/components/DashboardBuilder/malloyText.spec.ts +84 -0
- package/src/components/DashboardBuilder/malloyText.ts +151 -0
- package/src/components/DashboardBuilder/moveIntoGap.spec.ts +90 -0
- package/src/components/DashboardBuilder/preview.spec.ts +149 -0
- package/src/components/DashboardBuilder/preview.ts +172 -0
- package/src/components/DashboardBuilder/readDocument.spec.ts +375 -0
- package/src/components/DashboardBuilder/readDocument.ts +467 -0
- package/src/components/DashboardBuilder/sortable.tsx +151 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +1108 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +1098 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +48 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +88 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +255 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +193 -0
- package/src/components/DashboardBuilder/useDraft.ts +43 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +144 -0
- package/src/components/DashboardBuilder/useFilterForm.ts +352 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useTileReorder.ts +115 -0
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +121 -0
- package/src/components/DashboardBuilder/useTileResize.ts +110 -0
- package/src/components/DashboardBuilder/withGaps.spec.ts +96 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +81 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +105 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +73 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +58 -0
- package/src/components/DocumentStorage/index.ts +16 -0
- package/src/components/Environment/About.tsx +4 -36
- package/src/components/FloatingIconButton.tsx +41 -0
- package/src/components/Model/Model.tsx +6 -23
- package/src/components/Model/ModelCell.tsx +34 -72
- package/src/components/Model/index.ts +0 -1
- package/src/components/Notebook/Notebook.tsx +27 -156
- package/src/components/Notebook/NotebookCell.tsx +37 -191
- package/src/components/Prose.spec.tsx +85 -0
- package/src/components/Prose.tsx +179 -0
- package/src/components/QueryResult/QueryResult.tsx +15 -43
- package/src/components/RenderedResult/RenderedResult.tsx +86 -76
- package/src/components/RenderedResult/ResultContainer.tsx +25 -36
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +16 -0
- package/src/components/RenderedResult/resultSizing.spec.ts +249 -0
- package/src/components/RenderedResult/resultSizing.ts +308 -0
- package/src/components/ResultsDialog.tsx +2 -1
- package/src/components/drill/index.ts +6 -0
- package/src/components/drill/resolveDrill.ts +22 -1
- package/src/components/drill/useDrill.spec.tsx +94 -0
- package/src/components/drill/useDrill.tsx +52 -12
- package/src/components/drill/useDrillSelf.spec.tsx +64 -0
- package/src/components/drill/useDrillSelf.ts +110 -0
- package/src/components/given/GivenInput.spec.tsx +196 -2
- package/src/components/given/GivenInput.tsx +300 -25
- package/src/components/given/GivensPanel.tsx +1 -1
- package/src/components/given/filterValue.spec.ts +112 -0
- package/src/components/given/filterValue.ts +188 -0
- package/src/components/given/index.ts +4 -0
- package/src/components/given/useGivenUrlParams.spec.tsx +74 -0
- package/src/components/given/useGivenUrlParams.ts +87 -0
- package/src/components/index.ts +11 -3
- package/src/components/styles.ts +0 -37
- package/src/hooks/index.ts +13 -1
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useGivensState.spec.ts +158 -0
- package/src/hooks/useGivensState.ts +114 -23
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/hooks/useSuggestOptions.dom.spec.ts +60 -1
- package/src/hooks/useSuggestOptions.ts +94 -51
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/vite.config.ts +5 -1
- package/dist/components/AnalyzePackageButton.d.ts +0 -6
- package/dist/components/Workbook/BrowserWorkbookStorage.d.ts +0 -9
- package/dist/components/Workbook/EditableMalloyCell.d.ts +0 -11
- package/dist/components/Workbook/ModelPicker.d.ts +0 -11
- package/dist/components/Workbook/MutableCell.d.ts +0 -17
- package/dist/components/Workbook/Workbook.d.ts +0 -7
- package/dist/components/Workbook/WorkbookList.d.ts +0 -7
- package/dist/components/Workbook/WorkbookManager.d.ts +0 -84
- package/dist/components/Workbook/WorkbookStorage.d.ts +0 -17
- package/dist/components/Workbook/WorkbookStorageProvider.d.ts +0 -12
- package/dist/components/Workbook/index.d.ts +0 -7
- package/dist/core-CWKmWEg2.cjs.js +0 -148
- package/dist/index-B0WyZAUA.es.js +0 -66412
- package/dist/index-kxVD1RjY.cjs.js +0 -356
- package/dist/markdown-editor.css +0 -341
- package/src/components/AnalyzePackageButton.tsx +0 -319
- package/src/components/Workbook/BrowserWorkbookStorage.ts +0 -64
- package/src/components/Workbook/EditableMalloyCell.tsx +0 -49
- package/src/components/Workbook/ModelPicker.tsx +0 -134
- package/src/components/Workbook/MutableCell.tsx +0 -458
- package/src/components/Workbook/Workbook.tsx +0 -501
- package/src/components/Workbook/WorkbookList.tsx +0 -110
- package/src/components/Workbook/WorkbookManager.ts +0 -214
- package/src/components/Workbook/WorkbookStorage.ts +0 -35
- package/src/components/Workbook/WorkbookStorageProvider.tsx +0 -40
- package/src/components/Workbook/index.ts +0 -10
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Credible Data Inc.
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
import type {
|
|
5
|
-
WorkbookLocator,
|
|
6
|
-
WorkbookStorage,
|
|
7
|
-
Workspace,
|
|
8
|
-
} from "./WorkbookStorage";
|
|
9
|
-
|
|
10
|
-
const LOCAL_WORKSPACE_NAME = "Local";
|
|
11
|
-
|
|
12
|
-
export class BrowserWorkbookStorage implements WorkbookStorage {
|
|
13
|
-
async listWorkspaces(writeableOnly: boolean): Promise<Workspace[]> {
|
|
14
|
-
// Parameters not used in browser storage implementation
|
|
15
|
-
void writeableOnly;
|
|
16
|
-
return Promise.resolve([
|
|
17
|
-
{
|
|
18
|
-
name: LOCAL_WORKSPACE_NAME,
|
|
19
|
-
description: "Stored locally- only accessible to this browser",
|
|
20
|
-
writeable: true,
|
|
21
|
-
},
|
|
22
|
-
]);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async listWorkbooks(_workspace: Workspace): Promise<WorkbookLocator[]> {
|
|
26
|
-
const keys: WorkbookLocator[] = [];
|
|
27
|
-
for (let i = 0; i < localStorage.length; i++) {
|
|
28
|
-
const key = localStorage.key(i);
|
|
29
|
-
keys.push({ path: key, workspace: LOCAL_WORKSPACE_NAME });
|
|
30
|
-
}
|
|
31
|
-
return keys;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async getWorkbook(path: WorkbookLocator): Promise<string> {
|
|
35
|
-
const notebook = localStorage.getItem(path.path);
|
|
36
|
-
if (notebook === null) {
|
|
37
|
-
throw new Error(`Notebook not found at path: ${path}`);
|
|
38
|
-
}
|
|
39
|
-
return notebook;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async deleteWorkbook(path: WorkbookLocator): Promise<void> {
|
|
43
|
-
if (localStorage.getItem(path.path) === null) {
|
|
44
|
-
throw new Error(`Notebook not found at path: ${path}`);
|
|
45
|
-
}
|
|
46
|
-
localStorage.removeItem(path.path);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async saveWorkbook(path: WorkbookLocator, notebook: string): Promise<void> {
|
|
50
|
-
localStorage.setItem(path.path, notebook);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async moveWorkbook(
|
|
54
|
-
from: WorkbookLocator,
|
|
55
|
-
to: WorkbookLocator,
|
|
56
|
-
): Promise<void> {
|
|
57
|
-
const notebook = localStorage.getItem(from.path);
|
|
58
|
-
if (notebook === null) {
|
|
59
|
-
throw new Error(`Notebook not found at path: ${from.path}`);
|
|
60
|
-
}
|
|
61
|
-
localStorage.setItem(to.path, notebook);
|
|
62
|
-
localStorage.removeItem(from.path);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Credible Data Inc.
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
SourceAndPath,
|
|
6
|
-
QueryExplorerResult,
|
|
7
|
-
SourcesExplorer,
|
|
8
|
-
} from "../Model/SourcesExplorer";
|
|
9
|
-
import { WorkbookCellValue } from "./WorkbookManager";
|
|
10
|
-
|
|
11
|
-
interface EditableMalloyCellProps {
|
|
12
|
-
cell: WorkbookCellValue;
|
|
13
|
-
sourceAndPaths: SourceAndPath[];
|
|
14
|
-
resourceUri: string;
|
|
15
|
-
onQueryChange: (query: QueryExplorerResult) => void;
|
|
16
|
-
onSourceChange?: (index: number) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function EditableMalloyCell({
|
|
20
|
-
cell,
|
|
21
|
-
sourceAndPaths,
|
|
22
|
-
resourceUri,
|
|
23
|
-
onQueryChange,
|
|
24
|
-
onSourceChange,
|
|
25
|
-
}: EditableMalloyCellProps) {
|
|
26
|
-
const query = {
|
|
27
|
-
query: cell.value,
|
|
28
|
-
malloyResult: cell.result ? JSON.parse(cell.result) : undefined,
|
|
29
|
-
malloyQuery: cell.queryInfo ? JSON.parse(cell.queryInfo) : undefined,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// Find the selected source index based on the cell's source name
|
|
33
|
-
const selectedSourceIndex = sourceAndPaths.findIndex(
|
|
34
|
-
(sourceAndPath) => sourceAndPath.sourceInfo.name === cell.sourceName,
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<SourcesExplorer
|
|
39
|
-
resourceUri={resourceUri}
|
|
40
|
-
sourceAndPaths={sourceAndPaths}
|
|
41
|
-
selectedSourceIndex={
|
|
42
|
-
selectedSourceIndex >= 0 ? selectedSourceIndex : 0
|
|
43
|
-
}
|
|
44
|
-
existingQuery={query}
|
|
45
|
-
onQueryChange={onQueryChange}
|
|
46
|
-
onSourceChange={onSourceChange}
|
|
47
|
-
/>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Credible Data Inc.
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
import CloseIcon from "@mui/icons-material/Close";
|
|
5
|
-
import FileUploadOutlinedIcon from "@mui/icons-material/FileUploadOutlined";
|
|
6
|
-
import {
|
|
7
|
-
Button,
|
|
8
|
-
Chip,
|
|
9
|
-
Divider,
|
|
10
|
-
FormControl,
|
|
11
|
-
Menu,
|
|
12
|
-
MenuItem,
|
|
13
|
-
Stack,
|
|
14
|
-
Typography,
|
|
15
|
-
} from "@mui/material";
|
|
16
|
-
import React from "react";
|
|
17
|
-
import { ApiErrorDisplay } from "../ApiErrorDisplay";
|
|
18
|
-
import { useQueryWithApiError } from "../../hooks/useQueryWithApiError";
|
|
19
|
-
import { parseResourceUri } from "../../utils/formatting";
|
|
20
|
-
import { useServer } from "../ServerProvider";
|
|
21
|
-
|
|
22
|
-
interface ModelPickerProps {
|
|
23
|
-
initialSelectedModels: string[];
|
|
24
|
-
onModelChange: (models: string[]) => void;
|
|
25
|
-
resourceUri: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Picks Models that are available in the package.
|
|
30
|
-
* Only "malloy" model files are shown.
|
|
31
|
-
*/
|
|
32
|
-
export function ModelPicker({
|
|
33
|
-
initialSelectedModels,
|
|
34
|
-
onModelChange,
|
|
35
|
-
resourceUri,
|
|
36
|
-
}: ModelPickerProps) {
|
|
37
|
-
const {
|
|
38
|
-
environmentName: environmentName,
|
|
39
|
-
packageName: packageName,
|
|
40
|
-
versionId: versionId,
|
|
41
|
-
} = parseResourceUri(resourceUri);
|
|
42
|
-
const { apiClients } = useServer();
|
|
43
|
-
|
|
44
|
-
const { data, isLoading, isSuccess, isError, error } = useQueryWithApiError({
|
|
45
|
-
queryKey: ["models", environmentName, packageName, versionId],
|
|
46
|
-
queryFn: () =>
|
|
47
|
-
apiClients.models.listModels(environmentName, packageName, versionId),
|
|
48
|
-
});
|
|
49
|
-
const [selectedModels, setSelectedModels] = React.useState<string[]>(
|
|
50
|
-
initialSelectedModels || [],
|
|
51
|
-
);
|
|
52
|
-
const [anchorEl, setAnchorEl] = React.useState<null | HTMLElement>(null);
|
|
53
|
-
|
|
54
|
-
React.useEffect(() => {
|
|
55
|
-
setSelectedModels(initialSelectedModels || []);
|
|
56
|
-
}, [initialSelectedModels]);
|
|
57
|
-
|
|
58
|
-
const handleRemove = (model: string) => {
|
|
59
|
-
const newModels = selectedModels.filter((m) => m !== model);
|
|
60
|
-
setSelectedModels(newModels);
|
|
61
|
-
onModelChange(newModels);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const handleAdd = (model: string) => {
|
|
65
|
-
const newModels = [...selectedModels, model];
|
|
66
|
-
setSelectedModels(newModels);
|
|
67
|
-
onModelChange(newModels);
|
|
68
|
-
setAnchorEl(null);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
let availableModels: string[] = [];
|
|
72
|
-
if (isSuccess && data?.data) {
|
|
73
|
-
availableModels = data.data
|
|
74
|
-
.filter((model) => !selectedModels.includes(model.path))
|
|
75
|
-
.map((model) => model.path);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (isError) {
|
|
79
|
-
return (
|
|
80
|
-
<ApiErrorDisplay
|
|
81
|
-
error={error}
|
|
82
|
-
context={`${environmentName} > ${packageName} > Model Picker`}
|
|
83
|
-
/>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return (
|
|
88
|
-
<>
|
|
89
|
-
<FormControl fullWidth>
|
|
90
|
-
{isLoading && <Typography>Loading...</Typography>}
|
|
91
|
-
<Stack direction="row" spacing={1}>
|
|
92
|
-
{selectedModels.map((model) => (
|
|
93
|
-
<Chip
|
|
94
|
-
key={model}
|
|
95
|
-
label={model}
|
|
96
|
-
onDelete={() => handleRemove(model)}
|
|
97
|
-
deleteIcon={<CloseIcon />}
|
|
98
|
-
sx={{ marginBottom: "5px" }}
|
|
99
|
-
/>
|
|
100
|
-
))}
|
|
101
|
-
<Button
|
|
102
|
-
size="small"
|
|
103
|
-
startIcon={<FileUploadOutlinedIcon />}
|
|
104
|
-
onClick={(e) => setAnchorEl(e.currentTarget)}
|
|
105
|
-
disabled={
|
|
106
|
-
isLoading || isError || availableModels.length === 0
|
|
107
|
-
}
|
|
108
|
-
>
|
|
109
|
-
Add Model
|
|
110
|
-
</Button>
|
|
111
|
-
</Stack>
|
|
112
|
-
</FormControl>
|
|
113
|
-
<Menu
|
|
114
|
-
anchorEl={anchorEl}
|
|
115
|
-
open={Boolean(anchorEl)}
|
|
116
|
-
onClose={() => setAnchorEl(null)}
|
|
117
|
-
>
|
|
118
|
-
<Typography variant="subtitle2" sx={{ ml: 1 }}>
|
|
119
|
-
Models
|
|
120
|
-
</Typography>
|
|
121
|
-
<Divider />
|
|
122
|
-
{availableModels.length === 0 ? (
|
|
123
|
-
<MenuItem disabled>No models available</MenuItem>
|
|
124
|
-
) : (
|
|
125
|
-
availableModels.map((model) => (
|
|
126
|
-
<MenuItem key={model} onClick={() => handleAdd(model)}>
|
|
127
|
-
<Typography variant="body2">{model}</Typography>
|
|
128
|
-
</MenuItem>
|
|
129
|
-
))
|
|
130
|
-
)}
|
|
131
|
-
</Menu>
|
|
132
|
-
</>
|
|
133
|
-
);
|
|
134
|
-
}
|
|
@@ -1,458 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Credible Data Inc.
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
|
|
4
|
-
import CheckIcon from "@mui/icons-material/Check";
|
|
5
|
-
import CodeIcon from "@mui/icons-material/Code";
|
|
6
|
-
import EditOutlinedIcon from "@mui/icons-material/EditOutlined";
|
|
7
|
-
import LinkOutlinedIcon from "@mui/icons-material/LinkOutlined";
|
|
8
|
-
import {
|
|
9
|
-
Box,
|
|
10
|
-
Button,
|
|
11
|
-
Collapse,
|
|
12
|
-
Dialog,
|
|
13
|
-
DialogActions,
|
|
14
|
-
DialogContent,
|
|
15
|
-
DialogTitle,
|
|
16
|
-
IconButton,
|
|
17
|
-
Stack,
|
|
18
|
-
Tooltip,
|
|
19
|
-
Typography,
|
|
20
|
-
} from "@mui/material";
|
|
21
|
-
import MDEditor from "@uiw/react-md-editor/nohighlight";
|
|
22
|
-
import Markdown from "markdown-to-jsx";
|
|
23
|
-
import React, { useEffect, useState } from "react";
|
|
24
|
-
import { usePublisherTheme } from "../../theme/ThemeContext";
|
|
25
|
-
import { highlight } from "../highlighter";
|
|
26
|
-
import {
|
|
27
|
-
emptyQueryExplorerResult,
|
|
28
|
-
QueryExplorerResult,
|
|
29
|
-
SourceAndPath,
|
|
30
|
-
} from "../Model/SourcesExplorer";
|
|
31
|
-
import ResultContainer from "../RenderedResult/ResultContainer";
|
|
32
|
-
import { StyledCard } from "../styles";
|
|
33
|
-
import { EditableMalloyCell } from "./EditableMalloyCell";
|
|
34
|
-
import { WorkbookCellValue } from "./WorkbookManager";
|
|
35
|
-
|
|
36
|
-
interface NotebookCellProps {
|
|
37
|
-
cell: WorkbookCellValue;
|
|
38
|
-
editingMalloy?: boolean;
|
|
39
|
-
editingMarkdown?: boolean;
|
|
40
|
-
sourceAndPaths: SourceAndPath[];
|
|
41
|
-
resourceUri: string;
|
|
42
|
-
onCellChange: (cell: WorkbookCellValue) => void;
|
|
43
|
-
onClose: () => void;
|
|
44
|
-
onEdit: () => void;
|
|
45
|
-
onDelete: () => void;
|
|
46
|
-
addButtonCallback: (isMarkdown: boolean) => React.ReactNode;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function MutableCell({
|
|
50
|
-
cell,
|
|
51
|
-
editingMalloy,
|
|
52
|
-
editingMarkdown,
|
|
53
|
-
sourceAndPaths,
|
|
54
|
-
resourceUri,
|
|
55
|
-
onCellChange,
|
|
56
|
-
onClose,
|
|
57
|
-
onEdit,
|
|
58
|
-
onDelete,
|
|
59
|
-
addButtonCallback,
|
|
60
|
-
}: NotebookCellProps) {
|
|
61
|
-
const [value, setValue] = useState(cell.value);
|
|
62
|
-
const [codeExpanded, setCodeExpanded] = React.useState<boolean>(false);
|
|
63
|
-
const [embeddingExpanded, setEmbeddingExpanded] =
|
|
64
|
-
React.useState<boolean>(false);
|
|
65
|
-
const [highlightedMalloyCode, setHighlightedMalloyCode] =
|
|
66
|
-
React.useState<string>();
|
|
67
|
-
const [highlightedEmbedCode] = React.useState<string>();
|
|
68
|
-
const [query, setQuery] = React.useState<QueryExplorerResult>(
|
|
69
|
-
emptyQueryExplorerResult(),
|
|
70
|
-
);
|
|
71
|
-
const [isHovered, setIsHovered] = React.useState<boolean>(false);
|
|
72
|
-
const [selectedSourceIndex, setSelectedSourceIndex] = React.useState<number>(
|
|
73
|
-
cell.sourceName
|
|
74
|
-
? sourceAndPaths.findIndex(
|
|
75
|
-
(entry) => entry.sourceInfo.name === cell.sourceName,
|
|
76
|
-
)
|
|
77
|
-
: 0,
|
|
78
|
-
);
|
|
79
|
-
|
|
80
|
-
const { mode } = usePublisherTheme();
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
if (!cell.isMarkdown)
|
|
83
|
-
highlight(cell.value, "malloy", mode).then((code) => {
|
|
84
|
-
setHighlightedMalloyCode(code);
|
|
85
|
-
});
|
|
86
|
-
}, [cell, mode]);
|
|
87
|
-
React.useEffect(() => {
|
|
88
|
-
document.documentElement.setAttribute("data-color-mode", "light");
|
|
89
|
-
});
|
|
90
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
91
|
-
|
|
92
|
-
const handleDeleteConfirm = () => {
|
|
93
|
-
onDelete();
|
|
94
|
-
setDeleteDialogOpen(false);
|
|
95
|
-
};
|
|
96
|
-
const noSources = sourceAndPaths.length === 0;
|
|
97
|
-
|
|
98
|
-
const saveResult = React.useCallback(() => {
|
|
99
|
-
// Get the current modelPath and sourceName from the selected source
|
|
100
|
-
const currentSource = sourceAndPaths[selectedSourceIndex];
|
|
101
|
-
const modelPath = currentSource?.modelPath || cell.modelPath || "";
|
|
102
|
-
const sourceName =
|
|
103
|
-
currentSource?.sourceInfo.name || cell.sourceName || "";
|
|
104
|
-
|
|
105
|
-
// Convert the results of the Query Explorer into
|
|
106
|
-
// the stringified JSON objects that are stored in the cell.
|
|
107
|
-
onCellChange({
|
|
108
|
-
...cell,
|
|
109
|
-
value: cell.isMarkdown ? value : query.query,
|
|
110
|
-
result: query.malloyResult
|
|
111
|
-
? JSON.stringify(query.malloyResult)
|
|
112
|
-
: undefined,
|
|
113
|
-
queryInfo: query.malloyQuery
|
|
114
|
-
? JSON.stringify(query.malloyQuery)
|
|
115
|
-
: undefined,
|
|
116
|
-
sourceName,
|
|
117
|
-
modelPath,
|
|
118
|
-
});
|
|
119
|
-
}, [cell, value, query, onCellChange, selectedSourceIndex, sourceAndPaths]);
|
|
120
|
-
|
|
121
|
-
const deleteButton = (
|
|
122
|
-
<Tooltip title="Delete Cell">
|
|
123
|
-
<IconButton size="small" onClick={() => setDeleteDialogOpen(true)}>
|
|
124
|
-
<svg
|
|
125
|
-
width="20"
|
|
126
|
-
height="20"
|
|
127
|
-
viewBox="0 0 24 24"
|
|
128
|
-
fill="none"
|
|
129
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
130
|
-
>
|
|
131
|
-
<path
|
|
132
|
-
d="M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6"
|
|
133
|
-
stroke="currentColor"
|
|
134
|
-
strokeWidth="2"
|
|
135
|
-
strokeLinecap="round"
|
|
136
|
-
strokeLinejoin="round"
|
|
137
|
-
/>
|
|
138
|
-
</svg>
|
|
139
|
-
</IconButton>
|
|
140
|
-
</Tooltip>
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
const deleteDialog = (
|
|
144
|
-
<Dialog
|
|
145
|
-
open={deleteDialogOpen}
|
|
146
|
-
onClose={() => setDeleteDialogOpen(false)}
|
|
147
|
-
>
|
|
148
|
-
<DialogTitle>Confirm Delete</DialogTitle>
|
|
149
|
-
<DialogContent>
|
|
150
|
-
<Typography>Are you sure you want to delete this cell?</Typography>
|
|
151
|
-
</DialogContent>
|
|
152
|
-
<DialogActions>
|
|
153
|
-
<Button onClick={() => setDeleteDialogOpen(false)}>Cancel</Button>
|
|
154
|
-
<Button onClick={handleDeleteConfirm} color="error">
|
|
155
|
-
Delete
|
|
156
|
-
</Button>
|
|
157
|
-
</DialogActions>
|
|
158
|
-
</Dialog>
|
|
159
|
-
);
|
|
160
|
-
const saveAndClose = () => {
|
|
161
|
-
saveResult();
|
|
162
|
-
onClose();
|
|
163
|
-
};
|
|
164
|
-
const buttons = cell.isMarkdown ? (
|
|
165
|
-
<>
|
|
166
|
-
{editingMarkdown ? (
|
|
167
|
-
<Tooltip title="Save">
|
|
168
|
-
<IconButton size="small" onClick={saveAndClose}>
|
|
169
|
-
<CheckIcon />
|
|
170
|
-
</IconButton>
|
|
171
|
-
</Tooltip>
|
|
172
|
-
) : (
|
|
173
|
-
<Tooltip title="Edit">
|
|
174
|
-
<IconButton size="small" onClick={onEdit}>
|
|
175
|
-
<EditOutlinedIcon />
|
|
176
|
-
</IconButton>
|
|
177
|
-
</Tooltip>
|
|
178
|
-
)}
|
|
179
|
-
{!editingMarkdown && deleteButton}
|
|
180
|
-
</>
|
|
181
|
-
) : (
|
|
182
|
-
<>
|
|
183
|
-
{!editingMalloy && (
|
|
184
|
-
<Tooltip title={codeExpanded ? "Hide Code" : "View Code"}>
|
|
185
|
-
<IconButton
|
|
186
|
-
size="small"
|
|
187
|
-
onClick={() => {
|
|
188
|
-
setCodeExpanded(!codeExpanded);
|
|
189
|
-
}}
|
|
190
|
-
>
|
|
191
|
-
<CodeIcon />
|
|
192
|
-
</IconButton>
|
|
193
|
-
</Tooltip>
|
|
194
|
-
)}
|
|
195
|
-
{!editingMalloy && cell.result && (
|
|
196
|
-
<Tooltip
|
|
197
|
-
title={embeddingExpanded ? "Hide Embedding" : "View Embedding"}
|
|
198
|
-
>
|
|
199
|
-
<IconButton
|
|
200
|
-
size="small"
|
|
201
|
-
onClick={() => {
|
|
202
|
-
setEmbeddingExpanded(!embeddingExpanded);
|
|
203
|
-
}}
|
|
204
|
-
>
|
|
205
|
-
<LinkOutlinedIcon />
|
|
206
|
-
</IconButton>
|
|
207
|
-
</Tooltip>
|
|
208
|
-
)}
|
|
209
|
-
{editingMalloy && (
|
|
210
|
-
<Tooltip title="Save">
|
|
211
|
-
<IconButton size="small" onClick={saveAndClose}>
|
|
212
|
-
<CheckIcon />
|
|
213
|
-
</IconButton>
|
|
214
|
-
</Tooltip>
|
|
215
|
-
)}
|
|
216
|
-
{!editingMalloy && (
|
|
217
|
-
<Tooltip title="Edit">
|
|
218
|
-
<IconButton size="small" onClick={onEdit}>
|
|
219
|
-
<EditOutlinedIcon />
|
|
220
|
-
</IconButton>
|
|
221
|
-
</Tooltip>
|
|
222
|
-
)}
|
|
223
|
-
{!editingMalloy && deleteButton}
|
|
224
|
-
</>
|
|
225
|
-
);
|
|
226
|
-
|
|
227
|
-
const isEditing = editingMalloy || editingMarkdown;
|
|
228
|
-
const editingButtons = editingMarkdown ? (
|
|
229
|
-
<Tooltip title="Save">
|
|
230
|
-
<IconButton size="small" onClick={saveAndClose}>
|
|
231
|
-
<CheckIcon />
|
|
232
|
-
</IconButton>
|
|
233
|
-
</Tooltip>
|
|
234
|
-
) : editingMalloy ? (
|
|
235
|
-
<Tooltip title="Save">
|
|
236
|
-
<IconButton size="small" onClick={saveAndClose}>
|
|
237
|
-
<CheckIcon />
|
|
238
|
-
</IconButton>
|
|
239
|
-
</Tooltip>
|
|
240
|
-
) : null;
|
|
241
|
-
|
|
242
|
-
const hoverButtonBox = isHovered && (
|
|
243
|
-
<Box
|
|
244
|
-
sx={{
|
|
245
|
-
position: "absolute",
|
|
246
|
-
top: "4px",
|
|
247
|
-
right: "4px",
|
|
248
|
-
// transform: "translateX(-50%)",
|
|
249
|
-
display: "flex",
|
|
250
|
-
gap: "8px",
|
|
251
|
-
backgroundColor: "background.paper",
|
|
252
|
-
border: "1px solid",
|
|
253
|
-
borderColor: "divider",
|
|
254
|
-
borderRadius: "8px",
|
|
255
|
-
padding: "2px 4px",
|
|
256
|
-
boxShadow: 1,
|
|
257
|
-
zIndex: 10,
|
|
258
|
-
}}
|
|
259
|
-
>
|
|
260
|
-
{(!isEditing && (
|
|
261
|
-
<>
|
|
262
|
-
{addButtonCallback(true)}
|
|
263
|
-
{addButtonCallback(false)}
|
|
264
|
-
{buttons}
|
|
265
|
-
</>
|
|
266
|
-
)) ||
|
|
267
|
-
editingButtons}
|
|
268
|
-
</Box>
|
|
269
|
-
);
|
|
270
|
-
|
|
271
|
-
return (
|
|
272
|
-
<StyledCard
|
|
273
|
-
sx={(theme) => ({
|
|
274
|
-
position: "relative",
|
|
275
|
-
marginTop: "5px",
|
|
276
|
-
marginBottom: "5px",
|
|
277
|
-
borderWidth: "1.5px",
|
|
278
|
-
backgroundColor: theme.palette.background.paper,
|
|
279
|
-
minHeight: "50px",
|
|
280
|
-
})}
|
|
281
|
-
onMouseEnter={() => setIsHovered(true)}
|
|
282
|
-
onMouseLeave={() => {
|
|
283
|
-
setIsHovered(false);
|
|
284
|
-
}}
|
|
285
|
-
>
|
|
286
|
-
{hoverButtonBox}
|
|
287
|
-
{cell.isMarkdown ? (
|
|
288
|
-
<>
|
|
289
|
-
{editingMarkdown ? (
|
|
290
|
-
<MDEditor
|
|
291
|
-
value={value}
|
|
292
|
-
preview="edit"
|
|
293
|
-
autoFocus
|
|
294
|
-
onChange={(newValue) => {
|
|
295
|
-
setValue(newValue);
|
|
296
|
-
onCellChange({ ...cell, value: newValue });
|
|
297
|
-
}}
|
|
298
|
-
onBlur={() => {
|
|
299
|
-
saveResult();
|
|
300
|
-
if (!isHovered) {
|
|
301
|
-
saveAndClose();
|
|
302
|
-
}
|
|
303
|
-
}}
|
|
304
|
-
/>
|
|
305
|
-
) : (
|
|
306
|
-
<Box
|
|
307
|
-
sx={{
|
|
308
|
-
px: 0.5,
|
|
309
|
-
pt: 0,
|
|
310
|
-
mt: 0,
|
|
311
|
-
"& h1, & h2, & h3, & h4, & h5, & h6": {
|
|
312
|
-
mt: 0.5,
|
|
313
|
-
mb: 0.5,
|
|
314
|
-
},
|
|
315
|
-
"& p": { mt: 0.5, mb: 0.5 },
|
|
316
|
-
"& ul, & ol": { mt: 0.5, mb: 0.5 },
|
|
317
|
-
"& li": { mt: 0, mb: 0 },
|
|
318
|
-
"& pre, & code": { mt: 0.5, mb: 0.5 },
|
|
319
|
-
"& blockquote": { mt: 0.5, mb: 0.5 },
|
|
320
|
-
}}
|
|
321
|
-
>
|
|
322
|
-
{cell.value ? (
|
|
323
|
-
<Box onClick={onEdit} sx={{ cursor: "pointer" }}>
|
|
324
|
-
<Markdown>{cell.value}</Markdown>
|
|
325
|
-
</Box>
|
|
326
|
-
) : (
|
|
327
|
-
<Box onClick={onEdit} sx={{ cursor: "pointer" }}>
|
|
328
|
-
<Typography
|
|
329
|
-
sx={{
|
|
330
|
-
p: 2,
|
|
331
|
-
textAlign: "center",
|
|
332
|
-
variant: "subtitle2",
|
|
333
|
-
fontWeight: "medium",
|
|
334
|
-
}}
|
|
335
|
-
>
|
|
336
|
-
Markdown is empty
|
|
337
|
-
</Typography>
|
|
338
|
-
<Typography
|
|
339
|
-
sx={{
|
|
340
|
-
mb: 2,
|
|
341
|
-
textAlign: "center",
|
|
342
|
-
variant: "body2",
|
|
343
|
-
}}
|
|
344
|
-
>
|
|
345
|
-
Click to edit.
|
|
346
|
-
</Typography>
|
|
347
|
-
</Box>
|
|
348
|
-
)}
|
|
349
|
-
</Box>
|
|
350
|
-
)}
|
|
351
|
-
</>
|
|
352
|
-
) : (
|
|
353
|
-
<>
|
|
354
|
-
<Collapse in={embeddingExpanded} timeout="auto" unmountOnExit>
|
|
355
|
-
<Stack
|
|
356
|
-
sx={{
|
|
357
|
-
p: "10px",
|
|
358
|
-
borderRadius: 0,
|
|
359
|
-
flexDirection: "row",
|
|
360
|
-
justifyContent: "space-between",
|
|
361
|
-
}}
|
|
362
|
-
>
|
|
363
|
-
<Typography
|
|
364
|
-
component="div"
|
|
365
|
-
sx={{
|
|
366
|
-
fontSize: "12px",
|
|
367
|
-
"& .line": { textWrap: "wrap" },
|
|
368
|
-
}}
|
|
369
|
-
dangerouslySetInnerHTML={{
|
|
370
|
-
__html: highlightedEmbedCode,
|
|
371
|
-
}}
|
|
372
|
-
/>
|
|
373
|
-
</Stack>
|
|
374
|
-
</Collapse>
|
|
375
|
-
<Collapse in={codeExpanded} timeout="auto" unmountOnExit>
|
|
376
|
-
<Stack
|
|
377
|
-
sx={{
|
|
378
|
-
p: "10px",
|
|
379
|
-
borderRadius: 0,
|
|
380
|
-
flexDirection: "row",
|
|
381
|
-
justifyContent: "space-between",
|
|
382
|
-
}}
|
|
383
|
-
>
|
|
384
|
-
<Typography
|
|
385
|
-
component="div"
|
|
386
|
-
className="content"
|
|
387
|
-
sx={{
|
|
388
|
-
fontSize: "12px",
|
|
389
|
-
"& .line": { textWrap: "wrap" },
|
|
390
|
-
}}
|
|
391
|
-
dangerouslySetInnerHTML={{
|
|
392
|
-
__html: highlightedMalloyCode,
|
|
393
|
-
}}
|
|
394
|
-
/>
|
|
395
|
-
</Stack>
|
|
396
|
-
</Collapse>
|
|
397
|
-
{editingMalloy &&
|
|
398
|
-
(noSources ? (
|
|
399
|
-
<>
|
|
400
|
-
<Typography
|
|
401
|
-
sx={{
|
|
402
|
-
p: 2,
|
|
403
|
-
textAlign: "center",
|
|
404
|
-
variant: "subtitle2",
|
|
405
|
-
fontWeight: "medium",
|
|
406
|
-
}}
|
|
407
|
-
>
|
|
408
|
-
No Model Imports
|
|
409
|
-
</Typography>
|
|
410
|
-
<Typography
|
|
411
|
-
sx={{ mb: 2, textAlign: "center", variant: "body2" }}
|
|
412
|
-
>
|
|
413
|
-
Please add a model import above.
|
|
414
|
-
</Typography>
|
|
415
|
-
</>
|
|
416
|
-
) : (
|
|
417
|
-
<EditableMalloyCell
|
|
418
|
-
sourceAndPaths={sourceAndPaths}
|
|
419
|
-
resourceUri={resourceUri}
|
|
420
|
-
onQueryChange={(query) => {
|
|
421
|
-
setQuery(query);
|
|
422
|
-
}}
|
|
423
|
-
onSourceChange={(index) => {
|
|
424
|
-
setSelectedSourceIndex(index);
|
|
425
|
-
}}
|
|
426
|
-
cell={cell}
|
|
427
|
-
/>
|
|
428
|
-
))}
|
|
429
|
-
{!editingMalloy && cell.result && (
|
|
430
|
-
<StyledCard variant="outlined" sx={{ borderRadius: 0 }}>
|
|
431
|
-
<ResultContainer result={cell.result} maxHeight={800} />
|
|
432
|
-
</StyledCard>
|
|
433
|
-
)}
|
|
434
|
-
{!editingMalloy && !cell.result && (
|
|
435
|
-
<Box onClick={onEdit} sx={{ cursor: "pointer" }}>
|
|
436
|
-
<Typography
|
|
437
|
-
sx={{
|
|
438
|
-
p: 2,
|
|
439
|
-
textAlign: "center",
|
|
440
|
-
variant: "subtitle2",
|
|
441
|
-
fontWeight: "medium",
|
|
442
|
-
}}
|
|
443
|
-
>
|
|
444
|
-
Explore is empty
|
|
445
|
-
</Typography>
|
|
446
|
-
<Typography
|
|
447
|
-
sx={{ mb: 2, textAlign: "center", variant: "body2" }}
|
|
448
|
-
>
|
|
449
|
-
Click to edit.
|
|
450
|
-
</Typography>
|
|
451
|
-
</Box>
|
|
452
|
-
)}
|
|
453
|
-
</>
|
|
454
|
-
)}
|
|
455
|
-
{deleteDialogOpen && deleteDialog}
|
|
456
|
-
</StyledCard>
|
|
457
|
-
);
|
|
458
|
-
}
|