@myinterview/widget-react 1.1.24-development-9fb08e2 → 1.1.24-export-ref-actions-02
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/cjs/components/Widget.d.ts +5 -2
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +9 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/configInterface.d.ts +4 -0
- package/dist/esm/components/Widget.d.ts +5 -2
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +9 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/configInterface.d.ts +4 -0
- package/dist/index.d.ts +29 -22
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const Widget: React.
|
|
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>>;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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/esm/index.js
CHANGED
|
@@ -30232,7 +30232,7 @@ const configGenerator = () => {
|
|
|
30232
30232
|
let release;
|
|
30233
30233
|
try {
|
|
30234
30234
|
environment !== null && environment !== void 0 ? environment : (environment = "staging");
|
|
30235
|
-
release !== null && release !== void 0 ? release : (release = "1.1.24");
|
|
30235
|
+
release !== null && release !== void 0 ? release : (release = "1.1.24-export-ref-actions-02");
|
|
30236
30236
|
}
|
|
30237
30237
|
catch (_a) {
|
|
30238
30238
|
console.error('sentry configGenerator error');
|
|
@@ -48529,7 +48529,7 @@ const useAccessibility = () => {
|
|
|
48529
48529
|
return { setSitekey, shutdown };
|
|
48530
48530
|
};
|
|
48531
48531
|
|
|
48532
|
-
const Widget = ({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }) => {
|
|
48532
|
+
const Widget = forwardRef(({ candidate, job, video, config, disabled = false, buttonText = 'START INTERVIEW', buttonStyle = {}, children, styleUrls = [], fontsUrls = [], }, clientRef) => {
|
|
48533
48533
|
const [isWidgetOpen, setIsWidgetOpen] = useState(false);
|
|
48534
48534
|
const [isWidgetMinimized, setIsWidgetMinimized] = useState(false);
|
|
48535
48535
|
const [isIncognitoMode, setIsIncognitoMode] = useState(false);
|
|
@@ -48539,6 +48539,8 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
|
|
|
48539
48539
|
const [shouldShowWaterMark, setShouldShowWaterMark] = useState(false);
|
|
48540
48540
|
const [isCustomStyleProvided, setIsCustomStyleProvided] = useState(false);
|
|
48541
48541
|
const { setSitekey, shutdown } = useAccessibility();
|
|
48542
|
+
if (!candidate || !config)
|
|
48543
|
+
return null;
|
|
48542
48544
|
useEffect(() => {
|
|
48543
48545
|
if (isAndroid) {
|
|
48544
48546
|
detectIncognito().then((res) => {
|
|
@@ -48625,6 +48627,10 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
|
|
|
48625
48627
|
emitTrackEvent({ eventType: EVENT_TYPES.WIDGET_MINIMIZED });
|
|
48626
48628
|
shutdown();
|
|
48627
48629
|
};
|
|
48630
|
+
useImperativeHandle(clientRef, () => ({
|
|
48631
|
+
open: () => { var _a; return (_a = buttonRef.current) === null || _a === void 0 ? void 0 : _a.click(); },
|
|
48632
|
+
close: onMinimize,
|
|
48633
|
+
}), []);
|
|
48628
48634
|
const layoutClassNames = classNames({
|
|
48629
48635
|
'myinterview-widget__layout': true,
|
|
48630
48636
|
'myinterview-widget-no-select': true,
|
|
@@ -48657,7 +48663,7 @@ const Widget = ({ candidate, job, video, config, disabled = false, buttonText =
|
|
|
48657
48663
|
video: Object.assign(Object.assign({}, video), { referrer: (video === null || video === void 0 ? void 0 : video.referrer) || window.location.href }),
|
|
48658
48664
|
candidate,
|
|
48659
48665
|
}, setShouldShowWaterMark: setShouldShowWaterMark, isWidgetMinimized: isWidgetMinimized, onMinimize: onMinimize }))))))))));
|
|
48660
|
-
};
|
|
48666
|
+
});
|
|
48661
48667
|
|
|
48662
48668
|
export { Widget };
|
|
48663
48669
|
//# sourceMappingURL=index.js.map
|