@malloy-publisher/sdk 0.9.6 → 0.9.8

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 (350) hide show
  1. package/README.md +117 -17
  2. package/dist/{RenderedResult-qnpbr4tc.cjs.js → RenderedResult-BrvrMDAP.cjs.js} +1 -1
  3. package/dist/{RenderedResult-BUb2Xvr2.es.js → RenderedResult-DZj-FnOJ.es.js} +2 -2
  4. package/dist/{ServerProvider-C6QQVKPm.es.js → ServerProvider-B_bPAsu2.es.js} +595 -410
  5. package/dist/ServerProvider-DuEOzwPc.cjs.js +1 -0
  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 +489 -111
  10. package/dist/client/index.cjs.js +1 -1
  11. package/dist/client/index.es.js +105 -95
  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/DataSchemaDialog.d.ts +26 -0
  24. package/dist/components/Package/NewDocumentDialog.d.ts +19 -10
  25. package/dist/components/Package/Package.d.ts +14 -9
  26. package/dist/components/Package/documentLocation.d.ts +66 -23
  27. package/dist/components/Package/index.d.ts +3 -2
  28. package/dist/components/Package/reportQueries.d.ts +8 -0
  29. package/dist/components/Package/useDocumentLocation.d.ts +36 -6
  30. package/dist/components/Package/useDraftLayout.d.ts +20 -0
  31. package/dist/components/Report/CellReport.d.ts +89 -0
  32. package/dist/components/Report/LinearReport.d.ts +18 -0
  33. package/dist/components/Report/Report.d.ts +62 -0
  34. package/dist/components/Report/index.d.ts +2 -0
  35. package/dist/components/Report/telemetry.d.ts +163 -0
  36. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.d.ts +2 -2
  37. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.d.ts +2 -2
  38. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.d.ts +5 -4
  39. package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.d.ts +5 -1
  40. package/dist/components/{DashboardBuilder → ReportBuilder}/EditorSurface.d.ts +10 -7
  41. package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts} +17 -8
  42. package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts} +41 -14
  43. package/dist/components/ReportBuilder/builderReport.d.ts +14 -0
  44. package/dist/components/{DashboardBuilder → ReportBuilder}/catalog.d.ts +8 -5
  45. package/dist/components/{DashboardBuilder → ReportBuilder}/document.d.ts +3 -4
  46. package/dist/components/{DashboardBuilder → ReportBuilder}/documentSession.d.ts +1 -1
  47. package/dist/components/{DashboardBuilder → ReportBuilder}/imports.d.ts +5 -1
  48. package/dist/components/{DashboardBuilder → ReportBuilder}/malloyTree.d.ts +9 -0
  49. package/dist/components/{DashboardBuilder → ReportBuilder}/newDashboard.d.ts +7 -1
  50. package/dist/components/{DashboardBuilder → ReportBuilder}/readDocument.d.ts +7 -5
  51. package/dist/components/{DashboardBuilder → ReportBuilder}/readForEditor.d.ts +1 -1
  52. package/dist/components/ReportBuilder/reportTag.d.ts +52 -0
  53. package/dist/components/{DashboardBuilder → ReportBuilder}/spliceDocument.d.ts +1 -7
  54. package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.d.ts +2 -2
  55. package/dist/components/{DashboardBuilder → ReportBuilder}/useControlBindings.d.ts +2 -2
  56. package/dist/components/ReportBuilder/useEditorCatalog.d.ts +25 -0
  57. package/dist/components/{DashboardBuilder → ReportBuilder}/useHostCopy.d.ts +5 -3
  58. package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.d.ts +7 -5
  59. package/dist/components/{DashboardBuilder/useDashboardEditor.d.ts → ReportBuilder/useReportEditor.d.ts} +3 -7
  60. package/dist/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.d.ts +6 -4
  61. package/dist/components/{DashboardBuilder → ReportBuilder}/useTileEditing.d.ts +2 -2
  62. package/dist/components/ServerProvider.d.ts +2 -1
  63. package/dist/components/drill/resolveDrill.d.ts +8 -1
  64. package/dist/components/drill/useDrillSelf.d.ts +4 -2
  65. package/dist/components/index.d.ts +2 -1
  66. package/dist/components/{Dashboard → legacy}/Dashboard.d.ts +15 -9
  67. package/dist/components/legacy/MalloynbCells.d.ts +13 -0
  68. package/dist/components/legacy/Notebook.d.ts +15 -0
  69. package/dist/components/{DashboardBuilder → legacy}/NotebookEditor.d.ts +3 -3
  70. package/dist/components/legacy/builderNames.d.ts +10 -0
  71. package/dist/components/legacy/index.d.ts +11 -0
  72. package/dist/components/legacy/kindAdapter.d.ts +11 -0
  73. package/dist/components/legacy/kindTypedDrafts.d.ts +10 -0
  74. package/dist/components/legacy/nameAlias.d.ts +44 -0
  75. package/dist/components/legacy/queryKeys.d.ts +8 -0
  76. package/dist/index.cjs.js +19 -19
  77. package/dist/index.es.js +7984 -7452
  78. package/dist/text/index.es.js +2 -2
  79. package/dist/{text-entry-CA0LZ1xL.es.js → text-entry-72YFLeNk.es.js} +10 -10
  80. package/dist/useCompiledDocument-oocN5cGE.cjs.js +141 -0
  81. package/dist/{useCompiledDocument-0sxonf6N.es.js → useCompiledDocument-x0B2RAH3.es.js} +4593 -4395
  82. package/package.json +2 -2
  83. package/src/builder-entry.ts +32 -24
  84. package/src/components/Dashboard/DashboardTile.tsx +17 -0
  85. package/src/components/Dashboard/DashboardView.spec.tsx +0 -21
  86. package/src/components/Dashboard/DashboardView.tsx +8 -24
  87. package/src/components/Dashboard/dropValueUrlTags.spec.ts +1 -4
  88. package/src/components/Dashboard/index.ts +0 -2
  89. package/src/components/DocumentCreate/createDocument.spec.ts +346 -53
  90. package/src/components/DocumentCreate/createDocument.ts +143 -63
  91. package/src/components/DocumentCreate/documentPath.ts +41 -12
  92. package/src/components/DocumentCreate/guards.ts +7 -15
  93. package/src/components/DocumentCreate/index.ts +3 -7
  94. package/src/components/DocumentCreate/newNotebook.spec.ts +113 -43
  95. package/src/components/DocumentCreate/newNotebook.ts +32 -10
  96. package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +130 -28
  97. package/src/components/DocumentStorage/BrowserDocumentStorage.ts +78 -40
  98. package/src/components/DocumentStorage/DocumentStorage.contract.spec.tsx +426 -0
  99. package/src/components/DocumentStorage/DocumentStorage.ts +57 -24
  100. package/src/components/Home/AddEnvironmentDialog.tsx +1 -1
  101. package/src/components/Home/Home.tsx +1 -1
  102. package/src/components/Loading.tsx +1 -1
  103. package/src/components/Model/SourcesExplorer.tsx +1 -1
  104. package/src/components/Notebook/NotebookCell.tsx +6 -5
  105. package/src/components/Notebook/cellKind.spec.ts +15 -7
  106. package/src/components/Package/DataSchemaDialog.spec.tsx +85 -0
  107. package/src/components/Package/DataSchemaDialog.tsx +367 -0
  108. package/src/components/Package/NewDocumentDialog.spec.tsx +145 -88
  109. package/src/components/Package/NewDocumentDialog.tsx +93 -48
  110. package/src/components/Package/Package.artifacts.spec.tsx +79 -60
  111. package/src/components/Package/Package.create.spec.tsx +126 -112
  112. package/src/components/Package/Package.notebooks.spec.tsx +46 -27
  113. package/src/components/Package/Package.spec.tsx +43 -30
  114. package/src/components/Package/Package.tsx +173 -292
  115. package/src/components/Package/documentLocation.spec.ts +145 -50
  116. package/src/components/Package/documentLocation.ts +118 -39
  117. package/src/components/Package/index.ts +12 -3
  118. package/src/components/Package/reportQueries.ts +25 -0
  119. package/src/components/Package/useDocumentLocation.spec.ts +58 -0
  120. package/src/components/Package/useDocumentLocation.ts +90 -32
  121. package/src/components/Package/useDraftLayout.spec.tsx +143 -0
  122. package/src/components/Package/useDraftLayout.ts +81 -0
  123. package/src/components/Prose.spec.tsx +3 -3
  124. package/src/components/RenderedResult/RenderedResult.tsx +1 -1
  125. package/src/components/Report/CellReport.spec.tsx +155 -0
  126. package/src/components/{Notebook/Notebook.tsx → Report/CellReport.tsx} +178 -220
  127. package/src/components/Report/LinearReport.tsx +71 -0
  128. package/src/components/Report/Report.spec.tsx +238 -0
  129. package/src/components/Report/Report.telemetry.spec.tsx +292 -0
  130. package/src/components/Report/Report.tsx +277 -0
  131. package/src/components/Report/index.ts +12 -0
  132. package/src/components/Report/telemetry.spec.ts +90 -0
  133. package/src/components/Report/telemetry.ts +250 -0
  134. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.tsx +5 -5
  135. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.tsx +2 -2
  136. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.tsx +6 -7
  137. package/src/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.tsx +33 -0
  138. package/src/components/{DashboardBuilder → ReportBuilder}/DrillDialog.tsx +2 -2
  139. package/src/components/{DashboardBuilder → ReportBuilder}/EditorSurface.tsx +67 -107
  140. package/src/components/{DashboardBuilder → ReportBuilder}/FilterDialog.tsx +3 -4
  141. package/src/components/{DashboardBuilder/DashboardBuilder.charts.spec.tsx → ReportBuilder/ReportBuilder.charts.spec.tsx} +4 -4
  142. package/src/components/{DashboardBuilder/DashboardBuilder.exit.spec.tsx → ReportBuilder/ReportBuilder.exit.spec.tsx} +5 -5
  143. package/src/components/{DashboardBuilder/DashboardBuilder.inline.spec.tsx → ReportBuilder/ReportBuilder.inline.spec.tsx} +4 -4
  144. package/src/components/ReportBuilder/ReportBuilder.layoutSwitch.spec.tsx +145 -0
  145. package/src/components/{DashboardBuilder/DashboardBuilder.notebook.spec.tsx → ReportBuilder/ReportBuilder.notebook.spec.tsx} +22 -21
  146. package/src/components/{DashboardBuilder/DashboardBuilder.openDraft.spec.tsx → ReportBuilder/ReportBuilder.openDraft.spec.tsx} +3 -3
  147. package/src/components/{DashboardBuilder/DashboardBuilder.sources.spec.tsx → ReportBuilder/ReportBuilder.sources.spec.tsx} +19 -8
  148. package/src/components/{DashboardBuilder/DashboardBuilder.spec.tsx → ReportBuilder/ReportBuilder.spec.tsx} +34 -34
  149. package/src/components/{DashboardBuilder/DashboardBuilder.textTiles.spec.tsx → ReportBuilder/ReportBuilder.textTiles.spec.tsx} +5 -5
  150. package/src/components/{DashboardBuilder/DashboardBuilder.tsx → ReportBuilder/ReportBuilder.tsx} +46 -21
  151. package/src/components/{DashboardBuilder/DashboardEditor.authoritative.spec.tsx → ReportBuilder/ReportEditor.authoritative.spec.tsx} +28 -20
  152. package/src/components/{DashboardBuilder/DashboardEditor.emptyStart.spec.tsx → ReportBuilder/ReportEditor.emptyStart.spec.tsx} +19 -11
  153. package/src/components/{DashboardBuilder/DashboardEditor.filterTag.spec.tsx → ReportBuilder/ReportEditor.filterTag.spec.tsx} +7 -7
  154. package/src/components/{DashboardBuilder/DashboardEditor.notebook.spec.tsx → ReportBuilder/ReportEditor.notebook.spec.tsx} +70 -49
  155. package/src/components/{DashboardBuilder/DashboardEditor.package.spec.tsx → ReportBuilder/ReportEditor.package.spec.tsx} +52 -8
  156. package/src/components/{DashboardBuilder/DashboardEditor.resourceUri.spec.tsx → ReportBuilder/ReportEditor.resourceUri.spec.tsx} +50 -18
  157. package/src/components/{DashboardBuilder/DashboardEditor.spec.tsx → ReportBuilder/ReportEditor.spec.tsx} +65 -20
  158. package/src/components/{DashboardBuilder/DashboardEditor.textSource.spec.tsx → ReportBuilder/ReportEditor.textSource.spec.tsx} +6 -6
  159. package/src/components/{DashboardBuilder/DashboardEditor.tsx → ReportBuilder/ReportEditor.tsx} +92 -35
  160. package/src/components/{DashboardBuilder → ReportBuilder}/addTile.compile.spec.ts +6 -4
  161. package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.spec.ts +1 -0
  162. package/src/components/{DashboardBuilder → ReportBuilder}/artifactBlock.spec.ts +21 -29
  163. package/src/components/ReportBuilder/builderReport.ts +53 -0
  164. package/src/components/{DashboardBuilder → ReportBuilder}/catalog.spec.ts +28 -10
  165. package/src/components/{DashboardBuilder → ReportBuilder}/catalog.ts +17 -10
  166. package/src/components/{DashboardBuilder → ReportBuilder}/controls.spec.ts +1 -0
  167. package/src/components/{DashboardBuilder → ReportBuilder}/document.ts +4 -7
  168. package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.spec.ts +5 -5
  169. package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.ts +1 -1
  170. package/src/components/{DashboardBuilder → ReportBuilder}/imports.spec.ts +6 -2
  171. package/src/components/{DashboardBuilder → ReportBuilder}/imports.ts +8 -4
  172. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.chart.spec.ts +1 -1
  173. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.convert.spec.ts +9 -13
  174. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.read.spec.ts +15 -15
  175. package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.ts +7 -2
  176. package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.ts +25 -0
  177. package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.spec.ts +12 -4
  178. package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.ts +11 -24
  179. package/src/components/{DashboardBuilder → ReportBuilder}/preview.spec.ts +1 -0
  180. package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.spec.ts +64 -36
  181. package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.ts +33 -32
  182. package/src/components/ReportBuilder/readForEditor.spec.ts +96 -0
  183. package/src/components/{DashboardBuilder → ReportBuilder}/readForEditor.ts +3 -11
  184. package/src/components/ReportBuilder/reportTag.ts +108 -0
  185. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.imports.spec.ts +28 -1
  186. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.spec.ts +32 -3
  187. package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.ts +37 -60
  188. package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.spec.ts +3 -3
  189. package/src/components/{DashboardBuilder → ReportBuilder}/testing/artifactTagParity.json +2 -2
  190. package/src/components/ReportBuilder/testing/drillResolution.json +279 -0
  191. package/src/components/ReportBuilder/testing/reportLayoutParity.json +125 -0
  192. package/src/components/{DashboardBuilder → ReportBuilder}/textTiles.spec.ts +66 -143
  193. package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.ts +2 -2
  194. package/src/components/{DashboardBuilder → ReportBuilder}/useControlBindings.ts +2 -2
  195. package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +156 -0
  196. package/src/components/ReportBuilder/useEditorCatalog.ts +119 -0
  197. package/src/components/{DashboardBuilder → ReportBuilder}/useHostCopy.ts +7 -5
  198. package/src/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.ts +56 -35
  199. package/src/components/{DashboardBuilder/useDashboardEditor.spec.ts → ReportBuilder/useReportEditor.spec.ts} +6 -6
  200. package/src/components/{DashboardBuilder/useDashboardEditor.ts → ReportBuilder/useReportEditor.ts} +6 -17
  201. package/src/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.ts +36 -35
  202. package/src/components/{DashboardBuilder → ReportBuilder}/useTileEditing.ts +2 -2
  203. package/src/components/ServerProvider.tsx +2 -0
  204. package/src/components/drill/resolveDrill.ts +9 -2
  205. package/src/components/drill/useDrill.tsx +1 -0
  206. package/src/components/drill/useDrillSelf.spec.tsx +60 -7
  207. package/src/components/drill/useDrillSelf.ts +29 -12
  208. package/src/components/index.ts +2 -1
  209. package/src/components/{Dashboard → legacy}/Dashboard.spec.tsx +1 -1
  210. package/src/components/{Dashboard → legacy}/Dashboard.tsx +40 -28
  211. package/src/components/legacy/MalloynbCells.tsx +88 -0
  212. package/src/components/{Notebook → legacy}/Notebook.served.spec.tsx +17 -13
  213. package/src/components/{Notebook → legacy}/Notebook.spec.tsx +24 -20
  214. package/src/components/legacy/Notebook.tsx +44 -0
  215. package/src/components/{DashboardBuilder → legacy}/NotebookEditor.tsx +7 -4
  216. package/src/components/legacy/builderNames.ts +25 -0
  217. package/src/components/legacy/index.ts +20 -0
  218. package/src/components/legacy/kindAdapter.ts +19 -0
  219. package/src/components/legacy/kindTypedDrafts.ts +34 -0
  220. package/src/components/legacy/nameAlias.spec.ts +124 -0
  221. package/src/components/legacy/nameAlias.ts +95 -0
  222. package/src/components/legacy/queryKeys.ts +26 -0
  223. package/src/hooks/useGivensState.spec.ts +9 -9
  224. package/src/mainEntry.spec.ts +1 -1
  225. package/src/textEntry.spec.ts +9 -9
  226. package/src/utils/formatting.spec.ts +5 -5
  227. package/src/utils/parsing.spec.ts +1 -1
  228. package/src/utils/parsing.ts +1 -1
  229. package/dist/ServerProvider-Gj-im5VD.cjs.js +0 -1
  230. package/dist/components/Dashboard/telemetry.d.ts +0 -73
  231. package/dist/components/DashboardBuilder/builderReport.d.ts +0 -13
  232. package/dist/components/DashboardBuilder/telemetry.d.ts +0 -43
  233. package/dist/components/DocumentCreate/events.d.ts +0 -10
  234. package/dist/components/Notebook/Notebook.d.ts +0 -52
  235. package/dist/components/Notebook/index.d.ts +0 -1
  236. package/dist/useCompiledDocument-tBejqZ7s.cjs.js +0 -142
  237. package/src/components/Dashboard/telemetry.ts +0 -75
  238. package/src/components/DashboardBuilder/builderReport.ts +0 -74
  239. package/src/components/DashboardBuilder/readForEditor.spec.ts +0 -80
  240. package/src/components/DashboardBuilder/telemetry.ts +0 -47
  241. package/src/components/DashboardBuilder/testing/documentKindRule.json +0 -40
  242. package/src/components/DocumentCreate/events.ts +0 -15
  243. package/src/components/Notebook/index.ts +0 -4
  244. /package/dist/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.d.ts +0 -0
  245. /package/dist/components/{DashboardBuilder → ReportBuilder}/ChartPicker.d.ts +0 -0
  246. /package/dist/components/{DashboardBuilder → ReportBuilder}/DrillDialog.d.ts +0 -0
  247. /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterDialog.d.ts +0 -0
  248. /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterStrip.d.ts +0 -0
  249. /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.d.ts +0 -0
  250. /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineText.d.ts +0 -0
  251. /package/dist/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.d.ts +0 -0
  252. /package/dist/components/{DashboardBuilder → ReportBuilder}/TextTileBody.d.ts +0 -0
  253. /package/dist/components/{DashboardBuilder → ReportBuilder}/TileFrame.d.ts +0 -0
  254. /package/dist/components/{DashboardBuilder → ReportBuilder}/TileMenu.d.ts +0 -0
  255. /package/dist/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.d.ts +0 -0
  256. /package/dist/components/{DashboardBuilder → ReportBuilder}/annotationText.d.ts +0 -0
  257. /package/dist/components/{DashboardBuilder → ReportBuilder}/changedTile.d.ts +0 -0
  258. /package/dist/components/{DashboardBuilder → ReportBuilder}/chartLine.d.ts +0 -0
  259. /package/dist/components/{DashboardBuilder → ReportBuilder}/controls.d.ts +0 -0
  260. /package/dist/components/{DashboardBuilder → ReportBuilder}/inlineEdit.d.ts +0 -0
  261. /package/dist/components/{DashboardBuilder → ReportBuilder}/layout.d.ts +0 -0
  262. /package/dist/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.d.ts +0 -0
  263. /package/dist/components/{DashboardBuilder → ReportBuilder}/loadMalloy.d.ts +0 -0
  264. /package/dist/components/{DashboardBuilder → ReportBuilder}/openDraft.d.ts +0 -0
  265. /package/dist/components/{DashboardBuilder → ReportBuilder}/preview.d.ts +0 -0
  266. /package/dist/components/{DashboardBuilder → ReportBuilder}/sortable.d.ts +0 -0
  267. /package/dist/components/{DashboardBuilder → ReportBuilder}/spliceResult.d.ts +0 -0
  268. /package/dist/components/{DashboardBuilder → ReportBuilder}/tagParse.d.ts +0 -0
  269. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.d.ts +0 -0
  270. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/inline.d.ts +0 -0
  271. /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/resize.d.ts +0 -0
  272. /package/dist/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.d.ts +0 -0
  273. /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.d.ts +0 -0
  274. /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.d.ts +0 -0
  275. /package/dist/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.d.ts +0 -0
  276. /package/dist/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.d.ts +0 -0
  277. /package/dist/components/{DashboardBuilder → ReportBuilder}/useDraft.d.ts +0 -0
  278. /package/dist/components/{DashboardBuilder → ReportBuilder}/useExitGuard.d.ts +0 -0
  279. /package/dist/components/{DashboardBuilder → ReportBuilder}/useFilterForm.d.ts +0 -0
  280. /package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.d.ts +0 -0
  281. /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileReorder.d.ts +0 -0
  282. /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileResize.d.ts +0 -0
  283. /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.spec.tsx +0 -0
  284. /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.tsx +0 -0
  285. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.render.spec.tsx +0 -0
  286. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.spec.ts +0 -0
  287. /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.tsx +0 -0
  288. /package/src/components/{DashboardBuilder → ReportBuilder}/FilterStrip.tsx +0 -0
  289. /package/src/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.tsx +0 -0
  290. /package/src/components/{DashboardBuilder → ReportBuilder}/InlineText.tsx +0 -0
  291. /package/src/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.tsx +0 -0
  292. /package/src/components/{DashboardBuilder → ReportBuilder}/TextTileBody.tsx +0 -0
  293. /package/src/components/{DashboardBuilder → ReportBuilder}/TileFrame.tsx +0 -0
  294. /package/src/components/{DashboardBuilder → ReportBuilder}/TileMenu.tsx +0 -0
  295. /package/src/components/{DashboardBuilder → ReportBuilder}/__test__/inventory.ts +0 -0
  296. /package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.ts +0 -0
  297. /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.spec.ts +0 -0
  298. /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.ts +0 -0
  299. /package/src/components/{DashboardBuilder → ReportBuilder}/artifactTagParity.spec.ts +0 -0
  300. /package/src/components/{DashboardBuilder → ReportBuilder}/catalog.aggregate.spec.ts +0 -0
  301. /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.spec.ts +0 -0
  302. /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.ts +0 -0
  303. /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.spec.ts +0 -0
  304. /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.ts +0 -0
  305. /package/src/components/{DashboardBuilder → ReportBuilder}/controls.ts +0 -0
  306. /package/src/components/{DashboardBuilder → ReportBuilder}/emptyStart.spec.ts +0 -0
  307. /package/src/components/{DashboardBuilder → ReportBuilder}/inlineEdit.tsx +0 -0
  308. /package/src/components/{DashboardBuilder → ReportBuilder}/invariants.spec.ts +0 -0
  309. /package/src/components/{DashboardBuilder → ReportBuilder}/keepRowStructure.spec.ts +0 -0
  310. /package/src/components/{DashboardBuilder → ReportBuilder}/layout.ts +0 -0
  311. /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.spec.ts +0 -0
  312. /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.ts +0 -0
  313. /package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.spec.ts +0 -0
  314. /package/src/components/{DashboardBuilder → ReportBuilder}/moveIntoGap.spec.ts +0 -0
  315. /package/src/components/{DashboardBuilder → ReportBuilder}/openDraft.ts +0 -0
  316. /package/src/components/{DashboardBuilder → ReportBuilder}/preview.shapes.spec.ts +0 -0
  317. /package/src/components/{DashboardBuilder → ReportBuilder}/preview.ts +0 -0
  318. /package/src/components/{DashboardBuilder → ReportBuilder}/scannerShapes.spec.ts +0 -0
  319. /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.spec.ts +0 -0
  320. /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.tsx +0 -0
  321. /package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.chart.spec.ts +0 -0
  322. /package/src/components/{DashboardBuilder → ReportBuilder}/spliceResult.ts +0 -0
  323. /package/src/components/{DashboardBuilder → ReportBuilder}/statementExtent.spec.ts +0 -0
  324. /package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.ts +0 -0
  325. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.ts +0 -0
  326. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/inline.ts +0 -0
  327. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/resize.ts +0 -0
  328. /package/src/components/{DashboardBuilder → ReportBuilder}/testing/urlRenderTags.json +0 -0
  329. /package/src/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.ts +0 -0
  330. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.spec.ts +0 -0
  331. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.ts +0 -0
  332. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.overlay.spec.tsx +0 -0
  333. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.spec.tsx +0 -0
  334. /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.ts +0 -0
  335. /package/src/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.ts +0 -0
  336. /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.spec.ts +0 -0
  337. /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.ts +0 -0
  338. /package/src/components/{DashboardBuilder → ReportBuilder}/useDraft.ts +0 -0
  339. /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.spec.ts +0 -0
  340. /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.ts +0 -0
  341. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.existing.spec.tsx +0 -0
  342. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.spec.tsx +0 -0
  343. /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.ts +0 -0
  344. /package/src/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.ts +0 -0
  345. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.spec.tsx +0 -0
  346. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.ts +0 -0
  347. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.spec.tsx +0 -0
  348. /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.ts +0 -0
  349. /package/src/components/{DashboardBuilder → ReportBuilder}/withGaps.spec.ts +0 -0
  350. /package/src/components/{Notebook → legacy}/Notebook.layout.spec.tsx +0 -0
