derive-dashboards 0.5.1 → 0.7.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 (342) hide show
  1. package/README.md +4 -2
  2. package/dist/body.mjs +2 -2
  3. package/dist/charts/data/buckets.d.mts +11 -0
  4. package/dist/charts/data/buckets.mjs +66 -0
  5. package/dist/charts/data/clean.mjs +55 -0
  6. package/dist/charts/data/format.d.mts +19 -0
  7. package/dist/charts/data/format.mjs +174 -0
  8. package/dist/charts/data/input-error.d.mts +5 -0
  9. package/dist/charts/data/input-error.mjs +11 -0
  10. package/dist/charts/data/range.mjs +14 -0
  11. package/dist/charts/data/rows.d.mts +13 -0
  12. package/dist/charts/data/rows.mjs +31 -0
  13. package/dist/charts/data/shares.mjs +55 -0
  14. package/dist/charts/data/types.d.mts +106 -0
  15. package/dist/charts/data/words.d.mts +44 -0
  16. package/dist/charts/data/words.mjs +31 -0
  17. package/dist/charts/describe.mjs +110 -0
  18. package/dist/charts/index.d.mts +34 -0
  19. package/dist/charts/index.mjs +24 -0
  20. package/dist/charts/kinds/area-marks.mjs +120 -0
  21. package/dist/charts/kinds/area.d.mts +23 -0
  22. package/dist/charts/kinds/area.mjs +71 -0
  23. package/dist/charts/kinds/bars-data.d.mts +11 -0
  24. package/dist/charts/kinds/bars-data.mjs +30 -0
  25. package/dist/charts/kinds/bars-layout.mjs +30 -0
  26. package/dist/charts/kinds/bars-marks.mjs +93 -0
  27. package/dist/charts/kinds/bars-words.mjs +56 -0
  28. package/dist/charts/kinds/bars.d.mts +17 -0
  29. package/dist/charts/kinds/bars.mjs +68 -0
  30. package/dist/charts/kinds/columns-data.mjs +116 -0
  31. package/dist/charts/kinds/columns-layout.mjs +29 -0
  32. package/dist/charts/kinds/columns-marks.mjs +200 -0
  33. package/dist/charts/kinds/columns-words.mjs +26 -0
  34. package/dist/charts/kinds/columns.d.mts +13 -0
  35. package/dist/charts/kinds/columns.mjs +80 -0
  36. package/dist/charts/kinds/dumbbell-data.d.mts +22 -0
  37. package/dist/charts/kinds/dumbbell-data.mjs +59 -0
  38. package/dist/charts/kinds/dumbbell-layout.mjs +113 -0
  39. package/dist/charts/kinds/dumbbell-marks.mjs +119 -0
  40. package/dist/charts/kinds/dumbbell-words.d.mts +7 -0
  41. package/dist/charts/kinds/dumbbell-words.mjs +94 -0
  42. package/dist/charts/kinds/dumbbell.d.mts +14 -0
  43. package/dist/charts/kinds/dumbbell.mjs +67 -0
  44. package/dist/charts/kinds/funnel-data.d.mts +11 -0
  45. package/dist/charts/kinds/funnel-data.mjs +70 -0
  46. package/dist/charts/kinds/funnel-layout.mjs +32 -0
  47. package/dist/charts/kinds/funnel-marks.mjs +204 -0
  48. package/dist/charts/kinds/funnel-words.mjs +77 -0
  49. package/dist/charts/kinds/funnel.d.mts +11 -0
  50. package/dist/charts/kinds/funnel.mjs +75 -0
  51. package/dist/charts/kinds/grid-data.d.mts +18 -0
  52. package/dist/charts/kinds/grid-data.mjs +35 -0
  53. package/dist/charts/kinds/grid-layout.mjs +77 -0
  54. package/dist/charts/kinds/grid-marks.mjs +140 -0
  55. package/dist/charts/kinds/grid-time.mjs +41 -0
  56. package/dist/charts/kinds/grid-words.mjs +86 -0
  57. package/dist/charts/kinds/grid.d.mts +22 -0
  58. package/dist/charts/kinds/grid.mjs +55 -0
  59. package/dist/charts/kinds/histogram-data.mjs +142 -0
  60. package/dist/charts/kinds/histogram-layout.mjs +144 -0
  61. package/dist/charts/kinds/histogram-marks.mjs +110 -0
  62. package/dist/charts/kinds/histogram-words.mjs +104 -0
  63. package/dist/charts/kinds/histogram.d.mts +15 -0
  64. package/dist/charts/kinds/histogram.mjs +47 -0
  65. package/dist/charts/kinds/line-marks.mjs +36 -0
  66. package/dist/charts/kinds/line.d.mts +17 -0
  67. package/dist/charts/kinds/line.mjs +52 -0
  68. package/dist/charts/kinds/multiples-grid.mjs +107 -0
  69. package/dist/charts/kinds/multiples-head.mjs +44 -0
  70. package/dist/charts/kinds/multiples-layout.mjs +159 -0
  71. package/dist/charts/kinds/multiples-marks.mjs +95 -0
  72. package/dist/charts/kinds/multiples-words.mjs +110 -0
  73. package/dist/charts/kinds/multiples.d.mts +26 -0
  74. package/dist/charts/kinds/multiples.mjs +42 -0
  75. package/dist/charts/kinds/row-chart.mjs +112 -0
  76. package/dist/charts/kinds/row-marks.mjs +121 -0
  77. package/dist/charts/kinds/scatter-data.d.mts +18 -0
  78. package/dist/charts/kinds/scatter-data.mjs +123 -0
  79. package/dist/charts/kinds/scatter-layout.mjs +189 -0
  80. package/dist/charts/kinds/scatter-marks.mjs +149 -0
  81. package/dist/charts/kinds/scatter-words.mjs +80 -0
  82. package/dist/charts/kinds/scatter.d.mts +21 -0
  83. package/dist/charts/kinds/scatter.mjs +72 -0
  84. package/dist/charts/kinds/stat-data.mjs +91 -0
  85. package/dist/charts/kinds/stat-layout.mjs +108 -0
  86. package/dist/charts/kinds/stat-marks.mjs +85 -0
  87. package/dist/charts/kinds/stat-words.mjs +57 -0
  88. package/dist/charts/kinds/stat.d.mts +28 -0
  89. package/dist/charts/kinds/stat.mjs +35 -0
  90. package/dist/charts/kinds/time-chart.mjs +74 -0
  91. package/dist/charts/kinds/time-frame.mjs +113 -0
  92. package/dist/charts/kinds/time-notes.mjs +36 -0
  93. package/dist/charts/kinds/time-plan.d.mts +8 -0
  94. package/dist/charts/kinds/time-plan.mjs +57 -0
  95. package/dist/charts/kinds/time-plot.mjs +56 -0
  96. package/dist/charts/kinds/time-stops.mjs +56 -0
  97. package/dist/charts/kinds/value-plot.mjs +33 -0
  98. package/dist/charts/kinds/waterfall-data.d.mts +7 -0
  99. package/dist/charts/kinds/waterfall-data.mjs +71 -0
  100. package/dist/charts/kinds/waterfall-layout.mjs +38 -0
  101. package/dist/charts/kinds/waterfall-marks.mjs +82 -0
  102. package/dist/charts/kinds/waterfall-words.mjs +118 -0
  103. package/dist/charts/kinds/waterfall.d.mts +17 -0
  104. package/dist/charts/kinds/waterfall.mjs +66 -0
  105. package/dist/charts/layout/boxes.mjs +28 -0
  106. package/dist/charts/layout/dodge.mjs +75 -0
  107. package/dist/charts/layout/extent.mjs +25 -0
  108. package/dist/charts/layout/frame.mjs +97 -0
  109. package/dist/charts/layout/place-labels.mjs +101 -0
  110. package/dist/charts/layout/stack.mjs +31 -0
  111. package/dist/charts/marks/axes.mjs +137 -0
  112. package/dist/charts/marks/dot.mjs +31 -0
  113. package/dist/charts/marks/end-labels.mjs +124 -0
  114. package/dist/charts/marks/legend.mjs +141 -0
  115. package/dist/charts/marks/lines.d.mts +2 -0
  116. package/dist/charts/marks/lines.mjs +38 -0
  117. package/dist/charts/marks/lit.d.mts +3 -0
  118. package/dist/charts/marks/lit.mjs +63 -0
  119. package/dist/charts/marks/more.mjs +18 -0
  120. package/dist/charts/marks/notes.mjs +253 -0
  121. package/dist/charts/marks/series-line.mjs +110 -0
  122. package/dist/charts/marks/thin.mjs +138 -0
  123. package/dist/charts/marks/x-axis.mjs +32 -0
  124. package/dist/charts/scale/calendar.mjs +174 -0
  125. package/dist/charts/scale/time-ticks.mjs +154 -0
  126. package/dist/charts/scale/time.mjs +33 -0
  127. package/dist/charts/scale/value.mjs +161 -0
  128. package/dist/charts/scene/defs.mjs +33 -0
  129. package/dist/charts/scene/markup.mjs +35 -0
  130. package/dist/charts/scene/nearest.d.mts +11 -0
  131. package/dist/charts/scene/nearest.mjs +49 -0
  132. package/dist/charts/scene/paint.d.mts +12 -0
  133. package/dist/charts/scene/paint.mjs +13 -0
  134. package/dist/charts/scene/svg.d.mts +18 -0
  135. package/dist/charts/scene/svg.mjs +185 -0
  136. package/dist/charts/scene/types.d.mts +177 -0
  137. package/dist/charts/text/measure.d.mts +9 -0
  138. package/dist/charts/text/measure.mjs +123 -0
  139. package/dist/charts/theme.d.mts +47 -0
  140. package/dist/charts/theme.mjs +239 -0
  141. package/dist/charts-react/Chart.d.mts +91 -0
  142. package/dist/charts-react/Chart.mjs +166 -0
  143. package/dist/charts-react/Overlay.mjs +171 -0
  144. package/dist/charts-react/Picture.mjs +22 -0
  145. package/dist/charts-react/Reader.mjs +147 -0
  146. package/dist/charts-react/bucket-names.mjs +29 -0
  147. package/dist/charts-react/chart-unlayered.css +1 -0
  148. package/dist/charts-react/chart-unlayered.css.d.ts +1 -0
  149. package/dist/charts-react/chart.css +1 -0
  150. package/dist/charts-react/chart.css.d.ts +1 -0
  151. package/dist/charts-react/events.mjs +72 -0
  152. package/dist/charts-react/exact-sum.mjs +24 -0
  153. package/dist/charts-react/from-answer.mjs +185 -0
  154. package/dist/charts-react/index.d.mts +3 -0
  155. package/dist/charts-react/index.mjs +4 -0
  156. package/dist/charts-react/keys.mjs +117 -0
  157. package/dist/charts-react/opens.mjs +28 -0
  158. package/dist/charts-react/plan-bars.mjs +95 -0
  159. package/dist/charts-react/plan-funnel.mjs +120 -0
  160. package/dist/charts-react/plan-grid.mjs +121 -0
  161. package/dist/charts-react/plan-parts.d.mts +2 -0
  162. package/dist/charts-react/plan-parts.mjs +30 -0
  163. package/dist/charts-react/plan-time.mjs +84 -0
  164. package/dist/charts-react/plan.d.mts +3 -0
  165. package/dist/charts-react/plan.mjs +37 -0
  166. package/dist/charts-react/point-keys.mjs +22 -0
  167. package/dist/charts-react/pointer.mjs +99 -0
  168. package/dist/charts-react/reader-page.d.mts +8 -0
  169. package/dist/charts-react/reader-page.mjs +116 -0
  170. package/dist/charts-react/tiles.d.mts +24 -0
  171. package/dist/charts-react/tiles.mjs +142 -0
  172. package/dist/charts-react/tip-place.mjs +107 -0
  173. package/dist/charts-react/tip-room.mjs +31 -0
  174. package/dist/charts-react/useClientLayoutEffect.mjs +8 -0
  175. package/dist/charts-react/useScene.mjs +76 -0
  176. package/dist/charts-react/useSize.mjs +44 -0
  177. package/dist/charts-react/useStop.mjs +68 -0
  178. package/dist/core/conformance/memory/aggregate.mjs +2 -1
  179. package/dist/core/conformance/memory/rows.mjs +1 -1
  180. package/dist/core/conformance/memory/source.mjs +3 -2
  181. package/dist/core/document/display-comparisons.mjs +49 -0
  182. package/dist/core/document/display-entries.mjs +2 -1
  183. package/dist/core/document/display-validation.d.mts +12 -0
  184. package/dist/core/document/display-validation.mjs +56 -0
  185. package/dist/core/document/display.d.mts +27 -12
  186. package/dist/core/document/display.mjs +40 -49
  187. package/dist/core/document/view-layout.mjs +16 -0
  188. package/dist/core/engine/access.mjs +4 -2
  189. package/dist/core/engine/context.mjs +5 -7
  190. package/dist/core/engine/custom/cells.mjs +1 -1
  191. package/dist/core/engine/custom/records.mjs +2 -1
  192. package/dist/core/engine/dialect.d.mts +2 -0
  193. package/dist/core/engine/index.mjs +1 -1
  194. package/dist/core/engine/levels.mjs +33 -1
  195. package/dist/core/engine/plan.d.mts +2 -0
  196. package/dist/core/engine/postgres.mjs +1 -0
  197. package/dist/core/engine/rank.mjs +1 -1
  198. package/dist/core/engine/reader.d.mts +4 -0
  199. package/dist/core/engine/sql-partition.mjs +45 -0
  200. package/dist/core/engine/sql-reads.mjs +4 -1
  201. package/dist/core/engine/statement.mjs +4 -4
  202. package/dist/core/engine/version.d.mts +1 -1
  203. package/dist/core/engine/version.mjs +1 -1
  204. package/dist/core/error/codes.d.mts +1 -1
  205. package/dist/core/error/codes.mjs +1 -1
  206. package/dist/core/exact/decimal.d.mts +1 -4
  207. package/dist/core/exact/decimal.mjs +1 -14
  208. package/dist/core/exact/text.d.mts +5 -0
  209. package/dist/core/exact/text.mjs +19 -0
  210. package/dist/core/index.d.mts +9 -6
  211. package/dist/core/index.mjs +11 -8
  212. package/dist/core/model/types.d.mts +2 -0
  213. package/dist/core/model/validate/fields.mjs +1 -1
  214. package/dist/core/model/validate/known-members.mjs +2 -0
  215. package/dist/core/model/validate/shape.mjs +5 -1
  216. package/dist/core/oracle/visibility.mjs +2 -2
  217. package/dist/core/policy/bind.mjs +29 -1
  218. package/dist/core/query/drill/compose.d.mts +2 -0
  219. package/dist/core/query/drill/compose.mjs +1 -1
  220. package/dist/core/query/drill/synthetic.mjs +2 -1
  221. package/dist/core/query/drill/types.d.mts +7 -0
  222. package/dist/core/query/drill/types.mjs +3 -1
  223. package/dist/core/result/number.mjs +2 -1
  224. package/dist/core/result/time-axis.mjs +2 -1
  225. package/dist/core/schema/answers.d.mts +1176 -362
  226. package/dist/core/schema/commands.mjs +2 -1
  227. package/dist/core/schema/document.mjs +27 -2
  228. package/dist/core/schema/drill-answers.mjs +19 -1
  229. package/dist/core/schema/drill.d.mts +21 -6
  230. package/dist/core/schema/drill.mjs +7 -1
  231. package/dist/core/schema/index.d.mts +2 -1
  232. package/dist/core/schema/index.mjs +2 -1
  233. package/dist/core/schema/null-ops.d.mts +6 -0
  234. package/dist/core/schema/null-ops.mjs +18 -0
  235. package/dist/core/schema/query.mjs +30 -4
  236. package/dist/core/schema/tools.mjs +13 -0
  237. package/dist/core/schema/union-error.mjs +38 -0
  238. package/dist/core/time/bucket.mjs +2 -1
  239. package/dist/core/time/index.d.mts +3 -2
  240. package/dist/core/time/instant.d.mts +1 -2
  241. package/dist/core/time/instant.mjs +2 -30
  242. package/dist/core/time/range.mjs +2 -1
  243. package/dist/core/time/stored.mjs +2 -1
  244. package/dist/core/time/text-time.d.mts +10 -0
  245. package/dist/core/time/text-time.mjs +80 -0
  246. package/dist/core/types/api.d.mts +1 -1
  247. package/dist/core/types/api.mjs +1 -1
  248. package/dist/core/types/drill-api.d.mts +22 -2
  249. package/dist/dashboard-documents.d.mts +8 -0
  250. package/dist/dashboard-documents.mjs +52 -0
  251. package/dist/drill-access.mjs +40 -3
  252. package/dist/drill-comparison.mjs +71 -0
  253. package/dist/drill-crumbs.mjs +21 -2
  254. package/dist/drill-group-seal.mjs +13 -0
  255. package/dist/drill-open.mjs +7 -1
  256. package/dist/drill-seal.mjs +4 -6
  257. package/dist/drill-views.mjs +5 -13
  258. package/dist/drill.mjs +28 -58
  259. package/dist/editing.mjs +1 -1
  260. package/dist/endpoints/drill.mjs +2 -3
  261. package/dist/endpoints/index.d.mts +20 -0
  262. package/dist/index.d.mts +2 -1
  263. package/dist/index.mjs +6 -27
  264. package/dist/llms.txt +1 -1
  265. package/dist/react/Cell.mjs +2 -2
  266. package/dist/react/DashboardList.mjs +3 -3
  267. package/dist/react/Editing.mjs +3 -3
  268. package/dist/react/Header.mjs +2 -2
  269. package/dist/react/History.mjs +3 -3
  270. package/dist/react/Parts.mjs +2 -2
  271. package/dist/react/RowBody.d.mts +2 -4
  272. package/dist/react/RowBody.mjs +14 -39
  273. package/dist/react/Tile.mjs +4 -5
  274. package/dist/react/builder/FilterEditor.mjs +2 -2
  275. package/dist/react/builder/Picker.mjs +3 -3
  276. package/dist/react/builder/RangeEditor.mjs +3 -3
  277. package/dist/react/builder/Time.mjs +3 -3
  278. package/dist/react/builder/Values.mjs +2 -2
  279. package/dist/react/builder/WidgetBuilder.mjs +2 -2
  280. package/dist/react/digits.mjs +1 -1
  281. package/dist/react/drill/Bars.mjs +34 -38
  282. package/dist/react/drill/Comparison.mjs +204 -0
  283. package/dist/react/drill/Controls.mjs +8 -12
  284. package/dist/react/drill/DrillDrawer.mjs +42 -0
  285. package/dist/react/drill/DrillPanel.mjs +61 -41
  286. package/dist/react/drill/Header.mjs +65 -35
  287. package/dist/react/drill/ItemLink.mjs +40 -0
  288. package/dist/react/drill/Items.d.mts +2 -1
  289. package/dist/react/drill/Items.mjs +126 -99
  290. package/dist/react/drill/ItemsBody.mjs +38 -0
  291. package/dist/react/drill/ItemsFoot.mjs +24 -19
  292. package/dist/react/drill/Notes.mjs +23 -13
  293. package/dist/react/drill/PanelBody.mjs +7 -25
  294. package/dist/react/drill/RecordRow.mjs +47 -0
  295. package/dist/react/drill/Trend.mjs +186 -0
  296. package/dist/react/drill/board.mjs +21 -11
  297. package/dist/react/drill/drawer-context.mjs +5 -0
  298. package/dist/react/drill/item-parts.mjs +53 -35
  299. package/dist/react/drill/item-type.d.mts +2 -2
  300. package/dist/react/drill/lazy.d.mts +1 -4
  301. package/dist/react/drill/lazy.mjs +29 -11
  302. package/dist/react/drill/panel-focus.mjs +18 -7
  303. package/dist/react/drill/props.d.mts +7 -1
  304. package/dist/react/drill/props.mjs +39 -8
  305. package/dist/react/drill/record-page.mjs +61 -0
  306. package/dist/react/drill/state.mjs +17 -2
  307. package/dist/react/drill/trend-touch.mjs +33 -0
  308. package/dist/react/drill/useDrill.d.mts +3 -3
  309. package/dist/react/drill/useDrill.mjs +35 -15
  310. package/dist/react/drill/words.d.mts +14 -0
  311. package/dist/react/drill/words.mjs +20 -8
  312. package/dist/react/english.d.mts +4 -1
  313. package/dist/react/english.mjs +17 -2
  314. package/dist/react/filters/chip.mjs +2 -2
  315. package/dist/react/filters/menu-search.mjs +5 -5
  316. package/dist/react/filters/menu.mjs +2 -2
  317. package/dist/react/filters/number.mjs +2 -2
  318. package/dist/react/filters/operator.mjs +2 -2
  319. package/dist/react/filters/phone.mjs +2 -2
  320. package/dist/react/filters/values.mjs +4 -4
  321. package/dist/react/format-time.d.mts +2 -1
  322. package/dist/react/format-time.mjs +42 -34
  323. package/dist/react/format.mjs +15 -3
  324. package/dist/react/index.d.mts +4 -3
  325. package/dist/react/index.mjs +4 -3
  326. package/dist/react/messages.d.mts +23 -2
  327. package/dist/react/renderers/entries.d.mts +11 -0
  328. package/dist/react/renderers/list.mjs +8 -10
  329. package/dist/react/renderers/table-cells.mjs +38 -9
  330. package/dist/react/renderers/table-measure.mjs +2 -0
  331. package/dist/react/renderers/table-row.mjs +64 -7
  332. package/dist/react/renderers/table-sort.mjs +2 -8
  333. package/dist/react/renderers/table.mjs +16 -15
  334. package/dist/react/series.mjs +8 -3
  335. package/dist/react/theme-unlayered.css +1 -3144
  336. package/dist/react/theme.css +1 -3146
  337. package/dist/recharts/parts.mjs +1 -1
  338. package/dist/skills/derive-dashboards/SKILL.md +10 -5
  339. package/dist/store/apply.mjs +2 -2
  340. package/dist/store/editor.mjs +2 -2
  341. package/dist/store/writer.mjs +2 -2
  342. package/package.json +27 -2
