@altertable/data-app 0.67.0 → 0.69.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.
- package/AGENTS.md +6 -0
- package/CONTRIBUTING.md +27 -1
- package/README.md +18 -21
- package/THIRD_PARTY_NOTICES +18 -0
- package/dist/chunks/index-22d576sn.js +153 -0
- package/dist/chunks/index-22d576sn.js.map +11 -0
- package/dist/chunks/{index-ktmvs916.js → index-2sbp9h2b.js} +37 -21
- package/dist/chunks/index-2sbp9h2b.js.map +13 -0
- package/dist/chunks/{index-23dktynd.js → index-ap60vggk.js} +4 -4
- package/dist/chunks/{index-m6n8ctfc.js → index-cv36cyna.js} +4 -4
- package/dist/chunks/index-cv36cyna.js.map +10 -0
- package/dist/chunks/{index-ag0cgnvq.js → index-k766wwwr.js} +13 -9
- package/dist/chunks/index-k766wwwr.js.map +13 -0
- package/dist/chunks/{index-mt93ff2b.js → index-kwnqycjt.js} +2 -2
- package/dist/chunks/index-kwnqycjt.js.map +10 -0
- package/dist/chunks/index-m0gbxtgp.js +355 -0
- package/dist/chunks/index-m0gbxtgp.js.map +13 -0
- package/dist/chunks/{index-8qfxv0h5.js → index-qhzdzca2.js} +3951 -2242
- package/dist/chunks/index-qhzdzca2.js.map +118 -0
- package/dist/chunks/{index-x69p7cv7.js → index-r7b1ftwy.js} +3 -3
- package/dist/chunks/index-r7b1ftwy.js.map +10 -0
- package/dist/chunks/{index-ev2b5aaf.js → index-sx488hvs.js} +4 -4
- package/dist/chunks/{index-f5cnbrjz.js → index-wss3gd3h.js} +39 -9
- package/dist/chunks/index-wss3gd3h.js.map +13 -0
- package/dist/chunks/{index-qd5xgx6y.js → index-zcqxfwdq.js} +5 -12
- package/dist/chunks/index-zcqxfwdq.js.map +13 -0
- package/dist/client/index.js +6 -6
- package/dist/core/appearance.js +1 -1
- package/dist/core/config.js +3 -3
- package/dist/core/contract.js +3 -3
- package/dist/core/format.js +10 -2
- package/dist/core/format.js.map +1 -1
- package/dist/embed/index.js +26 -25
- package/dist/embed/index.js.map +4 -4
- package/dist/index.js +3 -3
- package/dist/local.js +166 -144
- package/dist/local.js.map +8 -7
- package/dist/preview.js +1456 -0
- package/dist/preview.js.map +17 -0
- package/dist/react/embed/index.js +1 -1
- package/dist/react/index.js +272 -103
- package/dist/react/index.js.map +10 -11
- package/dist/react/ui/index.js +2124 -1254
- package/dist/react/ui/index.js.map +20 -13
- package/dist/server.js +68 -57
- package/dist/server.js.map +7 -6
- package/dist/types/client/download.d.ts +5 -0
- package/dist/types/client/iframe.d.ts +4 -2
- package/dist/types/client/logger.d.ts +10 -2
- package/dist/types/core/annotations.d.ts +5 -0
- package/dist/types/core/appearance.d.ts +2 -0
- package/dist/types/core/bridge-endpoint.d.ts +2 -2
- package/dist/types/core/bridge.d.ts +22 -0
- package/dist/types/core/config.d.ts +5 -0
- package/dist/types/core/contract.d.ts +3 -1
- package/dist/types/core/date-format.d.ts +24 -0
- package/dist/types/core/dimension.d.ts +2 -1
- package/dist/types/core/filters.d.ts +4 -3
- package/dist/types/core/format.d.ts +5 -3
- package/dist/types/core/messages.d.ts +3 -1
- package/dist/types/core/operation-types.d.ts +7 -7
- package/dist/types/core/time-interval.d.ts +96 -0
- package/dist/types/core/variables.d.ts +13 -4
- package/dist/types/embed/host.d.ts +4 -4
- package/dist/types/react/annotations/annotation-editor-state.d.ts +2 -0
- package/dist/types/react/annotations/annotation-targets.d.ts +1 -0
- package/dist/types/react/annotations/getAnnotationProps.d.ts +5 -3
- package/dist/types/react/annotations/useAnnotationGeometry.d.ts +2 -2
- package/dist/types/react/bindings.d.ts +26 -3
- package/dist/types/react/date-formatting.d.ts +12 -0
- package/dist/types/react/hooks.d.ts +10 -9
- package/dist/types/react/index.d.ts +7 -2
- package/dist/types/react/search-suggestions.d.ts +8 -0
- package/dist/types/react/style-contract.d.ts +13 -5
- package/dist/types/react/ui/ChartLegend.d.ts +4 -3
- package/dist/types/react/ui/ChoicePicker.d.ts +2 -0
- package/dist/types/react/ui/ComposedChart.d.ts +1 -1
- package/dist/types/react/ui/DataApp.d.ts +5 -4
- package/dist/types/react/ui/DataAppFrame.d.ts +14 -3
- package/dist/types/react/ui/DataTable.d.ts +6 -4
- package/dist/types/react/ui/DataWidget.d.ts +4 -0
- package/dist/types/react/ui/DateDisplay.d.ts +9 -0
- package/dist/types/react/ui/DateRangePicker.d.ts +3 -1
- package/dist/types/react/ui/DateTimeTooltip.d.ts +3 -2
- package/dist/types/react/ui/DimensionPicker.d.ts +3 -1
- package/dist/types/react/ui/EmptyState.d.ts +1 -1
- package/dist/types/react/ui/FunnelChart.d.ts +20 -0
- package/dist/types/react/ui/GradientScroll.d.ts +8 -0
- package/dist/types/react/ui/Grid.d.ts +1 -1
- package/dist/types/react/ui/JourneyChart.d.ts +10 -0
- package/dist/types/react/ui/MetricWidget.d.ts +2 -0
- package/dist/types/react/ui/NumberFilterPicker.d.ts +3 -1
- package/dist/types/react/ui/PeriodSummary.d.ts +2 -1
- package/dist/types/react/ui/PickerField.d.ts +15 -0
- package/dist/types/react/ui/PopoverSurface.d.ts +5 -0
- package/dist/types/react/ui/RequestHint.d.ts +2 -2
- package/dist/types/react/ui/RetentionChart.d.ts +27 -0
- package/dist/types/react/ui/SearchField.d.ts +3 -1
- package/dist/types/react/ui/SearchTypeahead.d.ts +15 -0
- package/dist/types/react/ui/SectionHeading.d.ts +8 -0
- package/dist/types/react/ui/Select.d.ts +5 -1
- package/dist/types/react/ui/Sheet.d.ts +3 -1
- package/dist/types/react/ui/TableWidget.d.ts +8 -0
- package/dist/types/react/ui/Tabs.d.ts +4 -3
- package/dist/types/react/ui/VariableBar.d.ts +1 -1
- package/dist/types/react/ui/VisualizationWidget.d.ts +1 -1
- package/dist/types/react/ui/chart-data.d.ts +9 -0
- package/dist/types/react/ui/chart-date-axis.d.ts +15 -0
- package/dist/types/react/ui/chart-interaction.d.ts +21 -0
- package/dist/types/react/ui/chart-primitives.d.ts +7 -5
- package/dist/types/react/ui/chart-time.d.ts +16 -0
- package/dist/types/react/ui/chartColor.d.ts +1 -0
- package/dist/types/react/ui/icons.d.ts +3 -1
- package/dist/types/react/ui/index.d.ts +15 -4
- package/dist/types/react/ui/journey-flow.d.ts +49 -0
- package/dist/types/react/ui/metric-comparison.d.ts +2 -2
- package/dist/types/react/ui/metric.d.ts +2 -2
- package/dist/types/react/ui/presentation.d.ts +2 -0
- package/dist/types/react/ui/searchItems.d.ts +2 -0
- package/dist/types/react/ui/useSvgId.d.ts +2 -0
- package/dist/types/react/ui/variables.d.ts +1 -1
- package/dist/types/react/view-control-bar.d.ts +16 -0
- package/dist/types/react/view-controls.d.ts +3 -2
- package/dist/types/react/view-runtime.d.ts +3 -1
- package/dist/types/react/view.d.ts +14 -2
- package/dist/types/server/local.d.ts +3 -1
- package/dist/types/server/preview/host.d.ts +1 -0
- package/dist/types/server/preview/index.d.ts +16 -0
- package/dist/types/server/reload-channel.d.ts +6 -0
- package/dist/types/server/request-body.d.ts +4 -0
- package/dist/worker.js +2 -2
- package/docs/app-authoring.md +17 -9
- package/docs/client.md +1 -1
- package/docs/contract.md +10 -10
- package/docs/embed.md +11 -3
- package/docs/formatting-and-appearance.md +36 -5
- package/docs/layout.md +31 -8
- package/docs/react-embed.md +4 -4
- package/docs/react.md +1 -1
- package/docs/server-bun.md +25 -0
- package/docs/server.md +1 -1
- package/docs/styling.md +7 -28
- package/docs/ui.md +33 -12
- package/docs/variables.md +92 -15
- package/docs/views.md +13 -36
- package/docs/widgets.md +38 -23
- package/docs/worker.md +2 -1
- package/examples/starter-data-app/index.tsx +0 -1
- package/examples/starter-local-data-app/.bun-version +1 -0
- package/examples/starter-local-data-app/.node-version +1 -0
- package/examples/starter-local-data-app/.oxfmtrc.json +4 -0
- package/examples/starter-local-data-app/.oxlintrc.json +33 -0
- package/examples/starter-local-data-app/AGENTS.md +22 -0
- package/examples/starter-local-data-app/README.md +54 -0
- package/examples/starter-local-data-app/app.ts +22 -0
- package/examples/starter-local-data-app/bunfig.toml +2 -0
- package/examples/starter-local-data-app/package.json +33 -0
- package/examples/starter-local-data-app/src/App.tsx +8 -0
- package/examples/starter-local-data-app/src/assets.d.ts +1 -0
- package/examples/starter-local-data-app/src/data-context.ts +21 -0
- package/examples/starter-local-data-app/src/favicon.svg +13 -0
- package/examples/starter-local-data-app/src/index.html +14 -0
- package/examples/starter-local-data-app/src/main.tsx +7 -0
- package/examples/starter-local-data-app/src/operations.ts +6 -0
- package/examples/starter-local-data-app/src/server.ts +6 -0
- package/examples/starter-local-data-app/tsconfig.json +15 -0
- package/package.json +13 -3
- package/dist/chunks/index-8qfxv0h5.js.map +0 -108
- package/dist/chunks/index-ag0cgnvq.js.map +0 -13
- package/dist/chunks/index-dq7b35fn.js +0 -307
- package/dist/chunks/index-dq7b35fn.js.map +0 -13
- package/dist/chunks/index-f5cnbrjz.js.map +0 -13
- package/dist/chunks/index-ktmvs916.js.map +0 -13
- package/dist/chunks/index-m6n8ctfc.js.map +0 -10
- package/dist/chunks/index-mev09s5v.js +0 -77
- package/dist/chunks/index-mev09s5v.js.map +0 -10
- package/dist/chunks/index-mt93ff2b.js.map +0 -10
- package/dist/chunks/index-qd5xgx6y.js.map +0 -13
- package/dist/chunks/index-x69p7cv7.js.map +0 -10
- package/dist/types/react/shellStyles.d.ts +0 -3
- package/dist/types/react/ui/DataAppSkeleton.d.ts +0 -7
- /package/dist/chunks/{index-23dktynd.js.map → index-ap60vggk.js.map} +0 -0
- /package/dist/chunks/{index-ev2b5aaf.js.map → index-sx488hvs.js.map} +0 -0
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import type { QueryParameters } from './queries.js';
|
|
3
3
|
export type OperationContracts = Record<string, {
|
|
4
4
|
input: (value: unknown) => unknown;
|
|
5
|
-
output: (value: unknown) => unknown;
|
|
6
5
|
}>;
|
|
7
6
|
export type InputOf<T> = T extends {
|
|
8
7
|
input: (value: unknown) => infer Input;
|
|
9
8
|
} ? Input : never;
|
|
9
|
+
/** An operation's data is what its `run` resolves to. */
|
|
10
10
|
export type OutputOf<T> = T extends {
|
|
11
|
-
|
|
12
|
-
} ? Output :
|
|
11
|
+
run: (...args: never[]) => Promise<infer Output>;
|
|
12
|
+
} ? Output : unknown;
|
|
13
13
|
export type QueryResult = {
|
|
14
14
|
columns: {
|
|
15
15
|
name: string;
|
|
@@ -40,12 +40,12 @@ export type OperationContext = {
|
|
|
40
40
|
queryParams?: QueryParameters;
|
|
41
41
|
};
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
44
|
-
* Browser validation does not replace backend authorization or query limits.
|
|
43
|
+
* The input parser runs in the operation executor's runtime: server for HTTP apps, browser for
|
|
44
|
+
* bundle apps. Browser validation does not replace backend authorization or query limits.
|
|
45
|
+
* `run` parses query rows once; its result is the operation's data.
|
|
45
46
|
*/
|
|
46
47
|
export type DataOperation<Input, Output> = {
|
|
47
48
|
input: (value: unknown) => Input;
|
|
48
|
-
output: (value: unknown) => Output;
|
|
49
49
|
run: (context: OperationContext, input: Input) => Promise<Output>;
|
|
50
50
|
checks: readonly Input[];
|
|
51
51
|
queryNames?: Readonly<Record<string, string>>;
|
|
@@ -56,7 +56,7 @@ export type DataOperation<Input, Output> = {
|
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
/** Heterogeneous registry: inputs vary per operation, so checks retain unknown values. */
|
|
59
|
-
export type DataOperations = Record<string, OperationContracts[string] & Omit<DataOperation<never, unknown>, 'input' | '
|
|
59
|
+
export type DataOperations = Record<string, OperationContracts[string] & Omit<DataOperation<never, unknown>, 'input' | 'checks'> & {
|
|
60
60
|
checks: readonly unknown[];
|
|
61
61
|
}>;
|
|
62
62
|
export type DataQueryInput<Operations extends OperationContracts> = {
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* TypeScript port of d3-time 3.1.0 (ISC), https://github.com/d3/d3-time/tree/v3.1.0
|
|
3
|
+
* Numeric tick-step helpers adapted from d3-array 3.2.4 (ISC).
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2010-2022 Mike Bostock (d3-time)
|
|
6
|
+
* Copyright 2010-2023 Mike Bostock (d3-array tick-step helpers)
|
|
7
|
+
*
|
|
8
|
+
* Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
9
|
+
* with or without fee is hereby granted, provided that the above copyright notice
|
|
10
|
+
* and this permission notice appear in all copies.
|
|
11
|
+
*
|
|
12
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
13
|
+
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
14
|
+
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15
|
+
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
|
16
|
+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
17
|
+
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
|
18
|
+
* THIS SOFTWARE.
|
|
19
|
+
*/
|
|
20
|
+
type DateValue = Date | number;
|
|
21
|
+
type DateMutation = (date: Date) => void;
|
|
22
|
+
type DateOffset = (date: Date, step: number) => void;
|
|
23
|
+
type DateCount = (start: Date, end: Date) => number;
|
|
24
|
+
export interface TimeInterval {
|
|
25
|
+
(date?: DateValue): Date;
|
|
26
|
+
floor(this: void, date: DateValue): Date;
|
|
27
|
+
ceil(this: void, date: DateValue): Date;
|
|
28
|
+
round(this: void, date: DateValue): Date;
|
|
29
|
+
offset(this: void, date: DateValue, step?: number): Date;
|
|
30
|
+
range(this: void, start: DateValue, stop: DateValue, step?: number): Date[];
|
|
31
|
+
filter(this: void, test: (date: Date) => boolean): TimeInterval;
|
|
32
|
+
}
|
|
33
|
+
export interface CountableTimeInterval extends TimeInterval {
|
|
34
|
+
count(this: void, start: DateValue, end: DateValue): number;
|
|
35
|
+
every(this: void, step: number): TimeInterval | null;
|
|
36
|
+
}
|
|
37
|
+
export declare function timeInterval(floor: DateMutation, offset: DateOffset): TimeInterval;
|
|
38
|
+
export declare function timeInterval(floor: DateMutation, offset: DateOffset, count: DateCount, field?: (date: Date) => number): CountableTimeInterval;
|
|
39
|
+
declare const millisecond: CountableTimeInterval;
|
|
40
|
+
declare const milliseconds: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
41
|
+
declare const second: CountableTimeInterval;
|
|
42
|
+
declare const seconds: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
43
|
+
export declare const timeMinute: CountableTimeInterval;
|
|
44
|
+
export declare const timeMinutes: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
45
|
+
export declare const utcMinute: CountableTimeInterval;
|
|
46
|
+
export declare const utcMinutes: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
47
|
+
export declare const timeHour: CountableTimeInterval;
|
|
48
|
+
export declare const timeHours: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
49
|
+
export declare const utcHour: CountableTimeInterval;
|
|
50
|
+
export declare const utcHours: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
51
|
+
export declare const timeDay: CountableTimeInterval;
|
|
52
|
+
export declare const timeDays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
53
|
+
export declare const utcDay: CountableTimeInterval;
|
|
54
|
+
export declare const utcDays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
55
|
+
export declare const unixDay: CountableTimeInterval;
|
|
56
|
+
export declare const unixDays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
57
|
+
export declare const timeSunday: CountableTimeInterval;
|
|
58
|
+
export declare const timeMonday: CountableTimeInterval;
|
|
59
|
+
export declare const timeTuesday: CountableTimeInterval;
|
|
60
|
+
export declare const timeWednesday: CountableTimeInterval;
|
|
61
|
+
export declare const timeThursday: CountableTimeInterval;
|
|
62
|
+
export declare const timeFriday: CountableTimeInterval;
|
|
63
|
+
export declare const timeSaturday: CountableTimeInterval;
|
|
64
|
+
export declare const timeSundays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
65
|
+
export declare const timeMondays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
66
|
+
export declare const timeTuesdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
67
|
+
export declare const timeWednesdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
68
|
+
export declare const timeThursdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
69
|
+
export declare const timeFridays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
70
|
+
export declare const timeSaturdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
71
|
+
export declare const utcSunday: CountableTimeInterval;
|
|
72
|
+
export declare const utcMonday: CountableTimeInterval;
|
|
73
|
+
export declare const utcTuesday: CountableTimeInterval;
|
|
74
|
+
export declare const utcWednesday: CountableTimeInterval;
|
|
75
|
+
export declare const utcThursday: CountableTimeInterval;
|
|
76
|
+
export declare const utcFriday: CountableTimeInterval;
|
|
77
|
+
export declare const utcSaturday: CountableTimeInterval;
|
|
78
|
+
export declare const utcSundays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
79
|
+
export declare const utcMondays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
80
|
+
export declare const utcTuesdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
81
|
+
export declare const utcWednesdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
82
|
+
export declare const utcThursdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
83
|
+
export declare const utcFridays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
84
|
+
export declare const utcSaturdays: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
85
|
+
export declare const timeMonth: CountableTimeInterval;
|
|
86
|
+
export declare const timeMonths: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
87
|
+
export declare const utcMonth: CountableTimeInterval;
|
|
88
|
+
export declare const utcMonths: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
89
|
+
export declare const timeYear: CountableTimeInterval;
|
|
90
|
+
export declare const timeYears: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
91
|
+
export declare const utcYear: CountableTimeInterval;
|
|
92
|
+
export declare const utcYears: (this: void, start: DateValue, stop: DateValue, step?: number) => Date[];
|
|
93
|
+
declare const utcTicks: (start: DateValue, stop: DateValue, count: number | TimeInterval) => Date[], utcTickInterval: (start: DateValue, stop: DateValue, count: number) => TimeInterval | null;
|
|
94
|
+
declare const timeTicks: (start: DateValue, stop: DateValue, count: number | TimeInterval) => Date[], timeTickInterval: (start: DateValue, stop: DateValue, count: number) => TimeInterval | null;
|
|
95
|
+
export { utcTicks, utcTickInterval, timeTicks, timeTickInterval };
|
|
96
|
+
export { millisecond as timeMillisecond, millisecond as utcMillisecond, milliseconds as timeMilliseconds, milliseconds as utcMilliseconds, second as timeSecond, second as utcSecond, seconds as timeSeconds, seconds as utcSeconds, timeSunday as timeWeek, timeSundays as timeWeeks, utcSunday as utcWeek, utcSundays as utcWeeks, };
|
|
@@ -4,10 +4,17 @@ import type { DimensionSelection, DimensionVariable } from './dimension.js';
|
|
|
4
4
|
import type { NumberFilter, BooleanFilter } from './filters.js';
|
|
5
5
|
import type { HistoryMode } from './navigation.js';
|
|
6
6
|
export type { HistoryMode } from './navigation.js';
|
|
7
|
+
export type VariablePresentation = {
|
|
8
|
+
/** Scope changes the included data; display changes its presentation. Defaults to scope. */
|
|
9
|
+
group?: 'scope' | 'display';
|
|
10
|
+
/** Secondary scope controls live in the Filters sheet with compact pickers when active; secondary display options follow primary options. Defaults to primary. */
|
|
11
|
+
prominence?: 'primary' | 'secondary';
|
|
12
|
+
};
|
|
7
13
|
/** An app-owned value with one URL representation. Controls never parse or write routes. */
|
|
8
14
|
export type AppVariable<Value, Kind extends string = string> = {
|
|
9
15
|
kind: Kind;
|
|
10
16
|
label?: string;
|
|
17
|
+
presentation?: VariablePresentation;
|
|
11
18
|
urlKeys: readonly string[];
|
|
12
19
|
defaultValue: Value;
|
|
13
20
|
/** Unrestricted value, when this variable represents a filter. */
|
|
@@ -30,6 +37,7 @@ type ScalarVariableOptions = {
|
|
|
30
37
|
key: string;
|
|
31
38
|
defaultValue?: string;
|
|
32
39
|
history?: HistoryMode;
|
|
40
|
+
presentation?: VariablePresentation;
|
|
33
41
|
};
|
|
34
42
|
export type SearchVariable = AppVariable<string, 'search'>;
|
|
35
43
|
export type ChoiceOption = {
|
|
@@ -45,14 +53,14 @@ export type MultiChoiceVariable = AppVariable<readonly string[], 'multiChoice'>
|
|
|
45
53
|
maxSelected: number;
|
|
46
54
|
};
|
|
47
55
|
/** Search query state; typing replaces history by default. */
|
|
48
|
-
export declare function searchVariable({ key, label, defaultValue, history, }: ScalarVariableOptions): SearchVariable;
|
|
56
|
+
export declare function searchVariable({ key, label, defaultValue, history, }: Omit<ScalarVariableOptions, 'presentation'>): SearchVariable;
|
|
49
57
|
/** Validate labeled choices before controls or URL state consume them. */
|
|
50
58
|
export declare function validateChoiceOptions(options: readonly ChoiceOption[]): void;
|
|
51
|
-
export declare function choiceVariable({ key, label, defaultValue, options, history, }: ScalarVariableOptions & {
|
|
59
|
+
export declare function choiceVariable({ key, label, defaultValue, options, history, presentation, }: ScalarVariableOptions & {
|
|
52
60
|
defaultValue: string;
|
|
53
61
|
options: readonly ChoiceOption[];
|
|
54
62
|
}): ChoiceVariable;
|
|
55
|
-
export declare function multiChoiceVariable({ key, label, defaultValue, options, maxSelected, history, }: Omit<ScalarVariableOptions, 'defaultValue'> & {
|
|
63
|
+
export declare function multiChoiceVariable({ key, label, defaultValue, options, maxSelected, history, presentation, }: Omit<ScalarVariableOptions, 'defaultValue'> & {
|
|
56
64
|
defaultValue?: readonly string[];
|
|
57
65
|
options: readonly ChoiceOption[];
|
|
58
66
|
maxSelected?: number;
|
|
@@ -78,6 +86,7 @@ export type DateRangeVariableOptions = {
|
|
|
78
86
|
history?: HistoryMode;
|
|
79
87
|
/** Opt into a URL-backed comparison with the preceding equal-length range. */
|
|
80
88
|
comparison?: boolean;
|
|
89
|
+
presentation?: VariablePresentation;
|
|
81
90
|
};
|
|
82
91
|
export type DateRangeVariable = AppVariable<DateRangeSelection, 'dateRange'> & {
|
|
83
92
|
kind: 'dateRange';
|
|
@@ -95,4 +104,4 @@ export type DateRangeVariable = AppVariable<DateRangeSelection, 'dateRange'> & {
|
|
|
95
104
|
comparisonRange: (selection: DateRangeSelection) => DateRange | null;
|
|
96
105
|
};
|
|
97
106
|
/** A date variable keeps relative presets relative and validates exact dates against source coverage. */
|
|
98
|
-
export declare function dateRangeVariable({ key, label, defaultValue, contract, history, comparison, }: DateRangeVariableOptions): DateRangeVariable;
|
|
107
|
+
export declare function dateRangeVariable({ key, label, defaultValue, contract, history, comparison, presentation, }: DateRangeVariableOptions): DateRangeVariable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DataAppPresentation } from '../core/presentation.js';
|
|
2
2
|
import type { DataAppLogger } from '../core/logger.js';
|
|
3
|
-
import { type
|
|
3
|
+
import { type BridgeDiagnostic } from '../core/bridge.js';
|
|
4
4
|
import { type MessageDispatcher } from '../core/messages.js';
|
|
5
5
|
export type DataAppConnection = {
|
|
6
6
|
type: 'origin';
|
|
@@ -10,9 +10,9 @@ export type DataAppConnection = {
|
|
|
10
10
|
token: string;
|
|
11
11
|
};
|
|
12
12
|
export type DataAppStatus = 'connecting' | 'connected' | 'ready' | 'failed' | 'disconnected';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/** Delivery metadata only; never tokens or payloads. `durationMs` measures host handling of a request, reported on its result or error. */
|
|
14
|
+
export type DataAppDiagnostic = BridgeDiagnostic & {
|
|
15
|
+
durationMs?: number;
|
|
16
16
|
};
|
|
17
17
|
export type DataAppHost = {
|
|
18
18
|
dispose: () => void;
|
|
@@ -4,6 +4,8 @@ export type AnnotationEditorState = {
|
|
|
4
4
|
target: AnnotationTargetElement;
|
|
5
5
|
draft: DataAppAnnotationDraft;
|
|
6
6
|
annotationId?: string;
|
|
7
|
+
/** Epoch milliseconds, comparable to host interaction timestamps. */
|
|
8
|
+
openedAt: number;
|
|
7
9
|
comment: string;
|
|
8
10
|
captureStatus: 'capturing' | 'ready' | 'failed';
|
|
9
11
|
error: string;
|
|
@@ -28,6 +28,7 @@ export declare function annotationPoint(rect: AnnotationRect, point?: Annotation
|
|
|
28
28
|
};
|
|
29
29
|
/** The iframe document is a crop surface, never a selectable global-layout target. */
|
|
30
30
|
export declare function annotationRoot(root: HTMLElement | null): AnnotationTargetElement | undefined;
|
|
31
|
+
export declare function indexAnnotationTargets(root: HTMLElement | null): Map<string, AnnotationTargetElement>;
|
|
31
32
|
export declare function findAnnotationTarget(root: HTMLElement | null, id: string | undefined): AnnotationTargetElement | undefined;
|
|
32
33
|
export declare function normalizeAnnotationRect(area: AnnotationRect, target: AnnotationRect): AnnotationRect;
|
|
33
34
|
export declare function projectAnnotationRect(area: AnnotationRect, target: AnnotationRect): AnnotationRect;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { WidgetEvidence } from '../ui/WidgetEvidence.js';
|
|
2
2
|
type AnnotationPropsOptions = {
|
|
3
|
-
id
|
|
3
|
+
id: string;
|
|
4
4
|
label?: string;
|
|
5
|
+
fallbackId?: string;
|
|
5
6
|
evidence?: WidgetEvidence;
|
|
6
7
|
kind?: 'widget' | 'element';
|
|
7
8
|
};
|
|
8
|
-
export declare function getAnnotationProps({ id, label, evidence, kind, }: AnnotationPropsOptions): {
|
|
9
|
-
'data-annotation-id': string
|
|
9
|
+
export declare function getAnnotationProps({ id, label, fallbackId, evidence, kind, }: AnnotationPropsOptions): {
|
|
10
|
+
'data-annotation-id': string;
|
|
11
|
+
'data-annotation-fallback-id': string | undefined;
|
|
10
12
|
'data-annotation-label': string | undefined;
|
|
11
13
|
'data-annotation-kind': "element" | "widget";
|
|
12
14
|
'data-annotation-queries': string;
|
|
@@ -13,9 +13,9 @@ type AnnotationGeometryOptions = {
|
|
|
13
13
|
rootRef: AnnotationRootRef;
|
|
14
14
|
target?: AnnotationTargetElement;
|
|
15
15
|
region?: AnnotationRect;
|
|
16
|
-
|
|
16
|
+
annotations: DataAppAnnotationPresentation['targets'];
|
|
17
17
|
};
|
|
18
|
-
export declare function useAnnotationGeometry({ rootRef, target, region,
|
|
18
|
+
export declare function useAnnotationGeometry({ rootRef, target, region, annotations, }: AnnotationGeometryOptions): {
|
|
19
19
|
pins: AnnotationPin[];
|
|
20
20
|
outline?: AnnotationRect;
|
|
21
21
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { EvidenceDeclaration } from './ui/data-context.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SearchSuggestion } from './ui/SearchTypeahead.js';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
import type { DateFormat } from '../core/format.js';
|
|
3
5
|
import type { DateRangeRequest } from '../core/contract.js';
|
|
4
6
|
import type { DataView, DisplayedSnapshot } from '../core/data-view.js';
|
|
5
7
|
import type { MetricFormat } from '../core/format.js';
|
|
@@ -34,6 +36,16 @@ export type DatasetColumn<Row> = {
|
|
|
34
36
|
} | {
|
|
35
37
|
value: (row: Row) => number | null | undefined;
|
|
36
38
|
format: MetricFormat;
|
|
39
|
+
} | {
|
|
40
|
+
value: (row: Row) => string | number | null | undefined;
|
|
41
|
+
format: Extract<DateFormat, {
|
|
42
|
+
kind: 'dateTime';
|
|
43
|
+
}>;
|
|
44
|
+
} | {
|
|
45
|
+
value: (row: Row) => string | null | undefined;
|
|
46
|
+
format: Extract<DateFormat, {
|
|
47
|
+
kind: 'date';
|
|
48
|
+
}>;
|
|
37
49
|
});
|
|
38
50
|
export type DatasetDefinition<Data, Input, Row, Evidence = WidgetEvidence> = {
|
|
39
51
|
name: string;
|
|
@@ -42,6 +54,14 @@ export type DatasetDefinition<Data, Input, Row, Evidence = WidgetEvidence> = {
|
|
|
42
54
|
rowKey: (row: NoInfer<Row>) => string | number;
|
|
43
55
|
evidence: Evidence;
|
|
44
56
|
emptyFallback?: EmptyContent;
|
|
57
|
+
/** Declare for records whose titles are useful query completions; omit for aggregate rows. */
|
|
58
|
+
suggestions?: DatasetSuggestionOptions<Row>;
|
|
59
|
+
};
|
|
60
|
+
export type DatasetSuggestionOptions<Row> = {
|
|
61
|
+
title: (row: Row) => string;
|
|
62
|
+
description?: (row: Row) => string;
|
|
63
|
+
/** Override query completion with an app action. */
|
|
64
|
+
onSelect?: (row: Row) => void;
|
|
45
65
|
};
|
|
46
66
|
/** Authoring references are registered by the owning view. */
|
|
47
67
|
export type DatasetDeclaration<Data, Input, Row> = DatasetDefinition<Data, Input, Row, EvidenceDeclaration>;
|
|
@@ -56,13 +76,16 @@ export declare function registeredEvidence(binding: RegisteredBinding, owner: ob
|
|
|
56
76
|
export declare class ExportDataset<Data, Input> extends RegisteredBinding {
|
|
57
77
|
#private;
|
|
58
78
|
readonly name: string;
|
|
79
|
+
/** @internal Undefined means this dataset declares no record suggestions. */
|
|
80
|
+
readSearchSuggestions(_source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
|
|
59
81
|
constructor(name: string, csv: (snapshot: DisplayedSnapshot<Data, Input>) => CsvTable, owner?: object, evidence?: WidgetEvidence);
|
|
60
82
|
static csv<Data, Input>(dataset: ExportDataset<Data, Input>, snapshot: DisplayedSnapshot<Data, Input>): CsvTable;
|
|
61
83
|
}
|
|
62
84
|
export declare class Dataset<Data, Input, Row> extends ExportDataset<Data, Input> {
|
|
63
85
|
#private;
|
|
64
86
|
readonly evidence: WidgetEvidence;
|
|
65
|
-
constructor(definition: DatasetDefinition<Data, Input, Row>, owner?: object);
|
|
87
|
+
constructor(definition: DatasetDefinition<Data, Input, Row>, owner?: object, timeZone?: string);
|
|
88
|
+
readSearchSuggestions(source: ViewSource<Data, Input>): DataReading<readonly SearchSuggestion[]> | undefined;
|
|
66
89
|
read: <Source extends ViewSource<Data, Input>>(source: Source) => SourceReading<Source, readonly Row[]>;
|
|
67
90
|
static table<Data, Input, Row>(dataset: Dataset<Data, Input, Row>, source: ViewSource<Data, Input>): {
|
|
68
91
|
title: string;
|
|
@@ -78,7 +101,7 @@ export declare class Dataset<Data, Input, Row> extends ExportDataset<Data, Input
|
|
|
78
101
|
};
|
|
79
102
|
};
|
|
80
103
|
}
|
|
81
|
-
export declare function bindDataset<Data, Input, Row>(definition: DatasetDefinition<Data, Input, Row>, owner?: object): Dataset<Data, Input, Row>;
|
|
104
|
+
export declare function bindDataset<Data, Input, Row>(definition: DatasetDefinition<Data, Input, Row>, owner?: object, timeZone?: string): Dataset<Data, Input, Row>;
|
|
82
105
|
export declare function datasetTable<Data, Input, Row>(dataset: Dataset<Data, Input, Row>, source: ViewSource<Data, Input>): {
|
|
83
106
|
title: string;
|
|
84
107
|
columns: [TableWidgetColumn<Row>, ...TableWidgetColumn<Row>[]];
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
};
|
|
@@ -8,11 +8,11 @@ import type { DataOperations, DateRangeRequest } from '../core/contract.js';
|
|
|
8
8
|
import type { DataClient } from '../client/data-client.js';
|
|
9
9
|
import type { InputOf, OutputOf } from '../core/operation-types.js';
|
|
10
10
|
import { type VariableCollection } from '../core/variables.js';
|
|
11
|
-
import { dateRangeVariable, type DateRangeVariableOptions } from './ui/variables.js';
|
|
11
|
+
import { dateRangeVariable, type DateRangeVariable, type DateRangeVariableOptions } from './ui/variables.js';
|
|
12
12
|
import { type DimensionFilterOptions, type DimensionOption, type DimensionValue } from '../core/dimension.js';
|
|
13
13
|
import type { EmptyContent } from './ui/presentation.js';
|
|
14
14
|
import { ViewContent, type DataContentState } from './content.js';
|
|
15
|
-
import { type DataViewDefinition, type ResolvedVariables, type
|
|
15
|
+
import { type DataViewDefinition, type ResolvedVariables, type ViewBindingOptions } from './view.js';
|
|
16
16
|
type TimeVariables<Additional extends VariableCollection> = {
|
|
17
17
|
period: ReturnType<typeof dateRangeVariable>;
|
|
18
18
|
} & Additional;
|
|
@@ -22,6 +22,10 @@ type TimeInputMapping<Additional extends VariableCollection, Input> = TimeInput<
|
|
|
22
22
|
} : {
|
|
23
23
|
input: (values: ResolvedVariables<TimeVariables<Additional>>) => Input;
|
|
24
24
|
};
|
|
25
|
+
/** Match the period reader's precedence for each possible operation input. */
|
|
26
|
+
type RequiredPeriodBinding<Input> = Input extends unknown ? 'period' extends keyof Input ? Input extends {
|
|
27
|
+
period: DateRangeRequest;
|
|
28
|
+
} ? never : 'period' : Input extends DateRangeRequest ? never : 'period' : never;
|
|
25
29
|
/** Bind declared operations to URL variables, displayed readings, and request feedback. */
|
|
26
30
|
export declare function createDataHooks<Operations extends DataOperations>(client: DataClient<Operations>): {
|
|
27
31
|
defineDataView: <Name extends keyof Operations & string, const Variables extends VariableCollection = {}, const Context extends AuthoringDataContext = AuthoringDataContext>(definition: DataViewDefinition<Name, Variables, InputOf<Operations[Name]>, OutputOf<Operations[Name]>> & {
|
|
@@ -43,19 +47,16 @@ export declare function createDataHooks<Operations extends DataOperations>(clien
|
|
|
43
47
|
variables?: Additional & {
|
|
44
48
|
period?: never;
|
|
45
49
|
};
|
|
46
|
-
bindings?: ViewBindings<{
|
|
47
|
-
period: ReturnType<typeof dateRangeVariable>;
|
|
48
|
-
} & NoInfer<Additional>, InputOf<Operations[Name]>>;
|
|
49
50
|
isEmpty: (data: OutputOf<Operations[Name]>) => boolean;
|
|
50
51
|
emptyFallback: EmptyContent;
|
|
51
|
-
} & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>>) => DeclaredView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Omit<DataViewDefinition<Name, {
|
|
52
|
-
period:
|
|
52
|
+
} & TimeInputMapping<NoInfer<Additional>, InputOf<Operations[Name]>> & ViewBindingOptions<TimeVariables<NoInfer<Additional>>, InputOf<Operations[Name]>, RequiredPeriodBinding<InputOf<Operations[Name]>>>) => DeclaredView<OutputOf<Operations[Name]>, InputOf<Operations[Name]>, Omit<DataViewDefinition<Name, {
|
|
53
|
+
period: DateRangeVariable;
|
|
53
54
|
} & Additional, InputOf<Operations[Name]>, OutputOf<Operations[Name]>>, "input" | "variables"> & {
|
|
54
55
|
variables: {
|
|
55
|
-
period:
|
|
56
|
+
period: DateRangeVariable;
|
|
56
57
|
} & Additional;
|
|
57
58
|
input: (values: ResolvedVariables<NoInfer<{
|
|
58
|
-
period:
|
|
59
|
+
period: DateRangeVariable;
|
|
59
60
|
} & Additional>>) => InputOf<Operations[Name]>;
|
|
60
61
|
describeInput: (input: InputOf<Operations[Name]>) => string;
|
|
61
62
|
}> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Declared views, bound widgets, and layouts for data-app authoring. */
|
|
2
|
-
export type { DatasetColumn, DatasetDeclaration as DatasetDefinition, } from './bindings.js';
|
|
2
|
+
export type { DatasetColumn, DatasetSuggestionOptions, DatasetDeclaration as DatasetDefinition, } from './bindings.js';
|
|
3
3
|
export { injectDataAppStyles } from './styles.js';
|
|
4
4
|
export type { DataAppStylesOptions } from './styles.js';
|
|
5
5
|
export type { DataAppStyle, DataAppStyleToken, DataAppStyleHooks, } from './style-contract.js';
|
|
@@ -47,7 +47,7 @@ export type { UpdatedAtProps } from './ui/UpdatedAt.js';
|
|
|
47
47
|
export { DateTimeTooltip } from './ui/DateTimeTooltip.js';
|
|
48
48
|
export type { DateTimeTooltipProps } from './ui/DateTimeTooltip.js';
|
|
49
49
|
export { searchVariable, choiceVariable, multiChoiceVariable, dateRangeVariable, } from './ui/variables.js';
|
|
50
|
-
export type { AppVariable, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
|
|
50
|
+
export type { AppVariable, VariablePresentation, AppVariableValues, ChoiceOption, ChoiceVariable, MultiChoiceVariable, SearchVariable, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './ui/variables.js';
|
|
51
51
|
export { PeriodSummary } from './ui/PeriodSummary.js';
|
|
52
52
|
export type { ReportingPeriod, PeriodComparison, PeriodSummaryProps, } from './ui/PeriodSummary.js';
|
|
53
53
|
export { createDataContext } from './ui/data-context.js';
|
|
@@ -68,3 +68,8 @@ export { useDataAppAnnotations } from './annotations/useDataAppAnnotations.js';
|
|
|
68
68
|
export { AnnotationBar } from './annotations/AnnotationBar.js';
|
|
69
69
|
export type { AnnotationBarHandle, AnnotationBarProps, } from './annotations/AnnotationBar.js';
|
|
70
70
|
export { injectDataAppAnnotationStyles } from './annotations/styles.js';
|
|
71
|
+
export { SectionHeading } from './ui/SectionHeading.js';
|
|
72
|
+
export type { SectionHeadingProps } from './ui/SectionHeading.js';
|
|
73
|
+
export { DateDisplay } from './ui/DateDisplay.js';
|
|
74
|
+
export type { DateDisplayProps } from './ui/DateDisplay.js';
|
|
75
|
+
export { useDateFormatting } from './date-formatting.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SearchSuggestion } from './ui/SearchTypeahead.js';
|
|
2
|
+
/** The primary view supplies suggestions from exactly the source displayed by its widgets. */
|
|
3
|
+
export declare const SearchSuggestionsContext: import("react").Context<{
|
|
4
|
+
groups: readonly (readonly SearchSuggestion[])[];
|
|
5
|
+
busy: boolean;
|
|
6
|
+
} | null>;
|
|
7
|
+
/** Share five slots across datasets, then prioritize title matches without filtering source rows. */
|
|
8
|
+
export declare function balanceSearchSuggestions(groups: readonly (readonly SearchSuggestion[])[], query?: string): SearchSuggestion[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
2
|
/** Public custom-property names for authoring types and validation. CSS owns their defaults. */
|
|
3
|
-
export declare const dataAppStyleTokens: readonly ['--atbl-control-text-size', '--atbl-annotation-accent', '--atbl-annotation-accent-hover', '--atbl-annotation-on-accent', '--atbl-annotation-highlight', '--atbl-background', '--atbl-surface', '--atbl-subtle', '--atbl-text', '--atbl-muted', '--atbl-border', '--atbl-accent', '--atbl-accent-subtle', '--atbl-on-accent', '--atbl-positive', '--atbl-negative', '--atbl-danger', '--atbl-danger-subtle', '--atbl-backdrop', '--atbl-code-surface', '--atbl-code-text', '--atbl-code-keyword', '--atbl-chart-fill', '--atbl-control-hover-border', '--atbl-focus-color', '--atbl-focus-outline', '--atbl-focus-ring-offset', '--atbl-focus-ring-inset', '--atbl-font', '--atbl-font-heading', '--atbl-mono-font', '--atbl-space-xs', '--atbl-space-sm', '--atbl-space-md', '--atbl-space-lg', '--atbl-space-xl', '--atbl-layout-gap', '--atbl-content-width', '--atbl-control-height', '--atbl-radius-control', '--atbl-radius-surface', '--atbl-radius-overlay', '--atbl-shadow-surface', '--atbl-shadow-overlay', '--atbl-shadow-control', '--atbl-cursor-action', '--atbl-cursor-disabled', '--atbl-cursor-help', '--atbl-duration-fast', '--atbl-duration-normal', '--atbl-duration-slow', '--atbl-ease-standard', '--atbl-ease-enter', '--atbl-chart-1', '--atbl-chart-2', '--atbl-chart-3', '--atbl-chart-4', '--atbl-chart-5', '--atbl-chart-6', '--atbl-chart-7', '--atbl-chart-8', '--atbl-type-emphasis-weight', '--atbl-type-meta-weight', '--atbl-type-page-size', '--atbl-type-section-size', '--atbl-type-widget-size', '--atbl-type-body-size', '--atbl-type-label-size', '--atbl-type-meta-size', '--atbl-type-metric-size', '--atbl-type-heading-weight', '--atbl-type-label-weight', '--atbl-type-body-leading', '--atbl-type-label-leading', '--atbl-type-heading-leading', '--atbl-type-metric-leading', '--atbl-text-measure', '--atbl-control-compact-height', '--atbl-control-icon-size', '--atbl-control-padding-inline', '--atbl-control-padding-block', '--atbl-control-gap', '--atbl-control-disabled-opacity', '--atbl-cursor-busy', '--atbl-control-hover-surface', '--atbl-control-pressed-surface', '--atbl-control-selected-surface', '--atbl-control-selected-text'];
|
|
3
|
+
export declare const dataAppStyleTokens: readonly ['--atbl-control-text-size', '--atbl-annotation-accent', '--atbl-annotation-accent-hover', '--atbl-annotation-on-accent', '--atbl-annotation-highlight', '--atbl-background', '--atbl-surface', '--atbl-subtle', '--atbl-text', '--atbl-muted', '--atbl-border', '--atbl-accent', '--atbl-accent-subtle', '--atbl-on-accent', '--atbl-positive', '--atbl-negative', '--atbl-danger', '--atbl-danger-subtle', '--atbl-backdrop', '--atbl-code-surface', '--atbl-code-text', '--atbl-code-keyword', '--atbl-chart-fill', '--atbl-control-hover-border', '--atbl-focus-color', '--atbl-focus-outline', '--atbl-focus-ring-offset', '--atbl-focus-ring-inset', '--atbl-font', '--atbl-font-heading', '--atbl-mono-font', '--atbl-space-xs', '--atbl-space-sm', '--atbl-space-md', '--atbl-space-lg', '--atbl-space-xl', '--atbl-layout-gap', '--atbl-surface-padding', '--atbl-content-width', '--atbl-control-height', '--atbl-radius-control', '--atbl-radius-surface', '--atbl-radius-overlay', '--atbl-shadow-surface', '--atbl-shadow-overlay', '--atbl-shadow-control', '--atbl-cursor-action', '--atbl-cursor-disabled', '--atbl-cursor-help', '--atbl-duration-fast', '--atbl-duration-normal', '--atbl-duration-slow', '--atbl-ease-standard', '--atbl-ease-enter', '--atbl-chart-1', '--atbl-chart-2', '--atbl-chart-3', '--atbl-chart-4', '--atbl-chart-5', '--atbl-chart-6', '--atbl-chart-7', '--atbl-chart-8', '--atbl-type-emphasis-weight', '--atbl-type-meta-weight', '--atbl-type-page-size', '--atbl-type-section-size', '--atbl-type-widget-size', '--atbl-type-body-size', '--atbl-type-label-size', '--atbl-type-meta-size', '--atbl-type-metric-size', '--atbl-type-heading-weight', '--atbl-type-label-weight', '--atbl-type-body-leading', '--atbl-type-label-leading', '--atbl-type-heading-leading', '--atbl-type-metric-leading', '--atbl-text-measure', '--atbl-control-compact-height', '--atbl-control-icon-size', '--atbl-control-padding-inline', '--atbl-control-padding-block', '--atbl-control-gap', '--atbl-control-disabled-opacity', '--atbl-cursor-busy', '--atbl-control-hover-surface', '--atbl-control-pressed-surface', '--atbl-control-open-surface', '--atbl-control-open-border', '--atbl-control-selected-surface', '--atbl-control-selected-text'];
|
|
4
4
|
/** Stable component roots for CSS customization; only utilities may be placed on native markup. */
|
|
5
5
|
export declare const dataAppStyleClasses: {
|
|
6
6
|
readonly 'altertable-app-layout': {
|
|
@@ -39,10 +39,6 @@ export declare const dataAppStyleClasses: {
|
|
|
39
39
|
readonly component: 'MetricWidget';
|
|
40
40
|
readonly kind: 'root';
|
|
41
41
|
};
|
|
42
|
-
readonly 'altertable-data-app-skeleton': {
|
|
43
|
-
readonly component: 'DataAppSkeleton';
|
|
44
|
-
readonly kind: 'root';
|
|
45
|
-
};
|
|
46
42
|
readonly 'altertable-chart-legend': {
|
|
47
43
|
readonly component: 'ChartLegend';
|
|
48
44
|
readonly kind: 'root';
|
|
@@ -59,6 +55,18 @@ export declare const dataAppStyleClasses: {
|
|
|
59
55
|
readonly component: 'ChartLegend.Label';
|
|
60
56
|
readonly kind: 'root';
|
|
61
57
|
};
|
|
58
|
+
readonly 'altertable-funnel-chart': {
|
|
59
|
+
readonly component: 'FunnelChart';
|
|
60
|
+
readonly kind: 'root';
|
|
61
|
+
};
|
|
62
|
+
readonly 'altertable-retention-chart': {
|
|
63
|
+
readonly component: 'RetentionChart';
|
|
64
|
+
readonly kind: 'root';
|
|
65
|
+
};
|
|
66
|
+
readonly 'altertable-journey-chart': {
|
|
67
|
+
readonly component: 'JourneyChart';
|
|
68
|
+
readonly kind: 'root';
|
|
69
|
+
};
|
|
62
70
|
readonly 'altertable-composed-chart': {
|
|
63
71
|
readonly component: 'ComposedChart';
|
|
64
72
|
readonly kind: 'root';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type ComponentPropsWithRef, type ReactNode } from 'react';
|
|
2
2
|
export type ChartLegendProps = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
|
|
4
|
+
/** Single-row fits up to four cells before expansion, adapting to available width. */
|
|
5
|
+
layout?: 'horizontal' | 'vertical' | 'single-row';
|
|
5
6
|
align?: 'start' | 'center' | 'end';
|
|
6
|
-
/**
|
|
7
|
+
/** Optional cell cap, including expansion. Horizontal legends default to two rows. */
|
|
7
8
|
maxVisibleItems?: number;
|
|
8
9
|
} & Omit<ComponentPropsWithRef<'ul'>, 'children'>;
|
|
9
10
|
/** Optional chart key, placed beside any chart with the app's layout components.
|
|
@@ -14,7 +15,7 @@ export type ChartLegendItemProps = ComponentPropsWithRef<'li'> & {
|
|
|
14
15
|
};
|
|
15
16
|
/** Descriptive by default; compose a button inside the item for an authored series toggle. */
|
|
16
17
|
declare function ChartLegendItem({ inactive, className, ...props }: ChartLegendItemProps): import("react").JSX.Element;
|
|
17
|
-
export type ChartLegendMarkerKind = 'bar' | 'line' | 'area' | 'point' | 'slice';
|
|
18
|
+
export type ChartLegendMarkerKind = 'square' | 'bar' | 'line' | 'area' | 'point' | 'slice';
|
|
18
19
|
export type ChartLegendMarkerProps = Omit<ComponentPropsWithRef<'svg'>, 'children'> & {
|
|
19
20
|
kind: ChartLegendMarkerKind;
|
|
20
21
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { type ControlLabelPlacement } from './PickerField.js';
|
|
1
2
|
import type { ChoiceOption } from '../../core/variables.js';
|
|
2
3
|
export type { ChoiceOption } from '../../core/variables.js';
|
|
3
4
|
type SharedProps = {
|
|
4
5
|
label: string;
|
|
6
|
+
labelPlacement?: ControlLabelPlacement;
|
|
5
7
|
options: readonly ChoiceOption[];
|
|
6
8
|
/** Separate source state, rendered last with a divider and the shared option component. */
|
|
7
9
|
missingOption?: ChoiceOption;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
2
|
import { ComposedChartLegend as Legend } from './ComposedChartLegend.js';
|
|
3
3
|
import { ComposedChart as RechartsComposedChart, ZAxis, ReferenceLine, ReferenceArea, ReferenceDot, Brush, Label, LabelList, ErrorBar } from 'recharts';
|
|
4
4
|
import { ChartBar as Bar, ChartDot as Dot, ChartLine as Line, ChartArea as Area, ChartScatter as Scatter, ChartXAxis as XAxis, ChartYAxis as YAxis, ChartGrid as CartesianGrid, ChartTooltip as Tooltip } from './chart-primitives.js';
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type RegisteredBinding } from '../bindings.js';
|
|
1
|
+
import { type ExportDataset, type RegisteredBinding } from '../bindings.js';
|
|
2
2
|
import type { DisplayedSnapshot } from '../../core/data-view.js';
|
|
3
|
-
import { type ExportDataset } from '../bindings.js';
|
|
4
3
|
import type { StoryFinding } from './story.js';
|
|
5
|
-
import { type DataAppBaseProps } from './DataAppFrame.js';
|
|
4
|
+
import { type DataAppBaseProps, type DataAppControlProps } from './DataAppFrame.js';
|
|
6
5
|
import { type DeclaredView } from '../view-runtime.js';
|
|
7
|
-
export type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'> & {
|
|
6
|
+
export type DataAppProps<Data, Input = unknown> = Omit<DataAppBaseProps, 'dataContext'> & DataAppControlProps & {
|
|
8
7
|
view: DeclaredView<Data, Input> & {
|
|
9
8
|
scope(snapshot: DisplayedSnapshot<Data, Input>): string;
|
|
10
9
|
};
|
|
10
|
+
/** Show supplied datasets’ record suggestions on the first declared search. Defaults to true. */
|
|
11
|
+
showSearchSuggestions?: boolean;
|
|
11
12
|
story: (snapshot: DisplayedSnapshot<Data, Input>) => readonly (Omit<StoryFinding, 'evidence'> & {
|
|
12
13
|
evidence: RegisteredBinding;
|
|
13
14
|
})[];
|
|
@@ -12,21 +12,32 @@ export type DataAppBaseProps = {
|
|
|
12
12
|
description?: ReactNode;
|
|
13
13
|
toolbarActions?: ReactNode;
|
|
14
14
|
footerActions?: ReactNode;
|
|
15
|
+
/** Optional source, coverage, or methodology note below the app content.
|
|
16
|
+
* Compose prose and inline components; typography and spacing are provided.
|
|
17
|
+
* Put data widgets in children and app controls in footerActions. */
|
|
18
|
+
footer?: ReactNode;
|
|
15
19
|
};
|
|
16
20
|
export type DataAppRequest<Data, Input> = SectionResult<Data, Input> & {
|
|
17
21
|
queries?: DisclosedQuery[];
|
|
18
22
|
/** Actual request activity, including retries with retained data. */
|
|
19
23
|
refreshing?: boolean;
|
|
20
24
|
cancel?: () => unknown;
|
|
21
|
-
|
|
25
|
+
searchControls?: ReactNode;
|
|
26
|
+
filterControls?: ReactNode;
|
|
27
|
+
};
|
|
28
|
+
export type DataAppControlProps = {
|
|
29
|
+
/** Show declared search controls. Defaults to true; hiding preserves their values. */
|
|
30
|
+
showSearch?: boolean;
|
|
31
|
+
/** Show declared filter controls, including display options. Defaults to true; hiding preserves their values. */
|
|
32
|
+
showFilters?: boolean;
|
|
22
33
|
};
|
|
23
34
|
export type StaticDataAppProps = DataAppBaseProps & {
|
|
24
35
|
csvExport?: CsvExport;
|
|
25
36
|
queries?: DisclosedQuery[];
|
|
26
37
|
};
|
|
27
|
-
export type DataAppProps<Data = unknown, Input = unknown> = (DataAppBaseProps & {
|
|
38
|
+
export type DataAppProps<Data = unknown, Input = unknown> = (DataAppBaseProps & DataAppControlProps & {
|
|
28
39
|
request: DataAppRequest<Data, Input>;
|
|
29
|
-
/** Findings are always derived from the result currently visible to the
|
|
40
|
+
/** Findings are always derived from the result currently visible to the user. */
|
|
30
41
|
story: BoundStory<Data, Input>;
|
|
31
42
|
/** Export every distinct dataset in the displayed result. */
|
|
32
43
|
csvExport: (snapshot: DisplayedSnapshot<Data, Input>) => CsvExport;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
2
|
import type { EmptyContent } from './presentation.js';
|
|
3
3
|
import { type SearchFieldProps } from './SearchField.js';
|
|
4
|
-
export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue'> & {
|
|
4
|
+
export type DataTableSearch = Pick<SearchFieldProps, 'label' | 'placeholder' | 'value' | 'onChange' | 'resetValue' | 'inputProps'> & {
|
|
5
5
|
/** Number of available records before filtering or a display limit. */
|
|
6
6
|
itemCount: number;
|
|
7
7
|
};
|
|
@@ -18,10 +18,12 @@ export declare function DataTableShare({ value }: {
|
|
|
18
18
|
export type DataTableEmptyRowProps = EmptyContent & {
|
|
19
19
|
colSpan: number;
|
|
20
20
|
};
|
|
21
|
-
export declare function DataTableEmptyRow({ colSpan, title, description, }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
21
|
+
export declare function DataTableEmptyRow({ colSpan, title, description, action, }: DataTableEmptyRowProps): import("react").JSX.Element;
|
|
22
22
|
export type DataTableTimestampProps = {
|
|
23
|
-
value: string | Date;
|
|
23
|
+
value: string | Date | number;
|
|
24
24
|
children?: ReactNode;
|
|
25
25
|
timeZone?: string;
|
|
26
|
+
locale?: string;
|
|
27
|
+
precision?: 'minute' | 'second';
|
|
26
28
|
};
|
|
27
|
-
export declare function DataTableTimestamp({ value, children, timeZone, }: DataTableTimestampProps): import("react").JSX.Element;
|
|
29
|
+
export declare function DataTableTimestamp({ value, children, timeZone, locale, precision, }: DataTableTimestampProps): import("react").JSX.Element;
|
|
@@ -4,7 +4,11 @@ import type { EmptyContent, BoundWidgetReading } from './presentation.js';
|
|
|
4
4
|
import type { WidgetEvidence } from './WidgetEvidence.js';
|
|
5
5
|
type DataWidgetBaseProps = {
|
|
6
6
|
title: ReactNode;
|
|
7
|
+
/** Document outline level. The widget title keeps the shared widget-heading appearance. */
|
|
8
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
9
|
+
/** Unique stable target for persisted feedback; overrides automatic evidence identity. */
|
|
7
10
|
annotationId?: string;
|
|
11
|
+
/** Result count beside the heading. Derive from the displayed result; zero is visible. */
|
|
8
12
|
count?: number;
|
|
9
13
|
description?: ReactNode;
|
|
10
14
|
evidence?: WidgetEvidence;
|