derive-dashboards 0.7.1 → 0.9.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 (591) hide show
  1. package/CHANGELOG.md +513 -0
  2. package/README.md +8 -2
  3. package/dist/adapter/statement.mjs +9 -7
  4. package/dist/authorize.mjs +27 -6
  5. package/dist/body.mjs +28 -25
  6. package/dist/cache.d.mts +2 -2
  7. package/dist/charts/data/buckets.d.mts +25 -7
  8. package/dist/charts/data/buckets.mjs +92 -15
  9. package/dist/charts/data/clean.mjs +254 -12
  10. package/dist/charts/data/format.d.mts +7 -2
  11. package/dist/charts/data/format.mjs +68 -70
  12. package/dist/charts/data/input-error.d.mts +2 -0
  13. package/dist/charts/data/input-error.mjs +2 -0
  14. package/dist/charts/data/rows.d.mts +3 -1
  15. package/dist/charts/data/rows.mjs +4 -2
  16. package/dist/charts/data/types.d.mts +50 -7
  17. package/dist/charts/data/words.d.mts +13 -0
  18. package/dist/charts/data/words.mjs +8 -1
  19. package/dist/charts/describe.mjs +6 -6
  20. package/dist/charts/index.d.mts +14 -14
  21. package/dist/charts/index.mjs +4 -1
  22. package/dist/charts/kinds/area-marks.mjs +86 -44
  23. package/dist/charts/kinds/area.d.mts +3 -3
  24. package/dist/charts/kinds/area.mjs +32 -11
  25. package/dist/charts/kinds/bars-data.d.mts +3 -3
  26. package/dist/charts/kinds/bars-data.mjs +12 -6
  27. package/dist/charts/kinds/bars-layout.mjs +60 -6
  28. package/dist/charts/kinds/bars-marks.mjs +6 -6
  29. package/dist/charts/kinds/bars.d.mts +5 -3
  30. package/dist/charts/kinds/bars.mjs +39 -6
  31. package/dist/charts/kinds/columns-data.mjs +14 -5
  32. package/dist/charts/kinds/columns-marks.mjs +52 -23
  33. package/dist/charts/kinds/columns.d.mts +2 -2
  34. package/dist/charts/kinds/columns.mjs +36 -10
  35. package/dist/charts/kinds/course-data.mjs +44 -0
  36. package/dist/charts/kinds/course-layout.mjs +77 -0
  37. package/dist/charts/kinds/course-marks.mjs +52 -0
  38. package/dist/charts/kinds/course-words.mjs +64 -0
  39. package/dist/charts/kinds/course.d.mts +10 -0
  40. package/dist/charts/kinds/course.mjs +55 -0
  41. package/dist/charts/kinds/dumbbell-data.d.mts +4 -4
  42. package/dist/charts/kinds/dumbbell-data.mjs +3 -3
  43. package/dist/charts/kinds/dumbbell-layout.mjs +17 -8
  44. package/dist/charts/kinds/dumbbell.d.mts +5 -3
  45. package/dist/charts/kinds/dumbbell.mjs +35 -4
  46. package/dist/charts/kinds/funnel-data.d.mts +3 -3
  47. package/dist/charts/kinds/funnel-data.mjs +11 -16
  48. package/dist/charts/kinds/funnel-layout.mjs +7 -6
  49. package/dist/charts/kinds/funnel.d.mts +5 -4
  50. package/dist/charts/kinds/funnel.mjs +33 -6
  51. package/dist/charts/kinds/grid-data.d.mts +3 -3
  52. package/dist/charts/kinds/grid-data.mjs +55 -13
  53. package/dist/charts/kinds/grid-layout.mjs +88 -13
  54. package/dist/charts/kinds/grid-legend.mjs +60 -0
  55. package/dist/charts/kinds/grid-marks.mjs +81 -32
  56. package/dist/charts/kinds/grid-time.mjs +19 -5
  57. package/dist/charts/kinds/grid-words.mjs +57 -35
  58. package/dist/charts/kinds/grid.d.mts +7 -4
  59. package/dist/charts/kinds/grid.mjs +51 -9
  60. package/dist/charts/kinds/histogram-data.mjs +68 -26
  61. package/dist/charts/kinds/histogram-layout.mjs +4 -3
  62. package/dist/charts/kinds/histogram-words.mjs +2 -3
  63. package/dist/charts/kinds/histogram.d.mts +2 -2
  64. package/dist/charts/kinds/histogram.mjs +17 -1
  65. package/dist/charts/kinds/line-marks.mjs +19 -11
  66. package/dist/charts/kinds/line.d.mts +2 -2
  67. package/dist/charts/kinds/line.mjs +21 -3
  68. package/dist/charts/kinds/multiples-grid.mjs +57 -27
  69. package/dist/charts/kinds/multiples-head.mjs +52 -22
  70. package/dist/charts/kinds/multiples-layout.mjs +106 -52
  71. package/dist/charts/kinds/multiples-marks.mjs +6 -5
  72. package/dist/charts/kinds/multiples-words.mjs +53 -38
  73. package/dist/charts/kinds/multiples.d.mts +2 -2
  74. package/dist/charts/kinds/multiples.mjs +35 -7
  75. package/dist/charts/kinds/row-chart.d.mts +7 -0
  76. package/dist/charts/kinds/row-chart.mjs +47 -10
  77. package/dist/charts/kinds/row-marks.mjs +5 -5
  78. package/dist/charts/kinds/scatter-data.d.mts +5 -5
  79. package/dist/charts/kinds/scatter-data.mjs +6 -6
  80. package/dist/charts/kinds/scatter-marks.mjs +46 -19
  81. package/dist/charts/kinds/scatter-words.mjs +8 -8
  82. package/dist/charts/kinds/scatter.d.mts +5 -3
  83. package/dist/charts/kinds/scatter.mjs +18 -0
  84. package/dist/charts/kinds/stat-data.mjs +7 -7
  85. package/dist/charts/kinds/stat-marks.mjs +2 -2
  86. package/dist/charts/kinds/stat.d.mts +4 -4
  87. package/dist/charts/kinds/stat.mjs +19 -0
  88. package/dist/charts/kinds/time-chart.mjs +13 -4
  89. package/dist/charts/kinds/time-frame.mjs +50 -19
  90. package/dist/charts/kinds/time-plan.mjs +29 -2
  91. package/dist/charts/kinds/time-plot.mjs +1 -1
  92. package/dist/charts/kinds/time-stops.mjs +58 -29
  93. package/dist/charts/kinds/waterfall-data.d.mts +3 -3
  94. package/dist/charts/kinds/waterfall-data.mjs +2 -2
  95. package/dist/charts/kinds/waterfall.d.mts +5 -4
  96. package/dist/charts/kinds/waterfall.mjs +29 -2
  97. package/dist/charts/layout/frame.mjs +5 -3
  98. package/dist/charts/layout/stack.mjs +43 -22
  99. package/dist/charts/marks/axes.mjs +12 -6
  100. package/dist/charts/marks/budget.mjs +14 -0
  101. package/dist/charts/marks/end-labels.mjs +24 -10
  102. package/dist/charts/marks/legend.mjs +19 -8
  103. package/dist/charts/marks/lines.mjs +3 -3
  104. package/dist/charts/marks/more.mjs +79 -13
  105. package/dist/charts/marks/notes.mjs +12 -6
  106. package/dist/charts/marks/series-line.mjs +14 -10
  107. package/dist/charts/marks/thin.mjs +16 -33
  108. package/dist/charts/marks/x-axis.mjs +3 -2
  109. package/dist/charts/scale/calendar.mjs +41 -26
  110. package/dist/charts/scale/linear.mjs +58 -0
  111. package/dist/charts/scale/value.d.mts +21 -0
  112. package/dist/charts/scale/value.mjs +67 -9
  113. package/dist/charts/scene/lazy.mjs +27 -0
  114. package/dist/charts/scene/markup.mjs +2 -1
  115. package/dist/charts/scene/svg.mjs +20 -8
  116. package/dist/charts/scene/types.d.mts +34 -0
  117. package/dist/charts/text/measure.mjs +33 -3
  118. package/dist/charts/theme.d.mts +25 -25
  119. package/dist/charts/theme.mjs +47 -30
  120. package/dist/charts-react/Chart.d.mts +20 -0
  121. package/dist/charts-react/Chart.mjs +9 -67
  122. package/dist/charts-react/Reader.mjs +50 -96
  123. package/dist/charts-react/box.mjs +106 -0
  124. package/dist/charts-react/bucket-names.mjs +9 -24
  125. package/dist/charts-react/columns-picture.mjs +12 -0
  126. package/dist/charts-react/exact-sum.mjs +4 -7
  127. package/dist/charts-react/from-answer.mjs +9 -4
  128. package/dist/charts-react/index.d.mts +9 -2
  129. package/dist/charts-react/index.mjs +9 -2
  130. package/dist/charts-react/kinds/area.d.mts +4 -0
  131. package/dist/charts-react/kinds/area.mjs +38 -0
  132. package/dist/charts-react/kinds/bar.d.mts +4 -0
  133. package/dist/charts-react/kinds/bar.mjs +15 -0
  134. package/dist/charts-react/kinds/funnel.d.mts +4 -0
  135. package/dist/charts-react/kinds/funnel.mjs +13 -0
  136. package/dist/charts-react/kinds/heatmap.d.mts +4 -0
  137. package/dist/charts-react/kinds/heatmap.mjs +13 -0
  138. package/dist/charts-react/kinds/line.d.mts +4 -0
  139. package/dist/charts-react/kinds/line.mjs +20 -0
  140. package/dist/charts-react/kinds/multiples.d.mts +4 -0
  141. package/dist/charts-react/kinds/multiples.mjs +33 -0
  142. package/dist/charts-react/kinds/number.d.mts +5 -0
  143. package/dist/charts-react/kinds/number.mjs +86 -0
  144. package/dist/charts-react/plan-bars.mjs +15 -8
  145. package/dist/charts-react/plan-funnel.mjs +3 -1
  146. package/dist/charts-react/plan-grid.mjs +14 -5
  147. package/dist/charts-react/plan-of.mjs +17 -0
  148. package/dist/charts-react/plan-parts.mjs +16 -5
  149. package/dist/charts-react/plan-time.mjs +4 -53
  150. package/dist/charts-react/reader-page.d.mts +1 -1
  151. package/dist/charts-react/reader-page.mjs +19 -9
  152. package/dist/charts-react/renderers.d.mts +14 -0
  153. package/dist/charts-react/renderers.mjs +22 -0
  154. package/dist/charts-react/table.d.mts +1 -0
  155. package/dist/charts-react/table.mjs +108 -0
  156. package/dist/charts-react/tiles.mjs +21 -49
  157. package/dist/charts-react/useScene.mjs +45 -17
  158. package/dist/charts-react/words.mjs +19 -0
  159. package/dist/checks.mjs +97 -19
  160. package/dist/cli/add.mjs +4 -3
  161. package/dist/cli/doctor.mjs +2 -2
  162. package/dist/core/conformance/index.d.mts +5 -2
  163. package/dist/core/conformance/index.mjs +5 -2
  164. package/dist/core/conformance/memory/aggregate.mjs +11 -6
  165. package/dist/core/conformance/memory/rows.d.mts +7 -3
  166. package/dist/core/conformance/memory/rows.mjs +19 -13
  167. package/dist/core/conformance/memory/source.mjs +4 -4
  168. package/dist/core/document/control-fields.d.mts +20 -0
  169. package/dist/core/document/control-fields.mjs +117 -0
  170. package/dist/core/document/display-comparisons.d.mts +17 -0
  171. package/dist/core/document/display-comparisons.mjs +15 -4
  172. package/dist/core/document/display-entries.d.mts +14 -0
  173. package/dist/core/document/display-entries.mjs +25 -9
  174. package/dist/core/document/display-validation.d.mts +5 -1
  175. package/dist/core/document/display-validation.mjs +14 -7
  176. package/dist/core/document/display.d.mts +11 -8
  177. package/dist/core/document/display.mjs +26 -3
  178. package/dist/core/document/layout.d.mts +8 -9
  179. package/dist/core/document/layout.mjs +23 -6
  180. package/dist/core/document/stacked.d.mts +0 -7
  181. package/dist/core/document/types.mjs +8 -6
  182. package/dist/core/document/upgrade.d.mts +1 -0
  183. package/dist/core/document/upgrade.mjs +4 -2
  184. package/dist/core/engine/access.mjs +3 -3
  185. package/dist/core/engine/assert.mjs +4 -2
  186. package/dist/core/engine/bucket.mjs +2 -2
  187. package/dist/core/engine/checks.mjs +6 -7
  188. package/dist/core/engine/custom/ask.mjs +22 -2
  189. package/dist/core/engine/custom/cells.mjs +22 -22
  190. package/dist/core/engine/custom/level.mjs +12 -13
  191. package/dist/core/engine/custom/measures.mjs +12 -9
  192. package/dist/core/engine/custom/reader.mjs +3 -1
  193. package/dist/core/engine/custom/records.mjs +8 -7
  194. package/dist/core/engine/custom/unread.mjs +78 -0
  195. package/dist/core/engine/custom/where.mjs +15 -10
  196. package/dist/core/engine/index.d.mts +2 -13
  197. package/dist/core/engine/index.mjs +2 -12
  198. package/dist/core/engine/measure.mjs +1 -0
  199. package/dist/core/engine/members.mjs +7 -3
  200. package/dist/core/engine/nan.mjs +10 -1
  201. package/dist/core/engine/native.mjs +2 -20
  202. package/dist/core/engine/numbers.mjs +26 -14
  203. package/dist/core/engine/postgres.mjs +9 -5
  204. package/dist/core/engine/prepare.mjs +4 -4
  205. package/dist/core/engine/rank-sets.mjs +1 -1
  206. package/dist/core/engine/read.mjs +5 -4
  207. package/dist/core/engine/reader.d.mts +6 -0
  208. package/dist/core/engine/record-layout.mjs +3 -3
  209. package/dist/core/engine/run.mjs +77 -20
  210. package/dist/core/engine/segmented.d.mts +2 -1
  211. package/dist/core/engine/segmented.mjs +19 -12
  212. package/dist/core/engine/series.mjs +1 -1
  213. package/dist/core/engine/shape.mjs +8 -8
  214. package/dist/core/engine/sql-partition.mjs +2 -2
  215. package/dist/core/engine/sql-pass.mjs +3 -2
  216. package/dist/core/engine/sql-reader.mjs +13 -5
  217. package/dist/core/engine/sql-reads.mjs +2 -1
  218. package/dist/core/engine/sql-records.mjs +2 -2
  219. package/dist/core/engine/sql-split.mjs +1 -1
  220. package/dist/core/engine/sql-unread.mjs +70 -0
  221. package/dist/core/engine/time.mjs +2 -1
  222. package/dist/core/engine/types.d.mts +17 -0
  223. package/dist/core/engine/version.d.mts +1 -1
  224. package/dist/core/engine/version.mjs +1 -1
  225. package/dist/core/error/codes.d.mts +24 -1
  226. package/dist/core/error/codes.mjs +23 -3
  227. package/dist/core/error/refusal.d.mts +8 -3
  228. package/dist/core/error/refusal.mjs +6 -1
  229. package/dist/core/exact/decimal.d.mts +1 -14
  230. package/dist/core/exact/decimal.mjs +9 -19
  231. package/dist/core/exact/stored.d.mts +9 -0
  232. package/dist/core/exact/stored.mjs +38 -0
  233. package/dist/core/exact/text.d.mts +16 -1
  234. package/dist/core/exact/text.mjs +50 -1
  235. package/dist/core/format/digits.mjs +55 -0
  236. package/dist/core/format/index.d.mts +16 -0
  237. package/dist/core/format/index.mjs +27 -0
  238. package/dist/core/format/number.d.mts +27 -0
  239. package/dist/core/format/number.mjs +158 -0
  240. package/dist/core/format/write.d.mts +6 -0
  241. package/dist/core/format/write.mjs +57 -0
  242. package/dist/core/index.d.mts +43 -33
  243. package/dist/core/index.mjs +31 -28
  244. package/dist/core/model/defaults.d.mts +18 -1
  245. package/dist/core/model/defaults.mjs +19 -1
  246. package/dist/core/model/define.d.mts +17 -8
  247. package/dist/core/model/define.mjs +2 -0
  248. package/dist/core/model/member.d.mts +5 -3
  249. package/dist/core/model/member.mjs +33 -6
  250. package/dist/core/model/storage.mjs +40 -12
  251. package/dist/core/model/types.d.mts +17 -1
  252. package/dist/core/model/types.mjs +5 -0
  253. package/dist/core/model/validate/expr.d.mts +1 -7
  254. package/dist/core/model/validate/fields.d.mts +2 -0
  255. package/dist/core/model/validate/fields.mjs +14 -7
  256. package/dist/core/model/validate/issues.mjs +5 -1
  257. package/dist/core/model/validate/known-members.mjs +6 -5
  258. package/dist/core/model/validate/shape.mjs +36 -3
  259. package/dist/core/model/validate/source.mjs +2 -2
  260. package/dist/core/oracle/data.d.mts +4 -2
  261. package/dist/core/oracle/evaluate.d.mts +19 -1
  262. package/dist/core/oracle/evaluate.mjs +56 -10
  263. package/dist/core/oracle/expr.mjs +1 -1
  264. package/dist/core/oracle/facts.mjs +12 -5
  265. package/dist/core/oracle/measure.mjs +1 -1
  266. package/dist/core/oracle/request.mjs +39 -4
  267. package/dist/core/oracle/segmented.d.mts +3 -1
  268. package/dist/core/oracle/segmented.mjs +19 -13
  269. package/dist/core/oracle/unread.mjs +32 -0
  270. package/dist/core/oracle/visibility.mjs +4 -3
  271. package/dist/core/policy/bind.d.mts +2 -11
  272. package/dist/core/policy/bind.mjs +1 -1
  273. package/dist/core/policy/match.mjs +1 -1
  274. package/dist/core/query/closure.d.mts +7 -2
  275. package/dist/core/query/closure.mjs +29 -12
  276. package/dist/core/query/compose-tile.d.mts +3 -2
  277. package/dist/core/query/compose-tile.mjs +32 -13
  278. package/dist/core/query/compose.d.mts +0 -5
  279. package/dist/core/query/drill/internal.d.mts +5 -5
  280. package/dist/core/query/drill/internal.mjs +11 -0
  281. package/dist/core/query/drill/links.d.mts +2 -3
  282. package/dist/core/query/drill/links.mjs +18 -4
  283. package/dist/core/query/drill/selection.d.mts +8 -2
  284. package/dist/core/query/drill/selection.mjs +14 -3
  285. package/dist/core/query/drill/synthetic.mjs +1 -1
  286. package/dist/core/query/drill/time.mjs +11 -10
  287. package/dist/core/query/filter.d.mts +1 -6
  288. package/dist/core/query/filter.mjs +1 -4
  289. package/dist/core/query/fold.mjs +23 -0
  290. package/dist/core/query/segments.mjs +42 -3
  291. package/dist/core/query/to-wire.d.mts +7 -0
  292. package/dist/core/query/to-wire.mjs +14 -2
  293. package/dist/core/query/types.d.mts +30 -13
  294. package/dist/core/result/columns.mjs +23 -13
  295. package/dist/core/result/number.mjs +3 -3
  296. package/dist/core/result/status.d.mts +13 -0
  297. package/dist/core/result/status.mjs +18 -0
  298. package/dist/core/result/time-axis.d.mts +14 -13
  299. package/dist/core/result/time-axis.mjs +20 -2
  300. package/dist/core/result/types.d.mts +33 -3
  301. package/dist/core/result/whole.d.mts +23 -0
  302. package/dist/core/result/whole.mjs +27 -0
  303. package/dist/core/schema/agent-query.d.mts +89 -0
  304. package/dist/core/schema/agent-query.mjs +115 -0
  305. package/dist/core/schema/aliases.mjs +1 -52
  306. package/dist/core/schema/answer-parts.mjs +17 -13
  307. package/dist/core/schema/answers.d.mts +787 -319
  308. package/dist/core/schema/commands.d.mts +33 -23
  309. package/dist/core/schema/commands.mjs +26 -18
  310. package/dist/core/schema/custom.mjs +46 -45
  311. package/dist/core/schema/document.d.mts +32 -27
  312. package/dist/core/schema/document.mjs +61 -81
  313. package/dist/core/schema/drill-answers.mjs +4 -1
  314. package/dist/core/schema/drill.d.mts +14 -9
  315. package/dist/core/schema/drill.mjs +23 -22
  316. package/dist/core/schema/index.d.mts +5 -3
  317. package/dist/core/schema/index.mjs +5 -3
  318. package/dist/core/schema/options.d.mts +92 -0
  319. package/dist/core/schema/options.mjs +104 -0
  320. package/dist/core/schema/picks.d.mts +2 -2
  321. package/dist/core/schema/picks.mjs +7 -6
  322. package/dist/core/schema/query.d.mts +9 -83
  323. package/dist/core/schema/query.mjs +49 -73
  324. package/dist/core/schema/strict.d.mts +3 -0
  325. package/dist/core/schema/strict.mjs +91 -0
  326. package/dist/core/schema/union-error.mjs +30 -7
  327. package/dist/core/schema/view.d.mts +4 -3
  328. package/dist/core/schema/view.mjs +16 -11
  329. package/dist/core/store/ddl.d.mts +0 -2
  330. package/dist/core/store/ddl.mjs +1 -5
  331. package/dist/core/time/bucket.d.mts +1 -18
  332. package/dist/core/time/bucket.mjs +12 -8
  333. package/dist/core/time/compare.mjs +3 -2
  334. package/dist/core/time/index.d.mts +7 -8
  335. package/dist/core/time/instant.d.mts +15 -9
  336. package/dist/core/time/instant.mjs +23 -9
  337. package/dist/core/time/range.d.mts +3 -15
  338. package/dist/core/time/range.mjs +17 -7
  339. package/dist/core/time/stored.d.mts +8 -5
  340. package/dist/core/time/stored.mjs +51 -15
  341. package/dist/core/time/temporal.d.mts +1 -5
  342. package/dist/core/time/temporal.mjs +9 -4
  343. package/dist/core/time/text-time.d.mts +31 -2
  344. package/dist/core/time/text-time.mjs +139 -22
  345. package/dist/core/time/zone.d.mts +6 -1
  346. package/dist/core/time/zone.mjs +13 -4
  347. package/dist/core/types/api.d.mts +1 -1
  348. package/dist/core/types/api.mjs +1 -1
  349. package/dist/core/types/dashboard.d.mts +185 -0
  350. package/dist/core/types/dashboard.mjs +26 -0
  351. package/dist/core/types/drill-api.d.mts +14 -2
  352. package/dist/core/types/infer.d.mts +0 -4
  353. package/dist/core/types/options-check.d.mts +42 -0
  354. package/dist/core/types/options-check.mjs +90 -0
  355. package/dist/core/types/options.d.mts +14 -8
  356. package/dist/core/value/casefold.d.mts +1 -3
  357. package/dist/core/value/stored.d.mts +26 -0
  358. package/dist/core/value/stored.mjs +28 -0
  359. package/dist/cursor-seal.mjs +37 -9
  360. package/dist/dashboard-documents.d.mts +14 -6
  361. package/dist/dashboard-documents.mjs +32 -12
  362. package/dist/dashboards.mjs +10 -9
  363. package/dist/drill-access.mjs +6 -6
  364. package/dist/drill-change.mjs +18 -20
  365. package/dist/drill-comparison.mjs +2 -1
  366. package/dist/drill-crumbs.mjs +63 -28
  367. package/dist/drill-distinct.mjs +2 -1
  368. package/dist/drill-explain.mjs +1 -1
  369. package/dist/drill-items.mjs +1 -1
  370. package/dist/drill-open.mjs +39 -23
  371. package/dist/drill-seal.mjs +41 -13
  372. package/dist/drill-share.mjs +1 -1
  373. package/dist/drill-summary.mjs +2 -1
  374. package/dist/drill-targets.mjs +4 -4
  375. package/dist/drill-views.mjs +4 -3
  376. package/dist/drill.mjs +1 -1
  377. package/dist/editing.mjs +5 -3
  378. package/dist/endpoints/index.d.mts +29 -8
  379. package/dist/endpoints/index.mjs +4 -1
  380. package/dist/endpoints/meta.mjs +4 -3
  381. package/dist/endpoints/query.mjs +5 -2
  382. package/dist/endpoints/read.mjs +7 -6
  383. package/dist/endpoints/versions.mjs +2 -1
  384. package/dist/execute.d.mts +3 -0
  385. package/dist/execute.mjs +23 -12
  386. package/dist/grant.d.mts +9 -0
  387. package/dist/grant.mjs +43 -0
  388. package/dist/handler.mjs +8 -13
  389. package/dist/http.d.mts +6 -2
  390. package/dist/http.mjs +6 -2
  391. package/dist/index.d.mts +25 -4
  392. package/dist/index.mjs +91 -40
  393. package/dist/llms.txt +3 -3
  394. package/dist/mcp/api.mjs +2 -1
  395. package/dist/mcp/query.mjs +3 -8
  396. package/dist/mcp/resolve.mjs +9 -2
  397. package/dist/node/index.d.mts +36 -0
  398. package/dist/node/index.mjs +89 -0
  399. package/dist/node/request.d.mts +12 -0
  400. package/dist/node/request.mjs +119 -0
  401. package/dist/node/response.mjs +58 -0
  402. package/dist/principal.mjs +15 -7
  403. package/dist/react/Canvas.mjs +90 -69
  404. package/dist/react/Cell.mjs +2 -1
  405. package/dist/react/Dashboard.d.mts +15 -1
  406. package/dist/react/Dashboard.mjs +43 -42
  407. package/dist/react/DashboardList.mjs +9 -4
  408. package/dist/react/Editing.d.mts +9 -0
  409. package/dist/react/Editing.mjs +8 -3
  410. package/dist/react/Grid.mjs +1 -1
  411. package/dist/react/Header.mjs +25 -52
  412. package/dist/react/History.mjs +3 -2
  413. package/dist/react/LoadFailed.mjs +59 -0
  414. package/dist/react/Panel.d.mts +1 -1
  415. package/dist/react/Panel.mjs +1 -1
  416. package/dist/react/Parts.d.mts +34 -0
  417. package/dist/react/Parts.mjs +9 -6
  418. package/dist/react/ReviewPanel.mjs +1 -1
  419. package/dist/react/RowBody.d.mts +2 -0
  420. package/dist/react/RowBody.mjs +5 -1
  421. package/dist/react/Share.mjs +153 -0
  422. package/dist/react/TabStrip.mjs +37 -0
  423. package/dist/react/Tile.d.mts +3 -1
  424. package/dist/react/Tile.mjs +89 -92
  425. package/dist/react/TileState.mjs +117 -0
  426. package/dist/react/ago.mjs +45 -0
  427. package/dist/react/arrange.mjs +1 -1
  428. package/dist/react/board.mjs +2 -2
  429. package/dist/react/bucket-name.d.mts +8 -0
  430. package/dist/react/bucket-name.mjs +13 -0
  431. package/dist/react/builder/DisplayOptions.mjs +219 -0
  432. package/dist/react/builder/Preview.mjs +13 -13
  433. package/dist/react/builder/RangeEditor.mjs +4 -3
  434. package/dist/react/builder/WidgetBuilder.d.mts +1 -7
  435. package/dist/react/builder/WidgetBuilder.mjs +12 -3
  436. package/dist/react/builder/base.d.mts +13 -2
  437. package/dist/react/builder/base.mjs +70 -12
  438. package/dist/react/builder/display.d.mts +3 -0
  439. package/dist/react/builder/display.mjs +256 -0
  440. package/dist/react/builder/labels.mjs +19 -5
  441. package/dist/react/builder/options.mjs +11 -6
  442. package/dist/react/builder/state.mjs +25 -3
  443. package/dist/react/builder/useBuilder.d.mts +7 -1
  444. package/dist/react/builder/useBuilder.mjs +6 -9
  445. package/dist/react/builder/usePreview.mjs +3 -2
  446. package/dist/react/builder/words.d.mts +16 -1
  447. package/dist/react/builder/words.mjs +41 -1
  448. package/dist/react/change-text.mjs +149 -0
  449. package/dist/react/client.d.mts +9 -0
  450. package/dist/react/client.mjs +105 -14
  451. package/dist/react/columns.mjs +9 -1
  452. package/dist/react/context.d.mts +24 -3
  453. package/dist/react/context.mjs +23 -7
  454. package/dist/react/dates-shown.mjs +76 -0
  455. package/dist/react/draft.mjs +3 -2
  456. package/dist/react/drill/Bars.mjs +12 -16
  457. package/dist/react/drill/Comparison.mjs +1 -1
  458. package/dist/react/drill/DrillPanel.d.mts +1 -1
  459. package/dist/react/drill/DrillPanel.mjs +2 -1
  460. package/dist/react/drill/Header.mjs +65 -12
  461. package/dist/react/drill/Items.d.mts +1 -1
  462. package/dist/react/drill/Notes.mjs +10 -7
  463. package/dist/react/drill/PanelStates.mjs +8 -1
  464. package/dist/react/drill/Trend.mjs +10 -5
  465. package/dist/react/drill/board.d.mts +1 -1
  466. package/dist/react/drill/board.mjs +1 -0
  467. package/dist/react/drill/host.mjs +4 -1
  468. package/dist/react/drill/lazy.mjs +2 -27
  469. package/dist/react/drill/props.d.mts +19 -8
  470. package/dist/react/drill/props.mjs +62 -18
  471. package/dist/react/drill/state.d.mts +15 -5
  472. package/dist/react/drill/state.mjs +12 -3
  473. package/dist/react/drill/words.d.mts +46 -3
  474. package/dist/react/drill/words.mjs +30 -5
  475. package/dist/react/english.mjs +33 -8
  476. package/dist/react/export/ExportButton.mjs +4 -1
  477. package/dist/react/export/csv.d.mts +7 -2
  478. package/dist/react/export/csv.mjs +24 -7
  479. package/dist/react/failure-words.mjs +60 -0
  480. package/dist/react/filters/bar.d.mts +1 -1
  481. package/dist/react/filters/bar.mjs +4 -1
  482. package/dist/react/filters/calendar.mjs +23 -8
  483. package/dist/react/filters/chip.mjs +7 -3
  484. package/dist/react/filters/context.d.mts +13 -1
  485. package/dist/react/filters/context.mjs +1 -1
  486. package/dist/react/filters/dates-said.mjs +57 -0
  487. package/dist/react/filters/days.d.mts +3 -4
  488. package/dist/react/filters/days.mjs +10 -17
  489. package/dist/react/filters/hooks.d.mts +11 -0
  490. package/dist/react/filters/hooks.mjs +10 -6
  491. package/dist/react/filters/menu-search.mjs +17 -9
  492. package/dist/react/filters/menu.mjs +10 -8
  493. package/dist/react/filters/phone.mjs +41 -16
  494. package/dist/react/filters/place.mjs +40 -0
  495. package/dist/react/filters/popover.mjs +18 -13
  496. package/dist/react/filters/rules.d.mts +4 -3
  497. package/dist/react/filters/rules.mjs +3 -3
  498. package/dist/react/filters/sheet.mjs +7 -3
  499. package/dist/react/filters/state.mjs +6 -1
  500. package/dist/react/filters/values.mjs +24 -7
  501. package/dist/react/filters/words.d.mts +13 -0
  502. package/dist/react/filters/words.mjs +5 -0
  503. package/dist/react/format-time.d.mts +17 -6
  504. package/dist/react/format-time.mjs +152 -33
  505. package/dist/react/format.d.mts +3 -3
  506. package/dist/react/format.mjs +35 -122
  507. package/dist/react/headline.d.mts +12 -0
  508. package/dist/react/headline.mjs +107 -0
  509. package/dist/react/index.d.mts +20 -17
  510. package/dist/react/index.mjs +13 -10
  511. package/dist/react/lazy.mjs +38 -0
  512. package/dist/react/messages.d.mts +78 -2
  513. package/dist/react/now.mjs +38 -0
  514. package/dist/react/place.mjs +4 -2
  515. package/dist/react/read.d.mts +1 -0
  516. package/dist/react/read.mjs +140 -9
  517. package/dist/react/renderers/exact.mjs +31 -59
  518. package/dist/react/renderers/index.d.mts +27 -6
  519. package/dist/react/renderers/index.mjs +154 -92
  520. package/dist/react/renderers/list-parts.mjs +24 -0
  521. package/dist/react/renderers/list.d.mts +1 -0
  522. package/dist/react/renderers/list.mjs +99 -43
  523. package/dist/react/renderers/more-rows.mjs +75 -0
  524. package/dist/react/renderers/number-before.mjs +320 -0
  525. package/dist/react/renderers/number-period.mjs +54 -0
  526. package/dist/react/renderers/number-whole.mjs +29 -0
  527. package/dist/react/renderers/props.d.mts +24 -1
  528. package/dist/react/renderers/props.mjs +8 -0
  529. package/dist/react/renderers/table-cells.mjs +137 -31
  530. package/dist/react/renderers/table-fit.mjs +55 -10
  531. package/dist/react/renderers/table-measure.mjs +29 -9
  532. package/dist/react/renderers/table-row.mjs +14 -9
  533. package/dist/react/renderers/table-scale.mjs +2 -3
  534. package/dist/react/renderers/table-sort.mjs +3 -2
  535. package/dist/react/renderers/table-whole.mjs +37 -0
  536. package/dist/react/renderers/table.mjs +73 -53
  537. package/dist/react/review.d.mts +7 -0
  538. package/dist/react/review.mjs +35 -8
  539. package/dist/react/roving.d.mts +6 -0
  540. package/dist/react/roving.mjs +123 -0
  541. package/dist/react/says-dates.d.mts +7 -0
  542. package/dist/react/says-dates.mjs +51 -0
  543. package/dist/react/series.mjs +5 -6
  544. package/dist/react/stable.mjs +1 -1
  545. package/dist/react/tabs/EditTabs.mjs +125 -0
  546. package/dist/react/tabs/NameField.mjs +72 -0
  547. package/dist/react/tabs/TabMenu.mjs +175 -0
  548. package/dist/react/tabs/actions.mjs +37 -0
  549. package/dist/react/tabs/commands.mjs +76 -0
  550. package/dist/react/tabs/focus.mjs +22 -0
  551. package/dist/react/tabs/keys.mjs +28 -0
  552. package/dist/react/theme-unlayered.css +1 -1
  553. package/dist/react/theme.css +1 -1
  554. package/dist/react/tile-store.d.mts +4 -0
  555. package/dist/react/tile-store.mjs +93 -13
  556. package/dist/react/touch.d.mts +16 -0
  557. package/dist/react/touch.mjs +39 -0
  558. package/dist/react/useBoard.d.mts +6 -0
  559. package/dist/react/useBoard.mjs +1 -0
  560. package/dist/react/useDashboard.d.mts +2 -0
  561. package/dist/react/useDashboard.mjs +5 -2
  562. package/dist/react/useTiles.d.mts +3 -0
  563. package/dist/react/useTiles.mjs +73 -17
  564. package/dist/react/view-grid.mjs +2 -2
  565. package/dist/react/view.mjs +1 -1
  566. package/dist/recharts/axes.mjs +1 -1
  567. package/dist/recharts/axis.mjs +23 -73
  568. package/dist/recharts/bar.d.mts +2 -1
  569. package/dist/recharts/bar.mjs +140 -64
  570. package/dist/recharts/fit.mjs +33 -0
  571. package/dist/recharts/line.mjs +23 -17
  572. package/dist/recharts/marks.mjs +2 -1
  573. package/dist/recharts/parts.mjs +19 -14
  574. package/dist/recharts/table.mjs +8 -3
  575. package/dist/refusal.mjs +46 -0
  576. package/dist/registry/filter-bar.json +1 -1
  577. package/dist/skills/derive-dashboards/SKILL.md +25 -9
  578. package/dist/tile-doc.mjs +1 -1
  579. package/package.json +21 -6
  580. package/dist/charts-react/plan.d.mts +0 -3
  581. package/dist/charts-react/plan.mjs +0 -37
  582. package/dist/charts-react/tiles.d.mts +0 -24
  583. package/dist/core/policy/match.d.mts +0 -16
  584. package/dist/core/schema/aliases.d.mts +0 -7
  585. package/dist/core/time/compare.d.mts +0 -30
  586. package/dist/react/EditBar.d.mts +0 -16
  587. package/dist/react/History.d.mts +0 -30
  588. package/dist/react/ReviewPanel.d.mts +0 -15
  589. package/dist/react/digits.mjs +0 -46
  590. package/dist/react/drill/trend-touch.mjs +0 -33
  591. package/dist/react/renderers/exact.d.mts +0 -6
