eli-video-interview 1.2.41-alpha.39 → 1.2.41-alpha.40

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.
@@ -105,9 +105,11 @@ var BootVideo = function (props) {
105
105
  }
106
106
  },
107
107
  }).run;
108
- var handleSelectVideo = useCallback(function (mediaUrl, thumbUrl) {
109
- setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
110
- }, [setMediaState]);
108
+ var handleSelectVideo = useCallback(function (video) {
109
+ setMediaState(__assign(__assign({}, mediaState), video));
110
+ },
111
+ // eslint-disable-next-line react-hooks/exhaustive-deps
112
+ [mediaState]);
111
113
  var handleSetVideo = useCallback(function (data) {
112
114
  setVirtualManList(virtualManList.map(function (v) {
113
115
  if (v.selected) {
@@ -205,7 +207,7 @@ var BootVideo = function (props) {
205
207
  useEffect(function () {
206
208
  if (open) {
207
209
  getAiInterviewerProfileList();
208
- setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
210
+ setMediaState({ pcUrl: pcUrl, pcThumbUrl: pcThumbUrl, mediaUrl: mediaUrl, thumbUrl: thumbUrl });
209
211
  if (mediaUrl && thumbUrl && mediaUrl !== mediaList[0].videoUrl) {
210
212
  setMediaList(__spreadArray(__spreadArray([], __read(mediaList), false), [
211
213
  {
@@ -214,10 +216,19 @@ var BootVideo = function (props) {
214
216
  },
215
217
  ], false));
216
218
  }
219
+ if (pcUrl && pcThumbUrl && pcUrl !== pcMediaList[0].videoUrl) {
220
+ setPcMediaList(__spreadArray(__spreadArray([], __read(pcMediaList), false), [
221
+ {
222
+ videoUrl: pcUrl,
223
+ frameUrl: pcThumbUrl,
224
+ },
225
+ ], false));
226
+ }
217
227
  }
218
228
  else {
219
- setMediaState({ mediaUrl: '', thumbUrl: '' });
229
+ setMediaState({ mediaUrl: '', thumbUrl: '', pcUrl: '', pcThumbUrl: '' });
220
230
  setMediaList(DEFAULT_GUIDE_VIDEO);
231
+ setPcMediaList(DEFAULT_GUIDE_VIDEO);
221
232
  }
222
233
  // eslint-disable-next-line react-hooks/exhaustive-deps
223
234
  }, [open]);
@@ -246,10 +257,15 @@ var BootVideo = function (props) {
246
257
  borderColor: human.selected ? '#4CAF50' : 'transparent',
247
258
  }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), _jsx(Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken)); }) })), _jsx(Typography, __assign({ variant: "caption", flexWrap: "wrap", color: "disabled", mb: 3 }, { children: (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail.desc) || ((_g = (_f = (_e = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _e === void 0 ? void 0 : _e.interviewerShows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.desc) })), broadcastType !== 3 && (_jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "body2", fontWeight: "medium", mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u64AD\u62A5\u5185\u5BB9" })), _jsx(TextField, { multiline: true, error: (((_h = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _h === void 0 ? void 0 : _h.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, onChange: handleGuidanceText, max: 300 })] }))] })), interviewRoomState.interactType === 1 && (_jsxs(Stack, { children: [_jsxs(Stack, { children: [_jsx(Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), _jsx(Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u79FB\u52A8\u7AEF" })), _jsxs(CustomUploadedImgRoot, { children: [mediaList.map(function (_a) {
248
259
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
249
- return (_jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }, videoUrl));
260
+ return (_jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () {
261
+ return handleSelectVideo({
262
+ mediaUrl: videoUrl,
263
+ thumbUrl: frameUrl,
264
+ });
265
+ } }, videoUrl));
250
266
  }), loading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] }), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [mediaList.length <= 5 && (_jsx(Upload, __assign({}, uploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), mediaList.length > 5 && (_jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), _jsx(Tooltip, __assign({ title: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm", placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) }))] }))] }), _jsxs(Stack, { children: [_jsx(Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u7535\u8111\u7AEF" })), _jsxs(CustomUploadedImgRoot, __assign({ platform: "pc" }, { children: [pcMediaList.map(function (_a) {
251
267
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
252
- return (_jsx(Box, { children: _jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.pcUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }) }, videoUrl));
268
+ return (_jsx(Box, { children: _jsx("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.pcUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo({ pcUrl: videoUrl, pcThumbUrl: frameUrl }); } }) }, videoUrl));
253
269
  }), pcLoading && _jsx(Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), _jsxs(Stack, __assign({ direction: "row", alignItems: "center" }, { children: [_jsxs(CustomUploadButtonRoot, { children: [pcMediaList.length <= 5 && (_jsx(Upload, __assign({}, pcUploadProps, { children: _jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), pcMediaList.length > 5 && (_jsx(Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: _jsx(AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), _jsx(Tooltip, __assign({ title: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm", placement: "bottom-start" }, { children: _jsx(Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: _jsx(InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) })), _jsx(Box, __assign({ ml: 2 }, { children: _jsx(Checkbox, { checked: mediaState.appliedAllPosition, label: _jsx(Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] })] }))] })) })) }) })));
254
270
  };
255
271
  export default BootVideo;
@@ -110,9 +110,11 @@ var BootVideo = function (props) {
110
110
  }
111
111
  },
112
112
  }).run;
113
- var handleSelectVideo = (0, react_1.useCallback)(function (mediaUrl, thumbUrl) {
114
- setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
115
- }, [setMediaState]);
113
+ var handleSelectVideo = (0, react_1.useCallback)(function (video) {
114
+ setMediaState(__assign(__assign({}, mediaState), video));
115
+ },
116
+ // eslint-disable-next-line react-hooks/exhaustive-deps
117
+ [mediaState]);
116
118
  var handleSetVideo = (0, react_1.useCallback)(function (data) {
117
119
  setVirtualManList(virtualManList.map(function (v) {
118
120
  if (v.selected) {
@@ -210,7 +212,7 @@ var BootVideo = function (props) {
210
212
  (0, react_1.useEffect)(function () {
211
213
  if (open) {
212
214
  getAiInterviewerProfileList();
213
- setMediaState({ mediaUrl: mediaUrl, thumbUrl: thumbUrl });
215
+ setMediaState({ pcUrl: pcUrl, pcThumbUrl: pcThumbUrl, mediaUrl: mediaUrl, thumbUrl: thumbUrl });
214
216
  if (mediaUrl && thumbUrl && mediaUrl !== mediaList[0].videoUrl) {
215
217
  setMediaList(__spreadArray(__spreadArray([], __read(mediaList), false), [
216
218
  {
@@ -219,10 +221,19 @@ var BootVideo = function (props) {
219
221
  },
220
222
  ], false));
221
223
  }
224
+ if (pcUrl && pcThumbUrl && pcUrl !== pcMediaList[0].videoUrl) {
225
+ setPcMediaList(__spreadArray(__spreadArray([], __read(pcMediaList), false), [
226
+ {
227
+ videoUrl: pcUrl,
228
+ frameUrl: pcThumbUrl,
229
+ },
230
+ ], false));
231
+ }
222
232
  }
223
233
  else {
224
- setMediaState({ mediaUrl: '', thumbUrl: '' });
234
+ setMediaState({ mediaUrl: '', thumbUrl: '', pcUrl: '', pcThumbUrl: '' });
225
235
  setMediaList(ai_question_1.DEFAULT_GUIDE_VIDEO);
236
+ setPcMediaList(ai_question_1.DEFAULT_GUIDE_VIDEO);
226
237
  }
227
238
  // eslint-disable-next-line react-hooks/exhaustive-deps
228
239
  }, [open]);
@@ -251,10 +262,15 @@ var BootVideo = function (props) {
251
262
  borderColor: human.selected ? '#4CAF50' : 'transparent',
252
263
  }, height: 100, alt: "", onClick: function () { return handleSelectHumanType(human); } }), (0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "body2", textAlign: "center" }, { children: human.name }))] }, human.humanToken)); }) })), (0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "caption", flexWrap: "wrap", color: "disabled", mb: 3 }, { children: (virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail.desc) || ((_g = (_f = (_e = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.detail) === null || _e === void 0 ? void 0 : _e.interviewerShows) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.desc) })), broadcastType !== 3 && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "body2", fontWeight: "medium", mb: 2 }, { children: "\u5F15\u5BFC\u89C6\u9891\u64AD\u62A5\u5185\u5BB9" })), (0, jsx_runtime_1.jsx)(fbm_ui_2.TextField, { multiline: true, error: (((_h = virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText) === null || _h === void 0 ? void 0 : _h.length) || 0) > 300, rows: 3, placeholder: "\u8BF7\u8F93\u5165\u6587\u672C\u6846\u5185\u5BB9\uFF0C\u82E5\u4E0D\u586B\uFF0C\u5219\u5728\u9762\u8BD5\u95F4\u4E0D\u5C55\u793A\u8BE5\u6587\u672C\u6846\u3002", value: virtualMan === null || virtualMan === void 0 ? void 0 : virtualMan.guidanceText, onChange: handleGuidanceText, max: 300 })] }))] })), interviewRoomState.interactType === 1 && ((0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ fontSize: "14px", variant: "body1", fontWeight: 500, mt: 2, mb: 1 }, { children: "\u5F15\u5BFC\u89C6\u9891" })), (0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u79FB\u52A8\u7AEF" })), (0, jsx_runtime_1.jsxs)(styled_1.CustomUploadedImgRoot, { children: [mediaList.map(function (_a) {
253
264
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
254
- return ((0, jsx_runtime_1.jsx)("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }, videoUrl));
265
+ return ((0, jsx_runtime_1.jsx)("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.mediaUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () {
266
+ return handleSelectVideo({
267
+ mediaUrl: videoUrl,
268
+ thumbUrl: frameUrl,
269
+ });
270
+ } }, videoUrl));
255
271
  }), loading && (0, jsx_runtime_1.jsx)(fbm_ui_2.Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsxs)(styled_1.CustomUploadButtonRoot, { children: [mediaList.length <= 5 && ((0, jsx_runtime_1.jsx)(fbm_ui_2.Upload, __assign({}, uploadProps, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_2.AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), mediaList.length > 5 && ((0, jsx_runtime_1.jsx)(fbm_ui_2.Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_2.AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), (0, jsx_runtime_1.jsx)(mui_1.Tooltip, __assign({ title: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm", placement: "bottom-start" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) }))] }))] }), (0, jsx_runtime_1.jsxs)(mui_1.Stack, { children: [(0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "caption", mb: 2 }, { children: "\u7535\u8111\u7AEF" })), (0, jsx_runtime_1.jsxs)(styled_1.CustomUploadedImgRoot, __assign({ platform: "pc" }, { children: [pcMediaList.map(function (_a) {
256
272
  var videoUrl = _a.videoUrl, frameUrl = _a.frameUrl;
257
- return ((0, jsx_runtime_1.jsx)(fbm_ui_2.Box, { children: (0, jsx_runtime_1.jsx)("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.pcUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo(videoUrl, frameUrl); } }) }, videoUrl));
273
+ return ((0, jsx_runtime_1.jsx)(fbm_ui_2.Box, { children: (0, jsx_runtime_1.jsx)("img", { src: frameUrl, style: { borderColor: (mediaState === null || mediaState === void 0 ? void 0 : mediaState.pcUrl) === videoUrl ? '#4CAF50' : 'transparent' }, height: 100, alt: "", onClick: function () { return handleSelectVideo({ pcUrl: videoUrl, pcThumbUrl: frameUrl }); } }) }, videoUrl));
258
274
  }), pcLoading && (0, jsx_runtime_1.jsx)(fbm_ui_2.Box, { height: 100, loading: { size: 24, loading: true, isMask: true } })] })), (0, jsx_runtime_1.jsxs)(mui_1.Stack, __assign({ direction: "row", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsxs)(styled_1.CustomUploadButtonRoot, { children: [pcMediaList.length <= 5 && ((0, jsx_runtime_1.jsx)(fbm_ui_2.Upload, __assign({}, pcUploadProps, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_2.AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })) }))), pcMediaList.length > 5 && ((0, jsx_runtime_1.jsx)(fbm_ui_2.Button, __assign({ variant: "outlined", disabled: mediaList.length > 5, color: "inherit", icon: (0, jsx_runtime_1.jsx)(fbm_ui_2.AddIcon, {}) }, { children: "\u4E0A\u4F20\u89C6\u9891" })))] }), (0, jsx_runtime_1.jsx)(mui_1.Tooltip, __assign({ title: "\u5EFA\u8BAE\u4E0A\u4F20mp4\u683C\u5F0F\uFF0C\u5927\u5C0F\u4E0D\u8981\u8D85\u8FC7500M\uFF0C\u6700\u591A\u652F\u6301\u4E0A\u4F205\u4E2A\uFF0C\u652F\u6301\u89C6\u9891\u683C\u5F0F\uFF1Amp4\u3001mov\u3001m4v\u30013gp\u3001avi\u3001webm", placement: "bottom-start" }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.Box, __assign({ display: "flex", alignItems: "center", sx: { ml: 1 } }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_2.InfoOutlineIcon, { sx: { color: 'rgba(0, 0, 0, 0.56)', fontSize: 16 } }) })) })), (0, jsx_runtime_1.jsx)(fbm_ui_2.Box, __assign({ ml: 2 }, { children: (0, jsx_runtime_1.jsx)(fbm_ui_1.Checkbox, { checked: mediaState.appliedAllPosition, label: (0, jsx_runtime_1.jsx)(fbm_ui_2.Typography, __assign({ variant: "body2" }, { children: "\u5E94\u7528\u5230\u6240\u6709AI\u89C6\u9891" })), onChange: function (e, checked) { return setMediaState({ appliedAllPosition: checked }); } }) }))] }))] })] }))] })) })) }) })));
259
275
  };
260
276
  exports.default = BootVideo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eli-video-interview",
3
- "version": "1.2.41-alpha.39",
3
+ "version": "1.2.41-alpha.40",
4
4
  "description": "鳄梨科技 AI视频面试 React SDK",
5
5
  "author": "鳄梨科技",
6
6
  "license": "MIT",