@myinterview/widget-react 1.1.47 → 1.1.49-development-4577eb9

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.
@@ -6,6 +6,7 @@ interface IProps {
6
6
  currentQuestion: number;
7
7
  numberOfQuestions: number;
8
8
  timer: number;
9
+ antiCheat: boolean;
9
10
  onSubmitAssessment: (answer: IMultipleAnswer[] | string, isValidAnswer: boolean) => void;
10
11
  }
11
12
  export declare const AssessmentController: React.FC<IProps>;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface IProps {
3
3
  onAnswer: (answer: string) => void;
4
4
  maxChars?: number;
5
+ antiCheat?: boolean;
5
6
  }
6
7
  export declare const AssessmentFreeText: React.FC<IProps>;
7
8
  export {};
package/dist/cjs/index.js CHANGED
@@ -35453,7 +35453,7 @@ const prod_config = {
35453
35453
  const config$1 = (configEnv) => {
35454
35454
  let env = configEnv;
35455
35455
  try {
35456
- env !== null && env !== void 0 ? env : (env = "prod");
35456
+ env !== null && env !== void 0 ? env : (env = "staging");
35457
35457
  }
35458
35458
  catch (_a) { }
35459
35459
  switch (env) {
@@ -35472,8 +35472,8 @@ const configGenerator = () => {
35472
35472
  let environment;
35473
35473
  let release;
35474
35474
  try {
35475
- environment !== null && environment !== void 0 ? environment : (environment = "prod");
35476
- release !== null && release !== void 0 ? release : (release = "1.1.47");
35475
+ environment !== null && environment !== void 0 ? environment : (environment = "staging");
35476
+ release !== null && release !== void 0 ? release : (release = "1.1.49");
35477
35477
  }
35478
35478
  catch (_a) {
35479
35479
  console.error('sentry configGenerator error');
@@ -45254,9 +45254,14 @@ const CharactersLimit = ({ currentLength, maxLength }) => (React__default["defau
45254
45254
  ' ',
45255
45255
  maxLength));
45256
45256
 
45257
- const AssessmentFreeText = ({ onAnswer, maxChars = DEFAULT_ASSESSMENT_MAX_CHARS }) => {
45257
+ const AssessmentFreeText = ({ onAnswer, maxChars = DEFAULT_ASSESSMENT_MAX_CHARS, antiCheat = false }) => {
45258
45258
  const { t } = useTranslation();
45259
45259
  const [answerInput, setAnswerInput] = React.useState('');
45260
+ const handlePaste = (e) => {
45261
+ if (antiCheat) {
45262
+ e.preventDefault();
45263
+ }
45264
+ };
45260
45265
  const handleChange = (e) => {
45261
45266
  const val = e.target.value;
45262
45267
  const valToSet = maxChars && val.length > maxChars ? val.substring(0, maxChars) : val;
@@ -45264,7 +45269,7 @@ const AssessmentFreeText = ({ onAnswer, maxChars = DEFAULT_ASSESSMENT_MAX_CHARS
45264
45269
  onAnswer(valToSet);
45265
45270
  };
45266
45271
  return (React__default["default"].createElement("div", { className: "myinterview-widget-assessment__free-text" },
45267
- React__default["default"].createElement("textarea", { className: "myinterview-widget-assessment__input myinterview-widget-scroll-indicator", value: answerInput, placeholder: t('assessment.free_text.input_placeholder'), onChange: handleChange }),
45272
+ React__default["default"].createElement("textarea", { className: "myinterview-widget-assessment__input myinterview-widget-scroll-indicator", value: answerInput, placeholder: t('assessment.free_text.input_placeholder'), onPaste: handlePaste, onDrop: handlePaste, onChange: handleChange }),
45268
45273
  !!maxChars && React__default["default"].createElement(CharactersLimit, { currentLength: answerInput.length, maxLength: maxChars })));
45269
45274
  };
45270
45275
 
@@ -45303,8 +45308,8 @@ const ANSWER_COMPONENTS = {
45303
45308
  [ANSWER_TYPES.SINGLE]: AssessmentSingleSelect,
45304
45309
  [ANSWER_TYPES.MULTIPLE]: AssessmentMultiSelect,
45305
45310
  };
45306
- const AssessmentController = ({ currentQuestionObj, timer, currentQuestion, numberOfQuestions, onSubmitAssessment }) => {
45307
- var _a, _b;
45311
+ const AssessmentController = ({ currentQuestionObj, timer, currentQuestion, numberOfQuestions, antiCheat, onSubmitAssessment }) => {
45312
+ var _a, _b, _c;
45308
45313
  const { t } = useTranslation();
45309
45314
  const answerToSubmit = React.useRef(currentQuestionObj.answerType !== ANSWER_TYPES.TEXT ? [] : '');
45310
45315
  const AnswerComponent = React.useMemo(() => ANSWER_COMPONENTS[currentQuestionObj.answerType], [currentQuestionObj.answerType]);
@@ -45337,7 +45342,7 @@ const AssessmentController = ({ currentQuestionObj, timer, currentQuestion, numb
45337
45342
  React__default["default"].createElement(CountDown, { countDown: timer, forceMobileCounter: true, numberOfSecondsToHighlight: SECONDS_LEFT_HIGHLIGHT }))),
45338
45343
  React__default["default"].createElement(Question, { questionObj: currentQuestionObj }),
45339
45344
  React__default["default"].createElement(AnswerInstructions, { currentQuestionObj: currentQuestionObj }),
45340
- React__default["default"].createElement(AnswerComponent, Object.assign({ answerOptions: answerOptions, onAnswer: onAnswer }, (currentQuestionObj.answerType === ANSWER_TYPES.TEXT) && { maxChars: (_b = currentQuestionObj.config) === null || _b === void 0 ? void 0 : _b.maxChars })),
45345
+ React__default["default"].createElement(AnswerComponent, Object.assign({ answerOptions: answerOptions, onAnswer: onAnswer }, (currentQuestionObj.answerType === ANSWER_TYPES.TEXT) && { maxChars: (_b = currentQuestionObj.config) === null || _b === void 0 ? void 0 : _b.maxChars, antiCheat: antiCheat || ((_c = currentQuestionObj.config) === null || _c === void 0 ? void 0 : _c.antiCheat) })),
45341
45346
  React__default["default"].createElement(C, { disabled: !isValidAnswer, className: "myinterview-widget-assessment__submit-button", onClick: () => onSubmit(false) }, t('buttons.SUBMIT'))));
45342
45347
  };
45343
45348
 
@@ -45486,7 +45491,7 @@ const InnerView = React__default["default"].forwardRef(({ widgetMachine, sendToW
45486
45491
  isExplanationState && (React__default["default"].createElement(Explanation, { isVideoQuestion: !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion), isAssessment: isAssessment, timeLimit: isAssessment ? currentQuestionObj.partDuration : currentQuestionObj.thinkingTime, answerType: currentQuestionObj.answerType || ANSWER_TYPES.VIDEO, duration: currentQuestionObj.partDuration, takes: currentQuestionObj.numOfRetakes })),
45487
45492
  React__default["default"].createElement(VideoCamera, { recordWithoutVideo: recordWithoutVideo, myinterviewRef: myinterviewRef, ref: videoRef, microphoneRef: microphoneRef, isCameraDisplayed: isCameraDisplayed, isPracticeModeDisplayed: !isQuestionMode && isRecording, errorType: errorType, isPermissionStepsOpen: isSliderModalOpen, onDisplayPermissionSteps: onOpenSliderModal, onReInitRecorder: onReInitRecorder, onClosePermissionSteps: onCloseSliderModal, onRecorderRetry: isSetupState ? onRecorderRetry : onReInitRecorder, isRecorderCanChangeSettings: isRecorderCanChangeSettings, videoDevices: videoDevices, audioDevices: audioDevices, selectedVideoDevice: selectedVideoDevice, selectedAudioDevice: selectedAudioDevice, handleDeviceChange: handleDeviceChange, canStartRecording: canStartRecording, currentQuestion: currentQuestion, numberOfQuestions: questions.length, currentQuestionObj: currentQuestionObj, isRecording: isRecording, durations: durations, recordingTime: recordingTime, isCountDown: isCountDown, countdown: countdown, isQuestionDisplayed: isQuestionDisplayed, isAssessment: isAssessment }),
45488
45493
  isAssessmentState && !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.answerType) && (currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.answerType) !== ANSWER_TYPES.VIDEO
45489
- && (React__default["default"].createElement(AssessmentController, { currentQuestionObj: currentQuestionObj, timer: timer, currentQuestion: currentQuestion, numberOfQuestions: questions.length, onSubmitAssessment: onSubmitAssessment })),
45494
+ && (React__default["default"].createElement(AssessmentController, { currentQuestionObj: currentQuestionObj, timer: timer, currentQuestion: currentQuestion, numberOfQuestions: questions.length, onSubmitAssessment: onSubmitAssessment, antiCheat: !!widgetConfig.config.antiCheat })),
45490
45495
  isTimesUpState && React__default["default"].createElement(TimesUp, { onContinue: onContinue }),
45491
45496
  (isVideoQuestionState || (isExplanationState && !!(currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion))) && (React__default["default"].createElement(VideoQuestion, { src: (currentQuestionObj === null || currentQuestionObj === void 0 ? void 0 : currentQuestionObj.videoQuestion) || '', isThinkingTime: isThinkingTime, onVideoEnds: onVideoEnds, isWidgetMinimized: isWidgetMinimized, hidden: isExplanationState, onVideoStateChanged: onVideoStateChanged })),
45492
45497
  previewRef && isPreviewState && (React__default["default"].createElement(PreviewList, { myinterviewRef: myinterviewRef, previewRef: previewRef, onNextQuestion: onNextQuestion, onNextRetake: onNextRetake, onQuestionMode: onQuestionMode, isRetakeAvailable: isRetakeAvailable, totalRetakes: totalRetakes, isQuestionMode: isQuestionMode, isLastQuestion: isLastQuestion, isConnected: isConnected, currentQuestion: currentQuestion, numberOfQuestions: questions.length })),
@@ -55112,7 +55117,7 @@ const DivComponent = React__default["default"].forwardRef((_a, ref) => {
55112
55117
  return React__default["default"].createElement("div", Object.assign({ ref: ref }, props), children);
55113
55118
  });
55114
55119
  const Widget = React.forwardRef(({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }, clientRef) => {
55115
- const widget_version = "1.1.47";
55120
+ const widget_version = "1.1.49";
55116
55121
  const [isWidgetOpen, setIsWidgetOpen] = React.useState(false);
55117
55122
  const [isWidgetMinimized, setIsWidgetMinimized] = React.useState(false);
55118
55123
  const [isIncognitoMode, setIsIncognitoMode] = React.useState(false);