@malloy-publisher/sdk 0.3.0 → 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 +8 -0
- 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-CH71GsoL.cjs.js +1 -0
- package/dist/{ServerProvider-DSK9rfSY.es.js → ServerProvider-X2Ma0HRs.es.js} +486 -521
- 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/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/Dashboard/Dashboard.d.ts +19 -14
- 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 +7 -3
- 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/DocumentStorageProvider.d.ts +7 -0
- package/dist/components/DocumentStorage/index.d.ts +1 -1
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +1 -0
- package/dist/components/drill/index.d.ts +1 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/styles.d.ts +0 -4
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/index.cjs.js +23 -270
- package/dist/index.es.js +16977 -41293
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/package.json +24 -9
- package/src/builder-entry.ts +55 -0
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +165 -175
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +66 -123
- 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 +70 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +33 -2
- 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/DocumentStorageProvider.tsx +12 -0
- package/src/components/DocumentStorage/index.ts +1 -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 +33 -72
- package/src/components/Notebook/Notebook.tsx +25 -88
- package/src/components/Notebook/NotebookCell.tsx +35 -183
- 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/ResultContainer.tsx +4 -12
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +1 -0
- package/src/components/drill/index.ts +1 -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/given/GivensPanel.tsx +1 -1
- package/src/components/index.ts +6 -0
- package/src/components/styles.ts +0 -37
- package/src/hooks/index.ts +13 -0
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/vite.config.ts +5 -0
- package/dist/ServerProvider-CGnLjzag.cjs.js +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { CatalogField } from './catalog';
|
|
2
|
+
import { BuilderControl, MappingRow } from './controls';
|
|
3
|
+
import { DashboardDocument, DashboardTile, LocalGiven } from './document';
|
|
4
|
+
/**
|
|
5
|
+
* A filter control: what it is, and which tiles it drives.
|
|
6
|
+
*
|
|
7
|
+
* Two questions, asked in that order and nothing else. WHAT: its label, and
|
|
8
|
+
* the field it filters on — one field, because a control almost always filters
|
|
9
|
+
* the same field on every tile, and the case where it does not is one click
|
|
10
|
+
* away ("Adjust per tile"), not five text boxes on every open. WHICH: a list
|
|
11
|
+
* of the dashboard's tiles with a checkbox each, and one checkbox over them
|
|
12
|
+
* all. A tile that cannot take a filter says why in place.
|
|
13
|
+
*
|
|
14
|
+
* The field is SEARCHED, not typed blind, when the host has handed over the
|
|
15
|
+
* source's fields: the picker offers the dimensions the tiles' source has,
|
|
16
|
+
* an unknown name is marked as such where it stands, and Apply waits until
|
|
17
|
+
* every ticked tile's field resolves. A binding to a field that does not exist
|
|
18
|
+
* fails at package load, which is the worst place for it to fail; here it
|
|
19
|
+
* cannot be written.
|
|
20
|
+
*
|
|
21
|
+
* The same window adds, edits and removes. It opens on the mapping the control
|
|
22
|
+
* has NOW, so unticking a tile unbinds it, and a control this dashboard
|
|
23
|
+
* declares can be taken off the page from here.
|
|
24
|
+
*
|
|
25
|
+
* What it writes is the convention {@link LocalGiven} describes: a new control
|
|
26
|
+
* is a `given:` declared in this file, bound on each ticked tile as a
|
|
27
|
+
* `+ { where: field ~ $GIVEN }` refinement. A control the model declares can be
|
|
28
|
+
* bound here but not changed, since the builder never edits model files.
|
|
29
|
+
*/
|
|
30
|
+
export interface FilterDialogProps {
|
|
31
|
+
open: boolean;
|
|
32
|
+
document: DashboardDocument;
|
|
33
|
+
/** The control being edited, or undefined to add one. */
|
|
34
|
+
control?: BuilderControl;
|
|
35
|
+
/** Model givens not yet bound anywhere, offered as "from the model". */
|
|
36
|
+
available: readonly BuilderControl[];
|
|
37
|
+
/**
|
|
38
|
+
* The fields a binding on THIS tile may name: the dimensions of the source
|
|
39
|
+
* it reads. Per tile, because a composite dashboard exists to span sources,
|
|
40
|
+
* and a field one source has another may not. Undefined for a tile whose
|
|
41
|
+
* source the host has no catalog for, in which case any name is accepted
|
|
42
|
+
* for it and nothing is searched.
|
|
43
|
+
*/
|
|
44
|
+
fieldsFor?: (tile: DashboardTile) => readonly CatalogField[] | undefined;
|
|
45
|
+
onClose: () => void;
|
|
46
|
+
/**
|
|
47
|
+
* Bind a control. `declare` is set when the control is new to this file, or
|
|
48
|
+
* when its declaration changed, and is the declaration to write.
|
|
49
|
+
*/
|
|
50
|
+
onApply: (given: string, rows: MappingRow[], declare?: LocalGiven) => void;
|
|
51
|
+
/** Take a control off the dashboard; offered for one this file declares. */
|
|
52
|
+
onRemove: (given: string) => void;
|
|
53
|
+
}
|
|
54
|
+
export declare function FilterDialog({ open, document, control, available, fieldsFor, onClose, onApply, onRemove, }: FilterDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BuilderControl } from './controls';
|
|
3
|
+
/**
|
|
4
|
+
* The strip under the header where the dashboard's controls are configured —
|
|
5
|
+
* the ONE place: a chip per control opens its window, and "Add filter"
|
|
6
|
+
* declares a new one. The live control row the host renders sits under it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, children, }: {
|
|
9
|
+
controls: BuilderControl[];
|
|
10
|
+
tileCount: number;
|
|
11
|
+
/** Bindings a control has that its tiles' sources cannot take. */
|
|
12
|
+
unknownFieldsOf: (name: string, type: string | undefined) => string[];
|
|
13
|
+
onEdit: (control: BuilderControl) => void;
|
|
14
|
+
onAdd: () => void;
|
|
15
|
+
/** The host's live control row. */
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DashboardDocument } from './document';
|
|
2
|
+
/**
|
|
3
|
+
* The page's own settings, off the edit bar: its title, the markdown
|
|
4
|
+
* description under it, the grid's width, and whether controls run as they
|
|
5
|
+
* change or behind an Apply button. Edits commit on close (`useDraft`).
|
|
6
|
+
*/
|
|
7
|
+
export interface PageSettings {
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
columns?: number;
|
|
11
|
+
autorun?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const settingsOf: (document: DashboardDocument) => PageSettings;
|
|
14
|
+
export declare function SettingsPopover({ anchor, settings, onClose, onCommit, }: {
|
|
15
|
+
anchor: HTMLElement | null;
|
|
16
|
+
settings: PageSettings;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
/** Called once, on close, only when something changed. */
|
|
19
|
+
onCommit: (next: PageSettings) => void;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { PointerEvent, ReactNode } from 'react';
|
|
2
|
+
import { DashboardTile } from './document';
|
|
3
|
+
/**
|
|
4
|
+
* Everything the builder draws AROUND a tile: the selection outline, the grip,
|
|
5
|
+
* the menu button, the resize badge and the handle at the right edge. The tile
|
|
6
|
+
* itself is `children` — the host's real `DashboardTile`, or a placeholder
|
|
7
|
+
* saying what the tile will run.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TileFrame({ tile, index, selected, menuOpen, resizeSpan, columns, onSelect, onOpenMenu, onResizeStart, onResizeMove, onResizeEnd, children, }: {
|
|
10
|
+
tile: DashboardTile;
|
|
11
|
+
index: number;
|
|
12
|
+
selected: boolean;
|
|
13
|
+
/** Whether this tile's menu is open, which keeps its button showing. */
|
|
14
|
+
menuOpen: boolean;
|
|
15
|
+
/** The width being previewed while THIS tile is resized. */
|
|
16
|
+
resizeSpan: number | undefined;
|
|
17
|
+
columns: number;
|
|
18
|
+
onSelect: () => void;
|
|
19
|
+
onOpenMenu: (anchor: HTMLElement) => void;
|
|
20
|
+
onResizeStart: (event: PointerEvent<HTMLDivElement>) => void;
|
|
21
|
+
onResizeMove: (event: PointerEvent<HTMLDivElement>) => void;
|
|
22
|
+
onResizeEnd: (event: PointerEvent<HTMLDivElement>) => void;
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* No host-supplied tile: say what this one will run, so the surface is still
|
|
27
|
+
* legible without a server.
|
|
28
|
+
*/
|
|
29
|
+
export declare function TilePlaceholder({ tile }: {
|
|
30
|
+
tile: DashboardTile;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/** The empty end of a row, made a drop target while a drag is live. */
|
|
33
|
+
export declare function GapTarget({ after }: {
|
|
34
|
+
after: string;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
/**
|
|
37
|
+
* Column guides, drawn only during a gesture: a flow grid is invisible until
|
|
38
|
+
* you are trying to land on it.
|
|
39
|
+
*/
|
|
40
|
+
export declare function GridGuides({ columns }: {
|
|
41
|
+
columns: number;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DashboardTile } from './document';
|
|
2
|
+
/**
|
|
3
|
+
* A tile's own settings, on the tile: a popover off its menu button, so
|
|
4
|
+
* editing it never means scrolling away from it. Its title, subtitle, width
|
|
5
|
+
* presets, clickable cells and removal. Its row is set by dragging it — a drop
|
|
6
|
+
* into the empty end of a row is what "start a new row" means — and its card
|
|
7
|
+
* is the reader's to decide, so neither is a toggle here. Which controls it
|
|
8
|
+
* answers to is not here either: filters are configured in one place, the
|
|
9
|
+
* strip under the header. Edits commit on close (`useDraft`).
|
|
10
|
+
*/
|
|
11
|
+
export interface TileMenuProps {
|
|
12
|
+
anchor: HTMLElement | null;
|
|
13
|
+
tile: DashboardTile | undefined;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** Apply the edited tile. Called once, on close, only when something changed. */
|
|
16
|
+
onCommit: (next: DashboardTile) => void;
|
|
17
|
+
/** Take the tile off the dashboard. Offered on every tile: order is this file's. */
|
|
18
|
+
onRemove: () => void;
|
|
19
|
+
/** The grid's width, which the width presets are fractions of. */
|
|
20
|
+
columns: number;
|
|
21
|
+
/** Open the clickable-cells window for this tile's source. */
|
|
22
|
+
onDrills: () => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function TileMenu({ anchor, tile, onClose, onCommit, onRemove, columns, onDrills, }: TileMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { CompiledModel } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* What a package offers a dashboard: the sources, the views on them, and the
|
|
4
|
+
* fields a drill can be declared on.
|
|
5
|
+
*
|
|
6
|
+
* This is what makes a tile expression correct BY CONSTRUCTION. The builder only
|
|
7
|
+
* ever offers `source -> view` pairs that came from here, so it cannot emit a
|
|
8
|
+
* tile that does not resolve — which is the reason validation needs nothing more
|
|
9
|
+
* than the existing compile endpoint.
|
|
10
|
+
*
|
|
11
|
+
* Shaped from the models endpoint as it is, rather than from a new one. The cost
|
|
12
|
+
* is that annotations arrive RAW — `'# bar_chart\n'`, `'#(doc) Revenue by
|
|
13
|
+
* category\n'` — so the small amount of reading below happens here instead of on
|
|
14
|
+
* the server.
|
|
15
|
+
*/
|
|
16
|
+
export interface CatalogField {
|
|
17
|
+
name: string;
|
|
18
|
+
kind: "dimension" | "measure";
|
|
19
|
+
type?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface CatalogView {
|
|
22
|
+
name: string;
|
|
23
|
+
/** From a `#(doc)` annotation, which is what a picker should show. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** `bar_chart`, `line_chart`, `shape_map`, … if the view declares one. */
|
|
26
|
+
chart?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface CatalogSource {
|
|
29
|
+
name: string;
|
|
30
|
+
/** The model that declares it, which is what a preview runs against. */
|
|
31
|
+
modelPath: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
views: CatalogView[];
|
|
34
|
+
/**
|
|
35
|
+
* The givens this source is scoped by, which is also the control row a tile
|
|
36
|
+
* reading it will show — measured equal to the manifest's per-tile
|
|
37
|
+
* `givenNames` for the `source -> view` form.
|
|
38
|
+
*/
|
|
39
|
+
givens: string[];
|
|
40
|
+
/** For declaring a `# drill` dimension. */
|
|
41
|
+
fields: CatalogField[];
|
|
42
|
+
}
|
|
43
|
+
export interface PackageCatalog {
|
|
44
|
+
sources: CatalogSource[];
|
|
45
|
+
}
|
|
46
|
+
/** `#(doc) Revenue by product category\n` -> `Revenue by product category`. */
|
|
47
|
+
export declare function docOf(annotations: string[] | undefined): string | undefined;
|
|
48
|
+
/** `# bar_chart\n` -> `bar_chart`. Only the renderer's own chart tags count. */
|
|
49
|
+
export declare function chartOf(annotations: string[] | undefined): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* The fields a filter on `source` may name: its dimensions, joins included as
|
|
52
|
+
* paths. Measures are not filterable with `where:` and are left out. Undefined
|
|
53
|
+
* when the catalog has no such source, which a picker reads as "no list".
|
|
54
|
+
*/
|
|
55
|
+
export declare function filterableFields(catalog: PackageCatalog | undefined, source: string | undefined): CatalogField[] | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* A dashboard file is itself a model, so the endpoint lists it alongside the
|
|
58
|
+
* real ones. Offering a dashboard's own tile views as things to put on a
|
|
59
|
+
* dashboard would be circular, so they are left out.
|
|
60
|
+
*/
|
|
61
|
+
export declare const isDashboardModel: (path: string | undefined) => boolean;
|
|
62
|
+
export declare function buildCatalog(models: CompiledModel[]): PackageCatalog;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { DashboardDocument, DashboardTile, LocalGiven } from './document';
|
|
2
|
+
/**
|
|
3
|
+
* The builder's view of the dashboard's filter controls, and the pure edits it
|
|
4
|
+
* makes to them. Kept out of the component so every rule here has a test that
|
|
5
|
+
* needs no DOM.
|
|
6
|
+
*
|
|
7
|
+
* A control is a GIVEN some tile binds. It comes from one of two places, and
|
|
8
|
+
* the difference decides what the builder may do with it:
|
|
9
|
+
*
|
|
10
|
+
* - `dashboard` — declared in this file ({@link LocalGiven}). The builder owns
|
|
11
|
+
* it outright: add, retag, remove, and bind on any tile.
|
|
12
|
+
* - `model` — declared in the model and reaching this file through an import.
|
|
13
|
+
* The builder may bind it on tiles, because a binding is a refinement in this
|
|
14
|
+
* file, but it cannot change or remove the declaration, because the builder
|
|
15
|
+
* never edits imports or model files.
|
|
16
|
+
*
|
|
17
|
+
* Declaring in the dashboard is the convention; see {@link LocalGiven}.
|
|
18
|
+
*/
|
|
19
|
+
export type ControlOrigin = "dashboard" | "model";
|
|
20
|
+
/** A given the builder can bind a tile to, from either origin. */
|
|
21
|
+
export interface BuilderGiven {
|
|
22
|
+
/** The given's name, as written after `$` in a `where:`. */
|
|
23
|
+
name: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
/** The declared type, which decides how a binding compares; see {@link defaultOperator}. */
|
|
26
|
+
type?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The field to compare against, used as the default when this given is
|
|
29
|
+
* bound to a tile. The dimension its control suggests over is the right
|
|
30
|
+
* guess — a `CATEGORY` control that suggests over `category` is almost
|
|
31
|
+
* always filtering `category` — and it is only a default: the binding is
|
|
32
|
+
* editable afterwards, because the tile's source may spell it differently.
|
|
33
|
+
*/
|
|
34
|
+
field?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface BuilderControl extends BuilderGiven {
|
|
37
|
+
origin: ControlOrigin;
|
|
38
|
+
/** The declaration, for a control this dashboard owns. */
|
|
39
|
+
local?: LocalGiven;
|
|
40
|
+
/** How many tiles bind it. Zero means declared but not yet a control. */
|
|
41
|
+
boundTiles: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Every control the builder can offer: the dashboard's own first, in file
|
|
45
|
+
* order, then the model's that the caller knows about. A model given that
|
|
46
|
+
* shares a name with a local one is the same control as far as any `where:` is
|
|
47
|
+
* concerned, and the local declaration is the one that binds — so it is not
|
|
48
|
+
* listed twice.
|
|
49
|
+
*/
|
|
50
|
+
export declare function controlsOf(document: DashboardDocument, modelGivens?: readonly BuilderGiven[]): BuilderControl[];
|
|
51
|
+
/**
|
|
52
|
+
* How a binding to a given of this type compares.
|
|
53
|
+
*
|
|
54
|
+
* A `filter<…>` given is a filter EXPRESSION and binds with `~`, which is the
|
|
55
|
+
* common case and is left implicit on the binding. A plain-typed given is a
|
|
56
|
+
* VALUE: a `date` is "since", a `number` is "at least", a `string` is "equals".
|
|
57
|
+
* Measured: `created_at ~ $SINCE` does not compile against a `date` given.
|
|
58
|
+
*/
|
|
59
|
+
export declare function defaultOperator(type: string | undefined): string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Whether a given of `givenType` can compare a field of `fieldType` (the
|
|
62
|
+
* catalog's spelling: `string_type`, `number_type`, `date_type`, …).
|
|
63
|
+
*
|
|
64
|
+
* A `filter<string>` over a number field compiles nowhere and a `date` over a
|
|
65
|
+
* string field compares nothing, so the picker offers only the fields a control
|
|
66
|
+
* can take, and a binding to one it cannot is marked. Dates and timestamps
|
|
67
|
+
* compare with each other. Unknown on EITHER side is accepted: the catalog may
|
|
68
|
+
* carry no type, and a given of a type this does not know is not refused on
|
|
69
|
+
* that account.
|
|
70
|
+
*/
|
|
71
|
+
export declare function acceptsField(givenType: string | undefined, fieldType: string | undefined): boolean;
|
|
72
|
+
/** `number_type` -> "a number", as a message would say it. */
|
|
73
|
+
export declare function typeLabel(type: string | undefined): string;
|
|
74
|
+
/**
|
|
75
|
+
* The control a field of this type naturally gets: a number range for a
|
|
76
|
+
* number, a date picker for a date, a pick-list for anything else. What the
|
|
77
|
+
* window switches a new control to when the field picked does not fit the kind
|
|
78
|
+
* it started with.
|
|
79
|
+
*/
|
|
80
|
+
export declare function kindForFieldType(fieldType: string | undefined): ControlKind;
|
|
81
|
+
/** The comparisons a binding can use, with how a reader would say them. */
|
|
82
|
+
export declare const OPERATORS: ReadonlyArray<{
|
|
83
|
+
op: string;
|
|
84
|
+
label: string;
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* A given name from a field: `products.category` -> `CATEGORY`, and kept
|
|
88
|
+
* distinct from any name already taken.
|
|
89
|
+
*/
|
|
90
|
+
export declare function givenNameFor(field: string, taken: Iterable<string>): string;
|
|
91
|
+
/** What kind of control a new filter is, in a reader's terms. */
|
|
92
|
+
export type ControlKind = "select" | "multiselect" | "text" | "number" | "date";
|
|
93
|
+
export declare const CONTROL_KINDS: ReadonlyArray<{
|
|
94
|
+
kind: ControlKind;
|
|
95
|
+
label: string;
|
|
96
|
+
hint: string;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* A new control's declaration, from what the dialog asked.
|
|
100
|
+
*
|
|
101
|
+
* The picker's options come from the source the field lives on — the base of
|
|
102
|
+
* the tile's own extension — which the file necessarily already imports, so a
|
|
103
|
+
* `suggest` here always resolves and the builder never has to add an import.
|
|
104
|
+
*/
|
|
105
|
+
export declare function newLocalGiven(spec: {
|
|
106
|
+
name: string;
|
|
107
|
+
label: string;
|
|
108
|
+
kind: ControlKind;
|
|
109
|
+
field: string;
|
|
110
|
+
/** The source to suggest over, for `select` and `multiselect`. */
|
|
111
|
+
source?: string;
|
|
112
|
+
/** A date's default, `YYYY-MM-DD`; a number range's bounds. */
|
|
113
|
+
dateDefault?: string;
|
|
114
|
+
range?: {
|
|
115
|
+
min: number;
|
|
116
|
+
max: number;
|
|
117
|
+
};
|
|
118
|
+
}): LocalGiven;
|
|
119
|
+
/** One tile's row in a control's mapping: whether it binds, and how. */
|
|
120
|
+
export interface MappingRow {
|
|
121
|
+
include: boolean;
|
|
122
|
+
field: string;
|
|
123
|
+
/** Absent means `~`; see {@link defaultOperator}. */
|
|
124
|
+
op?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Which tiles can take a binding, and why the others cannot.
|
|
128
|
+
*
|
|
129
|
+
* A binding is a `+ { where: … }` refinement on the tile's declaration, so the
|
|
130
|
+
* tile has to BE a declaration this file owns that the reader will read back.
|
|
131
|
+
* That is the `reference` form only: an `inherited` tile is declared on the
|
|
132
|
+
* model's source, and an `inline` tile's body is a query, not a reference, so a
|
|
133
|
+
* refinement written onto it would not come back and the round-trip gate would
|
|
134
|
+
* refuse the whole save. Better to refuse the tick.
|
|
135
|
+
*/
|
|
136
|
+
export declare const canBind: (tile: DashboardTile) => boolean;
|
|
137
|
+
/** The mapping a control has NOW, one row per tile, for the dialog to open on. */
|
|
138
|
+
export declare function mappingOf(document: DashboardDocument, control: {
|
|
139
|
+
name: string;
|
|
140
|
+
field?: string;
|
|
141
|
+
type?: string;
|
|
142
|
+
}): MappingRow[];
|
|
143
|
+
/**
|
|
144
|
+
* Apply a mapping: a DIFF against what each tile carries now — added where
|
|
145
|
+
* newly ticked, dropped where unticked, rewritten where only the field or the
|
|
146
|
+
* comparison changed. Mutates the draft; the caller makes it one history entry.
|
|
147
|
+
*/
|
|
148
|
+
export declare function applyMapping(draft: DashboardDocument, given: string, rows: readonly MappingRow[]): void;
|
|
149
|
+
/** Declare a control in this dashboard, or replace its declaration by name. */
|
|
150
|
+
export declare function declareControl(draft: DashboardDocument, given: LocalGiven): void;
|
|
151
|
+
/**
|
|
152
|
+
* Take a control off the dashboard: every binding to it, and — when this file
|
|
153
|
+
* declares it — the declaration too. A model given keeps its declaration, which
|
|
154
|
+
* is not ours; it simply stops being a control here, because a control is a
|
|
155
|
+
* given some tile binds.
|
|
156
|
+
*/
|
|
157
|
+
export declare function removeControl(draft: DashboardDocument, name: string): void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A line diff, for showing an author what a structural save will do to the
|
|
3
|
+
* file before it does it.
|
|
4
|
+
*
|
|
5
|
+
* Adding or removing a tile moves a declaration and the comment block above
|
|
6
|
+
* it, and the file cannot say whether that comment belonged to the tile, the
|
|
7
|
+
* row, or the page. The writer makes a defensible choice (a tile's `#` tags
|
|
8
|
+
* go with it; `//` comments stay), and this is what turns that choice from a
|
|
9
|
+
* silent one into one the author sees and approves.
|
|
10
|
+
*
|
|
11
|
+
* Longest-common-subsequence over lines: exact, and a dashboard file is a few
|
|
12
|
+
* hundred lines, so the quadratic table is small. Past `LIMIT` lines a side,
|
|
13
|
+
* the diff degrades to "everything changed" rather than stalling the page.
|
|
14
|
+
*/
|
|
15
|
+
export type DiffLine = {
|
|
16
|
+
kind: "same";
|
|
17
|
+
text: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "add";
|
|
20
|
+
text: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "del";
|
|
23
|
+
text: string;
|
|
24
|
+
};
|
|
25
|
+
export declare function lineDiff(before: string, after: string): DiffLine[];
|
|
26
|
+
/**
|
|
27
|
+
* The diff with unchanged stretches folded, keeping `context` lines around
|
|
28
|
+
* every change — what a review tool shows, and all a reader needs to judge a
|
|
29
|
+
* save. A fold is one entry saying how many lines it hides.
|
|
30
|
+
*/
|
|
31
|
+
export type DiffHunkLine = DiffLine | {
|
|
32
|
+
kind: "fold";
|
|
33
|
+
count: number;
|
|
34
|
+
};
|
|
35
|
+
export declare function foldUnchanged(lines: DiffLine[], context?: number): DiffHunkLine[];
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dashboard builder's working representation of a `dashboards/*.malloy`
|
|
3
|
+
* file.
|
|
4
|
+
*
|
|
5
|
+
* This is an editing PROJECTION, not a complete representation of the file, and
|
|
6
|
+
* the distinction is load-bearing. The builder writes changes by SPLICING the
|
|
7
|
+
* source text — patching the ranges it owns and leaving every other byte alone —
|
|
8
|
+
* so anything this type does not model survives an edit untouched. A `where:` in
|
|
9
|
+
* a source extension, an inline computed dimension, a `#(doc)` tag, a reader's
|
|
10
|
+
* comments: none of them appear below, and none of them are lost.
|
|
11
|
+
*
|
|
12
|
+
* What that buys is the reason the projection exists. A writer that regenerated
|
|
13
|
+
* the whole file would have to model everything or destroy it, which is why the
|
|
14
|
+
* earlier design could only ever have edited files it wrote itself.
|
|
15
|
+
*
|
|
16
|
+
* The document is still what decides whether a file can be opened at all: the
|
|
17
|
+
* reader refuses a file it cannot fully turn into one of these, rather than
|
|
18
|
+
* opening it half-understood. See {@link readDashboardDocument}.
|
|
19
|
+
*/
|
|
20
|
+
/** One `import` line. The file needs both forms, and for different reasons. */
|
|
21
|
+
export type DashboardImport =
|
|
22
|
+
/** `import "../givens.malloy"` — the whole file's declarations. */
|
|
23
|
+
{
|
|
24
|
+
kind: "all";
|
|
25
|
+
from: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `import { products, regions } from "../storefront.malloy"` — specific
|
|
29
|
+
* names. Not interchangeable with the bare form: a bare import is not
|
|
30
|
+
* transitive, so a dashboard whose control has `suggest { source=products }`
|
|
31
|
+
* must name `products` here or the package load reports an error for every
|
|
32
|
+
* such given.
|
|
33
|
+
*/
|
|
34
|
+
| {
|
|
35
|
+
kind: "names";
|
|
36
|
+
names: string[];
|
|
37
|
+
from: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* A given this dashboard declares itself, rather than taking from the model.
|
|
41
|
+
*
|
|
42
|
+
* This is the CONVENTION for a dashboard the builder edits, not the exception:
|
|
43
|
+
* the builder adds and removes filters, and a filter it can add has to be a
|
|
44
|
+
* declaration in the one file it writes. A given imported from the model is
|
|
45
|
+
* still read and still bindable, but it is the model's, and the builder never
|
|
46
|
+
* edits imports or model files.
|
|
47
|
+
*
|
|
48
|
+
* Measured, and the reason the convention has to be this way round: a local
|
|
49
|
+
* given does NOT drive a model-level `where:` of the same name. Binding is per
|
|
50
|
+
* declaration, not per name, so a dashboard that declares `CATEGORY` and extends
|
|
51
|
+
* a source whose own `where:` reads the model's `CATEGORY` gets a control that
|
|
52
|
+
* moves nothing. The filtering therefore lives on the dashboard's tiles, as
|
|
53
|
+
* {@link DashboardTile.filters} — which is what the builder writes anyway.
|
|
54
|
+
*
|
|
55
|
+
* The fields are the declaration and its control contract, spelled as in the
|
|
56
|
+
* file. A tag this does not model survives an edit like any other unmodelled
|
|
57
|
+
* Malloy, because the writer patches rather than regenerates.
|
|
58
|
+
*/
|
|
59
|
+
export interface LocalGiven {
|
|
60
|
+
name: string;
|
|
61
|
+
/** The declared type, spelled as in the file: `filter<string>`, `date`, … */
|
|
62
|
+
type: string;
|
|
63
|
+
/** The default, spelled as in the file: `f'Jeans'`, `@2023-01-01`, … */
|
|
64
|
+
default: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
/** `# description="…"`: helper text under the control. */
|
|
67
|
+
description?: string;
|
|
68
|
+
/** `control=select` / `multiselect`. */
|
|
69
|
+
control?: string;
|
|
70
|
+
/**
|
|
71
|
+
* `suggest { source=products dimension=category }`, or `{ query=… }`: where
|
|
72
|
+
* a picker gets its options. The source or query has to resolve in this file,
|
|
73
|
+
* and the builder does not add imports — so a given it creates suggests over
|
|
74
|
+
* a source the file already reads, or over nothing.
|
|
75
|
+
*/
|
|
76
|
+
suggest?: {
|
|
77
|
+
source?: string;
|
|
78
|
+
query?: string;
|
|
79
|
+
dimension: string;
|
|
80
|
+
};
|
|
81
|
+
/** `range_min=` / `range_max=` on a `filter<number>`: a slider's bounds. */
|
|
82
|
+
rangeMin?: number;
|
|
83
|
+
rangeMax?: number;
|
|
84
|
+
}
|
|
85
|
+
/** A `# drill` dimension the dashboard declares in its own source extension. */
|
|
86
|
+
export interface DashboardDrill {
|
|
87
|
+
/** The source this dimension is declared on. */
|
|
88
|
+
source: string;
|
|
89
|
+
/** `dimension: <name> is <expression>`. */
|
|
90
|
+
name: string;
|
|
91
|
+
expression: string;
|
|
92
|
+
/** Dashboard slugs, or the literal `self`. */
|
|
93
|
+
to: string[];
|
|
94
|
+
/** The given a click seeds. Absent means the dimension's own name. */
|
|
95
|
+
given?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Where a tile's view is declared, and therefore what the builder may edit.
|
|
99
|
+
*
|
|
100
|
+
* Three forms, all of them found in dashboards that ship in this repository, and
|
|
101
|
+
* the distinction decides which affordances a tile gets:
|
|
102
|
+
*
|
|
103
|
+
* - `reference` — `view: revenue_trend is sales_by_month` in this file. Fully
|
|
104
|
+
* editable: the layout tags sit above that line and the builder owns them.
|
|
105
|
+
* - `inline` — `view: order_tile is { aggregate: order_count }` in this file.
|
|
106
|
+
* Its tags are editable for the same reason; its QUERY is not, because
|
|
107
|
+
* authoring a query body is a separate feature. The projection holds: the body
|
|
108
|
+
* is never rewritten, so it cannot be damaged.
|
|
109
|
+
* - `inherited` — not declared in this file at all, as in a dashboard whose only
|
|
110
|
+
* tile is `orders -> by_brand` against an imported source. Nothing about it is
|
|
111
|
+
* editable here, because its tags live on the model's own view and the builder
|
|
112
|
+
* does not write model files. Read and shown, not changed.
|
|
113
|
+
*/
|
|
114
|
+
export type TileDeclaration = {
|
|
115
|
+
kind: "reference";
|
|
116
|
+
from: string;
|
|
117
|
+
} | {
|
|
118
|
+
kind: "inline";
|
|
119
|
+
} | {
|
|
120
|
+
kind: "inherited";
|
|
121
|
+
};
|
|
122
|
+
/** One tile: a view shown on the page, plus how it is presented. */
|
|
123
|
+
export interface DashboardTile {
|
|
124
|
+
/**
|
|
125
|
+
* The view name. For a tile declared in this file, assigned ONCE when the
|
|
126
|
+
* tile is added and never recomputed — deriving it from position would
|
|
127
|
+
* rename every later tile on a reorder, turning a pure-layout edit into a
|
|
128
|
+
* large diff.
|
|
129
|
+
*/
|
|
130
|
+
name: string;
|
|
131
|
+
/**
|
|
132
|
+
* The source it reads, by NAME — an index would break on reorder. May name a
|
|
133
|
+
* source this file declares in {@link DashboardDocument.sources}, or one it
|
|
134
|
+
* merely imports.
|
|
135
|
+
*/
|
|
136
|
+
source: string;
|
|
137
|
+
declaration: TileDeclaration;
|
|
138
|
+
/**
|
|
139
|
+
* Given bindings, emitted as a `+ { where: … }` refinement on the view.
|
|
140
|
+
*
|
|
141
|
+
* `op` is the comparison, and absent means `~`, which is how a `filter<…>`
|
|
142
|
+
* given binds. A plain `date` or `number` given is a VALUE, not a filter,
|
|
143
|
+
* and compares with `>=`, `<=` or `=` — measured: `created_at >= $SINCE`
|
|
144
|
+
* compiles and `created_at ~ $SINCE` does not, on a `date` given.
|
|
145
|
+
*/
|
|
146
|
+
filters?: Array<{
|
|
147
|
+
field: string;
|
|
148
|
+
given: string;
|
|
149
|
+
op?: string;
|
|
150
|
+
}>;
|
|
151
|
+
label?: string;
|
|
152
|
+
subtitle?: string;
|
|
153
|
+
colspan?: number;
|
|
154
|
+
break?: boolean;
|
|
155
|
+
borderless?: boolean;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A source extension the dashboard DECLARES, holding tiles that read it.
|
|
159
|
+
*
|
|
160
|
+
* A LIST, not one source, because a composite dashboard exists precisely to
|
|
161
|
+
* combine queries no single Malloy result can span. Measured: a dashboard whose
|
|
162
|
+
* tiles come from two sources loads clean and scopes givens per source. A picker
|
|
163
|
+
* over a package catalog offers every source's views side by side, so the second
|
|
164
|
+
* tile a reader adds can already need this.
|
|
165
|
+
*
|
|
166
|
+
* May be EMPTY. A dashboard whose tiles all read imported sources declares no
|
|
167
|
+
* extension at all — `tiles=["orders -> by_brand"]` over an imported `orders` is
|
|
168
|
+
* a complete dashboard with nothing else in the file.
|
|
169
|
+
*/
|
|
170
|
+
export interface DashboardSource {
|
|
171
|
+
name: string;
|
|
172
|
+
/** What it extends: `source: <name> is <base> extend { … }`. */
|
|
173
|
+
base: string;
|
|
174
|
+
/** A `#(doc)` description on the source. */
|
|
175
|
+
doc?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The dimensions this extension declares itself, in file order. These are
|
|
178
|
+
* the only fields a `# drill` can be authored on here: a drill is a tag on
|
|
179
|
+
* the dimension's declaration, and the model's dimensions are declared in
|
|
180
|
+
* the model.
|
|
181
|
+
*/
|
|
182
|
+
dimensions?: DashboardDimension[];
|
|
183
|
+
}
|
|
184
|
+
/** A tile's identity across a reorder: what the grid keys on, a drag names and the writer matches. */
|
|
185
|
+
export declare const tileKey: (tile: {
|
|
186
|
+
source: string;
|
|
187
|
+
name: string;
|
|
188
|
+
}) => string;
|
|
189
|
+
/** `dimension: <name> is <expression>` in the dashboard's own extension. */
|
|
190
|
+
export interface DashboardDimension {
|
|
191
|
+
name: string;
|
|
192
|
+
expression: string;
|
|
193
|
+
}
|
|
194
|
+
export interface DashboardDocument {
|
|
195
|
+
title: string;
|
|
196
|
+
/** The narrative header, as markdown. Emitted as `##"` lines. */
|
|
197
|
+
description?: string;
|
|
198
|
+
/** `# dashboard { columns=N }`. */
|
|
199
|
+
columns?: number;
|
|
200
|
+
/** `## artifact { autorun=false }`. Absent means autorun. */
|
|
201
|
+
autorun?: boolean;
|
|
202
|
+
imports: DashboardImport[];
|
|
203
|
+
sources: DashboardSource[];
|
|
204
|
+
localGivens?: LocalGiven[];
|
|
205
|
+
/** `## artifact { givens { … } }` — where the controls open. */
|
|
206
|
+
startingGivens?: Record<string, string>;
|
|
207
|
+
drills?: DashboardDrill[];
|
|
208
|
+
/**
|
|
209
|
+
* Tiles in layout order. The grid flows in declaration order, so this array
|
|
210
|
+
* IS the layout, and there is no separate ordering field to fall out of step
|
|
211
|
+
* with it.
|
|
212
|
+
*
|
|
213
|
+
* One array drives both halves of the file: the `## artifact { tiles=[…] }`
|
|
214
|
+
* list and the `view:` declarations inside each extension. They therefore
|
|
215
|
+
* cannot disagree, which they can and do in hand-written files.
|
|
216
|
+
*/
|
|
217
|
+
tiles: DashboardTile[];
|
|
218
|
+
}
|