folder-pane 4.0.1-0 → 4.0.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.
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +21 -19
- package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +8 -0
- package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +157 -115
- package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js +17 -15
- package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.d.ts +3 -0
- package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
- package/dist/components/folder-pane-view/FolderPaneView.esm.js +99 -80
- package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
- package/dist/folderPane.cjs.js +1 -1
- package/dist/folderPane.cjs.js.map +1 -1
- package/dist/folderPane.d.ts +13 -0
- package/dist/folderPane.d.ts.map +1 -1
- package/dist/folderPane.esm.js +16 -6
- package/dist/folderPane.esm.js.map +1 -1
- package/dist/requestQueue.cjs.js +2 -0
- package/dist/requestQueue.cjs.js.map +1 -0
- package/dist/requestQueue.d.ts +30 -0
- package/dist/requestQueue.d.ts.map +1 -0
- package/dist/requestQueue.esm.js +67 -0
- package/dist/requestQueue.esm.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FolderPaneView.esm.js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getRelevantPanes","isExplorerEvent","log","ns","showDialog","WebComponent","widgets","authn","authSession","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_selectedResourceDecs","_containerViewDecs","_searchQueryDecs","_contentErrorDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_selectedResource","_init_containerView","_init_searchQuery","_init_contentError","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","console","Error","message","String","store","input","createElement","multiple","addEventListener","files","Array","from","validFiles","filter","file","invalidFiles","forEach","length","remaining","refreshes","finish","dataset","status","replaceChildren","uploadFiles","fetcher","uri","_file","then","containedResource","sym","finally","click","contentError","selectedResource","subject","clearContentError","showResourceInContentView","showInitialContainer","resource","searchQuery","showSubject","session","paneRegistry","byName","render","resourceTarget","querySelector","view","setContainerView","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","fullView","containerView","contentView","fullViewTarget","sidebar","createRenderRoot","connectedCallback","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","initialLoadGeneration","removeEventListener","off","updated","changedProperties","has","get","renderContainerView","showContentError","renderAccessDeniedScreen","title","openCreatedResource","currentPane","selected","root","parent","dir","rootUri","endsWith","startsWith","navigationGeneration","navigationContext","reload","load","force","clearPreviousData","warn","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","refreshResources","addOptimisticResource","refresh","isConnected","target","document","hideRootSpecialFolders","generation","getPaneForSubject","relevantPanes","mintClass","any","ui","mintClassPane","find","candidate","shouldGetFocus","renderExplorerInto","options","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","map","action","_event","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","item","nextPane","request","catch","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","containerHasIndexDocument","applicationSubject","sourcePane","indexedContainerUri","indexedContainer","renderContentError","handleResourceSelected","handleResourceOpenPane","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","default","FolderPaneCreateDialog","_FolderPaneCreateDial","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_selectedResourceDecs","_init_selectedResource","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_contentErrorDecs","_init_contentError","_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","customElement","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","property","state","query","WebComponent","args","event","authn","pane","container","dom","statusArea","operationGeneration","paneName","getPaneLabel","name","resolve","isSafeCreationName","invalidCreationNameMessage","created","mintPaneInstance","stillOwnsNavigation","error","PaneMintError","setMintStatus","input","files","validFiles","file","remaining","refreshes","finish","uri","message","selectedResource","subject","resource","view","aclControl","authSession","invalidateRenderRequest","changedProperties","currentPane","selected","isContainerResource","root","parent","rootUri","store","navigationGeneration","navigationContext","reload","log","confirmed","containedResource","members","ns","member","containerView","newInstance","target","generation","isJavaScriptFile","isAccessDeniedError","mintClass","mintClassPane","relevantPanes","candidate","getRelevantPanes","options","selectedPane","paneElement","provider","menuItems","label","FILE_EXPLORER_OPEN_PANE_EVENT","item","FILE_EXPLORER_BACK_EVENT","isExplorerEvent","nextPane","request","isCurrentRenderRequest","composeExplorer","renderGeneration","isCurrentSelection","indexRequested","applicationSubject","getIndexedApplicationSubject","sourcePane","indexedContainerUri","getIndexedContainer","indexedContainer","nothing"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getRelevantPanes, isExplorerEvent, log, ns, showDialog, WebComponent, widgets } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\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 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 { 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'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\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 @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor contentError: { title: string, message: string } | undefined = undefined\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\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 /** Top-of-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 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 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 // 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 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 private handleAuthChange = () => {\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 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 console.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 }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n if (!container || !statusArea || !this.store) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n const files = Array.from(input.files ?? [])\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n invalidFiles.forEach(file => setMintStatus(statusArea, 'error', `${file.name}: ${invalidCreationNameMessage}`))\n if (!validFiles.length) return\n this.creationInFlight = true\n let remaining = validFiles.length\n let refreshes = Promise.resolve()\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n widgets.uploadFiles(\n this.store!.fetcher,\n validFiles,\n container.uri,\n container.uri,\n (_file: File, uri: string) => {\n refreshes = refreshes.then(() => this.showCreatedResource({\n container,\n containedResource: this.store!.sym(uri)\n })).finally(finish)\n },\n (_file: File, message: string) => {\n setMintStatus(statusArea, 'error', message)\n finish()\n }\n )\n })\n input.click()\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\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 // 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: { title: string, message: string }) {\n 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 clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\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)\n } else if (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 if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = 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 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 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 containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n containerView.hideRootSpecialFolders = this.subject\n ? selectedResource.sameTerm(this.subject)\n : false\n\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.store.fetcher.load(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 if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private getPaneForSubject (subject: NamedNode, relevantPanes: PaneDefinition[]) {\n const mintClass = this.store && (\n this.store.any(subject, ns.ui('mintClass'), undefined, subject.doc()) ||\n this.store.any(subject.doc(), ns.ui('mintClass'), undefined, subject.doc())\n )\n if (mintClass) {\n const mintClassPane = relevantPanes.find(pane => pane.mintClass?.sameTerm(mintClass))\n if (mintClassPane) return mintClassPane\n }\n\n return relevantPanes.find(candidate => candidate.shouldGetFocus?.(subject)) || relevantPanes[0]\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 || this.getPaneForSubject(subject, 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 = relevantPanes\n .map(candidate => {\n const label = candidate.label(subject, this.browserContext as DataBrowserContext)\n if (!label) return undefined\n return {\n label,\n action: (_event: Event) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: subject.uri, paneName: candidate.name }\n }))\n }\n }\n })\n .filter((item): item is { label: string, action: (event: Event) => void } => item !== undefined)\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n this.renderGeneration++\n this.selectedResource = undefined\n this.renderContainerView(this.subject || subject)\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 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 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 ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n if (!target || !this.store || !this.resourceLogic) 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 (this.subject?.sameTerm(selectedResource) && !indexRequested && !isJavaScriptFile(selectedResource)) {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (isContainerResource(selectedResource, this.resourceLogic)) {\n try {\n await this.store.fetcher.load(selectedResource)\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 (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource)) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource, pane?.name)\n )\n try {\n await this.store.fetcher.load(applicationSubject.doc())\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 this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.store.fetcher.load(selectedResource)\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) {\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 indexedContainerUri = getIndexedContainer(resource)\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = !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 // 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)\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 if (this.subject) this.showSubject(this.subject)\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 render () {\n if (this.fullView) {\n return html`\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n @resource-open-pane=${this.handleResourceOpenPane}\n ></div>\n `\n }\n\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .selectedResource=${this.selectedResource ?? this.subject}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${Boolean(authn.currentUser())}\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 <div\n class=\"folder-pane-main-content\"\n @resource-selected=${this.handleResourceSelected}\n @resource-open-pane=${this.handleResourceOpenPane}\n >\n <folder-pane-sidebar\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.selectedResource ?? this.subject}\n ></folder-pane-sidebar>\n <div class=\"folder-pane-content-column\">\n <div class=\"folder-pane-status\"></div>\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n </div>\n </div>\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBuFiC,KAAA,CAgBtF/B,EAAc,kBAAkB,CAAC;AAAA,IAAAgC,IAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,kBAAA,IAAAJ,QAAA,GAAAK,kBAAA,IAAAL,QAAA,GAAAM,kBAAA,IAAAN,QAAA,GAAAO,kBAAA,IAAAP,QAAA,GAAAQ,kBAAA,IAAAR,QAAA,GAAAS,kBAAA,IAAAT,QAAA,GAAAU,kBAAA,IAAAV,QAAA;AAAAW,MAAAC,KAE/BhC,EAAS,EAAEiC,WAAW,GAAM,CAAC,GAACC,KAO9BlC,EAAS,EAAEiC,WAAW,GAAM,CAAC,GAACE,KAO9BnC,EAAS;CAAEoC,MAAMC;CAASJ,WAAW;AAAY,CAAC,GAACK,KAGnDpC,EAAM,GAACqC,KAGPrC,EAAM,GAACsC,KAGPtC,EAAM,GAACuC,KAGPvC,EAAM,GAACwC,IASPzC,EAAM,qBAAqB,GAAC0C,IAG5B1C,EAAM,wBAAwB,GAAC2C,KAG/B3C,EAAM,qBAAqB,GAAC4C,IAI5B5C,EAAM,qBAAqB,GAAC,mBA4rB9BwQ,KAAA3N,cA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js","names":["aclControl","composeExplorer","customElement","FILE_EXPLORER_BACK_EVENT","FILE_EXPLORER_OPEN_PANE_EVENT","getRelevantPanes","isExplorerEvent","log","ns","showDialog","WebComponent","widgets","authn","authSession","html","nothing","property","query","state","getIndexedApplicationSubject","getIndexedContainer","isAccessDeniedError","isContainerResource","isJavaScriptFile","invalidateRenderRequest","isCurrentRenderRequest","FolderPaneCreateDialog","getPaneLabel","isSafeCreationName","invalidCreationNameMessage","mintPaneInstance","PaneMintError","setMintStatus","_classDecs","_FolderPaneView","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_ref","_browserContextDecs","attribute","_subjectDecs","_fullViewDecs","type","Boolean","_hideStorageHeaderDecs","_selectedResourceDecs","_containerViewDecs","_searchQueryDecs","_contentErrorDecs","_contentViewDecs","_fullViewTargetDecs","_sidebarDecs","_statusAreaDecs","FolderPaneView","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_browserContext","undefined","_init_subject","_init_fullView","_init_hideStorageHeader","_init_selectedResource","_init_containerView","_init_searchQuery","_init_contentError","_defineProperty","_init_contentView","_init_fullViewTarget","_init_sidebar","_init_statusArea","requestUpdate","event","stopPropagation","creationInFlight","currentUser","pane","detail","mintNew","container","getActiveContainer","dom","ownerDocument","statusArea","operationGeneration","renderGeneration","paneName","name","Promise","resolve","props","label","onClose","sameTerm","clearContentForCreation","created","context","browserContext","noun","me","stillOwnsNavigation","showCreatedResource","newInstance","error","console","Error","message","String","store","input","createElement","multiple","addEventListener","files","Array","from","validFiles","filter","file","invalidFiles","forEach","length","remaining","refreshes","finish","dataset","status","replaceChildren","uploadFiles","fetcher","uri","_file","then","containedResource","sym","finally","click","contentError","selectedResource","subject","clearContentError","showResourceInContentView","showInitialContainer","resource","searchQuery","showSubject","session","paneRegistry","byName","render","resourceTarget","querySelector","view","setContainerView","_classPrivateFieldGet","v","_classPrivateFieldSet","resourceLogic","logic","fullView","hideStorageHeader","containerView","contentView","fullViewTarget","sidebar","createRenderRoot","connectedCallback","dropProtectionAttached","preventBrowserDropEvents","handleCreatePane","handleUpload","authListenersAttached","events","on","handleAuthChange","disconnectedCallback","initialLoadGeneration","removeEventListener","off","updated","changedProperties","has","get","renderContainerView","showContentError","renderAccessDeniedScreen","title","openCreatedResource","currentPane","selected","root","parent","dir","rootUri","endsWith","startsWith","navigationGeneration","navigationContext","reload","load","force","clearPreviousData","warn","confirmed","members","each","ldp","doc","member","termType","getState","value","unload","refreshResources","addOptimisticResource","refresh","isConnected","target","document","hideRootSpecialFolders","generation","getPaneForSubject","relevantPanes","mintClass","any","ui","mintClassPane","find","candidate","shouldGetFocus","renderExplorerInto","options","excludedPaneNames","fallbackPaneName","isCurrent","selectedPane","renderExplorerError","paneElement","paneOptions","provider","menuItems","map","action","_event","dispatchEvent","CustomEvent","bubbles","composed","subjectUri","item","nextPane","request","catch","header","showHeader","paneIcon","icon","indexRequested","isCurrentSelection","containerHasIndexDocument","applicationSubject","sourcePane","indexedContainerUri","indexedContainer","renderContentError","handleResourceSelected","handleResourceOpenPane","renderStorageHeader","list","handleSelectHome","handleSelectBreadcrumbResource","handleContainerViewChange","handleSearch","retryContent","_FolderPaneView2","e","c","_initClass","_applyDecs","default","FolderPaneCreateDialog","_FolderPaneCreateDial","_FolderPaneView2","_initProto","_initClass","_classDecs","_browserContextDecs","_init_browserContext","_subjectDecs","_init_subject","_fullViewDecs","_init_fullView","_hideStorageHeaderDecs","_init_hideStorageHeader","_selectedResourceDecs","_init_selectedResource","_containerViewDecs","_init_containerView","_searchQueryDecs","_init_searchQuery","_contentErrorDecs","_init_contentError","_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","customElement","_FolderPaneView","_A","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","property","state","query","WebComponent","args","event","authn","pane","container","dom","statusArea","operationGeneration","paneName","getPaneLabel","name","resolve","isSafeCreationName","invalidCreationNameMessage","created","mintPaneInstance","stillOwnsNavigation","error","PaneMintError","setMintStatus","input","files","validFiles","file","remaining","refreshes","finish","uri","message","selectedResource","subject","resource","view","aclControl","authSession","invalidateRenderRequest","changedProperties","currentPane","selected","isContainerResource","root","parent","rootUri","store","navigationGeneration","navigationContext","reload","log","confirmed","containedResource","members","ns","member","containerView","newInstance","target","generation","isJavaScriptFile","isAccessDeniedError","mintClass","mintClassPane","relevantPanes","candidate","getRelevantPanes","options","selectedPane","paneElement","provider","menuItems","label","FILE_EXPLORER_OPEN_PANE_EVENT","item","FILE_EXPLORER_BACK_EVENT","isExplorerEvent","nextPane","request","isCurrentRenderRequest","composeExplorer","renderGeneration","isCurrentSelection","indexRequested","applicationSubject","getIndexedApplicationSubject","sourcePane","indexedContainerUri","getIndexedContainer","indexedContainer","nothing"],"sources":["../../../src/components/folder-pane-view/FolderPaneView.ts"],"sourcesContent":["import { aclControl, composeExplorer, customElement, FILE_EXPLORER_BACK_EVENT, FILE_EXPLORER_OPEN_PANE_EVENT, getRelevantPanes, isExplorerEvent, log, ns, showDialog, WebComponent, widgets } from 'solid-ui'\nimport { authn, authSession } from 'solid-logic'\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 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 { 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'\n\ntype CreatedResource = {\n container: NamedNode\n containedResource: NamedNode\n /** Omit to refresh listings without changing the content view (uploads). */\n newInstance?: NamedNode\n pane?: PaneDefinition\n}\n\ntype ExplorerRenderOptions = {\n paneOptions?: unknown\n isCurrent?: () => boolean\n showHeader?: boolean\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 @property({ type: Boolean, attribute: 'full-view' })\n accessor fullView = false\n\n /** Leaves out the storage header, keeping the sidebar and content. */\n @property({ type: Boolean, attribute: 'hide-storage-header' })\n accessor hideStorageHeader = false\n\n @state()\n accessor selectedResource: NamedNode | undefined = undefined\n\n @state()\n accessor containerView: 'grid' | 'list' = 'grid'\n\n @state()\n accessor searchQuery = ''\n\n @state()\n private accessor contentError: { title: string, message: string } | undefined = undefined\n\n private initialLoadGeneration = 0\n private renderGeneration = 0\n private creationInFlight = false\n private authListenersAttached = false\n private dropProtectionAttached = false\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 /** Top-of-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 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 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 // 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 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 private handleAuthChange = () => {\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 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 console.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 }\n }\n\n private handleUpload = (event: Event) => {\n event.stopPropagation()\n if (this.creationInFlight || !authn.currentUser()) return\n const container = this.getActiveContainer()\n const statusArea = this.statusArea\n if (!container || !statusArea || !this.store) return\n const input = this.ownerDocument.createElement('input')\n input.type = 'file'\n input.multiple = true\n input.addEventListener('change', () => {\n const files = Array.from(input.files ?? [])\n const validFiles = files.filter(file => isSafeCreationName(file.name))\n const invalidFiles = files.filter(file => !isSafeCreationName(file.name))\n invalidFiles.forEach(file => setMintStatus(statusArea, 'error', `${file.name}: ${invalidCreationNameMessage}`))\n if (!validFiles.length) return\n this.creationInFlight = true\n let remaining = validFiles.length\n let refreshes = Promise.resolve()\n setMintStatus(statusArea, 'progress', `Uploading ${validFiles.length} file${validFiles.length === 1 ? '' : 's'}`)\n const finish = () => {\n remaining--\n if (remaining === 0) {\n this.creationInFlight = false\n if (statusArea.dataset.status === 'progress') statusArea.replaceChildren()\n }\n }\n widgets.uploadFiles(\n this.store!.fetcher,\n validFiles,\n container.uri,\n container.uri,\n (_file: File, uri: string) => {\n refreshes = refreshes.then(() => this.showCreatedResource({\n container,\n containedResource: this.store!.sym(uri)\n })).finally(finish)\n },\n (_file: File, message: string) => {\n setMintStatus(statusArea, 'error', message)\n finish()\n }\n )\n })\n input.click()\n }\n\n protected updated (changedProperties: PropertyValues<this>) {\n if (\n (changedProperties.has('subject') || changedProperties.has('browserContext')) &&\n this.subject\n ) {\n if (changedProperties.has('subject') || changedProperties.has('browserContext')) {\n this.selectedResource = undefined\n this.renderGeneration++\n this.initialLoadGeneration++\n }\n void this.showInitialContainer(this.subject)\n return\n }\n\n if (changedProperties.has('fullView') && changedProperties.get('fullView') !== undefined) {\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 // 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: { title: string, message: string }) {\n 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 clearContentError = () => {\n this.contentError = undefined\n }\n\n private retryContent = () => {\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)\n } else if (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 if (selected && this.resourceLogic && isContainerResource(selected, this.resourceLogic)) {\n return selected\n }\n\n const root = 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 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 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 containerView.view = this.containerView\n containerView.searchQuery = this.searchQuery\n containerView.hideRootSpecialFolders = this.subject\n ? selectedResource.sameTerm(this.subject)\n : false\n\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.store.fetcher.load(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 if (!this.selectedResource) {\n this.showSubject(subject)\n }\n }\n\n private getPaneForSubject (subject: NamedNode, relevantPanes: PaneDefinition[]) {\n const mintClass = this.store && (\n this.store.any(subject, ns.ui('mintClass'), undefined, subject.doc()) ||\n this.store.any(subject.doc(), ns.ui('mintClass'), undefined, subject.doc())\n )\n if (mintClass) {\n const mintClassPane = relevantPanes.find(pane => pane.mintClass?.sameTerm(mintClass))\n if (mintClassPane) return mintClassPane\n }\n\n return relevantPanes.find(candidate => candidate.shouldGetFocus?.(subject)) || relevantPanes[0]\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 || this.getPaneForSubject(subject, 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 = relevantPanes\n .map(candidate => {\n const label = candidate.label(subject, this.browserContext as DataBrowserContext)\n if (!label) return undefined\n return {\n label,\n action: (_event: Event) => {\n provider.dispatchEvent(new CustomEvent(FILE_EXPLORER_OPEN_PANE_EVENT, {\n bubbles: true,\n composed: true,\n detail: { subjectUri: subject.uri, paneName: candidate.name }\n }))\n }\n }\n })\n .filter((item): item is { label: string, action: (event: Event) => void } => item !== undefined)\n\n provider.addEventListener(FILE_EXPLORER_BACK_EVENT, event => {\n if (!isExplorerEvent(event, provider)) return\n event.stopPropagation()\n this.renderGeneration++\n this.selectedResource = undefined\n this.renderContainerView(this.subject || subject)\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 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 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 ) {\n const renderGeneration = ++this.renderGeneration\n\n try {\n const target = this.resourceTarget\n if (!target || !this.store || !this.resourceLogic) 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 (this.subject?.sameTerm(selectedResource) && !indexRequested && !isJavaScriptFile(selectedResource)) {\n this.renderContainerView(selectedResource)\n return\n }\n\n if (isContainerResource(selectedResource, this.resourceLogic)) {\n try {\n await this.store.fetcher.load(selectedResource)\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 (indexRequested || this.resourceLogic.containerHasIndexDocument(selectedResource)) {\n const applicationSubject = this.store.sym(\n getIndexedApplicationSubject(selectedResource, pane?.name)\n )\n try {\n await this.store.fetcher.load(applicationSubject.doc())\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 this.renderContainerView(selectedResource)\n return\n }\n\n try {\n await this.store.fetcher.load(selectedResource)\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) {\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 indexedContainerUri = getIndexedContainer(resource)\n const indexedContainer = indexedContainerUri && this.store\n ? this.store.sym(indexedContainerUri)\n : undefined\n const subject = indexedContainer ?? resource\n const indexRequested = !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 // 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)\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 if (this.subject) this.showSubject(this.subject)\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 render () {\n if (this.fullView) {\n return html`\n ${this.renderContentError()}\n <div\n class=\"folder-pane-full-view\"\n ?hidden=${!!this.contentError}\n @resource-selected=${this.handleResourceSelected}\n @resource-open-pane=${this.handleResourceOpenPane}\n ></div>\n `\n }\n\n return html`\n ${this.hideStorageHeader ? nothing : this.renderStorageHeader()}\n <div\n class=\"folder-pane-main-content\"\n @resource-selected=${this.handleResourceSelected}\n @resource-open-pane=${this.handleResourceOpenPane}\n >\n <folder-pane-sidebar\n .store=${this.store}\n .resourceLogic=${this.resourceLogic}\n .subject=${this.subject}\n .selectedResource=${this.selectedResource ?? this.subject}\n ></folder-pane-sidebar>\n <div class=\"folder-pane-content-column\">\n <div class=\"folder-pane-status\"></div>\n ${this.renderContentError()}\n <folder-pane-content ?hidden=${!!this.contentError}></folder-pane-content>\n </div>\n </div>\n `\n }\n\n private renderStorageHeader () {\n return html`\n <folder-pane-storage-header\n .subject=${this.subject}\n .selectedResource=${this.selectedResource ?? this.subject}\n .browserContext=${this.browserContext}\n .paneList=${this.browserContext?.session.paneRegistry.list ?? []}\n .view=${this.containerView}\n .searchQuery=${this.searchQuery}\n .canCreate=${Boolean(authn.currentUser())}\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBuFiC,KAAA,CAgBtF/B,EAAc,kBAAkB,CAAC;AAAA,IAAAgC,IAAAC,kBAAA,IAAAC,QAAA,GAAAC,kBAAA,IAAAD,QAAA,GAAAE,kBAAA,IAAAF,QAAA,GAAAG,kBAAA,IAAAH,QAAA,GAAAI,kBAAA,IAAAJ,QAAA,GAAAK,kBAAA,IAAAL,QAAA,GAAAM,kBAAA,IAAAN,QAAA,GAAAO,kBAAA,IAAAP,QAAA,GAAAQ,kBAAA,IAAAR,QAAA,GAAAS,kBAAA,IAAAT,QAA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8BACnC,KAAKC,aAAY;;;CAG7C;CAEQR,qBAAsB;EAe5B,OAdI,KAAK/H,eACAvI,CAAI;;;qBAGI,KAAKuI,aAAaiD,MAAK;uBACrB,KAAKjD,aAAa/B,QAAO;qBAC3B,KAAKkC,kBAAiB;;2CAEA,KAAKqI,aAAY;;;UAMjD9Q;CACT;AACF,GAAC,CAAAgR,GAAA,CAAA1N,IAAAE,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC,GAAAE,GAAAC,IAAAC,IAAAC,IAAAd,KAAA4N,GAAA,CAAA9P,IAAA+P,OAAAC,GAAAJ,IAAA;CAAA;EAAA7O;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;AAAA,GAAA9B,IAAA,GAAA,KAAA,GApvB2CvB,CAAY,GAAAuR,GAAA"}
|
package/dist/folderPane.cjs.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.folder-pane{box-sizing:border-box;text-align:left;flex-direction:column;align-self:stretch;width:100%;max-width:none;height:100%;min-height:0;margin-left:0;margin-right:0;display:flex;overflow:hidden}.folder-pane-package-div{text-align:left;width:100%;max-width:none;margin-left:0;margin-right:0;display:block;overflow-x:auto}folder-pane-view{flex-direction:column;flex:auto;width:100%;height:100%;min-height:0;display:flex}.folder-pane-main-content{border:1px solid var(--solid-ui-color-gray-200,#cbd5e1);background:var(--solid-ui-color-white,#fff);border-radius:5px;flex-direction:row;flex:auto;width:100%;height:80vh;min-height:32rem;display:flex;overflow:hidden}.folder-pane-view-controls{flex:none;justify-content:flex-end;align-items:center;gap:.35rem;padding:10px 0;display:flex}.folder-pane-view-controls button{width:var(--solid-ui-clickable-area,42px);height:var(--solid-ui-clickable-area,42px);color:var(--solid-ui-color-gray-500,#6a7282);cursor:pointer;background:0 0;border:0;border-radius:5px;justify-content:center;align-items:center;padding:0;display:inline-flex}.folder-pane-view-controls button[aria-pressed=true],.folder-pane-view-controls button:hover{background:var(--solid-ui-color-primary-selected,#cbb9ff);color:var(--solid-ui-color-primary,#7c4dff)}.folder-pane-view-controls button:focus-visible{outline:2px solid var(--solid-ui-color-primary,#7c4dff);outline-offset:-2px}.folder-pane-view-controls icon-lucide-layout-grid,.folder-pane-view-controls icon-lucide-list{width:16px;height:16px}folder-pane-sidebar{box-sizing:border-box;border-right:1px solid var(--solid-ui-color-gray-200,#cbd5e1);flex-direction:column;flex:0 0 256px;min-width:256px;min-height:0;display:flex;overflow:hidden}.folder-pane-content-column{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex}.folder-pane-content-column>folder-pane-content{box-sizing:border-box;padding:1rem}.folder-pane-content-column>folder-pane-content:has(>solid-ui-file-explorer-provider){padding:0}.folder-pane-full-view{flex-direction:column;flex:auto;width:100%;height:100%;min-height:0;display:flex;overflow:auto}.folder-pane-access-denied-message{box-sizing:border-box;text-align:center;flex:auto;justify-content:center;align-items:center;width:100%;min-width:0;max-width:100%;height:100%;min-height:0;padding:32px;display:flex;overflow:hidden}.folder-pane-access-denied-message-body{box-sizing:border-box;overflow-wrap:anywhere;width:100%;min-width:0;max-width:384px}.folder-pane-resource-error{box-sizing:border-box;background:0 0;border:0;flex:auto;justify-content:center;align-items:center;width:100%;min-width:0;min-height:0;padding:16px;display:flex}.folder-pane-resource-error>solid-ui-error-state{width:min(100%,640px);display:block}solid-ui-file-explorer-provider{flex-direction:column;gap:0;width:100%;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}solid-ui-file-explorer-provider>solid-ui-file-explorer-header{z-index:2;background:var(--solid-ui-color-white,#fff);width:100%;display:block;position:sticky;top:0}solid-ui-file-explorer-provider>.paneDiv,solid-ui-file-explorer-provider>.exceptionPane{box-sizing:border-box;flex:auto;width:100%;min-width:0;max-width:100%;min-height:0;margin:0;display:block;overflow:hidden auto}.folder-pane-predicate-cell{width:0;min-width:0;max-width:0;overflow:hidden;border:0!important;margin:0!important;padding:0!important}.folder-pane-status{border-bottom:1px solid var(--color-border,#ddd);text-align:left;flex-direction:column;gap:8px;padding:8px 12px;display:flex}.folder-pane-status[data-status=progress]{accent-color:auto;text-align:center;outline:0;flex:auto;justify-content:center;align-items:center;box-shadow:none!important;background:0 0!important;border:0!important}.folder-pane-status:empty{display:none}.folder-pane-status-message{align-items:center;gap:12px;padding-right:40px;display:flex;position:relative}.folder-pane-status-message>solid-ui-button{position:absolute;top:-6px;right:-4px}.folder-pane-status-message[data-status=error]{color:var(--color-error,#b00020)}.folder-pane-status-text{flex:auto}.folder-pane-status[data-status=progress] .folder-pane-status-message{width:100%;min-height:8rem;color:var(--solid-ui-color-gray-500,#6a7282);font-size:var(--solid-ui-font-size-sm,.875rem);outline:0;flex:auto;justify-content:center;align-items:center;box-shadow:none!important;background:0 0!important;border:0!important}.folder-pane-status[data-status=progress] .folder-pane-status-text{flex:0 auto}.folder-pane-drop-target{width:var(--icon-base,2em);min-width:var(--icon-base,2em);max-width:var(--icon-base,2em);height:var(--icon-base,2em);min-height:var(--icon-base,2em);max-height:var(--icon-base,2em);box-sizing:content-box;flex:0 0 var(--icon-base,2em);display:inline-block;margin:0!important;padding:0!important}.folder-pane-explicit-drop-icon{width:var(--icon-base,2em);height:var(--icon-base,2em)}@media (width<=700px){.folder-pane{margin-top:var(--spacing-2xs,.25em);margin-bottom:var(--spacing-2xs,.25em);border-top:1px solid #777;border-bottom:1px solid #777}.folder-pane-explicit-drop-icon{width:var(--icon-sm,1.5em);height:var(--icon-sm,1.5em)}}
|
|
2
|
-
:root{--icon-base:2em}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./helpers.cjs.js");require("./components/folder-pane-view/index.cjs.js"),;let t=require("solid-ui");var n={icon:t.icons.iconBase+`noun_973694_expanded.svg`,name:`folder`,mintNew:function(e,t){let n=e.session.store,r=(t.newInstance||n.sym(t.newBase)).uri;r.endsWith(`/`)&&(r=r.slice(0,-1));let i=n.sym(r+`/`);return t.newInstance=i,n.fetcher.webOperation(`PUT`,i.uri).then(function(){return t})},label:function(n,r){if(e.isJavaScriptFile(n))return null;let i=r.session.store,a=i.each(n,t.ns.ldp(`contains`)).length;return a>0?`Contents (`+a+`)`:i.holds(n,t.ns.rdf(`type`),t.ns.ldp(`Container`))?`Container (0)`:null},render:function(e,t,n){let
|
|
2
|
+
:root{--icon-base:2em}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./helpers.cjs.js");require("./components/folder-pane-view/index.cjs.js"),;let t=require("solid-ui");var n=[`explorer`,`storage`,`container`];function r(e){return e.folderView&&n.includes(e.folderView)?e.folderView:e.fullView===!0||e.solo===!0?`container`:`explorer`}var i={icon:t.icons.iconBase+`noun_973694_expanded.svg`,name:`folder`,mintNew:function(e,t){let n=e.session.store,r=(t.newInstance||n.sym(t.newBase)).uri;r.endsWith(`/`)&&(r=r.slice(0,-1));let i=n.sym(r+`/`);return t.newInstance=i,n.fetcher.webOperation(`PUT`,i.uri).then(function(){return t})},label:function(n,r){if(e.isJavaScriptFile(n))return null;let i=r.session.store,a=i.each(n,t.ns.ldp(`contains`)).length;return a>0?`Contents (`+a+`)`:i.holds(n,t.ns.rdf(`type`),t.ns.ldp(`Container`))?`Container (0)`:null},render:function(e,t,n){let i=t.dom,a=i.createElement(`div`);a.classList.add(`instancePane`,`folder-pane`);let o=a.appendChild(i.createElement(`folder-pane-view`)),s=n&&typeof n==`object`?n:{};o.browserContext=t,o.subject=e;let c=r(s);return o.fullView=c===`container`,o.hideStorageHeader=c===`storage`,a}};exports.default=i,exports.folderViewFor=r;
|
|
3
3
|
//# sourceMappingURL=folderPane.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folderPane.cjs.js","names":["icons","isJavaScriptFile","ns","require_helpers","solid_ui","folderPane_default","kb","context","u","newPaneOptions","normalizedInstance","subject","n","dom","div","folderPaneView","renderOptions","paneOptions"],"sources":["../src/folderPane.ts"],"sourcesContent":["/* Folder pane\n **\n ** This outline pane lists the members of a folder\n */\n\nimport './components/folder-pane-view'\nimport type FolderPaneView from './components/folder-pane-view/FolderPaneView'\nimport { icons, ns } from 'solid-ui'\nimport { isJavaScriptFile } from './helpers'\nimport './styles/folderPane.css'\nimport './styles/utilities.css'\n\nexport { getCreationNoun, getCreationPanes, getPaneLabel } from './helpers'\n\ntype FolderPaneRenderOptions = {\n fullView?: boolean\n solo?: boolean\n}\n\nexport default {\n icon: icons.iconBase + 'noun_973694_expanded.svg',\n name: 'folder',\n\n // Create a new folder in a Solid system,\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n const newInstance =\n newPaneOptions.newInstance || kb.sym(newPaneOptions.newBase)\n let u = newInstance.uri\n if (u.endsWith('/')) {\n u = u.slice(0, -1) // chop off trailer\n } // { throw new Error('URI of new folder must end in \"/\" :' + u) }\n const normalizedInstance = kb.sym(u + '/')\n newPaneOptions.newInstance = normalizedInstance\n\n return kb.fetcher\n .webOperation('PUT', normalizedInstance.uri)\n .then(function () {\n return newPaneOptions\n })\n },\n\n label: function (subject, context) {\n if (isJavaScriptFile(subject)) return null\n const kb = context.session.store\n const n = kb.each(subject, ns.ldp('contains')).length\n if (n > 0) {\n return 'Contents (' + n + ')' // Show how many in hover text\n }\n if (kb.holds(subject, ns.rdf('type'), ns.ldp('Container'))) {\n // It is declared as being a container\n return 'Container (0)'\n }\n return null // Suppress pane otherwise\n },\n\n // Render a file folder in a LDP/solid system\n render: function (subject, context, paneOptions?: unknown) {\n\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('instancePane', 'folder-pane')\n const folderPaneView = div.appendChild(dom.createElement('folder-pane-view')) as FolderPaneView\n const renderOptions = paneOptions && typeof paneOptions === 'object'\n ? paneOptions as FolderPaneRenderOptions\n : {}\n folderPaneView.browserContext = context\n folderPaneView.subject = subject\n
|
|
1
|
+
{"version":3,"file":"folderPane.cjs.js","names":["icons","isJavaScriptFile","ns","require_helpers","solid_ui","FOLDER_VIEWS","folderViewFor","options","folderPane_default","kb","context","u","newPaneOptions","normalizedInstance","subject","n","dom","div","folderPaneView","renderOptions","paneOptions","folderView"],"sources":["../src/folderPane.ts"],"sourcesContent":["/* Folder pane\n **\n ** This outline pane lists the members of a folder\n */\n\nimport './components/folder-pane-view'\nimport type FolderPaneView from './components/folder-pane-view/FolderPaneView'\nimport { icons, ns } from 'solid-ui'\nimport { isJavaScriptFile } from './helpers'\nimport './styles/folderPane.css'\nimport './styles/utilities.css'\n\nexport { getCreationNoun, getCreationPanes, getPaneLabel } from './helpers'\n\n/**\n * How a folder is presented:\n * - `explorer`: storage header, sidebar and content (the viewer's own storage, the server root)\n * - `storage`: sidebar and content, under the navbar of someone else's pod\n * - `container`: the container alone (a container URL opened on its own)\n */\nexport type FolderView = 'explorer' | 'storage' | 'container'\n\ntype FolderPaneRenderOptions = {\n folderView?: FolderView\n fullView?: boolean\n solo?: boolean\n}\n\nconst FOLDER_VIEWS: FolderView[] = ['explorer', 'storage', 'container']\n\nexport function folderViewFor (options: FolderPaneRenderOptions): FolderView {\n if (options.folderView && FOLDER_VIEWS.includes(options.folderView)) return options.folderView\n return options.fullView === true || options.solo === true ? 'container' : 'explorer'\n}\n\nexport default {\n icon: icons.iconBase + 'noun_973694_expanded.svg',\n name: 'folder',\n\n // Create a new folder in a Solid system,\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n const newInstance =\n newPaneOptions.newInstance || kb.sym(newPaneOptions.newBase)\n let u = newInstance.uri\n if (u.endsWith('/')) {\n u = u.slice(0, -1) // chop off trailer\n } // { throw new Error('URI of new folder must end in \"/\" :' + u) }\n const normalizedInstance = kb.sym(u + '/')\n newPaneOptions.newInstance = normalizedInstance\n\n return kb.fetcher\n .webOperation('PUT', normalizedInstance.uri)\n .then(function () {\n return newPaneOptions\n })\n },\n\n label: function (subject, context) {\n if (isJavaScriptFile(subject)) return null\n const kb = context.session.store\n const n = kb.each(subject, ns.ldp('contains')).length\n if (n > 0) {\n return 'Contents (' + n + ')' // Show how many in hover text\n }\n if (kb.holds(subject, ns.rdf('type'), ns.ldp('Container'))) {\n // It is declared as being a container\n return 'Container (0)'\n }\n return null // Suppress pane otherwise\n },\n\n // Render a file folder in a LDP/solid system\n render: function (subject, context, paneOptions?: unknown) {\n\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('instancePane', 'folder-pane')\n const folderPaneView = div.appendChild(dom.createElement('folder-pane-view')) as FolderPaneView\n const renderOptions = paneOptions && typeof paneOptions === 'object'\n ? paneOptions as FolderPaneRenderOptions\n : {}\n folderPaneView.browserContext = context\n folderPaneView.subject = subject\n const folderView = folderViewFor(renderOptions)\n folderPaneView.fullView = folderView === 'container'\n folderPaneView.hideStorageHeader = folderView === 'storage'\n\n // The pane registry is needed to open the internal pane on Alt-click.\n // addDownstreamChangeListener is a high level function which when someone else changes the resource,\n // reloads it into the kb, then must call addDownstreamChangeListener to be able to update the folder pane.\n // SAM need to figure out how to add this line later kb.updater.addDownstreamChangeListener(subject, refresh) // Update store and call me if folder changes\n\n return div\n }\n}\n// ends\n"],"mappings":"A,+LA4BA,IAAMK,EAA6B,CAAC,WAAY,UAAW,WAAW,EAEtE,SAAgBC,EAAe,EAA8C,CAE3E,OADIC,EAAQ,YAAcF,EAAa,SAASE,EAAQ,UAAU,EAAUA,EAAQ,WAC7EA,EAAQ,WAAa,IAAQA,EAAQ,OAAS,GAAO,YAAc,UAC5E,CAEA,IAAAC,EAAe,CACb,KA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getCreationPanes, getPaneLabel } from './helpers';
|
|
2
|
+
/**
|
|
3
|
+
* How a folder is presented:
|
|
4
|
+
* - `explorer`: storage header, sidebar and content (the viewer's own storage, the server root)
|
|
5
|
+
* - `storage`: sidebar and content, under the navbar of someone else's pod
|
|
6
|
+
* - `container`: the container alone (a container URL opened on its own)
|
|
7
|
+
*/
|
|
8
|
+
export type FolderView = 'explorer' | 'storage' | 'container';
|
|
9
|
+
type FolderPaneRenderOptions = {
|
|
10
|
+
folderView?: FolderView;
|
|
11
|
+
fullView?: boolean;
|
|
12
|
+
solo?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare function folderViewFor(options: FolderPaneRenderOptions): FolderView;
|
|
2
15
|
declare const _default: {
|
|
3
16
|
icon: string;
|
|
4
17
|
name: string;
|
package/dist/folderPane.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folderPane.d.ts","sourceRoot":"","sources":["../src/folderPane.ts"],"names":[],"mappings":"AAKA,OAAO,+BAA+B,CAAA;AAItC,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;;;;;;
|
|
1
|
+
{"version":3,"file":"folderPane.d.ts","sourceRoot":"","sources":["../src/folderPane.ts"],"names":[],"mappings":"AAKA,OAAO,+BAA+B,CAAA;AAItC,OAAO,yBAAyB,CAAA;AAChC,OAAO,wBAAwB,CAAA;AAE/B,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAA;AAE7D,KAAK,uBAAuB,GAAG;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAID,wBAAgB,aAAa,CAAE,OAAO,EAAE,uBAAuB,GAAG,UAAU,CAG3E;;;;;;uDAwCmD,OAAO;;AAtC3D,wBA4DC"}
|
package/dist/folderPane.esm.js
CHANGED
|
@@ -5,7 +5,15 @@ import "./components/folder-pane-view/index.esm.js";
|
|
|
5
5
|
|
|
6
6
|
import { icons as t, ns as n } from "solid-ui";
|
|
7
7
|
// src/folderPane.ts
|
|
8
|
-
var r =
|
|
8
|
+
var r = [
|
|
9
|
+
"explorer",
|
|
10
|
+
"storage",
|
|
11
|
+
"container"
|
|
12
|
+
];
|
|
13
|
+
function i(e) {
|
|
14
|
+
return e.folderView && r.includes(e.folderView) ? e.folderView : e.fullView === !0 || e.solo === !0 ? "container" : "explorer";
|
|
15
|
+
}
|
|
16
|
+
var a = {
|
|
9
17
|
icon: t.iconBase + "noun_973694_expanded.svg",
|
|
10
18
|
name: "folder",
|
|
11
19
|
mintNew: function(e, t) {
|
|
@@ -22,12 +30,14 @@ var r = {
|
|
|
22
30
|
return a > 0 ? "Contents (" + a + ")" : i.holds(t, n.rdf("type"), n.ldp("Container")) ? "Container (0)" : null;
|
|
23
31
|
},
|
|
24
32
|
render: function(e, t, n) {
|
|
25
|
-
let r = t.dom,
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
33
|
+
let r = t.dom, a = r.createElement("div");
|
|
34
|
+
a.classList.add("instancePane", "folder-pane");
|
|
35
|
+
let o = a.appendChild(r.createElement("folder-pane-view")), s = n && typeof n == "object" ? n : {};
|
|
36
|
+
o.browserContext = t, o.subject = e;
|
|
37
|
+
let c = i(s);
|
|
38
|
+
return o.fullView = c === "container", o.hideStorageHeader = c === "storage", a;
|
|
29
39
|
}
|
|
30
40
|
};
|
|
31
|
-
export {
|
|
41
|
+
export { a as default, i as folderViewFor };
|
|
32
42
|
|
|
33
43
|
//# sourceMappingURL=folderPane.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"folderPane.esm.js","names":["folderPane_default","icons","kb","context","u","newPaneOptions","normalizedInstance","isJavaScriptFile","subject","n","ns","dom","div","folderPaneView","renderOptions","paneOptions"],"sources":["../src/folderPane.ts"],"sourcesContent":["/* Folder pane\n **\n ** This outline pane lists the members of a folder\n */\n\nimport './components/folder-pane-view'\nimport type FolderPaneView from './components/folder-pane-view/FolderPaneView'\nimport { icons, ns } from 'solid-ui'\nimport { isJavaScriptFile } from './helpers'\nimport './styles/folderPane.css'\nimport './styles/utilities.css'\n\nexport { getCreationNoun, getCreationPanes, getPaneLabel } from './helpers'\n\ntype FolderPaneRenderOptions = {\n fullView?: boolean\n solo?: boolean\n}\n\nexport default {\n icon: icons.iconBase + 'noun_973694_expanded.svg',\n name: 'folder',\n\n // Create a new folder in a Solid system,\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n const newInstance =\n newPaneOptions.newInstance || kb.sym(newPaneOptions.newBase)\n let u = newInstance.uri\n if (u.endsWith('/')) {\n u = u.slice(0, -1) // chop off trailer\n } // { throw new Error('URI of new folder must end in \"/\" :' + u) }\n const normalizedInstance = kb.sym(u + '/')\n newPaneOptions.newInstance = normalizedInstance\n\n return kb.fetcher\n .webOperation('PUT', normalizedInstance.uri)\n .then(function () {\n return newPaneOptions\n })\n },\n\n label: function (subject, context) {\n if (isJavaScriptFile(subject)) return null\n const kb = context.session.store\n const n = kb.each(subject, ns.ldp('contains')).length\n if (n > 0) {\n return 'Contents (' + n + ')' // Show how many in hover text\n }\n if (kb.holds(subject, ns.rdf('type'), ns.ldp('Container'))) {\n // It is declared as being a container\n return 'Container (0)'\n }\n return null // Suppress pane otherwise\n },\n\n // Render a file folder in a LDP/solid system\n render: function (subject, context, paneOptions?: unknown) {\n\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('instancePane', 'folder-pane')\n const folderPaneView = div.appendChild(dom.createElement('folder-pane-view')) as FolderPaneView\n const renderOptions = paneOptions && typeof paneOptions === 'object'\n ? paneOptions as FolderPaneRenderOptions\n : {}\n folderPaneView.browserContext = context\n folderPaneView.subject = subject\n
|
|
1
|
+
{"version":3,"file":"folderPane.esm.js","names":["FOLDER_VIEWS","folderViewFor","options","folderPane_default","icons","kb","context","u","newPaneOptions","normalizedInstance","isJavaScriptFile","subject","n","ns","dom","div","folderPaneView","renderOptions","paneOptions","folderView"],"sources":["../src/folderPane.ts"],"sourcesContent":["/* Folder pane\n **\n ** This outline pane lists the members of a folder\n */\n\nimport './components/folder-pane-view'\nimport type FolderPaneView from './components/folder-pane-view/FolderPaneView'\nimport { icons, ns } from 'solid-ui'\nimport { isJavaScriptFile } from './helpers'\nimport './styles/folderPane.css'\nimport './styles/utilities.css'\n\nexport { getCreationNoun, getCreationPanes, getPaneLabel } from './helpers'\n\n/**\n * How a folder is presented:\n * - `explorer`: storage header, sidebar and content (the viewer's own storage, the server root)\n * - `storage`: sidebar and content, under the navbar of someone else's pod\n * - `container`: the container alone (a container URL opened on its own)\n */\nexport type FolderView = 'explorer' | 'storage' | 'container'\n\ntype FolderPaneRenderOptions = {\n folderView?: FolderView\n fullView?: boolean\n solo?: boolean\n}\n\nconst FOLDER_VIEWS: FolderView[] = ['explorer', 'storage', 'container']\n\nexport function folderViewFor (options: FolderPaneRenderOptions): FolderView {\n if (options.folderView && FOLDER_VIEWS.includes(options.folderView)) return options.folderView\n return options.fullView === true || options.solo === true ? 'container' : 'explorer'\n}\n\nexport default {\n icon: icons.iconBase + 'noun_973694_expanded.svg',\n name: 'folder',\n\n // Create a new folder in a Solid system,\n mintNew: function (context, newPaneOptions) {\n const kb = context.session.store\n const newInstance =\n newPaneOptions.newInstance || kb.sym(newPaneOptions.newBase)\n let u = newInstance.uri\n if (u.endsWith('/')) {\n u = u.slice(0, -1) // chop off trailer\n } // { throw new Error('URI of new folder must end in \"/\" :' + u) }\n const normalizedInstance = kb.sym(u + '/')\n newPaneOptions.newInstance = normalizedInstance\n\n return kb.fetcher\n .webOperation('PUT', normalizedInstance.uri)\n .then(function () {\n return newPaneOptions\n })\n },\n\n label: function (subject, context) {\n if (isJavaScriptFile(subject)) return null\n const kb = context.session.store\n const n = kb.each(subject, ns.ldp('contains')).length\n if (n > 0) {\n return 'Contents (' + n + ')' // Show how many in hover text\n }\n if (kb.holds(subject, ns.rdf('type'), ns.ldp('Container'))) {\n // It is declared as being a container\n return 'Container (0)'\n }\n return null // Suppress pane otherwise\n },\n\n // Render a file folder in a LDP/solid system\n render: function (subject, context, paneOptions?: unknown) {\n\n const dom = context.dom\n const div = dom.createElement('div')\n div.classList.add('instancePane', 'folder-pane')\n const folderPaneView = div.appendChild(dom.createElement('folder-pane-view')) as FolderPaneView\n const renderOptions = paneOptions && typeof paneOptions === 'object'\n ? paneOptions as FolderPaneRenderOptions\n : {}\n folderPaneView.browserContext = context\n folderPaneView.subject = subject\n const folderView = folderViewFor(renderOptions)\n folderPaneView.fullView = folderView === 'container'\n folderPaneView.hideStorageHeader = folderView === 'storage'\n\n // The pane registry is needed to open the internal pane on Alt-click.\n // addDownstreamChangeListener is a high level function which when someone else changes the resource,\n // reloads it into the kb, then must call addDownstreamChangeListener to be able to update the folder pane.\n // SAM need to figure out how to add this line later kb.updater.addDownstreamChangeListener(subject, refresh) // Update store and call me if folder changes\n\n return div\n }\n}\n// ends\n"],"mappings":";;;;;;AA4BA,IAAMA,IAA6B;CAAC;CAAY;CAAW;AAAW;AAEtE,SAAgBC,EAAe,GAA8C;CAE3E,OADIC,EAAQ,cAAcF,EAAa,SAASE,EAAQ,UAAU,IAAUA,EAAQ,aAC7EA,EAAQ,aAAa,MAAQA,EAAQ,SAAS,KAAO,cAAc;AAC5E;AAEA,IAAAC,IAAe;CACb,MAAMC,EAAM,WAAW;CACvB,MAAM;CAGN,SAAS,SAAU,GAAS,GAAgB;EAC1C,IAAMC,IAAKC,EAAQ,QAAQ,OAGvBC,KADFC,EAAe,eAAeH,EAAG,IAAIG,EAAe,OAAO,EAAA,CACzC;EACpB,AAAID,EAAE,SAAS,GAAG,MAChB,IAAIA,EAAE,MAAM,GAAG,EAAE;EAEnB,IAAME,IAAqBJ,EAAG,IAAIE,IAAI,GAAG;EAGzC,OAFA,EAAe,cAAcE,GAEtBJ,EAAG,QACP,aAAa,OAAOI,EAAmB,GAAG,CAAC,CAC3C,KAAK,WAAY;GAChB,OAAOD;EACT,CAAC;CACL;CAEA,OAAO,SAAU,GAAS,GAAS;EACjC,IAAIE,EAAiBC,CAAO,GAAG,OAAO;EACtC,IAAMN,IAAKC,EAAQ,QAAQ,OACrBM,IAAIP,EAAG,KAAKM,GAASE,EAAG,IAAI,UAAU,CAAC,CAAC,CAAC;EAQ/C,OAPID,IAAI,IACC,eAAeA,IAAI,MAExBP,EAAG,MAAMM,GAASE,EAAG,IAAI,MAAM,GAAGA,EAAG,IAAI,WAAW,CAAC,IAEhD,kBAEF;CACT;CAGA,QAAQ,SAAU,GAAS,GAAS,GAAuB;EAEzD,IAAMC,IAAMR,EAAQ,KACdS,IAAMD,EAAI,cAAc,KAAK;EACnC,EAAI,UAAU,IAAI,gBAAgB,aAAa;EAC/C,IAAME,IAAiBD,EAAI,YAAYD,EAAI,cAAc,kBAAkB,CAAC,GACtEG,IAAgBC,KAAe,OAAOA,KAAgB,WACxDA,IACA,CAAC;EAEL,AADA,EAAe,iBAAiBZ,GAChC,EAAe,UAAUK;EACzB,IAAMQ,IAAalB,EAAcgB,CAAa;EAS9C,OARA,EAAe,WAAWE,MAAe,aACzC,EAAe,oBAAoBA,MAAe,WAO3CJ;CACT;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=class extends Error{constructor(){super(`Request queue was cleared`),this.name=`RequestQueueClearedError`}};function t(e){return typeof e==`object`&&e?e:void 0}function n(e){let n=t(e);return n?.status===429||n?.response?.status===429||e instanceof Error&&/\bStatus: 429\b/.test(e.message)}function r(e,n,r=Date.now()){let i=t(e),a=i?.headers??i?.response?.headers,o=typeof a?.get==`function`?a.get(`retry-after`):null;if(!o)return n;let s=Number(o);if(Number.isFinite(s))return Math.max(0,s*1e3);let c=Date.parse(o);return Number.isNaN(c)?n:Math.max(0,c-r)}function i({concurrency:t=4,maxRetries:i=2,defaultRetryAfterMs:a=1e4,wait:o=e=>new Promise(t=>setTimeout(t,e))}={}){let s=[],c=0,l,u=0;function d(){if(!l)for(;c<t&&s.length>0;){let e=s.shift();c++,f(e,u)}}async function f(e,t){try{e.resolve(await e.task())}catch(o){t===u&&n(o)&&e.retries<i?(e.retries++,s.unshift(e),p(r(o,a))):e.reject(o)}finally{c--,d()}}function p(e){if(l)return;let t=u;l=o(e).then(()=>{t===u&&(l=void 0,d())})}return{run(e){return new Promise((t,n)=>{s.push({task:e,resolve:t,reject:n,retries:0}),d()})},clear(){u++,l=void 0;let t=s;s=[];for(let n of t)n.reject(new e)}}}exports.RequestQueueClearedError=e,exports.createRequestQueue=i,exports.getRetryAfterMs=r,exports.isRateLimitedError=n;
|
|
2
|
+
//# sourceMappingURL=requestQueue.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestQueue.cjs.js","names":["RequestQueueClearedError","getErrorResponse","error","isRateLimitedError","response","getRetryAfterMs","headers","value","fallbackMs","seconds","date","now","createRequestQueue","resolve","ms","pending","active","pausedUntil","generation","pump","concurrency","item","execute","taskGeneration","maxRetries","pause","defaultRetryAfterMs","pauseGeneration","wait","cleared"],"sources":["../src/requestQueue.ts"],"sourcesContent":["/**\n * Limits how many advisory requests (member counts, access indicators) a\n * folder view sends at once, and backs off when the server answers 429.\n *\n * Opening a folder used to fetch every child immediately. Each browser request\n * also needs a CORS preflight, so a folder with a few dozen children could\n * exceed per-IP rate limits such as Cloudflare's and leave counts missing.\n */\n\nexport class RequestQueueClearedError extends Error {\n constructor () {\n super('Request queue was cleared')\n this.name = 'RequestQueueClearedError'\n }\n}\n\ntype RequestQueueOptions = {\n concurrency?: number\n maxRetries?: number\n defaultRetryAfterMs?: number\n wait?: (ms: number) => Promise<void>\n}\n\ntype PendingTask = {\n task: () => Promise<unknown>\n resolve: (value: unknown) => void\n reject: (error: unknown) => void\n retries: number\n}\n\nexport type RequestQueue = {\n run: <T>(task: () => Promise<T>) => Promise<T>\n clear: () => void\n}\n\ntype ErrorWithResponse = {\n status?: number\n headers?: Headers\n response?: { status?: number, headers?: Headers }\n}\n\nfunction getErrorResponse (error: unknown): ErrorWithResponse | undefined {\n return typeof error === 'object' && error !== null ? error as ErrorWithResponse : undefined\n}\n\nfunction isRateLimitedError (error: unknown): boolean {\n const response = getErrorResponse(error)\n if (response?.status === 429 || response?.response?.status === 429) return true\n // solid-logic's metadata HEAD reports failures only in the message.\n return error instanceof Error && /\\bStatus: 429\\b/.test(error.message)\n}\n\n/**\n * Returns the delay requested by a 429's Retry-After header (seconds or an\n * HTTP date), or `fallbackMs` when it is missing or unreadable.\n */\nfunction getRetryAfterMs (error: unknown, fallbackMs: number, now = Date.now()): number {\n const response = getErrorResponse(error)\n const headers = response?.headers ?? response?.response?.headers\n const value = typeof headers?.get === 'function' ? headers.get('retry-after') : null\n if (!value) return fallbackMs\n const seconds = Number(value)\n if (Number.isFinite(seconds)) return Math.max(0, seconds * 1000)\n const date = Date.parse(value)\n return Number.isNaN(date) ? fallbackMs : Math.max(0, date - now)\n}\n\nfunction createRequestQueue ({\n concurrency = 4,\n maxRetries = 2,\n defaultRetryAfterMs = 10_000,\n wait = ms => new Promise(resolve => setTimeout(resolve, ms))\n}: RequestQueueOptions = {}): RequestQueue {\n let pending: PendingTask[] = []\n let active = 0\n let pausedUntil: Promise<void> | undefined\n let generation = 0\n\n function pump () {\n if (pausedUntil) return\n while (active < concurrency && pending.length > 0) {\n const item = pending.shift()!\n active++\n void execute(item, generation)\n }\n }\n\n async function execute (item: PendingTask, taskGeneration: number) {\n try {\n item.resolve(await item.task())\n } catch (error) {\n if (taskGeneration === generation && isRateLimitedError(error) && item.retries < maxRetries) {\n item.retries++\n // Retry first so it is not overtaken by tasks queued after it.\n pending.unshift(item)\n pause(getRetryAfterMs(error, defaultRetryAfterMs))\n } else {\n item.reject(error)\n }\n } finally {\n active--\n pump()\n }\n }\n\n function pause (ms: number) {\n if (pausedUntil) return\n const pauseGeneration = generation\n pausedUntil = wait(ms).then(() => {\n if (pauseGeneration !== generation) return\n pausedUntil = undefined\n pump()\n })\n }\n\n return {\n run<T> (task: () => Promise<T>): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n pending.push({ task, resolve: resolve as (value: unknown) => void, reject, retries: 0 })\n pump()\n })\n },\n clear () {\n generation++\n pausedUntil = undefined\n const cleared = pending\n pending = []\n for (const item of cleared) item.reject(new RequestQueueClearedError())\n }\n }\n}\n\nexport { createRequestQueue, getRetryAfterMs, isRateLimitedError }\n"],"mappings":"AASA,IAAaA,EAAb,cAA8C,KAAM,CAClD,aAAe,CACb,MAAM,2BAA2B,EACjC,KAAK,KAAO,0BACd,CACF,EA2BA,SAASC,EAAkB,EAA+C,CACxE,OAAO,OAAOC,GAAU,UAAYA,EAAiBA,EAA6B,IAAA,EACpF,CAEA,SAASC,EAAoB,EAAyB,CACpD,IAAMC,EAAWH,EAAiBC,CAAK,EAGvC,OAFIE,GAAU,SAAW,KAAOA,GAAU,UAAU,SAAW,KAExDF,aAAiB,OAAS,kBAAkB,KAAKA,EAAM,OAAO,CACvE,CAMA,SAASG,EAAiB,EAAgB,EAAoB,EAAM,KAAK,IAAI,EAAW,CACtF,IAAMD,EAAWH,EAAiBC,CAAK,EACjCI,EAAUF,GAAU,SAAWA,GAAU,UAAU,QACnDG,EAAQ,OAAOD,GAAS,KAAQ,WAAaA,EAAQ,IAAI,aAAa,EAAI,KAChF,GAAI,CAACC,EAAO,OAAOC,EACnB,IAAMC,EAAU,OAAOF,CAAK,EAC5B,GAAI,OAAO,SAASE,CAAO,EAAG,OAAO,KAAK,IAAI,EAAGA,EAAU,GAAI,EAC/D,IAAMC,EAAO,KAAK,MAAMH,CAAK,EAC7B,OAAO,OAAO,MAAMG,CAAI,EAAIF,EAAa,KAAK,IAAI,EAAGE,EAAOC,CAAG,CACj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ests (member counts, access indicators) a
|
|
3
|
+
* folder view sends at once, and backs off when the server answers 429.
|
|
4
|
+
*
|
|
5
|
+
* Opening a folder used to fetch every child immediately. Each browser request
|
|
6
|
+
* also needs a CORS preflight, so a folder with a few dozen children could
|
|
7
|
+
* exceed per-IP rate limits such as Cloudflare's and leave counts missing.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RequestQueueClearedError extends Error {
|
|
10
|
+
constructor();
|
|
11
|
+
}
|
|
12
|
+
type RequestQueueOptions = {
|
|
13
|
+
concurrency?: number;
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
defaultRetryAfterMs?: number;
|
|
16
|
+
wait?: (ms: number) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export type RequestQueue = {
|
|
19
|
+
run: <T>(task: () => Promise<T>) => Promise<T>;
|
|
20
|
+
clear: () => void;
|
|
21
|
+
};
|
|
22
|
+
declare function isRateLimitedError(error: unknown): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the delay requested by a 429's Retry-After header (seconds or an
|
|
25
|
+
* HTTP date), or `fallbackMs` when it is missing or unreadable.
|
|
26
|
+
*/
|
|
27
|
+
declare function getRetryAfterMs(error: unknown, fallbackMs: number, now?: number): number;
|
|
28
|
+
declare function createRequestQueue({ concurrency, maxRetries, defaultRetryAfterMs, wait }?: RequestQueueOptions): RequestQueue;
|
|
29
|
+
export { createRequestQueue, getRetryAfterMs, isRateLimitedError };
|
|
30
|
+
//# sourceMappingURL=requestQueue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestQueue.d.ts","sourceRoot":"","sources":["../src/requestQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,qBAAa,wBAAyB,SAAQ,KAAK;;CAKlD;AAED,KAAK,mBAAmB,GAAG;IACzB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACrC,CAAA;AASD,MAAM,MAAM,YAAY,GAAG;IACzB,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;IAC9C,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB,CAAA;AAYD,iBAAS,kBAAkB,CAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKpD;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,SAAa,GAAG,MAAM,CAStF;AAED,iBAAS,kBAAkB,CAAE,EAC3B,WAAe,EACf,UAAc,EACd,mBAA4B,EAC5B,IAA4D,EAC7D,GAAE,mBAAwB,GAAG,YAAY,CA0DzC;AAED,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/requestQueue.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
constructor() {
|
|
4
|
+
super("Request queue was cleared"), this.name = "RequestQueueClearedError";
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
function t(e) {
|
|
8
|
+
return typeof e == "object" && e ? e : void 0;
|
|
9
|
+
}
|
|
10
|
+
function n(e) {
|
|
11
|
+
let n = t(e);
|
|
12
|
+
return n?.status === 429 || n?.response?.status === 429 || e instanceof Error && /\bStatus: 429\b/.test(e.message);
|
|
13
|
+
}
|
|
14
|
+
function r(e, n, r = Date.now()) {
|
|
15
|
+
let i = t(e), a = i?.headers ?? i?.response?.headers, o = typeof a?.get == "function" ? a.get("retry-after") : null;
|
|
16
|
+
if (!o) return n;
|
|
17
|
+
let s = Number(o);
|
|
18
|
+
if (Number.isFinite(s)) return Math.max(0, s * 1e3);
|
|
19
|
+
let c = Date.parse(o);
|
|
20
|
+
return Number.isNaN(c) ? n : Math.max(0, c - r);
|
|
21
|
+
}
|
|
22
|
+
function i({ concurrency: t = 4, maxRetries: i = 2, defaultRetryAfterMs: a = 1e4, wait: o = (e) => new Promise((t) => setTimeout(t, e)) } = {}) {
|
|
23
|
+
let s = [], c = 0, l, u = 0;
|
|
24
|
+
function d() {
|
|
25
|
+
if (!l) for (; c < t && s.length > 0;) {
|
|
26
|
+
let e = s.shift();
|
|
27
|
+
c++, f(e, u);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async function f(e, t) {
|
|
31
|
+
try {
|
|
32
|
+
e.resolve(await e.task());
|
|
33
|
+
} catch (o) {
|
|
34
|
+
t === u && n(o) && e.retries < i ? (e.retries++, s.unshift(e), p(r(o, a))) : e.reject(o);
|
|
35
|
+
} finally {
|
|
36
|
+
c--, d();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function p(e) {
|
|
40
|
+
if (l) return;
|
|
41
|
+
let t = u;
|
|
42
|
+
l = o(e).then(() => {
|
|
43
|
+
t === u && (l = void 0, d());
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
run(e) {
|
|
48
|
+
return new Promise((t, n) => {
|
|
49
|
+
s.push({
|
|
50
|
+
task: e,
|
|
51
|
+
resolve: t,
|
|
52
|
+
reject: n,
|
|
53
|
+
retries: 0
|
|
54
|
+
}), d();
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
clear() {
|
|
58
|
+
u++, l = void 0;
|
|
59
|
+
let t = s;
|
|
60
|
+
s = [];
|
|
61
|
+
for (let n of t) n.reject(new e());
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export { e as RequestQueueClearedError, i as createRequestQueue, r as getRetryAfterMs, n as isRateLimitedError };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=requestQueue.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestQueue.esm.js","names":["RequestQueueClearedError","getErrorResponse","error","isRateLimitedError","response","getRetryAfterMs","headers","value","fallbackMs","seconds","date","now","createRequestQueue","resolve","ms","pending","active","pausedUntil","generation","pump","concurrency","item","execute","taskGeneration","maxRetries","pause","defaultRetryAfterMs","pauseGeneration","wait","cleared"],"sources":["../src/requestQueue.ts"],"sourcesContent":["/**\n * Limits how many advisory requests (member counts, access indicators) a\n * folder view sends at once, and backs off when the server answers 429.\n *\n * Opening a folder used to fetch every child immediately. Each browser request\n * also needs a CORS preflight, so a folder with a few dozen children could\n * exceed per-IP rate limits such as Cloudflare's and leave counts missing.\n */\n\nexport class RequestQueueClearedError extends Error {\n constructor () {\n super('Request queue was cleared')\n this.name = 'RequestQueueClearedError'\n }\n}\n\ntype RequestQueueOptions = {\n concurrency?: number\n maxRetries?: number\n defaultRetryAfterMs?: number\n wait?: (ms: number) => Promise<void>\n}\n\ntype PendingTask = {\n task: () => Promise<unknown>\n resolve: (value: unknown) => void\n reject: (error: unknown) => void\n retries: number\n}\n\nexport type RequestQueue = {\n run: <T>(task: () => Promise<T>) => Promise<T>\n clear: () => void\n}\n\ntype ErrorWithResponse = {\n status?: number\n headers?: Headers\n response?: { status?: number, headers?: Headers }\n}\n\nfunction getErrorResponse (error: unknown): ErrorWithResponse | undefined {\n return typeof error === 'object' && error !== null ? error as ErrorWithResponse : undefined\n}\n\nfunction isRateLimitedError (error: unknown): boolean {\n const response = getErrorResponse(error)\n if (response?.status === 429 || response?.response?.status === 429) return true\n // solid-logic's metadata HEAD reports failures only in the message.\n return error instanceof Error && /\\bStatus: 429\\b/.test(error.message)\n}\n\n/**\n * Returns the delay requested by a 429's Retry-After header (seconds or an\n * HTTP date), or `fallbackMs` when it is missing or unreadable.\n */\nfunction getRetryAfterMs (error: unknown, fallbackMs: number, now = Date.now()): number {\n const response = getErrorResponse(error)\n const headers = response?.headers ?? response?.response?.headers\n const value = typeof headers?.get === 'function' ? headers.get('retry-after') : null\n if (!value) return fallbackMs\n const seconds = Number(value)\n if (Number.isFinite(seconds)) return Math.max(0, seconds * 1000)\n const date = Date.parse(value)\n return Number.isNaN(date) ? fallbackMs : Math.max(0, date - now)\n}\n\nfunction createRequestQueue ({\n concurrency = 4,\n maxRetries = 2,\n defaultRetryAfterMs = 10_000,\n wait = ms => new Promise(resolve => setTimeout(resolve, ms))\n}: RequestQueueOptions = {}): RequestQueue {\n let pending: PendingTask[] = []\n let active = 0\n let pausedUntil: Promise<void> | undefined\n let generation = 0\n\n function pump () {\n if (pausedUntil) return\n while (active < concurrency && pending.length > 0) {\n const item = pending.shift()!\n active++\n void execute(item, generation)\n }\n }\n\n async function execute (item: PendingTask, taskGeneration: number) {\n try {\n item.resolve(await item.task())\n } catch (error) {\n if (taskGeneration === generation && isRateLimitedError(error) && item.retries < maxRetries) {\n item.retries++\n // Retry first so it is not overtaken by tasks queued after it.\n pending.unshift(item)\n pause(getRetryAfterMs(error, defaultRetryAfterMs))\n } else {\n item.reject(error)\n }\n } finally {\n active--\n pump()\n }\n }\n\n function pause (ms: number) {\n if (pausedUntil) return\n const pauseGeneration = generation\n pausedUntil = wait(ms).then(() => {\n if (pauseGeneration !== generation) return\n pausedUntil = undefined\n pump()\n })\n }\n\n return {\n run<T> (task: () => Promise<T>): Promise<T> {\n return new Promise<T>((resolve, reject) => {\n pending.push({ task, resolve: resolve as (value: unknown) => void, reject, retries: 0 })\n pump()\n })\n },\n clear () {\n generation++\n pausedUntil = undefined\n const cleared = pending\n pending = []\n for (const item of cleared) item.reject(new RequestQueueClearedError())\n }\n }\n}\n\nexport { createRequestQueue, getRetryAfterMs, isRateLimitedError }\n"],"mappings":";AASA,IAAaA,IAAb,cAA8C,MAAM;CAClD,cAAe;EAEb,AADA,MAAM,2BAA2B,GACjC,KAAK,OAAO;CACd;AACF;AA2BA,SAASC,EAAkB,GAA+C;CACxE,OAAO,OAAOC,KAAU,YAAYA,IAAiBA,IAA6B,KAAA;AAC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