liveroom-client-element 0.0.11 → 0.0.13
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/main.cjs +1 -1
- package/dist/main.js +14 -14
- package/package.json +5 -5
package/dist/main.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=
|
|
1
|
+
"use strict";const i=n=>Object.freeze(Object.defineProperty({__proto__:null,default:n},Symbol.toStringTag,{value:"Module"}));let l,t;c();u();const m="liveroom-client-element";async function c(){const o=new URLSearchParams(window.location.search).get("_liveroom"),e=document.querySelector("script[src*='liveroom-client-element.js']")||document.querySelector("script[src*='client/dist/main.js']"),s=(e==null?void 0:e.getAttribute("data-url"))||"wss://liveroom.app/client_socket",a=(e==null?void 0:e.getAttribute("data-roomid"))||null,r=o||a;r&&r!=l&&(l=r,t&&(t.remove(),t=void 0),await d(s,l))}function u(){window.addEventListener("popstate",c)}async function d(n,o){if(!o)return!1;await Promise.resolve().then(()=>i(require("./liveroom-client-element.cjs"))),console.log("[Liveroom] Installed successfully");const e=document.getElementsByTagName("body")[0];return t=document.createElement(m),t.setAttribute("url",n),o&&t.setAttribute("room_id",o),e.appendChild(t),console.log("[Liveroom] Injected successfully"),!0}
|
package/dist/main.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
let
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
async function
|
|
6
|
-
const o = new URLSearchParams(window.location.search).get("_liveroom"),
|
|
1
|
+
let r, t;
|
|
2
|
+
l();
|
|
3
|
+
m();
|
|
4
|
+
const i = "liveroom-client-element";
|
|
5
|
+
async function l() {
|
|
6
|
+
const o = new URLSearchParams(window.location.search).get("_liveroom"), e = (
|
|
7
7
|
// prod
|
|
8
8
|
document.querySelector("script[src*='liveroom-client-element.js']") || // local dev
|
|
9
9
|
document.querySelector("script[src*='client/dist/main.js']")
|
|
10
|
-
),
|
|
11
|
-
|
|
10
|
+
), s = (e == null ? void 0 : e.getAttribute("data-url")) || "wss://liveroom.app/client_socket", a = (e == null ? void 0 : e.getAttribute("data-roomid")) || null, n = o || a;
|
|
11
|
+
n && n != r && (r = n, t && (t.remove(), t = void 0), await u(s, r));
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
window.addEventListener("popstate",
|
|
13
|
+
function m() {
|
|
14
|
+
window.addEventListener("popstate", l);
|
|
15
15
|
}
|
|
16
|
-
async function
|
|
17
|
-
if (!
|
|
16
|
+
async function u(c, o) {
|
|
17
|
+
if (!o)
|
|
18
18
|
return !1;
|
|
19
19
|
await import("./liveroom-client-element.js"), console.log("[Liveroom] Installed successfully");
|
|
20
|
-
const
|
|
21
|
-
return
|
|
20
|
+
const e = document.getElementsByTagName("body")[0];
|
|
21
|
+
return t = document.createElement(i), t.setAttribute("url", c), o && t.setAttribute("room_id", o), e.appendChild(t), console.log("[Liveroom] Injected successfully"), !0;
|
|
22
22
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liveroom-client-element",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"module": "./dist/main.js",
|
|
7
|
+
"main": "./dist/main.cjs",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"import": "./dist/main.js",
|
|
14
|
-
"require": "./dist/main.
|
|
14
|
+
"require": "./dist/main.cjs"
|
|
15
15
|
},
|
|
16
16
|
"./liveroom-client-element": {
|
|
17
17
|
"import": "./dist/liveroom-client-element.js",
|
|
18
|
-
"require": "./dist/liveroom-client-element.
|
|
18
|
+
"require": "./dist/liveroom-client-element.cjs"
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|