@malloy-publisher/sdk 0.0.248 → 0.0.250

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 (202) hide show
  1. package/README.md +37 -17
  2. package/TREE_SHAKING.md +5 -0
  3. package/bunfig.toml +3 -0
  4. package/dist/ServerProvider-CcfeBpt3.cjs.js +1 -0
  5. package/dist/{ServerProvider-BxEh3nFI.es.js → ServerProvider-EqBlMMqx.es.js} +1056 -905
  6. package/dist/client/api.d.ts +306 -9
  7. package/dist/client/index.cjs.js +1 -1
  8. package/dist/client/index.es.js +74 -70
  9. package/dist/components/Dashboard/Dashboard.d.ts +49 -0
  10. package/dist/components/Dashboard/DashboardTile.d.ts +48 -0
  11. package/dist/components/Dashboard/index.d.ts +2 -0
  12. package/dist/components/Notebook/Notebook.d.ts +46 -8
  13. package/dist/components/Notebook/NotebookCell.d.ts +37 -3
  14. package/dist/components/Notebook/runPlan.d.ts +29 -0
  15. package/dist/components/Notebook/types.d.ts +10 -0
  16. package/dist/components/Package/ContentTypeIcon.d.ts +17 -1
  17. package/dist/components/Package/Package.d.ts +1 -4
  18. package/dist/components/RenderedResult/RenderedResult.d.ts +7 -1
  19. package/dist/components/RenderedResult/ResultContainer.d.ts +3 -1
  20. package/dist/components/ResultsDialog.d.ts +4 -1
  21. package/dist/components/ServerProvider.d.ts +2 -1
  22. package/dist/components/click_helper.d.ts +10 -1
  23. package/dist/components/drill/index.d.ts +3 -0
  24. package/dist/components/drill/markDrillableCells.d.ts +55 -0
  25. package/dist/components/drill/resolveDrill.d.ts +139 -0
  26. package/dist/components/drill/useDrill.d.ts +63 -0
  27. package/dist/components/given/GivenInput.d.ts +27 -3
  28. package/dist/components/given/GivensPanel.d.ts +36 -7
  29. package/dist/components/given/filterValue.d.ts +97 -0
  30. package/dist/components/given/index.d.ts +1 -1
  31. package/dist/components/given/paramCodec.d.ts +60 -0
  32. package/dist/components/index.d.ts +4 -1
  33. package/dist/components/styles.d.ts +31 -0
  34. package/dist/constants/docLinks.d.ts +6 -0
  35. package/dist/{core-C86Rb7tJ.cjs.js → core-CVXEUnnm.cjs.js} +1 -1
  36. package/dist/{core-BuvlzSIX.es.js → core-Cr-9Wkp3.es.js} +1 -1
  37. package/dist/hooks/givenValue.d.ts +10 -0
  38. package/dist/hooks/index.d.ts +3 -1
  39. package/dist/hooks/useGivensState.d.ts +64 -0
  40. package/dist/hooks/useSuggestOptions.d.ts +78 -0
  41. package/dist/index-C-KeIwsG.cjs.js +339 -0
  42. package/dist/{index-BdtAZ5k6.es.js → index-DVkelll3.es.js} +40981 -39669
  43. package/dist/index.cjs.js +1 -1
  44. package/dist/index.es.js +77 -62
  45. package/dist/theme/types.d.ts +9 -0
  46. package/dist/utils/malloyString.d.ts +7 -0
  47. package/package.json +3 -1
  48. package/src/client-entry.ts +3 -0
  49. package/src/components/AnalyzePackageButton.tsx +3 -0
  50. package/src/components/ApiErrorDisplay.tsx +3 -0
  51. package/src/components/Connections/AddConnectionDialog.tsx +13 -1
  52. package/src/components/Connections/DeleteConnectionDialog.tsx +3 -0
  53. package/src/components/Connections/EditConnectionDialog.tsx +3 -0
  54. package/src/components/Connections/common.ts +3 -0
  55. package/src/components/DOMElement/DOMElement.tsx +3 -0
  56. package/src/components/DOMElement/index.ts +3 -0
  57. package/src/components/Dashboard/Dashboard.tsx +398 -0
  58. package/src/components/Dashboard/DashboardTile.tsx +153 -0
  59. package/src/components/Dashboard/index.ts +5 -0
  60. package/src/components/DataAppViewer/DataAppViewer.tsx +3 -0
  61. package/src/components/DataAppViewer/index.ts +3 -0
  62. package/src/components/Environment/About.tsx +3 -0
  63. package/src/components/Environment/AddPackageDialog.tsx +3 -0
  64. package/src/components/Environment/ConnectionExplorer.tsx +3 -0
  65. package/src/components/Environment/Connections.tsx +3 -0
  66. package/src/components/Environment/DeletePackageDialog.tsx +3 -0
  67. package/src/components/Environment/EditPackageDialog.tsx +3 -0
  68. package/src/components/Environment/Environment.tsx +3 -0
  69. package/src/components/Environment/Packages.tsx +3 -0
  70. package/src/components/Environment/index.ts +3 -0
  71. package/src/components/Home/AddEnvironmentDialog.tsx +3 -0
  72. package/src/components/Home/DeleteEnvironmentDialog.tsx +3 -0
  73. package/src/components/Home/EditEnvironmentDialog.tsx +3 -0
  74. package/src/components/Home/Home.tsx +113 -23
  75. package/src/components/Home/index.ts +3 -0
  76. package/src/components/Loading.tsx +3 -0
  77. package/src/components/Materializations/CreateEnvMaterializationDialog.tsx +3 -0
  78. package/src/components/Materializations/CreateMaterializationDialog.tsx +3 -0
  79. package/src/components/Materializations/DeleteMaterializationDialog.tsx +3 -0
  80. package/src/components/Materializations/EnvironmentMaterializations.tsx +3 -0
  81. package/src/components/Materializations/ManifestView.tsx +3 -0
  82. package/src/components/Materializations/MaterializationDetailDialog.tsx +3 -0
  83. package/src/components/Materializations/MaterializationRunsList.tsx +3 -0
  84. package/src/components/Materializations/Materializations.tsx +3 -0
  85. package/src/components/Materializations/ScheduleCard.tsx +3 -0
  86. package/src/components/Materializations/SectionLabel.tsx +3 -0
  87. package/src/components/Materializations/SetScheduleDialog.tsx +3 -0
  88. package/src/components/Materializations/TriggerChip.tsx +3 -0
  89. package/src/components/Materializations/cron.ts +3 -0
  90. package/src/components/Materializations/index.ts +3 -0
  91. package/src/components/Materializations/utils.ts +3 -0
  92. package/src/components/Model/Model.tsx +3 -0
  93. package/src/components/Model/ModelCell.tsx +3 -0
  94. package/src/components/Model/ModelExplorer.tsx +3 -0
  95. package/src/components/Model/ModelExplorerDialog.tsx +3 -0
  96. package/src/components/Model/SourcesExplorer.tsx +3 -0
  97. package/src/components/Model/index.ts +3 -0
  98. package/src/components/Model/useModelData.ts +3 -0
  99. package/src/components/Notebook/Notebook.tsx +447 -390
  100. package/src/components/Notebook/NotebookCell.tsx +120 -3
  101. package/src/components/Notebook/index.ts +3 -0
  102. package/src/components/Notebook/runPlan.spec.ts +155 -0
  103. package/src/components/Notebook/runPlan.ts +67 -0
  104. package/src/components/Notebook/types.ts +14 -0
  105. package/src/components/Package/ContentTypeIcon.spec.ts +91 -0
  106. package/src/components/Package/ContentTypeIcon.tsx +80 -6
  107. package/src/components/Package/FileTreeView.tsx +3 -0
  108. package/src/components/Package/Models.tsx +3 -0
  109. package/src/components/Package/Package.tsx +151 -38
  110. package/src/components/Package/index.ts +3 -0
  111. package/src/components/QueryResult/QueryResult.tsx +3 -0
  112. package/src/components/QueryResult/index.ts +3 -0
  113. package/src/components/RenderedResult/RenderedResult.tsx +312 -19
  114. package/src/components/RenderedResult/ResultContainer.tsx +31 -1
  115. package/src/components/RenderedResult/index.ts +3 -0
  116. package/src/components/RenderedResult/renderLogs.spec.ts +3 -0
  117. package/src/components/RenderedResult/renderLogs.ts +3 -0
  118. package/src/components/ResultsDialog.tsx +8 -0
  119. package/src/components/ServerProvider.tsx +5 -0
  120. package/src/components/Workbook/BrowserWorkbookStorage.ts +3 -0
  121. package/src/components/Workbook/EditableMalloyCell.tsx +3 -0
  122. package/src/components/Workbook/ModelPicker.tsx +3 -0
  123. package/src/components/Workbook/MutableCell.tsx +3 -0
  124. package/src/components/Workbook/Workbook.tsx +3 -0
  125. package/src/components/Workbook/WorkbookList.tsx +3 -0
  126. package/src/components/Workbook/WorkbookManager.ts +3 -0
  127. package/src/components/Workbook/WorkbookStorage.ts +3 -0
  128. package/src/components/Workbook/WorkbookStorageProvider.tsx +3 -0
  129. package/src/components/Workbook/index.ts +3 -0
  130. package/src/components/click_helper.ts +17 -1
  131. package/src/components/drill/index.ts +28 -0
  132. package/src/components/drill/markDrillableCells.dom.spec.ts +313 -0
  133. package/src/components/drill/markDrillableCells.spec.ts +109 -0
  134. package/src/components/drill/markDrillableCells.ts +314 -0
  135. package/src/components/drill/resolveDrill.spec.ts +449 -0
  136. package/src/components/drill/resolveDrill.ts +375 -0
  137. package/src/components/drill/useDrill.tsx +203 -0
  138. package/src/components/filter/DimensionFilter.tsx +3 -0
  139. package/src/components/filter/index.ts +3 -0
  140. package/src/components/filter/utils.ts +16 -5
  141. package/src/components/given/GivenInput.spec.tsx +498 -15
  142. package/src/components/given/GivenInput.tsx +565 -30
  143. package/src/components/given/GivensPanel.spec.tsx +175 -0
  144. package/src/components/given/GivensPanel.tsx +142 -32
  145. package/src/components/given/filterValue.spec.ts +364 -0
  146. package/src/components/given/filterValue.ts +207 -0
  147. package/src/components/given/index.ts +8 -1
  148. package/src/components/given/paramCodec.spec.ts +857 -0
  149. package/src/components/given/paramCodec.ts +483 -0
  150. package/src/components/given/utils.spec.ts +3 -0
  151. package/src/components/given/utils.ts +3 -0
  152. package/src/components/highlighter.ts +3 -0
  153. package/src/components/index.ts +7 -1
  154. package/src/components/styles.ts +38 -3
  155. package/src/constants/docLinks.spec.ts +54 -0
  156. package/src/constants/docLinks.ts +29 -0
  157. package/src/hooks/givenValue.ts +13 -0
  158. package/src/hooks/index.ts +9 -4
  159. package/src/hooks/useDimensionFilters.ts +4 -7
  160. package/src/hooks/useDimensionFiltersFromSpec.ts +3 -0
  161. package/src/hooks/useDimensionFiltersQuery.ts +4 -7
  162. package/src/hooks/useDimensionalFilterRangeData.ts +4 -7
  163. package/src/hooks/useGivensState.spec.ts +449 -0
  164. package/src/hooks/useGivensState.ts +340 -0
  165. package/src/hooks/useModelGivens.ts +3 -0
  166. package/src/hooks/useQueryWithApiError.ts +3 -0
  167. package/src/hooks/useRawQueryData.ts +3 -0
  168. package/src/hooks/useSuggestOptions.spec.ts +112 -0
  169. package/src/hooks/useSuggestOptions.ts +263 -0
  170. package/src/index.ts +3 -0
  171. package/src/react-app-env.d.ts +3 -0
  172. package/src/theme/ThemeContext.tsx +3 -0
  173. package/src/theme/buildMalloyExplicitTheme.ts +3 -0
  174. package/src/theme/buildTableCssVars.spec.ts +3 -0
  175. package/src/theme/buildTableCssVars.ts +7 -0
  176. package/src/theme/buildVegaThemeOverride.spec.ts +3 -0
  177. package/src/theme/buildVegaThemeOverride.ts +3 -0
  178. package/src/theme/defaults.ts +3 -0
  179. package/src/theme/index.ts +3 -0
  180. package/src/theme/keys.ts +3 -0
  181. package/src/theme/readChartAnnotations.spec.ts +3 -0
  182. package/src/theme/readChartAnnotations.ts +3 -0
  183. package/src/theme/resolveTheme.spec.ts +16 -0
  184. package/src/theme/resolveTheme.ts +6 -0
  185. package/src/theme/types.ts +12 -0
  186. package/src/utils/dataAppEmbed.spec.ts +3 -0
  187. package/src/utils/dataAppEmbed.ts +3 -0
  188. package/src/utils/formatting.spec.ts +3 -0
  189. package/src/utils/formatting.ts +3 -0
  190. package/src/utils/malloyString.spec.ts +24 -0
  191. package/src/utils/malloyString.ts +12 -0
  192. package/src/utils/parsing.spec.ts +3 -0
  193. package/src/utils/parsing.ts +3 -0
  194. package/src/utils/queryClient.ts +3 -0
  195. package/test/README.md +21 -10
  196. package/test/setup.ts +3 -0
  197. package/vite.config.ts +3 -0
  198. package/dist/ServerProvider-Dg5S1qBU.cjs.js +0 -1
  199. package/dist/hooks/useGivensForm.d.ts +0 -35
  200. package/dist/index-MES4MGpQ.cjs.js +0 -309
  201. package/src/hooks/useGivensForm.spec.ts +0 -99
  202. package/src/hooks/useGivensForm.ts +0 -107
