@malloy-publisher/sdk 0.8.1 → 0.8.2
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/{DocumentStorage-D7yF4_T3.cjs.js → DocumentStorage-B0_YgSzt.cjs.js} +32 -32
- package/dist/{DocumentStorage-BCpTBa7U.es.js → DocumentStorage-BZqn0x5r.es.js} +3826 -3741
- package/dist/{RenderedResult-ChkvK7b2.cjs.js → RenderedResult-Bu25oAAr.cjs.js} +1 -1
- package/dist/{RenderedResult-CDA9mN_6.es.js → RenderedResult-DKOl0FQ8.es.js} +2 -2
- package/dist/{ServerProvider-CvMqBhuj.es.js → ServerProvider-CfUFleYe.es.js} +4 -4
- package/dist/builder/index.cjs.js +1 -1
- package/dist/builder/index.es.js +2 -2
- package/dist/client/api.d.ts +10 -4
- package/dist/client/index.es.js +1 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +3 -1
- package/dist/components/Model/Model.d.ts +10 -3
- package/dist/components/Model/ModelExplorer.d.ts +21 -1
- package/dist/components/Model/ModelExplorerDialog.d.ts +4 -1
- package/dist/components/Model/SourcesExplorer.d.ts +8 -1
- package/dist/components/Model/index.d.ts +1 -0
- package/dist/components/Model/runGate.d.ts +19 -0
- package/dist/components/Notebook/NotebookCell.d.ts +10 -1
- package/dist/index.cjs.js +13 -13
- package/dist/index.es.js +3754 -3732
- package/package.json +1 -1
- package/src/components/Dashboard/Dashboard.spec.tsx +58 -2
- package/src/components/Dashboard/Dashboard.tsx +8 -1
- package/src/components/Dashboard/ExploreDialog.tsx +5 -0
- package/src/components/Model/Model.tsx +28 -1
- package/src/components/Model/ModelExplorer.spec.tsx +404 -0
- package/src/components/Model/ModelExplorer.tsx +65 -2
- package/src/components/Model/ModelExplorerDialog.tsx +12 -0
- package/src/components/Model/SourcesExplorer.tsx +70 -15
- package/src/components/Model/index.ts +1 -0
- package/src/components/Model/runGate.spec.ts +102 -0
- package/src/components/Model/runGate.ts +67 -0
- package/src/components/Notebook/Notebook.spec.tsx +67 -3
- package/src/components/Notebook/Notebook.tsx +12 -2
- package/src/components/Notebook/NotebookCell.tsx +26 -7
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
Typography,
|
|
21
21
|
} from "@mui/material";
|
|
22
22
|
import React, { useEffect, useState } from "react";
|
|
23
|
+
import type { Given } from "../../client";
|
|
23
24
|
import { usePublisherTheme } from "../../theme/ThemeContext";
|
|
24
25
|
import { parseResourceUri } from "../../utils/formatting";
|
|
25
26
|
import { highlight } from "../highlighter";
|
|
@@ -82,6 +83,14 @@ interface NotebookCellProps {
|
|
|
82
83
|
* drill inert rather than dead-ended, and removes the affordance with it.
|
|
83
84
|
*/
|
|
84
85
|
onDrillNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
|
|
86
|
+
/**
|
|
87
|
+
* The notebook's current control values, to seed the "Data Sources"
|
|
88
|
+
* dialog's own so exploring from a cell starts from what the reader is
|
|
89
|
+
* looking at rather than the model's bare defaults.
|
|
90
|
+
*/
|
|
91
|
+
givens?: Record<string, string>;
|
|
92
|
+
/** The notebook's declared givens, so that dialog renders their controls. */
|
|
93
|
+
givenSpecs?: Given[];
|
|
85
94
|
}
|
|
86
95
|
|
|
87
96
|
export function NotebookCell({
|
|
@@ -97,6 +106,8 @@ export function NotebookCell({
|
|
|
97
106
|
onDrillSelf,
|
|
98
107
|
canDrillSelf,
|
|
99
108
|
onDrillNavigate,
|
|
109
|
+
givens,
|
|
110
|
+
givenSpecs,
|
|
100
111
|
}: NotebookCellProps) {
|
|
101
112
|
const [codeDialogOpen, setCodeDialogOpen] = React.useState<boolean>(false);
|
|
102
113
|
const [embeddingDialogOpen, setEmbeddingDialogOpen] =
|
|
@@ -209,13 +220,20 @@ export function NotebookCell({
|
|
|
209
220
|
return 0; // Default to the first source
|
|
210
221
|
};
|
|
211
222
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
// Memoized: the dialog's given controls key off this object's identity.
|
|
224
|
+
const modelDataFromNewSources = React.useMemo(
|
|
225
|
+
() =>
|
|
226
|
+
cell.newSources && cell.newSources.length > 0
|
|
227
|
+
? {
|
|
228
|
+
sourceInfos: cell.newSources,
|
|
229
|
+
resource: resourceUri,
|
|
230
|
+
// A cell's sources carry no givens of their own; without the
|
|
231
|
+
// notebook's, the dialog has no controls and a gated source 403s.
|
|
232
|
+
givens: givenSpecs,
|
|
233
|
+
}
|
|
234
|
+
: undefined,
|
|
235
|
+
[cell.newSources, resourceUri, givenSpecs],
|
|
236
|
+
);
|
|
219
237
|
|
|
220
238
|
const queryResultCodeSnippet = createEmbeddedQueryResult({
|
|
221
239
|
query: cell.text,
|
|
@@ -349,6 +367,7 @@ export function NotebookCell({
|
|
|
349
367
|
resourceUri={resourceUri}
|
|
350
368
|
data={modelDataFromNewSources}
|
|
351
369
|
initialSelectedSourceIndex={getInitialSourceIndex()}
|
|
370
|
+
startingGivens={givens}
|
|
352
371
|
/>
|
|
353
372
|
|
|
354
373
|
{/* Code Dialog */}
|