@@ -1,30 +1,66 @@
1
- import { parseTextTime } from "./text-time.mjs";
2
- import { MICROS_PER_SECOND, parseDate, parseNaiveTime } from "./instant.mjs";
1
+ import { movePoint, plainDecimal } from "../exact/text.mjs";
2
+ import { readValue, wholeNumber } from "../value/stored.mjs";
3
+ import { MICROS_PER_SECOND, isInstant, parseTextTime } from "./text-time.mjs";
4
+ import { parseDate, parseNaiveTime } from "./instant.mjs";
3
5
  import { resolveNaive, startOfDate } from "./zone.mjs";
4
6
  // src/time/stored.ts
7
+ const unread = (why) => ({ unread: why });
8
+ /** An instant, when it is one the library holds. */
9
+ const instant = (micros) => isInstant(micros) ? { value: micros } : unread("is outside years 1 to 9999");
10
+ /**
11
+ * A float as whole microseconds: its shortest digits with the point moved `places` to the right,
12
+ * rounded half away from zero. The one rounding of an epoch; the SQL engine rounds the same
13
+ * digits so (`engine/members.ts`), held to it by `laws/unread.laws.test.ts`.
14
+ */
15
+ function roundedMicros(digits, places) {
16
+ const moved = movePoint(digits, places);
17
+ const [whole = "0", part = ""] = moved.replace("-", "").split(".");
18
+ const size = BigInt(whole) + (part.charAt(0) >= "5" ? 1n : 0n);
19
+ return moved.startsWith("-") ? -size : size;
20
+ }
21
+ /** Seconds or milliseconds since the epoch: a whole number exactly, a fraction to the microsecond. */
5
22
  function epochValue(storage, raw) {
6
- if (typeof raw !== "number" || !Number.isFinite(raw)) return null;
7
- return Math.round(raw * (storage === "epoch_ms" ? 1e3 : MICROS_PER_SECOND));
23
+ const per = storage === "epoch_ms" ? 1000n : MICROS_PER_SECOND;
24
+ const whole = wholeNumber(raw);
25
+ if (whole !== void 0) return instant(whole * per);
26
+ const digits = typeof raw === "number" ? plainDecimal(raw) : void 0;
27
+ if (digits === void 0) return unread("is not a finite number");
28
+ return instant(roundedMicros(digits, per.toString().length - 1));
29
+ }
30
+ /** A `Date` is an instant: read as one by the storages that hold instants, refused by the rest. */
31
+ function dateObject(storage, raw) {
32
+ const millis = raw.getTime();
33
+ if (Number.isNaN(millis)) return unread("is an invalid Date");
34
+ if (storage === "date" || typeof storage === "object" && "timestamp" in storage) return unread("is a Date, which is an instant; give this column's value as text");
35
+ return instant(BigInt(millis) * 1000n);
8
36
  }
