@myinterview/widget-react 1.0.4 → 1.0.5
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/README.md +2 -2
- package/dist/esm/components/Widget.d.ts +2 -2
- package/dist/esm/index.js +9 -7
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/configInterface.d.ts +10 -3
- package/dist/esm/interfaces/jobInterface.d.ts +8 -0
- package/dist/esm/utils/constants.utils.d.ts +3 -1
- package/dist/index.d.ts +18 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ import React from 'react';
|
|
|
27
27
|
import { Widget } from '@myinterview/widget-react';
|
|
28
28
|
|
|
29
29
|
const App = () => {
|
|
30
|
-
const
|
|
30
|
+
const onFinish = () => {
|
|
31
31
|
//...
|
|
32
32
|
}
|
|
33
33
|
const onError = () => {
|
|
@@ -38,7 +38,7 @@ const App = () => {
|
|
|
38
38
|
<Widget
|
|
39
39
|
job={{ job_id: "xxxxxxxxxxxxxxxxxx" }}
|
|
40
40
|
candidate={{ email: "test@mail.com", username: "Max" }}
|
|
41
|
-
config={{
|
|
41
|
+
config={{ onFinish, onError,
|
|
42
42
|
auth: "apikey xxxxxxxxxxxxxxxxx sig=xxxxxxxxxxxxxxxxxxxxxxxxxx" }}
|
|
43
43
|
/>
|
|
44
44
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { IClientWidgetConfig } from '../interfaces/configInterface';
|
|
3
3
|
import '../assets/styles/global.scss';
|
|
4
4
|
import { getToken } from '../utils/authToken.utils';
|
|
5
|
-
export declare const Widget: React.FC<
|
|
5
|
+
export declare const Widget: React.FC<IClientWidgetConfig>;
|
|
6
6
|
export { getToken };
|
package/dist/esm/index.js
CHANGED
|
@@ -28122,7 +28122,9 @@ const VideoTimeBar = ({ duration, currentTime, isThinkingTime, onChangeTime, })
|
|
|
28122
28122
|
|
|
28123
28123
|
const DEFAULT_COUNT_DOWN = 3; // seconds
|
|
28124
28124
|
const DEFAULT_DURATION = 60; // seconds
|
|
28125
|
-
const
|
|
28125
|
+
const DEFAULT_ATTEMPTS = 3; // number of attempts
|
|
28126
|
+
const DEFAULT_THINKING_TIME = 0; // seconds
|
|
28127
|
+
const ENOUGH_RECORDING_TIME = 3; // seconds
|
|
28126
28128
|
const SPEED_TEST_FILE_SIZE = 5; // MB
|
|
28127
28129
|
const FAST_UPLOAD_SPEED = 0.35; // MB/s
|
|
28128
28130
|
const SLOW_UPLOAD_SPEED = 0.1; // MB/s
|
|
@@ -28384,10 +28386,10 @@ const InnerView = React__default.forwardRef(({ widgetMachine, sendToWidget, reco
|
|
|
28384
28386
|
previewRef && isPreviewState && (React__default.createElement(PreviewList, { previewRef: previewRef, onNextQuestion: onNextQuestion, onNextRetake: onNextRetake, onQuestionMode: onQuestionMode, isRetakeAvailable: isRetakeAvailable, totalRetakes: totalRetakes, isQuestionMode: isQuestionMode, isLastQuestion: isLastQuestion, isConnected: isConnected, currentQuestion: currentQuestion, numberOfQuestions: questions.length })),
|
|
28385
28387
|
canStartRecording && (React__default.createElement(StartRecordingButton, { onClick: () => sendToWidget(EVENTS$4.NEXT_STEP), disabled: !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion) && !isQuestionVideoWatched && isVideoQuestionState, isExplanationState: isExplanationState, isVideoQuestionState: isVideoQuestionState, isVideoQuestion: !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion) })),
|
|
28386
28388
|
isCountDown && countdown > DEFAULT_COUNT_DOWN && (React__default.createElement(StartNowButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.FORCE_START) })),
|
|
28387
|
-
(isRecording && !RecorderError) && (React__default.createElement(StopRecordingButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.STOP_RECORDING), disabled: recordingTime <
|
|
28389
|
+
(isRecording && !RecorderError) && (React__default.createElement(StopRecordingButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.STOP_RECORDING), disabled: recordingTime < ENOUGH_RECORDING_TIME })))),
|
|
28388
28390
|
canStartRecording && (React__default.createElement(StartRecordingButton, { onClick: () => sendToWidget(EVENTS$4.NEXT_STEP), disabled: !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion) && !isQuestionVideoWatched && isVideoQuestionState, isExplanationState: isExplanationState, isVideoQuestionState: isVideoQuestionState, isVideoQuestion: !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion) })),
|
|
28389
28391
|
isCountDown && countdown > DEFAULT_COUNT_DOWN && (React__default.createElement(StartNowButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.FORCE_START) })),
|
|
28390
|
-
isRecording && (React__default.createElement(StopRecordingButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.STOP_RECORDING), disabled: recordingTime <
|
|
28392
|
+
isRecording && (React__default.createElement(StopRecordingButton, { onClick: () => sendToRecorder(RECORDER_EVENTS.STOP_RECORDING), disabled: recordingTime < ENOUGH_RECORDING_TIME }))));
|
|
28391
28393
|
});
|
|
28392
28394
|
|
|
28393
28395
|
var VIDEO_STATUS;
|
|
@@ -33399,7 +33401,7 @@ const Main = ({ widgetConfig, setShouldShowWaterMark }) => {
|
|
|
33399
33401
|
useEffect(() => {
|
|
33400
33402
|
var _a, _b;
|
|
33401
33403
|
if (machine.done) {
|
|
33402
|
-
(_b = (_a = widgetConfig.config).
|
|
33404
|
+
(_b = (_a = widgetConfig.config).onFinish) === null || _b === void 0 ? void 0 : _b.call(_a, { redirectUrl: candidate.redirectUrl, video_id: (video === null || video === void 0 ? void 0 : video.video_id) || '' });
|
|
33403
33405
|
}
|
|
33404
33406
|
}, [machine.done]);
|
|
33405
33407
|
useEffect(() => {
|
|
@@ -40517,7 +40519,7 @@ const Widget = ({ candidate, job, video, config: config$1, disabled = false, but
|
|
|
40517
40519
|
};
|
|
40518
40520
|
const onInterviewCompleted = (data) => {
|
|
40519
40521
|
var _a;
|
|
40520
|
-
(_a = config$1.
|
|
40522
|
+
(_a = config$1.onFinish) === null || _a === void 0 ? void 0 : _a.call(config$1, data);
|
|
40521
40523
|
onCloseWidget();
|
|
40522
40524
|
};
|
|
40523
40525
|
const onError = (data) => {
|
|
@@ -40554,8 +40556,8 @@ const Widget = ({ candidate, job, video, config: config$1, disabled = false, but
|
|
|
40554
40556
|
(!isSupportedDevice || isIncognitoMode) && React__default.createElement(UnsupportedModal, { messageType: !isSupportedIosDevice ? 'IOS' : !isSupportedDevice ? 'BROWSER' : 'INCOGNITO' }),
|
|
40555
40557
|
isSupportedDevice && (React__default.createElement("div", { className: "myinterview-widget__wrapper" },
|
|
40556
40558
|
React__default.createElement(Main, { widgetConfig: {
|
|
40557
|
-
config: Object.assign(Object.assign({}, config$1), {
|
|
40558
|
-
job,
|
|
40559
|
+
config: Object.assign(Object.assign({}, config$1), { onFinish: onInterviewCompleted, onError, practiceQuestions: config$1.practiceQuestions.map((q) => (Object.assign(Object.assign({}, q), { numOfRetakes: q.attempts || DEFAULT_ATTEMPTS, partDuration: q.duration || DEFAULT_DURATION, thinkingTime: q.thinkingTime || DEFAULT_THINKING_TIME }))) }),
|
|
40560
|
+
job: Object.assign(Object.assign({}, job), { questions: job.questions.map((q) => (Object.assign(Object.assign({}, q), { numOfRetakes: q.attempts || DEFAULT_ATTEMPTS, partDuration: q.duration || DEFAULT_DURATION, thinkingTime: q.thinkingTime || DEFAULT_THINKING_TIME }))) }),
|
|
40559
40561
|
video,
|
|
40560
40562
|
candidate,
|
|
40561
40563
|
}, setShouldShowWaterMark: setShouldShowWaterMark })))))))));
|