yt-chat-components 0.7.0 → 0.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-chat-components",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "main": "build/static/js/bundle.min.js",
5
5
  "module": "build/static/js/bundle.min.js",
6
6
  "types": "build/static/js/index.d.ts",
package/public/index.html CHANGED
@@ -27,50 +27,53 @@
27
27
  logo-font-size="26px"
28
28
  logo-position="fixed"
29
29
  is-title-side-icon=true
30
+ is-show-upload-button=false
30
31
  />
31
32
  </body>
32
33
 
33
- <!--<body style="width: 100vw; height: 100vh; margin:0 ">-->
34
- <!--<yt-page-chat-->
35
- <!-- title="菜鸟驿站"-->
36
- <!-- host-url="https://ai-api.yuntu.cn"-->
37
- <!-- app-id="a8e7ebd8-9bf7-499b-9e4a-c235078a0910"-->
38
- <!-- user-info='{"id": "123", "name": "John Doe", "code":"1606451129" }'-->
39
- <!-- tags='[{"name":"今天天气怎么样?"},{"name":"明天天气怎么样?"},{"name":"昨天天气怎么样?"}]'-->
40
- <!-- box-style='{"height":"100%"}'-->
41
- <!-- is-show-side-right=false-->
42
- <!-- is-show-side-left=false-->
43
- <!-- dialog-index="999999999"-->
44
- <!-- agent-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/ccit/user/xc//image/ebfaf4da-c1d9-46fb-a0b1-f159e95cffc2_AI招生咨询小助手.png"-->
45
- <!-- agent-name="医专智能助手"-->
46
- <!-- logo-width="42px"-->
47
- <!-- logo-font-size="26px"-->
48
- <!-- is-title-side-icon=true-->
49
- <!--/>-->
50
- <!--</body>-->
34
+ <body style="width: 100vw; height: 100vh; margin:0 ">
35
+ <yt-page-chat
36
+ title="菜鸟驿站"
37
+ host-url="https://ai-api.yuntu.cn"
38
+ app-id="a8e7ebd8-9bf7-499b-9e4a-c235078a0910"
39
+ user-info='{"id": "123", "name": "John Doe", "code":"1606451129" }'
40
+ tags='[{"name":"今天天气怎么样?"},{"name":"明天天气怎么样?"},{"name":"昨天天气怎么样?"}]'
41
+ box-style='{"height":"100%"}'
42
+ is-show-side-right=false
43
+ is-show-side-left=false
44
+ dialog-index="999999999"
45
+ agent-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/ccit/user/xc//image/ebfaf4da-c1d9-46fb-a0b1-f159e95cffc2_AI招生咨询小助手.png"
46
+ agent-name="医专智能助手"
47
+ logo-width="42px"
48
+ logo-font-size="26px"
49
+ is-title-side-icon=true
50
+ is-show-upload-button=false
51
+ />
52
+ </body>
51
53
 
52
- <!--<body style="width: 100vw; height: 100vh; position: relative; margin: unset ">-->
53
- <!--<yt-split-modal-chat-->
54
- <!-- right="100"-->
55
- <!-- bottom="100"-->
56
- <!-- width="50"-->
57
- <!-- height="50"-->
58
- <!-- title="招生助手"-->
59
- <!-- icon-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/ccit/user/xc//image/ebfaf4da-c1d9-46fb-a0b1-f159e95cffc2_AI招生咨询小助手.png"-->
60
- <!-- host-url="https://ai-api.yuntu.cn"-->
61
- <!-- user-info='{"id": "test", "name": "test", "code":"test" }'-->
62
- <!-- is-show-side-right=true-->
63
- <!-- is-show-side-left=true-->
64
- <!-- scene-id="c1e7a2a4-6127-4e53-a529-113da78eb069"-->
65
- <!-- modal-index="9999999999"-->
66
- <!-- modal-width="1400"-->
67
- <!-- dialog-index="999999999"-->
68
- <!-- agent-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/agent.png"-->
69
- <!-- agent-name="医专智能助手"-->
70
- <!-- logo-width="42px"-->
71
- <!-- logo-font-size="26px"-->
72
- <!-- logo-position="fixed"-->
73
- <!-- is-title-side-icon=true-->
74
- <!--/>-->
75
- <!--</body>-->
54
+ <body style="width: 100vw; height: 100vh; position: relative; margin: unset ">
55
+ <yt-split-modal-chat
56
+ right="100"
57
+ bottom="100"
58
+ width="50"
59
+ height="50"
60
+ title="招生助手"
61
+ icon-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/ccit/user/xc//image/ebfaf4da-c1d9-46fb-a0b1-f159e95cffc2_AI招生咨询小助手.png"
62
+ host-url="https://ai-api.yuntu.cn"
63
+ user-info='{"id": "test", "name": "test", "code":"test" }'
64
+ is-show-side-right=true
65
+ is-show-side-left=true
66
+ scene-id="c1e7a2a4-6127-4e53-a529-113da78eb069"
67
+ modal-index="9999999999"
68
+ modal-width="1400"
69
+ dialog-index="999999999"
70
+ agent-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/agent.png"
71
+ agent-name="医专智能助手"
72
+ logo-width="42px"
73
+ logo-font-size="26px"
74
+ logo-position="fixed"
75
+ is-title-side-icon=true
76
+ is-show-upload-button=false
77
+ />
78
+ </body>
76
79
  </html>
