@next-bricks/ai-portal 0.59.4 → 0.60.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.
Files changed (48) hide show
  1. package/dist/bricks.json +36 -32
  2. package/dist/chunks/2232.02cd2bbc.js.map +1 -1
  3. package/dist/chunks/6792.0efb2d00.js +2 -0
  4. package/dist/chunks/6792.0efb2d00.js.map +1 -0
  5. package/dist/chunks/chat-box.991e397f.js.map +1 -1
  6. package/dist/chunks/gantt-chart.c8cdcd66.js +2 -0
  7. package/dist/chunks/gantt-chart.c8cdcd66.js.map +1 -0
  8. package/dist/chunks/{main.2a8a7df5.js → main.87ffc00f.js} +2 -2
  9. package/dist/chunks/{main.2a8a7df5.js.map → main.87ffc00f.js.map} +1 -1
  10. package/dist/chunks/{notice-dropdown.c4604581.js → notice-dropdown.365134e6.js} +2 -2
  11. package/dist/chunks/notice-dropdown.365134e6.js.map +1 -0
  12. package/dist/chunks/{notice-list.f15560fb.js → notice-list.d51c0103.js} +3 -3
  13. package/dist/chunks/notice-list.d51c0103.js.map +1 -0
  14. package/dist/chunks/set-chat-command.367b9c88.js.map +1 -1
  15. package/dist/examples.json +19 -16
  16. package/dist/index.a91518b7.js +2 -0
  17. package/dist/index.a91518b7.js.map +1 -0
  18. package/dist/manifest.json +195 -163
  19. package/dist/types.json +600 -432
  20. package/dist-types/bootstrap.d.ts +1 -0
  21. package/dist-types/chat-stream/useConversationStream.spec.d.ts +1 -0
  22. package/dist-types/data-providers/set-chat-command.d.ts +1 -1
  23. package/dist-types/gantt-chart/GanttBar.d.ts +2 -0
  24. package/dist-types/gantt-chart/GanttBar.spec.d.ts +1 -0
  25. package/dist-types/gantt-chart/constants.d.ts +5 -0
  26. package/dist-types/gantt-chart/getStateIcon.d.ts +6 -0
  27. package/dist-types/gantt-chart/i18n.d.ts +17 -0
  28. package/dist-types/gantt-chart/index.d.ts +23 -0
  29. package/dist-types/gantt-chart/index.spec.d.ts +1 -0
  30. package/dist-types/gantt-chart/interfaces.d.ts +12 -0
  31. package/dist-types/gantt-chart/utils.d.ts +6 -0
  32. package/dist-types/gantt-chart/utils.spec.d.ts +1 -0
  33. package/dist-types/notice-dropdown/index.d.ts +10 -1
  34. package/dist-types/notice-list/index.d.ts +1 -1
  35. package/dist-types/shared/PlanProgress/PlanProgress.d.ts +3 -3
  36. package/dist-types/shared/getFlatChunks.spec.d.ts +1 -0
  37. package/dist-types/shared/getTaskTree.spec.d.ts +1 -0
  38. package/dist-types/shared/interfaces.d.ts +6 -13
  39. package/dist-types/shared/useServiceFlowPlan.d.ts +2 -2
  40. package/docs/gantt-chart.md +37 -0
  41. package/package.json +2 -2
  42. package/dist/chunks/2621.2e553d56.js +0 -2
  43. package/dist/chunks/2621.2e553d56.js.map +0 -1
  44. package/dist/chunks/notice-dropdown.c4604581.js.map +0 -1
  45. package/dist/chunks/notice-list.f15560fb.js.map +0 -1
  46. package/dist/index.8eb595d7.js +0 -2
  47. package/dist/index.8eb595d7.js.map +0 -1
  48. /package/dist/chunks/{notice-list.f15560fb.js.LICENSE.txt → notice-list.d51c0103.js.LICENSE.txt} +0 -0
@@ -32,3 +32,4 @@ import "./data-providers/set-chat-command.js";
32
32
  import "./running-flow/index.js";
33
33
  import "./notice-dropdown/index.js";
34
34
  import "./notice-list/index.js";
35
+ import "./gantt-chart/index.js";
@@ -1,6 +1,6 @@
1
1
  import type { CommandPayload } from "../shared/interfaces.js";
