@snapcall/stream-ui 1.38.1-beta.1 → 1.39.0

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.
@@ -0,0 +1,17 @@
1
+ (() => {
2
+ /*
3
+ * Since timers can be altered in an inactive browser tab,
4
+ * we use this worker to emulate the setInterval.
5
+ */ // @ts-ignore
6
+ let $7df5a1066adc9830$var$interval;
7
+ self.onmessage = (event)=>{
8
+ const { action: action, params: params } = event.data;
9
+ if (action === 'start') {
10
+ if ($7df5a1066adc9830$var$interval) clearInterval($7df5a1066adc9830$var$interval);
11
+ $7df5a1066adc9830$var$interval = self.setInterval(()=>{
12
+ self.postMessage('time');
13
+ }, 1000 / params);
14
+ }
15
+ };
16
+
17
+ })();
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Since timers can be altered in an inactive browser tab,
3
+ * we use this worker to emulate the setInterval.
4
+ */ // @ts-ignore
5
+ let $febe13af234b7734$var$interval;
6
+ self.onmessage = (event)=>{
7
+ const { action: action, params: params } = event.data;
8
+ if (action === 'start') {
9
+ if ($febe13af234b7734$var$interval) clearInterval($febe13af234b7734$var$interval);
10
+ $febe13af234b7734$var$interval = self.setInterval(()=>{
11
+ self.postMessage('time');
12
+ }, 1000 / params);
13
+ }
14
+ };
15
+
16
+
package/dist/types.d.ts CHANGED
@@ -14,15 +14,10 @@ interface Step {
14
14
  token: string;
15
15
  title: string;
16
16
  config?: {
17
- geolocation?: boolean;
18
- description: string;
19
- image_url: string;
20
- source?: string;
17
+ description?: string;
18
+ image_url?: string;
21
19
  button_text?: string;
22
- video_bot?: boolean;
23
- upload?: boolean;
24
- allow_video?: boolean;
25
- allow_screensharing?: boolean;
20
+ use_workspace_logo?: boolean;
26
21
  };
27
22
  translation: {
28
23
  title?: string;
@@ -38,25 +33,77 @@ interface Flow {
38
33
  token: string;
39
34
  name: string;
40
35
  is_default: number;
36
+ config?: {
37
+ description?: string;
38
+ image_url?: string;
39
+ output_language?: string;
40
+ stock_detection?: boolean;
41
+ source?: string;
42
+ geolocation?: boolean;
43
+ external_links?: Array<{
44
+ title: string;
45
+ url: string;
46
+ }>;
47
+ call?: {
48
+ pre_call?: boolean;
49
+ pre_call_title?: string;
50
+ pre_call_description?: string;
51
+ pre_call_image_url?: string;
52
+ video?: boolean;
53
+ screensharing?: boolean;
54
+ recording?: boolean;
55
+ snapshot?: boolean;
56
+ pointer?: boolean;
57
+ };
58
+ acknowledgment?: {
59
+ enabled: boolean;
60
+ isPublic: boolean;
61
+ hideAi: boolean;
62
+ };
63
+ docupass?: boolean;
64
+ };
41
65
  steps: Array<Step>;
42
66
  }
43
- interface FlowV0 {
44
- logo_url?: string;
45
- image_url?: string;
46
- title?: string;
47
- text?: string;
67
+ interface StreamInfo {
68
+ type: 'assist' | 'instant' | 'schedule';
69
+ defaultPublicPage?: {
70
+ token: string;
71
+ };
72
+ streamer_instance?: 'recorder';
73
+ plan: {
74
+ id: number;
75
+ name: string;
76
+ users_limit: number;
77
+ interactions_limit: number;
78
+ calls_interactions_limit: number;
79
+ clips_interactions_limit: number;
80
+ is_addon: 0;
81
+ permissions: Permissions;
82
+ quantity: number;
83
+ status: string;
84
+ };
85
+ recordings?: {
86
+ enabled: true;
87
+ video: true;
88
+ };
89
+ company_id: number;
90
+ flow: Flow;
91
+ defaultVideoBackground?: string;
92
+ videoBackgrounds?: Array<string>;
93
+ company: {
94
+ name: string;
95
+ company_name: string;
96
+ avatar_url?: string;
97
+ terminate_enabled?: boolean;
98
+ ai_blocked?: boolean;
99
+ hide_stream_invite?: boolean;
100
+ };
48
101
  }
49
102
  interface InitResult {
50
- type: 'instant' | 'assist';
51
- flow?: Flow;
52
- flowV0?: FlowV0;
53
- hideStreamInvite?: boolean;
54
- videoBackgrounds?: Array<string>;
55
- defaultVideoBackground?: string;
103
+ peerId: string;
56
104
  }
57
105
  interface JoinOptions {
58
106
  languageCode?: string;
59
- flowToken?: string;
60
107
  recorder?: boolean;
61
108
  apiKey?: string;
62
109
  email?: string;
@@ -321,7 +368,7 @@ declare class VideoDrawer {
321
368
  });
322
369
  onFrame(): void;
323
370
  onFrameScreen(): void;
324
- setVideoDrawerDisplay(video: HTMLVideoElement): void;
371
+ setVideoDrawerDisplay(): void;
325
372
  createStream(): Promise<MediaStream>;
326
373
  clean(): Promise<void>;
327
374
  }
@@ -583,7 +630,7 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
583
630
  onStartSpeak(): void;
584
631
  onStopSpeak(): void;
585
632
  generateToken(bid: string): Promise<string>;
586
- init(room?: string, options?: JoinOptions): Promise<InitResult>;
633
+ init(room: string, streamInfo: StreamInfo, options?: JoinOptions): Promise<InitResult>;
587
634
  onTransportManyDisconnections(transport: mediasoupClient.types.Transport): void;
588
635
  onTransportStateChangeNetwork(transport: mediasoupClient.types.Transport, isOk: boolean): void;
589
636
  onNetworkLog(transport: mediasoupClient.types.Transport, log: NetworkLog): void;
@@ -790,14 +837,8 @@ interface StreamUIBaseOptions {
790
837
  apiKey?: string;
791
838
  email?: string;
792
839
  headless?: boolean;
793
- greeting?: boolean;
794
- recorder?: {
795
- geolocation?: boolean;
796
- enabledModes: Array<'video' | 'screen' | 'photo' | 'audio' | 'upload'>;
797
- enabled: boolean;
798
- defaultMode?: 'photo' | 'video' | 'audio' | 'screen' | 'upload';
799
- skipOnboarding?: boolean;
800
- };
840
+ flow?: Flow;
841
+ isRecorder?: boolean;
801
842
  sharedURL?: string;
802
843
  audioTiles?: boolean;
803
844
  controls?: {
@@ -820,6 +861,7 @@ interface StreamUIBaseOptions {
820
861
  tracking?: boolean;
821
862
  language?: string;
822
863
  disableSessionFetching?: boolean;
864
+ skipPreCall?: boolean;
823
865
  }
824
866
  interface StreamUIInitOptions extends StreamUIBaseOptions {
825
867
  element: HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcall/stream-ui",
3
- "version": "1.38.1-beta.1",
3
+ "version": "1.39.0",
4
4
  "description": "",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/stream-ui.js",
@@ -57,14 +57,14 @@
57
57
  "license": "ISC",
58
58
  "peerDependencies": {
59
59
  "bowser": "^2.11.0",
60
- "i18next": "^23.11.5",
60
+ "i18next": "^25.5.2",
61
61
  "inobounce": "^0.2.1",
62
62
  "mediasoup-client": "^3.15.6",
63
63
  "protoo-client": "^4.0.6",
64
64
  "qrcode": "^1.5.4",
65
- "react": "^18.3.1",
66
- "react-dom": "^18.3.1",
67
- "react-i18next": "^14.1.1"
65
+ "react": "^19.1.1",
66
+ "react-dom": "^19.1.1",
67
+ "react-i18next": "^15.7.3"
68
68
  },
69
69
  "devDependencies": {
70
70
  "@localazy/cli": "^2.0.8",
@@ -93,8 +93,8 @@
93
93
  "typescript": "^5.8.3"
94
94
  },
95
95
  "dependencies": {
96
- "@mediapipe/tasks-vision": "^0.10.18",
97
- "@snapcall/design-system": "^1.23.1",
96
+ "@mediapipe/selfie_segmentation": "^0.1.1675465747",
97
+ "@snapcall/design-system": "^1.23.3",
98
98
  "@tanstack/react-query": "^5.81.5",
99
99
  "bowser": "^2.11.0",
100
100
  "classnames": "^2.5.1",