@inkandswitch/patchwork-pkg-base 0.0.106 → 0.0.108

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.
Files changed (50) hide show
  1. package/module-settings-url +1 -1
  2. package/package.json +1 -1
  3. package/packages/llm-host/dist/{LlmConfigTray-CjW04jeT.js → LlmConfigTray-CsVpZoou.js} +160 -150
  4. package/packages/llm-host/dist/index.js +1 -1
  5. package/packages/providers/dist/assets/SelectedDocProvider-CpFoW1D5.js +2 -0
  6. package/packages/providers/dist/assets/SelectedDocProvider-CpFoW1D5.js.map +1 -0
  7. package/packages/providers/dist/index.js +1 -1
  8. package/packages/sideboard/dist/{chunk-RZPTJTVZ.js → chunk-3A65VAIS.js} +2 -2
  9. package/packages/sideboard/dist/chunk-B2O2X2JP.js +13 -0
  10. package/packages/sideboard/dist/chunk-B2O2X2JP.js.map +7 -0
  11. package/packages/sideboard/dist/chunk-PVIUDN4Q.js +2 -0
  12. package/packages/sideboard/dist/chunk-PVIUDN4Q.js.map +7 -0
  13. package/packages/sideboard/dist/chunk-WIFOKAHN.js +2 -0
  14. package/packages/sideboard/dist/chunk-WIFOKAHN.js.map +7 -0
  15. package/packages/sideboard/dist/chunk-WPHECYLJ.js +15 -0
  16. package/packages/sideboard/dist/chunk-WPHECYLJ.js.map +7 -0
  17. package/packages/sideboard/dist/{create-new-menu-4VNS2UFI.js → create-new-menu-JPICLPWM.js} +2 -2
  18. package/packages/sideboard/dist/document-list-panel-VFY2RV33.js +2 -0
  19. package/packages/sideboard/dist/index.css +1 -1
  20. package/packages/sideboard/dist/index.css.map +2 -2
  21. package/packages/sideboard/dist/index.js +1 -1
  22. package/packages/sideboard/dist/item-menu-C37UJBFI.js +2 -0
  23. package/packages/sideboard/dist/{item-menu-3JUJN3MS.js.map → item-menu-C37UJBFI.js.map} +1 -1
  24. package/packages/sideboard/dist/sideboard/sideboard.js +1 -1
  25. package/packages/threepane/dist/IsolatedDocumentArea-UTNJADQ7.js +2 -0
  26. package/packages/threepane/dist/{PatchworkFrame-X4GBBC46.js → PatchworkFrame-U2TVLGCZ.js} +2 -2
  27. package/packages/threepane/dist/chunk-XOKWELWP.js +1210 -0
  28. package/packages/threepane/dist/chunk-XOKWELWP.js.map +7 -0
  29. package/packages/threepane/dist/index.js +1 -1
  30. package/plugin-registry-url +1 -1
  31. package/packages/providers/dist/assets/SelectedDocProvider-CLztU54U.js +0 -2
  32. package/packages/providers/dist/assets/SelectedDocProvider-CLztU54U.js.map +0 -1
  33. package/packages/sideboard/dist/chunk-73XN2I2U.js +0 -15
  34. package/packages/sideboard/dist/chunk-73XN2I2U.js.map +0 -7
  35. package/packages/sideboard/dist/chunk-NS3ADG2Z.js +0 -2
  36. package/packages/sideboard/dist/chunk-NS3ADG2Z.js.map +0 -7
  37. package/packages/sideboard/dist/chunk-OFWMAVKQ.js +0 -13
  38. package/packages/sideboard/dist/chunk-OFWMAVKQ.js.map +0 -7
  39. package/packages/sideboard/dist/chunk-YZ573CYO.js +0 -2
  40. package/packages/sideboard/dist/chunk-YZ573CYO.js.map +0 -7
  41. package/packages/sideboard/dist/document-list-panel-SCICIJCF.js +0 -2
  42. package/packages/sideboard/dist/item-menu-3JUJN3MS.js +0 -2
  43. package/packages/threepane/dist/IsolatedDocumentArea-W7IBHNIS.js +0 -2
  44. package/packages/threepane/dist/chunk-MWFQHDD3.js +0 -1210
  45. package/packages/threepane/dist/chunk-MWFQHDD3.js.map +0 -7
  46. /package/packages/sideboard/dist/{chunk-RZPTJTVZ.js.map → chunk-3A65VAIS.js.map} +0 -0
  47. /package/packages/sideboard/dist/{create-new-menu-4VNS2UFI.js.map → create-new-menu-JPICLPWM.js.map} +0 -0
  48. /package/packages/sideboard/dist/{document-list-panel-SCICIJCF.js.map → document-list-panel-VFY2RV33.js.map} +0 -0
  49. /package/packages/threepane/dist/{IsolatedDocumentArea-W7IBHNIS.js.map → IsolatedDocumentArea-UTNJADQ7.js.map} +0 -0
  50. /package/packages/threepane/dist/{PatchworkFrame-X4GBBC46.js.map → PatchworkFrame-U2TVLGCZ.js.map} +0 -0