@@ -1,3 +1,4 @@
1
+ import { MAX_DRILL_ROWS } from "derive-dashboards/core";
1
2
  // src/drill/state.ts
2
3
  /** The view a fresh step opens on: the server picks it by its rules (Breakdown with no field). */
3
4
  const FIRST = { by: "breakdown" };
@@ -20,7 +21,7 @@ function drillFrom(origin, drill, at = {}) {
20
21
  }
21
22
  /** A row of a sealed answer as a path entry, or undefined when the row does not open. */
22
23
  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
+ return sealed === void 0 || !Number.isInteger(row) || row < 0 || row >= MAX_DRILL_ROWS || sealed.closed?.some((c) => c.row === row) === true ? void 0 : `${sealed.answer}#${previous ? "p" : ""}${String(row)}`;
24
25
  }
25
26
  /** A row's place in the sealed answer as a path of one, or undefined when the row does not open. */
26
27
  function pick(drill, row) {
@@ -56,6 +57,20 @@ function onEntry(state, entry) {
56
57
  view: FIRST
57
58
  };
58
59
  }
60
+ /** Full records and their summary share one read and one accumulated set of pages. */
61
+ function itemFields(state, wide) {
62
+ if (state.view.by !== "items") return state;
63
+ const { fields: _fields, ...view } = state.view;
64
+ return {
65
+ ...state,
66
+ view: wide ? {
67
+ ...view,
68
+ fields: true
69
+ } : view
70
+ };
71
+ }
72
+ const readState = (state) => state && itemFields(state, false);
73
+ const showsFields = (state) => state?.view.by === "items" && state.view.fields === true;
59
74
  /** A key that names a drill's state exactly, for caching its answer. */
