liveroom-client-element 0.0.34 → 0.0.36

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 p=i=>Object.freeze(Object.defineProperty({__proto__:null,default:i},Symbol.toStringTag,{value:"Module"})),f="liveroom-client-element",_="0.0.34",E="module",g="./dist/main.js",b="./dist/main.cjs",y=["dist","!dist/vite.svg"],A={".":{import:"./dist/main.js",require:"./dist/main.cjs"},"./liveroom-client-element":{import:"./dist/liveroom-client-element.js",require:"./dist/liveroom-client-element.cjs"}},h={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"},j={"livekit-client":"1.13.4","phx-live-state":"0.10.2"},w={"@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"},S={name:f,private:!1,version:_,type:E,module:g,main:b,files:y,exports:A,scripts:h,dependencies:j,devDependencies:w};let c,t,e=null;const k="_liveroom",R="_liveroom_user_name",u="liveroom-room-id",I="liveroom-client-element",l=S.version;v();O();async function v(){const o=new URLSearchParams(window.location.search).get(k),a=sessionStorage==null?void 0:sessionStorage.getItem(u);e=document.querySelector("script[src*='/liveroom-client-element']"),e==null||e.setAttribute("version",l);const r=(e==null?void 0:e.getAttribute("data-url"))||"wss://liveroom.app/client_socket",d=(e==null?void 0:e.getAttribute("data-roomid"))||null;let s=o||a||d||void 0;const n=s==null?void 0:s.split("https://meet.google.com/"),m=n==null?void 0:n[1];s=m?m.split("?")[0]:n==null?void 0:n[0],s&&s!=c&&(c=s,sessionStorage==null||sessionStorage.setItem(u,c),t&&(t.remove(),t=void 0),await P(r,c))}function O(){window.addEventListener("popstate",v)}async function P(i,o){if(!o)return!1;await Promise.resolve().then(()=>p(require("./liveroom-client-element.cjs"))),console.log(`[Liveroom] Installed successfully (v${l})`),t=document.createElement(I),t.setAttribute("url",i),t.setAttribute("version",l),o&&t.setAttribute("room_id",o);const r=new URLSearchParams(window.location.search).get(R);return r&&t.setAttribute("user_name",r),document.body.appendChild(t),console.log("[Liveroom] Injected successfully"),!0}
1
+ "use strict";const s=require("./constants-d9d958c9.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
- const p = "liveroom-client-element", f = "0.0.34", E = "module", _ = "./dist/main.js", g = "./dist/main.cjs", A = [
2
- "dist",
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-0103de6d.js";
2
+ let r, o;
48
3
  u();
49
- I();
50
- async function u() {
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 L(l, i) {
65
- if (!i)
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${c})`), t = document.createElement(R), t.setAttribute("url", l), t.setAttribute("version", c), i && t.setAttribute("room_id", i);
68
- const o = new URLSearchParams(window.location.search).get(k);
69
- return o && t.setAttribute("user_name", o), document.body.appendChild(t), console.log("[Liveroom] Injected successfully"), !0;
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
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "liveroom-client-element",
3
3
  "private": false,
4
- "version": "0.0.34",
4
+ "version": "0.0.36",
5
5
  "type": "module",
6
6
  "module": "./dist/main.js",
7
7
  "main": "./dist/main.cjs",