@myinterview/widget-react 1.1.55-development-08dc601 → 1.1.57-beta-7a63e4c

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/dist/esm/index.js CHANGED
@@ -35449,7 +35449,7 @@ const configGenerator = () => {
35449
35449
  let release;
35450
35450
  try {
35451
35451
  environment !== null && environment !== void 0 ? environment : (environment = "staging");
35452
- release !== null && release !== void 0 ? release : (release = "1.1.55");
35452
+ release !== null && release !== void 0 ? release : (release = "1.1.57");
35453
35453
  }
35454
35454
  catch (_a) {
35455
35455
  console.error('sentry configGenerator error');
@@ -45738,26 +45738,36 @@ const AssessmentFreeText = ({ onAnswer, maxChars = DEFAULT_ASSESSMENT_MAX_CHARS,
45738
45738
  React__default.createElement(CharactersLimit, { currentLength: answerInput.length, maxLength: maxChars }))));
45739
45739
  };
45740
45740
 
45741
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
45741
45742
  const AssessmentMultiSelect = ({ answerOptions, onAnswer }) => {
45742
45743
  const [selectedAnswersIds, setSelectedAnswersIds] = useState(answerOptions.map((answer) => (Object.assign(Object.assign({}, answer), { selected: false }))));
45743
45744
  const handleChange = (e) => {
45744
45745
  const { value, checked } = e.target;
45745
45746
  setSelectedAnswersIds((prev) => prev.map((answer) => (answer.id !== value ? answer : Object.assign(Object.assign({}, answer), { selected: checked }))));
45746
45747
  };
45748
+ const handleChangeByKeyboard = (id) => {
45749
+ setSelectedAnswersIds((prev) => prev.map((answer) => (answer.id !== id ? answer : Object.assign(Object.assign({}, answer), { selected: !answer.selected }))));
45750
+ };
45747
45751
  useEffect(() => {
45748
45752
  onAnswer(selectedAnswersIds);
45749
45753
  }, [selectedAnswersIds]);
45750
45754
  return (React__default.createElement("div", { className: "myinterview-widget-assessment__multi-select" },
45751
- React__default.createElement("form", { className: "myinterview-widget-assessment__options-form", style: { display: 'flex', flexDirection: 'column' } }, selectedAnswersIds.map((answer) => (React__default.createElement("label", { key: answer.id, className: "myinterview-widget-assessment__option myinterview-text--S" },
45752
- React__default.createElement(nr, { inputAttributs: {
45755
+ React__default.createElement("form", { className: "myinterview-widget-assessment__options-form", style: { display: 'flex', flexDirection: 'column' } }, selectedAnswersIds.map((answer) => (React__default.createElement("label", { key: answer.id, className: "myinterview-widget-assessment__option myinterview-text--S", tabIndex: 0, htmlFor: `multi-answer-${answer.id}`, onKeyDown: (e) => {
45756
+ if (e.key === 'Enter' || e.key === ' ') {
45757
+ handleChangeByKeyboard(answer.id);
45758
+ }
45759
+ } },
45760
+ React__default.createElement(nr, { id: `multi-answer-${answer.id}`, inputAttributs: {
45753
45761
  name: 'multi-answer',
45754
45762
  value: answer.id,
45755
45763
  checked: answer.selected,
45764
+ tabIndex: -1,
45756
45765
  onChange: handleChange,
45757
45766
  }, checked: answer.selected }),
45758
45767
  React__default.createElement(Qe, { size: "S-Regular" }, answer.label)))))));
45759
45768
  };
45760
45769
 
45770
+ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
45761
45771
  const AssessmentSingleSelect = ({ answerOptions, onAnswer }) => {
45762
45772
  const [selectedAnswer, setSelectedAnswer] = useState(answerOptions.map((answer) => (Object.assign(Object.assign({}, answer), { selected: false }))));
45763
45773
  const handleChange = (e) => {
@@ -45765,9 +45775,21 @@ const AssessmentSingleSelect = ({ answerOptions, onAnswer }) => {
45765
45775
  setSelectedAnswer(_answers);
45766
45776
  onAnswer(_answers);
45767
45777
  };
45778
+ const handleChangeByKeyboard = (e, id) => {
45779
+ var _a;
45780
+ const el = e.target;
45781
+ if ('control' in el) {
45782
+ // @ts-ignore
45783
+ (_a = el.control) === null || _a === void 0 ? void 0 : _a.click();
45784
+ }
45785
+ };
45768
45786
  return (React__default.createElement("div", { className: "myinterview-widget-assessment__single-select" },
45769
- React__default.createElement("form", { className: "myinterview-widget-assessment__options-form", onChange: handleChange }, selectedAnswer.map((answer) => (React__default.createElement("label", { key: answer.id, className: "myinterview-widget-assessment__option myinterview-text--S" },
45770
- React__default.createElement("input", { type: "radio", name: "single-answer", value: answer.id, hidden: true }),
45787
+ React__default.createElement("form", { className: "myinterview-widget-assessment__options-form", onChange: handleChange }, selectedAnswer.map((answer) => (React__default.createElement("label", { key: answer.id, className: "myinterview-widget-assessment__option myinterview-text--S", tabIndex: 0, htmlFor: `single-answer-${answer.id}`, onKeyDown: (e) => {
45788
+ if (e.key === 'Enter' || e.key === ' ') {
45789
+ handleChangeByKeyboard(e, answer.id);
45790
+ }
45791
+ } },
45792
+ React__default.createElement("input", { type: "radio", name: "single-answer", value: answer.id, hidden: true, id: `single-answer-${answer.id}` }),
45771
45793
  React__default.createElement("div", { className: `myinterview-widget-assessment__checkmark ${answer.selected ? 'myinterview-widget-assessment__checkmark--selected' : ''}` },
45772
45794
  React__default.createElement(Ae, null)),
45773
45795
  React__default.createElement(Qe, { size: "S-Regular" }, answer.label)))))));
@@ -45812,9 +45834,8 @@ const AssessmentController = ({ currentQuestionObj, timer, currentQuestion, numb
45812
45834
  React__default.createElement(CountDown, { countDown: timer, forceMobileCounter: true, numberOfSecondsToHighlight: SECONDS_LEFT_HIGHLIGHT }))),
45813
45835
  React__default.createElement(Question, { questionObj: currentQuestionObj }),
45814
45836
  React__default.createElement(AnswerInstructions, { currentQuestionObj: currentQuestionObj }),
45815
- React__default.createElement("form", { onSubmit: (e) => { e.preventDefault(); onSubmit(false); } },
45816
- React__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) })),
45817
- React__default.createElement(C, { type: "submit", disabled: !isValidAnswer, className: "myinterview-widget-assessment__submit-button" }, t('buttons.SUBMIT')))));
45837
+ React__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) })),
45838
+ React__default.createElement(C, { disabled: !isValidAnswer, className: "myinterview-widget-assessment__submit-button", onClick: () => onSubmit(false), type: "button" }, t('buttons.SUBMIT'))));
45818
45839
  };
