@next-bricks/ai-portal 0.12.2 → 0.12.4

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 (33) hide show
  1. package/dist/bricks.json +9 -5
  2. package/dist/chunks/1607.f5537929.js +2 -0
  3. package/dist/chunks/1607.f5537929.js.map +1 -0
  4. package/dist/chunks/8136.c756ba85.js +2 -0
  5. package/dist/chunks/8136.c756ba85.js.map +1 -0
  6. package/dist/chunks/cruise-canvas.4af272b8.js +2 -0
  7. package/dist/chunks/{cruise-canvas.c87f0250.js.map → cruise-canvas.4af272b8.js.map} +1 -1
  8. package/dist/chunks/main.c7bb363c.js +2 -0
  9. package/dist/chunks/main.c7bb363c.js.map +1 -0
  10. package/dist/chunks/stat-with-mini-chart.0c8b5712.js +2 -0
  11. package/dist/chunks/stat-with-mini-chart.0c8b5712.js.map +1 -0
  12. package/dist/examples.json +6 -3
  13. package/dist/index.2dbc0ade.js +2 -0
  14. package/dist/index.2dbc0ade.js.map +1 -0
  15. package/dist/manifest.json +89 -38
  16. package/dist/types.json +150 -60
  17. package/dist-types/bootstrap.d.ts +1 -0
  18. package/dist-types/cruise-canvas/utils/converters/convertForm.d.ts +1 -1
  19. package/dist-types/cruise-canvas/utils/converters/expressions.d.ts +11 -0
  20. package/dist-types/cruise-canvas/utils/converters/interfaces.d.ts +1 -0
  21. package/dist-types/stat-with-mini-chart/index.d.ts +35 -0
  22. package/dist-types/stat-with-mini-chart/index.spec.d.ts +1 -0
  23. package/docs/stat-with-mini-chart.md +226 -0
  24. package/package.json +4 -3
  25. package/dist/chunks/2335.08b02fcc.js +0 -2
  26. package/dist/chunks/2335.08b02fcc.js.map +0 -1
  27. package/dist/chunks/7301.eb125ee2.js +0 -2
  28. package/dist/chunks/7301.eb125ee2.js.map +0 -1
  29. package/dist/chunks/cruise-canvas.c87f0250.js +0 -2
  30. package/dist/chunks/main.8ebb7977.js +0 -2
  31. package/dist/chunks/main.8ebb7977.js.map +0 -1
  32. package/dist/index.90639dd9.js +0 -2
  33. package/dist/index.90639dd9.js.map +0 -1
