paul-ai-assistant 1.0.2 → 1.0.3

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 (34) hide show
  1. package/dist/6254.async.js +490 -490
  2. package/dist/7084.async.js +247 -0
  3. package/dist/customer-service-typewriter/index.html +44 -0
  4. package/dist/demos.async.js +384 -10
  5. package/dist/demos__customerServiceTypewriter__index.md.async.js +2 -0
  6. package/dist/dumi__tmp-production__dumi__theme__ContextWrapper.async.js +1 -1
  7. package/dist/meta__demos.async.js +1601 -1
  8. package/dist/meta__docs.async.js +29 -28
  9. package/dist/preload_helper.js +1 -1
  10. package/dist/umi.js +47 -47
  11. package/dist/~demos/demos-customer-service-typewriter-demo-customer-service-demo/index.html +44 -0
  12. package/dist/~demos/demos-customer-service-typewriter-demo-smart-scroll-demo/index.html +44 -0
  13. package/es/AssistantChat/AssistantChatCard/OperationCard/FeedBack/index.js +1 -1
  14. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/AttachmentsRender.js +1 -1
  15. package/es/AssistantChat/AssistantChatCard/UserQueryCardRender/ImageRender.js +1 -1
  16. package/es/components/AgentCardSubmit/index.js +1 -1
  17. package/es/components/PaulButtonGroup/Select.js +1 -1
  18. package/es/components/PaulButtonGroup/index.js +1 -1
  19. package/es/components/PopAuth/index.js +1 -1
  20. package/es/components/SelectBlurry/index.js +1 -1
  21. package/es/components/ShareModal/index.js +1 -1
  22. package/es/components/ShareOperationBar/index.js +1 -1
  23. package/es/context/utils/messages.js +1 -1
  24. package/es/context/utils/send.js +1 -1
  25. package/es/context/utils/tool.js +1 -1
  26. package/es/utils/apushAssistant.js +1 -1
  27. package/es/utils/clientPlugin.js +1 -1
  28. package/es/utils/request.d.ts +15 -0
  29. package/es/utils/request.js +74 -0
  30. package/es/utils/send.js +1 -1
  31. package/es/utils/uploadImage.d.ts +2 -2
  32. package/es/utils/uploadImage.js +1 -1
  33. package/package.json +1 -4
  34. package/dist/2517.async.js +0 -247
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <meta name="description" content="Paul AI 智能辅助组件">
8
+ <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i3/O1CN01nkhAfJ1G04B40Ux1h_!!6000000000559-2-tps-300-300.png">
9
+ <title>Paul AI Assistant</title>
10
+ <link rel="stylesheet" href="//alifd.alicdn.com/npm/@alife/theme-135688/0.3.11/next.var.min.css">
11
+ <style>
12
+ .dumi-default-header-left {
13
+ padding-right: 16px;
14
+ white-space: nowrap;
15
+ width: unset !important;
16
+ }
17
+ .dumi-default-hero-title {
18
+ font-size: 120px !important;
19
+ }
20
+ .dumi-default-source-code > pre.prism-code {
21
+ max-height: 300px;
22
+ }
23
+ .dumi-default-previewer .dumi-default-previewer-demo {
24
+ background: #FFF;
25
+ padding: 16px;
26
+ a {
27
+ color: #0064c8;
28
+ }
29
+ a:hover {
30
+ color: #0586fe;
31
+ }
32
+ }
33
+
34
+ </style>
35
+ <script src="//gw.alipayobjects.com/os/lib/??react/16.14.0/umd/react.development.js,react-dom/16.14.0/umd/react-dom.development.js,moment/2.29.1/moment.js,moment/2.29.1/locale/zh-cn.js"></script>
36
+ <script src="//gw.alipayobjects.com/os/lib/bizcharts/4.1.20/umd/BizCharts.min.js"></script>
37
+ <script>window.publicPath = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || "./";</script>
38
+ <script src="../../preload_helper.js"></script>
39
+ </head>
40
+ <body>
41
+ <div id="root" data-reactroot></div>
42
+ <script src="../../umi.js" entry></script>
43
+ </body>
44
+ </html>
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <meta name="description" content="Paul AI 智能辅助组件">
8
+ <link rel="shortcut icon" href="//img.alicdn.com/imgextra/i3/O1CN01nkhAfJ1G04B40Ux1h_!!6000000000559-2-tps-300-300.png">
9
+ <title>Paul AI Assistant</title>
10
+ <link rel="stylesheet" href="//alifd.alicdn.com/npm/@alife/theme-135688/0.3.11/next.var.min.css">
11
+ <style>
12
+ .dumi-default-header-left {
13
+ padding-right: 16px;
14
+ white-space: nowrap;
15
+ width: unset !important;
16
+ }
17
+ .dumi-default-hero-title {
18
+ font-size: 120px !important;
19
+ }
20
+ .dumi-default-source-code > pre.prism-code {
21
+ max-height: 300px;
22
+ }
23
+ .dumi-default-previewer .dumi-default-previewer-demo {
24
+ background: #FFF;
25
+ padding: 16px;
26
+ a {
27
+ color: #0064c8;
28
+ }
29
+ a:hover {
30
+ color: #0586fe;
31
+ }
32
+ }
33
+
34
+ </style>
35
+ <script src="//gw.alipayobjects.com/os/lib/??react/16.14.0/umd/react.development.js,react-dom/16.14.0/umd/react-dom.development.js,moment/2.29.1/moment.js,moment/2.29.1/locale/zh-cn.js"></script>
36
+ <script src="//gw.alipayobjects.com/os/lib/bizcharts/4.1.20/umd/BizCharts.min.js"></script>
37
+ <script>window.publicPath = window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__ || "./";</script>
38
+ <script src="../../preload_helper.js"></script>
39
+ </head>
40
+ <body>
41
+ <div id="root" data-reactroot></div>
42
+ <script src="../../umi.js" entry></script>
43
+ </body>
44
+ </html>
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  */
6
6
  import React, { useEffect, useState } from 'react';
