solid-panes 5.0.0-1 → 5.1.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/README.md +67 -2
  2. package/dist/RDFXMLPane2.cjs.js.map +1 -1
  3. package/dist/RDFXMLPane2.esm.js.map +1 -1
  4. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +1 -1
  5. package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +1 -1
  6. package/dist/_virtual/~icons/lucide/cake.cjs.js +2 -0
  7. package/dist/_virtual/~icons/lucide/cake.cjs.js.map +1 -0
  8. package/dist/_virtual/~icons/lucide/cake.esm.js +11 -0
  9. package/dist/_virtual/~icons/lucide/cake.esm.js.map +1 -0
  10. package/dist/_virtual/~icons/lucide/camera.cjs.js +2 -0
  11. package/dist/_virtual/~icons/lucide/camera.cjs.js.map +1 -0
  12. package/dist/_virtual/~icons/lucide/camera.esm.js +11 -0
  13. package/dist/_virtual/~icons/lucide/camera.esm.js.map +1 -0
  14. package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js +2 -0
  15. package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js.map +1 -0
  16. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +11 -0
  17. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js.map +1 -0
  18. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +1 -1
  19. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +1 -1
  20. package/dist/_virtual/~icons/lucide/folder-open.cjs.js.map +1 -1
  21. package/dist/_virtual/~icons/lucide/folder-open.esm.js.map +1 -1
  22. package/dist/_virtual/~icons/lucide/folder.cjs.js.map +1 -1
  23. package/dist/_virtual/~icons/lucide/folder.esm.js.map +1 -1
  24. package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -1
  25. package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -1
  26. package/dist/_virtual/~icons/lucide/help-circle.cjs.js.map +1 -1
  27. package/dist/_virtual/~icons/lucide/help-circle.esm.js.map +1 -1
  28. package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js.map +1 -1
  29. package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js.map +1 -1
  30. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -1
  31. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -1
  32. package/dist/_virtual/~icons/lucide/mail.cjs.js +2 -0
  33. package/dist/_virtual/~icons/lucide/mail.cjs.js.map +1 -0
  34. package/dist/_virtual/~icons/lucide/mail.esm.js +11 -0
  35. package/dist/_virtual/~icons/lucide/mail.esm.js.map +1 -0
  36. package/dist/_virtual/~icons/lucide/map-pin.cjs.js +2 -0
  37. package/dist/_virtual/~icons/lucide/map-pin.cjs.js.map +1 -0
  38. package/dist/_virtual/~icons/lucide/map-pin.esm.js +11 -0
  39. package/dist/_virtual/~icons/lucide/map-pin.esm.js.map +1 -0
  40. package/dist/_virtual/~icons/lucide/pencil.cjs.js.map +1 -1
  41. package/dist/_virtual/~icons/lucide/pencil.esm.js.map +1 -1
  42. package/dist/_virtual/~icons/lucide/phone.cjs.js +2 -0
  43. package/dist/_virtual/~icons/lucide/phone.cjs.js.map +1 -0
  44. package/dist/_virtual/~icons/lucide/phone.esm.js +11 -0
  45. package/dist/_virtual/~icons/lucide/phone.esm.js.map +1 -0
  46. package/dist/_virtual/~icons/lucide/settings-2.cjs.js.map +1 -1
  47. package/dist/_virtual/~icons/lucide/settings-2.esm.js.map +1 -1
  48. package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +1 -1
  49. package/dist/_virtual/~icons/lucide/share-2.esm.js.map +1 -1
  50. package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +1 -1
  51. package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +1 -1
  52. package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js +2 -0
  53. package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js.map +1 -0
  54. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +11 -0
  55. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js.map +1 -0
  56. package/dist/_virtual/~icons/lucide/user.cjs.js.map +1 -1
  57. package/dist/_virtual/~icons/lucide/user.esm.js.map +1 -1
  58. package/dist/_virtual/~icons/lucide/users.cjs.js.map +1 -1
  59. package/dist/_virtual/~icons/lucide/users.esm.js.map +1 -1
  60. package/dist/_virtual/~icons/lucide/x.cjs.js +2 -0
  61. package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -0
  62. package/dist/_virtual/~icons/lucide/x.esm.js +11 -0
  63. package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -0
  64. package/dist/audio/audioPane.cjs.js +1 -1
  65. package/dist/audio/audioPane.cjs.js.map +1 -1
  66. package/dist/audio/audioPane.esm.js +1 -5
  67. package/dist/audio/audioPane.esm.js.map +1 -1
  68. package/dist/classInstancePane.cjs.js.map +1 -1
  69. package/dist/classInstancePane.esm.js.map +1 -1
  70. package/dist/components/editor-card/EditorCard.cjs.js +1 -1
  71. package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
  72. package/dist/components/editor-card/EditorCard.esm.js +4 -7
  73. package/dist/components/editor-card/EditorCard.esm.js.map +1 -1
  74. package/dist/components/editor-card/EditorCard.styles.cjs.js.map +1 -1
  75. package/dist/components/editor-card/EditorCard.styles.esm.js.map +1 -1
  76. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +1 -1
  77. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
  78. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +2 -2
  79. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -1
  80. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +1 -1
  81. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +1 -1
  82. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +1 -1
  83. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
  84. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +3 -3
  85. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -1
  86. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -1
  87. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -1
  88. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
  89. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
  90. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +2 -2
  91. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -1
  92. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +1 -1
  93. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +1 -1
  94. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +5 -5
  95. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -1
  96. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -1
  97. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +97 -96
  98. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -1
  99. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +1 -1
  100. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +1 -1
  101. package/dist/components/header/Header.cjs.js +1 -1
  102. package/dist/components/header/Header.cjs.js.map +1 -1
  103. package/dist/components/header/Header.esm.js +2 -2
  104. package/dist/components/header/Header.esm.js.map +1 -1
  105. package/dist/components/header/Header.styles.cjs.js +1 -1
  106. package/dist/components/header/Header.styles.cjs.js.map +1 -1
  107. package/dist/components/header/Header.styles.esm.js +1 -1
  108. package/dist/components/header/Header.styles.esm.js.map +1 -1
  109. package/dist/components/navbar/Navbar.cjs.js +1 -1
  110. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  111. package/dist/components/navbar/Navbar.d.ts +2 -0
  112. package/dist/components/navbar/Navbar.d.ts.map +1 -1
  113. package/dist/components/navbar/Navbar.esm.js +2 -2
  114. package/dist/components/navbar/Navbar.esm.js.map +1 -1
  115. package/dist/components/navbar/Navbar.styles.cjs.js +1 -1
  116. package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
  117. package/dist/components/navbar/Navbar.styles.esm.js +1 -1
  118. package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
  119. package/dist/components/profile-heading/ProfileHeading.cjs.js +95 -0
  120. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -0
  121. package/dist/components/profile-heading/ProfileHeading.d.ts +45 -0
  122. package/dist/components/profile-heading/ProfileHeading.d.ts.map +1 -0
  123. package/dist/components/profile-heading/ProfileHeading.esm.js +480 -0
  124. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -0
  125. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +2 -0
  126. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -0
  127. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +7 -0
  128. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -0
  129. package/dist/components/profile-heading/editor/index.d.ts +3 -0
  130. package/dist/components/profile-heading/editor/index.d.ts.map +1 -0
  131. package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts +44 -0
  132. package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts.map +1 -0
  133. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +297 -0
  134. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js.map +1 -0
  135. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts +5 -0
  136. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts.map +1 -0
  137. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +642 -0
  138. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js.map +1 -0
  139. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js +2 -0
  140. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js.map +1 -0
  141. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts +4 -0
  142. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts.map +1 -0
  143. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +16 -0
  144. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js.map +1 -0
  145. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js +2 -0
  146. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js.map +1 -0
  147. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts +5 -0
  148. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts.map +1 -0
  149. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +76 -0
  150. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js.map +1 -0
  151. package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js +19 -0
  152. package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js.map +1 -0
  153. package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts +2 -0
  154. package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts.map +1 -0
  155. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +28 -0
  156. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js.map +1 -0
  157. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js +2 -0
  158. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js.map +1 -0
  159. package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts +4 -0
  160. package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts.map +1 -0
  161. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +151 -0
  162. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js.map +1 -0
  163. package/dist/components/profile-heading/editor/sections/heading/types.d.ts +34 -0
  164. package/dist/components/profile-heading/editor/sections/heading/types.d.ts.map +1 -0
  165. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js +2 -0
  166. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js.map +1 -0
  167. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts +7 -0
  168. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts.map +1 -0
  169. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +20 -0
  170. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js.map +1 -0
  171. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js +2 -0
  172. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js.map +1 -0
  173. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts +3 -0
  174. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts.map +1 -0
  175. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +11 -0
  176. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js.map +1 -0
  177. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js +2 -0
  178. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js.map +1 -0
  179. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts +20 -0
  180. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts.map +1 -0
  181. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +1291 -0
  182. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js.map +1 -0
  183. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js +2 -0
  184. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js.map +1 -0
  185. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts +45 -0
  186. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
  187. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +211 -0
  188. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js.map +1 -0
  189. package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js +2 -0
  190. package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js.map +1 -0
  191. package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts +21 -0
  192. package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts.map +1 -0
  193. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +18 -0
  194. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js.map +1 -0
  195. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js +2 -0
  196. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js.map +1 -0
  197. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts +5 -0
  198. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts.map +1 -0
  199. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +18 -0
  200. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js.map +1 -0
  201. package/dist/components/profile-heading/editor/sections/shared/types.d.ts +31 -0
  202. package/dist/components/profile-heading/editor/sections/shared/types.d.ts.map +1 -0
  203. package/dist/components/profile-heading/editor/textUtils.cjs.js +2 -0
  204. package/dist/components/profile-heading/editor/textUtils.cjs.js.map +1 -0
  205. package/dist/components/profile-heading/editor/textUtils.d.ts +6 -0
  206. package/dist/components/profile-heading/editor/textUtils.d.ts.map +1 -0
  207. package/dist/components/profile-heading/editor/textUtils.esm.js +26 -0
  208. package/dist/components/profile-heading/editor/textUtils.esm.js.map +1 -0
  209. package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts +9 -0
  210. package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts.map +1 -0
  211. package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js +2 -0
  212. package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js.map +1 -0
  213. package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts +14 -0
  214. package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts.map +1 -0
  215. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +6 -0
  216. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js.map +1 -0
  217. package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js +2 -0
  218. package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js.map +1 -0
  219. package/dist/components/profile-heading/editor/texts/messageTexts.d.ts +42 -0
  220. package/dist/components/profile-heading/editor/texts/messageTexts.d.ts.map +1 -0
  221. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +6 -0
  222. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js.map +1 -0
  223. package/dist/components/profile-heading/editor/texts/profileTexts.d.ts +14 -0
  224. package/dist/components/profile-heading/editor/texts/profileTexts.d.ts.map +1 -0
  225. package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts +2 -0
  226. package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts.map +1 -0
  227. package/dist/components/profile-heading/editor/texts.d.ts +6 -0
  228. package/dist/components/profile-heading/editor/texts.d.ts.map +1 -0
  229. package/dist/components/profile-heading/editor/ui/dialog.d.ts +41 -0
  230. package/dist/components/profile-heading/editor/ui/dialog.d.ts.map +1 -0
  231. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +17 -0
  232. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -0
  233. package/dist/components/profile-heading/editor/ui/dialog2.esm.js +263 -0
  234. package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -0
  235. package/dist/components/profile-heading/editor/ui/spinner.cjs.js +5 -0
  236. package/dist/components/profile-heading/editor/ui/spinner.cjs.js.map +1 -0
  237. package/dist/components/profile-heading/editor/ui/spinner.d.ts +3 -0
  238. package/dist/components/profile-heading/editor/ui/spinner.d.ts.map +1 -0
  239. package/dist/components/profile-heading/editor/ui/spinner.esm.js +12 -0
  240. package/dist/components/profile-heading/editor/ui/spinner.esm.js.map +1 -0
  241. package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js +2 -0
  242. package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js.map +1 -0
  243. package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts +2 -0
  244. package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts.map +1 -0
  245. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +18 -0
  246. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js.map +1 -0
  247. package/dist/components/profile-heading/friendActions.cjs.js +2 -0
  248. package/dist/components/profile-heading/friendActions.cjs.js.map +1 -0
  249. package/dist/components/profile-heading/friendActions.d.ts +11 -0
  250. package/dist/components/profile-heading/friendActions.d.ts.map +1 -0
  251. package/dist/components/profile-heading/friendActions.esm.js +32 -0
  252. package/dist/components/profile-heading/friendActions.esm.js.map +1 -0
  253. package/dist/components/profile-heading/index.cjs.js +1 -0
  254. package/dist/components/profile-heading/index.d.ts +5 -0
  255. package/dist/components/profile-heading/index.d.ts.map +1 -0
  256. package/dist/components/profile-heading/index.esm.js +1 -0
  257. package/dist/components/profile-heading/profileHeadingData.cjs.js +2 -0
  258. package/dist/components/profile-heading/profileHeadingData.cjs.js.map +1 -0
  259. package/dist/components/profile-heading/profileHeadingData.d.ts +6 -0
  260. package/dist/components/profile-heading/profileHeadingData.d.ts.map +1 -0
  261. package/dist/components/profile-heading/profileHeadingData.esm.js +81 -0
  262. package/dist/components/profile-heading/profileHeadingData.esm.js.map +1 -0
  263. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +1 -1
  264. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
  265. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +2 -2
  266. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -1
  267. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +1 -1
  268. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +1 -1
  269. package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
  270. package/dist/dashboard/basicPreferences.esm.js.map +1 -1
  271. package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
  272. package/dist/dashboard/dashboardPane.esm.js.map +1 -1
  273. package/dist/dashboard/homepage.cjs.js.map +1 -1
  274. package/dist/dashboard/homepage.esm.js.map +1 -1
  275. package/dist/dashboard/ontologyData.cjs.js.map +1 -1
  276. package/dist/dashboard/ontologyData.esm.js.map +1 -1
  277. package/dist/dashboard/preferencesFormText.cjs.js.map +1 -1
  278. package/dist/dashboard/preferencesFormText.esm.js.map +1 -1
  279. package/dist/dataContentPane2.cjs.js.map +1 -1
  280. package/dist/dataContentPane2.esm.js.map +1 -1
  281. package/dist/defaultPane2.cjs.js.map +1 -1
  282. package/dist/defaultPane2.esm.js.map +1 -1
  283. package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
  284. package/dist/dokieli/dokieliPane.esm.js.map +1 -1
  285. package/dist/dokieli/new.cjs.js.map +1 -1
  286. package/dist/dokieli/new.esm.js.map +1 -1
  287. package/dist/form/pane.cjs.js.map +1 -1
  288. package/dist/form/pane.esm.js.map +1 -1
  289. package/dist/home/homePane.cjs.js.map +1 -1
  290. package/dist/home/homePane.esm.js.map +1 -1
  291. package/dist/humanReadablePane2.cjs.js.map +1 -1
  292. package/dist/humanReadablePane2.esm.js.map +1 -1
  293. package/dist/icons/folder.cjs.js.map +1 -1
  294. package/dist/icons/folder.esm.js.map +1 -1
  295. package/dist/icons/friends.cjs.js.map +1 -1
  296. package/dist/icons/friends.esm.js.map +1 -1
  297. package/dist/icons/person.cjs.js.map +1 -1
  298. package/dist/icons/person.esm.js.map +1 -1
  299. package/dist/imagePane2.cjs.js.map +1 -1
  300. package/dist/imagePane2.esm.js.map +1 -1
  301. package/dist/index.cjs.js +1 -1
  302. package/dist/index.cjs.js.map +1 -1
  303. package/dist/index.d.ts +2 -1
  304. package/dist/index.d.ts.map +1 -1
  305. package/dist/index.esm.js +15 -14
  306. package/dist/index.esm.js.map +1 -1
  307. package/dist/internal/internalPane2.cjs.js +1 -1
  308. package/dist/internal/internalPane2.cjs.js.map +1 -1
  309. package/dist/internal/internalPane2.esm.js +2 -5
  310. package/dist/internal/internalPane2.esm.js.map +1 -1
  311. package/dist/mainPage/header.cjs.js +1 -1
  312. package/dist/mainPage/header.cjs.js.map +1 -1
  313. package/dist/mainPage/header.d.ts +2 -2
  314. package/dist/mainPage/header.d.ts.map +1 -1
  315. package/dist/mainPage/header.esm.js +48 -44
  316. package/dist/mainPage/header.esm.js.map +1 -1
  317. package/dist/mainPage/index.cjs.js +1 -1
  318. package/dist/mainPage/index.cjs.js.map +1 -1
  319. package/dist/mainPage/index.d.ts.map +1 -1
  320. package/dist/mainPage/index.esm.js +27 -21
  321. package/dist/mainPage/index.esm.js.map +1 -1
  322. package/dist/mainPage/navbar.cjs.js +1 -1
  323. package/dist/mainPage/navbar.cjs.js.map +1 -1
  324. package/dist/mainPage/navbar.d.ts +3 -2
  325. package/dist/mainPage/navbar.d.ts.map +1 -1
  326. package/dist/mainPage/navbar.esm.js +77 -42
  327. package/dist/mainPage/navbar.esm.js.map +1 -1
  328. package/dist/mainPage/navigation.cjs.js +2 -0
  329. package/dist/mainPage/navigation.cjs.js.map +1 -0
  330. package/dist/mainPage/navigation.d.ts +6 -0
  331. package/dist/mainPage/navigation.d.ts.map +1 -0
  332. package/dist/mainPage/navigation.esm.js +22 -0
  333. package/dist/mainPage/navigation.esm.js.map +1 -0
  334. package/dist/mainPage/profileHeading.d.ts +5 -0
  335. package/dist/mainPage/profileHeading.d.ts.map +1 -0
  336. package/dist/mainPage/profileHeading2.cjs.js +2 -0
  337. package/dist/mainPage/profileHeading2.cjs.js.map +1 -0
  338. package/dist/mainPage/profileHeading2.esm.js +158 -0
  339. package/dist/mainPage/profileHeading2.esm.js.map +1 -0
  340. package/dist/n3Pane2.cjs.js.map +1 -1
  341. package/dist/n3Pane2.esm.js.map +1 -1
  342. package/dist/navigation/browserEvents.cjs.js +2 -0
  343. package/dist/navigation/browserEvents.cjs.js.map +1 -0
  344. package/dist/navigation/browserEvents.d.ts +15 -0
  345. package/dist/navigation/browserEvents.d.ts.map +1 -0
  346. package/dist/navigation/browserEvents.esm.js +32 -0
  347. package/dist/navigation/browserEvents.esm.js.map +1 -0
  348. package/dist/navigation/chrome.cjs.js +2 -0
  349. package/dist/navigation/chrome.cjs.js.map +1 -0
  350. package/dist/navigation/chrome.d.ts +69 -0
  351. package/dist/navigation/chrome.d.ts.map +1 -0
  352. package/dist/navigation/chrome.esm.js +43 -0
  353. package/dist/navigation/chrome.esm.js.map +1 -0
  354. package/dist/navigation/controller.cjs.js +2 -0
  355. package/dist/navigation/controller.cjs.js.map +1 -0
  356. package/dist/navigation/controller.d.ts +51 -0
  357. package/dist/navigation/controller.d.ts.map +1 -0
  358. package/dist/navigation/controller.esm.js +45 -0
  359. package/dist/navigation/controller.esm.js.map +1 -0
  360. package/dist/navigation/events.cjs.js +2 -0
  361. package/dist/navigation/events.cjs.js.map +1 -0
  362. package/dist/navigation/events.d.ts +17 -0
  363. package/dist/navigation/events.d.ts.map +1 -0
  364. package/dist/navigation/events.esm.js +18 -0
  365. package/dist/navigation/events.esm.js.map +1 -0
  366. package/dist/navigation/navbarVisibility.cjs.js +2 -0
  367. package/dist/navigation/navbarVisibility.cjs.js.map +1 -0
  368. package/dist/navigation/navbarVisibility.d.ts +5 -0
  369. package/dist/navigation/navbarVisibility.d.ts.map +1 -0
  370. package/dist/navigation/navbarVisibility.esm.js +26 -0
  371. package/dist/navigation/navbarVisibility.esm.js.map +1 -0
  372. package/dist/navigation/options.cjs.js +2 -0
  373. package/dist/navigation/options.cjs.js.map +1 -0
  374. package/dist/navigation/options.d.ts +16 -0
  375. package/dist/navigation/options.d.ts.map +1 -0
  376. package/dist/navigation/options.esm.js +8 -0
  377. package/dist/navigation/options.esm.js.map +1 -0
  378. package/dist/navigation/podContext.cjs.js +2 -0
  379. package/dist/navigation/podContext.cjs.js.map +1 -0
  380. package/dist/navigation/podContext.d.ts +21 -0
  381. package/dist/navigation/podContext.d.ts.map +1 -0
  382. package/dist/navigation/podContext.esm.js +62 -0
  383. package/dist/navigation/podContext.esm.js.map +1 -0
  384. package/dist/navigation/state.cjs.js +2 -0
  385. package/dist/navigation/state.cjs.js.map +1 -0
  386. package/dist/navigation/state.d.ts +40 -0
  387. package/dist/navigation/state.d.ts.map +1 -0
  388. package/dist/navigation/state.esm.js +41 -0
  389. package/dist/navigation/state.esm.js.map +1 -0
  390. package/dist/outline/context.cjs.js.map +1 -1
  391. package/dist/outline/context.esm.js.map +1 -1
  392. package/dist/outline/manager2.cjs.js +1 -1
  393. package/dist/outline/manager2.cjs.js.map +1 -1
  394. package/dist/outline/manager2.esm.js +388 -354
  395. package/dist/outline/manager2.esm.js.map +1 -1
  396. package/dist/outline/outlineIcons.cjs.js.map +1 -1
  397. package/dist/outline/outlineIcons.esm.js.map +1 -1
  398. package/dist/outline/propertyViews.cjs.js.map +1 -1
  399. package/dist/outline/propertyViews.esm.js.map +1 -1
  400. package/dist/outline/queryByExample.cjs.js.map +1 -1
  401. package/dist/outline/queryByExample.esm.js.map +1 -1
  402. package/dist/outline/userInput.cjs.js +1 -1
  403. package/dist/outline/userInput.cjs.js.map +1 -1
  404. package/dist/outline/userInput.esm.js +12 -13
  405. package/dist/outline/userInput.esm.js.map +1 -1
  406. package/dist/outline/viewAsImage.cjs.js.map +1 -1
  407. package/dist/outline/viewAsImage.esm.js.map +1 -1
  408. package/dist/outline/viewAsMbox.cjs.js.map +1 -1
  409. package/dist/outline/viewAsMbox.esm.js.map +1 -1
  410. package/dist/pad/padPane2.cjs.js +1 -1
  411. package/dist/pad/padPane2.cjs.js.map +1 -1
  412. package/dist/pad/padPane2.esm.js +2 -6
  413. package/dist/pad/padPane2.esm.js.map +1 -1
  414. package/dist/playlist/playlistPane.cjs.js.map +1 -1
  415. package/dist/playlist/playlistPane.esm.js.map +1 -1
  416. package/dist/registerPanes.cjs.js.map +1 -1
  417. package/dist/registerPanes.esm.js.map +1 -1
  418. package/dist/schedule/formsForSchedule.cjs.js.map +1 -1
  419. package/dist/schedule/formsForSchedule.esm.js.map +1 -1
  420. package/dist/schedule/schedulePane2.cjs.js +1 -1
  421. package/dist/schedule/schedulePane2.cjs.js.map +1 -1
  422. package/dist/schedule/schedulePane2.esm.js +1 -5
  423. package/dist/schedule/schedulePane2.esm.js.map +1 -1
  424. package/dist/sharing/sharingPane.cjs.js.map +1 -1
  425. package/dist/sharing/sharingPane.esm.js.map +1 -1
  426. package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
  427. package/dist/slideshow/slideshowPane.esm.js.map +1 -1
  428. package/dist/social/editProfileDetails.cjs.js +1 -1
  429. package/dist/social/editProfileDetails.cjs.js.map +1 -1
  430. package/dist/social/editProfileDetails.esm.js +0 -2
  431. package/dist/social/editProfileDetails.esm.js.map +1 -1
  432. package/dist/social/icons.cjs.js +4 -4
  433. package/dist/social/icons.cjs.js.map +1 -1
  434. package/dist/social/icons.esm.js +5 -5
  435. package/dist/social/icons.esm.js.map +1 -1
  436. package/dist/social/socialPane.d.ts +0 -1
  437. package/dist/social/socialPane.d.ts.map +1 -1
  438. package/dist/social/socialPane2.cjs.js +3 -3
  439. package/dist/social/socialPane2.cjs.js.map +1 -1
  440. package/dist/social/socialPane2.esm.js +97 -154
  441. package/dist/social/socialPane2.esm.js.map +1 -1
  442. package/dist/social/socialSections.cjs.js +1 -1
  443. package/dist/social/socialSections.cjs.js.map +1 -1
  444. package/dist/social/socialSections.d.ts +2 -1
  445. package/dist/social/socialSections.d.ts.map +1 -1
  446. package/dist/social/socialSections.esm.js +54 -129
  447. package/dist/social/socialSections.esm.js.map +1 -1
  448. package/dist/social/triage.cjs.js.map +1 -1
  449. package/dist/social/triage.esm.js.map +1 -1
  450. package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
  451. package/dist/tabbed/tabbedPane.esm.js.map +1 -1
  452. package/dist/tableViewPane.cjs.js.map +1 -1
  453. package/dist/tableViewPane.esm.js.map +1 -1
  454. package/dist/transaction/pane.cjs.js.map +1 -1
  455. package/dist/transaction/pane.esm.js +1 -1
  456. package/dist/transaction/pane.esm.js.map +1 -1
  457. package/dist/transaction/period.cjs.js.map +1 -1
  458. package/dist/transaction/period.esm.js.map +1 -1
  459. package/dist/trip/tripPane.cjs.js.map +1 -1
  460. package/dist/trip/tripPane.esm.js.map +1 -1
  461. package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
  462. package/dist/trustedApplications/trustedApplications.dom.esm.js.map +1 -1
  463. package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
  464. package/dist/trustedApplications/trustedApplications.utils.esm.js.map +1 -1
  465. package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
  466. package/dist/trustedApplications/trustedApplications.view.esm.js.map +1 -1
  467. package/dist/types.d.ts +3 -0
  468. package/dist/types.d.ts.map +1 -0
  469. package/dist/ui/pane.cjs.js +1 -1
  470. package/dist/ui/pane.cjs.js.map +1 -1
  471. package/dist/ui/pane.esm.js +2 -5
  472. package/dist/ui/pane.esm.js.map +1 -1
  473. package/dist/utils/paneUtils.cjs.js +1 -1
  474. package/dist/utils/paneUtils.cjs.js.map +1 -1
  475. package/dist/utils/paneUtils.esm.js +4 -4
  476. package/dist/utils/paneUtils.esm.js.map +1 -1
  477. package/dist/utils/podUtils.cjs.js.map +1 -1
  478. package/dist/utils/podUtils.esm.js.map +1 -1
  479. package/dist/utils/viewerUtils.cjs.js +2 -0
  480. package/dist/utils/viewerUtils.cjs.js.map +1 -0
  481. package/dist/utils/viewerUtils.d.ts +5 -0
  482. package/dist/utils/viewerUtils.d.ts.map +1 -0
  483. package/dist/utils/viewerUtils.esm.js +13 -0
  484. package/dist/utils/viewerUtils.esm.js.map +1 -0
  485. package/dist/utils/webIdUtils.cjs.js +1 -1
  486. package/dist/utils/webIdUtils.cjs.js.map +1 -1
  487. package/dist/utils/webIdUtils.d.ts +1 -0
  488. package/dist/utils/webIdUtils.d.ts.map +1 -1
  489. package/dist/utils/webIdUtils.esm.js +23 -19
  490. package/dist/utils/webIdUtils.esm.js.map +1 -1
  491. package/dist/versionInfo.cjs.js +1 -1
  492. package/dist/versionInfo.cjs.js.map +1 -1
  493. package/dist/versionInfo.esm.js +11 -11
  494. package/dist/versionInfo.esm.js.map +1 -1
  495. package/dist/video/videoPane.cjs.js.map +1 -1
  496. package/dist/video/videoPane.esm.js.map +1 -1
  497. package/package.json +15 -14
