@telepath-computer/television 0.1.215 → 0.1.216
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/cli.cjs +62 -19
- package/dist/views/artifact-missing/index.html +2 -2
- package/dist/views/markdown/index.html +22 -22
- package/dist/web/assets/artifact-bridge-3Trk-B2L.js +1 -0
- package/dist/web/assets/{artifactMissing-9rcTXhkH.js → artifactMissing-BiK_l3Ts.js} +1 -1
- package/dist/web/assets/main-V14r9Psb.js +596 -0
- package/dist/web/assets/{urlUnsupported-kgq7Zh2V.js → urlUnsupported-RGIrhMDe.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/views/artifact-missing/index.html +2 -2
- package/dist/web/views/url-unsupported/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/artifact-bridge-BXDhGuL-.js +0 -1
- package/dist/web/assets/main-Z-io-D9l.js +0 -596
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){const m=document.createElement("link").relList;if(m&&m.supports&&m.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))b(a);new MutationObserver(a=>{for(const g of a)if(g.type==="childList")for(const R of g.addedNodes)R.tagName==="LINK"&&R.rel==="modulepreload"&&b(R)}).observe(document,{childList:!0,subtree:!0});function S(a){const g={};return a.integrity&&(g.integrity=a.integrity),a.referrerPolicy&&(g.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?g.credentials="include":a.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function b(a){if(a.ep)return;a.ep=!0;const g=S(a);fetch(a.href,g)}})();const U="url-target-request",O="url-target",I="artifact-missing-request",P="artifact-missing",N="proxy-content-changed",C="bridge-ready",G="leaving";function K(t,m){return!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown")||t.isComposing||t.metaKey||t.shiftKey?!1:m==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(m)?t.altKey&&!t.ctrlKey:t.ctrlKey&&!t.altKey}function L(t){return typeof t=="object"&&t!==null}function q(t){return!L(t)||t.type!==U?!1:!("id"in t)}function B(t){return!L(t)||t.type!==O||typeof t.url!="string"&&t.url!==null?!1:!("id"in t)}function x(t){return!L(t)||t.type!==I?!1:!("id"in t)}function Y(t){return!L(t)||t.type!==P||typeof t.title!="string"||typeof t.path!="string"?!1:!("id"in t)}function v(t){return!L(t)||t.type!==N?!1:!("id"in t)}function F(t){return!L(t)||t.type!==C||typeof t.guid!="string"?!1:!("id"in t)}function V(t){return!L(t)||t.type!==G||typeof t.guid!="string"?!1:!("id"in t)}function w(t){return!L(t)||t.type!=="navigation-request"||typeof t.url!="string"||"replace"in t&&typeof t.replace!="boolean"||"sameDocument"in t&&typeof t.sameDocument!="boolean"||"native"in t&&typeof t.native!="boolean"?!1:!("id"in t)}function W(t){return!L(t)||t.type!=="navigation-key"||t.key!=="ArrowLeft"&&t.key!=="ArrowRight"&&t.key!=="ArrowUp"&&t.key!=="ArrowDown"?!1:!("id"in t)}function X(t=window,m={}){const S=t;if(t.parent===t||S.__televisionArtifactBridgeInstalled===!0)return;S.__televisionArtifactBridgeInstalled=!0;const a=(()=>{const u=Date.now().toString(36);try{const d=t.crypto;if(d&&typeof d.getRandomValues=="function"){const c=new Uint32Array(4);return d.getRandomValues(c),`tvb-${u}-${Array.from(c,A=>A.toString(36)).join("-")}`}}catch{}return`tvb-${u}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`})(),g=()=>{t.parent.postMessage({type:"bridge-ready",guid:a},"*")};t.addEventListener("pagehide",()=>{t.parent.postMessage({type:"leaving",guid:a},"*")}),t.addEventListener("pageshow",h=>{h.persisted===!0&&g()}),t.addEventListener("keydown",h=>{const i=h,u=i.key==="ArrowLeft"||i.key==="ArrowRight"||i.key==="ArrowUp"||i.key==="ArrowDown",d=t.navigator.platform,A=d==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(d)?i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey:i.ctrlKey&&!i.altKey&&!i.metaKey&&!i.shiftKey;!u||i.isComposing||!A||(i.preventDefault(),t.parent.postMessage({type:"navigation-key",key:i.key},"*"))},!0);const R=t.location.href;if((h=>{try{const i=new URL(h);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(i.pathname)}catch{return!1}})(R)&&typeof t.fetch=="function"){const u=m.pollCadence,d=u!==void 0&&Number.isFinite(u.normalMs)&&u.normalMs>0&&Number.isFinite(u.slowMs)&&u.slowMs>=u.normalMs?u:null,c=(d==null?void 0:d.normalMs)??5e3,A=(d==null?void 0:d.slowMs)??15e3;let o=null,f=c,r=0,e=!1,s=null,n=null;const y=()=>{e&&(e=!1,r+=1,s!==null&&(t.clearTimeout(s),s=null),n==null||n.abort(),n=null)},p=()=>{if(e)return;e=!0;const l=++r,D=()=>{if(!e||l!==r)return;s=null;const M=t.AbortController,E=typeof M=="function"?new M:null;n=E,(async()=>{try{const T=await t.fetch(R,{method:"HEAD",...E?{signal:E.signal}:{}});if(!e||l!==r)return;if(!T.ok)throw new Error("Artifact poll failed");const _=T.headers.get("ETag");if(!_)throw new Error("Artifact poll missing ETag");f=c,o===null?o=_:_!==o&&(o=_,t.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{e&&l===r&&(f=Math.min(A,f*2))}finally{n===E&&(n=null),e&&l===r&&(s=t.setTimeout(D,f))}})()};D()};t.addEventListener("pagehide",y),t.addEventListener("pageshow",l=>{l.persisted===!0&&p()}),p()}if(m.reportNavigation!==!1){const h=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]),i=(o,f)=>{try{const r=new URL(o,f);return r.protocol==="http:"||r.protocol==="https:"||h.has(r.protocol)?null:r}catch{return null}},u=(o,f)=>{try{const r=new URL(o,f);return r.protocol==="http:"||r.protocol==="https:"?r:null}catch{return null}},d=o=>{var l;const f=o.type==="click"&&o.button===0,r=o.type==="auxclick"&&o.button===1;if(!f&&!r)return;const e=(l=t.document.defaultView)==null?void 0:l.Element;if(!e||!(o.target instanceof e))return;const s=o.target.closest("a[href]");if(!s)return;const n=i(s.href,t.document.baseURI);if(!n)return;const y=s.target.toLowerCase();!(r||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||y!==""&&y!=="_self")&&!s.hasAttribute("download")||(o.preventDefault(),t.location.href=n.href)};t.document.addEventListener("click",d,!0),t.document.addEventListener("auxclick",d,!0);const c=o=>{t.parent.postMessage({type:"navigation-request",...o},"*")};c({url:t.location.href});const A=t.navigation;if(A)A.addEventListener("navigate",o=>{var p,l;const f=o,r=(p=f.destination)==null?void 0:p.url;if(typeof r!="string")return;const e=u(r,t.location.href);if(!e)return;const s=((l=f.destination)==null?void 0:l.sameDocument)===!0,n={url:r,...f.navigationType==="replace"?{replace:!0}:{},...s?{sameDocument:!0}:{}};if(s){c(n);return}if(e.origin===t.location.origin){c({...n,native:!0});return}f.canIntercept!==!1&&f.preventDefault(),c(n)});else{t.document.addEventListener("click",r=>{var l;const e=r;if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const s=(l=t.document.defaultView)==null?void 0:l.Element;if(!s||!(e.target instanceof s))return;const n=e.target.closest("a[href]");if(!n||n.target&&n.target.toLowerCase()!=="_self"||n.hasAttribute("download")||!n.getAttribute("href"))return;const p=u(n.href,t.document.baseURI);if(p){if(p.origin===t.location.origin&&p.pathname===t.location.pathname&&p.search===t.location.search&&p.hash!==""){c({url:p.href,sameDocument:!0});return}e.preventDefault(),c({url:p.href})}},!0);const o=t.history.pushState.bind(t.history),f=t.history.replaceState.bind(t.history);t.history.pushState=function(...e){o(...e),c({url:t.location.href,sameDocument:!0})},t.history.replaceState=function(...e){f(...e),c({url:t.location.href,replace:!0,sameDocument:!0})},t.addEventListener("popstate",()=>{c({url:t.location.href,sameDocument:!0})}),t.addEventListener("hashchange",()=>{c({url:t.location.href,sameDocument:!0})}),t.document.addEventListener("submit",r=>{var l,D;const e=r,s=e.target,n=(l=t.document.defaultView)==null?void 0:l.HTMLFormElement;if(!n||!(s instanceof n)||s.target&&s.target.toLowerCase()!=="_self")return;const y=u(s.action||t.location.href,t.document.baseURI);if(!y)return;if(e.preventDefault(),s.method.toLowerCase()==="get"){const M=(D=t.document.defaultView)==null?void 0:D.FormData;if(!M)return;const E=new URLSearchParams;for(const[T,_]of new M(s))typeof _=="string"&&E.append(T,_);y.search=E.toString()}c({url:y.href})},!0)}}g()}export{P as A,O as U,V as a,F as b,W as c,w as d,v as e,q as f,K as g,X as h,x as i,Y as j,I as k,B as l,U as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d,j as m,k as p}from"./artifact-bridge-
|
|
1
|
+
import{h as d,j as m,k as p}from"./artifact-bridge-3Trk-B2L.js";import{m as l,a as E,b as f}from"./missing-artifact-page-DVzJ41AE.js";d(window,{reportNavigation:!1});document.getElementById("missing-title")!==null&&i(null);window.addEventListener("message",t=>{t.source===window.parent&&m(t.data)&&i(t.data)});var a;(a=window.__televisionContentBridge)==null||a.onHostMessage(t=>{m(t)&&i(t)});const c={type:p};window.parent.postMessage(c,"*");var g;(g=window.__televisionContentBridge)==null||g.postToHost(c);function i(t,n=document){const e=w(n);if(e.title.textContent=l(),e.description.textContent=E(),e.recovery.textContent=f(),n.title=(t==null?void 0:t.title)||l(),t===null){e.path.textContent="",e.pathBlock.hidden=!0;return}e.path.textContent=t.path,e.pathBlock.hidden=!1}function w(t){const n=t.getElementById("missing-title"),e=t.getElementById("missing-description"),s=t.getElementById("path-block"),o=t.getElementById("missing-path"),r=t.getElementById("missing-recovery");if(!(n instanceof HTMLElement))throw new Error("Missing #missing-title");if(!(e instanceof HTMLElement))throw new Error("Missing #missing-description");if(!(s instanceof HTMLElement))throw new Error("Missing #path-block");if(!(o instanceof HTMLElement))throw new Error("Missing #missing-path");if(!(r instanceof HTMLElement))throw new Error("Missing #missing-recovery");return{title:n,description:e,pathBlock:s,path:o,recovery:r}}
|