@inkandswitch/patchwork-pkg-base 0.0.128 → 0.0.129

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