@whereby.com/react-native-sdk 0.1.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.
- package/LICENSE +23 -0
- package/README.md +9 -0
- package/dist/commonjs/embed/index.js +36 -0
- package/dist/commonjs/embed/index.js.map +1 -0
- package/dist/commonjs/native/index.js +10 -0
- package/dist/commonjs/native/index.js.map +1 -0
- package/dist/commonjs/package.json +1 -0
- package/dist/module/embed/index.js +31 -0
- package/dist/module/embed/index.js.map +1 -0
- package/dist/module/native/index.js +6 -0
- package/dist/module/native/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/babel.config.d.ts +4 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/babel.config.d.ts.map +1 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/bob.config.d.ts +9 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/bob.config.d.ts.map +1 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/jest.config.d.ts +3 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/jest.config.d.ts.map +1 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/src/embed/index.d.ts +10 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/src/embed/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/src/native/index.d.ts +2 -0
- package/dist/typescript/commonjs/packages/react-native-sdk/src/native/index.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/packages/react-native-sdk/babel.config.d.ts +4 -0
- package/dist/typescript/module/packages/react-native-sdk/babel.config.d.ts.map +1 -0
- package/dist/typescript/module/packages/react-native-sdk/bob.config.d.ts +9 -0
- package/dist/typescript/module/packages/react-native-sdk/bob.config.d.ts.map +1 -0
- package/dist/typescript/module/packages/react-native-sdk/jest.config.d.ts +3 -0
- package/dist/typescript/module/packages/react-native-sdk/jest.config.d.ts.map +1 -0
- package/dist/typescript/module/packages/react-native-sdk/src/embed/index.d.ts +10 -0
- package/dist/typescript/module/packages/react-native-sdk/src/embed/index.d.ts.map +1 -0
- package/dist/typescript/module/packages/react-native-sdk/src/native/index.d.ts +2 -0
- package/dist/typescript/module/packages/react-native-sdk/src/native/index.d.ts.map +1 -0
- package/embed/package.json +7 -0
- package/package.json +89 -0
- package/src/embed/index.tsx +33 -0
- package/src/native/index.tsx +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Whereby AS (https://www.whereby.com)
|
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
|
5
|
+
obtaining a copy of this software and associated documentation
|
|
6
|
+
files (the "Software"), to deal in the Software without
|
|
7
|
+
restriction, including without limitation the rights to use,
|
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the
|
|
10
|
+
Software is furnished to do so, subject to the following
|
|
11
|
+
conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.WherebyEmbed = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNativeWebview = require("react-native-webview");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
12
|
+
const WherebyEmbed = exports.WherebyEmbed = /*#__PURE__*/React.forwardRef(({
|
|
13
|
+
roomUrl,
|
|
14
|
+
queryParams,
|
|
15
|
+
...props
|
|
16
|
+
}, ref) => {
|
|
17
|
+
const url = queryParams ? `${roomUrl}?${queryParams}` : roomUrl;
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeWebview.WebView, {
|
|
19
|
+
ref: ref,
|
|
20
|
+
source: {
|
|
21
|
+
uri: url
|
|
22
|
+
},
|
|
23
|
+
startInLoadingState: true,
|
|
24
|
+
originWhitelist: ["*"],
|
|
25
|
+
mediaPlaybackRequiresUserAction: false
|
|
26
|
+
// iOS specific:
|
|
27
|
+
,
|
|
28
|
+
allowsInlineMediaPlayback: true
|
|
29
|
+
// Android specific:
|
|
30
|
+
,
|
|
31
|
+
javaScriptEnabled: true,
|
|
32
|
+
domStorageEnabled: true,
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNativeWebview","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","WherebyEmbed","exports","forwardRef","roomUrl","queryParams","props","ref","url","jsx","WebView","source","uri","startInLoadingState","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","javaScriptEnabled","domStorageEnabled"],"sourceRoot":"../../../src","sources":["embed/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAA6D,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAO7D,MAAMW,YAAY,GAAAC,OAAA,CAAAD,YAAA,gBAAGzB,KAAK,CAAC2B,UAAU,CACjC,CAAC;EAAEC,OAAO;EAAEC,WAAW;EAAE,GAAGC;AAAyB,CAAC,EAAEC,GAAG,KAAK;EAC5D,MAAMC,GAAG,GAAGH,WAAW,GAAG,GAAGD,OAAO,IAAIC,WAAW,EAAE,GAAGD,OAAO;EAE/D,oBACI,IAAAxB,WAAA,CAAA6B,GAAA,EAAC9B,mBAAA,CAAA+B,OAAO;IACJH,GAAG,EAAEA,GAAI;IACTI,MAAM,EAAE;MAAEC,GAAG,EAAEJ;IAAI,CAAE;IACrBK,mBAAmB;IACnBC,eAAe,EAAE,CAAC,GAAG,CAAE;IACvBC,+BAA+B,EAAE;IACjC;IAAA;IACAC,yBAAyB;IACzB;IAAA;IACAC,iBAAiB;IACjBC,iBAAiB;IAAA,GACbZ;EAAK,CACZ,CAAC;AAEV,CACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["multiply","a","b","Promise","resolve"],"sourceRoot":"../../../src","sources":["native/index.tsx"],"mappings":";;;;;;AAAO,SAASA,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAmB;EAC5D,OAAOC,OAAO,CAACC,OAAO,CAACH,CAAC,GAAGC,CAAC,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { WebView } from "react-native-webview";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
const WherebyEmbed = /*#__PURE__*/React.forwardRef(({
|
|
7
|
+
roomUrl,
|
|
8
|
+
queryParams,
|
|
9
|
+
...props
|
|
10
|
+
}, ref) => {
|
|
11
|
+
const url = queryParams ? `${roomUrl}?${queryParams}` : roomUrl;
|
|
12
|
+
return /*#__PURE__*/_jsx(WebView, {
|
|
13
|
+
ref: ref,
|
|
14
|
+
source: {
|
|
15
|
+
uri: url
|
|
16
|
+
},
|
|
17
|
+
startInLoadingState: true,
|
|
18
|
+
originWhitelist: ["*"],
|
|
19
|
+
mediaPlaybackRequiresUserAction: false
|
|
20
|
+
// iOS specific:
|
|
21
|
+
,
|
|
22
|
+
allowsInlineMediaPlayback: true
|
|
23
|
+
// Android specific:
|
|
24
|
+
,
|
|
25
|
+
javaScriptEnabled: true,
|
|
26
|
+
domStorageEnabled: true,
|
|
27
|
+
...props
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
export { WherebyEmbed };
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","WebView","jsx","_jsx","WherebyEmbed","forwardRef","roomUrl","queryParams","props","ref","url","source","uri","startInLoadingState","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","javaScriptEnabled","domStorageEnabled"],"sourceRoot":"../../../src","sources":["embed/index.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,OAAO,QAAsB,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAO7D,MAAMC,YAAY,gBAAGJ,KAAK,CAACK,UAAU,CACjC,CAAC;EAAEC,OAAO;EAAEC,WAAW;EAAE,GAAGC;AAAyB,CAAC,EAAEC,GAAG,KAAK;EAC5D,MAAMC,GAAG,GAAGH,WAAW,GAAG,GAAGD,OAAO,IAAIC,WAAW,EAAE,GAAGD,OAAO;EAE/D,oBACIH,IAAA,CAACF,OAAO;IACJQ,GAAG,EAAEA,GAAI;IACTE,MAAM,EAAE;MAAEC,GAAG,EAAEF;IAAI,CAAE;IACrBG,mBAAmB;IACnBC,eAAe,EAAE,CAAC,GAAG,CAAE;IACvBC,+BAA+B,EAAE;IACjC;IAAA;IACAC,yBAAyB;IACzB;IAAA;IACAC,iBAAiB;IACjBC,iBAAiB;IAAA,GACbV;EAAK,CACZ,CAAC;AAEV,CACJ,CAAC;AAID,SAASJ,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["multiply","a","b","Promise","resolve"],"sourceRoot":"../../../src","sources":["native/index.tsx"],"mappings":";;AAAA,OAAO,SAASA,QAAQA,CAACC,CAAS,EAAEC,CAAS,EAAmB;EAC5D,OAAOC,OAAO,CAACC,OAAO,CAACH,CAAC,GAAGC,CAAC,CAAC;AACjC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../../../babel.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bob.config.d.ts","sourceRoot":"","sources":["../../../../../bob.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../../../../jest.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { WebView, WebViewProps } from "react-native-webview";
|
|
3
|
+
interface WherebyEmbedProps extends WebViewProps {
|
|
4
|
+
roomUrl: string;
|
|
5
|
+
queryParams?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const WherebyEmbed: React.ForwardRefExoticComponent<WherebyEmbedProps & React.RefAttributes<WebView<unknown>>>;
|
|
8
|
+
type WherebyEmbedRef = React.ElementRef<typeof WebView>;
|
|
9
|
+
export { WherebyEmbed, type WherebyEmbedRef };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/embed/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,iBAAkB,SAAQ,YAAY;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,4FAoBjB,CAAC;AAEF,KAAK,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/native/index.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"babel.config.d.ts","sourceRoot":"","sources":["../../../../../babel.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bob.config.d.ts","sourceRoot":"","sources":["../../../../../bob.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../../../../../jest.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { WebView, WebViewProps } from "react-native-webview";
|
|
3
|
+
interface WherebyEmbedProps extends WebViewProps {
|
|
4
|
+
roomUrl: string;
|
|
5
|
+
queryParams?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const WherebyEmbed: React.ForwardRefExoticComponent<WherebyEmbedProps & React.RefAttributes<WebView<unknown>>>;
|
|
8
|
+
type WherebyEmbedRef = React.ElementRef<typeof WebView>;
|
|
9
|
+
export { WherebyEmbed, type WherebyEmbedRef };
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/embed/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,iBAAkB,SAAQ,YAAY;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,YAAY,4FAoBjB,CAAC;AAEF,KAAK,eAAe,GAAG,KAAK,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,KAAK,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/native/index.tsx"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE9D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../dist/commonjs/embed/index.js",
|
|
3
|
+
"module": "../dist/module/embed/index.js",
|
|
4
|
+
"source": "../src/embed/index.tsx",
|
|
5
|
+
"types": "../dist/typescript/module/packages/react-native-sdk/src/embed/index.d.ts",
|
|
6
|
+
"@whereby.com/react-native-sdk": "../src/embed/index.tsx"
|
|
7
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@whereby.com/react-native-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Modules for integration Whereby video in react native apps",
|
|
5
|
+
"source": "./src/index.tsx",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./embed": {
|
|
8
|
+
"import": {
|
|
9
|
+
"types": "./dist/typescript/module/packages/react-native-sdk/src/embed/index.d.ts",
|
|
10
|
+
"default": "./dist/module/embed/index.js"
|
|
11
|
+
},
|
|
12
|
+
"require": {
|
|
13
|
+
"types": "./dist/typescript/commonjs/packages/react-native-sdk/src/embed/index.d.ts",
|
|
14
|
+
"default": "./dist/commonjs/embed/index.js"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"embed",
|
|
21
|
+
"dist",
|
|
22
|
+
"lib",
|
|
23
|
+
"android",
|
|
24
|
+
"ios",
|
|
25
|
+
"cpp",
|
|
26
|
+
"*.podspec",
|
|
27
|
+
"!ios/build",
|
|
28
|
+
"!android/build",
|
|
29
|
+
"!android/gradle",
|
|
30
|
+
"!android/gradlew",
|
|
31
|
+
"!android/gradlew.bat",
|
|
32
|
+
"!android/local.properties",
|
|
33
|
+
"!**/__tests__",
|
|
34
|
+
"!**/__fixtures__",
|
|
35
|
+
"!**/__mocks__",
|
|
36
|
+
"!**/.*"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"test": "yarn test:typescript && yarn test:lint && yarn test:unit",
|
|
40
|
+
"test:typescript": "tsc",
|
|
41
|
+
"test:lint": "eslint src/",
|
|
42
|
+
"test:unit": "jest --passWithNoTests",
|
|
43
|
+
"test:unit:watch": "jest --watch",
|
|
44
|
+
"test:attw": "attw --pack . -f table",
|
|
45
|
+
"clean": "del-cli dist",
|
|
46
|
+
"build": "bob build"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"react-native",
|
|
50
|
+
"ios",
|
|
51
|
+
"android"
|
|
52
|
+
],
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/whereby/sdk.git.git"
|
|
56
|
+
},
|
|
57
|
+
"author": "Whereby AS",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/whereby/sdk.git/issues"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@react-native/eslint-config": "^0.73.1",
|
|
67
|
+
"@types/jest": "^29.5.5",
|
|
68
|
+
"@types/react": "^18.2.44",
|
|
69
|
+
"del-cli": "^5.1.0",
|
|
70
|
+
"jest": "^29.7.0",
|
|
71
|
+
"prettier": "^3.0.3",
|
|
72
|
+
"react": "18.2.0",
|
|
73
|
+
"react-native": "0.74.5",
|
|
74
|
+
"react-native-builder-bob": "^0.30.0",
|
|
75
|
+
"react-native-webview": "13.8.6",
|
|
76
|
+
"typescript": "^5.2.2"
|
|
77
|
+
},
|
|
78
|
+
"resolutions": {
|
|
79
|
+
"@types/react": "^18.2.44"
|
|
80
|
+
},
|
|
81
|
+
"peerDependencies": {
|
|
82
|
+
"react": "*",
|
|
83
|
+
"react-native": "*"
|
|
84
|
+
},
|
|
85
|
+
"create-react-native-library": {
|
|
86
|
+
"type": "library",
|
|
87
|
+
"version": "0.41.0"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { WebView, WebViewProps } from "react-native-webview";
|
|
3
|
+
|
|
4
|
+
interface WherebyEmbedProps extends WebViewProps {
|
|
5
|
+
roomUrl: string;
|
|
6
|
+
queryParams?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const WherebyEmbed = React.forwardRef<React.ElementRef<typeof WebView>, WherebyEmbedProps>(
|
|
10
|
+
({ roomUrl, queryParams, ...props }: WherebyEmbedProps, ref) => {
|
|
11
|
+
const url = queryParams ? `${roomUrl}?${queryParams}` : roomUrl;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<WebView
|
|
15
|
+
ref={ref}
|
|
16
|
+
source={{ uri: url }}
|
|
17
|
+
startInLoadingState
|
|
18
|
+
originWhitelist={["*"]}
|
|
19
|
+
mediaPlaybackRequiresUserAction={false}
|
|
20
|
+
// iOS specific:
|
|
21
|
+
allowsInlineMediaPlayback
|
|
22
|
+
// Android specific:
|
|
23
|
+
javaScriptEnabled
|
|
24
|
+
domStorageEnabled
|
|
25
|
+
{...props}
|
|
26
|
+
/>
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
type WherebyEmbedRef = React.ElementRef<typeof WebView>;
|
|
32
|
+
|
|
33
|
+
export { WherebyEmbed, type WherebyEmbedRef };
|