@altertable/data-app 0.70.0 → 0.72.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 (291) hide show
  1. package/AGENTS.md +7 -1
  2. package/CONTRIBUTING.md +73 -33
  3. package/README.md +23 -26
  4. package/REFERENCE.md +1904 -0
  5. package/dist/chunks/index-5a27erdg.js +54 -0
  6. package/dist/chunks/index-5a27erdg.js.map +10 -0
  7. package/dist/chunks/{index-58kks6a8.js → index-9yxr7nmm.js} +330 -21
  8. package/dist/chunks/index-9yxr7nmm.js.map +17 -0
  9. package/dist/chunks/{index-wjt6cavj.js → index-j5q5n3ra.js} +5 -5
  10. package/dist/chunks/index-j5q5n3ra.js.map +10 -0
  11. package/dist/chunks/{index-22d576sn.js → index-q75zm3a7.js} +3 -3
  12. package/dist/chunks/{index-22d576sn.js.map → index-q75zm3a7.js.map} +3 -3
  13. package/dist/chunks/{index-9zqbrv2z.js → index-vhaec7m5.js} +4 -6
  14. package/dist/chunks/index-vhaec7m5.js.map +10 -0
  15. package/dist/chunks/{index-q1w84fv9.js → index-zp78caex.js} +345 -84
  16. package/dist/chunks/index-zp78caex.js.map +19 -0
  17. package/dist/client/index.js +284 -16
  18. package/dist/client/index.js.map +7 -3
  19. package/dist/core/appearance.js +181 -11
  20. package/dist/core/appearance.js.map +4 -3
  21. package/dist/core/config.js +3 -3
  22. package/dist/core/contract.js +10 -12
  23. package/dist/core/contract.js.map +1 -1
  24. package/dist/core/format.js +1 -1
  25. package/dist/index.js +4 -4
  26. package/dist/index.js.map +1 -1
  27. package/dist/internal.js +418 -0
  28. package/dist/internal.js.map +15 -0
  29. package/dist/server/index.js +102 -0
  30. package/dist/server/index.js.map +10 -0
  31. package/dist/types/client/annotations.d.ts +1 -1
  32. package/dist/types/client/iframe.d.ts +6 -6
  33. package/dist/types/client/index.d.ts +3 -4
  34. package/dist/types/client/location.d.ts +2 -2
  35. package/dist/types/client/logger.d.ts +1 -1
  36. package/dist/types/client/navigation.d.ts +1 -1
  37. package/dist/types/client/transport.d.ts +1 -1
  38. package/dist/types/core/bridge.d.ts +1 -1
  39. package/dist/types/core/config.d.ts +8 -9
  40. package/dist/types/core/filters.d.ts +1 -1
  41. package/dist/types/core/format.d.ts +1 -2
  42. package/dist/types/core/messages.d.ts +3 -3
  43. package/dist/types/core/operation-types.d.ts +1 -1
  44. package/dist/types/core/presentation.d.ts +1 -1
  45. package/dist/types/core/reading.d.ts +1 -1
  46. package/dist/types/internal.d.ts +22 -0
  47. package/dist/types/server/index.d.ts +1 -2
  48. package/docs/app-authoring.md +18 -1
  49. package/docs/client.md +1 -1
  50. package/docs/contract.md +1 -1
  51. package/docs/data-context.md +3 -3
  52. package/docs/embed.md +4 -4
  53. package/docs/formatting-and-appearance.md +1 -1
  54. package/docs/hosted-apps.md +16 -8
  55. package/docs/local-data-apps.md +1 -1
  56. package/docs/react-embed.md +7 -6
  57. package/docs/react.md +6 -6
  58. package/docs/server-bun.md +6 -6
  59. package/docs/stories-and-export.md +3 -3
  60. package/docs/styling.md +2 -2
  61. package/docs/ui.md +6 -6
  62. package/docs/views.md +2 -2
  63. package/docs/widgets.md +4 -4
  64. package/docs/worker.md +4 -4
  65. package/package.json +15 -92
  66. package/THIRD_PARTY_NOTICES +0 -18
  67. package/dist/chunks/index-2ajhmsc4.js +0 -355
  68. package/dist/chunks/index-2ajhmsc4.js.map +0 -13
  69. package/dist/chunks/index-58kks6a8.js.map +0 -13
  70. package/dist/chunks/index-7q99hf1z.js +0 -87
  71. package/dist/chunks/index-7q99hf1z.js.map +0 -10
  72. package/dist/chunks/index-9zqbrv2z.js.map +0 -10
  73. package/dist/chunks/index-cv36cyna.js +0 -180
  74. package/dist/chunks/index-cv36cyna.js.map +0 -10
  75. package/dist/chunks/index-q1w84fv9.js.map +0 -15
  76. package/dist/chunks/index-rew95tbg.js +0 -272
  77. package/dist/chunks/index-rew95tbg.js.map +0 -13
  78. package/dist/chunks/index-vtpygsbq.js +0 -17270
  79. package/dist/chunks/index-vtpygsbq.js.map +0 -126
  80. package/dist/chunks/index-wjt6cavj.js.map +0 -10
  81. package/dist/chunks/index-wss3gd3h.js +0 -319
  82. package/dist/chunks/index-wss3gd3h.js.map +0 -13
  83. package/dist/chunks/index-xzb7sx6g.js +0 -221
  84. package/dist/chunks/index-xzb7sx6g.js.map +0 -12
  85. package/dist/embed/index.js +0 -138
  86. package/dist/embed/index.js.map +0 -12
  87. package/dist/local.js +0 -465
  88. package/dist/local.js.map +0 -16
  89. package/dist/preview.js +0 -1456
  90. package/dist/preview.js.map +0 -17
  91. package/dist/react/embed/index.js +0 -117
  92. package/dist/react/embed/index.js.map +0 -10
  93. package/dist/react/index.js +0 -2890
  94. package/dist/react/index.js.map +0 -23
  95. package/dist/react/ui/index.js +0 -3514
  96. package/dist/react/ui/index.js.map +0 -36
  97. package/dist/server.js +0 -334
  98. package/dist/server.js.map +0 -15
  99. package/dist/types/core/time-interval.d.ts +0 -96
  100. package/dist/types/embed/bootstrap.d.ts +0 -5
  101. package/dist/types/embed/bridge.d.ts +0 -12
  102. package/dist/types/embed/host.d.ts +0 -36
  103. package/dist/types/embed/index.d.ts +0 -14
  104. package/dist/types/embed/navigation.d.ts +0 -6
  105. package/dist/types/embed/runtime-html.d.ts +0 -2
  106. package/dist/types/embed/source.d.ts +0 -16
  107. package/dist/types/embed/sql.d.ts +0 -4
  108. package/dist/types/react/actions.d.ts +0 -53
  109. package/dist/types/react/annotations/AnnotationBar.d.ts +0 -30
  110. package/dist/types/react/annotations/AnnotationControls.d.ts +0 -10
  111. package/dist/types/react/annotations/AnnotationEditor.d.ts +0 -16
  112. package/dist/types/react/annotations/AnnotationMarkers.d.ts +0 -19
  113. package/dist/types/react/annotations/AnnotationSelectionLayer.d.ts +0 -12
  114. package/dist/types/react/annotations/AnnotationTarget.d.ts +0 -9
  115. package/dist/types/react/annotations/AnnotationTooltip.d.ts +0 -9
  116. package/dist/types/react/annotations/AnnotationTrigger.d.ts +0 -10
  117. package/dist/types/react/annotations/annotation-editor-state.d.ts +0 -58
  118. package/dist/types/react/annotations/annotation-screenshot.d.ts +0 -4
  119. package/dist/types/react/annotations/annotation-targets.d.ts +0 -34
  120. package/dist/types/react/annotations/getAnnotationProps.d.ts +0 -17
  121. package/dist/types/react/annotations/styles.d.ts +0 -3
  122. package/dist/types/react/annotations/useAnnotationGeometry.d.ts +0 -22
  123. package/dist/types/react/annotations/useDataAppAnnotations.d.ts +0 -22
  124. package/dist/types/react/app-context.d.ts +0 -3
  125. package/dist/types/react/bindings.d.ts +0 -169
  126. package/dist/types/react/content.d.ts +0 -36
  127. package/dist/types/react/date-formatting.d.ts +0 -12
  128. package/dist/types/react/details.d.ts +0 -46
  129. package/dist/types/react/embed/bridge.d.ts +0 -21
  130. package/dist/types/react/embed/index.d.ts +0 -7
  131. package/dist/types/react/exploration.d.ts +0 -44
  132. package/dist/types/react/hooks.d.ts +0 -113
  133. package/dist/types/react/index.d.ts +0 -78
  134. package/dist/types/react/injectStyles.d.ts +0 -7
  135. package/dist/types/react/mount.d.ts +0 -13
  136. package/dist/types/react/search-suggestions.d.ts +0 -8
  137. package/dist/types/react/source-owner.d.ts +0 -2
  138. package/dist/types/react/style-contract.d.ts +0 -88
  139. package/dist/types/react/style-validation.d.ts +0 -2
  140. package/dist/types/react/styles.d.ts +0 -8
  141. package/dist/types/react/ui/AboutData.d.ts +0 -73
  142. package/dist/types/react/ui/AltertableLogo.d.ts +0 -3
  143. package/dist/types/react/ui/AppFooter.d.ts +0 -6
  144. package/dist/types/react/ui/AppHeader.d.ts +0 -10
  145. package/dist/types/react/ui/AppLayout.d.ts +0 -10
  146. package/dist/types/react/ui/AppScope.d.ts +0 -7
  147. package/dist/types/react/ui/AppToolbar.d.ts +0 -30
  148. package/dist/types/react/ui/AreaChart.d.ts +0 -7
  149. package/dist/types/react/ui/BarChart.d.ts +0 -6
  150. package/dist/types/react/ui/Breakdown.d.ts +0 -13
  151. package/dist/types/react/ui/Button.d.ts +0 -12
  152. package/dist/types/react/ui/ChartLegend.d.ts +0 -32
  153. package/dist/types/react/ui/Checkbox.d.ts +0 -21
  154. package/dist/types/react/ui/CheckboxGroup.d.ts +0 -7
  155. package/dist/types/react/ui/ChoicePicker.d.ts +0 -39
  156. package/dist/types/react/ui/Comparison.d.ts +0 -14
  157. package/dist/types/react/ui/ComposedChart.d.ts +0 -41
  158. package/dist/types/react/ui/ComposedChartLegend.d.ts +0 -9
  159. package/dist/types/react/ui/ContentSkeleton.d.ts +0 -7
  160. package/dist/types/react/ui/DataApp.d.ts +0 -24
  161. package/dist/types/react/ui/DataAppFrame.d.ts +0 -52
  162. package/dist/types/react/ui/DataBoundary.d.ts +0 -14
  163. package/dist/types/react/ui/DataSection.d.ts +0 -14
  164. package/dist/types/react/ui/DataSectionBoundary.d.ts +0 -30
  165. package/dist/types/react/ui/DataTable.d.ts +0 -29
  166. package/dist/types/react/ui/DataValue.d.ts +0 -9
  167. package/dist/types/react/ui/DataViewToast.d.ts +0 -11
  168. package/dist/types/react/ui/DataWidget.d.ts +0 -37
  169. package/dist/types/react/ui/DateDisplay.d.ts +0 -9
  170. package/dist/types/react/ui/DateRangePicker.d.ts +0 -30
  171. package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -10
  172. package/dist/types/react/ui/DimensionPicker.d.ts +0 -13
  173. package/dist/types/react/ui/EmptyState.d.ts +0 -6
  174. package/dist/types/react/ui/ExplorationActionControl.d.ts +0 -60
  175. package/dist/types/react/ui/ExportControl.d.ts +0 -4
  176. package/dist/types/react/ui/FilterActions.d.ts +0 -10
  177. package/dist/types/react/ui/FilterBar.d.ts +0 -3
  178. package/dist/types/react/ui/FunnelChart.d.ts +0 -20
  179. package/dist/types/react/ui/GettingStarted.d.ts +0 -6
  180. package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -7
  181. package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -16
  182. package/dist/types/react/ui/GradientScroll.d.ts +0 -23
  183. package/dist/types/react/ui/Grid.d.ts +0 -12
  184. package/dist/types/react/ui/GridItem.d.ts +0 -7
  185. package/dist/types/react/ui/HelpPopover.d.ts +0 -21
  186. package/dist/types/react/ui/IconButton.d.ts +0 -19
  187. package/dist/types/react/ui/InspectionContext.d.ts +0 -12
  188. package/dist/types/react/ui/InspectionProvider.d.ts +0 -29
  189. package/dist/types/react/ui/JourneyChart.d.ts +0 -10
  190. package/dist/types/react/ui/Kbd.d.ts +0 -7
  191. package/dist/types/react/ui/LineChart.d.ts +0 -7
  192. package/dist/types/react/ui/LiveControl.d.ts +0 -10
  193. package/dist/types/react/ui/Menu.d.ts +0 -13
  194. package/dist/types/react/ui/MetricWidget.d.ts +0 -51
  195. package/dist/types/react/ui/NumberField.d.ts +0 -27
  196. package/dist/types/react/ui/NumberFilterPicker.d.ts +0 -11
  197. package/dist/types/react/ui/PeriodSummary.d.ts +0 -17
  198. package/dist/types/react/ui/PickerField.d.ts +0 -23
  199. package/dist/types/react/ui/PieChart.d.ts +0 -11
  200. package/dist/types/react/ui/PopoverSurface.d.ts +0 -5
  201. package/dist/types/react/ui/PresentStory.d.ts +0 -30
  202. package/dist/types/react/ui/QueryList.d.ts +0 -14
  203. package/dist/types/react/ui/RadioGroup.d.ts +0 -18
  204. package/dist/types/react/ui/Ranking.d.ts +0 -13
  205. package/dist/types/react/ui/RefreshControl.d.ts +0 -9
  206. package/dist/types/react/ui/RequestHint.d.ts +0 -20
  207. package/dist/types/react/ui/RetentionChart.d.ts +0 -27
  208. package/dist/types/react/ui/ScatterChart.d.ts +0 -17
  209. package/dist/types/react/ui/SearchField.d.ts +0 -23
  210. package/dist/types/react/ui/SearchInput.d.ts +0 -10
  211. package/dist/types/react/ui/SearchMatch.d.ts +0 -6
  212. package/dist/types/react/ui/SearchTypeahead.d.ts +0 -15
  213. package/dist/types/react/ui/SectionHeading.d.ts +0 -8
  214. package/dist/types/react/ui/Select.d.ts +0 -22
  215. package/dist/types/react/ui/SelectionMark.d.ts +0 -5
  216. package/dist/types/react/ui/Sheet.d.ts +0 -21
  217. package/dist/types/react/ui/Skeleton.d.ts +0 -8
  218. package/dist/types/react/ui/Stack.d.ts +0 -7
  219. package/dist/types/react/ui/StaticDataApp.d.ts +0 -4
  220. package/dist/types/react/ui/StatusPanel.d.ts +0 -10
  221. package/dist/types/react/ui/TableWidget.d.ts +0 -67
  222. package/dist/types/react/ui/Tabs.d.ts +0 -10
  223. package/dist/types/react/ui/TextContent.d.ts +0 -4
  224. package/dist/types/react/ui/TextWidget.d.ts +0 -20
  225. package/dist/types/react/ui/ThemeSelector.d.ts +0 -12
  226. package/dist/types/react/ui/Toast.d.ts +0 -8
  227. package/dist/types/react/ui/Tooltip.d.ts +0 -23
  228. package/dist/types/react/ui/TooltipSurface.d.ts +0 -3
  229. package/dist/types/react/ui/TrendChart.d.ts +0 -5
  230. package/dist/types/react/ui/UpdatedAt.d.ts +0 -9
  231. package/dist/types/react/ui/VariableBar.d.ts +0 -6
  232. package/dist/types/react/ui/VisualizationWidget.d.ts +0 -43
  233. package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -6
  234. package/dist/types/react/ui/WidgetEvidence.d.ts +0 -12
  235. package/dist/types/react/ui/WidgetViewTabs.d.ts +0 -16
  236. package/dist/types/react/ui/chart-data.d.ts +0 -36
  237. package/dist/types/react/ui/chart-date-axis.d.ts +0 -15
  238. package/dist/types/react/ui/chart-interaction.d.ts +0 -27
  239. package/dist/types/react/ui/chart-primitives.d.ts +0 -22
  240. package/dist/types/react/ui/chart-time.d.ts +0 -19
  241. package/dist/types/react/ui/chartColor.d.ts +0 -2
  242. package/dist/types/react/ui/classNames.d.ts +0 -1
  243. package/dist/types/react/ui/csv-export.d.ts +0 -19
  244. package/dist/types/react/ui/data-context.d.ts +0 -76
  245. package/dist/types/react/ui/data-identifiers.d.ts +0 -32
  246. package/dist/types/react/ui/icons.d.ts +0 -49
  247. package/dist/types/react/ui/index.d.ts +0 -111
  248. package/dist/types/react/ui/journey-flow.d.ts +0 -49
  249. package/dist/types/react/ui/keyboard.d.ts +0 -6
  250. package/dist/types/react/ui/metric-comparison.d.ts +0 -30
  251. package/dist/types/react/ui/metric.d.ts +0 -11
  252. package/dist/types/react/ui/presentation.d.ts +0 -25
  253. package/dist/types/react/ui/search.d.ts +0 -6
  254. package/dist/types/react/ui/searchItems.d.ts +0 -36
  255. package/dist/types/react/ui/shortcuts.d.ts +0 -45
  256. package/dist/types/react/ui/story.d.ts +0 -20
  257. package/dist/types/react/ui/use-chart-scroll-to-end.d.ts +0 -2
  258. package/dist/types/react/ui/useAppAppearance.d.ts +0 -3
  259. package/dist/types/react/ui/useDataAppPresentation.d.ts +0 -3
  260. package/dist/types/react/ui/useSvgId.d.ts +0 -2
  261. package/dist/types/react/ui/variables.d.ts +0 -38
  262. package/dist/types/react/ui/widget-views.d.ts +0 -3
  263. package/dist/types/react/view-control-bar.d.ts +0 -18
  264. package/dist/types/react/view-controls.d.ts +0 -20
  265. package/dist/types/react/view-runtime.d.ts +0 -34
  266. package/dist/types/react/view.d.ts +0 -87
  267. package/dist/types/react/widgets.d.ts +0 -90
  268. package/dist/types/server/local.d.ts +0 -19
  269. package/dist/types/server/preview/host.d.ts +0 -1
  270. package/dist/types/server/preview/index.d.ts +0 -16
  271. package/dist/types/server/reload-channel.d.ts +0 -6
  272. package/dist/worker.js +0 -106
  273. package/examples/starter-data-app/index.tsx +0 -193
  274. package/examples/starter-local-data-app/.bun-version +0 -1
  275. package/examples/starter-local-data-app/.node-version +0 -1
  276. package/examples/starter-local-data-app/.oxfmtrc.json +0 -4
  277. package/examples/starter-local-data-app/.oxlintrc.json +0 -33
  278. package/examples/starter-local-data-app/AGENTS.md +0 -22
  279. package/examples/starter-local-data-app/README.md +0 -54
  280. package/examples/starter-local-data-app/app.ts +0 -28
  281. package/examples/starter-local-data-app/bunfig.toml +0 -2
  282. package/examples/starter-local-data-app/package.json +0 -33
  283. package/examples/starter-local-data-app/src/App.tsx +0 -8
  284. package/examples/starter-local-data-app/src/assets.d.ts +0 -1
  285. package/examples/starter-local-data-app/src/data-context.ts +0 -21
  286. package/examples/starter-local-data-app/src/favicon.svg +0 -13
  287. package/examples/starter-local-data-app/src/index.html +0 -14
  288. package/examples/starter-local-data-app/src/main.tsx +0 -7
  289. package/examples/starter-local-data-app/src/operations.ts +0 -6
  290. package/examples/starter-local-data-app/src/server.ts +0 -6
  291. package/examples/starter-local-data-app/tsconfig.json +0 -21
