folder-pane 4.0.1-2 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +4 -0
  2. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +14 -5
  3. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
  4. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +11 -1
  5. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
  6. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +174 -121
  7. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
  8. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +1 -1
  9. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -1
  10. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +1 -1
  11. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -1
  12. package/dist/components/folder-pane-content/FolderPaneContent.cjs.js.map +1 -1
  13. package/dist/components/folder-pane-content/FolderPaneContent.esm.js.map +1 -1
  14. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -1
  15. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -1
  16. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js.map +1 -1
  17. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js.map +1 -1
  18. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js.map +1 -1
  19. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js.map +1 -1
  20. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +8 -7
  21. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -1
  22. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +2 -0
  23. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -1
  24. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +84 -77
  25. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -1
  26. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +1 -1
  27. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -1
  28. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +1 -1
  29. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -1
  30. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.cjs.js.map +1 -1
  31. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.esm.js.map +1 -1
  32. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.cjs.js.map +1 -1
  33. package/dist/components/folder-pane-storage-header/FolderPaneCreateDialog.styles.esm.js.map +1 -1
  34. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +5 -5
  35. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -1
  36. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +1 -0
  37. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -1
  38. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +16 -10
  39. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -1
  40. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +1 -1
  41. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -1
  42. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +1 -1
  43. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -1
  44. package/dist/components/folder-pane-view/FolderPaneView.cjs.js +2 -2
  45. package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
  46. package/dist/components/folder-pane-view/FolderPaneView.d.ts +6 -0
  47. package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
  48. package/dist/components/folder-pane-view/FolderPaneView.esm.js +164 -118
  49. package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
  50. package/dist/folderPane.cjs.js +2 -2
  51. package/dist/folderPane.cjs.js.map +1 -1
  52. package/dist/folderPane.d.ts.map +1 -1
  53. package/dist/folderPane.esm.js +17 -15
  54. package/dist/folderPane.esm.js.map +1 -1
  55. package/dist/helpers.cjs.js.map +1 -1
  56. package/dist/helpers.d.ts +1 -1
  57. package/dist/helpers.d.ts.map +1 -1
  58. package/dist/helpers.esm.js.map +1 -1
  59. package/dist/resourceActionItems.cjs.js +1 -1
  60. package/dist/resourceActionItems.cjs.js.map +1 -1
  61. package/dist/resourceActionItems.d.ts +4 -5
  62. package/dist/resourceActionItems.d.ts.map +1 -1
  63. package/dist/resourceActionItems.esm.js +14 -14
  64. package/dist/resourceActionItems.esm.js.map +1 -1
  65. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { css as e } from "lit";
2
2
  // src/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.css
3
- var t = e`:host{z-index:100;background:var(--solid-ui-color-white,#fff);flex:none;min-width:0;display:block;position:sticky;top:0}.folder-pane-storage-header{justify-content:space-between;align-items:center;padding:10px 0;display:flex}.folder-pane-storage-header-breadcrumbs,.folder-pane-storage-header-breadcrumbs ol,.folder-pane-storage-header-breadcrumbs li,.folder-pane-storage-header-toolbar,.folder-pane-storage-header-view-controls{align-items:center;display:flex}.folder-pane-storage-header-breadcrumbs{gap:5.6px;min-width:0;overflow:auto hidden}.folder-pane-storage-header-breadcrumbs icon-lucide-folder-open{width:12px;height:12px;color:var(--solid-ui-color-gray-500,#6a7282);flex:none}.folder-pane-storage-header-breadcrumbs ol{min-width:0;color:var(--solid-ui-color-gray-600,#4a5565);font-size:var(--solid-ui-font-size-sm,.875rem);flex-wrap:nowrap;gap:5.6px;margin:0;padding:0;list-style:none}.folder-pane-storage-header-breadcrumbs li{gap:5.6px;min-width:0}.folder-pane-storage-header-breadcrumbs button{color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;padding:0}.folder-pane-storage-header-breadcrumbs button:hover,.folder-pane-storage-header-breadcrumbs button:focus-visible{color:var(--solid-ui-color-primary,#7c4dff)}.folder-pane-storage-header-breadcrumbs [aria-current=page]{white-space:nowrap}.folder-pane-storage-header-toolbar{min-width:0;padding-right:var(--folder-pane-storage-toolbar-right-padding,0);flex:none;justify-content:flex-end;gap:8px}.folder-pane-storage-header-search{border:1px solid var(--solid-ui-color-gray-300,#d1d5dc);min-width:8rem;max-width:14rem;color:var(--solid-ui-color-gray-500,#6a7282);border-radius:.35rem;align-items:center;gap:5.6px;padding:4px 8px;display:none}.folder-pane-storage-header-search icon-lucide-search{flex:none;width:1rem;height:1rem}.folder-pane-storage-header-search input{width:100%;min-width:0;color:inherit;font:inherit;background:0 0;border:0;outline:0}.folder-pane-storage-header-view-controls{gap:0}.folder-pane-storage-header-resource-actions{flex:none;align-items:center;display:inline-flex}.folder-pane-storage-header-view-toggle{border:1px solid var(--solid-ui-color-gray-300,#d1d5dc);background:var(--solid-ui-color-white,#fff);justify-content:center;align-items:center;gap:5px;width:44px;height:36px;padding:0 5px;display:flex}.folder-pane-storage-header-view-toggle:first-child{border-radius:5px 0 0 5px}.folder-pane-storage-header-view-toggle:last-child{border-left:0;border-radius:0 5px 5px 0}.folder-pane-storage-header-view-toggle.is-selected{background:var(--solid-ui-color-lavender-300,#e6dcff)}.folder-pane-storage-header-view-toggle solid-ui-button{width:100%;height:100%}.folder-pane-storage-header-view-toggle icon-lucide-layout-grid,.folder-pane-storage-header-view-toggle icon-lucide-list{flex-shrink:0;width:16px;height:16px}.folder-pane-storage-header-view-toggle solid-ui-button[aria-pressed=true]{color:var(--solid-ui-color-primary,#7c4dff)}.folder-pane-storage-header-add-menu{align-items:center;margin-left:22px;display:inline-flex}.folder-pane-storage-header-add-trigger{align-items:center;display:inline-flex}.folder-pane-storage-header-add-button{background:var(--solid-ui-color-primary,#7c4dff);min-height:36px;color:var(--solid-ui-color-white,#fff);cursor:pointer;font:inherit;border:0;border-radius:5.6px;justify-content:center;align-items:center;gap:5.6px;padding:5.6px 12px;display:inline-flex}.folder-pane-storage-header-add-button:hover{background:var(--solid-ui-color-primary-hover,#b9a2ff)}.folder-pane-storage-header-add-button:focus-visible{outline:2px solid var(--solid-ui-color-primary,#7c4dff);outline-offset:2px}.folder-pane-storage-header-add-button icon-lucide-plus,.folder-pane-storage-header-add-chevron{flex:none;width:1.25rem;height:1.25rem}.folder-pane-storage-header-add-menu img[slot=left-icon]{object-fit:contain;flex:none;width:13.333px;height:12.664px;display:block}@media (width<=768px){.folder-pane-storage-header{gap:var(--folder-pane-storage-header-mobile-gap,8px);padding:var(--folder-pane-storage-header-mobile-padding,10px 0);border-bottom:1px solid var(--solid-ui-color-gray-200,#e5e7eb);flex-wrap:wrap}.folder-pane-storage-header-breadcrumbs{flex:auto;max-width:100%;display:none}.folder-pane-storage-header-toolbar{flex:0 auto;margin-left:auto}.folder-pane-storage-header-add-menu{margin:0}.folder-pane-storage-header-add-trigger{z-index:200;box-sizing:border-box;aspect-ratio:1;background:var(--solid-ui-color-primary,#7c4dff);border-radius:6.944px;justify-content:center;align-items:center;gap:11.111px;width:50px;height:50px;padding:9.722px 13.889px;display:flex;position:fixed;bottom:50px;right:30px;box-shadow:1.389px 5.556px 9.722px #0000008f}.folder-pane-storage-header-add-button{box-sizing:border-box;background:0 0;width:100%;height:100%;min-height:0;padding:0}.folder-pane-storage-header-add-button:hover{background:0 0}.folder-pane-storage-header-add-button icon-lucide-plus{width:20px;height:20px}.folder-pane-storage-header-add-label,.folder-pane-storage-header-add-chevron{display:none}}`;
3
+ var t = e`:host{z-index:100;background:var(--solid-ui-color-white,#fff);flex:none;min-width:0;display:block;position:sticky;top:0}.folder-pane-storage-header{justify-content:space-between;align-items:center;padding:10px 0;display:flex}.folder-pane-storage-header-breadcrumbs,.folder-pane-storage-header-breadcrumbs ol,.folder-pane-storage-header-breadcrumbs li,.folder-pane-storage-header-toolbar,.folder-pane-storage-header-view-controls{align-items:center;display:flex}.folder-pane-storage-header-breadcrumbs{gap:5.6px;min-width:0;padding-left:10px;overflow:auto hidden}.folder-pane-storage-header-breadcrumbs icon-lucide-folder-open{width:12px;height:12px;color:var(--solid-ui-color-gray-500,#6a7282);flex:none}.folder-pane-storage-header-breadcrumbs ol{min-width:0;color:var(--solid-ui-color-gray-600,#4a5565);font-size:var(--solid-ui-font-size-sm,.875rem);flex-wrap:nowrap;gap:5.6px;margin:0;padding:0;list-style:none}.folder-pane-storage-header-breadcrumbs li{flex:none;gap:5.6px;min-width:0}.folder-pane-storage-header-breadcrumbs button{color:inherit;cursor:pointer;font:inherit;white-space:nowrap;background:0 0;border:0;padding:0}.folder-pane-storage-header-breadcrumbs button:hover,.folder-pane-storage-header-breadcrumbs button:focus-visible{color:var(--solid-ui-color-primary,#7c4dff)}.folder-pane-storage-header-breadcrumbs [aria-current=page]{white-space:nowrap}.folder-pane-storage-header-toolbar{min-width:0;padding-right:var(--folder-pane-storage-toolbar-right-padding,0);flex:none;justify-content:flex-end;gap:8px}.folder-pane-storage-header-search{border:1px solid var(--solid-ui-color-gray-300,#d1d5dc);min-width:8rem;max-width:14rem;color:var(--solid-ui-color-gray-500,#6a7282);border-radius:.35rem;align-items:center;gap:5.6px;padding:4px 8px;display:none}.folder-pane-storage-header-search icon-lucide-search{flex:none;width:1rem;height:1rem}.folder-pane-storage-header-search input{width:100%;min-width:0;color:inherit;font:inherit;background:0 0;border:0;outline:0}.folder-pane-storage-header-view-controls{gap:0}.folder-pane-storage-header-resource-actions{flex:none;align-items:center;display:inline-flex}.folder-pane-storage-header-view-toggle{border:1px solid var(--solid-ui-color-gray-300,#d1d5dc);background:var(--solid-ui-color-white,#fff);justify-content:center;align-items:center;gap:5px;width:44px;height:36px;padding:0 5px;display:flex}.folder-pane-storage-header-view-toggle:first-child{border-radius:5px 0 0 5px}.folder-pane-storage-header-view-toggle:last-child{border-left:0;border-radius:0 5px 5px 0}.folder-pane-storage-header-view-toggle.is-selected{background:var(--solid-ui-color-lavender-300,#e6dcff)}.folder-pane-storage-header-view-toggle solid-ui-button{width:100%;height:100%}.folder-pane-storage-header-view-toggle icon-lucide-layout-grid,.folder-pane-storage-header-view-toggle icon-lucide-list{flex-shrink:0;width:16px;height:16px}.folder-pane-storage-header-view-toggle solid-ui-button[aria-pressed=true]{color:var(--solid-ui-color-primary,#7c4dff)}.folder-pane-storage-header-add-menu{align-items:center;margin-left:22px;display:inline-flex}.folder-pane-storage-header-add-trigger{align-items:center;display:inline-flex}.folder-pane-storage-header-add-button{background:var(--solid-ui-color-primary,#7c4dff);min-height:36px;color:var(--solid-ui-color-white,#fff);cursor:pointer;font:inherit;border:0;border-radius:5.6px;justify-content:center;align-items:center;gap:5.6px;padding:5.6px 12px;display:inline-flex}.folder-pane-storage-header-add-button:hover{background:var(--solid-ui-color-primary-hover,#b9a2ff)}.folder-pane-storage-header-add-button:focus-visible{outline:2px solid var(--solid-ui-color-primary,#7c4dff);outline-offset:2px}.folder-pane-storage-header-add-button icon-lucide-plus,.folder-pane-storage-header-add-chevron{flex:none;width:1.25rem;height:1.25rem}.folder-pane-storage-header-add-menu img[slot=left-icon]{object-fit:contain;flex:none;width:13.333px;height:12.664px;display:block}@media (width<=768px){.folder-pane-storage-header{align-items:flex-start;gap:var(--folder-pane-storage-header-mobile-gap,8px);padding:var(--folder-pane-storage-header-mobile-padding,10px 0);border-bottom:1px solid var(--solid-ui-color-gray-200,#e5e7eb);flex-wrap:nowrap}.folder-pane-storage-header-breadcrumbs{flex:1 1 0;align-self:stretch;align-items:flex-end;max-width:100%;margin-top:4px;overflow:visible}.folder-pane-storage-header-breadcrumbs ol{font-size:var(--solid-ui-font-size-sm,.875rem);text-align:left;flex-wrap:nowrap;flex:1 1 0;justify-content:flex-start;align-self:flex-end;align-items:baseline;row-gap:3px}.folder-pane-storage-header-breadcrumbs icon-lucide-folder-open{transform:translateY(-3px)}.folder-pane-storage-header-breadcrumbs li:nth-last-child(n+3),.folder-pane-storage-header-breadcrumbs li:last-child{display:none}.folder-pane-storage-header-breadcrumbs li:only-child{display:flex}.folder-pane-storage-header-breadcrumbs .separator{display:none}.folder-pane-storage-header-breadcrumbs li{flex:0 auto;align-items:baseline;max-width:100%}.folder-pane-storage-header-breadcrumbs li button{white-space:normal;overflow-wrap:anywhere;text-align:left;min-width:0}.folder-pane-storage-header-breadcrumbs .separator{flex:none;margin-left:.35em}.folder-pane-storage-header-breadcrumbs .breadcrumb-label-ending{white-space:nowrap;display:inline-block}.folder-pane-storage-header-breadcrumbs [aria-current=page]{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;display:block}.folder-pane-storage-header-toolbar{flex:none;margin-left:auto}.folder-pane-storage-header-add-menu{margin:0}.folder-pane-storage-header-add-trigger{z-index:200;box-sizing:border-box;aspect-ratio:1;background:var(--solid-ui-color-primary,#7c4dff);border-radius:6.944px;justify-content:center;align-items:center;gap:11.111px;width:50px;height:50px;padding:9.722px 13.889px;display:flex;position:fixed;bottom:50px;right:30px;box-shadow:1.389px 5.556px 9.722px #0000008f}.folder-pane-storage-header-add-button{box-sizing:border-box;background:0 0;width:100%;height:100%;min-height:0;padding:0}.folder-pane-storage-header-add-button:hover{background:0 0}.folder-pane-storage-header-add-button icon-lucide-plus{width:20px;height:20px}.folder-pane-storage-header-add-label,.folder-pane-storage-header-add-chevron{display:none}}`;
4
4
  export { t as default };
