@snapcall/stream-ui 1.21.0 → 1.23.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 @@
1
+ let e;self.onmessage=a=>{let{action:s,params:t}=a.data;"start"===s&&(e&&clearInterval(e),e=self.setInterval(()=>{self.postMessage("time")},1e3/t))};
package/dist/types.d.ts CHANGED
@@ -3,32 +3,6 @@ import { types } from "mediasoup-client";
3
3
  import * as protooClient from "protoo-client";
4
4
  import { Transport } from "mediasoup-client/lib/Transport";
5
5
  import { CSSProperties } from "react";
6
- interface MenuItem {
7
- id: string;
8
- title: string;
9
- jsxIcon?: JSX.Element;
10
- srcIcon?: string;
11
- action: () => void;
12
- danger?: boolean;
13
- isNew?: boolean;
14
- }
15
- interface MenuCategory {
16
- id: string;
17
- title?: string;
18
- items: MenuItem[];
19
- }
20
- type DisplayType = 'icon' | 'full';
21
- interface SettingShortcut {
22
- id: string;
23
- displayType: DisplayType;
24
- }
25
- interface SettingsCategory extends MenuCategory {
26
- position?: number;
27
- items: SettingsItem[];
28
- }
29
- interface SettingsItem extends MenuItem {
30
- position?: number;
31
- }
32
6
  type VideoResolution = 'qvga' | 'vga' | 'hd';
33
7
  type PeerId = string;
34
8
  type DeviceType = 'webcam' | 'screen' | 'microphone';
@@ -36,7 +10,28 @@ interface Profile {
36
10
  name?: string;
37
11
  image?: string;
38
12
  }
13
+ interface Step {
14
+ type: 'video' | 'audio' | 'screen' | 'image';
15
+ token: string;
16
+ title: string;
17
+ description: string;
18
+ image_url: string;
19
+ translation: {
20
+ title?: string;
21
+ description?: string;
22
+ button?: string;
23
+ languageCode?: string;
24
+ };
25
+ }
26
+ interface Flow {
27
+ token: string;
28
+ name: string;
29
+ is_default: number;
30
+ steps: Array<Step>;
31
+ }
39
32
  interface JoinOptions {
33
+ languageCode?: string;
34
+ flowToken?: string;
40
35
  recorder?: boolean;
41
36
  apiKey?: string;
42
37
  email?: string;
@@ -127,6 +122,32 @@ declare global {
127
122
  sinkId?: string;
128
123
  }
129
124
  }
125
+ interface MenuItem {
126
+ id: string;
127
+ title: string;
128
+ jsxIcon?: JSX.Element;
129
+ srcIcon?: string;
130
+ action: () => void;
131
+ danger?: boolean;
132
+ isNew?: boolean;
133
+ }
134
+ interface MenuCategory {
135
+ id: string;
136
+ title?: string;
137
+ items: MenuItem[];
138
+ }
139
+ type DisplayType = 'icon' | 'full';
140
+ interface SettingShortcut {
141
+ id: string;
142
+ displayType: DisplayType;
143
+ }
144
+ interface SettingsCategory extends MenuCategory {
145
+ position?: number;
146
+ items: SettingsItem[];
147
+ }
148
+ interface SettingsItem extends MenuItem {
149
+ position?: number;
150
+ }
130
151
  interface AudioLevelListener {
131
152
  onAudioLevel?(audioLevel: number, id: string): void;
132
153
  onMuteDetection?(id: string): void;
@@ -395,12 +416,16 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
395
416
  onStartSpeak(): void;
396
417
  onStopSpeak(): void;
397
418
  generateToken(bid: string): Promise<string>;
398
- init(room?: string, options?: JoinOptions): Promise<void>;
419
+ readFlow(token: string): Promise<Flow | undefined>;
420
+ init(room?: string, options?: JoinOptions): Promise<{
421
+ flow?: Flow;
422
+ }>;
399
423
  setAgentIdentity({ apiKey, email }: {
400
424
  apiKey: string;
401
425
  email?: string;
402
426
  }): Promise<void>;
403
427
  acceptAccessRequest(id: string): Promise<void>;
428
+ setStep(stepToken: string): Promise<void>;
404
429
  denyAccessRequest(id: string): Promise<void>;
405
430
  requestRoomAccess(): Promise<void>;
406
431
  joinRoom(): Promise<void>;
@@ -572,6 +597,7 @@ interface ControlSettings {
572
597
  }
573
598
  interface StreamUIBaseOptions {
574
599
  token?: string;
600
+ flowToken?: string;
575
601
  authKey?: string;
576
602
  profile?: Profile;
577
603
  apiKey?: string;
@@ -579,9 +605,9 @@ interface StreamUIBaseOptions {
579
605
  headless?: boolean;
580
606
  greeting?: boolean;
581
607
  recorder?: {
608
+ enabledModes: Array<'video' | 'screen' | 'photo' | 'audio'>;
582
609
  enabled: boolean;
583
- defaultMode?: 'photo' | 'video';
584
- defaultMedia?: 'camera' | 'screen';
610
+ defaultMode?: 'photo' | 'video' | 'audio' | 'screen';
585
611
  skipOnboarding?: boolean;
586
612
  };
587
613
  sharedURL?: string;
@@ -612,6 +638,7 @@ interface StreamUIBaseOptions {
612
638
  email?: string;
613
639
  name?: string;
614
640
  };
641
+ hideSwitchToMobilePopup?: boolean;
615
642
  }
616
643
  interface StreamUIInitOptions extends StreamUIBaseOptions {
617
644
  element: HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcall/stream-ui",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/stream-ui.js",
@@ -8,6 +8,15 @@
8
8
  "umd": "dist/stream-ui.umd.js",
9
9
  "types": "dist/types.d.ts",
10
10
  "targets": {
11
+ "streamerClient": {
12
+ "source": "streamerClient/index.ts",
13
+ "context": "browser",
14
+ "outputFormat": "commonjs",
15
+ "includeNodeModules": true,
16
+ "isLibrary": true,
17
+ "optimize": true,
18
+ "sourceMap": false
19
+ },
11
20
  "umd": {
12
21
  "context": "browser",
13
22
  "outputFormat": "global",
@@ -29,6 +38,7 @@
29
38
  "build": "parcel build",
30
39
  "build:npm": "parcel build --no-source-maps",
31
40
  "build:s3": "parcel build --no-source-maps --target umd",
41
+ "build:streamerClient": "parcel build --target streamerClient",
32
42
  "typecheck": "tsc --noEmit",
33
43
  "lint": "eslint src streamerClient --ext .ts,.tsx",
34
44
  "prettier": "prettier --check .",