solid-panes 5.0.0 → 5.1.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/README.md +84 -2
  2. package/dist/RDFXMLPane2.cjs.js.map +1 -1
  3. package/dist/_virtual/~icons/lucide/cake.cjs.js +2 -0
  4. package/dist/_virtual/~icons/lucide/cake.cjs.js.map +1 -0
  5. package/dist/_virtual/~icons/lucide/cake.esm.js +11 -0
  6. package/dist/_virtual/~icons/lucide/cake.esm.js.map +1 -0
  7. package/dist/_virtual/~icons/lucide/camera.cjs.js +2 -0
  8. package/dist/_virtual/~icons/lucide/camera.cjs.js.map +1 -0
  9. package/dist/_virtual/~icons/lucide/camera.esm.js +11 -0
  10. package/dist/_virtual/~icons/lucide/camera.esm.js.map +1 -0
  11. package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js +2 -0
  12. package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js.map +1 -0
  13. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +11 -0
  14. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js.map +1 -0
  15. package/dist/_virtual/~icons/lucide/mail.cjs.js +2 -0
  16. package/dist/_virtual/~icons/lucide/mail.cjs.js.map +1 -0
  17. package/dist/_virtual/~icons/lucide/mail.esm.js +11 -0
  18. package/dist/_virtual/~icons/lucide/mail.esm.js.map +1 -0
  19. package/dist/_virtual/~icons/lucide/map-pin.cjs.js +2 -0
  20. package/dist/_virtual/~icons/lucide/map-pin.cjs.js.map +1 -0
  21. package/dist/_virtual/~icons/lucide/map-pin.esm.js +11 -0
  22. package/dist/_virtual/~icons/lucide/map-pin.esm.js.map +1 -0
  23. package/dist/_virtual/~icons/lucide/phone.cjs.js +2 -0
  24. package/dist/_virtual/~icons/lucide/phone.cjs.js.map +1 -0
  25. package/dist/_virtual/~icons/lucide/phone.esm.js +11 -0
  26. package/dist/_virtual/~icons/lucide/phone.esm.js.map +1 -0
  27. package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js +2 -0
  28. package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js.map +1 -0
  29. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +11 -0
  30. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js.map +1 -0
  31. package/dist/_virtual/~icons/lucide/x.cjs.js +2 -0
  32. package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -0
  33. package/dist/_virtual/~icons/lucide/x.esm.js +11 -0
  34. package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -0
  35. package/dist/audio/audioPane.cjs.js +1 -1
  36. package/dist/audio/audioPane.cjs.js.map +1 -1
  37. package/dist/audio/audioPane.esm.js +1 -5
  38. package/dist/audio/audioPane.esm.js.map +1 -1
  39. package/dist/classInstancePane.cjs.js.map +1 -1
  40. package/dist/components/editor-card/EditorCard.cjs.js +1 -1
  41. package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
  42. package/dist/components/editor-card/EditorCard.esm.js +4 -7
  43. package/dist/components/editor-card/EditorCard.esm.js.map +1 -1
  44. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +1 -1
  45. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
  46. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +2 -2
  47. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +1 -1
  48. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
  49. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +2 -2
  50. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
  51. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
  52. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +2 -2
  53. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +5 -5
  54. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -1
  55. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -1
  56. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +97 -96
  57. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -1
  58. package/dist/components/header/Header.cjs.js +1 -1
  59. package/dist/components/header/Header.cjs.js.map +1 -1
  60. package/dist/components/header/Header.esm.js +2 -2
  61. package/dist/components/header/Header.styles.cjs.js +1 -1
  62. package/dist/components/header/Header.styles.cjs.js.map +1 -1
  63. package/dist/components/header/Header.styles.esm.js +1 -1
  64. package/dist/components/header/Header.styles.esm.js.map +1 -1
  65. package/dist/components/navbar/Navbar.cjs.js +1 -1
  66. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  67. package/dist/components/navbar/Navbar.d.ts +2 -0
  68. package/dist/components/navbar/Navbar.d.ts.map +1 -1
  69. package/dist/components/navbar/Navbar.esm.js +2 -2
  70. package/dist/components/navbar/Navbar.esm.js.map +1 -1
  71. package/dist/components/navbar/Navbar.styles.cjs.js +1 -1
  72. package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
  73. package/dist/components/navbar/Navbar.styles.esm.js +1 -1
  74. package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
  75. package/dist/components/profile-heading/ProfileHeading.cjs.js +95 -0
  76. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -0
  77. package/dist/components/profile-heading/ProfileHeading.d.ts +45 -0
  78. package/dist/components/profile-heading/ProfileHeading.d.ts.map +1 -0
  79. package/dist/components/profile-heading/ProfileHeading.esm.js +480 -0
  80. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -0
  81. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +2 -0
  82. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -0
  83. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +7 -0
  84. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -0
  85. package/dist/components/profile-heading/editor/index.d.ts +3 -0
  86. package/dist/components/profile-heading/editor/index.d.ts.map +1 -0
  87. package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts +44 -0
  88. package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts.map +1 -0
  89. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +297 -0
  90. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js.map +1 -0
  91. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts +5 -0
  92. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts.map +1 -0
  93. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +642 -0
  94. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js.map +1 -0
  95. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js +2 -0
  96. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js.map +1 -0
  97. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts +4 -0
  98. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts.map +1 -0
  99. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +16 -0
  100. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js.map +1 -0
  101. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js +2 -0
  102. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js.map +1 -0
  103. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts +5 -0
  104. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts.map +1 -0
  105. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +76 -0
  106. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js.map +1 -0
  107. package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js +19 -0
  108. package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js.map +1 -0
  109. package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts +2 -0
  110. package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts.map +1 -0
  111. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +28 -0
  112. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js.map +1 -0
  113. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js +2 -0
  114. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js.map +1 -0
  115. package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts +4 -0
  116. package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts.map +1 -0
  117. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +151 -0
  118. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js.map +1 -0
  119. package/dist/components/profile-heading/editor/sections/heading/types.d.ts +34 -0
  120. package/dist/components/profile-heading/editor/sections/heading/types.d.ts.map +1 -0
  121. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js +2 -0
  122. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js.map +1 -0
  123. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts +7 -0
  124. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts.map +1 -0
  125. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +20 -0
  126. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js.map +1 -0
  127. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js +2 -0
  128. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js.map +1 -0
  129. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts +3 -0
  130. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts.map +1 -0
  131. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +11 -0
  132. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js.map +1 -0
  133. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js +2 -0
  134. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js.map +1 -0
  135. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts +20 -0
  136. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts.map +1 -0
  137. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +1291 -0
  138. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js.map +1 -0
  139. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js +2 -0
  140. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js.map +1 -0
  141. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts +45 -0
  142. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
  143. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +211 -0
  144. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js.map +1 -0
  145. package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js +2 -0
  146. package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js.map +1 -0
  147. package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts +21 -0
  148. package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts.map +1 -0
  149. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +18 -0
  150. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js.map +1 -0
  151. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js +2 -0
  152. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js.map +1 -0
  153. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts +5 -0
  154. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts.map +1 -0
  155. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +18 -0
  156. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js.map +1 -0
  157. package/dist/components/profile-heading/editor/sections/shared/types.d.ts +31 -0
  158. package/dist/components/profile-heading/editor/sections/shared/types.d.ts.map +1 -0
  159. package/dist/components/profile-heading/editor/textUtils.cjs.js +2 -0
  160. package/dist/components/profile-heading/editor/textUtils.cjs.js.map +1 -0
  161. package/dist/components/profile-heading/editor/textUtils.d.ts +6 -0
  162. package/dist/components/profile-heading/editor/textUtils.d.ts.map +1 -0
  163. package/dist/components/profile-heading/editor/textUtils.esm.js +26 -0
  164. package/dist/components/profile-heading/editor/textUtils.esm.js.map +1 -0
  165. package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts +9 -0
  166. package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts.map +1 -0
  167. package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js +2 -0
  168. package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js.map +1 -0
  169. package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts +14 -0
  170. package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts.map +1 -0
  171. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +6 -0
  172. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js.map +1 -0
  173. package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js +2 -0
  174. package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js.map +1 -0
  175. package/dist/components/profile-heading/editor/texts/messageTexts.d.ts +42 -0
  176. package/dist/components/profile-heading/editor/texts/messageTexts.d.ts.map +1 -0
  177. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +6 -0
  178. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js.map +1 -0
  179. package/dist/components/profile-heading/editor/texts/profileTexts.d.ts +14 -0
  180. package/dist/components/profile-heading/editor/texts/profileTexts.d.ts.map +1 -0
  181. package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts +2 -0
  182. package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts.map +1 -0
  183. package/dist/components/profile-heading/editor/texts.d.ts +6 -0
  184. package/dist/components/profile-heading/editor/texts.d.ts.map +1 -0
  185. package/dist/components/profile-heading/editor/ui/dialog.d.ts +41 -0
  186. package/dist/components/profile-heading/editor/ui/dialog.d.ts.map +1 -0
  187. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +17 -0
  188. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -0
  189. package/dist/components/profile-heading/editor/ui/dialog2.esm.js +263 -0
  190. package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -0
  191. package/dist/components/profile-heading/editor/ui/spinner.cjs.js +5 -0
  192. package/dist/components/profile-heading/editor/ui/spinner.cjs.js.map +1 -0
  193. package/dist/components/profile-heading/editor/ui/spinner.d.ts +3 -0
  194. package/dist/components/profile-heading/editor/ui/spinner.d.ts.map +1 -0
  195. package/dist/components/profile-heading/editor/ui/spinner.esm.js +12 -0
  196. package/dist/components/profile-heading/editor/ui/spinner.esm.js.map +1 -0
  197. package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js +2 -0
  198. package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js.map +1 -0
  199. package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts +2 -0
  200. package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts.map +1 -0
  201. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +18 -0
  202. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js.map +1 -0
  203. package/dist/components/profile-heading/friendActions.cjs.js +2 -0
  204. package/dist/components/profile-heading/friendActions.cjs.js.map +1 -0
  205. package/dist/components/profile-heading/friendActions.d.ts +11 -0
  206. package/dist/components/profile-heading/friendActions.d.ts.map +1 -0
  207. package/dist/components/profile-heading/friendActions.esm.js +32 -0
  208. package/dist/components/profile-heading/friendActions.esm.js.map +1 -0
  209. package/dist/components/profile-heading/index.cjs.js +1 -0
  210. package/dist/components/profile-heading/index.d.ts +5 -0
  211. package/dist/components/profile-heading/index.d.ts.map +1 -0
  212. package/dist/components/profile-heading/index.esm.js +1 -0
  213. package/dist/components/profile-heading/profileHeadingData.cjs.js +2 -0
  214. package/dist/components/profile-heading/profileHeadingData.cjs.js.map +1 -0
  215. package/dist/components/profile-heading/profileHeadingData.d.ts +6 -0
  216. package/dist/components/profile-heading/profileHeadingData.d.ts.map +1 -0
  217. package/dist/components/profile-heading/profileHeadingData.esm.js +81 -0
  218. package/dist/components/profile-heading/profileHeadingData.esm.js.map +1 -0
  219. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +1 -1
  220. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
  221. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +2 -2
  222. package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
  223. package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
  224. package/dist/dashboard/homepage.cjs.js.map +1 -1
  225. package/dist/dataContentPane2.cjs.js.map +1 -1
  226. package/dist/defaultPane2.cjs.js.map +1 -1
  227. package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
  228. package/dist/form/pane.cjs.js.map +1 -1
  229. package/dist/home/homePane.cjs.js.map +1 -1
  230. package/dist/humanReadablePane2.cjs.js.map +1 -1
  231. package/dist/icons/folder.cjs.js.map +1 -1
  232. package/dist/icons/friends.cjs.js.map +1 -1
  233. package/dist/icons/person.cjs.js.map +1 -1
  234. package/dist/imagePane2.cjs.js.map +1 -1
  235. package/dist/index.cjs.js +1 -1
  236. package/dist/index.cjs.js.map +1 -1
  237. package/dist/index.d.ts +2 -1
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.esm.js +15 -14
  240. package/dist/index.esm.js.map +1 -1
  241. package/dist/internal/internalPane2.cjs.js +1 -1
  242. package/dist/internal/internalPane2.cjs.js.map +1 -1
  243. package/dist/internal/internalPane2.esm.js +2 -5
  244. package/dist/internal/internalPane2.esm.js.map +1 -1
  245. package/dist/mainPage/header.cjs.js +1 -1
  246. package/dist/mainPage/header.cjs.js.map +1 -1
  247. package/dist/mainPage/header.d.ts +2 -2
  248. package/dist/mainPage/header.d.ts.map +1 -1
  249. package/dist/mainPage/header.esm.js +48 -44
  250. package/dist/mainPage/header.esm.js.map +1 -1
  251. package/dist/mainPage/index.cjs.js +1 -1
  252. package/dist/mainPage/index.cjs.js.map +1 -1
  253. package/dist/mainPage/index.d.ts.map +1 -1
  254. package/dist/mainPage/index.esm.js +27 -21
  255. package/dist/mainPage/index.esm.js.map +1 -1
  256. package/dist/mainPage/navbar.cjs.js +1 -1
  257. package/dist/mainPage/navbar.cjs.js.map +1 -1
  258. package/dist/mainPage/navbar.d.ts +3 -2
  259. package/dist/mainPage/navbar.d.ts.map +1 -1
  260. package/dist/mainPage/navbar.esm.js +77 -42
  261. package/dist/mainPage/navbar.esm.js.map +1 -1
  262. package/dist/mainPage/navigation.cjs.js +2 -0
  263. package/dist/mainPage/navigation.cjs.js.map +1 -0
  264. package/dist/mainPage/navigation.d.ts +6 -0
  265. package/dist/mainPage/navigation.d.ts.map +1 -0
  266. package/dist/mainPage/navigation.esm.js +22 -0
  267. package/dist/mainPage/navigation.esm.js.map +1 -0
  268. package/dist/mainPage/profileHeading.d.ts +5 -0
  269. package/dist/mainPage/profileHeading.d.ts.map +1 -0
  270. package/dist/mainPage/profileHeading2.cjs.js +2 -0
  271. package/dist/mainPage/profileHeading2.cjs.js.map +1 -0
  272. package/dist/mainPage/profileHeading2.esm.js +158 -0
  273. package/dist/mainPage/profileHeading2.esm.js.map +1 -0
  274. package/dist/n3Pane2.cjs.js.map +1 -1
  275. package/dist/navigation/browserEvents.cjs.js +2 -0
  276. package/dist/navigation/browserEvents.cjs.js.map +1 -0
  277. package/dist/navigation/browserEvents.d.ts +15 -0
  278. package/dist/navigation/browserEvents.d.ts.map +1 -0
  279. package/dist/navigation/browserEvents.esm.js +32 -0
  280. package/dist/navigation/browserEvents.esm.js.map +1 -0
  281. package/dist/navigation/chrome.cjs.js +2 -0
  282. package/dist/navigation/chrome.cjs.js.map +1 -0
  283. package/dist/navigation/chrome.d.ts +69 -0
  284. package/dist/navigation/chrome.d.ts.map +1 -0
  285. package/dist/navigation/chrome.esm.js +43 -0
  286. package/dist/navigation/chrome.esm.js.map +1 -0
  287. package/dist/navigation/controller.cjs.js +2 -0
  288. package/dist/navigation/controller.cjs.js.map +1 -0
  289. package/dist/navigation/controller.d.ts +51 -0
  290. package/dist/navigation/controller.d.ts.map +1 -0
  291. package/dist/navigation/controller.esm.js +45 -0
  292. package/dist/navigation/controller.esm.js.map +1 -0
  293. package/dist/navigation/events.cjs.js +2 -0
  294. package/dist/navigation/events.cjs.js.map +1 -0
  295. package/dist/navigation/events.d.ts +17 -0
  296. package/dist/navigation/events.d.ts.map +1 -0
  297. package/dist/navigation/events.esm.js +18 -0
  298. package/dist/navigation/events.esm.js.map +1 -0
  299. package/dist/navigation/navbarVisibility.cjs.js +2 -0
  300. package/dist/navigation/navbarVisibility.cjs.js.map +1 -0
  301. package/dist/navigation/navbarVisibility.d.ts +5 -0
  302. package/dist/navigation/navbarVisibility.d.ts.map +1 -0
  303. package/dist/navigation/navbarVisibility.esm.js +26 -0
  304. package/dist/navigation/navbarVisibility.esm.js.map +1 -0
  305. package/dist/navigation/options.cjs.js +2 -0
  306. package/dist/navigation/options.cjs.js.map +1 -0
  307. package/dist/navigation/options.d.ts +16 -0
  308. package/dist/navigation/options.d.ts.map +1 -0
  309. package/dist/navigation/options.esm.js +8 -0
  310. package/dist/navigation/options.esm.js.map +1 -0
  311. package/dist/navigation/podContext.cjs.js +2 -0
  312. package/dist/navigation/podContext.cjs.js.map +1 -0
  313. package/dist/navigation/podContext.d.ts +21 -0
  314. package/dist/navigation/podContext.d.ts.map +1 -0
  315. package/dist/navigation/podContext.esm.js +62 -0
  316. package/dist/navigation/podContext.esm.js.map +1 -0
  317. package/dist/navigation/state.cjs.js +2 -0
  318. package/dist/navigation/state.cjs.js.map +1 -0
  319. package/dist/navigation/state.d.ts +40 -0
  320. package/dist/navigation/state.d.ts.map +1 -0
  321. package/dist/navigation/state.esm.js +41 -0
  322. package/dist/navigation/state.esm.js.map +1 -0
  323. package/dist/outline/context.cjs.js.map +1 -1
  324. package/dist/outline/manager2.cjs.js +1 -1
  325. package/dist/outline/manager2.cjs.js.map +1 -1
  326. package/dist/outline/manager2.esm.js +387 -353
  327. package/dist/outline/manager2.esm.js.map +1 -1
  328. package/dist/outline/outlineIcons.cjs.js.map +1 -1
  329. package/dist/outline/propertyViews.cjs.js.map +1 -1
  330. package/dist/outline/queryByExample.cjs.js.map +1 -1
  331. package/dist/outline/userInput.cjs.js +1 -1
  332. package/dist/outline/userInput.cjs.js.map +1 -1
  333. package/dist/outline/userInput.esm.js +12 -13
  334. package/dist/outline/userInput.esm.js.map +1 -1
  335. package/dist/outline/viewAsImage.cjs.js.map +1 -1
  336. package/dist/outline/viewAsMbox.cjs.js.map +1 -1
  337. package/dist/pad/padPane2.cjs.js +1 -1
  338. package/dist/pad/padPane2.cjs.js.map +1 -1
  339. package/dist/pad/padPane2.esm.js +2 -6
  340. package/dist/pad/padPane2.esm.js.map +1 -1
  341. package/dist/playlist/playlistPane.cjs.js.map +1 -1
  342. package/dist/registerPanes.cjs.js.map +1 -1
  343. package/dist/schedule/schedulePane2.cjs.js +1 -1
  344. package/dist/schedule/schedulePane2.cjs.js.map +1 -1
  345. package/dist/schedule/schedulePane2.esm.js +1 -5
  346. package/dist/schedule/schedulePane2.esm.js.map +1 -1
  347. package/dist/sharing/sharingPane.cjs.js.map +1 -1
  348. package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
  349. package/dist/social/editProfileDetails.cjs.js +1 -1
  350. package/dist/social/editProfileDetails.cjs.js.map +1 -1
  351. package/dist/social/editProfileDetails.esm.js +0 -2
  352. package/dist/social/editProfileDetails.esm.js.map +1 -1
  353. package/dist/social/icons.cjs.js +4 -4
  354. package/dist/social/icons.cjs.js.map +1 -1
  355. package/dist/social/icons.esm.js +5 -5
  356. package/dist/social/icons.esm.js.map +1 -1
  357. package/dist/social/socialPane.d.ts +0 -1
  358. package/dist/social/socialPane.d.ts.map +1 -1
  359. package/dist/social/socialPane2.cjs.js +3 -3
  360. package/dist/social/socialPane2.cjs.js.map +1 -1
  361. package/dist/social/socialPane2.esm.js +97 -154
  362. package/dist/social/socialPane2.esm.js.map +1 -1
  363. package/dist/social/socialSections.cjs.js +1 -1
  364. package/dist/social/socialSections.cjs.js.map +1 -1
  365. package/dist/social/socialSections.d.ts +2 -2
  366. package/dist/social/socialSections.d.ts.map +1 -1
  367. package/dist/social/socialSections.esm.js +62 -139
  368. package/dist/social/socialSections.esm.js.map +1 -1
  369. package/dist/social/triage.cjs.js.map +1 -1
  370. package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
  371. package/dist/tableViewPane.cjs.js.map +1 -1
  372. package/dist/transaction/pane.cjs.js.map +1 -1
  373. package/dist/transaction/pane.esm.js +1 -1
  374. package/dist/transaction/pane.esm.js.map +1 -1
  375. package/dist/transaction/period.cjs.js.map +1 -1
  376. package/dist/trip/tripPane.cjs.js.map +1 -1
  377. package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
  378. package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
  379. package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
  380. package/dist/types.d.ts +3 -0
  381. package/dist/types.d.ts.map +1 -0
  382. package/dist/ui/pane.cjs.js +1 -1
  383. package/dist/ui/pane.cjs.js.map +1 -1
  384. package/dist/ui/pane.esm.js +2 -5
  385. package/dist/ui/pane.esm.js.map +1 -1
  386. package/dist/utils/paneUtils.cjs.js +1 -1
  387. package/dist/utils/paneUtils.cjs.js.map +1 -1
  388. package/dist/utils/paneUtils.esm.js +4 -4
  389. package/dist/utils/paneUtils.esm.js.map +1 -1
  390. package/dist/utils/podUtils.cjs.js.map +1 -1
  391. package/dist/utils/viewerUtils.cjs.js +2 -0
  392. package/dist/utils/viewerUtils.cjs.js.map +1 -0
  393. package/dist/utils/viewerUtils.d.ts +5 -0
  394. package/dist/utils/viewerUtils.d.ts.map +1 -0
  395. package/dist/utils/viewerUtils.esm.js +13 -0
  396. package/dist/utils/viewerUtils.esm.js.map +1 -0
  397. package/dist/utils/webIdUtils.cjs.js +1 -1
  398. package/dist/utils/webIdUtils.cjs.js.map +1 -1
  399. package/dist/utils/webIdUtils.d.ts +1 -0
  400. package/dist/utils/webIdUtils.d.ts.map +1 -1
  401. package/dist/utils/webIdUtils.esm.js +23 -19
  402. package/dist/utils/webIdUtils.esm.js.map +1 -1
  403. package/dist/versionInfo.cjs.js +1 -1
  404. package/dist/versionInfo.cjs.js.map +1 -1
  405. package/dist/versionInfo.esm.js +11 -11
  406. package/dist/versionInfo.esm.js.map +1 -1
  407. package/dist/video/videoPane.cjs.js.map +1 -1
  408. package/package.json +7 -6