60
75
  const drillKey = (state) => JSON.stringify(state);
61
76
  /** A key that names a drill's path, whatever its view: one summary serves every view of it. */
@@ -65,4 +80,4 @@ const pathKey = (state) => JSON.stringify([
65
80
  state.path,
66
81
  state.entry ?? null
67
82
  ]);
68
- export { deeper, drillFrom, drillKey, onEntry, pathKey, rowEntry, upTo };
83
+ export { deeper, drillFrom, drillKey, itemFields, onEntry, pathKey, readState, rowEntry, showsFields, upTo };
@@ -0,0 +1,33 @@
1
+ import { useRef, useState } from "react";
2
+ // src/drill/trend-touch.ts
3
+ /** A finger previews the value before opening its sealed selection. Mouse and keyboard activate directly. */
4
+ function useTouchPreview() {
5
+ const touch = useRef(false);
6
+ const [selected, select] = useState(null);
7
+ return {
8
+ selected,
9
+ handlers: {
10
+ onPointerDownCapture: (e) => {
11
+ touch.current = e.pointerType === "touch";
12
+ if (!touch.current) select(null);
13
+ },
14
+ onKeyDownCapture: () => {
15
+ touch.current = false;
16
+ select(null);
17
+ },
18
+ onClickCapture: (e) => {
19
+ if (!touch.current || e.detail === 0 || !(e.target instanceof Element)) return;
20
+ touch.current = false;
21
+ const mark = e.target.closest("[tabindex]");
22
+ if (mark === null) return;
23
+ const index = mark.closest("li")?.dataset["index"];
24
+ if (index === void 0 || Number(index) === selected) return;
25
+ e.preventDefault();
26
+ e.stopPropagation();
27
+ select(Number(index));
28
+ mark.focus({ preventScroll: true });
29
+ }
30
+ }
31
+ };
32
+ }
33
+ export { useTouchPreview };
@@ -1,4 +1,4 @@
1
- import { DrillChange } from "./state.mjs";
1
+ import { DrillChange, DrillHistory } from "./state.mjs";
2
2
  import { DrillAnswer, DrillState, DrillSummary, DrillView } from "derive-dashboards/core";