@@ -0,0 +1,32 @@
1
+ import { clearPaneState as e } from "./state.esm.js";
2
+ //#region src/navigation/browserEvents.ts
3
+ var t, n = !1;
4
+ function r() {
5
+ return n;
6
+ }
7
+ function i(e) {
8
+ console.error("Failed to show the page after browser navigation.", e);
9
+ }
10
+ function a(r) {
11
+ if (t = r, n) return;
12
+ n = !0;
13
+ let a = () => (e(), (t?.show({
14
+ kind: "restore",
15
+ forceHeading: !0
16
+ }) ?? Promise.resolve()).catch(i)), o = window.navigation;
17
+ o ? (o.addEventListener("navigate", (e) => {
18
+ e.canIntercept && e.userInitiated && e.navigationType === "replace" && e.destination.url === window.location.href && e.intercept({
19
+ scroll: "manual",
20
+ focusReset: "manual",
21
+ handler: a
22
+ });
23
+ }), o.addEventListener("currententrychange", (e) => {
24
+ e.navigationType === "traverse" && a();
25
+ })) : window.addEventListener("popstate", () => {
26
+ a();
27
+ });
28
+ }
29
+ //#endregion
30
+ export { r as isHandlingBrowserNavigation, a as registerBrowserNavigation };
31
+
32
+ //# sourceMappingURL=browserEvents.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browserEvents.esm.js","names":["navigation","listenersRegistered","isHandlingBrowserNavigation","reportError","error","registerBrowserNavigation","controller","showUrl","clearPaneState","navigationApi","event"],"sources":["../../src/navigation/browserEvents.ts"],"sourcesContent":["/*\n * What the page does when the browser changes the URL or the history entry without reloading.\n *\n * Like a reload, both cases show what the URL is, not what the entry last displayed through the\n * navbar or the account menu:\n * - Enter on the current URL (typically one ending in #me)\n * - back and forward\n */\n\nimport type { NavigationController } from './controller'\nimport { clearPaneState } from './state'\n\ninterface NavigationEvent extends Event {\n canIntercept: boolean\n userInitiated: boolean\n navigationType: string\n destination: { url: string }\n intercept: (options: { handler: () => Promise<void>, scroll: 'manual', focusReset: 'manual' }) => void\n}\n\ninterface NavigationApi {\n addEventListener: (type: 'navigate' | 'currententrychange', listener: (event: NavigationEvent) => void) => void\n}\n\nlet navigation: NavigationController | undefined\nlet listenersRegistered = false\n\n/**\n * Whether the main page handles back and forward itself. Packages that used to re-render on\n * `popstate` (mashlib) ask this and leave it to the main page.\n */\nexport function isHandlingBrowserNavigation (): boolean {\n return listenersRegistered\n}\n\nfunction reportError (error: unknown) {\n console.error('Failed to show the page after browser navigation.', error)\n}\n\n/**\n * Starts handling Enter, back and forward for a controller. The listeners are added once;\n * calling this again only changes which controller they use.\n *\n * The Navigation API is used where the browser has it; the places that fall back to an older\n * mechanism are marked NAVIGATION API FALLBACK. See \"Browser support\" in docs/navigation-design.md.\n */\nexport function registerBrowserNavigation (controller: NavigationController): void {\n navigation = controller\n if (listenersRegistered) return\n listenersRegistered = true\n\n const showUrl = () => {\n clearPaneState()\n return (navigation?.show({ kind: 'restore', forceHeading: true }) ?? Promise.resolve()).catch(reportError)\n }\n\n const navigationApi = (window as unknown as { navigation?: NavigationApi }).navigation\n if (!navigationApi) {\n // NAVIGATION API FALLBACK (Firefox before 147, Safari before 26.2, older Chromium).\n // Back and forward use `popstate`, which cannot tell them from in-page `#` links, so a\n // fragment link also re-renders the page. Enter on the current URL is not handled at all\n // here: without a fragment the browser reloads the page, and `initMainPage` shows the URL.\n window.addEventListener('popstate', () => { showUrl() })\n return\n }\n\n // NAVIGATION API: Enter on the current URL (typically one ending in #me) is a same-URL\n // \"replace\" navigation; intercepting it shows the URL without reloading. Without the API\n // there is no equivalent, see the fallback above.\n navigationApi.addEventListener('navigate', event => {\n if (!event.canIntercept || !event.userInitiated || event.navigationType !== 'replace' ||\n event.destination.url !== window.location.href) return\n\n event.intercept({\n scroll: 'manual',\n focusReset: 'manual',\n handler: showUrl\n })\n })\n\n // NAVIGATION API: unlike the `popstate` fallback above, this does not fire for in-page\n // fragment links.\n navigationApi.addEventListener('currententrychange', event => {\n if (event.navigationType === 'traverse') showUrl()\n })\n}\n"],"mappings":";;AAwBA,IAAIA,GACAC,IAAsB;AAM1B,SAAgBC,IAAwC;CACtD,OAAOD;AACT;AAEA,SAASE,EAAa,GAAgB;CACpC,QAAQ,MAAM,qDAAqDC,CAAK;AAC1E;AASA,SAAgBC,EAA2B,GAAwC;CAEjF,IADA,IAAaC,GACTL,GAAqB;CACzB,IAAsB;CAEtB,IAAMM,WACJC,EAAe,IACPR,GAAY,KAAK;EAAE,MAAM;EAAW,cAAc;CAAK,CAAC,KAAK,QAAQ,QAAQ,EAAA,CAAG,MAAMG,CAAW,IAGrGM,IAAiB,OAAqD;CAC5E,AAAKA,KAYLA,EAAc,iBAAiB,aAAY,MAAS;EAClD,AAAKC,EAAM,gBAAiBA,EAAM,iBAAiBA,EAAM,mBAAmB,aACxEA,EAAM,YAAY,QAAQ,OAAO,SAAS,QAE9CA,EAAM,UAAU;GACd,QAAQ;GACR,YAAY;GACZ,SAASH;EACX,CAAC;CACH,CAAC,GAIDE,EAAc,iBAAiB,uBAAsB,MAAS;EAC5D,AAAIC,EAAM,mBAAmB,cAAYH,EAAQ;CACnD,CAAC,KAtBC,OAAO,iBAAiB,kBAAkB;EAAE,EAAQ;CAAE,CAAC;AAuB3D"}
@@ -0,0 +1,2 @@
1
+ var e=[`profile`,`social`];function t(t){return t!==void 0&&e.includes(t)}function n(e){let{view:n,viaAccountMenu:r,viewer:i,pageUrl:a,owner:o,storageUris:s}=e,c=n.pane,l=c===`profile`||c===`social`?o!==void 0:c===`folder`&&s.some(e=>!n.subject||e===n.subject),u=l||!r?o:void 0;return t(c)?{mode:c===`profile`?`full`:`compact`,subjectUri:n.subject||(l?o:void 0)||a,paneName:c}:!u||u===i?{mode:`none`}:{mode:`compact`,subjectUri:u,paneName:c}}function r(e,t){return{paneName:e.pane??(t?`profile`:void 0),paneUri:e.subject}}function i(e,t,n){return!t.paneName||e.paneName!==t.paneName?!1:e.paneName===`folder`?t.paneUri?t.paneUri===e.paneUri:n===1:!0}function a(e,t,n){let r=e.filter(e=>e.paneName===t);return r.find(e=>e.paneUri===n)??r[0]}function o(e){return e.viaAccountMenu||e.ownProfile||e.inViewerPod}function s(e){return e.isRootResource||e.isWebId?!1:!e.viewerPodOnly||e.inViewerPod}function c(e,n){return e&&!t(n)}exports.PERSON_PANES=e,exports.deriveExplorerHeader=s,exports.deriveHeading=n,exports.deriveNavbarSelection=r,exports.explorerHeaderForPane=c,exports.isNavbarHidden=o,exports.isNavbarItemSelected=i,exports.isPersonPane=t,exports.pickNavbarItem=a;
2
+ //# sourceMappingURL=chrome.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.cjs.js","names":["PERSON_PANES","isPersonPane","paneName","deriveHeading","input","view","ownerHasPane","owner","storageUris","uri","ownerUri","viaAccountMenu","pageUrl","viewer","deriveNavbarSelection","pageIsWebId","isNavbarItemSelected","selection","item","storageItemCount","pickNavbarItem","forPane","items","paneUri","isNavbarHidden","deriveExplorerHeader","explorerHeaderForPane","resourceHeader"],"sources":["../../src/navigation/chrome.ts"],"sourcesContent":["/*\n * The rules for what the page chrome shows, as pure functions.\n *\n * What the user sees depends on the page URL, the pane that was last opened, whether the\n * account menu opened it, who is logged in and whose pod the URL is in. These functions\n * decide it from those inputs alone: they read no history, DOM or session, so every rule\n * can be tested in one place. The heading, navbar, outline and file explorer provider\n * only apply the result.\n */\n\nimport { type NavigationView } from './state'\n\n/** Registry names of the panes that present a person rather than a resource. */\nexport const PERSON_PANES = ['profile', 'social']\n\nexport function isPersonPane (paneName?: string): boolean {\n return paneName !== undefined && PERSON_PANES.includes(paneName)\n}\n\n/** The parts of a navbar item that the rules look at. */\nexport interface NavbarItemRef {\n paneName?: string\n paneUri?: string\n}\n\n// Profile heading\n\nexport type HeadingDecision =\n | { mode: 'none' }\n | {\n /** Full on the profile pane, compact everywhere else. */\n mode: 'full' | 'compact'\n /** The profile (WebID or document) to present. */\n subjectUri: string\n paneName?: string\n }\n\nexport interface HeadingInput {\n view: NavigationView\n viaAccountMenu: boolean\n /** WebID of the logged-in user. */\n viewer?: string\n pageUrl: string\n /** WebID of the person whose pod the page is in, if known. */\n owner?: string\n /** URIs of the storages of that pod. */\n storageUris: string[]\n}\n\n/**\n * Profile and friends panes present their own subject. Any other pane shows the owner of\n * the pod the page is in, unless that is the viewer, or the view came from the account menu\n * and so shows the viewer's own content.\n */\nexport function deriveHeading (input: HeadingInput): HeadingDecision {\n const { view, viaAccountMenu, viewer, pageUrl, owner, storageUris } = input\n const paneName = view.pane\n\n // Whether the pod owner's navbar has an item for the displayed pane: Profile and Friends\n // whenever there is an owner, and a storage by its URI (any of them when the view names none).\n const ownerHasPane = paneName === 'profile' || paneName === 'social'\n ? owner !== undefined\n : paneName === 'folder' && storageUris.some(uri => !view.subject || uri === view.subject)\n const ownerUri = ownerHasPane || !viaAccountMenu ? owner : undefined\n\n if (!isPersonPane(paneName)) {\n if (!ownerUri || ownerUri === viewer) return { mode: 'none' }\n return { mode: 'compact', subjectUri: ownerUri, paneName }\n }\n\n return {\n mode: paneName === 'profile' ? 'full' : 'compact',\n subjectUri: view.subject || (ownerHasPane ? owner : undefined) || pageUrl,\n paneName\n }\n}\n\n// Navbar\n\nexport interface NavbarSelection {\n paneName?: string\n paneUri?: string\n}\n\n/** What the navbar should have selected: the displayed pane, or Profile on a WebID. */\nexport function deriveNavbarSelection (view: NavigationView, pageIsWebId: boolean): NavbarSelection {\n return {\n paneName: view.pane ?? (pageIsWebId ? 'profile' : undefined),\n paneUri: view.subject\n }\n}\n\n/**\n * @param storageItemCount how many storage items the navbar has; a single storage is\n * selected even when the view does not say which one it was\n */\nexport function isNavbarItemSelected (\n item: NavbarItemRef,\n selection: NavbarSelection,\n storageItemCount: number\n): boolean {\n if (!selection.paneName || item.paneName !== selection.paneName) return false\n if (item.paneName === 'folder') {\n return selection.paneUri ? selection.paneUri === item.paneUri : storageItemCount === 1\n }\n return true\n}\n\n/** The item to select for a pane: the one for that subject, else the first for that pane. */\nexport function pickNavbarItem<Item extends NavbarItemRef> (\n items: Item[],\n paneName: string,\n paneUri?: string\n): Item | undefined {\n const forPane = items.filter(item => item.paneName === paneName)\n return forPane.find(item => item.paneUri === paneUri) ?? forPane[0]\n}\n\n/** The navbar is not offered in the viewer's own pod, nor over account-menu content. */\nexport function isNavbarHidden (input: { viaAccountMenu: boolean, ownProfile: boolean, inViewerPod: boolean }): boolean {\n return input.viaAccountMenu || input.ownProfile || input.inViewerPod\n}\n\n// File explorer header\n\nexport interface ExplorerHeaderInput {\n isRootResource: boolean\n isWebId: boolean\n /**\n * The view shows a person's own subject or the viewer's content, not the resource the\n * page URL points at, so the resource header only fits inside the viewer's own pod.\n */\n viewerPodOnly: boolean\n inViewerPod: boolean\n}\n\n/** Whether the header describing a resource fits the view. */\nexport function deriveExplorerHeader (input: ExplorerHeaderInput): boolean {\n if (input.isRootResource || input.isWebId) return false\n return !input.viewerPodOnly || input.inViewerPod\n}\n\n/** The header is never shown over a person's profile or friends, whatever the resource. */\nexport function explorerHeaderForPane (resourceHeader: boolean, paneName?: string): boolean {\n return resourceHeader && !isPersonPane(paneName)\n}\n"],"mappings":"AAaA,IAAaA,EAAe,CAAC,UAAW,QAAQ,EAEhD,SAAgBC,EAAc,EAA4B,CACxD,OAAOC,IAAa,IAAA,IAAaF,EAAa,SAASE,CAAQ,CACjE,CAqCA,SAAgBC,EAAe,EAAsC,CACnE,GAAM,CAAE,OAAM,iBAAgB,SAAQ,UAAS,QAAO,eAAgBC,EAChEF,EAAWG,EAAK,KAIhBC,EAAeJ,IAAa,WAAaA,IAAa,SACxDK,IAAU,IAAA,GACVL,IAAa,UAAYM,EAAY,KAAK,GAAO,CAACH,EAAK,SAAWI,IAAQJ,EAAK,OAAO,EACpFK,EAAWJ,GAAgB,CAACK,EAAiBJ,EAAQ,IAAA,GAO3D,OALKN,EAAaC,CAAQ,EAKnB,CACL,KAAMA,IAAa,UAAY,OAAS,UACxC,WAAYG,EAAK,UAAYC,EAAeC,EAAQ,IAAA,KAAcK,EAClE,UACF,EARM,CAACF,GAAYA,IAAaG,EAAe,CAAE,KAAM,MAAO,EACrD,CAAE,KAAM,UAAW,WAAYH,EAAU,UAAS,CAQ7D,CAUA,SAAgBI,EAAuB,EAAsB,EAAuC,CAClG,MAAO,CACL,SAAUT,EAAK,OAASU,EAAc,UAAY,IAAA,IAClD,QAASV,EAAK,OAChB,CACF,CAMA,SAAgBW,EACd,EACA,EACA,EACS,CAKT,MAJI,CAACC,EAAU,UAAYC,EAAK,WAAaD,EAAU,SAAiB,GACpEC,EAAK,WAAa,SACbD,EAAU,QAAUA,EAAU,UAAYC,EAAK,QAAUC,IAAqB,EAEhF,EACT,CAGA,SAAgBC,EACd,EACA,EACA,EACkB,CAClB,IAAMC,EAAUC,EAAM,OAAO,GAAQJ,EAAK,WAAahB,CAAQ,EAC/D,OAAOmB,EAAQ,KAAK,GAAQH,EAAK,UAAYK,CAAO,GAAKF,EAAQ,EACnE,CAGA,SAAgBG,EAAgB,EAAwF,CACtH,OAAOpB,EAAM,gBAAkBA,EAAM,YAAcA,EAAM,WAC3D,CAgBA,SAAgBqB,EAAsB,EAAqC,CAEzE,OADIrB,EAAM,gBAAkBA,EAAM,QAAgB,GAC3C,CAACA,EAAM,eAAiBA,EAAM,WACvC,CAGA,SAAgBsB,EAAuB,EAAyB,EAA4B,CAC1F,OAAOC,GAAkB,CAAC1B,EAAaC,CAAQ,CACjD,C"}
@@ -0,0 +1,69 @@
1
+ import { NavigationView } from './state';
2
+ /** Registry names of the panes that present a person rather than a resource. */
3
+ export declare const PERSON_PANES: string[];
4
+ export declare function isPersonPane(paneName?: string): boolean;
5
+ /** The parts of a navbar item that the rules look at. */
6
+ export interface NavbarItemRef {
7
+ paneName?: string;
8
+ paneUri?: string;
9
+ }
10
+ export type HeadingDecision = {
11
+ mode: 'none';
12
+ } | {
13
+ /** Full on the profile pane, compact everywhere else. */
14
+ mode: 'full' | 'compact';
15
+ /** The profile (WebID or document) to present. */
16
+ subjectUri: string;
17
+ paneName?: string;
18
+ };
19
+ export interface HeadingInput {
20
+ view: NavigationView;
21
+ viaAccountMenu: boolean;
22
+ /** WebID of the logged-in user. */
23
+ viewer?: string;
24
+ pageUrl: string;
25
+ /** WebID of the person whose pod the page is in, if known. */
26
+ owner?: string;
27
+ /** URIs of the storages of that pod. */
28
+ storageUris: string[];
29
+ }
30
+ /**
31
+ * Profile and friends panes present their own subject. Any other pane shows the owner of
32
+ * the pod the page is in, unless that is the viewer, or the view came from the account menu
33
+ * and so shows the viewer's own content.
34
+ */
35
+ export declare function deriveHeading(input: HeadingInput): HeadingDecision;
36
+ export interface NavbarSelection {
37
+ paneName?: string;
38
+ paneUri?: string;
39
+ }
40
+ /** What the navbar should have selected: the displayed pane, or Profile on a WebID. */
41
+ export declare function deriveNavbarSelection(view: NavigationView, pageIsWebId: boolean): NavbarSelection;
42
+ /**
43
+ * @param storageItemCount how many storage items the navbar has; a single storage is
44
+ * selected even when the view does not say which one it was
45
+ */
46
+ export declare function isNavbarItemSelected(item: NavbarItemRef, selection: NavbarSelection, storageItemCount: number): boolean;
47
+ /** The item to select for a pane: the one for that subject, else the first for that pane. */
48
+ export declare function pickNavbarItem<Item extends NavbarItemRef>(items: Item[], paneName: string, paneUri?: string): Item | undefined;
49
+ /** The navbar is not offered in the viewer's own pod, nor over account-menu content. */
50
+ export declare function isNavbarHidden(input: {
51
+ viaAccountMenu: boolean;
52
+ ownProfile: boolean;
53
+ inViewerPod: boolean;
54
+ }): boolean;
55
+ export interface ExplorerHeaderInput {
56
+ isRootResource: boolean;
57
+ isWebId: boolean;
58
+ /**
59
+ * The view shows a person's own subject or the viewer's content, not the resource the
60
+ * page URL points at, so the resource header only fits inside the viewer's own pod.
61
+ */
62
+ viewerPodOnly: boolean;
63
+ inViewerPod: boolean;
64
+ }
65
+ /** Whether the header describing a resource fits the view. */
66
+ export declare function deriveExplorerHeader(input: ExplorerHeaderInput): boolean;
67
+ /** The header is never shown over a person's profile or friends, whatever the resource. */
68
+ export declare function explorerHeaderForPane(resourceHeader: boolean, paneName?: string): boolean;
69
+ //# sourceMappingURL=chrome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/navigation/chrome.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,gFAAgF;AAChF,eAAO,MAAM,YAAY,UAAwB,CAAA;AAEjD,wBAAgB,YAAY,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAID,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IACA,yDAAyD;IACzD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,cAAc,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,EAAE,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAE,KAAK,EAAE,YAAY,GAAG,eAAe,CAqBnE;AAID,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,uFAAuF;AACvF,wBAAgB,qBAAqB,CAAE,IAAI,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,GAAG,eAAe,CAKlG;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,eAAe,EAC1B,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAMT;AAED,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,IAAI,SAAS,aAAa,EACvD,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,GAAG,SAAS,CAGlB;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAE,KAAK,EAAE;IAAE,cAAc,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAEtH;AAID,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,8DAA8D;AAC9D,wBAAgB,oBAAoB,CAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAGzE;AAED,2FAA2F;AAC3F,wBAAgB,qBAAqB,CAAE,cAAc,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAE1F"}
@@ -0,0 +1,43 @@
1
+ //#region src/navigation/chrome.ts
2
+ var e = ["profile", "social"];
3
+ function t(t) {
4
+ return t !== void 0 && e.includes(t);
5
+ }
6
+ function n(e) {
7
+ let { view: n, viaAccountMenu: r, viewer: i, pageUrl: a, owner: o, storageUris: s } = e, c = n.pane, l = c === "profile" || c === "social" ? o !== void 0 : c === "folder" && s.some((e) => !n.subject || e === n.subject), u = l || !r ? o : void 0;
8
+ return t(c) ? {
9
+ mode: c === "profile" ? "full" : "compact",
10
+ subjectUri: n.subject || (l ? o : void 0) || a,
11
+ paneName: c
12
+ } : !u || u === i ? { mode: "none" } : {
13
+ mode: "compact",
14
+ subjectUri: u,
15
+ paneName: c
16
+ };
17
+ }
18
+ function r(e, t) {
19
+ return {
20
+ paneName: e.pane ?? (t ? "profile" : void 0),
21
+ paneUri: e.subject
22
+ };
23
+ }
24
+ function i(e, t, n) {
25
+ return !t.paneName || e.paneName !== t.paneName ? !1 : e.paneName === "folder" ? t.paneUri ? t.paneUri === e.paneUri : n === 1 : !0;
26
+ }
27
+ function a(e, t, n) {
28
+ let r = e.filter((e) => e.paneName === t);
29
+ return r.find((e) => e.paneUri === n) ?? r[0];
30
+ }
31
+ function o(e) {
32
+ return e.viaAccountMenu || e.ownProfile || e.inViewerPod;
33
+ }
34
+ function s(e) {
35
+ return e.isRootResource || e.isWebId ? !1 : !e.viewerPodOnly || e.inViewerPod;
36
+ }
37
+ function c(e, n) {
38
+ return e && !t(n);
39
+ }
40
+ //#endregion
41
+ export { e as PERSON_PANES, s as deriveExplorerHeader, n as deriveHeading, r as deriveNavbarSelection, c as explorerHeaderForPane, o as isNavbarHidden, i as isNavbarItemSelected, t as isPersonPane, a as pickNavbarItem };
42
+
43
+ //# sourceMappingURL=chrome.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome.esm.js","names":["PERSON_PANES","isPersonPane","paneName","deriveHeading","input","view","ownerHasPane","owner","storageUris","uri","ownerUri","viaAccountMenu","pageUrl","viewer","deriveNavbarSelection","pageIsWebId","isNavbarItemSelected","selection","item","storageItemCount","pickNavbarItem","forPane","items","paneUri","isNavbarHidden","deriveExplorerHeader","explorerHeaderForPane","resourceHeader"],"sources":["../../src/navigation/chrome.ts"],"sourcesContent":["/*\n * The rules for what the page chrome shows, as pure functions.\n *\n * What the user sees depends on the page URL, the pane that was last opened, whether the\n * account menu opened it, who is logged in and whose pod the URL is in. These functions\n * decide it from those inputs alone: they read no history, DOM or session, so every rule\n * can be tested in one place. The heading, navbar, outline and file explorer provider\n * only apply the result.\n */\n\nimport { type NavigationView } from './state'\n\n/** Registry names of the panes that present a person rather than a resource. */\nexport const PERSON_PANES = ['profile', 'social']\n\nexport function isPersonPane (paneName?: string): boolean {\n return paneName !== undefined && PERSON_PANES.includes(paneName)\n}\n\n/** The parts of a navbar item that the rules look at. */\nexport interface NavbarItemRef {\n paneName?: string\n paneUri?: string\n}\n\n// Profile heading\n\nexport type HeadingDecision =\n | { mode: 'none' }\n | {\n /** Full on the profile pane, compact everywhere else. */\n mode: 'full' | 'compact'\n /** The profile (WebID or document) to present. */\n subjectUri: string\n paneName?: string\n }\n\nexport interface HeadingInput {\n view: NavigationView\n viaAccountMenu: boolean\n /** WebID of the logged-in user. */\n viewer?: string\n pageUrl: string\n /** WebID of the person whose pod the page is in, if known. */\n owner?: string\n /** URIs of the storages of that pod. */\n storageUris: string[]\n}\n\n/**\n * Profile and friends panes present their own subject. Any other pane shows the owner of\n * the pod the page is in, unless that is the viewer, or the view came from the account menu\n * and so shows the viewer's own content.\n */\nexport function deriveHeading (input: HeadingInput): HeadingDecision {\n const { view, viaAccountMenu, viewer, pageUrl, owner, storageUris } = input\n const paneName = view.pane\n\n // Whether the pod owner's navbar has an item for the displayed pane: Profile and Friends\n // whenever there is an owner, and a storage by its URI (any of them when the view names none).\n const ownerHasPane = paneName === 'profile' || paneName === 'social'\n ? owner !== undefined\n : paneName === 'folder' && storageUris.some(uri => !view.subject || uri === view.subject)\n const ownerUri = ownerHasPane || !viaAccountMenu ? owner : undefined\n\n if (!isPersonPane(paneName)) {\n if (!ownerUri || ownerUri === viewer) return { mode: 'none' }\n return { mode: 'compact', subjectUri: ownerUri, paneName }\n }\n\n return {\n mode: paneName === 'profile' ? 'full' : 'compact',\n subjectUri: view.subject || (ownerHasPane ? owner : undefined) || pageUrl,\n paneName\n }\n}\n\n// Navbar\n\nexport interface NavbarSelection {\n paneName?: string\n paneUri?: string\n}\n\n/** What the navbar should have selected: the displayed pane, or Profile on a WebID. */\nexport function deriveNavbarSelection (view: NavigationView, pageIsWebId: boolean): NavbarSelection {\n return {\n paneName: view.pane ?? (pageIsWebId ? 'profile' : undefined),\n paneUri: view.subject\n }\n}\n\n/**\n * @param storageItemCount how many storage items the navbar has; a single storage is\n * selected even when the view does not say which one it was\n */\nexport function isNavbarItemSelected (\n item: NavbarItemRef,\n selection: NavbarSelection,\n storageItemCount: number\n): boolean {\n if (!selection.paneName || item.paneName !== selection.paneName) return false\n if (item.paneName === 'folder') {\n return selection.paneUri ? selection.paneUri === item.paneUri : storageItemCount === 1\n }\n return true\n}\n\n/** The item to select for a pane: the one for that subject, else the first for that pane. */\nexport function pickNavbarItem<Item extends NavbarItemRef> (\n items: Item[],\n paneName: string,\n paneUri?: string\n): Item | undefined {\n const forPane = items.filter(item => item.paneName === paneName)\n return forPane.find(item => item.paneUri === paneUri) ?? forPane[0]\n}\n\n/** The navbar is not offered in the viewer's own pod, nor over account-menu content. */\nexport function isNavbarHidden (input: { viaAccountMenu: boolean, ownProfile: boolean, inViewerPod: boolean }): boolean {\n return input.viaAccountMenu || input.ownProfile || input.inViewerPod\n}\n\n// File explorer header\n\nexport interface ExplorerHeaderInput {\n isRootResource: boolean\n isWebId: boolean\n /**\n * The view shows a person's own subject or the viewer's content, not the resource the\n * page URL points at, so the resource header only fits inside the viewer's own pod.\n */\n viewerPodOnly: boolean\n inViewerPod: boolean\n}\n\n/** Whether the header describing a resource fits the view. */\nexport function deriveExplorerHeader (input: ExplorerHeaderInput): boolean {\n if (input.isRootResource || input.isWebId) return false\n return !input.viewerPodOnly || input.inViewerPod\n}\n\n/** The header is never shown over a person's profile or friends, whatever the resource. */\nexport function explorerHeaderForPane (resourceHeader: boolean, paneName?: string): boolean {\n return resourceHeader && !isPersonPane(paneName)\n}\n"],"mappings":";AAaA,IAAaA,IAAe,CAAC,WAAW,QAAQ;AAEhD,SAAgBC,EAAc,GAA4B;CACxD,OAAOC,MAAa,KAAA,KAAaF,EAAa,SAASE,CAAQ;AACjE;AAqCA,SAAgBC,EAAe,GAAsC;CACnE,IAAM,EAAE,SAAM,mBAAgB,WAAQ,YAAS,UAAO,mBAAgBC,GAChEF,IAAWG,EAAK,MAIhBC,IAAeJ,MAAa,aAAaA,MAAa,WACxDK,MAAU,KAAA,IACVL,MAAa,YAAYM,EAAY,MAAK,MAAO,CAACH,EAAK,WAAWI,MAAQJ,EAAK,OAAO,GACpFK,IAAWJ,KAAgB,CAACK,IAAiBJ,IAAQ,KAAA;CAO3D,OALKN,EAAaC,CAAQ,IAKnB;EACL,MAAMA,MAAa,YAAY,SAAS;EACxC,YAAYG,EAAK,YAAYC,IAAeC,IAAQ,KAAA,MAAcK;EAClE;CACF,IARM,CAACF,KAAYA,MAAaG,IAAe,EAAE,MAAM,OAAO,IACrD;EAAE,MAAM;EAAW,YAAYH;EAAU;CAAS;AAQ7D;AAUA,SAAgBI,EAAuB,GAAsB,GAAuC;CAClG,OAAO;EACL,UAAUT,EAAK,SAASU,IAAc,YAAY,KAAA;EAClD,SAASV,EAAK;CAChB;AACF;AAMA,SAAgBW,EACd,GACA,GACA,GACS;CAKT,OAJI,CAACC,EAAU,YAAYC,EAAK,aAAaD,EAAU,WAAiB,KACpEC,EAAK,aAAa,WACbD,EAAU,UAAUA,EAAU,YAAYC,EAAK,UAAUC,MAAqB,IAEhF;AACT;AAGA,SAAgBC,EACd,GACA,GACA,GACkB;CAClB,IAAMC,IAAUC,EAAM,QAAO,MAAQJ,EAAK,aAAahB,CAAQ;CAC/D,OAAOmB,EAAQ,MAAK,MAAQH,EAAK,YAAYK,CAAO,KAAKF,EAAQ;AACnE;AAGA,SAAgBG,EAAgB,GAAwF;CACtH,OAAOpB,EAAM,kBAAkBA,EAAM,cAAcA,EAAM;AAC3D;AAgBA,SAAgBqB,EAAsB,GAAqC;CAEzE,OADIrB,EAAM,kBAAkBA,EAAM,UAAgB,KAC3C,CAACA,EAAM,iBAAiBA,EAAM;AACvC;AAGA,SAAgBsB,EAAuB,GAAyB,GAA4B;CAC1F,OAAOC,KAAkB,CAAC1B,EAAaC,CAAQ;AACjD"}
@@ -0,0 +1,2 @@
1
+ const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/paneUtils.cjs.js"),n=require("./state.cjs.js"),r=require("./navbarVisibility.cjs.js");function i(i){let{store:a,outliner:o,byName:s,effects:c}=i,l=0;async function u(n,r){if(r.subject){let e=a.sym(r.subject);if(r.kind===`profile`)return t.getProfilePaneFromURI(e);if(r.kind===`friends`)return t.getSocialPaneFromURI(e);if(r.kind===`storage`)return t.getFolderPaneForStorage(e)}return r.pane?s(r.pane)??void 0:e.isWebIdUri(n)?t.getProfilePaneFromURI(n):void 0}async function d(e,n,r){switch(e.kind){case`restore`:return u(n,r.view);case`profile`:return t.getProfilePaneFromURI(a.sym(e.subject));case`friends`:return t.getSocialPaneFromURI(a.sym(e.subject));case`storage`:return e.pane;case`app`:return s(e.pane)}}return{async show(e){let t=++l,i=n.readNavigationState(),s=e.kind===`restore`?i.viaAccountMenu?`accountMenu`:`default`:e.source??`default`;s===`accountMenu`&&r.setNavbarHidden(!0);let u=a.sym(e.kind===`restore`&&e.subject?e.subject:window.location.href),f=await d(e,u,i);if(t===l){if(!f&&e.kind!==`restore`)console.warn(`Could not open the requested view for the logged-in user.`);else{if(o.GotoSubject(u,!0,f??void 0,!0,void 0,void 0,{source:s}),s!==`accountMenu`){let{view:e}=n.readNavigationState();e.pane&&c.selectNavbarPane(e.pane,e.subject)}await c.refreshHeading(e.kind===`restore`&&e.forceHeading===!0)}}}}}exports.createNavigationController=i;
2
+ //# sourceMappingURL=controller.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.cjs.js","names":["getProfilePaneFromURI","getSocialPaneFromURI","getFolderPaneForStorage","isWebIdUri","readNavigationState","require_webIdUtils","require_paneUtils","require_state","require_navbarVisibility","createNavigationController","deps","latest","paneForView","view","paneSubject","store","byName","subject","paneFor","intent","state","request","source","pane","outliner","effects"],"sources":["../../src/navigation/controller.ts"],"sourcesContent":["/*\n * The one place that displays a view and brings the page chrome in line with it.\n *\n * The account menu, the navbar, a page load, Enter in the address bar, back and forward and a\n * layout change used to each resolve a pane, call `GotoSubject` and then do some of the follow-up\n * themselves. Now each describes what it wants as an intent, and the follow-up is always the same:\n * navbar visibility and selection, then the profile heading.\n */\n\nimport type { LiveStore, NamedNode } from 'rdflib'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { getFolderPaneForStorage, getProfilePaneFromURI, getSocialPaneFromURI, type PaneItem } from '../utils/paneUtils'\nimport { setNavbarHidden } from './navbarVisibility'\nimport { readNavigationState, type NavigationState, type NavigationView } from './state'\nimport type { NavigationSource } from './options'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\nexport type NavigationIntent =\n /** Display what the current history entry says was displayed, for the page's own URL. */\n | {\n kind: 'restore'\n /** The page subject, when it is not the current URL. */\n subject?: string\n /** Redo the heading even if it believes it already shows the right profile. */\n forceHeading?: boolean\n }\n /** A person's profile or friends, by WebID. */\n | { kind: 'profile' | 'friends', subject: string, source?: NavigationSource }\n /** A storage, as the navbar or the account menu offers it. */\n | { kind: 'storage', pane: PaneItem, source?: NavigationSource }\n /** A pane of the application itself, by registry name (dashboard, preferences). */\n | { kind: 'app', pane: string, source?: NavigationSource }\n\nexport interface NavigationEffects {\n selectNavbarPane: (paneName: string, paneUri?: string) => void\n refreshHeading: (force: boolean) => Promise<void>\n}\n\nexport interface NavigationDeps {\n store: LiveStore\n outliner: OutlineManager\n byName: (name: string) => PaneDefinition | null | undefined\n effects: NavigationEffects\n}\n\nexport interface NavigationController {\n /**\n * Display what the intent asks for. If another intent arrives while this one is still\n * resolving its pane, only the later one is displayed.\n */\n show: (intent: NavigationIntent) => Promise<void>\n}\n\ntype DisplayedPane = PaneItem | PaneDefinition | null | undefined\n\nexport function createNavigationController (deps: NavigationDeps): NavigationController {\n const { store, outliner, byName, effects } = deps\n let latest = 0\n\n async function paneForView (subject: NamedNode, view: NavigationView): Promise<DisplayedPane> {\n // These panes render a subject other than the page URL.\n if (view.subject) {\n const paneSubject = store.sym(view.subject)\n if (view.kind === 'profile') return getProfilePaneFromURI(paneSubject)\n if (view.kind === 'friends') return getSocialPaneFromURI(paneSubject)\n if (view.kind === 'storage') return getFolderPaneForStorage(paneSubject)\n }\n if (view.pane) return byName(view.pane) ?? undefined\n return isWebIdUri(subject) ? getProfilePaneFromURI(subject) : undefined\n }\n\n async function paneFor (intent: NavigationIntent, subject: NamedNode, state: NavigationState): Promise<DisplayedPane> {\n switch (intent.kind) {\n case 'restore': return paneForView(subject, state.view)\n case 'profile': return getProfilePaneFromURI(store.sym(intent.subject))\n case 'friends': return getSocialPaneFromURI(store.sym(intent.subject))\n case 'storage': return intent.pane\n case 'app': return byName(intent.pane)\n }\n }\n\n return {\n async show (intent) {\n const request = ++latest\n const state = readNavigationState()\n const source: NavigationSource = intent.kind === 'restore'\n ? (state.viaAccountMenu ? 'accountMenu' : 'default')\n : intent.source ?? 'default'\n // The account menu shows the viewer's own content, so the navbar for the page is not offered\n if (source === 'accountMenu') setNavbarHidden(true)\n\n const subject = store.sym(intent.kind === 'restore' && intent.subject ? intent.subject : window.location.href)\n const pane = await paneFor(intent, subject, state)\n if (request !== latest) return\n\n // Without a pane the outline would fall back to the page URL's own default view, which\n // is only right when restoring an entry that displayed nothing in particular.\n if (!pane && intent.kind !== 'restore') {\n console.warn('Could not open the requested view for the logged-in user.')\n return\n }\n\n outliner.GotoSubject(subject, true, pane ?? undefined, true, undefined, undefined, { source })\n\n if (source !== 'accountMenu') {\n const { view } = readNavigationState()\n if (view.pane) effects.selectNavbarPane(view.pane, view.subject)\n }\n await effects.refreshHeading(intent.kind === 'restore' && intent.forceHeading === true)\n }\n }\n}\n"],"mappings":"A,wJAwDA,SAAgBS,EAA4B,EAA4C,CACtF,GAAM,CAAE,QAAO,WAAU,SAAQ,WAAYC,EACzCC,EAAS,EAEb,eAAeC,EAAa,EAAoB,EAA8C,CAE5F,GAAIC,EAAK,QAAS,CAChB,IAAMC,EAAcC,EAAM,IAAIF,EAAK,OAAO,EAC1C,GAAIA,EAAK,OAAS,UAAW,OAAOb,EAAAA,sBAAsBc,CAAW,EACrE,GAAID,EAAK,OAAS,UAAW,OAAOZ,EAAAA,qBAAqBa,CAAW,EACpE,GAAID,EAAK,OAAS,UAAW,OAAOX,EAAAA,wBAAwBY,CAAW,CACzE,CAEA,OADID,EAAK,KAAaG,EAAOH,EAAK,IAAI,GAAK,IAAA,GACpCV,EAAAA,WAAWc,CAAO,EAAIjB,EAAAA,sBAAsBiB,CAAO,EAAI,IAAA,EAChE,CAEA,eAAeC,EAAS,EAA0B,EAAoB,EAAgD,CACpH,OAAQC,EAAO,KAAf,CACE,IAAK,UAAW,OAAOP,EAAYK,EAASG,EAAM,IAAI,EACtD,IAAK,UAAW,OAAOpB,EAAAA,sBAAsBe,EAAM,IAAII,EAAO,OAAO,CAAC,EACtE,IAAK,UAAW,OAAOlB,EAAAA,qBAAqBc,EAAM,IAAII,EAAO,OAAO,CAAC,EACrE,IAAK,UAAW,OAAOA,EAAO,KAC9B,IAAK,MAAO,OAAOH,EAAOG,EAAO,IAAI,CACvC,CACF,CAEA,MAAO,CACL,MAAM,KAAM,EAAQ,CAClB,IAAME,EAAU,EAAEV,EACZS,EAAQhB,EAAAA,oBAAoB,EAC5BkB,EAA2BH,EAAO,OAAS,UAC5CC,EAAM,eAAiB,cAAgB,UACxCD,EAAO,QAAU,UAEjBG,IAAW,eAAed,EAAA,gBAAgB,EAAI,EAElD,IAAMS,EAAUF,EAAM,IAAII,EAAO,OAAS,WAAaA,EAAO,QAAUA,EAAO,QAAU,OAAO,SAAS,IAAI,EACvGI,EAAO,MAAML,EAAQC,EAAQF,EAASG,CAAK,EACjD,GAAIC,IAAYV,EAIhB,IAAI,CAACY,GAAQJ,EAAO,OAAS,UAC3B,QAAQ,KAAK,2DAA2D,MAI1E,CAEA,GAFAK,EAAS,YAAYP,EAAS,GAAMM,GAAQ,IAAA,GAAW,GAAM,IAAA,GAAW,IAAA,GAAW,CAAE,QAAO,CAAC,EAEzFD,IAAW,cAAe,CAC5B,GAAM,CAAE,QAASlB,EAAAA,oBAAoB,EACjCS,EAAK,MAAMY,EAAQ,iBAAiBZ,EAAK,KAAMA,EAAK,OAAO,CACjE,CACA,MAAMY,EAAQ,eAAeN,EAAO,OAAS,WAAaA,EAAO,eAAiB,EAAI,CANO,CAF7F,CASF,CACF,CACF,C"}
@@ -0,0 +1,51 @@
1
+ import { LiveStore } from '../../node_modules/rdflib';
2
+ import { PaneDefinition } from '../../node_modules/pane-registry';
3
+ import { OutlineManager } from '../outline/manager';
4
+ import { PaneItem } from '../utils/paneUtils';
5
+ import { NavigationSource } from './options';
6
+ export type NavigationIntent =
7
+ /** Display what the current history entry says was displayed, for the page's own URL. */
8
+ {
9
+ kind: 'restore';
10
+ /** The page subject, when it is not the current URL. */
11
+ subject?: string;
12
+ /** Redo the heading even if it believes it already shows the right profile. */
13
+ forceHeading?: boolean;
14
+ }
15
+ /** A person's profile or friends, by WebID. */
16
+ | {
17
+ kind: 'profile' | 'friends';
18
+ subject: string;
19
+ source?: NavigationSource;
20
+ }
21
+ /** A storage, as the navbar or the account menu offers it. */
22
+ | {
23
+ kind: 'storage';
24
+ pane: PaneItem;
25
+ source?: NavigationSource;
26
+ }
27
+ /** A pane of the application itself, by registry name (dashboard, preferences). */
28
+ | {
29
+ kind: 'app';
30
+ pane: string;
31
+ source?: NavigationSource;
32
+ };
33
+ export interface NavigationEffects {
34
+ selectNavbarPane: (paneName: string, paneUri?: string) => void;
35
+ refreshHeading: (force: boolean) => Promise<void>;
36
+ }
37
+ export interface NavigationDeps {
38
+ store: LiveStore;
39
+ outliner: OutlineManager;
40
+ byName: (name: string) => PaneDefinition | null | undefined;
41
+ effects: NavigationEffects;
42
+ }
43
+ export interface NavigationController {
44
+ /**
45
+ * Display what the intent asks for. If another intent arrives while this one is still
46
+ * resolving its pane, only the later one is displayed.
47
+ */
48
+ show: (intent: NavigationIntent) => Promise<void>;
49
+ }
50
+ export declare function createNavigationController(deps: NavigationDeps): NavigationController;
51
+ //# sourceMappingURL=controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/navigation/controller.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAwE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGxH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAGjD,MAAM,MAAM,gBAAgB;AAC1B,yFAAyF;AACvF;IACA,IAAI,EAAE,SAAS,CAAA;IACf,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+EAA+E;IAC/E,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB;AACD,+CAA+C;GAC7C;IAAE,IAAI,EAAE,SAAS,GAAG,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE;AAC7E,8DAA8D;GAC5D;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE;AAChE,mFAAmF;GACjF;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAAE,CAAA;AAE5D,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC9D,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,SAAS,CAAA;IAChB,QAAQ,EAAE,cAAc,CAAA;IACxB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,IAAI,GAAG,SAAS,CAAA;IAC3D,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAClD;AAID,wBAAgB,0BAA0B,CAAE,IAAI,EAAE,cAAc,GAAG,oBAAoB,CAwDtF"}
@@ -0,0 +1,45 @@
1
+ import { isWebIdUri as e } from "../utils/webIdUtils.esm.js";
2
+ import { getFolderPaneForStorage as t, getProfilePaneFromURI as n, getSocialPaneFromURI as r } from "../utils/paneUtils.esm.js";
3
+ import { readNavigationState as i } from "./state.esm.js";
4
+ import { setNavbarHidden as a } from "./navbarVisibility.esm.js";
5
+ //#region src/navigation/controller.ts
6
+ function o(o) {
7
+ let { store: s, outliner: c, byName: l, effects: u } = o, d = 0;
8
+ async function f(i, a) {
9
+ if (a.subject) {
10
+ let e = s.sym(a.subject);
11
+ if (a.kind === "profile") return n(e);
12
+ if (a.kind === "friends") return r(e);
13
+ if (a.kind === "storage") return t(e);
14
+ }
15
+ return a.pane ? l(a.pane) ?? void 0 : e(i) ? n(i) : void 0;
16
+ }
17
+ async function p(e, t, i) {
18
+ switch (e.kind) {
19
+ case "restore": return f(t, i.view);
20
+ case "profile": return n(s.sym(e.subject));
21
+ case "friends": return r(s.sym(e.subject));
22
+ case "storage": return e.pane;
23
+ case "app": return l(e.pane);
24
+ }
25
+ }
26
+ return { async show(e) {
27
+ let t = ++d, n = i(), r = e.kind === "restore" ? n.viaAccountMenu ? "accountMenu" : "default" : e.source ?? "default";
28
+ r === "accountMenu" && a(!0);
29
+ let o = s.sym(e.kind === "restore" && e.subject ? e.subject : window.location.href), l = await p(e, o, n);
30
+ if (t === d) {
31
+ if (!l && e.kind !== "restore") console.warn("Could not open the requested view for the logged-in user.");
32
+ else {
33
+ if (c.GotoSubject(o, !0, l ?? void 0, !0, void 0, void 0, { source: r }), r !== "accountMenu") {
34
+ let { view: e } = i();
35
+ e.pane && u.selectNavbarPane(e.pane, e.subject);
36
+ }
37
+ await u.refreshHeading(e.kind === "restore" && e.forceHeading === !0);
38
+ }
39
+ }
40
+ } };
41
+ }
42
+ //#endregion
43
+ export { o as createNavigationController };
44
+
45
+ //# sourceMappingURL=controller.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"controller.esm.js","names":["createNavigationController","deps","latest","paneForView","view","paneSubject","store","getProfilePaneFromURI","getSocialPaneFromURI","getFolderPaneForStorage","byName","isWebIdUri","subject","paneFor","intent","state","request","readNavigationState","source","setNavbarHidden","pane","outliner","effects"],"sources":["../../src/navigation/controller.ts"],"sourcesContent":["/*\n * The one place that displays a view and brings the page chrome in line with it.\n *\n * The account menu, the navbar, a page load, Enter in the address bar, back and forward and a\n * layout change used to each resolve a pane, call `GotoSubject` and then do some of the follow-up\n * themselves. Now each describes what it wants as an intent, and the follow-up is always the same:\n * navbar visibility and selection, then the profile heading.\n */\n\nimport type { LiveStore, NamedNode } from 'rdflib'\nimport type { PaneDefinition } from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { getFolderPaneForStorage, getProfilePaneFromURI, getSocialPaneFromURI, type PaneItem } from '../utils/paneUtils'\nimport { setNavbarHidden } from './navbarVisibility'\nimport { readNavigationState, type NavigationState, type NavigationView } from './state'\nimport type { NavigationSource } from './options'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\nexport type NavigationIntent =\n /** Display what the current history entry says was displayed, for the page's own URL. */\n | {\n kind: 'restore'\n /** The page subject, when it is not the current URL. */\n subject?: string\n /** Redo the heading even if it believes it already shows the right profile. */\n forceHeading?: boolean\n }\n /** A person's profile or friends, by WebID. */\n | { kind: 'profile' | 'friends', subject: string, source?: NavigationSource }\n /** A storage, as the navbar or the account menu offers it. */\n | { kind: 'storage', pane: PaneItem, source?: NavigationSource }\n /** A pane of the application itself, by registry name (dashboard, preferences). */\n | { kind: 'app', pane: string, source?: NavigationSource }\n\nexport interface NavigationEffects {\n selectNavbarPane: (paneName: string, paneUri?: string) => void\n refreshHeading: (force: boolean) => Promise<void>\n}\n\nexport interface NavigationDeps {\n store: LiveStore\n outliner: OutlineManager\n byName: (name: string) => PaneDefinition | null | undefined\n effects: NavigationEffects\n}\n\nexport interface NavigationController {\n /**\n * Display what the intent asks for. If another intent arrives while this one is still\n * resolving its pane, only the later one is displayed.\n */\n show: (intent: NavigationIntent) => Promise<void>\n}\n\ntype DisplayedPane = PaneItem | PaneDefinition | null | undefined\n\nexport function createNavigationController (deps: NavigationDeps): NavigationController {\n const { store, outliner, byName, effects } = deps\n let latest = 0\n\n async function paneForView (subject: NamedNode, view: NavigationView): Promise<DisplayedPane> {\n // These panes render a subject other than the page URL.\n if (view.subject) {\n const paneSubject = store.sym(view.subject)\n if (view.kind === 'profile') return getProfilePaneFromURI(paneSubject)\n if (view.kind === 'friends') return getSocialPaneFromURI(paneSubject)\n if (view.kind === 'storage') return getFolderPaneForStorage(paneSubject)\n }\n if (view.pane) return byName(view.pane) ?? undefined\n return isWebIdUri(subject) ? getProfilePaneFromURI(subject) : undefined\n }\n\n async function paneFor (intent: NavigationIntent, subject: NamedNode, state: NavigationState): Promise<DisplayedPane> {\n switch (intent.kind) {\n case 'restore': return paneForView(subject, state.view)\n case 'profile': return getProfilePaneFromURI(store.sym(intent.subject))\n case 'friends': return getSocialPaneFromURI(store.sym(intent.subject))\n case 'storage': return intent.pane\n case 'app': return byName(intent.pane)\n }\n }\n\n return {\n async show (intent) {\n const request = ++latest\n const state = readNavigationState()\n const source: NavigationSource = intent.kind === 'restore'\n ? (state.viaAccountMenu ? 'accountMenu' : 'default')\n : intent.source ?? 'default'\n // The account menu shows the viewer's own content, so the navbar for the page is not offered\n if (source === 'accountMenu') setNavbarHidden(true)\n\n const subject = store.sym(intent.kind === 'restore' && intent.subject ? intent.subject : window.location.href)\n const pane = await paneFor(intent, subject, state)\n if (request !== latest) return\n\n // Without a pane the outline would fall back to the page URL's own default view, which\n // is only right when restoring an entry that displayed nothing in particular.\n if (!pane && intent.kind !== 'restore') {\n console.warn('Could not open the requested view for the logged-in user.')\n return\n }\n\n outliner.GotoSubject(subject, true, pane ?? undefined, true, undefined, undefined, { source })\n\n if (source !== 'accountMenu') {\n const { view } = readNavigationState()\n if (view.pane) effects.selectNavbarPane(view.pane, view.subject)\n }\n await effects.refreshHeading(intent.kind === 'restore' && intent.forceHeading === true)\n }\n }\n}\n"],"mappings":";;;;;AAwDA,SAAgBA,EAA4B,GAA4C;CACtF,IAAM,EAAE,UAAO,aAAU,WAAQ,eAAYC,GACzCC,IAAS;CAEb,eAAeC,EAAa,GAAoB,GAA8C;EAE5F,IAAIC,EAAK,SAAS;GAChB,IAAMC,IAAcC,EAAM,IAAIF,EAAK,OAAO;GAC1C,IAAIA,EAAK,SAAS,WAAW,OAAOG,EAAsBF,CAAW;GACrE,IAAID,EAAK,SAAS,WAAW,OAAOI,EAAqBH,CAAW;GACpE,IAAID,EAAK,SAAS,WAAW,OAAOK,EAAwBJ,CAAW;EACzE;EAEA,OADID,EAAK,OAAaM,EAAON,EAAK,IAAI,KAAK,KAAA,IACpCO,EAAWC,CAAO,IAAIL,EAAsBK,CAAO,IAAI,KAAA;CAChE;CAEA,eAAeC,EAAS,GAA0B,GAAoB,GAAgD;EACpH,QAAQC,EAAO,MAAf;GACE,KAAK,WAAW,OAAOX,EAAYS,GAASG,EAAM,IAAI;GACtD,KAAK,WAAW,OAAOR,EAAsBD,EAAM,IAAIQ,EAAO,OAAO,CAAC;GACtE,KAAK,WAAW,OAAON,EAAqBF,EAAM,IAAIQ,EAAO,OAAO,CAAC;GACrE,KAAK,WAAW,OAAOA,EAAO;GAC9B,KAAK,OAAO,OAAOJ,EAAOI,EAAO,IAAI;EACvC;CACF;CAEA,OAAO,EACL,MAAM,KAAM,GAAQ;EAClB,IAAME,IAAU,EAAEd,GACZa,IAAQE,EAAoB,GAC5BC,IAA2BJ,EAAO,SAAS,YAC5CC,EAAM,iBAAiB,gBAAgB,YACxCD,EAAO,UAAU;EAErB,AAAII,MAAW,iBAAeC,EAAgB,EAAI;EAElD,IAAMP,IAAUN,EAAM,IAAIQ,EAAO,SAAS,aAAaA,EAAO,UAAUA,EAAO,UAAU,OAAO,SAAS,IAAI,GACvGM,IAAO,MAAMP,EAAQC,GAAQF,GAASG,CAAK;EACjD,IAAIC,MAAYd,GAIhB;OAAI,CAACkB,KAAQN,EAAO,SAAS,WAC3B,QAAQ,KAAK,2DAA2D;QAI1E;IAEA,IAFAO,EAAS,YAAYT,GAAS,IAAMQ,KAAQ,KAAA,GAAW,IAAM,KAAA,GAAW,KAAA,GAAW,EAAE,UAAO,CAAC,GAEzFF,MAAW,eAAe;KAC5B,IAAM,EAAE,YAASD,EAAoB;KACrC,AAAIb,EAAK,QAAMkB,EAAQ,iBAAiBlB,EAAK,MAAMA,EAAK,OAAO;IACjE;IACA,MAAMkB,EAAQ,eAAeR,EAAO,SAAS,aAAaA,EAAO,iBAAiB,EAAI;GANO;EAF7F;CASF,EACF;AACF"}
@@ -0,0 +1,2 @@
1
+ const e=require("./state.cjs.js");var t=`solid-panes:navigated`;function n(n){let r={url:n.location.href,state:e.parseNavigationState(n.defaultView?.history.state)};n.dispatchEvent(new CustomEvent(t,{detail:r}))}function r(e,n=document){let r=t=>e(t.detail);return n.addEventListener(t,r),()=>n.removeEventListener(t,r)}exports.NAVIGATED_EVENT=t,exports.announceNavigation=n,exports.onNavigated=r;
2
+ //# sourceMappingURL=events.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.cjs.js","names":["parseNavigationState","require_state","NAVIGATED_EVENT","announceNavigation","detail","doc","onNavigated","handler","listener","event"],"sources":["../../src/navigation/events.ts"],"sourcesContent":["import { parseNavigationState, type NavigationState } from './state'\n\n/** Dispatched on the document after a view has been displayed and its history entry written. */\nexport const NAVIGATED_EVENT = 'solid-panes:navigated'\n\nexport interface NavigatedDetail {\n /** The page URL after displaying. */\n url: string\n /** What the history entry now says was displayed. */\n state: NavigationState\n}\n\n/**\n * Whoever calls `GotoSubject` directly (links and buttons in solid-ui, mashlib) gets the same\n * follow-up as the main page's own navigation, because the page chrome listens for this.\n */\nexport function announceNavigation (doc: Document): void {\n const detail: NavigatedDetail = {\n url: doc.location.href,\n state: parseNavigationState(doc.defaultView?.history.state)\n }\n doc.dispatchEvent(new CustomEvent<NavigatedDetail>(NAVIGATED_EVENT, { detail }))\n}\n\n/** Calls the listener after each navigation; returns a function that stops listening. */\nexport function onNavigated (listener: (detail: NavigatedDetail) => void, doc: Document = document): () => void {\n const handler = (event: Event) => listener((event as CustomEvent<NavigatedDetail>).detail)\n doc.addEventListener(NAVIGATED_EVENT, handler)\n return () => doc.removeEventListener(NAVIGATED_EVENT, handler)\n}\n"],"mappings":"A,kCAGA,IAAaE,EAAkB,wBAa/B,SAAgBC,EAAoB,EAAqB,CACvD,IAAMC,EAA0B,CAC9B,IAAKC,EAAI,SAAS,KAClB,MAAOL,EAAAA,qBAAqBK,EAAI,aAAa,QAAQ,KAAK,CAC5D,EACAA,EAAI,cAAc,IAAI,YAA6BH,EAAiB,CAAE,QAAO,CAAC,CAAC,CACjF,CAGA,SAAgBI,EAAa,EAA6C,EAAgB,SAAsB,CAC9G,IAAMC,EAAW,GAAiBC,EAAUC,EAAuC,MAAM,EAEzF,OADAJ,EAAI,iBAAiBH,EAAiBK,CAAO,MAChCF,EAAI,oBAAoBH,EAAiBK,CAAO,CAC/D,C"}
@@ -0,0 +1,17 @@
1
+ import { NavigationState } from './state';
2
+ /** Dispatched on the document after a view has been displayed and its history entry written. */
3
+ export declare const NAVIGATED_EVENT = "solid-panes:navigated";
4
+ export interface NavigatedDetail {
5
+ /** The page URL after displaying. */
6
+ url: string;
7
+ /** What the history entry now says was displayed. */
8
+ state: NavigationState;
9
+ }
10
+ /**
11
+ * Whoever calls `GotoSubject` directly (links and buttons in solid-ui, mashlib) gets the same
12
+ * follow-up as the main page's own navigation, because the page chrome listens for this.
13
+ */
14
+ export declare function announceNavigation(doc: Document): void;
15
+ /** Calls the listener after each navigation; returns a function that stops listening. */
16
+ export declare function onNavigated(listener: (detail: NavigatedDetail) => void, doc?: Document): () => void;
17
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/navigation/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAEpE,gGAAgG;AAChG,eAAO,MAAM,eAAe,0BAA0B,CAAA;AAEtD,MAAM,WAAW,eAAe;IAC9B,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAA;IACX,qDAAqD;IACrD,KAAK,EAAE,eAAe,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAMvD;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,EAAE,GAAG,GAAE,QAAmB,GAAG,MAAM,IAAI,CAI9G"}
@@ -0,0 +1,18 @@
1
+ import { parseNavigationState as e } from "./state.esm.js";
2
+ //#region src/navigation/events.ts
3
+ var t = "solid-panes:navigated";
4
+ function n(n) {
5
+ let r = {
6
+ url: n.location.href,
7
+ state: e(n.defaultView?.history.state)
8
+ };
9
+ n.dispatchEvent(new CustomEvent(t, { detail: r }));
10
+ }
11
+ function r(e, n = document) {
12
+ let r = (t) => e(t.detail);
13
+ return n.addEventListener(t, r), () => n.removeEventListener(t, r);
14
+ }
15
+ //#endregion
16
+ export { t as NAVIGATED_EVENT, n as announceNavigation, r as onNavigated };
17
+
18
+ //# sourceMappingURL=events.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.esm.js","names":["NAVIGATED_EVENT","announceNavigation","detail","doc","parseNavigationState","onNavigated","handler","listener","event"],"sources":["../../src/navigation/events.ts"],"sourcesContent":["import { parseNavigationState, type NavigationState } from './state'\n\n/** Dispatched on the document after a view has been displayed and its history entry written. */\nexport const NAVIGATED_EVENT = 'solid-panes:navigated'\n\nexport interface NavigatedDetail {\n /** The page URL after displaying. */\n url: string\n /** What the history entry now says was displayed. */\n state: NavigationState\n}\n\n/**\n * Whoever calls `GotoSubject` directly (links and buttons in solid-ui, mashlib) gets the same\n * follow-up as the main page's own navigation, because the page chrome listens for this.\n */\nexport function announceNavigation (doc: Document): void {\n const detail: NavigatedDetail = {\n url: doc.location.href,\n state: parseNavigationState(doc.defaultView?.history.state)\n }\n doc.dispatchEvent(new CustomEvent<NavigatedDetail>(NAVIGATED_EVENT, { detail }))\n}\n\n/** Calls the listener after each navigation; returns a function that stops listening. */\nexport function onNavigated (listener: (detail: NavigatedDetail) => void, doc: Document = document): () => void {\n const handler = (event: Event) => listener((event as CustomEvent<NavigatedDetail>).detail)\n doc.addEventListener(NAVIGATED_EVENT, handler)\n return () => doc.removeEventListener(NAVIGATED_EVENT, handler)\n}\n"],"mappings":";;AAGA,IAAaA,IAAkB;AAa/B,SAAgBC,EAAoB,GAAqB;CACvD,IAAMC,IAA0B;EAC9B,KAAKC,EAAI,SAAS;EAClB,OAAOC,EAAqBD,EAAI,aAAa,QAAQ,KAAK;CAC5D;CACA,EAAI,cAAc,IAAI,YAA6BH,GAAiB,EAAE,UAAO,CAAC,CAAC;AACjF;AAGA,SAAgBK,EAAa,GAA6C,IAAgB,UAAsB;CAC9G,IAAMC,KAAW,MAAiBC,EAAUC,EAAuC,MAAM;CAEzF,OADAL,EAAI,iBAAiBH,GAAiBM,CAAO,SAChCH,EAAI,oBAAoBH,GAAiBM,CAAO;AAC/D"}
@@ -0,0 +1,2 @@
1
+ const e=require("../utils/webIdUtils.cjs.js"),t=require("./chrome.cjs.js"),n=require("./podContext.cjs.js");let r=require("rdflib");var i=`navbar--hidden`,a=0;function o(e){++a,document.querySelector(`solid-panes-navbar`)?.classList.toggle(i,e)}async function s(i,s=!1){let c=++a,l=e.isOwnWebIdProfile((0,r.sym)(i));if(s||l){o(!0);return}let u=await n.isPageInViewerPod(i);c===a&&o(t.isNavbarHidden({viaAccountMenu:s,ownProfile:l,inViewerPod:u}))}exports.refreshNavbarVisibility=s,exports.setNavbarHidden=o;
2
+ //# sourceMappingURL=navbarVisibility.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbarVisibility.cjs.js","names":["isOwnWebIdProfile","sym","isPageInViewerPod","isNavbarHidden","require_webIdUtils","require_chrome","require_podContext","rdflib","NAVBAR_HIDDEN_CLASS","revision","setNavbarHidden","hidden","refreshNavbarVisibility","request","ownProfile","url","viaAccountMenu","inViewerPod"],"sources":["../../src/navigation/navbarVisibility.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { isOwnWebIdProfile } from '../utils/webIdUtils'\nimport { isNavbarHidden } from './chrome'\nimport { isPageInViewerPod } from './podContext'\n\nconst NAVBAR_HIDDEN_CLASS = 'navbar--hidden'\nlet revision = 0\n\n/** Show or hide the navbar, if the page has one. */\nexport function setNavbarHidden (hidden: boolean): void {\n ++revision\n document.querySelector<HTMLElement>('solid-panes-navbar')?.classList.toggle(NAVBAR_HIDDEN_CLASS, hidden)\n}\n\n/** Apply ownership rules without letting an older lookup overwrite a newer navigation. */\nexport async function refreshNavbarVisibility (url: string, viaAccountMenu = false): Promise<void> {\n const request = ++revision\n const ownProfile = isOwnWebIdProfile(sym(url))\n if (viaAccountMenu || ownProfile) {\n setNavbarHidden(true)\n return\n }\n\n const inViewerPod = await isPageInViewerPod(url)\n if (request !== revision) return\n setNavbarHidden(isNavbarHidden({ viaAccountMenu, ownProfile, inViewerPod }))\n}\n"],"mappings":"A,oIAKA,IAAMQ,EAAsB,iBACxBC,EAAW,EAGf,SAAgBC,EAAiB,EAAuB,CACtD,EAAED,EACF,SAAS,cAA2B,oBAAoB,CAAC,EAAE,UAAU,OAAOD,EAAqBG,CAAM,CACzG,CAGA,eAAsBC,EAAyB,EAAa,EAAiB,GAAsB,CACjG,IAAMC,EAAU,EAAEJ,EACZK,EAAad,EAAAA,mBAAAA,EAAkBC,EAAAA,IAAAA,CAAIc,CAAG,CAAC,EAC7C,GAAIC,GAAkBF,EAAY,CAChCJ,EAAgB,EAAI,EACpB,MACF,CAEA,IAAMO,EAAc,MAAMf,EAAAA,kBAAkBa,CAAG,EAC3CF,IAAYJ,GAChBC,EAAgBP,EAAAA,eAAe,CAAE,iBAAgB,aAAY,aAAY,CAAC,CAAC,CAC7E,C"}
@@ -0,0 +1,5 @@
1
+ /** Show or hide the navbar, if the page has one. */
2
+ export declare function setNavbarHidden(hidden: boolean): void;
3
+ /** Apply ownership rules without letting an older lookup overwrite a newer navigation. */
4
+ export declare function refreshNavbarVisibility(url: string, viaAccountMenu?: boolean): Promise<void>;
5
+ //# sourceMappingURL=navbarVisibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbarVisibility.d.ts","sourceRoot":"","sources":["../../src/navigation/navbarVisibility.ts"],"names":[],"mappings":"AAQA,oDAAoD;AACpD,wBAAgB,eAAe,CAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAGtD;AAED,0FAA0F;AAC1F,wBAAsB,uBAAuB,CAAE,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAWjG"}
@@ -0,0 +1,26 @@
1
+ import { isOwnWebIdProfile as e } from "../utils/webIdUtils.esm.js";
2
+ import { isNavbarHidden as t } from "./chrome.esm.js";
3
+ import { isPageInViewerPod as n } from "./podContext.esm.js";
4
+ import { sym as r } from "rdflib";
5
+ //#region src/navigation/navbarVisibility.ts
6
+ var i = "navbar--hidden", a = 0;
7
+ function o(e) {
8
+ ++a, document.querySelector("solid-panes-navbar")?.classList.toggle(i, e);
9
+ }
10
+ async function s(i, s = !1) {
11
+ let c = ++a, l = e(r(i));
12
+ if (s || l) {
13
+ o(!0);
14
+ return;
15
+ }
16
+ let u = await n(i);
17
+ c === a && o(t({
18
+ viaAccountMenu: s,
19
+ ownProfile: l,
20
+ inViewerPod: u
21
+ }));
22
+ }
23
+ //#endregion
24
+ export { s as refreshNavbarVisibility, o as setNavbarHidden };
25
+
26
+ //# sourceMappingURL=navbarVisibility.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbarVisibility.esm.js","names":["NAVBAR_HIDDEN_CLASS","revision","setNavbarHidden","hidden","refreshNavbarVisibility","request","ownProfile","isOwnWebIdProfile","sym","url","viaAccountMenu","inViewerPod","isPageInViewerPod","isNavbarHidden"],"sources":["../../src/navigation/navbarVisibility.ts"],"sourcesContent":["import { sym } from 'rdflib'\nimport { isOwnWebIdProfile } from '../utils/webIdUtils'\nimport { isNavbarHidden } from './chrome'\nimport { isPageInViewerPod } from './podContext'\n\nconst NAVBAR_HIDDEN_CLASS = 'navbar--hidden'\nlet revision = 0\n\n/** Show or hide the navbar, if the page has one. */\nexport function setNavbarHidden (hidden: boolean): void {\n ++revision\n document.querySelector<HTMLElement>('solid-panes-navbar')?.classList.toggle(NAVBAR_HIDDEN_CLASS, hidden)\n}\n\n/** Apply ownership rules without letting an older lookup overwrite a newer navigation. */\nexport async function refreshNavbarVisibility (url: string, viaAccountMenu = false): Promise<void> {\n const request = ++revision\n const ownProfile = isOwnWebIdProfile(sym(url))\n if (viaAccountMenu || ownProfile) {\n setNavbarHidden(true)\n return\n }\n\n const inViewerPod = await isPageInViewerPod(url)\n if (request !== revision) return\n setNavbarHidden(isNavbarHidden({ viaAccountMenu, ownProfile, inViewerPod }))\n}\n"],"mappings":";;;;;AAKA,IAAMA,IAAsB,kBACxBC,IAAW;AAGf,SAAgBC,EAAiB,GAAuB;CAEtD,AADA,EAAED,GACF,SAAS,cAA2B,oBAAoB,CAAC,EAAE,UAAU,OAAOD,GAAqBG,CAAM;AACzG;AAGA,eAAsBC,EAAyB,GAAa,IAAiB,IAAsB;CACjG,IAAMC,IAAU,EAAEJ,GACZK,IAAaC,EAAkBC,EAAIC,CAAG,CAAC;CAC7C,IAAIC,KAAkBJ,GAAY;EAChC,EAAgB,EAAI;EACpB;CACF;CAEA,IAAMK,IAAc,MAAMC,EAAkBH,CAAG;CAC/C,AAAIJ,MAAYJ,KAChBC,EAAgBW,EAAe;EAAE;EAAgB;EAAY;CAAY,CAAC,CAAC;AAC7E"}
@@ -0,0 +1,2 @@
1
+ function e(e){return typeof e==`object`&&e?e.source??`default`:e===void 0||e?`default`:`accountMenu`}exports.resolveSource=e;
2
+ //# sourceMappingURL=options.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.cjs.js","names":["resolveSource","argument"],"sources":["../../src/navigation/options.ts"],"sourcesContent":["/**\n * Who asked for a view to be displayed. `GotoSubject` takes it as its seventh argument.\n *\n * - `default`: the page's own navigation (URL, navbar, links)\n * - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere\n */\nexport type NavigationSource = 'default' | 'accountMenu'\n\nexport interface GotoSubjectOptions {\n source?: NavigationSource\n}\n\n/**\n * The seventh argument used to be `showNavbar`: `false` meant \"opened by the account menu\"\n * and anything else meant the page's own navigation. That form is still accepted.\n */\nexport function resolveSource (argument?: boolean | GotoSubjectOptions | null): NavigationSource {\n if (typeof argument === 'object' && argument !== null) return argument.source ?? 'default'\n if (argument === undefined) return 'default'\n return argument ? 'default' : 'accountMenu'\n}\n"],"mappings":"AAgBA,SAAgBA,EAAe,EAAkE,CAG/F,OAFI,OAAOC,GAAa,UAAYA,EAA0BA,EAAS,QAAU,UAC7EA,IAAa,IAAA,IACVA,EAD4B,UACL,aAChC,C"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Who asked for a view to be displayed. `GotoSubject` takes it as its seventh argument.
3
+ *
4
+ * - `default`: the page's own navigation (URL, navbar, links)
5
+ * - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere
6
+ */
7
+ export type NavigationSource = 'default' | 'accountMenu';
8
+ export interface GotoSubjectOptions {
9
+ source?: NavigationSource;
10
+ }
11
+ /**
12
+ * The seventh argument used to be `showNavbar`: `false` meant "opened by the account menu"
13
+ * and anything else meant the page's own navigation. That form is still accepted.
14
+ */
15
+ export declare function resolveSource(argument?: boolean | GotoSubjectOptions | null): NavigationSource;
16
+ //# sourceMappingURL=options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/navigation/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAA;CAC1B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,GAAG,gBAAgB,CAI/F"}
@@ -0,0 +1,8 @@
1
+ //#region src/navigation/options.ts
2
+ function e(e) {
3
+ return typeof e == "object" && e ? e.source ?? "default" : e === void 0 || e ? "default" : "accountMenu";
4
+ }
5
+ //#endregion
6
+ export { e as resolveSource };
7
+
8
+ //# sourceMappingURL=options.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"options.esm.js","names":["resolveSource","argument"],"sources":["../../src/navigation/options.ts"],"sourcesContent":["/**\n * Who asked for a view to be displayed. `GotoSubject` takes it as its seventh argument.\n *\n * - `default`: the page's own navigation (URL, navbar, links)\n * - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere\n */\nexport type NavigationSource = 'default' | 'accountMenu'\n\nexport interface GotoSubjectOptions {\n source?: NavigationSource\n}\n\n/**\n * The seventh argument used to be `showNavbar`: `false` meant \"opened by the account menu\"\n * and anything else meant the page's own navigation. That form is still accepted.\n */\nexport function resolveSource (argument?: boolean | GotoSubjectOptions | null): NavigationSource {\n if (typeof argument === 'object' && argument !== null) return argument.source ?? 'default'\n if (argument === undefined) return 'default'\n return argument ? 'default' : 'accountMenu'\n}\n"],"mappings":";AAgBA,SAAgBA,EAAe,GAAkE;CAG/F,OAFI,OAAOC,KAAa,YAAYA,IAA0BA,EAAS,UAAU,YAC7EA,MAAa,KAAA,KACVA,IAD4B,YACL;AAChC"}
@@ -0,0 +1,2 @@
1
+ const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/podUtils.cjs.js"),n=require("../utils/paneUtils.cjs.js");let r=require("solid-logic"),i=require("rdflib");var a=500,o=new Map,s=new Map,c=new Map;function l(e){try{let t=new URL(e),[n=``]=t.pathname.split(`/`).filter(Boolean);return`${t.origin}|${n}`}catch{return e}}function u(e){return(0,i.sym)(e).doc().uri}function d(e,t,n,r,i){let o=e.get(t);if(o)return o;let s=r().catch(r=>(console.warn(`Could not load the ${n} for ${t}`,r),e.get(t)===s&&e.delete(t),i));return e.set(t,s),e.size>a&&e.delete(e.keys().next().value),s}function f(t){return d(o,u(t),`owner of the pod`,async()=>{let n=(0,i.sym)(t),r=await e.loadProfileFromURI(n);return r.uri===n.uri&&!e.isWebIdUri(n)?void 0:r.value},void 0)}function p(e){return d(s,l(e),`storages of the pod`,()=>n.getFolderPanesFromURI((0,i.sym)(e)),[])}function m(e){return e?d(c,e,`storages of the viewer`,async()=>(await t.getPodStorages((0,i.sym)(e))).map(e=>e.uri),[]):Promise.resolve([])}async function h(e=window.location.href){let t=r.authn.currentUser()?.value,[n,i,a]=await Promise.all([f(e),p(e),m(t)]);return{viewer:t,owner:n,storagePanes:i,viewerStorages:a}}function g(e,t){return e.owner===t.owner&&e.viewer===t.viewer&&e.storagePanes.map(e=>e.subject.value).join()===t.storagePanes.map(e=>e.subject.value).join()}function _(e,t){return e.viewerStorages.some(e=>t.startsWith(e))}async function v(e){return _(await h(e),e)}exports.getPodContext=h,exports.isInViewerPod=_,exports.isPageInViewerPod=v,exports.isSamePod=g;
2
+ //# sourceMappingURL=podContext.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podContext.cjs.js","names":["sym","loadProfileFromURI","isWebIdUri","getFolderPanesFromURI","getPodStorages","authn","require_webIdUtils","require_podUtils","require_paneUtils","solid_logic","rdflib","MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","storagesOf","storagesOfViewer","viewer","storage","getPodContext","owner","storagePanes","ownStorages","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string): Promise<PaneItem[]> {\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(sym(pageUrl)), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, storagePanes, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOf(pageUrl), storagesOfViewer(viewer)\n ])\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":"A,4KA0BA,IAAMW,EAAiB,IAOjBC,EAAS,IAAI,IACbC,EAAW,IAAI,IACfC,EAAiB,IAAI,IAE3B,SAASC,EAAQ,EAAyB,CACxC,GAAI,CACF,IAAMC,EAAM,IAAI,IAAIC,CAAO,EACrB,CAACC,EAAQ,IAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,EAC3D,MAAO,GAAGA,EAAI,OAAO,GAAGE,GAC1B,MAAQ,CACN,OAAOD,CACT,CACF,CAEA,SAASE,EAAa,EAAyB,CAC7C,OAAA,EAAOnB,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAC5B,CAKA,SAASG,EACP,EACA,EACA,EACA,EACA,EACY,CACZ,IAAMC,EAAWC,EAAM,IAAIC,CAAG,EAC9B,GAAIF,EAAU,OAAOA,EAErB,IAAMG,EAAsBC,EAAK,CAAC,CAAC,MAAM,IACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,IAAOI,CAAK,EACvDL,EAAM,IAAIC,CAAG,IAAMC,GAASF,EAAM,OAAOC,CAAG,EACzCK,EACR,EAGD,OAFAN,EAAM,IAAIC,EAAKC,CAAO,EAClBF,EAAM,KAAOX,GAAgBW,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,EAC1EE,CACT,CAEA,SAASK,EAAS,EAA8C,CAC9D,OAAOT,EAASR,EAAQO,EAAYF,CAAO,EAAG,mBAAoB,SAAY,CAC5E,IAAMa,GAAA,EAAU9B,EAAAA,IAAAA,CAAIiB,CAAO,EACrBc,EAAQ,MAAM9B,EAAAA,mBAAmB6B,CAAO,EAE9C,OAAOC,EAAM,MAAQD,EAAQ,KAAO,CAAC5B,EAAAA,WAAW4B,CAAO,EAAI,IAAA,GAAYC,EAAM,KAC/E,EAAG,IAAA,EAAS,CACd,CAEA,SAASC,EAAY,EAAsC,CACzD,OAAOZ,EAASP,EAAUE,EAAOE,CAAO,EAAG,0BAA6Bd,EAAAA,uBAAAA,EAAsBH,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,EAAG,CAAC,CAAC,CACjH,CAEA,SAASgB,EAAkB,EAA+C,CAExE,OADKC,EACEd,EAASN,EAAgBoB,EAAQ,yBAA0B,UACxD,MAAM9B,EAAAA,gBAAAA,EAAeJ,EAAAA,IAAAA,CAAIkC,CAAM,CAAC,EAAA,CAAG,IAAI,GAAWC,EAAQ,GAAG,EACpE,CAAC,CAAC,EAHe,QAAQ,QAAQ,CAAC,CAAC,CAIxC,CAGA,eAAsBC,EAAe,EAAkB,OAAO,SAAS,KAA2B,CAChG,IAAMF,EAAS7B,EAAAA,MAAM,YAAY,CAAC,EAAE,MAC9B,CAACgC,EAAOC,EAAcC,GAAe,MAAM,QAAQ,IAAI,CAC3DV,EAAQZ,CAAO,EAAGe,EAAWf,CAAO,EAAGgB,EAAiBC,CAAM,CAChE,CAAC,EACD,MAAO,CAAE,SAAQ,QAAO,eAAc,eAAgBK,CAAY,CACpE,CAUA,SAAgBC,EAAW,EAAe,EAAwB,CAChE,OAAOC,EAAE,QAAUC,EAAE,OAASD,EAAE,SAAWC,EAAE,QAC3CD,EAAE,aAAa,IAAI,GAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,IAAMD,EAAE,aAAa,IAAI,GAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,CAClH,CAEA,SAAgBC,EAAe,EAAqB,EAAsB,CACxE,OAAOC,EAAQ,eAAe,KAAK,GAAW7B,EAAI,WAAWmB,CAAO,CAAC,CACvE,CAGA,eAAsBW,EAAmB,EAA+B,CACtE,OAAOF,EAAc,MAAMR,EAAcpB,CAAG,EAAGA,CAAG,CACpD,C"}
@@ -0,0 +1,21 @@
1
+ import { PaneItem } from '../utils/paneUtils';
2
+ export interface PodContext {
3
+ /** WebID of the logged-in user. */
4
+ viewer?: string;
5
+ /** WebID of the person whose pod the page is in; unknown when no profile could be found. */
6
+ owner?: string;
7
+ /** The storages of that pod, as panes the navbar can open. */
8
+ storagePanes: PaneItem[];
9
+ /** The storages the viewer owns. */
10
+ viewerStorages: string[];
11
+ }
12
+ /** The context for the pod a URL is in; the page's own URL by default. */
13
+ export declare function getPodContext(pageUrl?: string): Promise<PodContext>;
14
+ /** Forget what was loaded, for example when tests start over. */
15
+ export declare function resetPodContexts(): void;
16
+ /** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */
17
+ export declare function isSamePod(a: PodContext, b: PodContext): boolean;
18
+ export declare function isInViewerPod(context: PodContext, url: string): boolean;
19
+ /** Whether the URL lies within one of the viewer's own storages. */
20
+ export declare function isPageInViewerPod(url: string): Promise<boolean>;
21
+ //# sourceMappingURL=podContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podContext.d.ts","sourceRoot":"","sources":["../../src/navigation/podContext.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGzE,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,YAAY,EAAE,QAAQ,EAAE,CAAA;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAsED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAE,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,UAAU,CAAC,CAMhG;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAK,IAAI,CAIxC;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAGhE;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,oEAAoE;AACpE,wBAAsB,iBAAiB,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE"}