folder-pane 4.1.0 → 4.1.1

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
- const e=require("../../accessCache.cjs.js");require("../folder-pane-container/index.cjs.js"),require("../folder-pane-sidebar/index.cjs.js"),require("../folder-pane-content/index.cjs.js"),require("../folder-pane-storage-header/index.cjs.js"),require("../../_virtual/~icons/lucide/chevron-left.cjs.js");const t=require("../../helpers.cjs.js"),n=require("./renderRequest.cjs.js"),r=require("../folder-pane-storage-header/FolderPaneCreateDialog.cjs.js"),i=require("../../creationSafety.cjs.js"),a=require("../../mintPaneInstance.cjs.js"),o=require("../../debug.cjs.js"),s=require("./resourceLoad.cjs.js");let c=require("solid-ui"),l=require("solid-logic"),u=require("lit"),d=require("lit/decorators.js");require("solid-ui/components/button"),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/error-state"),require("solid-ui/components/file-explorer-header");var f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve;function M(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n){ye(e,t),t.set(e,n)}function ye(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function P(e,t,n){return e.set(be(e,t),n),n}function F(e,t){return e.get(be(e,t))}function be(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function xe(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:we(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||we(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return Te(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:Se(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function Se(e){var t=Ce(e,`string`);return typeof t==`symbol`?t:t+``}function Ce(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function we(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function Te(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function I(e,t){if(!Number.isFinite(t)||t<=320)return 256;let n=t-320;return n<180?256:Math.min(480,n,Math.max(180,Number.isFinite(e)?e:256))}h=[(0,c.customElement)(`folder-pane-view`)];var Ee,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,Q=new WeakMap,$=new WeakMap;ve=(g=(0,d.property)({attribute:!1}),v=(0,d.property)({attribute:!1}),b=(0,d.property)({type:Boolean,attribute:`full-view`}),S=(0,d.state)(),w=(0,d.state)(),E=(0,d.state)(),O=(0,d.state)(),A=(0,d.state)(),ee=(0,d.state)(),ne=(0,d.state)(),ie=(0,d.state)(),oe=(0,d.state)(),ce=(0,d.state)(),ue=(0,d.query)(`folder-pane-content`),fe=(0,d.query)(`.folder-pane-full-view`),me=(0,d.query)(`folder-pane-sidebar`),ge=(0,d.query)(`.folder-pane-status`),`browserContext`),f=class extends c.WebComponent{constructor(...u){super(...u),N(this,L,(p(this),_(this,void 0))),N(this,R,y(this,void 0)),N(this,z,x(this,!1)),N(this,B,C(this,void 0)),N(this,V,T(this,void 0)),N(this,H,D(this,`grid`)),N(this,U,k(this,``)),N(this,W,j(this,!1)),N(this,G,te(this,256)),N(this,K,re(this,480)),N(this,q,ae(this,void 0)),N(this,J,se(this,!1)),N(this,Y,le(this,!1)),M(this,`initialLoadGeneration`,0),M(this,`renderGeneration`,0),M(this,`permissionGeneration`,0),M(this,`permissionRequest`,void 0),M(this,`creationInFlight`,!1),M(this,`authListenersAttached`,!1),M(this,`dropProtectionAttached`,!1),M(this,`sidebarResizeObserver`,void 0),M(this,`responsiveLayoutInitialized`,!1),M(this,`sidebarDrag`,void 0),N(this,X,de(this,null)),N(this,Z,pe(this,null)),N(this,Q,he(this,null)),N(this,$,_e(this,null)),M(this,`handleAuthChange`,()=>{e.resourceAccessCache.clear(),this.refreshCreationPermission(!0),this.requestUpdate()}),M(this,`handleCreatePane`,async e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let n=e.detail?.pane;if(!n?.mintNew)return;let s=this.getActiveContainer(),u=this.ownerDocument,d=this.statusArea;if(!s||!d)return;this.creationInFlight=!0,this.updateUploadAvailability();let f=++this.renderGeneration,p=t.getPaneLabel(n);try{let e=await new Promise(e=>{(0,c.showDialog)(r.default,{props:{label:p},onClose:e})});if(!e||!l.authn.currentUser()||f!==this.renderGeneration||this.getActiveContainer()?.sameTerm(s)!==!0)return;if(!i.isSafeCreationName(e)){a.setMintStatus(d,`error`,i.invalidCreationNameMessage);return}this.clearContentForCreation();let t=await a.mintPaneInstance({context:this.browserContext,container:s,pane:n,name:e,noun:p,statusArea:d,me:l.authn.currentUser()??void 0,dom:u}),o=f===this.renderGeneration&&this.getActiveContainer()?.sameTerm(s)===!0;await this.showCreatedResource({container:s,...t,pane:n,newInstance:o?t.newInstance:void 0})}catch(e){o.error(`Unable to create folder-pane resource`,e),!(e instanceof a.PaneMintError)&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,`Unable to create ${p}: ${e instanceof Error?e.message:String(e)}`)}finally{this.creationInFlight=!1,this.updateUploadAvailability()}}),M(this,`handleUpload`,e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let t=this.ownerDocument.createElement(`input`);t.type=`file`,t.multiple=!0,t.addEventListener(`change`,()=>{this.uploadFiles(Array.from(t.files??[]),!0)}),t.click()}),M(this,`handleDroppedFiles`,e=>{e.stopPropagation();let t=e.detail?.files??[];this.uploadFiles(t,!1)}),M(this,`handleUploadRejected`,e=>{e.stopPropagation();let t=e.detail?.message;t&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,t)}),M(this,`handleResourceDeleted`,e=>{let t=e.detail?.resource;if(!t)return;let r=t.dir(),i=this.getActiveContainer();r&&this.sidebar?.refreshResources?.(r);let a=this.resourceTarget?.querySelector(`folder-pane-container`);if(r&&i?.sameTerm(r)&&a?.refresh?.(),!this.selectedResource?.sameTerm(t))return;this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration);let o=r??this.subject;o?(this.selectedResource=o,this.renderContainerView(o)):this.selectedResource=void 0}),M(this,`clearContentError`,()=>{this.contentError=void 0}),M(this,`retryContent`,()=>{let e=this.contentError?.retry;if(e){this.clearContentError(),e();return}let t=this.selectedResource,n=this.subject;(t||n)&&(this.clearContentError(),t?this.showResourceInContentView(t,void 0,!1,!0):n&&(this.store&&s.clearFailedResource(this.store.fetcher,n),this.showInitialContainer(n)))}),M(this,`handleResourceSelected`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.searchQuery=``,this.showSubject(t))}),M(this,`handleResourceOpenPane`,e=>{let t=e.detail?.resource,n=e.detail?.paneName,r=n?this.browserContext?.session.paneRegistry.byName(n):void 0;t&&r&&(e.stopPropagation(),this.searchQuery=``,r.name===`folder`?this.showSubject(t,r,!0):this.showSubject(t,typeof r?.render==`function`?r:void 0,!0))}),M(this,`handleSelectHome`,()=>{this.searchQuery=``;let e=this.subject&&this.standaloneBreadcrumbRoot?.sameTerm(this.subject)?this.subject:this.standaloneBreadcrumbRoot;e&&this.showSubject(e)}),M(this,`handleSearch`,e=>{e.stopPropagation(),this.searchQuery=e.detail?.query||``;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.searchQuery=this.searchQuery)}),M(this,`handleSelectBreadcrumbResource`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.showSubject(t))}),M(this,`handleContainerViewChange`,e=>{let t=e.detail?.view;t&&(e.stopPropagation(),this.setContainerView(t))}),M(this,`updateSidebarBounds`,()=>{this.isConnected&&(this.sidebarMaximumWidth=I(480,this.sidebarAvailableWidth),this.resizeSidebar(this.sidebarWidth))}),M(this,`handleSidebarPointerDown`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.button!==0||!e.isPrimary)return;e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),t.focus(),this.sidebarDrag={separator:t,pointerId:e.pointerId,startX:e.clientX,startWidth:this.sidebarWidth},this.requestUpdate()}),M(this,`handleSidebarPointerMove`,e=>{let t=this.sidebarDrag;this.isConnected&&!this.sidebarCollapsed&&t&&t.pointerId===e.pointerId&&this.resizeSidebar(t.startWidth+e.clientX-t.startX)}),M(this,`handleSidebarPointerEnd`,e=>{this.sidebarDrag?.pointerId===e.pointerId&&this.finishSidebarResize()}),M(this,`handleSidebarResizeKey`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.altKey||e.ctrlKey||e.metaKey)return;let t;switch(e.key){case`ArrowLeft`:t=this.sidebarWidth-16;break;case`ArrowRight`:t=this.sidebarWidth+16;break;case`Home`:t=180;break;case`End`:t=480;break;default:return}e.preventDefault(),e.stopPropagation(),this.resizeSidebar(t)}),M(this,`handleSidebarToggle`,async e=>{e.stopPropagation();let t=this.sidebar,n=this.renderRoot.querySelector(`.folder-pane-sidebar-resize-handle`),r=!!t&&(t.matches(`:focus-within`)||t.shadowRoot?.activeElement!=null),i=n===this.ownerDocument.activeElement;this.finishSidebarResize(),this.sidebarCollapsed=!this.sidebarCollapsed,this.sidebarCollapsed&&(r||i)&&(await this.updateComplete,this.renderRoot.querySelector(`.folder-pane-sidebar-toggle`)?.focus())}),M(this,`handleFolderPaneResourceError`,e=>{e.stopPropagation();let t=e.detail?.title||`Unable to load this folder`,n=e.detail?.message||`The folder could not be loaded. Try again.`;this.showContentError({title:t,message:n,retry:e.detail?.retry},!1)})}get[ve](){return F(L,this)}set browserContext(e){P(L,this,e)}get store(){return this.browserContext?.session.store}get subject(){return F(R,this)}set subject(e){P(R,this,e)}get resourceLogic(){return this.browserContext?.session.logic.resource}get displayedResource(){return this.selectedResource??this.subject}get fullView(){return F(z,this)}set fullView(e){P(z,this,e)}get selectedResource(){return F(B,this)}set selectedResource(e){P(B,this,e)}get standaloneBreadcrumbRoot(){return F(V,this)}set standaloneBreadcrumbRoot(e){P(V,this,e)}get containerView(){return F(H,this)}set containerView(e){P(H,this,e)}get searchQuery(){return F(U,this)}set searchQuery(e){P(U,this,e)}get sidebarCollapsed(){return F(W,this)}set sidebarCollapsed(e){P(W,this,e)}get sidebarWidth(){return F(G,this)}set sidebarWidth(e){P(G,this,e)}get sidebarMaximumWidth(){return F(K,this)}set sidebarMaximumWidth(e){P(K,this,e)}get contentError(){return F(q,this)}set contentError(e){P(q,this,e)}get showingContainer(){return F(J,this)}set showingContainer(e){P(J,this,e)}get canCreate(){return F(Y,this)}set canCreate(e){P(Y,this,e)}get contentView(){return F(X,this)}set contentView(e){P(X,this,e)}get fullViewTarget(){return F(Z,this)}set fullViewTarget(e){P(Z,this,e)}get sidebar(){return F(Q,this)}set sidebar(e){P(Q,this,e)}get statusArea(){return F($,this)}set statusArea(e){P($,this,e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver?.observe(e),this.dropProtectionAttached||=(c.aclControl.preventBrowserDropEvents(this.ownerDocument),!0),this.addEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.addEventListener(`folder-pane-upload`,this.handleUpload),this.addEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.addEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.addEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.addEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached||=(l.authSession.events.on(`login`,this.handleAuthChange),l.authSession.events.on(`logout`,this.handleAuthChange),!0)}disconnectedCallback(){this.finishSidebarResize(),this.sidebarResizeObserver?.disconnect(),this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration),this.initialLoadGeneration++,this.removeEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.removeEventListener(`folder-pane-upload`,this.handleUpload),this.removeEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.removeEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.removeEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.removeEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached&&=(l.authSession.events.off(`login`,this.handleAuthChange),l.authSession.events.off(`logout`,this.handleAuthChange),!1),super.disconnectedCallback()}firstUpdated(){if(this.updateSidebarBounds(),typeof ResizeObserver<`u`){this.sidebarResizeObserver=new ResizeObserver(e=>{this.updateSidebarBounds();let t=e[0]?.contentRect.width??0;this.responsiveLayoutInitialized||t<=0||(this.responsiveLayoutInitialized=!0,t<768&&this.handleSidebarToggle(new Event(`folder-pane-responsive-collapse`)))});let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver.observe(e),this.sidebarResizeObserver.observe(this)}}async uploadFiles(e,t){if(this.creationInFlight||!l.authn.currentUser()||!this.canCreate)return;let n=this.getActiveContainer(),r=this.statusArea,o=this.resourceLogic;if(!e.length||!n||!r||!this.store||!o)return;let s=e.filter(e=>i.isSafeCreationName(e.name)),c=e.filter(e=>!i.isSafeCreationName(e.name)).map(e=>`${e.name}: ${i.invalidCreationNameMessage}`);if(!s.length){c.length&&a.setMintStatus(r,`error`,c.join(`; `));return}this.creationInFlight=!0,this.updateUploadAvailability();let u=this.renderGeneration,d=this.browserContext,f=s.length,p=()=>{f--,f===0&&(this.creationInFlight=!1,this.updateUploadAvailability(),r.dataset.status===`progress`&&r.replaceChildren())};a.setMintStatus(r,`progress`,`Uploading ${s.length} file${s.length===1?``:`s`}`);try{let e=await o.uploadFiles(s,n.uri);for(let r of e)if(r.success)try{let e=this.renderGeneration===u&&this.browserContext===d;await this.showCreatedResource({container:n,containedResource:this.store.sym(r.uploadedUri),newInstance:t&&s.length===1&&e?this.store.sym(r.uploadedUri):void 0})}catch(e){let t=e instanceof Error?e.message:String(e);c.push(`Uploaded ${r.file.name}, but could not refresh the folder: ${t}`)}finally{p()}else{let e=r.error.destinationUri?`Upload failed while putting ${r.error.destinationUri}`:`Upload failed for ${r.file.name}`,t=r.error.status===413?`${e}: storage quota was exceeded. ${r.error.message}`:r.error.status?`${e} (HTTP ${r.error.status}). ${r.error.message}`:`${e}. ${r.error.message}`;c.push(t),p()}}catch(e){let t=e instanceof Error?e.message:String(e);for(c.push(`Unable to upload files: ${t}`);f>0;)p()}c.length&&a.setMintStatus(r,`error`,c.join(`; `))}updated(e){(e.has(`subject`)||e.has(`browserContext`))&&this.subject?(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject,(e.has(`subject`)||e.has(`browserContext`))&&(this.selectedResource=void 0,this.renderGeneration++,this.initialLoadGeneration++),this.refreshCreationPermission(),this.showInitialContainer(this.subject)):(e.has(`selectedResource`)&&this.refreshCreationPermission(),e.has(`fullView`)&&e.get(`fullView`)!==void 0&&(this.subject&&(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject),this.selectedResource?this.showResourceInContentView(this.selectedResource):this.subject&&this.renderContainerView(this.subject)))}getStandaloneBreadcrumbRoot(e){try{let t=new URL(e.uri),n=t.pathname.split(`/`).filter(Boolean);return n.length<=1?e:this.store?.sym(`${t.origin}/${n[0]}/`)??e}catch{return e}}get resourceTarget(){return this.fullView?this.fullViewTarget:this.contentView}showContentError(e,t=!0){t&&this.resourceTarget?.replaceChildren(),this.contentError=e}renderAccessDeniedScreen(){this.showContentError({title:`Access denied`,message:`You do not have access to the contents of this container.`})}async loadResource(e,n=!1){let r=this.store;if(!r)return;let i=r.fetcher;n&&s.clearFailedResource(i,e);try{await i.load(e)}catch(r){if(!n||!t.isAccessDeniedError(r)||!l.authn.currentUser())throw r;await i.load(e,{force:!0,clearPreviousData:!0})}}openCreatedResource(e,t){this.searchQuery=``;let n=t?.name?this.browserContext?.session.paneRegistry.byName(t.name)??t:t;this.showSubject(e,typeof n?.render==`function`?n:void 0)}getActiveContainer(){let e=this.selectedResource,n=e?t.getIndexedContainer(e):void 0;if(n&&this.store)return this.store.sym(n);if(e&&this.resourceLogic&&t.isContainerResource(e,this.resourceLogic))return e;let r=this.fullView?this.standaloneBreadcrumbRoot:this.subject,i=e?.dir(),a=r?.uri.endsWith(`/`)?r.uri:`${r?.uri}/`;return r&&i&&a&&i.uri.startsWith(a)?i:this.subject}refreshCreationPermission(e=!1){let t=this.getActiveContainer(),n=this.browserContext?.session.logic.resource;if(!e&&t&&n&&this.permissionRequest?.containerUri===t.uri&&this.permissionRequest.resourceLogic===n)return;let r=++this.permissionGeneration;this.setCanCreate(!1),this.permissionRequest=t&&n?{containerUri:t.uri,resourceLogic:n}:void 0,t&&n&&n.fetchMetadata(t).then(e=>{r===this.permissionGeneration&&this.getActiveContainer()?.sameTerm(t)===!0&&this.setCanCreate(e.access.canEdit)}).catch(e=>{r===this.permissionGeneration&&(this.permissionRequest=void 0,o.warn(`Unable to determine folder creation permission`,e))})}updateUploadAvailability(){let e=this.resourceTarget?.querySelector(`folder-pane-container`),t=this.getActiveContainer();e&&(e.canUpload=this.canCreate&&!this.creationInFlight&&!!t&&e.subject?.sameTerm(t)===!0,e.uploadBusy=this.creationInFlight)}setCanCreate(e){this.canCreate=e,this.updateUploadAvailability()}clearContentForCreation(){this.resourceTarget?.replaceChildren()}async showCreatedResource({container:e,containedResource:t,newInstance:n,pane:r}){let i=this.store;if(!i)return;let a=this.renderGeneration,o=this.browserContext,s=async e=>{try{return await i.fetcher.load(e,{force:!0,clearPreviousData:!0}),!0}catch(t){return c.log.warn(`Unable to reload `+e.uri+`: `+t),!1}},l=await s(e);if(t.uri.endsWith(`/`)){await s(t);let e=i.each(t,c.ns.ldp(`contains`),void 0,t.doc());for(let t of e)t.termType===`NamedNode`&&i.fetcher.getState(t.value)===`failed`&&i.fetcher.unload(t)}this.sidebar?.refreshResources?.(e);let u=this.resourceTarget?.querySelector(`folder-pane-container`);!l&&u?.addOptimisticResource&&u.addOptimisticResource(t),l&&u?.refresh?.(),n&&this.isConnected&&this.renderGeneration===a&&this.browserContext===o&&this.openCreatedResource(n,r)}renderContainerView(e){let t=this.resourceTarget;if(!t)return;this.contentError=void 0;let n=document.createElement(`folder-pane-container`);n.subject=e,n.resourceLogic=this.resourceLogic??null,n.browserContext=this.browserContext;let r=this.getActiveContainer();n.canUpload=this.canCreate&&!!r&&e.sameTerm(r),n.uploadBusy=this.creationInFlight,n.view=this.containerView,n.searchQuery=this.searchQuery,this.showingContainer=!0,t.replaceChildren(n)}async showInitialContainer(e){let n=++this.initialLoadGeneration;if(t.isJavaScriptFile(e))this.showSubject(e);else if(this.store&&this.resourceLogic){try{await this.loadResource(e)}catch(r){if(n!==this.initialLoadGeneration||!this.subject?.sameTerm(e))return;if(t.isAccessDeniedError(r)){this.resourceTarget&&this.renderAccessDeniedScreen();return}c.log.error(`Unable to load storage container: `+r),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}n===this.initialLoadGeneration&&this.subject?.sameTerm(e)&&(this.sidebar?.refreshResources?.(),this.requestUpdate(),this.selectedResource||this.showSubject(e))}}async renderExplorerInto(e,t,r,i={}){if(!this.browserContext)return;let a=await(0,c.getRelevantPanes)(t,this.browserContext,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(i.isCurrent&&!i.isCurrent())return;let o=r||(0,c.getPreferredPane)(t,this.browserContext,a);if(!o){this.renderExplorerError(t,`No pane is available to display this resource.`);return}let s;try{s=o.render(t,this.browserContext,i.paneOptions||{})}catch(e){c.log.error(`Unable to render selected pane: `+e),this.renderExplorerError(t,`The selected pane could not render this resource.`);return}let l=e.ownerDocument.createElement(`solid-ui-file-explorer-provider`),u=await(0,c.preparePaneMenuItems)({subject:t,context:this.browserContext,panes:a,openPane:(e,t)=>{l.dispatchEvent(new CustomEvent(c.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))}});l.addEventListener(c.FILE_EXPLORER_BACK_EVENT,e=>{if(!(0,c.isExplorerEvent)(e,l))return;e.stopPropagation();let n=this.getActiveContainer()||this.subject||t;this.renderGeneration++,this.selectedResource=n,this.renderContainerView(n)}),l.addEventListener(c.FILE_EXPLORER_OPEN_PANE_EVENT,r=>{if(!(0,c.isExplorerEvent)(r,l))return;r.stopPropagation();let a=r.detail?.paneName,o=a?this.browserContext?.session.paneRegistry.byName(a):void 0;if(o){let r={generation:++this.renderGeneration,subjectUri:t.uri,context:this.browserContext};this.renderExplorerInto(e,t,o,{...i,paneOptions:o.name===`folder`?{folderView:`container`,fullView:!0,solo:!0}:i.paneOptions,isCurrent:()=>n.isCurrentRenderRequest(r,this.renderGeneration,this.selectedResource?.uri,this.browserContext)}).catch(e=>{c.log.error(`Unable to switch selected pane: `+e)})}}),(0,c.composeExplorer)(l,{context:this.browserContext,subjectUri:t.uri,pane:o,relevantPanes:a,header:i.showHeader===!1?void 0:{paneIcon:o.icon,menuItems:u},paneElement:s}),(!i.isCurrent||i.isCurrent())&&(this.contentError=void 0,this.showingContainer=!1,e.replaceChildren(l))}renderExplorerError(e,t){this.showContentError({title:t,message:e.uri})}async showResourceInContentView(e,r,i=!1,a=!1){let o=++this.renderGeneration;try{let s=this.resourceTarget,l=this.browserContext;if(!s||!this.store||!this.resourceLogic||!l)return;let u={generation:o,subjectUri:e.uri,context:this.browserContext},d=e=>n.isCurrentRenderRequest(u,this.renderGeneration,this.selectedResource?.uri,this.browserContext)&&e.uri===u.subjectUri;if(!d(e))return;if(this.subject?.sameTerm(e)&&!r&&!i&&t.isContainerResource(e,this.resourceLogic)){this.renderContainerView(e);return}if(t.isContainerResource(e,this.resourceLogic)&&(r?.name!==`source`||i)){try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load selected container: `+n),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}if(!d(e))return;if(this.sidebar?.refreshResources?.(),r?.name===`folder`){this.renderContainerView(e);return}if(!r&&(i||this.resourceLogic.containerHasIndexDocument(e))){let n=this.store.sym(t.getIndexedApplicationSubject(e));try{await this.loadResource(n.doc(),a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load container index document: `+n)}await this.renderExplorerInto(s,n,r,{isCurrent:()=>d(e),showHeader:!1});return}let n=await(0,c.getRelevantPanes)(e,l,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(!d(e))return;let o=r||(0,c.getPreferredPane)(e,l,n);if(o?.name!==`folder`){await this.renderExplorerInto(s,e,o,{isCurrent:()=>d(e),showHeader:!1});return}this.renderContainerView(e);return}try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.warn(`Unable to load selected resource metadata: `+n)}if(!d(e))return;let f=t.isJavaScriptFile(e)?this.browserContext?.session.paneRegistry.byName(`source`):void 0;if(!r&&t.isJavaScriptFile(e)&&!f){this.renderExplorerError(e,`The Source pane is unavailable to display this JavaScript file.`);return}await this.renderExplorerInto(s,e,r||f,{isCurrent:()=>d(e)})}catch(n){if(c.log.error(`Unable to render selected resource: `+n),o===this.renderGeneration&&this.resourceTarget){if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}this.renderExplorerError(e,`Unable to display the selected resource.`)}}}showSubject(e,n,r=!1){let i=!r&&n?.name!==`sharing`,a=i?t.getIndexedContainer(e):void 0,o=a&&this.store?this.store.sym(a):void 0,s=o??e,c=i&&!o&&!!this.resourceLogic&&t.isContainerResource(e,this.resourceLogic)&&this.resourceLogic.containerHasIndexDocument(e);this.selectedResource=s,this.showResourceInContentView(s,n,!!o||c)}setContainerView(e){this.containerView=e;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.view=e)}get sidebarAvailableWidth(){let e=this.renderRoot.querySelector(`.folder-pane-main-content`),t=this.renderRoot.querySelector(`.folder-pane-sidebar-resizer`);return(e?.clientWidth??0)-(t?.getBoundingClientRect().width??0)}resizeSidebar(e){this.sidebarWidth=I(e,this.sidebarAvailableWidth)}finishSidebarResize(){let e=this.sidebarDrag;e&&(this.sidebarDrag=void 0,e.separator.hasPointerCapture(e.pointerId)&&e.separator.releasePointerCapture(e.pointerId),this.isConnected&&this.requestUpdate())}render(){return this.fullView?u.html`
1
+ const e=require("../../accessCache.cjs.js");require("../folder-pane-container/index.cjs.js"),require("../folder-pane-sidebar/index.cjs.js"),require("../folder-pane-content/index.cjs.js"),require("../folder-pane-storage-header/index.cjs.js"),require("../../_virtual/~icons/lucide/chevron-left.cjs.js");const t=require("../../helpers.cjs.js"),n=require("./renderRequest.cjs.js"),r=require("../folder-pane-storage-header/FolderPaneCreateDialog.cjs.js"),i=require("../../creationSafety.cjs.js"),a=require("../../mintPaneInstance.cjs.js"),o=require("../../debug.cjs.js"),s=require("./resourceLoad.cjs.js");let c=require("solid-ui"),l=require("solid-logic"),u=require("lit"),d=require("lit/decorators.js");require("solid-ui/components/button"),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/error-state"),require("solid-ui/components/file-explorer-header");var f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve;function M(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n){ye(e,t),t.set(e,n)}function ye(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function P(e,t,n){return e.set(be(e,t),n),n}function F(e,t){return e.get(be(e,t))}function be(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function xe(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:we(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||we(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return Te(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:Se(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function Se(e){var t=Ce(e,`string`);return typeof t==`symbol`?t:t+``}function Ce(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function we(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function Te(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function I(e,t){if(!Number.isFinite(t)||t<=320)return 256;let n=t-320;return n<180?256:Math.min(480,n,Math.max(180,Number.isFinite(e)?e:256))}h=[(0,c.customElement)(`folder-pane-view`)];var Ee,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,Q=new WeakMap,$=new WeakMap;ve=(g=(0,d.property)({attribute:!1}),v=(0,d.property)({attribute:!1}),b=(0,d.property)({type:Boolean,attribute:`full-view`}),S=(0,d.state)(),w=(0,d.state)(),E=(0,d.state)(),O=(0,d.state)(),A=(0,d.state)(),ee=(0,d.state)(),ne=(0,d.state)(),ie=(0,d.state)(),oe=(0,d.state)(),ce=(0,d.state)(),ue=(0,d.query)(`folder-pane-content`),fe=(0,d.query)(`.folder-pane-full-view`),me=(0,d.query)(`folder-pane-sidebar`),ge=(0,d.query)(`.folder-pane-status`),`browserContext`),f=class extends c.WebComponent{constructor(...u){super(...u),N(this,L,(p(this),_(this,void 0))),N(this,R,y(this,void 0)),N(this,z,x(this,!1)),N(this,B,C(this,void 0)),N(this,V,T(this,void 0)),N(this,H,D(this,`grid`)),N(this,U,k(this,``)),N(this,W,j(this,!1)),N(this,G,te(this,256)),N(this,K,re(this,480)),N(this,q,ae(this,void 0)),N(this,J,se(this,!1)),N(this,Y,le(this,!1)),M(this,`initialLoadGeneration`,0),M(this,`renderGeneration`,0),M(this,`permissionGeneration`,0),M(this,`permissionRequest`,void 0),M(this,`creationInFlight`,!1),M(this,`authListenersAttached`,!1),M(this,`dropProtectionAttached`,!1),M(this,`sidebarResizeObserver`,void 0),M(this,`responsiveLayoutInitialized`,!1),M(this,`sidebarDrag`,void 0),N(this,X,de(this,null)),N(this,Z,pe(this,null)),N(this,Q,he(this,null)),N(this,$,_e(this,null)),M(this,`handleAuthChange`,()=>{e.resourceAccessCache.clear(),this.refreshCreationPermission(!0),this.requestUpdate()}),M(this,`handleCreatePane`,async e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let n=e.detail?.pane;if(!n?.mintNew)return;let s=this.getActiveContainer(),u=this.ownerDocument,d=this.statusArea;if(!s||!d)return;this.creationInFlight=!0,this.updateUploadAvailability();let f=++this.renderGeneration,p=t.getPaneLabel(n);try{let e=await new Promise(e=>{(0,c.showDialog)(r.default,{props:{label:p},onClose:e})});if(!e||!l.authn.currentUser()||f!==this.renderGeneration||this.getActiveContainer()?.sameTerm(s)!==!0)return;if(!i.isSafeCreationName(e)){a.setMintStatus(d,`error`,i.invalidCreationNameMessage);return}this.clearContentForCreation();let t=await a.mintPaneInstance({context:this.browserContext,container:s,pane:n,name:e,noun:p,statusArea:d,me:l.authn.currentUser()??void 0,dom:u}),o=f===this.renderGeneration&&this.getActiveContainer()?.sameTerm(s)===!0;await this.showCreatedResource({container:s,...t,pane:n,newInstance:o?t.newInstance:void 0})}catch(e){o.error(`Unable to create folder-pane resource`,e),!(e instanceof a.PaneMintError)&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,`Unable to create ${p}: ${e instanceof Error?e.message:String(e)}`)}finally{this.creationInFlight=!1,this.updateUploadAvailability()}}),M(this,`handleUpload`,e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let t=this.ownerDocument.createElement(`input`);t.type=`file`,t.multiple=!0,t.addEventListener(`change`,()=>{this.uploadFiles(Array.from(t.files??[]),!0)}),t.click()}),M(this,`handleDroppedFiles`,e=>{e.stopPropagation();let t=e.detail?.files??[];this.uploadFiles(t,!1)}),M(this,`handleUploadRejected`,e=>{e.stopPropagation();let t=e.detail?.message;t&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,t)}),M(this,`handleResourceDeleted`,e=>{let t=e.detail?.resource;if(!t)return;let r=t.dir(),i=this.getActiveContainer();r&&this.sidebar?.refreshResources?.(r);let a=this.resourceTarget?.querySelector(`folder-pane-container`);if(r&&i?.sameTerm(r)&&a?.refresh?.(),!this.selectedResource?.sameTerm(t))return;this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration);let o=r??this.subject;o?(this.selectedResource=o,this.renderContainerView(o)):this.selectedResource=void 0}),M(this,`clearContentError`,()=>{this.contentError=void 0}),M(this,`retryContent`,()=>{let e=this.contentError?.retry;if(e){this.clearContentError(),e();return}let t=this.selectedResource,n=this.subject;(t||n)&&(this.clearContentError(),t?this.showResourceInContentView(t,void 0,!1,!0):n&&(this.store&&s.clearFailedResource(this.store.fetcher,n),this.showInitialContainer(n)))}),M(this,`handleResourceSelected`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.searchQuery=``,this.showSubject(t))}),M(this,`handleResourceOpenPane`,e=>{let t=e.detail?.resource,n=e.detail?.paneName,r=n?this.browserContext?.session.paneRegistry.byName(n):void 0;t&&r&&(e.stopPropagation(),this.searchQuery=``,r.name===`folder`?this.showSubject(t,r,!0):this.showSubject(t,typeof r?.render==`function`?r:void 0,!0))}),M(this,`handleSelectHome`,()=>{this.searchQuery=``;let e=this.subject&&this.standaloneBreadcrumbRoot?.sameTerm(this.subject)?this.subject:this.standaloneBreadcrumbRoot;e&&this.showSubject(e)}),M(this,`handleSearch`,e=>{e.stopPropagation(),this.searchQuery=e.detail?.query||``;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.searchQuery=this.searchQuery)}),M(this,`handleSelectBreadcrumbResource`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.showSubject(t))}),M(this,`handleContainerViewChange`,e=>{let t=e.detail?.view;t&&(e.stopPropagation(),this.setContainerView(t))}),M(this,`updateSidebarBounds`,()=>{this.isConnected&&(this.sidebarMaximumWidth=I(480,this.sidebarAvailableWidth),this.resizeSidebar(this.sidebarWidth))}),M(this,`handleSidebarPointerDown`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.button!==0||!e.isPrimary)return;e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),t.focus(),this.sidebarDrag={separator:t,pointerId:e.pointerId,startX:e.clientX,startWidth:this.sidebarWidth},this.requestUpdate()}),M(this,`handleSidebarPointerMove`,e=>{let t=this.sidebarDrag;this.isConnected&&!this.sidebarCollapsed&&t&&t.pointerId===e.pointerId&&this.resizeSidebar(t.startWidth+e.clientX-t.startX)}),M(this,`handleSidebarPointerEnd`,e=>{this.sidebarDrag?.pointerId===e.pointerId&&this.finishSidebarResize()}),M(this,`handleSidebarResizeKey`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.altKey||e.ctrlKey||e.metaKey)return;let t;switch(e.key){case`ArrowLeft`:t=this.sidebarWidth-16;break;case`ArrowRight`:t=this.sidebarWidth+16;break;case`Home`:t=180;break;case`End`:t=480;break;default:return}e.preventDefault(),e.stopPropagation(),this.resizeSidebar(t)}),M(this,`handleSidebarToggle`,async e=>{e.stopPropagation();let t=this.sidebar,n=this.renderRoot.querySelector(`.folder-pane-sidebar-resize-handle`),r=!!t&&(t.matches(`:focus-within`)||t.shadowRoot?.activeElement!=null),i=n===this.ownerDocument.activeElement;this.finishSidebarResize(),this.sidebarCollapsed=!this.sidebarCollapsed,this.sidebarCollapsed&&(r||i)&&(await this.updateComplete,this.renderRoot.querySelector(`.folder-pane-sidebar-toggle`)?.focus())}),M(this,`handleFolderPaneResourceError`,e=>{e.stopPropagation();let t=e.detail?.title||`Unable to load this folder`,n=e.detail?.message||`The folder could not be loaded. Try again.`;this.showContentError({title:t,message:n,retry:e.detail?.retry},!1)})}get[ve](){return F(L,this)}set browserContext(e){P(L,this,e)}get store(){return this.browserContext?.session.store}get subject(){return F(R,this)}set subject(e){P(R,this,e)}get resourceLogic(){return this.browserContext?.session.logic.resource}get displayedResource(){return this.selectedResource??this.subject}get fullView(){return F(z,this)}set fullView(e){P(z,this,e)}get selectedResource(){return F(B,this)}set selectedResource(e){P(B,this,e)}get standaloneBreadcrumbRoot(){return F(V,this)}set standaloneBreadcrumbRoot(e){P(V,this,e)}get containerView(){return F(H,this)}set containerView(e){P(H,this,e)}get searchQuery(){return F(U,this)}set searchQuery(e){P(U,this,e)}get sidebarCollapsed(){return F(W,this)}set sidebarCollapsed(e){P(W,this,e)}get sidebarWidth(){return F(G,this)}set sidebarWidth(e){P(G,this,e)}get sidebarMaximumWidth(){return F(K,this)}set sidebarMaximumWidth(e){P(K,this,e)}get contentError(){return F(q,this)}set contentError(e){P(q,this,e)}get showingContainer(){return F(J,this)}set showingContainer(e){P(J,this,e)}get canCreate(){return F(Y,this)}set canCreate(e){P(Y,this,e)}get contentView(){return F(X,this)}set contentView(e){P(X,this,e)}get fullViewTarget(){return F(Z,this)}set fullViewTarget(e){P(Z,this,e)}get sidebar(){return F(Q,this)}set sidebar(e){P(Q,this,e)}get statusArea(){return F($,this)}set statusArea(e){P($,this,e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver?.observe(e),this.dropProtectionAttached||=(c.aclControl.preventBrowserDropEvents(this.ownerDocument),!0),this.addEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.addEventListener(`folder-pane-upload`,this.handleUpload),this.addEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.addEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.addEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.addEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached||=(l.authSession.events.on(`login`,this.handleAuthChange),l.authSession.events.on(`logout`,this.handleAuthChange),!0)}disconnectedCallback(){this.finishSidebarResize(),this.sidebarResizeObserver?.disconnect(),this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration),this.initialLoadGeneration++,this.removeEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.removeEventListener(`folder-pane-upload`,this.handleUpload),this.removeEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.removeEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.removeEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.removeEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached&&=(l.authSession.events.off(`login`,this.handleAuthChange),l.authSession.events.off(`logout`,this.handleAuthChange),!1),super.disconnectedCallback()}firstUpdated(){if(this.updateSidebarBounds(),typeof ResizeObserver<`u`){this.sidebarResizeObserver=new ResizeObserver(e=>{this.updateSidebarBounds();let t=e[0]?.contentRect.width??0;this.responsiveLayoutInitialized||t<=0||(this.responsiveLayoutInitialized=!0,t<768&&this.handleSidebarToggle(new Event(`folder-pane-responsive-collapse`)))});let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver.observe(e),this.sidebarResizeObserver.observe(this)}}async uploadFiles(e,t){if(this.creationInFlight||!l.authn.currentUser()||!this.canCreate)return;let n=this.getActiveContainer(),r=this.statusArea,o=this.resourceLogic;if(!e.length||!n||!r||!this.store||!o)return;let s=e.filter(e=>i.isSafeCreationName(e.name)),c=e.filter(e=>!i.isSafeCreationName(e.name)).map(e=>`${e.name}: ${i.invalidCreationNameMessage}`);if(!s.length){c.length&&a.setMintStatus(r,`error`,c.join(`; `));return}this.creationInFlight=!0,this.updateUploadAvailability();let u=this.renderGeneration,d=this.browserContext,f=s.length,p=()=>{f--,f===0&&(this.creationInFlight=!1,this.updateUploadAvailability(),r.dataset.status===`progress`&&r.replaceChildren())};a.setMintStatus(r,`progress`,`Uploading ${s.length} file${s.length===1?``:`s`}`);try{let e=await o.uploadFiles(s,n.uri);for(let r of e)if(r.success)try{let e=this.renderGeneration===u&&this.browserContext===d;await this.showCreatedResource({container:n,containedResource:this.store.sym(r.uploadedUri),newInstance:t&&s.length===1&&e?this.store.sym(r.uploadedUri):void 0})}catch(e){let t=e instanceof Error?e.message:String(e);c.push(`Uploaded ${r.file.name}, but could not refresh the folder: ${t}`)}finally{p()}else{let e=r.error.destinationUri?`Upload failed while putting ${r.error.destinationUri}`:`Upload failed for ${r.file.name}`,t=r.error.status===413?`${e}: storage quota was exceeded. ${r.error.message}`:r.error.status?`${e} (HTTP ${r.error.status}). ${r.error.message}`:`${e}. ${r.error.message}`;c.push(t),p()}}catch(e){let t=e instanceof Error?e.message:String(e);for(c.push(`Unable to upload files: ${t}`);f>0;)p()}c.length&&a.setMintStatus(r,`error`,c.join(`; `))}updated(e){(e.has(`subject`)||e.has(`browserContext`))&&this.subject?(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject,(e.has(`subject`)||e.has(`browserContext`))&&(this.selectedResource=void 0,this.renderGeneration++,this.initialLoadGeneration++),this.refreshCreationPermission(),this.showInitialContainer(this.subject)):(e.has(`selectedResource`)&&this.refreshCreationPermission(),e.has(`fullView`)&&e.get(`fullView`)!==void 0&&(this.subject&&(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject),this.selectedResource?this.showResourceInContentView(this.selectedResource):this.subject&&this.renderContainerView(this.subject)))}getStandaloneBreadcrumbRoot(e){try{let t=new URL(e.uri),n=t.pathname.split(`/`).filter(Boolean);return n.length<=1?e:this.store?.sym(`${t.origin}/${n[0]}/`)??e}catch{return e}}get resourceTarget(){return this.fullView?this.fullViewTarget:this.contentView}showContentError(e,t=!0){t&&this.resourceTarget?.replaceChildren(),this.contentError=e}renderAccessDeniedScreen(){this.showContentError({title:`Access denied`,message:`You do not have access to the contents of this container.`})}async loadResource(e,n=!1){let r=this.store;if(!r)return;let i=r.fetcher;n&&s.clearFailedResource(i,e);try{await i.load(e)}catch(r){if(!n||!t.isAccessDeniedError(r)||!l.authn.currentUser())throw r;await i.load(e,{force:!0,clearPreviousData:!0})}}openCreatedResource(e,t){this.searchQuery=``;let n=t?.name?this.browserContext?.session.paneRegistry.byName(t.name)??t:t;this.showSubject(e,typeof n?.render==`function`?n:void 0,!0)}getActiveContainer(){let e=this.selectedResource,n=e?t.getIndexedContainer(e):void 0;if(n&&this.store)return this.store.sym(n);if(e&&this.resourceLogic&&t.isContainerResource(e,this.resourceLogic))return e;let r=this.fullView?this.standaloneBreadcrumbRoot:this.subject,i=e?.dir(),a=r?.uri.endsWith(`/`)?r.uri:`${r?.uri}/`;return r&&i&&a&&i.uri.startsWith(a)?i:this.subject}refreshCreationPermission(e=!1){let t=this.getActiveContainer(),n=this.browserContext?.session.logic.resource;if(!e&&t&&n&&this.permissionRequest?.containerUri===t.uri&&this.permissionRequest.resourceLogic===n)return;let r=++this.permissionGeneration;this.setCanCreate(!1),this.permissionRequest=t&&n?{containerUri:t.uri,resourceLogic:n}:void 0,t&&n&&n.fetchMetadata(t).then(e=>{r===this.permissionGeneration&&this.getActiveContainer()?.sameTerm(t)===!0&&this.setCanCreate(e.access.canEdit)}).catch(e=>{r===this.permissionGeneration&&(this.permissionRequest=void 0,o.warn(`Unable to determine folder creation permission`,e))})}updateUploadAvailability(){let e=this.resourceTarget?.querySelector(`folder-pane-container`),t=this.getActiveContainer();e&&(e.canUpload=this.canCreate&&!this.creationInFlight&&!!t&&e.subject?.sameTerm(t)===!0,e.uploadBusy=this.creationInFlight)}setCanCreate(e){this.canCreate=e,this.updateUploadAvailability()}clearContentForCreation(){this.resourceTarget?.replaceChildren()}async showCreatedResource({container:e,containedResource:t,newInstance:n,pane:r}){let i=this.store;if(!i)return;let a=this.renderGeneration,o=this.browserContext,s=async e=>{try{return await i.fetcher.load(e,{force:!0,clearPreviousData:!0}),!0}catch(t){return c.log.warn(`Unable to reload `+e.uri+`: `+t),!1}},l=await s(e);if(t.uri.endsWith(`/`)){await s(t);let e=i.each(t,c.ns.ldp(`contains`),void 0,t.doc());for(let t of e)t.termType===`NamedNode`&&i.fetcher.getState(t.value)===`failed`&&i.fetcher.unload(t)}this.sidebar?.refreshResources?.(e);let u=this.resourceTarget?.querySelector(`folder-pane-container`);!l&&u?.addOptimisticResource&&u.addOptimisticResource(t),l&&u?.refresh?.(),n&&this.isConnected&&this.renderGeneration===a&&this.browserContext===o&&this.openCreatedResource(n,r)}renderContainerView(e){let t=this.resourceTarget;if(!t)return;this.contentError=void 0;let n=document.createElement(`folder-pane-container`);n.subject=e,n.resourceLogic=this.resourceLogic??null,n.browserContext=this.browserContext;let r=this.getActiveContainer();n.canUpload=this.canCreate&&!!r&&e.sameTerm(r),n.uploadBusy=this.creationInFlight,n.view=this.containerView,n.searchQuery=this.searchQuery,this.showingContainer=!0,t.replaceChildren(n)}async showInitialContainer(e){let n=++this.initialLoadGeneration;if(t.isJavaScriptFile(e))this.showSubject(e);else if(this.store&&this.resourceLogic){try{await this.loadResource(e)}catch(r){if(n!==this.initialLoadGeneration||!this.subject?.sameTerm(e))return;if(t.isAccessDeniedError(r)){this.resourceTarget&&this.renderAccessDeniedScreen();return}c.log.error(`Unable to load storage container: `+r),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}n===this.initialLoadGeneration&&this.subject?.sameTerm(e)&&(this.sidebar?.refreshResources?.(),this.requestUpdate(),this.selectedResource||this.showSubject(e))}}async renderExplorerInto(e,t,r,i={}){if(!this.browserContext)return;let a=await(0,c.getRelevantPanes)(t,this.browserContext,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(i.isCurrent&&!i.isCurrent())return;let o=r||(0,c.getPreferredPane)(t,this.browserContext,a);if(!o){this.renderExplorerError(t,`No pane is available to display this resource.`);return}let s;try{s=o.render(t,this.browserContext,i.paneOptions||{})}catch(e){c.log.error(`Unable to render selected pane: `+e),this.renderExplorerError(t,`The selected pane could not render this resource.`);return}let l=e.ownerDocument.createElement(`solid-ui-file-explorer-provider`),u=await(0,c.preparePaneMenuItems)({subject:t,context:this.browserContext,panes:a,openPane:(e,t)=>{l.dispatchEvent(new CustomEvent(c.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))}});l.addEventListener(c.FILE_EXPLORER_BACK_EVENT,e=>{if(!(0,c.isExplorerEvent)(e,l))return;e.stopPropagation();let n=this.getActiveContainer()||this.subject||t;this.renderGeneration++,this.selectedResource=n,this.renderContainerView(n)}),l.addEventListener(c.FILE_EXPLORER_OPEN_PANE_EVENT,r=>{if(!(0,c.isExplorerEvent)(r,l))return;r.stopPropagation();let a=r.detail?.paneName,o=a?this.browserContext?.session.paneRegistry.byName(a):void 0;if(o){let r={generation:++this.renderGeneration,subjectUri:t.uri,context:this.browserContext};this.renderExplorerInto(e,t,o,{...i,paneOptions:o.name===`folder`?{folderView:`container`,fullView:!0,solo:!0}:i.paneOptions,isCurrent:()=>n.isCurrentRenderRequest(r,this.renderGeneration,this.selectedResource?.uri,this.browserContext)}).catch(e=>{c.log.error(`Unable to switch selected pane: `+e)})}}),(0,c.composeExplorer)(l,{context:this.browserContext,subjectUri:t.uri,pane:o,relevantPanes:a,header:i.showHeader===!1?void 0:{paneIcon:o.icon,menuItems:u},paneElement:s}),(!i.isCurrent||i.isCurrent())&&(this.contentError=void 0,this.showingContainer=!1,e.replaceChildren(l))}renderExplorerError(e,t){this.showContentError({title:t,message:e.uri})}async showResourceInContentView(e,r,i=!1,a=!1){let o=++this.renderGeneration;try{let s=this.resourceTarget,l=this.browserContext;if(!s||!this.store||!this.resourceLogic||!l)return;let u={generation:o,subjectUri:e.uri,context:this.browserContext},d=e=>n.isCurrentRenderRequest(u,this.renderGeneration,this.selectedResource?.uri,this.browserContext)&&e.uri===u.subjectUri;if(!d(e))return;if(this.subject?.sameTerm(e)&&!r&&!i&&t.isContainerResource(e,this.resourceLogic)){this.renderContainerView(e);return}if(t.isContainerResource(e,this.resourceLogic)&&(r?.name!==`source`||i)){try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load selected container: `+n),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}if(!d(e))return;if(this.sidebar?.refreshResources?.(),r?.name===`folder`){this.renderContainerView(e);return}if(!r&&(i||this.resourceLogic.containerHasIndexDocument(e))){let n=this.store.sym(t.getIndexedApplicationSubject(e));try{await this.loadResource(n.doc(),a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load container index document: `+n)}await this.renderExplorerInto(s,n,r,{isCurrent:()=>d(e),showHeader:!1});return}let n=await(0,c.getRelevantPanes)(e,l,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(!d(e))return;let o=r||(0,c.getPreferredPane)(e,l,n);if(o?.name!==`folder`){await this.renderExplorerInto(s,e,o,{isCurrent:()=>d(e),showHeader:!1});return}this.renderContainerView(e);return}try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.warn(`Unable to load selected resource metadata: `+n)}if(!d(e))return;let f=t.isJavaScriptFile(e)?this.browserContext?.session.paneRegistry.byName(`source`):void 0;if(!r&&t.isJavaScriptFile(e)&&!f){this.renderExplorerError(e,`The Source pane is unavailable to display this JavaScript file.`);return}await this.renderExplorerInto(s,e,r||f,{isCurrent:()=>d(e)})}catch(n){if(c.log.error(`Unable to render selected resource: `+n),o===this.renderGeneration&&this.resourceTarget){if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}this.renderExplorerError(e,`Unable to display the selected resource.`)}}}showSubject(e,n,r=!1){let i=!r&&n?.name!==`sharing`,a=i?t.getIndexedContainer(e):void 0,o=a&&this.store?this.store.sym(a):void 0,s=o??e,c=i&&!o&&!!this.resourceLogic&&t.isContainerResource(e,this.resourceLogic)&&this.resourceLogic.containerHasIndexDocument(e);this.selectedResource=s,this.showResourceInContentView(s,n,!!o||c)}setContainerView(e){this.containerView=e;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.view=e)}get sidebarAvailableWidth(){let e=this.renderRoot.querySelector(`.folder-pane-main-content`),t=this.renderRoot.querySelector(`.folder-pane-sidebar-resizer`);return(e?.clientWidth??0)-(t?.getBoundingClientRect().width??0)}resizeSidebar(e){this.sidebarWidth=I(e,this.sidebarAvailableWidth)}finishSidebarResize(){let e=this.sidebarDrag;e&&(this.sidebarDrag=void 0,e.separator.hasPointerCapture(e.pointerId)&&e.separator.releasePointerCapture(e.pointerId),this.isConnected&&this.requestUpdate())}render(){return this.fullView?u.html`
2
2
  <folder-pane-provider
