@altertable/data-app 0.62.0 → 0.64.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 +4 -34
- package/CONTRIBUTING.md +79 -87
- package/README.md +14 -38
- package/dist/chunks/{contract-ryyf6dme.js → contract-cxr9t12b.js} +2 -5
- package/dist/chunks/contract-cxr9t12b.js.map +10 -0
- package/dist/chunks/contract-mev09s5v.js.map +2 -2
- package/dist/chunks/{contract-xjv197ck.js → contract-mwe7gnmh.js} +8 -8
- package/dist/chunks/{contract-xjv197ck.js.map → contract-mwe7gnmh.js.map} +3 -3
- package/dist/chunks/{contract-3bnrf5pf.js → contract-tf8c3qpv.js} +11 -3
- package/dist/chunks/contract-tf8c3qpv.js.map +11 -0
- package/dist/chunks/{contract-farfe948.js → contract-txjy0en2.js} +31 -31
- package/dist/chunks/contract-txjy0en2.js.map +10 -0
- package/dist/chunks/contract-wz59z8pq.js.map +2 -2
- package/dist/chunks/{contract-4vrw9zk9.js → contract-xtxza1fy.js} +69 -60
- package/dist/chunks/contract-xtxza1fy.js.map +12 -0
- package/dist/chunks/{contract-nt819swq.js → contract-yxbjea23.js} +13 -6
- package/dist/chunks/contract-yxbjea23.js.map +12 -0
- package/dist/chunks/{contract-rrm7s5zp.js → contract-zr3jd7mr.js} +5 -5
- package/dist/chunks/contract-zr3jd7mr.js.map +12 -0
- package/dist/client/index.js +7 -8
- package/dist/client/index.js.map +1 -1
- package/dist/core/appearance.js +4 -2
- package/dist/core/appearance.js.map +1 -1
- package/dist/core/contract.js +2 -2
- package/dist/embed/index.js +9 -11
- package/dist/embed/index.js.map +2 -2
- package/dist/local.js +7 -31
- package/dist/local.js.map +5 -7
- package/dist/react/embed/index.js +2 -3
- package/dist/react/embed/index.js.map +2 -2
- package/dist/react/index.js +5446 -230
- package/dist/react/index.js.map +71 -66
- package/dist/server.js +7 -31
- package/dist/server.js.map +5 -7
- package/dist/types/client/data-client.d.ts +33 -0
- package/dist/types/client/index.d.ts +5 -41
- package/dist/types/client/location.d.ts +4 -6
- package/dist/types/client/navigation.d.ts +2 -1
- package/dist/types/core/appearance.d.ts +12 -1
- package/dist/types/core/bridge.d.ts +2 -8
- package/dist/types/core/config.d.ts +3 -2
- package/dist/types/core/contract.d.ts +9 -56
- package/dist/types/core/format.d.ts +0 -1
- package/dist/types/core/messages.d.ts +5 -30
- package/dist/types/core/navigation.d.ts +11 -0
- package/dist/types/core/operation-types.d.ts +76 -0
- package/dist/types/core/operation.d.ts +2 -8
- package/dist/types/core/variables.d.ts +2 -2
- package/dist/types/embed/host.d.ts +5 -3
- package/dist/types/embed/index.d.ts +0 -1
- package/dist/types/embed/source.d.ts +2 -9
- package/dist/types/react/content.d.ts +3 -3
- package/dist/types/react/hooks.d.ts +65 -64
- package/dist/types/react/index.d.ts +135 -2
- package/dist/types/react/injectStyles.d.ts +7 -0
- package/dist/types/react/shellStyles.d.ts +3 -0
- package/dist/types/react/styles.d.ts +8 -0
- package/dist/types/react/ui/AboutData.d.ts +0 -1
- package/dist/types/react/ui/AppFooter.d.ts +0 -1
- package/dist/types/react/ui/AppHeader.d.ts +0 -1
- package/dist/types/react/ui/AppLayout.d.ts +0 -1
- package/dist/types/react/ui/AppScope.d.ts +0 -1
- package/dist/types/react/ui/AppToolbar.d.ts +0 -1
- package/dist/types/react/ui/Breakdown.d.ts +0 -1
- package/dist/types/react/ui/Button.d.ts +0 -1
- package/dist/types/react/ui/Checkbox.d.ts +0 -1
- package/dist/types/react/ui/Combobox.d.ts +0 -1
- package/dist/types/react/ui/ComparisonVisual.d.ts +0 -1
- package/dist/types/react/ui/ContentSkeleton.d.ts +2 -5
- package/dist/types/react/ui/DataApp.d.ts +2 -2
- package/dist/types/react/ui/DataAppSkeleton.d.ts +0 -1
- package/dist/types/react/ui/DataBoundary.d.ts +0 -1
- package/dist/types/react/ui/DataSection.d.ts +2 -4
- package/dist/types/react/ui/DataTable.d.ts +2 -3
- package/dist/types/react/ui/DataViewToast.d.ts +0 -1
- package/dist/types/react/ui/DataWidget.d.ts +4 -14
- package/dist/types/react/ui/DateRangePicker.d.ts +0 -1
- package/dist/types/react/ui/DateTimeTooltip.d.ts +0 -1
- package/dist/types/react/ui/EmptyState.d.ts +2 -5
- package/dist/types/react/ui/GettingStarted.d.ts +0 -1
- package/dist/types/react/ui/GlossaryDefinition.d.ts +0 -1
- package/dist/types/react/ui/GlossaryExplanation.d.ts +0 -1
- package/dist/types/react/ui/GradientScroll.d.ts +0 -1
- package/dist/types/react/ui/Grid.d.ts +0 -1
- package/dist/types/react/ui/HelpPopover.d.ts +0 -2
- package/dist/types/react/ui/Kbd.d.ts +0 -1
- package/dist/types/react/ui/LiveControl.d.ts +0 -1
- package/dist/types/react/ui/MetricWidget.d.ts +0 -2
- package/dist/types/react/ui/PeriodSummary.d.ts +0 -1
- package/dist/types/react/ui/PresentStory.d.ts +0 -1
- package/dist/types/react/ui/QueryList.d.ts +0 -1
- package/dist/types/react/ui/Ranking.d.ts +0 -1
- package/dist/types/react/ui/RefreshControl.d.ts +0 -1
- package/dist/types/react/ui/RefreshRegion.d.ts +0 -1
- package/dist/types/react/ui/RequestHint.d.ts +0 -1
- package/dist/types/react/ui/SearchField.d.ts +0 -1
- package/dist/types/react/ui/SearchInput.d.ts +0 -1
- package/dist/types/react/ui/SearchMatch.d.ts +0 -1
- package/dist/types/react/ui/SelectableBarChart.d.ts +0 -1
- package/dist/types/react/ui/SelectionMark.d.ts +0 -1
- package/dist/types/react/ui/Sheet.d.ts +0 -1
- package/dist/types/react/ui/Skeleton.d.ts +0 -1
- package/dist/types/react/ui/Stack.d.ts +0 -1
- package/dist/types/react/ui/StatusPanel.d.ts +0 -1
- package/dist/types/react/ui/TableWidget.d.ts +2 -3
- package/dist/types/react/ui/Tabs.d.ts +0 -1
- package/dist/types/react/ui/TextContent.d.ts +4 -0
- package/dist/types/react/ui/TextWidget.d.ts +19 -0
- package/dist/types/react/ui/ThemeSelector.d.ts +0 -1
- package/dist/types/react/ui/Tooltip.d.ts +0 -1
- package/dist/types/react/ui/UpdatedAt.d.ts +0 -1
- package/dist/types/react/ui/VariableBar.d.ts +0 -1
- package/dist/types/react/ui/VisualizationWidget.d.ts +5 -13
- package/dist/types/react/ui/WidgetDisclosure.d.ts +0 -1
- package/dist/types/react/ui/WidgetViewTabs.d.ts +2 -3
- package/dist/types/react/ui/data-identifiers.d.ts +0 -1
- package/dist/types/react/ui/presentation.d.ts +19 -0
- package/dist/types/react/ui/useAppAppearance.d.ts +2 -2
- package/dist/types/react/view-controls.d.ts +1 -1
- package/dist/types/react/view.d.ts +2 -2
- package/dist/worker.js +1 -0
- package/docs/app-authoring.md +61 -44
- package/docs/client.md +11 -19
- package/docs/contract.md +9 -9
- package/docs/embed.md +10 -29
- package/docs/hosted-apps.md +39 -0
- package/docs/local-data-apps.md +14 -0
- package/docs/react-embed.md +10 -19
- package/docs/react.md +108 -134
- package/docs/server-bun.md +4 -6
- package/docs/server.md +2 -2
- package/docs/worker.md +3 -5
- package/examples/starter-data-app/index.tsx +159 -0
- package/package.json +16 -10
- package/dist/chunks/contract-3bnrf5pf.js.map +0 -10
- package/dist/chunks/contract-4vrw9zk9.js.map +0 -12
- package/dist/chunks/contract-8q35dcyh.js +0 -9
- package/dist/chunks/contract-8q35dcyh.js.map +0 -10
- package/dist/chunks/contract-farfe948.js.map +0 -10
- package/dist/chunks/contract-nt819swq.js.map +0 -11
- package/dist/chunks/contract-rrm7s5zp.js.map +0 -12
- package/dist/chunks/contract-ryyf6dme.js.map +0 -10
- package/dist/react/index.css +0 -4628
- package/dist/react.css.d.ts +0 -1
- package/dist/types/react/ui/index.d.ts +0 -131
- package/docs/appearance.md +0 -43
- package/docs/config.md +0 -21
- package/docs/format.md +0 -29
- package/docs/react-styles.md +0 -17
- package/docs/starter-agent-instructions.md +0 -53
package/dist/react.css.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export { DataApp } from './DataApp.js';
|
|
3
|
-
export type { DataAppProps, DataAppRequest } from './DataApp.js';
|
|
4
|
-
export { GettingStarted } from './GettingStarted.js';
|
|
5
|
-
export { AppLayout } from './AppLayout.js';
|
|
6
|
-
export type { AppLayoutProps } from './AppLayout.js';
|
|
7
|
-
export { AppHeader } from './AppHeader.js';
|
|
8
|
-
export type { AppHeaderProps } from './AppHeader.js';
|
|
9
|
-
export { AppScope } from './AppScope.js';
|
|
10
|
-
export type { AppScopeProps } from './AppScope.js';
|
|
11
|
-
export { AppToolbar } from './AppToolbar.js';
|
|
12
|
-
export type { AppToolbarProps } from './AppToolbar.js';
|
|
13
|
-
export { VariableBar } from './VariableBar.js';
|
|
14
|
-
export type { VariableBarProps } from './VariableBar.js';
|
|
15
|
-
export { AppFooter } from './AppFooter.js';
|
|
16
|
-
export type { AppFooterProps } from './AppFooter.js';
|
|
17
|
-
export { ThemeSelector, ThemeToggle } from './ThemeSelector.js';
|
|
18
|
-
export type { ThemeSelectorProps } from './ThemeSelector.js';
|
|
19
|
-
export { Stack } from './Stack.js';
|
|
20
|
-
export type { StackProps } from './Stack.js';
|
|
21
|
-
export { Grid } from './Grid.js';
|
|
22
|
-
export type { GridProps } from './Grid.js';
|
|
23
|
-
export { GridItem } from './GridItem.js';
|
|
24
|
-
export type { GridItemProps } from './GridItem.js';
|
|
25
|
-
export type { WidgetEvidence } from './WidgetEvidence.js';
|
|
26
|
-
export { DataWidget } from './DataWidget.js';
|
|
27
|
-
export type { WidgetStatus } from './RequestHint.js';
|
|
28
|
-
export type { DataWidgetProps } from './DataWidget.js';
|
|
29
|
-
export { VisualizationWidget } from './VisualizationWidget.js';
|
|
30
|
-
export type { VisualizationWidgetProps, VisualizationWidgetView, } from './VisualizationWidget.js';
|
|
31
|
-
export { TableWidget } from './TableWidget.js';
|
|
32
|
-
export type { TableWidgetColumn, TableWidgetProps, TableWidgetSearch, } from './TableWidget.js';
|
|
33
|
-
export { chartColor } from './chartColor.js';
|
|
34
|
-
export { Breakdown } from './Breakdown.js';
|
|
35
|
-
export type { BreakdownItem, BreakdownProps } from './Breakdown.js';
|
|
36
|
-
export { Ranking } from './Ranking.js';
|
|
37
|
-
export type { RankingItem, RankingProps } from './Ranking.js';
|
|
38
|
-
export { WidgetDisclosure } from './WidgetDisclosure.js';
|
|
39
|
-
export type { WidgetDisclosureProps } from './WidgetDisclosure.js';
|
|
40
|
-
export { WidgetViewTabs } from './WidgetViewTabs.js';
|
|
41
|
-
export type { WidgetView, WidgetViewTabsProps, } from './WidgetViewTabs.js';
|
|
42
|
-
export { ComparisonVisual } from './ComparisonVisual.js';
|
|
43
|
-
export type { ComparisonVisualProps } from './ComparisonVisual.js';
|
|
44
|
-
export { calendarMetricComparison } from './comparison.js';
|
|
45
|
-
export type { MetricComparison } from './comparison.js';
|
|
46
|
-
export { DataTable, DataTableEmptyRow, DataTableTimestamp, DataTableShare, } from './DataTable.js';
|
|
47
|
-
export type { DataTableProps, DataTableSearch, DataTableEmptyRowProps, DataTableTimestampProps, } from './DataTable.js';
|
|
48
|
-
export { MetricWidget } from './MetricWidget.js';
|
|
49
|
-
export type { MetricWidgetProps } from './MetricWidget.js';
|
|
50
|
-
export { SelectableBarChart } from './SelectableBarChart.js';
|
|
51
|
-
export type { SelectableBarChartProps, SelectableBarItem, } from './SelectableBarChart.js';
|
|
52
|
-
export { DimensionPicker } from './DimensionPicker.js';
|
|
53
|
-
export { dimensionFilter, parseDimensionSelection, parseFacetOptions, dimensionPredicate, } from '../../core/dimension.js';
|
|
54
|
-
export type { DimensionSelection, DimensionMember, DimensionOption, DimensionVariable, DimensionFilterOptions, } from '../../core/dimension.js';
|
|
55
|
-
export { EmptyState } from './EmptyState.js';
|
|
56
|
-
export type { EmptyStateProps } from './EmptyState.js';
|
|
57
|
-
export { Skeleton } from './Skeleton.js';
|
|
58
|
-
export type { SkeletonProps } from './Skeleton.js';
|
|
59
|
-
export { DataAppSkeleton } from './DataAppSkeleton.js';
|
|
60
|
-
export type { DataAppSkeletonProps } from './DataAppSkeleton.js';
|
|
61
|
-
export { DataBoundary } from './DataBoundary.js';
|
|
62
|
-
export { resolveDataView } from '../../core/data-view.js';
|
|
63
|
-
export { displayedSnapshot } from '../../core/data-view.js';
|
|
64
|
-
export type { DataView, DataSnapshot, DisplayedSnapshot, } from '../../core/data-view.js';
|
|
65
|
-
export type { DataBoundaryProps } from './DataBoundary.js';
|
|
66
|
-
export { RefreshRegion } from './RefreshRegion.js';
|
|
67
|
-
export type { RefreshRegionProps } from './RefreshRegion.js';
|
|
68
|
-
export { DataSection } from './DataSection.js';
|
|
69
|
-
export type { DataSectionProps, SectionResult, } from './DataSection.js';
|
|
70
|
-
export { StatusPanel } from './StatusPanel.js';
|
|
71
|
-
export type { StatusPanelProps } from './StatusPanel.js';
|
|
72
|
-
export { ContentSkeleton } from './ContentSkeleton.js';
|
|
73
|
-
export type { ContentSkeletonProps } from './ContentSkeleton.js';
|
|
74
|
-
export { DataViewToast } from './DataViewToast.js';
|
|
75
|
-
export type { DataViewToastProps } from './DataViewToast.js';
|
|
76
|
-
export { UpdatedAt } from './UpdatedAt.js';
|
|
77
|
-
export type { UpdatedAtProps } from './UpdatedAt.js';
|
|
78
|
-
export { DateTimeTooltip } from './DateTimeTooltip.js';
|
|
79
|
-
export type { DateTimeTooltipProps } from './DateTimeTooltip.js';
|
|
80
|
-
export { LiveControl } from './LiveControl.js';
|
|
81
|
-
export type { LiveControlProps, LiveIntervalSeconds, } from './LiveControl.js';
|
|
82
|
-
export { DateRangePicker } from './DateRangePicker.js';
|
|
83
|
-
export type { DatePresetId, DateRange, DateRangePickerProps, } from './DateRangePicker.js';
|
|
84
|
-
export { defineAppVariables, textVariable, selectVariable, dateRangeVariable, dateRangeControl, useAppVariables, } from './variables.js';
|
|
85
|
-
export type { AppVariable, AppVariableValues, DateRangeSelection, DateRangeVariable, DateRangeVariableOptions, } from './variables.js';
|
|
86
|
-
export { PeriodSummary } from './PeriodSummary.js';
|
|
87
|
-
export type { ReportingPeriod, PeriodComparison, PeriodSummaryProps, } from './PeriodSummary.js';
|
|
88
|
-
export { SearchField } from './SearchField.js';
|
|
89
|
-
export type { SearchFieldProps } from './SearchField.js';
|
|
90
|
-
export { searchItems } from './searchItems.js';
|
|
91
|
-
export type { SearchAttribute, SearchHit, SearchItemsOptions, SearchMatchValue, SearchRange, } from './searchItems.js';
|
|
92
|
-
export { SearchMatch } from './SearchMatch.js';
|
|
93
|
-
export type { SearchMatchProps } from './SearchMatch.js';
|
|
94
|
-
export { Combobox } from './Combobox.js';
|
|
95
|
-
export type { ComboboxOption, ComboboxProps } from './Combobox.js';
|
|
96
|
-
export { GradientScroll } from './GradientScroll.js';
|
|
97
|
-
export type { GradientScrollProps } from './GradientScroll.js';
|
|
98
|
-
export { searchParams, slug, subscribeSearch, writeSearch, } from './search.js';
|
|
99
|
-
export { Tabs, TabList, Tab, TabPanels, TabPanel, useViewTab, } from './Tabs.js';
|
|
100
|
-
export { createDataContext, defineDataContext, evidenceFor, } from './data-context.js';
|
|
101
|
-
export type { DataContext, GlossaryEntry } from './data-context.js';
|
|
102
|
-
export { defineDataIdentifiers } from './data-identifiers.js';
|
|
103
|
-
export type { DataIdentifierDefinition, TableIdentifier, ColumnIdentifier, } from './data-identifiers.js';
|
|
104
|
-
export type { DisclosedQuery } from '../../core/contract.js';
|
|
105
|
-
export { GlossaryExplanation } from './GlossaryExplanation.js';
|
|
106
|
-
export type { GlossaryExplanationProps } from './GlossaryExplanation.js';
|
|
107
|
-
export { GlossaryDefinition } from './GlossaryDefinition.js';
|
|
108
|
-
export type { GlossaryDefinitionProps } from './GlossaryDefinition.js';
|
|
109
|
-
export { AboutData } from './AboutData.js';
|
|
110
|
-
export type { AboutDataProps, AboutEmpty, AboutSubject, AboutTab, } from './AboutData.js';
|
|
111
|
-
export { PresentStory } from './PresentStory.js';
|
|
112
|
-
export type { PresentStoryProps } from './PresentStory.js';
|
|
113
|
-
export type { StoryFinding, BoundStory } from './story.js';
|
|
114
|
-
export { Checkbox } from './Checkbox.js';
|
|
115
|
-
export type { CheckboxProps } from './Checkbox.js';
|
|
116
|
-
export { AppIcon } from './icons.js';
|
|
117
|
-
export type { AppIconName, AppIconProps } from './icons.js';
|
|
118
|
-
export { IconButton } from './IconButton.js';
|
|
119
|
-
export type { IconButtonProps } from './IconButton.js';
|
|
120
|
-
export { Kbd } from './Kbd.js';
|
|
121
|
-
export type { KbdProps } from './Kbd.js';
|
|
122
|
-
export { Sheet } from './Sheet.js';
|
|
123
|
-
export type { SheetDialogProps, SheetProps } from './Sheet.js';
|
|
124
|
-
export { Tooltip, TooltipProvider } from './Tooltip.js';
|
|
125
|
-
export type { TooltipProps, TooltipProviderProps, } from './Tooltip.js';
|
|
126
|
-
export { Button } from './Button.js';
|
|
127
|
-
export type { ButtonProps } from './Button.js';
|
|
128
|
-
export { HelpPopover } from './HelpPopover.js';
|
|
129
|
-
export type { HelpPopoverPanelProps, HelpPopoverProps, HelpPopoverTriggerProps, } from './HelpPopover.js';
|
|
130
|
-
export type { MetricDefinition } from './metric.js';
|
|
131
|
-
export type { DataReading, MetricReading, MetricValues, } from '../../core/reading.js';
|
package/docs/appearance.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Appearance
|
|
2
|
-
|
|
3
|
-
Import `parseAppearance`, `applyAppearance`, and `createThemeController` from
|
|
4
|
-
`@altertable/data-app/appearance`. Parsing is safe on the server. Applying tokens requires a browser document;
|
|
5
|
-
viewer preferences use browser storage.
|
|
6
|
-
|
|
7
|
-
```ts
|
|
8
|
-
import { parseAppearance } from '@altertable/data-app/appearance';
|
|
9
|
-
|
|
10
|
-
const appearance = parseAppearance({
|
|
11
|
-
theme: 'system',
|
|
12
|
-
accentColor: '#405d47',
|
|
13
|
-
density: 'comfortable',
|
|
14
|
-
});
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
`parseAppearance` fills omitted settings with defaults and rejects unknown keys
|
|
18
|
-
or invalid values. Settings include light/dark/system theme, neutral/slate/warm
|
|
19
|
-
base colors, accent colors, a chart palette, density, corner radius, elevation,
|
|
20
|
-
and body/heading typography. Colors are six-digit hexadecimal values.
|
|
21
|
-
|
|
22
|
-
`applyAppearance(appearance)` installs semantic CSS tokens on the document root
|
|
23
|
-
and returns a cleanup function for system-theme listening.
|
|
24
|
-
`createThemeController(initialTheme)` manages the viewer's preference through
|
|
25
|
-
`getTheme`, `setTheme`, and `subscribe`. It reads and persists local storage
|
|
26
|
-
when available. Apply the preference with `applyAppearance` in the UI owner;
|
|
27
|
-
the controller itself does not modify the document.
|
|
28
|
-
|
|
29
|
-
The React `DataApp` shell manages appearance for normal app usage. See
|
|
30
|
-
[configuration](config.md), [React](react.md), and [styles](react-styles.md).
|
|
31
|
-
|
|
32
|
-
`Theme` is the resolved `'light' | 'dark'` theme. `ThemePreference` additionally
|
|
33
|
-
allows `'system'` for standalone viewers. A trusted host supplies a `theme: Theme`
|
|
34
|
-
through [parent presentation](embed.md#parent-presentation). React applies that
|
|
35
|
-
theme directly with app-owned brand tokens; standalone viewers use the preference
|
|
36
|
-
controller. Appearance effect cleanup releases the system preference listener.
|
|
37
|
-
|
|
38
|
-
When migrating theme controls, replace `getMode`/`setMode` with
|
|
39
|
-
`getTheme`/`setTheme`, and initialize the controller with a `ThemePreference`
|
|
40
|
-
rather than appearance settings. Subscribe to the controller and compose its
|
|
41
|
-
preference with `applyAppearance` to update document tokens.
|
|
42
|
-
|
|
43
|
-
Appearance configuration uses `theme` (formerly `mode`).
|
package/docs/config.md
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# App configuration
|
|
2
|
-
|
|
3
|
-
Import `DataAppConfig` and `dataAppTitle` from `@altertable/data-app/config`.
|
|
4
|
-
Configuration is shared by the app shell and browser mounting code.
|
|
5
|
-
|
|
6
|
-
```ts
|
|
7
|
-
import type { DataAppConfig } from '@altertable/data-app/config';
|
|
8
|
-
|
|
9
|
-
export const config = {
|
|
10
|
-
title: 'Activity',
|
|
11
|
-
scope: { organization: 'example', environment: 'production' },
|
|
12
|
-
appearance: {},
|
|
13
|
-
} satisfies DataAppConfig;
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
`title` names the exploration. `scope` identifies its organization and
|
|
17
|
-
environment for display; it does not grant access to data.
|
|
18
|
-
`appearance` is validated by the [appearance APIs](appearance.md).
|
|
19
|
-
|
|
20
|
-
`dataAppTitle(config)` produces a document title containing the app title and
|
|
21
|
-
scope. [React mounting](react.md) applies it automatically.
|
package/docs/format.md
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Formatting
|
|
2
|
-
|
|
3
|
-
Import number and date helpers from `@altertable/data-app/format`. They use
|
|
4
|
-
JavaScript `Intl` APIs and can run in the browser or on the server.
|
|
5
|
-
|
|
6
|
-
```ts
|
|
7
|
-
import {
|
|
8
|
-
formatCount,
|
|
9
|
-
formatDateRange,
|
|
10
|
-
formatNumber,
|
|
11
|
-
formatPercent,
|
|
12
|
-
} from '@altertable/data-app/format';
|
|
13
|
-
|
|
14
|
-
formatCount(1200); // "1,200"
|
|
15
|
-
formatPercent(0.116); // "11.6%"
|
|
16
|
-
formatNumber(null); // "—"
|
|
17
|
-
formatDateRange({ start: '2026-01-01', end: '2026-01-03' });
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Percent values are ratios: `0.116` means 11.6%. Counts must be non-negative
|
|
21
|
-
integers. Missing or non-finite numbers render as `—`, customizable with
|
|
22
|
-
`missing`. Number formatting defaults to `en-US`; pass `locale` to override it.
|
|
23
|
-
|
|
24
|
-
`formatMetric` accepts a `MetricFormat` with `kind: 'count'`, `'ratio'`, or
|
|
25
|
-
`'currency'`; currency formats also require a currency code. `formatDateRange`
|
|
26
|
-
formats ISO calendar dates in UTC and retains the year in its labels.
|
|
27
|
-
`pluralize(count, singular, plural?)` selects a label for the count.
|
|
28
|
-
|
|
29
|
-
See [React metric definitions](react.md#bound-views-and-widgets).
|
package/docs/react-styles.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# React styles
|
|
2
|
-
|
|
3
|
-
Import the stylesheet once from the browser entry:
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import '@altertable/data-app/react/styles.css';
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
This entry is a CSS asset, with a declaration for TypeScript side-effect imports.
|
|
10
|
-
The app's bundler must process CSS imports. The React JavaScript entry does not
|
|
11
|
-
load it automatically, so server rendering can import components without
|
|
12
|
-
importing CSS into Node.
|
|
13
|
-
|
|
14
|
-
Stylesheets live beside their components in `src/react/ui` and are combined into
|
|
15
|
-
the published stylesheet during the build. Brand settings install semantic CSS
|
|
16
|
-
variables through [appearance](appearance.md); the [React app shell](react.md)
|
|
17
|
-
manages these for normal app usage.
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
# Starter agent instructions
|
|
2
|
-
|
|
3
|
-
The package ships `AGENTS.md`, public documentation in `docs/`, and declarations
|
|
4
|
-
referenced by its export map. Its agent guide describes package usage and includes
|
|
5
|
-
a separate section for contributors working in the package source repository.
|
|
6
|
-
|
|
7
|
-
A starter application's `AGENTS.md` owns its file paths, commands, and analysis
|
|
8
|
-
context. Keep it in the consuming app and explicitly direct agents to the
|
|
9
|
-
installed package guide. Dependency instructions are not guaranteed to be loaded
|
|
10
|
-
automatically: for example, [Codex discovers project instructions along the path
|
|
11
|
-
from the project root to its working directory](https://learn.chatgpt.com/docs/agent-configuration/agents-md),
|
|
12
|
-
not by scanning every dependency.
|
|
13
|
-
|
|
14
|
-
These installed docs replace references to the old vendored `.altertable/runtime`
|
|
15
|
-
layout for apps using this package.
|
|
16
|
-
|
|
17
|
-
Adapt this template to the starter's actual files and scripts:
|
|
18
|
-
|
|
19
|
-
```markdown
|
|
20
|
-
# Build this data app
|
|
21
|
-
|
|
22
|
-
Inspect source data, time coverage, and existing definitions before choosing an
|
|
23
|
-
exploration. Build conclusions from observed results; do not present association
|
|
24
|
-
as cause. Keep copy concise and relevant to the reader.
|
|
25
|
-
|
|
26
|
-
Read `node_modules/@altertable/data-app/AGENTS.md` first, then
|
|
27
|
-
`node_modules/@altertable/data-app/docs/app-authoring.md`.
|
|
28
|
-
|
|
29
|
-
| Task | App-owned files | Package documentation |
|
|
30
|
-
| ---------------------------------------- | ------------------------------------------- | -------------------------------------- |
|
|
31
|
-
| Define queries and inputs | `src/operations.ts`, shared input contracts | `docs/contract.md`, `docs/server.md` |
|
|
32
|
-
| Build views, filters, and request states | `src/App.tsx` | `docs/react.md` |
|
|
33
|
-
| Explain terms and query evidence | `src/data-context.ts` or `.tsx` | `docs/react.md#bind-evidence` |
|
|
34
|
-
| Change identity and brand | App configuration | `docs/config.md`, `docs/appearance.md` |
|
|
35
|
-
| Configure local serving or hosting | `src/server.ts` | `docs/server-bun.md`, `docs/server.md` |
|
|
36
|
-
|
|
37
|
-
Package documentation paths above are relative to
|
|
38
|
-
`node_modules/@altertable/data-app/`.
|
|
39
|
-
|
|
40
|
-
Edit app-owned source and import public package entries. Keep SQL and credentials
|
|
41
|
-
on the server, and import operation types with `import type` in browser code.
|
|
42
|
-
Do not edit installed package files. The connectivity screen is scaffolding,
|
|
43
|
-
not an example analysis.
|
|
44
|
-
|
|
45
|
-
Run the app's typecheck, lint, and build scripts. Inspect its findings and
|
|
46
|
-
interactions at phone and desktop widths, including loading, empty, error, and
|
|
47
|
-
stale states. Verify that the exploration answers the user's question.
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
A runnable port of the CLI starter lives in
|
|
51
|
-
[`examples/starter`](https://github.com/altertable-ai/data-app/tree/main/examples/starter). It consumes the built public
|
|
52
|
-
package and keeps its own app instructions. Updating CLI scaffolding to consume
|
|
53
|
-
the published package remains a separate migration.
|