@glodon-aiot/agent-cli-ui 3.3.7-beta.2 → 3.3.8-alpha.1

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/es/AgentClientUI.mjs +107 -94
  2. package/dist/es/Dialog/AgentChat/HistoryItem/SessionRefer/index.mjs +46 -59
  3. package/dist/es/Dialog/AgentChat/HistoryItem/index.mjs +46 -47
  4. package/dist/es/Dialog/AgentChat/index.mjs +378 -376
  5. package/dist/es/Dialog/SessionList/index.mjs +115 -119
  6. package/dist/es/Dialog/index.mjs +26 -30
  7. package/dist/es/QuillEditor/index.mjs +59 -70
  8. package/dist/es/components/Recommend/index.mjs +34 -52
  9. package/dist/es/constant.mjs +3 -11
  10. package/dist/es/index.mjs +293 -285
  11. package/dist/es/packages/agent-cli-ui/package.json.mjs +23 -25
  12. package/dist/es/packages/react-components/dist/es/index.mjs +1 -1
  13. package/dist/es/src/style.css +1 -1
  14. package/dist/es/src/style10.css +1 -1
  15. package/dist/es/src/style11.css +1 -1
  16. package/dist/es/src/style12.css +1 -1
  17. package/dist/es/src/style13.css +1 -1
  18. package/dist/es/src/style14.css +1 -1
  19. package/dist/es/src/style15.css +1 -1
  20. package/dist/es/src/style17.css +1 -1
  21. package/dist/es/src/style18.css +1 -1
  22. package/dist/es/src/style19.css +1 -1
  23. package/dist/es/src/style20.css +1 -1
  24. package/dist/es/src/style22.css +1 -1
  25. package/dist/es/src/style23.css +1 -1
  26. package/dist/es/src/style24.css +1 -1
  27. package/dist/es/src/style25.css +1 -1
  28. package/dist/es/src/style26.css +1 -1
  29. package/dist/es/src/style27.css +1 -1
  30. package/dist/es/src/style28.css +1 -1
  31. package/dist/es/src/style4.css +1 -1
  32. package/dist/es/src/style5.css +1 -1
  33. package/dist/es/src/style6.css +1 -1
  34. package/dist/es/src/style7.css +1 -1
  35. package/dist/es/src/style8.css +1 -1
  36. package/dist/es/src/style9.css +1 -1
  37. package/dist/lib/index.css +1 -1
  38. package/dist/lib/index.js +54 -54
  39. package/dist/src/AgentClientUI.d.ts +1 -1
  40. package/dist/src/Dialog/AgentChat/HistoryItem/SessionRefer/index.d.ts +0 -2
  41. package/dist/src/Dialog/index.d.ts +1 -1
  42. package/dist/src/Footer/index.d.ts +1 -2
  43. package/dist/src/QuillEditor/index.d.ts +1 -1
  44. package/dist/src/components/Greeting/index.d.ts +1 -2
  45. package/dist/src/components/Header/index.d.ts +1 -2
  46. package/dist/src/components/Recommend/index.d.ts +0 -1
  47. package/dist/src/constant.d.ts +0 -4
  48. package/dist/src/index.d.ts +1 -5
  49. package/dist/src/types.d.ts +2 -3
  50. package/dist/src/utils/antdConfig.d.ts +7 -0
  51. package/dist/src/utils/testAntdPrefix.d.ts +3 -0
  52. package/package.json +11 -13
@@ -3,7 +3,7 @@ import { AgentClientProps } from './types';
3
3
  import { Session } from '@glodon-aiot/bot-client-sdk';
4
4
  import { IKnowledge, ISessionParams } from '@glodon-aiot/apis';
