eli-video-interview 1.2.0 → 1.2.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.
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
- package/esm/modules/ai-report/components/VideoQuestion/QuestionItem.js +11 -11
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.d.ts +1 -1
- package/lib/modules/ai-report/components/VideoQuestion/QuestionItem.js +11 -11
- package/package.json +2 -2
|
@@ -10,22 +10,22 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
-
import
|
|
13
|
+
import Abilities from './Abilities';
|
|
14
|
+
import ScoreSlider from './ScoreSlider';
|
|
15
|
+
import { QuestionDesc } from './styled';
|
|
16
|
+
import { QUESTION_TYPE } from "../../../../enum/ai-question";
|
|
17
|
+
import { INTERVIEW_STEP_STATUS } from "../../../../enum/ai-report";
|
|
18
|
+
import FormatQuoteIcon from '@mui/icons-material/FormatQuote';
|
|
19
|
+
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
20
|
+
import { formatScore, highlighKeywords } from "../../../../utils/utils";
|
|
14
21
|
import { Box, Typography, Button } from 'fbm-ui';
|
|
15
22
|
import { theme } from 'fbm-ui/lib/components/ThemeProvider';
|
|
16
23
|
import { Paper } from 'fbm-ui/lib/mui';
|
|
17
24
|
import update from 'immutability-helper';
|
|
18
|
-
import
|
|
19
|
-
import { useAiReportStore } from "../../../../store/ai-report/global-store";
|
|
20
|
-
import { INTERVIEW_STEP_STATUS } from "../../../../enum/ai-report";
|
|
21
|
-
import { QUESTION_TYPE } from "../../../../enum/ai-question";
|
|
22
|
-
import { formatScore, highlighKeywords } from "../../../../utils/utils";
|
|
23
|
-
import { QuestionDesc } from './styled';
|
|
24
|
-
import ScoreSlider from './ScoreSlider';
|
|
25
|
-
import Abilities from './Abilities';
|
|
25
|
+
import { useState, useCallback, useMemo } from 'react';
|
|
26
26
|
var STEP_NO_ANSWER = INTERVIEW_STEP_STATUS.STEP_NO_ANSWER, STEP_COMPLETED = INTERVIEW_STEP_STATUS.STEP_COMPLETED, STEP_FAILED = INTERVIEW_STEP_STATUS.STEP_FAILED, STEP_IN_CALCULATION = INTERVIEW_STEP_STATUS.STEP_IN_CALCULATION;
|
|
27
27
|
var QuestionItem = function (props) {
|
|
28
|
-
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question,
|
|
28
|
+
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, desc = _b.desc, type = _b.type, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities;
|
|
29
29
|
var _d = useState(false), showAbilities = _d[0], setShowAbilities = _d[1];
|
|
30
30
|
var _e = useAiReportStore(function (store) { return [store.reportResult, store.stepToken, store.operableButtons, store.showAbilitiesDetails]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, showAbilitiesDetails = _e.showAbilitiesDetails, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
31
31
|
var steps = (reportResult || {}).steps;
|
|
@@ -83,6 +83,6 @@ var QuestionItem = function (props) {
|
|
|
83
83
|
mt: 2,
|
|
84
84
|
cursor: videoUrl ? 'pointer' : 'inherit',
|
|
85
85
|
borderColor: token === stepToken ? theme.palette.primary.main : '',
|
|
86
|
-
}, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".",
|
|
86
|
+
}, variant: "outlined", onClick: handleClickItem }, { children: [_jsxs(Typography, __assign({ fontSize: 14, color: token === stepToken ? theme.palette.primary.main : theme.palette.text.primary }, { children: [index + 1, ".", desc] })), _jsxs(QuestionDesc, { children: [_jsx(FormatQuoteIcon, {}), status === STEP_IN_CALCULATION ? (_jsx(Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : (_jsxs(_Fragment, { children: [_jsx(Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && (_jsxs(Box, { children: [_jsx("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), _jsxs(Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && (_jsxs(Box, __assign({ mt: 2, display: "flex" }, { children: [_jsxs(Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })), isShowWeight && _jsxs(Typography, __assign({ variant: "body2" }, { children: ["\u5355\u9898\u6743\u91CD\uFF1A", weight, "%"] }))] }))), isExistWeight && (_jsxs(Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [_jsx(Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: status === STEP_COMPLETED && (_jsxs(_Fragment, { children: [_jsx(ScoreSlider, { originScore: originScore, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && (_jsx(Button, __assign({ variant: "text", onClick: function () { return setShowAbilities(!showAbilities); } }, { children: showAbilities ? '收起' : '详情' })))] })) })), _jsx(Box, __assign({ width: 150, textAlign: "right" }, { children: _jsxs(Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500 }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore] })) }))] }))), isShowAbilitiesDetails && _jsx(Abilities, { stepIndex: index })] }), token));
|
|
87
87
|
};
|
|
88
88
|
export default QuestionItem;
|
|
@@ -15,22 +15,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var
|
|
18
|
+
var Abilities_1 = __importDefault(require("./Abilities"));
|
|
19
|
+
var ScoreSlider_1 = __importDefault(require("./ScoreSlider"));
|
|
20
|
+
var styled_1 = require("./styled");
|
|
21
|
+
var ai_question_1 = require("../../../../enum/ai-question");
|
|
22
|
+
var ai_report_1 = require("../../../../enum/ai-report");
|
|
23
|
+
var FormatQuote_1 = __importDefault(require("@mui/icons-material/FormatQuote"));
|
|
24
|
+
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
25
|
+
var utils_1 = require("../../../../utils/utils");
|
|
19
26
|
var fbm_ui_1 = require("fbm-ui");
|
|
20
27
|
var ThemeProvider_1 = require("fbm-ui/lib/components/ThemeProvider");
|
|
21
28
|
var mui_1 = require("fbm-ui/lib/mui");
|
|
22
29
|
var immutability_helper_1 = __importDefault(require("immutability-helper"));
|
|
23
|
-
var
|
|
24
|
-
var global_store_1 = require("../../../../store/ai-report/global-store");
|
|
25
|
-
var ai_report_1 = require("../../../../enum/ai-report");
|
|
26
|
-
var ai_question_1 = require("../../../../enum/ai-question");
|
|
27
|
-
var utils_1 = require("../../../../utils/utils");
|
|
28
|
-
var styled_1 = require("./styled");
|
|
29
|
-
var ScoreSlider_1 = __importDefault(require("./ScoreSlider"));
|
|
30
|
-
var Abilities_1 = __importDefault(require("./Abilities"));
|
|
30
|
+
var react_1 = require("react");
|
|
31
31
|
var STEP_NO_ANSWER = ai_report_1.INTERVIEW_STEP_STATUS.STEP_NO_ANSWER, STEP_COMPLETED = ai_report_1.INTERVIEW_STEP_STATUS.STEP_COMPLETED, STEP_FAILED = ai_report_1.INTERVIEW_STEP_STATUS.STEP_FAILED, STEP_IN_CALCULATION = ai_report_1.INTERVIEW_STEP_STATUS.STEP_IN_CALCULATION;
|
|
32
32
|
var QuestionItem = function (props) {
|
|
33
|
-
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question,
|
|
33
|
+
var token = props.token, index = props.index, status = props.status, _a = props.answer, analysisResult = _a.analysisResult, videoUrl = _a.videoUrl, _b = props.question, desc = _b.desc, type = _b.type, _c = props.scoreInfo, score = _c.score, weight = _c.weight, originScore = _c.originScore, finalScore = _c.finalScore, abilities = _c.abilities;
|
|
34
34
|
var _d = (0, react_1.useState)(false), showAbilities = _d[0], setShowAbilities = _d[1];
|
|
35
35
|
var _e = (0, global_store_1.useAiReportStore)(function (store) { return [store.reportResult, store.stepToken, store.operableButtons, store.showAbilitiesDetails]; }), reportResult = _e.reportResult, stepToken = _e.stepToken, operableButtons = _e.operableButtons, showAbilitiesDetails = _e.showAbilitiesDetails, updateState = _e.updateState, updateReportResult = _e.updateReportResult, onScoreChange = _e.onScoreChange, onStepChange = _e.onStepChange;
|
|
36
36
|
var steps = (reportResult || {}).steps;
|
|
@@ -88,6 +88,6 @@ var QuestionItem = function (props) {
|
|
|
88
88
|
mt: 2,
|
|
89
89
|
cursor: videoUrl ? 'pointer' : 'inherit',
|
|
90
90
|
borderColor: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : '',
|
|
91
|
-
}, variant: "outlined", onClick: handleClickItem }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: [index + 1, ".",
|
|
91
|
+
}, variant: "outlined", onClick: handleClickItem }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ fontSize: 14, color: token === stepToken ? ThemeProvider_1.theme.palette.primary.main : ThemeProvider_1.theme.palette.text.primary }, { children: [index + 1, ".", desc] })), (0, jsx_runtime_1.jsxs)(styled_1.QuestionDesc, { children: [(0, jsx_runtime_1.jsx)(FormatQuote_1.default, {}), status === STEP_IN_CALCULATION ? ((0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary" }, { children: "\u89C6\u9891\u5904\u7406\u4E2D\uFF0C\u8BF7\u7A0D\u5019" }))) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Typography, { variant: "caption", color: "secondary", dangerouslySetInnerHTML: { __html: renderText } }), type === ai_question_1.QUESTION_TYPE.COLOR_BLINDNESS && (analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img) && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, { children: [(0, jsx_runtime_1.jsx)("img", { style: { width: 100, height: 100 }, src: analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.img, alt: "" }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "caption", color: "secondary", ml: 1 }, { children: ["\u56DE\u7B54\uFF1A", analysisResult === null || analysisResult === void 0 ? void 0 : analysisResult.answer] }))] }))] }))] }), isExistWeight && status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ mt: 2, display: "flex" }, { children: [(0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", mr: 4 }, { children: ["\u8BC4\u5206\uFF1A", finalScore.toFixed(0), "\u5206"] })), isShowWeight && (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2" }, { children: ["\u5355\u9898\u6743\u91CD\uFF1A", weight, "%"] }))] }))), isExistWeight && ((0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ width: "100%", display: "flex", alignItems: "center", mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ flex: "1 0", display: "flex", alignItems: "center" }, { children: status === STEP_COMPLETED && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ScoreSlider_1.default, { originScore: originScore, finalScore: finalScore, isShowScoreRank: true, onChangeCommitted: handleChangeCommitted }), isShowAbilitiesButton && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "text", onClick: function () { return setShowAbilities(!showAbilities); } }, { children: showAbilities ? '收起' : '详情' })))] })) })), (0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ width: 150, textAlign: "right" }, { children: (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body1", fontSize: 16, fontWeight: 500 }, { children: ["\u7EFC\u5408\u8BC4\u5206\uFF1A", comprehensiveScore] })) }))] }))), isShowAbilitiesDetails && (0, jsx_runtime_1.jsx)(Abilities_1.default, { stepIndex: index })] }), token));
|
|
92
92
|
};
|
|
93
93
|
exports.default = QuestionItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eli-video-interview",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "鳄梨科技 AI视频面试 React SDK",
|
|
5
5
|
"author": "鳄梨科技",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"type": "git",
|
|
56
56
|
"url": "https://jihulab.com/elihr/elifront/open/lerna-avocado-sdk.git"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "d787e898f636bb66d99a990849ee10fec11f4b6e"
|
|
59
59
|
}
|