@next-bricks/ai-portal 0.63.0 → 0.63.2

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 (69) hide show
  1. package/dist/bricks.json +50 -50
  2. package/dist/chunks/1447.1763ddd6.js +2 -0
  3. package/dist/chunks/1447.1763ddd6.js.map +1 -0
  4. package/dist/chunks/2028.81962baa.js +3 -0
  5. package/dist/chunks/2028.81962baa.js.map +1 -0
  6. package/dist/chunks/3363.d64d8e2a.js +2 -0
  7. package/dist/chunks/3363.d64d8e2a.js.map +1 -0
  8. package/dist/chunks/4208.f9256bec.js +2 -0
  9. package/dist/chunks/4208.f9256bec.js.map +1 -0
  10. package/dist/chunks/4820.16e00935.js +2 -0
  11. package/dist/chunks/4820.16e00935.js.map +1 -0
  12. package/dist/chunks/7059.e3cef2d5.js +3 -0
  13. package/dist/chunks/7059.e3cef2d5.js.map +1 -0
  14. package/dist/chunks/778.85eedde5.js +2 -0
  15. package/dist/chunks/778.85eedde5.js.map +1 -0
  16. package/dist/chunks/9273.fbb69eb2.js +2 -0
  17. package/dist/chunks/{9273.3d1a73c8.js.map → 9273.fbb69eb2.js.map} +1 -1
  18. package/dist/chunks/chat-panel.9a58a43d.js +2 -0
  19. package/dist/chunks/chat-panel.9a58a43d.js.map +1 -0
  20. package/dist/chunks/chat-stream.c13cfc3f.js +2 -0
  21. package/dist/chunks/chat-stream.c13cfc3f.js.map +1 -0
  22. package/dist/chunks/elevo-sidebar.78a35f1d.js.map +1 -1
  23. package/dist/chunks/icon-button.545ffb24.js +2 -0
  24. package/dist/chunks/icon-button.545ffb24.js.map +1 -0
  25. package/dist/chunks/main.7105f876.js +2 -0
  26. package/dist/chunks/{main.3021b8e8.js.map → main.7105f876.js.map} +1 -1
  27. package/dist/examples.json +23 -23
  28. package/dist/index.4db426c8.js +2 -0
  29. package/dist/index.4db426c8.js.map +1 -0
  30. package/dist/manifest.json +383 -352
  31. package/dist/types.json +3269 -2531
  32. package/dist-types/chat-panel/index.d.ts +8 -3
  33. package/dist-types/elevo-sidebar/SpaceNav.d.ts +2 -1
  34. package/dist-types/elevo-sidebar/constants.d.ts +1 -0
  35. package/dist-types/elevo-sidebar/i18n.d.ts +2 -1
  36. package/dist-types/elevo-sidebar/index.d.ts +1 -0
  37. package/dist-types/elevo-sidebar/useNavLinkActive.d.ts +1 -0
  38. package/dist-types/icon-button/index.d.ts +2 -0
  39. package/dist-types/jsx.d.ts +1 -0
  40. package/dist-types/shared/FilePreview/FilePreview.d.ts +2 -1
  41. package/dist-types/shared/FilePreview/ImagesPreview.d.ts +2 -1
  42. package/docs/chat-panel.md +19 -3
  43. package/package.json +2 -2
  44. package/dist/chunks/4820.15145a03.js +0 -2
  45. package/dist/chunks/4820.15145a03.js.map +0 -1
  46. package/dist/chunks/6665.b5b39ef8.js +0 -2
  47. package/dist/chunks/6665.b5b39ef8.js.map +0 -1
  48. package/dist/chunks/689.11701509.js +0 -3
  49. package/dist/chunks/689.11701509.js.map +0 -1
  50. package/dist/chunks/7059.ee6fc15b.js +0 -3
  51. package/dist/chunks/7059.ee6fc15b.js.map +0 -1
  52. package/dist/chunks/7609.13366989.js +0 -2
  53. package/dist/chunks/7609.13366989.js.map +0 -1
  54. package/dist/chunks/778.b1fd7b4c.js +0 -2
  55. package/dist/chunks/778.b1fd7b4c.js.map +0 -1
  56. package/dist/chunks/8730.509db084.js +0 -2
  57. package/dist/chunks/8730.509db084.js.map +0 -1
  58. package/dist/chunks/9273.3d1a73c8.js +0 -2
  59. package/dist/chunks/chat-panel.a64e0e43.js +0 -2
  60. package/dist/chunks/chat-panel.a64e0e43.js.map +0 -1
  61. package/dist/chunks/chat-stream.a35fa156.js +0 -2
  62. package/dist/chunks/chat-stream.a35fa156.js.map +0 -1
  63. package/dist/chunks/icon-button.66d6d83a.js +0 -2
  64. package/dist/chunks/icon-button.66d6d83a.js.map +0 -1
  65. package/dist/chunks/main.3021b8e8.js +0 -2
  66. package/dist/index.eb7fcf13.js +0 -2
  67. package/dist/index.eb7fcf13.js.map +0 -1
  68. /package/dist/chunks/{689.11701509.js.LICENSE.txt → 2028.81962baa.js.LICENSE.txt} +0 -0
  69. /package/dist/chunks/{7059.ee6fc15b.js.LICENSE.txt → 7059.e3cef2d5.js.LICENSE.txt} +0 -0
