@malloy-publisher/sdk 0.9.2 → 0.9.4

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 (264) hide show
  1. package/dist/{RenderedResult-CBLHr32C.es.js → RenderedResult-DwB0-9Yx.es.js} +118 -119
  2. package/dist/{RenderedResult-B48wAjM8.cjs.js → RenderedResult-hKjFEqaN.cjs.js} +2 -2
  3. package/dist/{ServerProvider-DCV8BUWD.es.js → ServerProvider-CcSrGaRN.es.js} +1281 -1142
  4. package/dist/ServerProvider-Gbf1YPOP.cjs.js +1 -0
  5. package/dist/builder/index.cjs.js +112 -115
  6. package/dist/builder/index.es.js +11766 -11502
  7. package/dist/builder-entry.d.ts +1 -1
  8. package/dist/client/api.d.ts +170 -9
  9. package/dist/client/index.cjs.js +1 -1
  10. package/dist/client/index.es.js +93 -89
  11. package/dist/client-entry.d.ts +2 -0
  12. package/dist/components/ApiErrorDisplay.d.ts +11 -0
  13. package/dist/components/AppDialog.d.ts +6 -6
  14. package/dist/components/Dashboard/DashboardGrid.d.ts +18 -3
  15. package/dist/components/Dashboard/DashboardTile.d.ts +12 -2
  16. package/dist/components/Dashboard/DashboardView.d.ts +38 -3
  17. package/dist/components/Dashboard/TileCard.d.ts +16 -2
  18. package/dist/components/Dashboard/dropValueUrlTags.d.ts +6 -0
  19. package/dist/components/Dashboard/index.d.ts +3 -2
  20. package/dist/components/Dashboard/telemetry.d.ts +2 -1
  21. package/dist/components/Dashboard/textSource.d.ts +19 -0
  22. package/dist/components/DashboardBuilder/AddTileDialog.d.ts +7 -8
  23. package/dist/components/DashboardBuilder/BuilderDialogs.d.ts +25 -0
  24. package/dist/components/DashboardBuilder/BuilderGrid.d.ts +31 -0
  25. package/dist/components/DashboardBuilder/BuilderHeader.d.ts +17 -0
  26. package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +14 -17
  27. package/dist/components/DashboardBuilder/ChartPicker.d.ts +3 -1
  28. package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +15 -7
  29. package/dist/components/DashboardBuilder/DashboardEditor.d.ts +28 -2
  30. package/dist/components/DashboardBuilder/EditorSurface.d.ts +33 -0
  31. package/dist/components/DashboardBuilder/FilterStrip.d.ts +6 -4
  32. package/dist/components/DashboardBuilder/InlineText.d.ts +1 -1
  33. package/dist/components/DashboardBuilder/NotebookEditor.d.ts +1 -1
  34. package/dist/components/DashboardBuilder/TextTileBody.d.ts +4 -1
  35. package/dist/components/DashboardBuilder/TileFrame.d.ts +43 -6
  36. package/dist/components/DashboardBuilder/TileMenu.d.ts +6 -8
  37. package/dist/components/DashboardBuilder/builderReport.d.ts +13 -0
  38. package/dist/components/DashboardBuilder/catalog.d.ts +0 -18
  39. package/dist/components/DashboardBuilder/documentSession.d.ts +2 -2
  40. package/dist/components/DashboardBuilder/imports.d.ts +19 -0
  41. package/dist/components/DashboardBuilder/inlineEdit.d.ts +18 -0
  42. package/dist/components/DashboardBuilder/readDocument.d.ts +3 -1
  43. package/dist/components/DashboardBuilder/readForEditor.d.ts +1 -1
  44. package/dist/components/DashboardBuilder/sortable.d.ts +2 -0
  45. package/dist/components/DashboardBuilder/spliceDocument.d.ts +2 -0
  46. package/dist/components/DashboardBuilder/testing/resize.d.ts +7 -0
  47. package/dist/components/DashboardBuilder/tileDisplayTitle.d.ts +7 -0
  48. package/dist/components/DashboardBuilder/useBuilderSelection.d.ts +53 -0
  49. package/dist/components/DashboardBuilder/useBuilderSession.d.ts +4 -7
  50. package/dist/components/DashboardBuilder/useControlBindings.d.ts +30 -0
  51. package/dist/components/DashboardBuilder/useConversionConfirm.d.ts +20 -0
  52. package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +2 -0
  53. package/dist/components/DashboardBuilder/useDraft.d.ts +3 -1
  54. package/dist/components/DashboardBuilder/useHostCopy.d.ts +26 -0
  55. package/dist/components/DashboardBuilder/useOpenDraftCommit.d.ts +17 -0
  56. package/dist/components/DashboardBuilder/useOpenedDocument.d.ts +71 -0
  57. package/dist/components/DashboardBuilder/useSaveChannel.d.ts +50 -0
  58. package/dist/components/DashboardBuilder/useTileEditing.d.ts +33 -0
  59. package/dist/components/DashboardBuilder/useTileResize.d.ts +32 -0
  60. package/dist/components/Loading.d.ts +13 -0
  61. package/dist/components/Notebook/NotebookCell.d.ts +1 -5
  62. package/dist/components/Package/Package.d.ts +16 -1
  63. package/dist/components/Package/index.d.ts +1 -1
  64. package/dist/components/Prose.d.ts +1 -1
  65. package/dist/components/RenderedResult/loadRenderer.d.ts +7 -0
  66. package/dist/components/given/paramCodec.d.ts +8 -1
  67. package/dist/components/index.d.ts +1 -2
  68. package/dist/components/styles.d.ts +4 -4
  69. package/dist/hooks/givenValue.d.ts +6 -0
  70. package/dist/hooks/index.d.ts +1 -0
  71. package/dist/hooks/useCompiledDocument.d.ts +23 -0
  72. package/dist/hooks/useDocumentControls.d.ts +6 -1
  73. package/dist/hooks/useNearViewport.d.ts +16 -0
  74. package/dist/hooks/useQueryWithApiError.d.ts +7 -2
  75. package/dist/hooks/useSuggestOptions.d.ts +9 -2
  76. package/dist/index.cjs.js +14 -14
  77. package/dist/index.es.js +9760 -10363
  78. package/dist/text/index.es.js +1 -1
  79. package/dist/{text-entry-CbbBcZl8.es.js → text-entry-CA0LZ1xL.es.js} +8 -8
  80. package/dist/text-entry.d.ts +1 -1
  81. package/dist/theme/accent.d.ts +29 -0
  82. package/dist/theme/buildVegaThemeOverride.d.ts +3 -3
  83. package/dist/theme/index.d.ts +3 -0
  84. package/dist/theme/keys.d.ts +1 -1
  85. package/dist/theme/motion.d.ts +31 -0
  86. package/dist/theme/readChartAnnotations.d.ts +1 -1
  87. package/dist/theme/resolveTheme.d.ts +4 -4
  88. package/dist/theme/types.d.ts +33 -5
  89. package/dist/{DashboardTile-BFcxdv7R.es.js → useCompiledDocument-BU6d8FPp.es.js} +6978 -6289
  90. package/dist/useCompiledDocument-pOg2W-Yt.cjs.js +142 -0
  91. package/package.json +11 -11
  92. package/src/builder-entry.ts +1 -0
  93. package/src/client-entry.ts +8 -0
  94. package/src/clientEntry.spec.ts +17 -0
  95. package/src/components/ApiErrorDisplay.tsx +37 -18
  96. package/src/components/AppDialog.tsx +8 -7
  97. package/src/components/Dashboard/Dashboard.spec.tsx +3 -32
  98. package/src/components/Dashboard/Dashboard.tsx +2 -2
  99. package/src/components/Dashboard/DashboardGrid.tsx +23 -5
  100. package/src/components/Dashboard/DashboardTile.spec.tsx +97 -2
  101. package/src/components/Dashboard/DashboardTile.tsx +95 -31
  102. package/src/components/Dashboard/DashboardView.spec.tsx +156 -0
  103. package/src/components/Dashboard/DashboardView.tsx +165 -89
  104. package/src/components/Dashboard/RowsDialog.tsx +3 -2
  105. package/src/components/Dashboard/TileCard.tsx +17 -2
  106. package/src/components/Dashboard/dropValueUrlTags.spec.ts +177 -0
  107. package/src/components/Dashboard/dropValueUrlTags.ts +108 -0
  108. package/src/components/Dashboard/index.ts +11 -2
  109. package/src/components/Dashboard/telemetry.ts +2 -1
  110. package/src/components/Dashboard/textSource.spec.ts +36 -0
  111. package/src/components/Dashboard/textSource.ts +39 -0
  112. package/src/components/DashboardBuilder/AddTileDialog.tsx +16 -56
  113. package/src/components/DashboardBuilder/BuilderDialogs.tsx +162 -0
  114. package/src/components/DashboardBuilder/BuilderGrid.tsx +245 -0
  115. package/src/components/DashboardBuilder/BuilderHeader.tsx +107 -0
  116. package/src/components/DashboardBuilder/BuilderToolbar.tsx +86 -113
  117. package/src/components/DashboardBuilder/ChartPicker.tsx +4 -1
  118. package/src/components/DashboardBuilder/DashboardBuilder.charts.spec.tsx +5 -5
  119. package/src/components/DashboardBuilder/DashboardBuilder.exit.spec.tsx +74 -83
  120. package/src/components/DashboardBuilder/DashboardBuilder.inline.spec.tsx +62 -18
  121. package/src/components/DashboardBuilder/DashboardBuilder.notebook.spec.tsx +55 -108
  122. package/src/components/DashboardBuilder/DashboardBuilder.openDraft.spec.tsx +10 -62
  123. package/src/components/DashboardBuilder/DashboardBuilder.sources.spec.tsx +50 -57
  124. package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +53 -40
  125. package/src/components/DashboardBuilder/DashboardBuilder.textTiles.spec.tsx +10 -8
  126. package/src/components/DashboardBuilder/DashboardBuilder.tsx +227 -704
  127. package/src/components/DashboardBuilder/DashboardEditor.authoritative.spec.tsx +32 -52
  128. package/src/components/DashboardBuilder/DashboardEditor.emptyStart.spec.tsx +1 -50
  129. package/src/components/DashboardBuilder/DashboardEditor.notebook.spec.tsx +12 -18
  130. package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +4 -24
  131. package/src/components/DashboardBuilder/DashboardEditor.resourceUri.spec.tsx +4 -4
  132. package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +8 -13
  133. package/src/components/DashboardBuilder/DashboardEditor.textSource.spec.tsx +317 -0
  134. package/src/components/DashboardBuilder/DashboardEditor.tsx +142 -820
  135. package/src/components/DashboardBuilder/DrillDialog.tsx +2 -2
  136. package/src/components/DashboardBuilder/EditorSurface.tsx +471 -0
  137. package/src/components/DashboardBuilder/FilterDialog.tsx +13 -8
  138. package/src/components/DashboardBuilder/FilterStrip.tsx +117 -79
  139. package/src/components/DashboardBuilder/InlineMarkdown.tsx +7 -9
  140. package/src/components/DashboardBuilder/InlineText.tsx +23 -17
  141. package/src/components/DashboardBuilder/NotebookEditor.tsx +3 -3
  142. package/src/components/DashboardBuilder/TextTileBody.tsx +5 -2
  143. package/src/components/DashboardBuilder/TileFrame.tsx +255 -90
  144. package/src/components/DashboardBuilder/TileMenu.tsx +41 -91
  145. package/src/components/DashboardBuilder/artifactBlock.spec.ts +1 -1
  146. package/src/components/DashboardBuilder/artifactTagParity.spec.ts +9 -4
  147. package/src/components/DashboardBuilder/builderReport.ts +74 -0
  148. package/src/components/DashboardBuilder/catalog.spec.ts +0 -44
  149. package/src/components/DashboardBuilder/catalog.ts +0 -36
  150. package/src/components/DashboardBuilder/controls.spec.ts +1 -1
  151. package/src/components/DashboardBuilder/controls.ts +1 -1
  152. package/src/components/DashboardBuilder/documentSession.ts +3 -2
  153. package/src/components/DashboardBuilder/imports.spec.ts +61 -0
  154. package/src/components/DashboardBuilder/imports.ts +93 -0
  155. package/src/components/DashboardBuilder/inlineEdit.tsx +78 -0
  156. package/src/components/DashboardBuilder/legacyNotebook.ts +1 -1
  157. package/src/components/DashboardBuilder/malloyTree.ts +5 -1
  158. package/src/components/DashboardBuilder/newDashboard.ts +1 -1
  159. package/src/components/DashboardBuilder/preview.ts +1 -1
  160. package/src/components/DashboardBuilder/readDocument.spec.ts +36 -0
  161. package/src/components/DashboardBuilder/readDocument.ts +10 -4
  162. package/src/components/DashboardBuilder/readForEditor.ts +7 -2
  163. package/src/components/DashboardBuilder/sortable.spec.ts +25 -1
  164. package/src/components/DashboardBuilder/sortable.tsx +11 -0
  165. package/src/components/DashboardBuilder/spliceDocument.ts +8 -3
  166. package/src/components/DashboardBuilder/testing/artifactTagParity.json +62 -6
  167. package/src/components/DashboardBuilder/testing/documentKindRule.json +40 -0
  168. package/src/components/DashboardBuilder/testing/inline.ts +1 -1
  169. package/src/components/DashboardBuilder/testing/resize.ts +48 -0
  170. package/src/components/DashboardBuilder/testing/urlRenderTags.json +62 -0
  171. package/src/components/DashboardBuilder/textTiles.spec.ts +43 -1
  172. package/src/components/DashboardBuilder/tileDisplayTitle.ts +13 -0
  173. package/src/components/DashboardBuilder/useBuilderSelection.ts +121 -0
  174. package/src/components/DashboardBuilder/useBuilderSession.spec.ts +0 -85
  175. package/src/components/DashboardBuilder/useBuilderSession.ts +6 -43
  176. package/src/components/DashboardBuilder/useBuilderShortcuts.overlay.spec.tsx +32 -0
  177. package/src/components/DashboardBuilder/useBuilderShortcuts.ts +11 -1
  178. package/src/components/DashboardBuilder/useControlBindings.ts +152 -0
  179. package/src/components/DashboardBuilder/useConversionConfirm.ts +55 -0
  180. package/src/components/DashboardBuilder/useDashboardEditor.ts +5 -2
  181. package/src/components/DashboardBuilder/useDraft.ts +15 -2
  182. package/src/components/DashboardBuilder/useHostCopy.ts +104 -0
  183. package/src/components/DashboardBuilder/useOpenDraftCommit.ts +47 -0
  184. package/src/components/DashboardBuilder/useOpenedDocument.ts +314 -0
  185. package/src/components/DashboardBuilder/useSaveChannel.ts +275 -0
  186. package/src/components/DashboardBuilder/useTileEditing.ts +141 -0
  187. package/src/components/DashboardBuilder/useTileResize.spec.tsx +146 -0
  188. package/src/components/DashboardBuilder/useTileResize.ts +133 -0
  189. package/src/components/DataAppViewer/DataAppViewer.tsx +7 -4
  190. package/src/components/DocumentCreate/guards.ts +1 -1
  191. package/src/components/Environment/Environment.tsx +0 -10
  192. package/src/components/Loading.tsx +14 -0
  193. package/src/components/Model/Model.tsx +16 -9
  194. package/src/components/Model/ModelExplorer.tsx +2 -2
  195. package/src/components/Notebook/Notebook.tsx +6 -2
  196. package/src/components/Notebook/NotebookCell.tsx +90 -215
  197. package/src/components/Package/Package.artifacts.spec.tsx +8 -12
  198. package/src/components/Package/Package.create.spec.tsx +22 -1
  199. package/src/components/Package/Package.tsx +51 -27
  200. package/src/components/Package/index.ts +1 -1
  201. package/src/components/Prose.spec.tsx +37 -0
  202. package/src/components/Prose.tsx +35 -5
  203. package/src/components/RenderedResult/RenderedResult.tsx +5 -7
  204. package/src/components/RenderedResult/ResultContainer.tsx +7 -2
  205. package/src/components/RenderedResult/ResultPanel.tsx +20 -5
  206. package/src/components/RenderedResult/loadRenderer.ts +42 -0
  207. package/src/components/given/GivenInput.spec.tsx +5 -5
  208. package/src/components/given/GivenInput.tsx +46 -38
  209. package/src/components/given/GivensPanel.tsx +2 -8
  210. package/src/components/given/paramCodec.ts +27 -1
  211. package/src/components/index.ts +1 -2
  212. package/src/components/styles.ts +4 -5
  213. package/src/hooks/givenValue.ts +9 -0
  214. package/src/hooks/index.ts +4 -0
  215. package/src/hooks/useCompiledDocument.spec.tsx +86 -0
  216. package/src/hooks/useCompiledDocument.ts +59 -0
  217. package/src/hooks/useDimensionalFilterRangeData.ts +3 -1
  218. package/src/hooks/useDocumentControls.ts +13 -1
  219. package/src/hooks/useNearViewport.spec.tsx +150 -0
  220. package/src/hooks/useNearViewport.ts +102 -0
  221. package/src/hooks/useQueryResult.ts +7 -1
  222. package/src/hooks/useQueryWithApiError.ts +10 -3
  223. package/src/hooks/useRawQueryData.ts +3 -1
  224. package/src/hooks/useSuggestOptions.dom.spec.ts +40 -1
  225. package/src/hooks/useSuggestOptions.ts +42 -10
  226. package/src/text-entry.ts +1 -1
  227. package/src/textEntry.spec.ts +2 -8
  228. package/src/theme/accent.spec.ts +116 -0
  229. package/src/theme/accent.ts +148 -0
  230. package/src/theme/buildTableCssVars.spec.ts +24 -0
  231. package/src/theme/buildTableCssVars.ts +1 -2
  232. package/src/theme/buildVegaThemeOverride.spec.ts +38 -2
  233. package/src/theme/buildVegaThemeOverride.ts +5 -5
  234. package/src/theme/defaults.ts +34 -0
  235. package/src/theme/index.ts +9 -0
  236. package/src/theme/keys.ts +6 -0
  237. package/src/theme/motion.ts +44 -0
  238. package/src/theme/readChartAnnotations.spec.ts +18 -0
  239. package/src/theme/readChartAnnotations.ts +1 -1
  240. package/src/theme/resolveTheme.spec.ts +73 -0
  241. package/src/theme/resolveTheme.ts +61 -20
  242. package/src/theme/types.ts +30 -5
  243. package/src/utils/queryClient.ts +8 -0
  244. package/dist/DashboardTile-sg8LjUk8.cjs.js +0 -137
  245. package/dist/ServerProvider-HRqT3w1C.cjs.js +0 -1
  246. package/dist/components/Dashboard/DashboardBar.d.ts +0 -21
  247. package/dist/components/Dashboard/ExploreDialog.d.ts +0 -20
  248. package/dist/components/DashboardBuilder/DiffDialog.d.ts +0 -7
  249. package/dist/components/DashboardBuilder/SaveNotice.d.ts +0 -27
  250. package/dist/components/DashboardBuilder/SettingsPopover.d.ts +0 -32
  251. package/dist/components/DashboardBuilder/diff.d.ts +0 -35
  252. package/src/components/Dashboard/DashboardBar.tsx +0 -88
  253. package/src/components/Dashboard/ExploreDialog.tsx +0 -89
  254. package/src/components/DashboardBuilder/DashboardBuilder.notice.spec.tsx +0 -194
  255. package/src/components/DashboardBuilder/DiffDialog.spec.tsx +0 -25
  256. package/src/components/DashboardBuilder/DiffDialog.tsx +0 -103
  257. package/src/components/DashboardBuilder/SaveNotice.tsx +0 -113
  258. package/src/components/DashboardBuilder/SettingsPopover.spec.tsx +0 -87
  259. package/src/components/DashboardBuilder/SettingsPopover.tsx +0 -326
  260. package/src/components/DashboardBuilder/diff.spec.ts +0 -44
  261. package/src/components/DashboardBuilder/diff.ts +0 -93
  262. /package/dist/{components/DashboardBuilder → utils}/malloyText.d.ts +0 -0
  263. /package/src/{components/DashboardBuilder → utils}/malloyText.spec.ts +0 -0
  264. /package/src/{components/DashboardBuilder → utils}/malloyText.ts +0 -0
