@malloy-publisher/sdk 0.9.10 → 0.9.12

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 (263) hide show
  1. package/dist/{RenderedResult-Dp1Qdajz.es.js → RenderedResult-CDiXJAh9.es.js} +102 -102
  2. package/dist/RenderedResult-De51QvsZ.cjs.js +153 -0
  3. package/dist/ServerProvider-DKrBcXL7.cjs.js +1 -0
  4. package/dist/{ServerProvider-CQy4jVYK.es.js → ServerProvider-RvKSbvnL.es.js} +622 -587
  5. package/dist/builder/index.cjs.js +78 -130
  6. package/dist/builder/index.es.js +7493 -6769
  7. package/dist/builder-entry.d.ts +3 -0
  8. package/dist/client/api.d.ts +72 -23
  9. package/dist/client/index.cjs.js +1 -1
  10. package/dist/client/index.es.js +1 -1
  11. package/dist/components/AppDialog.d.ts +9 -1
  12. package/dist/components/Connections/common.d.ts +11 -3
  13. package/dist/components/Dashboard/DashboardGrid.d.ts +14 -15
  14. package/dist/components/Dashboard/DashboardTile.d.ts +8 -1
  15. package/dist/components/Dashboard/DashboardView.d.ts +22 -34
  16. package/dist/components/Dashboard/TileCard.d.ts +10 -3
  17. package/dist/components/Dashboard/useStuck.d.ts +15 -7
  18. package/dist/components/DocumentCreate/useDocumentChoices.d.ts +6 -0
  19. package/dist/components/Package/PackageProblems.d.ts +14 -0
  20. package/dist/components/RemoveBadge.d.ts +40 -0
  21. package/dist/components/Report/Report.d.ts +13 -4
  22. package/dist/components/Report/ReportPage.d.ts +60 -0
  23. package/dist/components/Report/layoutRules.d.ts +32 -0
  24. package/dist/components/Report/reportQuery.d.ts +30 -0
  25. package/dist/components/Report/telemetry.d.ts +0 -2
  26. package/dist/components/ReportBuilder/AddTileDialog.d.ts +22 -3
  27. package/dist/components/ReportBuilder/BuilderBar.d.ts +17 -0
  28. package/dist/components/ReportBuilder/BuilderDialogs.d.ts +7 -6
  29. package/dist/components/ReportBuilder/BuilderGrid.d.ts +10 -4
  30. package/dist/components/ReportBuilder/BuilderHeader.d.ts +4 -7
  31. package/dist/components/ReportBuilder/BuilderToolbar.d.ts +88 -0
  32. package/dist/components/ReportBuilder/DrillDialog.d.ts +3 -1
  33. package/dist/components/ReportBuilder/EditorSurface.d.ts +7 -9
  34. package/dist/components/ReportBuilder/FilterDialog.d.ts +3 -1
  35. package/dist/components/ReportBuilder/FilterStrip.d.ts +30 -8
  36. package/dist/components/ReportBuilder/InlineMarkdown.d.ts +4 -4
  37. package/dist/components/ReportBuilder/ReportBuilder.d.ts +49 -12
  38. package/dist/components/ReportBuilder/ReportEditor.d.ts +53 -3
  39. package/dist/components/ReportBuilder/TextTileBody.d.ts +2 -5
  40. package/dist/components/ReportBuilder/TileFrame.d.ts +10 -4
  41. package/dist/components/ReportBuilder/TileMenu.d.ts +12 -9
  42. package/dist/components/ReportBuilder/ViewPicker.d.ts +53 -0
  43. package/dist/components/ReportBuilder/addTileToDocument.d.ts +24 -3
  44. package/dist/components/ReportBuilder/builderControls.d.ts +60 -0
  45. package/dist/components/ReportBuilder/catalog.d.ts +2 -4
  46. package/dist/components/ReportBuilder/inlineEdit.d.ts +9 -10
  47. package/dist/components/ReportBuilder/localGiven.d.ts +12 -0
  48. package/dist/components/ReportBuilder/preview.d.ts +17 -2
  49. package/dist/components/ReportBuilder/readDocument.d.ts +0 -2
  50. package/dist/components/ReportBuilder/readForEditor.d.ts +2 -7
  51. package/dist/components/ReportBuilder/reportTag.d.ts +11 -1
  52. package/dist/components/ReportBuilder/sortable.d.ts +4 -3
  53. package/dist/components/ReportBuilder/testing/inline.d.ts +5 -1
  54. package/dist/components/ReportBuilder/useBuilderSelection.d.ts +0 -1
  55. package/dist/components/ReportBuilder/useBuilderSession.d.ts +21 -12
  56. package/dist/components/ReportBuilder/useDocumentEditor.d.ts +2 -6
  57. package/dist/components/ReportBuilder/useExitGuard.d.ts +3 -0
  58. package/dist/components/ReportBuilder/useFilterForm.d.ts +3 -1
  59. package/dist/components/ReportBuilder/useOpenedDocument.d.ts +0 -4
  60. package/dist/components/ReportBuilder/useReportDraft.d.ts +66 -0
  61. package/dist/components/ReportBuilder/useReportEditor.d.ts +0 -9
  62. package/dist/components/ReportBuilder/useTileEditing.d.ts +6 -3
  63. package/dist/components/ReportBuilder/viewAnnotations.d.ts +9 -0
  64. package/dist/components/ReportBuilder/widthLabel.d.ts +6 -0
  65. package/dist/components/ServerProvider.d.ts +9 -0
  66. package/dist/components/controlTokens.d.ts +45 -0
  67. package/dist/components/drill/markDrillableCells.d.ts +1 -1
  68. package/dist/components/given/FilterButton.d.ts +35 -0
  69. package/dist/components/given/GivensPanel.d.ts +2 -1
  70. package/dist/components/given/filterEditing.d.ts +54 -0
  71. package/dist/components/given/filterSummary.d.ts +9 -0
  72. package/dist/components/given/paramCodec.d.ts +11 -0
  73. package/dist/components/given/required.d.ts +25 -0
  74. package/dist/components/index.d.ts +3 -0
  75. package/dist/components/legacy/index.d.ts +1 -1
  76. package/dist/components/{Report/CellReport.d.ts → legacy/malloynb/CellRunnerView.d.ts} +9 -17
  77. package/dist/components/legacy/{MalloynbCells.d.ts → malloynb/MalloynbCells.d.ts} +3 -3
  78. package/dist/components/legacy/{Notebook.d.ts → malloynb/Notebook.d.ts} +1 -1
  79. package/dist/components/{Notebook → legacy/malloynb}/NotebookCell.d.ts +3 -3
  80. package/dist/components/legacy/malloynb/cellKind.d.ts +5 -0
  81. package/dist/components/{Notebook → legacy/malloynb}/types.d.ts +1 -1
  82. package/dist/components/styles.d.ts +0 -2
  83. package/dist/hooks/useQueryResult.d.ts +7 -0
  84. package/dist/index.cjs.js +16 -19
  85. package/dist/index.es.js +8418 -7722
  86. package/dist/theme/ThemeContext.d.ts +8 -1
  87. package/dist/theme/classes.d.ts +49 -0
  88. package/dist/theme/index.d.ts +2 -0
  89. package/dist/theme/types.d.ts +7 -0
  90. package/dist/theme/ui.d.ts +75 -0
  91. package/dist/{useCompiledDocument-BMPDvdFx.es.js → useCompiledDocument-Bf4RSfB6.es.js} +8669 -7851
  92. package/dist/useCompiledDocument-XsQz85Ri.cjs.js +141 -0
  93. package/package.json +2 -2
  94. package/src/builder-entry.ts +9 -0
  95. package/src/components/AppDialog.tsx +23 -0
  96. package/src/components/Connections/AddConnectionDialog.tsx +34 -2
  97. package/src/components/Connections/EditConnectionDialog.tsx +45 -3
  98. package/src/components/Connections/common.spec.ts +69 -0
  99. package/src/components/Connections/common.ts +132 -0
  100. package/src/components/Dashboard/DashboardGrid.tsx +39 -17
  101. package/src/components/Dashboard/DashboardTile.tsx +19 -2
  102. package/src/components/Dashboard/DashboardView.spec.tsx +216 -15
  103. package/src/components/Dashboard/DashboardView.tsx +137 -155
  104. package/src/components/Dashboard/RowsDialog.tsx +1 -2
  105. package/src/components/Dashboard/TileCard.tsx +28 -10
  106. package/src/components/Dashboard/defaultTileSpan.spec.ts +24 -0
  107. package/src/components/Dashboard/useStuck.ts +28 -17
  108. package/src/components/DocumentCreate/useDocumentChoices.ts +19 -2
  109. package/src/components/Environment/Connections.tsx +1 -0
  110. package/src/components/Package/NewDocumentDialog.spec.tsx +76 -59
  111. package/src/components/Package/NewDocumentDialog.tsx +383 -119
  112. package/src/components/Package/Package.artifacts.spec.tsx +1 -1
  113. package/src/components/Package/Package.create.spec.tsx +7 -6
  114. package/src/components/Package/Package.tsx +10 -7
  115. package/src/components/Package/PackageProblems.spec.tsx +41 -0
  116. package/src/components/Package/PackageProblems.tsx +95 -0
  117. package/src/components/Prose.tsx +12 -7
  118. package/src/components/RemoveBadge.tsx +94 -0
  119. package/src/components/RenderedResult/RenderedResult.tsx +5 -9
  120. package/src/components/RenderedResult/ResultPanel.tsx +59 -3
  121. package/src/components/Report/Report.spec.tsx +50 -32
  122. package/src/components/Report/Report.telemetry.spec.tsx +0 -45
  123. package/src/components/Report/Report.tsx +45 -77
  124. package/src/components/Report/ReportPage.tsx +168 -0
  125. package/src/components/Report/layoutRules.spec.ts +35 -0
  126. package/src/components/Report/layoutRules.ts +55 -0
  127. package/src/components/Report/reportQuery.ts +53 -0
  128. package/src/components/Report/telemetry.ts +0 -2
  129. package/src/components/ReportBuilder/AddTileDialog.spec.tsx +76 -41
  130. package/src/components/ReportBuilder/AddTileDialog.tsx +368 -133
  131. package/src/components/ReportBuilder/BuilderBar.tsx +599 -0
  132. package/src/components/ReportBuilder/BuilderDialogs.tsx +28 -39
  133. package/src/components/ReportBuilder/BuilderGrid.tsx +31 -29
  134. package/src/components/ReportBuilder/BuilderHeader.tsx +63 -75
  135. package/src/components/ReportBuilder/BuilderToolbar.tsx +95 -9
  136. package/src/components/ReportBuilder/DrillDialog.tsx +240 -128
  137. package/src/components/ReportBuilder/EditorSurface.tsx +345 -69
  138. package/src/components/ReportBuilder/FilterDialog.tsx +516 -166
  139. package/src/components/ReportBuilder/FilterStrip.tsx +130 -151
  140. package/src/components/ReportBuilder/InlineMarkdown.tsx +71 -45
  141. package/src/components/ReportBuilder/ReportBuilder.charts.spec.tsx +35 -40
  142. package/src/components/ReportBuilder/ReportBuilder.controls.spec.tsx +491 -0
  143. package/src/components/ReportBuilder/ReportBuilder.exit.spec.tsx +2 -4
  144. package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +13 -15
  145. package/src/components/ReportBuilder/ReportBuilder.notebook.spec.tsx +27 -118
  146. package/src/components/ReportBuilder/ReportBuilder.openDraft.spec.tsx +12 -5
  147. package/src/components/ReportBuilder/ReportBuilder.sources.spec.tsx +2 -10
  148. package/src/components/ReportBuilder/ReportBuilder.spec.tsx +37 -31
  149. package/src/components/ReportBuilder/ReportBuilder.textTiles.spec.tsx +22 -15
  150. package/src/components/ReportBuilder/ReportBuilder.tsx +292 -117
  151. package/src/components/ReportBuilder/ReportEditor.emptyStart.spec.tsx +2 -1
  152. package/src/components/ReportBuilder/ReportEditor.modelFilters.spec.tsx +312 -0
  153. package/src/components/ReportBuilder/ReportEditor.notebook.spec.tsx +26 -75
  154. package/src/components/ReportBuilder/ReportEditor.package.spec.tsx +6 -2
  155. package/src/components/ReportBuilder/ReportEditor.resourceUri.spec.tsx +3 -2
  156. package/src/components/ReportBuilder/ReportEditor.spec.tsx +2 -4
  157. package/src/components/ReportBuilder/ReportEditor.textSource.spec.tsx +93 -13
  158. package/src/components/ReportBuilder/ReportEditor.tsx +104 -14
  159. package/src/components/ReportBuilder/TextTileBody.tsx +6 -7
  160. package/src/components/ReportBuilder/TileFrame.tsx +212 -75
  161. package/src/components/ReportBuilder/TileMenu.tsx +241 -140
  162. package/src/components/ReportBuilder/ViewPicker.tsx +349 -0
  163. package/src/components/ReportBuilder/addTile.compile.spec.ts +1 -1
  164. package/src/components/ReportBuilder/addTileToDocument.spec.ts +102 -3
  165. package/src/components/ReportBuilder/addTileToDocument.ts +122 -25
  166. package/src/components/ReportBuilder/builderControls.ts +164 -0
  167. package/src/components/ReportBuilder/builderReport.ts +1 -2
  168. package/src/components/ReportBuilder/catalog.ts +10 -26
  169. package/src/components/ReportBuilder/inlineEdit.tsx +22 -54
  170. package/src/components/ReportBuilder/localGiven.ts +56 -0
  171. package/src/components/ReportBuilder/preview.spec.ts +125 -5
  172. package/src/components/ReportBuilder/preview.ts +60 -44
  173. package/src/components/ReportBuilder/readDocument.spec.ts +16 -22
  174. package/src/components/ReportBuilder/readDocument.ts +14 -11
  175. package/src/components/ReportBuilder/readForEditor.spec.ts +12 -41
  176. package/src/components/ReportBuilder/readForEditor.ts +4 -26
  177. package/src/components/ReportBuilder/reportTag.ts +28 -7
  178. package/src/components/ReportBuilder/sortable.tsx +15 -7
  179. package/src/components/ReportBuilder/spliceDocument.imports.spec.ts +1 -1
  180. package/src/components/ReportBuilder/tagParse.spec.ts +0 -40
  181. package/src/components/ReportBuilder/testing/inline.ts +25 -5
  182. package/src/components/ReportBuilder/testing/reportLayoutParity.json +13 -8
  183. package/src/components/ReportBuilder/textTiles.spec.ts +7 -6
  184. package/src/components/ReportBuilder/useBuilderSelection.ts +35 -0
  185. package/src/components/ReportBuilder/useBuilderSession.spec.ts +2 -2
  186. package/src/components/ReportBuilder/useBuilderSession.ts +21 -13
  187. package/src/components/ReportBuilder/useDocumentEditor.spec.ts +0 -58
  188. package/src/components/ReportBuilder/useDocumentEditor.ts +3 -16
  189. package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +26 -0
  190. package/src/components/ReportBuilder/useEditorCatalog.ts +7 -2
  191. package/src/components/ReportBuilder/useExitGuard.ts +16 -0
  192. package/src/components/ReportBuilder/useFilterForm.spec.tsx +17 -0
  193. package/src/components/ReportBuilder/useFilterForm.ts +5 -1
  194. package/src/components/ReportBuilder/useOpenedDocument.ts +0 -2
  195. package/src/components/ReportBuilder/useReportDraft.spec.ts +149 -0
  196. package/src/components/ReportBuilder/useReportDraft.ts +292 -0
  197. package/src/components/ReportBuilder/useReportEditor.ts +3 -12
  198. package/src/components/ReportBuilder/useSaveChannel.ts +0 -1
  199. package/src/components/ReportBuilder/useTileEditing.ts +43 -12
  200. package/src/components/ReportBuilder/viewAnnotations.ts +29 -0
  201. package/src/components/ReportBuilder/widthLabel.spec.ts +25 -0
  202. package/src/components/ReportBuilder/widthLabel.ts +26 -0
  203. package/src/components/ServerProvider.tsx +11 -0
  204. package/src/components/controlTokens.ts +47 -0
  205. package/src/components/drill/markDrillableCells.ts +2 -1
  206. package/src/components/given/FilterButton.spec.tsx +143 -0
  207. package/src/components/given/FilterButton.tsx +478 -0
  208. package/src/components/given/GivenInput.spec.tsx +47 -0
  209. package/src/components/given/GivenInput.tsx +20 -2
  210. package/src/components/given/GivensPanel.spec.tsx +11 -3
  211. package/src/components/given/GivensPanel.tsx +45 -44
  212. package/src/components/given/filterEditing.ts +60 -0
  213. package/src/components/given/filterSummary.spec.ts +108 -0
  214. package/src/components/given/filterSummary.ts +109 -0
  215. package/src/components/given/paramCodec.ts +1 -1
  216. package/src/components/given/required.spec.ts +60 -0
  217. package/src/components/given/required.ts +78 -0
  218. package/src/components/index.ts +9 -0
  219. package/src/components/legacy/Dashboard.spec.tsx +3 -1
  220. package/src/components/legacy/index.ts +1 -1
  221. package/src/components/{Report/CellReport.spec.tsx → legacy/malloynb/CellRunnerView.spec.tsx} +53 -57
  222. package/src/components/{Report/CellReport.tsx → legacy/malloynb/CellRunnerView.tsx} +122 -136
  223. package/src/components/legacy/{MalloynbCells.tsx → malloynb/MalloynbCells.tsx} +6 -6
  224. package/src/components/legacy/{Notebook.layout.spec.tsx → malloynb/Notebook.layout.spec.tsx} +16 -7
  225. package/src/components/legacy/malloynb/Notebook.served.spec.tsx +84 -0
  226. package/src/components/legacy/{Notebook.spec.tsx → malloynb/Notebook.spec.tsx} +5 -3
  227. package/src/components/legacy/{Notebook.tsx → malloynb/Notebook.tsx} +9 -7
  228. package/src/components/{Notebook → legacy/malloynb}/NotebookCell.tsx +70 -150
  229. package/src/components/legacy/malloynb/cellKind.spec.ts +33 -0
  230. package/src/components/legacy/malloynb/cellKind.ts +24 -0
  231. package/src/components/{Notebook → legacy/malloynb}/types.ts +1 -1
  232. package/src/components/styles.ts +0 -18
  233. package/src/hooks/useGivensState.ts +7 -3
  234. package/src/hooks/useQueryResult.placeholder.spec.ts +44 -0
  235. package/src/hooks/useQueryResult.ts +26 -1
  236. package/src/theme/ThemeContext.tsx +21 -1
  237. package/src/theme/classes.ts +52 -0
  238. package/src/theme/index.ts +8 -0
  239. package/src/theme/resolveTheme.ts +3 -0
  240. package/src/theme/types.ts +7 -0
  241. package/src/theme/ui.spec.tsx +91 -0
  242. package/src/theme/ui.ts +115 -0
  243. package/dist/RenderedResult-BcgYjkZ0.cjs.js +0 -153
  244. package/dist/ServerProvider-B0dUY8be.cjs.js +0 -1
  245. package/dist/components/Notebook/cellKind.d.ts +0 -20
  246. package/dist/components/Report/LinearReport.d.ts +0 -18
  247. package/dist/components/ReportBuilder/SourceViewPicker.d.ts +0 -9
  248. package/dist/components/ReportBuilder/legacyNotebook.d.ts +0 -73
  249. package/dist/components/ReportBuilder/useConversionConfirm.d.ts +0 -20
  250. package/dist/useCompiledDocument-UY28ITET.cjs.js +0 -141
  251. package/src/components/Notebook/cellKind.spec.ts +0 -199
  252. package/src/components/Notebook/cellKind.ts +0 -74
  253. package/src/components/Report/LinearReport.tsx +0 -71
  254. package/src/components/ReportBuilder/SourceViewPicker.tsx +0 -122
  255. package/src/components/ReportBuilder/legacyNotebook.chart.spec.ts +0 -77
  256. package/src/components/ReportBuilder/legacyNotebook.convert.spec.ts +0 -626
  257. package/src/components/ReportBuilder/legacyNotebook.read.spec.ts +0 -338
  258. package/src/components/ReportBuilder/legacyNotebook.ts +0 -1122
  259. package/src/components/ReportBuilder/useConversionConfirm.ts +0 -55
  260. package/src/components/legacy/Notebook.served.spec.tsx +0 -183
  261. /package/dist/components/{Notebook → legacy/malloynb}/runPlan.d.ts +0 -0
  262. /package/src/components/{Notebook → legacy/malloynb}/runPlan.spec.ts +0 -0
  263. /package/src/components/{Notebook → legacy/malloynb}/runPlan.ts +0 -0
