@ant-design/agentic-ui 2.30.2 → 2.30.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/Hooks/useLanguage.d.ts +3 -0
  2. package/dist/I18n/locales.d.ts +3 -0
  3. package/dist/I18n/locales.js +6 -0
  4. package/dist/MarkdownRenderer/useMarkdownToReact.js +3 -1
  5. package/dist/Plugins/chart/AreaChart/index.js +4 -3
  6. package/dist/Plugins/chart/BarChart/index.js +3 -3
  7. package/dist/Plugins/chart/BoxPlotChart/index.d.ts +65 -0
  8. package/dist/Plugins/chart/BoxPlotChart/index.js +665 -0
  9. package/dist/Plugins/chart/BoxPlotChart/style.d.ts +8 -0
  10. package/dist/Plugins/chart/BoxPlotChart/style.js +118 -0
  11. package/dist/Plugins/chart/ChartAttrToolBar/index.js +5 -16
  12. package/dist/Plugins/chart/ChartMark/Area.d.ts +2 -1
  13. package/dist/Plugins/chart/ChartMark/Area.js +5 -4
  14. package/dist/Plugins/chart/ChartMark/Bar.d.ts +2 -1
  15. package/dist/Plugins/chart/ChartMark/Bar.js +5 -4
  16. package/dist/Plugins/chart/ChartMark/Column.d.ts +2 -1
  17. package/dist/Plugins/chart/ChartMark/Column.js +5 -4
  18. package/dist/Plugins/chart/ChartMark/Line.d.ts +2 -1
  19. package/dist/Plugins/chart/ChartMark/Line.js +5 -4
  20. package/dist/Plugins/chart/ChartMark/Pie.d.ts +2 -1
  21. package/dist/Plugins/chart/ChartMark/Pie.js +5 -4
  22. package/dist/Plugins/chart/ChartRender.d.ts +1 -1
  23. package/dist/Plugins/chart/ChartRender.js +188 -12
  24. package/dist/Plugins/chart/DonutChart/Legend.d.ts +5 -3
  25. package/dist/Plugins/chart/DonutChart/Legend.js +30 -38
  26. package/dist/Plugins/chart/DonutChart/index.js +82 -23
  27. package/dist/Plugins/chart/DonutChart/plugins.d.ts +2 -2
  28. package/dist/Plugins/chart/DonutChart/plugins.js +5 -5
  29. package/dist/Plugins/chart/DonutChart/types.d.ts +2 -0
  30. package/dist/Plugins/chart/FunnelChart/index.js +24 -14
  31. package/dist/Plugins/chart/HistogramChart/index.d.ts +65 -0
  32. package/dist/Plugins/chart/HistogramChart/index.js +665 -0
  33. package/dist/Plugins/chart/HistogramChart/style.d.ts +8 -0
  34. package/dist/Plugins/chart/HistogramChart/style.js +118 -0
  35. package/dist/Plugins/chart/LineChart/index.js +4 -3
  36. package/dist/Plugins/chart/RadarChart/index.d.ts +2 -0
  37. package/dist/Plugins/chart/RadarChart/index.js +28 -26
  38. package/dist/Plugins/chart/ScatterChart/index.d.ts +2 -0
  39. package/dist/Plugins/chart/ScatterChart/index.js +43 -28
  40. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.d.ts +1 -0
  41. package/dist/Plugins/chart/components/ChartContainer/ChartContainer.js +14 -0
  42. package/dist/Plugins/chart/components/ChartContainer/ChartDarkAntdContext.d.ts +7 -0
  43. package/dist/Plugins/chart/components/ChartContainer/ChartDarkAntdContext.js +8 -0
  44. package/dist/Plugins/chart/components/ChartContainer/ChartErrorBoundary.d.ts +8 -2
  45. package/dist/Plugins/chart/components/ChartContainer/style.js +3 -3
  46. package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.d.ts +2 -0
  47. package/dist/Plugins/chart/components/ChartToolBar/ChartToolBar.js +23 -32
  48. package/dist/Plugins/chart/index.d.ts +4 -0
  49. package/dist/Plugins/chart/index.js +2 -0
  50. package/dist/Plugins/chart/loadChartRuntime.d.ts +4 -0
  51. package/dist/Plugins/chart/loadChartRuntime.js +5 -1
  52. package/package.json +3 -1
