@telepath-computer/television 0.1.183 → 0.1.184

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.
@@ -1 +1 @@
1
- import{k as a,n as o,o as d}from"./artifact-bridge-C0H5cXgO.js";a(window,{reportNavigation:!1});window.addEventListener("message",t=>{t.source===window.parent&&o(t.data)&&l(t.data.url)});window.parent.postMessage({type:d},"*");function l(t,n=document){const e=f(n);if(p(e),t===null){e.targetBlock.hidden=!0,e.desktopApp.hidden=!1;return}const r=g(t);if(e.targetBlock.hidden=!1,e.desktopApp.hidden=!1,e.addressLabel.textContent="This is the URL you're trying to visit:",r){e.targetLink.textContent=t,e.targetLink.href=r.href,e.targetLink.hidden=!1;return}e.plainAddress.textContent=t,e.plainAddress.hidden=!1}function p(t){t.targetLink.removeAttribute("href"),t.targetLink.textContent="",t.targetLink.hidden=!0,t.addressLabel.textContent="",t.plainAddress.textContent="",t.plainAddress.hidden=!0}function g(t){try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}catch{return null}}function f(t){const n=t.getElementById("target-block"),e=t.getElementById("address-label"),r=t.getElementById("target-link"),s=t.getElementById("plain-address"),i=t.getElementById("desktop-app");if(!(n instanceof HTMLElement))throw new Error("Missing #target-block");if(!(e instanceof HTMLElement))throw new Error("Missing #address-label");if(!(r instanceof HTMLAnchorElement))throw new Error("Missing #target-link");if(!(s instanceof HTMLElement))throw new Error("Missing #plain-address");if(!(i instanceof HTMLElement))throw new Error("Missing #desktop-app");return{targetBlock:n,addressLabel:e,targetLink:r,plainAddress:s,desktopApp:i}}
1
+ import{k as a,n as o,o as d}from"./artifact-bridge-BhiFDvPj.js";a(window,{reportNavigation:!1});window.addEventListener("message",t=>{t.source===window.parent&&o(t.data)&&l(t.data.url)});window.parent.postMessage({type:d},"*");function l(t,n=document){const e=f(n);if(p(e),t===null){e.targetBlock.hidden=!0,e.desktopApp.hidden=!1;return}const r=g(t);if(e.targetBlock.hidden=!1,e.desktopApp.hidden=!1,e.addressLabel.textContent="This is the URL you're trying to visit:",r){e.targetLink.textContent=t,e.targetLink.href=r.href,e.targetLink.hidden=!1;return}e.plainAddress.textContent=t,e.plainAddress.hidden=!1}function p(t){t.targetLink.removeAttribute("href"),t.targetLink.textContent="",t.targetLink.hidden=!0,t.addressLabel.textContent="",t.plainAddress.textContent="",t.plainAddress.hidden=!0}function g(t){try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}catch{return null}}function f(t){const n=t.getElementById("target-block"),e=t.getElementById("address-label"),r=t.getElementById("target-link"),s=t.getElementById("plain-address"),i=t.getElementById("desktop-app");if(!(n instanceof HTMLElement))throw new Error("Missing #target-block");if(!(e instanceof HTMLElement))throw new Error("Missing #address-label");if(!(r instanceof HTMLAnchorElement))throw new Error("Missing #target-link");if(!(s instanceof HTMLElement))throw new Error("Missing #plain-address");if(!(i instanceof HTMLElement))throw new Error("Missing #desktop-app");return{targetBlock:n,addressLabel:e,targetLink:r,plainAddress:s,desktopApp:i}}
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
6
  <link rel="icon" type="image/svg+xml" href="./assets/favicon-DaYMFRha.svg" />
7
7
  <title>Television</title>
8
- <script type="module" crossorigin src="./assets/main-D1MjT1Io.js"></script>
9
- <link rel="modulepreload" crossorigin href="./assets/artifact-bridge-C0H5cXgO.js">
8
+ <script type="module" crossorigin src="./assets/main-Bm2zCJif.js"></script>
9
+ <link rel="modulepreload" crossorigin href="./assets/artifact-bridge-BhiFDvPj.js">
10
10
  <link rel="modulepreload" crossorigin href="./assets/missing-artifact-page-DVzJ41AE.js">
11
11
  <link rel="stylesheet" crossorigin href="./assets/main-5017mprd.css">
12
12
  </head>
@@ -58,8 +58,8 @@
58
58
  display: none !important;
59
59
  }
60
60
  </style>
61
- <script type="module" crossorigin src="../../assets/artifactMissing-DWPZdkiF.js"></script>
62
- <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-C0H5cXgO.js">
61
+ <script type="module" crossorigin src="../../assets/artifactMissing-DY3nzD0p.js"></script>
62
+ <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-BhiFDvPj.js">
63
63
  <link rel="modulepreload" crossorigin href="../../assets/missing-artifact-page-DVzJ41AE.js">
64
64
  </head>
65
65
  <body>
@@ -70,8 +70,8 @@
70
70
  display: none !important;
71
71
  }
72
72
  </style>
