@fungi.computer/inkcap 0.8.2 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Br as t,Vr as n}from"./tree-path-JjH_INEe.js";import{Ct as r,Dt as i,Et as a,Tt as o,_t as s,bt as c,gt as l,ht as u,mt as d,vt as f,wt as p,xt as m,yt as h}from"./folder-open-FrTzWENd.js";var g=class extends s{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),v(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof r(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!p(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&b(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),i&&(this.#t!==n||r(this.options.enabled,this.#t)!==r(t.enabled,this.#t)||r(this.options.staleTime,this.#t)!==r(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==n||r(this.options.enabled,this.#t)!==r(t.enabled,this.#t)||a!==this.#f)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return p(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#h(e){return!f()&&r(this.options.enabled,this.#t)!==!1&&h(e)}#g(){this.#b();let e=r(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=a(this.#r.dataUpdatedAt,e)+1;this.#u=i.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=i.setInterval(()=>{(this.options.refetchIntervalInBackground||l.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(i.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(i.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,i=this.options,a=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},f=!1,p;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&v(e,t),o=r&&b(e,n,t,i);(a||o)&&(u={...u,...d(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:h,errorUpdatedAt:g,status:_}=u;p=u.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(_=`success`,p=m(a?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y){if(a&&p===o?.data&&t.select===this.#s)p=this.#c;else try{this.#s=t.select,p=t.select(p),p=m(a?.data,p,t),this.#c=p,this.#o=null}catch(e){this.#o=e}}else p===void 0&&(this.#o=null);this.#o&&(h=this.#o,p=this.#c,g=Date.now(),_=`error`,f=!1);let S=u.fetchStatus===`fetching`,C=_===`pending`,ee=_===`error`,w=C&&S,T=p!==void 0;return{status:_,fetchStatus:u.fetchStatus,isPending:C,isSuccess:_===`success`,isError:ee,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:ee&&!T,isPaused:u.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:ee&&T,isStale:x(e,t),refetch:this.refetch,isEnabled:r(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),p(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();u.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function _(e,t){return r(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||r(t.retryOnMount,e)!==!1)}function v(e,t){return _(e,t)||e.state.data!==void 0&&y(e,t,t.refetchOnMount)}function y(e,t,n){if(r(t.enabled,e)!==!1&&r(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&x(e,t)}return!1}function b(e,t,n,i){return(e!==t||r(i.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&x(e,n)}function x(e,t){return r(t.enabled,e)!==!1&&e.isStaleByTime(r(t.staleTime,e))}var S=e(n(),1),C=S.createContext(!1),ee=()=>S.useContext(C);C.Provider;var w=t();function T(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E=S.createContext(T()),te=()=>S.useContext(E),ne=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?o(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},D=e=>{S.useEffect(()=>{e.clearReset()},[e])},re=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||o(n,[e.error,r])),O=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ie=(e,t)=>e?.suspense&&t.isPending,k=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}),A=`file-tree-container`,ae=`data-file-tree-style`,oe=`data-file-tree-unsafe-css`,se=`data-file-tree-scrollbar-measure`,ce=`data-file-tree-scrollbar-gutter-measured`,le=`--trees-scrollbar-gutter-measured`,ue=`header`,de=`context-menu`,fe=`context-menu-trigger`,pe=typeof window>`u`?S.useEffect:S.useLayoutEffect;function me(e,t,n){let r=e==null?null:(0,w.jsx)(`div`,{slot:ue,children:e}),i=t!=null&&n!=null?(0,w.jsx)(`div`,{slot:de,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,w.jsxs)(w.Fragment,{children:[r,i]})}function he(e,t){return typeof window>`u`&&t!=null?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,w.jsx)(w.Fragment,{children:e})}function ge(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement||e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function _e(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function ve({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(n.getComposition()),d=(0,S.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,S.useCallback)(()=>{s(null)},[]),m=(0,S.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,S.useMemo)(()=>_e(h,e,f,p,m),[h,p,m,f,e]),_=(0,S.useCallback)(e=>{l(e)},[]);(0,S.useEffect)(()=>{f||s(null)},[f]),pe(()=>{n.setComposition(g)},[g,n]),pe(()=>{if(c!=null)return r!=null&&ge(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=he(me(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,w.jsx)(A,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var ye=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Br as t,Vr as n}from"./tree-path-JjH_INEe.js";import{Ct as r,Dt as i,Et as a,Tt as o,_t as s,bt as c,gt as l,ht as u,mt as d,vt as f,wt as p,xt as m,yt as h}from"./folder-open-DArW1Xa9.js";var g=class extends s{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),v(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return y(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return y(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof r(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!p(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let i=this.hasListeners();i&&b(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),i&&(this.#t!==n||r(this.options.enabled,this.#t)!==r(t.enabled,this.#t)||r(this.options.staleTime,this.#t)!==r(t.staleTime,this.#t))&&this.#g();let a=this.#_();i&&(this.#t!==n||r(this.options.enabled,this.#t)!==r(t.enabled,this.#t)||a!==this.#f)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return p(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(c)),t}#h(e){return!f()&&r(this.options.enabled,this.#t)!==!1&&h(e)}#g(){this.#b();let e=r(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=a(this.#r.dataUpdatedAt,e)+1;this.#u=i.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=i.setInterval(()=>{(this.options.refetchIntervalInBackground||l.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(i.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(i.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,i=this.options,a=this.#r,o=this.#i,s=this.#a,c=e===n?this.#n:e.state,{state:l}=e,u={...l},f=!1,p;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&v(e,t),o=r&&b(e,n,t,i);(a||o)&&(u={...u,...d(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:h,errorUpdatedAt:g,status:_}=u;p=u.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===s?.placeholderData?(e=a.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(_=`success`,p=m(a?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y){if(a&&p===o?.data&&t.select===this.#s)p=this.#c;else try{this.#s=t.select,p=t.select(p),p=m(a?.data,p,t),this.#c=p,this.#o=null}catch(e){this.#o=e}}else p===void 0&&(this.#o=null);this.#o&&(h=this.#o,p=this.#c,g=Date.now(),_=`error`,f=!1);let S=u.fetchStatus===`fetching`,C=_===`pending`,ee=_===`error`,w=C&&S,T=p!==void 0;return{status:_,fetchStatus:u.fetchStatus,isPending:C,isSuccess:_===`success`,isError:ee,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:u.dataUpdatedAt,error:h,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!C,isLoadingError:ee&&!T,isPaused:u.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:ee&&T,isStale:x(e,t),refetch:this.refetch,isEnabled:r(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),p(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();u.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function _(e,t){return r(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||r(t.retryOnMount,e)!==!1)}function v(e,t){return _(e,t)||e.state.data!==void 0&&y(e,t,t.refetchOnMount)}function y(e,t,n){if(r(t.enabled,e)!==!1&&r(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&x(e,t)}return!1}function b(e,t,n,i){return(e!==t||r(i.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&x(e,n)}function x(e,t){return r(t.enabled,e)!==!1&&e.isStaleByTime(r(t.staleTime,e))}var S=e(n(),1),C=S.createContext(!1),ee=()=>S.useContext(C);C.Provider;var w=t();function T(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var E=S.createContext(T()),te=()=>S.useContext(E),ne=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?o(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},D=e=>{S.useEffect(()=>{e.clearReset()},[e])},re=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||o(n,[e.error,r])),O=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ie=(e,t)=>e?.suspense&&t.isPending,k=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()}),A=`file-tree-container`,ae=`data-file-tree-style`,oe=`data-file-tree-unsafe-css`,se=`data-file-tree-scrollbar-measure`,ce=`data-file-tree-scrollbar-gutter-measured`,le=`--trees-scrollbar-gutter-measured`,ue=`header`,de=`context-menu`,fe=`context-menu-trigger`,pe=typeof window>`u`?S.useEffect:S.useLayoutEffect;function me(e,t,n){let r=e==null?null:(0,w.jsx)(`div`,{slot:ue,children:e}),i=t!=null&&n!=null?(0,w.jsx)(`div`,{slot:de,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,w.jsxs)(w.Fragment,{children:[r,i]})}function he(e,t){return typeof window>`u`&&t!=null?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,w.jsx)(w.Fragment,{children:e})}function ge(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement||e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function _e(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function ve({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,S.useState)(null),[c,l]=(0,S.useState)(null),u=(0,S.useRef)(n.getComposition()),d=(0,S.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,S.useCallback)(()=>{s(null)},[]),m=(0,S.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,S.useMemo)(()=>_e(h,e,f,p,m),[h,p,m,f,e]),_=(0,S.useCallback)(e=>{l(e)},[]);(0,S.useEffect)(()=>{f||s(null)},[f]),pe(()=>{n.setComposition(g)},[g,n]),pe(()=>{if(c!=null)return r!=null&&ge(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=he(me(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,w.jsx)(A,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}var ye=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
2
2
  <symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
3
3
  <path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
4
4
  </symbol>
package/dist/index.html CHANGED
@@ -4,11 +4,11 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Inkcap</title>
7
- <script type="module" crossorigin src="./assets/index-D-OpksWH.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-B-zUw4Dm.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-hePW80VL.js">
9
9
  <link rel="modulepreload" crossorigin href="./assets/tree-path-JjH_INEe.js">
10
- <link rel="modulepreload" crossorigin href="./assets/folder-open-FrTzWENd.js">
11
- <link rel="stylesheet" crossorigin href="./assets/index-BbCoS5Sh.css">
10
+ <link rel="modulepreload" crossorigin href="./assets/folder-open-DArW1Xa9.js">
11
+ <link rel="stylesheet" crossorigin href="./assets/index-B93IuBn_.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="inkcap-root"></div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fungi.computer/inkcap",
3
3
  "description": "Inkcap: edit the files on your Computer, an App for Oyster",
4
- "version": "0.8.2",
4
+ "version": "0.8.4",
5
5
  "author": "Levi <levi@technomancy.dev>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -12,12 +12,12 @@
12
12
  "react": "18.3.1",
13
13
  "react-dom": "18.3.1",
14
14
  "@tanstack/react-form": "1.33.2",
15
- "@fungi.computer/caps": "0.10.1",
16
- "@fungi.computer/agar": "0.9.0",
15
+ "@fungi.computer/caps": "0.10.2",
16
+ "@fungi.computer/agar": "0.9.1",
17
17
  "lucide-react": "0.460.0",
18
18
  "@fungi.computer/stipe": "0.1.1",
19
19
  "@fungi.computer/whistle": "0.3.0",
20
- "@fungi.computer/nacre": "0.4.3",
20
+ "@fungi.computer/nacre": "0.4.4",
21
21
  "effect": "4.0.2",
22
22
  "@pierre/trees": "1.0.0-beta.6",
23
23
  "@pierre/diffs": "1.3.6",
@@ -27,7 +27,7 @@
27
27
  "@fungi.computer/computer-contract": "0.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@fungi.computer/oyster": "0.19.6",
30
+ "@fungi.computer/oyster": "0.19.24",
31
31
  "@ladle/react": "5.1.1",
32
32
  "@fungi.computer/capnweb": "0.12.0-fungi.0",
33
33
  "@vitejs/plugin-react": "6.1.1",