eli-video-interview 1.2.37-beta.0 → 1.2.37-beta.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.
@@ -67,14 +67,18 @@ var BootVideo = function (props) {
67
67
  setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
68
68
  }, [setMediaState]);
69
69
  var handleInteractTypeChange = useCallback(function (e) {
70
+ var _a;
70
71
  var value = Number(e.target.value);
71
72
  if (value === 1) {
72
73
  setInterviewRoomState({ interactType: value });
73
74
  }
74
75
  else {
75
- setInterviewRoomState({ interactType: value, aiInterviewerProfile: interviewRoomState.aiInterviewerProfile });
76
+ setInterviewRoomState({
77
+ interactType: value,
78
+ aiInterviewerProfile: ((_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.humanType) ? interviewRoomState.aiInterviewerProfile : virtualManList[0],
79
+ });
76
80
  }
77
- }, [setInterviewRoomState, interviewRoomState]);
81
+ }, [setInterviewRoomState, interviewRoomState, virtualManList]);
78
82
  var handleSelectHumanType = useCallback(function (value) {
79
83
  setInterviewRoomState({ interactType: interviewRoomState.interactType, aiInterviewerProfile: value });
80
84
  }, [setInterviewRoomState, interviewRoomState]);
@@ -1,6 +1,3 @@
1
- /// <reference types="react" />
2
- interface InteractiveProps {
3
- mode: 'Traditional' | 'Chat';
4
- }
5
- declare const Interactive: React.FC<InteractiveProps>;
1
+ import { FC } from 'react';
2
+ declare const Interactive: FC;
6
3
  export default Interactive;
@@ -9,18 +9,27 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
12
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import BootVideo from '../BootVideo';
14
- import { Button, Typography, VideocamOutlineIcon } from 'fbm-ui';
14
+ import { useInterviewRoomStore } from "../../../../store/ai-question/interview-room-store";
15
+ import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
16
+ import { Button, CheckCircleOutlineIcon, Typography, VideocamOutlineIcon } from 'fbm-ui';
15
17
  import { Paper, Stack } from 'fbm-ui/lib/mui';
16
18
  import { useState } from 'react';
17
19
  var InteractiveModes = {
18
- Traditional: '传统读题模式',
19
- Chat: 'AI面试官对话模式',
20
+ 1: '传统读题模式',
21
+ 2: 'AI面试官对话模式',
20
22
  };
21
- var Interactive = function (_a) {
22
- var mode = _a.mode;
23
+ var AiVideoStatus = {
24
+ 0: '播报视频生成中...',
25
+ 1: '播报视频生成中...',
26
+ 2: '播报视频已生成',
27
+ 3: '播报视频生成中...',
28
+ };
29
+ var Interactive = function () {
30
+ var questionModelData = useQuestionModelStore().questionModelData;
31
+ var _a = useInterviewRoomStore(), interactType = _a.interactType, aiInterviewerProfile = _a.aiInterviewerProfile;
23
32
  var _b = useState(false), bootVideoOpen = _b[0], setBootVideoOpen = _b[1];
24
- return (_jsxs(_Fragment, { children: [_jsx(BootVideo, { open: bootVideoOpen, onClose: function () { return setBootVideoOpen(false); } }), _jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", component: Paper, variant: "outlined", height: 54, alignItems: "center", px: 2, mt: 2 }, { children: [_jsx(Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F\uFF1A".concat(InteractiveModes[mode]) })), _jsx(Button, __assign({ icon: _jsx(VideocamOutlineIcon, {}), variant: "text", onClick: function () { return setBootVideoOpen(true); } }, { children: "\u5B9A\u5236\u9762\u8BD5\u95F4" }))] }))] }));
33
+ return (_jsxs(_Fragment, { children: [bootVideoOpen && _jsx(BootVideo, { open: bootVideoOpen, onClose: function () { return setBootVideoOpen(false); } }), _jsxs(Stack, __assign({ direction: "row", justifyContent: "space-between", component: Paper, variant: "outlined", height: 54, alignItems: "center", px: 2, mt: 2 }, { children: [_jsxs(Typography, __assign({ display: "flex", alignItems: "center", variant: "body1", fontWeight: 500 }, { children: ["\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F\uFF1A".concat(InteractiveModes[interactType]), interactType === 2 && (_jsxs(_Fragment, { children: ["-".concat(aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.name), _jsx(Typography, __assign({ variant: "caption", color: "secondary", ml: 2 }, { children: AiVideoStatus[(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiVideoStatus) || 1] })), (questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiVideoStatus) === 2 && interactType === questionModelData.interactType ? (_jsx(CheckCircleOutlineIcon, { sx: { fontSize: '16px', ml: 1, color: 'RGBA(0, 0, 0, 0.56)' } })) : ('')] }))] })), _jsx(Button, __assign({ icon: _jsx(VideocamOutlineIcon, {}), variant: "text", onClick: function () { return setBootVideoOpen(true); } }, { children: "\u5B9A\u5236\u9762\u8BD5\u95F4" }))] }))] }));
25
34
  };