9
- function textValue(storage, raw, calendar) {
37
+ function textValue(storage, raw, zone) {
10
38
  if (storage === "date") {
11
39
  const date = parseDate(raw);
12
- return date === void 0 ? null : startOfDate(date, calendar.timezone);
40
+ return date === void 0 ? unread("is not a YYYY-MM-DD date") : instant(startOfDate(date, zone));
13
41
  }
14
42
  if (typeof storage === "object" && "timestamp" in storage) {
15
43
  const naive = parseNaiveTime(raw);
16
- return naive === void 0 ? null : resolveNaive(naive, storage.timestamp);
44
+ if (naive === void 0) return unread("is not a wall-clock time");
45
+ const at = resolveNaive(naive, storage.timestamp);
46
+ return at === null ? unread("is a wall-clock time its column's rule excludes") : instant(at);
17
47
  }
18
- return parseTextTime(raw) ?? null;
48
+ const at = parseTextTime(raw);
49
+ return at === void 0 ? unread("is not a time with an offset") : instant(at);
19
50
  }
20
51
  /**
21
- * The instant a stored time value means, by its declared storage. A date is its first instant
22
- * in the request's zone, so it buckets as its own date in any zone. A value that does not parse,
23
- * or a naive time its column's rule excludes, is null: excluded and counted, never guessed.
52
+ * A stored time value read by its declared storage. A date is its first instant in the
53
+ * request's zone, so it buckets as its own date in any zone. Text time is RFC 3339 with `T` or
54
+ * a space (as Postgres prints it, `2026-11-20 10:00:00+00`); a `Date` is its instant; an epoch
55
+ * column takes a number, a `bigint` or digit text. Anything else is unread, with its reason.
24
56
  */
25
- function timeValue(storage, raw, calendar) {
26
- if (raw === null) return null;
57
+ function readTime(storage, raw, calendar) {
58
+ if (raw === null || raw === void 0) return { value: null };
27
59
  if (storage === "epoch_ms" || storage === "epoch_s") return epochValue(storage, raw);
28
- return typeof raw === "string" ? textValue(storage, raw, calendar) : null;
60
+ if (raw instanceof Date) return dateObject(storage, raw);
61
+ if (typeof raw !== "string") return unread(`is a ${typeof raw}, not text`);
62
+ return textValue(storage, raw, calendar.timezone);
29
63
  }
30
- export { timeValue };
64
+ /** The instant a stored time value places its row at: null when stored null or unread. */
65
+ const timeValue = (storage, raw, calendar) => readValue(readTime(storage, raw, calendar));
66
+ export { readTime, timeValue };
@@ -1,7 +1,5 @@
1
- import { Micros } from "./instant.mjs";
1
+ import "./instant.mjs";
2
2
  import { Temporal } from "temporal-polyfill";
3
- /** Whether the runtime's zone database knows this zone name. */
4
- export declare function isZone(zone: string): boolean;
5
3
  /**
6
4
  * A moment as a host has one: a `Date`, or any Temporal `Instant` (the polyfill's or a native
7
5
  * one). Never a bare number, so milliseconds and microseconds cannot be confused.
@@ -9,6 +7,4 @@ export declare function isZone(zone: string): boolean;
9
7
  export type Moment = Date | {
10
8
  readonly epochNanoseconds: bigint;
11
9
  };
12
- /** A moment as whole microseconds since the epoch. */
13
- export declare function momentMicros(moment: Moment): Micros;
14
10
  export { Temporal };
@@ -2,14 +2,19 @@ import { Temporal } from "temporal-polyfill";
2
2
  // src/time/temporal.ts
3
3
  const NANOS_PER_MICRO = 1000n;
4
4
  function instantAt(micros) {
5
- return Temporal.Instant.fromEpochNanoseconds(BigInt(micros) * NANOS_PER_MICRO);
5
+ return Temporal.Instant.fromEpochNanoseconds(micros * NANOS_PER_MICRO);
6
6
  }
7
7
  function zonedAt(micros, zone) {
8
8
  return instantAt(micros).toZonedDateTimeISO(zone);
9
9
  }
10
- /** Every instant here is a whole number of microseconds, so the division is exact. */
10
+ /**
11
+ * An instant as whole microseconds, rounded down: every instant the library makes is a whole
12
+ * number of them, and a host's own nanoseconds go to the microsecond they fall in.
13
+ */
11
14
  function microsOf(value) {
12
- return Number(value.epochNanoseconds / NANOS_PER_MICRO);
15
+ const nanos = value.epochNanoseconds;
16
+ const whole = nanos / NANOS_PER_MICRO;
17
+ return nanos % NANOS_PER_MICRO < 0n ? whole - 1n : whole;
13
18
  }
14
19
  /** Whether the runtime's zone database knows this zone name. */
15
20
  function isZone(zone) {
@@ -22,6 +27,6 @@ function isZone(zone) {
22
27
  }
23
28
  /** A moment as whole microseconds since the epoch. */
24
29
  function momentMicros(moment) {
25
- return moment instanceof Date ? moment.getTime() * 1e3 : microsOf(moment);
30
+ return moment instanceof Date ? BigInt(moment.getTime()) * 1000n : microsOf(moment);
26
31
  }
27
32
  export { Temporal, instantAt, isZone, microsOf, momentMicros, zonedAt };
@@ -1,5 +1,17 @@
1
1
  import { Micros } from "./instant.mjs";
2
- /** A text instant at the engine's numeric precision. */
2
+ export declare const MICROS_PER_DAY: bigint;
3
+ /** Whether text is a date with no time (`DATE_ONLY`): a calendar day, not an instant. */
4
+ export declare const isDateOnly: (text: string) => boolean;
5
+ /**
6
+ * Text as milliseconds a browser can place, by the grammar alone: a text time's instant, or the
7
+ * wall time a naive time or a date (its midnight) names, held as if it were UTC, with `wall` set
8
+ * so the reader places it in its zone. None for text the grammar refuses or no real day.
9
+ */
10
+ export declare function textMillis(text: string): {
11
+ ms: number;
12
+ wall: boolean;
13
+ } | undefined;
14
+ /** A text instant as the whole microsecond it falls in (cut, never rounded); none outside `INSTANTS`. */
3
15
  export declare function parseTextTime(text: string): Micros | undefined;
4
16
  /** The last millisecond containing an included instant, for Intl to format in the viewer's zone.
5
17
  * The bounds are already resolved instants. No day arithmetic is involved, even across DST.
@@ -7,4 +19,21 @@ export declare function parseTextTime(text: string): Micros | undefined;
7
19
  export declare function lastIncludedMillisecond(range: {
8
20
  from: string;
9
21
  to: string;
10
- }): number | undefined;
22
+ }): number | undefined;
23
+ /**
24
+ * A calendar day's midnight as milliseconds held as if UTC, by counting, for any year (`Date.UTC`
25
+ * reads years 0 to 99 as 1900 to 1999). A day that is not real is held to the last of its
26
+ * month: 31 February is 28 or 29 February. Months past 12 run into the years after.
27
+ */
28
+ export declare function dateMillis(year: number, month: number, date: number): number;
29
+ /**
30
+ * Wall time in a zone by Intl alone, so a browser places a bucket without the calendar library
31
+ * (`resolveNaive`, `startOfDate`). A wall time is ms held as if UTC. `instant` is the instant it
32
+ * names as a column with `earlier` and `shift_forward` reads it: a time a clock change repeats is
33
+ * its first, one it skips is moved on by the gap. `dayStart` is a midnight's day's first instant,
34
+ * as `startOfDate` has it. The charts' `laws/buckets` holds both to the calendar library's.
35
+ */
36
+ export declare function wallClock(zone: string): {
37
+ instant: (wall: number) => number;
38
+ dayStart: (midnight: number) => number;
39
+ };
@@ -1,10 +1,13 @@
1
1
  // src/time/text-time.ts
2
+ const MICROS_PER_SECOND = 1000000n;
3
+ const MICROS_PER_HOUR = 3600n * MICROS_PER_SECOND;
4
+ const MICROS_PER_DAY = 24n * MICROS_PER_HOUR;
2
5
  /**
3
- * The one grammar for text time, a contract with every SQL dialect: `YYYY-MM-DD`, `T` or a
4
- * space, `hh:mm:ss`, an optional fraction of 1 to 6 digits, then `Z` or `+hh:mm` / `-hh:mm`.
5
- * A naive time is the same without the offset.
6
+ * The one grammar for text time, a contract with every SQL dialect: RFC 3339 section 5.6 (`T`,
7
+ * `t` or a space, a fraction of any length, `Z` or `z`) and Postgres's `+hh` offset of whole
8
+ * hours (`2026-11-20 10:00:00+00`). A naive time is the same without the offset.
6
9
  */
7
- const TEXT_TIME = /^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,6}))?(Z|[+-](\d{2}):(\d{2}))?$/u;
10
+ const TEXT_TIME = /^(\d{4})-(\d{2})-(\d{2})[Tt ](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?([Zz]|[+-](\d{2})(?::(\d{2}))?)?$/u;
8
11
  /** The grammar's own limits on a clock time and an offset: second 60 is no second. */
9
12
  function inGrammar(match) {
10
13
  const n = (i) => Number(match[i] ?? "0");
@@ -33,8 +36,11 @@ const MONTH_DAYS = [
33
36
  ];
34
37
  /** Whether a year has a 29 February, in the one calendar every year is counted in. */
35
38
  const isLeap = (year) => year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
36
- /** How many days a month of a year has; none for a month that is not one. */
37
- const daysIn = (year, month) => month === 2 && isLeap(year) ? 29 : MONTH_DAYS[month - 1] ?? 0;
39
+ /** Whether a day is real (no 30 February): the one owner of month lengths (`laws/calendar-day`). */
40
+ function isRealDay(year, month, date) {
41
+ const days = month === 2 && isLeap(year) ? 29 : MONTH_DAYS[month - 1] ?? 0;
42
+ return Number.isInteger(date) && date >= 1 && date <= days;
43
+ }
38
44
  /**
39
45
  * The days from 1970-01-01 to a calendar day, by counting: years in eras of 400, which all
40
46
  * have as many days, and months from March, so the leap day is the last day of its year.
@@ -47,34 +53,145 @@ function daysFromEpoch(year, month, date) {
47
53
  const days = inEra * 365 + Math.floor(inEra / 4) - Math.floor(inEra / 100) + inYear;
48
54
  return era * 146097 + days - 719468;
49
55
  }
50
- /** A calendar day's first millisecond in UTC; undefined for a day that is not real (30 February). */
56
+ /**
57
+ * The instants the library holds: from the first of year 1 to the end of year 9999, UTC, `to`
58
+ * excluded. Every one is exact; a stored value outside them is not one. Text time reads `to`
59
+ * as well, so a range can end there and take in every instant.
60
+ */
61
+ const INSTANTS = {
62
+ from: -62135596800000000n,
63
+ to: 253402300800000000n,
64
+ /** The two ends as text time: the end is 10000-01-01T00:00:00Z, written in four digits. */
65
+ fromText: "0001-01-01T00:00:00Z",
66
+ toText: "9999-12-31T10:00:00-14:00"
67
+ };
68
+ /** Whether an instant is one the library holds (`INSTANTS`, `to` excluded). */
69
+ const isInstant = (micros) => micros >= INSTANTS.from && micros < INSTANTS.to;
70
+ /** Whether an instant is one text time names: one the library holds, or the end of them all. */
71
+ const isNamed = (micros) => isInstant(micros) || micros === INSTANTS.to;
72
+ /** A calendar day's first microsecond in UTC; undefined for a day that is not real (30 February). */
51
73
  function dayStart(year, month, date) {
52
- return date >= 1 && date <= daysIn(year, month) ? daysFromEpoch(year, month, date) * 864e5 : void 0;
74
+ return isRealDay(year, month, date) ? BigInt(daysFromEpoch(year, month, date)) * MICROS_PER_DAY : void 0;
53
75
  }
54
- /** The instant a text time names, or undefined when it does not fit the grammar exactly. */
55
- function exactMicros(text) {
56
- const match = matchTime(text, true);
57
- if (match === void 0) return void 0;
76
+ /** The microsecond a matched text time falls in, its fraction past six digits cut; a naive one as at UTC. */
77
+ function microsOf(match) {
58
78
  const n = (i) => Number(match[i] ?? "0");
59
79
  const start = dayStart(n(1), n(2), n(3));
60
80
  if (start === void 0) return void 0;
61
81
  const offset = (match[8]?.startsWith("-") === true ? -1 : 1) * (n(9) * 60 + n(10));
62
- const millis = start + ((n(4) * 60 + n(5) - offset) * 60 + n(6)) * 1e3;
63
- return BigInt(millis) * 1000n + BigInt((match[7] ?? "").padEnd(6, "0"));
82
+ const seconds = (n(4) * 60 + n(5) - offset) * 60 + n(6);
83
+ const fraction = BigInt((match[7] ?? "").slice(0, 6).padEnd(6, "0"));
84
+ return start + BigInt(seconds) * MICROS_PER_SECOND + fraction;
85
+ }
86
+ /** The microsecond a text time's instant falls in, its fraction past six digits cut. */
87
+ function textMicros(text) {
88
+ const match = matchTime(text, true);
89
+ return match === void 0 ? void 0 : microsOf(match);
64
90
  }
65
- /** A text instant at the engine's numeric precision. */
91
+ /** Microseconds as the millisecond they fall in, rounded down before the epoch as after it. */
92
+ const millisOf = (micros) => Number(micros / 1000n) - Number(micros % 1000n < 0n);
93
+ /** A date with no time, as a `date` column gives it (`2026-09-30`). */
94
+ const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/u;
95
+ /** Whether text is a date with no time (`DATE_ONLY`): a calendar day, not an instant. */
96
+ const isDateOnly = (text) => DATE_ONLY.test(text);
97
+ /**
98
+ * Text as milliseconds a browser can place, by the grammar alone: a text time's instant, or the
99
+ * wall time a naive time or a date (its midnight) names, held as if it were UTC, with `wall` set
100
+ * so the reader places it in its zone. None for text the grammar refuses or no real day.
101
+ */
102
+ function textMillis(text) {
103
+ const instant = parseTextTime(text);
104
+ if (instant !== void 0) return {
105
+ ms: millisOf(instant),
106
+ wall: false
107
+ };
108
+ const match = matchTime(DATE_ONLY.test(text) ? `${text}T00:00:00` : text, false);
109
+ const wall = match === void 0 ? void 0 : microsOf(match);
110
+ return wall === void 0 ? void 0 : {
111
+ ms: millisOf(wall),
112
+ wall: true
113
+ };
114
+ }
115
+ /** A text instant as the whole microsecond it falls in (cut, never rounded); none outside `INSTANTS`. */
66
116
  function parseTextTime(text) {
67
- const micros = exactMicros(text);
68
- return micros === void 0 ? void 0 : Number(micros);
117
+ const micros = textMicros(text);
118
+ return micros !== void 0 && isNamed(micros) ? micros : void 0;
119
+ }
120
+ /** A range's end: the first whole microsecond at or after its instant, so the range stays exact. */
121
+ function parseRangeEnd(text) {
122
+ const micros = textMicros(text);
123
+ if (micros === void 0) return void 0;
124
+ const up = micros + BigInt(/\.\d{6}\d*[1-9]/u.test(text));
125
+ return isNamed(up) ? up : void 0;
69
126
  }
70
127
  /** The last millisecond containing an included instant, for Intl to format in the viewer's zone.
71
128
  * The bounds are already resolved instants. No day arithmetic is involved, even across DST.
72
129
  */
73
130
  function lastIncludedMillisecond(range) {
74
- const from = exactMicros(range.from);
75
- const until = exactMicros(range.to);
131
+ const from = parseRangeEnd(range.from);
132
+ const until = parseRangeEnd(range.to);
76
133
  if (from === void 0 || until === void 0 || from >= until) return void 0;
77
- const last = until - 1n;
78
- return Number(last / 1000n) - Number(last % 1000n < 0n);
134
+ return millisOf(until - 1n);
135
+ }
136
+ /**
137
+ * A calendar day's midnight as milliseconds held as if UTC, by counting, for any year (`Date.UTC`
138
+ * reads years 0 to 99 as 1900 to 1999). A day that is not real is held to the last of its
139
+ * month: 31 February is 28 or 29 February. Months past 12 run into the years after.
140
+ */
141
+ function dateMillis(year, month, date) {
142
+ const months = year * 12 + month - 1;
143
+ const [y, m] = [Math.floor(months / 12), months % 12 + 1];
144
+ const last = [
145
+ 31,
146
+ 30,
147
+ 29,
148
+ 28
149
+ ].find((day) => isRealDay(y, m, day)) ?? 28;
150
+ return daysFromEpoch(y, m, Math.min(date, last)) * DAY_MS;
151
+ }
152
+ const DAY_MS = 864e5;
153
+ /**
154
+ * A zone's offset from UTC at an instant, in ms east, from Intl's `GMT±hh:mm` or `GMT±hh:mm:ss`
155
+ * (a local mean time keeps its seconds: Africa/Monrovia was 44:30 behind until 1972). Intl
156
+ * writes a zero offset as `GMT` alone. A zone the runtime does not know throws a RangeError.
157
+ */
158
+ function offsetIn(zone) {
159
+ const format = new Intl.DateTimeFormat("en-US", {
160
+ timeZone: zone,
161
+ timeZoneName: "longOffset"
162
+ });
163
+ return (ms) => {
164
+ const name = format.formatToParts(ms).find((p) => p.type === "timeZoneName")?.value;
165
+ const found = /^GMT([+-])(\d{2}):(\d{2})(?::(\d{2}))?$/u.exec(name ?? "");
166
+ if (found === null) return 0;
167
+ const seconds = (Number(found[2]) * 60 + Number(found[3])) * 60 + Number(found[4] ?? "0");
168
+ return (found[1] === "-" ? -1e3 : 1e3) * seconds;
169
+ };
170
+ }
171
+ /**
172
+ * Wall time in a zone by Intl alone, so a browser places a bucket without the calendar library
173
+ * (`resolveNaive`, `startOfDate`). A wall time is ms held as if UTC. `instant` is the instant it
174
+ * names as a column with `earlier` and `shift_forward` reads it: a time a clock change repeats is
175
+ * its first, one it skips is moved on by the gap. `dayStart` is a midnight's day's first instant,
176
+ * as `startOfDate` has it. The charts' `laws/buckets` holds both to the calendar library's.
177
+ */
178
+ function wallClock(zone) {
179
+ const offset = offsetIn(zone);
180
+ const named = (wall) => [wall - offset(wall - DAY_MS), wall - offset(wall + DAY_MS)];
181
+ const real = (wall) => named(wall).filter((ms) => ms + offset(ms) === wall);
182
+ const instant = (wall) => {
183
+ const found = real(wall);
184
+ return found.length > 0 ? Math.min(...found) : Math.max(...named(wall));
185
+ };
186
+ return {
187
+ instant,
188
+ dayStart: (midnight) => {
189
+ const found = real(midnight);
190
+ const [first, again] = [Math.min(...found), Math.max(...found)];
191
+ if (found.length === 0 || first === again) return instant(midnight);
192
+ const before = again - 1 + offset(again - 1);
193
+ return Math.floor(before / DAY_MS) === Math.floor(midnight / DAY_MS) ? first : again;
194
+ }
195
+ };
79
196
  }
80
- export { lastIncludedMillisecond, matchTime, parseTextTime };
197
+ export { DATE_ONLY, INSTANTS, MICROS_PER_DAY, MICROS_PER_HOUR, MICROS_PER_SECOND, dateMillis, isDateOnly, isInstant, isRealDay, lastIncludedMillisecond, matchTime, parseRangeEnd, parseTextTime, textMillis, wallClock };
@@ -12,7 +12,12 @@ export type NaiveRule = {
12
12
  * rule excludes it. In a gap, shift_forward moves it later by the gap's length, as Postgres does.
13
13
  */
14
14
  export declare function resolveNaive(time: Temporal.PlainDateTime, rule: NaiveRule): Micros | null;
15
- /** The first instant of a calendar day in a zone: usually midnight, later on a day that skips it. */
15
+ /**
16
+ * The first instant of a calendar day in a zone: usually midnight, later on a day that skips
17
+ * it. Where the clocks fall back across midnight, midnight comes twice with the end of the day
18
+ * before in between: the day starts at the later one, so no two days overlap. Where both
19
+ * midnights are the day's own (clocks set back from 01:00), it starts at the first.
20
+ */
16
21
  export declare function startOfDate(date: Temporal.PlainDate, zone: string): Micros;
17
22
  /** One stretch of time with a single UTC offset, in minutes east of UTC. */
18
23
  export type OffsetSegment = {
@@ -11,9 +11,18 @@ function resolveNaive(time, rule) {
11
11
  if (earlier.toPlainDateTime().equals(time)) return rule.ambiguous === "exclude" ? null : microsOf(rule.ambiguous === "earlier" ? earlier : later);
12
12
  return rule.nonexistent === "exclude" ? null : microsOf(later);
13
13
  }
14
- /** The first instant of a calendar day in a zone: usually midnight, later on a day that skips it. */
14
+ /**
15
+ * The first instant of a calendar day in a zone: usually midnight, later on a day that skips
16
+ * it. Where the clocks fall back across midnight, midnight comes twice with the end of the day
17
+ * before in between: the day starts at the later one, so no two days overlap. Where both
18
+ * midnights are the day's own (clocks set back from 01:00), it starts at the first.
19
+ */
15
20
  function startOfDate(date, zone) {
16
- return microsOf(date.toZonedDateTime(zone));
21
+ const first = date.toZonedDateTime(zone);
22
+ const again = date.toPlainDateTime().toZonedDateTime(zone, { disambiguation: "later" });
23
+ if (again.epochNanoseconds <= first.epochNanoseconds) return microsOf(first);
24
+ const before = again.subtract({ microseconds: 1 }).toPlainDate();
25
+ return microsOf(before.equals(date) ? first : again);
17
26
  }
18
27
  function offsetMinutes(at) {
19
28
  return at.offsetNanoseconds / 6e10;
@@ -27,7 +36,7 @@ function offsetSegments(span, zone) {
27
36
  let at = zonedAt(span.from, zone);
28
37
  while (microsOf(at) < span.to) {
29
38
  const next = at.getTimeZoneTransition("next");
30
- const to = next === null ? span.to : Math.min(microsOf(next), span.to);
39
+ const to = next === null || microsOf(next) > span.to ? span.to : microsOf(next);
31
40
  segments.push({
32
41
  from: microsOf(at),
33
42
  to,
@@ -44,7 +53,7 @@ function firstDateFrom(instant, zone) {
44
53
  }
45
54
  /** The latest clock change at or before an instant, or undefined when the zone has none. */
46
55
  function lastChange(instant, zone) {
47
- const change = zonedAt(instant + 1, zone).getTimeZoneTransition("previous");
56
+ const change = zonedAt(instant + 1n, zone).getTimeZoneTransition("previous");
48
57
  return change === null ? void 0 : microsOf(change);
49
58
  }
50
59
  /** The first clock change after an instant, or undefined. */
@@ -344,4 +344,4 @@ export type CoreContract = {
344
344
  * than reading a shape it does not know. A test recomputes it from the answer schemas, so a
345
345
  * change to an answer fails until this is updated.
346
346
  */
347
- export declare const CONTRACT_VERSION = "87905292cf669d4a";
347
+ export declare const CONTRACT_VERSION = "dce7624268464e69";
@@ -5,5 +5,5 @@
5
5
  * than reading a shape it does not know. A test recomputes it from the answer schemas, so a
6
6
  * change to an answer fails until this is updated.
7
7
  */
8
- const CONTRACT_VERSION = "87905292cf669d4a";
8
+ const CONTRACT_VERSION = "dce7624268464e69";
9
9
  export { CONTRACT_VERSION };
@@ -0,0 +1,185 @@
1
+ import { DisplayKind, DisplayOf } from "../document/display.mjs";
2
+ import { Display, Doc, LayoutItem, Scope, Tab, Widget } from "../document/types.mjs";
3
+ import { DimensionId, MeasureId, SourceNameOf } from "../model/define.mjs";
4
+ import { DimensionValueType } from "../model/member.mjs";
5
+ import { Model } from "../model/types.mjs";
6
+ import { StoredLockEntry } from "../query/compose.mjs";
7
+ import { Leaf, NodeId, StoredFilter } from "../query/filter.mjs";
8
+ import { Control, DimensionCut, EntryId, ExplicitRange, RelativeRange, StoredQuery } from "../query/types.mjs";
9
+ import { JoinName } from "./primitives.mjs";
10
+ /**
11
+ * The kinds the library's renderers draw: React's own (number, table, list) and the chart
12
+ * kits' (line, bar, area, multiples, heatmap, funnel). A host's own renderers add theirs with
13
+ * `deriveDashboards({ widgetKinds })`.
14
+ */
15
+ export declare const LIBRARY_WIDGET_KINDS: readonly ["number", "table", "list", "line", "bar", "area", "multiples", "heatmap", "funnel"];
16
+ export type LibraryWidgetKind = (typeof LIBRARY_WIDGET_KINDS)[number];
17
+ /** A stored filter whose leaves name only dimensions source `S` can reach. */
18
+ type StoredFilterFor<M extends Model, S extends SourceNameOf<M>> = {
19
+ id: NodeId;
20
+ } & ({
21
+ all: readonly StoredFilterFor<M, S>[];
22
+ } | {
23
+ any: readonly StoredFilterFor<M, S>[];
24
+ } | {
25
+ not: StoredFilterFor<M, S>;
26
+ } | Leaf<DimensionId<M, S>> | {
27
+ some: {
28
+ join: JoinName;
29
+ where: StoredFilter;
30
+ };
31
+ } | {
32
+ none: {
33
+ join: JoinName;
34
+ where: StoredFilter;
35
+ };
36
+ });
37
+ /** `source.dimension` for a time dimension source `S` owns: what a query's time can name. */
38
+ type TimeDimensionId<M extends Model, S extends SourceNameOf<M> = SourceNameOf<M>> = { [K in S]: `${K}.${{ [D in keyof M["sources"][K]["dimensions"] & string]: M["sources"][K]["dimensions"][D] extends {
39
+ kind: "time";
40
+ } ? D : never; }[keyof M["sources"][K]["dimensions"] & string]}`; }[S];
41
+ /** A lock entry on one source of the model, its filter naming only members that source reaches. */
42
+ type LockFor<M extends Model> = { [S in SourceNameOf<M>]: Omit<StoredLockEntry, "on" | "filter"> & {
43
+ on: S;
44
+ filter: StoredFilterFor<M, S>;
45
+ }; }[SourceNameOf<M>];
46
+ /** A relative range as it may be written: its `includeCurrent` defaults to false. */
47
+ type RelativeWritten = Omit<RelativeRange, "includeCurrent"> & {
48
+ includeCurrent?: boolean;
49
+ };
50
+ /** A range as it may be written: a relative one's `includeCurrent` defaults to false. */
51
+ type RangeWritten = ExplicitRange | RelativeWritten;
52
+ /** A stored query on one source of the model, naming only that source's members. */
53
+ type StoredQueryFor<M extends Model> = { [S in SourceNameOf<M>]: Omit<StoredQuery, "source" | "measures" | "dimensions" | "time" | "filters"> & {
54
+ source: S;
55
+ measures: readonly {
56
+ id: EntryId;
57
+ measure: MeasureId<M, S>;
58
+ filter?: StoredFilterFor<M, S>;
59
+ label?: string;
60
+ }[];
61
+ dimensions?: readonly ({
62
+ id: EntryId;
63
+ member: DimensionId<M, S>;
64
+ } & DimensionCut<EntryId>)[];
65
+ time?: Omit<NonNullable<StoredQuery["time"]>, "dimension" | "range"> & {
66
+ dimension: TimeDimensionId<M, S>;
67
+ range: RangeWritten;
68
+ };
69
+ filters?: StoredFilterFor<M, S>;
70
+ }; }[SourceNameOf<M>];
71
+ /**
72
+ * A widget whose kind is one of `K` and whose queries are typed by the model. A built-in kind's
73
+ * display takes only its own options, each of its type; a host's own kind keeps its own.
74
+ */
75
+ type WidgetFor<M extends Model, K extends string> = K extends unknown ? Omit<Widget, "kind" | "queries" | "display"> & {
76
+ kind: K;
77
+ queries: Record<string, StoredQueryFor<M>>;
78
+ display?: K extends DisplayKind ? DisplayOf<K> : Display;
79
+ } : never;
80
+ /**
81
+ * Whether a dimension's definition holds values of type `T`, as `dimensionValueType` reads it: a
82
+ * number, a boolean or a time as declared, an expression as its `type`, and text for the rest.
83
+ * A definition the type checker does not know exactly may hold any.
84
+ */
85
+ type Holds<D, T extends DimensionValueType> = T extends (D extends {
86
+ kind: infer K extends "number" | "boolean" | "time";
87
+ } ? K : D extends {
88
+ kind: "expr";
89
+ type: infer E;
90
+ } ? E : "string") ? true : false;
91
+ /** The names of the dimensions in `Dims` that hold values of type `T`. */
92
+ type NamesHolding<Dims, T extends DimensionValueType> = { [D in keyof Dims & string]: Holds<Dims[D], T> extends true ? D : never; }[keyof Dims & string];
93
+ /** Each source's dimensions that hold values of type `T`, by name. */
94
+ type NamesHoldingIn<M extends Model, T extends DimensionValueType> = { [K in SourceNameOf<M>]: NamesHolding<M["sources"][K]["dimensions"], T>; };
95
+ /** A dimension id of the model, own or one join away, whose dimension holds values of type `T`. */
96
+ type DimensionIdHolding<M extends Model, T extends DimensionValueType> = DimensionId<M, SourceNameOf<M>, NamesHoldingIn<M, T>>;
97
+ /**
98
+ * A filter control's fields: a dimension of the model, and the same field on other sources, each
99
+ * holding the same type of value, so one pick narrows every one of them. The types hold each
100
+ * field to the model and to one type of value. That each is on a source of its own they do not
101
+ * say: a second field on a source is refused when the server starts (`CONTROL_FIELD`).
102
+ */
103
+ type FilterFields<M extends Model> = { [T in DimensionValueType]: {
104
+ member: DimensionIdHolding<M, T>;
105
+ also?: readonly DimensionIdHolding<M, T>[];
106
+ }; }[DimensionValueType];
107
+ /** A control as it may be written: a date range's presets and bounds may leave `includeCurrent` out, as a query's range may. */
108
+ type ControlWritten = Control extends (infer C) ? C extends {
109
+ kind: "date_range";
110
+ } ? Omit<C, "presets" | "min" | "max"> & {
111
+ presets: readonly RelativeWritten[];
112
+ min?: RangeWritten;
113
+ max?: RangeWritten;
114
+ } : C : never;
115
+ /**
116
+ * A control as it may be written; a filter control names a dimension of the model, and the same
117
+ * field on other sources.
118
+ */
119
+ type ControlFor<M extends Model> = ControlWritten extends (infer C) ? C extends {
120
+ kind: "filter";
121
+ } ? Omit<C, "member" | "also"> & FilterFields<M> : C : never;
122
+ /** A tab whose layout places only the widgets `W`: an entry for a widget the document lacks does not compile. */
123
+ type TabFor<W extends string> = Omit<Tab, "layout"> & {
124
+ layout: readonly (Omit<LayoutItem, "widget"> & {
125
+ widget: NoInfer<W>;
126
+ })[];
127
+ };
128
+ /**
129
+ * A document as it may be written: what has one obvious default (its spec version, one tab, no
130
+ * controls, no scope) may be left out, and is filled in as it is read (`documentSchema`).
131
+ */
132
+ type Written = Omit<Doc, "specVersion" | "tabs" | "widgets" | "controls" | "scope"> & {
133
+ specVersion?: Doc["specVersion"];
134
+ };
135
+ /**
136
+ * A document typed by the model, its widgets drawn by the kinds in `K`: its queries, filters,
137
+ * time dimensions and locks name only what the model has, and its layout only its widgets `W`.
138
+ */
139
+ type TypedDoc<M extends Model, K extends string, W extends string = string> = Written & {
140
+ tabs?: readonly TabFor<W>[];
141
+ widgets: Record<W, WidgetFor<M, K>>;
142
+ controls?: readonly ControlFor<M>[];
143
+ scope?: Omit<Scope, "bySource" | "lock" | "dateRange"> & {
144
+ bySource?: { readonly [S in SourceNameOf<M>]?: StoredFilterFor<M, S>; };
145
+ dateRange?: RangeWritten;
146
+ lock?: readonly LockFor<M>[];
147
+ };
148
+ };
149
+ /** Any document as it may be written, with no model to type it by: what every typed one is. */
150
+ type WideDoc = Written & {
151
+ tabs?: Doc["tabs"];
152
+ widgets: Record<string, Omit<Widget, "queries"> & {
153
+ queries: Record<string, WideQuery>;
154
+ }>;
155
+ controls?: readonly ControlWritten[];
156
+ scope?: Omit<Scope, "bySource" | "dateRange"> & {
157
+ bySource?: Scope["bySource"];
158
+ dateRange?: RangeWritten;
159
+ };
160
+ };
161
+ type WideQuery = Omit<StoredQuery, "time"> & {
162
+ time?: (Omit<NonNullable<StoredQuery["time"]>, "range"> & {
163
+ range: RangeWritten;
164
+ }) | undefined;
165
+ };
166
+ /**
167
+ * A dashboard document for the model `M`, its widgets of the library's kinds or of `K`, laid
168
+ * out by id from `W`. With no model (the wide `Model`), any document: it is checked when the
169
+ * server starts.
170
+ */
171
+ type DashboardDoc<M extends Model = Model, K extends string = never, W extends string = string> = Model extends M ? WideDoc : TypedDoc<M, LibraryWidgetKind | K, W>;
172
+ /** A dashboard defined in code, with a stable key and stable widget and control ids. */
173
+ export type CodeDashboard<M extends Model = Model, K extends string = never, W extends string = string> = {
174
+ key: string;
175
+ document: DashboardDoc<M, K, W>;
176
+ };
177
+ /**
178
+ * A dashboard document typed by the model, so a misspelt source, member, time dimension, lock
179
+ * member, widget kind or layout entry does not compile. Kinds besides the library's are named as
180
+ * on the server: `defineDashboard(model, {...}, { widgetKinds: ["gauge"] })`.
181
+ */
182
+ export declare function defineDashboard<M extends Model, const K extends string = never, W extends string = string>(_model: M, document: DashboardDoc<M, NoInfer<K>, W>, _kinds?: {
183
+ widgetKinds: readonly K[];
184
+ }): DashboardDoc<M, K>;
185
+ export {};
@@ -0,0 +1,26 @@
1
+ // src/types/dashboard.ts
2
+ /**
3
+ * The kinds the library's renderers draw: React's own (number, table, list) and the chart
4
+ * kits' (line, bar, area, multiples, heatmap, funnel). A host's own renderers add theirs with
5
+ * `deriveDashboards({ widgetKinds })`.
6
+ */
7
+ const LIBRARY_WIDGET_KINDS = [
8
+ "number",
9
+ "table",
10
+ "list",
11
+ "line",
12
+ "bar",
13
+ "area",
14
+ "multiples",
15
+ "heatmap",
16
+ "funnel"
17
+ ];
18
+ /**
19
+ * A dashboard document typed by the model, so a misspelt source, member, time dimension, lock
20
+ * member, widget kind or layout entry does not compile. Kinds besides the library's are named as
21
+ * on the server: `defineDashboard(model, {...}, { widgetKinds: ["gauge"] })`.
22
+ */
23
+ function defineDashboard(_model, document, _kinds) {
24
+ return document;
25
+ }
26
+ export { LIBRARY_WIDGET_KINDS, defineDashboard };