@snapcall/stream-ui 1.24.1 → 1.25.1

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/types.d.ts CHANGED
@@ -35,6 +35,10 @@ interface FlowV0 {
35
35
  title?: string;
36
36
  text?: string;
37
37
  }
38
+ interface InitResult {
39
+ flow?: Flow;
40
+ flowV0?: FlowV0;
41
+ }
38
42
  interface JoinOptions {
39
43
  languageCode?: string;
40
44
  flowToken?: string;
@@ -56,6 +60,25 @@ interface CompanyInfo {
56
60
  avatar_url?: string;
57
61
  terminate_enabled?: boolean;
58
62
  }
63
+ type WaitingRequests = Array<{
64
+ id: string;
65
+ profile?: Profile;
66
+ }>;
67
+ interface GetRoomPeersResult {
68
+ peers: Array<{
69
+ id: string;
70
+ displayName?: string;
71
+ profile: Profile;
72
+ muted: boolean;
73
+ producersIds: string[];
74
+ producersData: ProducerData[];
75
+ }>;
76
+ videoRecordStarted: boolean;
77
+ videoRecording: {
78
+ requested: boolean;
79
+ started: boolean;
80
+ };
81
+ }
59
82
  interface StreamerState extends PeerState {
60
83
  roomId: string;
61
84
  plan?: string;
@@ -63,7 +86,6 @@ interface StreamerState extends PeerState {
63
86
  company?: CompanyInfo;
64
87
  companyId: number;
65
88
  waitingRoomAccess: boolean;
66
- callId: number | undefined;
67
89
  peers: Array<PeerState>;
68
90
  joinOptions: JoinOptions;
69
91
  }
@@ -77,6 +99,7 @@ interface PeerInfo {
77
99
  peerId: PeerId;
78
100
  muted: boolean;
79
101
  profile: Profile;
102
+ displayName?: string;
80
103
  producersData: Array<ProducerData>;
81
104
  }
82
105
  type ConsumerId = string;
@@ -89,9 +112,11 @@ interface DevicesState {
89
112
  microphone: {
90
113
  enabled: boolean;
91
114
  muted: boolean;
115
+ device?: MediaDeviceInfo | null;
92
116
  };
93
117
  camera: {
94
118
  enabled: boolean;
119
+ device?: MediaDeviceInfo | null;
95
120
  };
96
121
  screenshare: {
97
122
  enabled: boolean;
@@ -114,7 +139,7 @@ declare global {
114
139
  displaySurface?: ConstrainDOMString;
115
140
  logicalSurface?: ConstrainBoolean;
116
141
  zoom?: number;
117
- focusMode?: FocusMode[number];
142
+ focusMode?: 'none' | 'manual' | 'single-shot' | 'continuous';
118
143
  }
119
144
  interface MediaTrackCapabilities {
120
145
  zoom: {
@@ -122,7 +147,7 @@ declare global {
122
147
  max: number;
123
148
  step: number;
124
149
  };
125
- focusMode?: FocusMode;
150
+ focusMode?: Array<'none' | 'manual' | 'single-shot' | 'continuous'>;
126
151
  }
127
152
  }
128
153
  interface MenuItem {
@@ -214,14 +239,10 @@ declare global {
214
239
  peerId: string;
215
240
  plan?: string;
216
241
  permissions: Permissions;
217
- waitingRequests: Array<{
218
- id: string;
219
- profile?: Profile;
220
- }>;
221
242
  peers: {
222
243
  peerId: string;
223
244
  muted: boolean;
224
- displayName: string;
245
+ displayName?: string;
225
246
  profile: Profile;
226
247
  }[];
227
248
  }>;
@@ -234,10 +255,7 @@ declare global {
234
255
  success: string;
235
256
  message?: string;
236
257
  }>;
237
- export type RequestAccessRequestEvent = SnapcallEvent<{
238
- id: string;
239
- profile?: Profile;
240
- }>;
258
+ export type RequestAccessRequestEvent = SnapcallEvent<WaitingRequests[number]>;
241
259
  export type RequestAccessCancelEvent = SnapcallEvent<{
242
260
  id: string;
243
261
  }>;
@@ -300,6 +318,7 @@ declare global {
300
318
  export type AudioLevelEvent = SnapcallEvent<{
301
319
  audioLevel: number;
302
320
  }>;
321
+ export type InitializedEvent = SnapcallEvent<InitResult>;
303
322
  }
304
323
  export interface PublicPage {
305
324
  token: string;
@@ -361,6 +380,7 @@ interface StreamerEventMap {
361
380
  videoRecordingStarted: SnapCall.BaseEvent['detail'];
362
381
  videoRecordingStopped: SnapCall.BaseEvent['detail'];
363
382
  videoRecordingRequested: SnapCall.BaseEvent['detail'];
383
+ initialized: SnapCall.InitializedEvent['detail'];
364
384
  }
365
385
  declare class SnapcallEvent<T extends keyof StreamerEventMap> extends CustomEvent<StreamerEventMap[T]> {
366
386
  constructor(name: T, data: CustomEventInit & {
@@ -388,6 +408,10 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
388
408
  resolution: VideoResolution;
389
409
  framerate?: number;
390
410
  };
411
+ microphone: {
412
+ device: MediaDeviceInfo | null;
413
+ muted: boolean;
414
+ };
391
415
  webcamTrack: MediaStreamTrack | null;
392
416
  webcamZoom: {
393
417
  available: boolean;
@@ -395,7 +419,6 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
395
419
  max: number;
396
420
  };
397
421
  audioLevel: AudioLevel | undefined;
398
- muted: boolean;
399
422
  roomId: string;
400
423
  companyId: number;
401
424
  defaultPublicPage?: {
@@ -422,25 +445,17 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
422
445
  onStartSpeak(): void;
423
446
  onStopSpeak(): void;
424
447
  generateToken(bid: string): Promise<string>;
425
- init(room?: string, options?: JoinOptions): Promise<{
426
- flow?: Flow;
427
- flowV0?: FlowV0;
428
- }>;
448
+ init(room?: string, options?: JoinOptions): Promise<InitResult>;
429
449
  setAgentIdentity({ apiKey, email }: {
430
450
  apiKey: string;
431
451
  email?: string;
432
452
  }): Promise<void>;
433
- acceptAccessRequest(id: string): Promise<void>;
453
+ acceptAccessRequest(id: string): Promise<any>;
434
454
  setStep(stepToken: string): Promise<void>;
435
- denyAccessRequest(id: string): Promise<void>;
455
+ denyAccessRequest(id: string): Promise<any>;
436
456
  requestRoomAccess(): Promise<void>;
437
457
  joinRoom(): Promise<void>;
438
- getRoomPeers(): Promise<{
439
- waitingRequests: Array<{
440
- profile: Profile;
441
- id: string;
442
- }>;
443
- }>;
458
+ getRoomPeers(): Promise<GetRoomPeersResult>;
444
459
  onEnterRoom(): Promise<void>;
445
460
  joinRecorder(): Promise<void>;
446
461
  switchMicrophone(deviceId?: string): Promise<void>;
@@ -517,7 +532,6 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
517
532
  setProfile(profile: Profile): Promise<void>;
518
533
  requestPeerDevice(remotePeerId: string, deviceType: DeviceType): Promise<void>;
519
534
  denyDeviceRequest(deviceType: DeviceType): void;
520
- getCallId(): Promise<number>;
521
535
  getConsumers(): Map<string, ConsumerData>;
522
536
  getDevicesState(): DevicesState;
523
537
  sendCustomMessageToAll(event: any): Promise<void>;
@@ -542,6 +556,7 @@ declare class StreamerClient extends StreamerEventTargetType implements AudioLev
542
556
  startRecord(): Promise<void>;
543
557
  stopRecord(): Promise<void>;
544
558
  getPublicPage(token: string): Promise<PublicPage>;
559
+ getWaitingRequests(): Promise<WaitingRequests>;
545
560
  }
546
561
  declare const streamerClient: StreamerClient;
547
562
  interface NotificationOptions {
@@ -639,12 +654,6 @@ interface StreamUIBaseOptions {
639
654
  apiUrl?: string;
640
655
  tracking?: boolean;
641
656
  language?: string;
642
- showLogin?: {
643
- enabled: boolean;
644
- email?: string;
645
- name?: string;
646
- };
647
- hideSwitchToMobilePopup?: boolean;
648
657
  }
649
658
  interface StreamUIInitOptions extends StreamUIBaseOptions {
650
659
  element: HTMLElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapcall/stream-ui",
3
- "version": "1.24.1",
3
+ "version": "1.25.1",
4
4
  "description": "",
5
5
  "source": "src/index.tsx",
6
6
  "main": "dist/stream-ui.js",
@@ -24,6 +24,9 @@
24
24
  "isLibrary": false,
25
25
  "optimize": true,
26
26
  "sourceMap": false
27
+ },
28
+ "html": {
29
+ "source": "html/index.html"
27
30
  }
28
31
  },
29
32
  "publishConfig": {
@@ -33,12 +36,12 @@
33
36
  "dist"
34
37
  ],
35
38
  "scripts": {
36
- "watch": "parcel watch",
37
- "serve": "parcel serve --https example/index.html --host 0.0.0.0",
39
+ "dev": "npm run serve",
40
+ "serve": "APP_ENV=local parcel serve --https --host 0.0.0.0 --target html",
38
41
  "build": "parcel build",
39
- "build:npm": "parcel build --no-source-maps",
40
- "build:s3": "parcel build --no-source-maps --target umd",
41
- "build:streamerClient": "parcel build --target streamerClient",
42
+ "build:npm": "parcel build --no-source-maps --target main --target module --target types",
43
+ "build:s3": "parcel build --no-source-maps --target umd --target html",
44
+ "build:streamerClient": "parcel build --target streamerClient --target types",
42
45
  "typecheck": "tsc --noEmit",
43
46
  "lint": "eslint src streamerClient --ext .ts,.tsx",
44
47
  "prettier": "prettier --check .",
@@ -81,17 +84,19 @@
81
84
  "eslint-config-react-app": "^7.0.1",
82
85
  "parcel": "^2.12.0",
83
86
  "postcss": "^8.4.38",
87
+ "posthtml": "^0.16.6",
88
+ "posthtml-expressions": "^1.11.3",
89
+ "posthtml-include": "^2.0.1",
84
90
  "prettier": "2.7.1",
85
91
  "process": "^0.11.10",
86
92
  "tailwindcss": "^3.4.3",
87
93
  "typescript": "^5.4.5"
88
94
  },
89
95
  "dependencies": {
90
- "@hotjar/browser": "^1.0.6",
91
96
  "@lottiefiles/react-lottie-player": "^3.5.3",
92
97
  "@mediapipe/selfie_segmentation": "^0.1.1632777926",
93
98
  "@sentry/browser": "^7.0.0",
94
- "@snapcall/design-system": "^1.18.3",
99
+ "@snapcall/design-system": "^1.19.1",
95
100
  "@types/youtube": "^0.0.50",
96
101
  "bowser": "^2.11.0",
97
102
  "classnames": "^2.3.2",