@altertable/data-app 0.66.0 → 0.67.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 (131) hide show
  1. package/CONTRIBUTING.md +22 -16
  2. package/dist/chunks/{contract-19ckn3n7.js → index-23dktynd.js} +8 -6
  3. package/dist/chunks/index-23dktynd.js.map +10 -0
  4. package/dist/chunks/{contract-havnjmdr.js → index-8qfxv0h5.js} +2272 -1123
  5. package/dist/chunks/index-8qfxv0h5.js.map +108 -0
  6. package/dist/chunks/{contract-rfbakka4.js → index-ag0cgnvq.js} +169 -35
  7. package/dist/chunks/index-ag0cgnvq.js.map +13 -0
  8. package/dist/chunks/index-dq7b35fn.js +307 -0
  9. package/dist/chunks/index-dq7b35fn.js.map +13 -0
  10. package/dist/chunks/{contract-e11m4y7f.js → index-ev2b5aaf.js} +11 -6
  11. package/dist/chunks/{contract-e11m4y7f.js.map → index-ev2b5aaf.js.map} +3 -3
  12. package/dist/chunks/{contract-awa2d5b1.js → index-f5cnbrjz.js} +19 -2
  13. package/dist/chunks/{contract-awa2d5b1.js.map → index-f5cnbrjz.js.map} +4 -3
  14. package/dist/chunks/{contract-13j5zb3c.js → index-ktmvs916.js} +8 -7
  15. package/dist/chunks/index-ktmvs916.js.map +13 -0
  16. package/dist/chunks/index-mt93ff2b.js +28 -0
  17. package/dist/chunks/index-mt93ff2b.js.map +10 -0
  18. package/dist/chunks/{contract-tf8c3qpv.js → index-qd5xgx6y.js} +46 -5
  19. package/dist/chunks/index-qd5xgx6y.js.map +13 -0
  20. package/dist/chunks/{contract-pk603qj7.js → index-x69p7cv7.js} +12 -9
  21. package/dist/chunks/index-x69p7cv7.js.map +10 -0
  22. package/dist/client/index.js +6 -6
  23. package/dist/core/appearance.js +1 -1
  24. package/dist/core/config.js +7 -3
  25. package/dist/core/config.js.map +1 -1
  26. package/dist/core/contract.js +14 -6
  27. package/dist/core/contract.js.map +1 -1
  28. package/dist/core/format.js +1 -1
  29. package/dist/embed/index.js +12 -10
  30. package/dist/embed/index.js.map +4 -4
  31. package/dist/index.js +12 -0
  32. package/dist/index.js.map +9 -0
  33. package/dist/local.js +20 -30
  34. package/dist/local.js.map +7 -8
  35. package/dist/react/embed/index.js +1 -1
  36. package/dist/react/embed/index.js.map +2 -2
  37. package/dist/react/index.js +57 -19
  38. package/dist/react/index.js.map +4 -4
  39. package/dist/react/ui/index.js +836 -178
  40. package/dist/react/ui/index.js.map +15 -9
  41. package/dist/server.js +13 -26
  42. package/dist/server.js.map +6 -7
  43. package/dist/types/client/annotations.d.ts +4 -0
  44. package/dist/types/client/data-client.d.ts +1 -2
  45. package/dist/types/client/iframe.d.ts +4 -2
  46. package/dist/types/core/annotations.d.ts +2 -0
  47. package/dist/types/core/config.d.ts +48 -4
  48. package/dist/types/core/contract.d.ts +20 -12
  49. package/dist/types/core/dimension.d.ts +6 -4
  50. package/dist/types/core/filters.d.ts +44 -0
  51. package/dist/types/core/messages.d.ts +2 -0
  52. package/dist/types/core/operation-types.d.ts +5 -2
  53. package/dist/types/core/operation.d.ts +3 -4
  54. package/dist/types/core/queries.d.ts +16 -0
  55. package/dist/types/core/uuid.d.ts +2 -0
  56. package/dist/types/core/variables.d.ts +32 -13
  57. package/dist/types/embed/runtime-html.d.ts +2 -0
  58. package/dist/types/embed/source.d.ts +2 -1
  59. package/dist/types/index.d.ts +3 -0
  60. package/dist/types/react/annotations/AnnotationBar.d.ts +7 -1
  61. package/dist/types/react/annotations/AnnotationEditor.d.ts +2 -1
  62. package/dist/types/react/annotations/useDataAppAnnotations.d.ts +3 -0
  63. package/dist/types/react/app-context.d.ts +3 -0
  64. package/dist/types/react/index.d.ts +3 -3
  65. package/dist/types/react/mount.d.ts +6 -4
  66. package/dist/types/react/style-contract.d.ts +22 -2
  67. package/dist/types/react/ui/Button.d.ts +3 -3
  68. package/dist/types/react/ui/ChartLegend.d.ts +31 -0
  69. package/dist/types/react/ui/Checkbox.d.ts +15 -4
  70. package/dist/types/react/ui/CheckboxGroup.d.ts +7 -0
  71. package/dist/types/react/ui/{Combobox.d.ts → ChoicePicker.d.ts} +10 -15
  72. package/dist/types/react/ui/ComposedChart.d.ts +41 -0
  73. package/dist/types/react/ui/ComposedChartLegend.d.ts +8 -0
  74. package/dist/types/react/ui/DataAppFrame.d.ts +1 -2
  75. package/dist/types/react/ui/DimensionPicker.d.ts +1 -1
  76. package/dist/types/react/ui/FilterActions.d.ts +10 -0
  77. package/dist/types/react/ui/FilterBar.d.ts +3 -0
  78. package/dist/types/react/ui/GettingStarted.d.ts +2 -4
  79. package/dist/types/react/ui/Menu.d.ts +12 -0
  80. package/dist/types/react/ui/NumberField.d.ts +27 -0
  81. package/dist/types/react/ui/NumberFilterPicker.d.ts +9 -0
  82. package/dist/types/react/ui/PieChart.d.ts +5 -2
  83. package/dist/types/react/ui/RadioGroup.d.ts +18 -0
  84. package/dist/types/react/ui/SearchInput.d.ts +2 -2
  85. package/dist/types/react/ui/Select.d.ts +14 -0
  86. package/dist/types/react/ui/SelectionMark.d.ts +2 -1
  87. package/dist/types/react/ui/TooltipSurface.d.ts +3 -0
  88. package/dist/types/react/ui/chart-data.d.ts +1 -1
  89. package/dist/types/react/ui/chart-primitives.d.ts +20 -0
  90. package/dist/types/react/ui/icons.d.ts +1 -0
  91. package/dist/types/react/ui/index.d.ts +26 -2
  92. package/dist/types/react/ui/keyboard.d.ts +6 -0
  93. package/dist/types/react/ui/shortcuts.d.ts +7 -0
  94. package/dist/types/react/ui/useAppAppearance.d.ts +1 -1
  95. package/dist/types/react/ui/variables.d.ts +4 -2
  96. package/dist/types/react/view-controls.d.ts +3 -1
  97. package/dist/types/server/handler.d.ts +4 -4
  98. package/dist/worker.js +20 -737
  99. package/docs/app-authoring.md +15 -1
  100. package/docs/client.md +8 -8
  101. package/docs/contract.md +42 -20
  102. package/docs/data-context.md +8 -6
  103. package/docs/embed.md +10 -2
  104. package/docs/formatting-and-appearance.md +23 -7
  105. package/docs/hosted-apps.md +9 -2
  106. package/docs/layout.md +1 -1
  107. package/docs/react-embed.md +3 -2
  108. package/docs/react.md +4 -3
  109. package/docs/server-bun.md +1 -1
  110. package/docs/server.md +4 -4
  111. package/docs/styling.md +10 -3
  112. package/docs/ui.md +158 -3
  113. package/docs/variables.md +80 -7
  114. package/docs/views.md +4 -8
  115. package/docs/widgets.md +16 -13
  116. package/examples/starter-data-app/index.tsx +34 -32
  117. package/package.json +16 -11
  118. package/dist/chunks/contract-13j5zb3c.js.map +0 -13
  119. package/dist/chunks/contract-19ckn3n7.js.map +0 -10
  120. package/dist/chunks/contract-h8a6f559.js +0 -286
  121. package/dist/chunks/contract-h8a6f559.js.map +0 -12
  122. package/dist/chunks/contract-havnjmdr.js.map +0 -99
  123. package/dist/chunks/contract-pk603qj7.js.map +0 -10
  124. package/dist/chunks/contract-rfbakka4.js.map +0 -13
  125. package/dist/chunks/contract-tf8c3qpv.js.map +0 -11
  126. package/dist/chunks/contract-wz59z8pq.js +0 -8
  127. package/dist/chunks/contract-wz59z8pq.js.map +0 -10
  128. /package/dist/chunks/{contract-m6n8ctfc.js → index-m6n8ctfc.js} +0 -0
  129. /package/dist/chunks/{contract-m6n8ctfc.js.map → index-m6n8ctfc.js.map} +0 -0
  130. /package/dist/chunks/{contract-mev09s5v.js → index-mev09s5v.js} +0 -0
  131. /package/dist/chunks/{contract-mev09s5v.js.map → index-mev09s5v.js.map} +0 -0