@@ -71,6 +71,8 @@ export declare function useLanguage(): {
71
71
  radarChart: string;
72
72
  scatterChart: string;
73
73
  funnelChart: string;
74
+ boxplotChart: string;
75
+ histogramChart: string;
74
76
  configChart: string;
75
77
  updateChart: string;
76
78
  barChart: string;
@@ -168,6 +170,7 @@ export declare function useLanguage(): {
168
170
  runCode: string;
169
171
  rerender: string;
170
172
  download: string;
173
+ copyMarkdown: string;
171
174
  dragToMove: string;
172
175
  format: string;
173
176
  removeLink: string;
@@ -33,6 +33,8 @@ export declare const cnLabels: {
33
33
  radarChart: string;
34
34
  scatterChart: string;
35
35
  funnelChart: string;
36
+ boxplotChart: string;
37
+ histogramChart: string;
36
38
  configChart: string;
37
39
  updateChart: string;
38
40
  barChart: string;
@@ -130,6 +132,7 @@ export declare const cnLabels: {
130
132
  runCode: string;
131
133
  rerender: string;
132
134
  download: string;
135
+ copyMarkdown: string;
133
136
  dragToMove: string;
134
137
  format: string;
135
138
  removeLink: string;
@@ -32,6 +32,8 @@
32
32
  radarChart: '雷达图',
33
33
  scatterChart: '散点图',
34
34
  funnelChart: '漏斗图',
35
+ boxplotChart: '箱线图',
36
+ histogramChart: '直方图',
35
37
  configChart: '配置图表',
36
38
  updateChart: '更新',
37
39
  barChart: '条形图',
@@ -130,6 +132,7 @@
130
132
  runCode: '运行代码',
131
133
  rerender: '重新渲染',
132
134
  download: '下载',
135
+ copyMarkdown: '复制表格',
133
136
  dragToMove: '拖拽移动',
134
137
  format: '格式化',
135
138
  removeLink: '移除链接',
@@ -490,6 +493,8 @@
490
493
  radarChart: 'Radar Chart',
491
494
  scatterChart: 'Scatter Chart',
492
495
  funnelChart: 'Funnel Chart',
496
+ boxplotChart: 'Box Plot',
497
+ histogramChart: 'Histogram',
493
498
  barChart: 'Bar Chart',
494
499
  lineChart: 'Line Chart',
495
500
  columnChart: 'Column Chart',
@@ -552,6 +557,7 @@
552
557
  runCode: 'Run Code',
553
558
  rerender: 'Rerender',
554
559
  download: 'Download',
560
+ copyMarkdown: 'Copy Table',
555
561
  dragToMove: 'Drag to Move',
556
562
  format: 'Format',
557
563
  removeLink: 'Remove Link',
@@ -1184,7 +1184,9 @@ export var useMarkdownToReact = function useMarkdownToReact(content, options) {
1184
1184
  var isLast = i === blocks.length - 1;
1185
1185
  // 用 index + 内容前 64 字符作 key,保持稳定性:
1186
1186
  // 相同位置 + 相同内容开头 → 相同 key → React 不 unmount
1187
- var stableKey = "b".concat(i, "-").concat(block.slice(0, 64));
1187
+ // 流式场景下,最后一个块内容频繁变化,若 key 随内容变会导致反复 unmount/remount,
1188
+ // ChartBlockRenderer 等会重复展示 Loading,故对末块使用稳定 key
1189
+ var stableKey = isLast && (options === null || options === void 0 ? void 0 : options.streaming) ? "b".concat(i, "-last") : "b".concat(i, "-").concat(block.slice(0, 64));
1188
1190
  if (!isLast) {
1189
1191
  var cached = cache.get(block);
1190
1192
  if (cached && cached.source === block) {
@@ -194,8 +194,8 @@ import { useStyle } from "./style";
194
194
  return gradient;
195
195
  },
196
196
  pointBackgroundColor: resolvedColor,
197
- pointBorderColor: '#fff',
198
- pointBorderWidth: 1,
197
+ pointBorderColor: isLight ? '#fff' : resolvedColor,
198
+ pointBorderWidth: isLight ? 1 : 0,
199
199
  borderWidth: 3,
200
200
  tension: 0,
201
201
  fill: true
@@ -209,7 +209,8 @@ import { useStyle } from "./style";
209
209
  filteredData,
210
210
  types,
211
211
  xValues,
212
- color
212
+ color,
213
+ isLight
213
214
  ]);
214
215
  var options = {
215
216
  responsive: true,
@@ -121,6 +121,7 @@ import { Bar } from "react-chartjs-2";
121
121
  import { ChartContainer, ChartFilter, ChartStatistic, ChartToolBar, downloadChart } from "../components";
122
122
  import { defaultColorList } from "../const";
123
123
  import { extractAndSortXValues, findDataPointByXValue, hexToRgba, resolveCssVariable, toNumber } from "../utils";
124
+ import { useChartTheme } from "../hooks";
124
125
  import { useStyle } from "./style";
125
126
  /**
126
127
  * @fileoverview 柱状图组件文件
@@ -511,9 +512,8 @@ var BarChart = function BarChart(param) {
511
512
  }, [
512
513
  filterLabels
513
514
  ]);
514
- var isLight = theme === 'light';
515
- var axisTextColor = isLight ? 'rgba(0, 25, 61, 0.3255)' : 'rgba(255, 255, 255, 0.8)';
516
- var gridColor = isLight ? 'rgba(0,0,0,0.08)' : 'rgba(255,255,255,0.2)';
515
+ // 使用 useChartTheme hook 获取主题相关颜色
516
+ var _useChartTheme = useChartTheme(theme), axisTextColor = _useChartTheme.axisTextColor, gridColor = _useChartTheme.gridColor, isLight = _useChartTheme.isLight;
517
517
  // 标签宽度计算函数
518
518
  var calculateLabelWidth = function calculateLabelWidth(text) {
519
519
  var fontSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 11;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { ChartContainerProps } from '../components';
3
+ import { StatisticConfigType } from '../hooks/useChartStatistic';
4
+ import type { ChartClassNames, ChartStyles } from '../types/classNames';
5
+ /**
6
+ * 箱线图数据项接口
7
+ *
8
+ * 传入原始数据数组,组件自动计算统计值
9
+ */
10
+ export interface BoxPlotChartDataItem {
11
+ /** X轴标签 */
12
+ label: string;
13
+ /** 原始数据值数组 */
14
+ values: number[];
15
+ /** 数据系列(用于分组显示) */
16
+ type?: string;
17
+ /** 分类(用于筛选) */
18
+ category?: string;
19
+ /** 筛选标签 */
20
+ filterLabel?: string;
21
+ }
22
+ export interface BoxPlotChartProps extends ChartContainerProps {
23
+ /** 扁平化数据数组 */
24
+ data: BoxPlotChartDataItem[];
25
+ /** 图表标题 */
26
+ title?: string;
27
+ /** 图表宽度,默认600px */
28
+ width?: number | string;
29
+ /** 图表高度,默认400px */
30
+ height?: number | string;
31
+ /** 自定义CSS类名 */
32
+ className?: string;
33
+ /** 自定义CSS类名(支持对象格式,为每层DOM设置类名) */
34
+ classNames?: ChartClassNames;
35
+ /** 数据时间 */
36
+ dataTime?: string;
37
+ /** 图表主题 */
38
+ theme?: 'dark' | 'light';
39
+ /** 自定义主色 */
40
+ color?: string | string[];
41
+ /** 是否显示图例,默认true */
42
+ showLegend?: boolean;
43
+ /** 图例位置 */
44
+ legendPosition?: 'top' | 'left' | 'bottom' | 'right';
45
+ /** 是否显示网格线,默认true */
46
+ showGrid?: boolean;
47
+ /** X轴标签 */
48
+ xAxisLabel?: string;
49
+ /** Y轴标签 */
50
+ yAxisLabel?: string;
51
+ /** 是否显示异常点 */
52
+ showOutliers?: boolean;
53
+ /** 头部工具条额外按钮 */
54
+ toolbarExtra?: React.ReactNode;
55
+ /** 是否将过滤器渲染到工具栏 */
56
+ renderFilterInToolbar?: boolean;
57
+ /** ChartStatistic组件配置 */
58
+ statistic?: StatisticConfigType;
59
+ /** 是否显示加载状态 */
60
+ loading?: boolean;
61
+ /** 自定义样式对象 */
62
+ styles?: ChartStyles;
63
+ }
64
+ declare const BoxPlotChart: React.FC<BoxPlotChartProps>;
65
+ export default BoxPlotChart;