@next-bricks/ai-portal 0.50.2 → 0.51.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 (114) hide show
  1. package/dist/bricks.json +33 -28
  2. package/dist/chunks/1334.aae33a33.js +2 -0
  3. package/dist/chunks/1334.aae33a33.js.map +1 -0
  4. package/dist/chunks/2084.37e19e93.js +3 -0
  5. package/dist/chunks/2084.37e19e93.js.map +1 -0
  6. package/dist/chunks/3199.0220cf6e.js +3 -0
  7. package/dist/chunks/3199.0220cf6e.js.map +1 -0
  8. package/dist/chunks/3735.8c1d82e7.js +15 -0
  9. package/dist/chunks/3735.8c1d82e7.js.LICENSE.txt +5 -0
  10. package/dist/chunks/3735.8c1d82e7.js.map +1 -0
  11. package/dist/chunks/3744.ed6d0719.js +2 -0
  12. package/dist/chunks/3744.ed6d0719.js.map +1 -0
  13. package/dist/chunks/4317.d0f5904b.js +3 -0
  14. package/dist/chunks/{3151.d1fdecfb.js.LICENSE.txt → 4317.d0f5904b.js.LICENSE.txt} +8 -0
  15. package/dist/chunks/4317.d0f5904b.js.map +1 -0
  16. package/dist/chunks/6201.993201cb.js +2 -0
  17. package/dist/chunks/6201.993201cb.js.map +1 -0
  18. package/dist/chunks/6206.874a68ab.js +2 -0
  19. package/dist/chunks/6206.874a68ab.js.map +1 -0
  20. package/dist/chunks/6593.f25cfd6b.js +2 -0
  21. package/dist/chunks/6593.f25cfd6b.js.map +1 -0
  22. package/dist/chunks/8135.3255c5ba.js +2 -0
  23. package/dist/chunks/8135.3255c5ba.js.map +1 -0
  24. package/dist/chunks/8717.fc81dec5.js +2 -0
  25. package/dist/chunks/8717.fc81dec5.js.map +1 -0
  26. package/dist/chunks/{ai-agents.59e23ea3.js → ai-agents.d47947e5.js} +3 -3
  27. package/dist/chunks/{ai-agents.59e23ea3.js.map → ai-agents.d47947e5.js.map} +1 -1
  28. package/dist/chunks/{ai-employees.941aaa1b.js → ai-employees.6d586b8d.js} +3 -3
  29. package/dist/chunks/{ai-employees.941aaa1b.js.map → ai-employees.6d586b8d.js.map} +1 -1
  30. package/dist/chunks/blank-state.2b55f2c6.js +2 -0
  31. package/dist/chunks/blank-state.2b55f2c6.js.map +1 -0
  32. package/dist/chunks/chat-box.6156ad59.js +2 -0
  33. package/dist/chunks/chat-box.6156ad59.js.map +1 -0
  34. package/dist/chunks/elevo-card.731505e0.js +3 -0
  35. package/dist/chunks/elevo-card.731505e0.js.LICENSE.txt +5 -0
  36. package/dist/chunks/elevo-card.731505e0.js.map +1 -0
  37. package/dist/chunks/elevo-sidebar.402d464e.js +3 -0
  38. package/dist/chunks/elevo-sidebar.402d464e.js.LICENSE.txt +5 -0
  39. package/dist/chunks/elevo-sidebar.402d464e.js.map +1 -0
  40. package/dist/chunks/icon-button.0881c876.js +2 -0
  41. package/dist/chunks/icon-button.0881c876.js.map +1 -0
  42. package/dist/chunks/main.5dcdeb69.js +2 -0
  43. package/dist/chunks/main.5dcdeb69.js.map +1 -0
  44. package/dist/chunks/page-container.e59d6a94.js +2 -0
  45. package/dist/chunks/page-container.e59d6a94.js.map +1 -0
  46. package/dist/chunks/preview-container.6b29ee97.js +2 -0
  47. package/dist/chunks/preview-container.6b29ee97.js.map +1 -0
  48. package/dist/chunks/sticky-container.d3f7054e.js +2 -0
  49. package/dist/chunks/sticky-container.d3f7054e.js.map +1 -0
  50. package/dist/examples.json +19 -16
  51. package/dist/images/27bd64e1.png +0 -0
  52. package/dist/index.28d7dd85.js +2 -0
  53. package/dist/index.28d7dd85.js.map +1 -0
  54. package/dist/manifest.json +216 -173
  55. package/dist/types.json +327 -149
  56. package/dist-types/blank-state/index.d.ts +1 -1
  57. package/dist-types/bootstrap.d.ts +1 -0
  58. package/dist-types/chat-box/index.d.ts +8 -0
  59. package/dist-types/elevo-card/index.d.ts +25 -0
  60. package/dist-types/elevo-card/index.spec.d.ts +1 -0
  61. package/dist-types/elevo-sidebar/ChatHistory.d.ts +3 -3
  62. package/dist-types/elevo-sidebar/NavLink.d.ts +9 -0
  63. package/dist-types/elevo-sidebar/i18n.d.ts +1 -0
  64. package/dist-types/elevo-sidebar/index.d.ts +4 -5
  65. package/dist-types/icon-button/index.d.ts +2 -0
  66. package/dist-types/page-container/index.d.ts +2 -0
  67. package/dist-types/shared/interfaces.d.ts +2 -2
  68. package/dist-types/shared/workers/tsxParser.d.ts +2 -2
  69. package/docs/elevo-card.md +40 -0
  70. package/package.json +2 -2
  71. package/dist/chunks/3151.d1fdecfb.js +0 -3
  72. package/dist/chunks/3151.d1fdecfb.js.map +0 -1
  73. package/dist/chunks/3735.0389cba2.js +0 -15
  74. package/dist/chunks/3735.0389cba2.js.map +0 -1
  75. package/dist/chunks/3744.8d040aaa.js +0 -2
  76. package/dist/chunks/3744.8d040aaa.js.map +0 -1
  77. package/dist/chunks/3832.9b48b5f5.js +0 -2
  78. package/dist/chunks/3832.9b48b5f5.js.map +0 -1
  79. package/dist/chunks/6201.01557568.js +0 -2
  80. package/dist/chunks/6201.01557568.js.map +0 -1
  81. package/dist/chunks/7580.5dca4f97.js +0 -3
  82. package/dist/chunks/7580.5dca4f97.js.LICENSE.txt +0 -9
  83. package/dist/chunks/7580.5dca4f97.js.map +0 -1
  84. package/dist/chunks/8414.8b8390cb.js +0 -2
  85. package/dist/chunks/8414.8b8390cb.js.map +0 -1
  86. package/dist/chunks/8717.4f49d4f6.js +0 -2
  87. package/dist/chunks/8717.4f49d4f6.js.map +0 -1
  88. package/dist/chunks/8889.746f8129.js +0 -3
  89. package/dist/chunks/8889.746f8129.js.map +0 -1
  90. package/dist/chunks/blank-state.3a537adc.js +0 -2
  91. package/dist/chunks/blank-state.3a537adc.js.map +0 -1
  92. package/dist/chunks/chat-box.da1fbfc3.js +0 -2
  93. package/dist/chunks/chat-box.da1fbfc3.js.map +0 -1
  94. package/dist/chunks/elevo-sidebar.cbec3024.js +0 -3
  95. package/dist/chunks/elevo-sidebar.cbec3024.js.LICENSE.txt +0 -9
  96. package/dist/chunks/elevo-sidebar.cbec3024.js.map +0 -1
  97. package/dist/chunks/icon-button.1014fc6a.js +0 -2
  98. package/dist/chunks/icon-button.1014fc6a.js.map +0 -1
  99. package/dist/chunks/main.bd40fdc0.js +0 -2
  100. package/dist/chunks/main.bd40fdc0.js.map +0 -1
  101. package/dist/chunks/page-container.e187d00a.js +0 -2
  102. package/dist/chunks/page-container.e187d00a.js.map +0 -1
  103. package/dist/chunks/preview-container.631389f7.js +0 -2
  104. package/dist/chunks/preview-container.631389f7.js.map +0 -1
  105. package/dist/chunks/sticky-container.b8ab2a25.js +0 -2
  106. package/dist/chunks/sticky-container.b8ab2a25.js.map +0 -1
  107. package/dist/images/4b299d0b.png +0 -0
  108. package/dist/images/ddd8ccd2.png +0 -0
  109. package/dist/index.546d6b1e.js +0 -2
  110. package/dist/index.546d6b1e.js.map +0 -1
  111. /package/dist/chunks/{8889.746f8129.js.LICENSE.txt → 2084.37e19e93.js.LICENSE.txt} +0 -0
  112. /package/dist/chunks/{3735.0389cba2.js.LICENSE.txt → 3199.0220cf6e.js.LICENSE.txt} +0 -0
  113. /package/dist/chunks/{ai-agents.59e23ea3.js.LICENSE.txt → ai-agents.d47947e5.js.LICENSE.txt} +0 -0
  114. /package/dist/chunks/{ai-employees.941aaa1b.js.LICENSE.txt → ai-employees.6d586b8d.js.LICENSE.txt} +0 -0
