folder-pane 4.0.1-0 → 4.0.1-2

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 (110) hide show
  1. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js +2 -0
  2. package/dist/_virtual/~icons/lucide/chevron-left.cjs.js.map +1 -0
  3. package/dist/_virtual/~icons/lucide/{trash-2.esm.js → chevron-left.esm.js} +4 -4
  4. package/dist/_virtual/~icons/lucide/chevron-left.esm.js.map +1 -0
  5. package/dist/accessCache.cjs.js +2 -0
  6. package/dist/accessCache.cjs.js.map +1 -0
  7. package/dist/accessCache.d.ts +37 -0
  8. package/dist/accessCache.d.ts.map +1 -0
  9. package/dist/accessCache.esm.js +34 -0
  10. package/dist/accessCache.esm.js.map +1 -0
  11. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js +38 -33
  12. package/dist/components/folder-pane-container/FolderPaneContainer.cjs.js.map +1 -1
  13. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts +27 -5
  14. package/dist/components/folder-pane-container/FolderPaneContainer.d.ts.map +1 -1
  15. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js +305 -189
  16. package/dist/components/folder-pane-container/FolderPaneContainer.esm.js.map +1 -1
  17. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js +1 -1
  18. package/dist/components/folder-pane-container/FolderPaneContainer.styles.cjs.js.map +1 -1
  19. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js +1 -1
  20. package/dist/components/folder-pane-container/FolderPaneContainer.styles.esm.js.map +1 -1
  21. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js +1 -1
  22. package/dist/components/folder-pane-content/FolderPaneContent.styles.cjs.js.map +1 -1
  23. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js +1 -1
  24. package/dist/components/folder-pane-content/FolderPaneContent.styles.esm.js.map +1 -1
  25. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js +2 -0
  26. package/dist/components/folder-pane-provider/FolderPaneProvider.cjs.js.map +1 -0
  27. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts +16 -0
  28. package/dist/components/folder-pane-provider/FolderPaneProvider.d.ts.map +1 -0
  29. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js +293 -0
  30. package/dist/components/folder-pane-provider/FolderPaneProvider.esm.js.map +1 -0
  31. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js +2 -0
  32. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.cjs.js.map +1 -0
  33. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js +6 -0
  34. package/dist/components/folder-pane-provider/FolderPaneProvider.styles.esm.js.map +1 -0
  35. package/dist/components/folder-pane-provider/index.cjs.js +1 -0
  36. package/dist/components/folder-pane-provider/index.d.ts +2 -0
  37. package/dist/components/folder-pane-provider/index.d.ts.map +1 -0
  38. package/dist/components/folder-pane-provider/index.esm.js +1 -0
  39. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js +18 -19
  40. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.cjs.js.map +1 -1
  41. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts +15 -2
  42. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.d.ts.map +1 -1
  43. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js +237 -108
  44. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.esm.js.map +1 -1
  45. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js +1 -1
  46. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.cjs.js.map +1 -1
  47. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js +1 -1
  48. package/dist/components/folder-pane-sidebar/FolderPaneSidebar.styles.esm.js.map +1 -1
  49. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js +32 -18
  50. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.cjs.js.map +1 -1
  51. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts +13 -2
  52. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.d.ts.map +1 -1
  53. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js +191 -84
  54. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.esm.js.map +1 -1
  55. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js +1 -1
  56. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.cjs.js.map +1 -1
  57. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js +1 -1
  58. package/dist/components/folder-pane-storage-header/FolderPaneStorageHeader.styles.esm.js.map +1 -1
  59. package/dist/components/folder-pane-view/FolderPaneView.cjs.js +91 -28
  60. package/dist/components/folder-pane-view/FolderPaneView.cjs.js.map +1 -1
  61. package/dist/components/folder-pane-view/FolderPaneView.d.ts +36 -3
  62. package/dist/components/folder-pane-view/FolderPaneView.d.ts.map +1 -1
  63. package/dist/components/folder-pane-view/FolderPaneView.esm.js +520 -240
  64. package/dist/components/folder-pane-view/FolderPaneView.esm.js.map +1 -1
  65. package/dist/components/folder-pane-view/resourceLoad.cjs.js +2 -0
  66. package/dist/components/folder-pane-view/resourceLoad.cjs.js.map +1 -0
  67. package/dist/components/folder-pane-view/resourceLoad.d.ts +8 -0
  68. package/dist/components/folder-pane-view/resourceLoad.d.ts.map +1 -0
  69. package/dist/components/folder-pane-view/resourceLoad.esm.js +7 -0
  70. package/dist/components/folder-pane-view/resourceLoad.esm.js.map +1 -0
  71. package/dist/debug.cjs.js +2 -0
  72. package/dist/debug.cjs.js.map +1 -0
  73. package/dist/debug.d.ts +5 -0
  74. package/dist/debug.d.ts.map +1 -0
  75. package/dist/debug.esm.js +10 -0
  76. package/dist/debug.esm.js.map +1 -0
  77. package/dist/folderPane.cjs.js +2 -2
  78. package/dist/folderPane.cjs.js.map +1 -1
  79. package/dist/folderPane.d.ts +13 -0
  80. package/dist/folderPane.d.ts.map +1 -1
  81. package/dist/folderPane.esm.js +24 -13
  82. package/dist/folderPane.esm.js.map +1 -1
  83. package/dist/helpers.cjs.js +1 -1
  84. package/dist/helpers.cjs.js.map +1 -1
  85. package/dist/helpers.d.ts +12 -1
  86. package/dist/helpers.d.ts.map +1 -1
  87. package/dist/helpers.esm.js +34 -14
  88. package/dist/helpers.esm.js.map +1 -1
  89. package/dist/primitives/context.cjs.js +2 -0
  90. package/dist/primitives/context.cjs.js.map +1 -0
  91. package/dist/primitives/context.d.ts +14 -0
  92. package/dist/primitives/context.d.ts.map +1 -0
  93. package/dist/primitives/context.esm.js +6 -0
  94. package/dist/primitives/context.esm.js.map +1 -0
  95. package/dist/requestQueue.cjs.js +2 -0
  96. package/dist/requestQueue.cjs.js.map +1 -0
  97. package/dist/requestQueue.d.ts +38 -0
  98. package/dist/requestQueue.d.ts.map +1 -0
  99. package/dist/requestQueue.esm.js +77 -0
  100. package/dist/requestQueue.esm.js.map +1 -0
  101. package/dist/resourceActionItems.cjs.js +2 -0
  102. package/dist/resourceActionItems.cjs.js.map +1 -0
  103. package/dist/resourceActionItems.d.ts +20 -0
  104. package/dist/resourceActionItems.d.ts.map +1 -0
  105. package/dist/resourceActionItems.esm.js +42 -0
  106. package/dist/resourceActionItems.esm.js.map +1 -0
  107. package/package.json +12 -8
  108. package/dist/_virtual/~icons/lucide/trash-2.cjs.js +0 -2
  109. package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +0 -1
  110. package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +0 -1