@@ -1,26 +1,31 @@
1
1
  import React from "react";
2
2
  import { ReactNextElement } from "@next-core/react-element";
3
3
  import "@next-core/theme";
4
- import type { UploadOptions } from "../shared/interfaces";
4
+ import type { ChatPayload, CommandPayload, FileInfo, UploadOptions } from "../shared/interfaces";
5
5
  export interface ChatPanelProps {
6
6
  panelTitle?: string;
7
- mode?: "drawer" | "modal" | "fullscreen";
7
+ aiEmployeeId?: string;
8
+ cmd?: CommandPayload;
8
9
  width?: string | number;
9
10
  height?: string | number;
10
11
  placeholder?: string;
11
12
  uploadOptions?: UploadOptions;
12
13
  }
13
14
  /**
14
- * 弹出式对话面板,支持三种显示模式:抽屉、弹窗、全屏。
15
+ * 弹出式对话面板。
15
16
  */
16
17
  export declare class ChatPanel extends ReactNextElement implements ChatPanelProps {
17
18
  #private;
18
19
  accessor panelTitle: string | undefined;
20
+ accessor aiEmployeeId: string | undefined;
21
+ accessor cmd: CommandPayload | undefined;
19
22
  accessor width: string | number | undefined;
20
23
  accessor height: string | number | undefined;
21
24
  accessor placeholder: string | undefined;
22
25
  accessor uploadOptions: UploadOptions | undefined;
23
26
  open(): void;
24
27
  close(): void;
28
+ send(payload: ChatPayload): void;
29
+ showFile(file: FileInfo): void;
25
30
  render(): React.JSX.Element;
26
31
  }
@@ -2,6 +2,7 @@ import React from "react";
2
2
  import type { SidebarLink } from "./interfaces.js";