73
- <script type="module" crossorigin src="../../assets/urlUnsupported-VVXPf33N.js"></script>
74
- <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-C0H5cXgO.js">
73
+ <script type="module" crossorigin src="../../assets/urlUnsupported-B2K6eB7H.js"></script>
74
+ <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-BhiFDvPj.js">
75
75
  </head>
76
76
  <body>
77
77
  <main>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telepath-computer/television",
3
- "version": "0.1.183",
3
+ "version": "0.1.184",
4
4
  "type": "module",
5
5
  "main": "dist/cli.cjs",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- (function(){const y=document.createElement("link").relList;if(y&&y.supports&&y.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))L(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&L(m)}).observe(document,{childList:!0,subtree:!0});function E(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function L(c){if(c.ep)return;c.ep=!0;const u=E(c);fetch(c.href,u)}})();const X="url-target-request",v="url-target",O="artifact-missing-request",U="artifact-missing",G="proxy-content-changed",P="bridge-ready",C="leaving";function d(t){return typeof t=="object"&&t!==null}function B(t){return!d(t)||t.type!==X?!1:!("id"in t)}function K(t){return!d(t)||t.type!==v||typeof t.url!="string"&&t.url!==null?!1:!("id"in t)}function x(t){return!d(t)||t.type!==O?!1:!("id"in t)}function W(t){return!d(t)||t.type!==U||typeof t.title!="string"||typeof t.path!="string"?!1:!("id"in t)}function k(t){return!d(t)||t.type!==G?!1:!("id"in t)}function q(t){return!d(t)||t.type!==P||typeof t.url!="string"||"guid"in t&&typeof t.guid!="string"?!1:!("id"in t)}function V(t){return!d(t)||t.type!==C||typeof t.guid!="string"?!1:!("id"in t)}function F(t){return!d(t)||t.type!=="wheel"||typeof t.deltaX!="number"||typeof t.shiftKey!="boolean"?!1:!("id"in t)}function $(t){return!d(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 j(t){return!d(t)||t.type!=="filmstrip-key"||t.direction!==-1&&t.direction!==1?!1:!("id"in t)}function z(t){return!d(t)||t.type!=="swipe-move"||typeof t.deltaX!="number"?!1:!("id"in t)}function H(t){return!d(t)||t.type!=="swipe-end"||typeof t.velocityX!="number"?!1:!("id"in t)}function Q(t=window,y={}){const E=t;if(E.__televisionArtifactBridgeInstalled===!0||(E.__televisionArtifactBridgeInstalled=!0,t.parent===t))return;const c=(()=>{const r=Date.now().toString(36);try{const s=t.crypto;if(s&&typeof s.getRandomValues=="function"){const a=new Uint32Array(4);return s.getRandomValues(a),`tvb-${r}-${Array.from(a,n=>n.toString(36)).join("-")}`}}catch{}return`tvb-${r}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`})(),u=()=>{t.parent.postMessage({type:"bridge-ready",url:t.location.href,guid:c},"*")};t.addEventListener("pagehide",()=>{t.parent.postMessage({type:"leaving",guid:c},"*")}),t.addEventListener("pageshow",o=>{o.persisted===!0&&u()});const m=t.location.href;if((o=>{try{const e=new URL(o);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e.pathname)}catch{return!1}})(m)&&typeof t.fetch=="function"){let r=null,s=5e3,a=!1;const n=()=>{(async()=>{try{const i=await t.fetch(m,{method:"HEAD"});if(!i.ok)throw new Error("Artifact poll failed");const f=i.headers.get("ETag");if(!f)throw new Error("Artifact poll missing ETag");s=5e3,r===null?r=f:f!==r&&(r=f,t.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{s=Math.min(15e3,s*2)}finally{a||t.setTimeout(n,s)}})()};t.addEventListener("pagehide",()=>{a=!0}),n()}const _=()=>{t.document.documentElement&&(t.document.documentElement.style.touchAction="pan-y",t.document.documentElement.style.overscrollBehaviorX="contain",t.document.documentElement.style.overscrollBehaviorY="contain"),t.document.body&&(t.document.body.style.overscrollBehaviorX="contain",t.document.body.style.overscrollBehaviorY="contain")};if(_(),t.document.body||t.document.addEventListener("DOMContentLoaded",_,{once:!0}),y.reportNavigation!==!1){const o=r=>{t.parent.postMessage({type:"navigation-request",...r},"*")};o({url:t.location.href});const e=t.navigation;if(e)e.addEventListener("navigate",r=>{var p,l;const s=r,a=(p=s.destination)==null?void 0:p.url;if(typeof a!="string")return;const n=((l=s.destination)==null?void 0:l.sameDocument)===!0,i={url:a,...s.navigationType==="replace"?{replace:!0}:{},...n?{sameDocument:!0}:{}};if(n){o(i);return}try{if(new URL(a,t.location.href).origin===t.location.origin){o({...i,native:!0});return}}catch{}s.canIntercept!==!1&&s.preventDefault(),o(i)});else{t.document.addEventListener("click",a=>{var h;const n=a;if(n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;const i=(h=t.document.defaultView)==null?void 0:h.Element;if(!i||!(n.target instanceof i))return;const f=n.target.closest("a[href]");if(!f||f.target&&f.target.toLowerCase()!=="_self"||f.hasAttribute("download"))return;const p=f.getAttribute("href");if(!p||p.startsWith("javascript:"))return;let l;try{l=new URL(f.href,t.document.baseURI)}catch{return}if(l.origin===t.location.origin&&l.pathname===t.location.pathname&&l.search===t.location.search&&l.hash!==""){o({url:l.href,sameDocument:!0});return}n.preventDefault(),o({url:l.href})},!0);const r=t.history.pushState.bind(t.history),s=t.history.replaceState.bind(t.history);t.history.pushState=function(...n){r(...n),o({url:t.location.href,sameDocument:!0})},t.history.replaceState=function(...n){s(...n),o({url:t.location.href,replace:!0,sameDocument:!0})},t.addEventListener("popstate",()=>{o({url:t.location.href,sameDocument:!0})}),t.addEventListener("hashchange",()=>{o({url:t.location.href,sameDocument:!0})}),t.document.addEventListener("submit",a=>{var h,b;const n=a,i=n.target,f=(h=t.document.defaultView)==null?void 0:h.HTMLFormElement;if(!f||!(i instanceof f)||i.target&&i.target.toLowerCase()!=="_self")return;n.preventDefault();const p=i.method.toLowerCase(),l=new URL(i.action||t.location.href,t.document.baseURI);if(p==="get"){const A=(b=t.document.defaultView)==null?void 0:b.FormData;if(!A)return;const R=new URLSearchParams;for(const[N,M]of new A(i))typeof M=="string"&&R.append(N,M);l.search=R.toString()}o({url:l.href})},!0)}}const D=o=>{var a,n;const e=(a=t.document.defaultView)==null?void 0:a.Element;if(!e||!(o instanceof e))return!1;const s=o.closest("input, textarea, select, [contenteditable], [role='textbox'], [role='searchbox'], [role='combobox'], [role='spinbutton'], [role='slider']");return s?s.hasAttribute("contenteditable")?((n=s.getAttribute("contenteditable"))==null?void 0:n.toLowerCase())!=="false":!0:!1};t.addEventListener("keydown",o=>{const e=o;e.key!=="ArrowLeft"&&e.key!=="ArrowRight"||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||D(e.target)||(e.preventDefault(),t.parent.postMessage({type:"filmstrip-key",direction:e.key==="ArrowRight"?1:-1},"*"))},{capture:!0}),t.addEventListener("wheel",o=>{const e=o,r=e.shiftKey&&e.deltaX===0&&e.deltaY!==0,s=r?e.deltaY:e.deltaX,a=Math.abs(s),n=r?0:Math.abs(e.deltaY);a<=n||(e.preventDefault(),t.parent.postMessage({type:"wheel",deltaX:s,shiftKey:e.shiftKey},"*"))},{passive:!1});const S=8,I=100,T=1e3,g=new Map;t.addEventListener("pointerdown",o=>{const e=o;e.pointerType==="touch"&&g.set(e.pointerId,{startX:e.clientX,startY:e.clientY,lastX:e.clientX,offset:0,active:!1,discarded:!1,samples:[{time:e.timeStamp,offset:0}]})},{passive:!0}),t.addEventListener("pointermove",o=>{const e=o,r=g.get(e.pointerId);if(!r||r.discarded)return;if(!r.active){const i=e.clientX-r.startX,f=e.clientY-r.startY,p=Math.abs(i),l=Math.abs(f);if(p<S&&l<S)return;if(l>=p){r.discarded=!0;return}r.active=!0}const s=e.clientX-r.lastX;r.lastX=e.clientX,r.offset+=s,r.samples.push({time:e.timeStamp,offset:r.offset});const a=e.timeStamp-I;let n=0;for(let i=0;i<r.samples.length;i+=1){if(r.samples[i].time>=a){n=i;break}n=i+1}if(n>0){const i=Math.max(0,n-1);r.samples.splice(0,i)}t.parent.postMessage({type:"swipe-move",deltaX:s},"*"),e.preventDefault()},{passive:!1}),t.addEventListener("pointerup",o=>{const e=o,r=g.get(e.pointerId);if(!r||(g.delete(e.pointerId),!r.active))return;let s=0;if(r.samples.length>=2){const a=r.samples[0],n=r.samples[r.samples.length-1],i=n.time-a.time;i>0&&(s=(n.offset-a.offset)/i*T)}t.parent.postMessage({type:"swipe-end",velocityX:s},"*")}),t.addEventListener("pointercancel",o=>{const e=o,r=g.get(e.pointerId);r&&(g.delete(e.pointerId),r.active&&t.parent.postMessage({type:"swipe-end",velocityX:0},"*"))}),u()}export{U as A,v as U,$ as a,q as b,F as c,j as d,B as e,x as f,k as g,z as h,V as i,H as j,Q as k,W as l,O as m,K as n,X as o};