2
2
  export interface ChatCommand {
3
- command?: string;
3
+ command: string;
4
4
  payload: CommandPayload;
5
5
  }
6
6
  export declare function setChatCommand(command: ChatCommand | null): void;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function GanttBar(): React.JSX.Element;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const INDENT_SIZE = 18;
2
+ export declare const LABEL_WIDTH = 260;
3
+ export declare const BAR_HEIGHT = 10;
4
+ export declare const CONTAINER_BAR_OFFSET = 8;
5
+ export declare const CONTAINER_BAR_HEIGHT: number;
@@ -0,0 +1,6 @@
1
+ import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
2
+ import type { ConversationState, JobState, TaskState } from "../shared/interfaces";
3
+ export declare function getStateIcon(state: TaskState | JobState | ConversationState | undefined, isFirstLevel?: boolean): {
4
+ icon: GeneralIconProps;
5
+ className?: string;
6
+ };
@@ -0,0 +1,17 @@
1
+ export declare enum K {
2
+ FULLSCREEN = "FULLSCREEN",
3
+ COLLAPSE = "COLLAPSE",
4
+ EXPAND = "EXPAND"
5
+ }
6
+ export declare const NS = "bricks/ai-portal/gantt-chart";
7
+ export declare const locales: {
8
+ en: Locale;
9
+ zh: Locale;
10
+ };
11
+ export declare const t: any;
12
+ type Locale = {
13
+ [k in K]: string;
14
+ } & {
15
+ [k in K as `${k}_plural`]?: string;
16
+ };
17
+ export {};
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import type { GanttNode } from "./interfaces.js";
5
+ export interface GanttChartProps {
6
+ chartTitle?: string;
7
+ nodes?: GanttNode[];
8
+ }
9
+ /**
10
+ * 构件 `ai-portal.gantt-chart`
11
+ */
12
+ export declare class GanttChart extends ReactNextElement implements GanttChartProps {
13
+ #private;
14
+ accessor chartTitle: string | undefined;
15
+ accessor nodes: GanttNode[] | undefined;
16
+ render(): React.JSX.Element;
17
+ }
18
+ export interface GanttChartNodeProps {
19
+ node: GanttNode;
20
+ level: number;
21
+ isLast: boolean;
22
+ }
23
+ export declare function GanttChartNode({ node, level, isLast }: GanttChartNodeProps): React.JSX.Element;
@@ -0,0 +1 @@
1
+ import "./";
@@ -0,0 +1,12 @@
1
+ import type { JobState, TaskState } from "../shared/interfaces.js";
2
+ export interface GanttNode {
3
+ name: string;
4
+ state?: TaskState | JobState;
5
+ startTime?: number;
6
+ endTime?: number;
7
+ children?: GanttNode[];
8
+ }
9
+ export interface Timing {
10
+ start: number;
11
+ end: number;
12
+ }
@@ -0,0 +1,6 @@
1
+ import type { GanttNode, Timing } from "./interfaces";
2
+ export declare function countNodes(node: GanttNode, collapsedNodes: Set<GanttNode> | null): number;
3
+ export declare function processTimeline(nodes: GanttNode[] | undefined): {
4
+ duration: number;
5
+ timeline: Map<GanttNode, Timing>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -3,7 +3,16 @@ import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
4
  import { Placement } from "@next-bricks/basic/popover";
5
5
  import { Target } from "@next-bricks/basic/link";
6
- import { NoticeItem } from "../shared/interfaces.js";
6
+ export interface NoticeItem {
7
+ id: string;
8
+ type: string;
9
+ isRead: boolean;
10
+ title: string;
11
+ description?: string;
12
+ time: number;
13
+ /** 单个消息详情链接,优先级高于 urlTemplate */
14
+ url?: string;
15
+ }
7
16
  export interface NoticeDropdownProps {
8
17
  /** 消息数据列表 */
9
18
  dataSource?: NoticeItem[];
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
- import { NoticeItem } from "../shared/interfaces.js";
5
4
  import { Target } from "@next-bricks/basic/link";
6
5
  import type { CheckboxValueType } from "@next-bricks/form/checkbox";
6
+ import { NoticeItem } from "../notice-dropdown/index.js";
7
7
  export interface CheckboxEvents {
8
8
  change: CustomEvent<CheckboxValueType[]>;
9
9
  }
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import type { ConversationState, PlanStep, TaskState } from "../interfaces";
2
+ import type { ConversationState, PlanProgressStep, TaskState } from "../interfaces";
3
3
  export interface PlanProgressProps {
4
- plan: PlanStep[];
4
+ plan: PlanProgressStep[];
5
5
  conversationState?: ConversationState;
6
6
  style?: React.CSSProperties;
7
7
  }
@@ -11,5 +11,5 @@ interface PlanStepProps {
11
11
  conversationState?: ConversationState;
12
12
  name: string;
13
13
  }
14
- declare function PlanStep({ state, conversationState, name }: PlanStepProps): React.JSX.Element;
14
+ declare function PlanProgressStep({ state, conversationState, name }: PlanStepProps): React.JSX.Element;
15
15
  export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -19,6 +19,11 @@ export interface Task {
19
19
  startTime: number;
20
20
  endTime?: number;
21
21
  aiEmployeeId?: string;
22
+ plan?: PlanStep[];
23
+ }
24
+ export interface PlanStep {
25
+ name: string;
26
+ jobId?: string;
22
27
  }
23
28
  export type ConversationState = "working" | "completed" | "failed" | "input-required" | "terminated";
24
29
  export type TaskState = "working" | "input-required" | "completed" | "failed";
@@ -58,10 +63,6 @@ export interface HumanActionSelect {
58
63
  type: "select";
59
64
  options: string[];
60
65
  }
61
- export interface Step {
62
- id: string;
63
- instruction: string;
64
- }
65
66
  export interface Message {
66
67
  role: string;
67
68
  parts: Part[];
@@ -225,19 +226,11 @@ export interface ActiveDetailOfActivity {
225
226
  activity: ActivityRun;
226
227
  flow: ServiceFlowRun;
227
228
  }
228
- export interface PlanStep {
229
+ export interface PlanProgressStep {
229
230
  name: string;
230
231
  taskId?: string;
231
232
  state?: TaskState;
232
233
  }
233
- export interface NoticeItem {
234
- id: string;
235
- type: string;
236
- isRead: boolean;
237
- title: string;
238
- description?: string;
239
- time: number;
240
- }
241
234
  export interface ActiveImages {
242
235
  files: FileInfo[];
243
236
  file: FileInfo;
@@ -1,2 +1,2 @@
1
- import type { PlanStep, ServiceFlowRun, Task } from "./interfaces";
2
- export declare function useServiceFlowPlan(serviceFlows: ServiceFlowRun[], tasks: Task[]): PlanStep[];
1
+ import type { PlanProgressStep, ServiceFlowRun, Task } from "./interfaces";
2
+ export declare function useServiceFlowPlan(serviceFlows: ServiceFlowRun[], tasks: Task[]): PlanProgressStep[];
@@ -0,0 +1,37 @@
1
+ 构件 `ai-portal.gantt-chart`
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: ai-portal.gantt-chart
9
+ properties:
10
+ chartTitle: Hello world
11
+ nodes:
12
+ - name: 整理产品业务相关知识
13
+ state: completed
14
+ children:
15
+ - name: One
16
+ startTime: 100
17
+ endTime: 110
18
+ - name: Two
19
+ - name: 创建产品设计业务流
20
+ state: working
21
+ children:
22
+ - name: 根据整理知识格式化为业务流定义
23
+ state: completed
24
+ children:
25
+ - name: Three
26
+ - name: 发起业务流:创建业务流
27
+ state: working
28
+ children:
29
+ - name: 编写业务流
30
+ state: completed
31
+ - name: 管理员确认
32
+ state: input-required
33
+ - name: 保存业务流
34
+ state: failed
35
+ - name: 展示业务流
36
+ # - name: 完成
37
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.59.4",
3
+ "version": "0.60.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/ai-portal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -47,5 +47,5 @@
47
47
  "@next-bricks/presentational": "*",
48
48
  "@next-bricks/vs": "*"
49
49
  },
50
- "gitHead": "ebd0fba01d17d7306589ddeec590acec6700b2c4"
50
+ "gitHead": "72a5f8e4dfde6e76a4b094a225d29dca3df47023"
51
51
  }