liveroom-client-element 0.0.50 → 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 -57
- package/dist/liveroom-client-element.js +1543 -19338
- package/dist/main.cjs +1 -1
- package/dist/main.js +37 -59
- package/package.json +14 -14
- package/dist/constants-Bnl9ENcX.js +0 -15
- package/dist/constants-DPiV-x94.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.9.8",
|
|
33
|
-
"phx-live-state": "0.12.1"
|
|
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,15 +0,0 @@
|
|
|
1
|
-
const _ = "0.0.50", o = {
|
|
2
|
-
version: _
|
|
3
|
-
}, E = o.version, s = "liveroom-client-element", e = "_liveroom_id", O = "_liveroom_token", R = "_liveroom_user_name", n = "_liveroom_user_color", S = "liveroom-id", r = "liveroom-token", c = "liveroom-user-name", t = "liveroom-user-color";
|
|
4
|
-
export {
|
|
5
|
-
s as E,
|
|
6
|
-
R as Q,
|
|
7
|
-
S,
|
|
8
|
-
E as V,
|
|
9
|
-
r as a,
|
|
10
|
-
c as b,
|
|
11
|
-
n as c,
|
|
12
|
-
t as d,
|
|
13
|
-
e,
|
|
14
|
-
O as f
|
|
15
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const _="0.0.50",E={version:_},O=E.version,R="liveroom-client-element",S="_liveroom_id",o="_liveroom_token",A="_liveroom_user_name",e="_liveroom_user_color",Y="liveroom-id",n="liveroom-token",s="liveroom-user-name",M="liveroom-user-color";exports.ELEMENT_TAG=R;exports.QUERY_PARAM_KEY_ROOM_ID=S;exports.QUERY_PARAM_KEY_ROOM_TOKEN=o;exports.QUERY_PARAM_KEY_USER_COLOR=e;exports.QUERY_PARAM_KEY_USER_NAME=A;exports.SESSION_STORAGE_KEY_ROOM_ID=Y;exports.SESSION_STORAGE_KEY_ROOM_TOKEN=n;exports.SESSION_STORAGE_KEY_USER_COLOR=M;exports.SESSION_STORAGE_KEY_USER_NAME=s;exports.VERSION=O;
|