package/dist/types.json CHANGED
@@ -1,97 +1,98 @@
1
1
  {
2
- "ai-portal.home-container": {
3
- "properties": [],
4
- "events": [],
5
- "methods": []
6
- },
7
- "ai-portal.chat-box": {
2
+ "ai-portal.stat-with-mini-chart": {
8
3
  "properties": [
9
4
  {
10
- "name": "disabled",
5
+ "name": "label",
11
6
  "annotation": {
12
7
  "type": "keyword",
13
- "value": "boolean"
8
+ "value": "string"
14
9
  }
15
10
  },
16
11
  {
17
- "name": "placeholder",
12
+ "name": "value",
18
13
  "annotation": {
19
14
  "type": "keyword",
20
15
  "value": "string"
21
16
  }
22
17
  },
23
18
  {
24
- "name": "autoFocus",
19
+ "name": "size",
20
+ "annotation": {
21
+ "type": "union",
22
+ "types": [
23
+ {
24
+ "type": "jsLiteral",
25
+ "value": "medium"
26
+ },
27
+ {
28
+ "type": "jsLiteral",
29
+ "value": "small"
30
+ }
31
+ ]
32
+ }
33
+ },
34
+ {
35
+ "name": "lineColor",
25
36
  "annotation": {
26
37
  "type": "keyword",
27
- "value": "boolean"
38
+ "value": "string"
28
39
  }
29
40
  },
30
41
  {
31
- "name": "suggestions",
42
+ "name": "showArea",
32
43
  "annotation": {
33
- "type": "array",
34
- "elementType": {
35
- "type": "reference",
36
- "typeName": {
37
- "type": "identifier",
38
- "name": "Suggestion"
39
- }
40
- }
44
+ "type": "keyword",
45
+ "value": "boolean"
41
46
  }
42
47
  },
43
48
  {
44
- "name": "suggestionsLabel",
49
+ "name": "xField",
45
50
  "annotation": {
46
51
  "type": "keyword",
47
52
  "value": "string"
48
53
  }
49
- }
50
- ],
51
- "events": [
54
+ },
52
55
  {
53
- "name": "message.submit",
54
- "detail": {
55
- "annotation": {
56
- "type": "keyword",
57
- "value": "string"
58
- }
56
+ "name": "yField",
57
+ "annotation": {
58
+ "type": "keyword",
59
+ "value": "string"
59
60
  }
60
- }
61
- ],
62
- "methods": [],
63
- "types": [
61
+ },
64
62
  {
65
- "type": "interface",
66
- "name": "Suggestion",
67
- "body": [
68
- {
69
- "type": "propertySignature",
70
- "key": {
71
- "type": "identifier",
72
- "name": "title"
73
- },
74
- "annotation": {
75
- "type": "keyword",
76
- "value": "string"
77
- },
78
- "computed": false
79
- },
80
- {
81
- "type": "propertySignature",
82
- "key": {
63
+ "name": "data",
64
+ "annotation": {
65
+ "type": "array",
66
+ "elementType": {
67
+ "type": "reference",
68
+ "typeName": {
83
69
  "type": "identifier",
84
- "name": "content"
85
- },
86
- "annotation": {
87
- "type": "keyword",
88
- "value": "string"
70
+ "name": "Record"
89
71
  },
90
- "computed": false
72
+ "typeParameters": {
73
+ "type": "typeParameterInstantiation",
74
+ "params": [
75
+ {
76
+ "type": "keyword",
77
+ "value": "string"
78
+ },
79
+ {
80
+ "type": "keyword",
81
+ "value": "number"
82
+ }
83
+ ]
84
+ }
91
85
  }
92
- ]
86
+ }
93
87
  }
94
- ]
88
+ ],
89
+ "events": [],
90
+ "methods": []
91
+ },
92
+ "ai-portal.home-container": {
93
+ "properties": [],
94
+ "events": [],
95
+ "methods": []
95
96
  },
96
97
  "ai-portal.chat-history": {
97
98
  "properties": [
@@ -246,6 +247,95 @@
246
247
  }
247
248
  ]
248
249
  },
250
+ "ai-portal.chat-box": {
251
+ "properties": [
252
+ {
253
+ "name": "disabled",
254
+ "annotation": {
255
+ "type": "keyword",
256
+ "value": "boolean"
257
+ }
258
+ },
259
+ {
260
+ "name": "placeholder",
261
+ "annotation": {
262
+ "type": "keyword",
263
+ "value": "string"
264
+ }
265
+ },
266
+ {
267
+ "name": "autoFocus",
268
+ "annotation": {
269
+ "type": "keyword",
270
+ "value": "boolean"
271
+ }
272
+ },
273
+ {
274
+ "name": "suggestions",
275
+ "annotation": {
276
+ "type": "array",
277
+ "elementType": {
278
+ "type": "reference",
279
+ "typeName": {
280
+ "type": "identifier",
281
+ "name": "Suggestion"
282
+ }
283
+ }
284
+ }
285
+ },
286
+ {
287
+ "name": "suggestionsLabel",
288
+ "annotation": {
289
+ "type": "keyword",
290
+ "value": "string"
291
+ }
292
+ }
293
+ ],
294
+ "events": [
295
+ {
296
+ "name": "message.submit",
297
+ "detail": {
298
+ "annotation": {
299
+ "type": "keyword",
300
+ "value": "string"
301
+ }
302
+ }
303
+ }
304
+ ],
305
+ "methods": [],
306
+ "types": [
307
+ {
308
+ "type": "interface",
309
+ "name": "Suggestion",
310
+ "body": [
311
+ {
312
+ "type": "propertySignature",
313
+ "key": {
314
+ "type": "identifier",
315
+ "name": "title"
316
+ },
317
+ "annotation": {
318
+ "type": "keyword",
319
+ "value": "string"
320
+ },
321
+ "computed": false
322
+ },
323
+ {
324
+ "type": "propertySignature",
325
+ "key": {
326
+ "type": "identifier",
327
+ "name": "content"
328
+ },
329
+ "annotation": {
330
+ "type": "keyword",
331
+ "value": "string"
332
+ },
333
+ "computed": false
334
+ }
335
+ ]
336
+ }
337
+ ]
338
+ },
249
339
  "ai-portal.cruise-canvas": {
250
340
  "properties": [
251
341
  {
@@ -2,3 +2,4 @@ import "./cruise-canvas/index.js";
2
2
  import "./chat-box/index.js";
3
3
  import "./home-container/index.js";
4
4
  import "./chat-history/index.js";
5
+ import "./stat-with-mini-chart/index.js";
@@ -1,3 +1,3 @@
1
1
  import type { BrickConf } from "@next-core/types";
2
2
  import type { Component } from "./interfaces.js";
3
- export default function convertForm(_component: Component): BrickConf;
3
+ export default function convertForm(component: Component): BrickConf;
@@ -0,0 +1,11 @@
1
+ export declare function isExpression(value: string): boolean;
2
+ export declare function getMemberAccessor(property: unknown): string;
3
+ export declare function extractDataSource(data: string | object): {
4
+ isString: false;
5
+ embedded?: undefined;
6
+ expression?: undefined;
7
+ } | {
8
+ isString: true;
9
+ embedded: string;
10
+ expression: string;
11
+ };
@@ -16,6 +16,7 @@ export interface DataSource {
16
16
  version: string;
17
17
  };
18
18
  params?: Record<string, any>;
19
+ transform?: string;
19
20
  }
20
21
  export interface Variable {
21
22
  viewId: string;
@@ -0,0 +1,35 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import type { MiniLineChartProps } from "@next-bricks/mini-chart/mini-line-chart";
5
+ export interface StatWithMiniChartProps extends Pick<MiniLineChartProps, "data" | "xField" | "yField" | "lineColor" | "showArea"> {
6
+ label?: string;
7
+ value?: string;
8
+ size?: "medium" | "small";
9
+ }
10
+ /**
11
+ * 构件 `ai-portal.stat-with-mini-chart`
12
+ */
13
+ export declare class StatWithMiniChart extends ReactNextElement implements StatWithMiniChartProps {
14
+ accessor label: string | undefined;
15
+ accessor value: string | undefined;
16
+ /**
17
+ * @default "medium"
18
+ */
19
+ accessor size: "medium" | "small" | undefined;
20
+ /**
21
+ * @default "var(--color-brand)"
22
+ */
23
+ accessor lineColor: string | undefined;
24
+ accessor showArea: boolean | undefined;
25
+ /**
26
+ * @default "0"
27
+ */
28
+ accessor xField: string | undefined;
29
+ /**
30
+ * @default "1"
31
+ */
32
+ accessor yField: string | undefined;
33
+ accessor data: Record<string, number>[] | undefined;
34
+ render(): React.JSX.Element;
35
+ }
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,226 @@
1
+ 构件 `ai-portal.stat-with-mini-chart`
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: ai-portal.stat-with-mini-chart
9
+ properties:
10
+ label: 请求数
11
+ value: "563.5"
12
+ xField: time
13
+ yField: request_total
14
+ lineColor: "#295DFF"
15
+ data:
16
+ - request_total: 642.2
17
+ time: 1730597995.403
18
+ - request_total: 621.3
19
+ time: 1730599200
20
+ - request_total: 600.2
21
+ time: 1730601000
22
+ - request_total: 601.9666666666667
23
+ time: 1730602800
24
+ - request_total: 592.4
25
+ time: 1730604600
26
+ - request_total: 567.8666666666667
27
+ time: 1730606400
28
+ - request_total: 651.3333333333334
29
+ time: 1730608200
30
+ - request_total: 571.9677419354839
31
+ time: 1730610000
32
+ - request_total: 550.2
33
+ time: 1730611800
34
+ - request_total: 556.5666666666667
35
+ time: 1730613600
36
+ - request_total: 565.6333333333333
37
+ time: 1730615400
38
+ - request_total: 586.5666666666667
39
+ time: 1730617200
40
+ - request_total: 611.7
41
+ time: 1730619000
42
+ - request_total: 540.0645161290323
43
+ time: 1730620800
44
+ - request_total: 595.9333333333333
45
+ time: 1730622600
46
+ - request_total: 560.0333333333333
47
+ time: 1730624400
48
+ - request_total: 565.2333333333333
49
+ time: 1730626200
50
+ - request_total: 609.5806451612904
51
+ time: 1730628000
52
+ - request_total: 598.8
53
+ time: 1730629800
54
+ - request_total: 594.5333333333333
55
+ time: 1730631600
56
+ - request_total: 525.7
57
+ time: 1730633400
58
+ - request_total: 602.3666666666667
59
+ time: 1730635200
60
+ - request_total: 557.7333333333333
61
+ time: 1730637000
62
+ - request_total: 595.8666666666667
63
+ time: 1730638800
64
+ - request_total: 638.7
65
+ time: 1730640600
66
+ - request_total: 635.8333333333334
67
+ time: 1730642400
68
+ - request_total: 563.9
69
+ time: 1730644200
70
+ - request_total: 606.4516129032259
71
+ time: 1730646000
72
+ - request_total: 660.1
73
+ time: 1730647800
74
+ - request_total: 606.2666666666667
75
+ time: 1730649600
76
+ - request_total: 504.43333333333334
77
+ time: 1730651400
78
+ - request_total: 651.7333333333333
79
+ time: 1730653200
80
+ - request_total: 583.5
81
+ time: 1730655000
82
+ - request_total: 566.2333333333333
83
+ time: 1730656800
84
+ - request_total: 519.2333333333333
85
+ time: 1730658600
86
+ - request_total: 621.6333333333333
87
+ time: 1730660400
88
+ - request_total: 530.9333333333333
89
+ time: 1730662200
90
+ - request_total: 685.3
91
+ time: 1730664000
92
+ - request_total: 616.3333333333334
93
+ time: 1730665800
94
+ - request_total: 580.3333333333334
95
+ time: 1730667600
96
+ - request_total: 568.5666666666667
97
+ time: 1730669400
98
+ - request_total: 619.3
99
+ time: 1730671200
100
+ - request_total: 636.2333333333333
101
+ time: 1730673000
102
+ - request_total: 630.4666666666667
103
+ time: 1730674800
104
+ - request_total: 621.4666666666667
105
+ time: 1730676600
106
+ - request_total: 587.5333333333333
107
+ time: 1730678400
108
+ - request_total: 542.8666666666667
109
+ time: 1730680200
110
+ - request_total: 579
111
+ time: 1730682000
112
+ - request_total: 563.5
113
+ time: 1730683800
114
+ ```
115
+
116
+ ### Size
117
+
118
+ ```yaml preview
119
+ brick: ai-portal.stat-with-mini-chart
120
+ properties:
121
+ label: 请求数
122
+ value: "563.5"
123
+ size: small
124
+ xField: time
125
+ yField: request_total
126
+ lineColor: "#295DFF"
127
+ data:
128
+ - request_total: 642.2
129
+ time: 1730597995.403
130
+ - request_total: 621.3
131
+ time: 1730599200
132
+ - request_total: 600.2
133
+ time: 1730601000
134
+ - request_total: 601.9666666666667
135
+ time: 1730602800
136
+ - request_total: 592.4
137
+ time: 1730604600
138
+ - request_total: 567.8666666666667
139
+ time: 1730606400
140
+ - request_total: 651.3333333333334
141
+ time: 1730608200
142
+ - request_total: 571.9677419354839
143
+ time: 1730610000
144
+ - request_total: 550.2
145
+ time: 1730611800
146
+ - request_total: 556.5666666666667
147
+ time: 1730613600
148
+ - request_total: 565.6333333333333
149
+ time: 1730615400
150
+ - request_total: 586.5666666666667
151
+ time: 1730617200
152
+ - request_total: 611.7
153
+ time: 1730619000
154
+ - request_total: 540.0645161290323
155
+ time: 1730620800
156
+ - request_total: 595.9333333333333
157
+ time: 1730622600
158
+ - request_total: 560.0333333333333
159
+ time: 1730624400
160
+ - request_total: 565.2333333333333
161
+ time: 1730626200
162
+ - request_total: 609.5806451612904
163
+ time: 1730628000
164
+ - request_total: 598.8
165
+ time: 1730629800
166
+ - request_total: 594.5333333333333
167
+ time: 1730631600
168
+ - request_total: 525.7
169
+ time: 1730633400
170
+ - request_total: 602.3666666666667
171
+ time: 1730635200
172
+ - request_total: 557.7333333333333
173
+ time: 1730637000
174
+ - request_total: 595.8666666666667
175
+ time: 1730638800
176
+ - request_total: 638.7
177
+ time: 1730640600
178
+ - request_total: 635.8333333333334
179
+ time: 1730642400
180
+ - request_total: 563.9
181
+ time: 1730644200
182
+ - request_total: 606.4516129032259
183
+ time: 1730646000
184
+ - request_total: 660.1
185
+ time: 1730647800
186
+ - request_total: 606.2666666666667
187
+ time: 1730649600
188
+ - request_total: 504.43333333333334
189
+ time: 1730651400
190
+ - request_total: 651.7333333333333
191
+ time: 1730653200
192
+ - request_total: 583.5
193
+ time: 1730655000
194
+ - request_total: 566.2333333333333
195
+ time: 1730656800
196
+ - request_total: 519.2333333333333
197
+ time: 1730658600
198
+ - request_total: 621.6333333333333
199
+ time: 1730660400
200
+ - request_total: 530.9333333333333
201
+ time: 1730662200
202
+ - request_total: 685.3
203
+ time: 1730664000
204
+ - request_total: 616.3333333333334
205
+ time: 1730665800
206
+ - request_total: 580.3333333333334
207
+ time: 1730667600
208
+ - request_total: 568.5666666666667
209
+ time: 1730669400
210
+ - request_total: 619.3
211
+ time: 1730671200
212
+ - request_total: 636.2333333333333
213
+ time: 1730673000
214
+ - request_total: 630.4666666666667
215
+ time: 1730674800
216
+ - request_total: 621.4666666666667
217
+ time: 1730676600
218
+ - request_total: 587.5333333333333
219
+ time: 1730678400
220
+ - request_total: 542.8666666666667
221
+ time: 1730680200
222
+ - request_total: 579
223
+ time: 1730682000
224
+ - request_total: 563.5
225
+ time: 1730683800
226
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/ai-portal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -41,7 +41,8 @@
41
41
  "peerDependencies": {
42
42
  "@next-bricks/advanced": "*",
43
43
  "@next-bricks/basic": "*",
44
- "@next-bricks/diagram": "*"
44
+ "@next-bricks/diagram": "*",
45
+ "@next-bricks/mini-chart": "*"
45
46
  },
46
- "gitHead": "8259af240978bb18d57f234102fe8c1f984f69a8"
47
+ "gitHead": "66e8980b0b69ce41ab619006100698736d298b83"
47
48
  }