derive-dashboards 0.1.0 → 0.2.0

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 (410) hide show
  1. package/README.md +8 -5
  2. package/dist/adapter/sql-adapter.mjs +4 -4
  3. package/dist/body.mjs +11 -1
  4. package/dist/cache.d.mts +1 -1
  5. package/dist/cli/add.mjs +130 -0
  6. package/dist/cli/check.mjs +14 -1
  7. package/dist/cli/cli.mjs +14 -12
  8. package/dist/cli/config.mjs +12 -1
  9. package/dist/cli/doctor.mjs +147 -0
  10. package/dist/cli/import/dbt-schema.mjs +2 -2
  11. package/dist/cli/import/index.mjs +2 -2
  12. package/dist/cli/init.mjs +3 -2
  13. package/dist/cli/json.mjs +21 -0
  14. package/dist/cli/layers.mjs +33 -0
  15. package/dist/core/conformance/cases.d.mts +3 -0
  16. package/dist/core/conformance/cases.mjs +20 -4
  17. package/dist/core/conformance/check.mjs +6 -3
  18. package/dist/core/conformance/drill-cases.mjs +120 -0
  19. package/dist/core/document/layout.mjs +1 -1
  20. package/dist/core/document/view-layout.d.mts +14 -0
  21. package/dist/core/document/view-layout.mjs +157 -0
  22. package/dist/core/document/view.d.mts +26 -7
  23. package/dist/core/document/view.mjs +42 -11
  24. package/dist/core/engine/filter.mjs +2 -2
  25. package/dist/core/engine/index.d.mts +14 -2
  26. package/dist/core/engine/index.mjs +12 -1
  27. package/dist/core/engine/leaf.mjs +9 -4
  28. package/dist/core/engine/members.mjs +2 -2
  29. package/dist/core/engine/postgres.mjs +1 -1
  30. package/dist/core/engine/record-layout.d.mts +11 -0
  31. package/dist/core/engine/record-layout.mjs +7 -7
  32. package/dist/core/engine/records.d.mts +3 -2
  33. package/dist/core/engine/records.mjs +2 -1
  34. package/dist/core/engine/segmented.mjs +5 -2
  35. package/dist/core/engine/sql-records.mjs +2 -1
  36. package/dist/core/engine/statement.mjs +37 -3
  37. package/dist/core/engine/types.d.mts +3 -0
  38. package/dist/core/engine/version.d.mts +1 -1
  39. package/dist/core/engine/version.mjs +1 -1
  40. package/dist/core/error/codes.d.mts +33 -1
  41. package/dist/core/error/codes.mjs +30 -2
  42. package/dist/core/index.d.mts +13 -7
  43. package/dist/core/index.mjs +9 -5
  44. package/dist/core/model/catalog/check.mjs +1 -1
  45. package/dist/core/model/hints.d.mts +36 -0
  46. package/dist/core/model/member.d.mts +4 -2
  47. package/dist/core/model/member.mjs +19 -3
  48. package/dist/core/model/types.d.mts +21 -19
  49. package/dist/core/model/validate/drill.mjs +70 -0
  50. package/dist/core/model/validate/index.mjs +3 -0
  51. package/dist/core/model/validate/members.mjs +7 -4
  52. package/dist/core/model/validate/shape.mjs +150 -0
  53. package/dist/core/model/validate/source.mjs +5 -3
  54. package/dist/core/policy/bind-query.d.mts +12 -0
  55. package/dist/core/policy/bind-query.mjs +53 -0
  56. package/dist/core/query/alias.mjs +7 -1
  57. package/dist/core/query/drill/compose.d.mts +22 -0
  58. package/dist/core/query/drill/compose.mjs +85 -0
  59. package/dist/core/query/drill/fields.d.mts +21 -0
  60. package/dist/core/query/drill/fields.mjs +91 -0
  61. package/dist/core/query/drill/internal.d.mts +11 -0
  62. package/dist/core/query/drill/items.d.mts +29 -0
  63. package/dist/core/query/drill/items.mjs +98 -0
  64. package/dist/core/query/drill/line.d.mts +31 -0
  65. package/dist/core/query/drill/line.mjs +183 -0
  66. package/dist/core/query/drill/links.d.mts +33 -0
  67. package/dist/core/query/drill/links.mjs +31 -0
  68. package/dist/core/query/drill/operand.mjs +7 -0
  69. package/dist/core/query/drill/scopes.d.mts +22 -0
  70. package/dist/core/query/drill/scopes.mjs +58 -0
  71. package/dist/core/query/drill/selection.d.mts +37 -0
  72. package/dist/core/query/drill/selection.mjs +144 -0
  73. package/dist/core/query/drill/steps.d.mts +14 -0
  74. package/dist/core/query/drill/steps.mjs +35 -0
  75. package/dist/core/query/drill/synthetic-expr.mjs +85 -0
  76. package/dist/core/query/drill/synthetic.d.mts +22 -0
  77. package/dist/core/query/drill/synthetic.mjs +165 -0
  78. package/dist/core/query/drill/time.d.mts +11 -0
  79. package/dist/core/query/drill/time.mjs +71 -0
  80. package/dist/core/query/drill/types.d.mts +155 -0
  81. package/dist/core/query/drill/types.mjs +4 -0
  82. package/dist/core/query/drill/views.d.mts +62 -0
  83. package/dist/core/query/drill/views.mjs +257 -0
  84. package/dist/core/query/filter.d.mts +6 -0
  85. package/dist/core/query/picks.d.mts +8 -2
  86. package/dist/core/query/picks.mjs +11 -4
  87. package/dist/core/query/segments.d.mts +12 -2
  88. package/dist/core/query/segments.mjs +5 -2
  89. package/dist/core/result/columns.mjs +20 -4
  90. package/dist/core/result/types.d.mts +5 -1
  91. package/dist/core/schema/aliases.d.mts +7 -0
  92. package/dist/core/schema/aliases.mjs +77 -0
  93. package/dist/core/schema/answer-parts.mjs +117 -0
  94. package/dist/core/schema/answers.d.mts +2109 -128
  95. package/dist/core/schema/answers.mjs +11 -113
  96. package/dist/core/schema/commands.d.mts +2 -2
  97. package/dist/core/schema/document.d.mts +1 -1
  98. package/dist/core/schema/drill-answers.mjs +179 -0
  99. package/dist/core/schema/drill.d.mts +260 -0
  100. package/dist/core/schema/drill.mjs +107 -0
  101. package/dist/core/schema/index.d.mts +6 -3
  102. package/dist/core/schema/index.mjs +6 -3
  103. package/dist/core/schema/picks.d.mts +35 -0
  104. package/dist/core/schema/picks.mjs +23 -0
  105. package/dist/core/schema/query.d.mts +82 -1
  106. package/dist/core/schema/query.mjs +9 -5
  107. package/dist/core/schema/tools.mjs +1 -1
  108. package/dist/core/schema/view.d.mts +0 -35
  109. package/dist/core/schema/view.mjs +19 -24
  110. package/dist/core/store/schema.d.mts +5 -0
  111. package/dist/core/store/schema.mjs +10 -0
  112. package/dist/core/types/api.d.mts +21 -1
  113. package/dist/core/types/api.mjs +1 -1
  114. package/dist/core/types/drill-api.d.mts +210 -0
  115. package/dist/core/types/options.d.mts +21 -0
  116. package/dist/core/types/viewer.d.mts +5 -0
  117. package/dist/cursor-seal.d.mts +8 -0
  118. package/dist/cursor-seal.mjs +98 -0
  119. package/dist/dashboard-id.mjs +1 -1
  120. package/dist/dashboards.mjs +4 -0
  121. package/dist/drill-access.mjs +93 -0
  122. package/dist/drill-change.mjs +76 -0
  123. package/dist/drill-crumbs.mjs +113 -0
  124. package/dist/drill-distinct.mjs +130 -0
  125. package/dist/drill-explain.mjs +64 -0
  126. package/dist/drill-identity.mjs +35 -0
  127. package/dist/drill-item-id.mjs +35 -0
  128. package/dist/drill-items.mjs +132 -0
  129. package/dist/drill-open.mjs +169 -0
  130. package/dist/drill-seal.mjs +170 -0
  131. package/dist/drill-secret.mjs +14 -0
  132. package/dist/drill-share.mjs +53 -0
  133. package/dist/drill-summary.mjs +158 -0
  134. package/dist/drill-targets.mjs +53 -0
  135. package/dist/drill-totals.mjs +8 -0
  136. package/dist/drill-views.mjs +175 -0
  137. package/dist/drill.mjs +157 -0
  138. package/dist/editing.mjs +3 -3
  139. package/dist/endpoints/dashboards.mjs +28 -5
  140. package/dist/endpoints/drill.mjs +55 -0
  141. package/dist/endpoints/index.d.mts +245 -4
  142. package/dist/endpoints/index.mjs +5 -1
  143. package/dist/endpoints/meta.mjs +10 -1
  144. package/dist/endpoints/query.mjs +26 -4
  145. package/dist/execute.d.mts +19 -1
  146. package/dist/execute.mjs +34 -27
  147. package/dist/handler.mjs +5 -1
  148. package/dist/index.d.mts +3 -1
  149. package/dist/index.mjs +29 -2
  150. package/dist/llms.txt +22 -0
  151. package/dist/mcp/drill.mjs +61 -0
  152. package/dist/mcp/format.mjs +69 -11
  153. package/dist/mcp/index.d.mts +15 -4
  154. package/dist/mcp/index.mjs +13 -7
  155. package/dist/mcp/query.d.mts +7 -2
  156. package/dist/mcp/query.mjs +40 -6
  157. package/dist/node-postgres.d.mts +8 -4
  158. package/dist/node-postgres.mjs +29 -6
  159. package/dist/owner.mjs +3 -3
  160. package/dist/postgres-connection.d.mts +8 -2
  161. package/dist/postgres-connection.mjs +2 -1
  162. package/dist/postgres-store.mjs +1 -0
  163. package/dist/react/Canvas.mjs +28 -5
  164. package/dist/react/Cell.mjs +2 -1
  165. package/dist/react/Dashboard.d.mts +10 -5
  166. package/dist/react/Dashboard.mjs +62 -22
  167. package/dist/react/DashboardList.mjs +52 -24
  168. package/dist/react/DashboardListRow.mjs +49 -0
  169. package/dist/react/Discard.mjs +12 -4
  170. package/dist/react/Editing.mjs +19 -5
  171. package/dist/react/FilterBar.d.mts +7 -9
  172. package/dist/react/Grid.mjs +19 -24
  173. package/dist/react/Header.mjs +10 -1
  174. package/dist/react/History.mjs +5 -0
  175. package/dist/react/Parts.mjs +6 -2
  176. package/dist/react/ReadFailed.mjs +23 -0
  177. package/dist/react/ReviewPanel.mjs +13 -2
  178. package/dist/react/RowBody.d.mts +19 -0
  179. package/dist/react/RowBody.mjs +55 -0
  180. package/dist/react/Spaces.mjs +15 -1
  181. package/dist/react/Tile.d.mts +3 -1
  182. package/dist/react/Tile.mjs +84 -32
  183. package/dist/react/_virtual/_rolldown/runtime.mjs +12 -0
  184. package/dist/react/arrange-steps.mjs +16 -13
  185. package/dist/react/arrange.mjs +10 -3
  186. package/dist/react/builder/Calcs.mjs +35 -11
  187. package/dist/react/builder/FilterEditor.mjs +196 -0
  188. package/dist/react/builder/Filters.mjs +172 -116
  189. package/dist/react/builder/Formula.mjs +82 -0
  190. package/dist/react/builder/Groups.mjs +1 -0
  191. package/dist/react/builder/Preview.mjs +1 -1
  192. package/dist/react/builder/RangeEditor.mjs +184 -0
  193. package/dist/react/builder/Sections.mjs +41 -6
  194. package/dist/react/builder/Time.mjs +138 -60
  195. package/dist/react/builder/Values.mjs +85 -0
  196. package/dist/react/builder/WidgetBuilder.mjs +50 -49
  197. package/dist/react/builder/base.d.mts +5 -0
  198. package/dist/react/builder/base.mjs +33 -8
  199. package/dist/react/builder/calc.mjs +15 -1
  200. package/dist/react/builder/escape.d.mts +1 -0
  201. package/dist/react/builder/escape.mjs +62 -0
  202. package/dist/react/builder/filter-tree.d.mts +9 -0
  203. package/dist/react/builder/filter-tree.mjs +186 -0
  204. package/dist/react/builder/formula-parse.d.mts +18 -0
  205. package/dist/react/builder/formula-parse.mjs +136 -0
  206. package/dist/react/builder/labels.d.mts +1 -1
  207. package/dist/react/builder/state.d.mts +2 -1
  208. package/dist/react/builder/state.mjs +23 -37
  209. package/dist/react/builder/useBuilder.d.mts +12 -1
  210. package/dist/react/builder/useBuilder.mjs +6 -3
  211. package/dist/react/builder/words.d.mts +59 -0
  212. package/dist/react/builder/words.mjs +73 -0
  213. package/dist/react/client.d.mts +2 -0
  214. package/dist/react/client.mjs +1 -0
  215. package/dist/react/context.d.mts +28 -1
  216. package/dist/react/context.mjs +25 -4
  217. package/dist/react/drill/Bars.mjs +179 -0
  218. package/dist/react/drill/Controls.mjs +173 -0
  219. package/dist/react/drill/DashboardTile.d.mts +18 -0
  220. package/dist/react/drill/DashboardTile.mjs +107 -0
  221. package/dist/react/drill/DrillPanel.d.mts +31 -0
  222. package/dist/react/drill/DrillPanel.mjs +104 -0
  223. package/dist/react/drill/DrillTabs.mjs +52 -0
  224. package/dist/react/drill/Header.mjs +131 -0
  225. package/dist/react/drill/Items.d.mts +22 -0
  226. package/dist/react/drill/Items.mjs +164 -0
  227. package/dist/react/drill/ItemsFoot.mjs +60 -0
  228. package/dist/react/drill/Notes.mjs +58 -0
  229. package/dist/react/drill/PanelBody.mjs +74 -0
  230. package/dist/react/drill/PanelStates.mjs +37 -0
  231. package/dist/react/drill/board.d.mts +18 -0
  232. package/dist/react/drill/board.mjs +91 -0
  233. package/dist/react/drill/counts.mjs +14 -0
  234. package/dist/react/drill/host.mjs +26 -0
  235. package/dist/react/drill/item-parts.d.mts +5 -0
  236. package/dist/react/drill/item-parts.mjs +76 -0
  237. package/dist/react/drill/item-type.d.mts +26 -0
  238. package/dist/react/drill/item-type.mjs +7 -0
  239. package/dist/react/drill/lazy.d.mts +6 -0
  240. package/dist/react/drill/lazy.mjs +17 -0
  241. package/dist/react/drill/pages.mjs +48 -0
  242. package/dist/react/drill/panel-focus.mjs +51 -0
  243. package/dist/react/drill/props.d.mts +25 -0
  244. package/dist/react/drill/props.mjs +72 -0
  245. package/dist/react/drill/state.d.mts +18 -0
  246. package/dist/react/drill/state.mjs +68 -0
  247. package/dist/react/drill/useDrill.d.mts +46 -0
  248. package/dist/react/drill/useDrill.mjs +194 -0
  249. package/dist/react/drill/words.d.mts +101 -0
  250. package/dist/react/drill/words.mjs +79 -0
  251. package/dist/react/english.mjs +29 -6
  252. package/dist/react/filters/bar.d.mts +12 -0
  253. package/dist/react/filters/bar.mjs +135 -0
  254. package/dist/react/filters/calendar.mjs +193 -0
  255. package/dist/react/filters/chip.mjs +174 -0
  256. package/dist/react/filters/context.d.mts +22 -0
  257. package/dist/react/filters/context.mjs +78 -0
  258. package/dist/react/filters/dates.mjs +89 -0
  259. package/dist/react/filters/days.d.mts +36 -0
  260. package/dist/react/filters/days.mjs +87 -0
  261. package/dist/react/filters/field-step.mjs +81 -0
  262. package/dist/react/filters/hooks.d.mts +34 -0
  263. package/dist/react/filters/hooks.mjs +94 -0
  264. package/dist/react/filters/listbox.mjs +131 -0
  265. package/dist/react/filters/logic.d.mts +59 -0
  266. package/dist/react/filters/logic.mjs +109 -0
  267. package/dist/react/filters/menu-search.mjs +211 -0
  268. package/dist/react/filters/menu.mjs +85 -0
  269. package/dist/react/filters/number.mjs +127 -0
  270. package/dist/react/filters/numbers.d.mts +47 -0
  271. package/dist/react/filters/numbers.mjs +151 -0
  272. package/dist/react/filters/operator.mjs +104 -0
  273. package/dist/react/filters/phone.mjs +104 -0
  274. package/dist/react/filters/popover.d.mts +19 -0
  275. package/dist/react/filters/popover.mjs +153 -0
  276. package/dist/react/filters/rules.d.mts +8 -0
  277. package/dist/react/filters/rules.mjs +55 -0
  278. package/dist/react/filters/sheet.mjs +196 -0
  279. package/dist/react/filters/state.mjs +132 -0
  280. package/dist/react/filters/suggest.d.mts +47 -0
  281. package/dist/react/filters/suggest.mjs +97 -0
  282. package/dist/react/filters/values.mjs +166 -0
  283. package/dist/react/filters/words.d.mts +81 -0
  284. package/dist/react/filters/words.mjs +73 -0
  285. package/dist/react/format.d.mts +3 -3
  286. package/dist/react/format.mjs +45 -16
  287. package/dist/react/index.d.mts +34 -5
  288. package/dist/react/index.mjs +15 -4
  289. package/dist/react/messages.d.mts +47 -2
  290. package/dist/react/place.mjs +7 -3
  291. package/dist/react/renderers/index.d.mts +10 -2
  292. package/dist/react/renderers/index.mjs +116 -14
  293. package/dist/react/renderers/list.d.mts +22 -0
  294. package/dist/react/renderers/list.mjs +118 -0
  295. package/dist/react/review-words.mjs +1 -1
  296. package/dist/react/review.mjs +2 -2
  297. package/dist/react/scope.mjs +2 -7
  298. package/dist/react/series.d.mts +54 -0
  299. package/dist/react/series.mjs +191 -0
  300. package/dist/react/theme.css +2734 -1296
  301. package/dist/react/theme.css.d.ts +1 -0
  302. package/dist/react/tile-store.mjs +15 -3
  303. package/dist/react/useBoard.d.mts +7 -0
  304. package/dist/react/useBoard.mjs +4 -1
  305. package/dist/react/useDashboard.d.mts +4 -0
  306. package/dist/react/useDashboard.mjs +8 -1
  307. package/dist/react/useTiles.mjs +50 -15
  308. package/dist/react/view-grid.mjs +16 -0
  309. package/dist/react/view.d.mts +9 -0
  310. package/dist/react/view.mjs +22 -10
  311. package/dist/reading.d.mts +2 -0
  312. package/dist/reading.mjs +9 -1
  313. package/dist/recharts/axes.mjs +28 -0
  314. package/dist/recharts/axis.mjs +84 -0
  315. package/dist/recharts/bar.d.mts +7 -0
  316. package/dist/recharts/bar.mjs +140 -0
  317. package/dist/recharts/charts.d.mts +4 -6
  318. package/dist/recharts/charts.mjs +2 -114
  319. package/dist/recharts/index.d.mts +5 -3
  320. package/dist/recharts/index.mjs +6 -3
  321. package/dist/recharts/line.d.mts +2 -0
  322. package/dist/recharts/line.mjs +111 -0
  323. package/dist/recharts/marks.mjs +112 -0
  324. package/dist/recharts/parts.mjs +88 -0
  325. package/dist/recharts/series.d.mts +2 -22
  326. package/dist/recharts/series.mjs +1 -64
  327. package/dist/recharts/table.mjs +71 -0
  328. package/dist/records-read.mjs +44 -0
  329. package/dist/registry/filter-bar.json +26 -0
  330. package/dist/skills/derive-dashboards/SKILL.md +69 -0
  331. package/dist/store/apply.mjs +5 -5
  332. package/dist/store/commands.mjs +4 -4
  333. package/dist/store/discard.mjs +7 -7
  334. package/dist/store/drafts.mjs +5 -5
  335. package/dist/store/editor.mjs +1 -1
  336. package/dist/store/publish.mjs +12 -12
  337. package/dist/store/reader.mjs +41 -22
  338. package/dist/store/review.mjs +16 -16
  339. package/dist/store/rows.mjs +20 -20
  340. package/dist/store/undo.mjs +3 -3
  341. package/dist/store/unpublished.mjs +4 -4
  342. package/dist/store/versions.mjs +14 -14
  343. package/dist/testing/adapter-suite.mjs +4 -4
  344. package/dist/tiles.mjs +37 -3
  345. package/package.json +12 -10
  346. package/dist/react/FilterBar.mjs +0 -119
  347. package/dist/react/Records.d.mts +0 -12
  348. package/dist/react/Records.mjs +0 -97
  349. package/src/adapter/sql-adapter.ts +0 -95
  350. package/src/adapter/statement.ts +0 -185
  351. package/src/authorize.ts +0 -73
  352. package/src/body.ts +0 -169
  353. package/src/bounded.ts +0 -43
  354. package/src/cache.ts +0 -192
  355. package/src/checks.ts +0 -170
  356. package/src/custom-source.ts +0 -59
  357. package/src/dashboard-id.ts +0 -36
  358. package/src/dashboards.ts +0 -132
  359. package/src/editing.ts +0 -148
  360. package/src/endpoints/access.ts +0 -41
  361. package/src/endpoints/dashboards.ts +0 -92
  362. package/src/endpoints/drafts.ts +0 -138
  363. package/src/endpoints/index.ts +0 -21
  364. package/src/endpoints/meta.ts +0 -137
  365. package/src/endpoints/query.ts +0 -86
  366. package/src/endpoints/read.ts +0 -92
  367. package/src/endpoints/review.ts +0 -89
  368. package/src/endpoints/values.ts +0 -62
  369. package/src/endpoints/versions.ts +0 -104
  370. package/src/execute.ts +0 -207
  371. package/src/handler.ts +0 -232
  372. package/src/http.ts +0 -66
  373. package/src/index.ts +0 -163
  374. package/src/introspect.ts +0 -205
  375. package/src/mcp/api.ts +0 -59
  376. package/src/mcp/format.ts +0 -67
  377. package/src/mcp/index.ts +0 -151
  378. package/src/mcp/query.ts +0 -153
  379. package/src/mcp/resolve.ts +0 -114
  380. package/src/node-postgres.ts +0 -81
  381. package/src/owner.ts +0 -36
  382. package/src/postgres-connection.ts +0 -143
  383. package/src/postgres-store.ts +0 -82
  384. package/src/principal.ts +0 -39
  385. package/src/reading.ts +0 -56
  386. package/src/request-rows.ts +0 -23
  387. package/src/request.ts +0 -22
  388. package/src/storage.ts +0 -63
  389. package/src/store/apply.ts +0 -129
  390. package/src/store/commands.ts +0 -75
  391. package/src/store/conflicts.ts +0 -98
  392. package/src/store/create-tables.ts +0 -104
  393. package/src/store/discard.ts +0 -42
  394. package/src/store/drafts.ts +0 -133
  395. package/src/store/editor.ts +0 -28
  396. package/src/store/log.ts +0 -28
  397. package/src/store/publish.ts +0 -199
  398. package/src/store/publisher.ts +0 -21
  399. package/src/store/reader.ts +0 -139
  400. package/src/store/review.ts +0 -239
  401. package/src/store/rows.ts +0 -250
  402. package/src/store/tenant.ts +0 -28
  403. package/src/store/undo.ts +0 -56
  404. package/src/store/unpublished.ts +0 -33
  405. package/src/store/versions.ts +0 -106
  406. package/src/store/writer.ts +0 -19
  407. package/src/testing/adapter-suite.ts +0 -239
  408. package/src/testing/index.ts +0 -2
  409. package/src/tile-doc.ts +0 -46
  410. package/src/tiles.ts +0 -120
