@whereby.com/browser-sdk 3.10.2 → 3.10.3

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.
@@ -3,7 +3,25 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var heresy = require('heresy');
6
- var core = require('@whereby.com/core');
6
+
7
+ function parseRoomUrlAndSubdomain(roomAttribute, subdomainAttribute) {
8
+ if (!roomAttribute) {
9
+ throw new Error("Missing room attribute");
10
+ }
11
+ const m = /https:\/\/([^.]+)(\.whereby\.com|-ip-\d+-\d+-\d+-\d+.hereby.dev:4443)\/.+/.exec(roomAttribute);
12
+ const subdomain = (m && m[1]) || subdomainAttribute;
13
+ if (!subdomain) {
14
+ throw new Error("Missing subdomain attribute");
15
+ }
16
+ if (!m) {
17
+ throw new Error("Could not parse room URL");
18
+ }
19
+ const roomUrl = new URL(roomAttribute);
20
+ return {
21
+ subdomain,
22
+ roomUrl,
23
+ };
24
+ }
7
25
 
8
26
  const boolAttrs = [
9
27
  "aec",
@@ -154,7 +172,7 @@ heresy.define("WherebyEmbed", {
154
172
  const { avatarurl: avatarUrl, displayname: displayName, cameraeffect: cameraEffect, emojiskintone: emojiSkinTone, lang, metadata, externalid: externalId, minimal, room, groups, virtualbackgroundurl: virtualBackgroundUrl, title, } = this;
155
173
  let roomUrl, subdomain;
156
174
  try {
157
- ({ roomUrl, subdomain } = core.parseRoomUrlAndSubdomain(room, this.subdomain));
175
+ ({ roomUrl, subdomain } = parseRoomUrlAndSubdomain(room, this.subdomain));
158
176
  }
159
177
  catch (error) {
160
178
  return this.html `Whereby: ${error instanceof Error ? error.message : "unknown error"}`;
@@ -1,5 +1,23 @@
1
1
  import { define, ref } from 'heresy';
2
- import { parseRoomUrlAndSubdomain } from '@whereby.com/core';
2
+
3
+ function parseRoomUrlAndSubdomain(roomAttribute, subdomainAttribute) {
4
+ if (!roomAttribute) {
5
+ throw new Error("Missing room attribute");
6
+ }
7
+ const m = /https:\/\/([^.]+)(\.whereby\.com|-ip-\d+-\d+-\d+-\d+.hereby.dev:4443)\/.+/.exec(roomAttribute);
8
+ const subdomain = (m && m[1]) || subdomainAttribute;
9
+ if (!subdomain) {
10
+ throw new Error("Missing subdomain attribute");
11
+ }
12
+ if (!m) {
13
+ throw new Error("Could not parse room URL");
14
+ }
15
+ const roomUrl = new URL(roomAttribute);
16
+ return {
17
+ subdomain,
18
+ roomUrl,
19
+ };
20
+ }
3
21
 
4
22
  const boolAttrs = [
5
23
  "aec",
@@ -172,7 +172,7 @@ const selectRoomConnectionState = toolkit.createSelector(core.selectChatMessages
172
172
  return state;
173
173
  });
174
174
 
175
- const browserSdkVersion = "3.10.2";
175
+ const browserSdkVersion = "3.10.3";
176
176
 
177
177
  const defaultRoomConnectionOptions = {
178
178
  localMediaOptions: {
@@ -150,7 +150,7 @@ const selectRoomConnectionState = createSelector(selectChatMessages, selectCloud
150
150
  return state;
151
151
  });
152
152
 
153
- const browserSdkVersion = "3.10.2";
153
+ const browserSdkVersion = "3.10.3";
154
154
 
155
155
  const defaultRoomConnectionOptions = {
156
156
  localMediaOptions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whereby.com/browser-sdk",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "description": "Modules for integration Whereby video in web apps",
5
5
  "author": "Whereby AS",
6
6
  "license": "MIT",
@@ -80,7 +80,7 @@
80
80
  "dependencies": {
81
81
  "@radix-ui/react-popover": "^1.0.7",
82
82
  "@reduxjs/toolkit": "^2.2.3",
83
- "@whereby.com/core": "0.29.3",
83
+ "@whereby.com/core": "0.30.0",
84
84
  "clsx": "^2.1.1",
85
85
  "heresy": "^1.0.4",
86
86
  "react-redux": "^9.1.1",