@carto/ps-react-ui 4.11.3 → 4.12.1
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/dist/chat.js +962 -733
- package/dist/chat.js.map +1 -1
- package/dist/csv-item-hH_Gt7ur.js +32 -0
- package/dist/csv-item-hH_Gt7ur.js.map +1 -0
- package/dist/{echart-BMPpj7n_.js → echart-Bdvbfx9s.js} +2 -2
- package/dist/echart-Bdvbfx9s.js.map +1 -0
- package/dist/{option-builders-F-c9ELi1.js → option-builders-DPeoyQaM.js} +41 -33
- package/dist/option-builders-DPeoyQaM.js.map +1 -0
- package/dist/png-item-9dNbB37T.js +57 -0
- package/dist/png-item-9dNbB37T.js.map +1 -0
- package/dist/table-B3ZWWhJt.js +383 -0
- package/dist/table-B3ZWWhJt.js.map +1 -0
- package/dist/types/chat/containers/chat-footer.d.ts +1 -1
- package/dist/types/chat/containers/styles.d.ts +79 -12
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/chat/types.d.ts +21 -0
- package/dist/types/chat/use-typewriter.d.ts +5 -3
- package/dist/types/widgets/utils/chart-config/index.d.ts +1 -1
- package/dist/types/widgets-v2/actions/download/constants.d.ts +12 -0
- package/dist/types/widgets-v2/actions/download/csv-item.d.ts +38 -0
- package/dist/types/widgets-v2/actions/download/icons.d.ts +6 -0
- package/dist/types/widgets-v2/actions/download/index.d.ts +3 -1
- package/dist/types/widgets-v2/actions/index.d.ts +1 -1
- package/dist/types/widgets-v2/pie/skeleton.d.ts +9 -0
- package/dist/widgets/bar.js +1 -1
- package/dist/widgets/histogram.js +1 -1
- package/dist/widgets/pie.js +1 -1
- package/dist/widgets/scatterplot.js +5 -5
- package/dist/widgets/timeseries.js +1 -1
- package/dist/widgets/utils.js +1 -1
- package/dist/widgets-v2/actions.js +40 -36
- package/dist/widgets-v2/actions.js.map +1 -1
- package/dist/widgets-v2/bar.js +69 -76
- package/dist/widgets-v2/bar.js.map +1 -1
- package/dist/widgets-v2/category.js +50 -55
- package/dist/widgets-v2/category.js.map +1 -1
- package/dist/widgets-v2/echart.js +1 -1
- package/dist/widgets-v2/formula.js +37 -43
- package/dist/widgets-v2/formula.js.map +1 -1
- package/dist/widgets-v2/histogram.js +141 -147
- package/dist/widgets-v2/histogram.js.map +1 -1
- package/dist/widgets-v2/markdown.js +18 -17
- package/dist/widgets-v2/markdown.js.map +1 -1
- package/dist/widgets-v2/pie.js +174 -126
- package/dist/widgets-v2/pie.js.map +1 -1
- package/dist/widgets-v2/scatterplot.js +156 -166
- package/dist/widgets-v2/scatterplot.js.map +1 -1
- package/dist/widgets-v2/spread.js +36 -41
- package/dist/widgets-v2/spread.js.map +1 -1
- package/dist/widgets-v2/table.js +46 -55
- package/dist/widgets-v2/table.js.map +1 -1
- package/dist/widgets-v2/timeseries.js +83 -89
- package/dist/widgets-v2/timeseries.js.map +1 -1
- package/dist/widgets-v2.js +3 -3
- package/package.json +1 -1
- package/src/chat/bubbles/styles.ts +5 -1
- package/src/chat/containers/chat-content.tsx +4 -1
- package/src/chat/containers/chat-footer.test.tsx +59 -0
- package/src/chat/containers/chat-footer.tsx +124 -36
- package/src/chat/containers/styles.ts +107 -16
- package/src/chat/feedback/styles.ts +11 -4
- package/src/chat/index.ts +1 -0
- package/src/chat/types.ts +22 -0
- package/src/chat/use-typewriter.ts +32 -24
- package/src/widgets/utils/chart-config/index.ts +1 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +34 -0
- package/src/widgets/utils/chart-config/option-builders.ts +21 -0
- package/src/widgets-v2/actions/download/constants.ts +14 -0
- package/src/widgets-v2/actions/download/csv-item.test.tsx +77 -0
- package/src/widgets-v2/actions/download/csv-item.tsx +71 -0
- package/src/widgets-v2/actions/download/icons.tsx +10 -1
- package/src/widgets-v2/actions/download/index.ts +3 -1
- package/src/widgets-v2/actions/download/png-item.tsx +2 -1
- package/src/widgets-v2/actions/index.ts +5 -0
- package/src/widgets-v2/bar/download.tsx +16 -22
- package/src/widgets-v2/bar/options.ts +3 -2
- package/src/widgets-v2/category/download.test.ts +9 -0
- package/src/widgets-v2/category/download.ts +16 -20
- package/src/widgets-v2/echart/edge-label-clamp.ts +7 -4
- package/src/widgets-v2/formula/download.tsx +23 -29
- package/src/widgets-v2/histogram/download.ts +22 -26
- package/src/widgets-v2/histogram/options.ts +3 -2
- package/src/widgets-v2/markdown/{download.ts → download.tsx} +5 -2
- package/src/widgets-v2/pie/download.ts +16 -20
- package/src/widgets-v2/pie/skeleton.test.tsx +6 -3
- package/src/widgets-v2/pie/skeleton.tsx +69 -7
- package/src/widgets-v2/scatterplot/download.ts +16 -20
- package/src/widgets-v2/scatterplot/options.ts +3 -6
- package/src/widgets-v2/spread/download.ts +23 -27
- package/src/widgets-v2/table/download.test.ts +10 -0
- package/src/widgets-v2/table/download.ts +11 -15
- package/src/widgets-v2/table/helpers.test.ts +19 -0
- package/src/widgets-v2/table/helpers.ts +7 -12
- package/src/widgets-v2/timeseries/download.ts +36 -40
- package/src/widgets-v2/timeseries/options.ts +3 -2
- package/dist/echart-BMPpj7n_.js.map +0 -1
- package/dist/option-builders-F-c9ELi1.js.map +0 -1
- package/dist/png-item-BE9uEqlD.js +0 -45
- package/dist/png-item-BE9uEqlD.js.map +0 -1
- package/dist/table-C9IMbTr0.js +0 -385
- package/dist/table-C9IMbTr0.js.map +0 -1
- package/dist/types/chat/feedback/styles.d.ts +0 -211
- package/dist/types/widgets/utils/chart-config/option-builders.d.ts +0 -124
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
|
-
export declare const styles: {
|
|
3
|
-
thinking: {
|
|
4
|
-
display: "flex";
|
|
5
|
-
alignItems: "center";
|
|
6
|
-
minHeight: ({ spacing }: Theme) => string;
|
|
7
|
-
background: ({ palette }: Theme) => string;
|
|
8
|
-
backgroundSize: string;
|
|
9
|
-
backgroundClip: "text";
|
|
10
|
-
WebkitBackgroundClip: "text";
|
|
11
|
-
WebkitTextFillColor: "transparent";
|
|
12
|
-
animation: `${{
|
|
13
|
-
name: string;
|
|
14
|
-
styles: string;
|
|
15
|
-
anim: 1;
|
|
16
|
-
toString: () => string;
|
|
17
|
-
} & string} 2s ease-in-out infinite`;
|
|
18
|
-
animationDuration: "2s";
|
|
19
|
-
};
|
|
20
|
-
loader: {
|
|
21
|
-
display: "flex";
|
|
22
|
-
alignItems: "center";
|
|
23
|
-
justifyContent: "center";
|
|
24
|
-
position: "relative";
|
|
25
|
-
p: number;
|
|
26
|
-
};
|
|
27
|
-
loaderOuterCircle: {
|
|
28
|
-
position: "absolute";
|
|
29
|
-
inset: number;
|
|
30
|
-
margin: string;
|
|
31
|
-
borderRadius: string;
|
|
32
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
33
|
-
animation: `${{
|
|
34
|
-
name: string;
|
|
35
|
-
styles: string;
|
|
36
|
-
anim: 1;
|
|
37
|
-
toString: () => string;
|
|
38
|
-
} & string} 1s ease-in-out infinite`;
|
|
39
|
-
};
|
|
40
|
-
loaderInnerCircle: {
|
|
41
|
-
position: "absolute";
|
|
42
|
-
inset: number;
|
|
43
|
-
margin: string;
|
|
44
|
-
borderRadius: string;
|
|
45
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
46
|
-
animation: `${{
|
|
47
|
-
name: string;
|
|
48
|
-
styles: string;
|
|
49
|
-
anim: 1;
|
|
50
|
-
toString: () => string;
|
|
51
|
-
} & string} 1s ease-in-out infinite`;
|
|
52
|
-
};
|
|
53
|
-
traceHeader: {
|
|
54
|
-
display: "flex";
|
|
55
|
-
alignItems: "center";
|
|
56
|
-
padding: number;
|
|
57
|
-
paddingLeft: ({ spacing }: Theme) => string;
|
|
58
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
59
|
-
width: string;
|
|
60
|
-
color: ({ palette }: Theme) => string;
|
|
61
|
-
'&:hover': {
|
|
62
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
traceChevron: {
|
|
66
|
-
color: ({ palette }: Theme) => string;
|
|
67
|
-
transition: "transform 0.2s";
|
|
68
|
-
};
|
|
69
|
-
traceDetailsWrapper: {
|
|
70
|
-
marginTop: ({ spacing }: Theme) => string;
|
|
71
|
-
padding: ({ spacing }: Theme) => string;
|
|
72
|
-
border: "1px solid";
|
|
73
|
-
borderColor: "divider";
|
|
74
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
75
|
-
};
|
|
76
|
-
traceField: {
|
|
77
|
-
display: "flex";
|
|
78
|
-
alignItems: "flex-start";
|
|
79
|
-
gap: ({ spacing }: Theme) => string;
|
|
80
|
-
};
|
|
81
|
-
traceFieldLabel: {
|
|
82
|
-
flexShrink: number;
|
|
83
|
-
};
|
|
84
|
-
traceReference: {
|
|
85
|
-
display: "flex";
|
|
86
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
87
|
-
padding: ({ spacing }: Theme) => string;
|
|
88
|
-
gap: ({ spacing }: Theme) => string;
|
|
89
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
90
|
-
color: ({ palette }: Theme) => string;
|
|
91
|
-
};
|
|
92
|
-
traceStatusSuccess: {
|
|
93
|
-
color: ({ palette }: Theme) => string;
|
|
94
|
-
};
|
|
95
|
-
traceStatusError: {
|
|
96
|
-
color: ({ palette }: Theme) => string;
|
|
97
|
-
};
|
|
98
|
-
codeArea: {
|
|
99
|
-
position: "relative";
|
|
100
|
-
width: string;
|
|
101
|
-
};
|
|
102
|
-
codeAreaPre: {
|
|
103
|
-
margin: number;
|
|
104
|
-
padding: ({ spacing }: Theme) => string;
|
|
105
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
106
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
107
|
-
fontSize: string;
|
|
108
|
-
fontFamily: "monospace";
|
|
109
|
-
whiteSpace: "pre-wrap";
|
|
110
|
-
wordBreak: "break-word";
|
|
111
|
-
overflowY: "auto";
|
|
112
|
-
};
|
|
113
|
-
codeAreaPreError: {
|
|
114
|
-
borderLeft: ({ palette }: Theme) => string;
|
|
115
|
-
backgroundColor: ({ palette }: Theme) => string;
|
|
116
|
-
};
|
|
117
|
-
codeAreaFullViewButton: {
|
|
118
|
-
position: "absolute";
|
|
119
|
-
top: ({ spacing }: Theme) => string;
|
|
120
|
-
right: ({ spacing }: Theme) => string;
|
|
121
|
-
};
|
|
122
|
-
fullViewDialog: {
|
|
123
|
-
margin: ({ spacing }: Theme) => string;
|
|
124
|
-
};
|
|
125
|
-
fullViewPaper: {
|
|
126
|
-
borderRadius: number;
|
|
127
|
-
};
|
|
128
|
-
fullViewTitle: {
|
|
129
|
-
display: "flex";
|
|
130
|
-
alignItems: "center";
|
|
131
|
-
justifyContent: "space-between";
|
|
132
|
-
padding: ({ spacing }: Theme) => string;
|
|
133
|
-
borderBottom: string;
|
|
134
|
-
borderBottomColor: "divider";
|
|
135
|
-
};
|
|
136
|
-
fullViewDialogContent: {
|
|
137
|
-
padding: number;
|
|
138
|
-
'&:first-of-type': {
|
|
139
|
-
paddingTop: number;
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
fullViewPre: {
|
|
143
|
-
margin: number;
|
|
144
|
-
padding: ({ spacing }: Theme) => string;
|
|
145
|
-
background: ({ palette, spacing }: Theme) => string;
|
|
146
|
-
fontFamily: "monospace";
|
|
147
|
-
fontSize: string;
|
|
148
|
-
whiteSpace: "pre-wrap";
|
|
149
|
-
wordBreak: "break-word";
|
|
150
|
-
lineHeight: number;
|
|
151
|
-
counterReset: "line";
|
|
152
|
-
};
|
|
153
|
-
fullViewLine: {
|
|
154
|
-
display: "block";
|
|
155
|
-
'&::before': {
|
|
156
|
-
counterIncrement: "line";
|
|
157
|
-
content: "counter(line)";
|
|
158
|
-
display: "inline-block";
|
|
159
|
-
width: string;
|
|
160
|
-
marginRight: string;
|
|
161
|
-
textAlign: "right";
|
|
162
|
-
color: ({ palette }: Theme) => string;
|
|
163
|
-
userSelect: "none";
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
groupHeader: {
|
|
167
|
-
textAlign: "left";
|
|
168
|
-
display: "flex";
|
|
169
|
-
alignItems: "center";
|
|
170
|
-
borderRadius: number;
|
|
171
|
-
gap: ({ spacing }: Theme) => string;
|
|
172
|
-
};
|
|
173
|
-
errorBadge: {
|
|
174
|
-
color: ({ palette }: Theme) => string;
|
|
175
|
-
fontWeight: number;
|
|
176
|
-
display: "flex";
|
|
177
|
-
alignItems: "center";
|
|
178
|
-
gap: ({ spacing }: Theme) => string;
|
|
179
|
-
};
|
|
180
|
-
syntaxToken_key: {
|
|
181
|
-
color: "#881280";
|
|
182
|
-
};
|
|
183
|
-
syntaxToken_string: {
|
|
184
|
-
color: "#c41a16";
|
|
185
|
-
};
|
|
186
|
-
syntaxToken_number: {
|
|
187
|
-
color: "#1c00cf";
|
|
188
|
-
};
|
|
189
|
-
syntaxToken_boolean: {
|
|
190
|
-
color: "#1c00cf";
|
|
191
|
-
};
|
|
192
|
-
syntaxToken_null: {
|
|
193
|
-
color: "#808080";
|
|
194
|
-
};
|
|
195
|
-
syntaxToken_punctuation: {
|
|
196
|
-
color: ({ palette }: Theme) => string;
|
|
197
|
-
};
|
|
198
|
-
groupListItem: {
|
|
199
|
-
borderBottom: string;
|
|
200
|
-
borderColor: "divider";
|
|
201
|
-
'&:first-of-type .MuiButton-root': {
|
|
202
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
203
|
-
};
|
|
204
|
-
'&:last-of-type:not([aria-expanded=true]) .MuiButton-root': {
|
|
205
|
-
borderRadius: ({ spacing }: Theme) => string;
|
|
206
|
-
};
|
|
207
|
-
'&:last-of-type': {
|
|
208
|
-
borderBottomWidth: number;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Theme } from '@mui/material';
|
|
2
|
-
import { LegendComponentOption } from 'echarts';
|
|
3
|
-
import { CallbackDataParams, TopLevelFormatterParams } from 'echarts/types/dist/shared';
|
|
4
|
-
/**
|
|
5
|
-
* Shared EChart configuration builders for chart widgets
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Rounds a value up to the nearest "nice" number.
|
|
9
|
-
* A nice number is a multiple of 10^floor(log10(value)).
|
|
10
|
-
*
|
|
11
|
-
* Examples: 547 → 600, 200 → 200, 1200 → 2000, 18 → 20, 5 → 5, -547 → -500
|
|
12
|
-
*/
|
|
13
|
-
export declare function niceNum(value: number): number;
|
|
14
|
-
/**
|
|
15
|
-
* Builds standard legend configuration for chart widgets
|
|
16
|
-
*
|
|
17
|
-
* @param params - Legend configuration parameters
|
|
18
|
-
* @param params.hasLegend - Whether to show the legend
|
|
19
|
-
* @param params.labelFormatter - Optional formatter for legend item names
|
|
20
|
-
* @returns Legend configuration object
|
|
21
|
-
*/
|
|
22
|
-
export declare function buildLegendConfig({ hasLegend, labelFormatter, }: {
|
|
23
|
-
hasLegend: boolean;
|
|
24
|
-
labelFormatter?: (value: string | number) => string | number;
|
|
25
|
-
}): LegendComponentOption;
|
|
26
|
-
/**
|
|
27
|
-
* Builds standard grid configuration with legend-aware spacing
|
|
28
|
-
*
|
|
29
|
-
* @param hasLegend - Whether the chart has a legend
|
|
30
|
-
* @param theme - MUI theme for spacing
|
|
31
|
-
* @param additionalConfig - Additional grid configuration to merge
|
|
32
|
-
* @returns Grid configuration object
|
|
33
|
-
*/
|
|
34
|
-
export declare function buildGridConfig(hasLegend: boolean, theme: Theme): {
|
|
35
|
-
bottom?: number | undefined;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Creates a tooltip position calculator that handles overflow
|
|
39
|
-
* Used by bar, histogram, and scatterplot widgets
|
|
40
|
-
*
|
|
41
|
-
* @param theme - MUI theme for spacing
|
|
42
|
-
* @returns Tooltip position function
|
|
43
|
-
*/
|
|
44
|
-
export declare function createTooltipPositioner(theme: Theme): (point: [number, number], _params: unknown, _dom: unknown, _rect: unknown, size: {
|
|
45
|
-
contentSize: [number, number];
|
|
46
|
-
viewSize: [number, number];
|
|
47
|
-
}) => Record<string, number>;
|
|
48
|
-
/**
|
|
49
|
-
* Creates an axis label formatter for ECharts
|
|
50
|
-
* Used to format numeric axis labels with a widget formatter
|
|
51
|
-
*
|
|
52
|
-
* @param formatter - Optional formatter function from widget config
|
|
53
|
-
* @returns Axis label formatter function or undefined
|
|
54
|
-
*/
|
|
55
|
-
export declare function createAxisLabelFormatter(formatter?: (value: number) => string): ((value: number) => string) | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Applies labelFormatter to xAxis configuration
|
|
58
|
-
* Applies to any xAxis regardless of axis type (category, value, etc.)
|
|
59
|
-
*
|
|
60
|
-
* @param xAxis - Existing xAxis configuration
|
|
61
|
-
* @param labelFormatter - Optional labelFormatter function from widget config
|
|
62
|
-
* @returns Updated xAxis configuration
|
|
63
|
-
*/
|
|
64
|
-
export declare function applyXAxisFormatter(xAxis: unknown, formatter?: (value: string | number) => string | number): {
|
|
65
|
-
axisLabel: {
|
|
66
|
-
formatter: ((value: string | number) => string) | undefined;
|
|
67
|
-
};
|
|
68
|
-
type?: string;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Applies formatter to yAxis configuration
|
|
72
|
-
* Only applies to single axis objects (not arrays) with type 'value'
|
|
73
|
-
*
|
|
74
|
-
* @param yAxis - Existing yAxis configuration
|
|
75
|
-
* @param formatter - Optional formatter function from widget config
|
|
76
|
-
* @returns Updated yAxis configuration or undefined if no changes needed
|
|
77
|
-
*/
|
|
78
|
-
export declare function applyYAxisFormatter(yAxis: unknown, formatter?: (value: number) => string): {
|
|
79
|
-
axisLabel: {
|
|
80
|
-
formatter: ((value: number) => string) | undefined;
|
|
81
|
-
};
|
|
82
|
-
type?: string;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Creates a tooltip formatter for ECharts
|
|
86
|
-
* Formats numeric values in tooltip using widget formatter
|
|
87
|
-
* Handles both axis trigger (array) and item trigger (object) modes
|
|
88
|
-
*
|
|
89
|
-
* @param formatter - Optional formatter function from widget config
|
|
90
|
-
* @returns Tooltip formatter function or undefined
|
|
91
|
-
*/
|
|
92
|
-
export declare function createTooltipFormatter(callback: (item: CallbackDataParams, items: CallbackDataParams[]) => {
|
|
93
|
-
name: string;
|
|
94
|
-
seriesName: string;
|
|
95
|
-
marker: string;
|
|
96
|
-
value: string | number;
|
|
97
|
-
}): (params: TopLevelFormatterParams) => string;
|
|
98
|
-
/**
|
|
99
|
-
* Builds a series `label` config that applies formatter to the data value
|
|
100
|
-
* extracted from a dataset row using ECharts encode/dimensionNames.
|
|
101
|
-
*
|
|
102
|
-
* Does not set `show` — labels remain hidden by default per ECharts defaults.
|
|
103
|
-
*
|
|
104
|
-
* @param formatter - Optional numeric value formatter
|
|
105
|
-
* @param encodeKey - The encode dimension key to extract ('y' for vertical charts, 'x' for horizontal)
|
|
106
|
-
*/
|
|
107
|
-
export declare function buildSeriesLabelConfig(formatter?: (value: number) => string, encodeKey?: string): {
|
|
108
|
-
label: {
|
|
109
|
-
formatter: (params: CallbackDataParams) => string;
|
|
110
|
-
};
|
|
111
|
-
} | object;
|
|
112
|
-
/**
|
|
113
|
-
* Builds a series `label` config that applies formatter to a raw numeric value.
|
|
114
|
-
* Used by histogram where series data is number[] (not datasets).
|
|
115
|
-
*
|
|
116
|
-
* Does not set `show` — labels remain hidden by default per ECharts defaults.
|
|
117
|
-
*
|
|
118
|
-
* @param formatter - Optional numeric value formatter
|
|
119
|
-
*/
|
|
120
|
-
export declare function buildHistogramSeriesLabelConfig(formatter?: (value: number) => string): {
|
|
121
|
-
label: {
|
|
122
|
-
formatter: (params: CallbackDataParams) => string;
|
|
123
|
-
};
|
|
124
|
-
} | object;
|