@@ -1,9 +1,9 @@
1
- import { A as e, a as t, C as i, b as o, c as n, at as r, e as p, f as A, d as u, E as m, y as c, B as l, z as E, K as y, H as C, J as F, I as P, D as b, W as g, O as S, V as M, U as k, h as d, _ as h, X as x, Z as T, Y as v, a2 as D, $ as f, a1 as R, a0 as z, ag as N, F as Q, i as W, G as L, L as O, j as q, k as B, M as j, l as w, a7 as G, m as I, a6 as H, a3 as J, a5 as K, a4 as U, ab as V, a8 as X, aa as Y, a9 as Z, n as _, N as $, af as aa, ac as sa, ae as ea, ad as ta, p as ia, o as oa, P as na, q as ra, ak as pa, ah as Aa, aj as ua, ai as ma, r as ca, s as la, ao as Ea, al as ya, an as Ca, am as Fa, Q as Pa, t as ba, v as ga, R as Sa, w as Ma, S as ka, x as da, T as ha, as as xa, ap as Ta, ar as va, aq as Da, g as fa, u as Ra } from "../ServerProvider-BxEh3nFI.es.js";
1
+ import { A as e, a as o, C as i, b as t, c as n, ax as r, e as p, f as A, d as u, E as m, y as c, B as l, z as E, K as y, H as C, J as F, I as P, W as b, O as g, V as S, U as d, D as M, _ as h, X as k, Z as x, Y as D, h as v, a2 as T, $ as f, a1 as R, a0 as z, a6 as N, a3 as Q, a5 as W, a4 as L, ak as O, F as q, i as w, G as B, L as j, j as G, k as I, M as H, l as J, ab as K, m as U, aa as V, a7 as X, a9 as Y, a8 as Z, af as _, ac as $, ae as aa, ad as sa, n as ea, N as oa, aj as ia, ag as ta, ai as na, ah as ra, p as pa, o as Aa, P as ua, q as ma, ao as ca, al as la, an as Ea, am as ya, r as Ca, s as Fa, as as Pa, ap as ba, ar as ga, aq as Sa, Q as da, t as Ma, v as ha, R as ka, w as xa, S as Da, x as va, T as Ta, aw as fa, at as Ra, av as za, au as Na, g as Qa, u as Wa } from "../ServerProvider-EqBlMMqx.es.js";
2
2
  export {
3
3
  e as AttachedDatabaseTypeEnum,
4
- t as AzureConnectionAuthTypeEnum,
4
+ o as AzureConnectionAuthTypeEnum,
5
5
  i as CompileProblemSeverityEnum,
6
- o as CompileRequestScopeEnum,
6
+ t as CompileRequestScopeEnum,
7
7
  n as CompileResultStatusEnum,
8
8
  r as Configuration,
9
9
  p as ConnectionProxyTypeEnum,
@@ -17,71 +17,75 @@ export {
17
17
  C as ConnectionsTestApiAxiosParamCreator,
18
18
  F as ConnectionsTestApiFactory,
19
19
  P as ConnectionsTestApiFp,
20
- b as DataAppFitEnum,
21
- g as DataAppsApi,
22
- S as DataAppsApiAxiosParamCreator,
23
- M as DataAppsApiFactory,
24
- k as DataAppsApiFp,
25
- d as DatabaseTypeEnum,
26
- h as DatabasesApi,
27
- x as DatabasesApiAxiosParamCreator,
28
- T as DatabasesApiFactory,
29
- v as DatabasesApiFp,
30
- D as EnvironmentsApi,
31
- f as EnvironmentsApiAxiosParamCreator,
32
- R as EnvironmentsApiFactory,
33
- z as EnvironmentsApiFp,
34
- N as ExecuteNotebookCellBypassFiltersEnum,
35
- Q as FilterTypeEnum,
36
- W as FreshnessFallbackEnum,
37
- L as GivenControlEnum,
38
- O as LedgerEntryStrategyEnum,
39
- q as LogMessageSeverityEnum,
40
- B as ManifestEntryFreshnessFallbackEnum,
41
- j as ManifestEntryOriginEnum,
42
- w as ManifestEntryRefreshEnum,
43
- G as MaterializationActionActionEnum,
44
- I as MaterializationStatus,
45
- H as MaterializationsApi,
46
- J as MaterializationsApiAxiosParamCreator,
47
- K as MaterializationsApiFactory,
48
- U as MaterializationsApiFp,
49
- V as ModelsApi,
50
- X as ModelsApiAxiosParamCreator,
51
- Y as ModelsApiFactory,
52
- Z as ModelsApiFp,
53
- _ as NotebookCellResultTypeEnum,
54
- $ as NotebookCellTypeEnum,
55
- aa as NotebooksApi,
56
- sa as NotebooksApiAxiosParamCreator,
57
- ea as NotebooksApiFactory,
58
- ta as NotebooksApiFp,
59
- ia as PackageManifestBindingStatusEnum,
60
- oa as PackageQueryableSourcesEnum,
61
- na as PackageScopeEnum,
62
- ra as PackageWarningsInnerSeverityEnum,
63
- pa as PackagesApi,
64
- Aa as PackagesApiAxiosParamCreator,
65
- ua as PackagesApiFactory,
66
- ma as PackagesApiFp,
67
- ca as PersistSourcePlanOriginEnum,
68
- la as PostgresConnectionSslmodeEnum,
69
- Ea as PublisherApi,
70
- ya as PublisherApiAxiosParamCreator,
71
- Ca as PublisherApiFactory,
72
- Fa as PublisherApiFp,
73
- Pa as QueryClass,
74
- ba as QueryResultQueryRowLimitSourceEnum,
75
- ga as QueryResultServedFromEnum,
76
- Sa as Realization,
77
- Ma as RunContextTriggerEnum,
78
- ka as ServerProvider,
79
- da as ServerStatusOperationalStateEnum,
80
- ha as ThemeDefaultModeEnum,
81
- xa as WatchModeApi,
82
- Ta as WatchModeApiAxiosParamCreator,
83
- va as WatchModeApiFactory,
84
- Da as WatchModeApiFp,
85
- fa as globalQueryClient,
86
- Ra as useServer
20
+ b as DashboardsApi,
21
+ g as DashboardsApiAxiosParamCreator,
22
+ S as DashboardsApiFactory,
23
+ d as DashboardsApiFp,
24
+ M as DataAppFitEnum,
25
+ h as DataAppsApi,
26
+ k as DataAppsApiAxiosParamCreator,
27
+ x as DataAppsApiFactory,
28
+ D as DataAppsApiFp,
29
+ v as DatabaseTypeEnum,
30
+ T as DatabasesApi,
31
+ f as DatabasesApiAxiosParamCreator,
32
+ R as DatabasesApiFactory,
33
+ z as DatabasesApiFp,
34
+ N as EnvironmentsApi,
35
+ Q as EnvironmentsApiAxiosParamCreator,
36
+ W as EnvironmentsApiFactory,
37
+ L as EnvironmentsApiFp,
38
+ O as ExecuteNotebookCellBypassFiltersEnum,
39
+ q as FilterTypeEnum,
40
+ w as FreshnessFallbackEnum,
41
+ B as GivenControlEnum,
42
+ j as LedgerEntryStrategyEnum,
43
+ G as LogMessageSeverityEnum,
44
+ I as ManifestEntryFreshnessFallbackEnum,
45
+ H as ManifestEntryOriginEnum,
46
+ J as ManifestEntryRefreshEnum,
47
+ K as MaterializationActionActionEnum,
48
+ U as MaterializationStatus,
49
+ V as MaterializationsApi,
50
+ X as MaterializationsApiAxiosParamCreator,
51
+ Y as MaterializationsApiFactory,
52
+ Z as MaterializationsApiFp,
53
+ _ as ModelsApi,
54
+ $ as ModelsApiAxiosParamCreator,
55
+ aa as ModelsApiFactory,
56
+ sa as ModelsApiFp,
57
+ ea as NotebookCellResultTypeEnum,
58
+ oa as NotebookCellTypeEnum,
59
+ ia as NotebooksApi,
60
+ ta as NotebooksApiAxiosParamCreator,
61
+ na as NotebooksApiFactory,
62
+ ra as NotebooksApiFp,
63
+ pa as PackageManifestBindingStatusEnum,
64
+ Aa as PackageQueryableSourcesEnum,
65
+ ua as PackageScopeEnum,
66
+ ma as PackageWarningsInnerSeverityEnum,
67
+ ca as PackagesApi,
68
+ la as PackagesApiAxiosParamCreator,
69
+ Ea as PackagesApiFactory,
70
+ ya as PackagesApiFp,
71
+ Ca as PersistSourcePlanOriginEnum,
72
+ Fa as PostgresConnectionSslmodeEnum,
73
+ Pa as PublisherApi,
74
+ ba as PublisherApiAxiosParamCreator,
75
+ ga as PublisherApiFactory,
76
+ Sa as PublisherApiFp,
77
+ da as QueryClass,
78
+ Ma as QueryResultQueryRowLimitSourceEnum,
79
+ ha as QueryResultServedFromEnum,
80
+ ka as Realization,
81
+ xa as RunContextTriggerEnum,
82
+ Da as ServerProvider,
83
+ va as ServerStatusOperationalStateEnum,
84
+ Ta as ThemeDefaultModeEnum,
85
+ fa as WatchModeApi,
86
+ Ra as WatchModeApiAxiosParamCreator,
87
+ za as WatchModeApiFactory,
88
+ Na as WatchModeApiFp,
89
+ Qa as globalQueryClient,
90
+ Wa as useServer
87
91
  };
@@ -0,0 +1,49 @@
1
+ import { DrillNavigation } from '../drill';
2
+ export interface DashboardProps {
3
+ /** `publisher://environments/{env}/packages/{pkg}`, env and package only. */
4
+ resourceUri: string;
5
+ /** The dashboard's slug, as listed by the dashboards endpoint. */
6
+ dashboard: string;
7
+ /**
8
+ * Control values from the host, typically its URL query parameters. These
9
+ * beat the dashboard's own starting values, so a shared link shows what the
10
+ * sender was looking at.
11
+ */
12
+ givens?: Record<string, string>;
13
+ /**
14
+ * Applied control values, for a host that wants them in its URL. Fires with
15
+ * what the results reflect, not with every keystroke.
16
+ *
17
+ * `managed` is every given this dashboard declares, whether or not it
18
+ * currently holds a value, and a host writing to a shared query string needs
19
+ * it. `givens` alone says which parameters to write but not which to REMOVE,
20
+ * so a host that guesses by deleting everything it did not just receive
21
+ * deletes the unrelated parameters it has no business touching. Same contract
22
+ * as `Notebook`, so a host can treat the two surfaces alike.
23
+ */
24
+ onGivensChange?: (givens: Record<string, string>, managed: readonly string[]) => void;
25
+ /**
26
+ * Where to go when a `# drill` cell is clicked. Without it, drilling to
27
+ * another dashboard is inert: `to=self` still filters in place, since that
28
+ * never leaves the component.
29
+ */
30
+ onNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
31
+ /**
32
+ * Height cap for a result panel. Left unset, each form gets the cap that
33
+ * suits its shape, see {@link TILE_HEIGHT} and {@link WHOLE_PAGE_HEIGHT}.
34
+ * Set it to hold a dashboard to a fixed box, as an embedding host might.
35
+ */
36
+ height?: number;
37
+ maxResultSize?: number;
38
+ }
39
+ /**
40
+ * A Malloyyo-style dashboard: a control row over one or more query results,
41
+ * declared entirely by tags in a package's `dashboards/*.malloy`.
42
+ *
43
+ * Host-agnostic on purpose. It takes props rather than reading a router, and
44
+ * hands navigation and URL state back to whoever mounted it, so the Publisher
45
+ * Console and an external React app render the same component and differ only
46
+ * in what they do with `onNavigate` and `onGivensChange`.
47
+ */
48
+ export declare function Dashboard({ resourceUri, dashboard, givens, onGivensChange, onNavigate, height, maxResultSize, }: DashboardProps): import("react/jsx-runtime").JSX.Element;
49
+ export default Dashboard;
@@ -0,0 +1,48 @@
1
+ import { GivenValue } from '../../hooks/givenValue';
2
+ import { DrillBinding } from '../drill';
3
+ export interface DashboardTileProps {
4
+ environmentName: string;
5
+ packageName: string;
6
+ modelPath: string;
7
+ /** A named query (the single-query form). */
8
+ queryName?: string;
9
+ /** A run expression (a composite tile). */
10
+ tile?: string;
11
+ /**
12
+ * The whole applied control row, NOT this tile's share of it. The narrowing
13
+ * happens here, in `givensToRequest` below, using {@link givenNames}: the
14
+ * caller does not know which givens a tile references and this component
15
+ * does.
16
+ */
17
+ givens: Map<string, GivenValue>;
18
+ /** Declared type per given name, which decides how a value is encoded. */
19
+ declaredTypes: ReadonlyMap<string, string | undefined>;
20
+ /**
21
+ * Given names this tile references, or undefined when discovery could not
22
+ * resolve the tile. Undefined means "send the whole control row", which the
23
+ * server accepts: a surfaced given a query does not reference is ignored.
24
+ */
25
+ givenNames?: string[];
26
+ height: number;
27
+ maxResultSize?: number;
28
+ /** Cell clicks and their affordance, for the dashboard's `# drill`. */
29
+ drill?: DrillBinding;
30
+ }
31
+ /**
32
+ * A composite tile's heading, read off its run expression: the last step's name
33
+ * as a sentence, so `scoped_sales -> sales_by_month` is titled "Sales by month".
34
+ *
35
+ * A tile in the single-query form gets its heading from a `# label` on the nest,
36
+ * and a composite tile has no nest to label: the entry is a string in
37
+ * `tiles=[…]`. Deriving it keeps the two forms reading alike instead of one
38
+ * showing titles and the other showing code.
39
+ */
40
+ export declare function tileTitle(tile: string): string;
41
+ /**
42
+ * One result panel: run it, render it, and keep its failure to itself.
43
+ *
44
+ * A tile owning its own query is what lets a composite dashboard survive a bad
45
+ * tile: the broken one shows its error in place and the rest of the grid still
46
+ * renders, rather than one failure blanking the page.
47
+ */
48
+ export declare function DashboardTile({ environmentName, packageName, modelPath, queryName, tile, givens, declaredTypes, givenNames, height, maxResultSize, drill, }: DashboardTileProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Dashboard, type DashboardProps } from './Dashboard';
2
+ export { DashboardTile, type DashboardTileProps } from './DashboardTile';
@@ -1,14 +1,52 @@
1
- import { MouseEvent } from 'react';
2
- import { RetrievalFunction } from '../filter/DimensionFilter';
1
+ import { NavigationClick } from '../click_helper';
2
+ import { DrillNavigation } from '../drill';
3
3
  interface NotebookProps {
4
4
  resourceUri: string;
5
5
  maxResultSize?: number;
6
- /** Optional retrieval function for semantic search filters */
7
- retrievalFn?: RetrievalFunction;
8
- /** Optional SPA navigation handler for links inside the notebook. When
6
+ /**
7
+ * Parameter values from the host, typically its URL query parameters: the
8
+ * same contract `Dashboard` takes, so a link into a filtered notebook works
9
+ * the way a link into a filtered dashboard does.
10
+ */
11
+ givens?: Record<string, string>;
12
+ /**
13
+ * Applied parameter values, for a host that wants them in its URL. Fires
14
+ * with what the cells actually ran with, which is what makes the URL a link
15
+ * that reproduces the view.
16
+ *
17
+ * That is every committed change. Under `## autorun=false` a change is
18
+ * committed on Apply, so reports are batched; otherwise every change is
19
+ * committed and typing in a text control reports per keystroke. It does NOT
20
+ * run per keystroke: a changed value waits
21
+ * `GIVEN_SETTLE_MS` before anything is dispatched, so a burst of typing
22
+ * produces one run. A run that does start supersedes and aborts the one
23
+ * before it. The REPORTS are still per keystroke, so a host doing something
24
+ * expensive per call should debounce.
25
+ *
26
+ * `managed` names every given this notebook declares, set or not. A host
27
+ * writing to a shared query string needs it: `givens` alone says which
28
+ * parameters to write but not which to *remove*, and a host that guesses by
29
+ * removing everything it did not just receive deletes the unrelated
30
+ * parameters it has no business touching.
31
+ */
32
+ onGivensChange?: (givens: Record<string, string>, managed: readonly string[]) => void;
33
+ /**
34
+ * Optional SPA navigation handler for links inside the notebook. When
9
35
  * omitted, in-notebook links fall back to plain absolute anchors, so no
10
- * react-router context is required to render a notebook. */
11
- onNavigate?: (to: string, event?: MouseEvent) => void;
36
+ * react-router context is required to render a notebook.
37
+ *
38
+ * It does NOT carry drill. A `# drill { to=self }` filters this notebook
39
+ * through `given:` state and needs no handler at all, and a drill naming a
40
+ * dashboard goes through {@link onDrillNavigate}, which takes a destination
41
+ * rather than a URL.
42
+ */
43
+ onNavigate?: (to: string, event?: NavigationClick) => void;
44
+ /**
45
+ * Opens a `# drill { to=<dashboard> }` from a cell, seeded with the clicked
46
+ * value. Omitted on a host with no dashboard route, which leaves those
47
+ * destinations inert AND unmarked rather than painting a dead link.
48
+ */
49
+ onDrillNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
12
50
  }
13
- export default function Notebook({ resourceUri, maxResultSize, retrievalFn, onNavigate, }: NotebookProps): import("react/jsx-runtime").JSX.Element;
51
+ export default function Notebook({ resourceUri, maxResultSize, givens, onGivensChange, onNavigate, onDrillNavigate, }: NotebookProps): import("react/jsx-runtime").JSX.Element;
14
52
  export {};
@@ -1,4 +1,5 @@
1
- import { default as React } from 'react';
1
+ import { NavigationClick } from '../click_helper';
2
+ import { DrillNavigation } from '../drill';
2
3
  import { EnhancedNotebookCell } from './types';
3
4
  interface NotebookCellProps {
4
5
  cell: EnhancedNotebookCell;
@@ -10,7 +11,40 @@ interface NotebookCellProps {
10
11
  index: number;
11
12
  maxResultSize?: number;
12
13
  isExecuting?: boolean;
13
- onNavigate?: (to: string, event?: React.MouseEvent) => void;
14
+ /**
15
+ * A re-run is coming but has not started, i.e. the given-settle window.
16
+ * Separate from `isExecuting` because the spinner below is gated on
17
+ * `!cell.result`, so on a re-run (where a result IS present) it renders
18
+ * nothing at all, which is exactly the case the settle window needs to
19
+ * signal: the values on screen are already stale.
20
+ */
21
+ pendingRerun?: boolean;
22
+ onNavigate?: (to: string, event?: NavigationClick) => void;
23
+ /**
24
+ * Applies a `# drill { to=self }` in place, by setting the named parameter
25
+ * on the notebook that owns this cell. Omitted when the notebook declares no
26
+ * givens, which makes a self-drill inert rather than an error.
27
+ *
28
+ * Takes the clicked value unencoded: only the notebook knows the declared
29
+ * type of the given being set, and the encoding depends on it.
30
+ */
31
+ onDrillSelf?: (given: string, rawValue: unknown) => void;
32
+ /**
33
+ * Whether the owning notebook declares a given, so a `to=self` drill onto it
34
+ * can be honoured. Without it every self-drill reads as clickable and the
35
+ * refusal only shows up in the console.
36
+ */
37
+ canDrillSelf?: (given: string) => boolean;
38
+ /**
39
+ * Opens a `# drill { to=<dashboard> }` destination, seeded with the clicked
40
+ * value. Distinct from {@link onNavigate}, which routes a markdown link and
41
+ * takes a URL: this one takes a destination and the givens to seed, and only
42
+ * the host knows how to turn those into a route.
43
+ *
44
+ * Omitted on a host with no dashboard route, which makes a cross-dashboard
45
+ * drill inert rather than dead-ended, and removes the affordance with it.
46
+ */
47
+ onDrillNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
14
48
  }
15
- export declare function NotebookCell({ cell, hideCodeCellIcon, hideEmbeddingIcon, resourceUri, index, maxResultSize, isExecuting, onNavigate, }: NotebookCellProps): import("react/jsx-runtime").JSX.Element;
49
+ export declare function NotebookCell({ cell, hideCodeCellIcon, hideEmbeddingIcon, resourceUri, index, maxResultSize, isExecuting, pendingRerun, onNavigate, onDrillSelf, canDrillSelf, onDrillNavigate, }: NotebookCellProps): import("react/jsx-runtime").JSX.Element;
16
50
  export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * What the notebook's run effect should do about the state it just observed.
3
+ *
4
+ * Pulled out as a pure function because the inline version produced two defects
5
+ * that no test could reach: it first lost the bound on concurrent runs
6
+ * entirely, then, once a settle delay put the bound back, it let an abandoned
7
+ * run fire. Both were reasoning errors about
8
+ * three interacting pieces of state, which is exactly what a table of cases
9
+ * pins and a component test does not.
10
+ */
11
+ export interface RunPlanInput {
12
+ /** Whether the notebook is loaded and runnable at all. */
13
+ ready: boolean;
14
+ /** Key of the run that has already been dispatched, or null before the first. */
15
+ lastRunKey: string | null;
16
+ /** Key of a run currently waiting out the settle delay, if any. */
17
+ pendingKey: string | undefined;
18
+ /** Key for the state the notebook is in now. */
19
+ runKey: string;
20
+ /** The `resourceUri|generation` prefix of {@link runKey}, without the parameters. */
21
+ documentKey: string;
22
+ }
23
+ export interface RunPlan {
24
+ /** Clear the pending timer, because what it would run is no longer current. */
25
+ cancelPending: boolean;
26
+ /** `now` skips the settle delay; `settle` waits it out; `none` does nothing. */
27
+ dispatch: "now" | "settle" | "none";
28
+ }
29
+ export declare function planRun({ ready, lastRunKey, pendingKey, runKey, documentKey, }: RunPlanInput): RunPlan;
@@ -18,4 +18,14 @@ export interface EnhancedNotebookCell extends ClientNotebookCell {
18
18
  * that become available in this cell (e.g., from imports or source definitions)
19
19
  */
20
20
  newSources?: string[];
21
+ /**
22
+ * Why this cell has no result, when the server refused to run it.
23
+ *
24
+ * A cell that throws used to be logged to the console and nothing else, so
25
+ * the reader got an empty space with no indication anything had happened.
26
+ * That was survivable while the only way to reach it was a server fault; it
27
+ * stopped being survivable once a model with a required `#(filter)` began
28
+ * failing every cell by design.
29
+ */
30
+ error?: string;
21
31
  }
@@ -1,5 +1,21 @@
1
1
  import { SvgIconProps } from '@mui/material/SvgIcon';
2
- type ContentType = "report" | "model" | "data" | "materialization" | "dataApp";
2
+ export type ContentType = "report" | "model" | "data" | "materialization" | "dataApp" | "dashboard";
3
+ /**
4
+ * The backplate color behind each icon. One per content type and no repeats: on
5
+ * a page that lists all six, a shared color reads as a shared kind, and the
6
+ * glyphs are small enough that color does most of the telling apart.
7
+ *
8
+ * The logo's three go to the three artifacts a reader opens to look at data,
9
+ * dashboards and notebooks and the models under them, and the accents to the
10
+ * rest, so the brand leads on the things the page is mostly for. Not a
11
+ * seniority ranking: dashboards are the newest thing a package can hold, and
12
+ * Package Data is among the oldest and takes an accent.
13
+ *
14
+ * Exhaustive by type rather than by a default, so adding a `ContentType` is a
15
+ * compile error here instead of a row that silently paints itself the same as
16
+ * its neighbour.
17
+ */
18
+ export declare const CONTENT_TINT: Record<ContentType, string>;
3
19
  interface ContentTypeIconProps extends Omit<SvgIconProps, "fontSize"> {
4
20
  type: ContentType;
5
21
  /** Pixel size of the rendered icon. */
@@ -1,10 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { RetrievalFunction } from '../filter/DimensionFilter';
3
2
  interface PackageProps {
4
3
  onClickPackageFile?: (to: string, event?: React.MouseEvent) => void;
5
4
  resourceUri: string;
6
- /** Optional retrieval function for semantic search filters */
7
- retrievalFn?: RetrievalFunction;
8
5
  }
9
- export default function Package({ onClickPackageFile, resourceUri, retrievalFn, }: PackageProps): import("react/jsx-runtime").JSX.Element;
6
+ export default function Package({ onClickPackageFile, resourceUri, }: PackageProps): import("react/jsx-runtime").JSX.Element;
10
7
  export {};
@@ -1,4 +1,5 @@
1
1
  import { default as React } from 'react';
2
+ import { DrillBinding } from '../drill/useDrill';
2
3
  type MalloyRenderElement = HTMLElement & Record<string, unknown>;
3
4
  declare global {
4
5
  namespace JSX {
@@ -12,7 +13,12 @@ interface RenderedResultProps {
12
13
  height?: number;
13
14
  isFillElement?: (boolean: any) => void;
14
15
  onSizeChange?: (height: number) => void;
15
- onDrill?: (element: unknown) => void;
16
+ /**
17
+ * Makes `# drill` cells clickable, and makes them look it. From `useDrill`
18
+ * on the host surface, which decides where a click may go; omitted where
19
+ * nothing can act on one, and then the result renders inert.
20
+ */
21
+ drill?: DrillBinding;
16
22
  }
17
23
  export default function RenderedResult(props: RenderedResultProps): import("react/jsx-runtime").JSX.Element;
18
24
  export {};
@@ -1,9 +1,11 @@
1
1
  import { LogMessage } from '../../client';
2
+ import { DrillBinding } from '../drill/useDrill';
2
3
  interface ResultContainerProps {
3
4
  result: string | undefined;
4
5
  maxHeight: number;
5
6
  maxResultSize?: number;
6
7
  renderLogs?: LogMessage[];
8
+ drill?: DrillBinding;
7
9
  }
8
- export default function ResultContainer({ result, maxHeight, maxResultSize, renderLogs, }: ResultContainerProps): import("react/jsx-runtime").JSX.Element;
10
+ export default function ResultContainer({ result, maxHeight, maxResultSize, renderLogs, drill, }: ResultContainerProps): import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -1,10 +1,13 @@
1
1
  import { LogMessage } from '../client';
2
+ import { DrillBinding } from './drill';
2
3
  interface ResultsDialogProps {
3
4
  open: boolean;
4
5
  onClose: () => void;
5
6
  result: string;
6
7
  title?: string;
7
8
  renderLogs?: LogMessage[];
9
+ /** `# drill` wiring, so a result stays clickable when it is expanded. */
10
+ drill?: DrillBinding;
8
11
  }
9
- export default function ResultsDialog({ open, onClose, result, title, renderLogs, }: ResultsDialogProps): import("react/jsx-runtime").JSX.Element;
12
+ export default function ResultsDialog({ open, onClose, result, title, renderLogs, drill, }: ResultsDialogProps): import("react/jsx-runtime").JSX.Element;
10
13
  export {};
@@ -1,5 +1,5 @@
1
1
  import { default as React, ReactNode } from 'react';
2
- import { ConnectionsApi, DataAppsApi, DatabasesApi, EnvironmentsApi, MaterializationsApi, ModelsApi, NotebooksApi, PackagesApi, PublisherApi, WatchModeApi } from '../client';
2
+ import { ConnectionsApi, DashboardsApi, DataAppsApi, DatabasesApi, EnvironmentsApi, MaterializationsApi, ModelsApi, NotebooksApi, PackagesApi, PublisherApi, WatchModeApi } from '../client';
3
3
  import { Theme } from '../theme/types';
4
4
  export interface ServerContextValue {
5
5
  server: string;
@@ -47,6 +47,7 @@ declare const getApiClients: (baseURL?: string, accessToken?: () => Promise<stri
47
47
  publisher: PublisherApi;
48
48
  environments: EnvironmentsApi;
49
49
  packages: PackagesApi;
50
+ dashboards: DashboardsApi;
50
51
  dataApps: DataAppsApi;
51
52
  notebooks: NotebooksApi;
52
53
  connections: ConnectionsApi;
@@ -1,8 +1,17 @@
1
1
  import { MouseEvent } from 'react';
2
+ /**
3
+ * The modifier state a navigation decision reads, and nothing more.
4
+ *
5
+ * Both React's synthetic mouse event and the DOM's satisfy it, which is the
6
+ * point. A click can reach navigation from a React handler, or from outside
7
+ * React entirely (a `# drill` click arrives from the Malloy renderer as a plain
8
+ * DOM event), and neither should have to be converted to the other first.
9
+ */
10
+ export type NavigationClick = Pick<MouseEvent, "metaKey" | "ctrlKey" | "shiftKey" | "button">;
2
11
  /**
3
12
  * Custom hook that returns a function for handling clicks with proper modifier key support.
4
13
  * The returned function handles CMD/Ctrl clicks to open in new tabs, regular clicks for navigation.
5
14
  *
6
15
  * @returns A function that takes a relative URL and either navigates or opens in new tab
7
16
  */
8
- export declare function useRouterClickHandler(): (to: string, event?: MouseEvent) => void;
17
+ export declare function useRouterClickHandler(): (to: string, event?: NavigationClick) => void;
@@ -0,0 +1,3 @@
1
+ export { DRILL_CELL_CLASS, drillableFieldNames, markDrillableCells, type DrillMetadataSource, } from './markDrillableCells';
2
+ export { DRILL_SELF, drillDestinations, drillValueToFilter, encodeDrillValue, humanizeSlug, resolveDrill, type DrillClickPayload, type DrillField, type DrillIntent, type DrillNavigation, type DrillTagReader, } from './resolveDrill';
3
+ export { useDrill, type DrillBinding, type UseDrillOptions, type UseDrillResult, } from './useDrill';
@@ -0,0 +1,55 @@
1
+ import { DrillField } from './resolveDrill';
2
+ /**
3
+ * Marks a leaf value cell whose column declares an honorable `# drill`.
4
+ * Malloyyo's counterpart is `dash-drill`; the name is local to each app's
5
+ * stylesheet, and only the tag grammar is a compatibility surface.
6
+ */
7
+ export declare const DRILL_CELL_CLASS = "publisher-drill";
8
+ /** As much of the renderer's viz handle as the affordance reads. */
9
+ export interface DrillMetadataSource {
10
+ getMetadata: () => {
11
+ getAllFields: () => DrillField[];
12
+ } | null | undefined;
13
+ }
14
+ /**
15
+ * The column names to mark: every field whose `# drill` this surface can honor.
16
+ *
17
+ * Both the field's own name and its `# label` go in, because the header cell
18
+ * this is matched against renders `getLabel()`: the label when the author set
19
+ * one, the name otherwise, and the caller cannot tell which from the DOM.
20
+ *
21
+ * `canDrill` is the host's capability filter (see `useDrill`), so a destination
22
+ * the surface cannot reach never becomes a link: a dead link is worse than none.
23
+ */
24
+ export declare function drillableFieldNames(viz: DrillMetadataSource, canDrill: (field: DrillField) => boolean): Set<string>;
25
+ /**
26
+ * Add {@link DRILL_CELL_CLASS} to the cells `names` makes clickable.
27
+ *
28
+ * Per table rather than per container: a nested table has its own grid and its
29
+ * own column numbering, so matching across them would mark whichever column of
30
+ * the child happened to share a number with the parent's.
31
+ *
32
+ * Idempotent, and safe to call repeatedly: a `# dashboard` result builds its
33
+ * cards over several frames, so the caller re-runs this as the DOM settles.
34
+ */
35
+ export declare function markDrillableCells(container: HTMLElement, names: Set<string>): void;
36
+ /**
37
+ * The drillable cells sharing `cell`'s column, in row order, or an empty array
38
+ * when `cell` is not a marked cell.
39
+ *
40
+ * Lives here rather than in the keyboard handler that calls it because the
41
+ * column identity is this module's rule: a cell's column is its inline
42
+ * `grid-column` start, scoped to its own `.malloy-table` so a nested table's
43
+ * numbering never matches the parent's. Two sites deciding that separately is
44
+ * how they come to disagree, so the handler asks this one.
45
+ */
46
+ export declare function drillColumnSiblings(cell: HTMLElement): HTMLElement[];
47
+ /**
48
+ * Move a drillable column's single tab stop `to` rows from `from`, or to the
49
+ * first or last cell, and return the cell that should now take focus.
50
+ *
51
+ * Lives beside {@link drillColumnSiblings} because it enforces the same
52
+ * invariant the marking does: exactly one cell per column carries
53
+ * `tabindex="0"`.
54
+ */
55
+ export declare function moveDrillStop(from: HTMLElement, to: number | "first" | "last"): HTMLElement | undefined;