@@ -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"}
@@ -0,0 +1,62 @@
1
+ import { isWebIdUri as e, loadProfileFromURI as t } from "../utils/webIdUtils.esm.js";
2
+ import { getPodStorages as n } from "../utils/podUtils.esm.js";
3
+ import { getFolderPanesFromURI as r } from "../utils/paneUtils.esm.js";
4
+ import { authn as i } from "solid-logic";
5
+ import { sym as a } from "rdflib";
6
+ //#region src/navigation/podContext.ts
7
+ var o = 500, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
8
+ function u(e) {
9
+ try {
10
+ let t = new URL(e), [n = ""] = t.pathname.split("/").filter(Boolean);
11
+ return `${t.origin}|${n}`;
12
+ } catch {
13
+ return e;
14
+ }
15
+ }
16
+ function d(e) {
17
+ return a(e).doc().uri;
18
+ }
19
+ function f(e, t, n, r, i) {
20
+ let a = e.get(t);
21
+ if (a) return a;
22
+ let s = r().catch((r) => (console.warn(`Could not load the ${n} for ${t}`, r), e.get(t) === s && e.delete(t), i));
23
+ return e.set(t, s), e.size > o && e.delete(e.keys().next().value), s;
24
+ }
25
+ function p(n) {
26
+ return f(s, d(n), "owner of the pod", async () => {
27
+ let r = a(n), i = await t(r);
28
+ return i.uri === r.uri && !e(r) ? void 0 : i.value;
29
+ }, void 0);
30
+ }
31
+ function m(e) {
32
+ return f(c, u(e), "storages of the pod", () => r(a(e)), []);
33
+ }
34
+ function h(e) {
35
+ return e ? f(l, e, "storages of the viewer", async () => (await n(a(e))).map((e) => e.uri), []) : Promise.resolve([]);
36
+ }
37
+ async function g(e = window.location.href) {
38
+ let t = i.currentUser()?.value, [n, r, a] = await Promise.all([
39
+ p(e),
40
+ m(e),
41
+ h(t)
42
+ ]);
43
+ return {
44
+ viewer: t,
45
+ owner: n,
46
+ storagePanes: r,
47
+ viewerStorages: a
48
+ };
49
+ }
50
+ function _(e, t) {
51
+ 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();
52
+ }
53
+ function v(e, t) {
54
+ return e.viewerStorages.some((e) => t.startsWith(e));
55
+ }
56
+ async function y(e) {
57
+ return v(await g(e), e);
58
+ }
59
+ //#endregion
60
+ export { g as getPodContext, v as isInViewerPod, y as isPageInViewerPod, _ as isSamePod };
61
+
62
+ //# sourceMappingURL=podContext.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"podContext.esm.js","names":["MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","sym","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","loadProfileFromURI","isWebIdUri","storagesOf","getFolderPanesFromURI","storagesOfViewer","viewer","getPodStorages","storage","getPodContext","authn","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":";;;;;;AA0BA,IAAMA,IAAiB,KAOjBC,oBAAS,IAAI,IAAyC,GACtDC,oBAAW,IAAI,IAAiC,GAChDC,oBAAiB,IAAI,IAA+B;AAE1D,SAASC,EAAQ,GAAyB;CACxC,IAAI;EACF,IAAMC,IAAM,IAAI,IAAIC,CAAO,GACrB,CAACC,IAAQ,MAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EAC3D,OAAO,GAAGA,EAAI,OAAO,GAAGE;CAC1B,QAAQ;EACN,OAAOD;CACT;AACF;AAEA,SAASE,EAAa,GAAyB;CAC7C,OAAOC,EAAIH,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5B;AAKA,SAASI,EACP,GACA,GACA,GACA,GACA,GACY;CACZ,IAAMC,IAAWC,EAAM,IAAIC,CAAG;CAC9B,IAAIF,GAAU,OAAOA;CAErB,IAAMG,IAAsBC,EAAK,CAAC,CAAC,OAAM,OACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,KAAOI,CAAK,GACvDL,EAAM,IAAIC,CAAG,MAAMC,KAASF,EAAM,OAAOC,CAAG,GACzCK,EACR;CAGD,OAFAN,EAAM,IAAIC,GAAKC,CAAO,GAClBF,EAAM,OAAOZ,KAAgBY,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,GAC1EE;AACT;AAEA,SAASK,EAAS,GAA8C;CAC9D,OAAOT,EAAST,GAAQO,EAAYF,CAAO,GAAG,oBAAoB,YAAY;EAC5E,IAAMc,IAAUX,EAAIH,CAAO,GACrBe,IAAQ,MAAMC,EAAmBF,CAAO;EAE9C,OAAOC,EAAM,QAAQD,EAAQ,OAAO,CAACG,EAAWH,CAAO,IAAI,KAAA,IAAYC,EAAM;CAC/E,GAAG,KAAA,CAAS;AACd;AAEA,SAASG,EAAY,GAAsC;CACzD,OAAOd,EAASR,GAAUE,EAAOE,CAAO,GAAG,6BAA6BmB,EAAsBhB,EAAIH,CAAO,CAAC,GAAG,CAAC,CAAC;AACjH;AAEA,SAASoB,EAAkB,GAA+C;CAExE,OADKC,IACEjB,EAASP,GAAgBwB,GAAQ,0BAA0B,aACxD,MAAMC,EAAenB,EAAIkB,CAAM,CAAC,EAAA,CAAG,KAAI,MAAWE,EAAQ,GAAG,GACpE,CAAC,CAAC,IAHe,QAAQ,QAAQ,CAAC,CAAC;AAIxC;AAGA,eAAsBC,EAAe,IAAkB,OAAO,SAAS,MAA2B;CAChG,IAAMH,IAASI,EAAM,YAAY,CAAC,EAAE,OAC9B,CAACC,GAAOC,GAAcC,KAAe,MAAM,QAAQ,IAAI;EAC3Df,EAAQb,CAAO;EAAGkB,EAAWlB,CAAO;EAAGoB,EAAiBC,CAAM;CAChE,CAAC;CACD,OAAO;EAAE;EAAQ;EAAO;EAAc,gBAAgBO;CAAY;AACpE;AAUA,SAAgBC,EAAW,GAAe,GAAwB;CAChE,OAAOC,EAAE,UAAUC,EAAE,SAASD,EAAE,WAAWC,EAAE,UAC3CD,EAAE,aAAa,KAAI,MAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,MAAMD,EAAE,aAAa,KAAI,MAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK;AAClH;AAEA,SAAgBC,EAAe,GAAqB,GAAsB;CACxE,OAAOC,EAAQ,eAAe,MAAK,MAAWnC,EAAI,WAAWwB,CAAO,CAAC;AACvE;AAGA,eAAsBY,EAAmB,GAA+B;CACtE,OAAOF,EAAc,MAAMT,EAAczB,CAAG,GAAGA,CAAG;AACpD"}
@@ -0,0 +1,2 @@
1
+ var e={profile:`profile`,social:`friends`,folder:`storage`};function t(e){return typeof e==`object`&&e?e:{}}function n(t,n){return t?{kind:e[t]??`pane`,pane:t,...n?{subject:n}:{}}:{kind:`default`}}function r(e){let{paneName:r,paneUri:i,viaAccountMenu:a}=t(e);return{view:n(typeof r==`string`&&r?r:void 0,typeof i==`string`&&i?i:void 0),viaAccountMenu:a===!0}}function i(){return r(window.history.state)}function a(e,n){let r={...t(e)};return n.pane&&(r.paneName=n.pane.name,typeof n.pane.subject==`string`&&(r.paneUri=n.pane.subject)),n.leavingPage&&!n.pane&&delete r.paneName,(n.leavingPage&&!n.pane||n.pane&&!n.pane.subject)&&delete r.paneUri,n.viaAccountMenu?r.viaAccountMenu=!0:delete r.viaAccountMenu,r}function o(e){let{paneName:n,paneUri:r,viaAccountMenu:i,...a}=t(e);return a}function s(){window.history.replaceState(o(window.history.state),``,window.location.href)}exports.clearPaneState=s,exports.nextHistoryState=a,exports.parseNavigationState=r,exports.readNavigationState=i,exports.viewFromPane=n,exports.withoutPaneState=o;
2
+ //# sourceMappingURL=state.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.cjs.js","names":["KIND_BY_PANE","asRecord","raw","viewFromPane","pane","subject","parseNavigationState","paneName","paneUri","viaAccountMenu","readNavigationState","nextHistoryState","next","current","change","withoutPaneState","rest","clearPaneState"],"sources":["../../src/navigation/state.ts"],"sourcesContent":["/*\n * What a history entry records about the view that was displayed.\n *\n * This is the only module that knows how that is stored in `history.state`; everything\n * else works with `NavigationState`. The stored fields are `paneName`, `paneUri` and\n * `viaAccountMenu`, next to whatever other keys the entry carries.\n */\n\nexport type ViewKind = 'default' | 'profile' | 'friends' | 'storage' | 'pane'\n\nexport interface NavigationView {\n kind: ViewKind\n /** Registry name of the displayed pane. Always set unless the kind is `default`. */\n pane?: string\n /** What the pane displays when that is not the page URL (a profile, friends list or storage). */\n subject?: string\n}\n\nexport interface NavigationState {\n view: NavigationView\n /** The account menu opened the view: it shows the viewer's own content under the page URL. */\n viaAccountMenu: boolean\n}\n\nconst KIND_BY_PANE: Record<string, ViewKind> = {\n profile: 'profile',\n social: 'friends',\n folder: 'storage'\n}\n\nfunction asRecord (raw: unknown): Record<string, unknown> {\n return raw !== null && typeof raw === 'object' ? raw as Record<string, unknown> : {}\n}\n\nexport function viewFromPane (pane?: string, subject?: string): NavigationView {\n if (!pane) return { kind: 'default' }\n return { kind: KIND_BY_PANE[pane] ?? 'pane', pane, ...(subject ? { subject } : {}) }\n}\n\nexport function parseNavigationState (raw: unknown): NavigationState {\n const { paneName, paneUri, viaAccountMenu } = asRecord(raw)\n return {\n view: viewFromPane(\n typeof paneName === 'string' && paneName ? paneName : undefined,\n typeof paneUri === 'string' && paneUri ? paneUri : undefined\n ),\n viaAccountMenu: viaAccountMenu === true\n }\n}\n\nexport function readNavigationState (): NavigationState {\n return parseNavigationState(window.history.state)\n}\n\nexport interface HistoryStateChange {\n /** The pane that is being displayed, and its own subject if it has one. */\n pane?: { name: string, subject?: string }\n /** The entry is for a different URL than the current one. */\n leavingPage: boolean\n /** The account menu is displaying it. */\n viaAccountMenu: boolean\n}\n\n/**\n * The state to store for an entry after displaying something.\n *\n * Pane details describe what was displayed, so they must not leak into the entry of\n * another URL, nor outlive the pane they were saved for. The account-menu marker\n * keeps a later page load from restoring the viewer's content over the URL's subject.\n */\nexport function nextHistoryState (current: unknown, change: HistoryStateChange): Record<string, unknown> {\n const next: Record<string, unknown> = { ...asRecord(current) }\n\n if (change.pane) {\n next.paneName = change.pane.name\n if (typeof change.pane.subject === 'string') next.paneUri = change.pane.subject\n }\n if (change.leavingPage && !change.pane) delete next.paneName\n if ((change.leavingPage && !change.pane) || (change.pane && !change.pane.subject)) delete next.paneUri\n\n if (change.viaAccountMenu) next.viaAccountMenu = true\n else delete next.viaAccountMenu\n\n return next\n}\n\n/** The state without anything about the displayed pane. */\nexport function withoutPaneState (raw: unknown): Record<string, unknown> {\n const { paneName, paneUri, viaAccountMenu, ...rest } = asRecord(raw)\n return rest\n}\n\n/** Forget what the current entry displayed, so the URL alone decides what to show. */\nexport function clearPaneState (): void {\n window.history.replaceState(withoutPaneState(window.history.state), '', window.location.href)\n}\n"],"mappings":"AAwBA,IAAMA,EAAyC,CAC7C,QAAS,UACT,OAAQ,UACR,OAAQ,SACV,EAEA,SAASC,EAAU,EAAuC,CACxD,OAAuB,OAAOC,GAAQ,UAA/BA,EAA0CA,EAAiC,CAAC,CACrF,CAEA,SAAgBC,EAAc,EAAe,EAAkC,CAE7E,OADKC,EACE,CAAE,KAAMJ,EAAaI,IAAS,OAAQ,OAAM,GAAIC,EAAU,CAAE,SAAQ,EAAI,CAAC,CAAG,EADjE,CAAE,KAAM,SAAU,CAEtC,CAEA,SAAgBC,EAAsB,EAA+B,CACnE,GAAM,CAAE,WAAU,UAAS,kBAAmBL,EAASC,CAAG,EAC1D,MAAO,CACL,KAAMC,EACJ,OAAOI,GAAa,UAAYA,EAAWA,EAAW,IAAA,GACtD,OAAOC,GAAY,UAAYA,EAAUA,EAAU,IAAA,EACrD,EACA,eAAgBC,IAAmB,EACrC,CACF,CAEA,SAAgBC,GAAwC,CACtD,OAAOJ,EAAqB,OAAO,QAAQ,KAAK,CAClD,CAkBA,SAAgBK,EAAkB,EAAkB,EAAqD,CACvG,IAAMC,EAAgC,CAAE,GAAGX,EAASY,CAAO,CAAE,EAY7D,OAVIC,EAAO,OACT,EAAK,SAAWA,EAAO,KAAK,KACxB,OAAOA,EAAO,KAAK,SAAY,WAAU,EAAK,QAAUA,EAAO,KAAK,UAEtEA,EAAO,aAAe,CAACA,EAAO,MAAM,OAAOF,EAAK,UAC/CE,EAAO,aAAe,CAACA,EAAO,MAAUA,EAAO,MAAQ,CAACA,EAAO,KAAK,UAAU,OAAOF,EAAK,QAE3FE,EAAO,eAAgB,EAAK,eAAiB,GAC5C,OAAOF,EAAK,eAEVA,CACT,CAGA,SAAgBG,EAAkB,EAAuC,CACvE,GAAM,CAAE,WAAU,UAAS,iBAAgB,GAAGC,GAASf,EAASC,CAAG,EACnE,OAAOc,CACT,CAGA,SAAgBC,GAAwB,CACtC,OAAO,QAAQ,aAAaF,EAAiB,OAAO,QAAQ,KAAK,EAAG,GAAI,OAAO,SAAS,IAAI,CAC9F,C"}
@@ -0,0 +1,40 @@
1
+ export type ViewKind = 'default' | 'profile' | 'friends' | 'storage' | 'pane';
2
+ export interface NavigationView {
3
+ kind: ViewKind;
4
+ /** Registry name of the displayed pane. Always set unless the kind is `default`. */
5
+ pane?: string;
6
+ /** What the pane displays when that is not the page URL (a profile, friends list or storage). */
7
+ subject?: string;
8
+ }
9
+ export interface NavigationState {
10
+ view: NavigationView;
11
+ /** The account menu opened the view: it shows the viewer's own content under the page URL. */
12
+ viaAccountMenu: boolean;
13
+ }
14
+ export declare function viewFromPane(pane?: string, subject?: string): NavigationView;
15
+ export declare function parseNavigationState(raw: unknown): NavigationState;
16
+ export declare function readNavigationState(): NavigationState;
17
+ export interface HistoryStateChange {
18
+ /** The pane that is being displayed, and its own subject if it has one. */
19
+ pane?: {
20
+ name: string;
21
+ subject?: string;
22
+ };
23
+ /** The entry is for a different URL than the current one. */
24
+ leavingPage: boolean;
25
+ /** The account menu is displaying it. */
26
+ viaAccountMenu: boolean;
27
+ }
28
+ /**
29
+ * The state to store for an entry after displaying something.
30
+ *
31
+ * Pane details describe what was displayed, so they must not leak into the entry of
32
+ * another URL, nor outlive the pane they were saved for. The account-menu marker
33
+ * keeps a later page load from restoring the viewer's content over the URL's subject.
34
+ */
35
+ export declare function nextHistoryState(current: unknown, change: HistoryStateChange): Record<string, unknown>;
36
+ /** The state without anything about the displayed pane. */
37
+ export declare function withoutPaneState(raw: unknown): Record<string, unknown>;
38
+ /** Forget what the current entry displayed, so the URL alone decides what to show. */
39
+ export declare function clearPaneState(): void;
40
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/navigation/state.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;AAE7E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAA;IACd,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iGAAiG;IACjG,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,cAAc,CAAA;IACpB,8FAA8F;IAC9F,cAAc,EAAE,OAAO,CAAA;CACxB;AAYD,wBAAgB,YAAY,CAAE,IAAI,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,cAAc,CAG7E;AAED,wBAAgB,oBAAoB,CAAE,GAAG,EAAE,OAAO,GAAG,eAAe,CASnE;AAED,wBAAgB,mBAAmB,IAAK,eAAe,CAEtD;AAED,MAAM,WAAW,kBAAkB;IACjC,2EAA2E;IAC3E,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACzC,6DAA6D;IAC7D,WAAW,EAAE,OAAO,CAAA;IACpB,yCAAyC;IACzC,cAAc,EAAE,OAAO,CAAA;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAcvG;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAE,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGvE;AAED,sFAAsF;AACtF,wBAAgB,cAAc,IAAK,IAAI,CAEtC"}