@@ -7,6 +7,7 @@ export interface ChatBoxProps {
7
7
  placeholder?: string;
8
8
  autoFocus?: boolean;
9
9
  aiEmployees?: AIEmployee[];
10
+ commands?: Command[];
10
11
  }
11
12
  export interface AIEmployee {
12
13
  employeeId: string;
@@ -17,6 +18,11 @@ export interface ChatBoxRef {
17
18
  getValue: () => string;
18
19
  focusOnInput: () => void;
19
20
  }
21
+ export interface Command {
22
+ label: string;
23
+ value: string;
24
+ options?: Command[];
25
+ }
20
26
  /**
21
27
  * 构件 `ai-portal.chat-box`
22
28
  */
@@ -27,6 +33,7 @@ export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
27
33
  accessor placeholder: string | undefined;
28
34
  accessor autoFocus: boolean | undefined;
29
35
  accessor aiEmployees: AIEmployee[] | undefined;
36
+ accessor commands: Command[] | undefined;
30
37
  setValue(value: string): void;
31
38
  getValue(): string | undefined;
32
39
  focusOnInput(): void | undefined;
@@ -35,6 +42,7 @@ export declare class ChatBox extends ReactNextElement implements ChatBoxProps {
35
42
  interface ChatBoxComponentProps extends ChatBoxProps {
36
43
  onSubmit: (value: string) => void;
37
44
  onEmployeeMention: (employee: AIEmployee | null) => void;
45
+ onCommandSelect: (command: string | null) => void;
38
46
  ref?: React.Ref<ChatBoxRef>;
39
47
  }
40
48
  export {};
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { ReactNextElement } from "@next-core/react-element";
3
+ import "@next-core/theme";
4
+ import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
5
+ export interface ElevoCardProps {
6
+ cardTitle?: string;
7
+ description?: string;
8
+ url?: string;
9
+ avatar?: string | IconWithColor;
10
+ avatarType?: "icon" | "image";
11
+ }
12
+ export type IconWithColor = GeneralIconProps & {
13
+ color?: string;
14
+ };
15
+ /**
16
+ * 构件 `ai-portal.elevo-card`
17
+ */
18
+ export declare class ElevoCard extends ReactNextElement implements ElevoCardProps {
19
+ accessor cardTitle: string | undefined;
20
+ accessor description: string | undefined;
21
+ accessor url: string | undefined;
22
+ accessor avatar: string | GeneralIconProps | undefined;
23
+ accessor avatarType: "icon" | "image" | undefined;
24
+ render(): React.JSX.Element;
25
+ }
@@ -0,0 +1 @@
1
+ import "./";
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { ActionType, SimpleActionType } from "@next-bricks/basic/mini-actions";
3
3
  import type { ConversationState } from "../shared/interfaces.js";
4
+ import type { SidebarLink } from "./index.js";
4
5
  export interface HistoryItem {
5
6
  conversationId: string;
6
7
  title: string;
@@ -41,13 +42,12 @@ export interface Project {
41
42
  modifier: string;
42
43
  }
43
44
  export interface ChatHistoryProps {
44
- historyActiveId?: string;
45
45
  historyUrlTemplate?: string;
46
46
  historyActions?: ActionType[];
47
- projectActiveId?: string;
48
47
  projectUrlTemplate?: string;
49
48
  projectActions?: ActionType[];
50
49
  canAddProject?: boolean;
50
+ myLinks?: SidebarLink[];
51
51
  onActionClick: (detail: ActionClickDetail) => void;
52
52
  onHistoryClick: () => void;
53
53
  onProjectActionClick: (detail: ProjectActionClickDetail) => void;
@@ -60,4 +60,4 @@ export interface ChatHistoryRef {
60
60
  moveConversation?: (conversationId: string) => void;
61
61
  }
62
62
  export declare const ChatHistory: React.ForwardRefExoticComponent<ChatHistoryProps & React.RefAttributes<ChatHistoryRef>>;
63
- export declare function LowLevelChatHistory({ historyActiveId, historyActions, historyUrlTemplate, projectActiveId, projectUrlTemplate, projectActions, canAddProject, onActionClick, onHistoryClick, onProjectActionClick, onAddProject, }: ChatHistoryProps, ref: React.Ref<ChatHistoryRef>): React.JSX.Element;
63
+ export declare function LowLevelChatHistory({ historyActions, historyUrlTemplate, projectUrlTemplate, projectActions, canAddProject, myLinks, onActionClick, onHistoryClick, onProjectActionClick, onAddProject, }: ChatHistoryProps, ref: React.Ref<ChatHistoryRef>): React.JSX.Element;
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ export interface NavLinkProps {
3
+ url?: string;
4
+ activeIncludes?: string[];
5
+ render: (props: {
6
+ active: boolean;
7
+ }) => React.ReactElement;
8
+ }
9
+ export declare function NavLink({ url, activeIncludes, render }: NavLinkProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -6,6 +6,7 @@ export declare enum K {
6
6
  PREVIOUS_7_DAYS = "PREVIOUS_7_DAYS",
7
7
  PREVIOUS_30_DAYS = "PREVIOUS_30_DAYS",
8
8
  SWITCH_LANGUAGE = "SWITCH_LANGUAGE",
9
+ MY = "MY",
9
10
  PROJECTS = "PROJECTS",
10
11
  HISTORY = "HISTORY",
11
12
  CREATE_PROJECT = "CREATE_PROJECT",
@@ -7,7 +7,6 @@ import { type Project } from "./ChatHistory.js";
7
7
  export interface ElevoSidebarProps {
8
8
  userInstanceId?: string;
9
9
  behavior?: "default" | "drawer";
10
- bordered?: boolean;
11
10
  logoUrl?: string;
12
11
  newChatUrl?: string;
13
12
  newChatLinkWhenCollapsed?: boolean;
@@ -19,11 +18,13 @@ export interface ElevoSidebarProps {
19
18
  projectActions?: ActionType[];
20
19
  links?: SidebarLink[];
21
20
  canAddProject?: boolean;
21
+ myLinks?: SidebarLink[];
22
22
  }
23
23
  export interface SidebarLink {
24
24
  title: string;
25
25
  url: string;
26
- icon: GeneralIconProps;
26
+ icon?: GeneralIconProps;
27
+ activeIncludes?: string[];
27
28
  }
28
29
  /**
29
30
  * 构件 `ai-portal.elevo-sidebar`
@@ -32,18 +33,16 @@ export declare class ElevoSidebar extends ReactNextElement implements ElevoSideb
32
33
  #private;
33
34
  accessor userInstanceId: string | undefined;
34
35
  accessor behavior: "default" | "drawer" | undefined;
35
- accessor bordered: boolean | undefined;
36
36
  accessor logoUrl: string | undefined;
37
37
  accessor newChatUrl: string | undefined;
38
38
  accessor newChatLinkWhenCollapsed: boolean | undefined;
39
- accessor historyActiveId: string | undefined;
40
39
  accessor historyUrlTemplate: string | undefined;
41
40
  accessor historyActions: ActionType[] | undefined;
42
- accessor projectActiveId: string | undefined;
43
41
  accessor projectUrlTemplate: string | undefined;
44
42
  accessor projectActions: ActionType[] | undefined;
45
43
  accessor links: SidebarLink[] | undefined;
46
44
  accessor canAddProject: boolean | undefined;
45
+ accessor myLinks: SidebarLink[] | undefined;
47
46
  /**
48
47
  * @param delay Delay in milliseconds before pulling the latest chat history.
49
48
  */
@@ -5,6 +5,7 @@ import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
5
5
  export interface IconButtonProps {
6
6
  icon?: GeneralIconProps;
7
7
  tooltip?: string;
8
+ tooltipHoist?: boolean;
8
9
  disabled?: boolean;
9
10
  variant?: IconButtonVariant;
10
11
  }
@@ -15,6 +16,7 @@ export type IconButtonVariant = "default" | "light" | "mini" | "mini-light" | "b
15
16
  export declare class IconButton extends ReactNextElement implements IconButtonProps {
16
17
  accessor icon: GeneralIconProps | undefined;
17
18
  accessor tooltip: string | undefined;
19
+ accessor tooltipHoist: boolean | undefined;
18
20
  accessor disabled: boolean | undefined;
19
21
  accessor variant: IconButtonVariant | undefined;
20
22
  render(): React.JSX.Element;
@@ -5,6 +5,7 @@ export interface PageContainerProps {
5
5
  pageTitle?: string;
6
6
  breadcrumbs?: Breadcrumb[];
7
7
  size?: "medium" | "small";
8
+ variant?: "default" | "form";
8
9
  sticky?: boolean;
9
10
  }
10
11
  export interface Breadcrumb {
@@ -21,6 +22,7 @@ export declare class PageContainer extends ReactNextElement implements PageConta
21
22
  accessor pageTitle: string | undefined;
22
23
  accessor breadcrumbs: Breadcrumb[] | undefined;
23
24
  accessor size: "medium" | "small" | undefined;
25
+ accessor variant: "default" | "form" | undefined;
24
26
  accessor sticky: boolean | undefined;
25
27
  render(): React.JSX.Element;
26
28
  }
@@ -1,4 +1,4 @@
1
- import type { ParseResult } from "@next-shared/tsx-parser";
1
+ import type { ParsedApp } from "@next-shared/tsx-parser";
2
2
  export interface Conversation {
3
3
  id: string;
4
4
  title: string;
@@ -113,7 +113,7 @@ export interface GeneratedView {
113
113
  withContexts?: Record<string, unknown>;
114
114
  asyncConstructedView?: Promise<ParsedView | null>;
115
115
  }
116
- export interface ParsedView extends ParseResult {
116
+ export interface ParsedView extends ParsedApp {
117
117
  viewId: string;
118
118
  withContexts?: Record<string, unknown>;
119
119
  }
@@ -1,5 +1,5 @@
1
- import type { ParseResult, ParseOptions } from "@next-shared/tsx-parser";
1
+ import type { ParsedApp, ParseOptions } from "@next-shared/tsx-parser";
2
2
  export interface RemoteTsxParserWorker {
3
- parse(source: string, options?: ParseOptions): Promise<ParseResult>;
3
+ parseView(source: string, options?: ParseOptions): Promise<ParsedApp>;
4
4
  }
5
5
  export declare function getRemoteTsxParserWorker(): Promise<RemoteTsxParserWorker>;
@@ -0,0 +1,40 @@
1
+ 构件 `ai-portal.elevo-card`
2
+
3
+ ## Examples
4
+
5
+ ### Basic
6
+
7
+ ```yaml preview
8
+ brick: ai-portal.home-container
9
+ children:
10
+ - brick: ai-portal.elevo-card
11
+ properties:
12
+ cardTitle: HR
13
+ description: Provide standard HR workflows. e.g. leave applications, office supply requistion, purchase requistion, etc.
14
+ style:
15
+ maxWidth: 400px
16
+ children:
17
+ - brick: eo-dropdown-actions
18
+ slot: actions
19
+ properties:
20
+ themeVariant: elevo
21
+ actions:
22
+ - text: Edit
23
+ event: edit
24
+ - text: Delete
25
+ event: delete
26
+ danger: true
27
+ children:
28
+ - brick: ai-portal.icon-button
29
+ properties:
30
+ variant: mini
31
+ icon:
32
+ lib: antd
33
+ icon: setting
34
+ - brick: eo-button
35
+ slot: footer
36
+ properties:
37
+ themeVariant: elevo
38
+ textContent: Chat
39
+ type: flat
40
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.50.2",
3
+ "version": "0.51.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": "a2783362462647b17c21eeb1f70d9965d7e0a270"
50
+ "gitHead": "ad8088670e3a3d6f21cd7a31e83ab149d362c160"
51
51
  }