liveroom-client-element 0.0.33 → 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/main.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const a=i=>Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"})),d="liveroom-client-element",u="0.0.33",v="module",p="./dist/main.js",f="./dist/main.cjs",_=["dist","!dist/vite.svg"],y={".":{import:"./dist/main.js",require:"./dist/main.cjs"},"./liveroom-client-element":{import:"./dist/liveroom-client-element.js",require:"./dist/liveroom-client-element.cjs"}},b={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"},g={"livekit-client":"1.13.4","phx-live-state":"0.10.2"},j={"@sveltejs/vite-plugin-svelte":"2.4.6","@tsconfig/svelte":"5.0.2",prettier:"3.0.3",svelte:"4.2.1","svelte-check":"3.5.2",tslib:"2.6.2",typescript:"5.2.2",vite:"4.4.9"},h={name:d,private:!1,version:u,type:v,module:p,main:f,files:_,exports:y,scripts:b,dependencies:g,devDependencies:j};let s,t,e=null;const w="liveroom-client-element",r=h.version;c();k();async function c(){const n=new URLSearchParams(window.location.search).get("_liveroom");e=document.querySelector("script[src*='/liveroom-client-element']"),e==null||e.setAttribute("version",r);const l=(e==null?void 0:e.getAttribute("data-url"))||"wss://liveroom.app/client_socket",m=(e==null?void 0:e.getAttribute("data-roomid"))||null,o=n||m;o&&o!=s&&(s=o,t&&(t.remove(),t=void 0),await E(l,s))}function k(){window.addEventListener("popstate",c)}async function E(i,n){return n?(await Promise.resolve().then(()=>a(require("./liveroom-client-element.cjs"))),console.log(`[Liveroom] Installed successfully (v${r})`),t=document.createElement(w),t.setAttribute("url",i),t.setAttribute("version",r),n&&t.setAttribute("room_id",n),document.body.appendChild(t),console.log("[Liveroom] Injected successfully"),!0):!1}
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,62 +1,60 @@
1
- const a = "liveroom-client-element", d = "0.0.33", v = "module", u = "./dist/main.js", p = "./dist/main.cjs", f = [
2
- "dist",
3
- "!dist/vite.svg"
4
- ], _ = {
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"
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;
3
+ u();
4
+ f();
5
+ function f() {
6
+ window.addEventListener("popstate", u);
7
+ }
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
+ );
12
24
  }
13
- }, w = {
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
- }, y = {
22
- "livekit-client": "1.13.4",
23
- "phx-live-state": "0.10.2"
24
- }, b = {
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
- }, g = {
34
- name: a,
35
- private: !1,
36
- version: d,
37
- type: v,
38
- module: u,
39
- main: p,
40
- files: f,
41
- exports: _,
42
- scripts: w,
43
- dependencies: y,
44
- devDependencies: b
45
- };
46
- let o, t, e = null;
47
- const h = "liveroom-client-element", s = g.version;
48
- c();
49
- j();
50
- async function c() {
51
- const n = new URLSearchParams(window.location.search).get("_liveroom");
52
- e = // prod
53
- document.querySelector("script[src*='/liveroom-client-element']"), e == null || e.setAttribute("version", s);
54
- const l = (e == null ? void 0 : e.getAttribute("data-url")) || "wss://liveroom.app/client_socket", m = (e == null ? void 0 : e.getAttribute("data-roomid")) || null, i = n || m;
55
- i && i != o && (o = i, t && (t.remove(), t = void 0), await k(l, o));
56
25
  }
57
- function j() {
58
- window.addEventListener("popstate", c);
26
+ async function d(e, t) {
27
+ if (!t)
28
+ return !1;
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
+ );
59
54
  }
60
- async function k(r, n) {
61
- return n ? (await import("./liveroom-client-element.js"), console.log(`[Liveroom] Installed successfully (v${s})`), t = document.createElement(h), t.setAttribute("url", r), t.setAttribute("version", s), n && t.setAttribute("room_id", n), document.body.appendChild(t), console.log("[Liveroom] Injected successfully"), !0) : !1;
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;
62
60
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "liveroom-client-element",
3
3
  "private": false,
4
- "version": "0.0.33",
4
+ "version": "0.0.35",
5
5
  "type": "module",
6
6
  "module": "./dist/main.js",
7
7
  "main": "./dist/main.cjs",