26
35
  export default Interactive;
@@ -19,6 +19,7 @@ import { QuestionModelRoot } from './styled';
19
19
  import { useAiAbilityListStore } from "../../../../store/ai-ability-select/question-ability-store";
20
20
  import { PostAiModelDetails } from "../../../../services/ai-question";
21
21
  import { useAiQuestionStore } from "../../../../store/ai-question/global-store";
22
+ import { useInterviewRoomStore } from "../../../../store/ai-question/interview-room-store";
22
23
  import { useQuestionModelStore } from "../../../../store/ai-question/question-model-store";
23
24
  import { useQuestionTemplateStore } from "../../../../store/ai-question/question-template-store";
24
25
  import { useRequest } from 'ahooks';
@@ -27,6 +28,7 @@ var Question = function () {
27
28
  var isDefaultAdded = useRef(false);
28
29
  var _a = useAiQuestionStore(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
29
30
  var aiEvaluationData = useQuestionTemplateStore(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
31
+ var updateInterviewRoom = useInterviewRoomStore().updateInterviewRoom;
30
32
  var _b = useQuestionModelStore(function (store) { return [store.questionModelData]; }), questionModelData = _b.questionModelData, updateModel = _b.updateModel, addModel = _b.addModel;
31
33
  var setSelctedAbilitys = useAiAbilityListStore().setSelctedAbilitys;
32
34
  var _c = useRequest(function () { return PostAiModelDetails(token); }, {
@@ -34,6 +36,8 @@ var Question = function () {
34
36
  onSuccess: function (_a) {
35
37
  var data = _a.data;
36
38
  updateModel(data);
39
+ var _b = data.interactType, interactType = _b === void 0 ? 1 : _b, aiInterviewerProfile = data.aiInterviewerProfile;
40
+ updateInterviewRoom({ interactType: interactType, aiInterviewerProfile: aiInterviewerProfile });
37
41
  setSelctedAbilitys((data === null || data === void 0 ? void 0 : data.selectAbilities) || []);
38
42
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(data.steps);
39
43
  },
@@ -70,6 +74,6 @@ var Question = function () {
70
74
  }
71
75
  }
72
76
  }, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
73
- return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(Interactive, { mode: "Traditional" }), _jsx(QuestionModelList, {})] })) }));
77
+ return (_jsx(QuestionModelRoot, { children: loading ? (_jsx(Skeleton, {})) : (_jsxs(_Fragment, { children: [_jsx(QuestionModelHeader, {}), _jsx(Interactive, {}), _jsx(QuestionModelList, {})] })) }));
74
78
  };
75
79
  export default Question;
@@ -10,6 +10,7 @@ export interface QuestionModelData {
10
10
  duration?: number;
11
11
  selectAbilities?: string[];
12
12
  interactType?: number;
13
+ aiVideoStatus?: number;
13
14
  aiInterviewerProfile?: AiInterviewerProfile;
14
15
  steps: QuestionModelStep[];
15
16
  }
@@ -10,15 +10,11 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  var _a;
13
- import { useQuestionModelStore } from "./question-model-store";
14
13
  import { useSetState } from 'ahooks';
15
14
  import { createGlobalStore } from 'hox';
16
15
  export var useInterviewRoomStore = (_a = createGlobalStore(function () {
17
- var questionModelData = useQuestionModelStore(function (store) { return [store.questionModelData]; }).questionModelData;
18
- console.log(questionModelData, 'questionModelData');
19
16
  var _a = useSetState({
20
- interactType: (questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.interactType) || 1,
21
- aiInterviewerProfile: questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiInterviewerProfile,
17
+ interactType: 1,
22
18
  }), interviewRoomState = _a[0], updateInterviewRoom = _a[1];
23
19
  return __assign(__assign({}, interviewRoomState), { interviewRoomState: interviewRoomState, updateInterviewRoom: updateInterviewRoom });
24
20
  }), _a[0]), getInterviewRoomStore = _a[1];
@@ -72,14 +72,18 @@ var BootVideo = function (props) {
72
72
  setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
73
73
  }, [setMediaState]);
