@malloy-publisher/sdk 0.9.7 → 0.9.9

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 (353) hide show
  1. package/README.md +117 -17
  2. package/dist/{RenderedResult-CkUS04tl.es.js → RenderedResult-BHuJpdSn.es.js} +2 -2
  3. package/dist/{RenderedResult-qnpbr4tc.cjs.js → RenderedResult-Bw7EQc42.cjs.js} +1 -1
  4. package/dist/ServerProvider-B0dUY8be.cjs.js +1 -0
  5. package/dist/{ServerProvider-DnLLeXEX.es.js → ServerProvider-CQy4jVYK.es.js} +1602 -1074
  6. package/dist/builder/index.cjs.js +93 -93
  7. package/dist/builder/index.es.js +4630 -4562
  8. package/dist/builder-entry.d.ts +13 -12
  9. package/dist/client/api.d.ts +893 -104
  10. package/dist/client/index.cjs.js +1 -1
  11. package/dist/client/index.es.js +125 -104
  12. package/dist/components/Dashboard/DashboardTile.d.ts +3 -1
  13. package/dist/components/Dashboard/DashboardView.d.ts +1 -3
  14. package/dist/components/Dashboard/index.d.ts +0 -2
  15. package/dist/components/DocumentCreate/createDocument.d.ts +29 -9
  16. package/dist/components/DocumentCreate/documentPath.d.ts +21 -6
  17. package/dist/components/DocumentCreate/guards.d.ts +2 -3
  18. package/dist/components/DocumentCreate/index.d.ts +2 -3
  19. package/dist/components/DocumentCreate/newNotebook.d.ts +14 -5
  20. package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +6 -0
  21. package/dist/components/DocumentStorage/DocumentStorage.d.ts +52 -24
  22. package/dist/components/Loading.d.ts +1 -1
  23. package/dist/components/Package/ContentTypeIcon.d.ts +3 -3
  24. package/dist/components/Package/DataSchemaDialog.d.ts +26 -0
  25. package/dist/components/Package/NewDocumentDialog.d.ts +19 -10
  26. package/dist/components/Package/Package.d.ts +14 -9
  27. package/dist/components/Package/documentLocation.d.ts +66 -23
  28. package/dist/components/Package/index.d.ts +3 -2
  29. package/dist/components/Package/reportQueries.d.ts +8 -0
  30. package/dist/components/Package/useDocumentLocation.d.ts +36 -6
  31. package/dist/components/Package/useDraftLayout.d.ts +20 -0
  32. package/dist/components/Report/CellReport.d.ts +89 -0
  33. package/dist/components/Report/LinearReport.d.ts +18 -0
  34. package/dist/components/Report/Report.d.ts +62 -0
  35. package/dist/components/Report/index.d.ts +2 -0
  36. package/dist/components/Report/telemetry.d.ts +163 -0
  37. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.d.ts +2 -2
  38. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.d.ts +2 -2
  39. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.d.ts +5 -4
  40. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.d.ts +5 -1
  41. package/dist/components/{DashboardBuilder → ReportBuilder}/EditorSurface.d.ts +10 -7
  42. package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts} +17 -8
  43. package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts} +41 -14
  44. package/dist/components/ReportBuilder/builderReport.d.ts +14 -0
  45. package/dist/components/{DashboardBuilder → ReportBuilder}/catalog.d.ts +8 -5
  46. package/dist/components/{DashboardBuilder → ReportBuilder}/document.d.ts +3 -4
  47. package/dist/components/{DashboardBuilder → ReportBuilder}/documentSession.d.ts +1 -1
  48. package/dist/components/{DashboardBuilder → ReportBuilder}/imports.d.ts +5 -1
  49. package/dist/components/{DashboardBuilder → ReportBuilder}/malloyTree.d.ts +9 -0
  50. package/dist/components/{DashboardBuilder → ReportBuilder}/newDashboard.d.ts +7 -1
  51. package/dist/components/{DashboardBuilder → ReportBuilder}/readDocument.d.ts +7 -5
  52. package/dist/components/{DashboardBuilder → ReportBuilder}/readForEditor.d.ts +1 -1
  53. package/dist/components/ReportBuilder/reportTag.d.ts +52 -0
  54. package/dist/components/{DashboardBuilder → ReportBuilder}/spliceDocument.d.ts +1 -7
  55. package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.d.ts +2 -2
  56. package/dist/components/{DashboardBuilder → ReportBuilder}/useControlBindings.d.ts +2 -2
  57. package/dist/components/ReportBuilder/useEditorCatalog.d.ts +25 -0
  58. package/dist/components/{DashboardBuilder → ReportBuilder}/useHostCopy.d.ts +5 -3
  59. package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.d.ts +7 -5
  60. package/dist/components/{DashboardBuilder/useDashboardEditor.d.ts → ReportBuilder/useReportEditor.d.ts} +3 -7
  61. package/dist/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.d.ts +6 -4
  62. package/dist/components/{DashboardBuilder → ReportBuilder}/useTileEditing.d.ts +2 -2
  63. package/dist/components/ServerProvider.d.ts +2 -1
  64. package/dist/components/drill/resolveDrill.d.ts +8 -1
  65. package/dist/components/drill/useDrillSelf.d.ts +4 -2
  66. package/dist/components/index.d.ts +2 -1
  67. package/dist/components/{Dashboard → legacy}/Dashboard.d.ts +15 -9
  68. package/dist/components/legacy/MalloynbCells.d.ts +13 -0
  69. package/dist/components/legacy/Notebook.d.ts +15 -0
  70. package/dist/components/{DashboardBuilder → legacy}/NotebookEditor.d.ts +3 -3
  71. package/dist/components/legacy/builderNames.d.ts +10 -0
  72. package/dist/components/legacy/index.d.ts +11 -0
  73. package/dist/components/legacy/kindAdapter.d.ts +11 -0
  74. package/dist/components/legacy/kindTypedDrafts.d.ts +10 -0
  75. package/dist/components/legacy/nameAlias.d.ts +44 -0
  76. package/dist/components/legacy/queryKeys.d.ts +8 -0
  77. package/dist/index.cjs.js +19 -19
  78. package/dist/index.es.js +8216 -7635
  79. package/dist/text/index.es.js +2 -2
  80. package/dist/{text-entry-CA0LZ1xL.es.js → text-entry-72YFLeNk.es.js} +10 -10
  81. package/dist/{useCompiledDocument-Bf72Ob5v.es.js → useCompiledDocument-1dgF5CC9.es.js} +4593 -4395
  82. package/dist/useCompiledDocument-BKyRnXmA.cjs.js +141 -0
  83. package/package.json +2 -2
  84. package/src/builder-entry.ts +32 -24
  85. package/src/components/Dashboard/DashboardTile.tsx +17 -0
  86. package/src/components/Dashboard/DashboardView.spec.tsx +0 -21
  87. package/src/components/Dashboard/DashboardView.tsx +8 -24
  88. package/src/components/Dashboard/dropValueUrlTags.spec.ts +1 -4
  89. package/src/components/Dashboard/index.ts +0 -2
  90. package/src/components/DocumentCreate/createDocument.spec.ts +346 -53
  91. package/src/components/DocumentCreate/createDocument.ts +143 -63
  92. package/src/components/DocumentCreate/documentPath.ts +41 -12
  93. package/src/components/DocumentCreate/guards.ts +7 -15
  94. package/src/components/DocumentCreate/index.ts +3 -7
  95. package/src/components/DocumentCreate/newNotebook.spec.ts +113 -43
  96. package/src/components/DocumentCreate/newNotebook.ts +32 -10
  97. package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +130 -28
  98. package/src/components/DocumentStorage/BrowserDocumentStorage.ts +78 -40
  99. package/src/components/DocumentStorage/DocumentStorage.contract.spec.tsx +426 -0
  100. package/src/components/DocumentStorage/DocumentStorage.ts +57 -24
  101. package/src/components/Home/AddEnvironmentDialog.tsx +1 -1
  102. package/src/components/Home/Home.tsx +1 -1
  103. package/src/components/Loading.tsx +1 -1
  104. package/src/components/Model/SourcesExplorer.tsx +1 -1
  105. package/src/components/Notebook/NotebookCell.tsx +6 -5
  106. package/src/components/Notebook/cellKind.spec.ts +15 -7
  107. package/src/components/Package/ContentTypeIcon.tsx +16 -3
  108. package/src/components/Package/DataSchemaDialog.spec.tsx +85 -0
  109. package/src/components/Package/DataSchemaDialog.tsx +367 -0
  110. package/src/components/Package/NewDocumentDialog.spec.tsx +145 -88
  111. package/src/components/Package/NewDocumentDialog.tsx +93 -48
  112. package/src/components/Package/Package.agents.spec.tsx +76 -0
  113. package/src/components/Package/Package.artifacts.spec.tsx +79 -60
  114. package/src/components/Package/Package.create.spec.tsx +126 -112
  115. package/src/components/Package/Package.notebooks.spec.tsx +46 -27
  116. package/src/components/Package/Package.spec.tsx +43 -30
  117. package/src/components/Package/Package.tsx +217 -293
  118. package/src/components/Package/documentLocation.spec.ts +145 -50
  119. package/src/components/Package/documentLocation.ts +118 -39
  120. package/src/components/Package/index.ts +12 -3
  121. package/src/components/Package/reportQueries.ts +25 -0
  122. package/src/components/Package/useDocumentLocation.spec.ts +58 -0
  123. package/src/components/Package/useDocumentLocation.ts +90 -32
  124. package/src/components/Package/useDraftLayout.spec.tsx +143 -0
  125. package/src/components/Package/useDraftLayout.ts +81 -0
  126. package/src/components/Prose.spec.tsx +3 -3
  127. package/src/components/RenderedResult/RenderedResult.tsx +1 -1
  128. package/src/components/Report/CellReport.spec.tsx +155 -0
  129. package/src/components/{Notebook/Notebook.tsx → Report/CellReport.tsx} +178 -220
  130. package/src/components/Report/LinearReport.tsx +71 -0
  131. package/src/components/Report/Report.spec.tsx +238 -0
  132. package/src/components/Report/Report.telemetry.spec.tsx +292 -0
  133. package/src/components/Report/Report.tsx +277 -0
  134. package/src/components/Report/index.ts +12 -0
  135. package/src/components/Report/telemetry.spec.ts +90 -0
  136. package/src/components/Report/telemetry.ts +250 -0
  137. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.tsx +5 -5
  138. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.tsx +2 -2
  139. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.tsx +6 -7
  140. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.tsx +33 -0
  141. package/src/components/{DashboardBuilder → ReportBuilder}/DrillDialog.tsx +2 -2
  142. package/src/components/{DashboardBuilder → ReportBuilder}/EditorSurface.tsx +67 -107
  143. package/src/components/{DashboardBuilder → ReportBuilder}/FilterDialog.tsx +3 -4
  144. package/src/components/{DashboardBuilder/DashboardBuilder.charts.spec.tsx → ReportBuilder/ReportBuilder.charts.spec.tsx} +4 -4
  145. package/src/components/{DashboardBuilder/DashboardBuilder.exit.spec.tsx → ReportBuilder/ReportBuilder.exit.spec.tsx} +5 -5
  146. package/src/components/{DashboardBuilder/DashboardBuilder.inline.spec.tsx → ReportBuilder/ReportBuilder.inline.spec.tsx} +4 -4
  147. package/src/components/ReportBuilder/ReportBuilder.layoutSwitch.spec.tsx +145 -0
  148. package/src/components/{DashboardBuilder/DashboardBuilder.notebook.spec.tsx → ReportBuilder/ReportBuilder.notebook.spec.tsx} +22 -21
  149. package/src/components/{DashboardBuilder/DashboardBuilder.openDraft.spec.tsx → ReportBuilder/ReportBuilder.openDraft.spec.tsx} +3 -3
  150. package/src/components/{DashboardBuilder/DashboardBuilder.sources.spec.tsx → ReportBuilder/ReportBuilder.sources.spec.tsx} +19 -8
  151. package/src/components/{DashboardBuilder/DashboardBuilder.spec.tsx → ReportBuilder/ReportBuilder.spec.tsx} +34 -34
  152. package/src/components/{DashboardBuilder/DashboardBuilder.textTiles.spec.tsx → ReportBuilder/ReportBuilder.textTiles.spec.tsx} +5 -5
  153. package/src/components/{DashboardBuilder/DashboardBuilder.tsx → ReportBuilder/ReportBuilder.tsx} +46 -21
  154. package/src/components/{DashboardBuilder/DashboardEditor.authoritative.spec.tsx → ReportBuilder/ReportEditor.authoritative.spec.tsx} +28 -20
  155. package/src/components/{DashboardBuilder/DashboardEditor.emptyStart.spec.tsx → ReportBuilder/ReportEditor.emptyStart.spec.tsx} +19 -11
  156. package/src/components/{DashboardBuilder/DashboardEditor.filterTag.spec.tsx → ReportBuilder/ReportEditor.filterTag.spec.tsx} +7 -7
  157. package/src/components/{DashboardBuilder/DashboardEditor.notebook.spec.tsx → ReportBuilder/ReportEditor.notebook.spec.tsx} +70 -49
  158. package/src/components/{DashboardBuilder/DashboardEditor.package.spec.tsx → ReportBuilder/ReportEditor.package.spec.tsx} +52 -8
  159. package/src/components/{DashboardBuilder/DashboardEditor.resourceUri.spec.tsx → ReportBuilder/ReportEditor.resourceUri.spec.tsx} +50 -18
  160. package/src/components/{DashboardBuilder/DashboardEditor.spec.tsx → ReportBuilder/ReportEditor.spec.tsx} +65 -20
  161. package/src/components/{DashboardBuilder/DashboardEditor.textSource.spec.tsx → ReportBuilder/ReportEditor.textSource.spec.tsx} +6 -6
  162. package/src/components/{DashboardBuilder/DashboardEditor.tsx → ReportBuilder/ReportEditor.tsx} +92 -35
  163. package/src/components/{DashboardBuilder → ReportBuilder}/addTile.compile.spec.ts +1 -3
  164. package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.spec.ts +1 -0
  165. package/src/components/{DashboardBuilder → ReportBuilder}/artifactBlock.spec.ts +21 -29
  166. package/src/components/ReportBuilder/builderReport.ts +53 -0
  167. package/src/components/{DashboardBuilder → ReportBuilder}/catalog.spec.ts +28 -10
  168. package/src/components/{DashboardBuilder → ReportBuilder}/catalog.ts +17 -10
  169. package/src/components/{DashboardBuilder → ReportBuilder}/controls.spec.ts +1 -0
  170. package/src/components/{DashboardBuilder → ReportBuilder}/document.ts +4 -7
  171. package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.spec.ts +5 -5
  172. package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.ts +1 -1
  173. package/src/components/{DashboardBuilder → ReportBuilder}/imports.spec.ts +6 -2
  174. package/src/components/{DashboardBuilder → ReportBuilder}/imports.ts +8 -4
  175. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.chart.spec.ts +1 -1
  176. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.convert.spec.ts +9 -13
  177. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.read.spec.ts +15 -15
  178. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.ts +7 -2
  179. package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.ts +25 -0
  180. package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.spec.ts +12 -4
  181. package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.ts +11 -24
  182. package/src/components/{DashboardBuilder → ReportBuilder}/preview.spec.ts +1 -0
  183. package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.spec.ts +64 -36
  184. package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.ts +33 -32
  185. package/src/components/ReportBuilder/readForEditor.spec.ts +96 -0
  186. package/src/components/{DashboardBuilder → ReportBuilder}/readForEditor.ts +3 -11
  187. package/src/components/ReportBuilder/reportTag.ts +108 -0
  188. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.imports.spec.ts +28 -1
  189. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.spec.ts +32 -3
  190. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.ts +37 -60
  191. package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.spec.ts +3 -3
  192. package/src/components/{DashboardBuilder → ReportBuilder}/testing/artifactTagParity.json +2 -2
  193. package/src/components/ReportBuilder/testing/drillResolution.json +279 -0
  194. package/src/components/ReportBuilder/testing/reportLayoutParity.json +125 -0
  195. package/src/components/{DashboardBuilder → ReportBuilder}/textTiles.spec.ts +66 -143
  196. package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.ts +2 -2
  197. package/src/components/{DashboardBuilder → ReportBuilder}/useControlBindings.ts +2 -2
  198. package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +156 -0
  199. package/src/components/ReportBuilder/useEditorCatalog.ts +119 -0
  200. package/src/components/{DashboardBuilder → ReportBuilder}/useHostCopy.ts +7 -5
  201. package/src/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.ts +56 -35
  202. package/src/components/{DashboardBuilder/useDashboardEditor.spec.ts → ReportBuilder/useReportEditor.spec.ts} +6 -6
  203. package/src/components/{DashboardBuilder/useDashboardEditor.ts → ReportBuilder/useReportEditor.ts} +6 -17
  204. package/src/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.ts +36 -35
  205. package/src/components/{DashboardBuilder → ReportBuilder}/useTileEditing.ts +2 -2
  206. package/src/components/ServerProvider.tsx +2 -0
  207. package/src/components/drill/resolveDrill.ts +9 -2
  208. package/src/components/drill/useDrill.tsx +1 -0
  209. package/src/components/drill/useDrillSelf.spec.tsx +60 -7
  210. package/src/components/drill/useDrillSelf.ts +29 -12
  211. package/src/components/index.ts +2 -1
  212. package/src/components/{Dashboard → legacy}/Dashboard.spec.tsx +1 -1
  213. package/src/components/{Dashboard → legacy}/Dashboard.tsx +40 -28
  214. package/src/components/legacy/MalloynbCells.tsx +88 -0
  215. package/src/components/{Notebook → legacy}/Notebook.served.spec.tsx +17 -13
  216. package/src/components/{Notebook → legacy}/Notebook.spec.tsx +24 -20
  217. package/src/components/legacy/Notebook.tsx +44 -0
  218. package/src/components/{DashboardBuilder → legacy}/NotebookEditor.tsx +7 -4
  219. package/src/components/legacy/builderNames.ts +25 -0
  220. package/src/components/legacy/index.ts +20 -0
  221. package/src/components/legacy/kindAdapter.ts +19 -0
  222. package/src/components/legacy/kindTypedDrafts.ts +34 -0
  223. package/src/components/legacy/nameAlias.spec.ts +124 -0
  224. package/src/components/legacy/nameAlias.ts +95 -0
  225. package/src/components/legacy/queryKeys.ts +26 -0
  226. package/src/hooks/useGivensState.spec.ts +9 -9
  227. package/src/mainEntry.spec.ts +1 -1
  228. package/src/textEntry.spec.ts +9 -9
  229. package/src/utils/formatting.spec.ts +5 -5
  230. package/src/utils/parsing.spec.ts +1 -1
  231. package/src/utils/parsing.ts +1 -1
  232. package/dist/ServerProvider-Gj-im5VD.cjs.js +0 -1
  233. package/dist/components/Dashboard/telemetry.d.ts +0 -73
  234. package/dist/components/DashboardBuilder/builderReport.d.ts +0 -13
  235. package/dist/components/DashboardBuilder/telemetry.d.ts +0 -43
  236. package/dist/components/DocumentCreate/events.d.ts +0 -10
  237. package/dist/components/Notebook/Notebook.d.ts +0 -52
  238. package/dist/components/Notebook/index.d.ts +0 -1
  239. package/dist/useCompiledDocument-tBejqZ7s.cjs.js +0 -142
  240. package/src/components/Dashboard/telemetry.ts +0 -75
  241. package/src/components/DashboardBuilder/builderReport.ts +0 -74
  242. package/src/components/DashboardBuilder/readForEditor.spec.ts +0 -80
  243. package/src/components/DashboardBuilder/telemetry.ts +0 -47
  244. package/src/components/DashboardBuilder/testing/documentKindRule.json +0 -40
  245. package/src/components/DocumentCreate/events.ts +0 -15
  246. package/src/components/Notebook/index.ts +0 -4
  247. /package/dist/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.d.ts +0 -0
  248. /package/dist/components/{DashboardBuilder → ReportBuilder}/ChartPicker.d.ts +0 -0
  249. /package/dist/components/{DashboardBuilder → ReportBuilder}/DrillDialog.d.ts +0 -0
  250. /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterDialog.d.ts +0 -0
  251. /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterStrip.d.ts +0 -0
  252. /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.d.ts +0 -0
  253. /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineText.d.ts +0 -0
  254. /package/dist/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.d.ts +0 -0
  255. /package/dist/components/{DashboardBuilder → ReportBuilder}/TextTileBody.d.ts +0 -0
  256. /package/dist/components/{DashboardBuilder → ReportBuilder}/TileFrame.d.ts +0 -0
  257. /package/dist/components/{DashboardBuilder → ReportBuilder}/TileMenu.d.ts +0 -0
  258. /package/dist/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.d.ts +0 -0
  259. /package/dist/components/{DashboardBuilder → ReportBuilder}/annotationText.d.ts +0 -0
  260. /package/dist/components/{DashboardBuilder → ReportBuilder}/changedTile.d.ts +0 -0
  261. /package/dist/components/{DashboardBuilder → ReportBuilder}/chartLine.d.ts +0 -0
  262. /package/dist/components/{DashboardBuilder → ReportBuilder}/controls.d.ts +0 -0
  263. /package/dist/components/{DashboardBuilder → ReportBuilder}/inlineEdit.d.ts +0 -0
  264. /package/dist/components/{DashboardBuilder → ReportBuilder}/layout.d.ts +0 -0
  265. /package/dist/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.d.ts +0 -0
  266. /package/dist/components/{DashboardBuilder → ReportBuilder}/loadMalloy.d.ts +0 -0
  267. /package/dist/components/{DashboardBuilder → ReportBuilder}/openDraft.d.ts +0 -0
  268. /package/dist/components/{DashboardBuilder → ReportBuilder}/preview.d.ts +0 -0
  269. /package/dist/components/{DashboardBuilder → ReportBuilder}/sortable.d.ts +0 -0
  270. /package/dist/components/{DashboardBuilder → ReportBuilder}/spliceResult.d.ts +0 -0
  271. /package/dist/components/{DashboardBuilder → ReportBuilder}/tagParse.d.ts +0 -0
  272. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.d.ts +0 -0
  273. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/inline.d.ts +0 -0
  274. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/resize.d.ts +0 -0
  275. /package/dist/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.d.ts +0 -0
  276. /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.d.ts +0 -0
  277. /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.d.ts +0 -0
  278. /package/dist/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.d.ts +0 -0
  279. /package/dist/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.d.ts +0 -0
  280. /package/dist/components/{DashboardBuilder → ReportBuilder}/useDraft.d.ts +0 -0
  281. /package/dist/components/{DashboardBuilder → ReportBuilder}/useExitGuard.d.ts +0 -0
  282. /package/dist/components/{DashboardBuilder → ReportBuilder}/useFilterForm.d.ts +0 -0
  283. /package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.d.ts +0 -0
  284. /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileReorder.d.ts +0 -0
  285. /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileResize.d.ts +0 -0
  286. /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.spec.tsx +0 -0
  287. /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.tsx +0 -0
  288. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.render.spec.tsx +0 -0
  289. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.spec.ts +0 -0
  290. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.tsx +0 -0
  291. /package/src/components/{DashboardBuilder → ReportBuilder}/FilterStrip.tsx +0 -0
  292. /package/src/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.tsx +0 -0
  293. /package/src/components/{DashboardBuilder → ReportBuilder}/InlineText.tsx +0 -0
  294. /package/src/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.tsx +0 -0
  295. /package/src/components/{DashboardBuilder → ReportBuilder}/TextTileBody.tsx +0 -0
  296. /package/src/components/{DashboardBuilder → ReportBuilder}/TileFrame.tsx +0 -0
  297. /package/src/components/{DashboardBuilder → ReportBuilder}/TileMenu.tsx +0 -0
  298. /package/src/components/{DashboardBuilder → ReportBuilder}/__test__/inventory.ts +0 -0
  299. /package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.ts +0 -0
  300. /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.spec.ts +0 -0
  301. /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.ts +0 -0
  302. /package/src/components/{DashboardBuilder → ReportBuilder}/artifactTagParity.spec.ts +0 -0
  303. /package/src/components/{DashboardBuilder → ReportBuilder}/catalog.aggregate.spec.ts +0 -0
  304. /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.spec.ts +0 -0
  305. /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.ts +0 -0
  306. /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.spec.ts +0 -0
  307. /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.ts +0 -0
  308. /package/src/components/{DashboardBuilder → ReportBuilder}/controls.ts +0 -0
  309. /package/src/components/{DashboardBuilder → ReportBuilder}/emptyStart.spec.ts +0 -0
  310. /package/src/components/{DashboardBuilder → ReportBuilder}/inlineEdit.tsx +0 -0
  311. /package/src/components/{DashboardBuilder → ReportBuilder}/invariants.spec.ts +0 -0
  312. /package/src/components/{DashboardBuilder → ReportBuilder}/keepRowStructure.spec.ts +0 -0
  313. /package/src/components/{DashboardBuilder → ReportBuilder}/layout.ts +0 -0
  314. /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.spec.ts +0 -0
  315. /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.ts +0 -0
  316. /package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.spec.ts +0 -0
  317. /package/src/components/{DashboardBuilder → ReportBuilder}/moveIntoGap.spec.ts +0 -0
  318. /package/src/components/{DashboardBuilder → ReportBuilder}/openDraft.ts +0 -0
  319. /package/src/components/{DashboardBuilder → ReportBuilder}/preview.shapes.spec.ts +0 -0
  320. /package/src/components/{DashboardBuilder → ReportBuilder}/preview.ts +0 -0
  321. /package/src/components/{DashboardBuilder → ReportBuilder}/scannerShapes.spec.ts +0 -0
  322. /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.spec.ts +0 -0
  323. /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.tsx +0 -0
  324. /package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.chart.spec.ts +0 -0
  325. /package/src/components/{DashboardBuilder → ReportBuilder}/spliceResult.ts +0 -0
  326. /package/src/components/{DashboardBuilder → ReportBuilder}/statementExtent.spec.ts +0 -0
  327. /package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.ts +0 -0
  328. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.ts +0 -0
  329. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/inline.ts +0 -0
  330. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/resize.ts +0 -0
  331. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/urlRenderTags.json +0 -0
  332. /package/src/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.ts +0 -0
  333. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.spec.ts +0 -0
  334. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.ts +0 -0
  335. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.overlay.spec.tsx +0 -0
  336. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.spec.tsx +0 -0
  337. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.ts +0 -0
  338. /package/src/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.ts +0 -0
  339. /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.spec.ts +0 -0
  340. /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.ts +0 -0
  341. /package/src/components/{DashboardBuilder → ReportBuilder}/useDraft.ts +0 -0
  342. /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.spec.ts +0 -0
  343. /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.ts +0 -0
  344. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.existing.spec.tsx +0 -0
  345. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.spec.tsx +0 -0
  346. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.ts +0 -0
  347. /package/src/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.ts +0 -0
  348. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.spec.tsx +0 -0
  349. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.ts +0 -0
  350. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.spec.tsx +0 -0
  351. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.ts +0 -0
  352. /package/src/components/{DashboardBuilder → ReportBuilder}/withGaps.spec.ts +0 -0
  353. /package/src/components/{Notebook → legacy}/Notebook.layout.spec.tsx +0 -0
