liveroom-client-element 0.0.34 → 0.0.35
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-10f2f8fa.cjs +1 -0
- package/dist/constants-351e7840.js +55 -0
- package/dist/liveroom-client-element.cjs +9 -9
- package/dist/liveroom-client-element.js +2338 -2326
- package/dist/main.cjs +1 -1
- package/dist/main.js +55 -65
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const s=require("./constants-10f2f8fa.cjs"),l=e=>Object.freeze(Object.defineProperty({__proto__:null,default:e},Symbol.toStringTag,{value:"Module"}));let a,n;c();i();function i(){window.addEventListener("popstate",c)}async function c(){const e=document.querySelector("script[src*='/liveroom-client-element']");e==null||e.setAttribute("version",s.VERSION);const t=S(e);if(t&&t!=a){a=t,sessionStorage==null||sessionStorage.setItem(s.SESSION_STORAGE_KEY_ROOM_ID,a),n&&(n.remove(),n=void 0);const o=e==null?void 0:e.getAttribute("data-url");await _(o||"wss://liveroom.app/client_socket",a)}}async function _(e,t){if(!t)return!1;await Promise.resolve().then(()=>l(require("./liveroom-client-element.cjs"))),console.log(`[Liveroom] Installed successfully (v${s.VERSION})`),n=document.createElement(s.ELEMENT_TAG),n.setAttribute("url",e),n.setAttribute("version",s.VERSION),t&&n.setAttribute("room_id",t);const o=m();o&&n.setAttribute("user_name",o);const r=E();return r&&n.setAttribute("user_color",r),document.body.appendChild(n),console.log("[Liveroom] Injected successfully"),!0}function m(){const t=new URLSearchParams(window.location.search).get(s.QUERY_PARAM_KEY_USER_NAME),o=sessionStorage==null?void 0:sessionStorage.getItem(s.SESSION_STORAGE_KEY_USER_NAME);return t||o||null}function E(){const t=new URLSearchParams(window.location.search).get(s.QUERY_PARAM_KEY_USER_COLOR),o=sessionStorage==null?void 0:sessionStorage.getItem(s.SESSION_STORAGE_KEY_USER_COLOR);return t||o||null}function S(e){const o=new URLSearchParams(window.location.search).get(s.QUERY_PARAM_KEY_ROOM_ID),r=sessionStorage==null?void 0:sessionStorage.getItem(s.SESSION_STORAGE_KEY_ROOM_ID),u=(e==null?void 0:e.getAttribute("data-roomid"))||null;return R(o||r||u)}function R(e){const t=e==null?void 0:e.split("https://meet.google.com/"),o=t==null?void 0:t[1];return(o?o.split("?")[0]:t==null?void 0:t[0])||null}
|
package/dist/main.js
CHANGED
|
@@ -1,70 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
"!dist/vite.svg"
|
|
4
|
-
], w = {
|
|
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
|
-
}, b = {
|
|
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
|
-
}, h = {
|
|
22
|
-
"livekit-client": "1.13.4",
|
|
23
|
-
"phx-live-state": "0.10.2"
|
|
24
|
-
}, y = {
|
|
25
|
-
"@sveltejs/vite-plugin-svelte": "2.4.6",
|
|
26
|
-
"@tsconfig/svelte": "5.0.2",
|
|
27
|
-
prettier: "3.0.3",
|
|
28
|
-
svelte: "4.2.1",
|
|
29
|
-
"svelte-check": "3.5.2",
|
|
30
|
-
tslib: "2.6.2",
|
|
31
|
-
typescript: "5.2.2",
|
|
32
|
-
vite: "4.4.9"
|
|
33
|
-
}, j = {
|
|
34
|
-
name: p,
|
|
35
|
-
private: !1,
|
|
36
|
-
version: f,
|
|
37
|
-
type: E,
|
|
38
|
-
module: _,
|
|
39
|
-
main: g,
|
|
40
|
-
files: A,
|
|
41
|
-
exports: w,
|
|
42
|
-
scripts: b,
|
|
43
|
-
dependencies: h,
|
|
44
|
-
devDependencies: y
|
|
45
|
-
};
|
|
46
|
-
let r, t, e = null;
|
|
47
|
-
const S = "_liveroom", k = "_liveroom_user_name", v = "liveroom-room-id", R = "liveroom-client-element", c = j.version;
|
|
1
|
+
import { V as a, S as c, E as m, Q as l, a as _, b as E, c as S, d as R } from "./constants-351e7840.js";
|
|
2
|
+
let r, o;
|
|
48
3
|
u();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const i = new URLSearchParams(window.location.search).get(S), m = sessionStorage == null ? void 0 : sessionStorage.getItem(v);
|
|
52
|
-
e = // prod
|
|
53
|
-
document.querySelector("script[src*='/liveroom-client-element']"), e == null || e.setAttribute("version", c);
|
|
54
|
-
const o = (e == null ? void 0 : e.getAttribute("data-url")) || "wss://liveroom.app/client_socket", d = (e == null ? void 0 : e.getAttribute("data-roomid")) || null;
|
|
55
|
-
let s = i || m || d || void 0;
|
|
56
|
-
const n = s == null ? void 0 : s.split(
|
|
57
|
-
"https://meet.google.com/"
|
|
58
|
-
), a = n == null ? void 0 : n[1];
|
|
59
|
-
s = a ? a.split("?")[0] : n == null ? void 0 : n[0], s && s != r && (r = s, sessionStorage == null || sessionStorage.setItem(v, r), t && (t.remove(), t = void 0), await L(o, r));
|
|
60
|
-
}
|
|
61
|
-
function I() {
|
|
4
|
+
f();
|
|
5
|
+
function f() {
|
|
62
6
|
window.addEventListener("popstate", u);
|
|
63
7
|
}
|
|
64
|
-
async function
|
|
65
|
-
|
|
8
|
+
async function u() {
|
|
9
|
+
const e = (
|
|
10
|
+
// prod
|
|
11
|
+
document.querySelector(
|
|
12
|
+
"script[src*='/liveroom-client-element']"
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
e == null || e.setAttribute("version", a);
|
|
16
|
+
const t = I(e);
|
|
17
|
+
if (t && t != r) {
|
|
18
|
+
r = t, sessionStorage == null || sessionStorage.setItem(c, r), o && (o.remove(), o = void 0);
|
|
19
|
+
const s = e == null ? void 0 : e.getAttribute("data-url");
|
|
20
|
+
await d(
|
|
21
|
+
s || "wss://liveroom.app/client_socket",
|
|
22
|
+
r
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
async function d(e, t) {
|
|
27
|
+
if (!t)
|
|
66
28
|
return !1;
|
|
67
|
-
await import("./liveroom-client-element.js"), console.log(`[Liveroom] Installed successfully (v${
|
|
68
|
-
const
|
|
69
|
-
|
|
29
|
+
await import("./liveroom-client-element.js"), console.log(`[Liveroom] Installed successfully (v${a})`), o = document.createElement(m), o.setAttribute("url", e), o.setAttribute("version", a), t && o.setAttribute("room_id", t);
|
|
30
|
+
const s = A();
|
|
31
|
+
s && o.setAttribute("user_name", s);
|
|
32
|
+
const n = g();
|
|
33
|
+
return n && o.setAttribute("user_color", n), document.body.appendChild(o), console.log("[Liveroom] Injected successfully"), !0;
|
|
34
|
+
}
|
|
35
|
+
function A() {
|
|
36
|
+
const t = new URLSearchParams(window.location.search).get(l), s = sessionStorage == null ? void 0 : sessionStorage.getItem(
|
|
37
|
+
_
|
|
38
|
+
);
|
|
39
|
+
return t || s || null;
|
|
40
|
+
}
|
|
41
|
+
function g() {
|
|
42
|
+
const t = new URLSearchParams(window.location.search).get(E), s = sessionStorage == null ? void 0 : sessionStorage.getItem(
|
|
43
|
+
S
|
|
44
|
+
);
|
|
45
|
+
return t || s || null;
|
|
46
|
+
}
|
|
47
|
+
function I(e) {
|
|
48
|
+
const s = new URLSearchParams(window.location.search).get(R), n = sessionStorage == null ? void 0 : sessionStorage.getItem(
|
|
49
|
+
c
|
|
50
|
+
), i = (e == null ? void 0 : e.getAttribute("data-roomid")) || null;
|
|
51
|
+
return O(
|
|
52
|
+
s || n || i
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function O(e) {
|
|
56
|
+
const t = e == null ? void 0 : e.split(
|
|
57
|
+
"https://meet.google.com/"
|
|
58
|
+
), s = t == null ? void 0 : t[1];
|
|
59
|
+
return (s ? s.split("?")[0] : t == null ? void 0 : t[0]) || null;
|
|
70
60
|
}
|