@myinterview/widget-react 1.1.25-development-aadf19b → 1.1.26-development-081afbd

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.
@@ -1,3 +1,6 @@
1
1
  import React from 'react';
2
- import { IClientWidgetConfig } from '../interfaces/configInterface';
3
- export declare const Widget: React.FC<IClientWidgetConfig>;
2
+ import { IWidgetRef } from '../interfaces/configInterface';
3
+ export declare const Widget: React.ForwardRefExoticComponent<Omit<import("../interfaces/configInterface").IWidgetConfig, "config" | "event_id" | "job"> & {
4
+ job: import("../interfaces/jobInterface").IClientJob;
5
+ config: import("../interfaces/configInterface").IClientConfig;
6
+ } & React.RefAttributes<IWidgetRef>>;
@@ -1,4 +1,4 @@
1
1
  import { Widget } from './components/Widget';
2
- import { IWidgetConfig, IClientWidgetConfig } from './interfaces/configInterface';
2
+ import { IWidgetConfig, IClientWidgetConfig, IWidgetRef } from './interfaces/configInterface';
3
3
  export { Widget };
4
- export type { IWidgetConfig, IClientWidgetConfig };
4
+ export type { IWidgetConfig, IClientWidgetConfig, IWidgetRef };
package/dist/cjs/index.js CHANGED
@@ -30258,7 +30258,7 @@ const configGenerator = () => {
30258
30258
  let release;
30259
30259
  try {
30260
30260
  environment !== null && environment !== void 0 ? environment : (environment = "staging");
30261
- release !== null && release !== void 0 ? release : (release = "1.1.25");
30261
+ release !== null && release !== void 0 ? release : (release = "1.1.26");
30262
30262
  }
30263
30263
  catch (_a) {
30264
30264
  console.error('sentry configGenerator error');
@@ -48555,7 +48555,7 @@ const useAccessibility = () => {
48555
48555
  return { setSitekey, shutdown };
48556
48556
  };
48557
48557
 
48558
- const Widget = ({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }) => {
48558
+ const Widget = React.forwardRef(({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }, clientRef) => {
48559
48559
  const [isWidgetOpen, setIsWidgetOpen] = React.useState(false);
48560
48560
  const [isWidgetMinimized, setIsWidgetMinimized] = React.useState(false);
48561
48561
  const [isIncognitoMode, setIsIncognitoMode] = React.useState(false);
@@ -48651,6 +48651,10 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
48651
48651
  emitTrackEvent({ eventType: EVENT_TYPES.WIDGET_MINIMIZED });
48652
48652
  shutdown();
48653
48653
  };
48654
+ React.useImperativeHandle(clientRef, () => ({
48655
+ open: () => { var _a; return (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.click(); },
48656
+ close: onMinimize,
48657
+ }), []);
48654
48658
  const layoutClassNames = classNames({
48655
48659
  'myinterview-widget__layout': true,
48656
48660
  'myinterview-widget-no-select': true,
@@ -48683,7 +48687,7 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
48683
48687
  video: Object.assign(Object.assign({}, video), { referrer: (video === null || video === void 0 ? void 0 : video.referrer) || window.location.href }),
48684
48688
  candidate,
48685
48689
  }, setShouldShowWaterMark: setShouldShowWaterMark, isWidgetMinimized: isWidgetMinimized, onMinimize: onMinimize }))))))))));
48686
- };
48690
+ });
48687
48691
 
48688
48692
  exports.Widget = Widget;
48689
48693
  //# sourceMappingURL=index.js.map