@@ -1,10 +1,10 @@
1
1
  import { jsx as L } from "react/jsx-runtime";
2
- import { Box as ne, useTheme as he } from "@mui/material";
3
- import { Suspense as me, useRef as F, useCallback as be, useMemo as fe, useEffect as ye, useLayoutEffect as pe } from "react";
4
- import { D as ge, r as U, l as ve, a as we, b as ke, c as xe, m as Ce, d as Re, e as le } from "./useCompiledDocument-BMPDvdFx.es.js";
5
- import { b6 as Ee, b4 as Se, b7 as Ae } from "./ServerProvider-CQy4jVYK.es.js";
6
- const g = "publisher-drill";
7
- function Te(e, r) {
2
+ import { Box as ae } from "@mui/material";
3
+ import { Suspense as ue, useRef as F, useCallback as he, useMemo as me, useEffect as be, useLayoutEffect as fe } from "react";
4
+ import { r as ye, D as pe, a as X, l as ge, b as ve, c as we, d as ke, m as xe, e as Ce, f as ne } from "./useCompiledDocument-Bf4RSfB6.es.js";
5
+ import { b6 as Re, b4 as Ee, b7 as Se } from "./ServerProvider-RvKSbvnL.es.js";
6
+ const g = ye.drillCell;
7
+ function Ae(e, r) {
8
8
  const t = /* @__PURE__ */ new Set();
9
9
  let l;
10
10
  try {
@@ -26,7 +26,7 @@ function I(e) {
26
26
  const r = /^\s*(\d+)/.exec(e.style?.gridColumn ?? "");
27
27
  return r ? r[1] : void 0;
28
28
  }
29
- function De(e, r) {
29
+ function Te(e, r) {
30
30
  if (r.size !== 0)
31
31
  for (const t of e.querySelectorAll(
32
32
  ".malloy-table"
@@ -65,7 +65,7 @@ function De(e, r) {
65
65
  }
66
66
  }
67
67
  }
68
- function Oe(e) {
68
+ function De(e) {
69
69
  const r = e.closest(".malloy-table"), t = I(e);
70
70
  return !r || !t ? [] : Array.from(
71
71
  r.querySelectorAll(`.${g}`)
@@ -73,8 +73,8 @@ function Oe(e) {
73
73
  (l) => l.closest(".malloy-table") === r && I(l) === t
74
74
  );
75
75
  }
76
- function ie(e, r) {
77
- const t = Oe(e), l = t.indexOf(e);
76
+ function le(e, r) {
77
+ const t = De(e), l = t.indexOf(e);
78
78
  if (l === -1) return;
79
79
  const o = r === "first" ? t[0] : r === "last" ? t[t.length - 1] : t[Math.min(Math.max(l + r, 0), t.length - 1)];
80
80
  if (o) {
@@ -82,7 +82,7 @@ function ie(e, r) {
82
82
  return o;
83
83
  }
84
84
  }
85
- function _e(e) {
85
+ function Oe(e) {
86
86
  return {
87
87
  background: e.dashboardRoot,
88
88
  tableBackground: e.tableBackground,
@@ -104,7 +104,7 @@ function _e(e) {
104
104
  mapColor: e.mapColor
105
105
  };
106
106
  }
107
- function ze(e) {
107
+ function _e(e) {
108
108
  const { foreground: r, axisFaint: t, gridline: l, font: o } = e, a = {
109
109
  background: e.background,
110
110
  font: o.family,
@@ -132,7 +132,7 @@ function ze(e) {
132
132
  };
133
133
  return (s) => s === "shape_map" ? n : a;
134
134
  }
135
- function Fe(e) {
135
+ function ze(e) {
136
136
  if (!e) return;
137
137
  const r = e.tag("theme");
138
138
  if (!r) return;
@@ -140,7 +140,7 @@ function Fe(e) {
140
140
  if (l) {
141
141
  const a = {}, n = l.textArray("series");
142
142
  n && n.length > 0 && (a.series = n);
143
- for (const s of Ee) {
143
+ for (const s of Re) {
144
144
  const b = l.tag(s);
145
145
  if (!b) continue;
146
146
  const y = {}, k = b.text("light"), v = b.text("dark");
@@ -157,25 +157,25 @@ function Fe(e) {
157
157
  }
158
158
  return Object.keys(t).length > 0 ? t : void 0;
159
159
  }
160
- const M = "data-publisher-fill", Le = async (e, r) => {
160
+ const M = "data-publisher-fill", Fe = async (e, r) => {
161
161
  if (typeof window > "u")
162
162
  throw new Error("MalloyRenderer can only be used in browser environment");
163
- const { MalloyRenderer: t } = await we();
163
+ const { MalloyRenderer: t } = await ve();
164
164
  return new t({
165
165
  onClick: r,
166
- vegaConfigOverride: ze(e),
166
+ vegaConfigOverride: _e(e),
167
167
  // Pass the explicit theme so table chrome and dashboard tiles
168
168
  // pick up the operator's colours directly. Without this the
169
169
  // renderer's own inline style writes `--malloy-render--*` values
170
170
  // sourced from its built-in defaults and shadows whatever we set
171
171
  // on the outer wrapper.
172
- theme: _e(e),
172
+ theme: Oe(e),
173
173
  onError: (o) => {
174
174
  console.error("Error rendering visualization:", typeof o, o);
175
175
  }
176
176
  }).createViz();
177
177
  };
178
- async function Me(e) {
178
+ async function Le(e) {
179
179
  if (!e || typeof e != "object") return;
180
180
  const r = e, t = [
181
181
  ...Array.isArray(r.model_annotations) ? r.model_annotations : [],
@@ -185,13 +185,13 @@ async function Me(e) {
185
185
  if (t.length === 0) return;
186
186
  let l;
187
187
  try {
188
- ({ parseAnnotation: l } = await ve());
188
+ ({ parseAnnotation: l } = await ge());
189
189
  } catch {
190
190
  return;
191
191
  }
192
192
  try {
193
193
  const { tag: o } = l(t);
194
- return Fe(o);
194
+ return ze(o);
195
195
  } catch (o) {
196
196
  console.warn(
197
197
  "Failed to parse # theme.* annotations; chart will render with the shell theme.",
@@ -200,12 +200,12 @@ async function Me(e) {
200
200
  return;
201
201
  }
202
202
  }
203
- function Ie(e, r, t) {
204
- const l = ke(r, t);
203
+ function Me(e, r, t) {
204
+ const l = we(r, t);
205
205
  for (const [o, a] of Object.entries(l))
206
206
  e.style.setProperty(o, a);
207
207
  }
208
- const Be = `
208
+ const Ie = `
209
209
  /* Card geometry, through the renderer's OWN theme vars rather than over the top
210
210
  of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
211
211
  passes each through to the --malloy-render--* the card CSS reads, so a value
@@ -357,13 +357,13 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
357
357
  color: var(--publisher-drill-link) !important;
358
358
  text-decoration: underline;
359
359
  }
360
- `, se = "publisher-malloy-renderer-overrides";
361
- function Ne() {
362
- if (typeof document > "u" || document.getElementById(se)) return;
360
+ `, ie = "publisher-malloy-renderer-overrides";
361
+ function Be() {
362
+ if (typeof document > "u" || document.getElementById(ie)) return;
363
363
  const e = document.createElement("style");
364
- e.id = se, e.textContent = Be, document.head.appendChild(e);
364
+ e.id = ie, e.textContent = Ie, document.head.appendChild(e);
365
365
  }
366
- function $e({
366
+ function Ne({
367
367
  result: e,
368
368
  height: r,
369
369
  drill: t,
@@ -373,43 +373,43 @@ function $e({
373
373
  }) {
374
374
  const n = F(null), s = F(t);
375
375
  s.current = t;
376
- const b = be((c) => {
376
+ const b = he((c) => {
377
377
  s.current?.onClick(c);
378
378
  }, []), y = t !== void 0, k = F(!1), v = F(
379
379
  null
380
- ), P = F(0), { theme: X, layers: Y, mode: J } = Se(), W = he().shape.borderRadius, Q = fe(
380
+ ), V = F(0), { theme: B, layers: Y, mode: J } = Ee(), W = me(
381
381
  () => ({
382
- radius: `${W}px`,
383
- padding: `${ge}px`
382
+ radius: B.ui.radius.tile,
383
+ padding: `${pe}px`
384
384
  }),
385
- [W]
385
+ [B.ui.radius.tile]
386
386
  );
387
- return ye(() => () => {
388
- P.current += 1;
387
+ return be(() => () => {
388
+ V.current += 1;
389
389
  const c = v.current;
390
390
  c?.viz.remove(), c?.node.remove(), v.current = null;
391
- }, []), pe(() => {
391
+ }, []), fe(() => {
392
392
  if (!n.current || !e) return;
393
- Ne();
394
- const c = n.current, de = P.current += 1;
395
- let V = !1;
396
- const q = () => !V && de === P.current;
397
- let d, h, B = null, H = 0, N = null, $ = null, j = null, T = null, D = null, O = null, Z = null, ee = 0, C = null;
393
+ Be();
394
+ const c = n.current, se = V.current += 1;
395
+ let q = !1;
396
+ const H = () => !q && se === V.current;
397
+ let d, h, N = null, K = 0, $ = null, j = null, P = null, T = null, D = null, O = null, Q = null, Z = 0, C = null;
398
398
  k.current = !1;
399
399
  let p, R;
400
- const K = (w) => {
401
- if (V || !w.firstElementChild || U(p, R) === "container") return;
402
- const _ = xe(p, R);
400
+ const G = (w) => {
401
+ if (q || !w.firstElementChild || X(p, R) === "container") return;
402
+ const _ = ke(p, R);
403
403
  if (k.current && !_) return;
404
404
  const z = c.hasAttribute(M);
405
405
  z && c.removeAttribute(M);
406
- const E = Ce(
406
+ const E = xe(
407
407
  w,
408
- le(p)
408
+ ne(p)
409
409
  );
410
- z && c.setAttribute(M, ""), E > 0 && (k.current = !0, l && E !== ee && (ee = E, l(E)));
411
- const u = Re(w, le(p));
412
- _ && u && Z !== u && (Z = u, O?.disconnect(), O = new ResizeObserver(() => K(w)), O.observe(u));
410
+ z && c.setAttribute(M, ""), E > 0 && (k.current = !0, l && E !== Z && (Z = E, l(E)));
411
+ const u = Ce(w, ne(p));
412
+ _ && u && Q !== u && (Q = u, O?.disconnect(), O = new ResizeObserver(() => G(w)), O.observe(u));
413
413
  };
414
414
  return (async () => {
415
415
  let w;
@@ -419,38 +419,38 @@ function $e({
419
419
  console.error("Error parsing visualization result:", f);
420
420
  return;
421
421
  }
422
- const _ = await Me(w), z = _ ? Ae([...Y, _], J) : X;
423
- if (!q()) return;
422
+ const _ = await Le(w), z = _ ? Se([...Y, _], J) : B;
423
+ if (!H()) return;
424
424
  try {
425
- h = await Le(z, b);
425
+ h = await Fe(z, b);
426
426
  } catch (f) {
427
427
  console.error("Failed to create renderer:", f);
428
428
  return;
429
429
  }
430
- if (!q()) {
430
+ if (!H()) {
431
431
  h.remove(), h = void 0;
432
432
  return;
433
433
  }
434
434
  const E = v.current;
435
- d = document.createElement("div"), d.style.width = "100%", d.style.height = "100%", Ie(d, z, Q), c.childElementCount > 0 && (c.style.position = "relative", d.style.position = "absolute", d.style.inset = "0", d.style.visibility = "hidden"), c.appendChild(d);
435
+ d = document.createElement("div"), d.style.width = "100%", d.style.height = "100%", Me(d, z, W), c.childElementCount > 0 && (c.style.position = "relative", d.style.position = "absolute", d.style.inset = "0", d.style.visibility = "hidden"), c.appendChild(d);
436
436
  const u = d;
437
437
  T = new MutationObserver(() => {
438
438
  D && clearTimeout(D), D = setTimeout(() => {
439
- K(u), k.current && T?.disconnect();
439
+ G(u), k.current && T?.disconnect();
440
440
  }, 100);
441
441
  }), T.observe(d, {
442
442
  childList: !0,
443
443
  subtree: !0,
444
444
  attributes: !0
445
445
  });
446
- const ce = h;
447
- let re = !1;
448
- const te = () => {
449
- if (!(re || !q())) {
450
- re = !0, C && (clearTimeout(C), C = null), E?.viz.remove();
446
+ const de = h;
447
+ let ee = !1;
448
+ const re = () => {
449
+ if (!(ee || !H())) {
450
+ ee = !0, C && (clearTimeout(C), C = null), E?.viz.remove();
451
451
  for (const f of Array.from(c.children))
452
452
  f !== u && c.removeChild(f);
453
- u.style.position = "", u.style.inset = "", u.style.visibility = "", c.style.position = "", v.current = { viz: ce, node: u }, K(u);
453
+ u.style.position = "", u.style.inset = "", u.style.visibility = "", c.style.position = "", v.current = { viz: de, node: u }, G(u);
454
454
  }
455
455
  };
456
456
  try {
@@ -461,51 +461,51 @@ function $e({
461
461
  } catch {
462
462
  p = void 0, R = void 0;
463
463
  }
464
- o?.(U(p, R)), d.dataset.malloyRenderAs = p ?? "unknown", d.dataset.malloySizing = U(p, R), h.render(d);
464
+ o?.(X(p, R)), d.dataset.malloyRenderAs = p ?? "unknown", d.dataset.malloySizing = X(p, R), h.render(d);
465
465
  const f = s.current;
466
466
  try {
467
467
  if (f) {
468
- const x = Te(h, f.canDrill), S = () => {
468
+ const x = Ae(h, f.canDrill), S = () => {
469
469
  try {
470
- De(u, x);
470
+ Te(u, x);
471
471
  } catch (i) {
472
472
  console.warn("Drill affordance skipped:", i);
473
473
  }
474
474
  };
475
475
  S();
476
- const oe = (i) => {
477
- const A = i.querySelector(".cell-content") ?? i, G = A.getBoundingClientRect();
476
+ const te = (i) => {
477
+ const A = i.querySelector(".cell-content") ?? i, U = A.getBoundingClientRect();
478
478
  A.dispatchEvent(
479
479
  new MouseEvent("click", {
480
480
  bubbles: !0,
481
481
  cancelable: !0,
482
482
  view: A.ownerDocument.defaultView,
483
- clientX: Math.round(G.left + G.width / 2),
484
- clientY: Math.round(G.bottom)
483
+ clientX: Math.round(U.left + U.width / 2),
484
+ clientY: Math.round(U.bottom)
485
485
  })
486
486
  );
487
- }, ae = (i) => i.target?.closest?.(`.${g}`) ?? null, ue = (i, m) => {
488
- ie(i, m)?.focus();
487
+ }, oe = (i) => i.target?.closest?.(`.${g}`) ?? null, ce = (i, m) => {
488
+ le(i, m)?.focus();
489
489
  };
490
- N = (i) => {
491
- const m = ae(i);
490
+ $ = (i) => {
491
+ const m = oe(i);
492
492
  if (!m) return;
493
493
  const A = i.key === "ArrowDown" ? 1 : i.key === "ArrowUp" ? -1 : i.key === "Home" ? "first" : i.key === "End" ? "last" : void 0;
494
494
  if (A !== void 0) {
495
- i.preventDefault(), ue(m, A);
495
+ i.preventDefault(), ce(m, A);
496
496
  return;
497
497
  }
498
- i.key === "Enter" ? (i.preventDefault(), oe(m)) : i.key === " " && i.preventDefault();
499
- }, $ = (i) => {
500
- if (i.key !== " ") return;
501
- const m = ae(i);
502
- m && (i.preventDefault(), oe(m));
498
+ i.key === "Enter" ? (i.preventDefault(), te(m)) : i.key === " " && i.preventDefault();
503
499
  }, j = (i) => {
500
+ if (i.key !== " ") return;
501
+ const m = oe(i);
502
+ m && (i.preventDefault(), te(m));
503
+ }, P = (i) => {
504
504
  const m = i.target?.closest?.(`.${g}`);
505
- m && ie(m, 0);
506
- }, u.addEventListener("keydown", N), u.addEventListener("keyup", $), u.addEventListener("focusin", j), x.size > 0 && typeof MutationObserver < "u" && (B = new MutationObserver(() => {
507
- cancelAnimationFrame(H), H = requestAnimationFrame(S);
508
- }), B.observe(u, {
505
+ m && le(m, 0);
506
+ }, u.addEventListener("keydown", $), u.addEventListener("keyup", j), u.addEventListener("focusin", P), x.size > 0 && typeof MutationObserver < "u" && (N = new MutationObserver(() => {
507
+ cancelAnimationFrame(K), K = requestAnimationFrame(S);
508
+ }), N.observe(u, {
509
509
  childList: !0,
510
510
  subtree: !0
511
511
  }));
@@ -513,12 +513,12 @@ function $e({
513
513
  } catch (x) {
514
514
  console.warn("Drill affordance skipped:", x);
515
515
  }
516
- h.onReady(te), C = setTimeout(te, 1e4);
516
+ h.onReady(re), C = setTimeout(re, 1e4);
517
517
  } catch (f) {
518
- console.error("Error rendering visualization:", f), T?.disconnect(), O?.disconnect(), B?.disconnect(), h.remove(), h = void 0, u.parentNode === c && c.removeChild(u);
518
+ console.error("Error rendering visualization:", f), T?.disconnect(), O?.disconnect(), N?.disconnect(), h.remove(), h = void 0, u.parentNode === c && c.removeChild(u);
519
519
  }
520
520
  })(), () => {
521
- V = !0, T?.disconnect(), O?.disconnect(), D && clearTimeout(D), C && clearTimeout(C), d && v.current?.node !== d && (N && d.removeEventListener("keydown", N), $ && d.removeEventListener("keyup", $), j && d.removeEventListener("focusin", j), B?.disconnect(), cancelAnimationFrame(H), h?.remove(), d.parentNode === c && c.removeChild(d), c.style.position = "");
521
+ q = !0, T?.disconnect(), O?.disconnect(), D && clearTimeout(D), C && clearTimeout(C), d && v.current?.node !== d && ($ && d.removeEventListener("keydown", $), j && d.removeEventListener("keyup", j), P && d.removeEventListener("focusin", P), N?.disconnect(), cancelAnimationFrame(K), h?.remove(), d.parentNode === c && c.removeChild(d), c.style.position = "");
522
522
  };
523
523
  }, [
524
524
  e,
@@ -526,10 +526,10 @@ function $e({
526
526
  y,
527
527
  l,
528
528
  o,
529
- X,
529
+ B,
530
530
  Y,
531
531
  J,
532
- Q
532
+ W
533
533
  ]), /* @__PURE__ */ L(
534
534
  "div",
535
535
  {
@@ -542,9 +542,9 @@ function $e({
542
542
  }
543
543
  );
544
544
  }
545
- function je(e) {
545
+ function $e(e) {
546
546
  return typeof window > "u" ? /* @__PURE__ */ L(
547
- ne,
547
+ ae,
548
548
  {
549
549
  sx: {
550
550
  width: "100%",
@@ -557,10 +557,10 @@ function je(e) {
557
557
  children: "Loading..."
558
558
  }
559
559
  ) : /* @__PURE__ */ L(
560
- me,
560
+ ue,
561
561
  {
562
562
  fallback: /* @__PURE__ */ L(
563
- ne,
563
+ ae,
564
564
  {
565
565
  sx: {
566
566
  width: "100%",
@@ -573,21 +573,21 @@ function je(e) {
573
573
  children: "Loading visualization..."
574
574
  }
575
575
  ),
576
- children: /* @__PURE__ */ L($e, { ...e })
576
+ children: /* @__PURE__ */ L(Ne, { ...e })
577
577
  }
578
578
  );
579
579
  }
580
- const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
580
+ const Ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
581
581
  __proto__: null,
582
- default: je
582
+ default: $e
583
583
  }, Symbol.toStringTag, { value: "Module" }));
584
584
  export {
585
585
  g as D,
586
- je as R,
587
- ze as a,
588
- _e as b,
589
- Ge as c,
590
- Te as d,
591
- De as m,
592
- Fe as r
586
+ $e as R,
587
+ _e as a,
588
+ Oe as b,
589
+ Ke as c,
590
+ Ae as d,
591
+ Te as m,
592
+ ze as r
593
593
  };
@@ -0,0 +1,153 @@
1
+ "use strict";const M=require("react/jsx-runtime"),ne=require("@mui/material"),p=require("react"),h=require("./useCompiledDocument-XsQz85Ri.cjs.js"),Y=require("./ServerProvider-DKrBcXL7.cjs.js"),g=h.reportClasses.drillCell;function se(e,r){const t=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return t}const o=new Set;for(const a of l)!a||r(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!r(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||t.add(n)}return t}function B(e){const r=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return r?r[1]:void 0}function de(e,r){if(r.size!==0)for(const t of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===t,o=new Set;for(const n of t.querySelectorAll(".column-cell.th")){if(!l(n))continue;const s=(n.textContent??"").replace(/\u200b/g,"").trim(),f=B(n);f&&r.has(s)&&o.add(f)}if(o.size===0)continue;const a=new Set;for(const n of t.querySelectorAll(`.${g}[tabindex="0"]`)){if(!l(n))continue;const s=B(n);s&&(a.has(s)?n.tabIndex=-1:a.add(s))}for(const n of t.querySelectorAll(".column-cell.td")){if(!l(n))continue;const s=B(n),f=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(s&&f&&o.has(s)&&!n.querySelector(".malloy-table")){if(n.classList.add(g),n.tabIndex===0)a.add(s);else{const v=a.has(s);v||a.add(s),n.tabIndex=v?-1:0}n.setAttribute("role","button")}}}}function pe(e){const r=e.closest(".malloy-table"),t=B(e);return!r||!t?[]:Array.from(r.querySelectorAll(`.${g}`)).filter(l=>l.closest(".malloy-table")===r&&B(l)===t)}function le(e,r){const t=pe(e),l=t.indexOf(e);if(l===-1)return;const o=r==="first"?t[0]:r==="last"?t[t.length-1]:t[Math.min(Math.max(l+r,0),t.length-1)];if(o){for(const a of t)a.tabIndex=a===o?0:-1;return o}}function ce(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function ue(e){const{foreground:r,axisFaint:t,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:r,font:o.family},axis:{labelColor:r,titleColor:r,domainColor:t,tickColor:t,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:r,titleColor:r,labelFont:o.family,titleFont:o.family},header:{labelColor:r,titleColor:r},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return s=>s==="shape_map"?n:a}function he(e){if(!e)return;const r=e.tag("theme");if(!r)return;const t={},l=r.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const s of Y.PER_MODE_COLOR_KEYS){const f=l.tag(s);if(!f)continue;const v={},C=f.text("light"),k=f.text("dark");C&&(v.light=C),k&&(v.dark=k),Object.keys(v).length>0&&(a[s]=v)}Object.keys(a).length>0&&(t.palette=a)}const o=r.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const s=o.numeric("size");typeof s=="number"&&Number.isFinite(s)&&(a.size=s),Object.keys(a).length>0&&(t.font=a)}return Object.keys(t).length>0?t:void 0}const I="data-publisher-fill",ge=async(e,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await h.loadMalloyRenderer();return new t({onClick:r,vegaConfigOverride:ue(e),theme:ce(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};async function ve(e){if(!e||typeof e!="object")return;const r=e,t=[...Array.isArray(r.model_annotations)?r.model_annotations:[],...Array.isArray(r.source_annotations)?r.source_annotations:[],...Array.isArray(r.annotations)?r.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(t.length===0)return;let l;try{({parseAnnotation:l}=await h.loadMalloyTag())}catch{return}try{const{tag:o}=l(t);return he(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:t});return}}function we(e,r,t){const l=h.buildTableCssVars(r,t);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const ke=`
2
+ /* Card geometry, through the renderer's OWN theme vars rather than over the top
3
+ of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
4
+ passes each through to the --malloy-render--* the card CSS reads, so a value
5
+ inherited from our wrapper loses to that declaration however early it is set:
6
+ this has to be a rule on the same element, at higher specificity. Doubling the
7
+ class does that, and then no !important is needed — which matters, because
8
+ !important here also lands on .dashboard-item-borderless and repaints a card
9
+ the author asked to have no card. */
10
+ .malloy-render.malloy-render {
11
+ --malloy-theme--dashboard-card-radius: var(--publisher-dashboard-card-radius);
12
+ --malloy-theme--dashboard-card-padding: var(--publisher-dashboard-card-padding);
13
+ }
14
+ /* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
15
+ and .dashboard-row-header, which would paint light grey in dark
16
+ mode and also bleed an operator-picked palette.background across
17
+ the panel chrome in light. Both surfaces use
18
+ --malloy-render--background here, which buildMalloyExplicitTheme
19
+ wires to dashboardRoot: a mode-keyed neutral that stays decoupled
20
+ from palette.background (the chart canvas) on purpose. Selectors
21
+ are duplicated at higher specificity to beat the renderer s own
22
+ scoped rules. */
23
+ .malloy-render .malloy-dashboard,
24
+ .malloy-render.malloy-render .malloy-dashboard,
25
+ div.malloy-render .malloy-dashboard {
26
+ /* --publisher-dashboard-root is set on the outer Publisher wrapper
27
+ (see buildTableCssVars) and stays decoupled from
28
+ --malloy-render--background, which gets shadowed inside the
29
+ renderer when a theme.background annotation is present. The
30
+ dedicated var means the panel between tiles always paints the
31
+ operator neutral dashboardRoot regardless of annotations. */
32
+ background: var(--publisher-dashboard-root) !important;
33
+ background-color: var(--publisher-dashboard-root) !important;
34
+ color: var(--malloy-render--table-body-color) !important;
35
+ }
36
+ .malloy-render .malloy-dashboard .dashboard-row,
37
+ .malloy-render .malloy-dashboard .dashboard-row-body,
38
+ .malloy-render .malloy-dashboard .dashboard-row-header,
39
+ .malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
40
+ div.malloy-render .malloy-dashboard .dashboard-row-header {
41
+ /* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
42
+ to #f7f9fc, and row / row-body have no explicit background but
43
+ get caught in any annotation-driven inline writes. Force all of
44
+ them to the neutral panel colour. */
45
+ background: var(--publisher-dashboard-root) !important;
46
+ background-color: var(--publisher-dashboard-root) !important;
47
+ }
48
+ .malloy-render .malloy-dashboard .dashboard-item:not(.dashboard-item-borderless) {
49
+ /* Tile padding around each chart / table. Uses our custom
50
+ --malloy-render--tile-background so the operator can theme the
51
+ tile separately from the table header row (which paints from
52
+ --malloy-render--table-pinned-background below).
53
+
54
+ A flat bordered card rather than the renderer's shadow ring, which is what
55
+ makes it match the composite tile's Paper. :not(borderless) because
56
+ # borderless asks for no card at all, and an !important background and
57
+ border drew one anyway. */
58
+ background: var(--malloy-render--tile-background) !important;
59
+ color: var(--malloy-render--table-body-color) !important;
60
+ box-shadow: none !important;
61
+ /* The card edge, not the table gridline: --publisher-dashboard-card-border,
62
+ the same value TileCard paints, so the renderer's card and the composite
63
+ one are outlined identically. */
64
+ border: var(--publisher-dashboard-card-border) !important;
65
+ }
66
+ /* The renderer's big-value card — the small card a "# big_value" measure sits
67
+ in, several to a row inside one tile. (No backticks in here: this is inside
68
+ a template literal.) Its own CSS gives it a 0.55px edge in
69
+ #e5e7eb: a sub-pixel width, and a grey off the slate ramp everything else on
70
+ the page is on. It is a dashboard card like any other, so it takes the card
71
+ edge and stops being the one card outlined in a hairline nobody can see. */
72
+ .malloy-render .malloy-big-value-card {
73
+ border: var(--publisher-dashboard-card-border) !important;
74
+ /* Its shadow is a four-layer Tailwind stack, and only two of those layers
75
+ are a shadow: the other is "0 0 0 1px #e5e7eb", a spread ring drawn as a
76
+ second border OVER the real one. So the border above was landing
77
+ underneath a ring in the renderer's own grey, and the card kept both a
78
+ lifted look the flat cards around it do not have and an edge we did not
79
+ pick. Dropped whole rather than rebuilt layer by layer: the ring's job is
80
+ the border's job, and the border is already doing it. */
81
+ box-shadow: none !important;
82
+ }
83
+ /* The strip of big-value cards as a grid, so cards share a width and the last one does not wrap
84
+ alone. The renderer's wrapping flex row sizes each card to its own text. The 250px floor is the
85
+ widest realistic value: it is nowrap at 32px in an overflow:visible card, so a narrower track
86
+ would spill it onto its neighbour. Embedded (a nested big_value) is left as the renderer draws it. */
87
+ .malloy-render .malloy-big-value:not(.malloy-big-value--embedded) {
88
+ display: grid;
89
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
90
+ }
91
+ .malloy-render .malloy-big-value-card:not(.malloy-big-value-card--embedded) {
92
+ width: auto;
93
+ max-width: none;
94
+ }
95
+ .malloy-render .malloy-dashboard .dashboard-row-header-separator {
96
+ background: var(--malloy-render--table-border) !important;
97
+ }
98
+ /* !important because the malloy-explorer stylesheet pins these same properties with it. */
99
+ [${I}] .malloy-table.root {
100
+ height: 100% !important;
101
+ align-content: start !important;
102
+ grid-template-columns: repeat(var(--total-header-size), minmax(max-content, 1fr)) !important;
103
+ }
104
+ .malloy-render .malloy-table .th.column-cell {
105
+ /* Non-pinned tables have no header background in the renderer's
106
+ own CSS (only pinned scrolled tables paint the pinned-header
107
+ with this var). Force the same value here so every table has a
108
+ visible header band reflecting the operator's choice. */
109
+ background: var(--malloy-render--table-pinned-background) !important;
110
+ }
111
+ .malloy-render .dashboard-item-title,
112
+ .malloy-render .dashboard-dimension-name {
113
+ color: var(--malloy-render--label-color) !important;
114
+ }
115
+ .malloy-render .dashboard-item-value,
116
+ .malloy-render .dashboard-item-value-measure,
117
+ .malloy-render .dashboard-dimension-value {
118
+ color: var(--malloy-render--value-color) !important;
119
+ }
120
+ .malloy-render .malloy-table,
121
+ .malloy-render .malloy-list {
122
+ color: var(--malloy-render--table-body-color) !important;
123
+ }
124
+ .malloy-render .column-cell.th,
125
+ .malloy-render .cell-content.header {
126
+ color: var(--malloy-render--table-header-color) !important;
127
+ }
128
+ /* A cell whose column declares a "# drill" this surface can honor, marked
129
+ by markDrillableCells. Ordinary text with a pointer cursor until hovered,
130
+ then it reads as a link: the same affordance Malloyyo gives the same tag,
131
+ and the only thing that tells a reader a cell navigates. Kept off the
132
+ resting state deliberately: a column painted blue competes with the data.
133
+ (No backticks in here: this is inside a template literal.) */
134
+ .malloy-render .${g} {
135
+ cursor: pointer;
136
+ }
137
+ .malloy-render .${g}:hover > .cell-content {
138
+ color: var(--publisher-drill-link) !important;
139
+ text-decoration: underline;
140
+ }
141
+ /* Keyboard focus reads the same as hover, plus a ring: a hover colour is not
142
+ something a keyboard user can produce, and a focus ring is not something a
143
+ mouse user sees. focus-visible rather than focus, so a click does not leave a
144
+ ring behind it. (No backticks in here: this is inside a template literal.) */
145
+ .malloy-render .${g}:focus-visible {
146
+ outline: 2px solid var(--publisher-drill-link);
147
+ outline-offset: -2px;
148
+ }
149
+ .malloy-render .${g}:focus-visible > .cell-content {
150
+ color: var(--publisher-drill-link) !important;
151
+ text-decoration: underline;
152
+ }
153
+ `,ie="publisher-malloy-renderer-overrides";function xe(){if(typeof document>"u"||document.getElementById(ie))return;const e=document.createElement("style");e.id=ie,e.textContent=ke,document.head.appendChild(e)}function Ce({result:e,height:r,drill:t,onSizeChange:l,onSizing:o,fill:a}){const n=p.useRef(null),s=p.useRef(t);s.current=t;const f=p.useCallback(c=>{s.current?.onClick(c)},[]),v=t!==void 0,C=p.useRef(!1),k=p.useRef(null),V=p.useRef(0),{theme:j,layers:J,mode:W}=Y.usePublisherTheme(),Q=p.useMemo(()=>({radius:j.ui.radius.tile,padding:`${h.DASHBOARD_CARD_PADDING_PX}px`}),[j.ui.radius.tile]);return p.useEffect(()=>()=>{V.current+=1;const c=k.current;c?.viz.remove(),c?.node.remove(),k.current=null},[]),p.useLayoutEffect(()=>{if(!n.current||!e)return;xe();const c=n.current,be=V.current+=1;let H=!1;const K=()=>!H&&be===V.current;let d,m,N=null,G=0,$=null,q=null,P=null,O=null,_=null,L=null,Z=null,ee=0,E=null;C.current=!1;let w,S;const U=x=>{if(H||!x.firstElementChild||h.resultSizing(w,S)==="container")return;const z=h.remeasuresAfterReady(w,S);if(C.current&&!z)return;const F=c.hasAttribute(I);F&&c.removeAttribute(I);const A=h.measureContentHeight(x,h.contentNodeDepth(w));F&&c.setAttribute(I,""),A>0&&(C.current=!0,l&&A!==ee&&(ee=A,l(A)));const u=h.contentNode(x,h.contentNodeDepth(w));z&&u&&Z!==u&&(Z=u,L?.disconnect(),L=new ResizeObserver(()=>U(x)),L.observe(u))};return(async()=>{let x;try{x=JSON.parse(e)}catch(y){console.error("Error parsing visualization result:",y);return}const z=await ve(x),F=z?Y.resolveTheme([...J,z],W):j;if(!K())return;try{m=await ge(F,f)}catch(y){console.error("Failed to create renderer:",y);return}if(!K()){m.remove(),m=void 0;return}const A=k.current;d=document.createElement("div"),d.style.width="100%",d.style.height="100%",we(d,F,Q),c.childElementCount>0&&(c.style.position="relative",d.style.position="absolute",d.style.inset="0",d.style.visibility="hidden"),c.appendChild(d);const u=d;O=new MutationObserver(()=>{_&&clearTimeout(_),_=setTimeout(()=>{U(u),C.current&&O?.disconnect()},100)}),O.observe(d,{childList:!0,subtree:!0,attributes:!0});const fe=m;let re=!1;const te=()=>{if(!(re||!K())){re=!0,E&&(clearTimeout(E),E=null),A?.viz.remove();for(const y of Array.from(c.children))y!==u&&c.removeChild(y);u.style.position="",u.style.inset="",u.style.visibility="",c.style.position="",k.current={viz:fe,node:u},U(u)}};try{m.setResult(x);try{const R=m.getMetadata(),T=R?.getRootField();w=T?.renderAs(),S=T?R?.getPluginsForField(T.key)?.[0]?.sizingStrategy:void 0}catch{w=void 0,S=void 0}o?.(h.resultSizing(w,S)),d.dataset.malloyRenderAs=w??"unknown",d.dataset.malloySizing=h.resultSizing(w,S),m.render(d);const y=s.current;try{if(y){const R=se(m,y.canDrill),T=()=>{try{de(u,R)}catch(i){console.warn("Drill affordance skipped:",i)}};T();const oe=i=>{const D=i.querySelector(".cell-content")??i,X=D.getBoundingClientRect();D.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:D.ownerDocument.defaultView,clientX:Math.round(X.left+X.width/2),clientY:Math.round(X.bottom)}))},ae=i=>i.target?.closest?.(`.${g}`)??null,ye=(i,b)=>{le(i,b)?.focus()};$=i=>{const b=ae(i);if(!b)return;const D=i.key==="ArrowDown"?1:i.key==="ArrowUp"?-1:i.key==="Home"?"first":i.key==="End"?"last":void 0;if(D!==void 0){i.preventDefault(),ye(b,D);return}i.key==="Enter"?(i.preventDefault(),oe(b)):i.key===" "&&i.preventDefault()},q=i=>{if(i.key!==" ")return;const b=ae(i);b&&(i.preventDefault(),oe(b))},P=i=>{const b=i.target?.closest?.(`.${g}`);b&&le(b,0)},u.addEventListener("keydown",$),u.addEventListener("keyup",q),u.addEventListener("focusin",P),R.size>0&&typeof MutationObserver<"u"&&(N=new MutationObserver(()=>{cancelAnimationFrame(G),G=requestAnimationFrame(T)}),N.observe(u,{childList:!0,subtree:!0}))}}catch(R){console.warn("Drill affordance skipped:",R)}m.onReady(te),E=setTimeout(te,1e4)}catch(y){console.error("Error rendering visualization:",y),O?.disconnect(),L?.disconnect(),N?.disconnect(),m.remove(),m=void 0,u.parentNode===c&&c.removeChild(u)}})(),()=>{H=!0,O?.disconnect(),L?.disconnect(),_&&clearTimeout(_),E&&clearTimeout(E),d&&k.current?.node!==d&&($&&d.removeEventListener("keydown",$),q&&d.removeEventListener("keyup",q),P&&d.removeEventListener("focusin",P),N?.disconnect(),cancelAnimationFrame(G),m?.remove(),d.parentNode===c&&c.removeChild(d),c.style.position="")}},[e,f,v,l,o,j,J,W,Q]),M.jsx("div",{ref:n,...a?{[I]:""}:{},style:{width:"100%",height:r?`${r}px`:"400px"}})}function me(e){return typeof window>"u"?M.jsx(ne.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):M.jsx(p.Suspense,{fallback:M.jsx(ne.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:M.jsx(Ce,{...e})})}const Re=Object.freeze(Object.defineProperty({__proto__:null,default:me},Symbol.toStringTag,{value:"Module"}));exports.DRILL_CELL_CLASS=g;exports.RenderedResult=me;exports.RenderedResult$1=Re;exports.buildMalloyExplicitTheme=ce;exports.buildVegaThemeOverride=ue;exports.drillableFieldNames=se;exports.markDrillableCells=de;exports.readChartAnnotations=he;