5
5
 
6
6
  //# sourceMappingURL=FolderPaneStorageHeader.styles.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FolderPaneStorageHeader.styles.esm.js","names":["FolderPaneStorageHeader_styles_default"],"sources":["../../../src/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.css"],"sourcesContent":[":host {\n display: block;\n flex: 0 0 auto;\n min-width: 0;\n position: sticky;\n top: 0;\n z-index: 100;\n background: var(--solid-ui-color-white, #ffffff);\n}\n\n.folder-pane-storage-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 0;\n}\n\n.folder-pane-storage-header-breadcrumbs,\n.folder-pane-storage-header-breadcrumbs ol,\n.folder-pane-storage-header-breadcrumbs li,\n.folder-pane-storage-header-toolbar,\n.folder-pane-storage-header-view-controls {\n display: flex;\n align-items: center;\n}\n\n.folder-pane-storage-header-breadcrumbs {\n min-width: 0;\n gap: 5.6px;\n overflow-x: auto;\n overflow-y: hidden;\n}\n\n.folder-pane-storage-header-breadcrumbs icon-lucide-folder-open {\n width: 12px;\n height: 12px;\n flex: 0 0 auto;\n color: var(--solid-ui-color-gray-500, #6a7282);\n}\n\n.folder-pane-storage-header-breadcrumbs ol {\n min-width: 0;\n flex-wrap: nowrap;\n gap: 5.6px;\n margin: 0;\n padding: 0;\n list-style: none;\n color: var(--solid-ui-color-gray-600, #4a5565);\n font-size: var(--solid-ui-font-size-sm, 0.875rem);\n}\n\n.folder-pane-storage-header-breadcrumbs li {\n min-width: 0;\n gap: 5.6px;\n}\n\n.folder-pane-storage-header-breadcrumbs button {\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n cursor: pointer;\n font: inherit;\n}\n\n.folder-pane-storage-header-breadcrumbs button:hover,\n.folder-pane-storage-header-breadcrumbs button:focus-visible {\n color: var(--solid-ui-color-primary, #7c4dff);\n}\n\n.folder-pane-storage-header-breadcrumbs [aria-current='page'] {\n white-space: nowrap;\n}\n\n.folder-pane-storage-header-toolbar {\n flex: 0 0 auto;\n justify-content: flex-end;\n gap: 8px;\n min-width: 0;\n padding-right: var(--folder-pane-storage-toolbar-right-padding, 0);\n}\n\n.folder-pane-storage-header-search {\n display: none;\n align-items: center;\n gap: 5.6px;\n min-width: 8rem;\n max-width: 14rem;\n padding: 4px 8px;\n border: 1px solid var(--solid-ui-color-gray-300, #d1d5dc);\n border-radius: 0.35rem;\n color: var(--solid-ui-color-gray-500, #6a7282);\n}\n\n.folder-pane-storage-header-search icon-lucide-search {\n width: 1rem;\n height: 1rem;\n flex: 0 0 auto;\n}\n\n.folder-pane-storage-header-search input {\n width: 100%;\n min-width: 0;\n border: 0;\n outline: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n}\n\n.folder-pane-storage-header-view-controls {\n gap: 0;\n}\n\n.folder-pane-storage-header-resource-actions {\n display: inline-flex;\n align-items: center;\n flex: 0 0 auto;\n}\n\n.folder-pane-storage-header-view-toggle {\n display: flex;\n width: 44px;\n height: 36px;\n padding: 0 5px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border: 1px solid var(--solid-ui-color-gray-300, #d1d5dc);\n background: var(--solid-ui-color-white, #ffffff);\n}\n\n.folder-pane-storage-header-view-toggle:first-child {\n border-radius: 5px 0 0 5px;\n}\n\n.folder-pane-storage-header-view-toggle:last-child {\n border-left: 0;\n border-radius: 0 5px 5px 0;\n}\n\n.folder-pane-storage-header-view-toggle.is-selected {\n background: var(--solid-ui-color-lavender-300, #e6dcff);\n}\n\n.folder-pane-storage-header-view-toggle solid-ui-button {\n width: 100%;\n height: 100%;\n}\n\n.folder-pane-storage-header-view-toggle icon-lucide-layout-grid,\n.folder-pane-storage-header-view-toggle icon-lucide-list {\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n}\n\n.folder-pane-storage-header-view-toggle solid-ui-button[aria-pressed='true'] {\n color: var(--solid-ui-color-primary, #7c4dff);\n}\n\n.folder-pane-storage-header-add-menu {\n display: inline-flex;\n align-items: center;\n margin-left: 22px;\n}\n\n.folder-pane-storage-header-add-trigger {\n display: inline-flex;\n align-items: center;\n}\n\n.folder-pane-storage-header-add-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5.6px;\n min-height: 36px;\n padding: 5.6px 12px;\n border: 0;\n border-radius: 5.6px;\n background: var(--solid-ui-color-primary, #7c4dff);\n color: var(--solid-ui-color-white, #ffffff);\n cursor: pointer;\n font: inherit;\n}\n\n.folder-pane-storage-header-add-button:hover {\n background: var(--solid-ui-color-primary-hover, #b9a2ff);\n}\n\n.folder-pane-storage-header-add-button:focus-visible {\n outline: 2px solid var(--solid-ui-color-primary, #7c4dff);\n outline-offset: 2px;\n}\n\n.folder-pane-storage-header-add-button icon-lucide-plus,\n.folder-pane-storage-header-add-chevron {\n width: 1.25rem;\n height: 1.25rem;\n flex: 0 0 auto;\n}\n\n.folder-pane-storage-header-add-menu img[slot=\"left-icon\"] {\n display: block;\n width: 1.25rem;\n height: 1.25rem;\n object-fit: contain;\n flex: 0 0 auto;\n}\n\n.folder-pane-storage-header-add-menu img[slot=\"left-icon\"] {\n width: 13.333px;\n height: 12.664px;\n}\n\n@media (max-width: 768px) {\n .folder-pane-storage-header {\n flex-wrap: wrap;\n gap: var(--folder-pane-storage-header-mobile-gap, 8px);\n padding: var(--folder-pane-storage-header-mobile-padding, 10px 0);\n border-bottom: 1px solid var(--solid-ui-color-gray-200, #e5e7eb);\n }\n\n .folder-pane-storage-header-breadcrumbs {\n display: none;\n }\n\n .folder-pane-storage-header-breadcrumbs {\n flex: 1 1 auto;\n max-width: 100%;\n }\n\n .folder-pane-storage-header-toolbar {\n flex: 0 1 auto;\n margin-left: auto;\n }\n\n .folder-pane-storage-header-add-menu {\n margin: 0;\n }\n\n .folder-pane-storage-header-add-trigger {\n position: fixed;\n right: 30px;\n bottom: 50px;\n z-index: 200;\n display: flex;\n width: 50px;\n height: 50px;\n box-sizing: border-box;\n padding: 9.722px 13.889px;\n justify-content: center;\n align-items: center;\n gap: 11.111px;\n aspect-ratio: 1 / 1;\n border-radius: 6.944px;\n background: var(--solid-ui-color-primary, #7c4dff);\n box-shadow: 1.389px 5.556px 9.722px 0 rgb(0 0 0 / 56%);\n }\n\n .folder-pane-storage-header-add-button {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n min-height: 0;\n padding: 0;\n background: transparent;\n }\n\n .folder-pane-storage-header-add-button:hover {\n background: transparent;\n }\n\n .folder-pane-storage-header-add-button icon-lucide-plus {\n width: 20px;\n height: 20px;\n }\n\n .folder-pane-storage-header-add-label,\n .folder-pane-storage-header-add-chevron {\n display: none;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"FolderPaneStorageHeader.styles.esm.js","names":["FolderPaneStorageHeader_styles_default"],"sources":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- const e=require("../../accessCache.cjs.js");require("../folder-pane-container/index.cjs.js"),require("../folder-pane-sidebar/index.cjs.js"),require("../folder-pane-content/index.cjs.js"),require("../folder-pane-storage-header/index.cjs.js"),require("../../_virtual/~icons/lucide/chevron-left.cjs.js");const t=require("../../helpers.cjs.js"),n=require("./renderRequest.cjs.js"),r=require("../folder-pane-storage-header/FolderPaneCreateDialog.cjs.js"),i=require("../../creationSafety.cjs.js"),a=require("../../mintPaneInstance.cjs.js"),o=require("../../debug.cjs.js"),s=require("./resourceLoad.cjs.js");let c=require("solid-ui"),l=require("solid-logic"),u=require("lit"),d=require("lit/decorators.js");require("solid-ui/components/button"),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/error-state"),require("solid-ui/components/file-explorer-header");var f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve;function M(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n){ye(e,t),t.set(e,n)}function ye(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function P(e,t,n){return e.set(be(e,t),n),n}function F(e,t){return e.get(be(e,t))}function be(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function xe(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:we(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||we(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return Te(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:Se(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function Se(e){var t=Ce(e,`string`);return typeof t==`symbol`?t:t+``}function Ce(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function we(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function Te(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function I(e,t){if(!Number.isFinite(t)||t<=320)return 256;let n=t-320;return n<180?256:Math.min(480,n,Math.max(180,Number.isFinite(e)?e:256))}h=[(0,c.customElement)(`folder-pane-view`)];var Ee,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,Q=new WeakMap,$=new WeakMap;ve=(g=(0,d.property)({attribute:!1}),v=(0,d.property)({attribute:!1}),b=(0,d.property)({type:Boolean,attribute:`full-view`}),S=(0,d.state)(),w=(0,d.state)(),E=(0,d.state)(),O=(0,d.state)(),A=(0,d.state)(),ee=(0,d.state)(),ne=(0,d.state)(),ie=(0,d.state)(),oe=(0,d.state)(),ce=(0,d.state)(),ue=(0,d.query)(`folder-pane-content`),fe=(0,d.query)(`.folder-pane-full-view`),me=(0,d.query)(`folder-pane-sidebar`),ge=(0,d.query)(`.folder-pane-status`),`browserContext`),f=class extends c.WebComponent{constructor(...n){super(...n),N(this,L,(p(this),_(this,void 0))),N(this,R,y(this,void 0)),N(this,z,x(this,!1)),N(this,B,C(this,void 0)),N(this,V,T(this,void 0)),N(this,H,D(this,`grid`)),N(this,U,k(this,``)),N(this,W,j(this,!1)),N(this,G,te(this,256)),N(this,K,re(this,480)),N(this,q,ae(this,void 0)),N(this,J,se(this,!1)),N(this,Y,le(this,!1)),M(this,`initialLoadGeneration`,0),M(this,`renderGeneration`,0),M(this,`permissionGeneration`,0),M(this,`permissionRequest`,void 0),M(this,`creationInFlight`,!1),M(this,`authListenersAttached`,!1),M(this,`dropProtectionAttached`,!1),M(this,`sidebarResizeObserver`,void 0),M(this,`responsiveLayoutInitialized`,!1),M(this,`sidebarDrag`,void 0),N(this,X,de(this,null)),N(this,Z,pe(this,null)),N(this,Q,he(this,null)),N(this,$,_e(this,null)),M(this,`handleAuthChange`,()=>{e.resourceAccessCache.clear(),this.refreshCreationPermission(!0),this.requestUpdate()}),M(this,`handleCreatePane`,async e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let n=e.detail?.pane;if(!n?.mintNew)return;let s=this.getActiveContainer(),u=this.ownerDocument,d=this.statusArea;if(!s||!d)return;this.creationInFlight=!0;let f=++this.renderGeneration,p=t.getPaneLabel(n);try{let e=await new Promise(e=>{(0,c.showDialog)(r.default,{props:{label:p},onClose:e})});if(!e||!l.authn.currentUser()||f!==this.renderGeneration||this.getActiveContainer()?.sameTerm(s)!==!0)return;if(!i.isSafeCreationName(e)){a.setMintStatus(d,`error`,i.invalidCreationNameMessage);return}this.clearContentForCreation();let t=await a.mintPaneInstance({context:this.browserContext,container:s,pane:n,name:e,noun:p,statusArea:d,me:l.authn.currentUser()??void 0,dom:u}),o=f===this.renderGeneration&&this.getActiveContainer()?.sameTerm(s)===!0;await this.showCreatedResource({container:s,...t,pane:n,newInstance:o?t.newInstance:void 0})}catch(e){o.error(`Unable to create folder-pane resource`,e),!(e instanceof a.PaneMintError)&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,`Unable to create ${p}: ${e instanceof Error?e.message:String(e)}`)}finally{this.creationInFlight=!1}}),M(this,`handleUpload`,e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let t=this.getActiveContainer(),n=this.statusArea;if(!t||!n||!this.store)return;let r=this.ownerDocument.createElement(`input`);r.type=`file`,r.multiple=!0,r.addEventListener(`change`,()=>{let e=Array.from(r.files??[]),o=e.filter(e=>i.isSafeCreationName(e.name));if(e.filter(e=>!i.isSafeCreationName(e.name)).forEach(e=>a.setMintStatus(n,`error`,`${e.name}: ${i.invalidCreationNameMessage}`)),!o.length)return;this.creationInFlight=!0;let s=this.renderGeneration,l=this.browserContext,u=o.length,d=Promise.resolve();a.setMintStatus(n,`progress`,`Uploading ${o.length} file${o.length===1?``:`s`}`);let f=()=>{u--,u===0&&(this.creationInFlight=!1,n.dataset.status===`progress`&&n.replaceChildren())};c.widgets.uploadFiles(this.store.fetcher,o,t.uri,t.uri,(e,n)=>{d=d.then(()=>{let e=this.renderGeneration===s&&this.browserContext===l;return this.showCreatedResource({container:t,containedResource:this.store.sym(n),newInstance:o.length===1&&e?this.store.sym(n):void 0})}).finally(f)},(e,t)=>{a.setMintStatus(n,`error`,t),f()})}),r.click()}),M(this,`clearContentError`,()=>{this.contentError=void 0}),M(this,`retryContent`,()=>{let e=this.contentError?.retry;if(e){this.clearContentError(),e();return}let t=this.selectedResource,n=this.subject;(t||n)&&(this.clearContentError(),t?this.showResourceInContentView(t,void 0,!1,!0):n&&(this.store&&s.clearFailedResource(this.store.fetcher,n),this.showInitialContainer(n)))}),M(this,`handleResourceSelected`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.searchQuery=``,this.showSubject(t))}),M(this,`handleResourceOpenPane`,e=>{let t=e.detail?.resource,n=e.detail?.paneName,r=n?this.browserContext?.session.paneRegistry.byName(n):void 0;t&&r&&(e.stopPropagation(),this.searchQuery=``,r.name===`folder`?this.showSubject(t,r):this.showSubject(t,typeof r?.render==`function`?r:void 0))}),M(this,`handleSelectHome`,()=>{this.searchQuery=``;let e=this.subject&&this.standaloneBreadcrumbRoot?.sameTerm(this.subject)?this.subject:this.standaloneBreadcrumbRoot;e&&this.showSubject(e)}),M(this,`handleSearch`,e=>{e.stopPropagation(),this.searchQuery=e.detail?.query||``;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.searchQuery=this.searchQuery)}),M(this,`handleSelectBreadcrumbResource`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.showSubject(t))}),M(this,`handleContainerViewChange`,e=>{let t=e.detail?.view;t&&(e.stopPropagation(),this.setContainerView(t))}),M(this,`updateSidebarBounds`,()=>{this.isConnected&&(this.sidebarMaximumWidth=I(480,this.sidebarAvailableWidth),this.resizeSidebar(this.sidebarWidth))}),M(this,`handleSidebarPointerDown`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.button!==0||!e.isPrimary)return;e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),t.focus(),this.sidebarDrag={separator:t,pointerId:e.pointerId,startX:e.clientX,startWidth:this.sidebarWidth},this.requestUpdate()}),M(this,`handleSidebarPointerMove`,e=>{let t=this.sidebarDrag;this.isConnected&&!this.sidebarCollapsed&&t&&t.pointerId===e.pointerId&&this.resizeSidebar(t.startWidth+e.clientX-t.startX)}),M(this,`handleSidebarPointerEnd`,e=>{this.sidebarDrag?.pointerId===e.pointerId&&this.finishSidebarResize()}),M(this,`handleSidebarResizeKey`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.altKey||e.ctrlKey||e.metaKey)return;let t;switch(e.key){case`ArrowLeft`:t=this.sidebarWidth-16;break;case`ArrowRight`:t=this.sidebarWidth+16;break;case`Home`:t=180;break;case`End`:t=480;break;default:return}e.preventDefault(),e.stopPropagation(),this.resizeSidebar(t)}),M(this,`handleSidebarToggle`,async e=>{e.stopPropagation();let t=this.sidebar,n=this.renderRoot.querySelector(`.folder-pane-sidebar-resize-handle`),r=!!t&&(t.matches(`:focus-within`)||t.shadowRoot?.activeElement!=null),i=n===this.ownerDocument.activeElement;this.finishSidebarResize(),this.sidebarCollapsed=!this.sidebarCollapsed,this.sidebarCollapsed&&(r||i)&&(await this.updateComplete,this.renderRoot.querySelector(`.folder-pane-sidebar-toggle`)?.focus())}),M(this,`handleFolderPaneResourceError`,e=>{e.stopPropagation();let t=e.detail?.title||`Unable to load this folder`,n=e.detail?.message||`The folder could not be loaded. Try again.`;this.showContentError({title:t,message:n,retry:e.detail?.retry},!1)})}get[ve](){return F(L,this)}set browserContext(e){P(L,this,e)}get store(){return this.browserContext?.session.store}get subject(){return F(R,this)}set subject(e){P(R,this,e)}get resourceLogic(){return this.browserContext?.session.logic.resource}get displayedResource(){return this.selectedResource??this.subject}get fullView(){return F(z,this)}set fullView(e){P(z,this,e)}get selectedResource(){return F(B,this)}set selectedResource(e){P(B,this,e)}get standaloneBreadcrumbRoot(){return F(V,this)}set standaloneBreadcrumbRoot(e){P(V,this,e)}get containerView(){return F(H,this)}set containerView(e){P(H,this,e)}get searchQuery(){return F(U,this)}set searchQuery(e){P(U,this,e)}get sidebarCollapsed(){return F(W,this)}set sidebarCollapsed(e){P(W,this,e)}get sidebarWidth(){return F(G,this)}set sidebarWidth(e){P(G,this,e)}get sidebarMaximumWidth(){return F(K,this)}set sidebarMaximumWidth(e){P(K,this,e)}get contentError(){return F(q,this)}set contentError(e){P(q,this,e)}get showingContainer(){return F(J,this)}set showingContainer(e){P(J,this,e)}get canCreate(){return F(Y,this)}set canCreate(e){P(Y,this,e)}get contentView(){return F(X,this)}set contentView(e){P(X,this,e)}get fullViewTarget(){return F(Z,this)}set fullViewTarget(e){P(Z,this,e)}get sidebar(){return F(Q,this)}set sidebar(e){P(Q,this,e)}get statusArea(){return F($,this)}set statusArea(e){P($,this,e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver?.observe(e),this.dropProtectionAttached||=(c.aclControl.preventBrowserDropEvents(this.ownerDocument),!0),this.addEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.addEventListener(`folder-pane-upload`,this.handleUpload),this.addEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.authListenersAttached||=(l.authSession.events.on(`login`,this.handleAuthChange),l.authSession.events.on(`logout`,this.handleAuthChange),!0)}disconnectedCallback(){this.finishSidebarResize(),this.sidebarResizeObserver?.disconnect(),this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration),this.initialLoadGeneration++,this.removeEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.removeEventListener(`folder-pane-upload`,this.handleUpload),this.removeEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.authListenersAttached&&=(l.authSession.events.off(`login`,this.handleAuthChange),l.authSession.events.off(`logout`,this.handleAuthChange),!1),super.disconnectedCallback()}firstUpdated(){if(this.updateSidebarBounds(),typeof ResizeObserver<`u`){this.sidebarResizeObserver=new ResizeObserver(e=>{this.updateSidebarBounds();let t=e[0]?.contentRect.width??0;this.responsiveLayoutInitialized||t<=0||(this.responsiveLayoutInitialized=!0,t<768&&this.handleSidebarToggle(new Event(`folder-pane-responsive-collapse`)))});let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver.observe(e),this.sidebarResizeObserver.observe(this)}}updated(e){(e.has(`subject`)||e.has(`browserContext`))&&this.subject?(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject,(e.has(`subject`)||e.has(`browserContext`))&&(this.selectedResource=void 0,this.renderGeneration++,this.initialLoadGeneration++),this.refreshCreationPermission(),this.showInitialContainer(this.subject)):(e.has(`selectedResource`)&&this.refreshCreationPermission(),e.has(`fullView`)&&e.get(`fullView`)!==void 0&&(this.subject&&(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject),this.selectedResource?this.showResourceInContentView(this.selectedResource):this.subject&&this.renderContainerView(this.subject)))}getStandaloneBreadcrumbRoot(e){try{let t=new URL(e.uri),n=t.pathname.split(`/`).filter(Boolean);return n.length<=1?e:this.store?.sym(`${t.origin}/${n[0]}/`)??e}catch{return e}}get resourceTarget(){return this.fullView?this.fullViewTarget:this.contentView}showContentError(e,t=!0){t&&this.resourceTarget?.replaceChildren(),this.contentError=e}renderAccessDeniedScreen(){this.showContentError({title:`Access denied`,message:`You do not have access to the contents of this container.`})}async loadResource(e,n=!1){let r=this.store;if(!r)return;let i=r.fetcher;n&&s.clearFailedResource(i,e);try{await i.load(e)}catch(r){if(!n||!t.isAccessDeniedError(r)||!l.authn.currentUser())throw r;await i.load(e,{force:!0,clearPreviousData:!0})}}openCreatedResource(e,t){this.searchQuery=``;let n=t?.name?this.browserContext?.session.paneRegistry.byName(t.name)??t:t;this.showSubject(e,typeof n?.render==`function`?n:void 0)}getActiveContainer(){let e=this.selectedResource;if(e&&this.resourceLogic&&t.isContainerResource(e,this.resourceLogic))return e;let n=this.fullView?this.standaloneBreadcrumbRoot:this.subject,r=e?.dir(),i=n?.uri.endsWith(`/`)?n.uri:`${n?.uri}/`;return n&&r&&i&&r.uri.startsWith(i)?r:this.subject}refreshCreationPermission(e=!1){let t=this.getActiveContainer(),n=this.browserContext?.session.logic.resource;if(!e&&t&&n&&this.permissionRequest?.containerUri===t.uri&&this.permissionRequest.resourceLogic===n)return;let r=++this.permissionGeneration;this.canCreate=!1,this.permissionRequest=t&&n?{containerUri:t.uri,resourceLogic:n}:void 0,t&&n&&n.fetchMetadata(t).then(e=>{r===this.permissionGeneration&&this.getActiveContainer()?.sameTerm(t)===!0&&(this.canCreate=e.access.canEdit)}).catch(e=>{r===this.permissionGeneration&&(this.permissionRequest=void 0,o.warn(`Unable to determine folder creation permission`,e))})}clearContentForCreation(){this.resourceTarget?.replaceChildren()}async showCreatedResource({container:e,containedResource:t,newInstance:n,pane:r}){let i=this.store;if(!i)return;let a=this.renderGeneration,o=this.browserContext,s=async e=>{try{return await i.fetcher.load(e,{force:!0,clearPreviousData:!0}),!0}catch(t){return c.log.warn(`Unable to reload `+e.uri+`: `+t),!1}},l=await s(e);if(t.uri.endsWith(`/`)){await s(t);let e=i.each(t,c.ns.ldp(`contains`),void 0,t.doc());for(let t of e)t.termType===`NamedNode`&&i.fetcher.getState(t.value)===`failed`&&i.fetcher.unload(t)}this.sidebar?.refreshResources?.(e);let u=this.resourceTarget?.querySelector(`folder-pane-container`);!l&&u?.addOptimisticResource&&u.addOptimisticResource(t),l&&u?.refresh?.(),n&&this.isConnected&&this.renderGeneration===a&&this.browserContext===o&&this.openCreatedResource(n,r)}renderContainerView(e){let t=this.resourceTarget;if(!t)return;this.contentError=void 0;let n=document.createElement(`folder-pane-container`);n.subject=e,n.resourceLogic=this.resourceLogic??null,n.browserContext=this.browserContext,n.view=this.containerView,n.searchQuery=this.searchQuery,this.showingContainer=!0,t.replaceChildren(n)}async showInitialContainer(e){let n=++this.initialLoadGeneration;if(t.isJavaScriptFile(e))this.showSubject(e);else if(this.store&&this.resourceLogic){try{await this.loadResource(e)}catch(r){if(n!==this.initialLoadGeneration||!this.subject?.sameTerm(e))return;if(t.isAccessDeniedError(r)){this.resourceTarget&&this.renderAccessDeniedScreen();return}c.log.error(`Unable to load storage container: `+r),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}n===this.initialLoadGeneration&&this.subject?.sameTerm(e)&&(this.sidebar?.refreshResources?.(),this.requestUpdate(),this.selectedResource||this.showSubject(e))}}async renderExplorerInto(e,t,r,i={}){if(!this.browserContext)return;let a=await(0,c.getRelevantPanes)(t,this.browserContext,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(i.isCurrent&&!i.isCurrent())return;let o=r||(0,c.getPreferredPane)(t,this.browserContext,a);if(!o){this.renderExplorerError(t,`No pane is available to display this resource.`);return}let s;try{s=o.render(t,this.browserContext,i.paneOptions||{})}catch(e){c.log.error(`Unable to render selected pane: `+e),this.renderExplorerError(t,`The selected pane could not render this resource.`);return}let l=e.ownerDocument.createElement(`solid-ui-file-explorer-provider`),u=await(0,c.preparePaneMenuItems)({subject:t,context:this.browserContext,panes:a,openPane:(e,t)=>{l.dispatchEvent(new CustomEvent(c.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))}});l.addEventListener(c.FILE_EXPLORER_BACK_EVENT,e=>{if(!(0,c.isExplorerEvent)(e,l))return;e.stopPropagation();let n=this.getActiveContainer()||this.subject||t;this.renderGeneration++,this.selectedResource=n,this.renderContainerView(n)}),l.addEventListener(c.FILE_EXPLORER_OPEN_PANE_EVENT,r=>{if(!(0,c.isExplorerEvent)(r,l))return;r.stopPropagation();let a=r.detail?.paneName,o=a?this.browserContext?.session.paneRegistry.byName(a):void 0;if(o){let r={generation:++this.renderGeneration,subjectUri:t.uri,context:this.browserContext};this.renderExplorerInto(e,t,o,{...i,paneOptions:o.name===`folder`?{folderView:`container`,fullView:!0,solo:!0}:i.paneOptions,isCurrent:()=>n.isCurrentRenderRequest(r,this.renderGeneration,this.selectedResource?.uri,this.browserContext)}).catch(e=>{c.log.error(`Unable to switch selected pane: `+e)})}}),(0,c.composeExplorer)(l,{context:this.browserContext,subjectUri:t.uri,pane:o,relevantPanes:a,header:i.showHeader===!1?void 0:{paneIcon:o.icon,menuItems:u},paneElement:s}),(!i.isCurrent||i.isCurrent())&&(this.contentError=void 0,this.showingContainer=!1,e.replaceChildren(l))}renderExplorerError(e,t){this.showContentError({title:t,message:e.uri})}async showResourceInContentView(e,r,i=!1,a=!1){let o=++this.renderGeneration;try{let s=this.resourceTarget,l=this.browserContext;if(!s||!this.store||!this.resourceLogic||!l)return;let u={generation:o,subjectUri:e.uri,context:this.browserContext},d=e=>n.isCurrentRenderRequest(u,this.renderGeneration,this.selectedResource?.uri,this.browserContext)&&e.uri===u.subjectUri;if(!d(e))return;if(this.subject?.sameTerm(e)&&!r&&!i&&t.isContainerResource(e,this.resourceLogic)){this.renderContainerView(e);return}if(t.isContainerResource(e,this.resourceLogic)&&(r?.name!==`source`||i)){try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load selected container: `+n),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}if(!d(e))return;if(this.sidebar?.refreshResources?.(),r?.name===`folder`){this.renderContainerView(e);return}if(r?.name!==`sharing`&&(i||this.resourceLogic.containerHasIndexDocument(e))){let n=this.store.sym(t.getIndexedApplicationSubject(e,r?.name));try{await this.loadResource(n.doc(),a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load container index document: `+n)}await this.renderExplorerInto(s,n,r,{isCurrent:()=>d(e),showHeader:!1});return}let n=await(0,c.getRelevantPanes)(e,l,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(!d(e))return;let o=r||(0,c.getPreferredPane)(e,l,n);if(o?.name!==`folder`){await this.renderExplorerInto(s,e,o,{isCurrent:()=>d(e),showHeader:!1});return}this.renderContainerView(e);return}try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.warn(`Unable to load selected resource metadata: `+n)}if(!d(e))return;let f=t.isJavaScriptFile(e)?this.browserContext?.session.paneRegistry.byName(`source`):void 0;if(!r&&t.isJavaScriptFile(e)&&!f){this.renderExplorerError(e,`The Source pane is unavailable to display this JavaScript file.`);return}await this.renderExplorerInto(s,e,r||f,{isCurrent:()=>d(e)})}catch(n){if(c.log.error(`Unable to render selected resource: `+n),o===this.renderGeneration&&this.resourceTarget){if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}this.renderExplorerError(e,`Unable to display the selected resource.`)}}}showSubject(e,n){let r=n?.name!==`sharing`,i=r?t.getIndexedContainer(e):void 0,a=i&&this.store?this.store.sym(i):void 0,o=a??e,s=r&&!a&&!!this.resourceLogic&&t.isContainerResource(e,this.resourceLogic)&&this.resourceLogic.containerHasIndexDocument(e);this.selectedResource=o,this.showResourceInContentView(o,n,!!a||s)}setContainerView(e){this.containerView=e;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.view=e)}get sidebarAvailableWidth(){let e=this.renderRoot.querySelector(`.folder-pane-main-content`),t=this.renderRoot.querySelector(`.folder-pane-sidebar-resizer`);return(e?.clientWidth??0)-(t?.getBoundingClientRect().width??0)}resizeSidebar(e){this.sidebarWidth=I(e,this.sidebarAvailableWidth)}finishSidebarResize(){let e=this.sidebarDrag;e&&(this.sidebarDrag=void 0,e.separator.hasPointerCapture(e.pointerId)&&e.separator.releasePointerCapture(e.pointerId),this.isConnected&&this.requestUpdate())}render(){return this.fullView?u.html`
