@100mslive/roomkit-web 0.0.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/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # `@100mslive/roomkit-web`
2
+
3
+ A web component implementation of the HMSPrebuilt component from [roomkit-react](https://www.100ms.live/docs/javascript/v2/quickstart/prebuilt-quickstart) library.
4
+
5
+ ## Usage
6
+
7
+ ```
8
+ import '@100mslive/roomkit-web'
9
+
10
+ Vue
11
+
12
+ YourComponent.vue
13
+
14
+ <template>
15
+ <hms-prebuilt room-code="<room-code-goes-here>"></hms-prebuilt>
16
+ </template>
17
+ <script>
18
+ import '@100mslive/roomkit-web';
19
+ </script>
20
+ ```
21
+
22
+ ## Props
23
+
24
+ `hms-prebuilt` accepts the following props:
25
+
26
+ `room-code` (optional if roomId and role are being used instead)
27
+ - The room code of the room you want to join. You can get the room code from the [100ms dashboard](https://dashboard.100ms.live). This prop can be skipped if the roomId and role are being provided instead.
28
+
29
+ `logo` (optional)
30
+ - An image URL as a string which is displayed in the preview screen and header.
31
+
32
+ `auth-token` (optional)
33
+ - This token is room and role specific. It can be copied from the join room modal on the [dashboard](https://dashboard.100ms.live). Read more about it [here](/get-started/v2/get-started/security-and-tokens#auth-token-for-client-sdks).
34
+
35
+ `roomId` (optional unless roomCode is not being used)
36
+ - The room ID of the room you want to join. You can get the room ID from the [dashboard](https://dashboard.100ms.live). It should be specified with the role prop if the room code is not being provided.
37
+
38
+ `role` (optional unless roomId is specified)
39
+ - A string specifying the role of the peer. Should be specified if the roomId is being used to join the room.
40
+
41
+ `on-join` (optional)
42
+ - A callback function that will be executed after the peer joins the call.
43
+
44
+ `on-leave` (optional)
45
+ - A callback function that will be executed after the peer leaves the call, the session ends or if the peer gets kicked out.
46
+
47
+ `options` (optional)
48
+ - A stringified JSON object which accepts the following parameters:
49
+ - `userName` (optional): The name to be assigned to the peer.
50
+
51
+ - `userId` (optional): The user ID to be assigned to the peer.
52
+
53
+ > NOTE: The callbacks on-join and on-leave havet to be present on the `window` as of now for them to be triggered.
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+
25
+ // src/index.js
26
+ var import_react_to_web_component = __toESM(require("@r2wc/react-to-web-component"));
27
+ var import_roomkit_react = require("@100mslive/roomkit-react");
28
+ var HMSPrebuiltWebComponent = (0, import_react_to_web_component.default)(import_roomkit_react.HMSPrebuilt, {
29
+ props: {
30
+ roomCode: "string",
31
+ authToken: "string",
32
+ roomId: "string",
33
+ role: "string",
34
+ options: "json",
35
+ onLeave: "function"
36
+ }
37
+ });
38
+ customElements.define("hms-prebuilt", HMSPrebuiltWebComponent);
39
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["import r2wc from '@r2wc/react-to-web-component';\nimport { HMSPrebuilt } from '@100mslive/roomkit-react';\n\nconst HMSPrebuiltWebComponent = r2wc(HMSPrebuilt, {\n props: {\n roomCode: 'string',\n authToken: 'string',\n roomId: 'string',\n role: 'string',\n options: 'json',\n onLeave: 'function',\n },\n});\n\ncustomElements.define('hms-prebuilt', HMSPrebuiltWebComponent);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAiB;AACjB,2BAA4B;AAE5B,IAAM,8BAA0B,8BAAAA,SAAK,kCAAa;AAAA,EAChD,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACF,CAAC;AAED,eAAe,OAAO,gBAAgB,uBAAuB;",
6
+ "names": ["r2wc"]
7
+ }
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ // src/index.js
2
+ import r2wc from "@r2wc/react-to-web-component";
3
+ import { HMSPrebuilt } from "@100mslive/roomkit-react";
4
+ var HMSPrebuiltWebComponent = r2wc(HMSPrebuilt, {
5
+ props: {
6
+ roomCode: "string",
7
+ authToken: "string",
8
+ roomId: "string",
9
+ role: "string",
10
+ options: "json",
11
+ onLeave: "function"
12
+ }
13
+ });
14
+ customElements.define("hms-prebuilt", HMSPrebuiltWebComponent);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.js"],
4
+ "sourcesContent": ["import r2wc from '@r2wc/react-to-web-component';\nimport { HMSPrebuilt } from '@100mslive/roomkit-react';\n\nconst HMSPrebuiltWebComponent = r2wc(HMSPrebuilt, {\n props: {\n roomCode: 'string',\n authToken: 'string',\n roomId: 'string',\n role: 'string',\n options: 'json',\n onLeave: 'function',\n },\n});\n\ncustomElements.define('hms-prebuilt', HMSPrebuiltWebComponent);\n"],
5
+ "mappings": ";AAAA,OAAO,UAAU;AACjB,SAAS,mBAAmB;AAE5B,IAAM,0BAA0B,KAAK,aAAa;AAAA,EAChD,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AACF,CAAC;AAED,eAAe,OAAO,gBAAgB,uBAAuB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "inputs": {
3
+ "<define:process.env>": {
4
+ "bytes": 0,
5
+ "imports": []
6
+ },
7
+ "src/index.js": {
8
+ "bytes": 380,
9
+ "imports": [
10
+ {
11
+ "path": "@r2wc/react-to-web-component",
12
+ "kind": "import-statement",
13
+ "external": true
14
+ },
15
+ {
16
+ "path": "@100mslive/roomkit-react",
17
+ "kind": "import-statement",
18
+ "external": true
19
+ },
20
+ {
21
+ "path": "<define:process.env>",
22
+ "kind": "import-statement",
23
+ "external": true
24
+ }
25
+ ],
26
+ "format": "esm"
27
+ }
28
+ },
29
+ "outputs": {
30
+ "dist/index.cjs.js.map": {
31
+ "imports": [],
32
+ "exports": [],
33
+ "inputs": {},
34
+ "bytes": 754
35
+ },
36
+ "dist/index.cjs.js": {
37
+ "imports": [
38
+ {
39
+ "path": "@r2wc/react-to-web-component",
40
+ "kind": "require-call",
41
+ "external": true
42
+ },
43
+ {
44
+ "path": "@100mslive/roomkit-react",
45
+ "kind": "require-call",
46
+ "external": true
47
+ }
48
+ ],
49
+ "exports": [],
50
+ "entryPoint": "src/index.js",
51
+ "inputs": {
52
+ "src/index.js": {
53
+ "bytesInOutput": 478
54
+ }
55
+ },
56
+ "bytes": 1709
57
+ }
58
+ }
59
+ }
@@ -0,0 +1,59 @@
1
+ {
2
+ "inputs": {
3
+ "<define:process.env>": {
4
+ "bytes": 0,
5
+ "imports": []
6
+ },
7
+ "src/index.js": {
8
+ "bytes": 380,
9
+ "imports": [
10
+ {
11
+ "path": "@r2wc/react-to-web-component",
12
+ "kind": "import-statement",
13
+ "external": true
14
+ },
15
+ {
16
+ "path": "@100mslive/roomkit-react",
17
+ "kind": "import-statement",
18
+ "external": true
19
+ },
20
+ {
21
+ "path": "<define:process.env>",
22
+ "kind": "import-statement",
23
+ "external": true
24
+ }
25
+ ],
26
+ "format": "esm"
27
+ }
28
+ },
29
+ "outputs": {
30
+ "dist/index.js.map": {
31
+ "imports": [],
32
+ "exports": [],
33
+ "inputs": {},
34
+ "bytes": 724
35
+ },
36
+ "dist/index.js": {
37
+ "imports": [
38
+ {
39
+ "path": "@r2wc/react-to-web-component",
40
+ "kind": "import-statement",
41
+ "external": true
42
+ },
43
+ {
44
+ "path": "@100mslive/roomkit-react",
45
+ "kind": "import-statement",
46
+ "external": true
47
+ }
48
+ ],
49
+ "exports": [],
50
+ "entryPoint": "src/index.js",
51
+ "inputs": {
52
+ "src/index.js": {
53
+ "bytesInOutput": 374
54
+ }
55
+ },
56
+ "bytes": 424
57
+ }
58
+ }
59
+ }
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@100mslive/roomkit-web",
3
+ "version": "0.0.1",
4
+ "description": "A web component implementation of 100ms Prebuilt component",
5
+ "keywords": [
6
+ "web-components",
7
+ "100ms",
8
+ "Prebuilt"
9
+ ],
10
+ "source": "src/index.ts",
11
+ "main": "dist/index.cjs.js",
12
+ "module": "dist/index.js",
13
+ "typings": "dist/index.d.ts",
14
+ "author": "100ms",
15
+ "license": "MIT",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "exports": {
20
+ ".": {
21
+ "require": "./dist/index.cjs.js",
22
+ "import": "./dist/index.js",
23
+ "default": "./dist/index.js"
24
+ }
25
+ },
26
+ "sideEffects": false,
27
+ "scripts": {
28
+ "build": "rm -rf dist && node ../../scripts/build-webapp"
29
+ },
30
+ "dependencies": {
31
+ "@100mslive/roomkit-react": "0.1.9",
32
+ "@r2wc/react-to-web-component": "2.0.2"
33
+ }
34
+ }