5
5
  export interface AgentClientRefProps {
6
- createSession: (params: ISessionParams & {
6
+ sessionCreate: (params: ISessionParams & {
7
7
  knowledges?: IKnowledge[];
8
8
  }) => Promise<Session> | undefined;
9
9
  getSessionList: () => Promise<Session[]> | undefined;
@@ -1,10 +1,8 @@
1
1
  import { default as React } from 'react';
2
2
  import { IHistory } from '@glodon-aiot/apis';
3
- import { MarkdownProps } from '@glodon-aiot/react-components/dist/src/components/Markdown';
4
3
  interface SessionReferProps {
5
4
  history?: IHistory;
6
5
  docViewerUrl?: string;
7
- markdown?: Partial<MarkdownProps>;
8
6
  }
9
7
  declare const SessionRefer: React.FC<SessionReferProps>;
10
8
  export default SessionRefer;
@@ -8,7 +8,7 @@ interface DialogProps {
8
8
  sessionId?: string;
9
9
  }
10
10
  export interface DialogRefProps {
11
- createSession: (params: ISessionParams & {
11
+ sessionCreate: (params: ISessionParams & {
12
12
  knowledges?: IKnowledge[];
13
13
  }) => Promise<Session> | undefined;
14
14
  getSessionList: () => Promise<Session[]> | undefined;
@@ -1,8 +1,7 @@
1
- import { default as React, FC } from 'react';
1
+ import { FC } from 'react';
2
2
  interface FooterProp {
3
3
  className?: string;
4
4
  tips?: HTMLDivElement | string | boolean;
5
- children?: React.ReactNode;
6
5
  }
7
6
  declare const Footer: FC<FooterProp>;
8
7
  export default Footer;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { default as ReactQuill } from 'react-quill-new';
2
+ import { default as ReactQuill } from 'react-quill';
3
3
  interface QuillEditorProp {
4
4
  text?: string;
5
5
  disabled?: boolean;
@@ -1,8 +1,7 @@
1
- import { default as React, FC } from 'react';
1
+ import { FC } from 'react';
2
2
  interface GreetingProps {
3
3
  icon: string;
4
4
  text: string;
5
- children?: React.ReactNode;
6
5
  }
7
6
  declare const Greeting: FC<GreetingProps>;
8
7
  export default Greeting;
@@ -1,7 +1,6 @@
1
- import { default as React, FC, ReactNode } from 'react';
1
+ import { FC, ReactNode } from 'react';
2
2
  interface HeaderProps {
3
3
  logo?: string | ReactNode;
4
- children?: React.ReactNode;
5
4
  }
6
5
  declare const Header: FC<HeaderProps>;
7
6
  export default Header;
@@ -6,7 +6,6 @@ interface RecommendProps {
6
6
  isRecommendClearing?: boolean;
7
7
  onChange?: (question: IQuestion) => void;
8
8
  onItemClick?: (question?: IQuestion) => void;
9
- layoutBreakpoints?: number[];
10
9
  }
11
10
  export interface RecommendRef {
12
11
  clear: () => void;
@@ -15,7 +15,3 @@ export declare const FILE_ICONS: {
15
15
  docx: string;
16
16
  pdf: string;
17
17
  };
18
- export declare const NET_OPEN_STATUS: {
19
- OPEN: number;
20
- CLOSE: number;
21
- };
@@ -9,8 +9,6 @@ export default class AgentClientUI {
9
9
  private _inputDisabled;
10
10
  private _defatulSessionId;
11
11
  private _agentClientRef;
12
- private _config;
13
- private _uuid;
14
12
  readonly apiUrl: string;
15
13
  readonly docViewerUrl: string;
16
14
  readonly env: Env;
@@ -25,8 +23,6 @@ export default class AgentClientUI {
25
23
  wrapper: HTMLElement;
26
24
  botClient: BotClient | null;
27
25
  constructor(config: InitalData);
28
- private updateUIConfig;
29
- private _initWrapper;
30
26
  get token(): string;
31
27
  set token(v: string);
32
28
  get mode(): AgentClientMode;
@@ -40,7 +36,7 @@ export default class AgentClientUI {
40
36
  disable(): void;
41
37
  enable(): void;
42
38
  getSessionList(): Promise<Session[]>;
43
- createSession(params?: ISessionParams & {
39
+ sessionCreate(params?: ISessionParams & {
44
40
  knowledges?: IKnowledge[];
45
41
  }): Promise<Session>;
46
42
  createBotClientSDK(): Promise<BotClient>;
@@ -47,7 +47,6 @@ export interface AgentFeaturesConfig {
47
47
  icon?: string;
48
48
  text?: string;
49
49
  questions?: boolean;
50
- layoutBreakpoints?: number[];
51
50
  };
52
51
  sessionList?: boolean;
53
52
  metadata?: boolean;
@@ -148,7 +147,7 @@ export interface AgentClientDefaultProps {
148
147
  greeting?: string;
149
148
  history?: boolean;
150
149
  service?: BotClientApi;
151
- popupContainer?: React.RefObject<HTMLDivElement | null>;
150
+ popupContainer?: React.RefObject<HTMLDivElement>;
152
151
  token?: string;
153
152
  debug?: boolean;
154
153
  plugins?: AgentPluginMap;
@@ -217,7 +216,7 @@ export interface InitalData extends AgentClientUIConfig {
217
216
  };
218
217
  bodyStyle?: CSSProperties;
219
218
  getSessionList?: any;
220
- createSession?: any;
219
+ sessionCreate?: any;
221
220
  }
222
221
  export interface AgentClientProps extends AgentClientDefaultProps {
223
222
  service: BotClientApi;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export declare const ANTD_PREFIX = "gbot";
3
+ export declare const AntdConfigWrapper: React.FC<{
4
+ children: React.ReactNode;
5
+ getPopupContainer: () => HTMLElement;
6
+ }>;
7
+ export declare const withAntdConfig: <P extends object>(Component: React.ComponentType<P>, getPopupContainer: () => HTMLElement) => React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ export declare const TestAntdPrefix: React.FC;
3
+ export default TestAntdPrefix;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glodon-aiot/agent-cli-ui",
3
- "version": "3.3.7-beta.2",
3
+ "version": "3.3.8-alpha.1",
4
4
  "module": "./dist/es/index.mjs",
5
5
  "main": "./dist/lib/index.js",
6
6
  "typings": "./dist/src/index.d.ts",
@@ -30,29 +30,29 @@
30
30
  "commit": "cz"
31
31
  },
32
32
  "peerDependencies": {
33
- "antd": ">=4.0.0",
34
- "react": ">=16.9.0",
35
- "react-dom": ">=16.9.0",
36
33
  "webpack": "*"
37
34
  },
38
35
  "dependencies": {
39
36
  "@ant-design/icons": "^5.3.4",
40
- "@glodon-aiot/apis": "^3.3.7-beta.2",
41
- "@glodon-aiot/bot-client-sdk": "^3.3.7-beta.2",
37
+ "@glodon-aiot/apis": "^3.3.8-alpha.1",
38
+ "@glodon-aiot/bot-client-sdk": "^3.3.8-alpha.1",
42
39
  "@matejmazur/react-mathjax": "^0.1.10",
43
40
  "@react-pdf-viewer/core": "^3.12.0",
44
41
  "@react-pdf-viewer/default-layout": "^3.12.0",
45
42
  "@react-pdf-viewer/locales": "^1.0.0",
46
43
  "@react-pdf-viewer/toolbar": "^3.12.0",
47
44
  "ahooks": "^3.8.5",
45
+ "antd": "4.x",
48
46
  "axios": "0.24.0",
49
47
  "classnames": "^2.5.1",
50
48
  "copy-to-clipboard": "^3.3.3",
51
49
  "dayjs": "^1.11.13",
52
50
  "lodash": "^4.17.21",
53
- "quill-delta": "^5.1.0",
51
+ "react": "^17.0.2",
52
+ "react-dom": "^17.0.2",
54
53
  "react-infinite-scroll-component": "^6.1.0",
55
- "react-quill-new": "^3.6.0",
54
+ "react-mathjax": "^1.0.1",
55
+ "react-quill": "^2.0.0",
56
56
  "react-resizable": "^3.0.5",
57
57
  "uuid": "^11.1.0"
58
58
  },
@@ -73,12 +73,12 @@
73
73
  "@storybook/react": "6.4.9",
74
74
  "@storybook/testing-library": "^0.0.13",
75
75
  "@types/lodash": "^4",
76
- "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
77
- "@types/react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
76
+ "@types/react": "^17.0.44",
77
+ "@types/react-dom": "^17.0.17",
78
+ "@types/react-mathjax": "^1",
78
79
  "@typescript-eslint/eslint-plugin": "^5.35.1",
79
80
  "@typescript-eslint/parser": "^5.35.1",
80
81
  "@vitejs/plugin-react": "^3.1.0",
81
- "antd": "^4.24.0",
82
82
  "babel-loader": "^8.3.0",
83
83
  "babel-plugin-import": "^1.13.8",
84
84
  "commitizen": "^4.3.0",
@@ -99,8 +99,6 @@
99
99
  "lint-staged": ">=10",
100
100
  "postcss-loader": "^7.2.4",
101
101
  "prettier": "2.7.1",
102
- "react": "^17.0.2",
103
- "react-dom": "^17.0.2",
104
102
  "require-from-string": "^2.0.2",
105
103
  "rollup-plugin-visualizer": "^6.0.1",
106
104
  "storybook-less-loader": "^0.1.0",