@myinterview/widget-react 1.1.29 → 1.1.30-beta-4fa3a39
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/index.js +21 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/configInterface.d.ts +2 -0
- package/dist/cjs/interfaces/recorderInterface.d.ts +2 -0
- package/dist/esm/index.js +21 -11
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/interfaces/configInterface.d.ts +2 -0
- package/dist/esm/interfaces/recorderInterface.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ export interface IOnError {
|
|
|
12
12
|
messageType: IMessageType;
|
|
13
13
|
}
|
|
14
14
|
export type IEnv = 'dev' | 'staging' | 'production' | 'development' | 'local';
|
|
15
|
+
export type IViews = 'desktop' | 'mobile';
|
|
15
16
|
interface IConfig {
|
|
16
17
|
auth: string;
|
|
17
18
|
onWidgetClicked?: () => void;
|
|
@@ -33,6 +34,7 @@ interface IConfig {
|
|
|
33
34
|
event_id?: string;
|
|
34
35
|
accessibility_id?: string;
|
|
35
36
|
recordWithoutVideo?: boolean;
|
|
37
|
+
forcedView?: IViews;
|
|
36
38
|
}
|
|
37
39
|
export type IClientConfig = Omit<IConfig, 'practiceQuestions'> & {
|
|
38
40
|
practiceQuestions?: IClientQuestion[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ActorRef, DoneInvokeEvent } from 'xstate';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
|
+
import { IViews } from './configInterface';
|
|
3
4
|
export declare const enum SPEED_TEST_LEVEL {
|
|
4
5
|
LOW = 0,
|
|
5
6
|
MEDIUM = 1,
|
|
@@ -45,6 +46,7 @@ export interface RecorderInterface {
|
|
|
45
46
|
durations: number;
|
|
46
47
|
isMicError: boolean;
|
|
47
48
|
isActivelyStopped: boolean;
|
|
49
|
+
forcedView?: IViews;
|
|
48
50
|
}
|
|
49
51
|
export declare const enum MIME_TYPES {
|
|
50
52
|
WEBM = "video/webm",
|
package/dist/esm/index.js
CHANGED
|
@@ -30212,7 +30212,7 @@ const prod_config = {
|
|
|
30212
30212
|
const config$1 = (configEnv) => {
|
|
30213
30213
|
let env = configEnv;
|
|
30214
30214
|
try {
|
|
30215
|
-
env !== null && env !== void 0 ? env : (env = "
|
|
30215
|
+
env !== null && env !== void 0 ? env : (env = "staging");
|
|
30216
30216
|
}
|
|
30217
30217
|
catch (_a) { }
|
|
30218
30218
|
switch (env) {
|
|
@@ -30231,8 +30231,8 @@ const configGenerator = () => {
|
|
|
30231
30231
|
let environment;
|
|
30232
30232
|
let release;
|
|
30233
30233
|
try {
|
|
30234
|
-
environment !== null && environment !== void 0 ? environment : (environment = "
|
|
30235
|
-
release !== null && release !== void 0 ? release : (release = "1.1.
|
|
30234
|
+
environment !== null && environment !== void 0 ? environment : (environment = "staging");
|
|
30235
|
+
release !== null && release !== void 0 ? release : (release = "1.1.30");
|
|
30236
30236
|
}
|
|
30237
30237
|
catch (_a) {
|
|
30238
30238
|
console.error('sentry configGenerator error');
|
|
@@ -44118,27 +44118,29 @@ const recorderMachineV2 = createMachine({
|
|
|
44118
44118
|
const audioDeviceId = context.selectedAudioDevice && context.selectedAudioDevice.deviceId;
|
|
44119
44119
|
const videoDeviceId = context.selectedVideoDevice && context.selectedVideoDevice.deviceId;
|
|
44120
44120
|
const isVideoOff = () => !!context.recordWithoutVideo;
|
|
44121
|
-
const
|
|
44121
|
+
const isMobileAspectForced = context.forcedView === 'mobile';
|
|
44122
|
+
const isDesktopAspectForced = context.forcedView === 'desktop';
|
|
44123
|
+
const defaultConstraints = {
|
|
44122
44124
|
video: !isVideoOff(),
|
|
44123
44125
|
audio: true,
|
|
44124
44126
|
};
|
|
44125
|
-
const
|
|
44127
|
+
const mobileConstraints = {
|
|
44126
44128
|
audio: {
|
|
44127
44129
|
deviceId: audioDeviceId ? { exact: audioDeviceId } : undefined,
|
|
44128
44130
|
},
|
|
44129
|
-
video: isVideoOff() ? false : Object.assign(Object.assign({}, context.constraint.video), { facingMode: context.facingMode, aspectRatio: 4 / 3 }),
|
|
44131
|
+
video: isVideoOff() ? false : Object.assign(Object.assign({}, (!isDesktopAspectForced && context.constraint.video)), { facingMode: context.facingMode, aspectRatio: isDesktopAspectForced ? 9 / 16 : 4 / 3 }),
|
|
44130
44132
|
};
|
|
44131
44133
|
const desktopConstraints = {
|
|
44132
44134
|
audio: {
|
|
44133
44135
|
deviceId: audioDeviceId ? { exact: audioDeviceId } : undefined,
|
|
44134
44136
|
},
|
|
44135
|
-
video: isVideoOff() ? false : Object.assign(Object.assign({}, context.constraint.video), { deviceId: videoDeviceId ? { exact: videoDeviceId } : undefined, aspectRatio: 16 / 9 }),
|
|
44137
|
+
video: isVideoOff() ? false : Object.assign(Object.assign({}, (!isMobileAspectForced && context.constraint.video)), { deviceId: videoDeviceId ? { exact: videoDeviceId } : undefined, aspectRatio: isMobileAspectForced ? 3 / 4 : 16 / 9 }),
|
|
44136
44138
|
};
|
|
44137
44139
|
const constraintCheck = () => {
|
|
44138
44140
|
if (context.isSafeMode)
|
|
44139
|
-
return
|
|
44141
|
+
return defaultConstraints;
|
|
44140
44142
|
if (isMobile)
|
|
44141
|
-
return
|
|
44143
|
+
return mobileConstraints;
|
|
44142
44144
|
return desktopConstraints;
|
|
44143
44145
|
};
|
|
44144
44146
|
const mediaStream = yield navigator.mediaDevices.getUserMedia(constraintCheck());
|
|
@@ -45638,7 +45640,7 @@ const accWidgetMachine = createMachine({
|
|
|
45638
45640
|
storageRef: spawn(storageMachine, { name: 'storage' }),
|
|
45639
45641
|
})),
|
|
45640
45642
|
[ACTIONS$6.SPAWN_RECORDER]: assign$2((context) => ({
|
|
45641
|
-
recorderRef: spawn(recorderMachineV2.withContext(Object.assign(Object.assign({}, recorderMachineV2.context), { videoRef: context.videoRef, speedTestLevel: SPEED_TEST_LEVEL.HIGH, recordWithoutVideo: context.widgetConfig.config.recordWithoutVideo })), { name: 'recorder' }),
|
|
45643
|
+
recorderRef: spawn(recorderMachineV2.withContext(Object.assign(Object.assign({}, recorderMachineV2.context), { videoRef: context.videoRef, speedTestLevel: SPEED_TEST_LEVEL.HIGH, recordWithoutVideo: context.widgetConfig.config.recordWithoutVideo, forcedView: context.widgetConfig.config.forcedView })), { name: 'recorder' }),
|
|
45642
45644
|
})),
|
|
45643
45645
|
[ACTIONS$6.SPAWN_PREVIEW]: assign$2((_) => ({
|
|
45644
45646
|
previewRef: spawn(previewMachine, { name: 'preview' }),
|
|
@@ -48396,6 +48398,11 @@ const Main = ({ widgetConfig, setShouldShowWaterMark, myinterviewRef, isWidgetMi
|
|
|
48396
48398
|
alignment: isRtl(job === null || job === void 0 ? void 0 : job.language) ? 'left' : 'right',
|
|
48397
48399
|
});
|
|
48398
48400
|
}
|
|
48401
|
+
SentryHub.configureScope((scope) => {
|
|
48402
|
+
scope.setTags({
|
|
48403
|
+
company_id: candidate === null || candidate === void 0 ? void 0 : candidate.company_id,
|
|
48404
|
+
});
|
|
48405
|
+
});
|
|
48399
48406
|
}, [candidate, job === null || job === void 0 ? void 0 : job.language]);
|
|
48400
48407
|
const setBackgroundOpacity = () => {
|
|
48401
48408
|
var _a;
|
|
@@ -48584,7 +48591,10 @@ const Widget = forwardRef(({ candidate, job, video, config, disabled = false, bu
|
|
|
48584
48591
|
")"))), [styleUrls]);
|
|
48585
48592
|
useEffect(() => {
|
|
48586
48593
|
SentryHub.configureScope((scope) => {
|
|
48587
|
-
scope.setUser(
|
|
48594
|
+
scope.setUser({
|
|
48595
|
+
email: candidate.email,
|
|
48596
|
+
});
|
|
48597
|
+
scope.setTags(Object.assign({}, (isIphone && { iphoneModel: getIPhoneModel() })));
|
|
48588
48598
|
});
|
|
48589
48599
|
}, [candidate.email]);
|
|
48590
48600
|
useEffect(() => {
|