@telepath-computer/television 0.1.172 → 0.1.174
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
CHANGED
|
@@ -52695,8 +52695,8 @@ var Server = class {
|
|
|
52695
52695
|
};
|
|
52696
52696
|
};
|
|
52697
52697
|
function readServerPackageVersion() {
|
|
52698
|
-
if ("0.1.
|
|
52699
|
-
return telemetryVersion("0.1.
|
|
52698
|
+
if ("0.1.174".length > 0) {
|
|
52699
|
+
return telemetryVersion("0.1.174");
|
|
52700
52700
|
}
|
|
52701
52701
|
const packageJsonPath = import_node_path11.default.resolve(import_node_path11.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url)), "..", "package.json");
|
|
52702
52702
|
if (!(0, import_node_fs9.existsSync)(packageJsonPath)) return telemetryVersion("0.0.0");
|
|
@@ -53769,8 +53769,8 @@ function resolveVercelSkillsInstallerBin() {
|
|
|
53769
53769
|
return localRequire.resolve("skills/bin/cli.mjs");
|
|
53770
53770
|
}
|
|
53771
53771
|
function readCLIVersion() {
|
|
53772
|
-
if ("0.1.
|
|
53773
|
-
return "0.1.
|
|
53772
|
+
if ("0.1.174".length > 0) {
|
|
53773
|
+
return "0.1.174";
|
|
53774
53774
|
}
|
|
53775
53775
|
const devPackageJsonPath = import_node_path15.default.join(getDevPackageDir(), "package.json");
|
|
53776
53776
|
if (!(0, import_node_fs12.existsSync)(devPackageJsonPath)) {
|
|
@@ -72,7 +72,7 @@ Those questions interact, but they are not the same question.
|
|
|
72
72
|
|
|
73
73
|
Television collects anonymous, content-free telemetry by default to understand early usage and improve the product. Telemetry records predefined usage events and content-free classifications; it does not record artifact paths or URLs, artifact titles, screen names, theme names, file contents, or user-authored text.
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
If the user wants to opt out, you turn telemetry off for them by running `tv telemetry disable` against the running server (`tv telemetry enable` turns it back on); `tv status` reports the current telemetry state. The command needs a live server. Television also honors the standard `DO_NOT_TRACK` environment variable when it is set, but `tv telemetry disable` is the intended way to opt out. When an agent operates the server, start it with `tv serve --installed-by-agent <agent-runtime-harness-name>` so Television can record the agent runtime harness name without recording user content. Use the software running the agent, such as Codex, Claude Code, Hermes, OpenClaw, or Pi; do not use a personalized nickname, persona name, model name, or any value with version numbers or qualifiers.
|
|
76
76
|
|
|
77
77
|
## Related skills
|
|
78
78
|
|
|
@@ -241,7 +241,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
241
241
|
<span part="box"><span part="check">${vM}</span></span>
|
|
242
242
|
<span part="content"><slot></slot></span>
|
|
243
243
|
</label>
|
|
244
|
-
`;const e=l(this,Xi).querySelector("input");if(!(e instanceof HTMLInputElement))throw new Error("checkbox-item failed to initialize input");b(this,sa,e)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","listitem"),this.setAttribute("aria-disabled","true"),p(this,oa,qh).call(this)}attributeChangedCallback(){p(this,oa,qh).call(this)}}Xi=new WeakMap,sa=new WeakMap,oa=new WeakSet,qh=function(){const e=this.hasAttribute("checked");l(this,sa).checked=e,this.setAttribute("aria-checked",e?"true":"false")},g(n0,"observedAttributes",["checked"]);customElements.get("checkbox-list")||customElements.define("checkbox-list",wM);customElements.get("checkbox-item")||customElements.define("checkbox-item",n0);const i0=Ve(),s0="No handler registered for update-content",o0="handleUpdateContent: handler already registered",km="television-artifact-bridge";function a0(r){return r instanceof Error&&typeof r.message=="string"?r.message:String(r)}const l0=Ra(Mt);var Qi,es,ts,Hn,Zn,aa,Ze,Yh,c0,u0,to,Kh,ov;let SM=(ov=class extends l0{constructor(e){super();w(this,Ze);w(this,Qi);w(this,es);w(this,ts);w(this,Hn,null);w(this,Zn,null);w(this,aa,!1);b(this,Qi,e);const n=e.ownerDocument.defaultView;if(!n)throw new Error("ArtifactView: iframe has no owner window");b(this,es,n),b(this,ts,i=>p(this,Ze,c0).call(this,i)),l(this,es).addEventListener("message",l(this,ts))}get content(){return l(this,Zn)}set content(e){p(this,Ze,Kh).call(this),b(this,Zn,e),l(this,aa)&&p(this,Ze,Yh).call(this,e)}handleUpdateContent(e){if(p(this,Ze,Kh).call(this),l(this,Hn)!==null)throw new Error(o0);b(this,Hn,e)}dispose(){l(this,es).removeEventListener("message",l(this,ts)),b(this,Hn,null)}},Qi=new WeakMap,es=new WeakMap,ts=new WeakMap,Hn=new WeakMap,Zn=new WeakMap,aa=new WeakMap,Ze=new WeakSet,Yh=function(e){const n={type:"content-updated",content:e};p(this,Ze,to).call(this,n)},c0=function(e){if(this.disposed||e.source!==l(this,Qi).contentWindow)return;const n=e.data;if(kb(n)){b(this,aa,!0),this.dispatchEvent(new i0("ready")),l(this,Zn)!==null&&p(this,Ze,Yh).call(this,l(this,Zn));return}if(xb(n)){p(this,Ze,u0).call(this,n);return}},u0=async function(e){const n=l(this,Hn);if(n===null){p(this,Ze,to).call(this,{type:"response",id:e.id,error:{message:s0}});return}try{await n(e.content)}catch(i){if(this.disposed)return;p(this,Ze,to).call(this,{type:"response",id:e.id,error:{message:a0(i)}});return}this.disposed||p(this,Ze,to).call(this,{type:"response",id:e.id,result:{}})},to=function(e){const n=l(this,Qi).contentWindow;n&&n.postMessage(e,"*")},Kh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},ov);var Wn,rs,Bn,Vn,la,We,Jh,h0,d0,ro,Xh;class _M extends l0{constructor(e){super();w(this,We);w(this,Wn);w(this,rs);w(this,Bn,null);w(this,Vn,null);w(this,la,!1);b(this,Wn,e),b(this,rs,n=>p(this,We,h0).call(this,n)),l(this,Wn).addEventListener("ipc-message",l(this,rs))}get content(){return l(this,Vn)}set content(e){p(this,We,Xh).call(this),b(this,Vn,e),l(this,la)&&p(this,We,Jh).call(this,e)}handleUpdateContent(e){if(p(this,We,Xh).call(this),l(this,Bn)!==null)throw new Error(o0);b(this,Bn,e)}dispose(){l(this,Wn).removeEventListener("ipc-message",l(this,rs)),b(this,Bn,null)}}Wn=new WeakMap,rs=new WeakMap,Bn=new WeakMap,Vn=new WeakMap,la=new WeakMap,We=new WeakSet,Jh=function(e){const n={type:"content-updated",content:e};p(this,We,ro).call(this,n)},h0=function(e){var s;if(this.disposed)return;const n=e.detail??e;if(!n||n.channel!==km)return;const i=(s=n.args)==null?void 0:s[0];if(kb(i)){b(this,la,!0),this.dispatchEvent(new i0("ready")),l(this,Vn)!==null&&p(this,We,Jh).call(this,l(this,Vn));return}if(xb(i)){p(this,We,d0).call(this,i);return}},d0=async function(e){const n=l(this,Bn);if(n===null){p(this,We,ro).call(this,{type:"response",id:e.id,error:{message:s0}});return}try{await n(e.content)}catch(i){if(this.disposed)return;p(this,We,ro).call(this,{type:"response",id:e.id,error:{message:a0(i)}});return}this.disposed||p(this,We,ro).call(this,{type:"response",id:e.id,result:{}})},ro=function(e){var n,i;(i=(n=l(this,Wn)).send)==null||i.call(n,km,e)},Xh=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};const xm="television-artifact-bridge",Em="/views/url-unsupported/",kM=404,p0=Ve(),xM=Ve(),EM=Ve();class AM extends HTMLElement{constructor(){super(...arguments);g(this,"_artifact",null);g(this,"_viewURL",null);g(this,"_contentURL",null);g(this,"_screen",null);g(this,"_standaloneScroll",!1);g(this,"_subscribedWebview",null);g(this,"_embedLoadFrame",null);g(this,"_embedLoadKey",null);g(this,"_bridgePending",!0);g(this,"_bridgeCurrentGuid",null);g(this,"_bridgeLifecycleWindow",null);g(this,"_activeReloadFrameSrc",null);g(this,"_markdownFrame",null);g(this,"_markdownHost",null);g(this,"_markdownContentURL",null);g(this,"_proxyReloadVersion",0);g(this,"_navigationState",null);g(this,"_navigationArtifactId",null);g(this,"_navigationCanonicalURL",null);g(this,"_preserveFrameSrcOnNavigationRender",!1);g(this,"_missingArtifactID",null);g(this,"handleIframeMessage",e=>{var u,h;const n=this.querySelector("iframe.artifact-frame");if(!n)return;const i=qp(e.data),s=tu(e.data)&&e.data.native===!0&&e.data.sameDocument!==!0,o=n.contentWindow===e.source,a=(i||s)&&this._bridgeLifecycleWindow!==null&&this._bridgeLifecycleWindow===e.source,c=i&&this.isArtifactFrameMessageOrigin(n,e.origin);if(!(!o&&!a&&!c)){if(Yp(e.data)){this.handleBridgeReady(e.data,n);return}if(i){this.handleBridgeLeaving(e.data.guid);return}if(Kp(e.data)){this.dispatchArtifactWheel({deltaX:e.data.deltaX,shiftKey:e.data.shiftKey});return}if(Jp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),this.dispatchArtifactFilmstripKey(e.data.direction);return}if(yS(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),(u=n.contentWindow)==null||u.postMessage({type:bS,url:this.currentExternalTargetURL()},"*");return}if(Xp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),(h=n.contentWindow)==null||h.postMessage(this.currentMissingArtifactMessage(),"*");return}if(Qp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),this.handleProxyContentChanged();return}if(tu(e.data)){const f=e.data.native===!0&&e.data.sameDocument!==!0;this.handleNavigationRequest(e.data),f||this.markLegacyBridgeProofOfLife(e.data,n);return}}});g(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,n=!e;n&&this.closeBridgeGate({render:!1}),this.render({preserveFrameSrc:e}),this._preserveFrameSrcOnNavigationRender=!1,n&&window.setTimeout(()=>this.forceCurrentFrameSrc(),0)});g(this,"handleArtifactContentChanged",e=>{var i;if(e.artifactID===((i=this._artifact)==null?void 0:i.id)){if(this._markdownHost&&this._markdownContentURL||this.isCurrentMarkdownMissing()){this.fetchMarkdownContent();return}this.reloadProxyFrame()}});g(this,"handleThemeChanged",()=>{var e;((e=this._artifact)==null?void 0:e.kind)==="url"&&vr(this._artifact.url)||this.reloadProxyFrame()});g(this,"handleWebviewIpcMessage",e=>{var o,a;const n=e.detail??e;if(!n||n.channel!==xm)return;const i=(o=n.args)==null?void 0:o[0];if(!i)return;const s=this._subscribedWebview;if(s){if(Yp(i)){this.handleBridgeReady(i,s);return}if(qp(i)){this.handleBridgeLeaving(i.guid);return}if(Xp(i)){this.markLegacyBridgeProofOfLife(i,s);const c=this.currentMissingArtifactMessage();c&&((a=s.send)==null||a.call(s,xm,c));return}if(tu(i)){this.handleNavigationRequest(i);return}if(Kp(i)){this.markLegacyBridgeProofOfLife(i,s),this.dispatchArtifactWheel({deltaX:i.deltaX,shiftKey:i.shiftKey});return}if(Jp(i)){this.markLegacyBridgeProofOfLife(i,s),this.dispatchArtifactFilmstripKey(i.direction);return}Qp(i)&&(this.markLegacyBridgeProofOfLife(i,s),this.handleProxyContentChanged())}});g(this,"handleWebviewDidStartNavigation",e=>{const n=e.detail??e;n.isMainFrame===!0&&n.isInPlace!==!0&&this.closeBridgeGate()});g(this,"handleWebviewDidFailLoad",e=>{(e.detail??e).isMainFrame!==!1&&this.closeBridgeGate()});g(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});g(this,"handleWebviewDidNavigateInPage",e=>{this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});g(this,"handleEmbedLoad",()=>{const e=this.querySelector(".artifact-frame");!e||e!==this._embedLoadFrame||this.setAttribute("data-embed-loaded","")})}set artifact(e){const n=this._artifact,i=n?!TM(n,e):!0;((n==null?void 0:n.id)!==e.id||n.kind==="path"&&e.kind==="path"&&n.path!==e.path)&&(this._missingArtifactID=null),i&&(this._bridgePending=!0,this._bridgeCurrentGuid=null,this._bridgeLifecycleWindow=null,this._activeReloadFrameSrc=null),this._artifact=e,this.syncNavigationState(),this.render(),this.syncWebviewSubscription()}get artifact(){return this._artifact}set viewURL(e){this._viewURL=e,this.syncNavigationState(),this.render(),this.syncWebviewSubscription()}get viewURL(){return this._viewURL}set contentURL(e){this._contentURL=e,this.render()}get contentURL(){return this._contentURL}set screen(e){var n,i,s,o;this._screen!==e&&((n=this._screen)==null||n.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),(i=this._screen)==null||i.removeEventListener("theme-changed",this.handleThemeChanged),this._screen=e,(s=this._screen)==null||s.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),(o=this._screen)==null||o.addEventListener("theme-changed",this.handleThemeChanged),this.syncMarkdownHost())}get screen(){return this._screen}get activeView(){return null}set standaloneScroll(e){this._standaloneScroll=e}get standaloneScroll(){return this._standaloneScroll}connectedCallback(){this.setAttribute("level","2"),window.addEventListener("message",this.handleIframeMessage),this.rearmArtifactFrameOnConnect(),this.render(),this.syncWebviewSubscription(),this.syncNavigationState()}disconnectedCallback(){var e,n;window.removeEventListener("message",this.handleIframeMessage),this.unsubscribeFromWebview(),this.unsubscribeFromEmbedLoad(),this.syncNavigationState(),(e=this._screen)==null||e.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),(n=this._screen)==null||n.removeEventListener("theme-changed",this.handleThemeChanged),this.disposeMarkdownHost()}handleClose(){this._artifact&&this.dispatchEvent(new p0("close-artifact",{artifactID:this._artifact.id,bubbles:!0,composed:!0}))}currentExternalTargetURL(){var n,i;const e=((n=this._navigationState)==null?void 0:n.currentURL)??null;return e&&Hu(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:wS,title:e.title,path:e.path}}handleBridgeReady(e,n=this.querySelector(".artifact-frame")){if(this.isArtifactFrame(n)){if(typeof e.guid=="string"){(e.guid!==this._bridgeCurrentGuid||this._bridgePending)&&(this._bridgeCurrentGuid=e.guid,this._bridgeLifecycleWindow=n.tagName.toLowerCase()==="iframe"?n.contentWindow:null,this._bridgePending=!1,this.render({preserveFrameSrc:!0}));return}this.markLegacyBridgeProofOfLife(e,n)}}handleBridgeLeaving(e){e===this._bridgeCurrentGuid&&this.closeBridgeGate()}markLegacyBridgeProofOfLife(e,n=this.querySelector(".artifact-frame")){this.isArtifactFrame(n)&&(!this._bridgePending||$M(e)||(this._bridgePending=!1,this.render({preserveFrameSrc:!0})))}closeBridgeGate(e={}){const n=!this._bridgePending||this._bridgeCurrentGuid!==null;this._bridgePending=!0,this._bridgeCurrentGuid=null,this._bridgeLifecycleWindow=null,n&&e.render!==!1&&this.render({preserveFrameSrc:!0})}isArtifactFrame(e){if(!e)return!1;const n=e.tagName.toLowerCase();return n==="iframe"||n==="webview"}isArtifactFrameMessageOrigin(e,n){try{return new URL(e.getAttribute("src")??e.src,window.location.href).origin===n}catch{return!1}}shouldGateFrame(){return this._bridgePending}rearmArtifactFrameOnConnect(){const e=this.querySelector(".artifact-frame");this.isArtifactFrame(e)&&this.closeBridgeGate({render:!1})}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!vr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){this.syncNavigationState();const n=this._navigationState;if(!n)return;const i=this.convertIframeNavigationURL(e.url);if(i===Em||i===n.currentURL)return;const s=e.native===!0;(e.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),s&&e.sameDocument!==!0&&this.closeBridgeGate({render:!1}),e.replace?n.replace(i):n.navigate(i)}dispatchArtifactFilmstripKey(e){this._standaloneScroll||this.dispatchEvent(new EM("artifact-filmstrip-key",{bubbles:!0,composed:!0,direction:e}))}dispatchArtifactWheel(e){this._standaloneScroll||this.dispatchEvent(new xM("artifact-wheel",{bubbles:!0,composed:!0,deltaX:e.deltaX,shiftKey:e.shiftKey}))}syncNavigationState(){if(!this.isConnected||!this._artifact){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new EO(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null&&this.render())}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const n=jl(e,{electron:cr()}),i=this._viewURL??n.viewURL;return e.kind==="url"&&vr(e.url)||n.renderer==="url-webview"?Cr(i):Am(i,i)}convertIframeNavigationURL(e){var i,s;if(((i=this._artifact)==null?void 0:i.kind)==="url"&&vr(this._artifact.url)&&vr(e))return Cr(e);const n=(s=this.querySelector(".artifact-frame"))==null?void 0:s.getAttribute("src");return Am(e,n??this._viewURL??null)}handleWebviewNavigationEvent(e){const n=e.url;if(typeof n!="string")return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=Cr(n);return s===i.currentURL?!1:(i.navigate(s),!0)}viewURLForInternalNavigation(e){if(!e.startsWith("/")||!this._viewURL)return e;try{return new URL(e,this._viewURL).toString()}catch{return e}}syncWebviewSubscription(){const e=this.querySelector("webview");e!==this._subscribedWebview&&(this.unsubscribeFromWebview(),e&&(e.addEventListener("ipc-message",this.handleWebviewIpcMessage),e.addEventListener("did-start-navigation",this.handleWebviewDidStartNavigation),e.addEventListener("did-fail-load",this.handleWebviewDidFailLoad),e.addEventListener("did-navigate",this.handleWebviewDidNavigate),e.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=e))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("ipc-message",this.handleWebviewIpcMessage),this._subscribedWebview.removeEventListener("did-start-navigation",this.handleWebviewDidStartNavigation),this._subscribedWebview.removeEventListener("did-fail-load",this.handleWebviewDidFailLoad),this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}syncEmbedLoadState(){var s;const e=this.querySelector(".artifact-frame"),n=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===this._embedLoadFrame&&n===this._embedLoadKey||(this.unsubscribeFromEmbedLoad(),this.removeAttribute("data-embed-loaded"),!e||!n))return;if(this._embedLoadFrame=e,this._embedLoadKey=n,e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",this.handleEmbedLoad),e.addEventListener("did-fail-load",this.handleEmbedLoad);return}e.addEventListener("load",this.handleEmbedLoad);const i=e;try{((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&this.handleEmbedLoad()}catch{}}unsubscribeFromEmbedLoad(){if(!this._embedLoadFrame){this._embedLoadKey=null;return}this._embedLoadFrame.removeEventListener("load",this.handleEmbedLoad),this._embedLoadFrame.removeEventListener("did-finish-load",this.handleEmbedLoad),this._embedLoadFrame.removeEventListener("did-fail-load",this.handleEmbedLoad),this._embedLoadFrame=null,this._embedLoadKey=null}iframeTargetOrigin(e){const n=e.getAttribute("sandbox")??"";if(!new Set(n.split(/\s+/).filter(Boolean)).has("allow-same-origin"))return"*";const s=e.getAttribute("src")??e.src;if(!s)return"*";try{return new URL(s,window.location.href).origin}catch{return"*"}}syncMarkdownHost(){const e=this.querySelector("[data-content-url]"),n=(e==null?void 0:e.dataset.contentUrl)??null;if(!e||!n||!this._artifact||!this._screen){this.disposeMarkdownHost();return}if(e===this._markdownFrame&&n===this._markdownContentURL)return;this.disposeMarkdownHost(),this._markdownFrame=e,this._markdownContentURL=n;const i=e.tagName.toLowerCase()==="webview"?new _M(e):new SM(e);this._markdownHost=i,i.handleUpdateContent(async s=>{const o=this._artifact,a=this._screen;if(!o||!a)throw new Error("No markdown artifact selected");await a.server.client.markdown.update({artifactID:o.id,content:s}),i.content=s}),this.fetchMarkdownContent()}async fetchMarkdownContent(){const e=this._artifact,n=this._markdownHost,i=this._screen;if(!(!e||!i))try{const s=await i.server.client.markdown.get({artifactID:e.id});if(this._missingArtifactID=null,!n){this.render();return}n.content=s}catch(s){if(s instanceof Jd&&s.status===kM){this._missingArtifactID=e.id,this.disposeMarkdownHost(),this.render();return}}}isCurrentMarkdownMissing(){var e;return this._missingArtifactID===((e=this._artifact)==null?void 0:e.id)&&this._artifact.kind==="path"&&Sb(this._artifact.path)}missingArtifactTemplate(e){return D`
|
|
244
|
+
`;const e=l(this,Xi).querySelector("input");if(!(e instanceof HTMLInputElement))throw new Error("checkbox-item failed to initialize input");b(this,sa,e)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","listitem"),this.setAttribute("aria-disabled","true"),p(this,oa,qh).call(this)}attributeChangedCallback(){p(this,oa,qh).call(this)}}Xi=new WeakMap,sa=new WeakMap,oa=new WeakSet,qh=function(){const e=this.hasAttribute("checked");l(this,sa).checked=e,this.setAttribute("aria-checked",e?"true":"false")},g(n0,"observedAttributes",["checked"]);customElements.get("checkbox-list")||customElements.define("checkbox-list",wM);customElements.get("checkbox-item")||customElements.define("checkbox-item",n0);const i0=Ve(),s0="No handler registered for update-content",o0="handleUpdateContent: handler already registered",km="television-artifact-bridge";function a0(r){return r instanceof Error&&typeof r.message=="string"?r.message:String(r)}const l0=Ra(Mt);var Qi,es,ts,Hn,Zn,aa,Ze,Yh,c0,u0,to,Kh,ov;let SM=(ov=class extends l0{constructor(e){super();w(this,Ze);w(this,Qi);w(this,es);w(this,ts);w(this,Hn,null);w(this,Zn,null);w(this,aa,!1);b(this,Qi,e);const n=e.ownerDocument.defaultView;if(!n)throw new Error("ArtifactView: iframe has no owner window");b(this,es,n),b(this,ts,i=>p(this,Ze,c0).call(this,i)),l(this,es).addEventListener("message",l(this,ts))}get content(){return l(this,Zn)}set content(e){p(this,Ze,Kh).call(this),b(this,Zn,e),l(this,aa)&&p(this,Ze,Yh).call(this,e)}handleUpdateContent(e){if(p(this,Ze,Kh).call(this),l(this,Hn)!==null)throw new Error(o0);b(this,Hn,e)}dispose(){l(this,es).removeEventListener("message",l(this,ts)),b(this,Hn,null)}},Qi=new WeakMap,es=new WeakMap,ts=new WeakMap,Hn=new WeakMap,Zn=new WeakMap,aa=new WeakMap,Ze=new WeakSet,Yh=function(e){const n={type:"content-updated",content:e};p(this,Ze,to).call(this,n)},c0=function(e){if(this.disposed||e.source!==l(this,Qi).contentWindow)return;const n=e.data;if(kb(n)){b(this,aa,!0),this.dispatchEvent(new i0("ready")),l(this,Zn)!==null&&p(this,Ze,Yh).call(this,l(this,Zn));return}if(xb(n)){p(this,Ze,u0).call(this,n);return}},u0=async function(e){const n=l(this,Hn);if(n===null){p(this,Ze,to).call(this,{type:"response",id:e.id,error:{message:s0}});return}try{await n(e.content)}catch(i){if(this.disposed)return;p(this,Ze,to).call(this,{type:"response",id:e.id,error:{message:a0(i)}});return}this.disposed||p(this,Ze,to).call(this,{type:"response",id:e.id,result:{}})},to=function(e){const n=l(this,Qi).contentWindow;n&&n.postMessage(e,"*")},Kh=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},ov);var Wn,rs,Bn,Vn,la,We,Jh,h0,d0,ro,Xh;class _M extends l0{constructor(e){super();w(this,We);w(this,Wn);w(this,rs);w(this,Bn,null);w(this,Vn,null);w(this,la,!1);b(this,Wn,e),b(this,rs,n=>p(this,We,h0).call(this,n)),l(this,Wn).addEventListener("ipc-message",l(this,rs))}get content(){return l(this,Vn)}set content(e){p(this,We,Xh).call(this),b(this,Vn,e),l(this,la)&&p(this,We,Jh).call(this,e)}handleUpdateContent(e){if(p(this,We,Xh).call(this),l(this,Bn)!==null)throw new Error(o0);b(this,Bn,e)}dispose(){l(this,Wn).removeEventListener("ipc-message",l(this,rs)),b(this,Bn,null)}}Wn=new WeakMap,rs=new WeakMap,Bn=new WeakMap,Vn=new WeakMap,la=new WeakMap,We=new WeakSet,Jh=function(e){const n={type:"content-updated",content:e};p(this,We,ro).call(this,n)},h0=function(e){var s;if(this.disposed)return;const n=e.detail??e;if(!n||n.channel!==km)return;const i=(s=n.args)==null?void 0:s[0];if(kb(i)){b(this,la,!0),this.dispatchEvent(new i0("ready")),l(this,Vn)!==null&&p(this,We,Jh).call(this,l(this,Vn));return}if(xb(i)){p(this,We,d0).call(this,i);return}},d0=async function(e){const n=l(this,Bn);if(n===null){p(this,We,ro).call(this,{type:"response",id:e.id,error:{message:s0}});return}try{await n(e.content)}catch(i){if(this.disposed)return;p(this,We,ro).call(this,{type:"response",id:e.id,error:{message:a0(i)}});return}this.disposed||p(this,We,ro).call(this,{type:"response",id:e.id,result:{}})},ro=function(e){var n,i;(i=(n=l(this,Wn)).send)==null||i.call(n,km,e)},Xh=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};const xm="television-artifact-bridge",Em="/views/url-unsupported/",kM=404,p0=Ve(),xM=Ve(),EM=Ve();class AM extends HTMLElement{constructor(){super(...arguments);g(this,"_artifact",null);g(this,"_viewURL",null);g(this,"_contentURL",null);g(this,"_screen",null);g(this,"_standaloneScroll",!1);g(this,"_subscribedWebview",null);g(this,"_embedLoadFrame",null);g(this,"_embedLoadKey",null);g(this,"_bridgePending",!0);g(this,"_bridgeCurrentGuid",null);g(this,"_bridgeLifecycleWindow",null);g(this,"_activeReloadFrameSrc",null);g(this,"_markdownFrame",null);g(this,"_markdownHost",null);g(this,"_markdownContentURL",null);g(this,"_markdownArtifactID",null);g(this,"_markdownContent",null);g(this,"_markdownFetchedArtifactID",null);g(this,"_markdownFetchedScreen",null);g(this,"_screenSubscriptionsAttached",!1);g(this,"_proxyReloadVersion",0);g(this,"_navigationState",null);g(this,"_navigationArtifactId",null);g(this,"_navigationCanonicalURL",null);g(this,"_preserveFrameSrcOnNavigationRender",!1);g(this,"_missingArtifactID",null);g(this,"handleIframeMessage",e=>{var u,h;const n=this.querySelector("iframe.artifact-frame");if(!n)return;const i=qp(e.data),s=tu(e.data)&&e.data.native===!0&&e.data.sameDocument!==!0,o=n.contentWindow===e.source,a=(i||s)&&this._bridgeLifecycleWindow!==null&&this._bridgeLifecycleWindow===e.source,c=i&&this.isArtifactFrameMessageOrigin(n,e.origin);if(!(!o&&!a&&!c)){if(Yp(e.data)){this.handleBridgeReady(e.data,n);return}if(i){this.handleBridgeLeaving(e.data.guid);return}if(Kp(e.data)){this.dispatchArtifactWheel({deltaX:e.data.deltaX,shiftKey:e.data.shiftKey});return}if(Jp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),this.dispatchArtifactFilmstripKey(e.data.direction);return}if(yS(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),(u=n.contentWindow)==null||u.postMessage({type:bS,url:this.currentExternalTargetURL()},"*");return}if(Xp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),(h=n.contentWindow)==null||h.postMessage(this.currentMissingArtifactMessage(),"*");return}if(Qp(e.data)){this.markLegacyBridgeProofOfLife(e.data,n),this.handleProxyContentChanged();return}if(tu(e.data)){const f=e.data.native===!0&&e.data.sameDocument!==!0;this.handleNavigationRequest(e.data),f||this.markLegacyBridgeProofOfLife(e.data,n);return}}});g(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,n=!e;n&&this.closeBridgeGate({render:!1}),this.render({preserveFrameSrc:e}),this._preserveFrameSrcOnNavigationRender=!1,n&&window.setTimeout(()=>this.forceCurrentFrameSrc(),0)});g(this,"handleArtifactContentChanged",e=>{var i;if(e.artifactID===((i=this._artifact)==null?void 0:i.id)){if(this._markdownHost&&this._markdownContentURL||this.isCurrentMarkdownMissing()){this.fetchMarkdownContent();return}this.reloadProxyFrame()}});g(this,"handleThemeChanged",()=>{var e;((e=this._artifact)==null?void 0:e.kind)==="url"&&vr(this._artifact.url)||this.reloadProxyFrame()});g(this,"handleWebviewIpcMessage",e=>{var o,a;const n=e.detail??e;if(!n||n.channel!==xm)return;const i=(o=n.args)==null?void 0:o[0];if(!i)return;const s=this._subscribedWebview;if(s){if(Yp(i)){this.handleBridgeReady(i,s);return}if(qp(i)){this.handleBridgeLeaving(i.guid);return}if(Xp(i)){this.markLegacyBridgeProofOfLife(i,s);const c=this.currentMissingArtifactMessage();c&&((a=s.send)==null||a.call(s,xm,c));return}if(tu(i)){this.handleNavigationRequest(i);return}if(Kp(i)){this.markLegacyBridgeProofOfLife(i,s),this.dispatchArtifactWheel({deltaX:i.deltaX,shiftKey:i.shiftKey});return}if(Jp(i)){this.markLegacyBridgeProofOfLife(i,s),this.dispatchArtifactFilmstripKey(i.direction);return}Qp(i)&&(this.markLegacyBridgeProofOfLife(i,s),this.handleProxyContentChanged())}});g(this,"handleWebviewDidStartNavigation",e=>{const n=e.detail??e;n.isMainFrame===!0&&n.isInPlace!==!0&&this.closeBridgeGate()});g(this,"handleWebviewDidFailLoad",e=>{(e.detail??e).isMainFrame!==!1&&this.closeBridgeGate()});g(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});g(this,"handleWebviewDidNavigateInPage",e=>{this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});g(this,"handleEmbedLoad",()=>{const e=this.querySelector(".artifact-frame");!e||e!==this._embedLoadFrame||this.setAttribute("data-embed-loaded","")})}set artifact(e){const n=this._artifact,i=n?!TM(n,e):!0;((n==null?void 0:n.id)!==e.id||n.kind==="path"&&e.kind==="path"&&n.path!==e.path)&&(this._missingArtifactID=null),i&&(this._bridgePending=!0,this._bridgeCurrentGuid=null,this._bridgeLifecycleWindow=null,this._activeReloadFrameSrc=null,this._markdownContent=null,this._markdownHost&&(this._markdownHost.content=""),this._markdownFetchedArtifactID=null,this._markdownFetchedScreen=null),this._artifact=e,this.syncNavigationState(),this.render(),this.syncWebviewSubscription()}get artifact(){return this._artifact}set viewURL(e){this._viewURL=e,this.syncNavigationState(),this.render(),this.syncWebviewSubscription()}get viewURL(){return this._viewURL}set contentURL(e){this._contentURL=e,this.render()}get contentURL(){return this._contentURL}set screen(e){this._screen!==e&&(this.detachScreenSubscriptions(),this._screen=e,this.attachScreenSubscriptions(),this.syncMarkdownHost())}get screen(){return this._screen}attachScreenSubscriptions(){!this._screen||this._screenSubscriptionsAttached||(this._screen.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._screen.addEventListener("theme-changed",this.handleThemeChanged),this._screenSubscriptionsAttached=!0)}detachScreenSubscriptions(){!this._screen||!this._screenSubscriptionsAttached||(this._screen.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._screen.removeEventListener("theme-changed",this.handleThemeChanged),this._screenSubscriptionsAttached=!1)}get activeView(){return null}set standaloneScroll(e){this._standaloneScroll=e}get standaloneScroll(){return this._standaloneScroll}connectedCallback(){this.setAttribute("level","2"),window.addEventListener("message",this.handleIframeMessage),this.attachScreenSubscriptions(),this.rearmArtifactFrameOnConnect(),this.render(),this.syncWebviewSubscription(),this.syncNavigationState()}disconnectedCallback(){window.removeEventListener("message",this.handleIframeMessage),this.unsubscribeFromWebview(),this.unsubscribeFromEmbedLoad(),this.syncNavigationState(),this.detachScreenSubscriptions(),this.disposeMarkdownHost()}handleClose(){this._artifact&&this.dispatchEvent(new p0("close-artifact",{artifactID:this._artifact.id,bubbles:!0,composed:!0}))}currentExternalTargetURL(){var n,i;const e=((n=this._navigationState)==null?void 0:n.currentURL)??null;return e&&Hu(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:wS,title:e.title,path:e.path}}handleBridgeReady(e,n=this.querySelector(".artifact-frame")){if(this.isArtifactFrame(n)){if(typeof e.guid=="string"){(e.guid!==this._bridgeCurrentGuid||this._bridgePending)&&(this._bridgeCurrentGuid=e.guid,this._bridgeLifecycleWindow=n.tagName.toLowerCase()==="iframe"?n.contentWindow:null,this._bridgePending=!1,this.render({preserveFrameSrc:!0}));return}this.markLegacyBridgeProofOfLife(e,n)}}handleBridgeLeaving(e){e===this._bridgeCurrentGuid&&this.closeBridgeGate()}markLegacyBridgeProofOfLife(e,n=this.querySelector(".artifact-frame")){this.isArtifactFrame(n)&&(!this._bridgePending||$M(e)||(this._bridgePending=!1,this.render({preserveFrameSrc:!0})))}closeBridgeGate(e={}){const n=!this._bridgePending||this._bridgeCurrentGuid!==null;this._bridgePending=!0,this._bridgeCurrentGuid=null,this._bridgeLifecycleWindow=null,n&&e.render!==!1&&this.render({preserveFrameSrc:!0})}isArtifactFrame(e){if(!e)return!1;const n=e.tagName.toLowerCase();return n==="iframe"||n==="webview"}isArtifactFrameMessageOrigin(e,n){try{return new URL(e.getAttribute("src")??e.src,window.location.href).origin===n}catch{return!1}}shouldGateFrame(){return this._bridgePending}rearmArtifactFrameOnConnect(){const e=this.querySelector(".artifact-frame");this.isArtifactFrame(e)&&this.closeBridgeGate({render:!1})}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!vr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){this.syncNavigationState();const n=this._navigationState;if(!n)return;const i=this.convertIframeNavigationURL(e.url);if(i===Em||i===n.currentURL)return;const s=e.native===!0;(e.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),s&&e.sameDocument!==!0&&this.closeBridgeGate({render:!1}),e.replace?n.replace(i):n.navigate(i)}dispatchArtifactFilmstripKey(e){this._standaloneScroll||this.dispatchEvent(new EM("artifact-filmstrip-key",{bubbles:!0,composed:!0,direction:e}))}dispatchArtifactWheel(e){this._standaloneScroll||this.dispatchEvent(new xM("artifact-wheel",{bubbles:!0,composed:!0,deltaX:e.deltaX,shiftKey:e.shiftKey}))}syncNavigationState(){if(!this.isConnected||!this._artifact){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new EO(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null&&this.render())}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const n=jl(e,{electron:cr()}),i=this._viewURL??n.viewURL;return e.kind==="url"&&vr(e.url)||n.renderer==="url-webview"?Cr(i):Am(i,i)}convertIframeNavigationURL(e){var i,s;if(((i=this._artifact)==null?void 0:i.kind)==="url"&&vr(this._artifact.url)&&vr(e))return Cr(e);const n=(s=this.querySelector(".artifact-frame"))==null?void 0:s.getAttribute("src");return Am(e,n??this._viewURL??null)}handleWebviewNavigationEvent(e){const n=e.url;if(typeof n!="string")return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=Cr(n);return s===i.currentURL?!1:(i.navigate(s),!0)}viewURLForInternalNavigation(e){if(!e.startsWith("/")||!this._viewURL)return e;try{return new URL(e,this._viewURL).toString()}catch{return e}}syncWebviewSubscription(){const e=this.querySelector("webview");e!==this._subscribedWebview&&(this.unsubscribeFromWebview(),e&&(e.addEventListener("ipc-message",this.handleWebviewIpcMessage),e.addEventListener("did-start-navigation",this.handleWebviewDidStartNavigation),e.addEventListener("did-fail-load",this.handleWebviewDidFailLoad),e.addEventListener("did-navigate",this.handleWebviewDidNavigate),e.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=e))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("ipc-message",this.handleWebviewIpcMessage),this._subscribedWebview.removeEventListener("did-start-navigation",this.handleWebviewDidStartNavigation),this._subscribedWebview.removeEventListener("did-fail-load",this.handleWebviewDidFailLoad),this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}syncEmbedLoadState(){var s;const e=this.querySelector(".artifact-frame"),n=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===this._embedLoadFrame&&n===this._embedLoadKey||(this.unsubscribeFromEmbedLoad(),this.removeAttribute("data-embed-loaded"),!e||!n))return;if(this._embedLoadFrame=e,this._embedLoadKey=n,e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",this.handleEmbedLoad),e.addEventListener("did-fail-load",this.handleEmbedLoad);return}e.addEventListener("load",this.handleEmbedLoad);const i=e;try{((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&this.handleEmbedLoad()}catch{}}unsubscribeFromEmbedLoad(){if(!this._embedLoadFrame){this._embedLoadKey=null;return}this._embedLoadFrame.removeEventListener("load",this.handleEmbedLoad),this._embedLoadFrame.removeEventListener("did-finish-load",this.handleEmbedLoad),this._embedLoadFrame.removeEventListener("did-fail-load",this.handleEmbedLoad),this._embedLoadFrame=null,this._embedLoadKey=null}iframeTargetOrigin(e){const n=e.getAttribute("sandbox")??"";if(!new Set(n.split(/\s+/).filter(Boolean)).has("allow-same-origin"))return"*";const s=e.getAttribute("src")??e.src;if(!s)return"*";try{return new URL(s,window.location.href).origin}catch{return"*"}}syncMarkdownHost(){var s;const e=this.querySelector("[data-content-url]"),n=(e==null?void 0:e.dataset.contentUrl)??null,i=((s=this._artifact)==null?void 0:s.id)??null;if(!e||!n||!i){this.disposeMarkdownHost({clearContent:!0});return}if(e!==this._markdownFrame||i!==this._markdownArtifactID){this.disposeMarkdownHost(),this._markdownFrame=e,this._markdownContentURL=n,this._markdownArtifactID=i;const o=e.tagName.toLowerCase()==="webview"?new _M(e):new SM(e);this._markdownHost=o,o.handleUpdateContent(async a=>{const c=this._artifact,u=this._screen;if(!c||!u)throw new Error("No markdown artifact selected");await u.server.client.markdown.update({artifactID:c.id,content:a}),this._markdownContent=a,this._markdownHost===o&&(o.content=a)}),this._markdownContent!==null&&(o.content=this._markdownContent)}else this._markdownContentURL=n;this.ensureMarkdownContentFetched()}ensureMarkdownContentFetched(){const e=this._artifact,n=this._screen;!e||!n||!this._markdownHost||this._markdownFetchedArtifactID===e.id&&this._markdownFetchedScreen===n||(this._markdownFetchedArtifactID=e.id,this._markdownFetchedScreen=n,this.fetchMarkdownContent())}async fetchMarkdownContent(){var s,o;const e=this._artifact,n=this._screen;if(!e||!n)return;const i=e.id;try{const a=await n.server.client.markdown.get({artifactID:i});if(((s=this._artifact)==null?void 0:s.id)!==i||this._screen!==n)return;this._missingArtifactID=null,this._markdownContent=a;const c=this._markdownHost;if(!c){this.render();return}c.content=a}catch(a){if(((o=this._artifact)==null?void 0:o.id)!==i||this._screen!==n)return;if(a instanceof Jd&&a.status===kM){this._missingArtifactID=i,this._markdownContent=null,this.disposeMarkdownHost(),this.render();return}this._markdownFetchedArtifactID=null,this._markdownFetchedScreen=null}}isCurrentMarkdownMissing(){var e;return this._missingArtifactID===((e=this._artifact)==null?void 0:e.id)&&this._artifact.kind==="path"&&Sb(this._artifact.path)}missingArtifactTemplate(e){return D`
|
|
245
245
|
<section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
|
|
246
246
|
<div class="artifact-missing-wrapper">
|
|
247
247
|
<h1>${kS()}</h1>
|
|
@@ -253,7 +253,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
253
253
|
<p>${ES()}</p>
|
|
254
254
|
</div>
|
|
255
255
|
</section>
|
|
256
|
-
`}disposeMarkdownHost(){var
|
|
256
|
+
`}disposeMarkdownHost(e={}){var n;(n=this._markdownHost)==null||n.dispose(),this._markdownHost=null,this._markdownFrame=null,this._markdownContentURL=null,this._markdownArtifactID=null,this._markdownFetchedArtifactID=null,this._markdownFetchedScreen=null,e.clearContent&&(this._markdownContent=null)}reloadProxyFrame(){var o,a,c,u;const e=this.querySelector(".artifact-frame:not([data-content-url])");if(!e||e.tagName.toLowerCase()==="webview"&&!(((o=this._artifact)==null?void 0:o.kind)==="path"||((a=this._artifact)==null?void 0:a.kind)==="url"&&vr(this._artifact.url)))return;const n=((c=this._artifact)==null?void 0:c.kind)==="url"&&vr(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(n===null)return;this.closeBridgeGate({render:!1});const i=new URL(n,window.location.href);i.searchParams.set(ms,String(++this._proxyReloadVersion));const s=n.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,this.removeAttribute("data-embed-loaded"),this.render({frameSrcOverride:s})}contentTemplate(e,n){var h;if(e.kind==="path"&&this.isCurrentMarkdownMissing())return this.missingArtifactTemplate(e);const i=this.routeForCurrentNavigation(e),s=(h=this.querySelector(".artifact-frame"))==null?void 0:h.getAttribute("src");let o=null;this._activeReloadFrameSrc&&(IM(this._activeReloadFrameSrc,i.viewURL)?o=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const a=n.frameSrcOverride??o??(n.preserveFrameSrc&&s?s:i.viewURL),c=this._contentURL??i.contentURL,u=this.shouldGateFrame();return i.renderer==="url-webview"?i.contentURL?D`<webview allowpopups class="artifact-frame artifact-content" src=${a} data-content-url=${c} ?data-bridge-pending=${u}></webview>`:D`<webview allowpopups class="artifact-frame artifact-content" src=${a} ?data-bridge-pending=${u}></webview>`:i.renderer==="markdown"?D`<iframe class="artifact-frame artifact-content" src=${a} data-content-url=${c} ?data-bridge-pending=${u}></iframe>`:D`<iframe class="artifact-frame artifact-content" src=${a} ?data-bridge-pending=${u}></iframe>`}routeForCurrentNavigation(e){var s;const n=jl(e,{electron:cr()}),i=((s=this._navigationState)==null?void 0:s.currentURL)??null;if(i===null){const o=this._viewURL??n.viewURL;return n.renderer==="markdown"?{renderer:"markdown",viewURL:o,contentURL:this._contentURL??n.contentURL}:{...n,viewURL:o}}return Hu(i)&&!cr()?vr(i)?{renderer:"proxy-iframe",viewURL:i,contentURL:null}:{renderer:"proxy-iframe",viewURL:Em,contentURL:null}:Hu(i)&&cr()?{renderer:"url-webview",viewURL:i,contentURL:null}:cr()?{renderer:"url-webview",viewURL:this.viewURLForInternalNavigation(i),contentURL:null}:{renderer:"proxy-iframe",viewURL:this.viewURLForInternalNavigation(i),contentURL:null}}forceCurrentFrameSrc(){if(!this._artifact)return;const e=this.routeForCurrentNavigation(this._artifact);if(e.renderer==="url-webview")return;const n=this.querySelector("iframe.artifact-frame");if(n){this.closeBridgeGate(),this._activeReloadFrameSrc=null,this.removeAttribute("data-embed-loaded");try{n.contentWindow&&(n.contentWindow.location.href=e.viewURL)}catch{n.src=e.viewURL}n.src=e.viewURL,n.setAttribute("src",e.viewURL),this.syncEmbedLoadState()}}titleIconTemplate(){const e=this._navigationState;return e!=null&&e.canGoBack?D`
|
|
257
257
|
<button
|
|
258
258
|
icon-only
|
|
259
259
|
size="sm"
|
package/dist/web/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
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-
|
|
8
|
+
<script type="module" crossorigin src="./assets/main-DYwUeskQ.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="./assets/artifact-bridge-C0H5cXgO.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="./assets/missing-artifact-page-DVzJ41AE.js">
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./assets/main-CyvFRuCC.css">
|