@@ -0,0 +1,17 @@
1
+ import { Suspense, lazy } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ // src/drill/lazy.tsx
4
+ /** The panel's code, loaded the first time a drill opens: a page that never drills never loads it. */
5
+ const Loaded = lazy(async () => ({ default: (await import("./DrillPanel.mjs")).DrillPanel }));
6
+ /**
7
+ * The drill panel (`DrillPanel` in `./DrillPanel`), loaded on first use: every export of the
8
+ * React entry reaches the panel through here, so no bundler pulls it in with the dashboard.
9
+ */
10
+ function DrillPanel(props) {
11
+ if ((props.controller?.state ?? props.state) === void 0) return null;
12
+ return /* @__PURE__ */ jsx(Suspense, {
13
+ fallback: null,
14
+ children: /* @__PURE__ */ jsx(Loaded, { ...props })
15
+ });
16
+ }
17
+ export { DrillPanel };
@@ -0,0 +1,48 @@
1
+ import { useRef, useState } from "react";
2
+ // src/drill/pages.ts
3
+ /** The pages of Items read past the first, for one drill and one viewer. */
4
+ function useMorePages(key, state, first, ask) {
5
+ const [pages, setPages] = useState({
6
+ key: "",
7
+ views: []
8
+ });
9
+ const [loadingFor, setLoadingFor] = useState();
10
+ const chain = `${key}|${first?.next ?? ""}`;
11
+ const current = useRef(chain);
12
+ current.current = chain;
13
+ const mine = pages.key === chain ? pages : {
14
+ key: chain,
15
+ views: []
16
+ };
17
+ const last = mine.views.at(-1) ?? first;
18
+ const loading = loadingFor === chain;
19
+ const more = async () => {
20
+ if (state === void 0 || last?.next === void 0 || loading) return;
21
+ const at = chain;
22
+ const own = (p) => p.key === at ? p.views : [];
23
+ setLoadingFor(at);
24
+ try {
25
+ const view = (await ask(state, { after: last.next })).view;
26
+ if (view.by === "items" && current.current === at) setPages((p) => ({
27
+ key: at,
28
+ views: [...own(p), view]
29
+ }));
30
+ } catch (error) {
31
+ if (current.current === at) setPages((p) => ({
32
+ key: at,
33
+ views: own(p),
34
+ failed: error instanceof Error ? error : new Error(String(error))
35
+ }));
36
+ } finally {
37
+ setLoadingFor((l) => l === at ? void 0 : l);
38
+ }
39
+ };
40
+ return {
41
+ items: [first, ...mine.views].flatMap((v) => v?.items ?? []),
42
+ more,
43
+ hasMore: last?.next !== void 0,
44
+ loadingMore: loading,
45
+ ...mine.failed === void 0 ? {} : { moreError: mine.failed }
46
+ };
47
+ }
48
+ export { useMorePages };
@@ -0,0 +1,51 @@
1
+ import { useEffect, useRef, useState } from "react";
2
+ // src/drill/panel-focus.ts
3
+ /** A phone-sized screen, where the drill is a page of its own. */
4
+ const PHONE = "(max-width: 640px)";
5
+ const onPhone = () => typeof globalThis.matchMedia === "function" && globalThis.matchMedia(PHONE).matches;
6
+ /** The heading of a dashboard's tile, by its widget: where focus goes when what opened the drill is gone. */
7
+ const tileOf = (widgetId) => widgetId === void 0 ? null : document.querySelector(`[data-widget="${CSS.escape(widgetId)}"]`);
8
+ /** Whether focus has moved on purpose outside the panel, to something other than the page. */
9
+ function movedAway(inside) {
10
+ const active = document.activeElement;
11
+ return active !== null && active !== document.body && !(inside?.contains(active) ?? false);
12
+ }
13
+ /** What focus returns to: what opened the drill while it is still there, else its tile's title. */
14
+ function returnTarget(back, widgetId) {
15
+ return back instanceof HTMLElement && back.isConnected && back !== document.body ? back : tileOf(widgetId)?.querySelector(".dd-tile-title");
16
+ }
17
+ /**
18
+ * While the drill is open, its tile is lit; when it closes (Close, Escape, Back at the root),
19
+ * focus goes back to what opened it, or to its tile's heading when that is gone, and on a phone
20
+ * the page scrolls back to the tile instead of its top. A close that moved focus elsewhere on
21
+ * purpose keeps it there.
22
+ */
23
+ function useFocusReturn(panel, widgetId) {
24
+ const opener = useRef(null);
25
+ if (opener.current === null && typeof document !== "undefined") opener.current = document.activeElement;
26
+ useEffect(() => {
27
+ const tile = tileOf(widgetId);
28
+ if (tile) tile.dataset.drilling = "";
29
+ const inside = panel.current;
30
+ return () => {
31
+ if (tile) delete tile.dataset.drilling;
32
+ if (movedAway(inside)) return;
33
+ const target = returnTarget(opener.current, widgetId);
34
+ target?.focus({ preventScroll: true });
35
+ if (onPhone()) requestAnimationFrame(() => {
36
+ (tileOf(widgetId) ?? target)?.scrollIntoView({ block: "center" });
37
+ });
38
+ };
39
+ }, [panel, widgetId]);
40
+ }
41
+ /**
42
+ * On a phone, a tap first shows the value and a button to see the rows (Rules: no hover there),
43
+ * then the full page. Elsewhere the panel opens whole.
44
+ */
45
+ function usePeek() {
46
+ const [peek, setPeek] = useState(onPhone);
47
+ return [peek, () => {
48
+ setPeek(false);
49
+ }];
50
+ }
51
+ export { useFocusReturn, usePeek };
@@ -0,0 +1,25 @@
1
+ import "../messages.mjs";
2
+ import { KeyboardEvent, MouseEvent } from "react";
3
+ import { AnswerDrill, DrillOrigin, DrillState, DrillView, ResultCell, ResultColumn } from "derive-dashboards/core";
4
+ /** What a drillable mark spreads on its element: a button a click or Enter opens. */
5
+ export type DrillMarkProps = {
6
+ role: "button";
7
+ tabIndex: 0;
8
+ "aria-label": string;
9
+ "data-drill": "";
10
+ onClick: (event: MouseEvent) => void;
11
+ onKeyDown: (event: KeyboardEvent) => void;
12
+ };
13
+ /**
14
+ * What a renderer drills its answer with; absent where drilling is off. `props(row, entry)`
15
+ * gives the props a mark spreads, or undefined for a row that does not drill (a comparison, a
16
+ * row the server sealed no selection for). `open(row, entry)` opens it from a chart kit's own
17
+ * event. A row is its index in `answer.rows` or the row itself; `entry` is the line clicked
18
+ * (`m1`), needed when the answer has more than one.
19
+ */
20
+ export type TileDrill = {
21
+ props: (row: number | readonly ResultCell[], entry?: string) => DrillMarkProps | undefined;
22
+ open: (row: number | readonly ResultCell[] | undefined, entry?: string) => void;
23
+ /** The whole tile, as its Rows button opens it: on Items unless another view is named. */
24
+ openAll: (entry?: string, view?: DrillView) => void;
25
+ };
@@ -0,0 +1,72 @@
1
+ import { formatCell } from "../format.mjs";
2
+ import { drillFrom } from "./state.mjs";
3
+ // src/drill/props.ts
4
+ const isLine = (c) => c.id.startsWith("m") || c.id.startsWith("c");
5
+ /** A mark's name for a screen reader: its groups, then its value. */
6
+ function markLabel(answer, row, format, entry) {
7
+ const named = answer.columns.filter(isLine).length > 1 ? entry : void 0;
8
+ const text = answer.columns.map((c, i) => ({
9
+ c,
10
+ cell: row[i] ?? null
11
+ })).filter(({ c }) => named === void 0 || !isLine(c) || c.id === named).map(({ c, cell }) => {
12
+ if (cell === null && !isLine(c)) return format.messages.drillNone(c.label);
13
+ const value = formatCell(cell, c, format);
14
+ return named !== void 0 && isLine(c) ? `${c.label} ${value}` : value;
15
+ }).join(", ");
16
+ return format.messages.drillMark(text);
17
+ }
18
+ /** A row of the answer by its place, or a row of the comparison period, read in that period. */
19
+ function at(answer, row) {
20
+ if (typeof row === "number") return row;
21
+ const own = answer.rows.indexOf(row);
22
+ return own >= 0 ? own : { previous: answer.compare?.rows.indexOf(row) ?? -1 };
23
+ }
24
+ /**
25
+ * A renderer's drill for one answer: each row's sealed selection, opened as a drill state the
26
+ * host receives. Undefined when the answer carries nothing to drill with.
27
+ */
28
+ function tileDrill(a) {
29
+ const { answer } = a;
30
+ if (answer.drill === void 0) return void 0;
31
+ const single = answer.columns.filter(isLine).length <= 1;
32
+ const stateOf = (row, entry, view) => entry === void 0 && !single ? void 0 : drillFrom(a.origin, answer.drill, {
33
+ ...row === void 0 ? {} : { row: at(answer, row) },
34
+ ...entry === void 0 ? {} : { entry },
35
+ ...view === void 0 ? {} : { view }
36
+ });
37
+ const open = (row, entry, view) => {
38
+ const state = stateOf(row, entry, view);
39
+ if (state !== void 0) a.onDrill(state);
40
+ };
41
+ const firstLine = answer.columns.find(isLine)?.id;
42
+ return {
43
+ open: (row, entry) => {
44
+ open(row, entry);
45
+ },
46
+ openAll: (entry, view) => {
47
+ open(void 0, entry ?? (single ? void 0 : firstLine), view ?? ITEMS);
48
+ },
49
+ props: (row, entry) => {
50
+ const cells = typeof row === "number" ? answer.rows[row] : row;
51
+ if (cells === void 0 || stateOf(row, entry) === void 0) return;
52
+ return markProps(markLabel(answer, cells, a.format, entry), () => {
53
+ open(row, entry);
54
+ });
55
+ }
56
+ };
57
+ }
58
+ const ITEMS = { by: "items" };
59
+ /** A mark's props: a button by role, named, that opens on a click, Enter or Space. */
60
+ const markProps = (label, open) => ({
61
+ role: "button",
62
+ tabIndex: 0,
63
+ "aria-label": label,
64
+ "data-drill": "",
65
+ onClick: open,
66
+ onKeyDown: (event) => {
67
+ if (event.key !== "Enter" && event.key !== " ") return;
68
+ event.preventDefault();
69
+ open();
70
+ }
71
+ });
72
+ export { tileDrill };
@@ -0,0 +1,18 @@
1
+ import { AnswerDrill, DrillOrigin, DrillState, DrillView } from "derive-dashboards/core";
2
+ /** Whether a change to the drill is a step a Back button should undo (`push`) or not (`replace`). */
3
+ export type DrillHistory = "push" | "replace";
4
+ /** How a drill tells its host its next state: undefined when it closed. */
5
+ export type DrillChange = (next: DrillState | undefined, history: DrillHistory) => void;
6
+ /**
7
+ * A drill's state from a click on an answer: its origin, the line clicked, the execution the
8
+ * answer ran under, and the clicked row of the sealed answer (none for the whole tile; a row of
9
+ * the comparison period by `{ previous: i }`), which the server answers with a sealed path.
10
+ * Undefined when the answer does not drill, or the row does not.
11
+ */
12
+ export declare function drillFrom(origin: DrillOrigin, drill: AnswerDrill | undefined, at?: {
13
+ row?: number | {
14
+ previous: number;
15
+ };
16
+ entry?: string;
17
+ view?: DrillView;
18
+ }): DrillState | undefined;
@@ -0,0 +1,68 @@
1
+ // src/drill/state.ts
2
+ /** The view a fresh step opens on: the server picks it by its rules (Breakdown with no field). */
3
+ const FIRST = { by: "breakdown" };
4
+ /**
5
+ * A drill's state from a click on an answer: its origin, the line clicked, the execution the
6
+ * answer ran under, and the clicked row of the sealed answer (none for the whole tile; a row of
7
+ * the comparison period by `{ previous: i }`), which the server answers with a sealed path.
8
+ * Undefined when the answer does not drill, or the row does not.
9
+ */
10
+ function drillFrom(origin, drill, at = {}) {
11
+ const path = drill === void 0 || at.row === void 0 ? [] : pick(drill, at.row);
12
+ if (drill === void 0 || path === void 0) return void 0;
13
+ return {
14
+ origin,
15
+ ...at.entry === void 0 ? {} : { entry: at.entry },
16
+ execution: drill.execution,
17
+ path,
18
+ view: at.view ?? FIRST
19
+ };
20
+ }
21
+ /** A row of a sealed answer as a path entry, or undefined when the row does not open. */
22
+ function rowEntry(sealed, row, previous = false) {
23
+ return sealed === void 0 || row < 0 || sealed.closed?.some((c) => c.row === row) === true ? void 0 : `${sealed.answer}#${previous ? "p" : ""}${String(row)}`;
24
+ }
25
+ /** A row's place in the sealed answer as a path of one, or undefined when the row does not open. */
26
+ function pick(drill, row) {
27
+ const entry = typeof row === "number" ? rowEntry(drill, row) : rowEntry(drill.previous, row.previous, true);
28
+ return entry === void 0 ? void 0 : [entry];
29
+ }
30
+ /** One step deeper: a row of a Breakdown or Over time clicked; the view it left is kept for Back. */
31
+ const deeper = (state, selection) => ({
32
+ ...state,
33
+ path: [...state.path, selection],
34
+ view: FIRST,
35
+ views: [...state.views ?? [], state.view]
36
+ });
37
+ /** The drill at an earlier step, as a breadcrumb or Back opens it: with the view that step had. */
38
+ function upTo(state, steps) {
39
+ const views = state.views ?? [];
40
+ const view = views[steps - 1] ?? FIRST;
41
+ const kept = views.slice(0, Math.max(0, steps - 1));
42
+ const { views: _views, ...rest } = state;
43
+ return {
44
+ ...rest,
45
+ path: state.path.slice(0, steps),
46
+ view,
47
+ ...kept.length === 0 ? {} : { views: kept }
48
+ };
49
+ }
50
+ /** Another line of the same tile, from a formula's parts: the same path, opened afresh. */
51
+ function onEntry(state, entry) {
52
+ const { views: _views, ...rest } = state;
53
+ return {
54
+ ...rest,
55
+ entry,
56
+ view: FIRST
57
+ };
58
+ }
59
+ /** A key that names a drill's state exactly, for caching its answer. */
60
+ const drillKey = (state) => JSON.stringify(state);
61
+ /** A key that names a drill's path, whatever its view: one summary serves every view of it. */
62
+ const pathKey = (state) => JSON.stringify([
63
+ state.origin,
64
+ state.execution,
65
+ state.path,
66
+ state.entry ?? null
67
+ ]);
68
+ export { deeper, drillFrom, drillKey, onEntry, pathKey, rowEntry, upTo };
@@ -0,0 +1,46 @@
1
+ import { DrillChange } from "./state.mjs";
2
+ import { DrillAnswer, DrillState, DrillSummary, DrillView } from "derive-dashboards/core";
3
+ export type DrillOptions = {
4
+ state: DrillState | undefined;
5
+ onStateChange: DrillChange;
6
+ };
7
+ /**
8
+ * The drill controller every drill UI sits on, `<DrillPanel>` included: the drill's answer for
9
+ * its state, and the moves a person makes (another view, a step deeper, Back, a breadcrumb,
10
+ * close), each told to the host as the next state with whether Back should undo it. Headless:
11
+ * no markup or styles. The state is the host's (in its URL, say); the controller never writes
12
+ * history itself. Its answers are cached per viewer and client (`viewerKey` on the provider),
13
+ * and a read the person moved on from is aborted.
14
+ */
15
+ export declare function useDrill({ state, onStateChange }: DrillOptions): {
16
+ setView: (view: DrillView) => void;
17
+ open: (selection: string) => void;
18
+ goTo: (steps: number) => void;
19
+ /** Another line of the tile: a formula's part, drilled on its own. */
20
+ openEntry: (entry: string) => void;
21
+ /** A drill the server sealed (a formula's part in its own scope), opened as it is. */
22
+ openState: (next: DrillState) => void;
23
+ /** One step up; at the first step, Back closes the drill. */
24
+ back: () => void;
25
+ close: () => void;
26
+ view: DrillView | undefined;
27
+ items: {
28
+ view: import("derive-dashboards/core").DrillItemsView | undefined;
29
+ moreError?: Error;
30
+ items: import("derive-dashboards/core").DrillItem[];
31
+ more: () => Promise<void>;
32
+ hasMore: boolean;
33
+ loadingMore: boolean;
34
+ };
35
+ status: "error" | "ready" | "loading";
36
+ /** A new view of the same step is loading: the last one stays, its controls with it. */
37
+ updating: boolean;
38
+ error: Error | undefined;
39
+ retry: () => void;
40
+ summary: DrillSummary | undefined;
41
+ path: import("derive-dashboards/core").DrillCrumb[];
42
+ shown: import("derive-dashboards/core").DrillItemsView | import("derive-dashboards/core").DrillGroupedView | import("derive-dashboards/core").DrillExplanationView | undefined;
43
+ state: DrillState | undefined;
44
+ answer: DrillAnswer | undefined;
45
+ };
46
+ export type DrillController = ReturnType<typeof useDrill>;
@@ -0,0 +1,194 @@
1
+ import { useDashboards } from "../context.mjs";
2
+ import { useMorePages } from "./pages.mjs";
3
+ import { deeper, drillKey, onEntry, pathKey, upTo } from "./state.mjs";
4
+ import { useEffect, useRef } from "react";
5
+ import useSWR, { useSWRConfig } from "swr";
6
+ // src/drill/useDrill.ts
7
+ /** Whether a view needs the summary read with it: to pick the first view, or to explain a formula. */
8
+ const needsSummary = (view) => view.by === "breakdown" && view.member === void 0 || view.by === "explanation";
9
+ /**
10
+ * Reads a drill for one state: each read aborts when the state moves on (the server then
11
+ * cancels its statements), and a path whose summary is known reads its next view without it.
12
+ */
13
+ function useAsk(client, scope, known) {
14
+ const running = useRef(void 0);
15
+ const paging = useRef(void 0);
16
+ const mounted = useRef(false);
17
+ useEffect(() => {
18
+ mounted.current = true;
19
+ return () => {
20
+ mounted.current = false;
21
+ queueMicrotask(() => {
22
+ if (mounted.current) return;
23
+ running.current?.abort();
24
+ paging.current?.abort();
25
+ });
26
+ };
27
+ }, []);
28
+ const begin = (page) => {
29
+ const stop = new AbortController();
30
+ paging.current?.abort();
31
+ if (page === void 0) {
32
+ running.current?.abort();
33
+ running.current = stop;
34
+ } else paging.current = stop;
35
+ return stop;
36
+ };
37
+ return async (state, page) => {
38
+ const stop = begin(page);
39
+ const have = known.get(`${scope}|${pathKey(state)}`);
40
+ const skip = have !== void 0 && (page !== void 0 || !needsSummary(state.view));
41
+ const answer = await client.drill({
42
+ state,
43
+ ...page === void 0 ? {} : { page },
44
+ ...skip ? { summary: false } : {}
45
+ }, stop.signal);
46
+ if (answer.summary !== void 0) known.set(`${scope}|${pathKey(answer.state)}`, answer.summary);
47
+ return answer.summary === void 0 && have !== void 0 ? {
48
+ ...answer,
49
+ summary: have
50
+ } : answer;
51
+ };
52
+ }
53
+ /**
54
+ * When the server normalizes a state (seals a clicked row, picks the first view, drops a step
55
+ * that fixed a field twice), the host is told, and the answer it already has serves the new
56
+ * state too.
57
+ */
58
+ function useNormalized(scope, state, answer, onChange) {
59
+ const { mutate } = useSWRConfig();
60
+ const latest = useRef(onChange);
61
+ latest.current = onChange;
62
+ useEffect(() => {
63
+ if (state === void 0 || answer === void 0) return;
64
+ const normal = drillKey(answer.state);
65
+ if (normal === drillKey(state)) return;
66
+ mutate([
67
+ "dd-drill",
68
+ scope,
69
+ normal
70
+ ], answer, { revalidate: false });
71
+ latest.current(answer.state, "replace");
72
+ }, [
73
+ scope,
74
+ state,
75
+ answer,
76
+ mutate
77
+ ]);
78
+ }
79
+ /** The moves a person makes in a drill, each told to the host as the next state. */
80
+ function movesOf(state, move) {
81
+ const at = (next, history) => {
82
+ if (state !== void 0) move(next(state), history);
83
+ };
84
+ return {
85
+ setView: (view) => {
86
+ at((s) => ({
87
+ ...s,
88
+ view
89
+ }), "replace");
90
+ },
91
+ open: (selection) => {
92
+ at((s) => deeper(s, selection), "push");
93
+ },
94
+ goTo: (steps) => {
95
+ at((s) => upTo(s, steps), "push");
96
+ },
97
+ /** Another line of the tile: a formula's part, drilled on its own. */
98
+ openEntry: (entry) => {
99
+ at((s) => onEntry(s, entry), "push");
100
+ },
101
+ /** A drill the server sealed (a formula's part in its own scope), opened as it is. */
102
+ openState: (next) => {
103
+ move(next, "push");
104
+ },
105
+ /** One step up; at the first step, Back closes the drill. */
106
+ back: () => {
107
+ const steps = state?.path.length ?? 0;
108
+ if (steps > 1) at((s) => upTo(s, steps - 1), "push");
109
+ else move(void 0, "push");
110
+ },
111
+ close: () => {
112
+ move(void 0, "push");
113
+ }
114
+ };
115
+ }
116
+ /** Whether the answer is on its way, here, or failed. */
117
+ function statusOf(asked) {
118
+ if (asked.data !== void 0) return "ready";
119
+ return asked.error === void 0 ? "loading" : "error";
120
+ }
121
+ /**
122
+ * The drill controller every drill UI sits on, `<DrillPanel>` included: the drill's answer for
123
+ * its state, and the moves a person makes (another view, a step deeper, Back, a breadcrumb,
124
+ * close), each told to the host as the next state with whether Back should undo it. Headless:
125
+ * no markup or styles. The state is the host's (in its URL, say); the controller never writes
126
+ * history itself. Its answers are cached per viewer and client (`viewerKey` on the provider),
127
+ * and a read the person moved on from is aborted.
128
+ */
129
+ function useDrill({ state, onStateChange }) {
130
+ const { client, cacheScope } = useDashboards();
131
+ const known = useRef(/* @__PURE__ */ new Map());
132
+ const ask = useAsk(client, cacheScope, known.current);
133
+ const key = state === void 0 ? null : [
134
+ "dd-drill",
135
+ cacheScope,
136
+ drillKey(state)
137
+ ];
138
+ const asked = useSWR(key, () => state === void 0 ? Promise.reject(/* @__PURE__ */ new Error("No drill.")) : ask(state));
139
+ const { answer, updating } = useSteady(state, asked.data);
140
+ useNormalized(cacheScope, state, asked.data, onStateChange);
141
+ const shown = answer?.view;
142
+ const itemsView = shown?.by === "items" ? shown : void 0;
143
+ const pages = useMorePages(`${cacheScope}|${key?.[2] ?? ""}`, state, itemsView, ask);
144
+ return {
145
+ state,
146
+ answer,
147
+ ...answered(answer),
148
+ view: state?.view,
149
+ items: {
150
+ ...pages,
151
+ view: itemsView
152
+ },
153
+ status: updating ? "ready" : statusOf(asked),
154
+ /** A new view of the same step is loading: the last one stays, its controls with it. */
155
+ updating,
156
+ error: asked.error instanceof Error ? asked.error : void 0,
157
+ retry: () => {
158
+ if (state !== void 0) known.current.delete(`${cacheScope}|${pathKey(state)}`);
159
+ asked.mutate();
160
+ },
161
+ ...movesOf(state, onStateChange)
162
+ };
163
+ }
164
+ /** Where a drill stands: its origin and path, not its view. */
165
+ const stepOf = (state) => JSON.stringify([
166
+ state.origin,
167
+ state.execution,
168
+ state.path,
169
+ state.entry ?? null
170
+ ]);
171
+ /**
172
+ * The answer to show: the new one, or while a new view of the same step loads (another field,
173
+ * a search, Only), the last one, so the controls a person is using stay where they are.
174
+ */
175
+ function useSteady(state, fresh) {
176
+ const last = useRef(void 0);
177
+ const step = state === void 0 ? void 0 : stepOf(state);
178
+ if (fresh !== void 0 && step !== void 0) last.current = {
179
+ step,
180
+ answer: fresh
181
+ };
182
+ const held = fresh === void 0 && last.current?.step === step ? last.current?.answer : void 0;
183
+ return {
184
+ answer: fresh ?? held,
185
+ updating: held !== void 0
186
+ };
187
+ }
188
+ /** What an answer shows: its summary, its breadcrumbs, its view. */
189
+ const answered = (answer) => ({
190
+ summary: answer?.summary,
191
+ path: answer?.path ?? [],
192
+ shown: answer?.view
193
+ });
194
+ export { useDrill };
@@ -0,0 +1,101 @@
1
+ import { DrillReason } from "derive-dashboards/core";
2
+ /** Every word the drill panel shows; `ENGLISH_DRILL` holds the defaults. */
3
+ export type DrillMessages = {
4
+ /** The panel's name, over the path. */
5
+ drillTitle: string;
6
+ /** The views. */
7
+ drillViews: Record<"breakdown" | "trend" | "items" | "explanation", string>;
8
+ /** Back one step; at the root, back to the dashboard. */
9
+ drillBack: string;
10
+ /** A breadcrumb that steps back to the tile itself. */
11
+ drillRoot: (title: string) => string;
12
+ /** "36 orders" beside the value, when the rows and the value differ. */
13
+ drillRows: (count: string) => string;
14
+ /** "396 tasks with Hours (57 without)": a value that counts only rows with its field set. */
15
+ drillWith: (rows: string, operand: string, without: string | undefined) => string;
16
+ /** "42% of the total" for a first step, "39% of Open" deeper. */
17
+ drillShare: (percent: string, of: string | undefined) => string;
18
+ /** The value now differs from the one the chart was drawn with (same viewer only). */
19
+ drillMoved: (now: string, then: string) => string;
20
+ /** Reload the drill. */
21
+ drillRefresh: string;
22
+ /** A link drawn by another viewer: the counts are this viewer's own. */
23
+ drillYours: (noun: string) => string;
24
+ /** A link whose step this viewer may not open: never how many rows. */
25
+ drillOmitted: string;
26
+ /** A mark of the period before: "Before · Sep 15 to Oct 14". */
27
+ drillEarlier: (range: string) => string;
28
+ /** Under a mark that opens: what a click does. */
29
+ drillHint: string;
30
+ /** A Breakdown's field picker. */
31
+ drillBy: string;
32
+ /** "Showing 12 of 36", or "Showing 12" when the total is not known. */
33
+ drillShowing: (shown: number, total?: string) => string;
34
+ drillSort: Record<"records" | "value" | "count", string>;
35
+ /** The records order in words: "newest first", "oldest first", "by Priority". */
36
+ drillSorted: (field: string, dir: "asc" | "desc", time: boolean) => string;
37
+ drillList: string;
38
+ drillTable: string;
39
+ /** An empty Items list. */
40
+ drillNoItems: string;
41
+ /** An empty Breakdown or Over time: no group to show. */
42
+ drillNoGroups: string;
43
+ /** A Breakdown search that matched nothing. */
44
+ drillNoMatch: string;
45
+ drillFailed: string;
46
+ drillRetry: string;
47
+ /** The drill's link no longer opens (the server restarted, the dashboard changed). */
48
+ drillStale: string;
49
+ /** Close the out-of-date drill. */
50
+ drillStaleClose: string;
51
+ /** A screen-reader name for a mark that opens: "Open, 36. Open what is behind it." */
52
+ drillMark: (label: string) => string;
53
+ /** A row in a list with no title field: "Task 4123" by its id, else "Task 3" by its place. */
54
+ drillUntitled: (n: number | string, noun?: string) => string;
55
+ /** A formula's parts. */
56
+ drillOperands: string;
57
+ /** Where a part of a formula is read: the row itself, the whole chart, its time point, the period before. */
58
+ drillScope: Record<"row" | "total" | "bucket" | "previous", string>;
59
+ /** A row, or rows, when the source names none: "rows". */
60
+ drillNoun: (n: number) => string;
61
+ /** A group in a Breakdown of the change: "36, was 30, +6". */
62
+ drillChange: (now: string, before: string, change: string) => string;
63
+ /** The header of a Breakdown of the change: "202 vs 169, +33". */
64
+ drillVersus: (before: string, change: string) => string;
65
+ /** The search in a Breakdown's field. */
66
+ drillSearch: string;
67
+ /** A ratio's Items: only the rows its numerator counts, "Only Won (12)". */
68
+ drillOnly: (numerator: string, count: string) => string;
69
+ /** Why a chart's later marks do not open. */
70
+ drillCut: string;
71
+ /** A number's value in the period before: "Before: 30". */
72
+ drillBefore: (value: string) => string;
73
+ /** A number tile's change against the period before: "+17 from 0", or no change. */
74
+ beforeChange: (change: string, before: string) => string;
75
+ beforeSame: (before: string) => string;
76
+ /** A step that is the whole of the period before, in the breadcrumb. */
77
+ drillPeriodBefore: string;
78
+ /** The Items table's first column when the source names no noun. */
79
+ drillItem: string;
80
+ /** A group with no value of its field: "No Assignee". */
81
+ drillNone: (field: string) => string;
82
+ /** Other of one field in a breadcrumb: "Other priority". */
83
+ drillOtherOf: (field: string) => string;
84
+ /** A time point in a breadcrumb: "Week of Nov 9". */
85
+ drillWeekOf: (date: string) => string;
86
+ /** A true or false value in a list or table. */
87
+ drillYes: string;
88
+ drillNo: string;
89
+ /** A percentile's marker row: "90% are below 4 h". */
90
+ drillPercentile: (p: number, value: string) => string;
91
+ /** Over time: the range drawn and its grain picker. */
92
+ drillRange: (from: string, to: string) => string;
93
+ drillGrains: Record<"hour" | "day" | "week" | "month" | "quarter" | "year", string>;
94
+ /** Why a view cannot show, by its code. */
95
+ drillReasons: Record<DrillReason, string>;
96
+ /** Open the widget behind the drill in the builder (editing only). */
97
+ drillOpenInBuilder: string;
98
+ /** On a phone, a tap first shows the value and this button. */
99
+ drillSee: (count: string) => string;
100
+ };
101
+ export declare const ENGLISH_DRILL: DrillMessages;