3
3
  export type DrillOptions = {
4
4
  state: DrillState | undefined;
@@ -13,7 +13,7 @@ export type DrillOptions = {
13
13
  * and a read the person moved on from is aborted.
14
14
  */
15
15
  export declare function useDrill({ state, onStateChange }: DrillOptions): {
16
- setView: (view: DrillView) => void;
16
+ setView: (view: DrillView, history?: DrillHistory) => void;
17
17
  open: (selection: string) => void;
18
18
  goTo: (steps: number) => void;
19
19
  /** Another line of the tile: a formula's part, drilled on its own. */
@@ -39,7 +39,7 @@ export declare function useDrill({ state, onStateChange }: DrillOptions): {
39
39
  retry: () => void;
40
40
  summary: DrillSummary | undefined;
41
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;
42
+ shown: import("derive-dashboards/core").DrillGroupedView | import("derive-dashboards/core").DrillComparisonView | import("derive-dashboards/core").DrillItemsView | import("derive-dashboards/core").DrillExplanationView | undefined;
43
43
  state: DrillState | undefined;
44
44
  answer: DrillAnswer | undefined;
45
45
  };
@@ -1,6 +1,6 @@
1
1
  import { useDashboards } from "../context.mjs";
2
2
  import { useMorePages } from "./pages.mjs";
3
- import { deeper, drillKey, onEntry, pathKey, upTo } from "./state.mjs";
3
+ import { deeper, drillKey, itemFields, onEntry, pathKey, readState, showsFields, upTo } from "./state.mjs";
4
4
  import { useEffect, useRef } from "react";
5
5
  import useSWR, { useSWRConfig } from "swr";
6
6
  // src/drill/useDrill.ts
@@ -55,26 +55,46 @@ function useAsk(client, scope, known) {
55
55
  * that fixed a field twice), the host is told, and the answer it already has serves the new
56
56
  * state too.
57
57
  */
58
- function useNormalized(scope, state, answer, onChange) {
58
+ function useAnswer({ scope, state, ask, onChange }) {
59
59
  const { mutate } = useSWRConfig();
60
+ const read = readState(state);
61
+ const key = read === void 0 ? null : [
62
+ "dd-drill",
63
+ scope,
64
+ drillKey(read)
65
+ ];
66
+ const seeded = useRef(void 0);
67
+ const justAnswered = seeded.current?.scope === scope && seeded.current.key === key?.[2];
68
+ const asked = useSWR(key, () => read === void 0 ? Promise.reject(/* @__PURE__ */ new Error("No drill.")) : ask(read), justAnswered ? { revalidateIfStale: false } : {});
60
69
  const latest = useRef(onChange);
61
70
  latest.current = onChange;
71
+ const answer = asked.data;
62
72
  useEffect(() => {
73
+ seeded.current = void 0;
63
74
  if (state === void 0 || answer === void 0) return;
64
75
  const normal = drillKey(answer.state);
65
- if (normal === drillKey(state)) return;
76
+ if (normal === drillKey(itemFields(state, false))) return;
77
+ seeded.current = {
78
+ scope,
79
+ key: normal
80
+ };
66
81
  mutate([
67
82
  "dd-drill",
68
83
  scope,
69
84
  normal
70
85
  ], answer, { revalidate: false });
71
- latest.current(answer.state, "replace");
86
+ latest.current(itemFields(answer.state, showsFields(state)), "replace");
72
87
  }, [
73
88
  scope,
74
89
  state,
75
90
  answer,
76
91
  mutate
77
92
  ]);
93
+ return {
94
+ asked,
95
+ read,
96
+ key
97
+ };
78
98
  }
79
99
  /** The moves a person makes in a drill, each told to the host as the next state. */
80
100
  function movesOf(state, move) {
@@ -82,11 +102,11 @@ function movesOf(state, move) {
82
102
  if (state !== void 0) move(next(state), history);
83
103
  };
84
104
  return {
85
- setView: (view) => {
105
+ setView: (view, history = "replace") => {
86
106
  at((s) => ({
87
107
  ...s,
88
108
  view
89
- }), "replace");
109
+ }), history);
90
110
  },
91
111
  open: (selection) => {
92
112
  at((s) => deeper(s, selection), "push");
@@ -105,7 +125,8 @@ function movesOf(state, move) {
105
125
  /** One step up; at the first step, Back closes the drill. */
106
126
  back: () => {
107
127
  const steps = state?.path.length ?? 0;
108
- if (steps > 1) at((s) => upTo(s, steps - 1), "push");
128
+ if (showsFields(state)) at((s) => itemFields(s, false), "push");
129
+ else if (steps > 1) at((s) => upTo(s, steps - 1), "push");
109
130
  else move(void 0, "push");
110
131
  },
111
132
  close: () => {
@@ -130,17 +151,16 @@ function useDrill({ state, onStateChange }) {
130
151
  const { client, cacheScope } = useDashboards();
131
152
  const known = useRef(/* @__PURE__ */ new Map());
132
153
  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));
154
+ const { asked, read, key } = useAnswer({
155
+ scope: cacheScope,
156
+ state,
157
+ ask,
158
+ onChange: onStateChange
159
+ });
139
160
  const { answer, updating } = useSteady(state, asked.data);
140
- useNormalized(cacheScope, state, asked.data, onStateChange);
141
161
  const shown = answer?.view;
142
162
  const itemsView = shown?.by === "items" ? shown : void 0;
143
- const pages = useMorePages(`${cacheScope}|${key?.[2] ?? ""}`, state, itemsView, ask);
163
+ const pages = useMorePages(`${cacheScope}|${key?.[2] ?? ""}`, read, itemsView, ask);
144
164
  return {
145
165
  state,
146
166
  answer,
@@ -1,4 +1,9 @@
1
1
  import { DrillReason } from "derive-dashboards/core";
2
+ export declare const RECORD_PAGES: {
3
+ previous: string;
4
+ next: string;
5
+ range: (first: string, last: string, loaded: string, total?: string) => string;
6
+ };
2
7
  /** Every word the drill panel shows; `ENGLISH_DRILL` holds the defaults. */
3
8
  export type DrillMessages = {
4
9
  /** The panel's name, over the path. */
@@ -13,6 +18,8 @@ export type DrillMessages = {
13
18
  drillRows: (count: string) => string;
14
19
  /** "396 tasks with Hours (57 without)": a value that counts only rows with its field set. */
15
20
  drillWith: (rows: string, operand: string, without: string | undefined) => string;
21
+ /** A metric denominator identified by its own name. */
22
+ drillMetricTotal?: (metric: string) => string;
16
23
  /** "42% of the total" for a first step, "39% of Open" deeper. */
17
24
  drillShare: (percent: string, of: string | undefined) => string;
18
25
  /** The value now differs from the one the chart was drawn with (same viewer only). */
@@ -29,6 +36,11 @@ export type DrillMessages = {
29
36
  drillHint: string;
30
37
  /** A Breakdown's field picker. */
31
38
  drillBy: string;
39
+ /** Accessible action name on a table group that opens a comparison. */
40
+ drillCompareGroup?: (group: string) => string;
41
+ /** Heading under the selected group, for example "Grouped by Coupon". */
42
+ drillGroupedBy?: (field: string) => string;
43
+ drillRecordPages?: typeof RECORD_PAGES;
32
44
  /** "Showing 12 of 36", or "Showing 12" when the total is not known. */
33
45
  drillShowing: (shown: number, total?: string) => string;
34
46
  drillSort: Record<"records" | "value" | "count", string>;
@@ -90,6 +102,8 @@ export type DrillMessages = {
90
102
  drillPercentile: (p: number, value: string) => string;
91
103
  /** Over time: the range drawn and its grain picker. */
92
104
  drillRange: (from: string, to: string) => string;
105
+ /** Distinguishes a bounded trend from an all-time headline. */
106
+ drillTrendWindow?: (period: string) => string;
93
107
  drillGrains: Record<"hour" | "day" | "week" | "month" | "quarter" | "year", string>;
94
108
  /** Why a view cannot show, by its code. */
95
109
  drillReasons: Record<DrillReason, string>;
@@ -1,26 +1,37 @@
1
1
  import { DRILL_REASONS } from "derive-dashboards/core";
2
2
  // src/drill/words.ts
3
+ const RECORD_PAGES = {
4
+ previous: "Previous page",
5
+ next: "Next page",
6
+ range: (first, last, loaded, total) => `Rows ${first}–${last} · ${total === void 0 ? loaded : `${loaded} of ${total}`} loaded`
7
+ };
3
8
  const capital = (text) => text.charAt(0).toUpperCase() + text.slice(1);
9
+ const compareGroupLabel = (group) => `${group} · Compare groups`;
10
+ const trendWindowLabel = (period) => `Chart covers ${period}. The total above covers all dates.`;
4
11
  const ENGLISH_DRILL = {
5
12
  drillTitle: "Analysis",
6
13
  drillViews: {
7
14
  breakdown: "Breakdown",
8
15
  trend: "Over time",
9
- items: "Items",
16
+ items: "Records",
10
17
  explanation: "Explanation"
11
18
  },
12
19
  drillBack: "Back",
13
20
  drillRoot: (title) => title,
14
21
  drillRows: (count) => `${count} rows`,
15
22
  drillWith: (rows, operand, without) => `${rows} with ${operand}${without === void 0 ? "" : ` (${without} without)`}`,
16
- drillShare: (percent, of) => `${percent} of ${of ?? "the total"}`,
23
+ drillMetricTotal: (metric) => `the total for “${metric}”`,
24
+ drillShare: (percent, of) => `${percent} of ${of ?? "the tile total"}`,
17
25
  drillMoved: (now, then) => `${now} now, ${then} when the chart loaded`,
18
26
  drillRefresh: "Refresh",
19
27
  drillYours: (noun) => `Counts include only ${noun} you can see.`,
20
28
  drillOmitted: "Part of this link was left out.",
21
29
  drillEarlier: (range) => `The period before · ${range}`,
22
- drillHint: "Click to see what is behind it",
30
+ drillHint: "Open details",
23
31
  drillBy: "Break down by",
32
+ drillCompareGroup: compareGroupLabel,
33
+ drillGroupedBy: (field) => `Grouped by ${field}`,
34
+ drillRecordPages: RECORD_PAGES,
24
35
  drillShowing: (shown, total) => total === void 0 ? `Showing ${String(shown)}` : `Showing ${String(shown)} of ${total}`,
25
36
  drillSort: {
26
37
  records: "in record order",
@@ -28,9 +39,9 @@ const ENGLISH_DRILL = {
28
39
  count: "most rows first"
29
40
  },
30
41
  drillSorted: (field, dir, time) => time ? dir === "desc" ? "newest first" : "oldest first" : `by ${field}`,
31
- drillList: "List",
32
- drillTable: "Table",
33
- drillNoItems: "No items match.",
42
+ drillList: "Summary",
43
+ drillTable: "All fields",
44
+ drillNoItems: "No matching records.",
34
45
  drillNoGroups: "Nothing to show here.",
35
46
  drillNoMatch: "No values match the search.",
36
47
  drillFailed: "Couldn't load.",
@@ -63,6 +74,7 @@ const ENGLISH_DRILL = {
63
74
  drillYes: "Yes",
64
75
  drillNo: "No",
65
76
  drillPercentile: (p, value) => `${String(p)}% are at or below ${value}`,
77
+ drillTrendWindow: trendWindowLabel,
66
78
  drillRange: (from, to) => `${from} to ${to}`,
67
79
  drillGrains: {
68
80
  hour: "Hour",
@@ -74,6 +86,6 @@ const ENGLISH_DRILL = {
74
86
  },
75
87
  drillReasons: { ...DRILL_REASONS },
76
88
  drillOpenInBuilder: "Open in builder",
77
- drillSee: (count) => `See ${count}`
89
+ drillSee: () => "View details"
78
90
  };
79
- export { ENGLISH_DRILL };
91
+ export { ENGLISH_DRILL, RECORD_PAGES, compareGroupLabel, trendWindowLabel };
@@ -1,3 +1,6 @@
1
1
  import { Messages } from "./messages.mjs";
2
2
  /** Every word the built-in components show, in English: the default `messages`. */
3
- export declare const ENGLISH: Messages;
3
+ export declare const ENGLISH: Messages & {
4
+ chartTooSmall: string;
5
+ chartPartial: string;
6
+ };
@@ -3,6 +3,15 @@ import { ENGLISH_DRILL } from "./drill/words.mjs";
3
3
  import { relativeLabel } from "./filters/days.mjs";
4
4
  import { ENGLISH_REVIEW } from "./review-words.mjs";
5
5
  // src/english.ts
6
+ /** What each kind of chart is called, with its article, in a chart's table caption. */
7
+ const CHART_NAMES = {
8
+ line: "a line chart",
9
+ bar: "a bar chart",
10
+ area: "an area chart",
11
+ multiples: "a set of small charts",
12
+ heatmap: "a heat grid",
13
+ funnel: "a funnel"
14
+ };
6
15
  /** Every word the built-in components show, in English: the default `messages`. */
7
16
  const ENGLISH = {
8
17
  ...ENGLISH_REVIEW,
@@ -19,6 +28,7 @@ const ENGLISH = {
19
28
  noData: "No data for this range",
20
29
  noRows: "No rows",
21
30
  soFar: "so far",
31
+ chartPartial: "part of the period",
22
32
  dashboardFailed: "This dashboard could not be loaded.",
23
33
  dashboardUnreachable: "Can't reach the server. Showing what was last loaded; it updates when the connection is back.",
24
34
  dashboardMissing: "This dashboard isn't here. It may not be published yet, or it was removed.",
@@ -63,7 +73,11 @@ const ENGLISH = {
63
73
  line: "Line",
64
74
  bar: "Bar",
65
75
  table: "Table",
66
- list: "List"
76
+ list: "List",
77
+ area: "Area",
78
+ multiples: "Small charts",
79
+ heatmap: "Heat grid",
80
+ funnel: "Funnel"
67
81
  },
68
82
  topValues: (n) => `top ${n}`,
69
83
  keepTop: "Keep the top",
@@ -109,7 +123,8 @@ const ENGLISH = {
109
123
  removedCalcs: (names) => `Removed ${names.join(", ")}: a change compares the whole range with the one before, so it needs no breakdown and a comparison.`,
110
124
  noMainQuery: (title) => `${title} has no main query, so the builder cannot edit it. Change it where it was made (in code, or by its plugin).`,
111
125
  notDrawn: (labels) => `Not drawn here: ${labels.join(", ")}. Show it as a table to see ${labels.length === 1 ? "it" : "them"}.`,
112
- chartTable: ({ title, kind, points }) => `${title}, a ${kind} chart of ${String(points)} ${points === 1 ? "point" : "points"}`,
126
+ chartTooSmall: "Enlarge the tile to see the chart.",
127
+ chartTable: ({ title, kind, points }) => `${title}, ${CHART_NAMES[kind]} of ${String(points)} ${points === 1 ? "point" : "points"}`,
113
128
  chartPoints: "Points to open (arrow keys move between them)",
114
129
  keptAside: ({ display, queries, fields }) => {
115
130
  return `Kept as they are: ${[
@@ -6,7 +6,7 @@ import { OperatorMenu } from "./operator.mjs";
6
6
  import { Popover } from "./popover.mjs";
7
7
  import { ValueList, ValuesSummary } from "./values.mjs";
8
8
  import { useRef } from "react";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  // src/filters/chip.tsx
11
11
  /** A control's icon from the host, if any. */
12
12
  function Icon({ control }) {
@@ -57,7 +57,7 @@ function ChipValue({ control, said }) {
57
57
  control,
58
58
  values: chosenOf(pick)
59
59
  });
60
- return /* @__PURE__ */ jsx(Fragment, { children: said ?? words.widgetDates });
60
+ return /* @__PURE__ */ jsx(Fragment$1, { children: said ?? words.widgetDates });
61
61
  }
62
62
  function FieldSegment({ control, open, toggle }) {
63
63
  const words = useWords();
@@ -6,7 +6,7 @@ import { isNumber } from "./logic.mjs";
6
6
  import { matchingFields, suggest, suggestionPick } from "./suggest.mjs";
7
7
  import { Mark } from "./values.mjs";
8
8
  import { useCallback, useEffect, useState } from "react";
9
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
9
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
10
10
  // src/filters/menu-search.tsx
11
11
  /** Reads one control's values into the menu's suggestions. One per control, so hooks stay fixed. */
12
12
  function Collect({ control, query, onValues }) {
@@ -85,7 +85,7 @@ function SuggestionRow({ s }) {
85
85
  const words = useWords();
86
86
  const format = useFormat();
87
87
  const rangeText = useRangeText();
88
- return /* @__PURE__ */ jsxs(Fragment, { children: [
88
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
89
89
  /* @__PURE__ */ jsx(Icon, { control: s.control }),
90
90
  /* @__PURE__ */ jsx("span", {
91
91
  className: "dd-fb-quiet",
@@ -94,7 +94,7 @@ function SuggestionRow({ s }) {
94
94
  s.kind === "date" ? /* @__PURE__ */ jsx("span", {
95
95
  className: "dd-fb-option-text",
96
96
  children: rangeText(s.range)
97
- }) : /* @__PURE__ */ jsxs(Fragment, { children: [
97
+ }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
98
98
  /* @__PURE__ */ jsx("span", {
99
99
  className: "dd-fb-quiet",
100
100
  children: s.negative ? words.isNotWord : words.isWord
@@ -112,7 +112,7 @@ function SuggestionRow({ s }) {
112
112
  }
113
113
  function FieldRow({ control }) {
114
114
  const said = useSummary()(control);
115
- return /* @__PURE__ */ jsxs(Fragment, { children: [
115
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
116
116
  /* @__PURE__ */ jsx(Icon, { control }),
117
117
  /* @__PURE__ */ jsx("span", {
118
118
  className: "dd-fb-option-text",
@@ -190,7 +190,7 @@ function MenuSearch({ controls, steps }) {
190
190
  const { known, failed, onValues } = useKnown();
191
191
  const searched = useDebounced(query, 150);
192
192
  const options = useMenuOptions(controls, query, known, steps);
193
- return /* @__PURE__ */ jsxs(Fragment, { children: [
193
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
194
194
  /* @__PURE__ */ jsx(Collectors, {
195
195
  controls,
196
196
  query: searched,
@@ -3,7 +3,7 @@ import { FieldStep } from "./field-step.mjs";
3
3
  import { MenuSearch } from "./menu-search.mjs";
4
4
  import { Popover } from "./popover.mjs";
5
5
  import { useRef, useState } from "react";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  // src/filters/menu.tsx
8
8
  const focusStep = (node) => {
9
9
  node?.querySelector("input, button:not(.dd-fb-back)")?.focus({ preventScroll: true });
@@ -56,7 +56,7 @@ function FilterMenu({ controls, open, setOpen, openChip, hidden }) {
56
56
  close,
57
57
  openChip
58
58
  };
59
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(MenuButton, {
59
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MenuButton, {
60
60
  anchor,
61
61
  open,
62
62
  hidden,
@@ -1,7 +1,7 @@
1
1
  import { useBar, useWords } from "./context.mjs";
2
2
  import { numberBounds, numberDraft, numberPresets, numberSides, unitText } from "./numbers.mjs";
3
3
  import { useId, useState } from "react";
4
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
4
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/filters/number.tsx
6
6
  function QuickPicks({ edges, unit, ops, pick, onPick }) {
7
7
  const words = useWords();
@@ -68,7 +68,7 @@ function Bounds({ name, unit, ops, current, bounds, setBounds, apply, problemId
68
68
  /** What is wrong with the typed bounds, if anything, and Apply. */
69
69
  function NumberFoot({ problem, errorId, apply }) {
70
70
  const words = useWords();
71
- return /* @__PURE__ */ jsxs(Fragment, { children: [problem === void 0 ? null : /* @__PURE__ */ jsx("p", {
71
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [problem === void 0 ? null : /* @__PURE__ */ jsx("p", {
72
72
  id: errorId,
73
73
  role: "alert",
74
74
  className: "dd-fb-error",
@@ -2,7 +2,7 @@ import { useOpText, useWords } from "./context.mjs";
2
2
  import { canFlip, isNegative } from "./logic.mjs";
3
3
  import { Popover } from "./popover.mjs";
4
4
  import { useRef, useState } from "react";
5
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
  // src/filters/operator.tsx
7
7
  const CHOICES = [false, true];
8
8
  /** Arrow keys, Home and End move between a menu's items, as the ARIA menu pattern asks. */
@@ -54,7 +54,7 @@ function OperatorMenu({ control, pick, onChange }) {
54
54
  className: "dd-fb-seg dd-fb-op",
55
55
  children: opText(pick)
56
56
  });
57
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("button", {
57
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("button", {
58
58
  ref: button,
59
59
  type: "button",
60
60
  className: "dd-fb-seg dd-fb-op",
@@ -5,7 +5,7 @@ import { Sheet } from "./sheet.mjs";
5
5
  import { useShortcuts } from "./state.mjs";
6
6
  import { ValuesSummary } from "./values.mjs";
7
7
  import { useState } from "react";
8
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  // src/filters/phone.tsx
10
10
  /** A date range or a number filter's pick, said short. */
11
11
  function PickText({ control }) {
@@ -86,7 +86,7 @@ function PhoneBar({ controls, removeLast, onReset }) {
86
86
  useShortcuts(() => {
87
87
  open(null);
88
88
  }, removeLast);
89
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(PhoneRow, {
89
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(PhoneRow, {
90
90
  inUse: controls.filter((c) => picks[c.id] !== void 0),
91
91
  sheetOpen: sheet,
92
92
  onOpen: open
@@ -3,13 +3,13 @@ import { useControlValues, useDebounced } from "./hooks.mjs";
3
3
  import { Combobox } from "./listbox.mjs";
4
4
  import { chosenOf, isNegative, offersNone, takesMany } from "./logic.mjs";
5
5
  import { useMemo, useState } from "react";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
  // src/filters/values.tsx
8
8
  /** What sits before a value: the host's mark, else a dot in the value's tone from the model. */
9
9
  function Mark({ control, value }) {
10
10
  const { fields, options } = useBar();
11
11
  const own = options.renderMark?.(control, value);
12
- if (own !== void 0) return /* @__PURE__ */ jsx(Fragment, { children: own });
12
+ if (own !== void 0) return /* @__PURE__ */ jsx(Fragment$1, { children: own });
13
13
  const tones = fields[control.id]?.tones;
14
14
  if (tones === void 0 || value === null) return null;
15
15
  return /* @__PURE__ */ jsx("span", {
@@ -23,7 +23,7 @@ function ValuesSummary({ control, values }) {
23
23
  const format = useFormat();
24
24
  const [first] = values;
25
25
  if (first === void 0) return null;
26
- return /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
27
27
  /* @__PURE__ */ jsx("span", {
28
28
  className: "dd-fb-marks",
29
29
  children: values.slice(0, 3).map((v) => /* @__PURE__ */ jsx(Mark, {
@@ -110,7 +110,7 @@ function ValuesFailed({ retry }) {
110
110
  }
111
111
  function ValueRow({ control, value }) {
112
112
  const format = useFormat();
113
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Mark, {
113
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Mark, {
114
114
  control,
115
115
  value
116
116
  }), /* @__PURE__ */ jsx("span", {
@@ -1,10 +1,11 @@
1
+ import "./messages.mjs";
1
2
  import { Grain } from "derive-dashboards/core";
2
3
  /**
3
4
  * A time bucket's label for a person: "Nov 2" for a day or week, "Jun 2026" for a month or
4
5
  * the month a (possibly fiscal) quarter starts. The label names a calendar date, so it is formatted as that date,
5
6
  * not as an instant in any zone. Hour labels stay as sent.
6
7
  */
7
- export declare function formatBucket(label: string, grain: Grain, locale?: string): string;
8
+ export declare function formatBucket(label: string, grain: Grain, locale?: string, withYear?: boolean): string;
8
9
  /** An instant (text time to the microsecond) as a date and time, in a zone (the dashboard's) or the viewer's own. */
9
10
  export declare function formatInstant(text: string, locale?: string, timeZone?: string): string;
10
11
  /**