@@ -69,6 +69,7 @@ export default function ChatWindow({
69
69
  setDropDownList = () => {},
70
70
  dropDownList = [],
71
71
  baseConfig = {},
72
+ isShowUploadButton
72
73
  }: {
73
74
  tags: [];
74
75
  getHistoryList: Function;
@@ -106,6 +107,7 @@ export default function ChatWindow({
106
107
  sessionId: string;
107
108
  additional_headers?: { [key: string]: string };
108
109
  baseConfig: object;
110
+ isShowUploadButton: boolean;
109
111
  }) {
110
112
  const [value, setValue] = useState<string>('');
111
113
  const ref = useRef<HTMLDivElement>(null);
@@ -810,15 +812,18 @@ export default function ChatWindow({
810
812
  </div>
811
813
  </Tooltip>
812
814
  {/*<Tooltip title="支持PDF / Word / Excel / Markdown / txt / mobi / rpub">*/}
813
- <Tooltip title="支持图片格式">
814
- <div
815
- className="w_send_file_box"
816
- style={sendingMessage ? { cursor: 'not-allowed' } : {}}
817
- onClick={uploadFile}
818
- >
819
- <img src={fileuploadPng} style={{ width: 23 }}></img>
820
- </div>
821
- </Tooltip>
815
+ {
816
+ isShowUploadButton &&
817
+ <Tooltip title="支持图片格式">
818
+ <div
819
+ className="w_send_file_box"
820
+ style={sendingMessage ? { cursor: 'not-allowed' } : {}}
821
+ onClick={uploadFile}
822
+ >
823
+ <img src={fileuploadPng} style={{ width: 23 }}></img>
824
+ </div>
825
+ </Tooltip>
826
+ }
822
827
  <button
823
828
  disabled={sendingMessage}
824
829
  style={{ ...(sendingMessage ? { cursor: 'not-allowed' } : {}), padding: '0 13px', background:'transparent', display:'flex', alignItems:'center', justifyContent:'center' }}
@@ -36,7 +36,8 @@ export default function ChatWidget({
36
36
  start_open = false,
37
37
  setDropDownList,
38
38
  dropDownList,
39
- baseConfig
39
+ baseConfig,
40
+ isShowUploadButton
40
41
  }: {
41
42
  tags: [];
42
43
  getHistoryList: Function;
@@ -70,6 +71,7 @@ export default function ChatWidget({
70
71
  session_id?: string;
71
72
  start_open?: boolean;
72
73
  baseConfig:object;
74
+ isShowUploadButton:boolean;
73
75
  }) {
74
76
  const [open, setOpen] = useState(start_open);
75
77
  const [messages, setMessages] = useState<ChatMessageType[]>([]);
@@ -2384,6 +2386,7 @@ input::-ms-input-placeholder { /* Microsoft Edge */
2384
2386
  setDropDownList={setDropDownList}
2385
2387
  dropDownList={dropDownList}
2386
2388
  baseConfig={baseConfig}
2389
+ isShowUploadButton={isShowUploadButton}
2387
2390
  />
2388
2391
  </div>
2389
2392
  );
@@ -33,7 +33,8 @@ export class LogoBtn extends React.Component {
33
33
  logoWidth,
34
34
  logoFontSize,
35
35
  logoPosition = 'absolute',
36
- isTitleSideIcon
36
+ isTitleSideIcon,
37
+ isShowUploadButton
37
38
  } = this.props;
38
39
  const iconConfig = {
39
40
  width: `${width || 100}px`,
@@ -87,6 +88,7 @@ export class LogoBtn extends React.Component {
87
88
  logoFontSize={logoFontSize}
88
89
  isTitleSideIcon={isTitleSideIcon}
89
90
  modalIndex={modalIndex}
91
+ isShowUploadButton={isShowUploadButton}
90
92
  />
91
93
  </Modal>
92
94
  </div>
@@ -35,6 +35,7 @@ export class LogoSplitBtn extends React.Component {
35
35
  logoFontSize = '26px',
36
36
  logoPosition = 'absolute',
37
37
  isTitleSideIcon,
38
+ isShowUploadButton,
38
39
  } = this.props;
39
40
  const iconConfig = {
40
41
  width: `${width || 100}px`,
@@ -89,6 +90,7 @@ export class LogoSplitBtn extends React.Component {
89
90
  logoFontSize={logoFontSize}
90
91
  isTitleSideIcon={isTitleSideIcon}
91
92
  modalIndex={modalIndex}
93
+ isShowUploadButton={isShowUploadButton}
92
94
  />
93
95
  </Modal>
94
96
  </div>
@@ -436,7 +436,8 @@ export class ToolDialog extends React.Component {
436
436
  logoWidth = '42px',
437
437
  logoFontSize = '26px',
438
438
  isTitleSideIcon = false,// 是否将左侧历史顶部icon移到中间顶部左侧蓝点位置
439
- modalIndex
439
+ modalIndex,
440
+ isShowUploadButton
440
441
  } = this.props;
441
442
  const { sceneInfo, currentFlow = {} } = this.state;
442
443
  const { flows=[], name: sceneName } = sceneInfo;
@@ -508,6 +509,7 @@ export class ToolDialog extends React.Component {
508
509
  setDropDownList={(list) => this.setState({ dropDownList: list })}
509
510
  dropDownList={this.state.dropDownList}
510
511
  baseConfig={{ isTitleSideIcon, logoWidth, agentUrl }}
512
+ isShowUploadButton={isShowUploadButton}
511
513
  />
512
514
  </div>
513
515
  {