@@ -3,7 +3,7 @@ import { UnsavedChangesDialog } from '../UnsavedChangesDialog';
3
3
  import { PackageCatalog } from './catalog';
4
4
  import { ConversionConfirm } from './useConversionConfirm';
5
5
  import { useControlBindings } from './useControlBindings';
6
- import { DashboardEditor } from './useDashboardEditor';
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
@@ -11,7 +11,7 @@ import { useTileEditing } from './useTileEditing';
11
11
  * question, the unsaved-changes guard and the add-tile picker.
12
12
  */
13
13
  export declare function BuilderDialogs({ editor, catalog, columns, dashboards, bindings, tiles, drillSource, setDrillSource, confirmConversion, exitDialog, }: {
14
- editor: DashboardEditor;
14
+ editor: ReportEditorHandle;
15
15
  catalog: PackageCatalog | undefined;
16
16
  columns: number;
17
17
  dashboards: string[] | undefined;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
2
  import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
3
3
  import { DashboardTile, QueryTile } from './document';
4
- import { DashboardEditor } from './useDashboardEditor';
4
+ import { ReportEditorHandle } from './useReportEditor';
5
5
  import { useTileReorder } from './useTileReorder';
6
6
  import { useTileResize } from './useTileResize';
7
7
  /**
@@ -10,7 +10,7 @@ import { useTileResize } from './useTileResize';
10
10
  * affordances: selection, the grip and menu, the width handle.
11
11
  */
12
12
  export declare function BuilderGrid({ editor, reorder, resizing, gridBox, columns, notebook, chrome, canAdd, selected, flash, menuIndex, onSelect, onOpenMenu, openAdd, editTile, renderTile, }: {
13
- editor: DashboardEditor;
13
+ editor: ReportEditorHandle;
14
14
  reorder: ReturnType<typeof useTileReorder>;
15
15
  resizing: ReturnType<typeof useTileResize>;
16
16
  gridBox: RefObject<HTMLDivElement | null>;
@@ -1,13 +1,14 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TileChrome } from '../Dashboard/TileCard';
3
- import { DashboardEditor } from './useDashboardEditor';
3
+ import { ReportEditorHandle } from './useReportEditor';
4
4
  /**
5
5
  * The document's title, with the builder's actions on its line, and its
6
6
  * description beneath: both edited where they stand, as the reader sees them.
7
7
  */
8
- export declare function BuilderHeader({ editor, notebook, documentSlug, chrome, actions, descriptionSelected, selectDescription, }: {
9
- editor: DashboardEditor;
10
- notebook: boolean;
8
+ export declare function BuilderHeader({ editor, documentSlug, chrome, actions, descriptionSelected, selectDescription, }: {
9
+ editor: ReportEditorHandle;
10
+ /** Kept for callers; the title reads the same in either layout. */
11
+ notebook?: boolean;
11
12
  /** The name a reader's view titles an untitled document with. */
12
13
  documentSlug: string | undefined;
13
14
  chrome: TileChrome;
@@ -35,5 +35,9 @@ export interface BuilderToolbarProps {
35
35
  * Console leaves from its own header and passes nothing.
36
36
  */
37
37
  onExit?: () => void;
38
+ /** The report's layout, for the switch. Absent, no switch is drawn. */
39
+ layout?: "grid" | "linear";
40
+ /** Switch the layout: rewrites `layout=` in the tag and nothing else. */
41
+ onLayoutChange?: (layout: "grid" | "linear") => void;
38
42
  }
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;
43
+ export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onAddTile, onExit, layout, onLayoutChange, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,17 @@
1
1
  import { Given } from '../../client';
2
- import { DashboardDocument, DocumentKind } from './document';
2
+ import { ReportLayout } from '../Package/documentLocation';
3
+ import { DashboardDocument } from './document';
3
4
  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, }: {
5
+ import { TextSourceOptions } from './ReportEditor';
6
+ 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, }: {
7
8
  textSource?: TextSourceOptions;
8
- kind: DocumentKind;
9
9
  /** The model's own givens, for a cell-format notebook whose manifest the server cannot build until it is saved. */
10
10
  modelGivens?: Given[];
11
11
  environmentName: string;
12
12
  packageName: string;
13
13
  modelPath: string;
14
+ /** A display label; the editor keys on `modelPath`. */
14
15
  slug: string;
15
16
  versionId?: string;
16
17
  opened: {
@@ -23,10 +24,12 @@ export declare function EditorSurface({ textSource, kind, modelGivens, environme
23
24
  generation: number;
24
25
  };
25
26
  replaces?: string;
26
- onSave?: (source: string) => Promise<void>;
27
+ /** Save the text, with the layout the document has as it is saved. */
28
+ onSave?: (source: string, layout: ReportLayout) => Promise<void>;
27
29
  onDirtyChange: (dirty: boolean) => void;
28
30
  onExit?: () => void;
29
- onEvent?: (event: BuilderEvent) => void;
31
+ allowLayoutChange?: boolean;
32
+ onEvent?: ReportEventHandler;
30
33
  savesTo: SavesTo;
31
34
  saveLabel?: string;
32
35
  note: string;
@@ -1,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
3
3
  import { SavesTo } from './documentSession';
4
- import { BuilderEvent } from './telemetry';
4
+ import { ReportEventHandler } from '../Report/telemetry';
5
5
  import { BuilderGiven } from './controls';
6
6
  import { PackageCatalog } from './catalog';
7
7
  import { DashboardDocument, QueryTile } from './document';
@@ -37,7 +37,7 @@ export type { BuilderGiven } from './controls';
37
37
  *
38
38
  * Tiles are added from the package's catalog and removed from their menu.
39
39
  */
40
- export interface DashboardBuilderProps {
40
+ export interface ReportBuilderProps {
41
41
  /** The file being edited. */
42
42
  source: string;
43
43
  /** The document that file produced. */
@@ -111,8 +111,12 @@ export interface DashboardBuilderProps {
111
111
  * go. Absent, a drill can only filter this dashboard.
112
112
  */
113
113
  dashboards?: string[];
114
- /** Saves and refusals, for the host to log; see `DashboardEvent`. A notebook-kind document reports `NotebookEvent`s instead. */
115
- onEvent?: (event: BuilderEvent) => void;
114
+ /**
115
+ * Saves, refusals and layout switches, for the host to log; see
116
+ * `ReportEvent`. Each is stamped with `modelPath` (empty when the builder
117
+ * was given none) and the document's layout as it stands.
118
+ */
119
+ onEvent?: ReportEventHandler;
116
120
  /**
117
121
  * The document is a conversion of a cell-format notebook: `from` is the text
118
122
  * on disk, `to` the layout text it converts to. Save writes `to` with the
@@ -144,10 +148,8 @@ export interface DashboardBuilderProps {
144
148
  saveLabel?: string;
145
149
  /** The file a save overwrites when `source` is a draft of it, so Undo save restores that file rather than the draft. */
146
150
  replaces?: string;
147
- /** The document's file within the package, so a kind switch tags what its folder would otherwise misread. */
151
+ /** The document's file within the package: the name an untitled document is shown under, and what a new tile is written beside. */
148
152
  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
153
  /** Set for a document held as text: the sources it sees without an `import`. A tile on one of them adds no import. */
152
154
  visibleSources?: readonly string[];
153
155
  /**
@@ -163,5 +165,12 @@ export interface DashboardBuilderProps {
163
165
  toolbar?: ReactNode;
164
166
  /** Leave the builder, opted into: draws Close, which asks first when edits are unsaved. */
165
167
  onExit?: () => void;
168
+ /**
169
+ * Whether the toolbar offers the Linear / Grid layout switch. Default
170
+ * true. A host that files a report by its layout passes false, so an
171
+ * author cannot change a layout the host files by. A document held as text
172
+ * never gets the switch.
173
+ */
174
+ allowLayoutChange?: boolean;
166
175
  }
167
- export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, onExit, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, explicitKind, visibleSources, addFilterDisabledReason, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
176
+ export declare function ReportBuilder({ source, document, onSave, onChange, onDirtyChange, onExit, allowLayoutChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, visibleSources, addFilterDisabledReason, }: ReportBuilderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { HostGivenValue } from '../../hooks/givenValue';
2
- import { BuilderEvent } from './telemetry';
3
- import { DocumentKind } from './document';
2
+ import { ReportEventHandler } from '../Report/telemetry';
3
+ import { DocumentKind } from '../legacy/kindAdapter';
4
+ import { ReportLayout } from '../Package/documentLocation';
4
5
  /**
5
6
  * The builder, opened on a package dashboard, with everything a host has to
6
7
  * supply already wired: the file's text and manifest from the server, a live
@@ -19,10 +20,24 @@ import { DocumentKind } from './document';
19
20
  * editor (its value is written into each tile's query) but reaches the package
20
21
  * only when the file is saved into it.
21
22
  */
22
- export type DashboardEditorProps = ({
23
+ export type ReportEditorProps = ({
23
24
  /** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
24
25
  resourceUri: string;
25
- /** The dashboard's slug, as listed by the dashboards endpoint. */
26
+ /**
27
+ * The report's package path, `sales/q3.malloy`: its identity, and what
28
+ * the editor is keyed by. Give this.
29
+ */
30
+ path: string;
31
+ /** A display label; default the path's basename. */
32
+ dashboard?: string;
33
+ } | {
34
+ /** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
35
+ resourceUri: string;
36
+ /**
37
+ * @deprecated Pass `path`. The report's basename, which opens
38
+ * `<kind>s/<name>.malloy` (`dashboards/` unless `kind` says
39
+ * `notebook`) when no `path` is given.
40
+ */
26
41
  dashboard: string;
27
42
  } | {
28
43
  /** @deprecated Pass `resourceUri` and `dashboard` instead. */
@@ -36,20 +51,25 @@ export type DashboardEditorProps = ({
36
51
  dashboardName: string;
37
52
  }) & {
38
53
  /**
39
- * What the editor does — opened, saved, refused — for the host to log or
40
- * count; see `DashboardEvent`. A notebook reports `NotebookEvent`s instead.
54
+ * What the editor does — opened, failed to load, saved, refused, switched
55
+ * layout — for the host to log or count; see `ReportEvent`.
41
56
  */
42
- onEvent?: (event: BuilderEvent) => void;
57
+ onEvent?: ReportEventHandler;
43
58
  /**
44
- * What the document is to the host: its storage locator and event names.
45
- * Default `dashboard`. A notebook is a dashboard with one column, and is
46
- * read with the authoring flag and served through the notebook endpoint.
59
+ * The report's layout as the host knows it before the text is read: from
60
+ * the package's listing, or for a draft the layout its store recorded.
61
+ * Default `grid`. It decides what is read when the editor opens (a linear
62
+ * report's copy is read back only from an authoritative store) and is what
63
+ * a save records until the text says otherwise; once open, the document's
64
+ * own tag decides how it is drawn, what a save records and which events it
65
+ * reports, and the layout switch changes that.
47
66
  */
67
+ layout?: ReportLayout;
68
+ /** @deprecated Pass `layout`: `dashboard` is grid, `notebook` linear. */
48
69
  kind?: DocumentKind;
49
70
  /**
50
- * The document's file within the package, when it is not where its kind
51
- * puts a new one (`dashboards/<slug>.malloy`, `notebooks/<slug>.malloy`):
52
- * the kind comes from the file's own tag, so a document may sit in either.
71
+ * The report's file within the package, wherever it lives: its identity.
72
+ * Without it, the deprecated name forms open `<kind>s/<name>.malloy`.
53
73
  */
54
74
  path?: string;
55
75
  /**
@@ -69,6 +89,13 @@ export type DashboardEditorProps = ({
69
89
  onExit?: () => void;
70
90
  /** Edit a document held as text; see {@link TextSourceOptions}. */
71
91
  textSource?: TextSourceOptions;
92
+ /**
93
+ * Whether the toolbar offers the Linear / Grid layout switch. Default
94
+ * true. A host that files a report by its layout passes false, so an
95
+ * author cannot change a layout the host files by. A document held as text
96
+ * never gets the switch.
97
+ */
98
+ allowLayoutChange?: boolean;
72
99
  };
73
100
  /**
74
101
  * Open a document the host keeps as TEXT, rather than a file in a package.
@@ -89,4 +116,4 @@ export interface TextSourceOptions {
89
116
  /** The values for the givens the host sets: sent with the compile and with each tile that reads one. */
90
117
  givens?: Record<string, HostGivenValue>;
91
118
  }
92
- export declare function DashboardEditor(props: DashboardEditorProps): import("react/jsx-runtime").JSX.Element;
119
+ export declare function ReportEditor(props: ReportEditorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { ReportLayout } from '../Package/documentLocation';
2
+ import { ReportEventHandler, SavesTo } from '../Report/telemetry';
3
+ import { SessionReport } from './useBuilderSession';
4
+ /**
5
+ * What the builder's session says about a save, as `report.*` events stamped
6
+ * with the report's path and the document's layout as it stands.
7
+ */
8
+ export declare const builderReport: ({ size, path, layout, savesTo, onEvent, }: {
9
+ size: number;
10
+ path: string;
11
+ layout: ReportLayout;
12
+ savesTo: SavesTo;
13
+ onEvent: ReportEventHandler | undefined;
14
+ }) => SessionReport;
@@ -62,9 +62,12 @@ export declare function chartOf(annotations: string[] | undefined): string | und
62
62
  */
63
63
  export declare function filterableFields(catalog: PackageCatalog | undefined, source: string | undefined): CatalogField[] | undefined;
64
64
  /**
65
- * A dashboard file is itself a model, so the endpoint lists it alongside the
66
- * real ones. Offering a dashboard's own tile views as things to put on a
67
- * dashboard would be circular, so they are left out.
65
+ * A report file is itself a model, so the models endpoint may list it beside
66
+ * the real ones. Offering a report's own tile views as things to put on a
67
+ * report would be circular, so they are left out, by the paths the package's
68
+ * report listing names: where a file lives never says whether it is a report.
68
69
  */
69
- export declare const isDashboardModel: (path: string | undefined) => boolean;
70
- export declare function buildCatalog(models: CompiledModel[]): PackageCatalog;
70
+ export declare const isReportModel: (path: string | undefined, reportPaths: ReadonlySet<string>) => boolean;
71
+ export declare function buildCatalog(models: CompiledModel[],
72
+ /** The package's report paths (`GET …/reports`), left out of the catalog. */
73
+ reportPaths?: ReadonlySet<string>): PackageCatalog;
@@ -1,3 +1,4 @@
1
+ import { ReportLayout } from '../Package/documentLocation';
1
2
  import { ChartState } from './chartLine';
2
3
  /** One `import` line. The file needs both forms, and for different reasons. */
3
4
  export type DashboardImport =
@@ -217,11 +218,9 @@ export interface DashboardDimension {
217
218
  name: string;
218
219
  expression: string;
219
220
  }
220
- /** Which surface the file is: a notebook is the same file with one column. */
221
- export type DocumentKind = "dashboard" | "notebook";
222
221
  export interface DashboardDocument {
223
- /** `## artifact { kind=… }`; the reader leaves it out for a dashboard. */
224
- kind?: DocumentKind;
222
+ /** The report's layout, as its tag decides it: a linear report is the same file drawn as one column. */
223
+ layout: ReportLayout;
225
224
  title: string;
226
225
  /** The narrative header, as markdown. Emitted as `##"` lines. */
227
226
  description?: string;
@@ -1,7 +1,7 @@
1
1
  import { QueryClient, QueryKey } from '@tanstack/react-query';
2
2
  import { Workspace } from '../DocumentStorage';
3
3
  import { ApiClients } from '../ServerProvider';
4
- import { SavesTo } from '../Dashboard/telemetry';
4
+ import { SavesTo } from '../Report/telemetry';
5
5
  export type { SavesTo };
6
6
  /**
7
7
  * The record when one declares itself, and otherwise the first writeable
@@ -1,5 +1,9 @@
1
1
  import { DashboardDocument, DashboardImport } from './document';
2
- /** How the document at `documentPath` names the model at `modelPath`. */
2
+ /**
3
+ * How the report at `documentPath` names the model at `modelPath`: relative to
4
+ * the report's own folder, with no leading `./` (`"storefront.malloy"` beside
5
+ * it, `"../storefront.malloy"` from one folder down).
6
+ */
3
7
  export declare function importPathOf(modelPath: string, documentPath: string): string;
4
8
  /**
5
9
  * Whether the file can already see `name`: it extends it, imports it by name,
@@ -155,6 +155,8 @@ export interface ParsedMalloy {
155
155
  givens: TreeGiven[];
156
156
  /** The closed floating `(markdown)` / `(text)` blocks, in file order. */
157
157
  textBlocks: TreeTextBlock[];
158
+ /** The file's own model-level notes (`##` lines and `##|` blocks), as written; a report's tag is read from these. */
159
+ modelNotes: string[];
158
160
  /** The comment token on `line`, if the line ends with one. */
159
161
  trailingComment(line: number): Span | undefined;
160
162
  /**
@@ -215,6 +217,13 @@ export type Ctx = Record<string, unknown> & {
215
217
  };
216
218
  /** A rule context we can take a range from; terminals and empties are not. */
217
219
  export declare const isRule: (c: Ctx | undefined) => boolean;
220
+ /**
221
+ * The model-level notes of a parse: each top-level statement's own
222
+ * `docAnnotations`, as written, a `##|` block without its closer. The
223
+ * server's `modelNotesOfParse` reads the same notes, so a report's tag is
224
+ * read from the same text on both sides.
225
+ */
226
+ export declare function readModelNotes(r: Reader, root: Ctx): string[];
218
227
  export declare class Reader {
219
228
  readonly text: string;
220
229
  private readonly map;
@@ -16,4 +16,10 @@ export interface NewDashboard {
16
16
  export declare function slugFor(title: string): string;
17
17
  /** Why this dashboard cannot be written as a file, or undefined when it can. */
18
18
  export declare function newDashboardProblem({ title, modelPath, source, view, }: NewDashboard): string | undefined;
19
- export declare function newDashboardSource(dashboard: NewDashboard): string;
19
+ /**
20
+ * A new grid report; see `newReportSource`, which writes both layouts from
21
+ * one template.
22
+ */
23
+ export declare function newDashboardSource(dashboard: NewDashboard,
24
+ /** The package path the report is written at; the import is relative to it. Default: the root. */
25
+ reportPath?: string): string;
@@ -1,7 +1,7 @@
1
1
  import { DashboardDocument, LocalGiven } from './document';
2
2
  import { ParsedMalloy } from './malloyTree';
3
3
  /**
4
- * Read a `dashboards/*.malloy` file into a {@link DashboardDocument}.
4
+ * Read a report file (either layout, anywhere in the package) into a {@link DashboardDocument}.
5
5
  *
6
6
  * PURE: source text in, document out. No server, no schema, no connection.
7
7
  * `Malloy.parse` needs none of those — only `Malloy.compile` does — so this runs
@@ -29,7 +29,7 @@ export interface ReadFailure {
29
29
  reason: string;
30
30
  /** 1-based, for a message that can point at the line. */
31
31
  line?: number;
32
- /** The file is a `kind=notebook` in the run-cell format, which `convertLegacyNotebook` turns into a layout notebook. */
32
+ /** The file is a linear report in the run-cell format, which `convertLegacyNotebook` turns into a tile layout. */
33
33
  legacyNotebook?: true;
34
34
  }
35
35
  export type ReadResult = {
@@ -102,7 +102,9 @@ type ParseTags = (lines: string[]) => {
102
102
  */
103
103
  export declare function localGivens(parsed: ParsedMalloy, lines: string[], parse: ParseTags): LocalGiven[] | undefined;
104
104
  /** Refuses rather than throws: `Tag.text()` throws on a malformed date literal such as `@2024-13-01`, and dropping the value would lose it on the next save. */
105
- export declare function readDashboardDocument(sourceText: string, modelPath?: string,
106
- /** A document the host keeps as text has no folder to take a kind from, so the layout decides. */
107
- textHeld?: boolean): Promise<ReadResult>;
105
+ export declare function readDashboardDocument(sourceText: string,
106
+ /** The file's path. Kept for callers; where a report lives never decides its layout. */
107
+ _modelPath?: string,
108
+ /** Kept for callers: text held by a host is read by the same rule as a file. */
109
+ _textHeld?: boolean): Promise<ReadResult>;
108
110
  export {};
@@ -13,4 +13,4 @@ export type EditorOpen = {
13
13
  reason: string;
14
14
  };
15
15
  /** Read `text` for the builder, converting a cell-format notebook rather than refusing it. */
16
- export declare function readForEditor(text: string, modelPath?: string, textHeld?: boolean): Promise<EditorOpen>;
16
+ export declare function readForEditor(text: string): Promise<EditorOpen>;
@@ -0,0 +1,52 @@
1
+ import { ReportLayout } from '../Package/documentLocation';
2
+ /**
3
+ * What a file's model-level notes make it, by the server's rule
4
+ * (`readReportTag`, `docs/reports-design.md` §1, §2):
5
+ *
6
+ * - `none`: no model-level `## artifact` note, so not a report.
7
+ * - `unparsed`: an artifact note the tag parser rejects, so not a report.
8
+ * - `kind-removed`: the tag sets the removed `kind=`, so not a report.
9
+ * - `report`: a report, with its layout.
10
+ */
11
+ export type ReportTag = {
12
+ status: "none";
13
+ } | {
14
+ status: "unparsed";
15
+ errors: string[];
16
+ } | {
17
+ status: "kind-removed";
18
+ kind: string;
19
+ } | {
20
+ status: "report";
21
+ layout: ReportLayout;
22
+ };
23
+ type Parsed = {
24
+ tag: TagReads;
25
+ log: Array<{
26
+ message: string;
27
+ }>;
28
+ };
29
+ type TagReads = {
30
+ tag(key: string): TagReads | undefined;
31
+ text(key: string): string | undefined;
32
+ has(key: string): boolean;
33
+ };
34
+ /** Why a `kind=` tag makes no report, and the fix: the server's message, word for word. */
35
+ export declare const kindRemovedReason: (kind: string) => string;
36
+ /**
37
+ * The one reader of a report's tag in the SDK, over a file's model-level
38
+ * notes (`ParsedMalloy.modelNotes`). The server's `readReportTag` is the same
39
+ * rule over the same notes; `reportLayoutParity.json` holds the two together.
40
+ *
41
+ * The layout, first match wins: `layout=grid|linear`; else grid when the tag
42
+ * lists `tiles` (an empty list counts) or a model-level `dashboard { … }` grid
43
+ * tag is present; else linear.
44
+ */
45
+ export declare function readReportTag(modelNotes: readonly string[], parseAnnotation: (lines: string[]) => Parsed): ReportTag;
46
+ /**
47
+ * {@link readReportTag} over raw text, parsed for its notes and nothing else:
48
+ * the answer for a file whatever else is wrong with it, as the server reads a
49
+ * file that does not compile.
50
+ */
51
+ export declare function readReportTagOfText(text: string): Promise<ReportTag>;
52
+ export {};
@@ -13,7 +13,7 @@ import { spliceFailed, SpliceFailure, SpliceResult } from './spliceResult';
13
13
  */
14
14
  export declare function syntaxErrors(text: string): Promise<string[]>;
15
15
  /**
16
- * Write a change back into a `dashboards/*.malloy` file by PATCHING it.
16
+ * Write a change back into a report file by PATCHING it.
17
17
  *
18
18
  * The builder does not regenerate the file. It rewrites the bytes it owns and
19
19
  * leaves every other byte exactly where it was, which is what lets it edit a
@@ -57,12 +57,6 @@ export declare const tileFileKey: (t: DashboardTile) => string;
57
57
  /** Why a text tile's markdown cannot be written into a block, or undefined when it can: the writer's refusals, for an editor to show live. */
58
58
  export declare function markdownProblem(markdown: string): string | undefined;
59
59
  export interface SpliceOptions {
60
- /** Lets `requested.kind` differ from the file's: the one edit that switches a dashboard to a notebook or back. */
61
- changeKind?: boolean;
62
- /** The file's path within the package; a dashboard under `notebooks/` is tagged `kind=dashboard` rather than left untagged. */
63
- modelPath?: string;
64
- /** Write `kind=dashboard` too, whatever the folder: for a document held as text, which the server reads by its tags and not by a folder. */
65
- explicitKind?: boolean;
66
60
  /** The sources a document held as text sees without an `import`: its run model's. */
67
61
  visibleSources?: readonly string[];
68
62
  }
@@ -1,6 +1,6 @@
1
1
  import { RefObject } from 'react';
2
2
  import { DashboardDocument } from './document';
3
- import { DashboardEditor } from './useDashboardEditor';
3
+ import { ReportEditorHandle } from './useReportEditor';
4
4
  import { SaveOutcome, LastSave } from './useDocumentEditor';
5
5
  /**
6
6
  * The builder's selection, and the flash that points at what undo and redo
@@ -12,7 +12,7 @@ import { SaveOutcome, LastSave } from './useDocumentEditor';
12
12
  * author is already looking at what they changed.
13
13
  */
14
14
  export declare function useBuilderSelection({ editor, gridBox, }: {
15
- editor: DashboardEditor;
15
+ editor: ReportEditorHandle;
16
16
  /** The grid's box, searched for the changed tile to scroll to. */
17
17
  gridBox: RefObject<HTMLDivElement | null>;
18
18
  }): {
@@ -1,14 +1,14 @@
1
1
  import { PackageCatalog, CatalogField } from './catalog';
2
2
  import { BuilderControl, BuilderGiven, MappingRow } from './controls';
3
3
  import { DashboardDocument, LocalGiven, QueryTile } from './document';
4
- import { DashboardEditor } from './useDashboardEditor';
4
+ import { ReportEditorHandle } from './useReportEditor';
5
5
  import { Dispatch, SetStateAction } from 'react';
6
6
  /**
7
7
  * The document's controls, the fields each tile may bind one to, and the
8
8
  * filter window that edits them — the one place a filter is configured.
9
9
  */
10
10
  export declare function useControlBindings({ editor, opened, givens, catalog, }: {
11
- editor: DashboardEditor;
11
+ editor: ReportEditorHandle;
12
12
  /** The document as the host opened it, before any edit here. */
13
13
  opened: DashboardDocument;
14
14
  /** The givens the host resolved across the model and its imports. */
@@ -0,0 +1,25 @@
1
+ import { ListedReport } from '../Package/documentLocation';
2
+ import { PackageCatalog } from './catalog';
3
+ /**
4
+ * The catalog a report's builder offers: every source the package publishes,
5
+ * less the reports (offering a report's own tile views would be circular) and
6
+ * this file. A tile runs against this file and may read only the package
7
+ * surface; files off it are not readable anyway (their model GET is 404).
8
+ *
9
+ * Nothing cached depends on the listing or on `modelPath`: the model listing
10
+ * is cached per package version, and each model under its own path, so the
11
+ * exclusions are applied on render and always follow the current listing and
12
+ * path. A listing that failed and then recovered, or a second report opened
13
+ * from the same cache, never inherits what a first read left out. The models
14
+ * excluded now are not fetched, so the builder never re-reads its own file or
15
+ * another report. Undefined until the listing and every model it needs have
16
+ * answered.
17
+ */
18
+ export declare function useEditorCatalog({ environmentName, packageName, versionId, modelPath, reports, reportsSettled, }: {
19
+ environmentName: string;
20
+ packageName: string;
21
+ versionId?: string;
22
+ modelPath: string;
23
+ reports: readonly ListedReport[];
24
+ reportsSettled: boolean;
25
+ }): PackageCatalog | undefined;
@@ -1,5 +1,5 @@
1
1
  import { DocumentStorage, Workspace } from '../DocumentStorage';
2
- import { DocumentKind } from './document';
2
+ import { ReportLayout } from '../Package/documentLocation';
3
3
  import { Dispatch, SetStateAction } from 'react';
4
4
  /**
5
5
  * The host's copy of the document, if one was saved earlier: which workspace
@@ -8,9 +8,11 @@ import { Dispatch, SetStateAction } from 'react';
8
8
  * Read once per document, from the host's {@link DocumentStorage}. A host
9
9
  * without one has nothing to read, so the answer is in at once.
10
10
  */
11
- export declare function useHostCopy({ storage, kind, notebook, environmentName, packageName, modelPath, }: {
11
+ export declare function useHostCopy({ storage, layout, notebook, environmentName, packageName, modelPath, }: {
12
12
  storage: DocumentStorage | undefined;
13
- kind: DocumentKind;
13
+ /** The layout the report opened with; a read finds the copy at its path whatever its layout. */
14
+ layout: ReportLayout;
15
+ /** The report opened linear: only an authoritative store's copy of it is read. */
14
16
  notebook: boolean;
15
17
  environmentName: string;
16
18
  packageName: string;
@@ -1,8 +1,9 @@
1
1
  import { MutableRefObject, Dispatch, SetStateAction, RefObject } from 'react';
2
2
  import { Workspace } from '../DocumentStorage';
3
3
  import { DashboardDocument } from './document';
4
- import { BuilderEvent } from './telemetry';
5
- export declare const LEGACY_REFUSAL = "a .malloynb notebook is read, not edited. Fix: rewrite it as a `.malloy` notebook under notebooks/ to edit it here.";
4
+ import { ReportLayout } from '../Package/documentLocation';
5
+ import { ReportEventHandler } from '../Report/telemetry';
6
+ export declare const LEGACY_REFUSAL = "a .malloynb notebook is read, not edited. Fix: rewrite it as a `.malloy` report to edit it here.";
6
7
  /** The document the builder is on, and what it was opened from. */
7
8
  export interface OpenedDocument {
8
9
  source: string;
@@ -24,7 +25,7 @@ export interface OpenedDocument {
24
25
  * refusal), and keeps a newer version behind a banner rather than loading it
25
26
  * over work the reader has not saved.
26
27
  */
27
- export declare function useOpenedDocument({ workspace, draft, draftChecked, readFailure, packageText, fetchedAt, packageSettled, modelPath, notebook, noun, refusedEvent, legacyFormat, textHeld, startedAt, onEventRef, }: {
28
+ export declare function useOpenedDocument({ workspace, draft, draftChecked, readFailure, packageText, fetchedAt, packageSettled, modelPath, layout, notebook, noun, legacyFormat, textHeld, startedAt, onEventRef, }: {
28
29
  workspace: Workspace | undefined;
29
30
  /** The host's copy, if one was read. */
30
31
  draft: string | undefined;
@@ -38,15 +39,16 @@ export declare function useOpenedDocument({ workspace, draft, draftChecked, read
38
39
  /** Whether the package's fetch has succeeded and is not refetching. */
39
40
  packageSettled: boolean;
40
41
  modelPath: string;
42
+ /** The layout the host opened it as: what a failure before the text is read reports. */
43
+ layout: ReportLayout;
41
44
  notebook: boolean;
42
45
  noun: string;
43
- refusedEvent: "notebook.open_refused" | "dashboard.open_refused";
44
46
  legacyFormat: boolean;
45
47
  /** The document is held as text by the host: there is no package file to fall back on. */
46
48
  textHeld: boolean;
47
49
  /** When the open was asked for, so "opened" can say how long it took. */
48
50
  startedAt: MutableRefObject<number>;
49
- onEventRef: MutableRefObject<((event: BuilderEvent) => void) | undefined>;
51
+ onEventRef: MutableRefObject<ReportEventHandler | undefined>;
50
52
  }): {
51
53
  authoritative: boolean;
52
54
  blockedOnRecord: boolean;