@@ -0,0 +1,20 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { type DotProps, Scatter, XAxis, YAxis, CartesianGrid, Tooltip, type BarProps, type LineProps, type AreaProps } from 'recharts';
3
+ export declare const chartBarFill = "var(--atbl-chart-fill, color-mix(in srgb, var(--atbl-accent) 75%, var(--atbl-surface)))";
4
+ /** Hollow sample marker shared by standalone and composed series. */
5
+ export declare function ChartDot({ active, stroke, fill, r, ...props }: DotProps & {
6
+ active?: boolean;
7
+ }): import("react").JSX.Element;
8
+ /** Shared series defaults; native props override every authored choice. */
9
+ export declare function ChartBar<Row = unknown, Value = number | null>(props: BarProps<Row, Value>): import("react").JSX.Element;
10
+ /** Themed hollow sample dots are enabled by default; dot=false hides them.
11
+ * activeDot independently controls the hovered point. Native dot props and renderers remain available. */
12
+ export declare function ChartLine<Row = unknown, Value = number | null>({ stroke, dot, activeDot, ...props }: LineProps<Row, Value>): import("react").JSX.Element;
13
+ /** Filled series with the same sample-dot and activeDot options as ChartLine. */
14
+ export declare function ChartArea<Row = unknown, Value = number | null>({ stroke, dot, activeDot, ...props }: AreaProps<Row, Value>): import("react").JSX.Element;
15
+ export declare function ChartScatter<Row = unknown, Value = number>(props: ComponentProps<typeof Scatter<Row, Value>>): import("react").JSX.Element;
16
+ export declare function ChartXAxis<Row = unknown, Value = string | number>(props: ComponentProps<typeof XAxis<Row, Value>>): import("react").JSX.Element;
17
+ export declare function ChartYAxis<Row = unknown, Value = number>(props: ComponentProps<typeof YAxis<Row, Value>>): import("react").JSX.Element;
18
+ export declare function ChartGrid(props: ComponentProps<typeof CartesianGrid>): import("react").JSX.Element;
19
+ /** Uses the same surface as single-series inspection; Recharts owns interaction. */
20
+ export declare function ChartTooltip(props: ComponentProps<typeof Tooltip>): import("react").JSX.Element;
@@ -18,6 +18,7 @@ declare const brandedIcons: {
18
18
  readonly export: import("lucide-react").LucideIcon;
19
19
  readonly error: import("lucide-react").LucideIcon;
20
20
  readonly close: import("lucide-react").LucideIcon;
21
+ readonly clearFilters: import("lucide-react").LucideIcon;
21
22
  readonly previous: import("lucide-react").LucideIcon;
22
23
  readonly next: import("lucide-react").LucideIcon;
23
24
  readonly lightTheme: import("lucide-react").LucideIcon;
@@ -1,6 +1,7 @@
1
1
  /** Direct UI composition and static screens. Requests use declared views from /react. */
2
2
  export { injectDataAppShellStyles } from '../shellStyles.js';
3
3
  export { DataAppProvider } from '../mount.js';
4
+ export { isPlainKeyEvent } from './keyboard.js';
4
5
  export { GettingStarted } from './GettingStarted.js';
5
6
  export { DataWidget } from './DataWidget.js';
6
7
  export type { WidgetStatus } from './RequestHint.js';
@@ -29,8 +30,10 @@ export { searchItems } from './searchItems.js';
29
30
  export type { SearchAttribute, SearchHit, SearchItemsOptions, SearchMatchValue, SearchRange, } from './searchItems.js';
30
31
  export { SearchMatch } from './SearchMatch.js';
31
32
  export type { SearchMatchProps } from './SearchMatch.js';
32
- export { Combobox } from './Combobox.js';
33
- export type { ComboboxOption, ComboboxProps } from './Combobox.js';
33
+ export { ChoicePicker } from './ChoicePicker.js';
34
+ export type { ChoiceOption, ChoicePickerProps, } from './ChoicePicker.js';
35
+ export { MenuTrigger, MenuButton, MenuPopover, Menu, MenuItem, MenuSection, MenuSeparator, } from './Menu.js';
36
+ export type { MenuTriggerProps, MenuPopoverProps, MenuProps, MenuItemProps, } from './Menu.js';
34
37
  export { GradientScroll } from './GradientScroll.js';
35
38
  export type { GradientScrollProps } from './GradientScroll.js';
36
39
  export { Tabs, TabList, Tab, TabPanels, TabPanel, useViewTab, } from './Tabs.js';
@@ -72,3 +75,24 @@ export type { CsvExport, CsvTable } from './csv-export.js';
72
75
  export type { TableWidgetColumn } from './TableWidget.js';
73
76
  export type { DataReading, MetricReading } from '../../core/reading.js';
74
77
  export type { DataAppStyle, DataAppStyleToken, DataAppStyleHooks, } from '../style-contract.js';
78
+ export { Select } from './Select.js';
79
+ export type { SelectProps } from './Select.js';
80
+ export { RadioGroup, Radio, SegmentedControl } from './RadioGroup.js';
81
+ export type { RadioGroupProps, RadioProps, SegmentedControlProps, } from './RadioGroup.js';
82
+ export { CheckboxGroup } from './CheckboxGroup.js';
83
+ export type { CheckboxGroupProps } from './CheckboxGroup.js';
84
+ export { NumberField, NumberRangeField } from './NumberField.js';
85
+ export type { NumberFieldProps, NumberRangeFieldProps, NumberRange, } from './NumberField.js';
86
+ export { FilterBar } from './FilterBar.js';
87
+ export type { FilterBarProps } from './FilterBar.js';
88
+ export { VariableBar } from './VariableBar.js';
89
+ export type { VariableBarProps } from './VariableBar.js';
90
+ export { FilterActions } from './FilterActions.js';
91
+ export type { FilterActionsProps } from './FilterActions.js';
92
+ export { NumberFilterPicker } from './NumberFilterPicker.js';
93
+ export type { NumberFilterPickerProps } from './NumberFilterPicker.js';
94
+ export { ComposedChart } from './ComposedChart.js';
95
+ export type { ComposedChartProps } from './ComposedChart.js';
96
+ export { ChartLegend } from './ChartLegend.js';
97
+ export type { ChartLegendProps, ChartLegendItemProps, ChartLegendMarkerProps, ChartLegendLabelProps, ChartLegendMarkerKind, } from './ChartLegend.js';
98
+ export type { ComposedChartLegendProps } from './ComposedChartLegend.js';
@@ -0,0 +1,6 @@
1
+ type KeyEvent = Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'metaKey' | 'shiftKey' | 'isComposing'>;
2
+ /** Keep local key actions separate from shortcuts and IME composition. Pass React's nativeEvent. */
3
+ export declare function isPlainKeyEvent(event: KeyEvent, { allowShift }?: {
4
+ allowShift?: boolean;
5
+ }): boolean;
6
+ export {};
@@ -15,6 +15,11 @@ export declare const shortcuts: {
15
15
  readonly code: 'Period';
16
16
  readonly key: '.';
17
17
  };
18
+ readonly sendAnnotations: {
19
+ readonly modifier: 'mod';
20
+ readonly code: 'Enter';
21
+ readonly key: 'Enter';
22
+ };
18
23
  readonly refresh: {
19
24
  readonly modifier: 'alt';
20
25
  readonly code: 'KeyR';
@@ -27,6 +32,7 @@ export declare const shortcuts: {
27
32
  };
28
33
  readonly playStory: {
29
34
  readonly modifier: 'mod';
35
+ readonly shift: true;
30
36
  readonly code: 'Enter';
31
37
  readonly key: 'Enter';
32
38
  };
@@ -34,5 +40,6 @@ export declare const shortcuts: {
34
40
  export declare function shortcutLabel({ modifier, shift, key }: Shortcut): string;
35
41
  export declare function ariaKeyShortcuts({ modifier, shift, key }: Shortcut): string;
36
42
  export declare function isEditingTarget(target: EventTarget | null): boolean;
43
+ export declare function matchesShortcut(event: KeyboardEvent, shortcut: Shortcut): boolean;
37
44
  /** Bind a page-level shortcut. Ignored while typing or while a modal layer is open. */
38
45
  export declare function useShortcut(shortcut: Shortcut, action: () => void, enabled?: boolean, allowWhileEditing?: boolean): void;
@@ -1,3 +1,3 @@
1
1
  import { type Theme, type AppearanceOptions } from '../../core/appearance.js';
2
2
  /** The parent theme takes precedence; only standalone viewers receive controls. */
3
- export declare function useAppAppearance(appearance: AppearanceOptions, hostTheme?: Theme): import("../../core/appearance.js").ThemeController | undefined;
3
+ export declare function useAppAppearance(appearance: AppearanceOptions | undefined, hostTheme?: Theme): import("../../core/appearance.js").ThemeController | undefined;
@@ -1,7 +1,7 @@
1
1
  import type { DatePresetId, DateRange } from '../../core/date-range.js';
2
2
  import { type AppVariableValues, type DateRangeSelection, type DateRangeVariable, type HistoryMode, type VariableCollection } from '../../core/variables.js';
3
- export { defineAppVariables, textVariable, selectVariable, dateRangeVariable, } from '../../core/variables.js';
4
- export type { AppVariable, AppVariableValues, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, VariableCollection, } from '../../core/variables.js';
3
+ export { defineAppVariables, searchVariable, choiceVariable, multiChoiceVariable, dateRangeVariable, } from '../../core/variables.js';
4
+ export type { AppVariable, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, VariableCollection, } from '../../core/variables.js';
5
5
  /** Adapt one date variable to the controlled picker without giving the picker URL ownership. */
6
6
  export declare function dateRangeControl(variable: DateRangeVariable, selection: DateRangeSelection, onChange: (selection: DateRangeSelection) => void): {
7
7
  minDate?: string;
@@ -27,6 +27,8 @@ export declare function useAppVariables<const Variables extends VariableCollecti
27
27
  values: AppVariableValues<Variables>;
28
28
  set: <Key extends keyof Variables & string>(name: Key, value: AppVariableValues<Variables>[Key]) => void;
29
29
  reset: <Key extends keyof Variables & string>(name: Key) => void;
30
+ resetAll: () => void;
31
+ clearAll: () => void;
30
32
  update: (next: Partial<AppVariableValues<Variables>>, history?: HistoryMode) => void;
31
33
  bind: <Key extends keyof Variables & string>(name: Key) => {
32
34
  value: AppVariableValues<Variables>[Key];
@@ -6,7 +6,9 @@ export declare function useViewVariables<Variables extends VariableCollection>(d
6
6
  values: AppVariableValues<Variables>;
7
7
  set: <Key extends keyof Variables & string>(name: Key, value: AppVariableValues<Variables>[Key]) => void;
8
8
  reset: <Key extends keyof Variables & string>(name: Key) => void;
9
- update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/navigation.js").HistoryMode) => void;
9
+ resetAll: () => void;
10
+ clearAll: () => void;
11
+ update: (next: Partial<AppVariableValues<Variables>>, history?: import("../core/variables.js").HistoryMode) => void;
10
12
  bind: <Key extends keyof Variables & string>(name: Key) => {
11
13
  value: AppVariableValues<Variables>[Key];
12
14
  onChange(value: AppVariableValues<Variables>[Key]): void;
@@ -1,13 +1,13 @@
1
- import { type DataOperations, type Lakehouse } from '../core/contract.js';
1
+ import { type DataOperations, type Lakehouse, type QueryParameters } from '../core/contract.js';
2
2
  /** Authorization result for one viewer request. A hosted adapter must scope its lakehouse client. */
3
3
  export type RequestAccess = {
4
4
  lakehouse: Lakehouse;
5
- canDiscloseSql: boolean;
5
+ /** Trusted values shared across queries; each query uses only its declared keys. */
6
+ queryParams?: QueryParameters;
6
7
  };
7
8
  /**
8
9
  * Execute named operations on the server. The app supplies operations and viewer authorization.
9
10
  * JSON, Origin, and Fetch Metadata checks reject cross-site browser POSTs; they do not
10
- * authenticate another local process. SQL is returned only when both the operation and
11
- * authorization result permit disclosure.
11
+ * authenticate another local process. Query evidence accompanies every result.
12
12
  */
13
13
  export declare function createDataHandler(operations: DataOperations, authorize: (request: Request, operation: string) => Promise<RequestAccess>): (request: Request) => Promise<Response>;