@@ -9,16 +9,16 @@ import * as React from "react";
9
9
  * with the same padding every time — a text Cancel and a filled confirm, the
10
10
  * two roles `buttons.tsx` names.
11
11
  *
12
- * Three dialogs stay off it deliberately, and each needs something this does
13
- * not have: `ModelExplorerDialog` is `fullScreen`, and `RowsDialog` and
14
- * `MaterializationDetailDialog` title themselves with a node rather than a
15
- * string. Widening this for three callers would cost more than it saves —
16
- * but a fourth exception is a reason to widen it, not to hand-roll a fourth.
12
+ * `ModelExplorerDialog` stays off it deliberately: it is `fullScreen`. The
13
+ * title takes a node as well as a string, so a dialog that titles itself with
14
+ * more than text (`RowsDialog`, `MaterializationDetailDialog`) can move onto
15
+ * this rather than hand-roll its own close button and type.
17
16
  */
18
17
  export declare function AppDialog({ open, onClose, title, description, maxWidth, showClose, actions, children, }: {
19
18
  open: boolean;
20
19
  onClose: () => void;
21
- title: string;
20
+ /** The heading. A string in the common case; a node when it needs more. */
21
+ title: React.ReactNode;
22
22
  /** What the dialog is for, in a line. The page's description, in a box. */
23
23
  description?: React.ReactNode;
24
24
  maxWidth?: "xs" | "sm" | "md" | "lg" | false;
@@ -5,8 +5,6 @@ export declare const DEFAULT_COLUMNS = 2;
5
5
  export declare const MAX_COLUMNS = 24;
6
6
  /** A tile's width after an arrow nudge, held to the grid and to what the builder offers. */
7
7
  export declare const nudgedSpan: (current: number, delta: 1 | -1, columns: number) => number;
8
- /** A tile's width for a width preset: a share of the grid, held to what the builder offers. */
9
- export declare const presetSpan: (columns: number, share: number) => number;
10
8
  /**
11
9
  * The gutter between tiles, in px.
12
10
  *
@@ -15,6 +13,21 @@ export declare const presetSpan: (columns: number, share: number) => number;
15
13
  * on the same gutters the grid paints.
16
14
  */
17
15
  export declare const GRID_GAP_PX = 16;
16
+ /**
17
+ * The space between a notebook's tiles, which stack in one column with no card
18
+ * around them: wider than a dashboard's gap so the reading flow breathes, and
19
+ * so the builder's selection ring, drawn {@link BARE_RING_OFFSET_PX} clear of
20
+ * a bare tile, never meets the next tile's.
21
+ */
22
+ export declare const NOTEBOOK_GAP_PX = 40;
23
+ /** How far a bare (uncarded) tile's selection ring sits from its content. */
24
+ export declare const BARE_RING_OFFSET_PX = 12;
25
+ /**
26
+ * The space above and below a notebook's description, in both modes: a bare
27
+ * description's ring in the builder is {@link BARE_RING_OFFSET_PX} clear of
28
+ * its text, and needs the room to stay clear of the title and the filters.
29
+ */
30
+ export declare const BARE_DESCRIPTION_MARGIN_PX: number;
18
31
  /**
19
32
  * The `grid-column` one tile occupies: its `# colspan`, and a `# break` forcing
20
33
  * it to start a fresh row.
@@ -64,7 +77,7 @@ export interface GridTile {
64
77
  * builder wraps one in its selection outline. Anything this component rendered
65
78
  * on their behalf would be a third opinion about what a tile looks like.
66
79
  */
67
- export declare function DashboardGrid<T extends GridTile>({ tiles, columns, keyOf, renderTile, minTilePx, }: {
80
+ export declare function DashboardGrid<T extends GridTile>({ tiles, columns, keyOf, renderTile, minTilePx, rowGapPx, }: {
68
81
  tiles: readonly T[];
69
82
  /** Track count — `# dashboard { columns=N }`, or {@link DEFAULT_COLUMNS}. */
70
83
  columns: number;
@@ -81,4 +94,6 @@ export declare function DashboardGrid<T extends GridTile>({ tiles, columns, keyO
81
94
  * builder assumes an unset colspan is one column.
82
95
  */
83
96
  minTilePx?: number;
97
+ /** The space between rows; a notebook's is {@link NOTEBOOK_GAP_PX}. */
98
+ rowGapPx?: number;
84
99
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,4 @@
1
- import { GivenValue } from '../../hooks/givenValue';
1
+ import { GivenValue, HostGivenValue } from '../../hooks/givenValue';
2
2
  import { DrillBinding } from '../drill';
3
3
  import { TileChrome, TileHeadingSlots } from './TileCard';
4
4
  export interface DashboardTileProps {
@@ -28,6 +28,8 @@ export interface DashboardTileProps {
28
28
  * does.
29
29
  */
30
30
  givens: Map<string, GivenValue>;
31
+ /** Givens the host sets with no control, which may be lists; narrowed by `givenNames` like `givens`. */
32
+ hostGivens?: Readonly<Record<string, HostGivenValue>>;
31
33
  /** Declared type per given name, which decides how a value is encoded. */
32
34
  declaredTypes: ReadonlyMap<string, string | undefined>;
33
35
  /**
@@ -49,6 +51,14 @@ export interface DashboardTileProps {
49
51
  chrome?: TileChrome;
50
52
  /** Labels of the page's filters this tile ignores, shown as a warning chip. */
51
53
  ignoredFilters?: readonly string[];
54
+ /**
55
+ * Text-source mode: the document's definitions, sent ahead of the tile's
56
+ * `run:` so the tile runs as the viewer's own text. Absent, the tile runs
57
+ * the model's view by expression as it always has.
58
+ */
59
+ preamble?: string;
60
+ /** The server marked this tile unreadable for the viewer: nothing is run. */
61
+ restricted?: boolean;
52
62
  }
53
63
  /**
54
64
  * A composite tile's heading when the view it names carries no `# label`: the
@@ -68,4 +78,4 @@ export declare function tileTitle(tile: string): string;
68
78
  * tile: the broken one shows its error in place and the rest of the grid still
69
79
  * renders, rather than one failure blanking the page.
70
80
  */
71
- export declare function DashboardTile({ environmentName, packageName, versionId, modelPath, queryName, tile, annotation, label, subtitle, heading, borderless, givens, declaredTypes, givenNames, height, maxResultSize, drill, onExplore, chrome, ignoredFilters, }: DashboardTileProps): import("react/jsx-runtime").JSX.Element;
81
+ export declare function DashboardTile({ environmentName, packageName, versionId, modelPath, queryName, tile, annotation, label, subtitle, heading, borderless, givens, hostGivens, declaredTypes, givenNames, height, maxResultSize, drill, onExplore, chrome, ignoredFilters, preamble, restricted, }: DashboardTileProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,16 @@
1
1
  import { DashboardManifest } from '../../client';
2
+ import { HostGivenValue } from '../../hooks/givenValue';
2
3
  import { DrillNavigation } from '../drill';
4
+ import { GivensLayout } from '../given';
3
5
  import { DashboardEventHandler } from './telemetry';
4
6
  import { TileChrome } from './TileCard';
7
+ /**
8
+ * The sticky control row's stacking level: above anything a tile raises
9
+ * inside itself as it scrolls under (a result's floating buttons sit at 1–2),
10
+ * and below MUI's app bar, popovers and dialogs. Shared so the builder's
11
+ * control row sits at the same level as the reader's.
12
+ */
13
+ export declare const STICKY_CONTROLS_Z = 4;
5
14
  export interface DashboardViewProps {
6
15
  /** The dashboard, or the tile layout a layout notebook carries. */
7
16
  manifest: DashboardManifest;
@@ -10,7 +19,12 @@ export interface DashboardViewProps {
10
19
  versionId?: string;
11
20
  /** The slug or path the manifest was fetched under, which keys its control edits. */
12
21
  documentName: string;
13
- givens?: Record<string, string>;
22
+ /**
23
+ * The host's values, typically its URL query parameters. A string drives a
24
+ * control; a value no control declares is sent as given to the tiles that
25
+ * read it, and only there may it be a list.
26
+ */
27
+ givens?: Record<string, HostGivenValue>;
14
28
  onGivensChange?: (givens: Record<string, string>, managed: readonly string[]) => void;
15
29
  onNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
16
30
  height?: number;
@@ -18,6 +32,21 @@ export interface DashboardViewProps {
18
32
  onEvent?: DashboardEventHandler;
19
33
  /** `none` renders tiles as a document, with no cards or title block. */
20
34
  chrome?: TileChrome;
35
+ /**
36
+ * How the control row is drawn: `bar` for a dashboard, `panel` for a
37
+ * notebook, so a layout notebook's controls match a cell notebook's.
38
+ */
39
+ controlsLayout?: GivensLayout;
40
+ /**
41
+ * Text-source mode: the document's definitions (see `documentPreamble`),
42
+ * sent ahead of each tile's `run:` so every query runs as the viewer's own
43
+ * text. Rows, which reopens a tile by name, is off in this mode.
44
+ */
45
+ preamble?: string;
46
+ /** Text-source mode: the model the text runs on top of, in place of `manifest.path`. */
47
+ runModelPath?: string;
48
+ /** Givens the host sets itself: no control is shown for them. */
49
+ hiddenGivens?: readonly string[];
21
50
  }
22
51
  /**
23
52
  * A loaded dashboard manifest, drawn: the control row and the tile grid.
@@ -25,12 +54,18 @@ export interface DashboardViewProps {
25
54
  * Split from the manifest fetch so a notebook written as a tile layout, whose
26
55
  * manifest arrives inside the notebook response, renders through the same code.
27
56
  */
28
- export declare function DashboardView({ manifest, environmentName, packageName, versionId, documentName, givens, onGivensChange, onNavigate, height, maxResultSize, onEvent, chrome, }: DashboardViewProps): import("react/jsx-runtime").JSX.Element;
57
+ export declare function DashboardView({ manifest, environmentName, packageName, versionId, documentName, givens, onGivensChange, onNavigate, height, maxResultSize, onEvent, chrome, controlsLayout, preamble, runModelPath, hiddenGivens, }: DashboardViewProps): import("react/jsx-runtime").JSX.Element;
29
58
  /**
30
59
  * The prose header over just the two fields it needs, so the BUILDER can draw
31
60
  * the same header over a `DashboardDocument`, which is not a manifest.
61
+ *
62
+ * The description is drawn as a text tile is, in the document's own tile
63
+ * chrome: the same box and the same type as the markdown between the tiles,
64
+ * so the page's prose reads as one kind of thing wherever it sits.
32
65
  */
33
- export declare function DashboardProse({ title, description, }: {
66
+ export declare function DashboardProse({ title, description, chrome, }: {
34
67
  title: string;
35
68
  description?: string;
69
+ /** The chrome the document's tiles take, which the description matches. */
70
+ chrome?: TileChrome;
36
71
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,17 @@
1
1
  import { SxProps, Theme } from '@mui/material';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, Ref } from 'react';
3
3
  /** `card` is a dashboard tile's panel; `none` is a notebook's bare flow. */
4
4
  export type TileChrome = "card" | "none";
5
+ /**
6
+ * The least a carded tile is drawn at, by kind: a query tile holds a spinner
7
+ * and then a result, so it keeps room for one; a text tile holds a line or two
8
+ * of prose and is no taller than its text needs, past a floor that keeps a
9
+ * one-word tile from reading as a sliver. A bare (`none`) tile has no floor.
10
+ */
11
+ export declare const TILE_MIN_HEIGHT: {
12
+ readonly query: 120;
13
+ readonly text: 72;
14
+ };
5
15
  /**
6
16
  * The card a dashboard tile sits in, and nothing else — so the builder, which
7
17
  * draws a stand-in tile when it has no server to run one, draws the same card
@@ -30,11 +40,15 @@ export type TileChrome = "card" | "none";
30
40
  * narrow below the chart it holds so the renderer redraws the chart to fit.
31
41
  * See the `minWidth: 0` note in `DashboardGrid` for the rest of that chain.
32
42
  */
33
- export declare function TileCard({ borderless, chrome, sx, children, }: {
43
+ export declare function TileCard({ borderless, chrome, kind, sx, cardRef, children, }: {
34
44
  borderless?: boolean;
45
+ /** What the tile holds, which sets its {@link TILE_MIN_HEIGHT}. */
46
+ kind?: keyof typeof TILE_MIN_HEIGHT;
35
47
  /** `none` drops the card entirely, for a document that reads top to bottom. */
36
48
  chrome?: TileChrome;
37
49
  sx?: SxProps<Theme>;
50
+ /** The card's element, for a caller that watches where it is on the page. */
51
+ cardRef?: Ref<HTMLDivElement>;
38
52
  children: ReactNode;
39
53
  }): import("react/jsx-runtime").JSX.Element;
40
54
  /** The heading's text as nodes, for a surface that makes it editable in place. */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The result with every `# image`, `# link` and HTML-bearing `# label` removed
3
+ * from its annotations; the input string untouched when there is none or it is
4
+ * not JSON, for the renderer to report.
5
+ */
6
+ export declare function dropValueUrlTags(result: string): string;
@@ -1,7 +1,8 @@
1
1
  export { Dashboard, type DashboardProps } from './Dashboard';
2
- export { DashboardView, type DashboardViewProps } from './DashboardView';
2
+ export { DashboardView, STICKY_CONTROLS_Z, type DashboardViewProps, } from './DashboardView';
3
3
  export { TileFilterTag, tileIgnoredFilterLabels } from './TileFilterTag';
4
4
  export { DashboardTile, type DashboardTileProps } from './DashboardTile';
5
+ export { documentPreamble, RESTRICTED_NOTICE, withPreamble, } from './textSource';
5
6
  export type { DashboardEvent, DashboardEventHandler } from './telemetry';
6
- export { TileCard, TileHeading } from './TileCard';
7
+ export { TILE_MIN_HEIGHT, TileCard, TileHeading } from './TileCard';
7
8
  export type { TileHeadingSlots } from './TileCard';
@@ -1,5 +1,6 @@
1
- import { SavesTo } from '../DashboardBuilder/documentSession';
2
1
  import { DashboardCreatedEvent } from '../DocumentCreate/events';
2
+ /** Where a host's Save lands, as an editor's events report it. */
3
+ export type SavesTo = "package" | "browser" | "host";
3
4
  /**
4
5
  * What a dashboard surface reports about itself, for the host to log or
5
6
  * count: the operations that matter (open, save, the rows behind a value,
@@ -0,0 +1,19 @@
1
+ import { NotebookCell } from '../../client';
2
+ /**
3
+ * Text-source mode: the document is a string the host keeps, and every query
4
+ * it runs is that document's own definitions followed by one `run:`, sent as
5
+ * the caller's text against a model the caller can already read. Nothing is run
6
+ * as the document's author, so each viewer sees what their own identity allows.
7
+ */
8
+ /** What a tile says in place of a result the viewer may not read. */
9
+ export declare const RESTRICTED_NOTICE = "You don't have access to this data";
10
+ /**
11
+ * The text a tile's `run:` is appended to: the document's definition cells in
12
+ * file order. Never an `import`, a `##!` flag or a `given:`; the model supplies
13
+ * those, and caller text may not carry them.
14
+ */
15
+ export declare function documentPreamble(cells: readonly NotebookCell[] | undefined): string;
16
+ /** `preamble` then `text`, as one query. */
17
+ export declare function withPreamble(preamble: string, text: string): string;
18
+ /** The server refused this viewer the source, as opposed to the query failing. */
19
+ export declare function isForbidden(error: unknown): boolean;
@@ -2,24 +2,23 @@ import { PackageCatalog } from './catalog';
2
2
  import { ChartPick } from './chartLine';
3
3
  import { DashboardDocument } from './document';
4
4
  /**
5
- * What a new tile is: a view, picked from the package, on a source this file
6
- * can reach.
5
+ * What a new tile is: a view, picked from the package.
7
6
  *
8
7
  * The picker is what makes a tile expression correct BY CONSTRUCTION. Every
9
8
  * `source -> view` it offers came from the catalog, so the builder never emits
10
9
  * a tile that does not resolve — which is why saving needs no compile step
11
10
  * beyond the reader's own round-trip.
12
11
  *
13
- * "Can reach" is the rule the writer enforces and the reason some sources are
14
- * not offered: a tile's view is declared in an extension of a model source, and
15
- * that source has to be in this file's scope. The builder never adds an
16
- * import, so a model source is offered only when the file already extends it,
17
- * or imports it BY NAME. A bare `import "../m.malloy"` may well bring it in,
18
- * but the file cannot say so, and a guess here fails the whole package load.
12
+ * Every source the package publishes is offered. A tile's view is declared in
13
+ * an extension of its model source, so a source the file cannot see yet is
14
+ * imported by name when the tile is added (`withSource`); one the file already
15
+ * reaches, by name or through a whole-file import of its model, is left alone.
19
16
  */
20
17
  export interface NewTile {
21
18
  /** The model source the view lives on. */
22
19
  base: string;
20
+ /** The model that declares it, for the import a source the file cannot see yet needs. */
21
+ modelPath: string;
23
22
  /** The view, as the catalog names it. */
24
23
  view: string;
25
24
  label?: string;
@@ -0,0 +1,25 @@
1
+ import { ComponentProps } from 'react';
2
+ import { UnsavedChangesDialog } from '../UnsavedChangesDialog';
3
+ import { PackageCatalog } from './catalog';
4
+ import { ConversionConfirm } from './useConversionConfirm';
5
+ import { useControlBindings } from './useControlBindings';
6
+ import { DashboardEditor } from './useDashboardEditor';
7
+ import { useTileEditing } from './useTileEditing';
8
+ /**
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.
12
+ */
13
+ export declare function BuilderDialogs({ editor, catalog, columns, dashboards, bindings, tiles, drillSource, setDrillSource, confirmConversion, exitDialog, }: {
14
+ editor: DashboardEditor;
15
+ catalog: PackageCatalog | undefined;
16
+ columns: number;
17
+ dashboards: string[] | undefined;
18
+ bindings: ReturnType<typeof useControlBindings>;
19
+ tiles: ReturnType<typeof useTileEditing>;
20
+ /** The source whose clickable cells are being edited, if any. */
21
+ drillSource: string | undefined;
22
+ setDrillSource: (source: string | undefined) => void;
23
+ confirmConversion: ConversionConfirm | undefined;
24
+ exitDialog: ComponentProps<typeof UnsavedChangesDialog>;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { ReactNode, RefObject } from 'react';
2
+ import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
3
+ import { DashboardTile, QueryTile } from './document';
4
+ import { DashboardEditor } from './useDashboardEditor';
5
+ import { useTileReorder } from './useTileReorder';
6
+ import { useTileResize } from './useTileResize';
7
+ /**
8
+ * The builder's tiles, on the SAME grid the dashboard renders on, each drawn
9
+ * by the caller's `renderTile` inside a `TileFrame` that carries the
10
+ * affordances: selection, the grip and menu, the width handle.
11
+ */
12
+ export declare function BuilderGrid({ editor, reorder, resizing, gridBox, columns, notebook, chrome, canAdd, selected, flash, menuIndex, onSelect, onOpenMenu, openAdd, editTile, renderTile, }: {
13
+ editor: DashboardEditor;
14
+ reorder: ReturnType<typeof useTileReorder>;
15
+ resizing: ReturnType<typeof useTileResize>;
16
+ gridBox: RefObject<HTMLDivElement | null>;
17
+ columns: number;
18
+ notebook: boolean;
19
+ chrome: TileChrome;
20
+ /** Whether there is a catalog to add a tile from. */
21
+ canAdd: boolean;
22
+ selected: number | undefined;
23
+ flash: string | undefined;
24
+ /** The tile whose menu is open. */
25
+ menuIndex: number | undefined;
26
+ onSelect: (index: number) => void;
27
+ onOpenMenu: (anchor: HTMLElement, index: number) => void;
28
+ openAdd: (at?: number) => void;
29
+ editTile: (key: string, change: (tile: DashboardTile) => void) => void;
30
+ renderTile?: (tile: QueryTile, heading?: TileHeadingSlots, chrome?: TileChrome) => ReactNode;
31
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { TileChrome } from '../Dashboard/TileCard';
3
+ import { DashboardEditor } from './useDashboardEditor';
4
+ /**
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.
7
+ */
8
+ export declare function BuilderHeader({ editor, notebook, documentSlug, chrome, actions, descriptionSelected, selectDescription, }: {
9
+ editor: DashboardEditor;
10
+ notebook: boolean;
11
+ /** The name a reader's view titles an untitled document with. */
12
+ documentSlug: string | undefined;
13
+ chrome: TileChrome;
14
+ actions: ReactNode;
15
+ descriptionSelected: boolean;
16
+ selectDescription: () => void;
17
+ }): import("react/jsx-runtime").JSX.Element;
@@ -3,17 +3,13 @@ import { SavesTo } from './documentSession';
3
3
  /** Where Save puts the document, in the words under the button. */
4
4
  export declare const SAVE_TARGET: Record<SavesTo, string>;
5
5
  /**
6
- * The edit bar across the top of the builder: that you are editing on the
7
- * left, what you can do about it on the right, in the same {@link DashboardBar}
8
- * the reader's view uses, so switching modes swaps the contents of one bar
9
- * rather than replacing one bar with a different one.
6
+ * The builder's actions, as one row with no bar of its own, at the right of
7
+ * the page title's line.
10
8
  *
11
- * The right-hand controls are grouped by what they do, separated rather than
12
- * run together: change the page (a tile, its settings), take a change back or
13
- * put it down (undo, redo, save), and leave (Done, where the reader's view has
14
- * Edit). Sticky, so undo and save stay in reach on a long dashboard; the
15
- * reader's own header (title and description) stays in the page below it
16
- * rather than being repeated here.
9
+ * Grouped by what they do, separated rather than run together: change the page
10
+ * (a tile), take a change back (undo, redo), and keep it (Save,
11
+ * which saves in place: the builder stays open, and leaving is the page's
12
+ * own navigation).
17
13
  */
18
14
  export interface BuilderToolbarProps {
19
15
  canUndo: boolean;
@@ -24,19 +20,20 @@ export interface BuilderToolbarProps {
24
20
  saving: boolean;
25
21
  /** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
26
22
  onSave?: () => void;
27
- /** Where Save writes, shown under the button. */
23
+ /** Where Save writes, shown in its tooltip. */
28
24
  savesTo?: SavesTo;
29
25
  /** The backend's own words for where Save writes; replaces the generic line for `savesTo`. */
30
26
  saveLabel?: string;
31
27
  /** The Save button, so focus can return to it after an Undo save. */
32
28
  saveButton?: Ref<HTMLButtonElement>;
33
- /** The host's own extra actions, beside Done. */
29
+ /** The host's own extra actions, beside Save. */
34
30
  actions?: ReactNode;
35
- /** Leave editing: draws "Close" at the right edge. Absent, no such button. */
36
- onExit?: () => void;
37
31
  /** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
38
32
  onAddTile?: () => void;
39
- /** Open the page's settings, anchored to the button that asked. Absent, no Settings button. */
40
- onSettings?: (anchor: HTMLElement) => void;
33
+ /**
34
+ * Leave the builder: draws Close after Save, for a host that opts in. The
35
+ * Console leaves from its own header and passes nothing.
36
+ */
37
+ onExit?: () => void;
41
38
  }
42
- export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onExit, onAddTile, onSettings, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
39
+ export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onAddTile, onExit, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
@@ -14,7 +14,7 @@ export type ViewStatus = "loading" | "unlisted";
14
14
  * Whatever the cell has now stays selectable, so the select never shows a value it does not offer.
15
15
  */
16
16
  export declare function chartChoices(view: Pick<CatalogView, "chart" | "aggregateOnly"> | undefined, current: ChartState, viewStatus?: ViewStatus): ChartChoice[];
17
- export declare function ChartPicker({ state, view, viewStatus, cellLabel, disabledReason, onOpen, onChange, }: {
17
+ export declare function ChartPicker({ state, view, viewStatus, cellLabel, disabledReason, onOpen, onChange, variant, }: {
18
18
  state: ChartState;
19
19
  /** The catalog's view this cell runs, when it is one the catalog knows. */
20
20
  view: Pick<CatalogView, "chart" | "aggregateOnly"> | undefined;
@@ -26,4 +26,6 @@ export declare function ChartPicker({ state, view, viewStatus, cellLabel, disabl
26
26
  /** The choices are being looked at, which is when a host may fetch what it needs to offer more. */
27
27
  onOpen?: () => void;
28
28
  onChange: (next: ChartState) => void;
29
+ /** The field's look: underlined in a compact menu, outlined beside a dialog's other fields. */
30
+ variant?: "standard" | "outlined";
29
31
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { TileHeadingSlots } from '../Dashboard/TileCard';
2
+ import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
3
3
  import { SavesTo } from './documentSession';
4
4
  import { BuilderEvent } from './telemetry';
5
5
  import { BuilderGiven } from './controls';
@@ -48,8 +48,6 @@ export interface DashboardBuilderProps {
48
48
  * the save, so it must write through the same channel and checks.
49
49
  */
50
50
  onSave?: SaveHandler<DashboardDocument>;
51
- /** Whether the save notice (View change, Undo save) is showing, for a host that must not replace the document under it. */
52
- onSaveNoticeChange?: (showing: boolean) => void;
53
51
  /**
54
52
  * The document as it stands, on every edit — including the first render.
55
53
  *
@@ -70,7 +68,9 @@ export interface DashboardBuilderProps {
70
68
  * heading itself passes it on (`DashboardTile`'s `heading`), or the tile
71
69
  * cannot be retitled on the page.
72
70
  */
73
- renderTile?: (tile: QueryTile, heading?: TileHeadingSlots) => ReactNode;
71
+ renderTile?: (tile: QueryTile, heading?: TileHeadingSlots,
72
+ /** The document's tile chrome — bare on a notebook — so the live tile reads as the reader's. */
73
+ chrome?: TileChrome) => ReactNode;
74
74
  /**
75
75
  * The control row, in the slot the reader puts it — this is where a real
76
76
  * `GivensPanel` goes.
@@ -146,12 +146,20 @@ export interface DashboardBuilderProps {
146
146
  replaces?: string;
147
147
  /** The document's file within the package, so a kind switch tags what its folder would otherwise misread. */
148
148
  modelPath?: string;
149
+ /** The document is held as text, which the server reads by its tags rather than its folder: the tag always carries `kind=`. */
150
+ explicitKind?: boolean;
151
+ /**
152
+ * Why "Add filter" is off, or absent when it is on. A document kept as bare
153
+ * text has no `given:` of its own to write, so only the model's givens can
154
+ * be bound, from the chips.
155
+ */
156
+ addFilterDisabledReason?: string;
149
157
  /**
150
158
  * The host's own extra actions for the edit bar, rendered beside undo, redo
151
- * and save. Leaving is `onExit`, not this: the builder draws Done itself.
159
+ * and save.
152
160
  */
153
161
  toolbar?: ReactNode;
154
- /** Leave the builder: renders "Close", which asks first when there are unsaved edits. */
162
+ /** Leave the builder, opted into: draws Close, which asks first when edits are unsaved. */
155
163
  onExit?: () => void;
156
164
  }
157
- export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, onSaveNoticeChange, renderTile, controls, givens, catalog, toolbar, onExit, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
165
+ export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, onExit, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, explicitKind, addFilterDisabledReason, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { HostGivenValue } from '../../hooks/givenValue';
1
2
  import { BuilderEvent } from './telemetry';
2
3
  import { DocumentKind } from './document';
3
4
  /**
@@ -34,8 +35,6 @@ export type DashboardEditorProps = ({
34
35
  */
35
36
  dashboardName: string;
36
37
  }) & {
37
- /** Leave the editor: its "Close", which asks first when edits are unsaved. Absent, no such button. */
38
- onExit?: () => void;
39
38
  /**
40
39
  * What the editor does — opened, saved, refused — for the host to log or
41
40
  * count; see `DashboardEvent`. A notebook reports `NotebookEvent`s instead.
@@ -62,5 +61,32 @@ export type DashboardEditorProps = ({
62
61
  * without this a host cannot tell whether leaving costs anything.
63
62
  */
64
63
  onDirtyChange?: (dirty: boolean) => void;
64
+ /**
65
+ * Leave the editor: opted into, it draws Close after Save, which asks first
66
+ * when edits are unsaved. A host with a way out of its own (the Console's
67
+ * header View) leaves it unset and guards with `onDirtyChange`.
68
+ */
69
+ onExit?: () => void;
70
+ /** Edit a document held as text; see {@link TextSourceOptions}. */
71
+ textSource?: TextSourceOptions;
65
72
  };
73
+ /**
74
+ * Open a document the host keeps as TEXT, rather than a file in a package.
75
+ *
76
+ * The text comes from the host's authoritative {@link DocumentStorage} and is
77
+ * compiled by the server, as the viewer, on top of `modelPath`: the model whose
78
+ * sources the document may name. The manifest is that compile's `document`, and
79
+ * every tile, cell and control option runs as the document's definitions
80
+ * followed by one `run:`, so each viewer sees what their own identity allows.
81
+ * The document carries no `import`, `##!` or `given:`, so "Add filter" is off
82
+ * and only the model's givens can be bound.
83
+ */
84
+ export interface TextSourceOptions {
85
+ /** The model the text is compiled and run on top of. */
86
+ modelPath: string;
87
+ /** Givens the host sets itself: no control is shown for them. */
88
+ hiddenGivens?: readonly string[];
89
+ /** The values for the givens the host sets: sent with the compile and with each tile that reads one. */
90
+ givens?: Record<string, HostGivenValue>;
91
+ }
66
92
  export declare function DashboardEditor(props: DashboardEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { Given } from '../../client';
2
+ import { DashboardDocument, DocumentKind } from './document';
3
+ import { SavesTo } from './documentSession';
4
+ import { TextSourceOptions } from './DashboardEditor';
5
+ import { BuilderEvent } from './telemetry';
6
+ export declare function EditorSurface({ textSource, kind, modelGivens, environmentName, packageName, modelPath, slug, versionId, opened, replaces, onSave, onDirtyChange, onExit, onEvent, savesTo, saveLabel, note, }: {
7
+ textSource?: TextSourceOptions;
8
+ kind: DocumentKind;
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
+ environmentName: string;
12
+ packageName: string;
13
+ modelPath: string;
14
+ slug: string;
15
+ versionId?: string;
16
+ opened: {
17
+ source: string;
18
+ document: DashboardDocument;
19
+ conversion?: {
20
+ from: string;
21
+ to: string;
22
+ };
23
+ generation: number;
24
+ };
25
+ replaces?: string;
26
+ onSave?: (source: string) => Promise<void>;
27
+ onDirtyChange: (dirty: boolean) => void;
28
+ onExit?: () => void;
29
+ onEvent?: (event: BuilderEvent) => void;
30
+ savesTo: SavesTo;
31
+ saveLabel?: string;
32
+ note: string;
33
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,19 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { BuilderControl } from './controls';
3
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.
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.
7
7
  */
8
- export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, onRemove, children, }: {
8
+ export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, addDisabledReason, onRemove, children, }: {
9
9
  controls: BuilderControl[];
10
10
  tileCount: number;
11
11
  /** Bindings a control has that its tiles' sources cannot take. */
12
12
  unknownFieldsOf: (name: string, type: string | undefined) => string[];
13
13
  onEdit: (control: BuilderControl) => void;
14
14
  onAdd: () => void;
15
+ /** Why adding is off; set, the chip is disabled and its tooltip says why. */
16
+ addDisabledReason?: string;
15
17
  /** Take a control off the dashboard, as its window's Remove does. */
16
18
  onRemove: (name: string) => void;
17
19
  /** The host's live control row. */
@@ -14,6 +14,6 @@ export declare function InlineText({ value, placeholder, ariaLabel, onCommit, fa
14
14
  ariaLabel: string;
15
15
  /** Called once per edit, with the new text, only when it differs from `value`. */
16
16
  onCommit: (next: string) => void;
17
- /** Draws an empty value faintly, and only while its tile is hovered or focused. */
17
+ /** Hides an empty value until its tile is hovered or focused. */
18
18
  faintWhenEmpty?: boolean;
19
19
  }): import("react/jsx-runtime").JSX.Element;
@@ -10,6 +10,6 @@ export type NotebookEditorProps = ({
10
10
  packageName: string;
11
11
  /** The notebook's slug: `overview` for `notebooks/overview.malloy`. */
12
12
  notebookName: string;
13
- }) & Pick<DashboardEditorProps, "onExit" | "onEvent" | "onDirtyChange" | "path">;
13
+ }) & Pick<DashboardEditorProps, "onEvent" | "onDirtyChange" | "onExit" | "path">;
14
14
  /** `DashboardEditor` opened on a notebook, under the name hosts already import. */
15
15
  export declare function NotebookEditor(props: NotebookEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,10 @@
1
+ import { TileChrome } from '../Dashboard/TileCard';
1
2
  import { TextTile } from './document';
2
3
  export declare const TEXT_TILE_PLACEHOLDER = "Write markdown: # heading, **bold**, - list";
3
4
  /** A text tile as the builder draws it: its markdown, edited in place. */
4
- export declare function TextTileBody({ tile, onChange, }: {
5
+ export declare function TextTileBody({ tile, onChange, chrome, }: {
5
6
  tile: TextTile;
6
7
  onChange: (markdown: string) => void;
8
+ /** The document's tile chrome: a card on a dashboard, bare on a notebook, as the reader draws it. */
9
+ chrome?: TileChrome;
7
10
  }): import("react/jsx-runtime").JSX.Element;