1
+ const e=require("../../accessCache.cjs.js");require("../folder-pane-container/index.cjs.js"),require("../folder-pane-sidebar/index.cjs.js"),require("../folder-pane-content/index.cjs.js"),require("../folder-pane-storage-header/index.cjs.js"),require("../../_virtual/~icons/lucide/chevron-left.cjs.js");const t=require("../../helpers.cjs.js"),n=require("./renderRequest.cjs.js"),r=require("../folder-pane-storage-header/FolderPaneCreateDialog.cjs.js"),i=require("../../creationSafety.cjs.js"),a=require("../../mintPaneInstance.cjs.js"),o=require("../../debug.cjs.js"),s=require("./resourceLoad.cjs.js");let c=require("solid-ui"),l=require("solid-logic"),u=require("lit"),d=require("lit/decorators.js");require("solid-ui/components/button"),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/error-state"),require("solid-ui/components/file-explorer-header");var f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,ee,te,ne,re,ie,ae,oe,se,ce,le,ue,de,fe,pe,me,he,ge,_e,ve;function M(e,t,n){return(t=Se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e,t,n){ye(e,t),t.set(e,n)}function ye(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function P(e,t,n){return e.set(be(e,t),n),n}function F(e,t){return e.get(be(e,t))}function be(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function xe(e,t,n,r,i,a){function o(e,t,n){return function(r,i){return n&&n(r),e[t].call(r,i)}}function s(e,t){for(var n=0;n<e.length;n++)e[n].call(t);return t}function c(e,t,n,r){if(typeof e!=`function`&&(r||e!==void 0))throw TypeError(t+` must `+(n||`be`)+` a function`+(r?``:` or undefined`));return e}function l(e,t,n,r,i,a,s,l,u,d,f,p,m){function h(e){if(!m(e))throw TypeError(`Attempted to access private element on non-instance`)}var g,_=t[0],v=t[3],y=!l;if(!y){n||Array.isArray(_)||(_=[_]);var b={},x=[],S=i===3?`get`:i===4||p?`set`:`value`;d?(f||p?b={get:we(function(){return v(this)},r,`get`),set:function(e){t[4](this,e)}}:b[S]=v,f||we(b[S],r,i===2?``:S)):f||(b=Object.getOwnPropertyDescriptor(e,r))}for(var C=e,w=_.length-1;w>=0;w-=n?2:1){var T=_[w],E=n?_[w-1]:void 0,D={},O={kind:[`field`,`accessor`,`method`,`getter`,`setter`,`class`][i],name:r,metadata:a,addInitializer:function(e,t){if(e.v)throw Error(`attempted to call addInitializer after decoration was finished`);c(t,`An initializer`,`be`,!0),s.push(t)}.bind(null,D)};try{if(y)(g=c(T.call(E,C,O),`class decorators`,`return`))&&(C=g);else{var k,A;O.static=u,O.private=d,d?i===2?k=function(e){return h(e),b.value}:(i<4&&(k=o(b,`get`,h)),i!==3&&(A=o(b,`set`,h))):(k=function(e){return e[r]},(i<2||i===4)&&(A=function(e,t){e[r]=t}));var j=O.access={has:d?m.bind():function(e){return r in e}};if(k&&(j.get=k),A&&(j.set=A),C=T.call(E,p?{get:b.get,set:b.set}:b[S],O),p){if(typeof C==`object`&&C)(g=c(C.get,`accessor.get`))&&(b.get=g),(g=c(C.set,`accessor.set`))&&(b.set=g),(g=c(C.init,`accessor.init`))&&x.push(g);else if(C!==void 0)throw TypeError(`accessor decorators must return an object with get, set, or init properties or void 0`)}else c(C,(f?`field`:`method`)+` decorators`,`return`)&&(f?x.push(C):b[S]=C)}}finally{D.v=!0}}return(f||p)&&l.push(function(e,t){for(var n=x.length-1;n>=0;n--)t=x[n].call(e,t);return t}),f||y||(d?p?l.push(o(b,`get`),o(b,`set`)):l.push(i===2?b[S]:o.call.bind(b[S])):Object.defineProperty(e,r,b)),C}function u(e,t){return Object.defineProperty(e,Symbol.metadata||Symbol.for(`Symbol.metadata`),{configurable:!0,enumerable:!0,value:t})}if(arguments.length>=6)var d=a[Symbol.metadata||Symbol.for(`Symbol.metadata`)];var f=Object.create(d??null),p=function(e,t,n,r){var i,a,o=[],c=function(t){return Te(t)===e},u=new Map;function d(e){e&&o.push(s.bind(null,e))}for(var f=0;f<t.length;f++){var p=t[f];if(Array.isArray(p)){var m=p[1],h=p[2],g=p.length>3,_=16&m,v=!!(8&m),y=(m&=7)==0,b=h+`/`+v;if(!y&&!g){var x=u.get(b);if(!0===x||x===3&&m!==4||x===4&&m!==3)throw Error(`Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: `+h);u.set(b,!(m>2)||m)}l(v?e:e.prototype,p,_,g?`#`+h:Se(h),m,r,v?a||=[]:i||=[],o,v,g,y,m===1,v&&g?c:n)}}return d(i),d(a),o}(e,t,i,f);return n.length||u(e,f),{e:p,get c(){var t=[];return n.length&&[u(l(e,[n],r,e.name,5,f,t),f),s.bind(null,t,e)]}}}function Se(e){var t=Ce(e,`string`);return typeof t==`symbol`?t:t+``}function Ce(e,t){if(typeof e!=`object`||!e)return e;var n;if(typeof Symbol<`u`&&(n=e[Symbol.toPrimitive])!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function we(e,t,n){typeof t==`symbol`&&(t=(t=t.description)?`[`+t+`]`:``);try{Object.defineProperty(e,"name",{configurable:!0,value:n?n+` `+t:t})}catch{}return e}function Te(e){if(Object(e)!==e)throw TypeError(`right-hand side of 'in' should be an object, got `+(e===null?`null`:typeof e));return e}function I(e,t){if(!Number.isFinite(t)||t<=320)return 256;let n=t-320;return n<180?256:Math.min(480,n,Math.max(180,Number.isFinite(e)?e:256))}h=[(0,c.customElement)(`folder-pane-view`)];var Ee,L=new WeakMap,R=new WeakMap,z=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,G=new WeakMap,K=new WeakMap,q=new WeakMap,J=new WeakMap,Y=new WeakMap,X=new WeakMap,Z=new WeakMap,Q=new WeakMap,$=new WeakMap;ve=(g=(0,d.property)({attribute:!1}),v=(0,d.property)({attribute:!1}),b=(0,d.property)({type:Boolean,attribute:`full-view`}),S=(0,d.state)(),w=(0,d.state)(),E=(0,d.state)(),O=(0,d.state)(),A=(0,d.state)(),ee=(0,d.state)(),ne=(0,d.state)(),ie=(0,d.state)(),oe=(0,d.state)(),ce=(0,d.state)(),ue=(0,d.query)(`folder-pane-content`),fe=(0,d.query)(`.folder-pane-full-view`),me=(0,d.query)(`folder-pane-sidebar`),ge=(0,d.query)(`.folder-pane-status`),`browserContext`),f=class extends c.WebComponent{constructor(...u){super(...u),N(this,L,(p(this),_(this,void 0))),N(this,R,y(this,void 0)),N(this,z,x(this,!1)),N(this,B,C(this,void 0)),N(this,V,T(this,void 0)),N(this,H,D(this,`grid`)),N(this,U,k(this,``)),N(this,W,j(this,!1)),N(this,G,te(this,256)),N(this,K,re(this,480)),N(this,q,ae(this,void 0)),N(this,J,se(this,!1)),N(this,Y,le(this,!1)),M(this,`initialLoadGeneration`,0),M(this,`renderGeneration`,0),M(this,`permissionGeneration`,0),M(this,`permissionRequest`,void 0),M(this,`creationInFlight`,!1),M(this,`authListenersAttached`,!1),M(this,`dropProtectionAttached`,!1),M(this,`sidebarResizeObserver`,void 0),M(this,`responsiveLayoutInitialized`,!1),M(this,`sidebarDrag`,void 0),N(this,X,de(this,null)),N(this,Z,pe(this,null)),N(this,Q,he(this,null)),N(this,$,_e(this,null)),M(this,`handleAuthChange`,()=>{e.resourceAccessCache.clear(),this.refreshCreationPermission(!0),this.requestUpdate()}),M(this,`handleCreatePane`,async e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let n=e.detail?.pane;if(!n?.mintNew)return;let s=this.getActiveContainer(),u=this.ownerDocument,d=this.statusArea;if(!s||!d)return;this.creationInFlight=!0,this.updateUploadAvailability();let f=++this.renderGeneration,p=t.getPaneLabel(n);try{let e=await new Promise(e=>{(0,c.showDialog)(r.default,{props:{label:p},onClose:e})});if(!e||!l.authn.currentUser()||f!==this.renderGeneration||this.getActiveContainer()?.sameTerm(s)!==!0)return;if(!i.isSafeCreationName(e)){a.setMintStatus(d,`error`,i.invalidCreationNameMessage);return}this.clearContentForCreation();let t=await a.mintPaneInstance({context:this.browserContext,container:s,pane:n,name:e,noun:p,statusArea:d,me:l.authn.currentUser()??void 0,dom:u}),o=f===this.renderGeneration&&this.getActiveContainer()?.sameTerm(s)===!0;await this.showCreatedResource({container:s,...t,pane:n,newInstance:o?t.newInstance:void 0})}catch(e){o.error(`Unable to create folder-pane resource`,e),!(e instanceof a.PaneMintError)&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,`Unable to create ${p}: ${e instanceof Error?e.message:String(e)}`)}finally{this.creationInFlight=!1,this.updateUploadAvailability()}}),M(this,`handleUpload`,e=>{if(e.stopPropagation(),this.creationInFlight||!l.authn.currentUser())return;let t=this.ownerDocument.createElement(`input`);t.type=`file`,t.multiple=!0,t.addEventListener(`change`,()=>{this.uploadFiles(Array.from(t.files??[]),!0)}),t.click()}),M(this,`handleDroppedFiles`,e=>{e.stopPropagation();let t=e.detail?.files??[];this.uploadFiles(t,!1)}),M(this,`handleUploadRejected`,e=>{e.stopPropagation();let t=e.detail?.message;t&&this.statusArea&&a.setMintStatus(this.statusArea,`error`,t)}),M(this,`handleResourceDeleted`,e=>{let t=e.detail?.resource;if(!t)return;let r=t.dir(),i=this.getActiveContainer();r&&this.sidebar?.refreshResources?.(r);let a=this.resourceTarget?.querySelector(`folder-pane-container`);if(r&&i?.sameTerm(r)&&a?.refresh?.(),!this.selectedResource?.sameTerm(t))return;this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration);let o=r??this.subject;o?(this.selectedResource=o,this.renderContainerView(o)):this.selectedResource=void 0}),M(this,`clearContentError`,()=>{this.contentError=void 0}),M(this,`retryContent`,()=>{let e=this.contentError?.retry;if(e){this.clearContentError(),e();return}let t=this.selectedResource,n=this.subject;(t||n)&&(this.clearContentError(),t?this.showResourceInContentView(t,void 0,!1,!0):n&&(this.store&&s.clearFailedResource(this.store.fetcher,n),this.showInitialContainer(n)))}),M(this,`handleResourceSelected`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.searchQuery=``,this.showSubject(t))}),M(this,`handleResourceOpenPane`,e=>{let t=e.detail?.resource,n=e.detail?.paneName,r=n?this.browserContext?.session.paneRegistry.byName(n):void 0;t&&r&&(e.stopPropagation(),this.searchQuery=``,r.name===`folder`?this.showSubject(t,r,!0):this.showSubject(t,typeof r?.render==`function`?r:void 0,!0))}),M(this,`handleSelectHome`,()=>{this.searchQuery=``;let e=this.subject&&this.standaloneBreadcrumbRoot?.sameTerm(this.subject)?this.subject:this.standaloneBreadcrumbRoot;e&&this.showSubject(e)}),M(this,`handleSearch`,e=>{e.stopPropagation(),this.searchQuery=e.detail?.query||``;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.searchQuery=this.searchQuery)}),M(this,`handleSelectBreadcrumbResource`,e=>{let t=e.detail?.resource;t&&(e.stopPropagation(),this.showSubject(t))}),M(this,`handleContainerViewChange`,e=>{let t=e.detail?.view;t&&(e.stopPropagation(),this.setContainerView(t))}),M(this,`updateSidebarBounds`,()=>{this.isConnected&&(this.sidebarMaximumWidth=I(480,this.sidebarAvailableWidth),this.resizeSidebar(this.sidebarWidth))}),M(this,`handleSidebarPointerDown`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.button!==0||!e.isPrimary)return;e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId),t.focus(),this.sidebarDrag={separator:t,pointerId:e.pointerId,startX:e.clientX,startWidth:this.sidebarWidth},this.requestUpdate()}),M(this,`handleSidebarPointerMove`,e=>{let t=this.sidebarDrag;this.isConnected&&!this.sidebarCollapsed&&t&&t.pointerId===e.pointerId&&this.resizeSidebar(t.startWidth+e.clientX-t.startX)}),M(this,`handleSidebarPointerEnd`,e=>{this.sidebarDrag?.pointerId===e.pointerId&&this.finishSidebarResize()}),M(this,`handleSidebarResizeKey`,e=>{if(!this.isConnected||this.sidebarCollapsed||this.sidebarDrag||e.altKey||e.ctrlKey||e.metaKey)return;let t;switch(e.key){case`ArrowLeft`:t=this.sidebarWidth-16;break;case`ArrowRight`:t=this.sidebarWidth+16;break;case`Home`:t=180;break;case`End`:t=480;break;default:return}e.preventDefault(),e.stopPropagation(),this.resizeSidebar(t)}),M(this,`handleSidebarToggle`,async e=>{e.stopPropagation();let t=this.sidebar,n=this.renderRoot.querySelector(`.folder-pane-sidebar-resize-handle`),r=!!t&&(t.matches(`:focus-within`)||t.shadowRoot?.activeElement!=null),i=n===this.ownerDocument.activeElement;this.finishSidebarResize(),this.sidebarCollapsed=!this.sidebarCollapsed,this.sidebarCollapsed&&(r||i)&&(await this.updateComplete,this.renderRoot.querySelector(`.folder-pane-sidebar-toggle`)?.focus())}),M(this,`handleFolderPaneResourceError`,e=>{e.stopPropagation();let t=e.detail?.title||`Unable to load this folder`,n=e.detail?.message||`The folder could not be loaded. Try again.`;this.showContentError({title:t,message:n,retry:e.detail?.retry},!1)})}get[ve](){return F(L,this)}set browserContext(e){P(L,this,e)}get store(){return this.browserContext?.session.store}get subject(){return F(R,this)}set subject(e){P(R,this,e)}get resourceLogic(){return this.browserContext?.session.logic.resource}get displayedResource(){return this.selectedResource??this.subject}get fullView(){return F(z,this)}set fullView(e){P(z,this,e)}get selectedResource(){return F(B,this)}set selectedResource(e){P(B,this,e)}get standaloneBreadcrumbRoot(){return F(V,this)}set standaloneBreadcrumbRoot(e){P(V,this,e)}get containerView(){return F(H,this)}set containerView(e){P(H,this,e)}get searchQuery(){return F(U,this)}set searchQuery(e){P(U,this,e)}get sidebarCollapsed(){return F(W,this)}set sidebarCollapsed(e){P(W,this,e)}get sidebarWidth(){return F(G,this)}set sidebarWidth(e){P(G,this,e)}get sidebarMaximumWidth(){return F(K,this)}set sidebarMaximumWidth(e){P(K,this,e)}get contentError(){return F(q,this)}set contentError(e){P(q,this,e)}get showingContainer(){return F(J,this)}set showingContainer(e){P(J,this,e)}get canCreate(){return F(Y,this)}set canCreate(e){P(Y,this,e)}get contentView(){return F(X,this)}set contentView(e){P(X,this,e)}get fullViewTarget(){return F(Z,this)}set fullViewTarget(e){P(Z,this,e)}get sidebar(){return F(Q,this)}set sidebar(e){P(Q,this,e)}get statusArea(){return F($,this)}set statusArea(e){P($,this,e)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback();let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver?.observe(e),this.dropProtectionAttached||=(c.aclControl.preventBrowserDropEvents(this.ownerDocument),!0),this.addEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.addEventListener(`folder-pane-upload`,this.handleUpload),this.addEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.addEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.addEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.addEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached||=(l.authSession.events.on(`login`,this.handleAuthChange),l.authSession.events.on(`logout`,this.handleAuthChange),!0)}disconnectedCallback(){this.finishSidebarResize(),this.sidebarResizeObserver?.disconnect(),this.renderGeneration=n.invalidateRenderRequest(this.renderGeneration),this.initialLoadGeneration++,this.removeEventListener(`folder-pane-create-pane`,this.handleCreatePane),this.removeEventListener(`folder-pane-upload`,this.handleUpload),this.removeEventListener(`folder-pane-upload-files`,this.handleDroppedFiles),this.removeEventListener(`folder-pane-upload-rejected`,this.handleUploadRejected),this.removeEventListener(`resource-open-pane`,this.handleResourceOpenPane),this.ownerDocument.removeEventListener(`solid-resource-deleted`,this.handleResourceDeleted),this.authListenersAttached&&=(l.authSession.events.off(`login`,this.handleAuthChange),l.authSession.events.off(`logout`,this.handleAuthChange),!1),super.disconnectedCallback()}firstUpdated(){if(this.updateSidebarBounds(),typeof ResizeObserver<`u`){this.sidebarResizeObserver=new ResizeObserver(e=>{this.updateSidebarBounds();let t=e[0]?.contentRect.width??0;this.responsiveLayoutInitialized||t<=0||(this.responsiveLayoutInitialized=!0,t<768&&this.handleSidebarToggle(new Event(`folder-pane-responsive-collapse`)))});let e=this.querySelector(`.folder-pane-main-content`);e&&this.sidebarResizeObserver.observe(e),this.sidebarResizeObserver.observe(this)}}async uploadFiles(e,t){if(this.creationInFlight||!l.authn.currentUser()||!this.canCreate)return;let n=this.getActiveContainer(),r=this.statusArea,o=this.resourceLogic;if(!e.length||!n||!r||!this.store||!o)return;let s=e.filter(e=>i.isSafeCreationName(e.name)),c=e.filter(e=>!i.isSafeCreationName(e.name)).map(e=>`${e.name}: ${i.invalidCreationNameMessage}`);if(!s.length){c.length&&a.setMintStatus(r,`error`,c.join(`; `));return}this.creationInFlight=!0,this.updateUploadAvailability();let u=this.renderGeneration,d=this.browserContext,f=s.length,p=()=>{f--,f===0&&(this.creationInFlight=!1,this.updateUploadAvailability(),r.dataset.status===`progress`&&r.replaceChildren())};a.setMintStatus(r,`progress`,`Uploading ${s.length} file${s.length===1?``:`s`}`);try{let e=await o.uploadFiles(s,n.uri);for(let r of e)if(r.success)try{let e=this.renderGeneration===u&&this.browserContext===d;await this.showCreatedResource({container:n,containedResource:this.store.sym(r.uploadedUri),newInstance:t&&s.length===1&&e?this.store.sym(r.uploadedUri):void 0})}catch(e){let t=e instanceof Error?e.message:String(e);c.push(`Uploaded ${r.file.name}, but could not refresh the folder: ${t}`)}finally{p()}else{let e=r.error.destinationUri?`Upload failed while putting ${r.error.destinationUri}`:`Upload failed for ${r.file.name}`,t=r.error.status===413?`${e}: storage quota was exceeded. ${r.error.message}`:r.error.status?`${e} (HTTP ${r.error.status}). ${r.error.message}`:`${e}. ${r.error.message}`;c.push(t),p()}}catch(e){let t=e instanceof Error?e.message:String(e);for(c.push(`Unable to upload files: ${t}`);f>0;)p()}c.length&&a.setMintStatus(r,`error`,c.join(`; `))}updated(e){(e.has(`subject`)||e.has(`browserContext`))&&this.subject?(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject,(e.has(`subject`)||e.has(`browserContext`))&&(this.selectedResource=void 0,this.renderGeneration++,this.initialLoadGeneration++),this.refreshCreationPermission(),this.showInitialContainer(this.subject)):(e.has(`selectedResource`)&&this.refreshCreationPermission(),e.has(`fullView`)&&e.get(`fullView`)!==void 0&&(this.subject&&(this.standaloneBreadcrumbRoot=this.fullView?this.getStandaloneBreadcrumbRoot(this.subject):this.subject),this.selectedResource?this.showResourceInContentView(this.selectedResource):this.subject&&this.renderContainerView(this.subject)))}getStandaloneBreadcrumbRoot(e){try{let t=new URL(e.uri),n=t.pathname.split(`/`).filter(Boolean);return n.length<=1?e:this.store?.sym(`${t.origin}/${n[0]}/`)??e}catch{return e}}get resourceTarget(){return this.fullView?this.fullViewTarget:this.contentView}showContentError(e,t=!0){t&&this.resourceTarget?.replaceChildren(),this.contentError=e}renderAccessDeniedScreen(){this.showContentError({title:`Access denied`,message:`You do not have access to the contents of this container.`})}async loadResource(e,n=!1){let r=this.store;if(!r)return;let i=r.fetcher;n&&s.clearFailedResource(i,e);try{await i.load(e)}catch(r){if(!n||!t.isAccessDeniedError(r)||!l.authn.currentUser())throw r;await i.load(e,{force:!0,clearPreviousData:!0})}}openCreatedResource(e,t){this.searchQuery=``;let n=t?.name?this.browserContext?.session.paneRegistry.byName(t.name)??t:t;this.showSubject(e,typeof n?.render==`function`?n:void 0)}getActiveContainer(){let e=this.selectedResource,n=e?t.getIndexedContainer(e):void 0;if(n&&this.store)return this.store.sym(n);if(e&&this.resourceLogic&&t.isContainerResource(e,this.resourceLogic))return e;let r=this.fullView?this.standaloneBreadcrumbRoot:this.subject,i=e?.dir(),a=r?.uri.endsWith(`/`)?r.uri:`${r?.uri}/`;return r&&i&&a&&i.uri.startsWith(a)?i:this.subject}refreshCreationPermission(e=!1){let t=this.getActiveContainer(),n=this.browserContext?.session.logic.resource;if(!e&&t&&n&&this.permissionRequest?.containerUri===t.uri&&this.permissionRequest.resourceLogic===n)return;let r=++this.permissionGeneration;this.setCanCreate(!1),this.permissionRequest=t&&n?{containerUri:t.uri,resourceLogic:n}:void 0,t&&n&&n.fetchMetadata(t).then(e=>{r===this.permissionGeneration&&this.getActiveContainer()?.sameTerm(t)===!0&&this.setCanCreate(e.access.canEdit)}).catch(e=>{r===this.permissionGeneration&&(this.permissionRequest=void 0,o.warn(`Unable to determine folder creation permission`,e))})}updateUploadAvailability(){let e=this.resourceTarget?.querySelector(`folder-pane-container`),t=this.getActiveContainer();e&&(e.canUpload=this.canCreate&&!this.creationInFlight&&!!t&&e.subject?.sameTerm(t)===!0,e.uploadBusy=this.creationInFlight)}setCanCreate(e){this.canCreate=e,this.updateUploadAvailability()}clearContentForCreation(){this.resourceTarget?.replaceChildren()}async showCreatedResource({container:e,containedResource:t,newInstance:n,pane:r}){let i=this.store;if(!i)return;let a=this.renderGeneration,o=this.browserContext,s=async e=>{try{return await i.fetcher.load(e,{force:!0,clearPreviousData:!0}),!0}catch(t){return c.log.warn(`Unable to reload `+e.uri+`: `+t),!1}},l=await s(e);if(t.uri.endsWith(`/`)){await s(t);let e=i.each(t,c.ns.ldp(`contains`),void 0,t.doc());for(let t of e)t.termType===`NamedNode`&&i.fetcher.getState(t.value)===`failed`&&i.fetcher.unload(t)}this.sidebar?.refreshResources?.(e);let u=this.resourceTarget?.querySelector(`folder-pane-container`);!l&&u?.addOptimisticResource&&u.addOptimisticResource(t),l&&u?.refresh?.(),n&&this.isConnected&&this.renderGeneration===a&&this.browserContext===o&&this.openCreatedResource(n,r)}renderContainerView(e){let t=this.resourceTarget;if(!t)return;this.contentError=void 0;let n=document.createElement(`folder-pane-container`);n.subject=e,n.resourceLogic=this.resourceLogic??null,n.browserContext=this.browserContext;let r=this.getActiveContainer();n.canUpload=this.canCreate&&!!r&&e.sameTerm(r),n.uploadBusy=this.creationInFlight,n.view=this.containerView,n.searchQuery=this.searchQuery,this.showingContainer=!0,t.replaceChildren(n)}async showInitialContainer(e){let n=++this.initialLoadGeneration;if(t.isJavaScriptFile(e))this.showSubject(e);else if(this.store&&this.resourceLogic){try{await this.loadResource(e)}catch(r){if(n!==this.initialLoadGeneration||!this.subject?.sameTerm(e))return;if(t.isAccessDeniedError(r)){this.resourceTarget&&this.renderAccessDeniedScreen();return}c.log.error(`Unable to load storage container: `+r),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}n===this.initialLoadGeneration&&this.subject?.sameTerm(e)&&(this.sidebar?.refreshResources?.(),this.requestUpdate(),this.selectedResource||this.showSubject(e))}}async renderExplorerInto(e,t,r,i={}){if(!this.browserContext)return;let a=await(0,c.getRelevantPanes)(t,this.browserContext,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(i.isCurrent&&!i.isCurrent())return;let o=r||(0,c.getPreferredPane)(t,this.browserContext,a);if(!o){this.renderExplorerError(t,`No pane is available to display this resource.`);return}let s;try{s=o.render(t,this.browserContext,i.paneOptions||{})}catch(e){c.log.error(`Unable to render selected pane: `+e),this.renderExplorerError(t,`The selected pane could not render this resource.`);return}let l=e.ownerDocument.createElement(`solid-ui-file-explorer-provider`),u=await(0,c.preparePaneMenuItems)({subject:t,context:this.browserContext,panes:a,openPane:(e,t)=>{l.dispatchEvent(new CustomEvent(c.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))}});l.addEventListener(c.FILE_EXPLORER_BACK_EVENT,e=>{if(!(0,c.isExplorerEvent)(e,l))return;e.stopPropagation();let n=this.getActiveContainer()||this.subject||t;this.renderGeneration++,this.selectedResource=n,this.renderContainerView(n)}),l.addEventListener(c.FILE_EXPLORER_OPEN_PANE_EVENT,r=>{if(!(0,c.isExplorerEvent)(r,l))return;r.stopPropagation();let a=r.detail?.paneName,o=a?this.browserContext?.session.paneRegistry.byName(a):void 0;if(o){let r={generation:++this.renderGeneration,subjectUri:t.uri,context:this.browserContext};this.renderExplorerInto(e,t,o,{...i,paneOptions:o.name===`folder`?{folderView:`container`,fullView:!0,solo:!0}:i.paneOptions,isCurrent:()=>n.isCurrentRenderRequest(r,this.renderGeneration,this.selectedResource?.uri,this.browserContext)}).catch(e=>{c.log.error(`Unable to switch selected pane: `+e)})}}),(0,c.composeExplorer)(l,{context:this.browserContext,subjectUri:t.uri,pane:o,relevantPanes:a,header:i.showHeader===!1?void 0:{paneIcon:o.icon,menuItems:u},paneElement:s}),(!i.isCurrent||i.isCurrent())&&(this.contentError=void 0,this.showingContainer=!1,e.replaceChildren(l))}renderExplorerError(e,t){this.showContentError({title:t,message:e.uri})}async showResourceInContentView(e,r,i=!1,a=!1){let o=++this.renderGeneration;try{let s=this.resourceTarget,l=this.browserContext;if(!s||!this.store||!this.resourceLogic||!l)return;let u={generation:o,subjectUri:e.uri,context:this.browserContext},d=e=>n.isCurrentRenderRequest(u,this.renderGeneration,this.selectedResource?.uri,this.browserContext)&&e.uri===u.subjectUri;if(!d(e))return;if(this.subject?.sameTerm(e)&&!r&&!i&&t.isContainerResource(e,this.resourceLogic)){this.renderContainerView(e);return}if(t.isContainerResource(e,this.resourceLogic)&&(r?.name!==`source`||i)){try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load selected container: `+n),this.showContentError({title:`Unable to load this folder`,message:`The folder could not be loaded. Try again.`});return}if(!d(e))return;if(this.sidebar?.refreshResources?.(),r?.name===`folder`){this.renderContainerView(e);return}if(!r&&(i||this.resourceLogic.containerHasIndexDocument(e))){let n=this.store.sym(t.getIndexedApplicationSubject(e));try{await this.loadResource(n.doc(),a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.error(`Unable to load container index document: `+n)}await this.renderExplorerInto(s,n,r,{isCurrent:()=>d(e),showHeader:!1});return}let n=await(0,c.getRelevantPanes)(e,l,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(!d(e))return;let o=r||(0,c.getPreferredPane)(e,l,n);if(o?.name!==`folder`){await this.renderExplorerInto(s,e,o,{isCurrent:()=>d(e),showHeader:!1});return}this.renderContainerView(e);return}try{await this.loadResource(e,a)}catch(n){if(!d(e))return;if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}c.log.warn(`Unable to load selected resource metadata: `+n)}if(!d(e))return;let f=t.isJavaScriptFile(e)?this.browserContext?.session.paneRegistry.byName(`source`):void 0;if(!r&&t.isJavaScriptFile(e)&&!f){this.renderExplorerError(e,`The Source pane is unavailable to display this JavaScript file.`);return}await this.renderExplorerInto(s,e,r||f,{isCurrent:()=>d(e)})}catch(n){if(c.log.error(`Unable to render selected resource: `+n),o===this.renderGeneration&&this.resourceTarget){if(t.isAccessDeniedError(n)){this.renderAccessDeniedScreen();return}this.renderExplorerError(e,`Unable to display the selected resource.`)}}}showSubject(e,n,r=!1){let i=!r&&n?.name!==`sharing`,a=i?t.getIndexedContainer(e):void 0,o=a&&this.store?this.store.sym(a):void 0,s=o??e,c=i&&!o&&!!this.resourceLogic&&t.isContainerResource(e,this.resourceLogic)&&this.resourceLogic.containerHasIndexDocument(e);this.selectedResource=s,this.showResourceInContentView(s,n,!!o||c)}setContainerView(e){this.containerView=e;let t=this.resourceTarget?.querySelector(`folder-pane-container`);t&&(t.view=e)}get sidebarAvailableWidth(){let e=this.renderRoot.querySelector(`.folder-pane-main-content`),t=this.renderRoot.querySelector(`.folder-pane-sidebar-resizer`);return(e?.clientWidth??0)-(t?.getBoundingClientRect().width??0)}resizeSidebar(e){this.sidebarWidth=I(e,this.sidebarAvailableWidth)}finishSidebarResize(){let e=this.sidebarDrag;e&&(this.sidebarDrag=void 0,e.separator.hasPointerCapture(e.pointerId)&&e.separator.releasePointerCapture(e.pointerId),this.isConnected&&this.requestUpdate())}render(){return this.fullView?u.html`
2
2
  <folder-pane-provider
3
3
  .rootResource=${this.subject}
4
4
  .displayedResource=${this.displayedResource}
@@ -89,7 +89,7 @@ const e=require("../../accessCache.cjs.js");require("../folder-pane-container/in
89
89
  <folder-pane-storage-header
90
90
  .subject=${this.subject}
91
91
  .breadcrumbRoot=${this.standaloneBreadcrumbRoot}
92
- .selectedResource=${this.displayedResource}
92
+ .selectedResource=${this.getActiveContainer()}
93
93
  .browserContext=${this.browserContext}
94
94
  .paneList=${this.browserContext?.session.paneRegistry.list??[]}
95
95
  .view=${this.containerView}