@@ -1,12 +1,21 @@
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)}})();import { isJavaScriptFile as e } from "./helpers.esm.js";
3
- import "./components/folder-pane-view/index.esm.js";
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--storage folder-pane-storage-header{--folder-pane-storage-toolbar-right-padding:8px;--folder-pane-storage-header-mobile-gap:0;--folder-pane-storage-header-mobile-padding:0 0 10px}folder-pane-view{flex-direction:column;flex:auto;width:100%;height:100%;min-height:0;display:flex}.folder-pane-main-content{box-sizing:border-box;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%;min-width:0;height:80vh;min-height:32rem;display:flex;overflow:hidden}.folder-pane-view-controls{flex:none;justify-content:flex-end;align-items:center;gap:5.6px;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{flex-direction:column;flex:0 0 var(--folder-pane-sidebar-width,256px);width:var(--folder-pane-sidebar-width,256px);box-sizing:border-box;border-right:1px solid var(--solid-ui-color-gray-200,#cbd5e1);min-width:0;max-width:100%;min-height:0;display:flex;overflow:hidden}.folder-pane-sidebar-resizer{background:0 0;flex:0 0 4px;width:4px;position:relative}.folder-pane-sidebar-resize-handle{cursor:col-resize;touch-action:none;position:absolute;inset:0}.folder-pane-sidebar-resize-handle:focus-visible{outline:1px solid var(--solid-ui-color-lavender-300,#e6dcff);outline-offset:0}.folder-pane-sidebar-resizer[data-resizing=true]{background:var(--solid-ui-color-lavender-300,#e6dcff)}.folder-pane-main-content:has(.folder-pane-sidebar-resizer[data-resizing=true]){-webkit-user-select:none;user-select:none}.folder-pane-sidebar-toggle{box-sizing:border-box;color:var(--solid-ui-color-gray-900,#101828);background:var(--solid-ui-color-zinc-300,#d4d4d8);z-index:1;border:0;border-radius:20px;justify-content:center;align-items:center;width:25px;min-width:25px;height:25px;min-height:25px;padding:0;display:flex;position:absolute;top:75%;left:calc(50% - 2px);transform:translate(-50%,-50%)}.folder-pane-sidebar-toggle:hover{background:var(--solid-ui-color-primary-hover)}.folder-pane-sidebar-toggle:focus-visible{outline:1px solid var(--solid-ui-color-lavender-300,#e6dcff);outline-offset:1px}.folder-pane-sidebar-toggle-icon{flex:none;width:12.308px;height:12.308px;display:block;position:relative;top:-1px}.folder-pane-sidebar-toggle-icon-collapsed{transform:rotate(90deg)scaleX(-1)}.folder-pane-main-content[data-sidebar-collapsed=true]>folder-pane-sidebar{border-right:0;flex-basis:0;width:0;min-width:0;overflow:hidden}.folder-pane-main-content[data-sidebar-collapsed=true]>.folder-pane-sidebar-resizer{flex-basis:4px}.folder-pane-main-content[data-sidebar-collapsed=true]>.folder-pane-sidebar-resizer>.folder-pane-sidebar-toggle{left:calc(50% + 12.5px)}.folder-pane-content-column{flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative}@media (prefers-reduced-motion:reduce){.folder-pane-main-content,folder-pane-sidebar,.folder-pane-sidebar-toggle-icon,.resource-expand-button icon-lucide-chevron-right{transition:none}}.folder-pane-content-column>folder-pane-content{box-sizing:border-box;padding:16px}.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-top:1px solid var(--color-border,#ddd);text-align:left;flex-direction:column;flex:none;gap:8px;padding:8px 12px;display:flex}.folder-pane-status[data-status=progress]{accent-color:auto;text-align:center;outline:0;flex:none;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<=768px){.folder-pane{height:auto;margin-top:var(--spacing-2xs,.25em);margin-bottom:var(--spacing-2xs,.25em);overflow:visible}folder-pane-view{height:auto}.folder-pane-main-content,.folder-pane-full-view{flex:none;height:auto;min-height:0;overflow:visible}.folder-pane-main-content{border:0}.folder-pane-content-column{min-height:0;overflow:visible}solid-ui-file-explorer-provider,solid-ui-file-explorer-provider>.paneDiv,solid-ui-file-explorer-provider>.exceptionPane{height:auto;min-height:0;overflow:visible}.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)}})();import "./components/folder-pane-view/index.esm.js";
3
+ import "./components/folder-pane-provider/index.esm.js";
4
+ import { isJavaScriptFile as e, isJsonFile as t } from "./helpers.esm.js";
4
5
 
5
6
 
6
- import { icons as t, ns as n } from "solid-ui";
7
+ import { icons as n, ns as r } from "solid-ui";
7
8
  // src/folderPane.ts
8
- var r = {
9
- icon: t.iconBase + "noun_973694_expanded.svg",
9
+ var i = [
10
+ "explorer",
11
+ "storage",
12
+ "container"
13
+ ];
14
+ function a(e) {
15
+ return e.folderView && i.includes(e.folderView) ? e.folderView : e.fullView === !0 || e.solo === !0 ? "container" : "explorer";
16
+ }
17
+ var o = {
18
+ icon: n.iconBase + "noun_973694_expanded.svg",
10
19
  name: "folder",
11
20
  mintNew: function(e, t) {
12
21
  let n = e.session.store, r = (t.newInstance || n.sym(t.newBase)).uri;
@@ -16,18 +25,20 @@ var r = {
16
25
  return t;
17
26
  });
18
27
  },
19
- label: function(t, r) {
20
- if (e(t)) return null;
21
- let i = r.session.store, a = i.each(t, n.ldp("contains")).length;
22
- return a > 0 ? "Contents (" + a + ")" : i.holds(t, n.rdf("type"), n.ldp("Container")) ? "Container (0)" : null;
28
+ label: function(n, i) {
29
+ if (e(n) || t(n)) return null;
30
+ let a = i.session.store, o = a.each(n, r.ldp("contains")).length;
31
+ return o > 0 ? "Contents (" + o + ")" : a.holds(n, r.rdf("type"), r.ldp("Container")) ? "Container (0)" : null;
23
32
  },
24
33
  render: function(e, t, n) {
25
34
  let r = t.dom, i = r.createElement("div");
26
35
  i.classList.add("instancePane", "folder-pane");
27
- let a = i.appendChild(r.createElement("folder-pane-view")), o = n && typeof n == "object" ? n : {};
28
- return a.browserContext = t, a.subject = e, a.fullView = o.fullView === !0 || o.solo === !0, i;
36
+ let o = i.appendChild(r.createElement("folder-pane-view")), s = n && typeof n == "object" ? n : {};
37
+ o.browserContext = t, o.subject = e;
38
+ let c = a(s);
39
+ return i.classList.add(`folder-pane--${c}`), o.fullView = c === "container", i;
29
40
  }
30
41
  };
31
- export { r as default };
42
+ export { o as default, a as folderViewFor };
32
43
 
33
44
  //# 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 folderPaneView.fullView = renderOptions.fullView === true || renderOptions.solo === true\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":";;;;;;AAmBA,IAAAA,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;EAUL,OATA,EAAe,iBAAiBZ,GAChC,EAAe,UAAUK,GACzB,EAAe,WAAWM,EAAc,aAAa,MAAQA,EAAc,SAAS,IAO7EF;CACT;AACF"}
1
+ {"version":3,"file":"folderPane.esm.js","names":["FOLDER_VIEWS","folderViewFor","options","folderPane_default","icons","kb","context","u","newPaneOptions","normalizedInstance","isJavaScriptFile","subject","isJsonFile","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 './components/folder-pane-provider'\nimport type FolderPaneView from './components/folder-pane-view/FolderPaneView'\nimport { icons, ns } from 'solid-ui'\nimport { isJavaScriptFile, isJsonFile } 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`: storage header, sidebar and content under the navbar of someone else's pod\n * - `container`: storage header and container contents, without a sidebar (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) || isJsonFile(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 div.classList.add(`folder-pane--${folderView}`)\n folderPaneView.fullView = folderView === 'container'\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":";;;;;;;AA6BA,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,KAAKC,EAAWD,CAAO,GAAG,OAAO;EAC7D,IAAMN,IAAKC,EAAQ,QAAQ,OACrBO,IAAIR,EAAG,KAAKM,GAASG,EAAG,IAAI,UAAU,CAAC,CAAC,CAAC;EAQ/C,OAPID,IAAI,IACC,eAAeA,IAAI,MAExBR,EAAG,MAAMM,GAASG,EAAG,IAAI,MAAM,GAAGA,EAAG,IAAI,WAAW,CAAC,IAEhD,kBAEF;CACT;CAGA,QAAQ,SAAU,GAAS,GAAS,GAAuB;EAEzD,IAAMC,IAAMT,EAAQ,KACdU,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,iBAAiBb,GAChC,EAAe,UAAUK;EACzB,IAAMS,IAAanB,EAAciB,CAAa;EAS9C,OARAF,EAAI,UAAU,IAAI,gBAAgBI,GAAY,GAC9C,EAAe,WAAWA,MAAe,aAOlCJ;CACT;AACF"}
@@ -1,2 +1,2 @@
1
- let e=require("solid-ui");function t(e){return/\.[cm]?js$/i.test(new URL(e.uri).pathname)}function n(e){return e.isPublicKnown===!1?`unknown`:e.isPublic?`public`:`private`}function r(e){return e?.toLowerCase()===`source`?`file`:e||`item`}function i(t){if(t.mintClass)return e.utils.label(t.mintClass);let n=r(t.name);return n.charAt(0).toUpperCase()+n.slice(1)}function a(e){return`${e} ${e===1?`item`:`items`}`}function o(e){return e.filter(e=>!!e.mintNew&&e.name?.toLowerCase()!==`chat`)}function s(e=`Container`){let t=e.charAt(0).toUpperCase()+e.slice(1);return{title:`New ${t}`,placeholder:`Enter ${t} name`}}function c(e,n){return e.uri.endsWith(`/`)||!t(e)&&n.isContainer(e)}function l(e){let t=typeof e==`object`&&e?e:void 0;return t?.status===401||t?.status===403||t?.response?.status===401||t?.response?.status===403}function u(e){let t=/^(.*\/)index\.ttl#this$/.exec(e.uri);return t?t[1]:null}function d(e,t){return t?.toLowerCase()===`schedule`?`${e.uri}details.ttl#event`:`${e.uri}index.ttl#this`}function f(t,n){if(!n)return new Map;let r=n.getContainerMembers(t).filter(e=>!n.isHiddenFile(e)).filter((e,t,n)=>n.findIndex(t=>t.sameTerm(e))===t).filter(e=>{let n=t.uri.endsWith(`/`)?t.uri:`${t.uri}/`;return e.uri!==`${n}index.ttl#this`}).map(t=>[e.utils.label(t).toLowerCase(),t]);return r.sort(),new Map(r.map(([,e])=>[e.value,{id:e.value,subject:e,parentId:t.value,isContainer:c(e,n)}]))}exports.getContainerMemberCountLabel=a,exports.getCreationDialogText=s,exports.getCreationNoun=r,exports.getCreationPanes=o,exports.getIndexedApplicationSubject=d,exports.getIndexedContainer=u,exports.getPaneLabel=i,exports.getResourceAccessState=n,exports.getResourcesForContainer=f,exports.isAccessDeniedError=l,exports.isContainerResource=c,exports.isJavaScriptFile=t;
1
+ let e=require("solid-ui");function t(e){return/\.[cm]?js$/i.test(new URL(e.uri).pathname)}function n(e){return/\.ttl$/i.test(new URL(e.uri).pathname)}function r(e){return/\.json$/i.test(new URL(e.uri).pathname)}function i(e){return e.isPublicKnown===!1?`unknown`:e.isPublic?`public`:`private`}function a(e){let t=e?.filter(Boolean).join(`,`);if(!t)return;let n=new Map;for(let e of t.split(`,`)){let t=e.trim().match(/^([A-Za-z]+)\s*=\s*"([^"]*)"$/);t&&n.set(t[1].toLowerCase(),t[2].toLowerCase().split(/\s+/).filter(Boolean))}let r=n.get(`public`)??[];return{isPublic:r.includes(`read`)||r.includes(`write`),canManageAccess:(n.get(`user`)??[]).includes(`control`)}}function o(e){return e?.toLowerCase()===`source`?`file`:e||`item`}function s(t){if(t.mintClass)return e.utils.label(t.mintClass);let n=o(t.name);return n.charAt(0).toUpperCase()+n.slice(1)}function c(e){return`${e} ${e===1?`item`:`items`}`}function l(e){return e.filter(e=>!!e.mintNew&&e.name?.toLowerCase()!==`chat`)}function u(e=`Container`){let t=e.charAt(0).toUpperCase()+e.slice(1);return{title:`New ${t}`,placeholder:`Enter ${t} name`}}function d(e,i){return e.uri.endsWith(`/`)||!t(e)&&!n(e)&&!r(e)&&i.isContainer(e)}function f(e){let t=typeof e==`object`&&e?e:void 0;return t?.status===401||t?.status===403||t?.response?.status===401||t?.response?.status===403}function p(e){let t=/^(.*\/)index\.ttl#this$/.exec(e.uri);return t?t[1]:null}function m(e,t){return t?.toLowerCase()===`schedule`?`${e.uri}details.ttl#event`:`${e.uri}index.ttl#this`}function h(t,n){if(!n)return new Map;let r=n.getContainerMembers(t).filter(e=>!n.isHiddenFile(e)).filter((e,t,n)=>n.findIndex(t=>t.sameTerm(e))===t).filter(e=>{let n=t.uri.endsWith(`/`)?t.uri:`${t.uri}/`;return e.uri!==`${n}index.ttl#this`}).map(t=>[e.utils.label(t).toLowerCase(),t]);return r.sort(),new Map(r.map(([,e])=>[e.value,{id:e.value,subject:e,parentId:t.value,isContainer:d(e,n)}]))}exports.getContainerMemberCountLabel=c,exports.getCreationDialogText=u,exports.getCreationNoun=o,exports.getCreationPanes=l,exports.getIndexedApplicationSubject=m,exports.getIndexedContainer=p,exports.getPaneLabel=s,exports.getResourceAccessState=i,exports.getResourcesForContainer=h,exports.isAccessDeniedError=f,exports.isContainerResource=d,exports.isJavaScriptFile=t,exports.isJsonFile=r,exports.isTurtleFile=n,exports.readStoredWacAllow=a;
2
2
  //# sourceMappingURL=helpers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.cjs.js","names":["utils","solid_ui","isJavaScriptFile","resource","getResourceAccessState","access","getCreationNoun","paneName","getPaneLabel","pane","noun","getContainerMemberCountLabel","memberCount","getCreationPanes","panes","getCreationDialogText","displayLabel","paneLabel","isContainerResource","resourceLogic","isAccessDeniedError","response","error","getIndexedContainer","match","getIndexedApplicationSubject","container","getResourcesForContainer","labeledResources","allContainedResources","other","containedResource","index","containerUri"],"sources":["../src/helpers.ts"],"sourcesContent":["import type { NamedNode } from 'rdflib'\nimport { utils } from 'solid-ui'\nimport type { ResourceLogic } from 'solid-logic'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { ResourceMap } from './types'\n\nexport type FolderPaneResourceLogic = Pick<\n ResourceLogic,\n 'getContainerMembers' | 'isHiddenFile' | 'isContainer' | 'containerHasIndexDocument' | 'getContainerIndexThing'\n>\n\nfunction isJavaScriptFile (resource: NamedNode): boolean {\n return /\\.[cm]?js$/i.test(new URL(resource.uri).pathname)\n}\n\ntype ResourceAccessMetadata = { isPublic?: boolean, isPublicKnown?: boolean }\n\nfunction getResourceAccessState (access: ResourceAccessMetadata): 'public' | 'private' | 'unknown' {\n if (access.isPublicKnown === false) return 'unknown'\n return access.isPublic ? 'public' : 'private'\n}\n\nfunction getCreationNoun (paneName?: string): string {\n if (paneName?.toLowerCase() === 'source') return 'file'\n return paneName || 'item'\n}\n\nfunction getPaneLabel (pane: Pick<PaneDefinition, 'name' | 'mintClass'>): string {\n if (pane.mintClass) return utils.label(pane.mintClass)\n const noun = getCreationNoun(pane.name)\n return noun.charAt(0).toUpperCase() + noun.slice(1)\n}\n\nfunction getContainerMemberCountLabel (memberCount: number): string {\n return `${memberCount} ${memberCount === 1 ? 'item' : 'items'}`\n}\n\nfunction getCreationPanes (panes: PaneDefinition[]): PaneDefinition[] {\n // Keep pane-registry order: it is also the pane priority order.\n return panes.filter(pane => !!pane.mintNew && pane.name?.toLowerCase() !== 'chat')\n}\n\nfunction getCreationDialogText (paneLabel = 'Container'): { title: string, placeholder: string } {\n const displayLabel = paneLabel.charAt(0).toUpperCase() + paneLabel.slice(1)\n return {\n title: `New ${displayLabel}`,\n placeholder: `Enter ${displayLabel} name`\n }\n}\n\nfunction isContainerResource (resource: NamedNode, resourceLogic: FolderPaneResourceLogic): boolean {\n return resource.uri.endsWith('/') || (!isJavaScriptFile(resource) && resourceLogic.isContainer(resource))\n}\n\nfunction isAccessDeniedError (error: unknown): boolean {\n const response = typeof error === 'object' && error !== null\n ? error as { status?: number, response?: { status?: number } }\n : undefined\n return response?.status === 401 || response?.status === 403 ||\n response?.response?.status === 401 || response?.response?.status === 403\n}\n\n/**\n * A pane's `index.ttl#this` stands for its container: return that container so\n * routing can render the pane without the file-explorer header.\n */\nfunction getIndexedContainer (resource: NamedNode): string | null {\n const match = /^(.*\\/)index\\.ttl#this$/.exec(resource.uri)\n return match ? match[1] : null\n}\n\nfunction getIndexedApplicationSubject (container: NamedNode, paneName?: string): string {\n return paneName?.toLowerCase() === 'schedule'\n ? `${container.uri}details.ttl#event`\n : `${container.uri}index.ttl#this`\n}\n\nfunction getResourcesForContainer (container: NamedNode, resourceLogic: FolderPaneResourceLogic | null): ResourceMap {\n if (!resourceLogic) return new Map()\n\n const containedResources = resourceLogic.getContainerMembers(container).filter(\n (resource) => !resourceLogic.isHiddenFile(resource)\n ).filter((containedResource, index, allContainedResources) => {\n return allContainedResources.findIndex(other => other.sameTerm(containedResource)) === index\n }).filter((resource) => {\n const containerUri = container.uri.endsWith('/') ? container.uri : `${container.uri}/`\n return resource.uri !== `${containerUri}index.ttl#this`\n })\n const labeledResources: Array<[string, NamedNode]> = containedResources.map(containedResource => [\n utils.label(containedResource).toLowerCase(),\n containedResource\n ])\n labeledResources.sort()\n\n return new Map(labeledResources.map(([, resource]) => [resource.value, {\n id: resource.value,\n subject: resource,\n parentId: container.value,\n isContainer: isContainerResource(resource, resourceLogic)\n }]))\n}\n\nexport {\n getCreationNoun,\n getCreationPanes,\n getCreationDialogText,\n getContainerMemberCountLabel,\n getIndexedApplicationSubject,\n getIndexedContainer,\n getPaneLabel,\n getResourceAccessState,\n getResourcesForContainer,\n isAccessDeniedError,\n isContainerResource,\n isJavaScriptFile\n}\n"],"mappings":"A,0BAWA,SAASE,EAAkB,EAA8B,CACvD,MAAO,cAAc,KAAK,IAAI,IAAIC,EAAS,GAAG,CAAC,CAAC,QAAQ,CAC1D,CAIA,SAASC,EAAwB,EAAkE,CAEjG,OADIC,EAAO,gBAAkB,GAAc,UACpCA,EAAO,SAAW,SAAW,SACtC,CAEA,SAASC,EAAiB,EAA2B,CAEnD,OADIC,GAAU,YAAY,IAAM,SAAiB,OAC1CA,GAAY,MACrB,CAEA,SAASC,EAAc,EAA0D,CAC/E,GAAIC,EAAK,UAAW,OAAOT,EAAAA,MAAM,MAAMS,EAAK,SAAS,EACrD,IAAMC,EAAOJ,EAAgBG,EAAK,IAAI,EACtC,OAAOC,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY,EAAIA,EAAK,MAAM,CAAC,CACpD,CAEA,SAASC,EAA8B,EAA6B,CAClE,MAAO,GAAGC,EAAY,GAAGA,IAAgB,EAAI,OAAS,SACxD,CAEA,SAASC,EAAkB,EAA2C,CAEpE,OAAOC,EAAM,OAAO,GAAQ,CAAC,CAACL,EAAK,SAAWA,EAAK,MAAM,YAAY,IAAM,MAAM,CACnF,CAEA,SAASM,EAAuB,EAAY,YAAqD,CAC/F,IAAMC,EAAeC,EAAU,OAAO,CAAC,CAAC,CAAC,YAAY,EAAIA,EAAU,MAAM,CAAC,EAC1E,MAAO,CACL,MAAO,OAAOD,IACd,YAAa,SAASA,EAAa,MACrC,CACF,CAEA,SAASE,EAAqB,EAAqB,EAAiD,CAClG,OAAOf,EAAS,IAAI,SAAS,GAAG,GAAM,CAACD,EAAiBC,CAAQ,GAAKgB,EAAc,YAAYhB,CAAQ,CACzG,CAEA,SAASiB,EAAqB,EAAyB,CACrD,IAAMC,EAAW,OAAOC,GAAU,UAAYA,EAC1CA,EACA,IAAA,GACJ,OAAOD,GAAU,SAAW,KAAOA,GAAU,SAAW,KACtDA,GAAU,UAAU,SAAW,KAAOA,GAAU,UAAU,SAAW,GACzE,CAMA,SAASE,EAAqB,EAAoC,CAChE,IAAMC,EAAQ,0BAA0B,KAAKrB,EAAS,GAAG,EACzD,OAAOqB,EAAQA,EAAM,GAAK,IAC5B,CAEA,SAASC,EAA8B,EAAsB,EAA2B,CACtF,OAAOlB,GAAU,YAAY,IAAM,WAC/B,GAAGmB,EAAU,IAAI,mBACjB,GAAGA,EAAU,IAAI,eACvB,CAEA,SAASC,EAA0B,EAAsB,EAA4D,CACnH,GAAI,CAACR,EAAe,OAAO,IAAI,IAU/B,IAAMS,EARqBT,EAAc,oBAAoBO,CAAS,CAAC,CAAC,OACrE,GAAa,CAACP,EAAc,aAAahB,CAAQ,CACpD,CAAC,CAAC,QAAQ,EAAmB,EAAO,IAC3B0B,EAAsB,UAAU,GAASC,EAAM,SAASC,CAAiB,CAAC,IAAMC,CACxF,CAAC,CAAC,OAAQ,GAAa,CACtB,IAAMC,EAAeP,EAAU,IAAI,SAAS,GAAG,EAAIA,EAAU,IAAM,GAAGA,EAAU,IAAI,GACpF,OAAOvB,EAAS,MAAQ,GAAG8B,EAAa,eAC1C,CACqD,CAAA,CAAmB,IAAI,GAAqB,CAC/FjC,EAAAA,MAAM,MAAM+B,CAAiB,CAAC,CAAC,YAAY,EAC3CA,CACF,CAAC,EAGD,OAFAH,EAAiB,KAAK,EAEf,IAAI,IAAIA,EAAiB,KAAK,EAAGzB,KAAc,CAACA,EAAS,MAAO,CACrE,GAAIA,EAAS,MACb,QAASA,EACT,SAAUuB,EAAU,MACpB,YAAaR,EAAoBf,EAAUgB,CAAa,CAC1D,CAAC,CAAC,CAAC,CACL,C"}
1
+ {"version":3,"file":"helpers.cjs.js","names":["utils","solid_ui","isJavaScriptFile","resource","isTurtleFile","isJsonFile","getResourceAccessState","access","readStoredWacAllow","header","wacAllowValues","modes","entry","match","publicModes","getCreationNoun","paneName","getPaneLabel","pane","noun","getContainerMemberCountLabel","memberCount","getCreationPanes","panes","getCreationDialogText","displayLabel","paneLabel","isContainerResource","resourceLogic","isAccessDeniedError","response","error","getIndexedContainer","getIndexedApplicationSubject","container","getResourcesForContainer","labeledResources","allContainedResources","other","containedResource","index","containerUri"],"sources":["../src/helpers.ts"],"sourcesContent":["import type { NamedNode } from 'rdflib'\nimport { utils } from 'solid-ui'\nimport type { ResourceLogic } from 'solid-logic'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { ResourceMap } from './types'\n\nexport type FolderPaneResourceLogic = Pick<\n ResourceLogic,\n 'getContainerMembers' | 'isHiddenFile' | 'isContainer' | 'containerHasIndexDocument' | 'getContainerIndexThing'\n>\n\nfunction isJavaScriptFile (resource: NamedNode): boolean {\n return /\\.[cm]?js$/i.test(new URL(resource.uri).pathname)\n}\n\nfunction isTurtleFile (resource: NamedNode): boolean {\n return /\\.ttl$/i.test(new URL(resource.uri).pathname)\n}\n\nfunction isJsonFile (resource: NamedNode): boolean {\n return /\\.json$/i.test(new URL(resource.uri).pathname)\n}\n\ntype ResourceAccessMetadata = { isPublic?: boolean, isPublicKnown?: boolean }\n\nfunction getResourceAccessState (access: ResourceAccessMetadata): 'public' | 'private' | 'unknown' {\n if (access.isPublicKnown === false) return 'unknown'\n return access.isPublic ? 'public' : 'private'\n}\n\n/**\n * Reads access from the WAC-Allow header of a stored response, so a resource\n * already loaded with GET does not need a separate HEAD.\n * Returns undefined when no stored header is available.\n */\nfunction readStoredWacAllow (wacAllowValues: string[] | undefined): { isPublic: boolean, canManageAccess: boolean } | undefined {\n const header = wacAllowValues?.filter(Boolean).join(',')\n if (!header) return undefined\n const modes = new Map<string, string[]>()\n for (const entry of header.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) modes.set(match[1].toLowerCase(), match[2].toLowerCase().split(/\\s+/).filter(Boolean))\n }\n const publicModes = modes.get('public') ?? []\n return {\n isPublic: publicModes.includes('read') || publicModes.includes('write'),\n canManageAccess: (modes.get('user') ?? []).includes('control')\n }\n}\n\nfunction getCreationNoun (paneName?: string): string {\n if (paneName?.toLowerCase() === 'source') return 'file'\n return paneName || 'item'\n}\n\nfunction getPaneLabel (pane: Pick<PaneDefinition, 'name' | 'mintClass'>): string {\n if (pane.mintClass) return utils.label(pane.mintClass)\n const noun = getCreationNoun(pane.name)\n return noun.charAt(0).toUpperCase() + noun.slice(1)\n}\n\nfunction getContainerMemberCountLabel (memberCount: number): string {\n return `${memberCount} ${memberCount === 1 ? 'item' : 'items'}`\n}\n\nfunction getCreationPanes (panes: PaneDefinition[]): PaneDefinition[] {\n // Keep pane-registry order: it is also the pane priority order.\n return panes.filter(pane => !!pane.mintNew && pane.name?.toLowerCase() !== 'chat')\n}\n\nfunction getCreationDialogText (paneLabel = 'Container'): { title: string, placeholder: string } {\n const displayLabel = paneLabel.charAt(0).toUpperCase() + paneLabel.slice(1)\n return {\n title: `New ${displayLabel}`,\n placeholder: `Enter ${displayLabel} name`\n }\n}\n\nfunction isContainerResource (resource: NamedNode, resourceLogic: FolderPaneResourceLogic): boolean {\n return resource.uri.endsWith('/') ||\n (!isJavaScriptFile(resource) && !isTurtleFile(resource) && !isJsonFile(resource) && resourceLogic.isContainer(resource))\n}\n\nfunction isAccessDeniedError (error: unknown): boolean {\n const response = typeof error === 'object' && error !== null\n ? error as { status?: number, response?: { status?: number } }\n : undefined\n return response?.status === 401 || response?.status === 403 ||\n response?.response?.status === 401 || response?.response?.status === 403\n}\n\n/**\n * A pane's `index.ttl#this` stands for its container: return that container so\n * routing can render the pane without the file-explorer header.\n */\nfunction getIndexedContainer (resource: NamedNode): string | null {\n const match = /^(.*\\/)index\\.ttl#this$/.exec(resource.uri)\n return match ? match[1] : null\n}\n\nfunction getIndexedApplicationSubject (container: NamedNode, paneName?: string): string {\n return paneName?.toLowerCase() === 'schedule'\n ? `${container.uri}details.ttl#event`\n : `${container.uri}index.ttl#this`\n}\n\nfunction getResourcesForContainer (container: NamedNode, resourceLogic: FolderPaneResourceLogic | null): ResourceMap {\n if (!resourceLogic) return new Map()\n\n const containedResources = resourceLogic.getContainerMembers(container).filter(\n (resource) => !resourceLogic.isHiddenFile(resource)\n ).filter((containedResource, index, allContainedResources) => {\n return allContainedResources.findIndex(other => other.sameTerm(containedResource)) === index\n }).filter((resource) => {\n const containerUri = container.uri.endsWith('/') ? container.uri : `${container.uri}/`\n return resource.uri !== `${containerUri}index.ttl#this`\n })\n const labeledResources: Array<[string, NamedNode]> = containedResources.map(containedResource => [\n utils.label(containedResource).toLowerCase(),\n containedResource\n ])\n labeledResources.sort()\n\n return new Map(labeledResources.map(([, resource]) => [resource.value, {\n id: resource.value,\n subject: resource,\n parentId: container.value,\n isContainer: isContainerResource(resource, resourceLogic)\n }]))\n}\n\nexport {\n getCreationNoun,\n getCreationPanes,\n getCreationDialogText,\n getContainerMemberCountLabel,\n getIndexedApplicationSubject,\n getIndexedContainer,\n getPaneLabel,\n getResourceAccessState,\n getResourcesForContainer,\n isAccessDeniedError,\n isContainerResource,\n isJavaScriptFile,\n isTurtleFile,\n isJsonFile,\n readStoredWacAllow\n}\n"],"mappings":"A,0BAWA,SAASE,EAAkB,EAA8B,CACvD,MAAO,cAAc,KAAK,IAAI,IAAIC,EAAS,GAAG,CAAC,CAAC,QAAQ,CAC1D,CAEA,SAASC,EAAc,EAA8B,CACnD,MAAO,UAAU,KAAK,IAAI,IAAID,EAAS,GAAG,CAAC,CAAC,QAAQ,CACtD,CAEA,SAASE,EAAY,EAA8B,CACjD,MAAO,WAAW,KAAK,IAAI,IAAIF,EAAS,GAAG,CAAC,CAAC,QAAQ,CACvD,CAIA,SAASG,EAAwB,EAAkE,CAEjG,OADIC,EAAO,gBAAkB,GAAc,UACpCA,EAAO,SAAW,SAAW,SACtC,CAOA,SAASC,EAAoB,EAAmG,CAC9H,IAAMC,EAASC,GAAgB,OAAO,OAAO,CAAC,CAAC,KAAK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AAS,MACb,QAASA,EACT,SAAU+B,EAAU,MACpB,YAAaP,EAAoBxB,EAAUyB,CAAa,CAC1D,CAAC,CAAC,CAAC,CACL,C"}
package/dist/helpers.d.ts CHANGED
@@ -4,11 +4,22 @@ import { PaneDefinition } from 'pane-registry';
4
4
  import { ResourceMap } from './types';
5
5
  export type FolderPaneResourceLogic = Pick<ResourceLogic, 'getContainerMembers' | 'isHiddenFile' | 'isContainer' | 'containerHasIndexDocument' | 'getContainerIndexThing'>;
6
6
  declare function isJavaScriptFile(resource: NamedNode): boolean;
7
+ declare function isTurtleFile(resource: NamedNode): boolean;
8
+ declare function isJsonFile(resource: NamedNode): boolean;
7
9
  type ResourceAccessMetadata = {
8
10
  isPublic?: boolean;
9
11
  isPublicKnown?: boolean;
10
12
  };
11
13
  declare function getResourceAccessState(access: ResourceAccessMetadata): 'public' | 'private' | 'unknown';
14
+ /**
15
+ * Reads access from the WAC-Allow header of a stored response, so a resource
16
+ * already loaded with GET does not need a separate HEAD.
17
+ * Returns undefined when no stored header is available.
18
+ */
19
+ declare function readStoredWacAllow(wacAllowValues: string[] | undefined): {
20
+ isPublic: boolean;
21
+ canManageAccess: boolean;
22
+ } | undefined;
12
23
  declare function getCreationNoun(paneName?: string): string;
13
24
  declare function getPaneLabel(pane: Pick<PaneDefinition, 'name' | 'mintClass'>): string;
14
25
  declare function getContainerMemberCountLabel(memberCount: number): string;
@@ -26,5 +37,5 @@ declare function isAccessDeniedError(error: unknown): boolean;
26
37
  declare function getIndexedContainer(resource: NamedNode): string | null;
27
38
  declare function getIndexedApplicationSubject(container: NamedNode, paneName?: string): string;
28
39
  declare function getResourcesForContainer(container: NamedNode, resourceLogic: FolderPaneResourceLogic | null): ResourceMap;
29
- export { getCreationNoun, getCreationPanes, getCreationDialogText, getContainerMemberCountLabel, getIndexedApplicationSubject, getIndexedContainer, getPaneLabel, getResourceAccessState, getResourcesForContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile };
40
+ export { getCreationNoun, getCreationPanes, getCreationDialogText, getContainerMemberCountLabel, getIndexedApplicationSubject, getIndexedContainer, getPaneLabel, getResourceAccessState, getResourcesForContainer, isAccessDeniedError, isContainerResource, isJavaScriptFile, isTurtleFile, isJsonFile, readStoredWacAllow };
30
41
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,aAAa,EACb,qBAAqB,GAAG,cAAc,GAAG,aAAa,GAAG,2BAA2B,GAAG,wBAAwB,CAChH,CAAA;AAED,iBAAS,gBAAgB,CAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,CAEvD;AAED,KAAK,sBAAsB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAE7E,iBAAS,sBAAsB,CAAE,MAAM,EAAE,sBAAsB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAGjG;AAED,iBAAS,eAAe,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED,iBAAS,YAAY,CAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,MAAM,CAI/E;AAED,iBAAS,4BAA4B,CAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,iBAAS,gBAAgB,CAAE,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAGpE;AAED,iBAAS,qBAAqB,CAAE,SAAS,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,CAItF;AAED,iBAAS,wBAAwB,CAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,GAAG,IAAI,GAAG,WAAW,CAuBnH;AAED,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,4BAA4B,EAC5B,4BAA4B,EAC5B,mBAAmB,EACnB,YAAY,EACZ,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,kBAAkB,EACnB,CAAA"}
@@ -4,44 +4,64 @@ function t(e) {
4
4
  return /\.[cm]?js$/i.test(new URL(e.uri).pathname);
5
5
  }
6
6
  function n(e) {
7
- return e.isPublicKnown === !1 ? "unknown" : e.isPublic ? "public" : "private";
7
+ return /\.ttl$/i.test(new URL(e.uri).pathname);
8
8
  }
9
9
  function r(e) {
10
+ return /\.json$/i.test(new URL(e.uri).pathname);
11
+ }
12
+ function i(e) {
13
+ return e.isPublicKnown === !1 ? "unknown" : e.isPublic ? "public" : "private";
14
+ }
15
+ function a(e) {
16
+ let t = e?.filter(Boolean).join(",");
17
+ if (!t) return;
18
+ let n = /* @__PURE__ */ new Map();
19
+ for (let e of t.split(",")) {
20
+ let t = e.trim().match(/^([A-Za-z]+)\s*=\s*"([^"]*)"$/);
21
+ t && n.set(t[1].toLowerCase(), t[2].toLowerCase().split(/\s+/).filter(Boolean));
22
+ }
23
+ let r = n.get("public") ?? [];
24
+ return {
25
+ isPublic: r.includes("read") || r.includes("write"),
26
+ canManageAccess: (n.get("user") ?? []).includes("control")
27
+ };
28
+ }
29
+ function o(e) {
10
30
  return e?.toLowerCase() === "source" ? "file" : e || "item";
11
31
  }
12
- function i(t) {
32
+ function s(t) {
13
33
  if (t.mintClass) return e.label(t.mintClass);
14
- let n = r(t.name);
34
+ let n = o(t.name);
15
35
  return n.charAt(0).toUpperCase() + n.slice(1);
16
36
  }
17
- function a(e) {
37
+ function c(e) {
18
38
  return `${e} ${e === 1 ? "item" : "items"}`;
19
39
  }
20
- function o(e) {
40
+ function l(e) {
21
41
  return e.filter((e) => !!e.mintNew && e.name?.toLowerCase() !== "chat");
22
42
  }
23
- function s(e = "Container") {
43
+ function u(e = "Container") {
24
44
  let t = e.charAt(0).toUpperCase() + e.slice(1);
25
45
  return {
26
46
  title: `New ${t}`,
27
47
  placeholder: `Enter ${t} name`
28
48
  };
29
49
  }
30
- function c(e, n) {
31
- return e.uri.endsWith("/") || !t(e) && n.isContainer(e);
50
+ function d(e, i) {
51
+ return e.uri.endsWith("/") || !t(e) && !n(e) && !r(e) && i.isContainer(e);
32
52
  }
33
- function l(e) {
53
+ function f(e) {
34
54
  let t = typeof e == "object" && e ? e : void 0;
35
55
  return t?.status === 401 || t?.status === 403 || t?.response?.status === 401 || t?.response?.status === 403;
36
56
  }
37
- function u(e) {
57
+ function p(e) {
38
58
  let t = /^(.*\/)index\.ttl#this$/.exec(e.uri);
39
59
  return t ? t[1] : null;
40
60
  }
41
- function d(e, t) {
61
+ function m(e, t) {
42
62
  return t?.toLowerCase() === "schedule" ? `${e.uri}details.ttl#event` : `${e.uri}index.ttl#this`;
43
63
  }
44
- function f(t, n) {
64
+ function h(t, n) {
45
65
  if (!n) return /* @__PURE__ */ new Map();
46
66
  let r = n.getContainerMembers(t).filter((e) => !n.isHiddenFile(e)).filter((e, t, n) => n.findIndex((t) => t.sameTerm(e)) === t).filter((e) => {
47
67
  let n = t.uri.endsWith("/") ? t.uri : `${t.uri}/`;
@@ -51,9 +71,9 @@ function f(t, n) {
51
71
  id: e.value,
52
72
  subject: e,
53
73
  parentId: t.value,
54
- isContainer: c(e, n)
74
+ isContainer: d(e, n)
55
75
  }]));
56
76
  }
57
- export { a as getContainerMemberCountLabel, s as getCreationDialogText, r as getCreationNoun, o as getCreationPanes, d as getIndexedApplicationSubject, u as getIndexedContainer, i as getPaneLabel, n as getResourceAccessState, f as getResourcesForContainer, l as isAccessDeniedError, c as isContainerResource, t as isJavaScriptFile };
77
+ export { c as getContainerMemberCountLabel, u as getCreationDialogText, o as getCreationNoun, l as getCreationPanes, m as getIndexedApplicationSubject, p as getIndexedContainer, s as getPaneLabel, i as getResourceAccessState, h as getResourcesForContainer, f as isAccessDeniedError, d as isContainerResource, t as isJavaScriptFile, r as isJsonFile, n as isTurtleFile, a as readStoredWacAllow };
58
78
 
59
79
  //# sourceMappingURL=helpers.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.esm.js","names":["isJavaScriptFile","resource","getResourceAccessState","access","getCreationNoun","paneName","getPaneLabel","pane","utils","noun","getContainerMemberCountLabel","memberCount","getCreationPanes","panes","getCreationDialogText","displayLabel","paneLabel","isContainerResource","resourceLogic","isAccessDeniedError","response","error","getIndexedContainer","match","getIndexedApplicationSubject","container","getResourcesForContainer","labeledResources","allContainedResources","other","containedResource","index","containerUri"],"sources":["../src/helpers.ts"],"sourcesContent":["import type { NamedNode } from 'rdflib'\nimport { utils } from 'solid-ui'\nimport type { ResourceLogic } from 'solid-logic'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { ResourceMap } from './types'\n\nexport type FolderPaneResourceLogic = Pick<\n ResourceLogic,\n 'getContainerMembers' | 'isHiddenFile' | 'isContainer' | 'containerHasIndexDocument' | 'getContainerIndexThing'\n>\n\nfunction isJavaScriptFile (resource: NamedNode): boolean {\n return /\\.[cm]?js$/i.test(new URL(resource.uri).pathname)\n}\n\ntype ResourceAccessMetadata = { isPublic?: boolean, isPublicKnown?: boolean }\n\nfunction getResourceAccessState (access: ResourceAccessMetadata): 'public' | 'private' | 'unknown' {\n if (access.isPublicKnown === false) return 'unknown'\n return access.isPublic ? 'public' : 'private'\n}\n\nfunction getCreationNoun (paneName?: string): string {\n if (paneName?.toLowerCase() === 'source') return 'file'\n return paneName || 'item'\n}\n\nfunction getPaneLabel (pane: Pick<PaneDefinition, 'name' | 'mintClass'>): string {\n if (pane.mintClass) return utils.label(pane.mintClass)\n const noun = getCreationNoun(pane.name)\n return noun.charAt(0).toUpperCase() + noun.slice(1)\n}\n\nfunction getContainerMemberCountLabel (memberCount: number): string {\n return `${memberCount} ${memberCount === 1 ? 'item' : 'items'}`\n}\n\nfunction getCreationPanes (panes: PaneDefinition[]): PaneDefinition[] {\n // Keep pane-registry order: it is also the pane priority order.\n return panes.filter(pane => !!pane.mintNew && pane.name?.toLowerCase() !== 'chat')\n}\n\nfunction getCreationDialogText (paneLabel = 'Container'): { title: string, placeholder: string } {\n const displayLabel = paneLabel.charAt(0).toUpperCase() + paneLabel.slice(1)\n return {\n title: `New ${displayLabel}`,\n placeholder: `Enter ${displayLabel} name`\n }\n}\n\nfunction isContainerResource (resource: NamedNode, resourceLogic: FolderPaneResourceLogic): boolean {\n return resource.uri.endsWith('/') || (!isJavaScriptFile(resource) && resourceLogic.isContainer(resource))\n}\n\nfunction isAccessDeniedError (error: unknown): boolean {\n const response = typeof error === 'object' && error !== null\n ? error as { status?: number, response?: { status?: number } }\n : undefined\n return response?.status === 401 || response?.status === 403 ||\n response?.response?.status === 401 || response?.response?.status === 403\n}\n\n/**\n * A pane's `index.ttl#this` stands for its container: return that container so\n * routing can render the pane without the file-explorer header.\n */\nfunction getIndexedContainer (resource: NamedNode): string | null {\n const match = /^(.*\\/)index\\.ttl#this$/.exec(resource.uri)\n return match ? match[1] : null\n}\n\nfunction getIndexedApplicationSubject (container: NamedNode, paneName?: string): string {\n return paneName?.toLowerCase() === 'schedule'\n ? `${container.uri}details.ttl#event`\n : `${container.uri}index.ttl#this`\n}\n\nfunction getResourcesForContainer (container: NamedNode, resourceLogic: FolderPaneResourceLogic | null): ResourceMap {\n if (!resourceLogic) return new Map()\n\n const containedResources = resourceLogic.getContainerMembers(container).filter(\n (resource) => !resourceLogic.isHiddenFile(resource)\n ).filter((containedResource, index, allContainedResources) => {\n return allContainedResources.findIndex(other => other.sameTerm(containedResource)) === index\n }).filter((resource) => {\n const containerUri = container.uri.endsWith('/') ? container.uri : `${container.uri}/`\n return resource.uri !== `${containerUri}index.ttl#this`\n })\n const labeledResources: Array<[string, NamedNode]> = containedResources.map(containedResource => [\n utils.label(containedResource).toLowerCase(),\n containedResource\n ])\n labeledResources.sort()\n\n return new Map(labeledResources.map(([, resource]) => [resource.value, {\n id: resource.value,\n subject: resource,\n parentId: container.value,\n isContainer: isContainerResource(resource, resourceLogic)\n }]))\n}\n\nexport {\n getCreationNoun,\n getCreationPanes,\n getCreationDialogText,\n getContainerMemberCountLabel,\n getIndexedApplicationSubject,\n getIndexedContainer,\n getPaneLabel,\n getResourceAccessState,\n getResourcesForContainer,\n isAccessDeniedError,\n isContainerResource,\n isJavaScriptFile\n}\n"],"mappings":";;AAWA,SAASA,EAAkB,GAA8B;CACvD,OAAO,cAAc,KAAK,IAAI,IAAIC,EAAS,GAAG,CAAC,CAAC,QAAQ;AAC1D;AAIA,SAASC,EAAwB,GAAkE;CAEjG,OADIC,EAAO,kBAAkB,KAAc,YACpCA,EAAO,WAAW,WAAW;AACtC;AAEA,SAASC,EAAiB,GAA2B;CAEnD,OADIC,GAAU,YAAY,MAAM,WAAiB,SAC1CA,KAAY;AACrB;AAEA,SAASC,EAAc,GAA0D;CAC/E,IAAIC,EAAK,WAAW,OAAOC,EAAM,MAAMD,EAAK,SAAS;CACrD,IAAME,IAAOL,EAAgBG,EAAK,IAAI;CACtC,OAAOE,EAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAK,MAAM,CAAC;AACpD;AAEA,SAASC,EAA8B,GAA6B;CAClE,OAAO,GAAGC,EAAY,GAAGA,MAAgB,IAAI,SAAS;AACxD;AAEA,SAASC,EAAkB,GAA2C;CAEpE,OAAOC,EAAM,QAAO,MAAQ,CAAC,CAACN,EAAK,WAAWA,EAAK,MAAM,YAAY,MAAM,MAAM;AACnF;AAEA,SAASO,EAAuB,IAAY,aAAqD;CAC/F,IAAMC,IAAeC,EAAU,OAAO,CAAC,CAAC,CAAC,YAAY,IAAIA,EAAU,MAAM,CAAC;CAC1E,OAAO;EACL,OAAO,OAAOD;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,IAAIA,EAAS;EACb,SAASA;EACT,UAAUwB,EAAU;EACpB,aAAaR,EAAoBhB,GAAUiB,CAAa;CAC1D,CAAC,CAAC,CAAC;AACL"}
1
+ {"version":3,"file":"helpers.esm.js","names":["isJavaScriptFile","resource","isTurtleFile","isJsonFile","getResourceAccessState","access","readStoredWacAllow","header","wacAllowValues","modes","entry","match","publicModes","getCreationNoun","paneName","getPaneLabel","pane","utils","noun","getContainerMemberCountLabel","memberCount","getCreationPanes","panes","getCreationDialogText","displayLabel","paneLabel","isContainerResource","resourceLogic","isAccessDeniedError","response","error","getIndexedContainer","getIndexedApplicationSubject","container","getResourcesForContainer","labeledResources","allContainedResources","other","containedResource","index","containerUri"],"sources":["../src/helpers.ts"],"sourcesContent":["import type { NamedNode } from 'rdflib'\nimport { utils } from 'solid-ui'\nimport type { ResourceLogic } from 'solid-logic'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { ResourceMap } from './types'\n\nexport type FolderPaneResourceLogic = Pick<\n ResourceLogic,\n 'getContainerMembers' | 'isHiddenFile' | 'isContainer' | 'containerHasIndexDocument' | 'getContainerIndexThing'\n>\n\nfunction isJavaScriptFile (resource: NamedNode): boolean {\n return /\\.[cm]?js$/i.test(new URL(resource.uri).pathname)\n}\n\nfunction isTurtleFile (resource: NamedNode): boolean {\n return /\\.ttl$/i.test(new URL(resource.uri).pathname)\n}\n\nfunction isJsonFile (resource: NamedNode): boolean {\n return /\\.json$/i.test(new URL(resource.uri).pathname)\n}\n\ntype ResourceAccessMetadata = { isPublic?: boolean, isPublicKnown?: boolean }\n\nfunction getResourceAccessState (access: ResourceAccessMetadata): 'public' | 'private' | 'unknown' {\n if (access.isPublicKnown === false) return 'unknown'\n return access.isPublic ? 'public' : 'private'\n}\n\n/**\n * Reads access from the WAC-Allow header of a stored response, so a resource\n * already loaded with GET does not need a separate HEAD.\n * Returns undefined when no stored header is available.\n */\nfunction readStoredWacAllow (wacAllowValues: string[] | undefined): { isPublic: boolean, canManageAccess: boolean } | undefined {\n const header = wacAllowValues?.filter(Boolean).join(',')\n if (!header) return undefined\n const modes = new Map<string, string[]>()\n for (const entry of header.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) modes.set(match[1].toLowerCase(), match[2].toLowerCase().split(/\\s+/).filter(Boolean))\n }\n const publicModes = modes.get('public') ?? []\n return {\n isPublic: publicModes.includes('read') || publicModes.includes('write'),\n canManageAccess: (modes.get('user') ?? []).includes('control')\n }\n}\n\nfunction getCreationNoun (paneName?: string): string {\n if (paneName?.toLowerCase() === 'source') return 'file'\n return paneName || 'item'\n}\n\nfunction getPaneLabel (pane: Pick<PaneDefinition, 'name' | 'mintClass'>): string {\n if (pane.mintClass) return utils.label(pane.mintClass)\n const noun = getCreationNoun(pane.name)\n return noun.charAt(0).toUpperCase() + noun.slice(1)\n}\n\nfunction getContainerMemberCountLabel (memberCount: number): string {\n return `${memberCount} ${memberCount === 1 ? 'item' : 'items'}`\n}\n\nfunction getCreationPanes (panes: PaneDefinition[]): PaneDefinition[] {\n // Keep pane-registry order: it is also the pane priority order.\n return panes.filter(pane => !!pane.mintNew && pane.name?.toLowerCase() !== 'chat')\n}\n\nfunction getCreationDialogText (paneLabel = 'Container'): { title: string, placeholder: string } {\n const displayLabel = paneLabel.charAt(0).toUpperCase() + paneLabel.slice(1)\n return {\n title: `New ${displayLabel}`,\n placeholder: `Enter ${displayLabel} name`\n }\n}\n\nfunction isContainerResource (resource: NamedNode, resourceLogic: FolderPaneResourceLogic): boolean {\n return resource.uri.endsWith('/') ||\n (!isJavaScriptFile(resource) && !isTurtleFile(resource) && !isJsonFile(resource) && resourceLogic.isContainer(resource))\n}\n\nfunction isAccessDeniedError (error: unknown): boolean {\n const response = typeof error === 'object' && error !== null\n ? error as { status?: number, response?: { status?: number } }\n : undefined\n return response?.status === 401 || response?.status === 403 ||\n response?.response?.status === 401 || response?.response?.status === 403\n}\n\n/**\n * A pane's `index.ttl#this` stands for its container: return that container so\n * routing can render the pane without the file-explorer header.\n */\nfunction getIndexedContainer (resource: NamedNode): string | null {\n const match = /^(.*\\/)index\\.ttl#this$/.exec(resource.uri)\n return match ? match[1] : null\n}\n\nfunction getIndexedApplicationSubject (container: NamedNode, paneName?: string): string {\n return paneName?.toLowerCase() === 'schedule'\n ? `${container.uri}details.ttl#event`\n : `${container.uri}index.ttl#this`\n}\n\nfunction getResourcesForContainer (container: NamedNode, resourceLogic: FolderPaneResourceLogic | null): ResourceMap {\n if (!resourceLogic) return new Map()\n\n const containedResources = resourceLogic.getContainerMembers(container).filter(\n (resource) => !resourceLogic.isHiddenFile(resource)\n ).filter((containedResource, index, allContainedResources) => {\n return allContainedResources.findIndex(other => other.sameTerm(containedResource)) === index\n }).filter((resource) => {\n const containerUri = container.uri.endsWith('/') ? container.uri : `${container.uri}/`\n return resource.uri !== `${containerUri}index.ttl#this`\n })\n const labeledResources: Array<[string, NamedNode]> = containedResources.map(containedResource => [\n utils.label(containedResource).toLowerCase(),\n containedResource\n ])\n labeledResources.sort()\n\n return new Map(labeledResources.map(([, resource]) => [resource.value, {\n id: resource.value,\n subject: resource,\n parentId: container.value,\n isContainer: isContainerResource(resource, resourceLogic)\n }]))\n}\n\nexport {\n getCreationNoun,\n getCreationPanes,\n getCreationDialogText,\n getContainerMemberCountLabel,\n getIndexedApplicationSubject,\n getIndexedContainer,\n getPaneLabel,\n getResourceAccessState,\n getResourcesForContainer,\n isAccessDeniedError,\n isContainerResource,\n isJavaScriptFile,\n isTurtleFile,\n isJsonFile,\n readStoredWacAllow\n}\n"],"mappings":";;AAWA,SAASA,EAAkB,GAA8B;CACvD,OAAO,cAAc,KAAK,IAAI,IAAIC,EAAS,GAAG,CAAC,CAAC,QAAQ;AAC1D;AAEA,SAASC,EAAc,GAA8B;CACnD,OAAO,UAAU,KAAK,IAAI,IAAID,EAAS,GAAG,CAAC,CAAC,QAAQ;AACtD;AAEA,SAASE,EAAY,GAA8B;CACjD,OAAO,WAAW,KAA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,GAAGuC,EAAa;CAC1C,CACqD,CAAA,CAAmB,KAAI,MAAqB,CAC/FvB,EAAM,MAAMqB,CAAiB,CAAC,CAAC,YAAY,GAC3CA,CACF,CAAC;CAGD,OAFAH,EAAiB,KAAK,GAEf,IAAI,IAAIA,EAAiB,KAAK,GAAGlC,OAAc,CAACA,EAAS,OAAO;EACrE,IAAIA,EAAS;EACb,SAASA;EACT,UAAUgC,EAAU;EACpB,aAAaP,EAAoBzB,GAAU0B,CAAa;CAC1D,CAAC,CAAC,CAAC;AACL"}
@@ -0,0 +1,2 @@
1
+ var e=(0,require("@lit/context").createContext)(Symbol(`folder-pane`));exports.folderPaneContext=e;
2
+ //# sourceMappingURL=context.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.cjs.js","names":["createContext","folderPaneContext"],"sources":["../../src/primitives/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport type { NamedNode } from 'rdflib'\n\nexport type FolderPaneViewMode = 'grid' | 'list'\n\nexport interface FolderPaneContext {\n rootResource: NamedNode | undefined\n displayedResource: NamedNode | undefined\n activeContainer: NamedNode | undefined\n view: FolderPaneViewMode\n searchQuery: string\n canCreate: boolean\n}\n\nexport const folderPaneContext = createContext<FolderPaneContext>(Symbol('folder-pane'))\n"],"mappings":"AAcA,IAAaC,GAAA,E,sBAAoBD,CAAAA,CAAAA,cAAAA,CAAiC,OAAO,aAAa,CAAC,E"}
@@ -0,0 +1,14 @@
1
+ import { NamedNode } from 'rdflib';
2
+ export type FolderPaneViewMode = 'grid' | 'list';
3
+ export interface FolderPaneContext {
4
+ rootResource: NamedNode | undefined;
5
+ displayedResource: NamedNode | undefined;
6
+ activeContainer: NamedNode | undefined;
7
+ view: FolderPaneViewMode;
8
+ searchQuery: string;
9
+ canCreate: boolean;
10
+ }
11
+ export declare const folderPaneContext: {
12
+ __context__: FolderPaneContext;
13
+ };
14
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/primitives/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,CAAA;AAEhD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,SAAS,GAAG,SAAS,CAAA;IACnC,iBAAiB,EAAE,SAAS,GAAG,SAAS,CAAA;IACxC,eAAe,EAAE,SAAS,GAAG,SAAS,CAAA;IACtC,IAAI,EAAE,kBAAkB,CAAA;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,iBAAiB;;CAA0D,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { createContext as e } from "@lit/context";
2
+ // src/primitives/context.ts
3
+ var t = e(Symbol("folder-pane"));
4
+ export { t as folderPaneContext };
5
+
6
+ //# sourceMappingURL=context.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.esm.js","names":["folderPaneContext","createContext"],"sources":["../../src/primitives/context.ts"],"sourcesContent":["import { createContext } from '@lit/context'\nimport type { NamedNode } from 'rdflib'\n\nexport type FolderPaneViewMode = 'grid' | 'list'\n\nexport interface FolderPaneContext {\n rootResource: NamedNode | undefined\n displayedResource: NamedNode | undefined\n activeContainer: NamedNode | undefined\n view: FolderPaneViewMode\n searchQuery: string\n canCreate: boolean\n}\n\nexport const folderPaneContext = createContext<FolderPaneContext>(Symbol('folder-pane'))\n"],"mappings":";;AAcA,IAAaA,IAAoBC,EAAiC,OAAO,aAAa,CAAC"}
@@ -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)}var r=new Set([998,999]),i=/Failed to fetch|NetworkError|Load failed|network failure/i;function a(e){let n=t(e),a=n?.status??n?.response?.status;return a!==void 0&&r.has(a)?!0:e instanceof Error&&i.test(e.message)}function o(e){return n(e)||a(e)}function s(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 c({concurrency:t=4,maxRetries:n=2,defaultRetryAfterMs:r=1e4,wait:i=e=>new Promise(t=>setTimeout(t,e))}={}){let a=[],c=0,l,u=0,d=0,f=0;function p(){if(!l)for(;c<t&&a.length>0;){let e=a.shift();c++,m(e,f)}}async function m(e,t){try{e.resolve(await e.task())}catch(i){t===f&&o(i)?(h(s(i,r)),e.retries<n?(e.retries++,a.unshift(e)):e.reject(i)):e.reject(i)}finally{c--,p()}}function h(e){let t=f,n=Date.now()+e;if(n<=u)return;u=n;let r=++d;l=i(e).then(()=>{t===f&&r===d&&(l=void 0,u=0,p())})}return{run(e){return new Promise((t,n)=>{a.push({task:e,resolve:t,reject:n,retries:0}),p()})},clear(){f++,l=void 0,u=0,d++;let t=a;a=[];for(let n of t)n.reject(new e)}}}exports.RequestQueueClearedError=e,exports.createRequestQueue=c,exports.getRetryAfterMs=s,exports.isNetworkFailureError=a,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","NETWORK_FAILURE_STATUSES","NETWORK_FAILURE_MESSAGE","isNetworkFailureError","status","shouldBackOff","getRetryAfterMs","headers","value","fallbackMs","seconds","date","now","createRequestQueue","resolve","ms","pending","active","pausedUntil","pauseDeadline","pauseToken","generation","pump","concurrency","item","execute","taskGeneration","pause","defaultRetryAfterMs","maxRetries","pauseGeneration","requestedDeadline","token","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 or the\n * request fails at the network level (see isNetworkFailureError).\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\nconst NETWORK_FAILURE_STATUSES = new Set([998, 999])\nconst NETWORK_FAILURE_MESSAGE = /Failed to fetch|NetworkError|Load failed|network failure/i\n\n/**\n * A rate limiter in front of a cross-origin pod (such as Cloudflare) answers\n * the CORS preflight with a 429 that carries no CORS headers. The browser then\n * hides the status and reports a network error, which rdflib turns into a\n * fake 999 status, so such failures have to be treated as possible 429s.\n */\nfunction isNetworkFailureError (error: unknown): boolean {\n const response = getErrorResponse(error)\n const status = response?.status ?? response?.response?.status\n if (status !== undefined && NETWORK_FAILURE_STATUSES.has(status)) return true\n return error instanceof Error && NETWORK_FAILURE_MESSAGE.test(error.message)\n}\n\nfunction shouldBackOff (error: unknown): boolean {\n return isRateLimitedError(error) || isNetworkFailureError(error)\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 pauseDeadline = 0\n let pauseToken = 0\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 && shouldBackOff(error)) {\n pause(getRetryAfterMs(error, defaultRetryAfterMs))\n if (item.retries < maxRetries) {\n item.retries++\n // Retry first so it is not overtaken by tasks queued after it.\n pending.unshift(item)\n } else {\n item.reject(error)\n }\n } else {\n item.reject(error)\n }\n } finally {\n active--\n pump()\n }\n }\n\n function pause (ms: number) {\n const pauseGeneration = generation\n const requestedDeadline = Date.now() + ms\n if (requestedDeadline <= pauseDeadline) return\n pauseDeadline = requestedDeadline\n const token = ++pauseToken\n pausedUntil = wait(ms).then(() => {\n if (pauseGeneration !== generation || token !== pauseToken) return\n pausedUntil = undefined\n pauseDeadline = 0\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 pauseDeadline = 0\n pauseToken++\n const cleared = pending\n pending = []\n for (const item of cleared) item.reject(new RequestQueueClearedError())\n }\n }\n}\n\nexport { createRequestQueue, getRetryAfterMs, isNetworkFailureError, isRateLimitedError }\n"],"mappings":"AAUA,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,CAEA,IAAMG,EAA2B,IAAI,IAAI,CAAC,IAAK,GAAG,CAAC,EAC7CC,EAA0B,4DAQhC,SAASC,EAAuB,EAAyB,CACvD,IAAMH,EAAWH,EAAiBC,CAAK,EACjCM,EAASJ,GAAU,QAAUA,GAAU,UAAU,OAEvD,OADII,IAAW,IAAA,IAAaH,EAAyB,IAAIG,CAAM,EAAU,GAClEN,aAAiB,OAASI,EAAwB,KAAKJ,EAAM,OAAO,CAC7E,CAEA,SAASO,EAAe,EAAyB,CAC/C,OAAON,EAAmBD,CAAK,GAAKK,EAAsBL,CAAK,CACjE,CAMA,SAASQ,EAAiB,EAAgB,EAAoB,EAAM,KAAK,IAAI,EAAW,CACtF,IAAMN,EAAWH,EAAiBC,CAAK,EACjCS,EAAUP,GAAU,SAAWA,GAAU,UAAU,QACnDQ,EAAQ,OAAOD,GAAS,KAAQ,WAAaA,EAAQ,IAAI,aAAa,EAAI,KAChF,GAAI,CAACC,EAAO,OAAOC,EACnB,IAAMC,EAAU,OAAO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H,CAEA,MAAO,CACL,IAAQ,EAAoC,CAC1C,OAAO,IAAI,SAAY,EAAS,IAAW,CACzCN,EAAQ,KAAK,CAAE,OAAe,UAAqC,SAAQ,QAAS,CAAE,CAAC,EACvFM,EAAK,CACP,CAAC,CACH,EACA,OAAS,CACP,IACA,EAAc,IAAA,GACd,EAAgB,EAChB,IACA,IAAMY,EAAUlB,EAChB,EAAU,CAAC,EACX,IAAK,IAAMQ,KAAQU,EAASV,EAAK,OAAO,IAAI5B,CAA0B,CACxE,CACF,CACF,C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Limits how many advisory requests (member counts, access indicators) a
3
+ * folder view sends at once, and backs off when the server answers 429 or the
4
+ * request fails at the network level (see isNetworkFailureError).
5
+ *
6
+ * Opening a folder used to fetch every child immediately. Each browser request
7
+ * also needs a CORS preflight, so a folder with a few dozen children could
8
+ * exceed per-IP rate limits such as Cloudflare's and leave counts missing.
9
+ */
10
+ export declare class RequestQueueClearedError extends Error {
11
+ constructor();
12
+ }
13
+ type RequestQueueOptions = {
14
+ concurrency?: number;
15
+ maxRetries?: number;
16
+ defaultRetryAfterMs?: number;
17
+ wait?: (ms: number) => Promise<void>;
18
+ };
19
+ export type RequestQueue = {
20
+ run: <T>(task: () => Promise<T>) => Promise<T>;
21
+ clear: () => void;
22
+ };
23
+ declare function isRateLimitedError(error: unknown): boolean;
24
+ /**
25
+ * A rate limiter in front of a cross-origin pod (such as Cloudflare) answers
26
+ * the CORS preflight with a 429 that carries no CORS headers. The browser then
27
+ * hides the status and reports a network error, which rdflib turns into a
28
+ * fake 999 status, so such failures have to be treated as possible 429s.
29
+ */
30
+ declare function isNetworkFailureError(error: unknown): boolean;
31
+ /**
32
+ * Returns the delay requested by a 429's Retry-After header (seconds or an
33
+ * HTTP date), or `fallbackMs` when it is missing or unreadable.
34
+ */
35
+ declare function getRetryAfterMs(error: unknown, fallbackMs: number, now?: number): number;
36
+ declare function createRequestQueue({ concurrency, maxRetries, defaultRetryAfterMs, wait }?: RequestQueueOptions): RequestQueue;
37
+ export { createRequestQueue, getRetryAfterMs, isNetworkFailureError, isRateLimitedError };
38
+ //# sourceMappingURL=requestQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestQueue.d.ts","sourceRoot":"","sources":["../src/requestQueue.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;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;AAKD;;;;;GAKG;AACH,iBAAS,qBAAqB,CAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAKvD;AAMD;;;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,CAsEzC;AAED,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,CAAA"}
@@ -0,0 +1,77 @@
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
+ var r = /* @__PURE__ */ new Set([998, 999]), i = /Failed to fetch|NetworkError|Load failed|network failure/i;
15
+ function a(e) {
16
+ let n = t(e), a = n?.status ?? n?.response?.status;
17
+ return a !== void 0 && r.has(a) ? !0 : e instanceof Error && i.test(e.message);
18
+ }
19
+ function o(e) {
20
+ return n(e) || a(e);
21
+ }
22
+ function s(e, n, r = Date.now()) {
23
+ let i = t(e), a = i?.headers ?? i?.response?.headers, o = typeof a?.get == "function" ? a.get("retry-after") : null;
24
+ if (!o) return n;
25
+ let s = Number(o);
26
+ if (Number.isFinite(s)) return Math.max(0, s * 1e3);
27
+ let c = Date.parse(o);
28
+ return Number.isNaN(c) ? n : Math.max(0, c - r);
29
+ }
30
+ function c({ concurrency: t = 4, maxRetries: n = 2, defaultRetryAfterMs: r = 1e4, wait: i = (e) => new Promise((t) => setTimeout(t, e)) } = {}) {
31
+ let a = [], c = 0, l, u = 0, d = 0, f = 0;
32
+ function p() {
33
+ if (!l) for (; c < t && a.length > 0;) {
34
+ let e = a.shift();
35
+ c++, m(e, f);
36
+ }
37
+ }
38
+ async function m(e, t) {
39
+ try {
40
+ e.resolve(await e.task());
41
+ } catch (i) {
42
+ t === f && o(i) ? (h(s(i, r)), e.retries < n ? (e.retries++, a.unshift(e)) : e.reject(i)) : e.reject(i);
43
+ } finally {
44
+ c--, p();
45
+ }
46
+ }
47
+ function h(e) {
48
+ let t = f, n = Date.now() + e;
49
+ if (n <= u) return;
50
+ u = n;
51
+ let r = ++d;
52
+ l = i(e).then(() => {
53
+ t === f && r === d && (l = void 0, u = 0, p());
54
+ });
55
+ }
56
+ return {
57
+ run(e) {
58
+ return new Promise((t, n) => {
59
+ a.push({
60
+ task: e,
61
+ resolve: t,
62
+ reject: n,
63
+ retries: 0
64
+ }), p();
65
+ });
66
+ },
67
+ clear() {
68
+ f++, l = void 0, u = 0, d++;
69
+ let t = a;
70
+ a = [];
71
+ for (let n of t) n.reject(new e());
72
+ }
73
+ };
74
+ }
75
+ export { e as RequestQueueClearedError, c as createRequestQueue, s as getRetryAfterMs, a as isNetworkFailureError, n as isRateLimitedError };
76
+
77
+ //# sourceMappingURL=requestQueue.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestQueue.esm.js","names":["RequestQueueClearedError","getErrorResponse","error","isRateLimitedError","response","NETWORK_FAILURE_STATUSES","NETWORK_FAILURE_MESSAGE","isNetworkFailureError","status","shouldBackOff","getRetryAfterMs","headers","value","fallbackMs","seconds","date","now","createRequestQueue","resolve","ms","pending","active","pausedUntil","pauseDeadline","pauseToken","generation","pump","concurrency","item","execute","taskGeneration","pause","defaultRetryAfterMs","maxRetries","pauseGeneration","requestedDeadline","token","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 or the\n * request fails at the network level (see isNetworkFailureError).\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\nconst NETWORK_FAILURE_STATUSES = new Set([998, 999])\nconst NETWORK_FAILURE_MESSAGE = /Failed to fetch|NetworkError|Load failed|network failure/i\n\n/**\n * A rate limiter in front of a cross-origin pod (such as Cloudflare) answers\n * the CORS preflight with a 429 that carries no CORS headers. The browser then\n * hides the status and reports a network error, which rdflib turns into a\n * fake 999 status, so such failures have to be treated as possible 429s.\n */\nfunction isNetworkFailureError (error: unknown): boolean {\n const response = getErrorResponse(error)\n const status = response?.status ?? response?.response?.status\n if (status !== undefined && NETWORK_FAILURE_STATUSES.has(status)) return true\n return error instanceof Error && NETWORK_FAILURE_MESSAGE.test(error.message)\n}\n\nfunction shouldBackOff (error: unknown): boolean {\n return isRateLimitedError(error) || isNetworkFailureError(error)\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 pauseDeadline = 0\n let pauseToken = 0\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 && shouldBackOff(error)) {\n pause(getRetryAfterMs(error, defaultRetryAfterMs))\n if (item.retries < maxRetries) {\n item.retries++\n // Retry first so it is not overtaken by tasks queued after it.\n pending.unshift(item)\n } else {\n item.reject(error)\n }\n } else {\n item.reject(error)\n }\n } finally {\n active--\n pump()\n }\n }\n\n function pause (ms: number) {\n const pauseGeneration = generation\n const requestedDeadline = Date.now() + ms\n if (requestedDeadline <= pauseDeadline) return\n pauseDeadline = requestedDeadline\n const token = ++pauseToken\n pausedUntil = wait(ms).then(() => {\n if (pauseGeneration !== generation || token !== pauseToken) return\n pausedUntil = undefined\n pauseDeadline = 0\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 pauseDeadline = 0\n pauseToken++\n const cleared = pending\n pending = []\n for (const item of cleared) item.reject(new RequestQueueClearedError())\n }\n }\n}\n\nexport { createRequestQueue, getRetryAfterMs, isNetworkFailureError, isRateLimitedError }\n"],"mappings":";AAUA,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;AACpF;AAEA,SAASC,EAAoB,GAAyB;CACpD,IAAMC,IAAWH,EAAiBC,CAAK;CAGvC,OAFIE,GAAU,WAAW,OAAOA,GAAU,UAAU,WAAW,OAExDF,aAAiB,SAAS,kBAAk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CAAU;EAC/B;CACF;CAEA,eAAeI,EAAS,GAAmB,GAAwB;EACjE,IAAI;GACF,EAAK,QAAQ,MAAMD,EAAK,KAAK,CAAC;EAChC,SAAS1B,GAAO;GACd,AAAI4B,MAAmBL,KAAchB,EAAcP,CAAK,KACtD6B,EAAMrB,EAAgBR,GAAO8B,CAAmB,CAAC,GAC7CJ,EAAK,UAAUK,KACjB,EAAK,WAELb,EAAQ,QAAQQ,CAAI,KAEpBA,EAAK,OAAO1B,CAAK,KAGnB0B,EAAK,OAAO1B,CAAK;EAErB,UAAU;GAER,AADA,KACAwB,EAAK;EACP;CACF;CAEA,SAASK,EAAO,GAAY;EAC1B,IAAMG,IAAkBT,GAClBU,IAAoB,KAAK,IAAI,IAAIhB;EACvC,IAAIgB,KAAqBZ,GAAe;EACxC,IAAgBY;EAChB,IAAMC,IAAQ,EAAEZ;EAChB,IAAca,EAAKlB,CAAE,CAAC,CAAC,WAAW;GAChC,AAAIe,MAAoBT,KAAcW,MAAUZ,MAChD,IAAc,KAAA,GACd,IAAgB,GAChBE,EAAK;EACP,CAAC;CACH;CAEA,OAAO;EACL,IAAQ,GAAoC;GAC1C,OAAO,IAAI,SAAY,GAAS,MAAW;IAEzC,AADAN,EAAQ,KAAK;KAAE;KAAe;KAAqC;KAAQ,SAAS;IAAE,CAAC,GACvFM,EAAK;GACP,CAAC;EACH;EACA,QAAS;GAIP,AAHA,KACA,IAAc,KAAA,GACd,IAAgB,GAChB;GACA,IAAMY,IAAUlB;GAChB,IAAU,CAAC;GACX,KAAK,IAAMQ,KAAQU,GAAS,EAAK,OAAO,IAAItC,EAAyB,CAAC;EACxE;CACF;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./helpers.cjs.js"),t=require("./debug.cjs.js");let n=require("solid-ui");async function r(r){let{resource:i,context:a,isCurrent:o}=r,s=a.session.store;try{await s.fetcher.load(i)}catch(e){t.warn(`Unable to preload resource for folder-pane action menu`,e)}if(!o())return;let c=i;if(r.isContainer&&r.resourceLogic?.containerHasIndexDocument(i)){c=s.sym(e.getIndexedApplicationSubject(i));try{await s.fetcher.load(c.doc())}catch(e){t.warn(`Unable to preload index document for folder-pane action menu`,e)}if(!o())return}let l=await(0,n.getRelevantPanes)(c,a,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`});if(!o())return;let u=(0,n.getPreferredPane)(c,a,l),d=l.filter(e=>e.name!==`folder`),f=u&&u.name!==`folder`?[u,...d.filter(e=>e!==u)]:d,p=r.includeFolderPane&&r.isContainer?u?.name===`folder`?[u,...d]:[...d,...l.filter(e=>e.name===`folder`)]:f,m=await(0,n.preparePaneMenuItems)({subject:c,context:a,panes:p,openPane:(e,t,n)=>r.openPane(t,n)});if(r.includeFolderPane){let e=m.find(e=>e.key===`folder`);e&&(e.label=`Contents`)}return o()?m:void 0}exports.loadResourcePaneMenuItems=r;
2
+ //# sourceMappingURL=resourceActionItems.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resourceActionItems.cjs.js","names":["getIndexedApplicationSubject","getRelevantPanes","getPreferredPane","preparePaneMenuItems","require_helpers","require_debug","solid_ui","loadResourcePaneMenuItems","options","store","context","resource","error","isCurrent","paneSubject","panes","preferredPane","nonFolderPanes","pane","orderedPanes","menuPanes","items","paneName","event","folderItem","item"],"sources":["../src/resourceActionItems.ts"],"sourcesContent":["import type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport { getPreferredPane, getRelevantPanes, preparePaneMenuItems } from 'solid-ui'\nimport type { PaneMenuItem, PaneMenuPane } from 'solid-ui'\nimport { getIndexedApplicationSubject, type FolderPaneResourceLogic } from './helpers'\nimport * as debug from './debug'\n\nexport type ResourcePaneMenuOptions = {\n resource: NamedNode\n isContainer: boolean\n context: DataBrowserContext\n resourceLogic?: Pick<FolderPaneResourceLogic, 'containerHasIndexDocument'> | null\n includeFolderPane?: boolean\n openPane: (paneName: string, event: Event) => void\n isCurrent: () => boolean\n}\n\n/**\n * Builds the pane entries for a resource's three-dots menu: the preferred\n * pane first, folder excluded, and indexed containers resolved to their\n * application subject. Returns undefined when the request became stale.\n */\nexport async function loadResourcePaneMenuItems (\n options: ResourcePaneMenuOptions\n): Promise<PaneMenuItem[] | undefined> {\n const { resource, context, isCurrent } = options\n const store = context.session.store\n try {\n await store.fetcher.load(resource)\n } catch (error) {\n debug.warn('Unable to preload resource for folder-pane action menu', error)\n }\n if (!isCurrent()) return undefined\n\n let paneSubject = resource\n if (options.isContainer && options.resourceLogic?.containerHasIndexDocument(resource)) {\n paneSubject = store.sym(getIndexedApplicationSubject(resource))\n try {\n await store.fetcher.load(paneSubject.doc())\n } catch (error) {\n debug.warn('Unable to preload index document for folder-pane action menu', error)\n }\n if (!isCurrent()) return undefined\n }\n\n const panes = await getRelevantPanes(paneSubject, context, {\n excludedPaneNames: ['sharing'],\n fallbackPaneName: 'internal'\n })\n if (!isCurrent()) return undefined\n\n const preferredPane = getPreferredPane(paneSubject, context, panes)\n const nonFolderPanes = panes.filter(pane => pane.name !== 'folder')\n const orderedPanes = preferredPane && preferredPane.name !== 'folder'\n ? [preferredPane, ...nonFolderPanes.filter(pane => pane !== preferredPane)]\n : nonFolderPanes\n const menuPanes = options.includeFolderPane && options.isContainer\n ? (preferredPane?.name === 'folder' ? [preferredPane, ...nonFolderPanes] : [...nonFolderPanes, ...panes.filter(pane => pane.name === 'folder')])\n : orderedPanes\n const items = await preparePaneMenuItems({\n subject: paneSubject,\n context,\n panes: menuPanes as PaneMenuPane[],\n openPane: (_subject, paneName, event) => options.openPane(paneName, event)\n })\n if (options.includeFolderPane) {\n const folderItem = items.find(item => item.key === 'folder')\n if (folderItem) folderItem.label = 'Contents'\n }\n return isCurrent() ? items : undefined\n}\n"],"mappings":"A,0FAsBA,eAAsBO,EACpB,EACqC,CACrC,GAAM,CAAE,WAAU,UAAS,aAAcC,EACnCC,EAAQC,EAAQ,QAAQ,MAC9B,GAAI,CACF,MAAMD,EAAM,QAAQ,KAAKE,CAAQ,CACnC,OA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,EAAIQ,EAAQ,IAAA,EAC/B,C"}
@@ -0,0 +1,20 @@
1
+ import { DataBrowserContext } from 'pane-registry';
2
+ import { NamedNode } from 'rdflib';
3
+ import { PaneMenuItem } from 'solid-ui';
4
+ import { FolderPaneResourceLogic } from './helpers';
5
+ export type ResourcePaneMenuOptions = {
6
+ resource: NamedNode;
7
+ isContainer: boolean;
8
+ context: DataBrowserContext;
9
+ resourceLogic?: Pick<FolderPaneResourceLogic, 'containerHasIndexDocument'> | null;
10
+ includeFolderPane?: boolean;
11
+ openPane: (paneName: string, event: Event) => void;
12
+ isCurrent: () => boolean;
13
+ };
14
+ /**
15
+ * Builds the pane entries for a resource's three-dots menu: the preferred
16
+ * pane first, folder excluded, and indexed containers resolved to their
17
+ * application subject. Returns undefined when the request became stale.
18
+ */
19
+ export declare function loadResourcePaneMenuItems(options: ResourcePaneMenuOptions): Promise<PaneMenuItem[] | undefined>;
20
+ //# sourceMappingURL=resourceActionItems.d.ts.map