@telepath-computer/television 0.1.159 → 0.1.161
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 +2044 -671
- package/dist/skills/television/SKILL.md +28 -5
- package/dist/views/artifact-missing/index.html +2 -2
- package/dist/views/markdown/index.html +10 -10
- package/dist/web/assets/artifact-bridge-KdJfBNuH.js +1 -0
- package/dist/web/assets/{artifactMissing-B7Big40q.js → artifactMissing-CxC-pgtU.js} +1 -1
- package/dist/web/assets/main-BsJuVijD.js +718 -0
- package/dist/web/assets/{urlUnsupported-BqoIG2ob.js → urlUnsupported-D3a0K5cH.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-Ce9BPLXH.js +0 -1
- package/dist/web/assets/main-DNa6t8SQ.js +0 -718
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))y(f);new MutationObserver(f=>{for(const u of f)if(u.type==="childList")for(const g of u.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&y(g)}).observe(document,{childList:!0,subtree:!0});function L(f){const u={};return f.integrity&&(u.integrity=f.integrity),f.referrerPolicy&&(u.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?u.credentials="include":f.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function y(f){if(f.ep)return;f.ep=!0;const u=L(f);fetch(f.href,u)}})();const I="url-target-request",D="url-target",N="artifact-missing-request",X="artifact-missing",O="proxy-content-changed";function p(e){return typeof e=="object"&&e!==null}function P(e){return!p(e)||e.type!==I?!1:!("id"in e)}function C(e){return!p(e)||e.type!==D||typeof e.url!="string"&&e.url!==null?!1:!("id"in e)}function U(e){return!p(e)||e.type!==N?!1:!("id"in e)}function Y(e){return!p(e)||e.type!==X||typeof e.title!="string"||typeof e.path!="string"?!1:!("id"in e)}function K(e){return!p(e)||e.type!==O?!1:!("id"in e)}function x(e){return!p(e)||e.type!=="wheel"||typeof e.deltaX!="number"||typeof e.shiftKey!="boolean"?!1:!("id"in e)}function G(e){return!p(e)||e.type!=="navigation-request"||typeof e.url!="string"||"replace"in e&&typeof e.replace!="boolean"||"sameDocument"in e&&typeof e.sameDocument!="boolean"||"native"in e&&typeof e.native!="boolean"?!1:!("id"in e)}function q(e){return!p(e)||e.type!=="filmstrip-key"||e.direction!==-1&&e.direction!==1?!1:!("id"in e)}function W(e){return!p(e)||e.type!=="swipe-move"||typeof e.deltaX!="number"?!1:!("id"in e)}function k(e){return!p(e)||e.type!=="swipe-end"||typeof e.velocityX!="number"?!1:!("id"in e)}function B(e=window,h={}){if(e.parent===e)return;const L=e;if(L.__televisionArtifactBridgeInstalled===!0)return;L.__televisionArtifactBridgeInstalled=!0;const y=e.location.href;if((o=>{try{const t=new URL(o);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t.pathname)}catch{return!1}})(y)&&typeof e.fetch=="function"){let r=null,i=5e3,a=!1;const n=()=>{(async()=>{try{const s=await e.fetch(y,{method:"HEAD"});if(!s.ok)throw new Error("Artifact poll failed");const c=s.headers.get("ETag");if(!c)throw new Error("Artifact poll missing ETag");i=5e3,r===null?r=c:c!==r&&(r=c,e.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{i=Math.min(15e3,i*2)}finally{a||e.setTimeout(n,i)}})()};e.addEventListener("pagehide",()=>{a=!0}),n()}const u=()=>{e.document.documentElement&&(e.document.documentElement.style.touchAction="pan-y",e.document.documentElement.style.overscrollBehaviorX="contain",e.document.documentElement.style.overscrollBehaviorY="contain"),e.document.body&&(e.document.body.style.overscrollBehaviorX="contain",e.document.body.style.overscrollBehaviorY="contain")};if(u(),e.document.body||e.document.addEventListener("DOMContentLoaded",u,{once:!0}),h.reportNavigation!==!1){const o=r=>{e.parent.postMessage({type:"navigation-request",...r},"*")};o({url:e.location.href});const t=e.navigation;if(t)t.addEventListener("navigate",r=>{var d,l;const i=r,a=(d=i.destination)==null?void 0:d.url;if(typeof a!="string")return;const n=((l=i.destination)==null?void 0:l.sameDocument)===!0,s={url:a,...i.navigationType==="replace"?{replace:!0}:{},...n?{sameDocument:!0}:{}};if(n){o(s);return}try{if(new URL(a,e.location.href).origin===e.location.origin){o({...s,native:!0});return}}catch{}i.canIntercept!==!1&&i.preventDefault(),o(s)});else{e.document.addEventListener("click",a=>{var E;const n=a;if(n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;const s=(E=e.document.defaultView)==null?void 0:E.Element;if(!s||!(n.target instanceof s))return;const c=n.target.closest("a[href]");if(!c||c.target&&c.target.toLowerCase()!=="_self"||c.hasAttribute("download"))return;const d=c.getAttribute("href");if(!d||d.startsWith("javascript:"))return;let l;try{l=new URL(c.href,e.document.baseURI)}catch{return}if(l.origin===e.location.origin&&l.pathname===e.location.pathname&&l.search===e.location.search&&l.hash!==""){o({url:l.href,sameDocument:!0});return}n.preventDefault(),o({url:l.href})},!0);const r=e.history.pushState.bind(e.history),i=e.history.replaceState.bind(e.history);e.history.pushState=function(...n){r(...n),o({url:e.location.href,sameDocument:!0})},e.history.replaceState=function(...n){i(...n),o({url:e.location.href,replace:!0,sameDocument:!0})},e.addEventListener("popstate",()=>{o({url:e.location.href,sameDocument:!0})}),e.addEventListener("hashchange",()=>{o({url:e.location.href,sameDocument:!0})}),e.document.addEventListener("submit",a=>{var E,S;const n=a,s=n.target,c=(E=e.document.defaultView)==null?void 0:E.HTMLFormElement;if(!c||!(s instanceof c)||s.target&&s.target.toLowerCase()!=="_self")return;n.preventDefault();const d=s.method.toLowerCase(),l=new URL(s.action||e.location.href,e.document.baseURI);if(d==="get"){const _=(S=e.document.defaultView)==null?void 0:S.FormData;if(!_)return;const M=new URLSearchParams;for(const[v,A]of new _(s))typeof A=="string"&&M.append(v,A);l.search=M.toString()}o({url:l.href})},!0)}}const g=o=>{var a,n;const t=(a=e.document.defaultView)==null?void 0:a.Element;if(!t||!(o instanceof t))return!1;const i=o.closest("input, textarea, select, [contenteditable], [role='textbox'], [role='searchbox'], [role='combobox'], [role='spinbutton'], [role='slider']");return i?i.hasAttribute("contenteditable")?((n=i.getAttribute("contenteditable"))==null?void 0:n.toLowerCase())!=="false":!0:!1};e.addEventListener("keydown",o=>{const t=o;t.key!=="ArrowLeft"&&t.key!=="ArrowRight"||t.metaKey||t.ctrlKey||t.altKey||t.shiftKey||g(t.target)||(t.preventDefault(),e.parent.postMessage({type:"filmstrip-key",direction:t.key==="ArrowRight"?1:-1},"*"))},{capture:!0}),e.addEventListener("wheel",o=>{const t=o,r=t.shiftKey&&t.deltaX===0&&t.deltaY!==0,i=r?t.deltaY:t.deltaX,a=Math.abs(i),n=r?0:Math.abs(t.deltaY);a<=n||(t.preventDefault(),e.parent.postMessage({type:"wheel",deltaX:i,shiftKey:t.shiftKey},"*"))},{passive:!1});const b=8,T=100,R=1e3,m=new Map;e.addEventListener("pointerdown",o=>{const t=o;t.pointerType==="touch"&&m.set(t.pointerId,{startX:t.clientX,startY:t.clientY,lastX:t.clientX,offset:0,active:!1,discarded:!1,samples:[{time:t.timeStamp,offset:0}]})},{passive:!0}),e.addEventListener("pointermove",o=>{const t=o,r=m.get(t.pointerId);if(!r||r.discarded)return;if(!r.active){const s=t.clientX-r.startX,c=t.clientY-r.startY,d=Math.abs(s),l=Math.abs(c);if(d<b&&l<b)return;if(l>=d){r.discarded=!0;return}r.active=!0}const i=t.clientX-r.lastX;r.lastX=t.clientX,r.offset+=i,r.samples.push({time:t.timeStamp,offset:r.offset});const a=t.timeStamp-T;let n=0;for(let s=0;s<r.samples.length;s+=1){if(r.samples[s].time>=a){n=s;break}n=s+1}if(n>0){const s=Math.max(0,n-1);r.samples.splice(0,s)}e.parent.postMessage({type:"swipe-move",deltaX:i},"*"),t.preventDefault()},{passive:!1}),e.addEventListener("pointerup",o=>{const t=o,r=m.get(t.pointerId);if(!r||(m.delete(t.pointerId),!r.active))return;let i=0;if(r.samples.length>=2){const a=r.samples[0],n=r.samples[r.samples.length-1],s=n.time-a.time;s>0&&(i=(n.offset-a.offset)/s*R)}e.parent.postMessage({type:"swipe-end",velocityX:i},"*")}),e.addEventListener("pointercancel",o=>{const t=o,r=m.get(t.pointerId);r&&(m.delete(t.pointerId),r.active&&e.parent.postMessage({type:"swipe-end",velocityX:0},"*"))})}export{X as A,D as U,q as a,P as b,U as c,K as d,G as e,W as f,k as g,B as h,x as i,Y as j,N as k,C as l,I as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{h as d,j as m,k as p}from"./artifact-bridge-KdJfBNuH.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}}
|