@@ -1033,6 +1033,31 @@ source: a is one extend {
1033
1033
  expect(removed).toContain(" dimension: brand is products.brand");
1034
1034
  });
1035
1035
 
1036
+ it("writes a path target quoted, and it reads back as the same path", async () => {
1037
+ for (const to of ["sales/overview", "overview-story"]) {
1038
+ const out = await spliced(WITH_DIMENSION, (d) => {
1039
+ d.drills = [{ ...(d.drills ?? [])[0], to: [to] }];
1040
+ });
1041
+ expect(out).toContain(
1042
+ ` # drill { to="${to}" given=BRAND }\n dimension: brand is products.brand`,
1043
+ );
1044
+ const reread = await readDashboardDocument(out);
1045
+ if (readFailed(reread)) throw new Error(reread.reason);
1046
+ expect(reread.document.drills?.[0].to).toEqual([to]);
1047
+ }
1048
+ });
1049
+
1050
+ it("escapes a quote or backslash in a target, so it reads back unchanged", async () => {
1051
+ for (const to of [[`odd "name"`], ["back\\slash/x"], [`a"b`, "c\\d"]]) {
1052
+ const out = await spliced(WITH_DIMENSION, (d) => {
1053
+ d.drills = [{ ...(d.drills ?? [])[0], to }];
1054
+ });
1055
+ const reread = await readDashboardDocument(out);
1056
+ if (readFailed(reread)) throw new Error(reread.reason);
1057
+ expect(reread.document.drills?.[0].to).toEqual(to);
1058
+ }
1059
+ });
1060
+
1036
1061
  it("refuses a drill on a dimension the model declares", async () => {
1037
1062
  const r = await splice(WITH_DIMENSION, (d) => {
1038
1063
  d.drills = [
@@ -1126,7 +1151,7 @@ describe("spliceDashboardDocument: the page's own settings", () => {
1126
1151
  });
1127
1152
 
1128
1153
  describe('how many `##"` lines a description writes', () => {
1129
- const NB = `##" Old\n## artifact { kind=notebook title="T" tiles=["a -> x"] }\nimport "../m.malloy"\n\nsource: a is one extend {\n view: x is vx\n}`;
1154
+ const NB = `##" Old\n## artifact { layout=linear title="T" tiles=["a -> x"] }\nimport "../m.malloy"\n\nsource: a is one extend {\n view: x is vx\n}`;
1130
1155
 
1131
1156
  it("writes one line for a one-line description, however it ends", async () => {
1132
1157
  for (const description of [
@@ -1561,6 +1586,7 @@ describe("spliceDashboardDocument: what it refuses", () => {
1561
1586
 
1562
1587
  it("refuses to edit a file that will not open", async () => {
1563
1588
  const r = await spliceDashboardDocument("not malloy at all", {
1589
+ layout: "grid",
1564
1590
  title: "x",
1565
1591
  imports: [],
1566
1592
  sources: [],
@@ -1633,7 +1659,7 @@ function unmodelledTagsByDeclaration(text: string): Record<string, string[]> {
1633
1659
  return out;
1634
1660
  }
1635
1661
 
1636
- describe("every composite dashboard survives an edit", () => {
1662
+ describe("every not a report survives an edit", () => {
1637
1663
  const found: string[] = [];
1638
1664
  const walk = (dir: string) => {
1639
1665
  if (!fs.existsSync(dir)) return;
@@ -1650,7 +1676,10 @@ describe("every composite dashboard survives an edit", () => {
1650
1676
  const editable = found.filter((f) => {
1651
1677
  const text = fs.readFileSync(f, "utf8");
1652
1678
  return (
1653
- /##\s*artifact[\s\S]*tiles\s*=/.test(text) && !/-lint[\\/]/.test(f)
1679
+ /##\s*artifact[\s\S]*tiles\s*=/.test(text) &&
1680
+ !/-lint[\\/]/.test(f) &&
1681
+ // A report whose one tile is a named query is not one the builder edits.
1682
+ !/tiles=\["[A-Za-z_]\w*"\]/.test(text)
1654
1683
  );
1655
1684
  });
1656
1685
 
@@ -14,7 +14,6 @@ import type {
14
14
  DashboardDrill,
15
15
  DashboardSource,
16
16
  DashboardTile,
17
- DocumentKind,
18
17
  QueryTile,
19
18
  TextTile,
20
19
  } from "./document";
@@ -68,7 +67,7 @@ export async function syntaxErrors(text: string): Promise<string[]> {
68
67
  }
69
68
 
70
69
  /**
71
- * Write a change back into a `dashboards/*.malloy` file by PATCHING it.
70
+ * Write a change back into a report file by PATCHING it.
72
71
  *
73
72
  * The builder does not regenerate the file. It rewrites the bytes it owns and
74
73
  * leaves every other byte exactly where it was, which is what lets it edit a
@@ -153,8 +152,17 @@ function applyEdits(source: string, edits: Edit[]): string {
153
152
  // rewrite of the declaration it sits above — the replacement has to go
154
153
  // first, or the insertion shifts the text out from under its end offset and
155
154
  // the rewrite lands in the middle of what was just inserted.
156
- for (const edit of [...edits].sort(
157
- (a, b) => b.start - a.start || b.end - a.end,
155
+ //
156
+ // Two insertions at one point keep the order they were planned in: the
157
+ // later one is applied first, so the earlier lands in front of it, and an
158
+ // import added at a file's end stays ABOVE a source extension written at
159
+ // the same point.
160
+ const planned = edits.map((edit, index) => ({ edit, index }));
161
+ for (const { edit } of planned.sort(
162
+ (a, b) =>
163
+ b.edit.start - a.edit.start ||
164
+ b.edit.end - a.edit.end ||
165
+ b.index - a.index,
158
166
  ))
159
167
  out = out.slice(0, edit.start) + edit.text + out.slice(edit.end);
160
168
  return out;
@@ -221,9 +229,6 @@ const MODELLED_GIVEN_TAG_KEYS: ReadonlySet<string> = new Set([
221
229
  "range_max",
222
230
  ]);
223
231
 
224
- const kindOf = (document: DashboardDocument): DocumentKind =>
225
- document.kind ?? "dashboard";
226
-
227
232
  /**
228
233
  * A given's tag line, composed from its control contract. One line, in the
229
234
  * order `givens.malloy` writes them, so a file the builder wrote reads like one
@@ -281,10 +286,15 @@ function viewDeclarationLine(
281
286
 
282
287
  /** `# drill { to=… given=… }`, one line, as the reader spells it back. */
283
288
  function drillTagLine(drill: DashboardDrill): string {
289
+ // A path target (`sales/overview`) is not a bare tag value, so it is
290
+ // quoted, with `"` and `\` escaped as the tag parser reads them; a bare
291
+ // name or `self` stays as written.
292
+ const one = (d: string) =>
293
+ /^[A-Za-z_][A-Za-z0-9_]*$/.test(d) ? d : quoted(d);
284
294
  const to =
285
295
  drill.to.length === 1
286
- ? drill.to[0]
287
- : `[${drill.to.map((d) => `"${d}"`).join(", ")}]`;
296
+ ? one(drill.to[0])
297
+ : `[${drill.to.map(quoted).join(", ")}]`;
288
298
  return `# drill { to=${to}${drill.given ? ` given=${drill.given}` : ""} }`;
289
299
  }
290
300
 
@@ -334,10 +344,6 @@ interface SpliceContext extends TileMembership {
334
344
  current: DashboardDocument;
335
345
  next: DashboardDocument;
336
346
  edits: Edit[];
337
- /** The file's package path, when known. */
338
- modelPath?: string;
339
- /** A kind switch writes `kind=` whichever way it goes; see {@link SpliceOptions.explicitKind}. */
340
- explicitKind?: boolean;
341
347
  }
342
348
 
343
349
  /**
@@ -347,16 +353,8 @@ interface SpliceContext extends TileMembership {
347
353
  function checkShape(
348
354
  current: DashboardDocument,
349
355
  next: DashboardDocument,
350
- changeKind: boolean,
351
356
  visibleSources: readonly string[] | undefined,
352
357
  ): SpliceFailure | TileMembership {
353
- if (kindOf(current) !== kindOf(next) && !changeKind) {
354
- return {
355
- ok: false,
356
- reason:
357
- "The document's kind is not changed by an ordinary edit; switch it with the explicit kind change.",
358
- };
359
- }
360
358
  // Tiles ADDED and REMOVED, by identity. A removed tile's declaration goes,
361
359
  // with its `#` tags; a `//` comment above it stays, because the file cannot
362
360
  // say whether it belonged to the tile, the row or the page, and a comment
@@ -523,7 +521,7 @@ function planOrder(ctx: SpliceContext): SpliceFailure | undefined {
523
521
  return {
524
522
  ok: false,
525
523
  reason:
526
- "A dashboard with no tiles is not served, so the last tile cannot be removed. Add another tile first.",
524
+ "A grid report with no tiles is not served, so the last tile cannot be removed. Add another tile first.",
527
525
  };
528
526
  }
529
527
  const byKey = new Map<string, string>();
@@ -688,7 +686,7 @@ function planSettings(ctx: SpliceContext): SpliceFailure | undefined {
688
686
  // — the package fails to compile otherwise — and a property
689
687
  // the file spells its own way keeps that spelling when it did not change.
690
688
  if (
691
- kindOf(current) !== kindOf(next) ||
689
+ current.layout !== next.layout ||
692
690
  current.title !== next.title ||
693
691
  current.autorun !== next.autorun ||
694
692
  current.columns !== next.columns ||
@@ -708,9 +706,8 @@ function planSettings(ctx: SpliceContext): SpliceFailure | undefined {
708
706
  (edit) => edit.start === extent.start && edit.end === extent.end,
709
707
  );
710
708
  let line = already ? already.text.replace(/\n$/, "") : tag.text;
711
- // Depth-aware, since a text tile's own `kind=text` sits inside the tag.
712
- if (kindOf(current) !== kindOf(next))
713
- line = removeArtifactProperty(line, "kind");
709
+ // A layout switch rewrites `layout=` and nothing else.
710
+ const writeLayout = current.layout !== next.layout;
714
711
  // The artifact tag's braces: everything up to the matching `}`.
715
712
  const open = line.indexOf("artifact");
716
713
  const braceOpen = line.indexOf("{", open);
@@ -753,14 +750,7 @@ function planSettings(ctx: SpliceContext): SpliceFailure | undefined {
753
750
  );
754
751
  else inner = append(`${key}=${value}`);
755
752
  };
756
- if (kindOf(current) !== kindOf(next) && kindOf(next) === "notebook")
757
- inner = append("kind=notebook");
758
- // A tag with no kind takes its folder's, and the server's compile of text takes none: a switch that leaves it off lets the two disagree.
759
- else if (
760
- kindOf(current) !== kindOf(next) &&
761
- (ctx.explicitKind || !ctx.modelPath?.startsWith("dashboards/"))
762
- )
763
- inner = append("kind=dashboard");
753
+ if (writeLayout) setProperty("layout", next.layout);
764
754
  if (current.title !== next.title)
765
755
  setProperty("title", next.title ? quoted(next.title) : undefined);
766
756
  if (current.autorun !== next.autorun)
@@ -1364,7 +1354,7 @@ function planTilePresentation(ctx: SpliceContext): SpliceFailure | undefined {
1364
1354
  ok: false,
1365
1355
  reason:
1366
1356
  `\`${tile.source} -> ${tile.name}\` is declared on its source, ` +
1367
- `not in this dashboard, so its presentation cannot be changed here.`,
1357
+ `not in this report, so its presentation cannot be changed here.`,
1368
1358
  };
1369
1359
  }
1370
1360
 
@@ -1670,12 +1660,15 @@ function unwritable(
1670
1660
  next: DashboardDocument,
1671
1661
  ): string | undefined {
1672
1662
  const was = new Map(current.tiles.map((t) => [tileKey(t), t]));
1663
+ // A linear report is one column, so the builder never SETS a width on one.
1664
+ // A width the file already states is kept as written, a layout switch
1665
+ // included: the switch rewrites `layout=` and nothing else.
1673
1666
  if (
1674
- kindOf(next) === "notebook" &&
1667
+ next.layout === "linear" &&
1675
1668
  next.columns !== undefined &&
1676
- (kindOf(current) !== "notebook" || next.columns !== current.columns)
1669
+ next.columns !== current.columns
1677
1670
  )
1678
- return "A notebook is one column, so its width is not written. Clear the width when switching a dashboard to a notebook.";
1671
+ return "A linear report is one column, so its width is not written.";
1679
1672
  const textNames = new Set<string>();
1680
1673
  for (const tile of next.tiles) {
1681
1674
  const before = was.get(tileKey(tile));
@@ -2000,8 +1993,8 @@ function planStageFilters(
2000
1993
  if (trailing && trailing.start >= anchor) anchor = trailing.end;
2001
1994
  }
2002
1995
  // A comma only ever follows another `where:`. Malloy rejects one after a
2003
- // `limit:` -- the writer used to emit `{ limit: 5, where: … }` and that is
2004
- // a parse error -- while a space parses after every statement form. A
1996
+ // `limit:` (`{ limit: 5, where: … }` is a parse error), while a space
1997
+ // parses after every statement form. A
2005
1998
  // one-line `where:` whose own span already ends at the separator needs none
2006
1999
  // added, or the file gains a `,,`.
2007
2000
  const lead =
@@ -2073,12 +2066,6 @@ function planReferenceFilters(
2073
2066
  }
2074
2067
 
2075
2068
  export interface SpliceOptions {
2076
- /** Lets `requested.kind` differ from the file's: the one edit that switches a dashboard to a notebook or back. */
2077
- changeKind?: boolean;
2078
- /** The file's path within the package; a dashboard under `notebooks/` is tagged `kind=dashboard` rather than left untagged. */
2079
- modelPath?: string;
2080
- /** 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. */
2081
- explicitKind?: boolean;
2082
2069
  /** The sources a document held as text sees without an `import`: its run model's. */
2083
2070
  visibleSources?: readonly string[];
2084
2071
  }
@@ -2106,7 +2093,7 @@ async function spliceLines(
2106
2093
  requested: DashboardDocument,
2107
2094
  options: SpliceOptions,
2108
2095
  ): Promise<SpliceResult> {
2109
- const before = await readDashboardDocument(sourceText, options.modelPath);
2096
+ const before = await readDashboardDocument(sourceText);
2110
2097
  if (readFailed(before)) {
2111
2098
  return {
2112
2099
  ok: false,
@@ -2115,12 +2102,7 @@ async function spliceLines(
2115
2102
  }
2116
2103
  const current = before.document;
2117
2104
  const next = keepUnstatedCharts(current, requested);
2118
- const shape = checkShape(
2119
- current,
2120
- next,
2121
- options.changeKind === true,
2122
- options.visibleSources,
2123
- );
2105
+ const shape = checkShape(current, next, options.visibleSources);
2124
2106
  if ("reason" in shape) return shape;
2125
2107
  const problem = unwritable(current, next);
2126
2108
  if (problem) return { ok: false, reason: problem };
@@ -2152,10 +2134,6 @@ async function spliceLines(
2152
2134
  current,
2153
2135
  next,
2154
2136
  edits,
2155
- ...(options.modelPath !== undefined
2156
- ? { modelPath: options.modelPath }
2157
- : {}),
2158
- ...(options.explicitKind ? { explicitKind: true } : {}),
2159
2137
  };
2160
2138
 
2161
2139
  // Each concern plans its own edits against the file as it stands; the
@@ -2184,7 +2162,7 @@ async function spliceLines(
2184
2162
  // normalises its shape asks for no change, gets no edits, and would be told
2185
2163
  // its save did not produce what it asked for.
2186
2164
  const comparable = (document: DashboardDocument): DashboardDocument => {
2187
- const { drills, localGivens, kind, description, ...rest } = document;
2165
+ const { drills, localGivens, description, ...rest } = document;
2188
2166
  const tiles = document.tiles.map((tile) => {
2189
2167
  if (isTextTile(tile)) return tile;
2190
2168
  if (tile.filters?.length) return withoutDefaultChart(tile);
@@ -2196,7 +2174,6 @@ async function spliceLines(
2196
2174
  ...(description === undefined
2197
2175
  ? {}
2198
2176
  : { description: trimDescription(description) }),
2199
- ...(kind === "notebook" ? { kind } : {}),
2200
2177
  tiles,
2201
2178
  ...(drills?.length
2202
2179
  ? {
@@ -2257,7 +2234,7 @@ async function spliceLines(
2257
2234
  // The second gate. Read back what was actually written and compare it
2258
2235
  // against what was asked for. Comments survived because they were never
2259
2236
  // rewritten; correctness is established here rather than assumed.
2260
- const after = await readDashboardDocument(spliced, options.modelPath);
2237
+ const after = await readDashboardDocument(spliced);
2261
2238
  if (readFailed(after)) {
2262
2239
  return {
2263
2240
  ok: false,
@@ -60,11 +60,11 @@ describe("filter-literal givens in the artifact tag", () => {
60
60
  for (const [name, tag] of [
61
61
  [
62
62
  "line",
63
- "## artifact { kind=notebook autorun=false givens { REGION=f'US' } }",
63
+ "## artifact { layout=linear autorun=false givens { REGION=f'US' } }",
64
64
  ],
65
65
  [
66
66
  "block",
67
- "##| artifact { kind=notebook\n autorun=false\n givens { REGION=f'US' }\n}\n|##",
67
+ "##| artifact { layout=linear\n autorun=false\n givens { REGION=f'US' }\n}\n|##",
68
68
  ],
69
69
  ]) {
70
70
  it(`converts a legacy notebook with the ${name} tag and keeps the literal as written`, async () => {
@@ -80,7 +80,7 @@ describe("filter-literal givens in the artifact tag", () => {
80
80
  it("reads a legacy notebook with a filter literal as a legacy notebook", async () => {
81
81
  const read = await readDashboardDocument(
82
82
  LEGACY(
83
- "## artifact { kind=notebook autorun=false givens { REGION=f'US' } }",
83
+ "## artifact { layout=linear autorun=false givens { REGION=f'US' } }",
84
84
  ),
85
85
  );
86
86
  if (!readFailed(read)) throw new Error("expected a refusal");
@@ -47,8 +47,8 @@
47
47
  "name": "a same-line |## with no later closer leaves the block unclosed",
48
48
  "source": "##| artifact { kind=dashboard } |##\nrun: x",
49
49
  "tag": null,
50
- "server": ["##| artifact { kind=dashboard } |##"],
51
- "why": "The file does not compile (`unclosed-block-annotation`). The server's write gate still reads the opener as a tag so the write reaches the compiler, whose error says to close the block, instead of being refused as untagged."
50
+ "server": ["##| artifact { kind=dashboard } |##", "run: x"],
51
+ "why": "The file does not compile (`unclosed-block-annotation`): the unclosed block runs to the end of the file. The server still reads it as the artifact note, so a write reaches the compiler, whose error says to close the block, instead of being refused as untagged."
52
52
  },
53
53
  {
54
54
  "name": "a |## inside a string in the block body does not close it",
@@ -0,0 +1,279 @@
1
+ {
2
+ "about": "Where a `# drill { to=… }` lands (docs/reports-design.md §3): `to=` is a package path from the root, with or without `.malloy`, and a bare name is a root file. `reports` is the package's reports; the server resolves against every path, a report `dropped` because it could not be read included, and the SDK's `resolveDrillTarget` against the listing, which omits a dropped one. `server` is the server's answer (`resolveDrillDestination`; it also marks a target that is not a plain package path `malformed`, which the comparison leaves out). The SDK's answer must equal it, compared by `kind` and `path`, except where a case carries `sdk` with a `knownDifference` saying why the two differ by design.",
3
+ "cases": [
4
+ {
5
+ "name": "a path from the package root",
6
+ "to": "sales/q3",
7
+ "reports": [
8
+ {
9
+ "path": "sales/q3.malloy",
10
+ "layout": "grid"
11
+ }
12
+ ],
13
+ "server": {
14
+ "kind": "path",
15
+ "path": "sales/q3.malloy"
16
+ }
17
+ },
18
+ {
19
+ "name": "a path written with its .malloy",
20
+ "to": "sales/q3.malloy",
21
+ "reports": [
22
+ {
23
+ "path": "sales/q3.malloy",
24
+ "layout": "grid"
25
+ }
26
+ ],
27
+ "server": {
28
+ "kind": "path",
29
+ "path": "sales/q3.malloy"
30
+ }
31
+ },
32
+ {
33
+ "name": "a .malloynb by its full path",
34
+ "to": "notes/story.malloynb",
35
+ "reports": [
36
+ {
37
+ "path": "notes/story.malloynb",
38
+ "layout": "linear"
39
+ }
40
+ ],
41
+ "server": {
42
+ "kind": "path",
43
+ "path": "notes/story.malloynb"
44
+ }
45
+ },
46
+ {
47
+ "name": "a bare name is a root path first, ahead of a grid report elsewhere",
48
+ "to": "overview",
49
+ "reports": [
50
+ {
51
+ "path": "dashboards/overview.malloy",
52
+ "layout": "grid"
53
+ },
54
+ {
55
+ "path": "overview.malloy",
56
+ "layout": "linear"
57
+ }
58
+ ],
59
+ "server": {
60
+ "kind": "path",
61
+ "path": "overview.malloy"
62
+ }
63
+ },
64
+ {
65
+ "name": "a bare name is a root file: a grid report elsewhere with that basename is not looked up",
66
+ "to": "overview",
67
+ "reports": [
68
+ {
69
+ "path": "dashboards/overview.malloy",
70
+ "layout": "grid"
71
+ },
72
+ {
73
+ "path": "notebooks/overview.malloy",
74
+ "layout": "linear"
75
+ }
76
+ ],
77
+ "server": {
78
+ "kind": "unresolved"
79
+ }
80
+ },
81
+ {
82
+ "name": "a bare name is a root file: the one report elsewhere with that basename is not looked up",
83
+ "to": "story",
84
+ "reports": [
85
+ {
86
+ "path": "notebooks/story.malloy",
87
+ "layout": "linear"
88
+ }
89
+ ],
90
+ "server": {
91
+ "kind": "unresolved"
92
+ }
93
+ },
94
+ {
95
+ "name": "a bare name adds .malloy, never .malloynb",
96
+ "to": "story",
97
+ "reports": [
98
+ {
99
+ "path": "story.malloynb",
100
+ "layout": "linear"
101
+ }
102
+ ],
103
+ "server": {
104
+ "kind": "unresolved"
105
+ }
106
+ },
107
+ {
108
+ "name": "a bare name two grid reports elsewhere have resolves to neither",
109
+ "to": "overview",
110
+ "reports": [
111
+ {
112
+ "path": "b/overview.malloy",
113
+ "layout": "grid"
114
+ },
115
+ {
116
+ "path": "a/overview.malloy",
117
+ "layout": "grid"
118
+ }
119
+ ],
120
+ "server": {
121
+ "kind": "unresolved"
122
+ }
123
+ },
124
+ {
125
+ "name": "a bare name two linear reports elsewhere have resolves to neither",
126
+ "to": "story",
127
+ "reports": [
128
+ {
129
+ "path": "a/story.malloy",
130
+ "layout": "linear"
131
+ },
132
+ {
133
+ "path": "b/story.malloy",
134
+ "layout": "linear"
135
+ }
136
+ ],
137
+ "server": {
138
+ "kind": "unresolved"
139
+ }
140
+ },
141
+ {
142
+ "name": "a bare name nothing has",
143
+ "to": "absent",
144
+ "reports": [
145
+ {
146
+ "path": "sales/q3.malloy",
147
+ "layout": "grid"
148
+ }
149
+ ],
150
+ "server": {
151
+ "kind": "unresolved"
152
+ }
153
+ },
154
+ {
155
+ "name": "a path target that misses is unresolved",
156
+ "to": "x/q3",
157
+ "reports": [
158
+ {
159
+ "path": "sales/q3.malloy",
160
+ "layout": "grid"
161
+ }
162
+ ],
163
+ "server": {
164
+ "kind": "unresolved"
165
+ }
166
+ },
167
+ {
168
+ "name": "self",
169
+ "to": "self",
170
+ "reports": [
171
+ {
172
+ "path": "self.malloy",
173
+ "layout": "grid"
174
+ }
175
+ ],
176
+ "server": {
177
+ "kind": "self"
178
+ },
179
+ "sdk": {
180
+ "kind": "path",
181
+ "path": "self.malloy"
182
+ },
183
+ "knownDifference": "The server reads `self` before any path; the SDK's caller handles `self` before it resolves a target (resolveDrill.ts `DRILL_SELF`), so `resolveDrillTarget` reads it as a path like any other."
184
+ },
185
+ {
186
+ "name": "a report dropped because it could not be read is still where a drill points, to the server",
187
+ "to": "broken",
188
+ "reports": [
189
+ {
190
+ "path": "broken.malloy",
191
+ "layout": "grid",
192
+ "dropped": true
193
+ }
194
+ ],
195
+ "server": {
196
+ "kind": "path",
197
+ "path": "broken.malloy"
198
+ },
199
+ "sdk": {
200
+ "kind": "unresolved"
201
+ },
202
+ "knownDifference": "The server counts a dropped report, so the lint does not also call a correct drill dangling; the listing the SDK resolves against omits it."
203
+ },
204
+ {
205
+ "name": "a bare name a report elsewhere has resolves to none, whether or not another was dropped",
206
+ "to": "overview",
207
+ "reports": [
208
+ {
209
+ "path": "a/overview.malloy",
210
+ "layout": "grid"
211
+ },
212
+ {
213
+ "path": "b/overview.malloy",
214
+ "layout": "grid",
215
+ "dropped": true
216
+ }
217
+ ],
218
+ "server": {
219
+ "kind": "unresolved"
220
+ }
221
+ },
222
+ {
223
+ "name": "a leading ./ is not a package path",
224
+ "to": "./sales/q3",
225
+ "reports": [
226
+ {
227
+ "path": "sales/q3.malloy",
228
+ "layout": "grid"
229
+ }
230
+ ],
231
+ "server": {
232
+ "kind": "unresolved",
233
+ "malformed": true
234
+ }
235
+ },
236
+ {
237
+ "name": "a leading / is not a package path",
238
+ "to": "/sales/q3",
239
+ "reports": [
240
+ {
241
+ "path": "sales/q3.malloy",
242
+ "layout": "grid"
243
+ }
244
+ ],
245
+ "server": {
246
+ "kind": "unresolved",
247
+ "malformed": true
248
+ }
249
+ },
250
+ {
251
+ "name": "an empty segment is not a package path",
252
+ "to": "sales//q3",
253
+ "reports": [
254
+ {
255
+ "path": "sales/q3.malloy",
256
+ "layout": "grid"
257
+ }
258
+ ],
259
+ "server": {
260
+ "kind": "unresolved",
261
+ "malformed": true
262
+ }
263
+ },
264
+ {
265
+ "name": "a .. segment is not a package path",
266
+ "to": "../sales/q3",
267
+ "reports": [
268
+ {
269
+ "path": "sales/q3.malloy",
270
+ "layout": "grid"
271
+ }
272
+ ],
273
+ "server": {
274
+ "kind": "unresolved",
275
+ "malformed": true
276
+ }
277
+ }
278
+ ]
279
+ }