@malloy-publisher/sdk 0.9.10 → 0.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/dist/RenderedResult-BlNoIiSi.cjs.js +153 -0
  2. package/dist/{RenderedResult-Dp1Qdajz.es.js → RenderedResult-Cmx8sX8d.es.js} +102 -102
  3. package/dist/ServerProvider-BOgiW8MX.cjs.js +1 -0
  4. package/dist/{ServerProvider-CQy4jVYK.es.js → ServerProvider-azXLkk1q.es.js} +619 -586
  5. package/dist/builder/index.cjs.js +78 -130
  6. package/dist/builder/index.es.js +7493 -6769
  7. package/dist/builder-entry.d.ts +3 -0
  8. package/dist/client/api.d.ts +26 -22
  9. package/dist/client/index.cjs.js +1 -1
  10. package/dist/client/index.es.js +1 -1
  11. package/dist/components/AppDialog.d.ts +9 -1
  12. package/dist/components/Dashboard/DashboardGrid.d.ts +14 -15
  13. package/dist/components/Dashboard/DashboardTile.d.ts +8 -1
  14. package/dist/components/Dashboard/DashboardView.d.ts +22 -34
  15. package/dist/components/Dashboard/TileCard.d.ts +10 -3
  16. package/dist/components/Dashboard/useStuck.d.ts +15 -7
  17. package/dist/components/DocumentCreate/useDocumentChoices.d.ts +6 -0
  18. package/dist/components/Package/PackageProblems.d.ts +14 -0
  19. package/dist/components/RemoveBadge.d.ts +40 -0
  20. package/dist/components/Report/Report.d.ts +13 -4
  21. package/dist/components/Report/ReportPage.d.ts +60 -0
  22. package/dist/components/Report/layoutRules.d.ts +32 -0
  23. package/dist/components/Report/reportQuery.d.ts +30 -0
  24. package/dist/components/Report/telemetry.d.ts +0 -2
  25. package/dist/components/ReportBuilder/AddTileDialog.d.ts +22 -3
  26. package/dist/components/ReportBuilder/BuilderBar.d.ts +17 -0
  27. package/dist/components/ReportBuilder/BuilderDialogs.d.ts +7 -6
  28. package/dist/components/ReportBuilder/BuilderGrid.d.ts +10 -4
  29. package/dist/components/ReportBuilder/BuilderHeader.d.ts +4 -7
  30. package/dist/components/ReportBuilder/BuilderToolbar.d.ts +88 -0
  31. package/dist/components/ReportBuilder/DrillDialog.d.ts +3 -1
  32. package/dist/components/ReportBuilder/EditorSurface.d.ts +7 -9
  33. package/dist/components/ReportBuilder/FilterDialog.d.ts +3 -1
  34. package/dist/components/ReportBuilder/FilterStrip.d.ts +30 -8
  35. package/dist/components/ReportBuilder/InlineMarkdown.d.ts +4 -4
  36. package/dist/components/ReportBuilder/ReportBuilder.d.ts +49 -12
  37. package/dist/components/ReportBuilder/ReportEditor.d.ts +53 -3
  38. package/dist/components/ReportBuilder/TextTileBody.d.ts +2 -5
  39. package/dist/components/ReportBuilder/TileFrame.d.ts +10 -4
  40. package/dist/components/ReportBuilder/TileMenu.d.ts +12 -9
  41. package/dist/components/ReportBuilder/ViewPicker.d.ts +53 -0
  42. package/dist/components/ReportBuilder/addTileToDocument.d.ts +24 -3
  43. package/dist/components/ReportBuilder/builderControls.d.ts +60 -0
  44. package/dist/components/ReportBuilder/catalog.d.ts +2 -4
  45. package/dist/components/ReportBuilder/inlineEdit.d.ts +9 -10
  46. package/dist/components/ReportBuilder/localGiven.d.ts +12 -0
  47. package/dist/components/ReportBuilder/preview.d.ts +17 -2
  48. package/dist/components/ReportBuilder/readDocument.d.ts +0 -2
  49. package/dist/components/ReportBuilder/readForEditor.d.ts +2 -7
  50. package/dist/components/ReportBuilder/reportTag.d.ts +11 -1
  51. package/dist/components/ReportBuilder/sortable.d.ts +4 -3
  52. package/dist/components/ReportBuilder/testing/inline.d.ts +5 -1
  53. package/dist/components/ReportBuilder/useBuilderSelection.d.ts +0 -1
  54. package/dist/components/ReportBuilder/useBuilderSession.d.ts +21 -12
  55. package/dist/components/ReportBuilder/useDocumentEditor.d.ts +2 -6
  56. package/dist/components/ReportBuilder/useExitGuard.d.ts +3 -0
  57. package/dist/components/ReportBuilder/useFilterForm.d.ts +3 -1
  58. package/dist/components/ReportBuilder/useOpenedDocument.d.ts +0 -4
  59. package/dist/components/ReportBuilder/useReportDraft.d.ts +66 -0
  60. package/dist/components/ReportBuilder/useReportEditor.d.ts +0 -9
  61. package/dist/components/ReportBuilder/useTileEditing.d.ts +6 -3
  62. package/dist/components/ReportBuilder/viewAnnotations.d.ts +9 -0
  63. package/dist/components/ReportBuilder/widthLabel.d.ts +6 -0
  64. package/dist/components/ServerProvider.d.ts +9 -0
  65. package/dist/components/controlTokens.d.ts +45 -0
  66. package/dist/components/drill/markDrillableCells.d.ts +1 -1
  67. package/dist/components/given/FilterButton.d.ts +35 -0
  68. package/dist/components/given/GivensPanel.d.ts +2 -1
  69. package/dist/components/given/filterEditing.d.ts +54 -0
  70. package/dist/components/given/filterSummary.d.ts +9 -0
  71. package/dist/components/given/paramCodec.d.ts +11 -0
  72. package/dist/components/given/required.d.ts +25 -0
  73. package/dist/components/index.d.ts +3 -0
  74. package/dist/components/legacy/index.d.ts +1 -1
  75. package/dist/components/{Report/CellReport.d.ts → legacy/malloynb/CellRunnerView.d.ts} +9 -17
  76. package/dist/components/legacy/{MalloynbCells.d.ts → malloynb/MalloynbCells.d.ts} +3 -3
  77. package/dist/components/legacy/{Notebook.d.ts → malloynb/Notebook.d.ts} +1 -1
  78. package/dist/components/{Notebook → legacy/malloynb}/NotebookCell.d.ts +3 -3
  79. package/dist/components/legacy/malloynb/cellKind.d.ts +5 -0
  80. package/dist/components/{Notebook → legacy/malloynb}/types.d.ts +1 -1
  81. package/dist/components/styles.d.ts +0 -2
  82. package/dist/hooks/useQueryResult.d.ts +7 -0
  83. package/dist/index.cjs.js +16 -19
  84. package/dist/index.es.js +8324 -7769
  85. package/dist/theme/ThemeContext.d.ts +8 -1
  86. package/dist/theme/classes.d.ts +49 -0
  87. package/dist/theme/index.d.ts +2 -0
  88. package/dist/theme/types.d.ts +7 -0
  89. package/dist/theme/ui.d.ts +75 -0
  90. package/dist/{useCompiledDocument-BMPDvdFx.es.js → useCompiledDocument-7j5cBjQd.es.js} +8669 -7851
  91. package/dist/useCompiledDocument-B21sVbb4.cjs.js +141 -0
  92. package/package.json +2 -2
  93. package/src/builder-entry.ts +9 -0
  94. package/src/components/AppDialog.tsx +23 -0
  95. package/src/components/Dashboard/DashboardGrid.tsx +39 -17
  96. package/src/components/Dashboard/DashboardTile.tsx +19 -2
  97. package/src/components/Dashboard/DashboardView.spec.tsx +216 -15
  98. package/src/components/Dashboard/DashboardView.tsx +137 -155
  99. package/src/components/Dashboard/RowsDialog.tsx +1 -2
  100. package/src/components/Dashboard/TileCard.tsx +28 -10
  101. package/src/components/Dashboard/defaultTileSpan.spec.ts +24 -0
  102. package/src/components/Dashboard/useStuck.ts +28 -17
  103. package/src/components/DocumentCreate/useDocumentChoices.ts +19 -2
  104. package/src/components/Package/NewDocumentDialog.spec.tsx +76 -59
  105. package/src/components/Package/NewDocumentDialog.tsx +383 -119
  106. package/src/components/Package/Package.artifacts.spec.tsx +1 -1
  107. package/src/components/Package/Package.create.spec.tsx +7 -6
  108. package/src/components/Package/Package.tsx +10 -7
  109. package/src/components/Package/PackageProblems.spec.tsx +41 -0
  110. package/src/components/Package/PackageProblems.tsx +95 -0
  111. package/src/components/Prose.tsx +12 -7
  112. package/src/components/RemoveBadge.tsx +94 -0
  113. package/src/components/RenderedResult/RenderedResult.tsx +5 -9
  114. package/src/components/RenderedResult/ResultPanel.tsx +59 -3
  115. package/src/components/Report/Report.spec.tsx +50 -32
  116. package/src/components/Report/Report.telemetry.spec.tsx +0 -45
  117. package/src/components/Report/Report.tsx +45 -77
  118. package/src/components/Report/ReportPage.tsx +168 -0
  119. package/src/components/Report/layoutRules.spec.ts +35 -0
  120. package/src/components/Report/layoutRules.ts +55 -0
  121. package/src/components/Report/reportQuery.ts +53 -0
  122. package/src/components/Report/telemetry.ts +0 -2
  123. package/src/components/ReportBuilder/AddTileDialog.spec.tsx +76 -41
  124. package/src/components/ReportBuilder/AddTileDialog.tsx +368 -133
  125. package/src/components/ReportBuilder/BuilderBar.tsx +599 -0
  126. package/src/components/ReportBuilder/BuilderDialogs.tsx +28 -39
  127. package/src/components/ReportBuilder/BuilderGrid.tsx +31 -29
  128. package/src/components/ReportBuilder/BuilderHeader.tsx +63 -75
  129. package/src/components/ReportBuilder/BuilderToolbar.tsx +95 -9
  130. package/src/components/ReportBuilder/DrillDialog.tsx +240 -128
  131. package/src/components/ReportBuilder/EditorSurface.tsx +345 -69
  132. package/src/components/ReportBuilder/FilterDialog.tsx +516 -166
  133. package/src/components/ReportBuilder/FilterStrip.tsx +130 -151
  134. package/src/components/ReportBuilder/InlineMarkdown.tsx +71 -45
  135. package/src/components/ReportBuilder/ReportBuilder.charts.spec.tsx +35 -40
  136. package/src/components/ReportBuilder/ReportBuilder.controls.spec.tsx +491 -0
  137. package/src/components/ReportBuilder/ReportBuilder.exit.spec.tsx +2 -4
  138. package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +13 -15
  139. package/src/components/ReportBuilder/ReportBuilder.notebook.spec.tsx +27 -118
  140. package/src/components/ReportBuilder/ReportBuilder.openDraft.spec.tsx +12 -5
  141. package/src/components/ReportBuilder/ReportBuilder.sources.spec.tsx +2 -10
  142. package/src/components/ReportBuilder/ReportBuilder.spec.tsx +37 -31
  143. package/src/components/ReportBuilder/ReportBuilder.textTiles.spec.tsx +22 -15
  144. package/src/components/ReportBuilder/ReportBuilder.tsx +292 -117
  145. package/src/components/ReportBuilder/ReportEditor.emptyStart.spec.tsx +2 -1
  146. package/src/components/ReportBuilder/ReportEditor.modelFilters.spec.tsx +312 -0
  147. package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +26 -75
  148. package/src/components/ReportBuilder/ReportEditor.package.spec.tsx +6 -2
  149. package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -2
  150. package/src/components/ReportBuilder/ReportEditor.spec.tsx +2 -4
  151. package/src/components/ReportBuilder/ReportEditor.textSource.spec.tsx +93 -13
  152. package/src/components/ReportBuilder/ReportEditor.tsx +104 -14
  153. package/src/components/ReportBuilder/TextTileBody.tsx +6 -7
  154. package/src/components/ReportBuilder/TileFrame.tsx +212 -75
  155. package/src/components/ReportBuilder/TileMenu.tsx +241 -140
  156. package/src/components/ReportBuilder/ViewPicker.tsx +349 -0
  157. package/src/components/ReportBuilder/addTile.compile.spec.ts +1 -1
  158. package/src/components/ReportBuilder/addTileToDocument.spec.ts +102 -3
  159. package/src/components/ReportBuilder/addTileToDocument.ts +122 -25
  160. package/src/components/ReportBuilder/builderControls.ts +164 -0
  161. package/src/components/ReportBuilder/builderReport.ts +1 -2
  162. package/src/components/ReportBuilder/catalog.ts +10 -26
  163. package/src/components/ReportBuilder/inlineEdit.tsx +22 -54
  164. package/src/components/ReportBuilder/localGiven.ts +56 -0
  165. package/src/components/ReportBuilder/preview.spec.ts +125 -5
  166. package/src/components/ReportBuilder/preview.ts +60 -44
  167. package/src/components/ReportBuilder/readDocument.spec.ts +16 -22
  168. package/src/components/ReportBuilder/readDocument.ts +14 -11
  169. package/src/components/ReportBuilder/readForEditor.spec.ts +12 -41
  170. package/src/components/ReportBuilder/readForEditor.ts +4 -26
  171. package/src/components/ReportBuilder/reportTag.ts +28 -7
  172. package/src/components/ReportBuilder/sortable.tsx +15 -7
  173. package/src/components/ReportBuilder/spliceDocument.imports.spec.ts +1 -1
  174. package/src/components/ReportBuilder/tagParse.spec.ts +0 -40
  175. package/src/components/ReportBuilder/testing/inline.ts +25 -5
  176. package/src/components/ReportBuilder/testing/reportLayoutParity.json +13 -8
  177. package/src/components/ReportBuilder/textTiles.spec.ts +7 -6
  178. package/src/components/ReportBuilder/useBuilderSelection.ts +35 -0
  179. package/src/components/ReportBuilder/useBuilderSession.spec.ts +2 -2
  180. package/src/components/ReportBuilder/useBuilderSession.ts +21 -13
  181. package/src/components/ReportBuilder/useDocumentEditor.spec.ts +0 -58
  182. package/src/components/ReportBuilder/useDocumentEditor.ts +3 -16
  183. package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +26 -0
  184. package/src/components/ReportBuilder/useEditorCatalog.ts +7 -2
  185. package/src/components/ReportBuilder/useExitGuard.ts +16 -0
  186. package/src/components/ReportBuilder/useFilterForm.spec.tsx +17 -0
  187. package/src/components/ReportBuilder/useFilterForm.ts +5 -1
  188. package/src/components/ReportBuilder/useOpenedDocument.ts +0 -2
  189. package/src/components/ReportBuilder/useReportDraft.spec.ts +149 -0
  190. package/src/components/ReportBuilder/useReportDraft.ts +292 -0
  191. package/src/components/ReportBuilder/useReportEditor.ts +3 -12
  192. package/src/components/ReportBuilder/useSaveChannel.ts +0 -1
  193. package/src/components/ReportBuilder/useTileEditing.ts +43 -12
  194. package/src/components/ReportBuilder/viewAnnotations.ts +29 -0
  195. package/src/components/ReportBuilder/widthLabel.spec.ts +25 -0
  196. package/src/components/ReportBuilder/widthLabel.ts +26 -0
  197. package/src/components/ServerProvider.tsx +11 -0
  198. package/src/components/controlTokens.ts +47 -0
  199. package/src/components/drill/markDrillableCells.ts +2 -1
  200. package/src/components/given/FilterButton.spec.tsx +143 -0
  201. package/src/components/given/FilterButton.tsx +478 -0
  202. package/src/components/given/GivenInput.spec.tsx +47 -0
  203. package/src/components/given/GivenInput.tsx +20 -2
  204. package/src/components/given/GivensPanel.spec.tsx +11 -3
  205. package/src/components/given/GivensPanel.tsx +45 -44
  206. package/src/components/given/filterEditing.ts +60 -0
  207. package/src/components/given/filterSummary.spec.ts +108 -0
  208. package/src/components/given/filterSummary.ts +109 -0
  209. package/src/components/given/paramCodec.ts +1 -1
  210. package/src/components/given/required.spec.ts +60 -0
  211. package/src/components/given/required.ts +78 -0
  212. package/src/components/index.ts +9 -0
  213. package/src/components/legacy/Dashboard.spec.tsx +3 -1
  214. package/src/components/legacy/index.ts +1 -1
  215. package/src/components/{Report/CellReport.spec.tsx → legacy/malloynb/CellRunnerView.spec.tsx} +53 -57
  216. package/src/components/{Report/CellReport.tsx → legacy/malloynb/CellRunnerView.tsx} +122 -136
  217. package/src/components/legacy/{MalloynbCells.tsx → malloynb/MalloynbCells.tsx} +6 -6
  218. package/src/components/legacy/{Notebook.layout.spec.tsx → malloynb/Notebook.layout.spec.tsx} +16 -7
  219. package/src/components/legacy/malloynb/Notebook.served.spec.tsx +84 -0
  220. package/src/components/legacy/{Notebook.spec.tsx → malloynb/Notebook.spec.tsx} +5 -3
  221. package/src/components/legacy/{Notebook.tsx → malloynb/Notebook.tsx} +9 -7
  222. package/src/components/{Notebook → legacy/malloynb}/NotebookCell.tsx +70 -150
  223. package/src/components/legacy/malloynb/cellKind.spec.ts +33 -0
  224. package/src/components/legacy/malloynb/cellKind.ts +24 -0
  225. package/src/components/{Notebook → legacy/malloynb}/types.ts +1 -1
  226. package/src/components/styles.ts +0 -18
  227. package/src/hooks/useGivensState.ts +7 -3
  228. package/src/hooks/useQueryResult.placeholder.spec.ts +44 -0
  229. package/src/hooks/useQueryResult.ts +26 -1
  230. package/src/theme/ThemeContext.tsx +21 -1
  231. package/src/theme/classes.ts +52 -0
  232. package/src/theme/index.ts +8 -0
  233. package/src/theme/resolveTheme.ts +3 -0
  234. package/src/theme/types.ts +7 -0
  235. package/src/theme/ui.spec.tsx +91 -0
  236. package/src/theme/ui.ts +115 -0
  237. package/dist/RenderedResult-BcgYjkZ0.cjs.js +0 -153
  238. package/dist/ServerProvider-B0dUY8be.cjs.js +0 -1
  239. package/dist/components/Notebook/cellKind.d.ts +0 -20
  240. package/dist/components/Report/LinearReport.d.ts +0 -18
  241. package/dist/components/ReportBuilder/SourceViewPicker.d.ts +0 -9
  242. package/dist/components/ReportBuilder/legacyNotebook.d.ts +0 -73
  243. package/dist/components/ReportBuilder/useConversionConfirm.d.ts +0 -20
  244. package/dist/useCompiledDocument-UY28ITET.cjs.js +0 -141
  245. package/src/components/Notebook/cellKind.spec.ts +0 -199
  246. package/src/components/Notebook/cellKind.ts +0 -74
  247. package/src/components/Report/LinearReport.tsx +0 -71
  248. package/src/components/ReportBuilder/SourceViewPicker.tsx +0 -122
  249. package/src/components/ReportBuilder/legacyNotebook.chart.spec.ts +0 -77
  250. package/src/components/ReportBuilder/legacyNotebook.convert.spec.ts +0 -626
  251. package/src/components/ReportBuilder/legacyNotebook.read.spec.ts +0 -338
  252. package/src/components/ReportBuilder/legacyNotebook.ts +0 -1122
  253. package/src/components/ReportBuilder/useConversionConfirm.ts +0 -55
  254. package/src/components/legacy/Notebook.served.spec.tsx +0 -183
  255. /package/dist/components/{Notebook → legacy/malloynb}/runPlan.d.ts +0 -0
  256. /package/src/components/{Notebook → legacy/malloynb}/runPlan.spec.ts +0 -0
  257. /package/src/components/{Notebook → legacy/malloynb}/runPlan.ts +0 -0
