eli-video-interview 1.6.2 → 1.6.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.
@@ -24,7 +24,7 @@ import { Box, Button, Typography } from 'fbm-ui';
24
24
  import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
25
25
  var NO_ANSWER = INTERVIEW_STATUS.NO_ANSWER;
26
26
  var AiReportRoot = forwardRef(function (props, ref) {
27
- var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
27
+ var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onExportReportClick = props.onExportReportClick, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
28
28
  var firstLoad = useRef(true);
29
29
  var _a = useAiReportStore(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
30
30
  var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
@@ -83,7 +83,7 @@ var AiReportRoot = forwardRef(function (props, ref) {
83
83
  borderRadius: 2,
84
84
  overflow: 'hidden',
85
85
  pb: 3,
86
- } }, { children: [hasRisk && (_jsx(Box, __assign({ id: "report-risk-alert" }, { children: _jsx(NotFinish, {}) }))), _jsx(V3Header, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), _jsxs(Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && (_jsx(AIEvaluate, {})), _jsx(CapabilityTable, {}), fetchFormResult && _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(VideoQuestion, { isExportPdf: isExportPdf })] }))] })) })) })));
86
+ } }, { children: [hasRisk && (_jsx(Box, __assign({ id: "report-risk-alert" }, { children: _jsx(NotFinish, {}) }))), _jsx(V3Header, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo, onExportReportClick: onExportReportClick }), _jsxs(Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && (_jsx(AIEvaluate, {})), _jsx(CapabilityTable, {}), fetchFormResult && _jsx(FormReport, { fetchFormResult: fetchFormResult }), _jsx(VideoQuestion, { isExportPdf: isExportPdf })] }))] })) })) })));
87
87
  }, [
88
88
  loading,
89
89
  status,
@@ -94,6 +94,7 @@ var AiReportRoot = forwardRef(function (props, ref) {
94
94
  customScore,
95
95
  handleRefreshSuccess,
96
96
  fetchCandidateInfo,
97
+ onExportReportClick,
97
98
  fetchFormResult,
98
99
  isExportPdf,
99
100
  ]);
@@ -6,6 +6,7 @@ interface V3HeaderProps {
6
6
  onRefreshSuccess: () => void;
7
7
  fetchCandidateInfo?: () => Promise<CandidateInfo>;
8
8
  v3AssetBase?: string;
9
+ onExportReportClick?: () => void;
9
10
  }
10
- declare const V3Header: ({ status, customScore, onRefreshSuccess, fetchCandidateInfo, v3AssetBase }: V3HeaderProps) => JSX.Element;
11
+ declare const V3Header: ({ status, customScore, onRefreshSuccess, fetchCandidateInfo, v3AssetBase, onExportReportClick }: V3HeaderProps) => JSX.Element;
11
12
  export default V3Header;
@@ -72,7 +72,7 @@ var tagColors = [
72
72
  var DefaultAvatar = function () { return (_jsxs("svg", __assign({ viewBox: "0 0 137 192", width: "100%", height: "100%", preserveAspectRatio: "xMidYMid slice" }, { children: [_jsx("defs", { children: _jsxs("linearGradient", __assign({ id: "avbg", x1: "0", y1: "0", x2: "0", y2: "1" }, { children: [_jsx("stop", { offset: "0", stopColor: "#EDF4F0" }), _jsx("stop", { offset: "1", stopColor: "#E2EEE6" })] })) }), _jsx("rect", { width: "137", height: "192", fill: "url(#avbg)" }), _jsx("circle", { cx: "68.5", cy: "78", r: "33", fill: "#C6D8CD" }), _jsx("path", { d: "M26 192c4-45 22-64 42.5-64s38.5 19 42.5 64z", fill: "#C6D8CD" })] }))); };
73
73
  var V3Header = function (_a) {
74
74
  var _b;
75
- var status = _a.status, customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo, _c = _a.v3AssetBase, v3AssetBase = _c === void 0 ? '' : _c;
75
+ var status = _a.status, customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo, _c = _a.v3AssetBase, v3AssetBase = _c === void 0 ? '' : _c, onExportReportClick = _a.onExportReportClick;
76
76
  var _d = useAiReportStore(function (store) { return [store.token, store.reportResult, store.operableButtons]; }), token = _d.token, reportResult = _d.reportResult, operableButtons = _d.operableButtons;
77
77
  var _e = reportResult || {}, _f = _e.score, score = _f === void 0 ? 0 : _f, _g = _e.createTime, createTime = _g === void 0 ? 0 : _g, _h = _e.steps, steps = _h === void 0 ? [] : _h, _j = _e.tags, tags = _j === void 0 ? [] : _j, candidateInfo = _e.candidateInfo;
78
78
  var _k = __read(useState(score || 0), 2), feScore = _k[0], setFeScore = _k[1];
@@ -136,7 +136,7 @@ var V3Header = function (_a) {
136
136
  fontSize: 28,
137
137
  lineHeight: '39px',
138
138
  color: 'rgba(0,0,0,0.86)',
139
- } }, { children: "AI\u9762\u8BD5\u62A5\u544A" })), _jsxs(Typography, __assign({ variant: "body2", color: "rgba(74,74,74,0.72)", sx: { ml: 1 } }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", dayjs(createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && (_jsx(Popover, __assign({ open: openRefresh, content: refreshContent, onClickAway: function () { return setOpenRefresh(false); } }, { children: _jsx(IconButton, __assign({ onClick: function () { return setOpenRefresh(true); }, size: "small" }, { children: _jsx(RefreshIcon, { sx: { color: '#009908' } }) })) })))] })) })), _jsx(Box, __assign({ sx: { px: 3, py: 2 } }, { children: _jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 3 }, { children: [_jsx(Box, __assign({ width: 137, height: 170, borderRadius: 2, overflow: "hidden", flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center", bgcolor: "#F2F5F3" }, { children: (candidate === null || candidate === void 0 ? void 0 : candidate.avatar) && !avatarErr ? (_jsx("img", { src: candidate.avatar, alt: "", onError: function () { return setAvatarErr(true); }, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : (_jsx(DefaultAvatar, {})) })), _jsx(Box, __assign({ flex: "1 1 auto", minWidth: 0, sx: {
139
+ } }, { children: "AI\u9762\u8BD5\u62A5\u544A" })), _jsxs(Typography, __assign({ variant: "body2", color: "rgba(74,74,74,0.72)", sx: { ml: 1 } }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", dayjs(createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && (_jsx(Popover, __assign({ open: openRefresh, content: refreshContent, onClickAway: function () { return setOpenRefresh(false); } }, { children: _jsx(IconButton, __assign({ onClick: function () { return setOpenRefresh(true); }, size: "small" }, { children: _jsx(RefreshIcon, { sx: { color: '#009908' } }) })) }))), _jsx(Box, { sx: { flex: 1 } }), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('export')) && onExportReportClick && (_jsx(Button, __assign({ variant: "outlined", size: "small", onClick: onExportReportClick, sx: { color: '#fff', borderColor: 'rgba(255,255,255,0.85)', whiteSpace: 'nowrap' } }, { children: "\u5BFC\u51FA\u62A5\u544A" })))] })) })), _jsx(Box, __assign({ sx: { px: 3, py: 2 } }, { children: _jsxs(Stack, __assign({ direction: "row", alignItems: "center", spacing: 3 }, { children: [_jsx(Box, __assign({ width: 137, height: 170, borderRadius: 2, overflow: "hidden", flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center", bgcolor: "#F2F5F3" }, { children: (candidate === null || candidate === void 0 ? void 0 : candidate.avatar) && !avatarErr ? (_jsx("img", { src: candidate.avatar, alt: "", onError: function () { return setAvatarErr(true); }, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : (_jsx(DefaultAvatar, {})) })), _jsx(Box, __assign({ flex: "1 1 auto", minWidth: 0, sx: {
140
140
  background: '#FBFDFC',
141
141
  borderRadius: 2,
142
142
  px: 2,
@@ -29,7 +29,7 @@ var fbm_ui_1 = require("fbm-ui");
29
29
  var react_1 = require("react");
30
30
  var NO_ANSWER = ai_report_1.INTERVIEW_STATUS.NO_ANSWER;
31
31
  var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
32
- var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
32
+ var token = props.token, v3AssetBase = props.v3AssetBase, customScore = props.customScore, reminderSent = props.reminderSent, operableButtons = props.operableButtons, onLoad = props.onLoad, onExportReportClick = props.onExportReportClick, onSendReminderClick = props.onSendReminderClick, fetchFormResult = props.fetchFormResult, fetchCandidateInfo = props.fetchCandidateInfo, isExportPdf = props.isExportPdf;
33
33
  var firstLoad = (0, react_1.useRef)(true);
34
34
  var _a = (0, global_store_1.useAiReportStore)(), updateState = _a.updateState, updateReportResult = _a.updateReportResult, reportResult = _a.reportResult, interviewCheat = _a.interviewCheat;
35
35
  var _b = (reportResult || {}).collection, collection = _b === void 0 ? [] : _b;
@@ -88,7 +88,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
88
88
  borderRadius: 2,
89
89
  overflow: 'hidden',
90
90
  pb: 3,
91
- } }, { children: [hasRisk && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ id: "report-risk-alert" }, { children: (0, jsx_runtime_1.jsx)(NotFinish_1.default, {}) }))), (0, jsx_runtime_1.jsx)(V3Header_1.default, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && ((0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {})), (0, jsx_runtime_1.jsx)(CapabilityTable_1.default, {}), fetchFormResult && (0, jsx_runtime_1.jsx)(Form_1.FormReport, { fetchFormResult: fetchFormResult }), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, { isExportPdf: isExportPdf })] }))] })) })) })));
91
+ } }, { children: [hasRisk && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Box, __assign({ id: "report-risk-alert" }, { children: (0, jsx_runtime_1.jsx)(NotFinish_1.default, {}) }))), (0, jsx_runtime_1.jsx)(V3Header_1.default, { v3AssetBase: v3AssetBase, status: status, customScore: customScore, onRefreshSuccess: handleRefreshSuccess, fetchCandidateInfo: fetchCandidateInfo, onExportReportClick: onExportReportClick }), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Box, __assign({ sx: { mx: 2, mt: 1.5 } }, { children: [((collection === null || collection === void 0 ? void 0 : collection.length) > 0 || !!(reportResult === null || reportResult === void 0 ? void 0 : reportResult.workplaceEvaluation)) && ((0, jsx_runtime_1.jsx)(AIEvaluate_1.default, {})), (0, jsx_runtime_1.jsx)(CapabilityTable_1.default, {}), fetchFormResult && (0, jsx_runtime_1.jsx)(Form_1.FormReport, { fetchFormResult: fetchFormResult }), (0, jsx_runtime_1.jsx)(VideoQuestion_1.default, { isExportPdf: isExportPdf })] }))] })) })) })));
92
92
  }, [
93
93
  loading,
94
94
  status,
@@ -99,6 +99,7 @@ var AiReportRoot = (0, react_1.forwardRef)(function (props, ref) {
99
99
  customScore,
100
100
  handleRefreshSuccess,
101
101
  fetchCandidateInfo,
102
+ onExportReportClick,
102
103
  fetchFormResult,
103
104
  isExportPdf,
104
105
  ]);
@@ -6,6 +6,7 @@ interface V3HeaderProps {
6
6
  onRefreshSuccess: () => void;
7
7
  fetchCandidateInfo?: () => Promise<CandidateInfo>;
8
8
  v3AssetBase?: string;
9
+ onExportReportClick?: () => void;
9
10
  }
10
- declare const V3Header: ({ status, customScore, onRefreshSuccess, fetchCandidateInfo, v3AssetBase }: V3HeaderProps) => JSX.Element;
11
+ declare const V3Header: ({ status, customScore, onRefreshSuccess, fetchCandidateInfo, v3AssetBase, onExportReportClick }: V3HeaderProps) => JSX.Element;
11
12
  export default V3Header;
@@ -77,7 +77,7 @@ var tagColors = [
77
77
  var DefaultAvatar = function () { return ((0, jsx_runtime_1.jsxs)("svg", __assign({ viewBox: "0 0 137 192", width: "100%", height: "100%", preserveAspectRatio: "xMidYMid slice" }, { children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", __assign({ id: "avbg", x1: "0", y1: "0", x2: "0", y2: "1" }, { children: [(0, jsx_runtime_1.jsx)("stop", { offset: "0", stopColor: "#EDF4F0" }), (0, jsx_runtime_1.jsx)("stop", { offset: "1", stopColor: "#E2EEE6" })] })) }), (0, jsx_runtime_1.jsx)("rect", { width: "137", height: "192", fill: "url(#avbg)" }), (0, jsx_runtime_1.jsx)("circle", { cx: "68.5", cy: "78", r: "33", fill: "#C6D8CD" }), (0, jsx_runtime_1.jsx)("path", { d: "M26 192c4-45 22-64 42.5-64s38.5 19 42.5 64z", fill: "#C6D8CD" })] }))); };
78
78
  var V3Header = function (_a) {
79
79
  var _b;
80
- var status = _a.status, customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo, _c = _a.v3AssetBase, v3AssetBase = _c === void 0 ? '' : _c;
80
+ var status = _a.status, customScore = _a.customScore, onRefreshSuccess = _a.onRefreshSuccess, fetchCandidateInfo = _a.fetchCandidateInfo, _c = _a.v3AssetBase, v3AssetBase = _c === void 0 ? '' : _c, onExportReportClick = _a.onExportReportClick;
81
81
  var _d = (0, global_store_1.useAiReportStore)(function (store) { return [store.token, store.reportResult, store.operableButtons]; }), token = _d.token, reportResult = _d.reportResult, operableButtons = _d.operableButtons;
82
82
  var _e = reportResult || {}, _f = _e.score, score = _f === void 0 ? 0 : _f, _g = _e.createTime, createTime = _g === void 0 ? 0 : _g, _h = _e.steps, steps = _h === void 0 ? [] : _h, _j = _e.tags, tags = _j === void 0 ? [] : _j, candidateInfo = _e.candidateInfo;
83
83
  var _k = __read((0, react_1.useState)(score || 0), 2), feScore = _k[0], setFeScore = _k[1];
@@ -141,7 +141,7 @@ var V3Header = function (_a) {
141
141
  fontSize: 28,
142
142
  lineHeight: '39px',
143
143
  color: 'rgba(0,0,0,0.86)',
144
- } }, { children: "AI\u9762\u8BD5\u62A5\u544A" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "rgba(74,74,74,0.72)", sx: { ml: 1 } }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", (0, dayjs_1.default)(createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: openRefresh, content: refreshContent, onClickAway: function () { return setOpenRefresh(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: function () { return setOpenRefresh(true); }, size: "small" }, { children: (0, jsx_runtime_1.jsx)(fbm_icons_1.RefreshIcon, { sx: { color: '#009908' } }) })) })))] })) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { px: 3, py: 2 } }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 3 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ width: 137, height: 170, borderRadius: 2, overflow: "hidden", flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center", bgcolor: "#F2F5F3" }, { children: (candidate === null || candidate === void 0 ? void 0 : candidate.avatar) && !avatarErr ? ((0, jsx_runtime_1.jsx)("img", { src: candidate.avatar, alt: "", onError: function () { return setAvatarErr(true); }, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : ((0, jsx_runtime_1.jsx)(DefaultAvatar, {})) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ flex: "1 1 auto", minWidth: 0, sx: {
144
+ } }, { children: "AI\u9762\u8BD5\u62A5\u544A" })), (0, jsx_runtime_1.jsxs)(fbm_ui_1.Typography, __assign({ variant: "body2", color: "rgba(74,74,74,0.72)", sx: { ml: 1 } }, { children: ["\u62A5\u544A\u751F\u6210\u65F6\u95F4\uFF1A", (0, dayjs_1.default)(createTime * 1000).format('YYYY-MM-DD HH:mm')] })), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('refresh')) && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Popover, __assign({ open: openRefresh, content: refreshContent, onClickAway: function () { return setOpenRefresh(false); } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.IconButton, __assign({ onClick: function () { return setOpenRefresh(true); }, size: "small" }, { children: (0, jsx_runtime_1.jsx)(fbm_icons_1.RefreshIcon, { sx: { color: '#009908' } }) })) }))), (0, jsx_runtime_1.jsx)(mui_1.Box, { sx: { flex: 1 } }), (operableButtons === null || operableButtons === void 0 ? void 0 : operableButtons.includes('export')) && onExportReportClick && ((0, jsx_runtime_1.jsx)(fbm_ui_1.Button, __assign({ variant: "outlined", size: "small", onClick: onExportReportClick, sx: { color: '#fff', borderColor: 'rgba(255,255,255,0.85)', whiteSpace: 'nowrap' } }, { children: "\u5BFC\u51FA\u62A5\u544A" })))] })) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ sx: { px: 3, py: 2 } }, { children: (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center", spacing: 3 }, { children: [(0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ width: 137, height: 170, borderRadius: 2, overflow: "hidden", flexShrink: 0, display: "flex", alignItems: "center", justifyContent: "center", bgcolor: "#F2F5F3" }, { children: (candidate === null || candidate === void 0 ? void 0 : candidate.avatar) && !avatarErr ? ((0, jsx_runtime_1.jsx)("img", { src: candidate.avatar, alt: "", onError: function () { return setAvatarErr(true); }, style: { width: '100%', height: '100%', objectFit: 'cover' } })) : ((0, jsx_runtime_1.jsx)(DefaultAvatar, {})) })), (0, jsx_runtime_1.jsx)(mui_1.Box, __assign({ flex: "1 1 auto", minWidth: 0, sx: {
145
145
  background: '#FBFDFC',
146
146
  borderRadius: 2,
147
147
  px: 2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",