@malloy-publisher/sdk 0.9.10 → 0.9.12
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/{RenderedResult-Dp1Qdajz.es.js → RenderedResult-CDiXJAh9.es.js} +102 -102
- package/dist/RenderedResult-De51QvsZ.cjs.js +153 -0
- package/dist/ServerProvider-DKrBcXL7.cjs.js +1 -0
- package/dist/{ServerProvider-CQy4jVYK.es.js → ServerProvider-RvKSbvnL.es.js} +622 -587
- package/dist/builder/index.cjs.js +78 -130
- package/dist/builder/index.es.js +7493 -6769
- package/dist/builder-entry.d.ts +3 -0
- package/dist/client/api.d.ts +72 -23
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/AppDialog.d.ts +9 -1
- package/dist/components/Connections/common.d.ts +11 -3
- package/dist/components/Dashboard/DashboardGrid.d.ts +14 -15
- package/dist/components/Dashboard/DashboardTile.d.ts +8 -1
- package/dist/components/Dashboard/DashboardView.d.ts +22 -34
- package/dist/components/Dashboard/TileCard.d.ts +10 -3
- package/dist/components/Dashboard/useStuck.d.ts +15 -7
- package/dist/components/DocumentCreate/useDocumentChoices.d.ts +6 -0
- package/dist/components/Package/PackageProblems.d.ts +14 -0
- package/dist/components/RemoveBadge.d.ts +40 -0
- package/dist/components/Report/Report.d.ts +13 -4
- package/dist/components/Report/ReportPage.d.ts +60 -0
- package/dist/components/Report/layoutRules.d.ts +32 -0
- package/dist/components/Report/reportQuery.d.ts +30 -0
- package/dist/components/Report/telemetry.d.ts +0 -2
- package/dist/components/ReportBuilder/AddTileDialog.d.ts +22 -3
- package/dist/components/ReportBuilder/BuilderBar.d.ts +17 -0
- package/dist/components/ReportBuilder/BuilderDialogs.d.ts +7 -6
- package/dist/components/ReportBuilder/BuilderGrid.d.ts +10 -4
- package/dist/components/ReportBuilder/BuilderHeader.d.ts +4 -7
- package/dist/components/ReportBuilder/BuilderToolbar.d.ts +88 -0
- package/dist/components/ReportBuilder/DrillDialog.d.ts +3 -1
- package/dist/components/ReportBuilder/EditorSurface.d.ts +7 -9
- package/dist/components/ReportBuilder/FilterDialog.d.ts +3 -1
- package/dist/components/ReportBuilder/FilterStrip.d.ts +30 -8
- package/dist/components/ReportBuilder/InlineMarkdown.d.ts +4 -4
- package/dist/components/ReportBuilder/ReportBuilder.d.ts +49 -12
- package/dist/components/ReportBuilder/ReportEditor.d.ts +53 -3
- package/dist/components/ReportBuilder/TextTileBody.d.ts +2 -5
- package/dist/components/ReportBuilder/TileFrame.d.ts +10 -4
- package/dist/components/ReportBuilder/TileMenu.d.ts +12 -9
- package/dist/components/ReportBuilder/ViewPicker.d.ts +53 -0
- package/dist/components/ReportBuilder/addTileToDocument.d.ts +24 -3
- package/dist/components/ReportBuilder/builderControls.d.ts +60 -0
- package/dist/components/ReportBuilder/catalog.d.ts +2 -4
- package/dist/components/ReportBuilder/inlineEdit.d.ts +9 -10
- package/dist/components/ReportBuilder/localGiven.d.ts +12 -0
- package/dist/components/ReportBuilder/preview.d.ts +17 -2
- package/dist/components/ReportBuilder/readDocument.d.ts +0 -2
- package/dist/components/ReportBuilder/readForEditor.d.ts +2 -7
- package/dist/components/ReportBuilder/reportTag.d.ts +11 -1
- package/dist/components/ReportBuilder/sortable.d.ts +4 -3
- package/dist/components/ReportBuilder/testing/inline.d.ts +5 -1
- package/dist/components/ReportBuilder/useBuilderSelection.d.ts +0 -1
- package/dist/components/ReportBuilder/useBuilderSession.d.ts +21 -12
- package/dist/components/ReportBuilder/useDocumentEditor.d.ts +2 -6
- package/dist/components/ReportBuilder/useExitGuard.d.ts +3 -0
- package/dist/components/ReportBuilder/useFilterForm.d.ts +3 -1
- package/dist/components/ReportBuilder/useOpenedDocument.d.ts +0 -4
- package/dist/components/ReportBuilder/useReportDraft.d.ts +66 -0
- package/dist/components/ReportBuilder/useReportEditor.d.ts +0 -9
- package/dist/components/ReportBuilder/useTileEditing.d.ts +6 -3
- package/dist/components/ReportBuilder/viewAnnotations.d.ts +9 -0
- package/dist/components/ReportBuilder/widthLabel.d.ts +6 -0
- package/dist/components/ServerProvider.d.ts +9 -0
- package/dist/components/controlTokens.d.ts +45 -0
- package/dist/components/drill/markDrillableCells.d.ts +1 -1
- package/dist/components/given/FilterButton.d.ts +35 -0
- package/dist/components/given/GivensPanel.d.ts +2 -1
- package/dist/components/given/filterEditing.d.ts +54 -0
- package/dist/components/given/filterSummary.d.ts +9 -0
- package/dist/components/given/paramCodec.d.ts +11 -0
- package/dist/components/given/required.d.ts +25 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/legacy/index.d.ts +1 -1
- package/dist/components/{Report/CellReport.d.ts → legacy/malloynb/CellRunnerView.d.ts} +9 -17
- package/dist/components/legacy/{MalloynbCells.d.ts → malloynb/MalloynbCells.d.ts} +3 -3
- package/dist/components/legacy/{Notebook.d.ts → malloynb/Notebook.d.ts} +1 -1
- package/dist/components/{Notebook → legacy/malloynb}/NotebookCell.d.ts +3 -3
- package/dist/components/legacy/malloynb/cellKind.d.ts +5 -0
- package/dist/components/{Notebook → legacy/malloynb}/types.d.ts +1 -1
- package/dist/components/styles.d.ts +0 -2
- package/dist/hooks/useQueryResult.d.ts +7 -0
- package/dist/index.cjs.js +16 -19
- package/dist/index.es.js +8418 -7722
- package/dist/theme/ThemeContext.d.ts +8 -1
- package/dist/theme/classes.d.ts +49 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/ui.d.ts +75 -0
- package/dist/{useCompiledDocument-BMPDvdFx.es.js → useCompiledDocument-Bf4RSfB6.es.js} +8669 -7851
- package/dist/useCompiledDocument-XsQz85Ri.cjs.js +141 -0
- package/package.json +2 -2
- package/src/builder-entry.ts +9 -0
- package/src/components/AppDialog.tsx +23 -0
- package/src/components/Connections/AddConnectionDialog.tsx +34 -2
- package/src/components/Connections/EditConnectionDialog.tsx +45 -3
- package/src/components/Connections/common.spec.ts +69 -0
- package/src/components/Connections/common.ts +132 -0
- package/src/components/Dashboard/DashboardGrid.tsx +39 -17
- package/src/components/Dashboard/DashboardTile.tsx +19 -2
- package/src/components/Dashboard/DashboardView.spec.tsx +216 -15
- package/src/components/Dashboard/DashboardView.tsx +137 -155
- package/src/components/Dashboard/RowsDialog.tsx +1 -2
- package/src/components/Dashboard/TileCard.tsx +28 -10
- package/src/components/Dashboard/defaultTileSpan.spec.ts +24 -0
- package/src/components/Dashboard/useStuck.ts +28 -17
- package/src/components/DocumentCreate/useDocumentChoices.ts +19 -2
- package/src/components/Environment/Connections.tsx +1 -0
- package/src/components/Package/NewDocumentDialog.spec.tsx +76 -59
- package/src/components/Package/NewDocumentDialog.tsx +383 -119
- package/src/components/Package/Package.artifacts.spec.tsx +1 -1
- package/src/components/Package/Package.create.spec.tsx +7 -6
- package/src/components/Package/Package.tsx +10 -7
- package/src/components/Package/PackageProblems.spec.tsx +41 -0
- package/src/components/Package/PackageProblems.tsx +95 -0
- package/src/components/Prose.tsx +12 -7
- package/src/components/RemoveBadge.tsx +94 -0
- package/src/components/RenderedResult/RenderedResult.tsx +5 -9
- package/src/components/RenderedResult/ResultPanel.tsx +59 -3
- package/src/components/Report/Report.spec.tsx +50 -32
- package/src/components/Report/Report.telemetry.spec.tsx +0 -45
- package/src/components/Report/Report.tsx +45 -77
- package/src/components/Report/ReportPage.tsx +168 -0
- package/src/components/Report/layoutRules.spec.ts +35 -0
- package/src/components/Report/layoutRules.ts +55 -0
- package/src/components/Report/reportQuery.ts +53 -0
- package/src/components/Report/telemetry.ts +0 -2
- package/src/components/ReportBuilder/AddTileDialog.spec.tsx +76 -41
- package/src/components/ReportBuilder/AddTileDialog.tsx +368 -133
- package/src/components/ReportBuilder/BuilderBar.tsx +599 -0
- package/src/components/ReportBuilder/BuilderDialogs.tsx +28 -39
- package/src/components/ReportBuilder/BuilderGrid.tsx +31 -29
- package/src/components/ReportBuilder/BuilderHeader.tsx +63 -75
- package/src/components/ReportBuilder/BuilderToolbar.tsx +95 -9
- package/src/components/ReportBuilder/DrillDialog.tsx +240 -128
- package/src/components/ReportBuilder/EditorSurface.tsx +345 -69
- package/src/components/ReportBuilder/FilterDialog.tsx +516 -166
- package/src/components/ReportBuilder/FilterStrip.tsx +130 -151
- package/src/components/ReportBuilder/InlineMarkdown.tsx +71 -45
- package/src/components/ReportBuilder/ReportBuilder.charts.spec.tsx +35 -40
- package/src/components/ReportBuilder/ReportBuilder.controls.spec.tsx +491 -0
- package/src/components/ReportBuilder/ReportBuilder.exit.spec.tsx +2 -4
- package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +13 -15
- package/src/components/ReportBuilder/ReportBuilder.notebook.spec.tsx +27 -118
- package/src/components/ReportBuilder/ReportBuilder.openDraft.spec.tsx +12 -5
- package/src/components/ReportBuilder/ReportBuilder.sources.spec.tsx +2 -10
- package/src/components/ReportBuilder/ReportBuilder.spec.tsx +37 -31
- package/src/components/ReportBuilder/ReportBuilder.textTiles.spec.tsx +22 -15
- package/src/components/ReportBuilder/ReportBuilder.tsx +292 -117
- package/src/components/ReportBuilder/ReportEditor.emptyStart.spec.tsx +2 -1
- package/src/components/ReportBuilder/ReportEditor.modelFilters.spec.tsx +312 -0
- package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +26 -75
- package/src/components/ReportBuilder/ReportEditor.package.spec.tsx +6 -2
- package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -2
- package/src/components/ReportBuilder/ReportEditor.spec.tsx +2 -4
- package/src/components/ReportBuilder/ReportEditor.textSource.spec.tsx +93 -13
- package/src/components/ReportBuilder/ReportEditor.tsx +104 -14
- package/src/components/ReportBuilder/TextTileBody.tsx +6 -7
- package/src/components/ReportBuilder/TileFrame.tsx +212 -75
- package/src/components/ReportBuilder/TileMenu.tsx +241 -140
- package/src/components/ReportBuilder/ViewPicker.tsx +349 -0
- package/src/components/ReportBuilder/addTile.compile.spec.ts +1 -1
- package/src/components/ReportBuilder/addTileToDocument.spec.ts +102 -3
- package/src/components/ReportBuilder/addTileToDocument.ts +122 -25
- package/src/components/ReportBuilder/builderControls.ts +164 -0
- package/src/components/ReportBuilder/builderReport.ts +1 -2
- package/src/components/ReportBuilder/catalog.ts +10 -26
- package/src/components/ReportBuilder/inlineEdit.tsx +22 -54
- package/src/components/ReportBuilder/localGiven.ts +56 -0
- package/src/components/ReportBuilder/preview.spec.ts +125 -5
- package/src/components/ReportBuilder/preview.ts +60 -44
- package/src/components/ReportBuilder/readDocument.spec.ts +16 -22
- package/src/components/ReportBuilder/readDocument.ts +14 -11
- package/src/components/ReportBuilder/readForEditor.spec.ts +12 -41
- package/src/components/ReportBuilder/readForEditor.ts +4 -26
- package/src/components/ReportBuilder/reportTag.ts +28 -7
- package/src/components/ReportBuilder/sortable.tsx +15 -7
- package/src/components/ReportBuilder/spliceDocument.imports.spec.ts +1 -1
- package/src/components/ReportBuilder/tagParse.spec.ts +0 -40
- package/src/components/ReportBuilder/testing/inline.ts +25 -5
- package/src/components/ReportBuilder/testing/reportLayoutParity.json +13 -8
- package/src/components/ReportBuilder/textTiles.spec.ts +7 -6
- package/src/components/ReportBuilder/useBuilderSelection.ts +35 -0
- package/src/components/ReportBuilder/useBuilderSession.spec.ts +2 -2
- package/src/components/ReportBuilder/useBuilderSession.ts +21 -13
- package/src/components/ReportBuilder/useDocumentEditor.spec.ts +0 -58
- package/src/components/ReportBuilder/useDocumentEditor.ts +3 -16
- package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +26 -0
- package/src/components/ReportBuilder/useEditorCatalog.ts +7 -2
- package/src/components/ReportBuilder/useExitGuard.ts +16 -0
- package/src/components/ReportBuilder/useFilterForm.spec.tsx +17 -0
- package/src/components/ReportBuilder/useFilterForm.ts +5 -1
- package/src/components/ReportBuilder/useOpenedDocument.ts +0 -2
- package/src/components/ReportBuilder/useReportDraft.spec.ts +149 -0
- package/src/components/ReportBuilder/useReportDraft.ts +292 -0
- package/src/components/ReportBuilder/useReportEditor.ts +3 -12
- package/src/components/ReportBuilder/useSaveChannel.ts +0 -1
- package/src/components/ReportBuilder/useTileEditing.ts +43 -12
- package/src/components/ReportBuilder/viewAnnotations.ts +29 -0
- package/src/components/ReportBuilder/widthLabel.spec.ts +25 -0
- package/src/components/ReportBuilder/widthLabel.ts +26 -0
- package/src/components/ServerProvider.tsx +11 -0
- package/src/components/controlTokens.ts +47 -0
- package/src/components/drill/markDrillableCells.ts +2 -1
- package/src/components/given/FilterButton.spec.tsx +143 -0
- package/src/components/given/FilterButton.tsx +478 -0
- package/src/components/given/GivenInput.spec.tsx +47 -0
- package/src/components/given/GivenInput.tsx +20 -2
- package/src/components/given/GivensPanel.spec.tsx +11 -3
- package/src/components/given/GivensPanel.tsx +45 -44
- package/src/components/given/filterEditing.ts +60 -0
- package/src/components/given/filterSummary.spec.ts +108 -0
- package/src/components/given/filterSummary.ts +109 -0
- package/src/components/given/paramCodec.ts +1 -1
- package/src/components/given/required.spec.ts +60 -0
- package/src/components/given/required.ts +78 -0
- package/src/components/index.ts +9 -0
- package/src/components/legacy/Dashboard.spec.tsx +3 -1
- package/src/components/legacy/index.ts +1 -1
- package/src/components/{Report/CellReport.spec.tsx → legacy/malloynb/CellRunnerView.spec.tsx} +53 -57
- package/src/components/{Report/CellReport.tsx → legacy/malloynb/CellRunnerView.tsx} +122 -136
- package/src/components/legacy/{MalloynbCells.tsx → malloynb/MalloynbCells.tsx} +6 -6
- package/src/components/legacy/{Notebook.layout.spec.tsx → malloynb/Notebook.layout.spec.tsx} +16 -7
- package/src/components/legacy/malloynb/Notebook.served.spec.tsx +84 -0
- package/src/components/legacy/{Notebook.spec.tsx → malloynb/Notebook.spec.tsx} +5 -3
- package/src/components/legacy/{Notebook.tsx → malloynb/Notebook.tsx} +9 -7
- package/src/components/{Notebook → legacy/malloynb}/NotebookCell.tsx +70 -150
- package/src/components/legacy/malloynb/cellKind.spec.ts +33 -0
- package/src/components/legacy/malloynb/cellKind.ts +24 -0
- package/src/components/{Notebook → legacy/malloynb}/types.ts +1 -1
- package/src/components/styles.ts +0 -18
- package/src/hooks/useGivensState.ts +7 -3
- package/src/hooks/useQueryResult.placeholder.spec.ts +44 -0
- package/src/hooks/useQueryResult.ts +26 -1
- package/src/theme/ThemeContext.tsx +21 -1
- package/src/theme/classes.ts +52 -0
- package/src/theme/index.ts +8 -0
- package/src/theme/resolveTheme.ts +3 -0
- package/src/theme/types.ts +7 -0
- package/src/theme/ui.spec.tsx +91 -0
- package/src/theme/ui.ts +115 -0
- package/dist/RenderedResult-BcgYjkZ0.cjs.js +0 -153
- package/dist/ServerProvider-B0dUY8be.cjs.js +0 -1
- package/dist/components/Notebook/cellKind.d.ts +0 -20
- package/dist/components/Report/LinearReport.d.ts +0 -18
- package/dist/components/ReportBuilder/SourceViewPicker.d.ts +0 -9
- package/dist/components/ReportBuilder/legacyNotebook.d.ts +0 -73
- package/dist/components/ReportBuilder/useConversionConfirm.d.ts +0 -20
- package/dist/useCompiledDocument-UY28ITET.cjs.js +0 -141
- package/src/components/Notebook/cellKind.spec.ts +0 -199
- package/src/components/Notebook/cellKind.ts +0 -74
- package/src/components/Report/LinearReport.tsx +0 -71
- package/src/components/ReportBuilder/SourceViewPicker.tsx +0 -122
- package/src/components/ReportBuilder/legacyNotebook.chart.spec.ts +0 -77
- package/src/components/ReportBuilder/legacyNotebook.convert.spec.ts +0 -626
- package/src/components/ReportBuilder/legacyNotebook.read.spec.ts +0 -338
- package/src/components/ReportBuilder/legacyNotebook.ts +0 -1122
- package/src/components/ReportBuilder/useConversionConfirm.ts +0 -55
- package/src/components/legacy/Notebook.served.spec.tsx +0 -183
- /package/dist/components/{Notebook → legacy/malloynb}/runPlan.d.ts +0 -0
- /package/src/components/{Notebook → legacy/malloynb}/runPlan.spec.ts +0 -0
- /package/src/components/{Notebook → legacy/malloynb}/runPlan.ts +0 -0
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
1
|
import { DashboardManifest } from '../../client';
|
|
3
2
|
import { HostGivenValue } from '../../hooks/givenValue';
|
|
4
3
|
import { DrillNavigation } from '../drill';
|
|
5
4
|
import { GivensLayout } from '../given';
|
|
5
|
+
import { NavigationClick } from '../click_helper';
|
|
6
6
|
import { TileChrome } from './TileCard';
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
* inside itself as it scrolls under (a result's floating buttons sit at 1–2),
|
|
10
|
-
* and below MUI's app bar, popovers and dialogs. Shared so the builder's
|
|
11
|
-
* control row sits at the same level as the reader's.
|
|
12
|
-
*/
|
|
13
|
-
export declare const STICKY_CONTROLS_Z = 4;
|
|
7
|
+
/** Re-exported for hosts that import it from here; defined with the page parts. */
|
|
8
|
+
export { STICKY_CONTROLS_Z } from '../Report/ReportPage';
|
|
14
9
|
export interface DashboardViewProps {
|
|
15
10
|
/** The dashboard, or the tile layout a layout notebook carries. */
|
|
16
11
|
manifest: DashboardManifest;
|
|
@@ -29,7 +24,11 @@ export interface DashboardViewProps {
|
|
|
29
24
|
onNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
|
|
30
25
|
height?: number;
|
|
31
26
|
maxResultSize?: number;
|
|
32
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Ignored: kept so existing callers compile. A linear report and a grid
|
|
29
|
+
* draw the same header, cards and controls, and differ only in how tiles
|
|
30
|
+
* are arranged, which the manifest says.
|
|
31
|
+
*/
|
|
33
32
|
chrome?: TileChrome;
|
|
34
33
|
/**
|
|
35
34
|
* How the control row is drawn: `bar` for a dashboard, `panel` for a
|
|
@@ -46,6 +45,19 @@ export interface DashboardViewProps {
|
|
|
46
45
|
runModelPath?: string;
|
|
47
46
|
/** Givens the host sets itself: no control is shown for them. */
|
|
48
47
|
hiddenGivens?: readonly string[];
|
|
48
|
+
/**
|
|
49
|
+
* Filters each tile reads through values the host writes into its query
|
|
50
|
+
* text rather than sending them as givens: a report held as text whose
|
|
51
|
+
* own `given:` the host resolves to literals before compiling. Keyed by
|
|
52
|
+
* the manifest's `tile.query`. Counted as read, so the tile is not marked
|
|
53
|
+
* as ignoring that filter, and never sent: the server does not know them.
|
|
54
|
+
*/
|
|
55
|
+
literalReads?: Readonly<Record<string, readonly string[]>>;
|
|
56
|
+
/**
|
|
57
|
+
* An ordinary link in the report's prose (its description and text tiles),
|
|
58
|
+
* for a host with its own router. Omitted, links are plain anchors.
|
|
59
|
+
*/
|
|
60
|
+
onLinkNavigate?: (to: string, event?: NavigationClick) => void;
|
|
49
61
|
}
|
|
50
62
|
/**
|
|
51
63
|
* A loaded dashboard manifest, drawn: the control row and the tile grid.
|
|
@@ -53,28 +65,4 @@ export interface DashboardViewProps {
|
|
|
53
65
|
* Split from the manifest fetch so a notebook written as a tile layout, whose
|
|
54
66
|
* manifest arrives inside the notebook response, renders through the same code.
|
|
55
67
|
*/
|
|
56
|
-
export declare function DashboardView({ manifest, environmentName, packageName, versionId, documentName, givens, onGivensChange, onNavigate, height, maxResultSize,
|
|
57
|
-
/**
|
|
58
|
-
* The prose header over just the two fields it needs, so the BUILDER can draw
|
|
59
|
-
* the same header over a `DashboardDocument`, which is not a manifest.
|
|
60
|
-
*
|
|
61
|
-
* The description is drawn as a text tile is, in the document's own tile
|
|
62
|
-
* chrome: the same box and the same type as the markdown between the tiles,
|
|
63
|
-
* so the page's prose reads as one kind of thing wherever it sits.
|
|
64
|
-
*/
|
|
65
|
-
export declare function DashboardProse({ title, description, chrome, }: {
|
|
66
|
-
title: string;
|
|
67
|
-
description?: string;
|
|
68
|
-
/** The chrome the document's tiles take, which the description matches. */
|
|
69
|
-
chrome?: TileChrome;
|
|
70
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
71
|
-
/**
|
|
72
|
-
* A control row that pins to the top of the scroller and, while pinned, draws
|
|
73
|
-
* a hairline under itself, so tiles scrolling beneath read as passing under a
|
|
74
|
-
* bar rather than being cut off by nothing. Shared by the reader and the
|
|
75
|
-
* builder so both pin the same way.
|
|
76
|
-
*/
|
|
77
|
-
export declare function StickyControls({ sticky, children, }: {
|
|
78
|
-
sticky?: boolean;
|
|
79
|
-
children: ReactNode;
|
|
80
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare function DashboardView({ manifest, environmentName, packageName, versionId, documentName, givens, onGivensChange, onNavigate, height, maxResultSize, controlsLayout, preamble, runModelPath, hiddenGivens, literalReads, onLinkNavigate, }: DashboardViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,8 +23,10 @@ export declare const TILE_MIN_HEIGHT: {
|
|
|
23
23
|
* a different card. Both surfaces moved together when the edge was darkened;
|
|
24
24
|
* either one left behind is a dashboard whose tiles are outlined two ways.
|
|
25
25
|
*
|
|
26
|
-
* Radius
|
|
27
|
-
*
|
|
26
|
+
* Radius is the report surfaces' tile radius ({@link ui.radius.tile}), which the
|
|
27
|
+
* renderer card is pointed at too, rather than the host's `shape.borderRadius`:
|
|
28
|
+
* a host's control radius is not a card radius, and taking it made tiles as
|
|
29
|
+
* round as buttons. The
|
|
28
30
|
* background is `theme.tile`, the value the renderer card paints — left unset,
|
|
29
31
|
* on a theme whose page is also white the composite tiles lost the tint that
|
|
30
32
|
* separates a card from the page while the single-query form kept it.
|
|
@@ -51,6 +53,11 @@ export declare function TileCard({ borderless, chrome, kind, sx, cardRef, childr
|
|
|
51
53
|
cardRef?: Ref<HTMLDivElement>;
|
|
52
54
|
children: ReactNode;
|
|
53
55
|
}): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
/**
|
|
57
|
+
* The class on a tile heading's root, so a surface that draws controls over
|
|
58
|
+
* the heading (the builder's tile menu) can leave room for them.
|
|
59
|
+
*/
|
|
60
|
+
export declare const TILE_HEADING_CLASS: "publisher-tile-heading";
|
|
54
61
|
/** The heading's text as nodes, for a surface that makes it editable in place. */
|
|
55
62
|
export interface TileHeadingSlots {
|
|
56
63
|
title: ReactNode;
|
|
@@ -62,7 +69,7 @@ export interface TileHeadingSlots {
|
|
|
62
69
|
* whichever surface draws it.
|
|
63
70
|
*/
|
|
64
71
|
export declare function TileHeading({ title, subtitle, tooltip, action, quiet, }: {
|
|
65
|
-
/** A
|
|
72
|
+
/** A tighter gap under the heading, for a tile with no card around it. */
|
|
66
73
|
quiet?: boolean;
|
|
67
74
|
title: ReactNode;
|
|
68
75
|
subtitle?: ReactNode;
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* How far above the scroller's edge a pinned bar sits: one pixel, so the bar
|
|
3
|
+
* is clipped by exactly that pixel while pinned and whole while it is not,
|
|
4
|
+
* which is what {@link useStuck} observes.
|
|
5
|
+
*/
|
|
6
|
+
export declare const STUCK_TOP_PX = -1;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a `position: sticky` bar (pinned at `top: {@link STUCK_TOP_PX}px`)
|
|
9
|
+
* is currently pinned, so it can draw an edge only while content scrolls under
|
|
10
|
+
* it. Unpinned, the bar sits in the flow and an edge would be a stray line
|
|
11
|
+
* between it and the first tile.
|
|
5
12
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
13
|
+
* Observes the bar itself: pinned, its top pixel is clipped by the scroller,
|
|
14
|
+
* so less than all of it is visible. No sentinel element, which as a sibling
|
|
15
|
+
* in a `gap` layout cost the page a gap of its own above the bar. No explicit
|
|
16
|
+
* root, so it works whichever ancestor scrolls: an observer with the implicit
|
|
9
17
|
* root counts clipping by every scrolling ancestor, not just the viewport.
|
|
10
18
|
*/
|
|
11
19
|
export declare function useStuck(): {
|
|
12
|
-
|
|
20
|
+
stickyRef: (node: HTMLElement | null) => void;
|
|
13
21
|
stuck: boolean;
|
|
14
22
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
export interface DocumentChoice {
|
|
2
2
|
source: string;
|
|
3
3
|
view: string;
|
|
4
|
+
/** The view's `#(doc)` line, which a picker shows as its title. */
|
|
5
|
+
description?: string;
|
|
6
|
+
/** The chart the view declares (`bar_chart`, …), for its icon. */
|
|
7
|
+
chart?: string;
|
|
8
|
+
/** The source's `#(doc)` line. */
|
|
9
|
+
sourceDescription?: string;
|
|
4
10
|
}
|
|
5
11
|
/**
|
|
6
12
|
* What a new dashboard or notebook can start from: model -> the (source, view)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PackageWarningsInner } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* What the server found wrong with a package when it loaded it, on the
|
|
4
|
+
* package page.
|
|
5
|
+
*
|
|
6
|
+
* Without it a broken file simply moved: a report whose artifact tag the
|
|
7
|
+
* server no longer reads stopped listing under Reports and listed under
|
|
8
|
+
* Models instead, with nothing on the page saying why. Errors (a file that
|
|
9
|
+
* should have been a report and is not, a tile that cannot load) are shown;
|
|
10
|
+
* `warn` findings, which still work, are counted and folded away.
|
|
11
|
+
*/
|
|
12
|
+
export declare function PackageProblems({ warnings, }: {
|
|
13
|
+
warnings: PackageWarningsInner[] | undefined;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The class on a remove badge. Its container shows it while hovered or
|
|
3
|
+
* focused: `"& .remove-badge": { opacity: 0 }` and
|
|
4
|
+
* `"&:hover .remove-badge, &:focus-within .remove-badge": { opacity: 1 }`,
|
|
5
|
+
* as {@link removeBadgeRevealSx} writes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const REMOVE_BADGE_CLASS = "remove-badge";
|
|
8
|
+
/** The container rules that reveal its remove badge on hover and focus, and always on touch. */
|
|
9
|
+
export declare const removeBadgeRevealSx: {
|
|
10
|
+
readonly "& .remove-badge": {
|
|
11
|
+
readonly opacity: 0;
|
|
12
|
+
};
|
|
13
|
+
readonly "&:hover .remove-badge, &:focus-within .remove-badge": {
|
|
14
|
+
readonly opacity: 1;
|
|
15
|
+
};
|
|
16
|
+
readonly "@media (hover: none)": {
|
|
17
|
+
readonly "& .remove-badge": {
|
|
18
|
+
readonly opacity: 1;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Take something off the page: a small round × on its top-right corner. The
|
|
24
|
+
* one removal control in the builder, for a filter and a tile alike, so
|
|
25
|
+
* removing looks and works the same wherever it is. The container must be
|
|
26
|
+
* `position: relative` and spread {@link removeBadgeRevealSx}.
|
|
27
|
+
*
|
|
28
|
+
* With `disabledReason`, the badge stays focusable (aria-disabled, not
|
|
29
|
+
* disabled) and says why on hover and to a screen reader, rather than
|
|
30
|
+
* vanishing or greying out without explanation.
|
|
31
|
+
*/
|
|
32
|
+
export declare function RemoveBadge({ label, onRemove, disabledReason,
|
|
33
|
+
/** How far outside the container's edge the badge's centre sits, in px. */
|
|
34
|
+
inset, }: {
|
|
35
|
+
/** The accessible name: "Remove filter BRAND", "Remove Revenue by month". */
|
|
36
|
+
label: string;
|
|
37
|
+
onRemove: () => void;
|
|
38
|
+
disabledReason?: string;
|
|
39
|
+
inset?: number;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -47,16 +47,25 @@ export interface ReportProps {
|
|
|
47
47
|
* shown, a drill — for the host to log or count; see `ReportEvent`.
|
|
48
48
|
*/
|
|
49
49
|
onEvent?: ReportEventHandler;
|
|
50
|
-
/**
|
|
50
|
+
/** Ignored: kept so existing callers compile. Both layouts draw the same cards. */
|
|
51
51
|
chrome?: TileChrome;
|
|
52
|
+
/**
|
|
53
|
+
* How long a read of the report is reused without asking the server again,
|
|
54
|
+
* in ms. Default: the query client's staleness for the `report` key, which
|
|
55
|
+
* is 0 (every mount asks, so a change made elsewhere shows) unless the host
|
|
56
|
+
* sets one with `setQueryDefaults(["report"], …)`. A host that draws the
|
|
57
|
+
* same report twice in a row can set a few seconds, as the Console does
|
|
58
|
+
* while the builder loads over it.
|
|
59
|
+
*/
|
|
60
|
+
manifestStaleTime?: number;
|
|
52
61
|
}
|
|
53
62
|
/**
|
|
54
63
|
* A report of either layout, from `GET …/reports/{path}`: a grid drawn as a
|
|
55
|
-
* dashboard, a linear report top to bottom
|
|
56
|
-
*
|
|
64
|
+
* dashboard, or a linear report top to bottom (a legacy `.malloynb` among
|
|
65
|
+
* them, read-only), each tile run through the governed query endpoint.
|
|
57
66
|
*
|
|
58
67
|
* Host-agnostic, like `Dashboard`: it takes props rather than reading a
|
|
59
68
|
* router, and hands navigation and URL state back to whoever mounted it.
|
|
60
69
|
*/
|
|
61
|
-
export declare function Report({ resourceUri, path, givens, onGivensChange, onNavigate, onLinkNavigate, height, maxResultSize, onEvent, chrome, }: ReportProps): import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
export declare function Report({ resourceUri, path, givens, onGivensChange, onNavigate, onLinkNavigate, height, maxResultSize, onEvent, chrome, manifestStaleTime, }: ReportProps): import("react/jsx-runtime").JSX.Element;
|
|
62
71
|
export default Report;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The parts of a report page that the reader and the builder both draw, in
|
|
5
|
+
* either layout: the page's arrangement, its header, its pinned control row,
|
|
6
|
+
* and a text tile's frame.
|
|
7
|
+
*
|
|
8
|
+
* Each surface fills the same slots with its own content (the reader with
|
|
9
|
+
* text, the builder with the same text made editable in place) rather than
|
|
10
|
+
* drawing a page of its own, so a change to how a report looks is made here
|
|
11
|
+
* once and editing a page can never draw it differently from reading it.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* The control row's stacking level: above anything a tile raises inside
|
|
15
|
+
* itself as it scrolls under (a result's floating buttons sit at 1–2), and
|
|
16
|
+
* below MUI's app bar, popovers and dialogs.
|
|
17
|
+
*/
|
|
18
|
+
export declare const STICKY_CONTROLS_Z = 4;
|
|
19
|
+
/**
|
|
20
|
+
* A report page, top to bottom: anything that must be said before it
|
|
21
|
+
* (`notice`), the header, the control row, then the body (the tiles, and
|
|
22
|
+
* whatever the surface adds under them).
|
|
23
|
+
*/
|
|
24
|
+
export declare function ReportPage({ layout, notice, header, controls, children, sx, }: {
|
|
25
|
+
/** Written as `data-layout` on the page, so a test or a host can tell the two apart. */
|
|
26
|
+
layout?: "grid" | "linear";
|
|
27
|
+
notice?: ReactNode;
|
|
28
|
+
header: ReactNode;
|
|
29
|
+
controls?: ReactNode;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
sx?: SxProps<Theme>;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* A report's title, with the surface's actions on its line (the builder's
|
|
35
|
+
* toolbar), and its description beneath. The title and description are slots:
|
|
36
|
+
* text in the reader, the same text editable in place in the builder.
|
|
37
|
+
*/
|
|
38
|
+
export declare function ReportHeader({ title, description, actions, }: {
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
description?: ReactNode;
|
|
41
|
+
actions?: ReactNode;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* The frame a text tile (and the page description) is drawn in: none. Prose
|
|
45
|
+
* is part of the page, not a result, so it never takes a card, in either
|
|
46
|
+
* layout. One definition, so every text block on every surface agrees.
|
|
47
|
+
*/
|
|
48
|
+
export declare function TextTileFrame({ sx, children, }: {
|
|
49
|
+
sx?: SxProps<Theme>;
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
/**
|
|
53
|
+
* The control row, pinned to the top of the scroller so the controls stay in
|
|
54
|
+
* reach while the tiles scroll under, with a hairline under it only while
|
|
55
|
+
* pinned: tiles passing beneath read as going under a bar rather than being
|
|
56
|
+
* cut off by nothing.
|
|
57
|
+
*/
|
|
58
|
+
export declare function StickyControls({ children }: {
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
2
|
+
/**
|
|
3
|
+
* What a report's layout decides, and nothing else.
|
|
4
|
+
*
|
|
5
|
+
* A linear report and a grid draw the same page (header, filter row, cards,
|
|
6
|
+
* prose) through the same components; the layout only constrains how tiles
|
|
7
|
+
* are arranged on it. Every surface that arranges tiles (the reader's grid,
|
|
8
|
+
* the builder's grid, adding a tile) asks this one function rather than
|
|
9
|
+
* branching on the layout itself, so a new constraint is added here once and
|
|
10
|
+
* the two layouts cannot drift apart in how they look.
|
|
11
|
+
*/
|
|
12
|
+
export interface LayoutRules {
|
|
13
|
+
layout: ReportLayout;
|
|
14
|
+
/** Columns the grid lays tiles across: one for linear, whatever it says, as the server reads it. */
|
|
15
|
+
columns: number;
|
|
16
|
+
/**
|
|
17
|
+
* Whether a tile has a width of its own: dragged at its edge, stepped with
|
|
18
|
+
* the arrow keys, written as `# colspan`. Off in one column, where every
|
|
19
|
+
* tile is the column's width and a width in the file is not the builder's
|
|
20
|
+
* to rewrite.
|
|
21
|
+
*/
|
|
22
|
+
widths: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether tiles are added between others: a "+" under each tile and an
|
|
25
|
+
* "Add tile" after the last. A top-to-bottom report is written by
|
|
26
|
+
* inserting; a grid is arranged by dragging, so it adds at the end.
|
|
27
|
+
*/
|
|
28
|
+
insertBetween: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function layoutRules(layout: ReportLayout | undefined,
|
|
31
|
+
/** `# dashboard { columns=N }` as the file has it. */
|
|
32
|
+
declaredColumns?: number): LayoutRules;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useServer } from '../ServerProvider';
|
|
2
|
+
import { ReportManifest } from '../../client';
|
|
3
|
+
/**
|
|
4
|
+
* The one read of a report's manifest, `GET …/reports/{path}`, shared by the
|
|
5
|
+
* reader and the builder so switching between them draws from one cache entry
|
|
6
|
+
* rather than reading the report again.
|
|
7
|
+
*
|
|
8
|
+
* `staleTime` is how long a read is reused without asking the server: 0 (every
|
|
9
|
+
* mount asks) unless a caller draws the same report twice in a row, as the
|
|
10
|
+
* builder does over the reader it keeps on screen while it loads. A write this
|
|
11
|
+
* app makes invalidates every `report` entry, but a change it did not make (a
|
|
12
|
+
* watch-mode save, another client's write, a package reload) is only seen by
|
|
13
|
+
* asking, so a standalone reader keeps 0.
|
|
14
|
+
*/
|
|
15
|
+
export declare function reportQueryOptions(apiClients: ReturnType<typeof useServer>["apiClients"], { environmentName, packageName, path, versionId, }: {
|
|
16
|
+
environmentName: string;
|
|
17
|
+
packageName: string;
|
|
18
|
+
path: string;
|
|
19
|
+
versionId: string | undefined;
|
|
20
|
+
},
|
|
21
|
+
/** Omitted, the query client's staleness for the `report` key decides. */
|
|
22
|
+
staleTime?: number): {
|
|
23
|
+
staleTime?: number;
|
|
24
|
+
queryKey: string[];
|
|
25
|
+
queryFn: ({ signal }: {
|
|
26
|
+
signal?: AbortSignal;
|
|
27
|
+
}) => Promise< ReportManifest>;
|
|
28
|
+
};
|
|
29
|
+
/** How long the builder, and the reader drawn while it loads, reuse one read of the report. */
|
|
30
|
+
export declare const BUILDER_HANDOFF_STALE_MS = 10000;
|
|
@@ -87,8 +87,6 @@ export type ReportEvent = {
|
|
|
87
87
|
tiles: number;
|
|
88
88
|
/** Whether a tile was added or removed, which moves declarations. */
|
|
89
89
|
structural: boolean;
|
|
90
|
-
/** The save rewrote a report in the cell format as tiles. */
|
|
91
|
-
converted?: boolean;
|
|
92
90
|
where: SavesTo;
|
|
93
91
|
/** The host workspace that took the write; never set for a package save. */
|
|
94
92
|
workspace?: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CatalogView, PackageCatalog } from './catalog';
|
|
2
3
|
import { ChartPick } from './chartLine';
|
|
3
4
|
import { DashboardDocument } from './document';
|
|
4
5
|
/**
|
|
@@ -31,6 +32,20 @@ export interface NewTile {
|
|
|
31
32
|
chartCarried?: string[];
|
|
32
33
|
colspan: number;
|
|
33
34
|
}
|
|
35
|
+
/** A view the picker shows a preview of, as the tile it would add. */
|
|
36
|
+
export interface ViewPreview {
|
|
37
|
+
base: string;
|
|
38
|
+
/** The model that exports the source: what the preview runs against. */
|
|
39
|
+
modelPath: string;
|
|
40
|
+
view: string;
|
|
41
|
+
/** The title the tile would have. */
|
|
42
|
+
label: string;
|
|
43
|
+
/** A chart for the preview; absent keeps the view's own. */
|
|
44
|
+
chart?: ChartPick | "none";
|
|
45
|
+
chartCarried?: string[];
|
|
46
|
+
/** The givens the source is scoped by, the ones the preview sends. */
|
|
47
|
+
givens: string[];
|
|
48
|
+
}
|
|
34
49
|
export interface AddTileDialogProps {
|
|
35
50
|
open: boolean;
|
|
36
51
|
document: DashboardDocument;
|
|
@@ -38,7 +53,11 @@ export interface AddTileDialogProps {
|
|
|
38
53
|
columns: number;
|
|
39
54
|
onClose: () => void;
|
|
40
55
|
onAdd: (tile: NewTile) => void;
|
|
41
|
-
/** Add an empty text tile, whose markdown is written on the tile itself. */
|
|
56
|
+
/** Add an empty text tile instead, whose markdown is written on the tile itself. */
|
|
42
57
|
onAddText: () => void;
|
|
58
|
+
/** The picked view run as a tile, with the page's filters. Absent, a card says what will run. */
|
|
59
|
+
renderPreview?: (view: ViewPreview) => ReactNode;
|
|
43
60
|
}
|
|
44
|
-
|
|
61
|
+
/** `by_category` -> `By category`: a view's name, read as words, where it has no doc line. */
|
|
62
|
+
export declare function viewTitle(view: CatalogView): string;
|
|
63
|
+
export declare function AddTileDialog({ open, document, catalog, columns, onClose, onAdd, onAddText, renderPreview, }: AddTileDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BuilderControls } from './builderControls';
|
|
2
|
+
export interface BuilderBarProps {
|
|
3
|
+
/** The builder's controls, from `onControlsChange`. Undefined while it opens: only Done is drawn. */
|
|
4
|
+
controls: BuilderControls | undefined;
|
|
5
|
+
/** Leave the builder for the reader. Absent, no Done is drawn. */
|
|
6
|
+
onDone?: () => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The builder's controls as one bar, for a host's header: the save status,
|
|
10
|
+
* undo and redo, the layout switch, an Add menu, then Done and, while there
|
|
11
|
+
* are unsaved edits, Save. The page under it stays the reader's page, with the
|
|
12
|
+
* tile and filter controls on the things they change.
|
|
13
|
+
*
|
|
14
|
+
* Done leaves; a host whose leave guard asks about unsaved edits (as the
|
|
15
|
+
* Console's does) is asked there, so Done never discards on its own.
|
|
16
|
+
*/
|
|
17
|
+
export declare function BuilderBar({ controls, onDone: onDoneProp }: BuilderBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ComponentProps } from 'react';
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { UnsavedChangesDialog } from '../UnsavedChangesDialog';
|
|
3
|
+
import { ViewPreview } from './AddTileDialog';
|
|
3
4
|
import { PackageCatalog } from './catalog';
|
|
4
|
-
import { ConversionConfirm } from './useConversionConfirm';
|
|
5
5
|
import { useControlBindings } from './useControlBindings';
|
|
6
6
|
import { ReportEditorHandle } from './useReportEditor';
|
|
7
7
|
import { useTileEditing } from './useTileEditing';
|
|
8
8
|
/**
|
|
9
9
|
* Every window the builder opens, each driven by state its hooks hold: the
|
|
10
|
-
* filter window, a tile's menu, the clickable-cells window, the
|
|
11
|
-
*
|
|
10
|
+
* filter window, a tile's menu, the clickable-cells window, the
|
|
11
|
+
* unsaved-changes guard and the add-tile picker.
|
|
12
12
|
*/
|
|
13
|
-
export declare function BuilderDialogs({ editor, catalog, columns, dashboards, bindings, tiles, drillSource, setDrillSource,
|
|
13
|
+
export declare function BuilderDialogs({ editor, catalog, columns, dashboards, bindings, tiles, drillSource, setDrillSource, exitDialog, renderViewPreview, takenGivenNames, }: {
|
|
14
14
|
editor: ReportEditorHandle;
|
|
15
15
|
catalog: PackageCatalog | undefined;
|
|
16
16
|
columns: number;
|
|
@@ -20,6 +20,7 @@ export declare function BuilderDialogs({ editor, catalog, columns, dashboards, b
|
|
|
20
20
|
/** The source whose clickable cells are being edited, if any. */
|
|
21
21
|
drillSource: string | undefined;
|
|
22
22
|
setDrillSource: (source: string | undefined) => void;
|
|
23
|
-
confirmConversion: ConversionConfirm | undefined;
|
|
24
23
|
exitDialog: ComponentProps<typeof UnsavedChangesDialog>;
|
|
24
|
+
renderViewPreview?: (view: ViewPreview) => ReactNode;
|
|
25
|
+
takenGivenNames?: readonly string[];
|
|
25
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactNode, RefObject } from 'react';
|
|
2
2
|
import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
|
|
3
|
+
import { LayoutRules } from '../Report/layoutRules';
|
|
3
4
|
import { DashboardTile, QueryTile } from './document';
|
|
4
5
|
import { ReportEditorHandle } from './useReportEditor';
|
|
5
6
|
import { useTileReorder } from './useTileReorder';
|
|
@@ -9,14 +10,15 @@ import { useTileResize } from './useTileResize';
|
|
|
9
10
|
* by the caller's `renderTile` inside a `TileFrame` that carries the
|
|
10
11
|
* affordances: selection, the grip and menu, the width handle.
|
|
11
12
|
*/
|
|
12
|
-
export declare function BuilderGrid({ editor, reorder, resizing, gridBox,
|
|
13
|
+
export declare function BuilderGrid({ editor, reorder, resizing, gridBox, defaultSpan, rules, canAdd, selected, flash, menuIndex, onSelect, onOpenMenu, onRemove, removeBlocked, openAdd, editTile, renderTile, }: {
|
|
13
14
|
editor: ReportEditorHandle;
|
|
14
15
|
reorder: ReturnType<typeof useTileReorder>;
|
|
15
16
|
resizing: ReturnType<typeof useTileResize>;
|
|
16
17
|
gridBox: RefObject<HTMLDivElement | null>;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
/** The span a tile with no `# colspan` is drawn at: as wide as the reader draws it. */
|
|
19
|
+
defaultSpan?: number;
|
|
20
|
+
/** How the document arranges tiles: columns, widths, inserting between. */
|
|
21
|
+
rules: LayoutRules;
|
|
20
22
|
/** Whether there is a catalog to add a tile from. */
|
|
21
23
|
canAdd: boolean;
|
|
22
24
|
selected: number | undefined;
|
|
@@ -25,6 +27,10 @@ export declare function BuilderGrid({ editor, reorder, resizing, gridBox, column
|
|
|
25
27
|
menuIndex: number | undefined;
|
|
26
28
|
onSelect: (index: number) => void;
|
|
27
29
|
onOpenMenu: (anchor: HTMLElement, index: number) => void;
|
|
30
|
+
/** Take a tile off the report. */
|
|
31
|
+
onRemove: (index: number) => void;
|
|
32
|
+
/** Why no tile can be removed now; set, each × says so instead. */
|
|
33
|
+
removeBlocked?: string;
|
|
28
34
|
openAdd: (at?: number) => void;
|
|
29
35
|
editTile: (key: string, change: (tile: DashboardTile) => void) => void;
|
|
30
36
|
renderTile?: (tile: QueryTile, heading?: TileHeadingSlots, chrome?: TileChrome) => ReactNode;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TileChrome } from '../Dashboard/TileCard';
|
|
3
2
|
import { ReportEditorHandle } from './useReportEditor';
|
|
4
3
|
/**
|
|
5
|
-
* The
|
|
6
|
-
*
|
|
4
|
+
* The reader's {@link ReportHeader}, with its title and description edited
|
|
5
|
+
* where they stand and the builder's actions on the title's line: the same
|
|
6
|
+
* header in the same place, so editing a page does not move it.
|
|
7
7
|
*/
|
|
8
|
-
export declare function BuilderHeader({ editor, documentSlug,
|
|
8
|
+
export declare function BuilderHeader({ editor, documentSlug, actions, descriptionSelected, selectDescription, }: {
|
|
9
9
|
editor: ReportEditorHandle;
|
|
10
|
-
/** Kept for callers; the title reads the same in either layout. */
|
|
11
|
-
notebook?: boolean;
|
|
12
10
|
/** The name a reader's view titles an untitled document with. */
|
|
13
11
|
documentSlug: string | undefined;
|
|
14
|
-
chrome: TileChrome;
|
|
15
12
|
actions: ReactNode;
|
|
16
13
|
descriptionSelected: boolean;
|
|
17
14
|
selectDescription: () => void;
|
|
@@ -1,5 +1,93 @@
|
|
|
1
1
|
import { ReactNode, Ref } from 'react';
|
|
2
2
|
import { SavesTo } from './documentSession';
|
|
3
|
+
import { ReportUi } from '../../theme/ui';
|
|
4
|
+
/**
|
|
5
|
+
* The toolbar's controls at the report surfaces' one size, set here rather
|
|
6
|
+
* than left to the host theme: the row was five shapes (a 29px square toggle,
|
|
7
|
+
* a text link, round 37px icons, a 37px pill), because each control took a
|
|
8
|
+
* different library default.
|
|
9
|
+
*/
|
|
10
|
+
export declare const controlSx: (edge: string, hoverEdge: string, ui?: ReportUi) => {
|
|
11
|
+
readonly "&:hover": {
|
|
12
|
+
readonly boxShadow: "none";
|
|
13
|
+
};
|
|
14
|
+
readonly "& .MuiButton-startIcon": {
|
|
15
|
+
readonly mr: 0.5;
|
|
16
|
+
readonly "& svg": {
|
|
17
|
+
readonly fontSize: 18;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
readonly "&.MuiButton-outlined": {
|
|
21
|
+
readonly borderColor: string;
|
|
22
|
+
readonly "&:hover": {
|
|
23
|
+
readonly borderColor: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly fontSize: number | string;
|
|
27
|
+
readonly fontWeight?: number | string;
|
|
28
|
+
readonly lineHeight?: number | string;
|
|
29
|
+
readonly letterSpacing?: string;
|
|
30
|
+
readonly fontFamily?: string;
|
|
31
|
+
readonly height: number;
|
|
32
|
+
readonly minHeight: number;
|
|
33
|
+
readonly px: 1.5;
|
|
34
|
+
readonly borderRadius: string;
|
|
35
|
+
readonly boxShadow: "none";
|
|
36
|
+
};
|
|
37
|
+
export declare const iconControlSx: (ui?: ReportUi) => {
|
|
38
|
+
readonly width: number;
|
|
39
|
+
readonly height: number;
|
|
40
|
+
readonly borderRadius: string;
|
|
41
|
+
readonly "& svg": {
|
|
42
|
+
readonly fontSize: 18;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
/** Short rules between groups: the height of a label, not of the row. */
|
|
46
|
+
export declare const dividerSx: {
|
|
47
|
+
readonly height: 20;
|
|
48
|
+
readonly alignSelf: "center";
|
|
49
|
+
readonly mx: 0.5;
|
|
50
|
+
readonly my: 0;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A segmented control, built as an outlined button group: the same edge,
|
|
54
|
+
* height, radius and padding as "+ Tile" beside it, each segment the full
|
|
55
|
+
* height of the control with a rule between them, and the chosen one tinted
|
|
56
|
+
* edge to edge. An inset chip inside the outline read as a control within a
|
|
57
|
+
* control, a size smaller than the button next to it.
|
|
58
|
+
*/
|
|
59
|
+
export declare const segmentedSx: (edge: string, ui?: ReportUi) => {
|
|
60
|
+
readonly height: number;
|
|
61
|
+
readonly boxSizing: "border-box";
|
|
62
|
+
readonly borderRadius: string;
|
|
63
|
+
readonly border: `1px solid ${string}`;
|
|
64
|
+
readonly overflow: "hidden";
|
|
65
|
+
readonly bgcolor: "background.paper";
|
|
66
|
+
readonly "& .MuiToggleButton-root": {
|
|
67
|
+
readonly color: "text.secondary";
|
|
68
|
+
readonly "& + .MuiToggleButton-root": {
|
|
69
|
+
readonly borderLeft: `1px solid ${string}`;
|
|
70
|
+
};
|
|
71
|
+
readonly "&:hover": {
|
|
72
|
+
readonly bgcolor: "action.hover";
|
|
73
|
+
};
|
|
74
|
+
readonly "&.Mui-selected, &.Mui-selected:hover": {
|
|
75
|
+
readonly bgcolor: "action.selected";
|
|
76
|
+
readonly color: "text.primary";
|
|
77
|
+
};
|
|
78
|
+
readonly fontSize: number | string;
|
|
79
|
+
readonly fontWeight?: number | string;
|
|
80
|
+
readonly lineHeight?: number | string;
|
|
81
|
+
readonly letterSpacing?: string;
|
|
82
|
+
readonly fontFamily?: string;
|
|
83
|
+
readonly border: "none";
|
|
84
|
+
readonly borderRadius: "0 !important";
|
|
85
|
+
readonly m: "0 !important";
|
|
86
|
+
readonly px: 1.5;
|
|
87
|
+
readonly py: 0;
|
|
88
|
+
readonly height: "100%";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
3
91
|
/** Where Save puts the document, in the words under the button. */
|
|
4
92
|
export declare const SAVE_TARGET: Record<SavesTo, string>;
|
|
5
93
|
/**
|
|
@@ -8,8 +8,10 @@ export interface DrillDialogProps {
|
|
|
8
8
|
givenNames: string[];
|
|
9
9
|
/** Other dashboards in the package, by slug, as `to=` destinations. */
|
|
10
10
|
dashboards: string[];
|
|
11
|
+
/** The tile the window was opened from, named in its description. */
|
|
12
|
+
tileLabel?: string;
|
|
11
13
|
onClose: () => void;
|
|
12
14
|
/** Every drill on `source`, replacing what the document had for it. */
|
|
13
15
|
onApply: (drills: DashboardDrill[]) => void;
|
|
14
16
|
}
|
|
15
|
-
export declare function DrillDialog({ open, document, source, givenNames, dashboards, onClose, onApply, }: DrillDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function DrillDialog({ open, document, source, givenNames, dashboards, tileLabel, onClose, onApply, }: DrillDialogProps): import("react/jsx-runtime").JSX.Element;
|