@@ -1,14 +1,22 @@
1
1
  /**
2
- * Whether a `position: sticky` bar is currently pinned, so it can draw an edge
3
- * only while content scrolls under it. Unpinned, the bar sits in the flow and
4
- * an edge would be a stray line between it and the first tile.
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
- * Watches a zero-height sentinel placed directly before the bar: once the
7
- * sentinel has scrolled out through the top, the bar is pinned. No explicit
8
- * root, so it works whichever ancestor scrolls — an observer with the implicit
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
- sentinelRef: (node: HTMLElement | null) => void;
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
- /** A grid report's tile chrome: `card` (default) or `none`. */
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, and a linear report written as
56
- * `run:` cells cell by cell, each through the governed query endpoint.
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 { PackageCatalog } from './catalog';
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
- export declare function AddTileDialog({ open, document, catalog, columns, onClose, onAdd, onAddText, }: AddTileDialogProps): import("react/jsx-runtime").JSX.Element;
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 conversion
11
- * question, the unsaved-changes guard and the add-tile picker.
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, confirmConversion, exitDialog, }: {
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, columns, notebook, chrome, canAdd, selected, flash, menuIndex, onSelect, onOpenMenu, openAdd, editTile, renderTile, }: {
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
- columns: number;
18
- notebook: boolean;
19
- chrome: TileChrome;
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 document's title, with the builder's actions on its line, and its
6
- * description beneath: both edited where they stand, as the reader sees them.
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, chrome, actions, descriptionSelected, selectDescription, }: {
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;
@@ -1,13 +1,11 @@
1
- import { Given } from '../../client';
2
1
  import { ReportLayout } from '../Package/documentLocation';
3
2
  import { DashboardDocument } from './document';
4
3
  import { SavesTo } from './documentSession';
5
4
  import { TextSourceOptions } from './ReportEditor';
6
5
  import { ReportEventHandler } from '../Report/telemetry';
7
- export declare function EditorSurface({ textSource, modelGivens, environmentName, packageName, modelPath, versionId, opened, replaces, onSave, onDirtyChange, onExit, allowLayoutChange, onEvent, savesTo, saveLabel, note, }: {
6
+ import { BuilderControlsHandler } from './builderControls';
7
+ export declare function EditorSurface({ textSource, environmentName, packageName, modelPath, versionId, opened, replaces, onSave, onDirtyChange, onExit, onOpenModel, onControlsChange, draftKey, allowLayoutChange, onEvent, savesTo, saveLabel, note, }: {
8
8
  textSource?: TextSourceOptions;
9
- /** The model's own givens, for a cell-format notebook whose manifest the server cannot build until it is saved. */
10
- modelGivens?: Given[];
11
9
  environmentName: string;
12
10
  packageName: string;
13
11
  modelPath: string;
@@ -17,17 +15,17 @@ export declare function EditorSurface({ textSource, modelGivens, environmentName
17
15
  opened: {
18
16
  source: string;
19
17
  document: DashboardDocument;
20
- conversion?: {
21
- from: string;
22
- to: string;
23
- };
24
18
  generation: number;
25
19
  };
26
20
  replaces?: string;
27
21
  /** Save the text, with the layout the document has as it is saved. */
28
22
  onSave?: (source: string, layout: ReportLayout) => Promise<void>;
29
- onDirtyChange: (dirty: boolean) => void;
23
+ onDirtyChange: (dirty: boolean, wouldLose: boolean) => void;
30
24
  onExit?: () => void;
25
+ onOpenModel?: (modelPath: string) => void;
26
+ onControlsChange?: BuilderControlsHandler;
27
+ /** Keep unsaved edits in this browser under this key; see `ReportBuilderProps.draftKey`. */
28
+ draftKey?: string;
31
29
  allowLayoutChange?: boolean;
32
30
  onEvent?: ReportEventHandler;
33
31
  savesTo: SavesTo;
@@ -34,6 +34,8 @@ export interface FilterDialogProps {
34
34
  control?: BuilderControl;
35
35
  /** Model givens not yet bound anywhere, offered as "from the model". */
36
36
  available: readonly BuilderControl[];
37
+ /** Names a new filter must not take, beyond the page's own and `available`'s. */
38
+ takenNames?: readonly string[];
37
39
  /**
38
40
  * The fields a binding on THIS tile may name: the dimensions of the source
39
41
  * it reads. Per tile, because a composite dashboard exists to span sources,
@@ -51,4 +53,4 @@ export interface FilterDialogProps {
51
53
  /** Take a control off the dashboard; offered for one this file declares. */
52
54
  onRemove: (given: string) => void;
53
55
  }
54
- export declare function FilterDialog({ open, document, control, available, fieldsFor, onClose, onApply, onRemove, }: FilterDialogProps): import("react/jsx-runtime").JSX.Element;
56
+ export declare function FilterDialog({ open, document, control, available, takenNames, fieldsFor, onClose, onApply, onRemove, }: FilterDialogProps): import("react/jsx-runtime").JSX.Element;
@@ -1,23 +1,45 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BuilderControl } from './controls';
3
3
  /**
4
- * The strip where the dashboard's controls are configured — the ONE place: a
5
- * chip per control opens its window, and "Add filter" beside them declares a
6
- * new one. The live control row the host renders sits under it.
4
+ * The builder's filter row: the ONE place a report's filters are used and
5
+ * configured. It is the reader's own row of filter buttons (the host's
6
+ * `children`), with the builder's editing added through
7
+ * {@link FilterEditingContext}: a remove badge on each button's corner, its
8
+ * settings from its popover, and "+ Filter" at the end. A filter no tile reads
9
+ * yet has no control in the reader's row, so it is drawn after the row's own,
10
+ * dashed and marked unused, and opens its settings.
11
+ *
12
+ * There used to be a second row above this one: a chip per filter, naming the
13
+ * same filters again, which is where they were edited. Two rows of look-alike
14
+ * things, each doing half the job, read as a duplicate.
15
+ *
16
+ * Without a live row (no server to run the controls), every filter is drawn
17
+ * as a settings button, so the file's filters can still be edited.
7
18
  */
8
- export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, addDisabledReason, onRemove, sticky, children, }: {
19
+ /** A filter the builder shows and sets but cannot change: why, and the model that sets it, if one does. */
20
+ export interface FixedFilter {
21
+ reason: string;
22
+ /** The model's package path, for "Open the model". */
23
+ modelPath?: string;
24
+ }
25
+ export declare function FilterStrip({ controls: controlList, unknownFieldsOf, onEdit, onAdd, addDisabledReason, onRemove, fixedFilters, onOpenModel, startingValues, onStartingValue, children, }: {
9
26
  controls: BuilderControl[];
10
- tileCount: number;
11
27
  /** Bindings a control has that its tiles' sources cannot take. */
12
28
  unknownFieldsOf: (name: string, type: string | undefined) => string[];
13
29
  onEdit: (control: BuilderControl) => void;
14
30
  onAdd: () => void;
15
- /** Why adding is off; set, the chip is disabled and its tooltip says why. */
31
+ /** Why adding is off; set, the add button is disabled and says why. */
16
32
  addDisabledReason?: string;
17
33
  /** Take a control off the dashboard, as its window's Remove does. */
18
34
  onRemove: (name: string) => void;
19
- /** Pin the strip to the top of the scroller: a grid's, not a linear report's. */
20
- sticky?: boolean;
35
+ /** Filters a tile reads other than through a binding, by name: why they are fixed here, and the model that sets one. */
36
+ fixedFilters?: ReadonlyMap<string, FixedFilter>;
37
+ /** Open a model by its package path, when the host can. */
38
+ onOpenModel?: (modelPath: string) => void;
39
+ /** The report's starting values (`givens { … }`), as the file spells them. */
40
+ startingValues?: Readonly<Record<string, string>>;
41
+ /** Set a filter's starting value, or drop it with undefined. */
42
+ onStartingValue?: (name: string, text: string | undefined) => void;
21
43
  /** The host's live control row. */
22
44
  children?: ReactNode;
23
45
  }): import("react/jsx-runtime").JSX.Element;