liveroom-client-element 0.0.49 → 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/dist/constants-Crg5Qc0w.js +3 -0
- package/dist/constants-X_93hTEi.cjs +1 -0
- package/dist/livekit-client.esm-B1rknK61.js +19569 -0
- package/dist/livekit-client.esm-DiyxitqE.cjs +39 -0
- package/dist/liveroom-client-element.cjs +59 -56
- package/dist/liveroom-client-element.js +1542 -19395
- package/dist/main.cjs +1 -1
- package/dist/main.js +37 -59
- package/package.json +14 -14
- package/dist/constants-C8O2fXxM.js +0 -57
- package/dist/constants-mjPxcM4R.cjs +0 -1
package/dist/main.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require("./constants-X_93hTEi.cjs");var t,n,r;a(),i();function i(){window.addEventListener(`popstate`,a)}async function a(){let i=document.querySelector(`script[src*='/liveroom-client-element']`);i?.setAttribute(`version`,e.u);let{roomId:a,roomToken:s}=l(i);if(a&&s&&(a!=t||s!=n)){t=a,n=s,sessionStorage?.setItem(e.o,t),sessionStorage?.setItem(e.s,n),r&&=(r.remove(),void 0);let c=i?.getAttribute(`data-url`);await o(c||`wss://liveroom.app/room`,t,n)}}async function o(t,n,i){if(!n||!i)return!1;await Promise.resolve().then(()=>require("./liveroom-client-element.cjs")),console.log(`[Liveroom] Installed successfully (v${e.u})`),r=document.createElement(e.t),r.setAttribute(`url`,t),r.setAttribute(`version`,e.u),n&&r.setAttribute(`room_id`,n),n&&r.setAttribute(`room_token`,i);let a=s();a&&r.setAttribute(`user_name`,a);let o=c();return o&&r.setAttribute(`user_color`,o),document.body.appendChild(r),console.log(`[Liveroom] Injected successfully`),!0}function s(){let t=new URLSearchParams(window.location.search).get(e.a),n=sessionStorage?.getItem(e.l);return t||n||null}function c(){let t=new URLSearchParams(window.location.search).get(e.i),n=sessionStorage?.getItem(e.c);return t||n||null}function l(t){let n=new URLSearchParams(window.location.search),r=n.get(e.n),i=n.get(e.r),a=sessionStorage?.getItem(e.o),o=sessionStorage?.getItem(e.s),s=t?.getAttribute(`data-roomid`)||null,c=t?.getAttribute(`data-roomtoken`)||null;return{roomId:u(r||s||a),roomToken:i||c||o}}function u(e){let t=e?.split(`https://meet.google.com/`),n=t?.[1];return(n?n.split(`?`)[0]:t?.[0])||null}
|
package/dist/main.js
CHANGED
|
@@ -1,66 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./constants-Crg5Qc0w.js";
|
|
2
|
+
// src/main.ts
|
|
3
|
+
var u, d, f;
|
|
4
|
+
m(), p();
|
|
5
|
+
function p() {
|
|
6
|
+
window.addEventListener("popstate", m);
|
|
7
7
|
}
|
|
8
|
-
async function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (t && o && (t != a || o != m)) {
|
|
18
|
-
a = t, m = o, sessionStorage == null || sessionStorage.setItem(u, a), sessionStorage == null || sessionStorage.setItem(c, m), s && (s.remove(), s = void 0);
|
|
19
|
-
const n = e == null ? void 0 : e.getAttribute("data-url");
|
|
20
|
-
await U(
|
|
21
|
-
n || "wss://liveroom.app/room",
|
|
22
|
-
a,
|
|
23
|
-
m
|
|
24
|
-
);
|
|
25
|
-
}
|
|
8
|
+
async function m() {
|
|
9
|
+
let e = document.querySelector("script[src*='/liveroom-client-element']");
|
|
10
|
+
e?.setAttribute("version", l);
|
|
11
|
+
let { roomId: t, roomToken: n } = v(e);
|
|
12
|
+
if (t && n && (t != u || n != d)) {
|
|
13
|
+
u = t, d = n, sessionStorage?.setItem(a, u), sessionStorage?.setItem(s, d), f &&= (f.remove(), void 0);
|
|
14
|
+
let r = e?.getAttribute("data-url");
|
|
15
|
+
await h(r || "wss://liveroom.app/room", u, d);
|
|
16
|
+
}
|
|
26
17
|
}
|
|
27
|
-
async function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return r && s.setAttribute("user_color", r), document.body.appendChild(s), console.log("[Liveroom] Injected successfully"), !0;
|
|
18
|
+
async function h(e, t, n) {
|
|
19
|
+
if (!t || !n) return !1;
|
|
20
|
+
await import("./liveroom-client-element.js"), console.log(`[Liveroom] Installed successfully (v${l})`), f = document.createElement(c), f.setAttribute("url", e), f.setAttribute("version", l), t && f.setAttribute("room_id", t), t && f.setAttribute("room_token", n);
|
|
21
|
+
let r = g();
|
|
22
|
+
r && f.setAttribute("user_name", r);
|
|
23
|
+
let i = _();
|
|
24
|
+
return i && f.setAttribute("user_color", i), document.body.appendChild(f), console.log("[Liveroom] Injected successfully"), !0;
|
|
35
25
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
40
|
-
return t || o || null;
|
|
26
|
+
function g() {
|
|
27
|
+
let t = new URLSearchParams(window.location.search).get(e), n = sessionStorage?.getItem(r);
|
|
28
|
+
return t || n || null;
|
|
41
29
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
);
|
|
46
|
-
return t || o || null;
|
|
30
|
+
function _() {
|
|
31
|
+
let e = new URLSearchParams(window.location.search).get(n), r = sessionStorage?.getItem(t);
|
|
32
|
+
return e || r || null;
|
|
47
33
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
roomId: M(
|
|
56
|
-
o || E || r
|
|
57
|
-
),
|
|
58
|
-
roomToken: n || S || i
|
|
59
|
-
};
|
|
34
|
+
function v(e) {
|
|
35
|
+
let t = new URLSearchParams(window.location.search), n = t.get(i), r = t.get(o), c = sessionStorage?.getItem(a), l = sessionStorage?.getItem(s), u = e?.getAttribute("data-roomid") || null, d = e?.getAttribute("data-roomtoken") || null;
|
|
36
|
+
return {
|
|
37
|
+
roomId: y(n || u || c),
|
|
38
|
+
roomToken: r || d || l
|
|
39
|
+
};
|
|
60
40
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
), o = t == null ? void 0 : t[1];
|
|
65
|
-
return (o ? o.split("?")[0] : t == null ? void 0 : t[0]) || null;
|
|
41
|
+
function y(e) {
|
|
42
|
+
let t = e?.split("https://meet.google.com/"), n = t?.[1];
|
|
43
|
+
return (n ? n.split("?")[0] : t?.[0]) || null;
|
|
66
44
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liveroom-client-element",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/liveroom-app/liveroom.git",
|
|
8
|
+
"directory": "client"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"module": "./dist/main.js",
|
|
7
12
|
"main": "./dist/main.cjs",
|
|
@@ -25,21 +30,16 @@
|
|
|
25
30
|
"preview": "vite preview",
|
|
26
31
|
"format": "prettier --write .",
|
|
27
32
|
"check-format": "prettier . --check",
|
|
28
|
-
"check": "
|
|
33
|
+
"check": "tsc --noEmit",
|
|
29
34
|
"lint": "npm run check-format && npm run check"
|
|
30
35
|
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"livekit-client": "2.0.10",
|
|
33
|
-
"phx-live-state": "0.11.2"
|
|
34
|
-
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"vite": "5.2.6"
|
|
37
|
+
"prettier": "3.9.10",
|
|
38
|
+
"tslib": "2.9.1",
|
|
39
|
+
"typescript": "7.0.2",
|
|
40
|
+
"vite": "8.3.6"
|
|
41
|
+
},
|
|
42
|
+
"allowScripts": {
|
|
43
|
+
"fsevents": false
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
const e = "liveroom-client-element", t = "0.0.49", s = "module", i = "./dist/main.js", o = "./dist/main.cjs", n = [
|
|
2
|
-
"dist",
|
|
3
|
-
"!dist/vite.svg"
|
|
4
|
-
], c = {
|
|
5
|
-
".": {
|
|
6
|
-
import: "./dist/main.js",
|
|
7
|
-
require: "./dist/main.cjs"
|
|
8
|
-
},
|
|
9
|
-
"./liveroom-client-element": {
|
|
10
|
-
import: "./dist/liveroom-client-element.js",
|
|
11
|
-
require: "./dist/liveroom-client-element.cjs"
|
|
12
|
-
}
|
|
13
|
-
}, r = {
|
|
14
|
-
dev: "vite",
|
|
15
|
-
build: "vite build",
|
|
16
|
-
preview: "vite preview",
|
|
17
|
-
format: "prettier --write .",
|
|
18
|
-
"check-format": "prettier . --check",
|
|
19
|
-
check: "svelte-check --tsconfig ./tsconfig.json",
|
|
20
|
-
lint: "npm run check-format && npm run check"
|
|
21
|
-
}, l = {
|
|
22
|
-
"livekit-client": "2.0.10",
|
|
23
|
-
"phx-live-state": "0.11.2"
|
|
24
|
-
}, _ = {
|
|
25
|
-
"@sveltejs/vite-plugin-svelte": "3.0.2",
|
|
26
|
-
"@tsconfig/svelte": "5.0.3",
|
|
27
|
-
prettier: "3.2.5",
|
|
28
|
-
svelte: "4.2.12",
|
|
29
|
-
"svelte-check": "3.6.8",
|
|
30
|
-
tslib: "2.6.2",
|
|
31
|
-
typescript: "5.4.3",
|
|
32
|
-
vite: "5.2.6"
|
|
33
|
-
}, m = {
|
|
34
|
-
name: e,
|
|
35
|
-
private: !1,
|
|
36
|
-
version: t,
|
|
37
|
-
type: s,
|
|
38
|
-
module: i,
|
|
39
|
-
main: o,
|
|
40
|
-
files: n,
|
|
41
|
-
exports: c,
|
|
42
|
-
scripts: r,
|
|
43
|
-
dependencies: l,
|
|
44
|
-
devDependencies: _
|
|
45
|
-
}, v = m.version, E = "liveroom-client-element", a = "_liveroom_id", p = "_liveroom_token", d = "_liveroom_user_name", O = "_liveroom_user_color", R = "liveroom-id", S = "liveroom-token", A = "liveroom-user-name", u = "liveroom-user-color";
|
|
46
|
-
export {
|
|
47
|
-
E,
|
|
48
|
-
d as Q,
|
|
49
|
-
R as S,
|
|
50
|
-
v as V,
|
|
51
|
-
S as a,
|
|
52
|
-
A as b,
|
|
53
|
-
O as c,
|
|
54
|
-
u as d,
|
|
55
|
-
a as e,
|
|
56
|
-
p as f
|
|
57
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e="liveroom-client-element",t="0.0.49",i="module",_="./dist/main.js",s="./dist/main.cjs",o=["dist","!dist/vite.svg"],n={".":{import:"./dist/main.js",require:"./dist/main.cjs"},"./liveroom-client-element":{import:"./dist/liveroom-client-element.js",require:"./dist/liveroom-client-element.cjs"}},E={dev:"vite",build:"vite build",preview:"vite preview",format:"prettier --write .","check-format":"prettier . --check",check:"svelte-check --tsconfig ./tsconfig.json",lint:"npm run check-format && npm run check"},c={"livekit-client":"2.0.10","phx-live-state":"0.11.2"},r={"@sveltejs/vite-plugin-svelte":"3.0.2","@tsconfig/svelte":"5.0.3",prettier:"3.2.5",svelte:"4.2.12","svelte-check":"3.6.8",tslib:"2.6.2",typescript:"5.4.3",vite:"5.2.6"},O={name:e,private:!1,version:t,type:i,module:_,main:s,files:o,exports:n,scripts:E,dependencies:c,devDependencies:r},R=O.version,l="liveroom-client-element",S="_liveroom_id",m="_liveroom_token",v="_liveroom_user_name",A="_liveroom_user_color",p="liveroom-id",d="liveroom-token",Y="liveroom-user-name",M="liveroom-user-color";exports.ELEMENT_TAG=l;exports.QUERY_PARAM_KEY_ROOM_ID=S;exports.QUERY_PARAM_KEY_ROOM_TOKEN=m;exports.QUERY_PARAM_KEY_USER_COLOR=A;exports.QUERY_PARAM_KEY_USER_NAME=v;exports.SESSION_STORAGE_KEY_ROOM_ID=p;exports.SESSION_STORAGE_KEY_ROOM_TOKEN=d;exports.SESSION_STORAGE_KEY_USER_COLOR=M;exports.SESSION_STORAGE_KEY_USER_NAME=Y;exports.VERSION=R;
|