diff --git a/assets/main.33fcae96.js b/assets/main.33fcae96.js new file mode 100644 index 0000000..b703d0d --- /dev/null +++ b/assets/main.33fcae96.js @@ -0,0 +1 @@ +import{p as o}from"./populate-versions.65797d6f.js";function e(){o(),console.log("Welcome to rrwebdebug.com!")}document.addEventListener("DOMContentLoaded",e); diff --git a/assets/main.96434df1.js b/assets/main.96434df1.js deleted file mode 100644 index 813f0d3..0000000 --- a/assets/main.96434df1.js +++ /dev/null @@ -1 +0,0 @@ -import{v as r}from"./versions.659c7220.js";function s(){document.getElementById("versions").innerHTML=Object.entries(r).map(([o,e])=>{const{rrwebVersion:t}=e,n="default"in e&&e.default;return``}).join(""),console.log("Welcome to rrwebdebug.com!")}document.addEventListener("DOMContentLoaded",s); diff --git a/assets/play.96013e32.js b/assets/play.96013e32.js deleted file mode 100644 index 7924bb0..0000000 --- a/assets/play.96013e32.js +++ /dev/null @@ -1 +0,0 @@ -import{v as u}from"./versions.659c7220.js";function d(e){return Object.keys(u).includes(e)}function h(){const e=Object.entries(u).find(([t,{default:n}])=>{if(n)return!0});return e==null?void 0:e[0]}function y(e){return d(e)||(e=h()),`https://cdn.jsdelivr.net/npm/rrweb-player@${e}/dist/index.js`}function g(e){return d(e)||(e=h()),`https://cdn.jsdelivr.net/npm/rrweb-player@${e}/dist/style.css`}function b(e,t){const n=new rrwebPlayer({target:document.getElementById("player"),data:{events:e,skipInactive:!0,showDebug:!0,showWarning:!0,autoPlay:t.autoPlay,useVirtualDom:t.useVirtualDom,UNSAFE_replayCanvas:t.canvas,mouseTail:{strokeStyle:"yellow"}}});window.$c=n,window.events=e,document.querySelector(".loading").style.display="none",n.addEventListener("finish",()=>console.log("finish"))}function v(e){const t=document.getElementById("jsoneditor"),n={mode:"view"};new JSONEditor(t,n,e),window.events=events}function j(e){const t=/gist.github(?:usercontent)?.com\/[^/]+\/(\w+)/.exec(e);return(t==null?void 0:t[1])||!1}function q(e){const t=/https?:\/\/jsonblob.com\/([\w\-]+)/.exec(e);return(t==null?void 0:t[1])||!1}async function R(){const e=new URL(document.location),t=e.searchParams.get("url"),n=e.searchParams.get("version"),p=Boolean(e.searchParams.get("canvas")),m=Boolean(e.searchParams.get("play")),w=Boolean(e.searchParams.get("virtual-dom"));let o;const i=j(t),l=q(t);if(i)try{const f=await(await fetch(`https://api.github.com/gists/${i}`)).json(),c=Object.values(f.files);c[0].truncated?o=await(await fetch(c[0].raw_url)).json():o=JSON.parse(c[0].content)}catch(s){alert("something went wrong, please check the console"),console.error(s)}else if(l)try{o=await(await fetch(`https://jsonblob.com/api/v1/get/${l}`)).json()}catch(s){alert("something went wrong, please check the console"),console.error(s)}else try{o=await(await fetch(t)).json()}catch(s){alert("something went wrong, please check the console"),console.error(s)}const r=document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("href",g(n)),document.head.appendChild(r);const a=document.createElement("script");a.setAttribute("src",y(n)),a.addEventListener("load",function(){b(o,{canvas:p,autoPlay:m,useVirtualDom:w}),v(o)}),document.head.appendChild(a),document.querySelector("a.json").setAttribute("href",t),document.querySelector("a.json").innerText=t}document.onload=R(); diff --git a/assets/play.bbd01d58.js b/assets/play.bbd01d58.js new file mode 100644 index 0000000..3b9abf9 --- /dev/null +++ b/assets/play.bbd01d58.js @@ -0,0 +1 @@ +import{v as d,p as w}from"./populate-versions.65797d6f.js";function f(e){return Object.keys(d).includes(e)}function y(){const e=Object.entries(d).find(([t,{default:n}])=>{if(n)return!0});return e==null?void 0:e[0]}function g(e){return`https://cdn.jsdelivr.net/npm/rrweb-player@${e}/dist/index.js`}function v(e){return`https://cdn.jsdelivr.net/npm/rrweb-player@${e}/dist/style.css`}function b(e){w(e),document.getElementById("versions").addEventListener("change",t=>{const n=t.target.value,r=new URL(document.location);r.searchParams.set("version",n),document.location.href=r.href})}function j(e,t){const n=new rrwebPlayer({target:document.getElementById("player"),data:{events:e,skipInactive:!0,showDebug:!0,showWarning:!0,autoPlay:t.autoPlay,useVirtualDom:t.useVirtualDom,UNSAFE_replayCanvas:t.canvas,mouseTail:{strokeStyle:"yellow"}}});window.$c=n,window.events=e,document.querySelector(".loading").style.display="none",n.addEventListener("finish",()=>console.log("finish"))}function E(e){const t=document.getElementById("jsoneditor"),n={mode:"view"};new JSONEditor(t,n,e),window.events=events}function R(e){const t=/gist.github(?:usercontent)?.com\/[^/]+\/(\w+)/.exec(e);return(t==null?void 0:t[1])||!1}function q(e){const t=/https?:\/\/jsonblob.com\/([\w\-]+)/.exec(e);return(t==null?void 0:t[1])||!1}async function P(){const e=new URL(document.location),t=e.searchParams.get("url");let n=e.searchParams.get("version");f(n)||(n=y());const r=Boolean(e.searchParams.get("canvas")),h=Boolean(e.searchParams.get("play")),m=Boolean(e.searchParams.get("virtual-dom"));let o;const l=R(t),u=q(t);if(l)try{const p=await(await fetch(`https://api.github.com/gists/${l}`)).json(),i=Object.values(p.files);i[0].truncated?o=await(await fetch(i[0].raw_url)).json():o=JSON.parse(i[0].content)}catch(s){alert("something went wrong, please check the console"),console.error(s)}else if(u)try{o=await(await fetch(`https://jsonblob.com/api/v1/get/${u}`)).json()}catch(s){alert("something went wrong, please check the console"),console.error(s)}else try{o=await(await fetch(t)).json()}catch(s){alert("something went wrong, please check the console"),console.error(s)}const a=document.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",v(n)),document.head.appendChild(a);const c=document.createElement("script");c.setAttribute("src",g(n)),c.addEventListener("load",function(){j(o,{canvas:r,autoPlay:h,useVirtualDom:m}),E(o)}),b(n),document.head.appendChild(c),document.querySelector("a.json").setAttribute("href",t),document.querySelector("a.json").innerText=t}document.onload=P(); diff --git a/assets/versions.659c7220.js b/assets/populate-versions.65797d6f.js similarity index 68% rename from assets/versions.659c7220.js rename to assets/populate-versions.65797d6f.js index f34648d..7c68adc 100644 --- a/assets/versions.659c7220.js +++ b/assets/populate-versions.65797d6f.js @@ -1 +1 @@ -const s=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))a(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const n of r.addedNodes)n.tagName==="LINK"&&n.rel==="modulepreload"&&a(n)}).observe(document,{childList:!0,subtree:!0});function i(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function a(e){if(e.ep)return;e.ep=!0;const r=i(e);fetch(e.href,r)}};s();var l={"0.7.1":{rrwebVersion:"0.9.14"},"0.7.2":{rrwebVersion:"1.0.0"},"0.7.3":{rrwebVersion:"1.0.1"},"0.7.4":{rrwebVersion:"1.0.2"},"0.7.5":{rrwebVersion:"1.0.3"},"0.7.6":{rrwebVersion:"1.0.4"},"0.7.7":{rrwebVersion:"1.0.5"},"0.7.8":{rrwebVersion:"1.0.6"},"0.7.9":{rrwebVersion:"1.0.7"},"0.7.10":{rrwebVersion:"1.0.8"},"0.7.11":{rrwebVersion:"1.1.0"},"0.7.13":{rrwebVersion:"1.1.2"},"0.7.14":{rrwebVersion:"1.1.3"},"1.0.0-alpha.0":{rrwebVersion:"2.0.0-alpha.0"},"1.0.0-alpha.1":{rrwebVersion:"2.0.0-alpha.1"},"1.0.0-alpha.2":{rrwebVersion:"2.0.0-alpha.2"},"1.0.0-alpha.3":{rrwebVersion:"2.0.0-alpha.3"},"2.0.0-alpha.5":{rrwebVersion:"2.0.0-alpha.5"},"2.0.0-alpha.6":{rrwebVersion:"2.0.0-alpha.6"},"2.0.0-alpha.7":{rrwebVersion:"2.0.0-alpha.7"},"2.0.0-alpha.8":{rrwebVersion:"2.0.0-alpha.8"},"2.0.0-alpha.9":{rrwebVersion:"2.0.0-alpha.9"},"2.0.0-alpha.10":{rrwebVersion:"2.0.0-alpha.10"},"2.0.0-alpha.11":{rrwebVersion:"2.0.0-alpha.11",default:!0}};export{l as v}; +const s=function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&t(i)}).observe(document,{childList:!0,subtree:!0});function n(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function t(e){if(e.ep)return;e.ep=!0;const r=n(e);fetch(e.href,r)}};s();var l={"0.7.1":{rrwebVersion:"0.9.14"},"0.7.2":{rrwebVersion:"1.0.0"},"0.7.3":{rrwebVersion:"1.0.1"},"0.7.4":{rrwebVersion:"1.0.2"},"0.7.5":{rrwebVersion:"1.0.3"},"0.7.6":{rrwebVersion:"1.0.4"},"0.7.7":{rrwebVersion:"1.0.5"},"0.7.8":{rrwebVersion:"1.0.6"},"0.7.9":{rrwebVersion:"1.0.7"},"0.7.10":{rrwebVersion:"1.0.8"},"0.7.11":{rrwebVersion:"1.1.0"},"0.7.13":{rrwebVersion:"1.1.2"},"0.7.14":{rrwebVersion:"1.1.3"},"1.0.0-alpha.0":{rrwebVersion:"2.0.0-alpha.0"},"1.0.0-alpha.1":{rrwebVersion:"2.0.0-alpha.1"},"1.0.0-alpha.2":{rrwebVersion:"2.0.0-alpha.2"},"1.0.0-alpha.3":{rrwebVersion:"2.0.0-alpha.3"},"2.0.0-alpha.5":{rrwebVersion:"2.0.0-alpha.5"},"2.0.0-alpha.6":{rrwebVersion:"2.0.0-alpha.6"},"2.0.0-alpha.7":{rrwebVersion:"2.0.0-alpha.7"},"2.0.0-alpha.8":{rrwebVersion:"2.0.0-alpha.8"},"2.0.0-alpha.9":{rrwebVersion:"2.0.0-alpha.9"},"2.0.0-alpha.10":{rrwebVersion:"2.0.0-alpha.10"},"2.0.0-alpha.11":{rrwebVersion:"2.0.0-alpha.11",default:!0}};function p(a){document.getElementById("versions").innerHTML=Object.entries(l).map(([o,n])=>{const{rrwebVersion:t}=n,e="default"in n&&n.default;return``}).join(""),a&&(document.getElementById("versions").value=a)}export{p,l as v}; diff --git a/index.html b/index.html index 51b2e53..e0bd5d2 100644 --- a/index.html +++ b/index.html @@ -16,8 +16,8 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous" > - - + + diff --git a/play/index.html b/play/index.html index 12189c9..3ef03ac 100644 --- a/play/index.html +++ b/play/index.html @@ -25,11 +25,15 @@ crossorigin="anonymous" /> - - + +

Events JSON: loading...

+

+ Version: + +

Loading player...