@@ -1,16 +0,0 @@
1
- import { type DataAppHost, type DataAppHostOptions } from './host.js';
2
- export type DataAppSource = {
3
- type: 'url';
4
- url: string;
5
- } | {
6
- type: 'bundle';
7
- /** Omit to use the packaged, network-isolated data document. */
8
- bootstrapUrl?: string;
9
- javascript: string;
10
- };
11
- export type DataAppSourceOptions = DataAppHostOptions & {
12
- source: DataAppSource;
13
- startupTimeoutMs?: number;
14
- };
15
- /** Owns loading and sandbox policy. Dispose before replacing the source or retrying. */
16
- export declare function attachDataAppSource({ iframe, source, presentation, logger, onMessage, onStatusChange, onDiagnostic, startupTimeoutMs, }: DataAppSourceOptions): DataAppHost;
@@ -1,4 +0,0 @@
1
- import type { Lakehouse } from '../core/contract.js';
2
- import { type MessageContext, type SqlQueryInput } from '../core/messages.js';
3
- /** Authorize every SQL request and supply a backend that independently enforces access and query limits. */
4
- export declare function createSqlQueryHandler(authorize: (query: SqlQueryInput, context: MessageContext) => Promise<Lakehouse>): (input: SqlQueryInput, context: MessageContext) => Promise<import("../core/contract.js").QueryResult<unknown[]>>;
@@ -1,53 +0,0 @@
1
- import { FilterTarget, BreakdownTarget } from './exploration.js';
2
- import type { DetailView } from './details.js';
3
- import type { ItemActions } from './ui/ExplorationActionControl.js';
4
- type ActionCondition<Row> = {
5
- label: string;
6
- when?: (row: Row) => boolean;
7
- };
8
- type DetailAction<Row, Input, DestinationInput> = ActionCondition<Row> & {
9
- label: string;
10
- target: DetailView<any, DestinationInput>;
11
- input: (row: Row, displayedInput: Input) => DestinationInput;
12
- };
13
- export type ActionDeclaration<Row, Input> = ActionCondition<Row> & ({
14
- kind: 'detail';
15
- target: DetailView<any, any>;
16
- input: (row: Row, input: Input) => unknown;
17
- } | {
18
- kind: 'filter';
19
- target: object;
20
- values: (row: Row) => object;
21
- breakdown?: {
22
- target: BreakdownTarget<any>;
23
- value: (row: Row) => string;
24
- };
25
- });
26
- export declare class ActionBuilder<Row, Input> {
27
- detail<DestinationInput>(config: DetailAction<Row, Input, DestinationInput>): ActionDeclaration<Row, Input>;
28
- filter<Patch extends object, const Values extends NoInfer<Patch>, Value extends string = never>(config: ActionCondition<Row> & {
29
- label: string;
30
- target: FilterTarget<Patch>;
31
- values: (row: Row) => Values & NoInfer<Patch>;
32
- breakdown?: {
33
- target: BreakdownTarget<Value>;
34
- value: (row: Row) => NoInfer<Value>;
35
- };
36
- }): ActionDeclaration<Row, Input>;
37
- }
38
- declare const actionTypes: unique symbol;
39
- /** Actions belong to one metric or dataset; its widget supplies displayed rows and input. */
40
- export declare class ExplorationActions<Row, Input> {
41
- readonly [actionTypes]: {
42
- row: Row;
43
- input: Input;
44
- };
45
- }
46
- export declare function defineActions<Row, Input, const Actions extends Record<string, ActionDeclaration<Row, Input>>>(binding: object, build: (action: ActionBuilder<Row, Input>) => Actions, options?: {
47
- primary?: keyof Actions & string;
48
- }): ExplorationActions<Row, Input>;
49
- export declare function resolveActions<Row, Input>(set: ExplorationActions<Row, Input> | undefined, binding: object, viewOwner: object | undefined, source: {
50
- loading?: boolean;
51
- input?: Input;
52
- }, open: (target: DetailView<any, any>, input: unknown, trigger?: HTMLElement | SVGElement) => void): ItemActions<Row>;
53
- export {};
@@ -1,30 +0,0 @@
1
- import { type Ref } from 'react';
2
- import type { Theme } from '../../core/appearance.js';
3
- import { type DataAppAnnotationDraft } from '../../core/annotations.js';
4
- export type AnnotationBarHandle = {
5
- /** Submit through the same guards, pending state, and retry feedback as the Send button. */
6
- send: () => Promise<void>;
7
- };
8
- export type AnnotationBarProps = {
9
- ref?: Ref<AnnotationBarHandle>;
10
- annotations: readonly DataAppAnnotationDraft[];
11
- active?: boolean;
12
- theme?: Theme;
13
- disabled?: boolean;
14
- deletedAnnotationId?: string;
15
- onUndoDelete?: (id: string) => void;
16
- onDismissUndo?: () => void;
17
- hasUnsavedChanges?: boolean;
18
- pinsVisible: boolean;
19
- onPinsVisibleChange: (visible: boolean) => void;
20
- onSelect: (id: string) => void;
21
- onDelete: (id: string) => void;
22
- onClear: () => void;
23
- /** Let host apps use their existing confirmation dialog. */
24
- requestDiscard?: (discard: () => void) => void;
25
- /** Resolve only after the outer application's agent API accepts this snapshot. */
26
- onSend: (annotations: readonly DataAppAnnotationDraft[]) => Promise<void>;
27
- onClose: () => void;
28
- };
29
- /** Host-owned batch controls. Collection changes and agent submission stay with the outer app. */
30
- export declare function AnnotationBar({ ref, annotations, active, theme, disabled, deletedAnnotationId, onUndoDelete, onDismissUndo, hasUnsavedChanges, pinsVisible, onPinsVisibleChange, onSelect, onDelete, onClear, requestDiscard, onSend, onClose, }: AnnotationBarProps): import("react").JSX.Element | null;
@@ -1,10 +0,0 @@
1
- import { type ComponentRef, type RefObject } from 'react';
2
- import type { DataAppAnnotationPresentation } from '../../core/annotations.js';
3
- type AnnotationControlsProps = {
4
- rootRef: RefObject<ComponentRef<'div'> | null>;
5
- presentation: DataAppAnnotationPresentation;
6
- displayedInput?: unknown;
7
- view?: string;
8
- };
9
- export declare function AnnotationControls({ rootRef, presentation, displayedInput, view, }: AnnotationControlsProps): import("react").JSX.Element;
10
- export {};
@@ -1,16 +0,0 @@
1
- import type { ComponentRef, CSSProperties, Ref } from 'react';
2
- import type { AnnotationEditorState } from './annotation-editor-state.js';
3
- type AnnotationEditorProps = {
4
- editor: AnnotationEditorState;
5
- editorRef: Ref<ComponentRef<'section'>>;
6
- textareaRef: Ref<ComponentRef<'textarea'>>;
7
- style: CSSProperties;
8
- disabled: boolean;
9
- onCommentChange: (comment: string) => void;
10
- onSubmit: () => void;
11
- onSend: () => void;
12
- onRetryScreenshot: () => void;
13
- onShakeEnd: () => void;
14
- };
15
- export declare function AnnotationEditor({ editor, editorRef, textareaRef, style, disabled, onCommentChange, onSubmit, onSend, onRetryScreenshot, onShakeEnd, }: AnnotationEditorProps): import("react").JSX.Element;
16
- export {};
@@ -1,19 +0,0 @@
1
- import type { AnnotationPoint, AnnotationRect } from './annotation-targets.js';
2
- export type AnnotationPin = {
3
- id: string;
4
- number: number;
5
- anchor: AnnotationPoint;
6
- rect: AnnotationRect;
7
- };
8
- type AnnotationMarkersProps = {
9
- outline?: AnnotationRect;
10
- rounded: boolean;
11
- pins: AnnotationPin[];
12
- pinsVisible: boolean;
13
- disabled: boolean;
14
- showHint: boolean;
15
- hasDuplicateIds: boolean;
16
- onOpenAnnotation: (id: string) => void;
17
- };
18
- export declare function AnnotationMarkers({ outline, rounded, pins, pinsVisible, disabled, showHint, hasDuplicateIds, onOpenAnnotation, }: AnnotationMarkersProps): import("react").JSX.Element;
19
- export {};
@@ -1,12 +0,0 @@
1
- import type { AnnotationTargetElement, AnnotationPoint, AnnotationRect } from './annotation-targets.js';
2
- type AnnotationSelectionLayerProps = {
3
- scope: HTMLElement;
4
- targets: AnnotationTargetElement[];
5
- onHover: (target: AnnotationTargetElement | undefined) => void;
6
- onSelect: (target: AnnotationTargetElement, point?: AnnotationPoint, region?: AnnotationRect) => void;
7
- disabled: boolean;
8
- editing: boolean;
9
- };
10
- /** Own pointer selection and keyboard focus while the app underneath is inert. */
11
- export declare function AnnotationSelectionLayer({ scope, targets, onHover, onSelect, disabled, editing, }: AnnotationSelectionLayerProps): import("react").JSX.Element;
12
- export {};
@@ -1,9 +0,0 @@
1
- import type { ComponentPropsWithRef } from 'react';
2
- import type { WidgetEvidence } from '../ui/WidgetEvidence.js';
3
- export type AnnotationTargetProps = ComponentPropsWithRef<'div'> & {
4
- annotationId: string;
5
- label: string;
6
- evidence?: WidgetEvidence;
7
- };
8
- /** A stable feedback target for app-owned content outside the built-in widgets. */
9
- export declare function AnnotationTarget({ annotationId, label, evidence, ...props }: AnnotationTargetProps): import("react").JSX.Element;
@@ -1,9 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import type { Theme } from '../../core/appearance.js';
3
- type AnnotationTooltipProps = {
4
- content: ReactNode;
5
- children: ReactNode;
6
- theme?: Theme;
7
- };
8
- export declare function AnnotationTooltip({ content, children, theme, }: AnnotationTooltipProps): import("react").JSX.Element;
9
- export {};
@@ -1,10 +0,0 @@
1
- import type { ComponentRef, Ref } from 'react';
2
- type AnnotationTriggerProps = {
3
- buttonRef: Ref<ComponentRef<'button'>>;
4
- active: boolean;
5
- disabled: boolean;
6
- count: number;
7
- onToggle: () => void;
8
- };
9
- export declare function AnnotationTrigger({ buttonRef, active, disabled, count, onToggle, }: AnnotationTriggerProps): import("react").JSX.Element;
10
- export {};
@@ -1,58 +0,0 @@
1
- import type { DataAppAnnotationDraft } from '../../core/annotations.js';
2
- import type { AnnotationTargetElement } from './annotation-targets.js';
3
- export type AnnotationEditorState = {
4
- target: AnnotationTargetElement;
5
- draft: DataAppAnnotationDraft;
6
- annotationId?: string;
7
- /** Epoch milliseconds, comparable to host interaction timestamps. */
8
- openedAt: number;
9
- comment: string;
10
- captureStatus: 'capturing' | 'ready' | 'failed';
11
- error: string;
12
- discardArmed: boolean;
13
- shaking: boolean;
14
- };
15
- type AnnotationControlsState = {
16
- annotationModeActive: boolean;
17
- observedActive: boolean;
18
- hoveredTarget?: AnnotationTargetElement;
19
- editor?: AnnotationEditorState;
20
- saving: boolean;
21
- };
22
- type AnnotationControlsAction = {
23
- type: 'annotationModeChanged';
24
- active: boolean;
25
- } | {
26
- type: 'externalModeObserved';
27
- active: boolean;
28
- } | {
29
- type: 'targetHovered';
30
- target?: AnnotationTargetElement;
31
- } | {
32
- type: 'editorOpened';
33
- editor: AnnotationEditorState;
34
- } | {
35
- type: 'editorClosed';
36
- } | {
37
- type: 'commentChanged';
38
- comment: string;
39
- } | {
40
- type: 'captureCompleted';
41
- draftId: string;
42
- succeeded: boolean;
43
- } | {
44
- type: 'editorEscaped';
45
- hasUnsavedChanges: boolean;
46
- } | {
47
- type: 'shakeFinished';
48
- } | {
49
- type: 'saveStarted';
50
- } | {
51
- type: 'saveFailed';
52
- error: string;
53
- } | {
54
- type: 'saveFinished';
55
- };
56
- export declare function createAnnotationControlsState(active: boolean): AnnotationControlsState;
57
- export declare function annotationControlsReducer(state: AnnotationControlsState, action: AnnotationControlsAction): AnnotationControlsState;
58
- export {};
@@ -1,4 +0,0 @@
1
- import type { AnnotationRect } from './annotation-targets.js';
2
- import type { DataAppAnnotationDraft } from '../../core/annotations.js';
3
- /** Capture the visible target at selection time; never include annotation controls. */
4
- export declare function captureAnnotationScreenshot(element: HTMLElement, region?: AnnotationRect): Promise<NonNullable<DataAppAnnotationDraft['context']['screenshot']>>;
@@ -1,34 +0,0 @@
1
- export type AnnotationPoint = {
2
- x: number;
3
- y: number;
4
- };
5
- export type AnnotationRect = {
6
- x: number;
7
- y: number;
8
- width: number;
9
- height: number;
10
- };
11
- export type AnnotationTargetElement = {
12
- element: HTMLElement;
13
- id: string;
14
- label: string;
15
- kind: 'widget' | 'element' | 'app';
16
- };
17
- export declare function discoverAnnotationTargets(root: HTMLElement | null): {
18
- targets: AnnotationTargetElement[];
19
- hasDuplicateIds: boolean;
20
- };
21
- export declare function annotationGeometry(element: HTMLElement): AnnotationRect;
22
- export declare function annotationPoint(rect: AnnotationRect, point?: AnnotationPoint): {
23
- cursor: AnnotationPoint;
24
- anchor: {
25
- x: number;
26
- y: number;
27
- };
28
- };
29
- /** The iframe document is a crop surface, never a selectable global-layout target. */
30
- export declare function annotationRoot(root: HTMLElement | null): AnnotationTargetElement | undefined;
31
- export declare function indexAnnotationTargets(root: HTMLElement | null): Map<string, AnnotationTargetElement>;
32
- export declare function findAnnotationTarget(root: HTMLElement | null, id: string | undefined): AnnotationTargetElement | undefined;
33
- export declare function normalizeAnnotationRect(area: AnnotationRect, target: AnnotationRect): AnnotationRect;
34
- export declare function projectAnnotationRect(area: AnnotationRect, target: AnnotationRect): AnnotationRect;
@@ -1,17 +0,0 @@
1
- import type { WidgetEvidence } from '../ui/WidgetEvidence.js';
2
- type AnnotationPropsOptions = {
3
- id: string;
4
- label?: string;
5
- fallbackId?: string;
6
- evidence?: WidgetEvidence;
7
- kind?: 'widget' | 'element';
8
- };
9
- export declare function getAnnotationProps({ id, label, fallbackId, evidence, kind, }: AnnotationPropsOptions): {
10
- 'data-annotation-id': string;
11
- 'data-annotation-fallback-id': string | undefined;
12
- 'data-annotation-label': string | undefined;
13
- 'data-annotation-kind': "element" | "widget";
14
- 'data-annotation-queries': string;
15
- 'data-annotation-glossary': string;
16
- };
17
- export {};
@@ -1,3 +0,0 @@
1
- import type { DataAppStylesOptions } from '../styles.js';
2
- /** Install only the outer-frame annotation controls; leave host page typography and layout intact. */
3
- export declare function injectDataAppAnnotationStyles(options?: DataAppStylesOptions): HTMLStyleElement;
@@ -1,22 +0,0 @@
1
- import { type ComponentRef, type RefObject } from 'react';
2
- import type { DataAppAnnotationPresentation } from '../../core/annotations.js';
3
- import { type AnnotationRect, type AnnotationTargetElement } from './annotation-targets.js';
4
- import type { AnnotationPin } from './AnnotationMarkers.js';
5
- type AnnotationRootRef = RefObject<ComponentRef<'div'> | null>;
6
- export declare function useAnnotationTargets(rootRef: AnnotationRootRef, active: boolean): {
7
- targets: AnnotationTargetElement[];
8
- hasDuplicateIds: boolean;
9
- } & {
10
- scope?: HTMLElement;
11
- };
12
- type AnnotationGeometryOptions = {
13
- rootRef: AnnotationRootRef;
14
- target?: AnnotationTargetElement;
15
- region?: AnnotationRect;
16
- annotations: DataAppAnnotationPresentation['targets'];
17
- };
18
- export declare function useAnnotationGeometry({ rootRef, target, region, annotations, }: AnnotationGeometryOptions): {
19
- pins: AnnotationPin[];
20
- outline?: AnnotationRect;
21
- };
22
- export {};
@@ -1,22 +0,0 @@
1
- /** Bind annotation delivery to this app's current iframe bridge. The host owns storage and submission. */
2
- export declare function useDataAppAnnotations(): {
3
- requestSendAnnotations(options?: {
4
- signal?: AbortSignal;
5
- }): Promise<null>;
6
- reportAnnotationEditorState(state: {
7
- hasUnsavedChanges: boolean;
8
- }, options?: {
9
- signal?: AbortSignal;
10
- }): Promise<null>;
11
- addAnnotation(draft: import("../../core/annotations.js").DataAppAnnotationDraft, options?: {
12
- signal?: AbortSignal;
13
- }): Promise<null>;
14
- updateAnnotation(id: string, comment: string, options?: {
15
- signal?: AbortSignal;
16
- }): Promise<null>;
17
- requestAnnotationModeChange(request: {
18
- active: boolean;
19
- }, options?: {
20
- signal?: AbortSignal;
21
- }): Promise<null>;
22
- };
@@ -1,3 +0,0 @@
1
- import type { DataAppConfig } from '../core/config.js';
2
- export declare const DataAppContext: import("react").Context<DataAppConfig | null>;
3
- export declare function useDataApp(): DataAppConfig;
@@ -1,169 +0,0 @@
1
- import { type DetailNavigation } from './details.js';
2
- import { type ActionBuilder, type ExplorationActions, type ActionDeclaration } from './actions.js';
3
- import type { EvidenceDeclaration } from './ui/data-context.js';
4
- import type { SearchSuggestion } from './ui/SearchTypeahead.js';
5
- import { type ReactNode } from 'react';
6
- import type { DateFormat } from '../core/format.js';
7
- import type { DateRangeRequest } from '../core/contract.js';
8
- import type { DataView, DisplayedSnapshot } from '../core/data-view.js';
9
- import type { MetricFormat } from '../core/format.js';
10
- import type { DataReading, MetricValues } from '../core/reading.js';
11
- import type { CsvCell, CsvTable, CsvExport } from './ui/csv-export.js';
12
- import type { MetricDefinition } from './ui/metric.js';
13
- import type { EmptyContent } from './ui/presentation.js';
14
- import type { TableWidgetColumn } from './ui/TableWidget.js';
15
- import type { WidgetEvidence } from './ui/WidgetEvidence.js';
16
- import { DetailView } from './details.js';
17
- /** Displayed data, or an initial loading reading. Pending filter values are never a source. */
18
- export type ViewSource<Data, Input> = {
19
- loading: true;
20
- } | {
21
- loading?: false;
22
- data: Data;
23
- input: Input;
24
- };
25
- type SourceReading<Source, Value> = Source extends {
26
- loading: true;
27
- } ? {
28
- loading: true;
29
- } : {
30
- loading: false;
31
- value: Value;
32
- };
33
- /** Keys supply IDs; accessors supply raw CSV values. Formats affect display only. */
34
- export type DatasetColumn<Row> = {
35
- label?: string;
36
- } & ({
37
- value: (row: Row) => CsvCell;
38
- format?: (row: Row) => ReactNode;
39
- } | {
40
- value: (row: Row) => number | null | undefined;
41
- format: MetricFormat;
42
- } | {
43
- value: (row: Row) => string | number | null | undefined;
44
- format: Extract<DateFormat, {
45
- kind: 'dateTime';
46
- }>;
47
- } | {
48
- value: (row: Row) => string | null | undefined;
49
- format: Extract<DateFormat, {
50
- kind: 'date';
51
- }>;
52
- });
53
- export type DatasetDefinition<Data, Input, Row, Evidence = WidgetEvidence> = {
54
- name: string;
55
- select: (data: Data, input: Input) => readonly Row[];
56
- columns: Record<string, DatasetColumn<NoInfer<Row>>>;
57
- rowKey: (row: NoInfer<Row>) => string | number;
58
- evidence: Evidence;
59
- emptyFallback?: EmptyContent;
60
- /** Declare for records whose titles are useful query completions; omit for aggregate rows. */
61
- suggestions?: DatasetSuggestionOptions<Row>;
62
- };
63
- export type DatasetSuggestionOptions<Row> = {
64
- title: (row: Row) => string;
65
- description?: (row: Row) => string;
66
- /** Override query completion with an app action. */
67
- onSelect?: (row: Row) => void;
68
- };
69
- /** Authoring references are registered by the owning view. */
70
- export type DatasetDeclaration<Data, Input, Row> = DatasetDefinition<Data, Input, Row, EvidenceDeclaration>;
71
- /** Real view ownership and registered references, shared by metrics and datasets. */
72
- export declare class RegisteredBinding {
73
- #private;
74
- constructor(owner?: object, evidence?: WidgetEvidence);
75
- /** @internal */
76
- static owner(binding: RegisteredBinding): object | undefined;
77
- protected assertSource(source: object): void;
78
- static evidence(binding: RegisteredBinding, owner: object): WidgetEvidence;
79
- }
80
- export declare function registeredEvidence(binding: RegisteredBinding, owner: object): WidgetEvidence;
81
- export declare class ExportDataset<Data, Input> extends RegisteredBinding {
82
- #private;
83
- readonly name: string;
84
- /** @internal Undefined means this dataset declares no record suggestions. */
85
- readSearchSuggestions(_source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
86
- constructor(name: string, csv: (snapshot: DisplayedSnapshot<Data, Input>) => CsvTable, owner?: object, evidence?: WidgetEvidence);
87
- static csv<Data, Input>(dataset: ExportDataset<Data, Input>, snapshot: DisplayedSnapshot<Data, Input>): CsvTable;
88
- }
89
- export declare class Dataset<Data, Input, Row> extends ExportDataset<Data, Input> {
90
- #private;
91
- readonly evidence: WidgetEvidence;
92
- constructor(definition: DatasetDefinition<Data, Input, Row>, owner?: object, timeZone?: string);
93
- actions<const Actions extends Record<string, ActionDeclaration<Row, Input>>>(build: (action: ActionBuilder<Row, Input>) => Actions, options?: {
94
- primary?: keyof Actions & string;
95
- }): ExplorationActions<Row, Input>;
96
- readSearchSuggestions(source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
97
- read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, readonly Row[]>;
98
- static table<Data, Input, Row>(dataset: Dataset<Data, Input, Row>, source: ViewSource<Data, Input>): {
99
- title: string;
100
- columns: [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
101
- rowKey: (row: Row) => string | number;
102
- evidence: WidgetEvidence;
103
- emptyFallback: EmptyContent;
104
- reading: {
105
- loading: true;
106
- } | {
107
- loading: false;
108
- value: readonly Row[];
109
- };
110
- };
111
- }
112
- export declare function bindDataset<Data, Input, Row>(definition: DatasetDefinition<Data, Input, Row>, owner?: object, timeZone?: string): Dataset<Data, Input, Row>;
113
- export declare function datasetTable<Data, Input, Row>(dataset: Dataset<Data, Input, Row>, source: ViewSource<Data, Input>): {
114
- title: string;
115
- columns: [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
116
- rowKey: (row: Row) => string | number;
117
- evidence: WidgetEvidence;
118
- emptyFallback: EmptyContent;
119
- reading: {
120
- loading: true;
121
- } | {
122
- loading: false;
123
- value: readonly Row[];
124
- };
125
- };
126
- export declare function datasetCsv<Data, Input>(dataset: ExportDataset<Data, Input>, snapshot: DisplayedSnapshot<Data, Input>): CsvTable;
127
- export declare class Metric<Data, Input> extends RegisteredBinding {
128
- #private;
129
- readonly definition: MetricDefinition;
130
- constructor(definition: MetricDefinition, select: (data: Data, input: Input) => MetricValues, date?: (input: Input) => DateRangeRequest, owner?: object);
131
- read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, MetricValues & {
132
- period?: DateRangeRequest;
133
- }>;
134
- records<DetailData, DetailInput>(options: {
135
- target: DetailView<DetailData, DetailInput>;
136
- input: (displayedInput: Input) => DetailInput;
137
- }): MetricRecords<Data, Input, DetailData, DetailInput>;
138
- actions<const Actions extends Record<string, ActionDeclaration<void, Input>>>(build: (action: ActionBuilder<void, Input>) => Actions, options?: {
139
- primary?: keyof Actions & string;
140
- }): ExplorationActions<void, Input>;
141
- }
142
- /** A metric-owned record destination. It can only render from that metric's displayed source. */
143
- export declare class MetricRecords<Data, Input, DetailData, DetailInput> {
144
- #private;
145
- constructor(metric: Metric<Data, Input>, target: DetailView<DetailData, DetailInput>, input: (displayedInput: Input) => DetailInput);
146
- render(source: ViewSource<Data, Input>, navigation?: DetailNavigation): {
147
- scope: string;
148
- content: import("react").FunctionComponentElement<{
149
- content: import("./details.js").DetailContent<any, any>;
150
- input: any;
151
- navigation?: DetailNavigation;
152
- }>;
153
- } | undefined;
154
- static render<Data, Input, DetailData, DetailInput>(records: MetricRecords<Data, Input, DetailData, DetailInput>, metric: Metric<Data, Input>, source: ViewSource<Data, Input>, navigation?: DetailNavigation): {
155
- scope: string;
156
- content: import("react").FunctionComponentElement<{
157
- content: import("./details.js").DetailContent<any, any>;
158
- input: any;
159
- navigation?: DetailNavigation;
160
- }>;
161
- } | undefined;
162
- }
163
- export declare function bindMetric<Data, Input>(definition: MetricDefinition, select: (data: Data, input: Input) => MetricValues, date?: (input: Input) => DateRangeRequest, owner?: object): Metric<Data, Input>;
164
- export declare function displayedScope<Data, Input>(view: DataView<Data, Input>, describeInput: (input: Input) => string): DataReading<string>;
165
- export declare function exportDatasets<Data, Input>(datasets: readonly [
166
- ExportDataset<Data, Input>,
167
- ...ExportDataset<Data, Input>[]
168
- ], snapshot: DisplayedSnapshot<Data, Input>, scope: string, appTitle: string): CsvExport;
169
- export {};
@@ -1,36 +0,0 @@
1
- import type { DeclaredView } from './view-runtime.js';
2
- import type { ReactNode } from 'react';
3
- import type { DataReading } from '../core/reading.js';
4
- export type DataContentState<Data, Input> = {
5
- scope: DataReading<string>;
6
- } & ({
7
- loading: true;
8
- data?: never;
9
- input?: never;
10
- } | {
11
- loading: false;
12
- data: Data;
13
- input: Input;
14
- });
15
- /** Content receives only displayed data, its original input, and the derived scope. */
16
- export declare function defineDataContent<Data, Input>(render: (state: DataContentState<Data, Input>) => ReactNode, options?: {
17
- describeInput?: (input: Input) => string;
18
- }): {
19
- loadingFallback: ReactNode;
20
- children(this: void, data: Data, input: Input): ReactNode;
21
- };
22
- /** A section's request owner and render layout are declared together. */
23
- export declare class ViewContent<Data, Input> {
24
- #private;
25
- constructor(view: DeclaredView<Data, Input>, render: (source: DataContentState<Data, Input>) => ReactNode, describeInput: (input: Input) => string);
26
- static section<Data, Input>(content: ViewContent<Data, Input>): {
27
- loadingFallback: ReactNode;
28
- children(this: void, data: Data, input: Input): ReactNode;
29
- view: DeclaredView<Data, Input, unknown>;
30
- };
31
- }
32
- export declare function sectionContent<Data, Input>(content: ViewContent<Data, Input>): {
33
- loadingFallback: ReactNode;
34
- children(this: void, data: Data, input: Input): ReactNode;
35
- view: DeclaredView<Data, Input, unknown>;
36
- };
@@ -1,12 +0,0 @@
1
- /** The reporting zone belongs to the displayed view, not the browser. */
2
- export declare const DateFormattingContext: import("react").Context<{
3
- timeZone?: string;
4
- }>;
5
- /** Resolve date display defaults for custom charts and narrative. Explicit options override the view and app. */
6
- export declare function useDateFormatting(options?: {
7
- locale?: string;
8
- timeZone?: string;
9
- }): {
10
- locale: string;
11
- timeZone: string;
12
- };
@@ -1,46 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import type { EmptyContent } from './ui/presentation.js';
3
- import type { ViewSource } from './bindings.js';
4
- import type { ViewResult } from './view-runtime.js';
5
- export type DetailViewDefinition<Data, Input> = {
6
- id: string;
7
- title: ReactNode;
8
- /** Validates untrusted navigation input before a detail operation can run. */
9
- parseInput: (input: unknown) => Input;
10
- describeInput: (input: Input) => string;
11
- isEmpty: (data: Data) => boolean;
12
- emptyFallback: EmptyContent;
13
- };
14
- /** A typed, query-backed destination. */
15
- export declare class DetailView<Data, Input> {
16
- #private;
17
- readonly definition: DetailViewDefinition<Data, Input>;
18
- readonly useResult: (input: Input) => ViewResult<Data, Input>;
19
- constructor(definition: DetailViewDefinition<Data, Input>, useResult: (input: Input) => ViewResult<Data, Input>);
20
- content(render: (source: ViewSource<Data, Input>) => ReactNode): DetailContent<Data, Input>;
21
- static content<Data, Input>(target: DetailView<Data, Input>): DetailContent<Data, Input>;
22
- }
23
- /** Validate destination input before it enters either navigation or a lazy records query. */
24
- export declare function parseDetailInput<Data, Input>(target: DetailView<Data, Input>, value: unknown): Input;
25
- /** A destination’s rendered body. Pass these to DataApp.details. */
26
- export declare class DetailContent<Data, Input> {
27
- readonly target: DetailView<Data, Input>;
28
- readonly render: (source: ViewSource<Data, Input>) => ReactNode;
29
- constructor(target: DetailView<Data, Input>, render: (source: ViewSource<Data, Input>) => ReactNode);
30
- }
31
- export type DetailNavigation = {
32
- open<Data, Input>(target: DetailView<Data, Input>, input: Input, trigger?: HTMLElement | SVGElement | null): void;
33
- };
34
- /** Resolve a detail target from an interaction. The destination validates input before fetching. */
35
- export declare function useDetailNavigation(): DetailNavigation;
36
- /** Mounts one replacement sheet for a stack of detail destinations. */
37
- export declare function DetailRoutes({ details, children, }: {
38
- details: readonly DetailContent<any, any>[];
39
- children: ReactNode;
40
- }): import("react").JSX.Element;
41
- /** Render a destination in an inspection tab. The query starts only when that tab mounts. */
42
- export declare function DetailRecords({ content, input, navigation, }: {
43
- content: DetailContent<any, any>;
44
- input: any;
45
- navigation?: DetailNavigation;
46
- }): import("react").JSX.Element;