7
7
  import { message, Tooltip } from '@alife/magic-basic';
8
- import { customRequest } from '@alife/magic-request';
8
+ import { customRequest } from "../../../../utils/request";
9
9
  import { CSECustomIcon } from "../../../../utils/CSEIconTool";
10
10
  export var FEEDBACK_TYPE = /*#__PURE__*/function (FEEDBACK_TYPE) {
11
11
  FEEDBACK_TYPE["HELPFUL"] = "helpful";
@@ -7,7 +7,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
7
  import React from 'react';
8
8
  import { message, Tooltip } from '@alife/magic-basic';
9
9
  import { DownloadO } from '@alife/magic-icons';
10
- import { customRequest } from '@alife/magic-request';
10
+ import { customRequest } from "../../../utils/request";
11
11
  import classNames from 'classnames';
12
12
  import { CSECustomIcon } from "../../../utils/CSEIconTool";
13
13
  import ImageRender from "./ImageRender";
@@ -9,7 +9,7 @@ import React, { useEffect, useState } from 'react';
9
9
  import { previewImg } from '@alife/goc-utils';
10
10
  import { Tooltip } from '@alife/magic-basic';
11
11
  import { DownloadO, ShowO } from '@alife/magic-icons';
12
- import { customRequest } from '@alife/magic-request';
12
+ import { customRequest } from "../../../utils/request";
13
13
  var ImageRender = function ImageRender(_ref) {
14
14
  var data = _ref.data,
15
15
  downloadFile = _ref.downloadFile;
@@ -5,7 +5,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
5
5
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
6
6
  var _excluded = ["bizId", "bizDomain", "agentId", "submitConfig", "onSubmitConfig"];
7
7
  import React, { useState } from 'react';
8
- import { customRequest } from '@alife/magic-request';
8
+ import { customRequest } from "../../utils/request";
9
9
  // import { Button } from '@alife/magic-basic';
10
10
  import { Submit } from '@formily/antd';
11
11
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
@@ -9,7 +9,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
9
9
  var _excluded = ["value", "onChange", "apiConfig", "fieldMapping"];
10
10
  import React, { useState } from 'react';
11
11
  import { Select } from '@alife/magic-basic';
12
- import { customRequest } from '@alife/magic-request';
12
+ import { customRequest } from "../../utils/request";
13
13
  import { useDebounceFn } from 'ahooks';
14
14
  import { get } from 'lodash';
15
15
  export default (function (props) {
@@ -10,7 +10,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
10
10
  */
11
11
  import React, { useCallback, useMemo, useState } from 'react';
12
12
  import { Button, Form, Input, Modal, Space } from '@alife/magic-basic';
13
- import { customRequest } from '@alife/magic-request';
13
+ import { customRequest } from "../../utils/request";
14
14
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
15
15
  import Select from "./Select";
16
16
  import "./index.scss";
@@ -2,7 +2,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
3
  import React, { useEffect, useState } from 'react';
4
4
  import { Button, message } from '@alife/magic-basic';
5
- import { customRequest } from '@alife/magic-request';
5
+ import { customRequest } from "../../utils/request";
6
6
  import { debounce } from 'lodash';
7
7
  import "./index.scss";
8
8
  var PopAuth = function PopAuth(props) {
@@ -5,7 +5,7 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutPr
5
5
  var _excluded = ["query", "dataApi", "fieldNames", "method"];
6
6
  import React, { useEffect, useState } from 'react';
7
7
  import { message, Select } from '@alife/magic-basic';
8
- import { customRequest } from '@alife/magic-request';
8
+ import { customRequest } from "../../utils/request";
9
9
  import { debounce } from 'lodash';
10
10
  var SelectBlurry = function SelectBlurry(props) {
11
11
  var query = props.query,
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React, { useContext, useState } from 'react';
5
5
  import { Button, Input, message, Modal, Select } from '@alife/magic-basic';
6
- import { customRequest } from '@alife/magic-request';
6
+ import { customRequest } from "../../utils/request";
7
7
  import { AssistantChatContext } from "../../context";
8
8
  import { CSECustomIcon } from "../../utils/CSEIconTool";
9
9
  import ShareContent from "../ShareContent";
@@ -3,7 +3,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import React, { useContext, useState } from 'react';
5
5
  import { Button, message } from '@alife/magic-basic';
6
- import { customRequest } from '@alife/magic-request';
6
+ import { customRequest } from "../../utils/request";
7
7
  import { AssistantChatContext } from "../../context";
8
8
  import { CSECustomIcon } from "../../utils/CSEIconTool";
9
9
  import { processAgentCardRenderScreenshot } from "../../utils/screenshot";
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
2
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
3
  import { event } from '@alife/goc-utils';
4
- import { customRequest } from '@alife/magic-request';
4
+ import { customRequest } from "../../utils/request";
5
5
  import { ASSIST_CHAT_EVENT } from "../../constants/assistChatEvent";
6
6
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
7
7
  import { countScrollDelay, locateToDialogId } from "../../utils/common";
@@ -1,7 +1,7 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import { message } from '@alife/magic-basic';
4
- import { customRequest } from '@alife/magic-request';
4
+ import { customRequest } from "../../utils/request";
5
5
  import { getWorkId } from '@alife/goc-utils';
6
6
  import { AGENT_TPYE, CHAT_TYPE, REQUEST_SUCCESS_CODE, SEARCH_TYPE } from "../../constants/common";
7
7
  import { LOG_TRACE_TYPE_ENUMS } from "../../constants/logTrace";
@@ -1,7 +1,7 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import { message } from '@alife/magic-basic';
4
- import { customRequest } from '@alife/magic-request';
4
+ import { customRequest } from "../../utils/request";
5
5
  import { REQUEST_SUCCESS_CODE } from "../../constants/common";
6
6
 
7
7
  // 工具搜索
@@ -1,7 +1,7 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import { event } from '@alife/goc-utils';
3
3
  import IM from '@alife/magic-chat-im';
4
- import { customRequest } from '@alife/magic-request';
4
+ import { customRequest } from "./request";
5
5
  import { JsonParse } from "./formatData";
6
6
  import { AesCustomLogEventEnum } from "./log";
7
7
  import { logger } from "./websocketLogger";
@@ -1,5 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import { customRequest } from '@alife/magic-request';
2
+ import { customRequest } from "./request";
3
3
  export var sendMsgToPlugin = function sendMsgToPlugin(serviceId, executionId, values) {
4
4
  window.dispatchEvent(new CustomEvent('TicketScriptEvent', {
5
5
  detail: {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @description HTTP 请求工具函数,替代 @alife/magic-request
3
+ */
4
+ export interface ICustomRequestOptions {
5
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE';
6
+ url: string;
7
+ query?: Record<string, any>;
8
+ headers?: Record<string, string>;
9
+ }
10
+ /**
11
+ * 自定义请求函数
12
+ * @param options 请求配置
13
+ * @returns Promise<any>
14
+ */
15
+ export declare const customRequest: (options: ICustomRequestOptions) => Promise<any>;
@@ -0,0 +1,74 @@
1
+ import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
4
+ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
+ /**
6
+ * @description HTTP 请求工具函数,替代 @alife/magic-request
7
+ */
8
+
9
+ /**
10
+ * 自定义请求函数
11
+ * @param options 请求配置
12
+ * @returns Promise<any>
13
+ */
14
+ export var customRequest = /*#__PURE__*/function () {
15
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
16
+ var method, url, query, _options$headers, headers, requestUrl, requestOptions, searchParams, queryString, response, data;
17
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ method = options.method, url = options.url, query = options.query, _options$headers = options.headers, headers = _options$headers === void 0 ? {} : _options$headers;
21
+ requestUrl = url;
22
+ requestOptions = {
23
+ method: method,
24
+ credentials: 'include',
25
+ headers: _objectSpread({
26
+ 'Content-Type': 'application/json'
27
+ }, headers)
28
+ };
29
+ if (method === 'GET') {
30
+ // GET 请求:将 query 参数拼接到 URL
31
+ if (query && Object.keys(query).length > 0) {
32
+ searchParams = new URLSearchParams();
33
+ Object.entries(query).forEach(function (_ref2) {
34
+ var _ref3 = _slicedToArray(_ref2, 2),
35
+ key = _ref3[0],
36
+ value = _ref3[1];
37
+ if (value !== undefined && value !== null) {
38
+ searchParams.append(key, String(value));
39
+ }
40
+ });
41
+ queryString = searchParams.toString();
42
+ requestUrl = url.includes('?') ? "".concat(url, "&").concat(queryString) : "".concat(url, "?").concat(queryString);
43
+ }
44
+ } else {
45
+ // POST/PUT/DELETE 请求:将 query 作为请求体
46
+ if (query) {
47
+ requestOptions.body = JSON.stringify(query);
48
+ }
49
+ }
50
+ _context.prev = 4;
51
+ _context.next = 7;
52
+ return fetch(requestUrl, requestOptions);
53
+ case 7:
54
+ response = _context.sent;
55
+ _context.next = 10;
56
+ return response.json();
57
+ case 10:
58
+ data = _context.sent;
59
+ return _context.abrupt("return", data);
60
+ case 14:
61
+ _context.prev = 14;
62
+ _context.t0 = _context["catch"](4);
63
+ console.error('Request failed:', _context.t0);
64
+ throw _context.t0;
65
+ case 18:
66
+ case "end":
67
+ return _context.stop();
68
+ }
69
+ }, _callee, null, [[4, 14]]);
70
+ }));
71
+ return function customRequest(_x) {
72
+ return _ref.apply(this, arguments);
73
+ };
74
+ }();
package/es/utils/send.js CHANGED
@@ -1,4 +1,4 @@
1
- import { customRequest } from '@alife/magic-request';
1
+ import { customRequest } from "./request";
2
2
  export var sendMessage = function sendMessage(query) {
3
3
  customRequest({
4
4
  method: 'POST',
@@ -1,9 +1,9 @@
1
- export declare const getPreviewUrl: (fileKey: string) => Promise<unknown>;
1
+ export declare const getPreviewUrl: (fileKey: string) => Promise<any>;
2
2
  export declare const base64ToBlob: (base64: any) => Blob;
3
3
  export declare const uploadImage: (blob: Blob, fileName: string) => Promise<{
4
4
  fileKey: unknown;
5
5
  url?: undefined;
6
6
  } | {
7
7
  fileKey: unknown;
8
- url: Promise<unknown>;
8
+ url: Promise<any>;
9
9
  }>;
@@ -5,7 +5,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
5
5
  * @author cherry.zj
6
6
  * @description 图片上传和预览
7
7
  */
8
- import { customRequest } from '@alife/magic-request';
8
+ import { customRequest } from "./request";
9
9
  var queryDownloadUrl = function queryDownloadUrl(params) {
10
10
  return customRequest({
11
11
  method: 'GET',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paul-ai-assistant",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Paul AI 智能辅助组件",
5
5
  "keywords": [
6
6
  "Magic Workbench",
@@ -77,7 +77,6 @@
77
77
  "ie >= 11"
78
78
  ],
79
79
  "resolutions": {
80
- "@alife/magic-request": "^2.5.0",
81
80
  "@types/react": "16.x",
82
81
  "@types/react-dom": "16.x",
83
82
  "eslint": "^8.40.0",
@@ -122,7 +121,6 @@
122
121
  "devDependencies": {
123
122
  "@ali/eslint-config-att": "^1.0.6",
124
123
  "@alife/magic-lint": "^3.1.8",
125
- "@alife/magic-request": "^2.5.0",
126
124
  "@babel/preset-env": "^7.24.0",
127
125
  "@babel/preset-react": "^7.23.3",
128
126
  "@babel/preset-typescript": "^7.23.3",
@@ -156,7 +154,6 @@
156
154
  "typescript": "^5.4.2"
157
155
  },
158
156
  "peerDependencies": {
159
- "@alife/magic-request": "^2.5.0",
160
157
  "react": ">=16.9.0",
161
158
  "react-dom": ">=16.9.0"
162
159
  },