74
74
  var handleInteractTypeChange = (0, react_1.useCallback)(function (e) {
75
+ var _a;
75
76
  var value = Number(e.target.value);
76
77
  if (value === 1) {
77
78
  setInterviewRoomState({ interactType: value });
78
79
  }
79
80
  else {
80
- setInterviewRoomState({ interactType: value, aiInterviewerProfile: interviewRoomState.aiInterviewerProfile });
81
+ setInterviewRoomState({
82
+ interactType: value,
83
+ aiInterviewerProfile: ((_a = interviewRoomState.aiInterviewerProfile) === null || _a === void 0 ? void 0 : _a.humanType) ? interviewRoomState.aiInterviewerProfile : virtualManList[0],
84
+ });
81
85
  }
82
- }, [setInterviewRoomState, interviewRoomState]);
86
+ }, [setInterviewRoomState, interviewRoomState, virtualManList]);
83
87
  var handleSelectHumanType = (0, react_1.useCallback)(function (value) {
84
88
  setInterviewRoomState({ interactType: interviewRoomState.interactType, aiInterviewerProfile: value });
85
89
  }, [setInterviewRoomState, interviewRoomState]);
@@ -1,6 +1,3 @@
1
- /// <reference types="react" />
2
- interface InteractiveProps {
3
- mode: 'Traditional' | 'Chat';
4
- }
5
- declare const Interactive: React.FC<InteractiveProps>;
1
+ import { FC } from 'react';
2
+ declare const Interactive: FC;
6
3
  export default Interactive;
@@ -16,16 +16,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var jsx_runtime_1 = require("react/jsx-runtime");
18
18
  var BootVideo_1 = __importDefault(require("../BootVideo"));
19
+ var interview_room_store_1 = require("../../../../store/ai-question/interview-room-store");
20
+ var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
19
21
  var fbm_ui_1 = require("fbm-ui");
20
22
  var mui_1 = require("fbm-ui/lib/mui");
21
23
  var react_1 = require("react");
22
24
  var InteractiveModes = {
23
- Traditional: '传统读题模式',
24
- Chat: 'AI面试官对话模式',
25
+ 1: '传统读题模式',
26
+ 2: 'AI面试官对话模式',
25
27
  };