3
3
  .rootResource=${this.subject}
4
4
  .displayedResource=${this.displayedResource}
@@ -1 +1 @@
1
- {"version":3,"file":"FolderPaneView.cjs.js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getPreferredPane","getRelevantPanes","isExplorerEvent","log","ns","preparePaneMenuItems","showDialog","WebComponent","authn","authSession","resourceAccessCache","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","debug","clearFailedResource","DEFAULT_SIDEBAR_WIDTH","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","MIN_CONTENT_WIDTH","SIDEBAR_RESIZE_STEP","NARROW_PANE_BREAKPOINT","clampSidebarWidth","requestedWidth","availableWidth","Number","isFinite","availableSidebarWidth","Math","min","max","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_selectedResourceDecs","_standaloneBreadcrumbRootDecs","_containerViewDecs","_searchQueryDecs","_sidebarCollapsedDecs","_sidebarWidthDecs","_sidebarMaximumWidthDecs","_contentErrorDecs","_showingContainerDecs","_canCreateDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_selectedResource","_init_standaloneBreadcrumbRoot","_init_containerView","_init_searchQuery","_init_sidebarCollapsed","_init_sidebarWidth","_init_sidebarMaximumWidth","_init_contentError","_init_showingContainer","_init_canCreate","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","clear","refreshCreationPermission","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","updateUploadAvailability","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","Error","message","String","input","createElement","multiple","addEventListener","uploadFiles","Array","from","files","click","resource","parent","dir","activeContainer","sidebar","refreshResources","containerView","resourceTarget","querySelector","refresh","selectedResource","subject","renderContainerView","contentError","retry","clearContentError","showResourceInContentView","store","fetcher","showInitialContainer","searchQuery","showSubject","session","paneRegistry","byName","render","home","standaloneBreadcrumbRoot","view","setContainerView","isConnected","sidebarMaximumWidth","sidebarAvailableWidth","resizeSidebar","sidebarWidth","sidebarCollapsed","sidebarDrag","button","isPrimary","preventDefault","separator","currentTarget","setPointerCapture","pointerId","focus","startX","clientX","startWidth","drag","finishSidebarResize","altKey","ctrlKey","metaKey","width","key","resizer","renderRoot","focusWasInSidebar","matches","shadowRoot","activeElement","focusWasOnResizer","updateComplete","title","showContentError","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","displayedResource","fullView","showingContainer","canCreate","contentView","fullViewTarget","createRenderRoot","connectedCallback","shell","sidebarResizeObserver","observe","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","handleDroppedFiles","handleUploadRejected","handleResourceOpenPane","handleResourceDeleted","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","disconnect","initialLoadGeneration","removeEventListener","off","firstUpdated","updateSidebarBounds","ResizeObserver","entries","contentRect","responsiveLayoutInitialized","handleSidebarToggle","Event","openUploadedResource","length","validFiles","filter","file","invalidFiles","errors","map","join","uploadGeneration","uploadContext","remaining","finish","dataset","status","replaceChildren","results","uri","result","success","prefix","destinationUri","push","canNavigateToUpload","containedResource","sym","uploadedUri","updated","changedProperties","has","getStandaloneBreadcrumbRoot","get","url","URL","pathSegments","pathname","split","origin","clearContent","renderAccessDeniedScreen","loadResource","retryFailed","load","force","clearPreviousData","openCreatedResource","currentPane","selected","indexedContainerUri","root","rootUri","endsWith","startsWith","permissionRequest","containerUri","permissionGeneration","setCanCreate","fetchMetadata","then","metadata","access","canEdit","catch","warn","canUpload","uploadBusy","navigationGeneration","navigationContext","reload","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","addOptimisticResource","target","document","generation","renderExplorerInto","options","relevantPanes","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","panes","openPane","paneSubject","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","parentContainer","nextPane","request","folderView","solo","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","candidate","containerHasIndexDocument","applicationSubject","sourcePane","preserveSubject","useIndexedApplication","indexedContainer","divider","clientWidth","getBoundingClientRect","hasPointerCapture","releasePointerCapture","renderStorageHeader","renderContentError","handleResourceSelected","handleFolderPaneResourceError","handleSidebarPointerDown","handleSidebarPointerMove","handleSidebarPointerEnd","handleSidebarResizeKey","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","require_accessCache","require_helpers","require_renderRequest","require_FolderPaneCreateDialog","require_creationSafety","require_mintPaneInstance","require_debug","require_resourceLoad","solid_ui","solid_logic","lit","lit_decorators_js","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_selectedResourceDecs","_init_selectedResource","_standaloneBreadcrumbRootDecs","_init_standaloneBreadcrumbRoot","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_sidebarCollapsedDecs","_init_sidebarCollapsed","_sidebarWidthDecs","_init_sidebarWidth","_sidebarMaximumWidthDecs","_init_sidebarMaximumWidth","_contentErrorDecs","_init_contentError","_showingContainerDecs","_init_showingContainer","_canCreateDecs","_init_canCreate","_contentViewDecs","_init_contentView","_fullViewTargetDecs","_init_fullViewTarget","_sidebarDecs","_init_sidebar","_statusAreaDecs","_init_statusArea","_ref","_defineProperty","_toPropertyKey","r","t","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","clampSidebarWidth","availableWidth","availableSidebarWidth","requestedWidth","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","args","event","pane","container","dom","statusArea","operationGeneration","paneName","name","resolve","created","stillOwnsNavigation","error$1","input","files","message","resource","parent","activeContainer","containerView","retry","selectedResource","subject","home","view","separator","drag","width","sidebar","resizer","focusWasInSidebar","focusWasOnResizer","title","shell","entries","resourceLogic","validFiles","file","errors","uploadGeneration","uploadContext","remaining","finish","results","result","canNavigateToUpload","openUploadedResource","error","prefix","changedProperties","url","pathSegments","clearContent","store","fetcher","retryFailed","currentPane","selected","indexedContainerUri","root","rootUri","force","permissionGeneration","metadata","canCreate","navigationGeneration","navigationContext","reload","confirmed","containedResource","members","member","newInstance","target","generation","relevantPanes","options","selectedPane","paneElement","provider","menuItems","paneSubject","parentContainer","nextPane","request","renderGeneration","browserContext","isCurrentSelection","candidate","indexRequested","applicationSubject","sourcePane","useIndexedApplication","preserveSubject","indexedContainer","divider"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getPreferredPane, getRelevantPanes, isExplorerEvent, log, ns, preparePaneMenuItems, showDialog, WebComponent } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\nimport { resourceAccessCache } from '../../accessCache'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport type { PropertyValues } from 'lit'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport '../folder-pane-container'\nimport '../folder-pane-sidebar'\nimport '../folder-pane-content'\nimport '../folder-pane-storage-header'\nimport type { NamedNode } from 'rdflib'\nimport 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/button'\nimport type FileExplorerProvider from 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/error-state'\nimport 'solid-ui/components/file-explorer-header'\nimport type FolderPaneContainer from '../folder-pane-container/FolderPaneContainer'\nimport '~icons/lucide/chevron-left'\nimport { getIndexedApplicationSubject, getIndexedContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile, type FolderPaneResourceLogic } from '../../helpers'\nimport { invalidateRenderRequest, isCurrentRenderRequest, type RenderRequest } from './renderRequest'\nimport FolderPaneCreateDialog from '../folder-pane-storage-header/FolderPaneCreateDialog'\nimport { getPaneLabel } from '../../helpers'\nimport { isSafeCreationName, invalidCreationNameMessage } from '../../creationSafety'\nimport { mintPaneInstance, PaneMintError, setMintStatus } from '../../mintPaneInstance'\nimport * as debug from '../../debug'\nimport { clearFailedResource } from './resourceLoad'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (multi-file uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\n}\n\ntype ContentError = {\n title: string\n message: string\n retry?: () => void\n}\n\nexport const DEFAULT_SIDEBAR_WIDTH = 256\nexport const MIN_SIDEBAR_WIDTH = 180\nexport const MAX_SIDEBAR_WIDTH = 480\nexport const MIN_CONTENT_WIDTH = 320\nexport const SIDEBAR_RESIZE_STEP = 16\nexport const NARROW_PANE_BREAKPOINT = 768\n\nexport function clampSidebarWidth (requestedWidth: number, availableWidth: number): number {\n if (!Number.isFinite(availableWidth) || availableWidth <= MIN_CONTENT_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const availableSidebarWidth = availableWidth - MIN_CONTENT_WIDTH\n if (availableSidebarWidth < MIN_SIDEBAR_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const requested = Number.isFinite(requestedWidth) ? requestedWidth : DEFAULT_SIDEBAR_WIDTH\n return Math.min(MAX_SIDEBAR_WIDTH, availableSidebarWidth, Math.max(MIN_SIDEBAR_WIDTH, requested))\n}\n\n@customElement('folder-pane-view')\nexport default class FolderPaneView extends WebComponent {\n @property({ attribute: false })\n accessor browserContext: DataBrowserContext | undefined = undefined\n\n private get store () {\n return this.browserContext?.session.store\n }\n\n @property({ attribute: false })\n accessor subject: NamedNode | undefined = undefined\n\n private get resourceLogic (): FolderPaneResourceLogic | undefined {\n return this.browserContext?.session.logic.resource as FolderPaneResourceLogic | undefined\n }\n\n private get displayedResource (): NamedNode | undefined {\n return this.selectedResource ?? this.subject\n }\n\n @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n private accessor standaloneBreadcrumbRoot: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor sidebarCollapsed = false\n\n @state()\n private accessor sidebarWidth = DEFAULT_SIDEBAR_WIDTH\n\n @state()\n private accessor sidebarMaximumWidth = MAX_SIDEBAR_WIDTH\n\n @state()\n private accessor contentError: ContentError | undefined = undefined\n\n @state()\n private accessor showingContainer = false\n\n @state()\n private accessor canCreate = false\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private permissionGeneration = 0\n private permissionRequest: { containerUri: string, resourceLogic: unknown } | undefined\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\n private sidebarResizeObserver: ResizeObserver | undefined\n private responsiveLayoutInitialized = false\n private sidebarDrag: {\n separator: HTMLElement\n pointerId: number\n startX: number\n startWidth: number\n } | undefined\n\n @query('folder-pane-content')\n private accessor contentView: HTMLElement | null = null\n\n @query('.folder-pane-full-view')\n private accessor fullViewTarget: HTMLElement | null = null\n\n @query('folder-pane-sidebar')\n private accessor sidebar: (HTMLElement & { refreshResources?: (container?: NamedNode) => void }) | null = null\n\n /** Below-content area for pane creation progress, errors and setup UI. */\n @query('.folder-pane-status')\n accessor statusArea: HTMLElement | null = null\n\n protected createRenderRoot () {\n return this\n }\n\n connectedCallback () {\n super.connectedCallback()\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver?.observe(shell)\n if (!this.dropProtectionAttached) {\n aclControl.preventBrowserDropEvents(this.ownerDocument)\n this.dropProtectionAttached = true\n }\n this.addEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.addEventListener('folder-pane-upload', this.handleUpload)\n this.addEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.addEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.addEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.addEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (!this.authListenersAttached) {\n authSession.events.on('login', this.handleAuthChange)\n authSession.events.on('logout', this.handleAuthChange)\n this.authListenersAttached = true\n }\n }\n\n disconnectedCallback () {\n this.finishSidebarResize()\n this.sidebarResizeObserver?.disconnect()\n // Invalidate awaited renders before detaching listeners. A late response\n // must never replace content in a detached view.\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n this.initialLoadGeneration++\n this.removeEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.removeEventListener('folder-pane-upload', this.handleUpload)\n this.removeEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.removeEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.removeEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.removeEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (this.authListenersAttached) {\n authSession.events.off('login', this.handleAuthChange)\n authSession.events.off('logout', this.handleAuthChange)\n this.authListenersAttached = false\n }\n super.disconnectedCallback()\n }\n\n protected firstUpdated () {\n this.updateSidebarBounds()\n if (typeof ResizeObserver !== 'undefined') {\n this.sidebarResizeObserver = new ResizeObserver(entries => {\n this.updateSidebarBounds()\n const width = entries[0]?.contentRect.width ?? 0\n if (this.responsiveLayoutInitialized || width <= 0) return\n this.responsiveLayoutInitialized = true\n if (width < NARROW_PANE_BREAKPOINT) {\n void this.handleSidebarToggle(new Event('folder-pane-responsive-collapse'))\n }\n })\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver.observe(shell)\n this.sidebarResizeObserver.observe(this)\n }\n }\n\n private handleAuthChange = () => {\n resourceAccessCache.clear()\n this.refreshCreationPermission(true)\n this.requestUpdate()\n }\n\n private handleCreatePane = async (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const pane = (event as CustomEvent<{ pane?: PaneDefinition }>).detail?.pane\n if (!pane?.mintNew) return\n const container = this.getActiveContainer()\n const dom = this.ownerDocument\n const statusArea = this.statusArea\n if (!container || !statusArea) return\n this.creationInFlight = true\n this.updateUploadAvailability()\n const operationGeneration = ++this.renderGeneration\n const paneName = getPaneLabel(pane)\n try {\n const name = await new Promise<string | undefined>(resolve => {\n showDialog(FolderPaneCreateDialog, {\n props: { label: paneName },\n onClose: resolve\n })\n })\n if (!name || !authn.currentUser()) return\n if (operationGeneration !== this.renderGeneration ||\n this.getActiveContainer()?.sameTerm(container) !== true) return\n if (!isSafeCreationName(name)) {\n setMintStatus(statusArea, 'error', invalidCreationNameMessage)\n return\n }\n this.clearContentForCreation()\n const created = await mintPaneInstance({\n context: this.browserContext!,\n container,\n pane,\n name,\n noun: paneName,\n statusArea,\n me: authn.currentUser() ?? undefined,\n dom\n })\n const stillOwnsNavigation = operationGeneration === this.renderGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n await this.showCreatedResource({\n container,\n ...created,\n pane,\n newInstance: stillOwnsNavigation ? created.newInstance : undefined\n })\n } catch (error) {\n debug.error('Unable to create folder-pane resource', error)\n if (!(error instanceof PaneMintError) && this.statusArea) {\n setMintStatus(this.statusArea, 'error', `Unable to create ${paneName}: ${error instanceof Error ? error.message : String(error)}`)\n }\n } finally {\n this.creationInFlight = false\n this.updateUploadAvailability()\n }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n void this.uploadFiles(Array.from(input.files ?? []), true)\n })\n input.click()\n }\n\n private handleDroppedFiles = (event: Event) => {\n event.stopPropagation()\n const files = (event as CustomEvent<{ files: File[] }>).detail?.files ?? []\n void this.uploadFiles(files, false)\n }\n\n private handleUploadRejected = (event: Event) => {\n event.stopPropagation()\n const message = (event as CustomEvent<{ message?: string }>).detail?.message\n if (message && this.statusArea) setMintStatus(this.statusArea, 'error', message)\n }\n\n private handleResourceDeleted = (event: Event) => {\n const resource = (event as CustomEvent<{ resource?: NamedNode }>).detail?.resource\n if (!resource) return\n\n const parent = resource.dir()\n const activeContainer = this.getActiveContainer()\n if (parent) {\n this.sidebar?.refreshResources?.(parent)\n }\n\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void }) | null\n if (parent && activeContainer?.sameTerm(parent)) {\n void containerView?.refresh?.()\n }\n\n if (!this.selectedResource?.sameTerm(resource)) return\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n const container = parent ?? this.subject\n if (container) {\n this.selectedResource = container\n this.renderContainerView(container)\n } else {\n this.selectedResource = undefined\n }\n }\n\n private async uploadFiles (files: File[], openUploadedResource: boolean) {\n if (this.creationInFlight || !authn.currentUser() || !this.canCreate) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n const resourceLogic = this.resourceLogic\n if (!files.length || !container || !statusArea || !this.store || !resourceLogic) return\n\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n const errors = invalidFiles.map(file => `${file.name}: ${invalidCreationNameMessage}`)\n if (!validFiles.length) {\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n return\n }\n\n this.creationInFlight = true\n this.updateUploadAvailability()\n const uploadGeneration = this.renderGeneration\n const uploadContext = this.browserContext\n let remaining = validFiles.length\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n this.updateUploadAvailability()\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n try {\n const results = await resourceLogic.uploadFiles(validFiles, container.uri)\n for (const result of results) {\n if (!result.success) {\n const prefix = result.error.destinationUri\n ? `Upload failed while putting ${result.error.destinationUri}`\n : `Upload failed for ${result.file.name}`\n const message = result.error.status === 413\n ? `${prefix}: storage quota was exceeded. ${result.error.message}`\n : result.error.status\n ? `${prefix} (HTTP ${result.error.status}). ${result.error.message}`\n : `${prefix}. ${result.error.message}`\n errors.push(message)\n finish()\n continue\n }\n\n try {\n const canNavigateToUpload = this.renderGeneration === uploadGeneration &&\n this.browserContext === uploadContext\n await this.showCreatedResource({\n container,\n containedResource: this.store.sym(result.uploadedUri),\n newInstance: openUploadedResource && validFiles.length === 1 && canNavigateToUpload\n ? this.store.sym(result.uploadedUri)\n : undefined\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Uploaded ${result.file.name}, but could not refresh the folder: ${message}`)\n } finally {\n finish()\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Unable to upload files: ${message}`)\n while (remaining > 0) finish()\n }\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n this.refreshCreationPermission()\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('selectedResource')) {\n this.refreshCreationPermission()\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\n if (this.subject) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n }\n if (this.selectedResource) {\n void this.showResourceInContentView(this.selectedResource)\n } else if (this.subject) {\n this.renderContainerView(this.subject)\n }\n }\n }\n\n private getStandaloneBreadcrumbRoot (subject: NamedNode): NamedNode {\n try {\n const url = new URL(subject.uri)\n const pathSegments = url.pathname.split('/').filter(Boolean)\n if (pathSegments.length <= 1) return subject\n return this.store?.sym(`${url.origin}/${pathSegments[0]}/`) ?? subject\n } catch {\n return subject\n }\n }\n\n // Lit never renders inside these targets; panes, explorers and containers\n // are inserted imperatively, and Lit-rendered errors sit beside them.\n private get resourceTarget () {\n return this.fullView ? this.fullViewTarget : this.contentView\n }\n\n private showContentError (error: ContentError, clearContent = true) {\n if (clearContent) this.resourceTarget?.replaceChildren()\n this.contentError = error\n }\n\n private renderAccessDeniedScreen () {\n this.showContentError({\n title: 'Access denied',\n message: 'You do not have access to the contents of this container.'\n })\n }\n\n private async loadResource (resource: NamedNode, retryFailed = false): Promise<void> {\n const store = this.store\n if (!store) return\n const fetcher = store.fetcher\n // A failed request can be cached by rdflib. Do not clear it during normal\n // navigation: persistent failures such as CORS errors should settle once\n // instead of causing a new request on every render. An explicit retry is\n // the point at which the cached failure should be discarded.\n if (retryFailed) clearFailedResource(fetcher, resource)\n try {\n await fetcher.load(resource)\n } catch (error) {\n if (!retryFailed || !isAccessDeniedError(error) || !authn.currentUser()) throw error\n await fetcher.load(resource, { force: true, clearPreviousData: true })\n }\n }\n\n private clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\n const retry = this.contentError?.retry\n if (retry) {\n this.clearContentError()\n retry()\n return\n }\n\n const selectedResource = this.selectedResource\n const subject = this.subject\n if (!selectedResource && !subject) return\n this.clearContentError()\n if (selectedResource) {\n void this.showResourceInContentView(selectedResource, undefined, false, true)\n } else if (subject) {\n if (this.store) clearFailedResource(this.store.fetcher, subject)\n void this.showInitialContainer(subject)\n }\n }\n\n /**\n * Select the resource returned by a pane's mintNew implementation. Some\n * panes (notably long chat) mint a resource inside the new document rather\n * than the container URI itself, so routing this through the normal\n * selection path is important.\n */\n openCreatedResource (resource: NamedNode, pane?: PaneDefinition) {\n this.searchQuery = ''\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n // Resolve the pane again from the registry. Creation menu entries can be\n // replaced while the async mint is running; retaining that stale object\n // lets a different relevant pane (notably profile for pad indexes) win.\n const currentPane = pane?.name\n ? this.browserContext?.session.paneRegistry.byName(pane.name) ?? pane\n : pane\n this.showSubject(resource, typeof currentPane?.render === 'function' ? currentPane : undefined)\n }\n\n /**\n * The storage header belongs to the explorer, while its actions apply to\n * the container currently being viewed. A document selection has no\n * writable container of its own, so use its parent when it remains within\n * the explorer root; otherwise retain the last browsed container.\n */\n getActiveContainer (): NamedNode | undefined {\n const selected = this.selectedResource\n const indexedContainerUri = selected ? getIndexedContainer(selected) : undefined\n if (indexedContainerUri && this.store) {\n return this.store.sym(indexedContainerUri)\n }\n if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = this.fullView ? this.standaloneBreadcrumbRoot : this.subject\n const parent = selected?.dir()\n const rootUri = root?.uri.endsWith('/') ? root.uri : `${root?.uri}/`\n if (root && parent && rootUri && parent.uri.startsWith(rootUri)) {\n return parent\n }\n\n return this.subject\n }\n\n private refreshCreationPermission (force = false) {\n const container = this.getActiveContainer()\n const resourceLogic = this.browserContext?.session.logic.resource\n if (\n !force &&\n container &&\n resourceLogic &&\n this.permissionRequest?.containerUri === container.uri &&\n this.permissionRequest.resourceLogic === resourceLogic\n ) return\n\n const permissionGeneration = ++this.permissionGeneration\n this.setCanCreate(false)\n this.permissionRequest = container && resourceLogic\n ? { containerUri: container.uri, resourceLogic }\n : undefined\n if (!container || !resourceLogic) return\n\n void resourceLogic.fetchMetadata(container)\n .then(metadata => {\n if (\n permissionGeneration === this.permissionGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n ) {\n this.setCanCreate(metadata.access.canEdit)\n }\n })\n .catch(error => {\n if (permissionGeneration === this.permissionGeneration) {\n this.permissionRequest = undefined\n debug.warn('Unable to determine folder creation permission', error)\n }\n })\n }\n\n private updateUploadAvailability () {\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (FolderPaneContainer & { subject?: NamedNode, uploadBusy?: boolean }) | null\n const activeContainer = this.getActiveContainer()\n if (!containerView) return\n containerView.canUpload = this.canCreate &&\n !this.creationInFlight &&\n !!activeContainer &&\n containerView.subject?.sameTerm(activeContainer) === true\n containerView.uploadBusy = this.creationInFlight\n }\n\n private setCanCreate (canCreate: boolean) {\n this.canCreate = canCreate\n this.updateUploadAvailability()\n }\n\n clearContentForCreation () {\n this.resourceTarget?.replaceChildren()\n }\n\n /**\n * Reload the server-backed container listing after a pane minted a new\n * resource, refresh the sidebar and container view, then open the result.\n */\n async showCreatedResource ({ container, containedResource, newInstance, pane }: CreatedResource) {\n const store = this.store\n if (!store) return\n const navigationGeneration = this.renderGeneration\n const navigationContext = this.browserContext\n const reload = async (resource: NamedNode): Promise<boolean> => {\n try {\n await store.fetcher.load(resource, { force: true, clearPreviousData: true })\n return true\n } catch (error) {\n log.warn('Unable to reload ' + resource.uri + ': ' + error)\n return false\n }\n }\n\n const confirmed = await reload(container)\n if (containedResource.uri.endsWith('/')) {\n await reload(containedResource)\n // Panes may probe their new documents before writing them; forget those\n // cached 404s so rendering loads what the pane actually created.\n const members = store.each(containedResource, ns.ldp('contains'), undefined, containedResource.doc())\n for (const member of members) {\n if (member.termType === 'NamedNode' && store.fetcher.getState(member.value) === 'failed') {\n store.fetcher.unload(member as NamedNode)\n }\n }\n }\n\n this.sidebar?.refreshResources?.(container)\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void, addOptimisticResource?: (resource: NamedNode) => void }) | null\n if (!confirmed && containerView?.addOptimisticResource) {\n containerView.addOptimisticResource(containedResource)\n }\n if (confirmed) {\n containerView?.refresh?.()\n }\n if (\n newInstance &&\n this.isConnected &&\n this.renderGeneration === navigationGeneration &&\n this.browserContext === navigationContext\n ) {\n this.openCreatedResource(newInstance, pane)\n }\n }\n\n private renderContainerView (selectedResource: NamedNode) {\n const target = this.resourceTarget\n if (!target) return\n\n this.contentError = undefined\n const containerView = document.createElement('folder-pane-container') as FolderPaneContainer\n\n containerView.subject = selectedResource\n containerView.resourceLogic = this.resourceLogic ?? null\n containerView.browserContext = this.browserContext\n const activeContainer = this.getActiveContainer()\n containerView.canUpload = this.canCreate &&\n !!activeContainer &&\n selectedResource.sameTerm(activeContainer)\n containerView.uploadBusy = this.creationInFlight\n containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n\n this.showingContainer = true\n target.replaceChildren(containerView)\n }\n\n private async showInitialContainer (subject: NamedNode) {\n const generation = ++this.initialLoadGeneration\n\n if (isJavaScriptFile(subject)) {\n this.showSubject(subject)\n return\n }\n\n if (!this.store || !this.resourceLogic) return\n\n try {\n await this.loadResource(subject)\n } catch (error) {\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n if (isAccessDeniedError(error)) {\n const target = this.resourceTarget\n if (target) this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load storage container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n this.sidebar?.refreshResources?.()\n this.requestUpdate()\n if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private async renderExplorerInto (\n target: HTMLElement,\n subject: NamedNode,\n pane: PaneDefinition | undefined,\n options: ExplorerRenderOptions = {}\n ) {\n if (!this.browserContext) return\n\n const relevantPanes = await getRelevantPanes(subject, this.browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (options.isCurrent && !options.isCurrent()) return\n const selectedPane = pane || getPreferredPane(subject, this.browserContext, relevantPanes)\n if (!selectedPane) {\n this.renderExplorerError(subject, 'No pane is available to display this resource.')\n return\n }\n\n let paneElement: HTMLElement\n try {\n paneElement = selectedPane.render(subject, this.browserContext, options.paneOptions || {})\n } catch (error) {\n log.error('Unable to render selected pane: ' + error)\n this.renderExplorerError(subject, 'The selected pane could not render this resource.')\n return\n }\n\n const provider = target.ownerDocument.createElement('solid-ui-file-explorer-provider') as FileExplorerProvider\n const menuItems = await preparePaneMenuItems({\n subject,\n context: this.browserContext,\n panes: relevantPanes,\n openPane: (paneSubject, paneName) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: paneSubject.uri, paneName }\n }))\n }\n })\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n // Return to the container that owns the displayed resource. Using the\n // explorer root here loses the user's position for resources in nested\n // containers.\n const parentContainer = this.getActiveContainer() || this.subject || subject\n this.renderGeneration++\n this.selectedResource = parentContainer\n this.renderContainerView(parentContainer)\n })\n provider.addEventListener(FILE_EXPLORER_OPEN_PANE_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n const paneName = (event as CustomEvent<{ paneName: string }>).detail?.paneName\n const nextPane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (nextPane) {\n const request: RenderRequest = {\n generation: ++this.renderGeneration,\n subjectUri: subject.uri,\n context: this.browserContext\n }\n this.renderExplorerInto(target, subject, nextPane, {\n ...options,\n paneOptions: nextPane.name === 'folder'\n ? { folderView: 'container', fullView: true, solo: true }\n : options.paneOptions,\n isCurrent: () => isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n )\n }).catch(error => {\n log.error('Unable to switch selected pane: ' + error)\n })\n }\n })\n\n composeExplorer(provider, {\n context: this.browserContext,\n subjectUri: subject.uri,\n pane: selectedPane,\n relevantPanes,\n header: options.showHeader === false\n ? undefined\n : { paneIcon: selectedPane.icon, menuItems },\n paneElement\n })\n if (options.isCurrent && !options.isCurrent()) return\n this.contentError = undefined\n this.showingContainer = false\n target.replaceChildren(provider)\n }\n\n private renderExplorerError (subject: NamedNode, message: string) {\n this.showContentError({ title: message, message: subject.uri })\n }\n\n private async showResourceInContentView (\n selectedResource: NamedNode,\n pane?: PaneDefinition,\n indexRequested = false,\n retryFailed = false\n ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n const browserContext = this.browserContext\n if (!target || !this.store || !this.resourceLogic || !browserContext) return\n\n const request: RenderRequest = {\n generation: renderGeneration,\n subjectUri: selectedResource.uri,\n context: this.browserContext\n }\n const isCurrentSelection = (candidate: NamedNode) =>\n isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n ) && candidate.uri === request.subjectUri\n\n if (!isCurrentSelection(selectedResource)) return\n\n if (\n this.subject?.sameTerm(selectedResource) &&\n !pane &&\n !indexRequested &&\n isContainerResource(selectedResource, this.resourceLogic)\n ) {\n this.renderContainerView(selectedResource)\n return\n }\n\n // A pane supplied by an explicit creation or pane-selection action is\n // authoritative. In particular, freshly created text resources can\n // briefly inherit container metadata while the store is refreshed.\n // Some servers report file resources as containers. Keep known file\n // types out of the folder branch so pane selection can run normally.\n if (\n isContainerResource(selectedResource, this.resourceLogic) &&\n (pane?.name !== 'source' || indexRequested)\n ) {\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load selected container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (!isCurrentSelection(selectedResource)) return\n this.sidebar?.refreshResources?.()\n\n if (pane?.name === 'folder') {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (\n !pane &&\n (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource))\n ) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource)\n )\n try {\n await this.loadResource(applicationSubject.doc(), retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load container index document: ' + error)\n }\n await this.renderExplorerInto(target, applicationSubject, pane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n const relevantPanes = await getRelevantPanes(selectedResource, browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (!isCurrentSelection(selectedResource)) return\n\n const selectedPane = pane || getPreferredPane(selectedResource, browserContext, relevantPanes)\n if (selectedPane?.name !== 'folder') {\n await this.renderExplorerInto(target, selectedResource, selectedPane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.warn('Unable to load selected resource metadata: ' + error)\n }\n\n if (!isCurrentSelection(selectedResource)) return\n const sourcePane = isJavaScriptFile(selectedResource)\n ? this.browserContext?.session.paneRegistry.byName('source')\n : undefined\n if (!pane && isJavaScriptFile(selectedResource) && !sourcePane) {\n this.renderExplorerError(selectedResource, 'The Source pane is unavailable to display this JavaScript file.')\n return\n }\n await this.renderExplorerInto(target, selectedResource, pane || sourcePane, {\n isCurrent: () => isCurrentSelection(selectedResource)\n })\n } catch (error) {\n log.error('Unable to render selected resource: ' + error)\n if (renderGeneration === this.renderGeneration && this.resourceTarget) {\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n this.renderExplorerError(selectedResource, 'Unable to display the selected resource.')\n }\n }\n }\n\n private showSubject (resource: NamedNode, pane?: PaneDefinition, preserveSubject = false) {\n // `container/index.ttl#this` is rendered exactly like selecting its container,\n // so indexed panes never show the file-explorer header on either route.\n const useIndexedApplication = !preserveSubject && pane?.name !== 'sharing'\n const indexedContainerUri = useIndexedApplication ? getIndexedContainer(resource) : undefined\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = useIndexedApplication && !indexedContainer &&\n !!this.resourceLogic &&\n isContainerResource(resource, this.resourceLogic) &&\n this.resourceLogic.containerHasIndexDocument(resource)\n this.selectedResource = subject\n // Render directly so re-selecting the same resource still replaces the content target.\n void this.showResourceInContentView(subject, pane, !!indexedContainer || indexRequested)\n }\n\n private handleResourceSelected = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.searchQuery = ''\n this.showSubject(resource)\n }\n\n private handleResourceOpenPane = (event: CustomEvent<{ resource: NamedNode, paneName: string }>) => {\n const resource = event.detail?.resource\n const paneName = event.detail?.paneName\n const pane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (!resource || !pane) return\n event.stopPropagation()\n this.searchQuery = ''\n if (pane.name === 'folder') {\n this.showSubject(resource, pane, true)\n return\n }\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n this.showSubject(resource, typeof pane?.render === 'function' ? pane : undefined, true)\n }\n\n private setContainerView (view: 'grid' | 'list') {\n this.containerView = view\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.view = view\n }\n\n private handleSelectHome = () => {\n this.searchQuery = ''\n const home = this.subject && this.standaloneBreadcrumbRoot?.sameTerm(this.subject)\n ? this.subject\n : this.standaloneBreadcrumbRoot\n if (home) this.showSubject(home)\n }\n\n private handleSearch = (event: CustomEvent<{ query: string }>) => {\n event.stopPropagation()\n this.searchQuery = event.detail?.query || ''\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.searchQuery = this.searchQuery\n }\n\n private handleSelectBreadcrumbResource = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.showSubject(resource)\n }\n\n private handleContainerViewChange = (event: CustomEvent<{ view: 'grid' | 'list' }>) => {\n const view = event.detail?.view\n if (!view) return\n event.stopPropagation()\n this.setContainerView(view)\n }\n\n private get sidebarAvailableWidth () {\n const shell = this.renderRoot.querySelector<HTMLElement>('.folder-pane-main-content')\n const divider = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resizer')\n return (shell?.clientWidth ?? 0) - (divider?.getBoundingClientRect().width ?? 0)\n }\n\n private resizeSidebar (width: number) {\n this.sidebarWidth = clampSidebarWidth(width, this.sidebarAvailableWidth)\n }\n\n private updateSidebarBounds = () => {\n if (!this.isConnected) return\n this.sidebarMaximumWidth = clampSidebarWidth(MAX_SIDEBAR_WIDTH, this.sidebarAvailableWidth)\n this.resizeSidebar(this.sidebarWidth)\n }\n\n private handleSidebarPointerDown = (event: PointerEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.button !== 0 || !event.isPrimary) return\n event.preventDefault()\n const separator = event.currentTarget as HTMLElement\n separator.setPointerCapture(event.pointerId)\n separator.focus()\n this.sidebarDrag = {\n separator,\n pointerId: event.pointerId,\n startX: event.clientX,\n startWidth: this.sidebarWidth\n }\n this.requestUpdate()\n }\n\n private handleSidebarPointerMove = (event: PointerEvent) => {\n const drag = this.sidebarDrag\n if (!this.isConnected || this.sidebarCollapsed || !drag || drag.pointerId !== event.pointerId) return\n this.resizeSidebar(drag.startWidth + event.clientX - drag.startX)\n }\n\n private finishSidebarResize () {\n const drag = this.sidebarDrag\n if (!drag) return\n this.sidebarDrag = undefined\n if (drag.separator.hasPointerCapture(drag.pointerId)) {\n drag.separator.releasePointerCapture(drag.pointerId)\n }\n if (this.isConnected) this.requestUpdate()\n }\n\n private handleSidebarPointerEnd = (event: PointerEvent) => {\n if (this.sidebarDrag?.pointerId === event.pointerId) this.finishSidebarResize()\n }\n\n private handleSidebarResizeKey = (event: KeyboardEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.altKey || event.ctrlKey || event.metaKey) return\n let width: number\n switch (event.key) {\n case 'ArrowLeft': width = this.sidebarWidth - SIDEBAR_RESIZE_STEP; break\n case 'ArrowRight': width = this.sidebarWidth + SIDEBAR_RESIZE_STEP; break\n case 'Home': width = MIN_SIDEBAR_WIDTH; break\n case 'End': width = MAX_SIDEBAR_WIDTH; break\n default: return\n }\n event.preventDefault()\n event.stopPropagation()\n this.resizeSidebar(width)\n }\n\n private handleSidebarToggle = async (event: Event) => {\n event.stopPropagation()\n const sidebar = this.sidebar\n const resizer = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resize-handle')\n const focusWasInSidebar = !!sidebar && (\n sidebar.matches(':focus-within') ||\n sidebar.shadowRoot?.activeElement != null\n )\n const focusWasOnResizer = resizer === this.ownerDocument.activeElement\n this.finishSidebarResize()\n this.sidebarCollapsed = !this.sidebarCollapsed\n if (!this.sidebarCollapsed || (!focusWasInSidebar && !focusWasOnResizer)) return\n await this.updateComplete\n this.renderRoot.querySelector<HTMLButtonElement>('.folder-pane-sidebar-toggle')?.focus()\n }\n\n private handleFolderPaneResourceError = (event: CustomEvent<{\n title?: string\n message?: string\n retry?: () => void\n }>) => {\n event.stopPropagation()\n const title = event.detail?.title || 'Unable to load this folder'\n const message = event.detail?.message || 'The folder could not be loaded. Try again.'\n this.showContentError({\n title,\n message,\n retry: event.detail?.retry\n }, false)\n }\n\n render () {\n if (this.fullView) {\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n >\n ${this.showingContainer ? this.renderStorageHeader() : nothing}\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n ></div>\n <div class=\"folder-pane-status\"></div>\n </folder-pane-provider>\n `\n }\n\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n .sidebarCollapsed=${this.sidebarCollapsed}\n >\n ${this.renderStorageHeader()}\n <div\n class=\"folder-pane-main-content\"\n data-sidebar-collapsed=${String(this.sidebarCollapsed)}\n style=${`--folder-pane-sidebar-width: ${this.sidebarWidth}px`}\n @resource-selected=${this.handleResourceSelected}\n @folder-pane-resource-error=${this.handleFolderPaneResourceError}\n @folder-pane-toggle-sidebar=${this.handleSidebarToggle}\n >\n <folder-pane-sidebar\n ?inert=${this.sidebarCollapsed}\n aria-hidden=${this.sidebarCollapsed ? 'true' : 'false'}\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.displayedResource}\n ></folder-pane-sidebar>\n <div\n class=\"folder-pane-sidebar-resizer\"\n data-resizing=${String(!!this.sidebarDrag)}\n >\n <div\n class=\"folder-pane-sidebar-resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize navigation sidebar\"\n aria-valuemin=${MIN_SIDEBAR_WIDTH}\n aria-valuemax=${this.sidebarMaximumWidth}\n aria-valuenow=${this.sidebarWidth}\n tabindex=${this.sidebarCollapsed ? -1 : 0}\n ?hidden=${this.sidebarCollapsed}\n ?inert=${this.sidebarCollapsed}\n @pointerdown=${this.handleSidebarPointerDown}\n @pointermove=${this.handleSidebarPointerMove}\n @pointerup=${this.handleSidebarPointerEnd}\n @pointercancel=${this.handleSidebarPointerEnd}\n @lostpointercapture=${this.handleSidebarPointerEnd}\n @keydown=${this.handleSidebarResizeKey}\n ></div>\n <button\n type=\"button\"\n class=\"folder-pane-sidebar-toggle\"\n aria-label=${this.sidebarCollapsed ? 'Expand navigation' : 'Collapse navigation'}\n aria-expanded=${String(!this.sidebarCollapsed)}\n @click=${this.handleSidebarToggle}\n >\n <icon-lucide-chevron-left\n class=${`folder-pane-sidebar-toggle-icon${this.sidebarCollapsed ? ' folder-pane-sidebar-toggle-icon-collapsed' : ''}`}\n aria-hidden=\"true\"\n ></icon-lucide-chevron-left>\n </button>\n </div>\n <div class=\"folder-pane-content-column\">\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n <div class=\"folder-pane-status\"></div>\n </div>\n </div>\n </folder-pane-provider>\n `\n }\n\n private renderStorageHeader () {\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .breadcrumbRoot=${this.standaloneBreadcrumbRoot}\n .selectedResource=${this.getActiveContainer()}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n @folder-pane-select-home=${this.handleSelectHome}\n @folder-pane-select-resource=${this.handleSelectBreadcrumbResource}\n @folder-pane-change-view=${this.handleContainerViewChange}\n @folder-pane-search=${this.handleSearch}\n ></folder-pane-storage-header>\n `\n }\n\n private renderContentError () {\n if (this.contentError) {\n return html`\n <div class=\"folder-pane-resource-error\" role=\"status\">\n <solid-ui-error-state\n .title=${this.contentError.title}\n .message=${this.contentError.message}\n @close=${this.clearContentError}\n >\n <button type=\"button\" @click=${this.retryContent}>Retry</button>\n </solid-ui-error-state>\n </div>\n `\n }\n\n return nothing\n }\n}\n"],"mappings":"A,8hKAuDA,SAAgB2C,EAAmBC,EAAwBC,EAAgC,CACzF,GAAI,CAACC,OAAOC,SAASF,CAAc,GAAKA,GAAAA,IACtC,MAAA,KAEF,IAAMG,EAAwBH,EAAAA,IAK9B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B,CAe5B,OAdI,KAAK5N,aACAlK,EAAAA,IAAI;;;qBAGI,KAAKkK,aAAakD,MAAK;uBACrB,KAAKlD,aAAaxB,QAAO;qBAC3B,KAAK0B,kBAAiB;;2CAEA,KAAKsO,aAAY;;;QAMjDzY,EAAAA,OACT,CACF,EAAC,CAAA2Y,EAAA,CAAA1T,EAAAE,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAE,GAAAC,GAAAC,GAAAC,GAAAnB,GAAA4T,EAAA,CAAAxW,GAAAyW,IAAAC,GAAAJ,EAAA,CAAA,CAAAlV,EAAA,EAAA,gBAAA,EAAA,CAAAE,EAAA,EAAA,SAAA,EAAA,CAAAC,EAAA,EAAA,UAAA,EAAA,CAAAG,EAAA,EAAA,kBAAA,EAAA,CAAAC,EAAA,EAAA,0BAAA,EAAA,CAAAC,EAAA,EAAA,eAAA,EAAA,CAAAC,EAAA,EAAA,aAAA,EAAA,CAAAC,EAAA,EAAA,kBAAA,EAAA,CAAAC,GAAA,EAAA,cAAA,EAAA,CAAAC,GAAA,EAAA,qBAAA,EAAA,CAAAC,GAAA,EAAA,cAAA,EAAA,CAAAC,GAAA,EAAA,kBAAA,EAAA,CAAAC,GAAA,EAAA,WAAA,EAAA,CAAAC,GAAA,EAAA,aAAA,EAAA,CAAAC,GAAA,EAAA,gBAAA,EAAA,CAAAC,GAAA,EAAA,SAAA,EAAA,CAAAC,GAAA,EAAA,YAAA,CAAA,EAAAxC,EAAA,EAAA,IAAA,GAlrC2CxC,EAAAA,YAAY,EAAAkZ,EAAA,E"}
1
+ {"version":3,"file":"FolderPaneView.cjs.js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getPreferredPane","getRelevantPanes","isExplorerEvent","log","ns","preparePaneMenuItems","showDialog","WebComponent","authn","authSession","resourceAccessCache","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","debug","clearFailedResource","DEFAULT_SIDEBAR_WIDTH","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","MIN_CONTENT_WIDTH","SIDEBAR_RESIZE_STEP","NARROW_PANE_BREAKPOINT","clampSidebarWidth","requestedWidth","availableWidth","Number","isFinite","availableSidebarWidth","Math","min","max","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_selectedResourceDecs","_standaloneBreadcrumbRootDecs","_containerViewDecs","_searchQueryDecs","_sidebarCollapsedDecs","_sidebarWidthDecs","_sidebarMaximumWidthDecs","_contentErrorDecs","_showingContainerDecs","_canCreateDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_selectedResource","_init_standaloneBreadcrumbRoot","_init_containerView","_init_searchQuery","_init_sidebarCollapsed","_init_sidebarWidth","_init_sidebarMaximumWidth","_init_contentError","_init_showingContainer","_init_canCreate","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","clear","refreshCreationPermission","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","updateUploadAvailability","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","Error","message","String","input","createElement","multiple","addEventListener","uploadFiles","Array","from","files","click","resource","parent","dir","activeContainer","sidebar","refreshResources","containerView","resourceTarget","querySelector","refresh","selectedResource","subject","renderContainerView","contentError","retry","clearContentError","showResourceInContentView","store","fetcher","showInitialContainer","searchQuery","showSubject","session","paneRegistry","byName","render","home","standaloneBreadcrumbRoot","view","setContainerView","isConnected","sidebarMaximumWidth","sidebarAvailableWidth","resizeSidebar","sidebarWidth","sidebarCollapsed","sidebarDrag","button","isPrimary","preventDefault","separator","currentTarget","setPointerCapture","pointerId","focus","startX","clientX","startWidth","drag","finishSidebarResize","altKey","ctrlKey","metaKey","width","key","resizer","renderRoot","focusWasInSidebar","matches","shadowRoot","activeElement","focusWasOnResizer","updateComplete","title","showContentError","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","displayedResource","fullView","showingContainer","canCreate","contentView","fullViewTarget","createRenderRoot","connectedCallback","shell","sidebarResizeObserver","observe","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","handleDroppedFiles","handleUploadRejected","handleResourceOpenPane","handleResourceDeleted","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","disconnect","initialLoadGeneration","removeEventListener","off","firstUpdated","updateSidebarBounds","ResizeObserver","entries","contentRect","responsiveLayoutInitialized","handleSidebarToggle","Event","openUploadedResource","length","validFiles","filter","file","invalidFiles","errors","map","join","uploadGeneration","uploadContext","remaining","finish","dataset","status","replaceChildren","results","uri","result","success","prefix","destinationUri","push","canNavigateToUpload","containedResource","sym","uploadedUri","updated","changedProperties","has","getStandaloneBreadcrumbRoot","get","url","URL","pathSegments","pathname","split","origin","clearContent","renderAccessDeniedScreen","loadResource","retryFailed","load","force","clearPreviousData","openCreatedResource","currentPane","selected","indexedContainerUri","root","rootUri","endsWith","startsWith","permissionRequest","containerUri","permissionGeneration","setCanCreate","fetchMetadata","then","metadata","access","canEdit","catch","warn","canUpload","uploadBusy","navigationGeneration","navigationContext","reload","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","addOptimisticResource","target","document","generation","renderExplorerInto","options","relevantPanes","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","panes","openPane","paneSubject","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","parentContainer","nextPane","request","folderView","solo","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","candidate","containerHasIndexDocument","applicationSubject","sourcePane","preserveSubject","useIndexedApplication","indexedContainer","divider","clientWidth","getBoundingClientRect","hasPointerCapture","releasePointerCapture","renderStorageHeader","renderContentError","handleResourceSelected","handleFolderPaneResourceError","handleSidebarPointerDown","handleSidebarPointerMove","handleSidebarPointerEnd","handleSidebarResizeKey","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","require_accessCache","require_helpers","require_renderRequest","require_FolderPaneCreateDialog","require_creationSafety","require_mintPaneInstance","require_debug","require_resourceLoad","solid_ui","solid_logic","lit","lit_decorators_js","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_selectedResourceDecs","_init_selectedResource","_standaloneBreadcrumbRootDecs","_init_standaloneBreadcrumbRoot","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_sidebarCollapsedDecs","_init_sidebarCollapsed","_sidebarWidthDecs","_init_sidebarWidth","_sidebarMaximumWidthDecs","_init_sidebarMaximumWidth","_contentErrorDecs","_init_contentError","_showingContainerDecs","_init_showingContainer","_canCreateDecs","_init_canCreate","_contentViewDecs","_init_contentView","_fullViewTargetDecs","_init_fullViewTarget","_sidebarDecs","_init_sidebar","_statusAreaDecs","_init_statusArea","_ref","_defineProperty","_toPropertyKey","r","t","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","a","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","f","p","_setFunctionName","P","j","D","I","F","l","N","_checkInRHS","_toPrimitive","e","clampSidebarWidth","availableWidth","availableSidebarWidth","requestedWidth","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","args","event","pane","container","dom","statusArea","operationGeneration","paneName","name","resolve","created","stillOwnsNavigation","error$1","input","files","message","resource","parent","activeContainer","containerView","retry","selectedResource","subject","home","view","separator","drag","width","sidebar","resizer","focusWasInSidebar","focusWasOnResizer","title","shell","entries","resourceLogic","validFiles","file","errors","uploadGeneration","uploadContext","remaining","finish","results","result","canNavigateToUpload","openUploadedResource","error","prefix","changedProperties","url","pathSegments","clearContent","store","fetcher","retryFailed","currentPane","selected","indexedContainerUri","root","rootUri","force","permissionGeneration","metadata","canCreate","navigationGeneration","navigationContext","reload","confirmed","containedResource","members","member","newInstance","target","generation","relevantPanes","options","selectedPane","paneElement","provider","menuItems","paneSubject","parentContainer","nextPane","request","renderGeneration","browserContext","isCurrentSelection","candidate","indexRequested","applicationSubject","sourcePane","useIndexedApplication","preserveSubject","indexedContainer","divider"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getPreferredPane, getRelevantPanes, isExplorerEvent, log, ns, preparePaneMenuItems, showDialog, WebComponent } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\nimport { resourceAccessCache } from '../../accessCache'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport type { PropertyValues } from 'lit'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport '../folder-pane-container'\nimport '../folder-pane-sidebar'\nimport '../folder-pane-content'\nimport '../folder-pane-storage-header'\nimport type { NamedNode } from 'rdflib'\nimport 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/button'\nimport type FileExplorerProvider from 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/error-state'\nimport 'solid-ui/components/file-explorer-header'\nimport type FolderPaneContainer from '../folder-pane-container/FolderPaneContainer'\nimport '~icons/lucide/chevron-left'\nimport { getIndexedApplicationSubject, getIndexedContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile, type FolderPaneResourceLogic } from '../../helpers'\nimport { invalidateRenderRequest, isCurrentRenderRequest, type RenderRequest } from './renderRequest'\nimport FolderPaneCreateDialog from '../folder-pane-storage-header/FolderPaneCreateDialog'\nimport { getPaneLabel } from '../../helpers'\nimport { isSafeCreationName, invalidCreationNameMessage } from '../../creationSafety'\nimport { mintPaneInstance, PaneMintError, setMintStatus } from '../../mintPaneInstance'\nimport * as debug from '../../debug'\nimport { clearFailedResource } from './resourceLoad'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (multi-file uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\n}\n\ntype ContentError = {\n title: string\n message: string\n retry?: () => void\n}\n\nexport const DEFAULT_SIDEBAR_WIDTH = 256\nexport const MIN_SIDEBAR_WIDTH = 180\nexport const MAX_SIDEBAR_WIDTH = 480\nexport const MIN_CONTENT_WIDTH = 320\nexport const SIDEBAR_RESIZE_STEP = 16\nexport const NARROW_PANE_BREAKPOINT = 768\n\nexport function clampSidebarWidth (requestedWidth: number, availableWidth: number): number {\n if (!Number.isFinite(availableWidth) || availableWidth <= MIN_CONTENT_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const availableSidebarWidth = availableWidth - MIN_CONTENT_WIDTH\n if (availableSidebarWidth < MIN_SIDEBAR_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const requested = Number.isFinite(requestedWidth) ? requestedWidth : DEFAULT_SIDEBAR_WIDTH\n return Math.min(MAX_SIDEBAR_WIDTH, availableSidebarWidth, Math.max(MIN_SIDEBAR_WIDTH, requested))\n}\n\n@customElement('folder-pane-view')\nexport default class FolderPaneView extends WebComponent {\n @property({ attribute: false })\n accessor browserContext: DataBrowserContext | undefined = undefined\n\n private get store () {\n return this.browserContext?.session.store\n }\n\n @property({ attribute: false })\n accessor subject: NamedNode | undefined = undefined\n\n private get resourceLogic (): FolderPaneResourceLogic | undefined {\n return this.browserContext?.session.logic.resource as FolderPaneResourceLogic | undefined\n }\n\n private get displayedResource (): NamedNode | undefined {\n return this.selectedResource ?? this.subject\n }\n\n @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n private accessor standaloneBreadcrumbRoot: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor sidebarCollapsed = false\n\n @state()\n private accessor sidebarWidth = DEFAULT_SIDEBAR_WIDTH\n\n @state()\n private accessor sidebarMaximumWidth = MAX_SIDEBAR_WIDTH\n\n @state()\n private accessor contentError: ContentError | undefined = undefined\n\n @state()\n private accessor showingContainer = false\n\n @state()\n private accessor canCreate = false\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private permissionGeneration = 0\n private permissionRequest: { containerUri: string, resourceLogic: unknown } | undefined\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\n private sidebarResizeObserver: ResizeObserver | undefined\n private responsiveLayoutInitialized = false\n private sidebarDrag: {\n separator: HTMLElement\n pointerId: number\n startX: number\n startWidth: number\n } | undefined\n\n @query('folder-pane-content')\n private accessor contentView: HTMLElement | null = null\n\n @query('.folder-pane-full-view')\n private accessor fullViewTarget: HTMLElement | null = null\n\n @query('folder-pane-sidebar')\n private accessor sidebar: (HTMLElement & { refreshResources?: (container?: NamedNode) => void }) | null = null\n\n /** Below-content area for pane creation progress, errors and setup UI. */\n @query('.folder-pane-status')\n accessor statusArea: HTMLElement | null = null\n\n protected createRenderRoot () {\n return this\n }\n\n connectedCallback () {\n super.connectedCallback()\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver?.observe(shell)\n if (!this.dropProtectionAttached) {\n aclControl.preventBrowserDropEvents(this.ownerDocument)\n this.dropProtectionAttached = true\n }\n this.addEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.addEventListener('folder-pane-upload', this.handleUpload)\n this.addEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.addEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.addEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.addEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (!this.authListenersAttached) {\n authSession.events.on('login', this.handleAuthChange)\n authSession.events.on('logout', this.handleAuthChange)\n this.authListenersAttached = true\n }\n }\n\n disconnectedCallback () {\n this.finishSidebarResize()\n this.sidebarResizeObserver?.disconnect()\n // Invalidate awaited renders before detaching listeners. A late response\n // must never replace content in a detached view.\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n this.initialLoadGeneration++\n this.removeEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.removeEventListener('folder-pane-upload', this.handleUpload)\n this.removeEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.removeEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.removeEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.removeEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (this.authListenersAttached) {\n authSession.events.off('login', this.handleAuthChange)\n authSession.events.off('logout', this.handleAuthChange)\n this.authListenersAttached = false\n }\n super.disconnectedCallback()\n }\n\n protected firstUpdated () {\n this.updateSidebarBounds()\n if (typeof ResizeObserver !== 'undefined') {\n this.sidebarResizeObserver = new ResizeObserver(entries => {\n this.updateSidebarBounds()\n const width = entries[0]?.contentRect.width ?? 0\n if (this.responsiveLayoutInitialized || width <= 0) return\n this.responsiveLayoutInitialized = true\n if (width < NARROW_PANE_BREAKPOINT) {\n void this.handleSidebarToggle(new Event('folder-pane-responsive-collapse'))\n }\n })\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver.observe(shell)\n this.sidebarResizeObserver.observe(this)\n }\n }\n\n private handleAuthChange = () => {\n resourceAccessCache.clear()\n this.refreshCreationPermission(true)\n this.requestUpdate()\n }\n\n private handleCreatePane = async (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const pane = (event as CustomEvent<{ pane?: PaneDefinition }>).detail?.pane\n if (!pane?.mintNew) return\n const container = this.getActiveContainer()\n const dom = this.ownerDocument\n const statusArea = this.statusArea\n if (!container || !statusArea) return\n this.creationInFlight = true\n this.updateUploadAvailability()\n const operationGeneration = ++this.renderGeneration\n const paneName = getPaneLabel(pane)\n try {\n const name = await new Promise<string | undefined>(resolve => {\n showDialog(FolderPaneCreateDialog, {\n props: { label: paneName },\n onClose: resolve\n })\n })\n if (!name || !authn.currentUser()) return\n if (operationGeneration !== this.renderGeneration ||\n this.getActiveContainer()?.sameTerm(container) !== true) return\n if (!isSafeCreationName(name)) {\n setMintStatus(statusArea, 'error', invalidCreationNameMessage)\n return\n }\n this.clearContentForCreation()\n const created = await mintPaneInstance({\n context: this.browserContext!,\n container,\n pane,\n name,\n noun: paneName,\n statusArea,\n me: authn.currentUser() ?? undefined,\n dom\n })\n const stillOwnsNavigation = operationGeneration === this.renderGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n await this.showCreatedResource({\n container,\n ...created,\n pane,\n newInstance: stillOwnsNavigation ? created.newInstance : undefined\n })\n } catch (error) {\n debug.error('Unable to create folder-pane resource', error)\n if (!(error instanceof PaneMintError) && this.statusArea) {\n setMintStatus(this.statusArea, 'error', `Unable to create ${paneName}: ${error instanceof Error ? error.message : String(error)}`)\n }\n } finally {\n this.creationInFlight = false\n this.updateUploadAvailability()\n }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n void this.uploadFiles(Array.from(input.files ?? []), true)\n })\n input.click()\n }\n\n private handleDroppedFiles = (event: Event) => {\n event.stopPropagation()\n const files = (event as CustomEvent<{ files: File[] }>).detail?.files ?? []\n void this.uploadFiles(files, false)\n }\n\n private handleUploadRejected = (event: Event) => {\n event.stopPropagation()\n const message = (event as CustomEvent<{ message?: string }>).detail?.message\n if (message && this.statusArea) setMintStatus(this.statusArea, 'error', message)\n }\n\n private handleResourceDeleted = (event: Event) => {\n const resource = (event as CustomEvent<{ resource?: NamedNode }>).detail?.resource\n if (!resource) return\n\n const parent = resource.dir()\n const activeContainer = this.getActiveContainer()\n if (parent) {\n this.sidebar?.refreshResources?.(parent)\n }\n\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void }) | null\n if (parent && activeContainer?.sameTerm(parent)) {\n void containerView?.refresh?.()\n }\n\n if (!this.selectedResource?.sameTerm(resource)) return\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n const container = parent ?? this.subject\n if (container) {\n this.selectedResource = container\n this.renderContainerView(container)\n } else {\n this.selectedResource = undefined\n }\n }\n\n private async uploadFiles (files: File[], openUploadedResource: boolean) {\n if (this.creationInFlight || !authn.currentUser() || !this.canCreate) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n const resourceLogic = this.resourceLogic\n if (!files.length || !container || !statusArea || !this.store || !resourceLogic) return\n\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n const errors = invalidFiles.map(file => `${file.name}: ${invalidCreationNameMessage}`)\n if (!validFiles.length) {\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n return\n }\n\n this.creationInFlight = true\n this.updateUploadAvailability()\n const uploadGeneration = this.renderGeneration\n const uploadContext = this.browserContext\n let remaining = validFiles.length\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n this.updateUploadAvailability()\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n try {\n const results = await resourceLogic.uploadFiles(validFiles, container.uri)\n for (const result of results) {\n if (!result.success) {\n const prefix = result.error.destinationUri\n ? `Upload failed while putting ${result.error.destinationUri}`\n : `Upload failed for ${result.file.name}`\n const message = result.error.status === 413\n ? `${prefix}: storage quota was exceeded. ${result.error.message}`\n : result.error.status\n ? `${prefix} (HTTP ${result.error.status}). ${result.error.message}`\n : `${prefix}. ${result.error.message}`\n errors.push(message)\n finish()\n continue\n }\n\n try {\n const canNavigateToUpload = this.renderGeneration === uploadGeneration &&\n this.browserContext === uploadContext\n await this.showCreatedResource({\n container,\n containedResource: this.store.sym(result.uploadedUri),\n newInstance: openUploadedResource && validFiles.length === 1 && canNavigateToUpload\n ? this.store.sym(result.uploadedUri)\n : undefined\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Uploaded ${result.file.name}, but could not refresh the folder: ${message}`)\n } finally {\n finish()\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Unable to upload files: ${message}`)\n while (remaining > 0) finish()\n }\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n this.refreshCreationPermission()\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('selectedResource')) {\n this.refreshCreationPermission()\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\n if (this.subject) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n }\n if (this.selectedResource) {\n void this.showResourceInContentView(this.selectedResource)\n } else if (this.subject) {\n this.renderContainerView(this.subject)\n }\n }\n }\n\n private getStandaloneBreadcrumbRoot (subject: NamedNode): NamedNode {\n try {\n const url = new URL(subject.uri)\n const pathSegments = url.pathname.split('/').filter(Boolean)\n if (pathSegments.length <= 1) return subject\n return this.store?.sym(`${url.origin}/${pathSegments[0]}/`) ?? subject\n } catch {\n return subject\n }\n }\n\n // Lit never renders inside these targets; panes, explorers and containers\n // are inserted imperatively, and Lit-rendered errors sit beside them.\n private get resourceTarget () {\n return this.fullView ? this.fullViewTarget : this.contentView\n }\n\n private showContentError (error: ContentError, clearContent = true) {\n if (clearContent) this.resourceTarget?.replaceChildren()\n this.contentError = error\n }\n\n private renderAccessDeniedScreen () {\n this.showContentError({\n title: 'Access denied',\n message: 'You do not have access to the contents of this container.'\n })\n }\n\n private async loadResource (resource: NamedNode, retryFailed = false): Promise<void> {\n const store = this.store\n if (!store) return\n const fetcher = store.fetcher\n // A failed request can be cached by rdflib. Do not clear it during normal\n // navigation: persistent failures such as CORS errors should settle once\n // instead of causing a new request on every render. An explicit retry is\n // the point at which the cached failure should be discarded.\n if (retryFailed) clearFailedResource(fetcher, resource)\n try {\n await fetcher.load(resource)\n } catch (error) {\n if (!retryFailed || !isAccessDeniedError(error) || !authn.currentUser()) throw error\n await fetcher.load(resource, { force: true, clearPreviousData: true })\n }\n }\n\n private clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\n const retry = this.contentError?.retry\n if (retry) {\n this.clearContentError()\n retry()\n return\n }\n\n const selectedResource = this.selectedResource\n const subject = this.subject\n if (!selectedResource && !subject) return\n this.clearContentError()\n if (selectedResource) {\n void this.showResourceInContentView(selectedResource, undefined, false, true)\n } else if (subject) {\n if (this.store) clearFailedResource(this.store.fetcher, subject)\n void this.showInitialContainer(subject)\n }\n }\n\n /**\n * Select the resource returned by a pane's mintNew implementation. Some\n * panes (notably long chat) mint a resource inside the new document rather\n * than the container URI itself, so routing this through the normal\n * selection path is important.\n */\n openCreatedResource (resource: NamedNode, pane?: PaneDefinition) {\n this.searchQuery = ''\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n // Resolve the pane again from the registry. Creation menu entries can be\n // replaced while the async mint is running; retaining that stale object\n // lets a different relevant pane (notably profile for pad indexes) win.\n const currentPane = pane?.name\n ? this.browserContext?.session.paneRegistry.byName(pane.name) ?? pane\n : pane\n // Explicitly opening a freshly-created resource must preserve its subject.\n // Indexed panes such as Pad use `index.ttl#this`; mapping that subject back\n // to the folder would render the pane against a container with no pad data.\n this.showSubject(\n resource,\n typeof currentPane?.render === 'function' ? currentPane : undefined,\n true\n )\n }\n\n /**\n * The storage header belongs to the explorer, while its actions apply to\n * the container currently being viewed. A document selection has no\n * writable container of its own, so use its parent when it remains within\n * the explorer root; otherwise retain the last browsed container.\n */\n getActiveContainer (): NamedNode | undefined {\n const selected = this.selectedResource\n const indexedContainerUri = selected ? getIndexedContainer(selected) : undefined\n if (indexedContainerUri && this.store) {\n return this.store.sym(indexedContainerUri)\n }\n if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = this.fullView ? this.standaloneBreadcrumbRoot : this.subject\n const parent = selected?.dir()\n const rootUri = root?.uri.endsWith('/') ? root.uri : `${root?.uri}/`\n if (root && parent && rootUri && parent.uri.startsWith(rootUri)) {\n return parent\n }\n\n return this.subject\n }\n\n private refreshCreationPermission (force = false) {\n const container = this.getActiveContainer()\n const resourceLogic = this.browserContext?.session.logic.resource\n if (\n !force &&\n container &&\n resourceLogic &&\n this.permissionRequest?.containerUri === container.uri &&\n this.permissionRequest.resourceLogic === resourceLogic\n ) return\n\n const permissionGeneration = ++this.permissionGeneration\n this.setCanCreate(false)\n this.permissionRequest = container && resourceLogic\n ? { containerUri: container.uri, resourceLogic }\n : undefined\n if (!container || !resourceLogic) return\n\n void resourceLogic.fetchMetadata(container)\n .then(metadata => {\n if (\n permissionGeneration === this.permissionGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n ) {\n this.setCanCreate(metadata.access.canEdit)\n }\n })\n .catch(error => {\n if (permissionGeneration === this.permissionGeneration) {\n this.permissionRequest = undefined\n debug.warn('Unable to determine folder creation permission', error)\n }\n })\n }\n\n private updateUploadAvailability () {\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (FolderPaneContainer & { subject?: NamedNode, uploadBusy?: boolean }) | null\n const activeContainer = this.getActiveContainer()\n if (!containerView) return\n containerView.canUpload = this.canCreate &&\n !this.creationInFlight &&\n !!activeContainer &&\n containerView.subject?.sameTerm(activeContainer) === true\n containerView.uploadBusy = this.creationInFlight\n }\n\n private setCanCreate (canCreate: boolean) {\n this.canCreate = canCreate\n this.updateUploadAvailability()\n }\n\n clearContentForCreation () {\n this.resourceTarget?.replaceChildren()\n }\n\n /**\n * Reload the server-backed container listing after a pane minted a new\n * resource, refresh the sidebar and container view, then open the result.\n */\n async showCreatedResource ({ container, containedResource, newInstance, pane }: CreatedResource) {\n const store = this.store\n if (!store) return\n const navigationGeneration = this.renderGeneration\n const navigationContext = this.browserContext\n const reload = async (resource: NamedNode): Promise<boolean> => {\n try {\n await store.fetcher.load(resource, { force: true, clearPreviousData: true })\n return true\n } catch (error) {\n log.warn('Unable to reload ' + resource.uri + ': ' + error)\n return false\n }\n }\n\n const confirmed = await reload(container)\n if (containedResource.uri.endsWith('/')) {\n await reload(containedResource)\n // Panes may probe their new documents before writing them; forget those\n // cached 404s so rendering loads what the pane actually created.\n const members = store.each(containedResource, ns.ldp('contains'), undefined, containedResource.doc())\n for (const member of members) {\n if (member.termType === 'NamedNode' && store.fetcher.getState(member.value) === 'failed') {\n store.fetcher.unload(member as NamedNode)\n }\n }\n }\n\n this.sidebar?.refreshResources?.(container)\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void, addOptimisticResource?: (resource: NamedNode) => void }) | null\n if (!confirmed && containerView?.addOptimisticResource) {\n containerView.addOptimisticResource(containedResource)\n }\n if (confirmed) {\n containerView?.refresh?.()\n }\n if (\n newInstance &&\n this.isConnected &&\n this.renderGeneration === navigationGeneration &&\n this.browserContext === navigationContext\n ) {\n this.openCreatedResource(newInstance, pane)\n }\n }\n\n private renderContainerView (selectedResource: NamedNode) {\n const target = this.resourceTarget\n if (!target) return\n\n this.contentError = undefined\n const containerView = document.createElement('folder-pane-container') as FolderPaneContainer\n\n containerView.subject = selectedResource\n containerView.resourceLogic = this.resourceLogic ?? null\n containerView.browserContext = this.browserContext\n const activeContainer = this.getActiveContainer()\n containerView.canUpload = this.canCreate &&\n !!activeContainer &&\n selectedResource.sameTerm(activeContainer)\n containerView.uploadBusy = this.creationInFlight\n containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n\n this.showingContainer = true\n target.replaceChildren(containerView)\n }\n\n private async showInitialContainer (subject: NamedNode) {\n const generation = ++this.initialLoadGeneration\n\n if (isJavaScriptFile(subject)) {\n this.showSubject(subject)\n return\n }\n\n if (!this.store || !this.resourceLogic) return\n\n try {\n await this.loadResource(subject)\n } catch (error) {\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n if (isAccessDeniedError(error)) {\n const target = this.resourceTarget\n if (target) this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load storage container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n this.sidebar?.refreshResources?.()\n this.requestUpdate()\n if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private async renderExplorerInto (\n target: HTMLElement,\n subject: NamedNode,\n pane: PaneDefinition | undefined,\n options: ExplorerRenderOptions = {}\n ) {\n if (!this.browserContext) return\n\n const relevantPanes = await getRelevantPanes(subject, this.browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (options.isCurrent && !options.isCurrent()) return\n const selectedPane = pane || getPreferredPane(subject, this.browserContext, relevantPanes)\n if (!selectedPane) {\n this.renderExplorerError(subject, 'No pane is available to display this resource.')\n return\n }\n\n let paneElement: HTMLElement\n try {\n paneElement = selectedPane.render(subject, this.browserContext, options.paneOptions || {})\n } catch (error) {\n log.error('Unable to render selected pane: ' + error)\n this.renderExplorerError(subject, 'The selected pane could not render this resource.')\n return\n }\n\n const provider = target.ownerDocument.createElement('solid-ui-file-explorer-provider') as FileExplorerProvider\n const menuItems = await preparePaneMenuItems({\n subject,\n context: this.browserContext,\n panes: relevantPanes,\n openPane: (paneSubject, paneName) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: paneSubject.uri, paneName }\n }))\n }\n })\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n // Return to the container that owns the displayed resource. Using the\n // explorer root here loses the user's position for resources in nested\n // containers.\n const parentContainer = this.getActiveContainer() || this.subject || subject\n this.renderGeneration++\n this.selectedResource = parentContainer\n this.renderContainerView(parentContainer)\n })\n provider.addEventListener(FILE_EXPLORER_OPEN_PANE_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n const paneName = (event as CustomEvent<{ paneName: string }>).detail?.paneName\n const nextPane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (nextPane) {\n const request: RenderRequest = {\n generation: ++this.renderGeneration,\n subjectUri: subject.uri,\n context: this.browserContext\n }\n this.renderExplorerInto(target, subject, nextPane, {\n ...options,\n paneOptions: nextPane.name === 'folder'\n ? { folderView: 'container', fullView: true, solo: true }\n : options.paneOptions,\n isCurrent: () => isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n )\n }).catch(error => {\n log.error('Unable to switch selected pane: ' + error)\n })\n }\n })\n\n composeExplorer(provider, {\n context: this.browserContext,\n subjectUri: subject.uri,\n pane: selectedPane,\n relevantPanes,\n header: options.showHeader === false\n ? undefined\n : { paneIcon: selectedPane.icon, menuItems },\n paneElement\n })\n if (options.isCurrent && !options.isCurrent()) return\n this.contentError = undefined\n this.showingContainer = false\n target.replaceChildren(provider)\n }\n\n private renderExplorerError (subject: NamedNode, message: string) {\n this.showContentError({ title: message, message: subject.uri })\n }\n\n private async showResourceInContentView (\n selectedResource: NamedNode,\n pane?: PaneDefinition,\n indexRequested = false,\n retryFailed = false\n ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n const browserContext = this.browserContext\n if (!target || !this.store || !this.resourceLogic || !browserContext) return\n\n const request: RenderRequest = {\n generation: renderGeneration,\n subjectUri: selectedResource.uri,\n context: this.browserContext\n }\n const isCurrentSelection = (candidate: NamedNode) =>\n isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n ) && candidate.uri === request.subjectUri\n\n if (!isCurrentSelection(selectedResource)) return\n\n if (\n this.subject?.sameTerm(selectedResource) &&\n !pane &&\n !indexRequested &&\n isContainerResource(selectedResource, this.resourceLogic)\n ) {\n this.renderContainerView(selectedResource)\n return\n }\n\n // A pane supplied by an explicit creation or pane-selection action is\n // authoritative. In particular, freshly created text resources can\n // briefly inherit container metadata while the store is refreshed.\n // Some servers report file resources as containers. Keep known file\n // types out of the folder branch so pane selection can run normally.\n if (\n isContainerResource(selectedResource, this.resourceLogic) &&\n (pane?.name !== 'source' || indexRequested)\n ) {\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load selected container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (!isCurrentSelection(selectedResource)) return\n this.sidebar?.refreshResources?.()\n\n if (pane?.name === 'folder') {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (\n !pane &&\n (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource))\n ) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource)\n )\n try {\n await this.loadResource(applicationSubject.doc(), retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load container index document: ' + error)\n }\n await this.renderExplorerInto(target, applicationSubject, pane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n const relevantPanes = await getRelevantPanes(selectedResource, browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (!isCurrentSelection(selectedResource)) return\n\n const selectedPane = pane || getPreferredPane(selectedResource, browserContext, relevantPanes)\n if (selectedPane?.name !== 'folder') {\n await this.renderExplorerInto(target, selectedResource, selectedPane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.warn('Unable to load selected resource metadata: ' + error)\n }\n\n if (!isCurrentSelection(selectedResource)) return\n const sourcePane = isJavaScriptFile(selectedResource)\n ? this.browserContext?.session.paneRegistry.byName('source')\n : undefined\n if (!pane && isJavaScriptFile(selectedResource) && !sourcePane) {\n this.renderExplorerError(selectedResource, 'The Source pane is unavailable to display this JavaScript file.')\n return\n }\n await this.renderExplorerInto(target, selectedResource, pane || sourcePane, {\n isCurrent: () => isCurrentSelection(selectedResource)\n })\n } catch (error) {\n log.error('Unable to render selected resource: ' + error)\n if (renderGeneration === this.renderGeneration && this.resourceTarget) {\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n this.renderExplorerError(selectedResource, 'Unable to display the selected resource.')\n }\n }\n }\n\n private showSubject (resource: NamedNode, pane?: PaneDefinition, preserveSubject = false) {\n // `container/index.ttl#this` is rendered exactly like selecting its container,\n // so indexed panes never show the file-explorer header on either route.\n const useIndexedApplication = !preserveSubject && pane?.name !== 'sharing'\n const indexedContainerUri = useIndexedApplication ? getIndexedContainer(resource) : undefined\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = useIndexedApplication && !indexedContainer &&\n !!this.resourceLogic &&\n isContainerResource(resource, this.resourceLogic) &&\n this.resourceLogic.containerHasIndexDocument(resource)\n this.selectedResource = subject\n // Render directly so re-selecting the same resource still replaces the content target.\n void this.showResourceInContentView(subject, pane, !!indexedContainer || indexRequested)\n }\n\n private handleResourceSelected = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.searchQuery = ''\n this.showSubject(resource)\n }\n\n private handleResourceOpenPane = (event: CustomEvent<{ resource: NamedNode, paneName: string }>) => {\n const resource = event.detail?.resource\n const paneName = event.detail?.paneName\n const pane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (!resource || !pane) return\n event.stopPropagation()\n this.searchQuery = ''\n if (pane.name === 'folder') {\n this.showSubject(resource, pane, true)\n return\n }\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n this.showSubject(resource, typeof pane?.render === 'function' ? pane : undefined, true)\n }\n\n private setContainerView (view: 'grid' | 'list') {\n this.containerView = view\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.view = view\n }\n\n private handleSelectHome = () => {\n this.searchQuery = ''\n const home = this.subject && this.standaloneBreadcrumbRoot?.sameTerm(this.subject)\n ? this.subject\n : this.standaloneBreadcrumbRoot\n if (home) this.showSubject(home)\n }\n\n private handleSearch = (event: CustomEvent<{ query: string }>) => {\n event.stopPropagation()\n this.searchQuery = event.detail?.query || ''\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.searchQuery = this.searchQuery\n }\n\n private handleSelectBreadcrumbResource = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.showSubject(resource)\n }\n\n private handleContainerViewChange = (event: CustomEvent<{ view: 'grid' | 'list' }>) => {\n const view = event.detail?.view\n if (!view) return\n event.stopPropagation()\n this.setContainerView(view)\n }\n\n private get sidebarAvailableWidth () {\n const shell = this.renderRoot.querySelector<HTMLElement>('.folder-pane-main-content')\n const divider = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resizer')\n return (shell?.clientWidth ?? 0) - (divider?.getBoundingClientRect().width ?? 0)\n }\n\n private resizeSidebar (width: number) {\n this.sidebarWidth = clampSidebarWidth(width, this.sidebarAvailableWidth)\n }\n\n private updateSidebarBounds = () => {\n if (!this.isConnected) return\n this.sidebarMaximumWidth = clampSidebarWidth(MAX_SIDEBAR_WIDTH, this.sidebarAvailableWidth)\n this.resizeSidebar(this.sidebarWidth)\n }\n\n private handleSidebarPointerDown = (event: PointerEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.button !== 0 || !event.isPrimary) return\n event.preventDefault()\n const separator = event.currentTarget as HTMLElement\n separator.setPointerCapture(event.pointerId)\n separator.focus()\n this.sidebarDrag = {\n separator,\n pointerId: event.pointerId,\n startX: event.clientX,\n startWidth: this.sidebarWidth\n }\n this.requestUpdate()\n }\n\n private handleSidebarPointerMove = (event: PointerEvent) => {\n const drag = this.sidebarDrag\n if (!this.isConnected || this.sidebarCollapsed || !drag || drag.pointerId !== event.pointerId) return\n this.resizeSidebar(drag.startWidth + event.clientX - drag.startX)\n }\n\n private finishSidebarResize () {\n const drag = this.sidebarDrag\n if (!drag) return\n this.sidebarDrag = undefined\n if (drag.separator.hasPointerCapture(drag.pointerId)) {\n drag.separator.releasePointerCapture(drag.pointerId)\n }\n if (this.isConnected) this.requestUpdate()\n }\n\n private handleSidebarPointerEnd = (event: PointerEvent) => {\n if (this.sidebarDrag?.pointerId === event.pointerId) this.finishSidebarResize()\n }\n\n private handleSidebarResizeKey = (event: KeyboardEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.altKey || event.ctrlKey || event.metaKey) return\n let width: number\n switch (event.key) {\n case 'ArrowLeft': width = this.sidebarWidth - SIDEBAR_RESIZE_STEP; break\n case 'ArrowRight': width = this.sidebarWidth + SIDEBAR_RESIZE_STEP; break\n case 'Home': width = MIN_SIDEBAR_WIDTH; break\n case 'End': width = MAX_SIDEBAR_WIDTH; break\n default: return\n }\n event.preventDefault()\n event.stopPropagation()\n this.resizeSidebar(width)\n }\n\n private handleSidebarToggle = async (event: Event) => {\n event.stopPropagation()\n const sidebar = this.sidebar\n const resizer = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resize-handle')\n const focusWasInSidebar = !!sidebar && (\n sidebar.matches(':focus-within') ||\n sidebar.shadowRoot?.activeElement != null\n )\n const focusWasOnResizer = resizer === this.ownerDocument.activeElement\n this.finishSidebarResize()\n this.sidebarCollapsed = !this.sidebarCollapsed\n if (!this.sidebarCollapsed || (!focusWasInSidebar && !focusWasOnResizer)) return\n await this.updateComplete\n this.renderRoot.querySelector<HTMLButtonElement>('.folder-pane-sidebar-toggle')?.focus()\n }\n\n private handleFolderPaneResourceError = (event: CustomEvent<{\n title?: string\n message?: string\n retry?: () => void\n }>) => {\n event.stopPropagation()\n const title = event.detail?.title || 'Unable to load this folder'\n const message = event.detail?.message || 'The folder could not be loaded. Try again.'\n this.showContentError({\n title,\n message,\n retry: event.detail?.retry\n }, false)\n }\n\n render () {\n if (this.fullView) {\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n >\n ${this.showingContainer ? this.renderStorageHeader() : nothing}\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n ></div>\n <div class=\"folder-pane-status\"></div>\n </folder-pane-provider>\n `\n }\n\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n .sidebarCollapsed=${this.sidebarCollapsed}\n >\n ${this.renderStorageHeader()}\n <div\n class=\"folder-pane-main-content\"\n data-sidebar-collapsed=${String(this.sidebarCollapsed)}\n style=${`--folder-pane-sidebar-width: ${this.sidebarWidth}px`}\n @resource-selected=${this.handleResourceSelected}\n @folder-pane-resource-error=${this.handleFolderPaneResourceError}\n @folder-pane-toggle-sidebar=${this.handleSidebarToggle}\n >\n <folder-pane-sidebar\n ?inert=${this.sidebarCollapsed}\n aria-hidden=${this.sidebarCollapsed ? 'true' : 'false'}\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.displayedResource}\n ></folder-pane-sidebar>\n <div\n class=\"folder-pane-sidebar-resizer\"\n data-resizing=${String(!!this.sidebarDrag)}\n >\n <div\n class=\"folder-pane-sidebar-resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize navigation sidebar\"\n aria-valuemin=${MIN_SIDEBAR_WIDTH}\n aria-valuemax=${this.sidebarMaximumWidth}\n aria-valuenow=${this.sidebarWidth}\n tabindex=${this.sidebarCollapsed ? -1 : 0}\n ?hidden=${this.sidebarCollapsed}\n ?inert=${this.sidebarCollapsed}\n @pointerdown=${this.handleSidebarPointerDown}\n @pointermove=${this.handleSidebarPointerMove}\n @pointerup=${this.handleSidebarPointerEnd}\n @pointercancel=${this.handleSidebarPointerEnd}\n @lostpointercapture=${this.handleSidebarPointerEnd}\n @keydown=${this.handleSidebarResizeKey}\n ></div>\n <button\n type=\"button\"\n class=\"folder-pane-sidebar-toggle\"\n aria-label=${this.sidebarCollapsed ? 'Expand navigation' : 'Collapse navigation'}\n aria-expanded=${String(!this.sidebarCollapsed)}\n @click=${this.handleSidebarToggle}\n >\n <icon-lucide-chevron-left\n class=${`folder-pane-sidebar-toggle-icon${this.sidebarCollapsed ? ' folder-pane-sidebar-toggle-icon-collapsed' : ''}`}\n aria-hidden=\"true\"\n ></icon-lucide-chevron-left>\n </button>\n </div>\n <div class=\"folder-pane-content-column\">\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n <div class=\"folder-pane-status\"></div>\n </div>\n </div>\n </folder-pane-provider>\n `\n }\n\n private renderStorageHeader () {\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .breadcrumbRoot=${this.standaloneBreadcrumbRoot}\n .selectedResource=${this.getActiveContainer()}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n @folder-pane-select-home=${this.handleSelectHome}\n @folder-pane-select-resource=${this.handleSelectBreadcrumbResource}\n @folder-pane-change-view=${this.handleContainerViewChange}\n @folder-pane-search=${this.handleSearch}\n ></folder-pane-storage-header>\n `\n }\n\n private renderContentError () {\n if (this.contentError) {\n return html`\n <div class=\"folder-pane-resource-error\" role=\"status\">\n <solid-ui-error-state\n .title=${this.contentError.title}\n .message=${this.contentError.message}\n @close=${this.clearContentError}\n >\n <button type=\"button\" @click=${this.retryContent}>Retry</button>\n </solid-ui-error-state>\n </div>\n `\n }\n\n return nothing\n }\n}\n"],"mappings":"A,8hKAuDA,SAAgB2C,EAAmBC,EAAwBC,EAAgC,CACzF,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AAC,sBAAsB,CAc7B;IAED,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,gBAAgB,CAMvB;IAED,OAAO,CAAC,YAAY,CAKnB;IAED,OAAO,CAAC,8BAA8B,CAKrC;IAED,OAAO,CAAC,yBAAyB,CAKhC;IAED,OAAO,KAAK,qBAAqB,GAIhC;IAED,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,mBAAmB,CAI1B;IAED,OAAO,CAAC,wBAAwB,CAc/B;IAED,OAAO,CAAC,wBAAwB,CAI/B;IAED,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,uBAAuB,CAE9B;IAED,OAAO,CAAC,sBAAsB,CAc7B;IAED,OAAO,CAAC,mBAAmB,CAc1B;IAED,OAAO,CAAC,6BAA6B,CAapC;IAED,MAAM;IA+FN,OAAO,CAAC,mBAAmB;IAmB3B,OAAO,CAAC,kBAAkB;CAiB3B"}
@@ -562,7 +562,7 @@ ze = (ae = P({ attribute: !1 }), se = P({ attribute: !1 }), le = P({
562
562
  openCreatedResource(e, t) {
563
563
  this.searchQuery = "";
564
564
  let n = t?.name ? this.browserContext?.session.paneRegistry.byName(t.name) ?? t : t;
565
- this.showSubject(e, typeof n?.render == "function" ? n : void 0);
565
+ this.showSubject(e, typeof n?.render == "function" ? n : void 0, !0);
566
566
  }
567
567
  getActiveContainer() {
568
568
  let e = this.selectedResource, t = e ? n(e) : void 0;
@@ -1 +1 @@
1
- {"version":3,"file":"FolderPaneView.esm.js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getPreferredPane","getRelevantPanes","isExplorerEvent","log","ns","preparePaneMenuItems","showDialog","WebComponent","authn","authSession","resourceAccessCache","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","debug","clearFailedResource","DEFAULT_SIDEBAR_WIDTH","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","MIN_CONTENT_WIDTH","SIDEBAR_RESIZE_STEP","NARROW_PANE_BREAKPOINT","clampSidebarWidth","requestedWidth","availableWidth","Number","isFinite","availableSidebarWidth","Math","min","max","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_selectedResourceDecs","_standaloneBreadcrumbRootDecs","_containerViewDecs","_searchQueryDecs","_sidebarCollapsedDecs","_sidebarWidthDecs","_sidebarMaximumWidthDecs","_contentErrorDecs","_showingContainerDecs","_canCreateDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_selectedResource","_init_standaloneBreadcrumbRoot","_init_containerView","_init_searchQuery","_init_sidebarCollapsed","_init_sidebarWidth","_init_sidebarMaximumWidth","_init_contentError","_init_showingContainer","_init_canCreate","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","clear","refreshCreationPermission","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","updateUploadAvailability","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","Error","message","String","input","createElement","multiple","addEventListener","uploadFiles","Array","from","files","click","resource","parent","dir","activeContainer","sidebar","refreshResources","containerView","resourceTarget","querySelector","refresh","selectedResource","subject","renderContainerView","contentError","retry","clearContentError","showResourceInContentView","store","fetcher","showInitialContainer","searchQuery","showSubject","session","paneRegistry","byName","render","home","standaloneBreadcrumbRoot","view","setContainerView","isConnected","sidebarMaximumWidth","sidebarAvailableWidth","resizeSidebar","sidebarWidth","sidebarCollapsed","sidebarDrag","button","isPrimary","preventDefault","separator","currentTarget","setPointerCapture","pointerId","focus","startX","clientX","startWidth","drag","finishSidebarResize","altKey","ctrlKey","metaKey","width","key","resizer","renderRoot","focusWasInSidebar","matches","shadowRoot","activeElement","focusWasOnResizer","updateComplete","title","showContentError","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","displayedResource","fullView","showingContainer","canCreate","contentView","fullViewTarget","createRenderRoot","connectedCallback","shell","sidebarResizeObserver","observe","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","handleDroppedFiles","handleUploadRejected","handleResourceOpenPane","handleResourceDeleted","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","disconnect","initialLoadGeneration","removeEventListener","off","firstUpdated","updateSidebarBounds","ResizeObserver","entries","contentRect","responsiveLayoutInitialized","handleSidebarToggle","Event","openUploadedResource","length","validFiles","filter","file","invalidFiles","errors","map","join","uploadGeneration","uploadContext","remaining","finish","dataset","status","replaceChildren","results","uri","result","success","prefix","destinationUri","push","canNavigateToUpload","containedResource","sym","uploadedUri","updated","changedProperties","has","getStandaloneBreadcrumbRoot","get","url","URL","pathSegments","pathname","split","origin","clearContent","renderAccessDeniedScreen","loadResource","retryFailed","load","force","clearPreviousData","openCreatedResource","currentPane","selected","indexedContainerUri","root","rootUri","endsWith","startsWith","permissionRequest","containerUri","permissionGeneration","setCanCreate","fetchMetadata","then","metadata","access","canEdit","catch","warn","canUpload","uploadBusy","navigationGeneration","navigationContext","reload","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","addOptimisticResource","target","document","generation","renderExplorerInto","options","relevantPanes","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","panes","openPane","paneSubject","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","parentContainer","nextPane","request","folderView","solo","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","candidate","containerHasIndexDocument","applicationSubject","sourcePane","preserveSubject","useIndexedApplication","indexedContainer","divider","clientWidth","getBoundingClientRect","hasPointerCapture","releasePointerCapture","renderStorageHeader","renderContentError","handleResourceSelected","handleFolderPaneResourceError","handleSidebarPointerDown","handleSidebarPointerMove","handleSidebarPointerEnd","handleSidebarResizeKey","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","_FolderPaneCreateDial","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_selectedResourceDecs","_init_selectedResource","_standaloneBreadcrumbRootDecs","_init_standaloneBreadcrumbRoot","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_sidebarCollapsedDecs","_init_sidebarCollapsed","_sidebarWidthDecs","_init_sidebarWidth","_sidebarMaximumWidthDecs","_init_sidebarMaximumWidth","_contentErrorDecs","_init_contentError","_showingContainerDecs","_init_showingContainer","_canCreateDecs","_init_canCreate","_contentViewDecs","_init_contentView","_fullViewTargetDecs","_init_fullViewTarget","_sidebarDecs","_init_sidebar","_statusAreaDecs","_init_statusArea","_ref","_defineProperty","_toPropertyKey","r","t","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","clampSidebarWidth","availableWidth","availableSidebarWidth","requestedWidth","customElement","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","property","state","query","WebComponent","args","resourceAccessCache","event","authn","pane","container","dom","statusArea","operationGeneration","paneName","getPaneLabel","name","resolve","isSafeCreationName","invalidCreationNameMessage","created","mintPaneInstance","stillOwnsNavigation","error$1","error","PaneMintError","setMintStatus","input","files","message","resource","parent","activeContainer","containerView","invalidateRenderRequest","retry","selectedResource","subject","clearFailedResource","home","view","separator","drag","width","sidebar","resizer","focusWasInSidebar","focusWasOnResizer","title","shell","aclControl","authSession","entries","resourceLogic","validFiles","file","errors","uploadGeneration","uploadContext","remaining","finish","results","result","canNavigateToUpload","openUploadedResource","prefix","changedProperties","url","pathSegments","clearContent","store","fetcher","retryFailed","isAccessDeniedError","currentPane","selected","indexedContainerUri","getIndexedContainer","isContainerResource","root","rootUri","force","permissionGeneration","metadata","warn","canCreate","navigationGeneration","navigationContext","reload","log","confirmed","containedResource","members","ns","member","newInstance","target","generation","isJavaScriptFile","relevantPanes","getRelevantPanes","options","selectedPane","getPreferredPane","paneElement","provider","menuItems","preparePaneMenuItems","FILE_EXPLORER_OPEN_PANE_EVENT","paneSubject","FILE_EXPLORER_BACK_EVENT","isExplorerEvent","parentContainer","nextPane","request","isCurrentRenderRequest","composeExplorer","renderGeneration","browserContext","isCurrentSelection","candidate","indexRequested","applicationSubject","getIndexedApplicationSubject","sourcePane","useIndexedApplication","preserveSubject","indexedContainer","divider","nothing"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getPreferredPane, getRelevantPanes, isExplorerEvent, log, ns, preparePaneMenuItems, showDialog, WebComponent } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\nimport { resourceAccessCache } from '../../accessCache'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport type { PropertyValues } from 'lit'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport '../folder-pane-container'\nimport '../folder-pane-sidebar'\nimport '../folder-pane-content'\nimport '../folder-pane-storage-header'\nimport type { NamedNode } from 'rdflib'\nimport 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/button'\nimport type FileExplorerProvider from 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/error-state'\nimport 'solid-ui/components/file-explorer-header'\nimport type FolderPaneContainer from '../folder-pane-container/FolderPaneContainer'\nimport '~icons/lucide/chevron-left'\nimport { getIndexedApplicationSubject, getIndexedContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile, type FolderPaneResourceLogic } from '../../helpers'\nimport { invalidateRenderRequest, isCurrentRenderRequest, type RenderRequest } from './renderRequest'\nimport FolderPaneCreateDialog from '../folder-pane-storage-header/FolderPaneCreateDialog'\nimport { getPaneLabel } from '../../helpers'\nimport { isSafeCreationName, invalidCreationNameMessage } from '../../creationSafety'\nimport { mintPaneInstance, PaneMintError, setMintStatus } from '../../mintPaneInstance'\nimport * as debug from '../../debug'\nimport { clearFailedResource } from './resourceLoad'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (multi-file uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\n}\n\ntype ContentError = {\n title: string\n message: string\n retry?: () => void\n}\n\nexport const DEFAULT_SIDEBAR_WIDTH = 256\nexport const MIN_SIDEBAR_WIDTH = 180\nexport const MAX_SIDEBAR_WIDTH = 480\nexport const MIN_CONTENT_WIDTH = 320\nexport const SIDEBAR_RESIZE_STEP = 16\nexport const NARROW_PANE_BREAKPOINT = 768\n\nexport function clampSidebarWidth (requestedWidth: number, availableWidth: number): number {\n if (!Number.isFinite(availableWidth) || availableWidth <= MIN_CONTENT_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const availableSidebarWidth = availableWidth - MIN_CONTENT_WIDTH\n if (availableSidebarWidth < MIN_SIDEBAR_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const requested = Number.isFinite(requestedWidth) ? requestedWidth : DEFAULT_SIDEBAR_WIDTH\n return Math.min(MAX_SIDEBAR_WIDTH, availableSidebarWidth, Math.max(MIN_SIDEBAR_WIDTH, requested))\n}\n\n@customElement('folder-pane-view')\nexport default class FolderPaneView extends WebComponent {\n @property({ attribute: false })\n accessor browserContext: DataBrowserContext | undefined = undefined\n\n private get store () {\n return this.browserContext?.session.store\n }\n\n @property({ attribute: false })\n accessor subject: NamedNode | undefined = undefined\n\n private get resourceLogic (): FolderPaneResourceLogic | undefined {\n return this.browserContext?.session.logic.resource as FolderPaneResourceLogic | undefined\n }\n\n private get displayedResource (): NamedNode | undefined {\n return this.selectedResource ?? this.subject\n }\n\n @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n private accessor standaloneBreadcrumbRoot: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor sidebarCollapsed = false\n\n @state()\n private accessor sidebarWidth = DEFAULT_SIDEBAR_WIDTH\n\n @state()\n private accessor sidebarMaximumWidth = MAX_SIDEBAR_WIDTH\n\n @state()\n private accessor contentError: ContentError | undefined = undefined\n\n @state()\n private accessor showingContainer = false\n\n @state()\n private accessor canCreate = false\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private permissionGeneration = 0\n private permissionRequest: { containerUri: string, resourceLogic: unknown } | undefined\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\n private sidebarResizeObserver: ResizeObserver | undefined\n private responsiveLayoutInitialized = false\n private sidebarDrag: {\n separator: HTMLElement\n pointerId: number\n startX: number\n startWidth: number\n } | undefined\n\n @query('folder-pane-content')\n private accessor contentView: HTMLElement | null = null\n\n @query('.folder-pane-full-view')\n private accessor fullViewTarget: HTMLElement | null = null\n\n @query('folder-pane-sidebar')\n private accessor sidebar: (HTMLElement & { refreshResources?: (container?: NamedNode) => void }) | null = null\n\n /** Below-content area for pane creation progress, errors and setup UI. */\n @query('.folder-pane-status')\n accessor statusArea: HTMLElement | null = null\n\n protected createRenderRoot () {\n return this\n }\n\n connectedCallback () {\n super.connectedCallback()\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver?.observe(shell)\n if (!this.dropProtectionAttached) {\n aclControl.preventBrowserDropEvents(this.ownerDocument)\n this.dropProtectionAttached = true\n }\n this.addEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.addEventListener('folder-pane-upload', this.handleUpload)\n this.addEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.addEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.addEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.addEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (!this.authListenersAttached) {\n authSession.events.on('login', this.handleAuthChange)\n authSession.events.on('logout', this.handleAuthChange)\n this.authListenersAttached = true\n }\n }\n\n disconnectedCallback () {\n this.finishSidebarResize()\n this.sidebarResizeObserver?.disconnect()\n // Invalidate awaited renders before detaching listeners. A late response\n // must never replace content in a detached view.\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n this.initialLoadGeneration++\n this.removeEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.removeEventListener('folder-pane-upload', this.handleUpload)\n this.removeEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.removeEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.removeEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.removeEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (this.authListenersAttached) {\n authSession.events.off('login', this.handleAuthChange)\n authSession.events.off('logout', this.handleAuthChange)\n this.authListenersAttached = false\n }\n super.disconnectedCallback()\n }\n\n protected firstUpdated () {\n this.updateSidebarBounds()\n if (typeof ResizeObserver !== 'undefined') {\n this.sidebarResizeObserver = new ResizeObserver(entries => {\n this.updateSidebarBounds()\n const width = entries[0]?.contentRect.width ?? 0\n if (this.responsiveLayoutInitialized || width <= 0) return\n this.responsiveLayoutInitialized = true\n if (width < NARROW_PANE_BREAKPOINT) {\n void this.handleSidebarToggle(new Event('folder-pane-responsive-collapse'))\n }\n })\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver.observe(shell)\n this.sidebarResizeObserver.observe(this)\n }\n }\n\n private handleAuthChange = () => {\n resourceAccessCache.clear()\n this.refreshCreationPermission(true)\n this.requestUpdate()\n }\n\n private handleCreatePane = async (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const pane = (event as CustomEvent<{ pane?: PaneDefinition }>).detail?.pane\n if (!pane?.mintNew) return\n const container = this.getActiveContainer()\n const dom = this.ownerDocument\n const statusArea = this.statusArea\n if (!container || !statusArea) return\n this.creationInFlight = true\n this.updateUploadAvailability()\n const operationGeneration = ++this.renderGeneration\n const paneName = getPaneLabel(pane)\n try {\n const name = await new Promise<string | undefined>(resolve => {\n showDialog(FolderPaneCreateDialog, {\n props: { label: paneName },\n onClose: resolve\n })\n })\n if (!name || !authn.currentUser()) return\n if (operationGeneration !== this.renderGeneration ||\n this.getActiveContainer()?.sameTerm(container) !== true) return\n if (!isSafeCreationName(name)) {\n setMintStatus(statusArea, 'error', invalidCreationNameMessage)\n return\n }\n this.clearContentForCreation()\n const created = await mintPaneInstance({\n context: this.browserContext!,\n container,\n pane,\n name,\n noun: paneName,\n statusArea,\n me: authn.currentUser() ?? undefined,\n dom\n })\n const stillOwnsNavigation = operationGeneration === this.renderGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n await this.showCreatedResource({\n container,\n ...created,\n pane,\n newInstance: stillOwnsNavigation ? created.newInstance : undefined\n })\n } catch (error) {\n debug.error('Unable to create folder-pane resource', error)\n if (!(error instanceof PaneMintError) && this.statusArea) {\n setMintStatus(this.statusArea, 'error', `Unable to create ${paneName}: ${error instanceof Error ? error.message : String(error)}`)\n }\n } finally {\n this.creationInFlight = false\n this.updateUploadAvailability()\n }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n void this.uploadFiles(Array.from(input.files ?? []), true)\n })\n input.click()\n }\n\n private handleDroppedFiles = (event: Event) => {\n event.stopPropagation()\n const files = (event as CustomEvent<{ files: File[] }>).detail?.files ?? []\n void this.uploadFiles(files, false)\n }\n\n private handleUploadRejected = (event: Event) => {\n event.stopPropagation()\n const message = (event as CustomEvent<{ message?: string }>).detail?.message\n if (message && this.statusArea) setMintStatus(this.statusArea, 'error', message)\n }\n\n private handleResourceDeleted = (event: Event) => {\n const resource = (event as CustomEvent<{ resource?: NamedNode }>).detail?.resource\n if (!resource) return\n\n const parent = resource.dir()\n const activeContainer = this.getActiveContainer()\n if (parent) {\n this.sidebar?.refreshResources?.(parent)\n }\n\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void }) | null\n if (parent && activeContainer?.sameTerm(parent)) {\n void containerView?.refresh?.()\n }\n\n if (!this.selectedResource?.sameTerm(resource)) return\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n const container = parent ?? this.subject\n if (container) {\n this.selectedResource = container\n this.renderContainerView(container)\n } else {\n this.selectedResource = undefined\n }\n }\n\n private async uploadFiles (files: File[], openUploadedResource: boolean) {\n if (this.creationInFlight || !authn.currentUser() || !this.canCreate) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n const resourceLogic = this.resourceLogic\n if (!files.length || !container || !statusArea || !this.store || !resourceLogic) return\n\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n const errors = invalidFiles.map(file => `${file.name}: ${invalidCreationNameMessage}`)\n if (!validFiles.length) {\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n return\n }\n\n this.creationInFlight = true\n this.updateUploadAvailability()\n const uploadGeneration = this.renderGeneration\n const uploadContext = this.browserContext\n let remaining = validFiles.length\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n this.updateUploadAvailability()\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n try {\n const results = await resourceLogic.uploadFiles(validFiles, container.uri)\n for (const result of results) {\n if (!result.success) {\n const prefix = result.error.destinationUri\n ? `Upload failed while putting ${result.error.destinationUri}`\n : `Upload failed for ${result.file.name}`\n const message = result.error.status === 413\n ? `${prefix}: storage quota was exceeded. ${result.error.message}`\n : result.error.status\n ? `${prefix} (HTTP ${result.error.status}). ${result.error.message}`\n : `${prefix}. ${result.error.message}`\n errors.push(message)\n finish()\n continue\n }\n\n try {\n const canNavigateToUpload = this.renderGeneration === uploadGeneration &&\n this.browserContext === uploadContext\n await this.showCreatedResource({\n container,\n containedResource: this.store.sym(result.uploadedUri),\n newInstance: openUploadedResource && validFiles.length === 1 && canNavigateToUpload\n ? this.store.sym(result.uploadedUri)\n : undefined\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Uploaded ${result.file.name}, but could not refresh the folder: ${message}`)\n } finally {\n finish()\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Unable to upload files: ${message}`)\n while (remaining > 0) finish()\n }\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n this.refreshCreationPermission()\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('selectedResource')) {\n this.refreshCreationPermission()\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\n if (this.subject) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n }\n if (this.selectedResource) {\n void this.showResourceInContentView(this.selectedResource)\n } else if (this.subject) {\n this.renderContainerView(this.subject)\n }\n }\n }\n\n private getStandaloneBreadcrumbRoot (subject: NamedNode): NamedNode {\n try {\n const url = new URL(subject.uri)\n const pathSegments = url.pathname.split('/').filter(Boolean)\n if (pathSegments.length <= 1) return subject\n return this.store?.sym(`${url.origin}/${pathSegments[0]}/`) ?? subject\n } catch {\n return subject\n }\n }\n\n // Lit never renders inside these targets; panes, explorers and containers\n // are inserted imperatively, and Lit-rendered errors sit beside them.\n private get resourceTarget () {\n return this.fullView ? this.fullViewTarget : this.contentView\n }\n\n private showContentError (error: ContentError, clearContent = true) {\n if (clearContent) this.resourceTarget?.replaceChildren()\n this.contentError = error\n }\n\n private renderAccessDeniedScreen () {\n this.showContentError({\n title: 'Access denied',\n message: 'You do not have access to the contents of this container.'\n })\n }\n\n private async loadResource (resource: NamedNode, retryFailed = false): Promise<void> {\n const store = this.store\n if (!store) return\n const fetcher = store.fetcher\n // A failed request can be cached by rdflib. Do not clear it during normal\n // navigation: persistent failures such as CORS errors should settle once\n // instead of causing a new request on every render. An explicit retry is\n // the point at which the cached failure should be discarded.\n if (retryFailed) clearFailedResource(fetcher, resource)\n try {\n await fetcher.load(resource)\n } catch (error) {\n if (!retryFailed || !isAccessDeniedError(error) || !authn.currentUser()) throw error\n await fetcher.load(resource, { force: true, clearPreviousData: true })\n }\n }\n\n private clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\n const retry = this.contentError?.retry\n if (retry) {\n this.clearContentError()\n retry()\n return\n }\n\n const selectedResource = this.selectedResource\n const subject = this.subject\n if (!selectedResource && !subject) return\n this.clearContentError()\n if (selectedResource) {\n void this.showResourceInContentView(selectedResource, undefined, false, true)\n } else if (subject) {\n if (this.store) clearFailedResource(this.store.fetcher, subject)\n void this.showInitialContainer(subject)\n }\n }\n\n /**\n * Select the resource returned by a pane's mintNew implementation. Some\n * panes (notably long chat) mint a resource inside the new document rather\n * than the container URI itself, so routing this through the normal\n * selection path is important.\n */\n openCreatedResource (resource: NamedNode, pane?: PaneDefinition) {\n this.searchQuery = ''\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n // Resolve the pane again from the registry. Creation menu entries can be\n // replaced while the async mint is running; retaining that stale object\n // lets a different relevant pane (notably profile for pad indexes) win.\n const currentPane = pane?.name\n ? this.browserContext?.session.paneRegistry.byName(pane.name) ?? pane\n : pane\n this.showSubject(resource, typeof currentPane?.render === 'function' ? currentPane : undefined)\n }\n\n /**\n * The storage header belongs to the explorer, while its actions apply to\n * the container currently being viewed. A document selection has no\n * writable container of its own, so use its parent when it remains within\n * the explorer root; otherwise retain the last browsed container.\n */\n getActiveContainer (): NamedNode | undefined {\n const selected = this.selectedResource\n const indexedContainerUri = selected ? getIndexedContainer(selected) : undefined\n if (indexedContainerUri && this.store) {\n return this.store.sym(indexedContainerUri)\n }\n if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = this.fullView ? this.standaloneBreadcrumbRoot : this.subject\n const parent = selected?.dir()\n const rootUri = root?.uri.endsWith('/') ? root.uri : `${root?.uri}/`\n if (root && parent && rootUri && parent.uri.startsWith(rootUri)) {\n return parent\n }\n\n return this.subject\n }\n\n private refreshCreationPermission (force = false) {\n const container = this.getActiveContainer()\n const resourceLogic = this.browserContext?.session.logic.resource\n if (\n !force &&\n container &&\n resourceLogic &&\n this.permissionRequest?.containerUri === container.uri &&\n this.permissionRequest.resourceLogic === resourceLogic\n ) return\n\n const permissionGeneration = ++this.permissionGeneration\n this.setCanCreate(false)\n this.permissionRequest = container && resourceLogic\n ? { containerUri: container.uri, resourceLogic }\n : undefined\n if (!container || !resourceLogic) return\n\n void resourceLogic.fetchMetadata(container)\n .then(metadata => {\n if (\n permissionGeneration === this.permissionGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n ) {\n this.setCanCreate(metadata.access.canEdit)\n }\n })\n .catch(error => {\n if (permissionGeneration === this.permissionGeneration) {\n this.permissionRequest = undefined\n debug.warn('Unable to determine folder creation permission', error)\n }\n })\n }\n\n private updateUploadAvailability () {\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (FolderPaneContainer & { subject?: NamedNode, uploadBusy?: boolean }) | null\n const activeContainer = this.getActiveContainer()\n if (!containerView) return\n containerView.canUpload = this.canCreate &&\n !this.creationInFlight &&\n !!activeContainer &&\n containerView.subject?.sameTerm(activeContainer) === true\n containerView.uploadBusy = this.creationInFlight\n }\n\n private setCanCreate (canCreate: boolean) {\n this.canCreate = canCreate\n this.updateUploadAvailability()\n }\n\n clearContentForCreation () {\n this.resourceTarget?.replaceChildren()\n }\n\n /**\n * Reload the server-backed container listing after a pane minted a new\n * resource, refresh the sidebar and container view, then open the result.\n */\n async showCreatedResource ({ container, containedResource, newInstance, pane }: CreatedResource) {\n const store = this.store\n if (!store) return\n const navigationGeneration = this.renderGeneration\n const navigationContext = this.browserContext\n const reload = async (resource: NamedNode): Promise<boolean> => {\n try {\n await store.fetcher.load(resource, { force: true, clearPreviousData: true })\n return true\n } catch (error) {\n log.warn('Unable to reload ' + resource.uri + ': ' + error)\n return false\n }\n }\n\n const confirmed = await reload(container)\n if (containedResource.uri.endsWith('/')) {\n await reload(containedResource)\n // Panes may probe their new documents before writing them; forget those\n // cached 404s so rendering loads what the pane actually created.\n const members = store.each(containedResource, ns.ldp('contains'), undefined, containedResource.doc())\n for (const member of members) {\n if (member.termType === 'NamedNode' && store.fetcher.getState(member.value) === 'failed') {\n store.fetcher.unload(member as NamedNode)\n }\n }\n }\n\n this.sidebar?.refreshResources?.(container)\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void, addOptimisticResource?: (resource: NamedNode) => void }) | null\n if (!confirmed && containerView?.addOptimisticResource) {\n containerView.addOptimisticResource(containedResource)\n }\n if (confirmed) {\n containerView?.refresh?.()\n }\n if (\n newInstance &&\n this.isConnected &&\n this.renderGeneration === navigationGeneration &&\n this.browserContext === navigationContext\n ) {\n this.openCreatedResource(newInstance, pane)\n }\n }\n\n private renderContainerView (selectedResource: NamedNode) {\n const target = this.resourceTarget\n if (!target) return\n\n this.contentError = undefined\n const containerView = document.createElement('folder-pane-container') as FolderPaneContainer\n\n containerView.subject = selectedResource\n containerView.resourceLogic = this.resourceLogic ?? null\n containerView.browserContext = this.browserContext\n const activeContainer = this.getActiveContainer()\n containerView.canUpload = this.canCreate &&\n !!activeContainer &&\n selectedResource.sameTerm(activeContainer)\n containerView.uploadBusy = this.creationInFlight\n containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n\n this.showingContainer = true\n target.replaceChildren(containerView)\n }\n\n private async showInitialContainer (subject: NamedNode) {\n const generation = ++this.initialLoadGeneration\n\n if (isJavaScriptFile(subject)) {\n this.showSubject(subject)\n return\n }\n\n if (!this.store || !this.resourceLogic) return\n\n try {\n await this.loadResource(subject)\n } catch (error) {\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n if (isAccessDeniedError(error)) {\n const target = this.resourceTarget\n if (target) this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load storage container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n this.sidebar?.refreshResources?.()\n this.requestUpdate()\n if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private async renderExplorerInto (\n target: HTMLElement,\n subject: NamedNode,\n pane: PaneDefinition | undefined,\n options: ExplorerRenderOptions = {}\n ) {\n if (!this.browserContext) return\n\n const relevantPanes = await getRelevantPanes(subject, this.browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (options.isCurrent && !options.isCurrent()) return\n const selectedPane = pane || getPreferredPane(subject, this.browserContext, relevantPanes)\n if (!selectedPane) {\n this.renderExplorerError(subject, 'No pane is available to display this resource.')\n return\n }\n\n let paneElement: HTMLElement\n try {\n paneElement = selectedPane.render(subject, this.browserContext, options.paneOptions || {})\n } catch (error) {\n log.error('Unable to render selected pane: ' + error)\n this.renderExplorerError(subject, 'The selected pane could not render this resource.')\n return\n }\n\n const provider = target.ownerDocument.createElement('solid-ui-file-explorer-provider') as FileExplorerProvider\n const menuItems = await preparePaneMenuItems({\n subject,\n context: this.browserContext,\n panes: relevantPanes,\n openPane: (paneSubject, paneName) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: paneSubject.uri, paneName }\n }))\n }\n })\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n // Return to the container that owns the displayed resource. Using the\n // explorer root here loses the user's position for resources in nested\n // containers.\n const parentContainer = this.getActiveContainer() || this.subject || subject\n this.renderGeneration++\n this.selectedResource = parentContainer\n this.renderContainerView(parentContainer)\n })\n provider.addEventListener(FILE_EXPLORER_OPEN_PANE_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n const paneName = (event as CustomEvent<{ paneName: string }>).detail?.paneName\n const nextPane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (nextPane) {\n const request: RenderRequest = {\n generation: ++this.renderGeneration,\n subjectUri: subject.uri,\n context: this.browserContext\n }\n this.renderExplorerInto(target, subject, nextPane, {\n ...options,\n paneOptions: nextPane.name === 'folder'\n ? { folderView: 'container', fullView: true, solo: true }\n : options.paneOptions,\n isCurrent: () => isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n )\n }).catch(error => {\n log.error('Unable to switch selected pane: ' + error)\n })\n }\n })\n\n composeExplorer(provider, {\n context: this.browserContext,\n subjectUri: subject.uri,\n pane: selectedPane,\n relevantPanes,\n header: options.showHeader === false\n ? undefined\n : { paneIcon: selectedPane.icon, menuItems },\n paneElement\n })\n if (options.isCurrent && !options.isCurrent()) return\n this.contentError = undefined\n this.showingContainer = false\n target.replaceChildren(provider)\n }\n\n private renderExplorerError (subject: NamedNode, message: string) {\n this.showContentError({ title: message, message: subject.uri })\n }\n\n private async showResourceInContentView (\n selectedResource: NamedNode,\n pane?: PaneDefinition,\n indexRequested = false,\n retryFailed = false\n ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n const browserContext = this.browserContext\n if (!target || !this.store || !this.resourceLogic || !browserContext) return\n\n const request: RenderRequest = {\n generation: renderGeneration,\n subjectUri: selectedResource.uri,\n context: this.browserContext\n }\n const isCurrentSelection = (candidate: NamedNode) =>\n isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n ) && candidate.uri === request.subjectUri\n\n if (!isCurrentSelection(selectedResource)) return\n\n if (\n this.subject?.sameTerm(selectedResource) &&\n !pane &&\n !indexRequested &&\n isContainerResource(selectedResource, this.resourceLogic)\n ) {\n this.renderContainerView(selectedResource)\n return\n }\n\n // A pane supplied by an explicit creation or pane-selection action is\n // authoritative. In particular, freshly created text resources can\n // briefly inherit container metadata while the store is refreshed.\n // Some servers report file resources as containers. Keep known file\n // types out of the folder branch so pane selection can run normally.\n if (\n isContainerResource(selectedResource, this.resourceLogic) &&\n (pane?.name !== 'source' || indexRequested)\n ) {\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load selected container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (!isCurrentSelection(selectedResource)) return\n this.sidebar?.refreshResources?.()\n\n if (pane?.name === 'folder') {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (\n !pane &&\n (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource))\n ) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource)\n )\n try {\n await this.loadResource(applicationSubject.doc(), retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load container index document: ' + error)\n }\n await this.renderExplorerInto(target, applicationSubject, pane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n const relevantPanes = await getRelevantPanes(selectedResource, browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (!isCurrentSelection(selectedResource)) return\n\n const selectedPane = pane || getPreferredPane(selectedResource, browserContext, relevantPanes)\n if (selectedPane?.name !== 'folder') {\n await this.renderExplorerInto(target, selectedResource, selectedPane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.warn('Unable to load selected resource metadata: ' + error)\n }\n\n if (!isCurrentSelection(selectedResource)) return\n const sourcePane = isJavaScriptFile(selectedResource)\n ? this.browserContext?.session.paneRegistry.byName('source')\n : undefined\n if (!pane && isJavaScriptFile(selectedResource) && !sourcePane) {\n this.renderExplorerError(selectedResource, 'The Source pane is unavailable to display this JavaScript file.')\n return\n }\n await this.renderExplorerInto(target, selectedResource, pane || sourcePane, {\n isCurrent: () => isCurrentSelection(selectedResource)\n })\n } catch (error) {\n log.error('Unable to render selected resource: ' + error)\n if (renderGeneration === this.renderGeneration && this.resourceTarget) {\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n this.renderExplorerError(selectedResource, 'Unable to display the selected resource.')\n }\n }\n }\n\n private showSubject (resource: NamedNode, pane?: PaneDefinition, preserveSubject = false) {\n // `container/index.ttl#this` is rendered exactly like selecting its container,\n // so indexed panes never show the file-explorer header on either route.\n const useIndexedApplication = !preserveSubject && pane?.name !== 'sharing'\n const indexedContainerUri = useIndexedApplication ? getIndexedContainer(resource) : undefined\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = useIndexedApplication && !indexedContainer &&\n !!this.resourceLogic &&\n isContainerResource(resource, this.resourceLogic) &&\n this.resourceLogic.containerHasIndexDocument(resource)\n this.selectedResource = subject\n // Render directly so re-selecting the same resource still replaces the content target.\n void this.showResourceInContentView(subject, pane, !!indexedContainer || indexRequested)\n }\n\n private handleResourceSelected = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.searchQuery = ''\n this.showSubject(resource)\n }\n\n private handleResourceOpenPane = (event: CustomEvent<{ resource: NamedNode, paneName: string }>) => {\n const resource = event.detail?.resource\n const paneName = event.detail?.paneName\n const pane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (!resource || !pane) return\n event.stopPropagation()\n this.searchQuery = ''\n if (pane.name === 'folder') {\n this.showSubject(resource, pane, true)\n return\n }\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n this.showSubject(resource, typeof pane?.render === 'function' ? pane : undefined, true)\n }\n\n private setContainerView (view: 'grid' | 'list') {\n this.containerView = view\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.view = view\n }\n\n private handleSelectHome = () => {\n this.searchQuery = ''\n const home = this.subject && this.standaloneBreadcrumbRoot?.sameTerm(this.subject)\n ? this.subject\n : this.standaloneBreadcrumbRoot\n if (home) this.showSubject(home)\n }\n\n private handleSearch = (event: CustomEvent<{ query: string }>) => {\n event.stopPropagation()\n this.searchQuery = event.detail?.query || ''\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.searchQuery = this.searchQuery\n }\n\n private handleSelectBreadcrumbResource = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.showSubject(resource)\n }\n\n private handleContainerViewChange = (event: CustomEvent<{ view: 'grid' | 'list' }>) => {\n const view = event.detail?.view\n if (!view) return\n event.stopPropagation()\n this.setContainerView(view)\n }\n\n private get sidebarAvailableWidth () {\n const shell = this.renderRoot.querySelector<HTMLElement>('.folder-pane-main-content')\n const divider = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resizer')\n return (shell?.clientWidth ?? 0) - (divider?.getBoundingClientRect().width ?? 0)\n }\n\n private resizeSidebar (width: number) {\n this.sidebarWidth = clampSidebarWidth(width, this.sidebarAvailableWidth)\n }\n\n private updateSidebarBounds = () => {\n if (!this.isConnected) return\n this.sidebarMaximumWidth = clampSidebarWidth(MAX_SIDEBAR_WIDTH, this.sidebarAvailableWidth)\n this.resizeSidebar(this.sidebarWidth)\n }\n\n private handleSidebarPointerDown = (event: PointerEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.button !== 0 || !event.isPrimary) return\n event.preventDefault()\n const separator = event.currentTarget as HTMLElement\n separator.setPointerCapture(event.pointerId)\n separator.focus()\n this.sidebarDrag = {\n separator,\n pointerId: event.pointerId,\n startX: event.clientX,\n startWidth: this.sidebarWidth\n }\n this.requestUpdate()\n }\n\n private handleSidebarPointerMove = (event: PointerEvent) => {\n const drag = this.sidebarDrag\n if (!this.isConnected || this.sidebarCollapsed || !drag || drag.pointerId !== event.pointerId) return\n this.resizeSidebar(drag.startWidth + event.clientX - drag.startX)\n }\n\n private finishSidebarResize () {\n const drag = this.sidebarDrag\n if (!drag) return\n this.sidebarDrag = undefined\n if (drag.separator.hasPointerCapture(drag.pointerId)) {\n drag.separator.releasePointerCapture(drag.pointerId)\n }\n if (this.isConnected) this.requestUpdate()\n }\n\n private handleSidebarPointerEnd = (event: PointerEvent) => {\n if (this.sidebarDrag?.pointerId === event.pointerId) this.finishSidebarResize()\n }\n\n private handleSidebarResizeKey = (event: KeyboardEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.altKey || event.ctrlKey || event.metaKey) return\n let width: number\n switch (event.key) {\n case 'ArrowLeft': width = this.sidebarWidth - SIDEBAR_RESIZE_STEP; break\n case 'ArrowRight': width = this.sidebarWidth + SIDEBAR_RESIZE_STEP; break\n case 'Home': width = MIN_SIDEBAR_WIDTH; break\n case 'End': width = MAX_SIDEBAR_WIDTH; break\n default: return\n }\n event.preventDefault()\n event.stopPropagation()\n this.resizeSidebar(width)\n }\n\n private handleSidebarToggle = async (event: Event) => {\n event.stopPropagation()\n const sidebar = this.sidebar\n const resizer = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resize-handle')\n const focusWasInSidebar = !!sidebar && (\n sidebar.matches(':focus-within') ||\n sidebar.shadowRoot?.activeElement != null\n )\n const focusWasOnResizer = resizer === this.ownerDocument.activeElement\n this.finishSidebarResize()\n this.sidebarCollapsed = !this.sidebarCollapsed\n if (!this.sidebarCollapsed || (!focusWasInSidebar && !focusWasOnResizer)) return\n await this.updateComplete\n this.renderRoot.querySelector<HTMLButtonElement>('.folder-pane-sidebar-toggle')?.focus()\n }\n\n private handleFolderPaneResourceError = (event: CustomEvent<{\n title?: string\n message?: string\n retry?: () => void\n }>) => {\n event.stopPropagation()\n const title = event.detail?.title || 'Unable to load this folder'\n const message = event.detail?.message || 'The folder could not be loaded. Try again.'\n this.showContentError({\n title,\n message,\n retry: event.detail?.retry\n }, false)\n }\n\n render () {\n if (this.fullView) {\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n >\n ${this.showingContainer ? this.renderStorageHeader() : nothing}\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n ></div>\n <div class=\"folder-pane-status\"></div>\n </folder-pane-provider>\n `\n }\n\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n .sidebarCollapsed=${this.sidebarCollapsed}\n >\n ${this.renderStorageHeader()}\n <div\n class=\"folder-pane-main-content\"\n data-sidebar-collapsed=${String(this.sidebarCollapsed)}\n style=${`--folder-pane-sidebar-width: ${this.sidebarWidth}px`}\n @resource-selected=${this.handleResourceSelected}\n @folder-pane-resource-error=${this.handleFolderPaneResourceError}\n @folder-pane-toggle-sidebar=${this.handleSidebarToggle}\n >\n <folder-pane-sidebar\n ?inert=${this.sidebarCollapsed}\n aria-hidden=${this.sidebarCollapsed ? 'true' : 'false'}\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.displayedResource}\n ></folder-pane-sidebar>\n <div\n class=\"folder-pane-sidebar-resizer\"\n data-resizing=${String(!!this.sidebarDrag)}\n >\n <div\n class=\"folder-pane-sidebar-resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize navigation sidebar\"\n aria-valuemin=${MIN_SIDEBAR_WIDTH}\n aria-valuemax=${this.sidebarMaximumWidth}\n aria-valuenow=${this.sidebarWidth}\n tabindex=${this.sidebarCollapsed ? -1 : 0}\n ?hidden=${this.sidebarCollapsed}\n ?inert=${this.sidebarCollapsed}\n @pointerdown=${this.handleSidebarPointerDown}\n @pointermove=${this.handleSidebarPointerMove}\n @pointerup=${this.handleSidebarPointerEnd}\n @pointercancel=${this.handleSidebarPointerEnd}\n @lostpointercapture=${this.handleSidebarPointerEnd}\n @keydown=${this.handleSidebarResizeKey}\n ></div>\n <button\n type=\"button\"\n class=\"folder-pane-sidebar-toggle\"\n aria-label=${this.sidebarCollapsed ? 'Expand navigation' : 'Collapse navigation'}\n aria-expanded=${String(!this.sidebarCollapsed)}\n @click=${this.handleSidebarToggle}\n >\n <icon-lucide-chevron-left\n class=${`folder-pane-sidebar-toggle-icon${this.sidebarCollapsed ? ' folder-pane-sidebar-toggle-icon-collapsed' : ''}`}\n aria-hidden=\"true\"\n ></icon-lucide-chevron-left>\n </button>\n </div>\n <div class=\"folder-pane-content-column\">\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n <div class=\"folder-pane-status\"></div>\n </div>\n </div>\n </folder-pane-provider>\n `\n }\n\n private renderStorageHeader () {\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .breadcrumbRoot=${this.standaloneBreadcrumbRoot}\n .selectedResource=${this.getActiveContainer()}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n @folder-pane-select-home=${this.handleSelectHome}\n @folder-pane-select-resource=${this.handleSelectBreadcrumbResource}\n @folder-pane-change-view=${this.handleContainerViewChange}\n @folder-pane-search=${this.handleSearch}\n ></folder-pane-storage-header>\n `\n }\n\n private renderContentError () {\n if (this.contentError) {\n return html`\n <div class=\"folder-pane-resource-error\" role=\"status\">\n <solid-ui-error-state\n .title=${this.contentError.title}\n .message=${this.contentError.message}\n @close=${this.clearContentError}\n >\n <button type=\"button\" @click=${this.retryContent}>Retry</button>\n </solid-ui-error-state>\n </div>\n `\n }\n\n return nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAC,IAAAnB,KAAA4T,GAAA,CAAAxW,IAAAyW,OAAAC,GAAAJ,IAAA;CAAA;EAAAlV;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAAxC,IAAA,GAAA,KAAA,GAlrC2CxC,CAAY,GAAAkZ,GAAA"}
1
+ {"version":3,"file":"FolderPaneView.esm.js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getPreferredPane","getRelevantPanes","isExplorerEvent","log","ns","preparePaneMenuItems","showDialog","WebComponent","authn","authSession","resourceAccessCache","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","debug","clearFailedResource","DEFAULT_SIDEBAR_WIDTH","MIN_SIDEBAR_WIDTH","MAX_SIDEBAR_WIDTH","MIN_CONTENT_WIDTH","SIDEBAR_RESIZE_STEP","NARROW_PANE_BREAKPOINT","clampSidebarWidth","requestedWidth","availableWidth","Number","isFinite","availableSidebarWidth","Math","min","max","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_selectedResourceDecs","_standaloneBreadcrumbRootDecs","_containerViewDecs","_searchQueryDecs","_sidebarCollapsedDecs","_sidebarWidthDecs","_sidebarMaximumWidthDecs","_contentErrorDecs","_showingContainerDecs","_canCreateDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_selectedResource","_init_standaloneBreadcrumbRoot","_init_containerView","_init_searchQuery","_init_sidebarCollapsed","_init_sidebarWidth","_init_sidebarMaximumWidth","_init_contentError","_init_showingContainer","_init_canCreate","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","clear","refreshCreationPermission","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","updateUploadAvailability","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","Error","message","String","input","createElement","multiple","addEventListener","uploadFiles","Array","from","files","click","resource","parent","dir","activeContainer","sidebar","refreshResources","containerView","resourceTarget","querySelector","refresh","selectedResource","subject","renderContainerView","contentError","retry","clearContentError","showResourceInContentView","store","fetcher","showInitialContainer","searchQuery","showSubject","session","paneRegistry","byName","render","home","standaloneBreadcrumbRoot","view","setContainerView","isConnected","sidebarMaximumWidth","sidebarAvailableWidth","resizeSidebar","sidebarWidth","sidebarCollapsed","sidebarDrag","button","isPrimary","preventDefault","separator","currentTarget","setPointerCapture","pointerId","focus","startX","clientX","startWidth","drag","finishSidebarResize","altKey","ctrlKey","metaKey","width","key","resizer","renderRoot","focusWasInSidebar","matches","shadowRoot","activeElement","focusWasOnResizer","updateComplete","title","showContentError","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","displayedResource","fullView","showingContainer","canCreate","contentView","fullViewTarget","createRenderRoot","connectedCallback","shell","sidebarResizeObserver","observe","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","handleDroppedFiles","handleUploadRejected","handleResourceOpenPane","handleResourceDeleted","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","disconnect","initialLoadGeneration","removeEventListener","off","firstUpdated","updateSidebarBounds","ResizeObserver","entries","contentRect","responsiveLayoutInitialized","handleSidebarToggle","Event","openUploadedResource","length","validFiles","filter","file","invalidFiles","errors","map","join","uploadGeneration","uploadContext","remaining","finish","dataset","status","replaceChildren","results","uri","result","success","prefix","destinationUri","push","canNavigateToUpload","containedResource","sym","uploadedUri","updated","changedProperties","has","getStandaloneBreadcrumbRoot","get","url","URL","pathSegments","pathname","split","origin","clearContent","renderAccessDeniedScreen","loadResource","retryFailed","load","force","clearPreviousData","openCreatedResource","currentPane","selected","indexedContainerUri","root","rootUri","endsWith","startsWith","permissionRequest","containerUri","permissionGeneration","setCanCreate","fetchMetadata","then","metadata","access","canEdit","catch","warn","canUpload","uploadBusy","navigationGeneration","navigationContext","reload","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","addOptimisticResource","target","document","generation","renderExplorerInto","options","relevantPanes","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","panes","openPane","paneSubject","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","parentContainer","nextPane","request","folderView","solo","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","candidate","containerHasIndexDocument","applicationSubject","sourcePane","preserveSubject","useIndexedApplication","indexedContainer","divider","clientWidth","getBoundingClientRect","hasPointerCapture","releasePointerCapture","renderStorageHeader","renderContentError","handleResourceSelected","handleFolderPaneResourceError","handleSidebarPointerDown","handleSidebarPointerMove","handleSidebarPointerEnd","handleSidebarResizeKey","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","_FolderPaneCreateDial","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_selectedResourceDecs","_init_selectedResource","_standaloneBreadcrumbRootDecs","_init_standaloneBreadcrumbRoot","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_sidebarCollapsedDecs","_init_sidebarCollapsed","_sidebarWidthDecs","_init_sidebarWidth","_sidebarMaximumWidthDecs","_init_sidebarMaximumWidth","_contentErrorDecs","_init_contentError","_showingContainerDecs","_init_showingContainer","_canCreateDecs","_init_canCreate","_contentViewDecs","_init_contentView","_fullViewTargetDecs","_init_fullViewTarget","_sidebarDecs","_init_sidebar","_statusAreaDecs","_init_statusArea","_ref","_defineProperty","_toPropertyKey","r","t","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","n","o","c","applyDec","m","h","y","v","g","b","u","w","S","A","d","p","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","clampSidebarWidth","availableWidth","availableSidebarWidth","requestedWidth","customElement","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_P","_Q","property","state","query","WebComponent","args","resourceAccessCache","event","authn","pane","container","dom","statusArea","operationGeneration","paneName","getPaneLabel","name","resolve","isSafeCreationName","invalidCreationNameMessage","created","mintPaneInstance","stillOwnsNavigation","error$1","error","PaneMintError","setMintStatus","input","files","message","resource","parent","activeContainer","containerView","invalidateRenderRequest","retry","selectedResource","subject","clearFailedResource","home","view","separator","drag","width","sidebar","resizer","focusWasInSidebar","focusWasOnResizer","title","shell","aclControl","authSession","entries","resourceLogic","validFiles","file","errors","uploadGeneration","uploadContext","remaining","finish","results","result","canNavigateToUpload","openUploadedResource","prefix","changedProperties","url","pathSegments","clearContent","store","fetcher","retryFailed","isAccessDeniedError","currentPane","selected","indexedContainerUri","getIndexedContainer","isContainerResource","root","rootUri","force","permissionGeneration","metadata","warn","canCreate","navigationGeneration","navigationContext","reload","log","confirmed","containedResource","members","ns","member","newInstance","target","generation","isJavaScriptFile","relevantPanes","getRelevantPanes","options","selectedPane","getPreferredPane","paneElement","provider","menuItems","preparePaneMenuItems","FILE_EXPLORER_OPEN_PANE_EVENT","paneSubject","FILE_EXPLORER_BACK_EVENT","isExplorerEvent","parentContainer","nextPane","request","isCurrentRenderRequest","composeExplorer","renderGeneration","browserContext","isCurrentSelection","candidate","indexRequested","applicationSubject","getIndexedApplicationSubject","sourcePane","useIndexedApplication","preserveSubject","indexedContainer","divider","nothing"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getPreferredPane, getRelevantPanes, isExplorerEvent, log, ns, preparePaneMenuItems, showDialog, WebComponent } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\nimport { resourceAccessCache } from '../../accessCache'\nimport { html, nothing } from 'lit'\nimport { property, query, state } from 'lit/decorators.js'\nimport type { PropertyValues } from 'lit'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport '../folder-pane-container'\nimport '../folder-pane-sidebar'\nimport '../folder-pane-content'\nimport '../folder-pane-storage-header'\nimport type { NamedNode } from 'rdflib'\nimport 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/button'\nimport type FileExplorerProvider from 'solid-ui/components/file-explorer-provider'\nimport 'solid-ui/components/error-state'\nimport 'solid-ui/components/file-explorer-header'\nimport type FolderPaneContainer from '../folder-pane-container/FolderPaneContainer'\nimport '~icons/lucide/chevron-left'\nimport { getIndexedApplicationSubject, getIndexedContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile, type FolderPaneResourceLogic } from '../../helpers'\nimport { invalidateRenderRequest, isCurrentRenderRequest, type RenderRequest } from './renderRequest'\nimport FolderPaneCreateDialog from '../folder-pane-storage-header/FolderPaneCreateDialog'\nimport { getPaneLabel } from '../../helpers'\nimport { isSafeCreationName, invalidCreationNameMessage } from '../../creationSafety'\nimport { mintPaneInstance, PaneMintError, setMintStatus } from '../../mintPaneInstance'\nimport * as debug from '../../debug'\nimport { clearFailedResource } from './resourceLoad'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (multi-file uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\n}\n\ntype ContentError = {\n title: string\n message: string\n retry?: () => void\n}\n\nexport const DEFAULT_SIDEBAR_WIDTH = 256\nexport const MIN_SIDEBAR_WIDTH = 180\nexport const MAX_SIDEBAR_WIDTH = 480\nexport const MIN_CONTENT_WIDTH = 320\nexport const SIDEBAR_RESIZE_STEP = 16\nexport const NARROW_PANE_BREAKPOINT = 768\n\nexport function clampSidebarWidth (requestedWidth: number, availableWidth: number): number {\n if (!Number.isFinite(availableWidth) || availableWidth <= MIN_CONTENT_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const availableSidebarWidth = availableWidth - MIN_CONTENT_WIDTH\n if (availableSidebarWidth < MIN_SIDEBAR_WIDTH) {\n return DEFAULT_SIDEBAR_WIDTH\n }\n const requested = Number.isFinite(requestedWidth) ? requestedWidth : DEFAULT_SIDEBAR_WIDTH\n return Math.min(MAX_SIDEBAR_WIDTH, availableSidebarWidth, Math.max(MIN_SIDEBAR_WIDTH, requested))\n}\n\n@customElement('folder-pane-view')\nexport default class FolderPaneView extends WebComponent {\n @property({ attribute: false })\n accessor browserContext: DataBrowserContext | undefined = undefined\n\n private get store () {\n return this.browserContext?.session.store\n }\n\n @property({ attribute: false })\n accessor subject: NamedNode | undefined = undefined\n\n private get resourceLogic (): FolderPaneResourceLogic | undefined {\n return this.browserContext?.session.logic.resource as FolderPaneResourceLogic | undefined\n }\n\n private get displayedResource (): NamedNode | undefined {\n return this.selectedResource ?? this.subject\n }\n\n @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n private accessor standaloneBreadcrumbRoot: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor sidebarCollapsed = false\n\n @state()\n private accessor sidebarWidth = DEFAULT_SIDEBAR_WIDTH\n\n @state()\n private accessor sidebarMaximumWidth = MAX_SIDEBAR_WIDTH\n\n @state()\n private accessor contentError: ContentError | undefined = undefined\n\n @state()\n private accessor showingContainer = false\n\n @state()\n private accessor canCreate = false\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private permissionGeneration = 0\n private permissionRequest: { containerUri: string, resourceLogic: unknown } | undefined\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\n private sidebarResizeObserver: ResizeObserver | undefined\n private responsiveLayoutInitialized = false\n private sidebarDrag: {\n separator: HTMLElement\n pointerId: number\n startX: number\n startWidth: number\n } | undefined\n\n @query('folder-pane-content')\n private accessor contentView: HTMLElement | null = null\n\n @query('.folder-pane-full-view')\n private accessor fullViewTarget: HTMLElement | null = null\n\n @query('folder-pane-sidebar')\n private accessor sidebar: (HTMLElement & { refreshResources?: (container?: NamedNode) => void }) | null = null\n\n /** Below-content area for pane creation progress, errors and setup UI. */\n @query('.folder-pane-status')\n accessor statusArea: HTMLElement | null = null\n\n protected createRenderRoot () {\n return this\n }\n\n connectedCallback () {\n super.connectedCallback()\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver?.observe(shell)\n if (!this.dropProtectionAttached) {\n aclControl.preventBrowserDropEvents(this.ownerDocument)\n this.dropProtectionAttached = true\n }\n this.addEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.addEventListener('folder-pane-upload', this.handleUpload)\n this.addEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.addEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.addEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.addEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (!this.authListenersAttached) {\n authSession.events.on('login', this.handleAuthChange)\n authSession.events.on('logout', this.handleAuthChange)\n this.authListenersAttached = true\n }\n }\n\n disconnectedCallback () {\n this.finishSidebarResize()\n this.sidebarResizeObserver?.disconnect()\n // Invalidate awaited renders before detaching listeners. A late response\n // must never replace content in a detached view.\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n this.initialLoadGeneration++\n this.removeEventListener('folder-pane-create-pane', this.handleCreatePane)\n this.removeEventListener('folder-pane-upload', this.handleUpload)\n this.removeEventListener('folder-pane-upload-files', this.handleDroppedFiles)\n this.removeEventListener('folder-pane-upload-rejected', this.handleUploadRejected)\n this.removeEventListener('resource-open-pane', this.handleResourceOpenPane as EventListener)\n this.ownerDocument.removeEventListener('solid-resource-deleted', this.handleResourceDeleted)\n if (this.authListenersAttached) {\n authSession.events.off('login', this.handleAuthChange)\n authSession.events.off('logout', this.handleAuthChange)\n this.authListenersAttached = false\n }\n super.disconnectedCallback()\n }\n\n protected firstUpdated () {\n this.updateSidebarBounds()\n if (typeof ResizeObserver !== 'undefined') {\n this.sidebarResizeObserver = new ResizeObserver(entries => {\n this.updateSidebarBounds()\n const width = entries[0]?.contentRect.width ?? 0\n if (this.responsiveLayoutInitialized || width <= 0) return\n this.responsiveLayoutInitialized = true\n if (width < NARROW_PANE_BREAKPOINT) {\n void this.handleSidebarToggle(new Event('folder-pane-responsive-collapse'))\n }\n })\n const shell = this.querySelector('.folder-pane-main-content')\n if (shell) this.sidebarResizeObserver.observe(shell)\n this.sidebarResizeObserver.observe(this)\n }\n }\n\n private handleAuthChange = () => {\n resourceAccessCache.clear()\n this.refreshCreationPermission(true)\n this.requestUpdate()\n }\n\n private handleCreatePane = async (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const pane = (event as CustomEvent<{ pane?: PaneDefinition }>).detail?.pane\n if (!pane?.mintNew) return\n const container = this.getActiveContainer()\n const dom = this.ownerDocument\n const statusArea = this.statusArea\n if (!container || !statusArea) return\n this.creationInFlight = true\n this.updateUploadAvailability()\n const operationGeneration = ++this.renderGeneration\n const paneName = getPaneLabel(pane)\n try {\n const name = await new Promise<string | undefined>(resolve => {\n showDialog(FolderPaneCreateDialog, {\n props: { label: paneName },\n onClose: resolve\n })\n })\n if (!name || !authn.currentUser()) return\n if (operationGeneration !== this.renderGeneration ||\n this.getActiveContainer()?.sameTerm(container) !== true) return\n if (!isSafeCreationName(name)) {\n setMintStatus(statusArea, 'error', invalidCreationNameMessage)\n return\n }\n this.clearContentForCreation()\n const created = await mintPaneInstance({\n context: this.browserContext!,\n container,\n pane,\n name,\n noun: paneName,\n statusArea,\n me: authn.currentUser() ?? undefined,\n dom\n })\n const stillOwnsNavigation = operationGeneration === this.renderGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n await this.showCreatedResource({\n container,\n ...created,\n pane,\n newInstance: stillOwnsNavigation ? created.newInstance : undefined\n })\n } catch (error) {\n debug.error('Unable to create folder-pane resource', error)\n if (!(error instanceof PaneMintError) && this.statusArea) {\n setMintStatus(this.statusArea, 'error', `Unable to create ${paneName}: ${error instanceof Error ? error.message : String(error)}`)\n }\n } finally {\n this.creationInFlight = false\n this.updateUploadAvailability()\n }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n void this.uploadFiles(Array.from(input.files ?? []), true)\n })\n input.click()\n }\n\n private handleDroppedFiles = (event: Event) => {\n event.stopPropagation()\n const files = (event as CustomEvent<{ files: File[] }>).detail?.files ?? []\n void this.uploadFiles(files, false)\n }\n\n private handleUploadRejected = (event: Event) => {\n event.stopPropagation()\n const message = (event as CustomEvent<{ message?: string }>).detail?.message\n if (message && this.statusArea) setMintStatus(this.statusArea, 'error', message)\n }\n\n private handleResourceDeleted = (event: Event) => {\n const resource = (event as CustomEvent<{ resource?: NamedNode }>).detail?.resource\n if (!resource) return\n\n const parent = resource.dir()\n const activeContainer = this.getActiveContainer()\n if (parent) {\n this.sidebar?.refreshResources?.(parent)\n }\n\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void }) | null\n if (parent && activeContainer?.sameTerm(parent)) {\n void containerView?.refresh?.()\n }\n\n if (!this.selectedResource?.sameTerm(resource)) return\n this.renderGeneration = invalidateRenderRequest(this.renderGeneration)\n const container = parent ?? this.subject\n if (container) {\n this.selectedResource = container\n this.renderContainerView(container)\n } else {\n this.selectedResource = undefined\n }\n }\n\n private async uploadFiles (files: File[], openUploadedResource: boolean) {\n if (this.creationInFlight || !authn.currentUser() || !this.canCreate) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n const resourceLogic = this.resourceLogic\n if (!files.length || !container || !statusArea || !this.store || !resourceLogic) return\n\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n const errors = invalidFiles.map(file => `${file.name}: ${invalidCreationNameMessage}`)\n if (!validFiles.length) {\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n return\n }\n\n this.creationInFlight = true\n this.updateUploadAvailability()\n const uploadGeneration = this.renderGeneration\n const uploadContext = this.browserContext\n let remaining = validFiles.length\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n this.updateUploadAvailability()\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n try {\n const results = await resourceLogic.uploadFiles(validFiles, container.uri)\n for (const result of results) {\n if (!result.success) {\n const prefix = result.error.destinationUri\n ? `Upload failed while putting ${result.error.destinationUri}`\n : `Upload failed for ${result.file.name}`\n const message = result.error.status === 413\n ? `${prefix}: storage quota was exceeded. ${result.error.message}`\n : result.error.status\n ? `${prefix} (HTTP ${result.error.status}). ${result.error.message}`\n : `${prefix}. ${result.error.message}`\n errors.push(message)\n finish()\n continue\n }\n\n try {\n const canNavigateToUpload = this.renderGeneration === uploadGeneration &&\n this.browserContext === uploadContext\n await this.showCreatedResource({\n container,\n containedResource: this.store.sym(result.uploadedUri),\n newInstance: openUploadedResource && validFiles.length === 1 && canNavigateToUpload\n ? this.store.sym(result.uploadedUri)\n : undefined\n })\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Uploaded ${result.file.name}, but could not refresh the folder: ${message}`)\n } finally {\n finish()\n }\n }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n errors.push(`Unable to upload files: ${message}`)\n while (remaining > 0) finish()\n }\n if (errors.length) setMintStatus(statusArea, 'error', errors.join('; '))\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n this.refreshCreationPermission()\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('selectedResource')) {\n this.refreshCreationPermission()\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\n if (this.subject) {\n this.standaloneBreadcrumbRoot = this.fullView\n ? this.getStandaloneBreadcrumbRoot(this.subject)\n : this.subject\n }\n if (this.selectedResource) {\n void this.showResourceInContentView(this.selectedResource)\n } else if (this.subject) {\n this.renderContainerView(this.subject)\n }\n }\n }\n\n private getStandaloneBreadcrumbRoot (subject: NamedNode): NamedNode {\n try {\n const url = new URL(subject.uri)\n const pathSegments = url.pathname.split('/').filter(Boolean)\n if (pathSegments.length <= 1) return subject\n return this.store?.sym(`${url.origin}/${pathSegments[0]}/`) ?? subject\n } catch {\n return subject\n }\n }\n\n // Lit never renders inside these targets; panes, explorers and containers\n // are inserted imperatively, and Lit-rendered errors sit beside them.\n private get resourceTarget () {\n return this.fullView ? this.fullViewTarget : this.contentView\n }\n\n private showContentError (error: ContentError, clearContent = true) {\n if (clearContent) this.resourceTarget?.replaceChildren()\n this.contentError = error\n }\n\n private renderAccessDeniedScreen () {\n this.showContentError({\n title: 'Access denied',\n message: 'You do not have access to the contents of this container.'\n })\n }\n\n private async loadResource (resource: NamedNode, retryFailed = false): Promise<void> {\n const store = this.store\n if (!store) return\n const fetcher = store.fetcher\n // A failed request can be cached by rdflib. Do not clear it during normal\n // navigation: persistent failures such as CORS errors should settle once\n // instead of causing a new request on every render. An explicit retry is\n // the point at which the cached failure should be discarded.\n if (retryFailed) clearFailedResource(fetcher, resource)\n try {\n await fetcher.load(resource)\n } catch (error) {\n if (!retryFailed || !isAccessDeniedError(error) || !authn.currentUser()) throw error\n await fetcher.load(resource, { force: true, clearPreviousData: true })\n }\n }\n\n private clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\n const retry = this.contentError?.retry\n if (retry) {\n this.clearContentError()\n retry()\n return\n }\n\n const selectedResource = this.selectedResource\n const subject = this.subject\n if (!selectedResource && !subject) return\n this.clearContentError()\n if (selectedResource) {\n void this.showResourceInContentView(selectedResource, undefined, false, true)\n } else if (subject) {\n if (this.store) clearFailedResource(this.store.fetcher, subject)\n void this.showInitialContainer(subject)\n }\n }\n\n /**\n * Select the resource returned by a pane's mintNew implementation. Some\n * panes (notably long chat) mint a resource inside the new document rather\n * than the container URI itself, so routing this through the normal\n * selection path is important.\n */\n openCreatedResource (resource: NamedNode, pane?: PaneDefinition) {\n this.searchQuery = ''\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n // Resolve the pane again from the registry. Creation menu entries can be\n // replaced while the async mint is running; retaining that stale object\n // lets a different relevant pane (notably profile for pad indexes) win.\n const currentPane = pane?.name\n ? this.browserContext?.session.paneRegistry.byName(pane.name) ?? pane\n : pane\n // Explicitly opening a freshly-created resource must preserve its subject.\n // Indexed panes such as Pad use `index.ttl#this`; mapping that subject back\n // to the folder would render the pane against a container with no pad data.\n this.showSubject(\n resource,\n typeof currentPane?.render === 'function' ? currentPane : undefined,\n true\n )\n }\n\n /**\n * The storage header belongs to the explorer, while its actions apply to\n * the container currently being viewed. A document selection has no\n * writable container of its own, so use its parent when it remains within\n * the explorer root; otherwise retain the last browsed container.\n */\n getActiveContainer (): NamedNode | undefined {\n const selected = this.selectedResource\n const indexedContainerUri = selected ? getIndexedContainer(selected) : undefined\n if (indexedContainerUri && this.store) {\n return this.store.sym(indexedContainerUri)\n }\n if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = this.fullView ? this.standaloneBreadcrumbRoot : this.subject\n const parent = selected?.dir()\n const rootUri = root?.uri.endsWith('/') ? root.uri : `${root?.uri}/`\n if (root && parent && rootUri && parent.uri.startsWith(rootUri)) {\n return parent\n }\n\n return this.subject\n }\n\n private refreshCreationPermission (force = false) {\n const container = this.getActiveContainer()\n const resourceLogic = this.browserContext?.session.logic.resource\n if (\n !force &&\n container &&\n resourceLogic &&\n this.permissionRequest?.containerUri === container.uri &&\n this.permissionRequest.resourceLogic === resourceLogic\n ) return\n\n const permissionGeneration = ++this.permissionGeneration\n this.setCanCreate(false)\n this.permissionRequest = container && resourceLogic\n ? { containerUri: container.uri, resourceLogic }\n : undefined\n if (!container || !resourceLogic) return\n\n void resourceLogic.fetchMetadata(container)\n .then(metadata => {\n if (\n permissionGeneration === this.permissionGeneration &&\n this.getActiveContainer()?.sameTerm(container) === true\n ) {\n this.setCanCreate(metadata.access.canEdit)\n }\n })\n .catch(error => {\n if (permissionGeneration === this.permissionGeneration) {\n this.permissionRequest = undefined\n debug.warn('Unable to determine folder creation permission', error)\n }\n })\n }\n\n private updateUploadAvailability () {\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (FolderPaneContainer & { subject?: NamedNode, uploadBusy?: boolean }) | null\n const activeContainer = this.getActiveContainer()\n if (!containerView) return\n containerView.canUpload = this.canCreate &&\n !this.creationInFlight &&\n !!activeContainer &&\n containerView.subject?.sameTerm(activeContainer) === true\n containerView.uploadBusy = this.creationInFlight\n }\n\n private setCanCreate (canCreate: boolean) {\n this.canCreate = canCreate\n this.updateUploadAvailability()\n }\n\n clearContentForCreation () {\n this.resourceTarget?.replaceChildren()\n }\n\n /**\n * Reload the server-backed container listing after a pane minted a new\n * resource, refresh the sidebar and container view, then open the result.\n */\n async showCreatedResource ({ container, containedResource, newInstance, pane }: CreatedResource) {\n const store = this.store\n if (!store) return\n const navigationGeneration = this.renderGeneration\n const navigationContext = this.browserContext\n const reload = async (resource: NamedNode): Promise<boolean> => {\n try {\n await store.fetcher.load(resource, { force: true, clearPreviousData: true })\n return true\n } catch (error) {\n log.warn('Unable to reload ' + resource.uri + ': ' + error)\n return false\n }\n }\n\n const confirmed = await reload(container)\n if (containedResource.uri.endsWith('/')) {\n await reload(containedResource)\n // Panes may probe their new documents before writing them; forget those\n // cached 404s so rendering loads what the pane actually created.\n const members = store.each(containedResource, ns.ldp('contains'), undefined, containedResource.doc())\n for (const member of members) {\n if (member.termType === 'NamedNode' && store.fetcher.getState(member.value) === 'failed') {\n store.fetcher.unload(member as NamedNode)\n }\n }\n }\n\n this.sidebar?.refreshResources?.(container)\n const containerView = this.resourceTarget?.querySelector('folder-pane-container') as\n (HTMLElement & { refresh?: () => void, addOptimisticResource?: (resource: NamedNode) => void }) | null\n if (!confirmed && containerView?.addOptimisticResource) {\n containerView.addOptimisticResource(containedResource)\n }\n if (confirmed) {\n containerView?.refresh?.()\n }\n if (\n newInstance &&\n this.isConnected &&\n this.renderGeneration === navigationGeneration &&\n this.browserContext === navigationContext\n ) {\n this.openCreatedResource(newInstance, pane)\n }\n }\n\n private renderContainerView (selectedResource: NamedNode) {\n const target = this.resourceTarget\n if (!target) return\n\n this.contentError = undefined\n const containerView = document.createElement('folder-pane-container') as FolderPaneContainer\n\n containerView.subject = selectedResource\n containerView.resourceLogic = this.resourceLogic ?? null\n containerView.browserContext = this.browserContext\n const activeContainer = this.getActiveContainer()\n containerView.canUpload = this.canCreate &&\n !!activeContainer &&\n selectedResource.sameTerm(activeContainer)\n containerView.uploadBusy = this.creationInFlight\n containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n\n this.showingContainer = true\n target.replaceChildren(containerView)\n }\n\n private async showInitialContainer (subject: NamedNode) {\n const generation = ++this.initialLoadGeneration\n\n if (isJavaScriptFile(subject)) {\n this.showSubject(subject)\n return\n }\n\n if (!this.store || !this.resourceLogic) return\n\n try {\n await this.loadResource(subject)\n } catch (error) {\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n if (isAccessDeniedError(error)) {\n const target = this.resourceTarget\n if (target) this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load storage container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (generation !== this.initialLoadGeneration || !this.subject?.sameTerm(subject)) return\n this.sidebar?.refreshResources?.()\n this.requestUpdate()\n if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private async renderExplorerInto (\n target: HTMLElement,\n subject: NamedNode,\n pane: PaneDefinition | undefined,\n options: ExplorerRenderOptions = {}\n ) {\n if (!this.browserContext) return\n\n const relevantPanes = await getRelevantPanes(subject, this.browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (options.isCurrent && !options.isCurrent()) return\n const selectedPane = pane || getPreferredPane(subject, this.browserContext, relevantPanes)\n if (!selectedPane) {\n this.renderExplorerError(subject, 'No pane is available to display this resource.')\n return\n }\n\n let paneElement: HTMLElement\n try {\n paneElement = selectedPane.render(subject, this.browserContext, options.paneOptions || {})\n } catch (error) {\n log.error('Unable to render selected pane: ' + error)\n this.renderExplorerError(subject, 'The selected pane could not render this resource.')\n return\n }\n\n const provider = target.ownerDocument.createElement('solid-ui-file-explorer-provider') as FileExplorerProvider\n const menuItems = await preparePaneMenuItems({\n subject,\n context: this.browserContext,\n panes: relevantPanes,\n openPane: (paneSubject, paneName) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: paneSubject.uri, paneName }\n }))\n }\n })\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n // Return to the container that owns the displayed resource. Using the\n // explorer root here loses the user's position for resources in nested\n // containers.\n const parentContainer = this.getActiveContainer() || this.subject || subject\n this.renderGeneration++\n this.selectedResource = parentContainer\n this.renderContainerView(parentContainer)\n })\n provider.addEventListener(FILE_EXPLORER_OPEN_PANE_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n const paneName = (event as CustomEvent<{ paneName: string }>).detail?.paneName\n const nextPane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (nextPane) {\n const request: RenderRequest = {\n generation: ++this.renderGeneration,\n subjectUri: subject.uri,\n context: this.browserContext\n }\n this.renderExplorerInto(target, subject, nextPane, {\n ...options,\n paneOptions: nextPane.name === 'folder'\n ? { folderView: 'container', fullView: true, solo: true }\n : options.paneOptions,\n isCurrent: () => isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n )\n }).catch(error => {\n log.error('Unable to switch selected pane: ' + error)\n })\n }\n })\n\n composeExplorer(provider, {\n context: this.browserContext,\n subjectUri: subject.uri,\n pane: selectedPane,\n relevantPanes,\n header: options.showHeader === false\n ? undefined\n : { paneIcon: selectedPane.icon, menuItems },\n paneElement\n })\n if (options.isCurrent && !options.isCurrent()) return\n this.contentError = undefined\n this.showingContainer = false\n target.replaceChildren(provider)\n }\n\n private renderExplorerError (subject: NamedNode, message: string) {\n this.showContentError({ title: message, message: subject.uri })\n }\n\n private async showResourceInContentView (\n selectedResource: NamedNode,\n pane?: PaneDefinition,\n indexRequested = false,\n retryFailed = false\n ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n const browserContext = this.browserContext\n if (!target || !this.store || !this.resourceLogic || !browserContext) return\n\n const request: RenderRequest = {\n generation: renderGeneration,\n subjectUri: selectedResource.uri,\n context: this.browserContext\n }\n const isCurrentSelection = (candidate: NamedNode) =>\n isCurrentRenderRequest(\n request,\n this.renderGeneration,\n this.selectedResource?.uri,\n this.browserContext\n ) && candidate.uri === request.subjectUri\n\n if (!isCurrentSelection(selectedResource)) return\n\n if (\n this.subject?.sameTerm(selectedResource) &&\n !pane &&\n !indexRequested &&\n isContainerResource(selectedResource, this.resourceLogic)\n ) {\n this.renderContainerView(selectedResource)\n return\n }\n\n // A pane supplied by an explicit creation or pane-selection action is\n // authoritative. In particular, freshly created text resources can\n // briefly inherit container metadata while the store is refreshed.\n // Some servers report file resources as containers. Keep known file\n // types out of the folder branch so pane selection can run normally.\n if (\n isContainerResource(selectedResource, this.resourceLogic) &&\n (pane?.name !== 'source' || indexRequested)\n ) {\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load selected container: ' + error)\n this.showContentError({\n title: 'Unable to load this folder',\n message: 'The folder could not be loaded. Try again.'\n })\n return\n }\n\n if (!isCurrentSelection(selectedResource)) return\n this.sidebar?.refreshResources?.()\n\n if (pane?.name === 'folder') {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (\n !pane &&\n (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource))\n ) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource)\n )\n try {\n await this.loadResource(applicationSubject.doc(), retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.error('Unable to load container index document: ' + error)\n }\n await this.renderExplorerInto(target, applicationSubject, pane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n const relevantPanes = await getRelevantPanes(selectedResource, browserContext, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (!isCurrentSelection(selectedResource)) return\n\n const selectedPane = pane || getPreferredPane(selectedResource, browserContext, relevantPanes)\n if (selectedPane?.name !== 'folder') {\n await this.renderExplorerInto(target, selectedResource, selectedPane, {\n isCurrent: () => isCurrentSelection(selectedResource),\n showHeader: false\n })\n return\n }\n\n this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.loadResource(selectedResource, retryFailed)\n } catch (error) {\n if (!isCurrentSelection(selectedResource)) return\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n log.warn('Unable to load selected resource metadata: ' + error)\n }\n\n if (!isCurrentSelection(selectedResource)) return\n const sourcePane = isJavaScriptFile(selectedResource)\n ? this.browserContext?.session.paneRegistry.byName('source')\n : undefined\n if (!pane && isJavaScriptFile(selectedResource) && !sourcePane) {\n this.renderExplorerError(selectedResource, 'The Source pane is unavailable to display this JavaScript file.')\n return\n }\n await this.renderExplorerInto(target, selectedResource, pane || sourcePane, {\n isCurrent: () => isCurrentSelection(selectedResource)\n })\n } catch (error) {\n log.error('Unable to render selected resource: ' + error)\n if (renderGeneration === this.renderGeneration && this.resourceTarget) {\n if (isAccessDeniedError(error)) {\n this.renderAccessDeniedScreen()\n return\n }\n this.renderExplorerError(selectedResource, 'Unable to display the selected resource.')\n }\n }\n }\n\n private showSubject (resource: NamedNode, pane?: PaneDefinition, preserveSubject = false) {\n // `container/index.ttl#this` is rendered exactly like selecting its container,\n // so indexed panes never show the file-explorer header on either route.\n const useIndexedApplication = !preserveSubject && pane?.name !== 'sharing'\n const indexedContainerUri = useIndexedApplication ? getIndexedContainer(resource) : undefined\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = useIndexedApplication && !indexedContainer &&\n !!this.resourceLogic &&\n isContainerResource(resource, this.resourceLogic) &&\n this.resourceLogic.containerHasIndexDocument(resource)\n this.selectedResource = subject\n // Render directly so re-selecting the same resource still replaces the content target.\n void this.showResourceInContentView(subject, pane, !!indexedContainer || indexRequested)\n }\n\n private handleResourceSelected = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.searchQuery = ''\n this.showSubject(resource)\n }\n\n private handleResourceOpenPane = (event: CustomEvent<{ resource: NamedNode, paneName: string }>) => {\n const resource = event.detail?.resource\n const paneName = event.detail?.paneName\n const pane = paneName ? this.browserContext?.session.paneRegistry.byName(paneName) : undefined\n if (!resource || !pane) return\n event.stopPropagation()\n this.searchQuery = ''\n if (pane.name === 'folder') {\n this.showSubject(resource, pane, true)\n return\n }\n // Some minting panes (e.g. Dokieli) delegate viewing to another pane and\n // have no render(); let the relevant-pane lookup choose in that case.\n this.showSubject(resource, typeof pane?.render === 'function' ? pane : undefined, true)\n }\n\n private setContainerView (view: 'grid' | 'list') {\n this.containerView = view\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.view = view\n }\n\n private handleSelectHome = () => {\n this.searchQuery = ''\n const home = this.subject && this.standaloneBreadcrumbRoot?.sameTerm(this.subject)\n ? this.subject\n : this.standaloneBreadcrumbRoot\n if (home) this.showSubject(home)\n }\n\n private handleSearch = (event: CustomEvent<{ query: string }>) => {\n event.stopPropagation()\n this.searchQuery = event.detail?.query || ''\n const container = this.resourceTarget?.querySelector('folder-pane-container') as FolderPaneContainer | null\n if (container) container.searchQuery = this.searchQuery\n }\n\n private handleSelectBreadcrumbResource = (event: CustomEvent<{ resource: NamedNode }>) => {\n const resource = event.detail?.resource\n if (!resource) return\n event.stopPropagation()\n this.showSubject(resource)\n }\n\n private handleContainerViewChange = (event: CustomEvent<{ view: 'grid' | 'list' }>) => {\n const view = event.detail?.view\n if (!view) return\n event.stopPropagation()\n this.setContainerView(view)\n }\n\n private get sidebarAvailableWidth () {\n const shell = this.renderRoot.querySelector<HTMLElement>('.folder-pane-main-content')\n const divider = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resizer')\n return (shell?.clientWidth ?? 0) - (divider?.getBoundingClientRect().width ?? 0)\n }\n\n private resizeSidebar (width: number) {\n this.sidebarWidth = clampSidebarWidth(width, this.sidebarAvailableWidth)\n }\n\n private updateSidebarBounds = () => {\n if (!this.isConnected) return\n this.sidebarMaximumWidth = clampSidebarWidth(MAX_SIDEBAR_WIDTH, this.sidebarAvailableWidth)\n this.resizeSidebar(this.sidebarWidth)\n }\n\n private handleSidebarPointerDown = (event: PointerEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.button !== 0 || !event.isPrimary) return\n event.preventDefault()\n const separator = event.currentTarget as HTMLElement\n separator.setPointerCapture(event.pointerId)\n separator.focus()\n this.sidebarDrag = {\n separator,\n pointerId: event.pointerId,\n startX: event.clientX,\n startWidth: this.sidebarWidth\n }\n this.requestUpdate()\n }\n\n private handleSidebarPointerMove = (event: PointerEvent) => {\n const drag = this.sidebarDrag\n if (!this.isConnected || this.sidebarCollapsed || !drag || drag.pointerId !== event.pointerId) return\n this.resizeSidebar(drag.startWidth + event.clientX - drag.startX)\n }\n\n private finishSidebarResize () {\n const drag = this.sidebarDrag\n if (!drag) return\n this.sidebarDrag = undefined\n if (drag.separator.hasPointerCapture(drag.pointerId)) {\n drag.separator.releasePointerCapture(drag.pointerId)\n }\n if (this.isConnected) this.requestUpdate()\n }\n\n private handleSidebarPointerEnd = (event: PointerEvent) => {\n if (this.sidebarDrag?.pointerId === event.pointerId) this.finishSidebarResize()\n }\n\n private handleSidebarResizeKey = (event: KeyboardEvent) => {\n if (!this.isConnected || this.sidebarCollapsed || this.sidebarDrag ||\n event.altKey || event.ctrlKey || event.metaKey) return\n let width: number\n switch (event.key) {\n case 'ArrowLeft': width = this.sidebarWidth - SIDEBAR_RESIZE_STEP; break\n case 'ArrowRight': width = this.sidebarWidth + SIDEBAR_RESIZE_STEP; break\n case 'Home': width = MIN_SIDEBAR_WIDTH; break\n case 'End': width = MAX_SIDEBAR_WIDTH; break\n default: return\n }\n event.preventDefault()\n event.stopPropagation()\n this.resizeSidebar(width)\n }\n\n private handleSidebarToggle = async (event: Event) => {\n event.stopPropagation()\n const sidebar = this.sidebar\n const resizer = this.renderRoot.querySelector<HTMLElement>('.folder-pane-sidebar-resize-handle')\n const focusWasInSidebar = !!sidebar && (\n sidebar.matches(':focus-within') ||\n sidebar.shadowRoot?.activeElement != null\n )\n const focusWasOnResizer = resizer === this.ownerDocument.activeElement\n this.finishSidebarResize()\n this.sidebarCollapsed = !this.sidebarCollapsed\n if (!this.sidebarCollapsed || (!focusWasInSidebar && !focusWasOnResizer)) return\n await this.updateComplete\n this.renderRoot.querySelector<HTMLButtonElement>('.folder-pane-sidebar-toggle')?.focus()\n }\n\n private handleFolderPaneResourceError = (event: CustomEvent<{\n title?: string\n message?: string\n retry?: () => void\n }>) => {\n event.stopPropagation()\n const title = event.detail?.title || 'Unable to load this folder'\n const message = event.detail?.message || 'The folder could not be loaded. Try again.'\n this.showContentError({\n title,\n message,\n retry: event.detail?.retry\n }, false)\n }\n\n render () {\n if (this.fullView) {\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n >\n ${this.showingContainer ? this.renderStorageHeader() : nothing}\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n ></div>\n <div class=\"folder-pane-status\"></div>\n </folder-pane-provider>\n `\n }\n\n return html`\n <folder-pane-provider\n .rootResource=${this.subject}\n .displayedResource=${this.displayedResource}\n .activeContainer=${this.getActiveContainer()}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n .sidebarCollapsed=${this.sidebarCollapsed}\n >\n ${this.renderStorageHeader()}\n <div\n class=\"folder-pane-main-content\"\n data-sidebar-collapsed=${String(this.sidebarCollapsed)}\n style=${`--folder-pane-sidebar-width: ${this.sidebarWidth}px`}\n @resource-selected=${this.handleResourceSelected}\n @folder-pane-resource-error=${this.handleFolderPaneResourceError}\n @folder-pane-toggle-sidebar=${this.handleSidebarToggle}\n >\n <folder-pane-sidebar\n ?inert=${this.sidebarCollapsed}\n aria-hidden=${this.sidebarCollapsed ? 'true' : 'false'}\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.displayedResource}\n ></folder-pane-sidebar>\n <div\n class=\"folder-pane-sidebar-resizer\"\n data-resizing=${String(!!this.sidebarDrag)}\n >\n <div\n class=\"folder-pane-sidebar-resize-handle\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label=\"Resize navigation sidebar\"\n aria-valuemin=${MIN_SIDEBAR_WIDTH}\n aria-valuemax=${this.sidebarMaximumWidth}\n aria-valuenow=${this.sidebarWidth}\n tabindex=${this.sidebarCollapsed ? -1 : 0}\n ?hidden=${this.sidebarCollapsed}\n ?inert=${this.sidebarCollapsed}\n @pointerdown=${this.handleSidebarPointerDown}\n @pointermove=${this.handleSidebarPointerMove}\n @pointerup=${this.handleSidebarPointerEnd}\n @pointercancel=${this.handleSidebarPointerEnd}\n @lostpointercapture=${this.handleSidebarPointerEnd}\n @keydown=${this.handleSidebarResizeKey}\n ></div>\n <button\n type=\"button\"\n class=\"folder-pane-sidebar-toggle\"\n aria-label=${this.sidebarCollapsed ? 'Expand navigation' : 'Collapse navigation'}\n aria-expanded=${String(!this.sidebarCollapsed)}\n @click=${this.handleSidebarToggle}\n >\n <icon-lucide-chevron-left\n class=${`folder-pane-sidebar-toggle-icon${this.sidebarCollapsed ? ' folder-pane-sidebar-toggle-icon-collapsed' : ''}`}\n aria-hidden=\"true\"\n ></icon-lucide-chevron-left>\n </button>\n </div>\n <div class=\"folder-pane-content-column\">\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n <div class=\"folder-pane-status\"></div>\n </div>\n </div>\n </folder-pane-provider>\n `\n }\n\n private renderStorageHeader () {\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .breadcrumbRoot=${this.standaloneBreadcrumbRoot}\n .selectedResource=${this.getActiveContainer()}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${this.canCreate}\n @folder-pane-select-home=${this.handleSelectHome}\n @folder-pane-select-resource=${this.handleSelectBreadcrumbResource}\n @folder-pane-change-view=${this.handleContainerViewChange}\n @folder-pane-search=${this.handleSearch}\n ></folder-pane-storage-header>\n `\n }\n\n private renderContentError () {\n if (this.contentError) {\n return html`\n <div class=\"folder-pane-resource-error\" role=\"status\">\n <solid-ui-error-state\n .title=${this.contentError.title}\n .message=${this.contentError.message}\n @close=${this.clearContentError}\n >\n <button type=\"button\" @click=${this.retryContent}>Retry</button>\n </solid-ui-error-state>\n </div>\n `\n }\n\n return nothing\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAAxC,IAAA,GAAA,KAAA,GAzrC2CxC,CAAY,GAAAkZ,GAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "folder-pane",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "Solid-compatible Panes: File browser",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
@@ -75,10 +75,10 @@
75
75
  "dependencies": {
76
76
  "@lit/context": "^1.1.6",
77
77
  "lit": "^3.3.3",
78
- "pane-registry": "5.1.1",
78
+ "pane-registry": "5.1.2-0",
79
79
  "rdflib": "2.4.1",
80
- "solid-logic": "6.2.0",
81
- "solid-ui": "5.1.0"
80
+ "solid-logic": "6.2.1-0",
81
+ "solid-ui": "5.1.1-0"
82
82
  },
83
83
  "solidosDependencies": [
84
84
  "rdflib",