@@ -1,1210 +0,0 @@
1
- import{a as Ke,b as Wr}from"./chunk-FW4363Y4.js";var xt=Ke((Oi,_t)=>{var ne=1e3,ae=ne*60,ie=ae*60,Q=ie*24,lo=Q*7,co=Q*365.25;_t.exports=function(e,r){r=r||{};var t=typeof e;if(t==="string"&&e.length>0)return uo(e);if(t==="number"&&isFinite(e))return r.long?ho(e):po(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function uo(e){if(e=String(e),!(e.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(r){var t=parseFloat(r[1]),o=(r[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return t*co;case"weeks":case"week":case"w":return t*lo;case"days":case"day":case"d":return t*Q;case"hours":case"hour":case"hrs":case"hr":case"h":return t*ie;case"minutes":case"minute":case"mins":case"min":case"m":return t*ae;case"seconds":case"second":case"secs":case"sec":case"s":return t*ne;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function po(e){var r=Math.abs(e);return r>=Q?Math.round(e/Q)+"d":r>=ie?Math.round(e/ie)+"h":r>=ae?Math.round(e/ae)+"m":r>=ne?Math.round(e/ne)+"s":e+"ms"}function ho(e){var r=Math.abs(e);return r>=Q?Ae(e,r,Q,"day"):r>=ie?Ae(e,r,ie,"hour"):r>=ae?Ae(e,r,ae,"minute"):r>=ne?Ae(e,r,ne,"second"):e+" ms"}function Ae(e,r,t,o){var n=r>=t*1.5;return Math.round(e/t)+" "+o+(n?"s":"")}});var Ct=Ke((zi,kt)=>{function fo(e){t.debug=t,t.default=t,t.coerce=l,t.disable=a,t.enable=n,t.enabled=d,t.humanize=xt(),t.destroy=c,Object.keys(e).forEach(s=>{t[s]=e[s]}),t.names=[],t.skips=[],t.formatters={};function r(s){let u=0;for(let p=0;p<s.length;p++)u=(u<<5)-u+s.charCodeAt(p),u|=0;return t.colors[Math.abs(u)%t.colors.length]}t.selectColor=r;function t(s){let u,p=null,b,w;function m(...h){if(!m.enabled)return;let f=m,_=Number(new Date),R=_-(u||_);f.diff=R,f.prev=u,f.curr=_,u=_,h[0]=t.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let F=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(G,Z)=>{if(G==="%%")return"%";F++;let M=t.formatters[Z];if(typeof M=="function"){let H=h[F];G=M.call(f,H),h.splice(F,1),F--}return G}),t.formatArgs.call(f,h),(f.log||t.log).apply(f,h)}return m.namespace=s,m.useColors=t.useColors(),m.color=t.selectColor(s),m.extend=o,m.destroy=t.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(b!==t.namespaces&&(b=t.namespaces,w=t.enabled(s)),w),set:h=>{p=h}}),typeof t.init=="function"&&t.init(m),m}function o(s,u){let p=t(this.namespace+(typeof u>"u"?":":u)+s);return p.log=this.log,p}function n(s){t.save(s),t.namespaces=s,t.names=[],t.skips=[];let u=(typeof s=="string"?s:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of u)p[0]==="-"?t.skips.push(p.slice(1)):t.names.push(p)}function i(s,u){let p=0,b=0,w=-1,m=0;for(;p<s.length;)if(b<u.length&&(u[b]===s[p]||u[b]==="*"))u[b]==="*"?(w=b,m=p,b++):(p++,b++);else if(w!==-1)b=w+1,m++,p=m;else return!1;for(;b<u.length&&u[b]==="*";)b++;return b===u.length}function a(){let s=[...t.names,...t.skips.map(u=>"-"+u)].join(",");return t.enable(""),s}function d(s){for(let u of t.skips)if(i(s,u))return!1;for(let u of t.names)if(i(s,u))return!0;return!1}function l(s){return s instanceof Error?s.stack||s.message:s}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}kt.exports=fo});var $t=Ke((P,De)=>{P.formatArgs=go;P.save=bo;P.load=vo;P.useColors=mo;P.storage=wo();P.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();P.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function mo(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function go(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+De.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let t=0,o=0;e[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(o=t))}),e.splice(o,0,r)}P.log=console.debug||console.log||(()=>{});function bo(e){try{e?P.storage.setItem("debug",e):P.storage.removeItem("debug")}catch{}}function vo(){let e;try{e=P.storage.getItem("debug")||P.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function wo(){try{return localStorage}catch{}}De.exports=Ct()(P);var{formatters:yo}=De.exports;yo.j=function(e){try{return JSON.stringify(e)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}});import{template as Ur}from"solid-js/web";import{createComponent as ti}from"solid-js/web";import{setAttribute as ri}from"solid-js/web";import{effect as oi}from"solid-js/web";import{insert as jr}from"solid-js/web";import{getOwner as ni}from"solid-js/web";import{createMemo as Or}from"solid-js";import{createStore as si,reconcile as li}from"solid-js/store";import{render as ci}from"solid-js/web";import{template as ut}from"solid-js/web";import{insert as $e}from"solid-js/web";import{getOwner as qe}from"solid-js/web";import{use as Be}from"solid-js/web";import{createComponent as X}from"solid-js/web";import{createUniqueId as Nr,untrack as pt}from"solid-js";import{isServer as Hr,isDev as ht}from"solid-js/web";import{reconcile as qr}from"solid-js/store";function Ye(e,r={}){let t=r.storage||globalThis.localStorage,o=r.name||`storage-${Nr()}`;if(!t)return Object.assign(e,{2:null});let n=r.storageOptions,i=r.serialize||JSON.stringify.bind(JSON),a=r.deserialize||JSON.parse.bind(JSON),d=t.getItem(o,n),l=typeof e[0]=="function"?s=>{try{let u=a(s);e[1](()=>u)}catch(u){ht&&console.warn(u)}}:s=>{try{let u=a(s);e[1](qr(u))}catch(u){ht&&console.warn(u)}},c=!0;if(d instanceof Promise?d.then(s=>c&&s&&l(s)):d&&l(d),typeof r.sync?.[0]=="function"){let s=typeof e[0]=="function"?e[0]:()=>e[0];r.sync[0](u=>{u.key!==o||!Hr&&(u.url||globalThis.location.href)!==globalThis.location.href||u.newValue===i(pt(s))||l(u.newValue)})}return Object.assign([],e,{1:typeof e[0]=="function"?s=>{let u=e[1](s),p=s!=null?i(u):s;return r.sync?.[1](o,p),p!=null?t.setItem(o,p,n):t.removeItem(o,n),c=!1,u}:(...s)=>{e[1](...s);let u=pt(()=>i(e[0]));r.sync?.[1](o,u),t.setItem(o,u,n),c=!1},2:d})}import{createEffect as Rr,createMemo as Fr,createSignal as re,on as Pr,onCleanup as Ga,onMount as Za,Show as Je}from"solid-js";import{createEffect as ft,createSignal as mt,on as gt}from"solid-js";var B={leftCollapsed:"patchwork:leftSidebarCollapsed",rightCollapsed:"patchwork:rightSidebarCollapsed",leftWidth:"patchwork:leftSidebarWidth",rightWidth:"patchwork:rightSidebarWidth",contextToolId:"patchwork:contextSidebarToolId"},Ee="patchwork:collapse-context-sidebar",Te=400;function bt(e,r){let t=localStorage.getItem(e);return t?parseInt(t,10):r}function vt(e){return localStorage.getItem(e)==="true"}function Br(){let[e,r]=mt(vt(B.leftCollapsed)),[t,o]=mt(bt(B.leftWidth,Te));return ft(gt(e,n=>{localStorage.setItem(B.leftCollapsed,String(n))})),ft(gt(t,n=>{localStorage.setItem(B.leftWidth,String(n))})),{isSidebarCollapsed:e,setIsSidebarCollapsed:r,leftSidebarWidth:t,setLeftSidebarWidth:o}}import{onCleanup as Jr,onMount as Vr}from"solid-js";var wt=180,Kr=720,Yr=120,yt=3;function Xe(e,{isCollapsed:r,setCollapsed:t,setWidth:o}){let n=!1,i=null,a=!1,d=null,l=f=>{if(f<Yr){r()||t(!0),d=null;return}r()&&t(!1);let _=Math.min(Kr,f);o(_),d=_},c=()=>{r()||d!==null&&d<wt&&o(wt)},s=null,u=()=>{document.body.setAttribute("data-sidebar-resizing",e),s=document.createElement("div"),s.style.cssText="position:fixed;inset:0;z-index:2147483647;cursor:col-resize;",document.body.appendChild(s)},p=()=>{n=!1,i=null,document.body.style.userSelect="",document.body.removeAttribute("data-sidebar-resizing"),s?.remove(),s=null},b=f=>{f.preventDefault(),i={x:f.clientX,y:f.clientY},a=!1,d=null,n=!0,document.body.style.userSelect="none"},w=()=>{let f=n,_=a;p(),f&&_&&c()},m=f=>{if(!n||!i)return;let _=Math.abs(f.clientX-i.x),R=Math.abs(f.clientY-i.y);!a&&(_>yt||R>yt)&&(a=!0,u()),l(e==="left"?f.clientX:window.innerWidth-f.clientX)},h=f=>{if(a){f.preventDefault(),f.stopPropagation(),a=!1;return}t(_=>!_)};return Vr(()=>{document.addEventListener("mousemove",m),document.addEventListener("mouseup",w),Jr(()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),n&&p()})}),{handleMouseDown:b,handleToggleClick:h}}import{createEffect as Xr,createSignal as Gr,onCleanup as Zr}from"solid-js";var oe=(e,r)=>{let[t,o]=Gr(!1);return Xr(()=>{let n=r();if(!n)return;o(!1);let i=a=>{a.detail?.componentId===e&&o(!0)};n.addEventListener("patchwork:mounted",i),Zr(()=>n.removeEventListener("patchwork:mounted",i))}),t};import{createEffect as Qr,createSignal as eo,onCleanup as to}from"solid-js";var ro=5e3,oo=(e,r)=>{let[t,o]=eo(!1);return Qr(()=>{if(t())return;let n=e(),i=r();if(!n||!i)return;let a=l=>{let c=l.detail;c?.url&&c.url!==i||o(!0)};n.addEventListener("patchwork:mounted",a),n.addEventListener("patchwork:no-tool",a);let d=setTimeout(()=>o(!0),ro);to(()=>{n.removeEventListener("patchwork:mounted",a),n.removeEventListener("patchwork:no-tool",a),clearTimeout(d)})}),t};import{getRegistry as no}from"@inkandswitch/patchwork-plugins";import{createMemo as ao,createSignal as io,onCleanup as so}from"solid-js";function me(e){let r=no("patchwork:component"),[t,o]=io(0),n=r.on("changed",()=>o(i=>i+1));return so(n),ao(()=>(t(),(r.all?.()??[]).filter(i=>(i.tags??[]).includes(e)).map(i=>({id:i.id,name:i.name||i.id,icon:i.icon})).sort((i,a)=>i.name.localeCompare(a.name))))}import{template as _e}from"solid-js/web";import{delegateEvents as un}from"solid-js/web";import{getOwner as pn}from"solid-js/web";import{effect as Zt}from"solid-js/web";import{setAttribute as hn}from"solid-js/web";import{memo as Qt}from"solid-js/web";import{insert as ce}from"solid-js/web";import{createComponent as de}from"solid-js/web";import{For as wn,Show as rt}from"solid-js";import{template as Pt}from"solid-js/web";import{delegateEvents as Io}from"solid-js/web";import{setAttribute as Ro}from"solid-js/web";import{insert as Fo}from"solid-js/web";import"solid-js/web";import{effect as Ft}from"solid-js/web";import{use as Lt}from"solid-js/web";import{createComponent as Ge}from"solid-js/web";var Tt=Wr($t(),1),At=(0,Tt.default)("cabbages");function St(e){return typeof e=="object"&&typeof e!=null&&Object.getPrototypeOf(e)==Object.prototype}var _o="\uFFFC";function Dt(e,...r){if(r.length==0){At("empty patch");return}let[t,o,n]=r,i=[...t];for(;;){let a=i.shift();if(!i.length){let l=Array.isArray(o);if(St(e)&&l&&typeof a>"u"&&typeof o[0]=="string"){delete e[o[0]];return}if(l||typeof o=="number"){if(typeof a>"u")throw new Error("cant treat top level as a seq");a=a;let[c,s]=Array.isArray(o)?o:[o,o+1],u=Array.isArray(o)&&o.length==0;if(!u&&(c==null||s==null))throw new RangeError("it's all or nothing, no half measures");let p=typeof n>"u",b=c===s&&!p,w=u&&!p,m=!b&&!p&&!w;if(typeof e[a]>"u"){if(typeof e=="string")return;typeof n=="string"?e[a]="":e[a]=[]}let h=e[a];if(Array.isArray(h)){if(w){Array.isArray(n)?h.push(...n):h.push(n);return}if(b||m){Array.isArray(n)?h.splice(c,s-c,...n):h.splice(c,s-c,n);return}if(p){h.splice(c,s-c);return}throw new Error("i don't know what happened")}if(typeof h=="string"){if(w){e[a]=h+n;return}if(m||b){e[a]=h.slice(0,c)+(typeof n=="string"?n:n.map(f=>typeof f=="string"?f:_o).join(""))+h.slice(s);return}if(p){e[a]=h.slice(0,c)+h.slice(s);return}throw new Error("i don't know what happened")}if(St(h)&&l&&typeof o[0]=="string"){delete h[o[0]];return}throw new Error("not implemented")}if(typeof a>"u"){if(typeof o!="string")throw new Error(`can't index top-level map with ${o}`);typeof n>"u"?delete e[o]:e[o]=n;return}if(typeof e[a]>"u"&&(e[a]={}),l){let[c,s]=o;c!=null&&s!=null&&(typeof n>"u"&&c!=null&&s!=null?delete e[a][c||s]:e[a][c||s]=n)}else if(typeof n>"u")delete e[a][o];else{if(typeof e[a]=="string")return;e[a][o]=n}return}if(typeof a>"u")throw new Error("cant treat top level as a seq");a=a;let d=i[0];if(typeof e[a]>"u")if(typeof d=="string")e[a]={};else if(typeof d=="number")e[a]=[];else throw new Error(`can't go down this road ${e}.${a}.${d}`);e=e[a]}}function Et(e,r){for(let t=0;t<r.length;t++)e=e?e[r[t]]:void 0;return e}function It(e,r){let t=e.path.slice(0,-1),o=e.path[e.path.length-1];switch(e.action){case"mark":case"unmark":return At(`skipping ${e.action} because it doesn't affect material reality`),[];case"inc":if(r)return[t,o,Et(r.patchInfo.after,e.path)];throw new Error(`can't apply ${e.action} without payload argument`);case"conflict":if(r)return[t,o,Et(r.patchInfo.after,e.path)];throw new Error(`can't apply ${e.action} without payload argument`);case"del":return typeof o=="string"?[t,o]:[t,[o,o+(e.length||1)]];case"insert":return[t,[o,o],structuredClone(e.values)];case"splice":return[t,[o,o],[e.value]];case"put":return[t,o,structuredClone(e.value)]}}function Ie(e){return r=>{for(let t of e.patches)Dt(r,...It(t,e))}}import{createMemo as $o}from"solid-js";import{onCleanup as xo}from"solid-js";import{createStore as ko,produce as Co,reconcile as Rt}from"solid-js/store";var ge=new WeakMap;function Re(e){if(xo(()=>{let i=ge.get(e);i&&(i.refs--||i.cleanup())}),ge.has(e)){let i=ge.get(e);return i.refs++,i.store}let[r,t]=ko(structuredClone(e.doc()));ge.set(e,{refs:0,store:r,cleanup(){e.off("change",o),e.off("delete",n),ge.delete(e)}});function o(i){if(i.scopeReplaced){t(Rt(i.doc??{}));return}t(Co(Ie(i)))}function n(){t(Rt({}))}return e.on("change",o),e.on("delete",n),e.whenReady().then(()=>{t(structuredClone(e.doc()))}),r}import{getOwner as Vi,onCleanup as Ki,createSignal as Yi,untrack as Xi,sharedConfig as Gi,onMount as Zi,DEV as Qi,equalFn as es}from"solid-js";import{isServer as rs}from"solid-js/web";var se=e=>typeof e=="function"&&!e.length?e():e;function Fe(e){return $o(()=>se(e)&&Re(se(e)))}import{createEffect as Eo,createResource as To,useContext as Ao}from"solid-js";import{createContext as So}from"solid-js";var Pe=So(null);function be(e,r){let t=Ao(Pe);if(!r?.repo&&!t)throw new Error("use outside <RepoContext> requires options.repo");let o=r?.repo||t;function n(){if(r?.["~skipInitialValue"])return;let d=se(e);if(!d)return;let l=o.findWithProgress(d).peek();return l.state==="ready"?l.handle:void 0}let[i,{mutate:a}]=To(e,d=>o.findWithProgress(d).whenReady(),{initialValue:n()});return Eo(()=>{se(e)||a()}),i}function Le(e,r){let t=be(e,r);return[Fe(t),t]}import{onCleanup as ws}from"solid-js";import{createSignal as _s}from"solid-js";import{createEffect as Cs,onCleanup as $s}from"solid-js";import{createSignal as Es}from"solid-js";import{useContext as Ps}from"solid-js";import{getType as Lo}from"@inkandswitch/patchwork-filesystem";import{getRegistry as Mo,isLoadedPlugin as Oo}from"@inkandswitch/patchwork-plugins";import{createEffect as zo,createMemo as Me,createSignal as Ze,onCleanup as Uo,onMount as Ot,Show as zt}from"solid-js";var Mt=Pt("<span class=threepane__title-text>"),Po=Pt("<input class=threepane__title-input type=text>");function Ut(e){let r,[t,o]=Ze();return Ot(()=>{o(r.closest("repo-provider")?.repo)}),Ge(zt,{get when(){return t()},get fallback(){return(()=>{var n=Mt(),i=r;return typeof i=="function"?Lt(i,n):r=n,n})()},children:n=>Ge(jo,{get docUrl(){return e.docUrl},get repo(){return n()}})})}function jo(e){let[r,t]=Le(()=>e.docUrl(),{repo:e.repo}),o=Mo("patchwork:datatype"),[n,i]=Ze(0);Ot(()=>{let m=o.on("changed",()=>i(h=>h+1));Uo(m)});let a=Me(()=>{let m=r();return m?Lo(m):void 0});zo(()=>{let m=a();m&&o.load(m)});let d=Me(()=>{n();let m=a();if(!m)return;let h=o.get(m);return h&&Oo(h)?h:void 0}),l=Me(()=>{let m=r(),h=d();if(!(!m||!h))return h.module.getTitle(m)}),c=Me(()=>!!t()&&typeof d()?.module.setTitle=="function"),[s,u]=Ze(!1),p;function b(){c()&&(u(!0),queueMicrotask(()=>{p?.focus(),p?.select()}))}function w(m){if(!s()||(u(!1),!m))return;let h=p?.value.trim();if(!h||h===l())return;let f=t(),_=d()?.module.setTitle;!f||!_||f.change(R=>{_(R,h);let F=R["@patchwork"];F&&(F.title=h)})}return Ge(zt,{get when(){return s()},get fallback(){return(()=>{var m=Mt();return m.$$click=b,Fo(m,()=>l()??"Untitled"),Ft(h=>{var f=!!c(),_=c()?"Rename":void 0;return f!==h.e&&m.classList.toggle("threepane__title-text--editable",h.e=f),_!==h.t&&Ro(m,"title",h.t=_),h},{e:void 0,t:void 0}),m})()},get children(){var m=Po();m.$$keydown=f=>{f.key==="Enter"?(f.preventDefault(),w(!0)):f.key==="Escape"&&(f.preventDefault(),w(!1))},m.addEventListener("blur",()=>w(!0));var h=p;return typeof h=="function"?Lt(h,m):p=m,Ft(()=>m.value=l()??""),m}})}Io(["keydown","click"]);import{template as ye}from"solid-js/web";import{delegateEvents as Qo}from"solid-js/web";import{getOwner as en}from"solid-js/web";import{insert as we}from"solid-js/web";import{createComponent as le}from"solid-js/web";import{Show as Qe}from"solid-js";import{template as Ht}from"solid-js/web";import{delegateEvents as Wo}from"solid-js/web";import{setStyleProperty as No}from"solid-js/web";import{insert as Ho}from"solid-js/web";import{setAttribute as Oe}from"solid-js/web";import{effect as jt}from"solid-js/web";import{memo as ve}from"solid-js/web";import{createComponent as Wt}from"solid-js/web";import{Show as Nt}from"solid-js";var qo=Ht('<button class="sidebar-toggle sidebar-toggle--resizable">'),Bo=Ht("<div class=sidebar>");function qt(e){let r=()=>`${e.isCollapsed()?0:e.width()}px`,t=()=>e.canExpand?.()??!0,o=()=>Wt(Nt,{get when(){return!e.isCollapsed()},get children(){return e.children}}),n=()=>Wt(Nt,{get when(){return!e.isCollapsed()||t()},get children(){var i=qo();return i.$$mousedown=a=>e.onMouseDown(a),i.$$click=a=>e.onToggleClick(a),jt(a=>{var d=e.isCollapsed()?"Expand sidebar":"Toggle or resize sidebar",l=e.isCollapsed()?"Click to expand, drag to resize":"Click to toggle, drag to resize";return d!==a.e&&Oe(i,"aria-label",a.e=d),l!==a.t&&Oe(i,"title",a.t=l),a},{e:void 0,t:void 0}),i}});return(()=>{var i=Bo();return Ho(i,(()=>{var a=ve(()=>e.side==="left");return()=>a()?[ve(o),ve(n)]:[ve(n),ve(o)]})()),jt(a=>{var d=e.side,l=e.isCollapsed()?"":void 0,c=r();return d!==a.e&&Oe(i,"data-side",a.e=d),l!==a.t&&Oe(i,"data-collapsed",a.t=l),c!==a.a&&No(i,"width",a.a=c),a},{e:void 0,t:void 0,a:void 0}),i})()}Wo(["click","mousedown"]);import{template as Jt}from"solid-js/web";import{delegateEvents as Jo}from"solid-js/web";import{setAttribute as Vo}from"solid-js/web";import{effect as Ko}from"solid-js/web";import{insert as Bt}from"solid-js/web";import{createComponent as Yo}from"solid-js/web";import{For as Zo}from"solid-js";var Xo=Jt("<div role=tablist class=context-sidebar__tablist>"),Go=Jt("<button type=button role=tab class=context-sidebar__tab>");function Vt(e){let r=()=>{let t=e.items().map(n=>n.id),o=e.selectedToolId();return o&&t.includes(o)?o:t[0]};return(()=>{var t=Xo();return Bt(t,Yo(Zo,{get each(){return e.items()},children:o=>(()=>{var n=Go();return n.$$click=()=>e.setSelectedToolId(o.id),Bt(n,()=>o.name),Ko(()=>Vo(n,"data-active",r()===o.id?"":void 0)),n})()})),t})()}Jo(["click"]);var tn=ye('<div class=context-sidebar__tabs><button type=button class=context-sidebar__close title="Hide context sidebar"aria-label="Hide context sidebar">'),rn=ye("<div class=context-sidebar__content>"),on=ye("<div class=context-sidebar>"),nn=ye("<patchwork-view>",!0,!1,!1),an=ye('<svg xmlns=http://www.w3.org/2000/svg width=18 height=18 viewBox="0 0 24 24"fill=none stroke=var(--studio-chrome-line) stroke-width=1.75 stroke-linecap=round stroke-linejoin=round><rect width=18 height=18 x=3 y=3 rx=2></rect><path d="M15 3v18">');function Kt(e){let r=me("context-tool"),t=()=>{let o=r().map(i=>i.id),n=e.selectedToolId();return n&&o.includes(n)?n:o[0]};return le(qt,{side:"right",get isCollapsed(){return e.isCollapsed},get width(){return e.width},get onMouseDown(){return e.onMouseDown},get onToggleClick(){return e.onToggleClick},get canExpand(){return e.canExpand},get children(){var o=on();return we(o,le(Qe,{get when(){return r().length},get children(){var n=tn(),i=n.firstChild;return we(n,le(Vt,{items:r,get selectedToolId(){return e.selectedToolId},get setSelectedToolId(){return e.setSelectedToolId}}),i),i.$$click=()=>e.onCollapse(),we(i,le(et,{})),n}}),null),we(o,le(Qe,{get when(){return!e.isCollapsed()},get children(){var n=rn();return we(n,le(Qe,{get when(){return t()},keyed:!0,children:i=>(()=>{var a=nn();return a.component=i,a._$owner=en(),a})()})),n}}),null),o}})}function et(){return an()}Qo(["click"]);import{template as sn}from"solid-js/web";import{effect as Yt}from"solid-js/web";import{getOwner as Xt}from"solid-js/web";import{createComponent as ln}from"solid-js/web";import{memo as cn}from"solid-js/web";import{Show as dn}from"solid-js";var Gt=sn("<patchwork-view>",!0,!1,!1),tt=e=>Array.isArray(e)?String(e[0]):String(e);function ql(e){let r=new Set;return e.filter(t=>{let o=tt(t);return r.has(o)?!1:(r.add(o),!0)})}function Bl(e){return ln(dn,{get when(){return cn(()=>!!Array.isArray(e.slot))()?e.slot:!1},get fallback(){return(()=>{var r=Gt();return r._$owner=Xt(),Yt(()=>r.component=String(e.slot)),r})()},children:r=>(()=>{var t=Gt();return t._$owner=Xt(),Yt(o=>{var n=r()[1],i=r()[0];return n!==o.e&&(t.docUrl=o.e=n),i!==o.t&&(t.toolId=o.t=i),o},{e:void 0,t:void 0}),t})()})}var fn=_e("<div class=threepane__title>"),mn=_e("<div class=threepane__doctitle-tools>"),gn=_e('<button type=button class=frame__sidebar-toggle title="Show context sidebar"aria-label="Show context sidebar">'),bn=_e("<div class=frame__topbar><div class=threepane__spacer>"),vn=_e("<patchwork-view>",!0,!1,!1);function er(e){let r=()=>e.toolSlots()??[];return(()=>{var t=bn(),o=t.firstChild;return ce(t,de(rt,{get when(){return e.docUrl()},get children(){var n=fn();return ce(n,de(Ut,{get docUrl(){return e.docUrl}})),n}}),o),ce(t,de(rt,{get when(){return Qt(()=>!!e.docUrl())()&&r().length},get children(){var n=mn();return ce(n,de(wn,{get each(){return r()},children:i=>(()=>{var a=vn();return a._$owner=pn(),Zt(d=>{var l=tt(i),c=e.docUrl();return l!==d.e&&(a.toolId=d.e=l),c!==d.t&&(a.docUrl=d.t=c),d},{e:void 0,t:void 0}),a})()})),n}}),null),ce(t,de(rt,{get when(){return Qt(()=>!!e.hasContext())()&&e.isRightCollapsed()},get children(){var n=gn();return n.$$click=()=>e.onToggleRight(),hn(n,"aria-pressed",!1),ce(n,de(et,{})),n}}),null),Zt(()=>t.classList.toggle("frame__topbar--left-collapsed",!!e.isLeftCollapsed())),t})()}un(["click"]);import{template as He}from"solid-js/web";import{effect as Sr}from"solid-js/web";import{getOwner as Er}from"solid-js/web";import{insert as V}from"solid-js/web";import{createComponent as I}from"solid-js/web";import{memo as Ce}from"solid-js/web";import{use as Tr}from"solid-js/web";import{parseAutomergeUrl as za}from"@automerge/automerge-repo/slim";import{getSuggestedImportUrl as Ua,getType as ja}from"@inkandswitch/patchwork-filesystem";import{getFallbackTool as Wa,getRegistry as Na}from"@inkandswitch/patchwork-plugins";import{createEffect as dt,createMemo as Ne,createSignal as J,onCleanup as te,onMount as Ha,Show as W}from"solid-js";import{template as C}from"solid-js/web";import{delegateEvents as na}from"solid-js/web";import{setAttribute as We}from"solid-js/web";import{effect as lt}from"solid-js/web";import"solid-js/web";import{createComponent as A}from"solid-js/web";import{insert as D}from"solid-js/web";import{use as aa}from"solid-js/web";import{importPackage as Aa}from"@inkandswitch/patchwork-filesystem";import{registerPlugins as Da}from"@inkandswitch/patchwork-plugins";import{createResource as Ia,createSignal as pe,onCleanup as st,onMount as Ra,Show as j}from"solid-js";import{template as k}from"solid-js/web";import{delegateEvents as En}from"solid-js/web";import{effect as pr}from"solid-js/web";import{memo as Tn}from"solid-js/web";import{insert as v}from"solid-js/web";import{createComponent as x}from"solid-js/web";import{use as An}from"solid-js/web";import{setAttribute as xe}from"solid-js/web";import{createResource as Zn,createSignal as Ue,For as it,Match as ue,onMount as Qn,Show as O,Switch as lr}from"solid-js";import*as rr from"@automerge/automerge/slim";import{getImportableUrlFromAutomergeUrl as yn}from"@inkandswitch/patchwork-filesystem";var ot=e=>e.startsWith("automerge:");function _n(e){return e.replace(/[#?].*$/,"")}function or(e){let r=e.split("#")[1];return r?r.split("|").filter(Boolean):[]}var U=e=>typeof e=="string"&&e.trim()?e.trim():void 0;function xn(e){if(typeof e=="string")return U(e);if(e&&typeof e=="object"){let{name:r,email:t}=e,o=U(r),n=U(t);return o&&n?`${o} <${n}>`:o??n}}function nr(e){if(!e||typeof e!="object")return{};let r=e,t=r.supportedDatatypes;return{id:U(r.id),name:U(r.name),type:U(r.type),supportedDatatypes:typeof t=="string"?[t]:Array.isArray(t)?t.filter(o=>typeof o=="string"):void 0}}async function tr(e){try{let r=await fetch(e);return r.ok?await r.json():void 0}catch{return}}var kn=new Set(["dist","build","lib","out","esm","src","public"]);async function Cn(e){if(ot(e)){let o=yn(e);return tr(new URL("package.json",o).href)}let r;try{r=new URL(e)}catch{return}let t=r.pathname.split("/").filter(Boolean);for(/\.[a-z0-9]+$/i.test(t.at(-1)??"")&&t.pop();;){let o=`${r.origin}/${t.join("/")}${t.length?"/":""}`,n=await tr(new URL("package.json",o).href);if(n&&typeof n=="object")return n;if(!kn.has(t.at(-1)?.toLowerCase()??""))return;t.pop()}}async function ar(e){let r=await Cn(e);if(r)return{name:U(r.name),title:U(r.title),version:U(r.version),description:U(r.description),author:xn(r.author),plugins:Array.isArray(r.plugins)?r.plugins.map(nr):void 0}}var ze,$n=1,ee=new Map;function Sn(){if(ze)return ze;let e=new Worker("/module-loader-worker.js",{type:"module",name:"threepane-package-preview"});return e.addEventListener("message",r=>{let t=r.data,o=t&&ee.get(t.id);o&&(ee.delete(t.id),t.type==="descriptors"?o.resolve(t.descriptors.map(nr)):o.reject(new Error(t.error)))}),e.addEventListener("error",r=>{let t=new Error(`the background worker stopped: ${r.message??"no reason given"}`);for(let o of ee.values())o.reject(t);ee.clear(),ze=void 0}),ze=e,e}function ir(e,r=15e3){let t=$n++;return new Promise((o,n)=>{let i=setTimeout(()=>{ee.delete(t)&&n(new Error("it took too long to answer"))},r);ee.set(t,{resolve:a=>{clearTimeout(i),o(a)},reject:a=>{clearTimeout(i),n(a)}});try{Sn().postMessage({type:"discover",id:t,url:e})}catch(a){clearTimeout(i),ee.delete(t),n(a instanceof Error?a:new Error(String(a)))}})}async function sr(e,r){let t=await e.find(_n(r)),o=t.doc();await new Promise(a=>setTimeout(a,0));let n=rr.getChangesMetaSince(o,[]),i=new Map;for(let a of n){let d=a.time??0,l=i.get(a.actor);if(!l){i.set(a.actor,{actor:a.actor,changes:1,first:d,last:d});continue}l.changes++,d&&(!l.first||d<l.first)&&(l.first=d),d>l.last&&(l.last=d)}return{heads:[...t.heads()],changes:n.length,writers:[...i.values()].sort((a,d)=>d.changes-a.changes)}}var Dn=k("<button type=button class=doc-card__link>see package details"),In=k("<p class=pkg-about__quiet>reading\u2026"),Rn=k("<p class=pkg-about__quiet>no package.json."),Fn=k("<dl class=pkg-about__facts><dt>plugins</dt><dd>"),Pn=k("<dt>pinned"),at=k("<dd>"),nt=k("<dt>history"),Ln=k("<dd class=pkg-about__quiet>reading\u2026"),Mn=k("<dd class=pkg-about__quiet>couldn't get its folder."),On=k('<div class=pkg-about popover=auto><header class=pkg-about__header><h3 class=doc-card__rough></h3><button type=button class="doc-card__link pkg-about__close"popovertargetaction=hide aria-label=close>\xD7</button></header><section class="pkg-about__section pkg-about__section--claims"><h4>self-reported <span class=pkg-about__tag>unverified</span></h4></section><section class=pkg-about__section><h4>source</h4><dl class=pkg-about__facts><dt>url</dt><dd><code class="doc-card__code doc-card__url">'),zn=k("<span class=pkg-about__version> "),Un=k("<button type=button class=doc-card__link>"),jn=k("<span class=pkg-about__quiet>unknown until loaded"),Wn=k("<p class=doc-card__notice>"),Nn=k("<dt>heads"),Hn=k("<dd> <!>, <!> <p class=pkg-about__quiet>writers are devices, not people. folder only."),qn=k("<dt>"),hr=k("<ul class=pkg-about__list>"),Bn=k("<span>nothing"),Jn=k("<span class=pkg-about__quiet> for "),Vn=k("<li>"),fr=k("<span class=pkg-about__quiet> \xB7 "),Kn=k("<span class=pkg-about__heads>"),Yn=k("<code class=doc-card__code>"),Xn=k("<li class=pkg-about__quiet>and <!> more"),Gn=k("<li><code class=doc-card__code></code> <!> "),ea=0;function mr(e){let r=`pkg-about-${++ea}`,t=ot(e.url),o=or(e.url),[n,i]=Ue(!1),[a]=Zn(()=>n()&&t?e.url:void 0,f=>sr(e.repo,f)),[d,l]=Ue(!1),[c,s]=Ue(),[u,p]=Ue();async function b(){if(window.confirm(`Listing its plugins runs the package's code in a background worker.
2
-
3
- ${e.url}
4
-
5
- It can use the network and this site's stored data, including your documents. Only run it if you trust where it came from.
6
-
7
- Run it?`)){p(void 0),l(!0);try{s(await ir(e.url))}catch(_){p(_?.message??String(_))}finally{l(!1)}}}let w;Qn(()=>{w.addEventListener("toggle",f=>{f.newState==="open"&&i(!0)})});let m=()=>e.claims?.title??e.claims?.name??"package",h=()=>c()??e.claims?.plugins;return[(()=>{var f=Dn();return xe(f,"popovertarget",r),f})(),(()=>{var f=On(),_=f.firstChild,R=_.firstChild,F=R.nextSibling,N=_.nextSibling,G=N.firstChild,Z=N.nextSibling,M=Z.firstChild,H=M.nextSibling,he=H.firstChild,fe=he.nextSibling,Se=fe.firstChild,K=w;return typeof K=="function"?An(K,f):w=f,xe(f,"id",r),v(R,m,null),v(R,x(O,{get when(){return e.claims?.version},children:S=>(()=>{var $=zn(),Y=$.firstChild;return v($,S,null),$})()}),null),xe(F,"popovertarget",r),v(N,x(lr,{get children(){return[x(ue,{get when(){return e.claimsLoading},get children(){return In()}}),x(ue,{get when(){return Tn(()=>!e.claims)()&&!c()},get children(){return Rn()}}),x(ue,{when:!0,get children(){var S=Fn(),$=S.firstChild,Y=$.nextSibling;return v(S,x(je,{label:"name",get value(){return e.claims?.name}}),$),v(S,x(je,{label:"title",get value(){return e.claims?.title}}),$),v(S,x(je,{label:"author",get value(){return e.claims?.author}}),$),v(S,x(je,{label:"description",get value(){return e.claims?.description}}),$),v(Y,x(O,{get when(){return h()},get fallback(){return x(O,{when:t,get fallback(){return jn()},get children(){var L=Un();return L.$$click=()=>void b(),v(L,()=>d()?"listing\u2026":"list them"),pr(()=>L.disabled=d()),L}})},children:L=>x(ta,{get plugins(){return L()}})}),null),v(Y,x(O,{get when(){return u()},children:L=>(()=>{var g=Wn();return v(g,L),g})()}),null),S}})]}}),null),v(Se,()=>e.url),v(H,x(O,{get when(){return o.length},get children(){return[Pn(),(()=>{var S=at();return v(S,x(cr,{heads:o})),S})()]}}),null),v(H,x(O,{when:t,get children(){return x(lr,{get children(){return[x(ue,{get when(){return a.loading},get children(){return[nt(),Ln()]}}),x(ue,{get when(){return a.error},get children(){return[nt(),Mn()]}}),x(ue,{get when(){return a()},children:S=>[Nn(),(()=>{var $=at();return v($,x(cr,{get heads(){return S().heads}})),$})(),nt(),(()=>{var $=Hn(),Y=$.firstChild,L=Y.nextSibling,g=L.nextSibling,y=g.nextSibling,E=y.nextSibling,T=E.nextSibling;return v($,()=>S().changes,Y),v($,()=>S().changes===1?"change":"changes",L),v($,()=>S().writers.length,y),v($,()=>S().writers.length===1?"writer":"writers",T),v($,x(ra,{get writers(){return S().writers}}),T),$})()]})]}})}}),null),f})()]}function je(e){return x(O,{get when(){return e.value},get children(){return[(()=>{var r=qn();return v(r,()=>e.label),r})(),(()=>{var r=at();return v(r,()=>e.value),r})()]}})}function ta(e){return x(O,{get when(){return e.plugins.length},get fallback(){return Bn()},get children(){var r=hr();return v(r,x(it,{get each(){return e.plugins},children:t=>(()=>{var o=Vn();return v(o,()=>t.name??t.id??"(unnamed)",null),v(o,x(O,{get when(){return t.type},children:n=>(()=>{var i=fr(),a=i.firstChild;return v(i,n,null),i})()}),null),v(o,x(O,{get when(){return t.supportedDatatypes?.length},get children(){var n=Jn(),i=n.firstChild;return v(n,()=>t.supportedDatatypes.join(", "),null),n}}),null),o})()})),r}})}function cr(e){return(()=>{var r=Kn();return v(r,x(it,{get each(){return e.heads},children:t=>(()=>{var o=Yn();return xe(o,"title",t),v(o,()=>t.slice(0,7)),o})()})),r})()}var dr=6;function ra(e){let r=()=>e.writers.length-dr;return(()=>{var t=hr();return v(t,x(it,{get each(){return e.writers.slice(0,dr)},children:o=>(()=>{var n=Gn(),i=n.firstChild,a=i.nextSibling,d=a.nextSibling,l=d.nextSibling;return v(i,()=>o.actor.slice(0,8)),v(n,()=>o.changes,d),v(n,()=>o.changes===1?"change":"changes",null),v(n,x(O,{get when(){return o.last},get children(){var c=fr(),s=c.firstChild;return v(c,()=>oa(o),null),c}}),null),pr(()=>xe(i,"title",o.actor)),n})()}),null),v(t,x(O,{get when(){return r()>0},get children(){var o=Xn(),n=o.firstChild,i=n.nextSibling,a=i.nextSibling;return v(o,r,i),o}}),null),t})()}function ur(e){return new Date(e*1e3).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function oa(e){let r=ur(e.last),t=e.first?ur(e.first):r;return t===r?r:`${t} \u2013 ${r}`}En(["click"]);var ia=C("<div class=doc-card><svg class=doc-card__defs aria-hidden=true><filter id=doc-card-rough><feTurbulence type=fractalNoise baseFrequency=0.04 numOctaves=2 seed=1></feTurbulence><feDisplacementMap in=SourceGraphic scale=1.4></feDisplacementMap></filter></svg><div class=doc-card__sheet><h2 class=doc-card__rough>"),sa=C('<div class="doc-card doc-card--finding"role=status><span class=doc-card__dot></span><span class=doc-card__finding-label>finding this doc\u2026'),la=C("<p>it's a <code class=doc-card__code></code>.<br>nothing here opens one yet."),ca=C("<p class=doc-card__links>"),da=C("<p>it'll open here if a package adds a tool for it."),ua=C("<p>the doc suggests "),ct=C('<div class=doc-card__actions><button type=button class="doc-card__button doc-card__button--primary">'),pa=C("<strong class=pkg-line>"),ha=C("<span class=pkg-line__version> "),fa=C("<p class=doc-card__notice>couldn't load it: "),ma=C("<button type=button class=doc-card__link>open doc with "),ga=C("<p>we couldn't get it from anywhere we looked.<br>that might mean:"),ba=C("<ul class=doc-card__reasons><li>the person who sent you the link hasn't given you access yet</li><li>it hasn't finished syncing from their device yet</li><li>something's wrong with the "),va=C("<p>we'll keep looking. if it turns up, it'll open right here."),wa=C("<button type=button class=doc-card__sync>sync server"),ya=C("<span class=doc-card__sync-told role=status> (<!>)"),_a=C("<p>found it, but it's private."),xa=C("<p>ask the owner to share it. if you're not in their phonebook, send them your card."),ka=C("<p>it'll open right here once they do."),Ca=C("<p>the doc is here, but the tool that shows it didn't load."),$a=C("<p class=doc-card__notice>"),Sa=C("<p>a bit of it got lost or changed on the way here, so it can't point at any doc. maybe a character dropped when it was copied, or the link got cut short."),Ea=C("<p>if someone sent it to you, ask them for the link again."),Ta=C('<p class=doc-card__aside><code class="doc-card__code doc-card__url">');function ke(e){let r;return Ra(()=>{r.dispatchEvent(new CustomEvent("patchwork:no-tool",{bubbles:!0,composed:!0,detail:{url:e.url}}))}),(()=>{var t=ia(),o=t.firstChild,n=o.nextSibling,i=n.firstChild,a=r;return typeof a=="function"?aa(a,t):r=t,D(i,()=>e.title),D(n,()=>e.children,null),t})()}function gr(){return sa()}function br(e){let[r,t]=pe(!1),[o,n]=pe(),[i]=Ia(()=>e.suggestion,l=>ar(l).catch(()=>{}));async function a(l){if(window.confirm(`Load this package?
8
-
9
- ${l}
10
-
11
- Its code runs in this page and can read and change your documents. Only load it if you trust where it came from.`)){n(void 0),t(!0);try{let s=await Aa(l);if(!Array.isArray(s?.plugins))throw new Error("it doesn't export any plugins");Da(s.plugins,l)}catch(s){console.error(`couldn't load the package at ${l}`,s),n(s?.message??String(s))}finally{t(!1)}}}let d=()=>{let l=i();return l&&(l.title||l.name)?l:void 0};return A(ke,{get url(){return e.url},title:"no tool for this",get children(){return[(()=>{var l=la(),c=l.firstChild,s=c.nextSibling;return D(s,()=>e.type),l})(),A(j,{get when(){return e.suggestion},get fallback(){return da()},children:l=>[(()=>{var c=ua(),s=c.firstChild;return D(c,A(j,{get when(){return d()},fallback:"a package.",children:u=>[(()=>{var p=pa();return D(p,()=>u().title??u().name),p})(),A(j,{get when(){return u().version},children:p=>(()=>{var b=ha(),w=b.firstChild;return D(b,p,null),b})()}),"."]}),null),c})(),(()=>{var c=ct(),s=c.firstChild;return s.$$click=()=>void a(l()),D(s,()=>r()?"loading\u2026":"load package"),lt(()=>s.disabled=r()),c})(),A(j,{get when(){return o()},children:c=>(()=>{var s=fa(),u=s.firstChild;return D(s,c,null),s})()})]}),A(j,{get when(){return e.suggestion||e.anything},get children(){var l=ca();return D(l,A(j,{get when(){return e.suggestion},children:c=>A(mr,{get url(){return c()},get repo(){return e.repo},get claims(){return i()},get claimsLoading(){return i.loading}})}),null),D(l,A(j,{get when(){return e.anything},children:c=>(()=>{var s=ma(),u=s.firstChild;return s.$$click=()=>e.onPeek(c().id),D(s,()=>c().name.toLowerCase(),null),s})()}),null),l}})]}})}function vr(e){let r=e.repo,t=typeof r.isSubductionConnected=="function",[o,n]=pe(t?r.isSubductionConnected():void 0),i=a=>{let d=o();n(a),a&&d===!1&&e.onRetry()};if(t&&r.on&&r.off){let a=d=>i(d.connected);r.on("subduction-connection",a),st(()=>r.off("subduction-connection",a))}if(t){let a=setInterval(()=>i(r.isSubductionConnected()),2e3);st(()=>clearInterval(a))}return A(ke,{get url(){return e.url},title:"can't load this doc",get children(){return[ga(),(()=>{var a=ba(),d=a.firstChild,l=d.nextSibling,c=l.nextSibling,s=c.firstChild;return D(c,A(j,{get when(){return o()!==void 0},fallback:"sync server",get children(){return A(Fa,{get connected(){return o()}})}}),null),a})(),va()]}})}function Fa(e){let[r,t]=pe(!1),o=()=>`sync server: ${e.connected?"connected":"disconnected"}`;return[(()=>{var n=wa();return n.$$click=()=>t(i=>!i),lt(i=>{var a=e.connected?"":void 0,d=o(),l=o(),c=r();return a!==i.e&&We(n,"data-connected",i.e=a),d!==i.t&&We(n,"title",i.t=d),l!==i.a&&We(n,"aria-label",i.a=l),c!==i.o&&We(n,"aria-expanded",i.o=c),i},{e:void 0,t:void 0,a:void 0,o:void 0}),n})(),A(j,{get when(){return r()},get children(){var n=ya(),i=n.firstChild,a=i.nextSibling,d=a.nextSibling;return D(n,()=>e.connected?"connected":"disconnected",a),n}})]}function wr(e){let[r,t]=pe(!1),o;st(()=>clearTimeout(o));let n=async()=>{e.card&&(await navigator.clipboard.writeText(e.card),t(!0),clearTimeout(o),o=setTimeout(()=>t(!1),1500))};return A(ke,{get url(){return e.url},title:"not shared with you yet",get children(){return[_a(),xa(),ka(),A(j,{get when(){return e.card},get children(){var i=ct(),a=i.firstChild;return a.$$click=()=>void n(),D(a,()=>r()?"copied":"copy my card"),i}})]}})}function yr(e){let[r,t]=pe(!1),o=async()=>{t(!0);try{await e.onRetry()}finally{t(!1)}};return A(ke,{get url(){return e.url},get title(){return`can't load ${e.name}`},get children(){return[Ca(),(()=>{var n=$a();return D(n,()=>e.error),n})(),(()=>{var n=ct(),i=n.firstChild;return i.$$click=()=>void o(),D(i,()=>r()?"trying\u2026":"try again"),lt(()=>i.disabled=r()),n})()]}})}function _r(e){return A(ke,{get url(){return e.url},title:"this link is broken",get children(){return[Sa(),Ea(),(()=>{var r=Ta(),t=r.firstChild;return D(t,()=>e.url),r})()]}})}na(["click"]);import{isKeyhiveDoc as Pa}from"@inkandswitch/patchwork-plugins";var xr=()=>globalThis.hive;async function kr(e,r){if(Pa(r))try{let t=e.active.individual.id;return!!(e.bestAccessForDoc?await e.bestAccessForDoc(t,r):await e.accessForDoc(t,r))}catch{return}}function Cr(e,r){return e.networkAdapter?.on("ingest-remote",r),()=>e.networkAdapter?.off("ingest-remote",r)}function $r(e){try{let r="";for(let t of e.active.contactCard.toBytes())r+=String.fromCharCode(t);return btoa(r)}catch{return}}var La=He("<div class=document-view>"),Ar=He("<patchwork-view>",!0,!1,!1),Ma=He("<div class=placeholder>Select a document in the sidebar"),Oa=He("<div class=doc-stack>");function Dr({viewKey:e,selectedDocUrl:r,toolId:t,ref:o}){let n,[i,a]=J();return Ha(()=>{a(n.closest("repo-provider")?.repo??null)}),(()=>{var d=La();return Tr(l=>{n=l,o?.(l)},d),V(d,I(W,{get when(){return Ce(()=>i()!==void 0)()&&e()},keyed:!0,children:l=>I(W,{get when(){return i()},get fallback(){return(()=>{var c=Ar();return c._$owner=Er(),Sr(s=>{var u=r(),p=t();return u!==s.e&&(c.docUrl=s.e=u),p!==s.t&&(c.toolId=s.t=p),s},{e:void 0,t:void 0}),c})()},children:c=>I(qa,{get url(){return r()},toolId:t,get repo(){return c()}})})}),null),V(d,(()=>{var l=Ce(()=>!r());return()=>l()&&Ma()})(),null),d})()}function qa(e){let r=Na("patchwork:tool"),[t,o]=J(0);te(r.on("changed",()=>{o(g=>g+1)}));let[n,i]=J({state:"finding"}),[a,d]=J(),l=()=>e.toolId()??a(),[c,s]=J(!1),[u,p]=J(0),b=!1;te(()=>b=!0);async function w(){try{let g=await e.repo.find(e.url);if(b)return;let y=n().state==="unavailable";i({state:"ready",doc:g.doc()}),y&&!c()&&p(E=>E+1)}catch(g){if(b)return;let y=Ja(g);i({state:y?"invalid":"unavailable"}),y||h(E=>E+1)}}let[m,h]=J(0),f,_;function R(){_?.(),f=Ba(e.repo,e.url),_=f?.subscribe(g=>{g.state==="ready"&&n().state==="unavailable"&&w()})}te(()=>_?.()),w(),R();function F(){let g=e.repo;if(typeof g.resyncSubduction=="function")try{g.resyncSubduction(za(e.url).documentId)}catch{}}let N;te(()=>clearTimeout(N));function G(g=1e3){F(),clearTimeout(N),N=setTimeout(()=>void w(),g)}dt(()=>{let g=m();g===0||n().state!=="unavailable"||c()||(G(Math.min(3e4,3e3*2**(g-1))),te(()=>clearTimeout(N)))});let Z=Ne(()=>{t();let g=n();if(g.state!=="ready")return g;let y=g.doc,E=y?ja(y):void 0;if(!E)return{state:"open",toolId:void 0};let T=l(),z;if(!T){let q=Ir(()=>Wa(y));q&&Va(q.supportedDatatypes,E)?z={id:q.id,name:q.name}:q&&(T=q.id)}return T&&r.get(T)?{state:"open",toolId:T}:{state:"no-tool",type:E,suggestion:Ua(y),anything:z}}),M=Ne(()=>Z().state),H=Ne(()=>{let g=Z();return g.state==="open"?g.toolId:void 0}),[he,fe]=J();async function Se(g){try{return await r.load(g),H()===g&&fe(void 0),!0}catch(y){return H()===g&&fe({id:g,message:y instanceof Error?y.message:String(y)}),!1}}dt(()=>{let g=H();fe(void 0),g&&Se(g)});let K=xr(),[S,$]=J();dt(()=>{if(!K||M()!=="open"){$(void 0);return}let g=e.url,y=!0,E=()=>void kr(K,g).then(z=>{y&&$(z)});E();let T=Cr(K,E);te(()=>{y=!1,T()})});async function Y(){let g=he()?.id;g&&await Se(g)&&p(y=>y+1)}let L=Ne(()=>{let g=Z();return g.state==="no-tool"?g:void 0});return(()=>{var g=Oa();return Tr(y=>{let E=T=>{let z=T.detail;z?.url&&z.url!==e.url||(s(!0),n().state==="unavailable"&&w())};y.addEventListener("patchwork:mounted",E),te(()=>y.removeEventListener("patchwork:mounted",E))},g),V(g,I(W,{get when(){return Ce(()=>M()==="open")()&&!he()||M()==="unavailable"},get children(){return I(W,{get when(){return u()+1},keyed:!0,children:y=>(()=>{var E=Ar();return E._$owner=Er(),Sr(T=>{var z=e.url,q=l();return z!==T.e&&(E.docUrl=T.e=z),q!==T.t&&(E.toolId=T.t=q),T},{e:void 0,t:void 0}),E})()})}}),null),V(g,I(W,{get when(){return M()==="finding"},get children(){return I(gr,{})}}),null),V(g,I(W,{get when(){return Ce(()=>M()==="open")()&&S()===!1},get children(){return I(wr,{get url(){return e.url},get card(){return K&&$r(K)}})}}),null),V(g,I(W,{get when(){return he()},children:y=>I(yr,{get url(){return e.url},get name(){return r.get(y().id)?.name??y().id},get error(){return y().message},onRetry:Y})}),null),V(g,I(W,{get when(){return M()==="invalid"},get children(){return I(_r,{get url(){return e.url}})}}),null),V(g,I(W,{get when(){return Ce(()=>M()==="unavailable")()&&!c()},get children(){return I(vr,{get url(){return e.url},get repo(){return e.repo},onRetry:G})}}),null),V(g,I(W,{get when(){return L()},children:y=>I(br,{get url(){return e.url},get type(){return y().type},get suggestion(){return y().suggestion},get anything(){return y().anything},onPeek:d,get repo(){return e.repo}})}),null),g})()}function Ba(e,r){let t=e.findWithProgress;if(typeof t=="function")return Ir(()=>{let o=t.call(e,r);return typeof o?.subscribe=="function"&&typeof o?.peek=="function"?o:void 0})}function Ja(e){let r=e?.message??String(e);return/invalid (automergeurl|document url|documentid|document id)/i.test(r)}function Va(e,r){let t=e==="*"?["*"]:e??[];return t.includes("*")&&!t.includes(r)}function Ir(e){try{return e()}catch{return}}var Ka=ut("<patchwork-view component=patchwork-draft-state-provider>",!0,!1,!1),Ya=ut("<div class=frame__main-column><div class=frame__doc-column><div class=main-area>"),Xa=ut("<patchwork-view component=patchwork-draft-overlay-provider><patchwork-view component=patchwork-comments-provider><patchwork-view component=patchwork-focus-provider>",!0,!1,!1);function Lr(e){let[r,t]=re(e.initialRightCollapsed()),[o,n]=re(e.initialRightWidth());Rr(Pr(r,p=>{try{localStorage.setItem(B.rightCollapsed,String(p))}catch{}},{defer:!0})),Rr(Pr(o,p=>{try{localStorage.setItem(B.rightWidth,String(p))}catch{}},{defer:!0}));let i=Xe("right",{isCollapsed:r,setCollapsed:t,setWidth:n});Za(()=>{let p=()=>t(!0);window.addEventListener(Ee,p),Ga(()=>window.removeEventListener(Ee,p))});let[a,d]=Ye(re(),{name:B.contextToolId}),[l,c]=re(),s=oe("patchwork-draft-state-provider",l),u=()=>s()?l():void 0;return X(Je,{get when(){return e.selectedDocUrl()},keyed:!0,children:p=>(()=>{var b=Ka();return Be(c,b),b.docUrl=p,b._$owner=qe(),$e(b,X(Je,{get when(){return u()},children:w=>X(Qa,{get host(){return w()},get setMainDocElement(){return e.setMainDocElement},get selectedDocUrl(){return e.selectedDocUrl},get selectedToolId(){return e.selectedToolId},get doctitleSlots(){return e.doctitleSlots},get isLeftCollapsed(){return e.isLeftCollapsed},isRightSidebarCollapsed:r,setIsRightSidebarCollapsed:t,rightSidebarWidth:o,get handleMouseDown(){return i.handleMouseDown},get handleToggleClick(){return i.handleToggleClick},selectedContextToolId:a,setSelectedContextToolId:d})})),b})()})}function Qa(e){let r=me("context-tool"),t=()=>r().length>0,o=Fr(()=>e.selectedDocUrl()),[n,i]=re(),a=oe("patchwork-draft-overlay-provider",n),[d,l]=re(),c=oe("patchwork-comments-provider",d),[s,u]=re(),p=oe("patchwork-focus-provider",s),b=Fr(()=>a()&&c()&&p());return(()=>{var w=Xa(),m=w.firstChild,h=m.firstChild;return Be(i,w),w._$owner=qe(),Be(l,m),m._$owner=qe(),Be(u,h),h._$owner=qe(),$e(h,X(Je,{get when(){return b()},get children(){var f=Ya(),_=f.firstChild,R=_.firstChild;return $e(_,X(er,{get docUrl(){return e.selectedDocUrl},get toolSlots(){return e.doctitleSlots},get isLeftCollapsed(){return e.isLeftCollapsed},hasContext:t,get isRightCollapsed(){return e.isRightSidebarCollapsed},onToggleRight:()=>e.setIsRightSidebarCollapsed(F=>!F)}),R),$e(R,X(Dr,{viewKey:o,get selectedDocUrl(){return e.selectedDocUrl},get toolId(){return e.selectedToolId},ref:F=>e.setMainDocElement?.(F)})),$e(f,X(Je,{get when(){return t()},get children(){return X(Kt,{get selectedToolId(){return e.selectedContextToolId},get setSelectedToolId(){return e.setSelectedContextToolId},get isCollapsed(){return e.isRightSidebarCollapsed},get width(){return e.rightSidebarWidth},get onMouseDown(){return e.handleMouseDown},get onToggleClick(){return e.handleToggleClick},onCollapse:()=>e.setIsRightSidebarCollapsed(!0)})}}),null),f}})),w})()}var Ve=`:root,
12
- :host,
13
- [theme] {
14
- --threepane-bg: var(--studio-fill, white);
15
- --threepane-sidebar-fill: var(--studio-chrome, var(--studio-fill, white));
16
- --threepane-fg: var(--studio-line, black);
17
- /* ink for text sitting ON the sidebar/account-bar chrome surface. mirrors the
18
- toolbar/context-sidebar fg: it rides --studio-chrome-line (the chrome's own
19
- ink) so it tracks the chrome palette, not the content page. --threepane-fg
20
- is content ink and only belongs on --threepane-bg surfaces. */
21
- --threepane-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));
22
- --threepane-muted: var(--studio-line-offset-50, #999);
23
- --threepane-family: var(--studio-family-sans, system-ui, sans-serif);
24
- --threepane-family-code: var(--studio-family-code, ui-monospace, monospace);
25
-
26
- /* spacing scale, aliased from the base theme */
27
- --threepane-space-3xs: var(--studio-space-3xs, 0.125rem);
28
- --threepane-space-2xs: var(--studio-space-2xs, 0.25rem);
29
- --threepane-space-xs: var(--studio-space-xs, 0.375rem);
30
- --threepane-space-sm: var(--studio-space-sm, 0.5rem);
31
- --threepane-space: var(--studio-space, 0.75rem);
32
- --threepane-space-md: var(--studio-space-md, 1rem);
33
- --threepane-space-2xl: var(--studio-space-2xl, 3rem);
34
-
35
- /* radius scale, aliased from the base theme */
36
- --threepane-radius-xs: var(--studio-radius-xs, 2px);
37
- --threepane-radius-sm: var(--studio-radius-sm, 4px);
38
- --threepane-radius-md: var(--studio-radius-md, 8px);
39
- --threepane-radius-round: var(--studio-radius-round, 9999px);
40
-
41
- /* Height of the frame's top strip: the top bar over the main column, and the
42
- matching empty space reserved above the left sidebar's widgets so the two
43
- line up and the left toggle has a home. */
44
- --threepane-header-height: calc(
45
- env(safe-area-inset-top, 0px) + var(--threepane-space-2xl)
46
- );
47
-
48
- /* the left footer and right tray boxes share one height so they line up. */
49
- --threepane-tray-height: var(--threepane-space-2xl);
50
- /* sidebar toggles ride a touch paler than the line (first ink offset). they
51
- sit on chrome (left toggle over the sidebar, right over the toolbar), so
52
- they use the chrome ink ramp, not the content one. */
53
- --threepane-toggle-fg: var(--studio-chrome-line-offset-10, var(--studio-line-offset-10, #333));
54
-
55
- --threepane-toolbar: var(--studio-chrome, white);
56
- /* toolbar text rides on the chrome surface, so it uses the chrome ink */
57
- --threepane-toolbar-fg: var(--studio-chrome-line, var(--studio-line, black));
58
- --threepane-toolbar-border: var(--studio-chrome-offset-10, #ddd);
59
- /* Resize handle: a faint 1px divider that tracks the chrome ramp's contrast
60
- (it mixes toward the chrome ink, so it reads darker on light themes and
61
- lighter on dark ones), plus a primary-tinted glow + grab pill on hover. */
62
- --threepane-sidebar-divider: var(--studio-chrome-offset-20, #d4d4d4);
63
- --threepane-resize-glow: color-mix(in oklch, var(--studio-primary-fill, var(--studio-primary, #35f7ca)), transparent 35%);
64
- --threepane-resize-pill: var(--studio-primary-fill, var(--studio-primary, #35f7ca));
65
-
66
- /* The context (right) sidebar sits on a chrome surface stepped one offset off
67
- the toolbar's flat chrome, so the two chrome regions read as distinct. */
68
- --threepane-context-sidebar-fill: var(--studio-chrome-offset-10, #ececec);
69
-
70
- /* Context sidebar (tabbed) */
71
- --context-sidebar-bg: var(--threepane-context-sidebar-fill);
72
- /* the tab-bar header rides on the same flat chrome as the toolbar above it,
73
- so the two chrome strips read as one continuous band */
74
- --context-sidebar-header-bg: var(--studio-chrome, #f2f2f2);
75
- --context-sidebar-fg: var(--studio-chrome-line, var(--studio-line, black));
76
- /* match the lines drawn around the document-view so tab/tray edges read as
77
- one continuous frame */
78
- --context-sidebar-border: var(--threepane-toolbar-border);
79
- --context-sidebar-tab-fg: var(--studio-chrome-line-offset-40, var(--studio-line-offset-40, #666));
80
- --context-sidebar-tab-hover: var(--studio-chrome-offset-10, #e5e5e5);
81
- --context-sidebar-tab-active-bg: var(--studio-fill, white);
82
- --context-sidebar-tab-active-fg: var(--studio-line, black);
83
- --context-sidebar-tab-active-accent: var(--studio-primary-line, var(--studio-primary, #35f7ca));
84
- /* the content panel shares the active tab's surface so the selected tab
85
- connects seamlessly into the tool view below it */
86
- --context-sidebar-content-bg: var(--context-sidebar-tab-active-bg);
87
- --context-sidebar-family: var(--studio-family-sans, system-ui, sans-serif);
88
- }
89
-
90
- .frame-shell {
91
- display: flex;
92
- flex-direction: column;
93
- width: 100%;
94
- height: 100%;
95
- }
96
-
97
- .frame-warning-banner {
98
- flex: none;
99
- padding: var(--threepane-space-2xs) var(--threepane-space-sm);
100
- text-align: center;
101
- text-transform: uppercase;
102
- font-family: var(--studio-family-ui, var(--threepane-family));
103
- font-size: 0.75rem;
104
- background: var(--studio-warning-fill, yellow);
105
- color: var(--studio-warning-line);
106
- }
107
-
108
- .frame {
109
- position: relative;
110
- display: flex;
111
- width: 100%;
112
- flex: 1;
113
- min-height: 0;
114
- font-family: var(--threepane-family);
115
- color: var(--threepane-fg);
116
- background: var(--threepane-bg);
117
- }
118
-
119
- .frame__version {
120
- position: absolute;
121
- top: var(--threepane-space-2xs);
122
- right: var(--threepane-space-sm);
123
- z-index: var(--studio-layer-raised, 10);
124
- color: var(--threepane-muted);
125
- font-size: 0.75rem;
126
- font-weight: 500;
127
- pointer-events: none;
128
- user-select: none;
129
- }
130
-
131
- .sidebar {
132
- position: relative;
133
- display: flex;
134
- flex: none;
135
- /* visible so the resize handle can straddle the boundary (sit on *both*
136
- sides of the divider line); the content clips itself instead. z-index lifts
137
- the handle's outer half above the main area so it stays grabbable. */
138
- overflow: visible;
139
- z-index: 1;
140
- }
141
-
142
- .sidebar[data-collapsed] {
143
- overflow: visible;
144
- }
145
-
146
- .sidebar[data-side="left"] {
147
- background: var(--threepane-sidebar-fill);
148
- color: var(--threepane-sidebar-fg);
149
- }
150
-
151
- .sidebar[data-side="right"] {
152
- background: var(--threepane-context-sidebar-fill);
153
- }
154
-
155
- .main-area {
156
- flex: 1;
157
- min-width: 0;
158
- display: flex;
159
- flex-direction: column;
160
- height: 100%;
161
- overflow: hidden;
162
- }
163
-
164
- /* The main column (right of the left sidebar): a row of
165
- [document column | right sidebar], so the right sidebar spans the full frame
166
- height and its resize divider runs top-to-bottom exactly like the left one. */
167
- .frame__main-column {
168
- position: relative;
169
- flex: 1;
170
- min-width: 0;
171
- display: flex;
172
- flex-direction: row;
173
- height: 100%;
174
- overflow: hidden;
175
- }
176
-
177
- /* The document column: the top bar over the main document view. Sits left of the
178
- full-height context sidebar. */
179
- .frame__doc-column {
180
- flex: 1;
181
- min-width: 0;
182
- width: 100%;
183
- display: flex;
184
- flex-direction: column;
185
- height: 100%;
186
- overflow: hidden;
187
- }
188
-
189
- .frame__doc-column > patchwork-view,
190
- .frame__doc-column > patchwork-view > patchwork-view,
191
- .frame__doc-column > patchwork-view > patchwork-view > patchwork-view,
192
- .frame__doc-column
193
- > patchwork-view
194
- > patchwork-view
195
- > patchwork-view
196
- > patchwork-view {
197
- display: contents;
198
- }
199
-
200
- /* The full-width top toolbar. Its height + top safe-area inset match the
201
- sideboard's reserved top margin so the bar reads as continuous across the top
202
- (the left sidebar's empty top region lines up with it). */
203
- .frame__topbar {
204
- display: flex;
205
- align-items: stretch;
206
- box-sizing: border-box;
207
- min-height: var(--threepane-space-2xl);
208
- padding-top: env(safe-area-inset-top, 0px);
209
- padding-inline: var(--threepane-space-2xs);
210
- gap: var(--threepane-space-2xs);
211
- background: var(--threepane-toolbar);
212
- color: var(--threepane-toolbar-fg);
213
- /* A hairline along the bottom, in the same colour as the document-view's
214
- border, so the line under the bar runs unbroken across the whole width
215
- (document column + context tabs). The active tab pulls down 1px to break
216
- through it and connect to its panel below. */
217
- border-bottom: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-toolbar-border);
218
- /* Animate the collapsed left-slot in step with the sidebar's width transition
219
- so the title glides up against the pinned toggle instead of jumping. */
220
- transition: padding-left var(--studio-transition-slow, 0.25s ease);
221
- }
222
-
223
- /* When the left sidebar is collapsed the bar's left edge reaches the frame edge,
224
- where the pinned left toggle lives; reserve a matching slot so the title slides
225
- up against the toggle rather than under it. */
226
- .frame__topbar--left-collapsed {
227
- padding-left: var(--threepane-space-2xl);
228
- }
229
-
230
- /* The left sidebar toggle, pinned to the frame's top-left corner so it keeps the
231
- same spot whether the sidebar is open or closed. Square, filling the top strip;
232
- sits over the sidebar's reserved (empty) top area when open. */
233
- .frame__left-toggle {
234
- position: absolute;
235
- top: 0;
236
- left: 0;
237
- z-index: 5;
238
- width: var(--threepane-space-2xl);
239
- height: var(--threepane-header-height);
240
- padding-top: env(safe-area-inset-top, 0px);
241
- }
242
-
243
- /* A sidebar toggle at either end of the top bar (always present). */
244
- .frame__sidebar-toggle {
245
- display: flex;
246
- align-items: center;
247
- justify-content: center;
248
- flex-shrink: 0;
249
- padding-inline: var(--threepane-space-sm);
250
- border: none;
251
- background: transparent;
252
- color: var(--threepane-toggle-fg);
253
- cursor: var(--studio-cursor-pointer, pointer);
254
- transition: color var(--studio-transition-fast, 0.1s ease);
255
- }
256
-
257
- .frame__sidebar-toggle:hover {
258
- color: var(--threepane-sidebar-fg);
259
- }
260
-
261
- /* The document title, rendered intrinsically: shrinks to the title's width but
262
- never past half the bar; ellipsis beyond. */
263
- .threepane__title {
264
- display: flex;
265
- align-items: center;
266
- flex: 0 1 auto;
267
- min-width: 0;
268
- max-width: 50%;
269
- overflow: hidden;
270
- padding-inline: var(--threepane-space-sm);
271
- }
272
-
273
- .threepane__title-text {
274
- font-weight: 600;
275
- white-space: nowrap;
276
- min-width: 0;
277
- overflow: hidden;
278
- text-overflow: ellipsis;
279
- }
280
-
281
- .threepane__title-text--editable {
282
- cursor: var(--studio-cursor-text, text);
283
- }
284
-
285
- .threepane__title-text--editable:hover {
286
- opacity: 0.7;
287
- }
288
-
289
- .threepane__title-input {
290
- font: inherit;
291
- font-weight: 600;
292
- color: inherit;
293
- min-width: 0;
294
- width: 100%;
295
- padding: 0;
296
- margin: 0;
297
- border: none;
298
- outline: none;
299
- background: transparent;
300
- }
301
-
302
- /* built-in spacer between the title and the right-hand tools */
303
- .threepane__spacer {
304
- flex: 1;
305
- min-width: var(--threepane-space-sm);
306
- }
307
-
308
- /* configured doctitle tools at the right end; scroll horizontally when they
309
- overflow rather than squashing. */
310
- .threepane__doctitle-tools {
311
- display: flex;
312
- align-items: center;
313
- gap: var(--threepane-space-sm);
314
- min-width: 0;
315
- padding-inline: var(--threepane-space-sm);
316
- overflow-x: auto;
317
- overflow-y: hidden;
318
- scrollbar-width: none;
319
- }
320
-
321
- .threepane__doctitle-tools::-webkit-scrollbar {
322
- display: none;
323
- }
324
-
325
- .threepane__doctitle-tools patchwork-view {
326
- display: flex;
327
- align-items: center;
328
- height: 2rem;
329
- flex-shrink: 0;
330
- width: auto;
331
- }
332
-
333
- .document-view {
334
- flex: 1;
335
- min-height: 0;
336
- overflow: hidden;
337
- /* Left divider only, square corners. The top line is the top bar's
338
- border-bottom and the bottom is open to the frame edge. The right divider
339
- (to the context sidebar) is the sidebar's own full-height border-left, so
340
- it runs the whole frame height rather than just the document view. When the
341
- left sidebar is collapsed the left divider is dropped (see the :has rule
342
- below) so nothing rides the frame edge. */
343
- border-left: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-toolbar-border);
344
- }
345
-
346
- /* Left sidebar collapsed to 0: drop the document-view's left divider so there's
347
- no stray line hugging the frame's left edge. */
348
- .frame:has(.sidebar[data-side="left"][data-collapsed]) .document-view {
349
- border-left: none;
350
- }
351
-
352
- .document-view patchwork-view {
353
- display: block;
354
- width: 100%;
355
- height: 100%;
356
- }
357
-
358
- .placeholder {
359
- display: flex;
360
- align-items: center;
361
- justify-content: center;
362
- height: 100%;
363
- color: var(--threepane-fg);
364
- }
365
-
366
- /* the main doc, and what's said in its place when it can't be shown. the
367
- cards lie over the patchwork-view (which may still be recovering) */
368
- .doc-stack {
369
- position: relative;
370
- width: 100%;
371
- height: 100%;
372
- }
373
-
374
- /* a card in place of a doc: the sheet lattice and knit draw, in the theme's
375
- colours, with its serif drawn a little by hand (but holding still) */
376
- .doc-card {
377
- --doc-card-ink: var(--studio-line, #1c1a17);
378
- --doc-card-muted: var(--studio-line-offset-50, color-mix(in oklab, var(--doc-card-ink) 55%, transparent));
379
- --doc-card-line: var(--studio-chrome-line, var(--doc-card-ink));
380
- --doc-card-sheet: var(--editor-fill, var(--text-editor-fill, var(--studio-fill, #fffdf5)));
381
- --doc-card-highlighter: var(--studio-selection-fill, #ffee8888);
382
- --doc-card-accent: var(--studio-primary-fill, var(--studio-primary, #ff2284));
383
- --doc-card-accent-ink: var(--studio-primary-line, #fff);
384
- --doc-card-danger: var(--studio-danger-text, var(--studio-danger, #d33a4c));
385
- --doc-card-good: var(--studio-added, #40dcba);
386
- --doc-card-radius: var(--studio-radius-sm, 3px);
387
- --doc-card-serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
388
- --doc-card-mono: var(--studio-family-code, Monaco, ui-monospace, monospace);
389
-
390
- position: absolute;
391
- inset: 0;
392
- z-index: 1;
393
- display: grid;
394
- box-sizing: border-box;
395
- place-items: center;
396
- overflow: auto;
397
- padding: 16px;
398
- background: var(--threepane-bg);
399
- color: var(--doc-card-ink);
400
- font-family: var(--studio-family-ui, var(--threepane-family));
401
- /* a doc that's only slow shouldn't flash a card on its way in */
402
- animation: doc-card-in var(--studio-duration-slow, 0.3s) ease 0.4s both;
403
- }
404
-
405
- @keyframes doc-card-in {
406
- from { opacity: 0; }
407
- }
408
-
409
- @media (prefers-reduced-motion: reduce) {
410
- .doc-card {
411
- animation-duration: 0.01s;
412
- }
413
- }
414
-
415
- .doc-card__defs {
416
- position: absolute;
417
- width: 0;
418
- height: 0;
419
- }
420
-
421
- .doc-card__sheet {
422
- box-sizing: border-box;
423
- max-width: 440px;
424
- padding: 24px 28px 20px;
425
- border: 1px solid var(--doc-card-line);
426
- border-radius: 0.5em;
427
- background: var(--doc-card-sheet);
428
- box-shadow: 0 0 10px 2px #66003322;
429
- text-align: center;
430
-
431
- & p {
432
- margin: 0 0 12px;
433
- color: var(--doc-card-muted);
434
- }
435
- }
436
-
437
- .doc-card__rough {
438
- margin: 0 0 6px;
439
- font: 400 28px/1.1 var(--doc-card-serif);
440
- filter: url(#doc-card-rough);
441
- }
442
-
443
- .doc-card__code {
444
- padding: 1px 5px;
445
- border-radius: var(--doc-card-radius);
446
- background: var(--doc-card-highlighter);
447
- color: var(--doc-card-ink);
448
- font: 11px var(--doc-card-mono);
449
- }
450
-
451
- .doc-card__url {
452
- display: inline-block;
453
- max-width: 100%;
454
- margin-top: 4px;
455
- overflow-wrap: anywhere;
456
- }
457
-
458
- .doc-card__reasons {
459
- margin: 0 0 12px;
460
- padding: 0 0 0 1.2em;
461
- color: var(--doc-card-muted);
462
- text-align: left;
463
-
464
- & li + li {
465
- margin-top: 4px;
466
- }
467
- }
468
-
469
- /* how the sync server looks from here */
470
- /* "sync server", in the colour of the connection as it stands. a button, so
471
- a tap can say which on a phone, where a title never shows */
472
- .doc-card__sync {
473
- padding: 0;
474
- border: none;
475
- background: none;
476
- color: var(--doc-card-danger);
477
- font: inherit;
478
- text-decoration: underline dotted;
479
- text-underline-offset: 3px;
480
- cursor: help;
481
-
482
- &[data-connected] {
483
- color: var(--doc-card-good);
484
- }
485
- }
486
-
487
- .doc-card__sync-told {
488
- color: var(--doc-card-ink);
489
- }
490
-
491
- .doc-card__actions {
492
- display: flex;
493
- justify-content: center;
494
- gap: 8px;
495
- margin: 0 0 12px;
496
- }
497
-
498
- .doc-card__button {
499
- padding: 2px 10px;
500
- border: 1px solid var(--doc-card-line);
501
- border-radius: 2px;
502
- background: var(--doc-card-sheet);
503
- box-shadow: 1px 1px 0 var(--doc-card-line);
504
- color: inherit;
505
- font: inherit;
506
- cursor: pointer;
507
-
508
- &:hover:not(:disabled) {
509
- translate: -1px -1px;
510
- box-shadow: 2px 2px 0 var(--doc-card-line);
511
- }
512
-
513
- &:active:not(:disabled) {
514
- translate: 1px 1px;
515
- box-shadow: none;
516
- }
517
-
518
- &:disabled {
519
- cursor: progress;
520
- opacity: 0.7;
521
- }
522
- }
523
-
524
- .doc-card__button--primary {
525
- min-width: 5em;
526
- background: var(--doc-card-accent);
527
- color: var(--doc-card-accent-ink);
528
- font-weight: 600;
529
- }
530
-
531
- .doc-card__link {
532
- padding: 0;
533
- border: none;
534
- background: none;
535
- color: inherit;
536
- font: inherit;
537
- text-decoration: underline;
538
- text-underline-offset: 2px;
539
- cursor: pointer;
540
- }
541
-
542
- .doc-card__aside {
543
- font-size: 0.9em;
544
-
545
- &:last-child {
546
- margin-bottom: 0;
547
- }
548
- }
549
-
550
- .doc-card__notice {
551
- color: var(--doc-card-danger) !important;
552
- }
553
-
554
- /* a suggested package, as its package.json names it */
555
- .pkg-line {
556
- color: var(--doc-card-ink);
557
- }
558
-
559
- .pkg-line__version {
560
- color: var(--doc-card-muted);
561
- }
562
-
563
- /* the card's quieter ways on, one to a line */
564
- .doc-card__links {
565
- display: flex;
566
- flex-direction: column;
567
- align-items: center;
568
- gap: 4px;
569
- font-size: 0.9em;
570
-
571
- &:last-child {
572
- margin-bottom: 0;
573
- }
574
- }
575
-
576
- /* everything known about a suggested package. a popover, so it sits in the
577
- top layer, but still inherits the card's colours */
578
- .pkg-about[popover] {
579
- box-sizing: border-box;
580
- width: min(440px, calc(100vw - 32px));
581
- max-height: calc(100vh - 64px);
582
- margin: auto;
583
- overflow: auto;
584
- padding: 18px 22px 16px;
585
- border: 1px solid var(--doc-card-line);
586
- border-radius: 0.5em;
587
- background: var(--doc-card-sheet);
588
- box-shadow: 0 0 10px 2px #66003322, 3px 3px 0 var(--doc-card-line);
589
- color: var(--doc-card-ink);
590
- font: 13px/1.45 var(--studio-family-ui, var(--threepane-family));
591
- text-align: left;
592
-
593
- &::backdrop {
594
- background: color-mix(in oklab, var(--doc-card-ink) 12%, transparent);
595
- }
596
-
597
- & h3 {
598
- margin: 0;
599
- font-size: 22px;
600
- }
601
-
602
- & h4 {
603
- margin: 0 0 6px;
604
- font-size: 11px;
605
- font-weight: 600;
606
- letter-spacing: 0.08em;
607
- text-transform: uppercase;
608
- color: var(--doc-card-muted);
609
- }
610
- }
611
-
612
- .pkg-about__header {
613
- display: flex;
614
- align-items: baseline;
615
- justify-content: space-between;
616
- margin-bottom: 12px;
617
- }
618
-
619
- .pkg-about__close {
620
- font-size: 20px;
621
- line-height: 1;
622
- text-decoration: none;
623
- }
624
-
625
- .pkg-about__section {
626
- margin: 0 0 14px;
627
- padding: 10px 12px;
628
- border: 1px solid var(--doc-card-line);
629
- border-radius: var(--doc-card-radius);
630
-
631
- &:last-child {
632
- margin-bottom: 0;
633
- }
634
- }
635
-
636
- /* the package's own word gets a dashed edge and the highlighter: it's quoted,
637
- not vouched for */
638
- .pkg-about__section--claims {
639
- border-style: dashed;
640
- background: color-mix(in oklab, var(--doc-card-highlighter) 35%, transparent);
641
- }
642
-
643
- .pkg-about__version {
644
- color: var(--doc-card-muted);
645
- font-size: 0.7em;
646
- }
647
-
648
- /* the claims are the package's own: say so where they're headed */
649
- .pkg-about__tag {
650
- margin-left: 4px;
651
- padding: 0 5px;
652
- border: 1px dashed currentColor;
653
- border-radius: var(--doc-card-radius);
654
- font-weight: 400;
655
- letter-spacing: 0.04em;
656
- }
657
-
658
- .pkg-about__quiet {
659
- color: var(--doc-card-muted);
660
- }
661
-
662
- .pkg-about__facts {
663
- display: grid;
664
- grid-template-columns: max-content 1fr;
665
- gap: 4px 12px;
666
- margin: 0 0 8px;
667
-
668
- & dt {
669
- color: var(--doc-card-muted);
670
- }
671
-
672
- & dd {
673
- min-width: 0;
674
- margin: 0;
675
- overflow-wrap: anywhere;
676
- }
677
- }
678
-
679
- .pkg-about__list {
680
- margin: 4px 0;
681
- padding: 0 0 0 1.1em;
682
- }
683
-
684
- .pkg-about__heads {
685
- display: inline-flex;
686
- flex-wrap: wrap;
687
- gap: 4px;
688
- }
689
-
690
- .pkg-about__ask {
691
- & .doc-card__notice {
692
- margin: 6px 0 0;
693
- }
694
- }
695
-
696
- /* still finding it: a quiet dot, once it's been a moment */
697
- .doc-card--finding {
698
- display: flex;
699
- justify-content: center;
700
- gap: 8px;
701
- color: var(--doc-card-muted);
702
- font-size: 0.9em;
703
- animation-delay: 1.5s;
704
- }
705
-
706
- .doc-card__dot {
707
- width: 8px;
708
- height: 8px;
709
- border-radius: 50%;
710
- background: currentColor;
711
- animation: doc-card-pulse 2s ease-in-out infinite;
712
- }
713
-
714
- @keyframes doc-card-pulse {
715
- 0%, 100% { opacity: 0.25; transform: scale(0.6); }
716
- 50% { opacity: 1; transform: scale(1); }
717
- }
718
-
719
- @media (prefers-reduced-motion: reduce) {
720
- .doc-card__dot {
721
- animation: none;
722
- }
723
- }
724
-
725
- .sidebar patchwork-view {
726
- display: block;
727
- width: 100%;
728
- height: 100%;
729
- /* the sidebar itself doesn't clip, so the content does */
730
- overflow: hidden;
731
- }
732
-
733
- /* Context sidebar (tabbed): lifted tabs with a top accent bar and surface fill
734
- on the active tab, a hover surface, and a bottom-border separator between the
735
- tab bar and the mounted tool view. */
736
- .context-sidebar {
737
- flex: 1;
738
- min-width: 0;
739
- width: 100%;
740
- height: 100%;
741
- display: flex;
742
- flex-direction: column;
743
- overflow: hidden;
744
- font-family: var(--context-sidebar-family);
745
- color: var(--context-sidebar-fg);
746
- background: var(--context-sidebar-bg);
747
- /* The full-height divider between the document column and the sidebar. Lives
748
- here (not on the document view) so it runs the whole frame height \u2014 top bar
749
- level included \u2014 and the resize handle straddling this edge is grabbable end
750
- to end, matching the left sidebar. */
751
- border-left: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--context-sidebar-border);
752
- }
753
-
754
- /* Tab bar: the row holding the tab list and the collapse button. Its height +
755
- top safe-area inset match the document column's top bar so the two header
756
- strips line up and their bottom hairlines read as one continuous line across
757
- the divider. */
758
- .context-sidebar__tabs {
759
- display: flex;
760
- align-items: flex-end;
761
- box-sizing: border-box;
762
- min-height: var(--threepane-space-2xl);
763
- padding-top: env(safe-area-inset-top, 0px);
764
- background: var(--context-sidebar-header-bg);
765
- border-bottom: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--context-sidebar-border);
766
- }
767
-
768
- .context-sidebar__tablist {
769
- display: flex;
770
- flex: 1;
771
- min-width: 0;
772
- align-items: flex-end;
773
- gap: var(--threepane-space-2xs);
774
- padding-inline: var(--threepane-space-2xs);
775
- /* when there are more tabs than fit, scroll them horizontally rather than
776
- letting them shrink/wrap; scrollbar hidden for a clean header. */
777
- overflow-x: auto;
778
- overflow-y: hidden;
779
- scrollbar-width: none;
780
- /* extend the clip box 1px past the tab-bar border (compensated by the
781
- negative margin so layout is unchanged) so the active tab's -1px overflow
782
- isn't clipped by the horizontal scroll container, and it can still cover
783
- the border-bottom to connect into the panel. */
784
- padding-bottom: 1px;
785
- margin-bottom: -1px;
786
- }
787
- .context-sidebar__tablist::-webkit-scrollbar {
788
- display: none;
789
- }
790
-
791
- /* A single tab. */
792
- .context-sidebar__tab {
793
- display: flex;
794
- align-items: center;
795
- flex-shrink: 0;
796
- padding: var(--threepane-space-xs) var(--threepane-space-sm);
797
- border: var(--studio-border-width, 1px) var(--studio-border-style, solid) transparent;
798
- border-bottom: none;
799
- border-top-left-radius: var(--threepane-radius-xs);
800
- border-top-right-radius: var(--threepane-radius-xs);
801
- background: transparent;
802
- font-family: inherit;
803
- font-size: 0.875rem;
804
- white-space: nowrap;
805
- color: var(--context-sidebar-tab-fg);
806
- cursor: var(--studio-cursor-pointer, pointer);
807
- user-select: none;
808
- transition: background var(--studio-transition-fast, 0.1s ease),
809
- color var(--studio-transition-fast, 0.1s ease);
810
- }
811
-
812
- .context-sidebar__tab:hover {
813
- background: var(--studio-chrome-hover-fill, var(--context-sidebar-tab-hover));
814
- color: var(--context-sidebar-tab-active-fg);
815
- }
816
-
817
- /* Exception: the selected tab. Pulled down 1px so its fill covers the tab-bar's
818
- bottom border, connecting the tab seamlessly into the panel below. */
819
- .context-sidebar__tab[data-active] {
820
- position: relative;
821
- margin-bottom: -1px;
822
- background: var(--context-sidebar-tab-active-bg);
823
- color: var(--context-sidebar-tab-active-fg);
824
- border-color: var(--context-sidebar-border);
825
- box-shadow: inset 0 1px 0 0 var(--context-sidebar-tab-active-accent);
826
- }
827
-
828
- /* The close (collapse) button. Centred vertically in the tab header (the header
829
- is otherwise flex-end for the tabs) so it lands at the same height as the
830
- reopen toggle in the top bar when the sidebar is collapsed. */
831
- .context-sidebar__close {
832
- display: flex;
833
- align-items: center;
834
- justify-content: center;
835
- align-self: center;
836
- flex-shrink: 0;
837
- padding-inline: var(--threepane-space-sm);
838
- margin-right: var(--threepane-space-2xs);
839
- border: none;
840
- background: transparent;
841
- color: var(--context-sidebar-fg);
842
- cursor: var(--studio-cursor-pointer, pointer);
843
- opacity: 0.5;
844
- transition: opacity var(--studio-transition-fast, 0.1s ease);
845
- }
846
-
847
- .context-sidebar__close:hover {
848
- opacity: 1;
849
- }
850
-
851
- /* The mounted tool view. */
852
- .context-sidebar__content {
853
- flex: 1;
854
- min-height: 0;
855
- overflow: auto;
856
- background: var(--context-sidebar-content-bg);
857
- contain: content;
858
- }
859
-
860
- .context-sidebar__content patchwork-view {
861
- display: block;
862
- width: 100%;
863
- height: 100%;
864
- }
865
-
866
- /* Left sidebar body: a stack of widgets with the account footer pinned below. */
867
- .threepane-sidebar {
868
- display: flex;
869
- flex-direction: column;
870
- width: 100%;
871
- height: 100%;
872
- min-height: 0;
873
- }
874
-
875
- /* Reserve the docked tray's height at the sidebar's bottom so the account bar
876
- sits above the tray (which is pinned outside this collapsing column). */
877
- .threepane-sidebar--has-tray {
878
- padding-bottom: calc(
879
- var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)
880
- );
881
- }
882
-
883
- /* account / packages / settings footer, pinned to the sidebar bottom */
884
- .threepane-sidebar--has-tray .threepane-sidebar__footer {
885
- flex: none;
886
- margin-bottom: calc(var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px));
887
- }
888
-
889
- /* The inlined account bar: avatar (account picker) + Packages + Settings. */
890
- .threepane-account-bar {
891
- container-type: inline-size;
892
- display: flex;
893
- align-items: center;
894
- gap: var(--threepane-space-md);
895
- min-height: var(--threepane-space-2xl);
896
- box-sizing: border-box;
897
- background: var(--threepane-sidebar-fill);
898
- color: var(--threepane-sidebar-fg);
899
- border-top: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-sidebar-divider);
900
- padding-block: var(--threepane-space-2xs);
901
- padding-bottom: calc(var(--threepane-space-2xs) + env(safe-area-inset-bottom));
902
- padding-left: calc(env(safe-area-inset-left) + var(--threepane-space-md));
903
- padding-right: calc(env(safe-area-inset-right) + var(--threepane-space-md));
904
- justify-content: space-between;
905
- overflow: hidden;
906
- }
907
-
908
- .threepane-account-bar__button {
909
- display: flex;
910
- align-items: center;
911
- border: var(--studio-border-width, 1px) var(--studio-border-style, solid) transparent;
912
- padding-inline: var(--threepane-space-2xs);
913
- padding-block: var(--threepane-space-3xs);
914
- border-radius: var(--threepane-radius-xs);
915
- background: transparent;
916
- color: inherit;
917
- font: inherit;
918
- white-space: nowrap;
919
- cursor: var(--studio-cursor-pointer, pointer);
920
- }
921
-
922
- .threepane-account-bar__button:hover {
923
- border-color: var(--threepane-sidebar-divider);
924
- }
925
-
926
- .threepane-account-bar__avatar {
927
- padding: 0;
928
- }
929
-
930
- .threepane-account-bar__avatar patchwork-view {
931
- display: block;
932
- width: 100%;
933
- height: 100%;
934
- }
935
-
936
- /* Left sidebar: a stack of configured widgets. The widgets start below the
937
- frame's top strip (the empty space matching the top bar), so the frame owns
938
- that spacing rather than each widget reserving its own top margin. */
939
- .threepane-widgets {
940
- flex: 1;
941
- display: flex;
942
- flex-direction: column;
943
- width: 100%;
944
- min-height: 0;
945
- padding-top: var(--threepane-header-height);
946
- gap: 1rem;
947
- }
948
-
949
- .threepane-widget {
950
- position: relative;
951
- flex: 1;
952
- min-height: 0;
953
- overflow: hidden;
954
- }
955
-
956
- .threepane-widget patchwork-view {
957
- display: block;
958
- width: 100%;
959
- height: 100%;
960
- }
961
-
962
- /* empty state: offer to add the document list */
963
- .threepane-widgets__empty {
964
- flex: 1;
965
- display: flex;
966
- align-items: flex-start;
967
- justify-content: center;
968
- }
969
-
970
- .threepane-widgets__add {
971
- padding: var(--threepane-space-xs) var(--threepane-space-sm);
972
- border: var(--studio-border-width, 1px) dashed var(--threepane-sidebar-divider);
973
- border-radius: var(--threepane-radius-sm);
974
- background: transparent;
975
- color: var(--threepane-muted);
976
- font: inherit;
977
- cursor: var(--studio-cursor-pointer, pointer);
978
- white-space: nowrap;
979
- }
980
-
981
- .threepane-widgets__add:hover:not(:disabled) {
982
- color: var(--threepane-sidebar-fg);
983
- border-color: var(--threepane-sidebar-fg);
984
- }
985
-
986
- .threepane-widgets__add:disabled {
987
- opacity: var(--studio-disabled-opacity, 0.5);
988
- cursor: var(--studio-cursor-default, default);
989
- }
990
-
991
- /* System tray dock: pinned to the frame's bottom-left. Lives outside the
992
- collapsing left sidebar so it isn't torn down when the sidebar closes. When
993
- the sidebar is open the dock spans its width (set inline) and fills the space
994
- reserved by \`threepane-sidebar--has-tray\`; when the sidebar closes the dock is
995
- hidden (\`display: none\`) but stays mounted, so the tray is invisible while its
996
- tools keep running. */
997
- .frame__tray-dock {
998
- position: absolute;
999
- left: 0;
1000
- bottom: 0;
1001
- z-index: 4;
1002
- box-sizing: border-box;
1003
- /* Fade the tray in only *after* the sidebar's width animation completes, so it
1004
- doesn't flash at full size over the still-expanding sidebar. The delay equals
1005
- the sidebar's transition duration; collapsing overrides this to hide at once. */
1006
- opacity: 1;
1007
- transition: opacity var(--studio-transition-fast, 0.1s ease) 0.25s;
1008
- }
1009
-
1010
- .frame__tray-dock--collapsed {
1011
- opacity: 0;
1012
- pointer-events: none;
1013
- /* Hide immediately on collapse \u2014 no wait, no fade. */
1014
- transition: opacity 0s;
1015
- }
1016
-
1017
- /* A row of tray-tagged tools, filling the dock. */
1018
- .frame-tray {
1019
- display: flex;
1020
- align-items: center;
1021
- gap: var(--threepane-space-2xs);
1022
- box-sizing: border-box;
1023
- /* min-height includes the safe-area inset (border-box), and the matching
1024
- padding-bottom lifts the tray's contents clear of it while the tray's own
1025
- background fills the inset down to the very bottom edge. */
1026
- min-height: calc(
1027
- var(--threepane-tray-height) + env(safe-area-inset-bottom, 0px)
1028
- );
1029
- padding-inline: var(--threepane-space-sm);
1030
- padding-bottom: env(safe-area-inset-bottom, 0px);
1031
- border-top: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-sidebar-divider);
1032
- background: var(--threepane-sidebar-fill);
1033
- }
1034
-
1035
- .frame-tray__item {
1036
- display: flex;
1037
- align-items: center;
1038
- }
1039
-
1040
- .frame-tray patchwork-view {
1041
- display: flex;
1042
- width: auto;
1043
- height: auto;
1044
- }
1045
-
1046
- /* Isolation-mode chrome popover.
1047
- In isolation the main document area is a sandboxed iframe, so host-realm tools
1048
- opened from the account bar (account picker / Packages / Settings) are floated
1049
- over the frame here instead of being routed into the iframe. The backdrop is a
1050
- lowish-opacity, theme-tinted ink wash (dims the frame + picks up the theme's
1051
- ink hue); the panel carries a soft drop shadow so it reads as lifted. Absolute
1052
- inset:0 resolves to the \`.frame\` (its nearest positioned ancestor). */
1053
- .frame__popover-backdrop {
1054
- position: absolute;
1055
- inset: 0;
1056
- z-index: var(--studio-layer-modal, 1000);
1057
- display: flex;
1058
- align-items: center;
1059
- justify-content: center;
1060
- padding: var(--threepane-space-2xl);
1061
- background: var(--studio-backdrop, color-mix(in oklch, var(--threepane-fg), transparent 82%));
1062
- animation: frame-popover-fade var(--studio-transition, 0.15s ease);
1063
- }
1064
-
1065
- .frame__popover {
1066
- display: flex;
1067
- flex-direction: column;
1068
- width: min(1100px, 100%);
1069
- height: min(900px, 100%);
1070
- overflow: hidden;
1071
- background: var(--threepane-bg);
1072
- color: var(--threepane-fg);
1073
- border: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-toolbar-border);
1074
- border-radius: var(--threepane-radius-md);
1075
- box-shadow:
1076
- 0 32px 80px color-mix(in oklch, var(--threepane-fg), transparent 45%),
1077
- 0 12px 32px color-mix(in oklch, var(--threepane-fg), transparent 60%),
1078
- 0 2px 8px color-mix(in oklch, var(--threepane-fg), transparent 70%);
1079
- animation: frame-popover-pop var(--studio-transition, 0.15s ease);
1080
- }
1081
-
1082
- /* The "Open with" picker, docked to the popover's top. Sits at its natural
1083
- height above the tool body; the doc-openwith tool renders a small titlebar
1084
- button, so this is left-aligned chrome rather than a full-height view. */
1085
- .frame__popover-toolbar {
1086
- display: flex;
1087
- align-items: center;
1088
- flex: 0 0 auto;
1089
- gap: var(--threepane-space-sm);
1090
- padding: var(--threepane-space-sm) var(--threepane-space-md);
1091
- border-bottom: var(--studio-border-width, 1px) var(--studio-border-style, solid) var(--threepane-toolbar-border);
1092
- }
1093
-
1094
- .frame__popover-toolbar patchwork-view {
1095
- display: block;
1096
- }
1097
-
1098
- .frame__popover-body {
1099
- flex: 1 1 auto;
1100
- min-height: 0;
1101
- overflow: auto;
1102
- }
1103
-
1104
- .frame__popover-body patchwork-view {
1105
- display: block;
1106
- width: 100%;
1107
- height: 100%;
1108
- overflow: auto;
1109
- }
1110
-
1111
- @keyframes frame-popover-fade {
1112
- from {
1113
- opacity: 0;
1114
- }
1115
- to {
1116
- opacity: 1;
1117
- }
1118
- }
1119
-
1120
- @keyframes frame-popover-pop {
1121
- from {
1122
- opacity: 0;
1123
- transform: translateY(8px) scale(0.98);
1124
- }
1125
- to {
1126
- opacity: 1;
1127
- transform: none;
1128
- }
1129
- }
1130
-
1131
- .frame {
1132
- .sidebar-toggle {
1133
- position: relative;
1134
- align-self: stretch;
1135
- height: 100%;
1136
- padding: 0;
1137
- /* 1px wide, overlapping the divider border while reserving no layout column
1138
- (content stays flush against the view's border - no offset-bg seam). The
1139
- divider border is painted inside the following column, so a centered 2px
1140
- strip reads half a pixel left of the line. */
1141
- width: 1px;
1142
- margin-inline: 0 -1px;
1143
- margin-block: 0;
1144
- border: 0;
1145
- z-index: 1;
1146
- cursor: var(--studio-cursor-pointer, pointer);
1147
- /* transparent at rest - the visible divider is the main view's border; the
1148
- handle lights up (full-height glow + pill) on hover to signal resize. */
1149
- background: transparent;
1150
- transition: background-color var(--studio-transition, 0.15s ease);
1151
- /* invisible hit target straddling the divider. The toggle sits on opposite
1152
- edges of the two sidebars (right edge of the left pane, left edge of the
1153
- right pane). The grab area reaches 6px past the line on both sides, so it
1154
- works the same on either edge without per-side rules. */
1155
- &::before {
1156
- content: "";
1157
- position: absolute;
1158
- inset-block: 0;
1159
- inset-inline: -6px;
1160
- }
1161
- &::after {
1162
- content: "";
1163
- position: absolute;
1164
- top: 50%;
1165
- left: 50%;
1166
- width: 5px;
1167
- height: 44px;
1168
- border-radius: var(--threepane-radius-round);
1169
- background: var(--threepane-resize-pill);
1170
- opacity: 0;
1171
- transform: translate(-50%, -50%) scaleY(0.55);
1172
- transition: opacity var(--studio-transition, 0.15s ease),
1173
- transform var(--studio-transition, 0.15s ease);
1174
- pointer-events: none;
1175
- }
1176
- /* on hover the divider line lights up in the frame primary */
1177
- &:hover,
1178
- &:active {
1179
- background: var(--threepane-resize-glow);
1180
- }
1181
- &:hover::after,
1182
- &:active::after {
1183
- opacity: 1;
1184
- transform: translate(-50%, -50%) scaleY(1);
1185
- }
1186
- }
1187
-
1188
- .sidebar-toggle--resizable {
1189
- cursor: var(--studio-cursor-resize-col, col-resize);
1190
- &:hover {
1191
- cursor: var(--studio-cursor-resize-col, col-resize);
1192
- }
1193
- &:active {
1194
- cursor: var(--studio-cursor-resize-col, col-resize);
1195
- }
1196
- }
1197
-
1198
- }
1199
-
1200
- /* Animate sidebar width on collapse/expand, but never while the handle is being
1201
- actively dragged - the width must track the pointer 1:1 with no easing lag.
1202
- The body flag is set for the duration of a drag by \`useSidebarResize\`. */
1203
- .sidebar {
1204
- transition: width var(--studio-transition-slow, 0.25s ease);
1205
- }
1206
- body[data-sidebar-resizing] .sidebar {
1207
- transition: none;
1208
- }
1209
- `;function Mr(){let e="patchwork-frame-styles",r=document.getElementById(e);if(r){r.textContent!==Ve&&(r.textContent=Ve);return}let t=document.createElement("style");t.id=e,t.textContent=Ve,document.head.append(t)}var ai=Ur("<patchwork-view component=patchwork-isolation root-component=threepane-isolation-root shared-providers=patchwork:contact,patchwork:selected-doc,patchwork:worker-channel shared-tools=llm-config-tray style=display:contents><script type=application/json data-root-component-data>",!0,!1,!1),ii=Ur("<div class=frame>");function Cd(e){let r=Or(()=>{let o=new Set,n=e.selectedDocUrl();return n&&o.add(n),e.contactUrl&&o.add(e.contactUrl),[...o]}),t=Or(()=>JSON.stringify({selectedDocUrl:e.selectedDocUrl(),selectedToolId:e.selectedToolId(),doctitleSlots:e.doctitleSlots(),isLeftCollapsed:e.isLeftCollapsed(),initialRightWidth:e.initialRightWidth(),initialRightCollapsed:e.initialRightCollapsed()}));return(()=>{var o=ai(),n=o.firstChild;return o._$owner=ni(),jr(n,t),oi(()=>ri(o,"automerge-allowlist",r().join(","))),o})()}function zr(e){if(!e?.textContent)return{};try{return JSON.parse(e.textContent)}catch(r){return console.error("[threepane-isolation-root] bad props JSON:",r),{}}}function $d(e){Mr();let r=e.querySelector('script[type="application/json"]'),[t,o]=si(zr(r)),n=new MutationObserver(()=>{o(li(zr(r)))});r&&n.observe(r,{characterData:!0,childList:!0,subtree:!0});let i=ci(()=>(()=>{var a=ii();return jr(a,ti(Lr,{selectedDocUrl:()=>t.selectedDocUrl,selectedToolId:()=>t.selectedToolId,doctitleSlots:()=>t.doctitleSlots,isLeftCollapsed:()=>t.isLeftCollapsed??!1,initialRightWidth:()=>t.initialRightWidth??Te,initialRightCollapsed:()=>t.initialRightCollapsed??!1})),a})(),e);return()=>{n.disconnect(),i()}}export{$t as a,be as b,B as c,Ee as d,Te as e,bt as f,vt as g,Br as h,Xe as i,oo as j,qt as k,tt as l,ql as m,Bl as n,Dr as o,Lr as p,Mr as q,Cd as r,$d as s};
1210
- //# sourceMappingURL=chunk-MWFQHDD3.js.map