45819
45840
 
45820
45841
  const TimesUp = ({ onContinue }) => {
@@ -55399,7 +55420,7 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
55399
55420
  return e;
55400
55421
  };
55401
55422
  const handleEscape = (e) => {
55402
- if (e.key === 'Escape' && config.minimizable) {
55423
+ if (e.key === 'Escape' && config.minimizable && !isInterviewState) {
55403
55424
  onMinimize();
55404
55425
  }
55405
55426
  };
@@ -55572,6 +55593,7 @@ const useAccessibility = () => {
55572
55593
  useEffect(() => {
55573
55594
  if (sitekey) {
55574
55595
  const position = window.innerWidth <= 800 ? 'Right' : 'Left';
55596
+ 'interdeal' in window && delete window.interdeal;
55575
55597
  // @ts-ignore
55576
55598
  window.interdeal = {
55577
55599
  sitekey,
@@ -55608,8 +55630,8 @@ const useAccessibility = () => {
55608
55630
  var _a;
55609
55631
  (_a = scriptEl.current) === null || _a === void 0 ? void 0 : _a.remove();
55610
55632
  scriptEl.current = null;
55611
- document.querySelectorAll('[id^="IND"]').forEach((el) => el.remove());
55612
- 'interdeal' in window && delete window.interdeal;
55633
+ // document.querySelectorAll('[id^="IND"]').forEach((el) => el.remove());
55634
+ // 'interdeal' in window && delete window.interdeal;
55613
55635
  };
55614
55636
  }, [sitekey]);
55615
55637
  const shutdown = () => setSitekey('');
@@ -55624,7 +55646,7 @@ const FOCUSABLE_SELECTORS = Object.freeze([
55624
55646
  'a[href]', 'button:not([disabled]):not([tabindex="-1"])', 'textarea', 'input', 'select', '[tabindex]:not([tabindex="-1"])',
55625
55647
  ]);
55626
55648
  const Widget = forwardRef(({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }, clientRef) => {
55627
- const widget_version = "1.1.55";
55649
+ const widget_version = "1.1.57";
55628
55650
  const [isWidgetOpen, setIsWidgetOpen] = useState(false);
55629
55651
  const [isWidgetMinimized, setIsWidgetMinimized] = useState(false);
55630
55652
  const [isIncognitoMode, setIsIncognitoMode] = useState(false);