26
- var Interactive = function (_a) {
27
- var mode = _a.mode;
28
+ var AiVideoStatus = {
29
+ 0: '播报视频生成中...',
30
+ 1: '播报视频生成中...',
31
+ 2: '播报视频已生成',
32
+ 3: '播报视频生成中...',
33
+ };
34
+ var Interactive = function () {
35
+ var questionModelData = (0, question_model_store_1.useQuestionModelStore)().questionModelData;
36
+ var _a = (0, interview_room_store_1.useInterviewRoomStore)(), interactType = _a.interactType, aiInterviewerProfile = _a.aiInterviewerProfile;
28
37
  var _b = (0, react_1.useState)(false), bootVideoOpen = _b[0], setBootVideoOpen = _b[1];
29
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BootVideo_1.default, { open: bootVideoOpen, onClose: function () { return setBootVideoOpen(false); } }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", component: mui_1.Paper, variant: "outlined", height: 54, alignItems: "center", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "body1", fontWeight: 500 }, { children: "\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F\uFF1A".concat(InteractiveModes[mode]) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.VideocamOutlineIcon, {}), variant: "text", onClick: function () { return setBootVideoOpen(true); } }, { children: "\u5B9A\u5236\u9762\u8BD5\u95F4" }))] }))] }));
38
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [bootVideoOpen && (0, jsx_runtime_1.jsx)(BootVideo_1.default, { open: bootVideoOpen, onClose: function () { return setBootVideoOpen(false); } }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", justifyContent: "space-between", component: mui_1.Paper, variant: "outlined", height: 54, alignItems: "center", px: 2, mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ display: "flex", alignItems: "center", variant: "body1", fontWeight: 500 }, { children: ["\u9762\u8BD5\u95F4\u4E92\u52A8\u65B9\u5F0F\uFF1A".concat(InteractiveModes[interactType]), interactType === 2 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["-".concat(aiInterviewerProfile === null || aiInterviewerProfile === void 0 ? void 0 : aiInterviewerProfile.name), (0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 2 }, { children: AiVideoStatus[(questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiVideoStatus) || 1] })), (questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiVideoStatus) === 2 && interactType === questionModelData.interactType ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.CheckCircleOutlineIcon, { sx: { fontSize: '16px', ml: 1, color: 'RGBA(0, 0, 0, 0.56)' } })) : ('')] }))] })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ icon: (0, jsx_runtime_1.jsx)(fbm_ui_1.VideocamOutlineIcon, {}), variant: "text", onClick: function () { return setBootVideoOpen(true); } }, { children: "\u5B9A\u5236\u9762\u8BD5\u95F4" }))] }))] }));
30
39
  };
31
40
  exports.default = Interactive;
@@ -24,6 +24,7 @@ var styled_1 = require("./styled");
24
24
  var question_ability_store_1 = require("../../../../store/ai-ability-select/question-ability-store");
25
25
  var ai_question_1 = require("../../../../services/ai-question");
26
26
  var global_store_1 = require("../../../../store/ai-question/global-store");
27
+ var interview_room_store_1 = require("../../../../store/ai-question/interview-room-store");
27
28
  var question_model_store_1 = require("../../../../store/ai-question/question-model-store");
28
29
  var question_template_store_1 = require("../../../../store/ai-question/question-template-store");
29
30
  var ahooks_1 = require("ahooks");
@@ -32,6 +33,7 @@ var Question = function () {
32
33
  var isDefaultAdded = (0, react_1.useRef)(false);
33
34
  var _a = (0, global_store_1.useAiQuestionStore)(function (store) { return [store.token, store.name, store.templateList]; }), token = _a.token, name = _a.name, templateList = _a.templateList, onLoad = _a.onLoad;
34
35
  var aiEvaluationData = (0, question_template_store_1.useQuestionTemplateStore)(function (store) { return [store.aiEvaluationData]; }).aiEvaluationData;
36
+ var updateInterviewRoom = (0, interview_room_store_1.useInterviewRoomStore)().updateInterviewRoom;
35
37
  var _b = (0, question_model_store_1.useQuestionModelStore)(function (store) { return [store.questionModelData]; }), questionModelData = _b.questionModelData, updateModel = _b.updateModel, addModel = _b.addModel;
36
38
  var setSelctedAbilitys = (0, question_ability_store_1.useAiAbilityListStore)().setSelctedAbilitys;
37
39
  var _c = (0, ahooks_1.useRequest)(function () { return (0, ai_question_1.PostAiModelDetails)(token); }, {
@@ -39,6 +41,8 @@ var Question = function () {
39
41
  onSuccess: function (_a) {
40
42
  var data = _a.data;
41
43
  updateModel(data);
44
+ var _b = data.interactType, interactType = _b === void 0 ? 1 : _b, aiInterviewerProfile = data.aiInterviewerProfile;
45
+ updateInterviewRoom({ interactType: interactType, aiInterviewerProfile: aiInterviewerProfile });
42
46
  setSelctedAbilitys((data === null || data === void 0 ? void 0 : data.selectAbilities) || []);
43
47
  onLoad === null || onLoad === void 0 ? void 0 : onLoad(data.steps);
44
48
  },
@@ -75,6 +79,6 @@ var Question = function () {
75
79
  }
76
80
  }
77
81
  }, [token, aiEvaluationData, questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.steps, templateList, addModel]);
78
- return ((0, jsx_runtime_1.jsx)(styled_1.QuestionModelRoot, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, {}), (0, jsx_runtime_1.jsx)(Interactive_1.default, { mode: "Traditional" }), (0, jsx_runtime_1.jsx)(List_1.default, {})] })) }));
82
+ return ((0, jsx_runtime_1.jsx)(styled_1.QuestionModelRoot, { children: loading ? ((0, jsx_runtime_1.jsx)(Skeleton_1.default, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Header_1.default, {}), (0, jsx_runtime_1.jsx)(Interactive_1.default, {}), (0, jsx_runtime_1.jsx)(List_1.default, {})] })) }));
79
83
  };
80
84
  exports.default = Question;
@@ -10,6 +10,7 @@ export interface QuestionModelData {
10
10
  duration?: number;
11
11
  selectAbilities?: string[];
12
12
  interactType?: number;
13
+ aiVideoStatus?: number;
13
14
  aiInterviewerProfile?: AiInterviewerProfile;
14
15
  steps: QuestionModelStep[];
15
16
  }
@@ -13,15 +13,11 @@ var __assign = (this && this.__assign) || function () {
13
13
  var _a;
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.getInterviewRoomStore = exports.useInterviewRoomStore = void 0;
16
- var question_model_store_1 = require("./question-model-store");
17
16
  var ahooks_1 = require("ahooks");
18
17
  var hox_1 = require("hox");
19
18
  exports.useInterviewRoomStore = (_a = (0, hox_1.createGlobalStore)(function () {
20
- var questionModelData = (0, question_model_store_1.useQuestionModelStore)(function (store) { return [store.questionModelData]; }).questionModelData;
21
- console.log(questionModelData, 'questionModelData');
22
19
  var _a = (0, ahooks_1.useSetState)({
23
- interactType: (questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.interactType) || 1,
24
- aiInterviewerProfile: questionModelData === null || questionModelData === void 0 ? void 0 : questionModelData.aiInterviewerProfile,
20
+ interactType: 1,
25
21
  }), interviewRoomState = _a[0], updateInterviewRoom = _a[1];
26
22
  return __assign(__assign({}, interviewRoomState), { interviewRoomState: interviewRoomState, updateInterviewRoom: updateInterviewRoom });
27
23
  }), _a[0]), exports.getInterviewRoomStore = _a[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.37-beta.0",
3
+ "version": "1.2.37-beta.1",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",