3
3
  export interface SpaceNavProps {
4
4
  returnUrl: string;
5
+ introUrl: string;
5
6
  spaceDetail: {
6
7
  instanceId: string;
7
8
  name: string;
@@ -13,4 +14,4 @@ export interface SpaceNavProps {
13
14
  export interface SpaceNavComponentProps extends SpaceNavProps {
14
15
  onAddServiceflow?: () => void;
15
16
  }
16
- export declare function SpaceNav({ returnUrl, spaceDetail, spaceObjects, spaceServiceflows, spaceLinks, onAddServiceflow, }: SpaceNavComponentProps): React.JSX.Element;
17
+ export declare function SpaceNav({ returnUrl, introUrl, spaceDetail, spaceObjects, spaceServiceflows, spaceLinks, onAddServiceflow, }: SpaceNavComponentProps): React.JSX.Element;
@@ -1,2 +1,3 @@
1
1
  import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
2
2
  export declare const ADD_ICON: GeneralIconProps;
3
+ export declare const MODEL_ICON: GeneralIconProps;
@@ -16,7 +16,8 @@ export declare enum K {
16
16
  BUSINESS_OBJECTS = "BUSINESS_OBJECTS",
17
17
  SERVICEFLOWS = "SERVICEFLOWS",
18
18
  COLLABORATION_SPACES = "COLLABORATION_SPACES",
19
- CREATE_SERVICEFLOW = "CREATE_SERVICEFLOW"
19
+ CREATE_SERVICEFLOW = "CREATE_SERVICEFLOW",
20
+ BUSINESS_OBJECTS_SETTINGS = "BUSINESS_OBJECTS_SETTINGS"
20
21
  }
21
22
  export declare const NS = "bricks/ai-portal/elevo-sidebar";
22
23
  export declare const locales: {
@@ -5,6 +5,7 @@ import type { ActionType } from "@next-bricks/basic/mini-actions";
5
5
  import { type ActionClickDetail, type Project, type ProjectActionClickDetail } from "./ChatHistory.js";
6
6
  import type { SidebarLink } from "./interfaces.js";
7
7
  import { type SpaceNavProps } from "./SpaceNav.js";
8
+ export type { SidebarLink, SpaceNavProps };
8
9
  export interface ElevoSidebarProps {
9
10
  userInstanceId?: string;
10
11
  behavior?: "default" | "drawer";
@@ -0,0 +1 @@
1
+ export declare function useNavLinkActive(url: string | null | undefined, activeIncludes?: string[]): boolean;
@@ -6,6 +6,7 @@ export interface IconButtonProps {
6
6
  icon?: GeneralIconProps & HTMLAttributes<GeneralIcon>;
7
7
  tooltip?: string;
8
8
  tooltipHoist?: boolean;
9
+ active?: boolean;
9
10
  disabled?: boolean;
10
11
  variant?: IconButtonVariant;
11
12
  reduceIconSize?: boolean;
@@ -18,6 +19,7 @@ export declare class IconButton extends ReactNextElement implements IconButtonPr
18
19
  accessor icon: (GeneralIconProps & HTMLAttributes<GeneralIcon>) | undefined;
19
20
  accessor tooltip: string | undefined;
20
21
  accessor tooltipHoist: boolean | undefined;
22
+ accessor active: boolean | undefined;
21
23
  accessor disabled: boolean | undefined;
22
24
  accessor variant: IconButtonVariant | undefined;
23
25
  /** 是否缩小图标尺寸(部分 easyops 图标过大) */
@@ -80,6 +80,7 @@ declare global {
80
80
  onAddProject?: () => void;
81
81
  onActionClick?: (event: CustomEvent<ActionClickDetail>) => void;
82
82
  onProjectActionClick?: (event: CustomEvent<ProjectActionClickDetail>) => void;
83
+ onAddServiceflow?: (event: CustomEvent<void>) => void;
83
84
  onPersonalActionClick?: (event: CustomEvent<PersonalActionClickDetail>) => void;
84
85
  };
85
86
  "ai-portal--flow-tabs": DetailedHTMLProps<HTMLAttributes<FlowTabs>, FlowTabs> & FlowTabsProps & {
@@ -2,5 +2,6 @@ import React from "react";
2
2
  import type { FileInfo } from "../../shared/interfaces";
3
3
  export interface FilePreviewProps {
4
4
  file: FileInfo;
5
+ fromModal?: boolean;
5
6
  }
6
- export declare function FilePreview({ file }: FilePreviewProps): React.JSX.Element;
7
+ export declare function FilePreview({ file, fromModal }: FilePreviewProps): React.JSX.Element;
@@ -2,5 +2,6 @@ import React from "react";
2
2
  import type { ActiveImages } from "../interfaces";
3
3
  export interface ImagesPreviewProps {
4
4
  images: ActiveImages;
5
+ fromModal?: boolean;
5
6
  }
6
- export declare function ImagesPreview({ images: { files, file } }: ImagesPreviewProps): React.JSX.Element;
7
+ export declare function ImagesPreview({ images: { files, file }, fromModal, }: ImagesPreviewProps): React.JSX.Element;
@@ -1,11 +1,27 @@
1
1
  构件 `ai-portal.chat-panel`
2
2
 
3
+ ## 介绍
4
+
5
+ 弹出式 AI 对话面板,提供一个模态框样式的聊天界面,支持与 AI 助手进行对话交互。
6
+
3
7
  ## Examples
4
8
 
5
9
  ### Basic
6
10
 
7
11
  ```yaml preview
8
- brick: ai-portal.chat-panel
9
- properties:
10
- textContent: Hello world
12
+ - brick: eo-button
13
+ properties:
14
+ themeVariant: elevo
15
+ textContent: 打开对话面板
16
+ events:
17
+ click:
18
+ target: "#chatPanel"
19
+ method: open
20
+ - brick: ai-portal.chat-panel
21
+ properties:
22
+ id: chatPanel
23
+ width: 600
24
+ height: 800
25
+ panelTitle: AI 助手
26
+ placeholder: 请输入您的问题...
11
27
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-bricks/ai-portal",
3
- "version": "0.63.0",
3
+ "version": "0.63.2",
4
4
  "homepage": "https://github.com/easyops-cn/next-advanced-bricks/tree/master/bricks/ai-portal",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,5 +49,5 @@
49
49
  "@next-bricks/presentational": "*",
50
50
  "@next-bricks/vs": "*"
51
51
  },
52
- "gitHead": "e648ff52316d7dd810056b060be72e3efd68377f"
52
+ "gitHead": "afb3515bbe0f27c73168c1e8f09311ce4ec61671"
53
53
  }