solid-panes 5.1.0-1 → 5.1.0-3

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 (308) hide show
  1. package/README.md +6 -0
  2. package/dist/RDFXMLPane2.esm.js +1 -2
  3. package/dist/_virtual/~icons/lucide/cake.esm.js +1 -2
  4. package/dist/_virtual/~icons/lucide/camera.esm.js +1 -2
  5. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +1 -2
  6. package/dist/_virtual/~icons/lucide/folder-open.esm.js +1 -2
  7. package/dist/_virtual/~icons/lucide/help-circle.esm.js +1 -2
  8. package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +1 -2
  9. package/dist/_virtual/~icons/lucide/mail.esm.js +1 -2
  10. package/dist/_virtual/~icons/lucide/map-pin.esm.js +1 -2
  11. package/dist/_virtual/~icons/lucide/pencil.esm.js +1 -2
  12. package/dist/_virtual/~icons/lucide/phone.esm.js +1 -2
  13. package/dist/_virtual/~icons/lucide/settings-2.esm.js +1 -2
  14. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +1 -2
  15. package/dist/_virtual/~icons/lucide/user.esm.js +1 -2
  16. package/dist/_virtual/~icons/lucide/users.esm.js +1 -2
  17. package/dist/_virtual/~icons/lucide/x.esm.js +1 -2
  18. package/dist/audio/audioPane.esm.js +1 -2
  19. package/dist/classInstancePane.esm.js +1 -2
  20. package/dist/components/editor-card/EditorCard.cjs.js +1 -1
  21. package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
  22. package/dist/components/editor-card/EditorCard.esm.js +6 -7
  23. package/dist/components/editor-card/EditorCard.styles.esm.js +1 -2
  24. package/dist/components/header/Header.cjs.js +1 -1
  25. package/dist/components/header/Header.cjs.js.map +1 -1
  26. package/dist/components/header/Header.esm.js +7 -8
  27. package/dist/components/header/Header.styles.esm.js +1 -2
  28. package/dist/components/navbar/Navbar.cjs.js +2 -2
  29. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  30. package/dist/components/navbar/Navbar.esm.js +8 -9
  31. package/dist/components/navbar/Navbar.styles.esm.js +1 -2
  32. package/dist/components/profile-heading/ProfileHeading.cjs.js +17 -17
  33. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
  34. package/dist/components/profile-heading/ProfileHeading.esm.js +28 -29
  35. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -1
  36. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +1 -1
  37. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -1
  38. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +2 -3
  39. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -1
  40. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +1 -1
  41. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +2 -3
  42. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +1 -2
  43. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +1 -2
  44. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +1 -2
  45. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +1 -2
  46. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +1 -2
  47. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +1 -2
  48. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +0 -1
  49. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +1 -2
  50. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +1 -2
  51. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +1 -2
  52. package/dist/components/profile-heading/editor/textUtils.esm.js +1 -2
  53. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +1 -2
  54. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +1 -2
  55. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +3 -3
  56. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -1
  57. package/dist/components/profile-heading/editor/ui/dialog2.esm.js +4 -19
  58. package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -1
  59. package/dist/components/profile-heading/editor/ui/spinner.esm.js +1 -2
  60. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +1 -2
  61. package/dist/components/profile-heading/friendActions.esm.js +1 -2
  62. package/dist/components/profile-heading/profileHeadingData.esm.js +1 -2
  63. package/dist/dashboard/basicPreferences.esm.js +1 -2
  64. package/dist/dashboard/dashboardPane.esm.js +0 -1
  65. package/dist/dashboard/homepage.esm.js +1 -2
  66. package/dist/dashboard/ontologyData.esm.js +1 -2
  67. package/dist/dashboard/preferencesFormText.esm.js +1 -2
  68. package/dist/dataContentPane2.cjs.js +1 -1
  69. package/dist/dataContentPane2.esm.js +2 -3
  70. package/dist/defaultPane2.cjs.js +1 -1
  71. package/dist/defaultPane2.esm.js +2 -3
  72. package/dist/dokieli/dokieliPane.cjs.js +1 -1
  73. package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
  74. package/dist/dokieli/dokieliPane.esm.js +7 -12
  75. package/dist/dokieli/dokieliPane.esm.js.map +1 -1
  76. package/dist/dokieli/new.esm.js +1 -2
  77. package/dist/form/pane.esm.js +1 -2
  78. package/dist/home/homePane.esm.js +1 -2
  79. package/dist/humanReadablePane.d.ts +3 -0
  80. package/dist/humanReadablePane.d.ts.map +1 -1
  81. package/dist/humanReadablePane2.cjs.js +276 -1
  82. package/dist/humanReadablePane2.cjs.js.map +1 -1
  83. package/dist/humanReadablePane2.esm.js +428 -31
  84. package/dist/humanReadablePane2.esm.js.map +1 -1
  85. package/dist/icons/folder.esm.js +1 -2
  86. package/dist/icons/friends.esm.js +1 -2
  87. package/dist/icons/person.esm.js +1 -2
  88. package/dist/imagePane.d.ts.map +1 -1
  89. package/dist/imagePane2.cjs.js +1 -1
  90. package/dist/imagePane2.cjs.js.map +1 -1
  91. package/dist/imagePane2.esm.js +2 -3
  92. package/dist/imagePane2.esm.js.map +1 -1
  93. package/dist/index.cjs.js +1 -1
  94. package/dist/index.cjs.js.map +1 -1
  95. package/dist/index.d.ts +1 -0
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.esm.js +17 -17
  98. package/dist/index.esm.js.map +1 -1
  99. package/dist/internal/internalPane2.cjs.js +1 -1
  100. package/dist/internal/internalPane2.esm.js +2 -3
  101. package/dist/mainPage/header.esm.js +1 -2
  102. package/dist/mainPage/index.cjs.js +1 -1
  103. package/dist/mainPage/index.cjs.js.map +1 -1
  104. package/dist/mainPage/index.d.ts +1 -1
  105. package/dist/mainPage/index.d.ts.map +1 -1
  106. package/dist/mainPage/index.esm.js +42 -27
  107. package/dist/mainPage/index.esm.js.map +1 -1
  108. package/dist/mainPage/navbar.esm.js +1 -2
  109. package/dist/mainPage/navigation.cjs.js +1 -1
  110. package/dist/mainPage/navigation.cjs.js.map +1 -1
  111. package/dist/mainPage/navigation.d.ts.map +1 -1
  112. package/dist/mainPage/navigation.esm.js +14 -11
  113. package/dist/mainPage/navigation.esm.js.map +1 -1
  114. package/dist/mainPage/profileHeading.d.ts +2 -1
  115. package/dist/mainPage/profileHeading.d.ts.map +1 -1
  116. package/dist/mainPage/profileHeading2.cjs.js +1 -1
  117. package/dist/mainPage/profileHeading2.cjs.js.map +1 -1
  118. package/dist/mainPage/profileHeading2.esm.js +76 -77
  119. package/dist/mainPage/profileHeading2.esm.js.map +1 -1
  120. package/dist/n3Pane2.esm.js +1 -2
  121. package/dist/navigation/browserEvents.esm.js +1 -2
  122. package/dist/navigation/chrome.cjs.js +1 -1
  123. package/dist/navigation/chrome.cjs.js.map +1 -1
  124. package/dist/navigation/chrome.d.ts +20 -2
  125. package/dist/navigation/chrome.d.ts.map +1 -1
  126. package/dist/navigation/chrome.esm.js +15 -10
  127. package/dist/navigation/chrome.esm.js.map +1 -1
  128. package/dist/navigation/controller.cjs.js +1 -1
  129. package/dist/navigation/controller.cjs.js.map +1 -1
  130. package/dist/navigation/controller.d.ts +3 -0
  131. package/dist/navigation/controller.d.ts.map +1 -1
  132. package/dist/navigation/controller.esm.js +50 -30
  133. package/dist/navigation/controller.esm.js.map +1 -1
  134. package/dist/navigation/events.esm.js +1 -2
  135. package/dist/navigation/navbarVisibility.esm.js +1 -2
  136. package/dist/navigation/options.cjs.js +1 -1
  137. package/dist/navigation/options.cjs.js.map +1 -1
  138. package/dist/navigation/options.d.ts +12 -0
  139. package/dist/navigation/options.d.ts.map +1 -1
  140. package/dist/navigation/options.esm.js +5 -3
  141. package/dist/navigation/options.esm.js.map +1 -1
  142. package/dist/navigation/podContext.cjs.js +1 -1
  143. package/dist/navigation/podContext.cjs.js.map +1 -1
  144. package/dist/navigation/podContext.d.ts.map +1 -1
  145. package/dist/navigation/podContext.esm.js +15 -16
  146. package/dist/navigation/podContext.esm.js.map +1 -1
  147. package/dist/navigation/state.esm.js +1 -2
  148. package/dist/outline/context.esm.js +1 -2
  149. package/dist/outline/fileExplorerHelpers.cjs.js +2 -0
  150. package/dist/outline/fileExplorerHelpers.cjs.js.map +1 -0
  151. package/dist/outline/fileExplorerHelpers.d.ts +13 -0
  152. package/dist/outline/fileExplorerHelpers.d.ts.map +1 -0
  153. package/dist/outline/fileExplorerHelpers.esm.js +24 -0
  154. package/dist/outline/fileExplorerHelpers.esm.js.map +1 -0
  155. package/dist/outline/manager2.cjs.js +1 -1
  156. package/dist/outline/manager2.cjs.js.map +1 -1
  157. package/dist/outline/manager2.esm.js +457 -437
  158. package/dist/outline/manager2.esm.js.map +1 -1
  159. package/dist/outline/outlineDomHelpers.cjs.js +2 -0
  160. package/dist/outline/outlineDomHelpers.cjs.js.map +1 -0
  161. package/dist/outline/outlineDomHelpers.d.ts +30 -0
  162. package/dist/outline/outlineDomHelpers.d.ts.map +1 -0
  163. package/dist/outline/outlineDomHelpers.esm.js +79 -0
  164. package/dist/outline/outlineDomHelpers.esm.js.map +1 -0
  165. package/dist/outline/outlineIcons.esm.js +1 -2
  166. package/dist/outline/propertyViews.esm.js +1 -2
  167. package/dist/outline/queryByExample.cjs.js.map +1 -1
  168. package/dist/outline/queryByExample.esm.js +1 -2
  169. package/dist/outline/queryByExample.esm.js.map +1 -1
  170. package/dist/outline/userInput.cjs.js +9 -9
  171. package/dist/outline/userInput.cjs.js.map +1 -1
  172. package/dist/outline/userInput.esm.js +50 -40
  173. package/dist/outline/userInput.esm.js.map +1 -1
  174. package/dist/outline/viewAsImage.esm.js +1 -2
  175. package/dist/outline/viewAsMbox.esm.js +1 -2
  176. package/dist/pad/padPane2.cjs.js +1 -1
  177. package/dist/pad/padPane2.esm.js +2 -3
  178. package/dist/playlist/playlistPane.esm.js +1 -2
  179. package/dist/registerPanes.esm.js +1 -2
  180. package/dist/schedule/formsForSchedule.esm.js +1 -2
  181. package/dist/schedule/schedulePane.d.ts.map +1 -1
  182. package/dist/schedule/schedulePane2.cjs.js +1 -1
  183. package/dist/schedule/schedulePane2.cjs.js.map +1 -1
  184. package/dist/schedule/schedulePane2.esm.js +60 -59
  185. package/dist/schedule/schedulePane2.esm.js.map +1 -1
  186. package/dist/sharing/sharingPane.esm.js +1 -2
  187. package/dist/slideshow/slideshowPane.esm.js +1 -2
  188. package/dist/social/editProfileDetails.cjs.js +1 -1
  189. package/dist/social/editProfileDetails.esm.js +1 -2
  190. package/dist/social/icons.esm.js +1 -2
  191. package/dist/social/socialPane2.esm.js +1 -2
  192. package/dist/social/socialSections.esm.js +1 -2
  193. package/dist/social/triage.esm.js +1 -2
  194. package/dist/tabbed/tabbedPane.esm.js +1 -2
  195. package/dist/tableViewPane.esm.js +1 -2
  196. package/dist/transaction/pane.esm.js +1 -2
  197. package/dist/transaction/period.esm.js +1 -2
  198. package/dist/trip/tripPane.esm.js +1 -2
  199. package/dist/trustedApplications/trustedApplications.dom.esm.js +1 -2
  200. package/dist/trustedApplications/trustedApplications.utils.esm.js +1 -2
  201. package/dist/trustedApplications/trustedApplications.view.esm.js +1 -2
  202. package/dist/ui/pane.esm.js +1 -2
  203. package/dist/utils/paneUtils.cjs.js +1 -1
  204. package/dist/utils/paneUtils.cjs.js.map +1 -1
  205. package/dist/utils/paneUtils.d.ts +5 -3
  206. package/dist/utils/paneUtils.d.ts.map +1 -1
  207. package/dist/utils/paneUtils.esm.js +36 -29
  208. package/dist/utils/paneUtils.esm.js.map +1 -1
  209. package/dist/utils/podUtils.cjs.js +1 -1
  210. package/dist/utils/podUtils.cjs.js.map +1 -1
  211. package/dist/utils/podUtils.d.ts +9 -1
  212. package/dist/utils/podUtils.d.ts.map +1 -1
  213. package/dist/utils/podUtils.esm.js +22 -95
  214. package/dist/utils/podUtils.esm.js.map +1 -1
  215. package/dist/utils/viewerUtils.esm.js +1 -2
  216. package/dist/utils/webIdUtils.esm.js +1 -2
  217. package/dist/versionInfo.cjs.js +1 -1
  218. package/dist/versionInfo.cjs.js.map +1 -1
  219. package/dist/versionInfo.esm.js +4 -5
  220. package/dist/versionInfo.esm.js.map +1 -1
  221. package/dist/video/videoPane.esm.js +1 -2
  222. package/package.json +7 -6
  223. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +0 -2
  224. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +0 -1
  225. package/dist/_virtual/~icons/lucide/arrow-left.esm.js +0 -11
  226. package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +0 -1
  227. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +0 -2
  228. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +0 -1
  229. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +0 -11
  230. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +0 -1
  231. package/dist/_virtual/~icons/lucide/folder.cjs.js +0 -2
  232. package/dist/_virtual/~icons/lucide/folder.cjs.js.map +0 -1
  233. package/dist/_virtual/~icons/lucide/folder.esm.js +0 -11
  234. package/dist/_virtual/~icons/lucide/folder.esm.js.map +0 -1
  235. package/dist/_virtual/~icons/lucide/globe.cjs.js +0 -2
  236. package/dist/_virtual/~icons/lucide/globe.cjs.js.map +0 -1
  237. package/dist/_virtual/~icons/lucide/globe.esm.js +0 -11
  238. package/dist/_virtual/~icons/lucide/globe.esm.js.map +0 -1
  239. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +0 -2
  240. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +0 -1
  241. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +0 -11
  242. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +0 -1
  243. package/dist/_virtual/~icons/lucide/share-2.cjs.js +0 -2
  244. package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +0 -1
  245. package/dist/_virtual/~icons/lucide/share-2.esm.js +0 -11
  246. package/dist/_virtual/~icons/lucide/share-2.esm.js.map +0 -1
  247. package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js +0 -2
  248. package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +0 -1
  249. package/dist/_virtual/~icons/lucide/user-round-cog.esm.js +0 -11
  250. package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +0 -1
  251. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +0 -14
  252. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +0 -1
  253. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +0 -18
  254. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +0 -1
  255. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +0 -292
  256. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +0 -1
  257. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +0 -2
  258. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +0 -1
  259. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +0 -7
  260. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +0 -1
  261. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +0 -32
  262. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +0 -1
  263. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +0 -21
  264. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +0 -1
  265. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +0 -294
  266. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +0 -1
  267. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +0 -2
  268. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +0 -1
  269. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +0 -7
  270. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +0 -1
  271. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +0 -34
  272. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +0 -1
  273. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +0 -20
  274. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +0 -1
  275. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +0 -346
  276. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +0 -1
  277. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +0 -2
  278. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +0 -1
  279. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +0 -7
  280. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +0 -1
  281. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +0 -13
  282. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +0 -1
  283. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +0 -36
  284. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +0 -1
  285. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +0 -470
  286. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +0 -1
  287. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +0 -2
  288. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +0 -1
  289. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +0 -7
  290. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +0 -1
  291. package/dist/components/file-explorer-header/index.cjs.js +0 -1
  292. package/dist/components/file-explorer-header/index.d.ts +0 -3
  293. package/dist/components/file-explorer-header/index.d.ts.map +0 -1
  294. package/dist/components/file-explorer-header/index.esm.js +0 -2
  295. package/dist/components/file-explorer-header/types.d.ts +0 -10
  296. package/dist/components/file-explorer-header/types.d.ts.map +0 -1
  297. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +0 -8
  298. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +0 -1
  299. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +0 -32
  300. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +0 -1
  301. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +0 -19
  302. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +0 -1
  303. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +0 -322
  304. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +0 -1
  305. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js +0 -2
  306. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +0 -1
  307. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js +0 -7
  308. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +0 -1
@@ -1,42 +1,57 @@
1
- import { clearPaneState as e } from "../navigation/state.esm.js";
2
- import { createHeader as t } from "./header.esm.js";
3
- import { createNavbar as n } from "./navbar.esm.js";
4
- import { initializeProfileHeading as r, placeProfileHeading as i } from "./profileHeading2.esm.js";
5
- import { navigationFor as a } from "./navigation.esm.js";
6
- import { registerBrowserNavigation as o } from "../navigation/browserEvents.esm.js";
7
- import { getOutliner as s } from "../index.esm.js";
8
- //#region src/mainPage/index.ts
9
- var c = "__lastRenderEnvSignature";
10
- function l(e) {
1
+ import { resetPodContexts as e } from "../navigation/podContext.esm.js";
2
+ import { clearPaneState as t } from "../navigation/state.esm.js";
3
+ import "../humanReadablePane2.esm.js";
4
+ import { createHeader as n } from "./header.esm.js";
5
+ import { createNavbar as r } from "./navbar.esm.js";
6
+ import { initializeProfileHeading as i, placeProfileHeading as a } from "./profileHeading2.esm.js";
7
+ import { navigationFor as o } from "./navigation.esm.js";
8
+ import { registerBrowserNavigation as s } from "../navigation/browserEvents.esm.js";
9
+ import { getOutliner as c } from "../index.esm.js";
10
+ import { authSession as l } from "solid-logic";
11
+ // src/mainPage/index.ts
12
+ var u = "__lastRenderEnvSignature";
13
+ function d(e) {
11
14
  return e ? [
12
15
  e.layout,
13
16
  e.theme,
14
17
  e.inputMode
15
18
  ].join("|") : "";
16
19
  }
17
- function u() {
20
+ function f() {
18
21
  let e = document.getElementById("MainContent");
19
22
  return e || (e = document.createElement("main"), e.id = "MainContent", e.setAttribute("role", "main"), e.setAttribute("tabindex", "-1"), e.setAttribute("aria-live", "polite"), document.body.appendChild(e)), e;
20
23
  }
21
- async function d(d, f, p) {
22
- u(), f ||= window.location.href;
23
- let m = typeof f == "string" ? d.sym(f) : f;
24
- e(), r();
25
- let h = s(document, p);
26
- h[c] = l(p);
27
- let g = a(h, d);
28
- o(g), await g.show({
24
+ async function p(p, m, h) {
25
+ if (window.name === "solidos-human-readable-preview" && window.self !== window.top) {
26
+ document.body.textContent = "This resource cannot be previewed here. Open it in a new tab instead.";
27
+ return;
28
+ }
29
+ f(), m ||= window.location.href;
30
+ let g = typeof m == "string" ? p.sym(m) : m;
31
+ t(), await i();
32
+ let _ = c(document, h);
33
+ _[u] = d(h);
34
+ let v = o(_, p);
35
+ s(v);
36
+ let y = () => {
37
+ e(), v.show({
38
+ kind: "restore",
39
+ forceHeading: !0
40
+ }).catch((e) => {
41
+ console.error("Failed to refresh navigation after an authentication change.", e);
42
+ });
43
+ };
44
+ l.events.on("login", y), l.events.on("sessionRestore", y), l.events.on("logout", y), l.events.on("sessionChange", y), l.events.on("identityReplaced", y), await v.show({
29
45
  kind: "restore",
30
- subject: m.uri
46
+ subject: g.uri
31
47
  });
32
- let _ = await t(g), v = await n(g);
33
- return i(), Promise.all([_, v]);
48
+ let b = await n(v), x = await r(v);
49
+ return a(), Promise.all([b, x]);
34
50
  }
35
- async function f(e) {
36
- let t = e?.context?.session?.store, n = l(e?.context?.environment);
37
- n !== (e?.[c] ?? "") && t && typeof e?.GotoSubject == "function" && (await a(e, t).show({ kind: "restore" }), e[c] = n);
51
+ async function m(e) {
52
+ let t = e?.context?.session?.store, n = d(e?.context?.environment);
53
+ n !== (e?.[u] ?? "") && t && typeof e?.GotoSubject == "function" && (await o(e, t).show({ kind: "restore" }), e[u] = n);
38
54
  }
39
- //#endregion
40
- export { d as initMainPage, f as refreshUI };
55
+ export { p as initMainPage, m as refreshUI };
41
56
 
42
57
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","registerBrowserNavigation","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;;AAiBA,IAAMA,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CAEA,AADAF,EAAkB,GAClB,MAAa,OAAO,SAAS;CAC7B,IAAMG,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA;CAMtE,AADAE,EAAe,GACfC,EAAyB;CACzB,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CACjD,EAAkBb,KAAuBC,EAAmBY,CAAW;CACxE,IAAMC,IAAaC,EAAcJ,GAAUH,CAAK;CAEhD,AADAQ,EAA0BF,CAAU,GACpC,MAAMA,EAAW,KAAK;EAAE,MAAM;EAAW,SAASR,EAAQ;CAAI,CAAC;CAE/D,IAAMW,IAAS,MAAMC,EAAaJ,CAAU,GACtCK,IAAS,MAAMC,EAAaN,CAAU;CAG5C,OADAO,EAAoB,GACb,QAAQ,IAAI,CAACJ,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBG,EAAW,GAA0B;CACzD,IAAMd,IAAQG,GAAU,SAAS,SAAS,OAIpCY,IAAmBtB,EAAmBU,GAAU,SAAS,WAAW;CAI1E,AAFmBY,OADQZ,IAAmBX,MAAwB,OAGpDQ,KAAS,OAAOG,GAAU,eAAgB,eAG1D,MAAMI,EAAcJ,GAAUH,CAAK,CAAC,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,GAC5D,EAAkBR,KAAuBuB;AAE9C"}
1
+ {"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","refreshNavigationAfterAuth","resetPodContexts","error","authSession","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authSession } from 'solid-logic'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { resetPodContexts } from '../navigation/podContext'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n await initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n const refreshNavigationAfterAuth = () => {\n resetPodContexts()\n navigation.show({ kind: 'restore', forceHeading: true }).catch((error: unknown) => {\n console.error('Failed to refresh navigation after an authentication change.', error)\n })\n }\n authSession.events.on('login', refreshNavigationAfterAuth)\n authSession.events.on('sessionRestore', refreshNavigationAfterAuth)\n authSession.events.on('logout', refreshNavigationAfterAuth)\n authSession.events.on('sessionChange', refreshNavigationAfterAuth)\n authSession.events.on('identityReplaced', refreshNavigationAfterAuth)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAMA,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CAGA,IAAI,OAAO,SAAA,oCAA8C,OAAO,SAAS,OAAO,KAAK;EACnF,SAAS,KAAK,cAAc;EAC5B;CACF;CAEA,AADAF,EAAkB,GAClB,MAAa,OAAO,SAAS;CAC7B,IAAMG,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA;CAMtE,AADAE,EAAe,GACf,MAAMC,EAAyB;CAC/B,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CACjD,EAAkBb,KAAuBC,EAAmBY,CAAW;CACxE,IAAMC,IAAaC,EAAcJ,GAAUH,CAAK;CAChD,EAA0BM,CAAU;CACpC,IAAME,UAAmC;EAEvC,AADAC,EAAiB,GACjBH,EAAW,KAAK;GAAE,MAAM;GAAW,cAAc;EAAK,CAAC,CAAC,CAAC,OAAO,MAAmB;GACjF,QAAQ,MAAM,gEAAgEI,CAAK;EACrF,CAAC;CACH;CAMA,AALAC,EAAY,OAAO,GAAG,SAASH,CAA0B,GACzDG,EAAY,OAAO,GAAG,kBAAkBH,CAA0B,GAClEG,EAAY,OAAO,GAAG,UAAUH,CAA0B,GAC1DG,EAAY,OAAO,GAAG,iBAAiBH,CAA0B,GACjEG,EAAY,OAAO,GAAG,oBAAoBH,CAA0B,GACpE,MAAMF,EAAW,KAAK;EAAE,MAAM;EAAW,SAASR,EAAQ;CAAI,CAAC;CAE/D,IAAMc,IAAS,MAAMC,EAAaP,CAAU,GACtCQ,IAAS,MAAMC,EAAaT,CAAU;CAG5C,OADAU,EAAoB,GACb,QAAQ,IAAI,CAACJ,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBG,EAAW,GAA0B;CACzD,IAAMjB,IAAQG,GAAU,SAAS,SAAS,OAIpCe,IAAmBzB,EAAmBU,GAAU,SAAS,WAAW;CAI1E,AAFmBe,OADQf,IAAmBX,MAAwB,OAGpDQ,KAAS,OAAOG,GAAU,eAAgB,eAG1D,MAAMI,EAAcJ,GAAUH,CAAK,CAAC,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,GAC5D,EAAkBR,KAAuB0B;AAE9C"}
@@ -10,7 +10,7 @@ import "../_virtual/~icons/lucide/folder-open.esm.js";
10
10
  import "../components/navbar/index.esm.js";
11
11
  import { store as l } from "solid-logic";
12
12
  import { html as u, render as d } from "lit-html";
13
- //#region src/mainPage/navbar.ts
13
+ // src/mainPage/navbar.ts
14
14
  function f() {
15
15
  return c(window.location.href, o().viaAccountMenu);
16
16
  }
@@ -95,7 +95,6 @@ async function _(m) {
95
95
  });
96
96
  return w;
97
97
  }
98
- //#endregion
99
98
  export { _ as createNavbar, m as selectNavbarPane };
100
99
 
101
100
  //# sourceMappingURL=navbar.esm.js.map
@@ -1,2 +1,2 @@
1
- const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./navbar.cjs.js"),n=require("../navigation/controller.cjs.js"),r=require("./profileHeading2.cjs.js");let i=require("pane-registry");i=e.__toESM(i);var a=new WeakMap;function o(e,o){let s=a.get(e);return s||(s=n.createNavigationController({store:o,outliner:e,byName:i.byName,effects:{selectNavbarPane:t.selectNavbarPane,refreshHeading:r.refreshProfileHeading}}),a.set(e,s)),s}exports.navigationFor=o;
1
+ const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./navbar.cjs.js"),n=require("../navigation/controller.cjs.js"),r=require("./profileHeading2.cjs.js");let i=require("pane-registry");i=e.__toESM(i);var a=new WeakMap;function o(e,o){let s=a.get(e);if(!s){let c=e.context?.session?.paneRegistry,l=typeof c?.byName==`function`?c.byName.bind(c):i.byName;s=n.createNavigationController({store:o,outliner:e,byName:l,effects:{selectNavbarPane:t.selectNavbarPane,refreshHeading:r.refreshProfileHeading}}),a.set(e,s)}return s}exports.navigationFor=o;
2
2
  //# sourceMappingURL=navigation.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.cjs.js","names":["createNavigationController","paneRegistry","refreshProfileHeading","require_runtime","require_navbar","require_controller","require_profileHeading","pane_registry","controllers","navigationFor","controller","outliner"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n controller = createNavigationController({\n store,\n outliner,\n byName: paneRegistry.byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":"A,sNAOA,IAAMQ,EAAc,IAAI,QAGxB,SAAgBC,EAAe,EAA0B,EAAwC,CAC/F,IAAIC,EAAaF,EAAY,IAAIG,CAAQ,EAUzC,OATKD,IACH,EAAaV,EAAAA,2BAA2B,CACtC,QACA,WACA,OAAQC,EAAa,OACrB,QAAS,CAAE,iBAAAG,EAAA,iBAAkB,eAAgBF,EAAAA,qBAAsB,CACrE,CAAC,EACDM,EAAY,IAAIG,EAAUD,CAAU,GAE/BA,CACT,C"}
1
+ {"version":3,"file":"navigation.cjs.js","names":["paneRegistry","createNavigationController","refreshProfileHeading","require_runtime","require_navbar","require_controller","require_profileHeading","pane_registry","controllers","navigationFor","controller","outliner","registry","byName"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n const registry = (outliner as any).context?.session?.paneRegistry\n const byName = typeof registry?.byName === 'function'\n ? registry.byName.bind(registry)\n : paneRegistry.byName\n controller = createNavigationController({\n store,\n outliner,\n byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":"A,sNAOA,IAAMQ,EAAc,IAAI,QAGxB,SAAgBC,EAAe,EAA0B,EAAwC,CAC/F,IAAIC,EAAaF,EAAY,IAAIG,CAAQ,EACzC,GAAI,CAACD,EAAY,CACf,IAAME,EAAYD,EAAiB,SAAS,SAAS,aAC/CE,EAAS,OAAOD,GAAU,QAAW,WACvCA,EAAS,OAAO,KAAKA,CAAQ,EAC7BZ,EAAa,OACjB,EAAaC,EAAAA,2BAA2B,CACtC,QACA,WACA,SACA,QAAS,CAAE,iBAAAG,EAAA,iBAAkB,eAAgBF,EAAAA,qBAAsB,CACrE,CAAC,EACDM,EAAY,IAAIG,EAAUD,CAAU,CACtC,CACA,OAAOA,CACT,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/mainPage/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAMhG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,CAY/F"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/mainPage/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAMhG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,CAgB/F"}
@@ -2,21 +2,24 @@ import { selectNavbarPane as e } from "./navbar.esm.js";
2
2
  import { createNavigationController as t } from "../navigation/controller.esm.js";
3
3
  import { refreshProfileHeading as n } from "./profileHeading2.esm.js";
4
4
  import * as r from "pane-registry";
5
- //#region src/mainPage/navigation.ts
5
+ // src/mainPage/navigation.ts
6
6
  var i = /* @__PURE__ */ new WeakMap();
7
7
  function a(a, o) {
8
8
  let s = i.get(a);
9
- return s || (s = t({
10
- store: o,
11
- outliner: a,
12
- byName: r.byName,
13
- effects: {
14
- selectNavbarPane: e,
15
- refreshHeading: n
16
- }
17
- }), i.set(a, s)), s;
9
+ if (!s) {
10
+ let c = a.context?.session?.paneRegistry, l = typeof c?.byName == "function" ? c.byName.bind(c) : r.byName;
11
+ s = t({
12
+ store: o,
13
+ outliner: a,
14
+ byName: l,
15
+ effects: {
16
+ selectNavbarPane: e,
17
+ refreshHeading: n
18
+ }
19
+ }), i.set(a, s);
20
+ }
21
+ return s;
18
22
  }
19
- //#endregion
20
23
  export { a as navigationFor };
21
24
 
22
25
  //# sourceMappingURL=navigation.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.esm.js","names":["paneRegistry","controllers","navigationFor","controller","outliner","createNavigationController","refreshProfileHeading"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n controller = createNavigationController({\n store,\n outliner,\n byName: paneRegistry.byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":";;;;;AAOA,IAAMC,oBAAc,IAAI,QAA8C;AAGtE,SAAgBC,EAAe,GAA0B,GAAwC;CAC/F,IAAIC,IAAaF,EAAY,IAAIG,CAAQ;CAUzC,OATKD,MACH,IAAaE,EAA2B;EACtC;EACA;EACA,QAAQL,EAAa;EACrB,SAAS;GAAE;GAAkB,gBAAgBM;EAAsB;CACrE,CAAC,GACDL,EAAY,IAAIG,GAAUD,CAAU,IAE/BA;AACT"}
1
+ {"version":3,"file":"navigation.esm.js","names":["paneRegistry","controllers","navigationFor","controller","outliner","registry","byName","createNavigationController","refreshProfileHeading"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n const registry = (outliner as any).context?.session?.paneRegistry\n const byName = typeof registry?.byName === 'function'\n ? registry.byName.bind(registry)\n : paneRegistry.byName\n controller = createNavigationController({\n store,\n outliner,\n byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":";;;;;AAOA,IAAMC,oBAAc,IAAI,QAA8C;AAGtE,SAAgBC,EAAe,GAA0B,GAAwC;CAC/F,IAAIC,IAAaF,EAAY,IAAIG,CAAQ;CACzC,IAAI,CAACD,GAAY;EACf,IAAME,IAAYD,EAAiB,SAAS,SAAS,cAC/CE,IAAS,OAAOD,GAAU,UAAW,aACvCA,EAAS,OAAO,KAAKA,CAAQ,IAC7BL,EAAa;EAOjB,AANA,IAAaO,EAA2B;GACtC;GACA;GACA;GACA,SAAS;IAAE;IAAkB,gBAAgBC;GAAsB;EACrE,CAAC,GACDP,EAAY,IAAIG,GAAUD,CAAU;CACtC;CACA,OAAOA;AACT"}
@@ -1,5 +1,6 @@
1
1
  export declare function refreshProfileHeading(force?: boolean): Promise<void>;
2
2
  /** Put the heading where it belongs, above the navbar, after the navbar has been added. */
3
3
  export declare function placeProfileHeading(): void;
4
- export declare function initializeProfileHeading(): void;
4
+ /** Shells browsing another resource can supply its current URL instead of the page URL. */
5
+ export declare function initializeProfileHeading(getPageUrl?: () => string): Promise<void>;
5
6
  //# sourceMappingURL=profileHeading.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileHeading.d.ts","sourceRoot":"","sources":["../../src/mainPage/profileHeading.ts"],"names":[],"mappings":"AAOA,OAAO,+BAA+B,CAAA;AACtC,OAAO,sBAAsB,CAAA;AA6I7B,wBAAsB,qBAAqB,CAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAyFzE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,IAAK,IAAI,CAE3C;AAED,wBAAgB,wBAAwB,IAAK,IAAI,CAqDhD"}
1
+ {"version":3,"file":"profileHeading.d.ts","sourceRoot":"","sources":["../../src/mainPage/profileHeading.ts"],"names":[],"mappings":"AAOA,OAAO,+BAA+B,CAAA;AACtC,OAAO,sBAAsB,CAAA;AA8I7B,wBAAsB,qBAAqB,CAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA0FzE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,IAAK,IAAI,CAE3C;AAED,2FAA2F;AAC3F,wBAAgB,wBAAwB,CAAE,UAAU,eAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhG"}
@@ -1,2 +1,2 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../utils/webIdUtils.cjs.js"),t=require("../navigation/chrome.cjs.js"),n=require("../navigation/podContext.cjs.js"),r=require("../navigation/state.cjs.js"),i=require("../navigation/events.cjs.js"),a=require("../components/profile-heading/profileHeadingData.cjs.js");require("../components/profile-heading/index.cjs.js");let o=require("solid-logic");var s=`solid-panes-profile-heading`,c=`profile-heading-mount`,l=0,u=!1,d=!1,f=!1,p,m=``,h=``,g=``,_=new WeakMap,v=new WeakMap;function y(e){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`)return;let t=getComputedStyle(e),n=t.marginTop||`18px`,r=t.marginBottom||`20px`,i=e.animate([{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`},{height:`${e.getBoundingClientRect().height}px`,opacity:1,marginTop:n,marginBottom:r,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`both`});v.set(e,i);let a=()=>{v.get(e)===i&&(v.delete(e),i.cancel())};i.finished.then(a,t=>{v.get(e)===i&&(console.error(`Failed to animate profile heading appearance.`,t),a())})}function b(e){let t=_.get(e);_.delete(e),t?.cancel(),e.inert=!1,e.removeAttribute(`aria-hidden`)}function x(e){if(_.has(e))return;let t=getComputedStyle(e),n=e.getBoundingClientRect().height,r=t.opacity,i=t.marginTop,a=t.marginBottom,o=v.get(e);v.delete(e),o?.cancel();let s=()=>{e.hidden=!0,e.replaceChildren()};if(e.inert=!0,e.setAttribute(`aria-hidden`,`true`),e.hidden||!e.firstElementChild||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`){s();return}let c=e.animate([{height:`${n}px`,opacity:r,marginTop:i,marginBottom:a,overflow:`hidden`},{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`forwards`});_.set(e,c),c.finished.then(()=>{_.get(e)===c&&(s(),_.delete(e),c.cancel())},t=>{_.get(e)===c&&(console.error(`Failed to animate profile heading disappearance.`,t),s(),_.delete(e),c.cancel())})}function S(){w(!0).catch(e=>{console.error(`Failed to refresh profile heading after an authentication change.`,e)})}function C(){let e=document.getElementById(`MainContent`);if(!e)return null;let t=document.getElementById(c);t||(t=document.createElement(`div`),t.id=c,t.setAttribute(`aria-label`,`Profile heading`));let n=document.querySelector(`solid-panes-navbar`),r=document.getElementById(`OutlineView`),i=n?.parentNode===e?n:r?.parentNode===e?r:null;return i&&t.nextSibling!==i?e.insertBefore(t,i):!i&&t.parentNode!==e&&e.appendChild(t),t}async function w(i=!1){await p;let c=await n.getPodContext(window.location.href),u=C();if(!u)return;i&&(l++,m=``,g=``);let{view:d,viaAccountMenu:f}=r.readNavigationState(),v=t.deriveHeading({view:d,viaAccountMenu:f,viewer:o.authn.currentUser()?.value,pageUrl:window.location.href,owner:c.owner,storageUris:c.storagePanes.map(e=>e.subject.value)});if(v.mode===`none`){l++,g=``,m=``,h=``,x(u);return}let{subjectUri:S}=v,T=v.mode===`full`;b(u);let E=`${v.paneName}:${S}`;if(E===m||E===g)return;let D=++l;g=E;let O,k,A,j;try{O=await e.loadProfileFromURI(o.store.sym(S)),k=a.presentProfile(O,o.store),j=T?await a.getViewerMode(O):`anonymous`,A=j===`owner`}catch(e){throw D===l&&(g=``),e}if(D!==l)return;let M=u.querySelector(s)||document.createElement(s);M.profileData=k;let N=o.authn.currentUser();M.friendSubject=T&&N&&!N.sameTerm(O)?O:void 0,M.editContext=A?{subject:O,profileData:k,viewerMode:j,onSaved:()=>w(!0)}:void 0,M.compact=!T;let P=u.hidden||!u.firstElementChild;u.hidden=!1,M.parentNode!==u&&u.replaceChildren(M),m=E,h=O.value,g=``,P&&(await M.updateComplete,D===l&&u.isConnected&&!u.hidden&&!_.has(u)&&y(u))}function T(){C()}function E(){C(),f||=(document.addEventListener(`profile-pane-saved`,e=>{if(!(e instanceof CustomEvent)||e.detail?.subjectUri!==h)return;let t=document.querySelector(`#${c} ${s}`);t&&e.detail.profileData?(l++,g=``,t.profileData=e.detail.profileData,t.editContext&&={...t.editContext,profileData:e.detail.profileData}):w(!0).catch(e=>{console.error(`Failed to refresh profile heading after saving profile information.`,e)})}),!0);let e=p??o.authn.checkUser().then(()=>void 0);p=e,d||=(o.authSession.events.on(`login`,S),o.authSession.events.on(`sessionRestore`,S),o.authSession.events.on(`logout`,S),o.authSession.events.on(`sessionChange`,S),o.authSession.events.on(`identityReplaced`,S),!0),u||=(i.onNavigated(()=>{w().catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}),!0),e.then(()=>w(!0)).catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}exports.initializeProfileHeading=E,exports.placeProfileHeading=T,exports.refreshProfileHeading=w;
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../utils/webIdUtils.cjs.js"),t=require("../navigation/chrome.cjs.js"),n=require("../navigation/podContext.cjs.js"),r=require("../navigation/state.cjs.js"),i=require("../navigation/events.cjs.js"),a=require("../components/profile-heading/profileHeadingData.cjs.js");require("../components/profile-heading/index.cjs.js");let o=require("solid-logic");var s=`solid-panes-profile-heading`,c=`profile-heading-mount`,l=0,u=!1,d=!1,f=!1,p,m=``,h=``,g=``,_=()=>window.location.href,v=new WeakMap,y=new WeakMap;function b(e){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`)return;let t=getComputedStyle(e),n=t.marginTop||`18px`,r=t.marginBottom||`20px`,i=e.animate([{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`},{height:`${e.getBoundingClientRect().height}px`,opacity:1,marginTop:n,marginBottom:r,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`both`});y.set(e,i);let a=()=>{y.get(e)===i&&(y.delete(e),i.cancel())};i.finished.then(a,t=>{y.get(e)===i&&(console.error(`Failed to animate profile heading appearance.`,t),a())})}function x(e){let t=v.get(e);v.delete(e),t?.cancel(),e.inert=!1,e.removeAttribute(`aria-hidden`)}function S(e){if(v.has(e))return;let t=getComputedStyle(e),n=e.getBoundingClientRect().height,r=t.opacity,i=t.marginTop,a=t.marginBottom,o=y.get(e);y.delete(e),o?.cancel();let s=()=>{e.hidden=!0,e.replaceChildren()};if(e.inert=!0,e.setAttribute(`aria-hidden`,`true`),e.hidden||!e.firstElementChild||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`){s();return}let c=e.animate([{height:`${n}px`,opacity:r,marginTop:i,marginBottom:a,overflow:`hidden`},{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`forwards`});v.set(e,c),c.finished.then(()=>{v.get(e)===c&&(s(),v.delete(e),c.cancel())},t=>{v.get(e)===c&&(console.error(`Failed to animate profile heading disappearance.`,t),s(),v.delete(e),c.cancel())})}function C(){T(!0).catch(e=>{console.error(`Failed to refresh profile heading after an authentication change.`,e)})}function w(){let e=document.getElementById(`MainContent`);if(!e)return null;let t=document.getElementById(c);t||(t=document.createElement(`div`),t.id=c,t.setAttribute(`aria-label`,`Profile heading`));let n=document.querySelector(`solid-panes-navbar`),r=document.getElementById(`OutlineView`),i=n?.parentNode===e?n:r?.parentNode===e?r:null;return i&&t.nextSibling!==i?e.insertBefore(t,i):!i&&t.parentNode!==e&&e.appendChild(t),t}async function T(i=!1){await p;let c=_(),u=await n.getPodContext(c),d=w();if(!d)return;i&&(l++,m=``,g=``);let{view:f,viaAccountMenu:y}=r.readNavigationState(),C=t.deriveHeading({view:f,viaAccountMenu:y,viewer:o.authn.currentUser()?.value,pageUrl:c,owner:u.owner,storageUris:u.storagePanes.map(e=>e.subject.value)});if(C.mode===`none`){l++,g=``,m=``,h=``,S(d);return}let{subjectUri:E}=C,D=C.mode===`full`;x(d);let O=`${C.paneName}:${E}`;if(O===m||O===g)return;let k=++l;g=O;let A,j,M,N;try{A=await e.loadProfileFromURI(o.store.sym(E)),j=a.presentProfile(A,o.store),N=D?await a.getViewerMode(A):`anonymous`,M=N===`owner`}catch(e){throw k===l&&(g=``),e}if(k!==l)return;let P=d.querySelector(s)||document.createElement(s);P.profileData=j;let F=o.authn.currentUser();P.friendSubject=t.offersFriendAction(C.paneName)&&F&&!F.sameTerm(A)?A:void 0,P.editContext=M?{subject:A,profileData:j,viewerMode:N,onSaved:()=>T(!0)}:void 0,P.compact=!D;let I=d.hidden||!d.firstElementChild;d.hidden=!1,P.parentNode!==d&&d.replaceChildren(P),m=O,h=A.value,g=``,I&&(await P.updateComplete,k===l&&d.isConnected&&!d.hidden&&!v.has(d)&&b(d))}function E(){w()}function D(e=()=>window.location.href){_=e,w(),f||=(document.addEventListener(`profile-pane-saved`,e=>{if(!(e instanceof CustomEvent)||e.detail?.subjectUri!==h)return;let t=document.querySelector(`#${c} ${s}`);t&&e.detail.profileData?(l++,g=``,t.profileData=e.detail.profileData,t.editContext&&={...t.editContext,profileData:e.detail.profileData}):T(!0).catch(e=>{console.error(`Failed to refresh profile heading after saving profile information.`,e)})}),!0);let t=p??o.authn.checkUser().then(()=>void 0);return p=t,d||=(o.authSession.events.on(`login`,C),o.authSession.events.on(`sessionRestore`,C),o.authSession.events.on(`logout`,C),o.authSession.events.on(`sessionChange`,C),o.authSession.events.on(`identityReplaced`,C),!0),u||=(i.onNavigated(()=>{T().catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}),!0),t.then(()=>T(!0)).catch(e=>{console.error(`Failed to refresh profile heading.`,e)}),t}exports.initializeProfileHeading=D,exports.placeProfileHeading=E,exports.refreshProfileHeading=T;
2
2
  //# sourceMappingURL=profileHeading2.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileHeading2.cjs.js","names":["getPodContext","readNavigationState","deriveHeading","authn","loadProfileFromURI","store","presentProfile","getViewerMode","require_webIdUtils","require_chrome","require_podContext","require_state","require_events","require_profileHeadingData","solid_logic","PROFILE_HEADING_TAG","PROFILE_HEADING_MOUNT_ID","refreshRequest","navigatedListenerRegistered","authListenersRegistered","profileSavedListenerRegistered","authReady","displayedPaneKey","displayedSubjectUri","loadingPaneKey","hideAnimations","showAnimations","showHeading","mount","style","marginTop","marginBottom","animation","finish","error","cancelHeadingHide","hideHeading","height","opacity","showing","refreshAfterAuthChange","refreshProfileHeading","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","pod","force","decision","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","event","readiness"],"sources":["../../src/mainPage/profileHeading.ts"],"sourcesContent":["import { authn, authSession, store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport type { ProfileDetails } from '../components/profile-heading/editor/sections/heading/types'\nimport type { ProfileHeadingEditContext } from '../components/profile-heading/ProfileHeading'\nimport { getViewerMode, presentProfile } from '../components/profile-heading/profileHeadingData'\nimport type { ViewerMode } from '../types'\nimport { loadProfileFromURI } from '../utils/webIdUtils'\nimport '../components/profile-heading'\nimport './profileHeading.css'\nimport { deriveHeading } from '../navigation/chrome'\nimport { getPodContext } from '../navigation/podContext'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState } from '../navigation/state'\n\nconst PROFILE_HEADING_TAG = 'solid-panes-profile-heading'\nconst PROFILE_HEADING_MOUNT_ID = 'profile-heading-mount'\n\nlet refreshRequest = 0\nlet navigatedListenerRegistered = false\nlet authListenersRegistered = false\nlet profileSavedListenerRegistered = false\nlet authReady: Promise<void> | undefined\nlet displayedPaneKey = ''\nlet displayedSubjectUri = ''\nlet loadingPaneKey = ''\nconst hideAnimations = new WeakMap<HTMLElement, Animation>()\nconst showAnimations = new WeakMap<HTMLElement, Animation>()\n\nfunction showHeading (mount: HTMLElement): void {\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') return\n\n const style = getComputedStyle(mount)\n const marginTop = style.marginTop || '18px'\n const marginBottom = style.marginBottom || '20px'\n const animation = mount.animate([\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' },\n {\n height: `${mount.getBoundingClientRect().height}px`,\n opacity: 1,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n }\n ], { duration: 300, easing: 'ease', fill: 'both' })\n showAnimations.set(mount, animation)\n const finish = () => {\n if (showAnimations.get(mount) !== animation) return\n showAnimations.delete(mount)\n animation.cancel()\n }\n animation.finished.then(finish, (error: unknown) => {\n if (showAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading appearance.', error)\n finish()\n })\n}\n\nfunction cancelHeadingHide (mount: HTMLElement): void {\n const animation = hideAnimations.get(mount)\n hideAnimations.delete(mount)\n animation?.cancel()\n mount.inert = false\n mount.removeAttribute('aria-hidden')\n}\n\nfunction hideHeading (mount: HTMLElement): void {\n if (hideAnimations.has(mount)) return\n\n const style = getComputedStyle(mount)\n const height = mount.getBoundingClientRect().height\n const opacity = style.opacity\n const marginTop = style.marginTop\n const marginBottom = style.marginBottom\n const showing = showAnimations.get(mount)\n showAnimations.delete(mount)\n showing?.cancel()\n\n const finish = () => {\n mount.hidden = true\n mount.replaceChildren()\n }\n mount.inert = true\n mount.setAttribute('aria-hidden', 'true')\n\n if (mount.hidden || !mount.firstElementChild ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') {\n finish()\n return\n }\n\n const animation = mount.animate([\n {\n height: `${height}px`,\n opacity,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n },\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' }\n ], { duration: 300, easing: 'ease', fill: 'forwards' })\n hideAnimations.set(mount, animation)\n animation.finished.then(() => {\n if (hideAnimations.get(mount) !== animation) return\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n }, (error: unknown) => {\n if (hideAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading disappearance.', error)\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n })\n}\n\nfunction refreshAfterAuthChange (): void {\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after an authentication change.', error)\n })\n}\n\nfunction ensureMountPoint (): HTMLElement | null {\n const mainContent = document.getElementById('MainContent')\n if (!mainContent) return null\n\n let mount = document.getElementById(PROFILE_HEADING_MOUNT_ID)\n if (!mount) {\n mount = document.createElement('div')\n mount.id = PROFILE_HEADING_MOUNT_ID\n mount.setAttribute('aria-label', 'Profile heading')\n }\n\n const navbar = document.querySelector('solid-panes-navbar')\n const outlineView = document.getElementById('OutlineView')\n const insertionPoint = navbar?.parentNode === mainContent\n ? navbar\n : outlineView?.parentNode === mainContent\n ? outlineView\n : null\n if (insertionPoint && mount.nextSibling !== insertionPoint) {\n mainContent.insertBefore(mount, insertionPoint)\n } else if (!insertionPoint && mount.parentNode !== mainContent) {\n mainContent.appendChild(mount)\n }\n return mount\n}\n\nexport async function refreshProfileHeading (force = false): Promise<void> {\n await authReady\n\n const pod = await getPodContext(window.location.href)\n const mount = ensureMountPoint()\n if (!mount) return\n\n if (force) {\n refreshRequest++\n displayedPaneKey = ''\n loadingPaneKey = ''\n }\n\n const { view, viaAccountMenu } = readNavigationState()\n const decision = deriveHeading({\n view,\n viaAccountMenu,\n viewer: authn.currentUser()?.value,\n pageUrl: window.location.href,\n owner: pod.owner,\n storageUris: pod.storagePanes.map(pane => pane.subject.value)\n })\n\n if (decision.mode === 'none') {\n refreshRequest++\n loadingPaneKey = ''\n displayedPaneKey = ''\n displayedSubjectUri = ''\n hideHeading(mount)\n return\n }\n\n const { subjectUri } = decision\n const isProfilePane = decision.mode === 'full'\n cancelHeadingHide(mount)\n const paneKey = `${decision.paneName}:${subjectUri}`\n if (paneKey === displayedPaneKey || paneKey === loadingPaneKey) return\n\n const request = ++refreshRequest\n loadingPaneKey = paneKey\n let subject: NamedNode\n let profileData: ProfileDetails\n let canEdit: boolean\n let viewerMode: ViewerMode\n try {\n subject = await loadProfileFromURI(store.sym(subjectUri))\n profileData = presentProfile(subject, store)\n viewerMode = isProfilePane ? await getViewerMode(subject) : 'anonymous'\n canEdit = viewerMode === 'owner'\n } catch (error) {\n if (request === refreshRequest) loadingPaneKey = ''\n throw error\n }\n if (request !== refreshRequest) return\n\n const heading = (mount.querySelector(PROFILE_HEADING_TAG) ||\n document.createElement(PROFILE_HEADING_TAG)) as HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n const viewer = authn.currentUser()\n heading.friendSubject = isProfilePane && viewer && !viewer.sameTerm(subject)\n ? subject\n : undefined\n heading.editContext = canEdit\n ? {\n subject,\n profileData,\n viewerMode,\n onSaved: () => refreshProfileHeading(true)\n }\n : undefined\n heading.compact = !isProfilePane\n const appearing = mount.hidden || !mount.firstElementChild\n mount.hidden = false\n if (heading.parentNode !== mount) mount.replaceChildren(heading)\n displayedPaneKey = paneKey\n displayedSubjectUri = subject.value\n loadingPaneKey = ''\n if (appearing) {\n await heading.updateComplete\n if (request === refreshRequest && mount.isConnected && !mount.hidden && !hideAnimations.has(mount)) {\n showHeading(mount)\n }\n }\n}\n\n/** Put the heading where it belongs, above the navbar, after the navbar has been added. */\nexport function placeProfileHeading (): void {\n ensureMountPoint()\n}\n\nexport function initializeProfileHeading (): void {\n ensureMountPoint()\n\n if (!profileSavedListenerRegistered) {\n document.addEventListener('profile-pane-saved', (event) => {\n if (!(event instanceof CustomEvent) || event.detail?.subjectUri !== displayedSubjectUri) return\n\n const heading = document.querySelector<HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n }>(`#${PROFILE_HEADING_MOUNT_ID} ${PROFILE_HEADING_TAG}`)\n if (heading && event.detail.profileData) {\n refreshRequest++\n loadingPaneKey = ''\n heading.profileData = event.detail.profileData\n if (heading.editContext) {\n heading.editContext = { ...heading.editContext, profileData: event.detail.profileData }\n }\n return\n }\n\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after saving profile information.', error)\n })\n })\n profileSavedListenerRegistered = true\n }\n\n const readiness = authReady ?? authn.checkUser().then(() => undefined)\n authReady = readiness\n\n if (!authListenersRegistered) {\n authSession.events.on('login', refreshAfterAuthChange)\n authSession.events.on('sessionRestore', refreshAfterAuthChange)\n authSession.events.on('logout', refreshAfterAuthChange)\n authSession.events.on('sessionChange', refreshAfterAuthChange)\n authSession.events.on('identityReplaced', refreshAfterAuthChange)\n authListenersRegistered = true\n }\n\n // Navigations the page's own navigation does not make, such as links and buttons in solid-ui\n if (!navigatedListenerRegistered) {\n onNavigated(() => {\n refreshProfileHeading().catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n })\n navigatedListenerRegistered = true\n }\n\n readiness.then(() => refreshProfileHeading(true)).catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n}\n"],"mappings":"A,gZAcA,IAAMe,EAAsB,8BACtBC,EAA2B,wBAE7BC,EAAiB,EACjBC,EAA8B,GAC9BC,EAA0B,GAC1BC,EAAiC,GACjCC,EACAC,EAAmB,GACnBC,EAAsB,GACtBC,EAAiB,GACfC,EAAiB,IAAI,QACrBC,EAAiB,IAAI,QAE3B,SAASC,EAAa,EAA0B,CAC9C,GAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,SACxD,OAAOC,EAAM,SAAY,WAAY,OAEzC,IAAMC,EAAQ,iBAAiBD,CAAK,EAC9BE,EAAYD,EAAM,WAAa,OAC/BE,EAAeF,EAAM,cAAgB,OACrCG,EAAYJ,EAAM,QAAQ,CAC9B,CAAE,OAAQ,MAAO,QAAS,EAAG,UAAW,MAAO,aAAc,MAAO,SAAU,QAAS,EACvF,CACE,OAAQ,GAAGA,EAAM,sBAAsB,CAAC,CAAC,OAAO,IAChD,QAAS,EACT,YACA,eACA,SAAU,QACZ,CACF,EAAG,CAAE,SAAU,IAAK,OAAQ,OAAQ,KAAM,MAAO,CAAC,EAClDF,EAAe,IAAIE,EAAOI,CAAS,EACnC,IAAMC,MAAe,CACfP,EAAe,IAAIE,CAAK,IAAMI,IAClCN,EAAe,OAAOE,CAAK,EAC3BI,EAAU,OAAO,EACnB,EACAA,EAAU,SAAS,KAAKC,EAAS,GAAmB,CAC9CP,EAAe,IAAIE,CAAK,IAAMI,IAClC,QAAQ,MAAM,gDAAiDE,CAAK,EACpED,EAAO,EACT,CAAC,CACH,CAEA,SAASE,EAAmB,EAA0B,CACpD,IAAMH,EAAYP,EAAe,IAAIG,CAA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zD,GAAI,EAAE4C,aAAiB,cAAgBA,EAAM,QAAQ,aAAezC,EAAqB,OAEzF,IAAMoC,EAAU,SAAS,cAGtB,IAAI3C,EAAyB,GAAGD,GAAqB,EACpD4C,GAAWK,EAAM,OAAO,aAC1B,IACA,EAAiB,GACjB,EAAQ,YAAcA,EAAM,OAAO,YACnC,AACEL,EAAQ,cAAc,CAAE,GAAGA,EAAQ,YAAa,YAAaK,EAAM,OAAO,WAAY,GAK1FvB,EAAsB,EAAI,CAAC,CAAC,MAAO,GAAmB,CACpD,QAAQ,MAAM,sEAAuEP,CAAK,CAC5F,CAAC,CACH,CAAC,EACgC,IAGnC,IAAM+B,EAAY5C,GAAalB,EAAAA,MAAM,UAAU,CAAC,CAAC,SAAW,IAAA,EAAS,EACrE,EAAY8D,EAEZ,AAME9C,KALAL,EAAA,YAAY,OAAO,GAAG,QAAS0B,CAAsB,EACrD1B,EAAA,YAAY,OAAO,GAAG,iBAAkB0B,CAAsB,EAC9D1B,EAAA,YAAY,OAAO,GAAG,SAAU0B,CAAsB,EACtD1B,EAAA,YAAY,OAAO,GAAG,gBAAiB0B,CAAsB,EAC7D1B,EAAA,YAAY,OAAO,GAAG,mBAAoB0B,CAAsB,EACtC,IAI5B,AAMEtB,KALAN,EAAA,gBAAkB,CAChB6B,EAAsB,CAAC,CAAC,MAAO,GAAmB,CAChD,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,CACH,CAAC,EAC6B,IAGhC+B,EAAU,SAAWxB,EAAsB,EAAI,CAAC,CAAC,CAAC,MAAO,GAAmB,CAC1E,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,CACH,C"}
1
+ {"version":3,"file":"profileHeading2.cjs.js","names":["getPodContext","readNavigationState","deriveHeading","authn","loadProfileFromURI","store","presentProfile","getViewerMode","offersFriendAction","require_webIdUtils","require_chrome","require_podContext","require_state","require_events","require_profileHeadingData","solid_logic","PROFILE_HEADING_TAG","PROFILE_HEADING_MOUNT_ID","refreshRequest","navigatedListenerRegistered","authListenersRegistered","profileSavedListenerRegistered","authReady","displayedPaneKey","displayedSubjectUri","loadingPaneKey","headingPageUrl","hideAnimations","showAnimations","showHeading","mount","style","marginTop","marginBottom","animation","finish","error","cancelHeadingHide","hideHeading","height","opacity","showing","refreshAfterAuthChange","refreshProfileHeading","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","pageUrl","pod","force","decision","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","getPageUrl","event","readiness"],"sources":["../../src/mainPage/profileHeading.ts"],"sourcesContent":["import { authn, authSession, store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport type { ProfileDetails } from '../components/profile-heading/editor/sections/heading/types'\nimport type { ProfileHeadingEditContext } from '../components/profile-heading/ProfileHeading'\nimport { getViewerMode, presentProfile } from '../components/profile-heading/profileHeadingData'\nimport type { ViewerMode } from '../types'\nimport { loadProfileFromURI } from '../utils/webIdUtils'\nimport '../components/profile-heading'\nimport './profileHeading.css'\nimport { deriveHeading, offersFriendAction } from '../navigation/chrome'\nimport { getPodContext } from '../navigation/podContext'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState } from '../navigation/state'\n\nconst PROFILE_HEADING_TAG = 'solid-panes-profile-heading'\nconst PROFILE_HEADING_MOUNT_ID = 'profile-heading-mount'\n\nlet refreshRequest = 0\nlet navigatedListenerRegistered = false\nlet authListenersRegistered = false\nlet profileSavedListenerRegistered = false\nlet authReady: Promise<void> | undefined\nlet displayedPaneKey = ''\nlet displayedSubjectUri = ''\nlet loadingPaneKey = ''\nlet headingPageUrl = () => window.location.href\nconst hideAnimations = new WeakMap<HTMLElement, Animation>()\nconst showAnimations = new WeakMap<HTMLElement, Animation>()\n\nfunction showHeading (mount: HTMLElement): void {\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') return\n\n const style = getComputedStyle(mount)\n const marginTop = style.marginTop || '18px'\n const marginBottom = style.marginBottom || '20px'\n const animation = mount.animate([\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' },\n {\n height: `${mount.getBoundingClientRect().height}px`,\n opacity: 1,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n }\n ], { duration: 300, easing: 'ease', fill: 'both' })\n showAnimations.set(mount, animation)\n const finish = () => {\n if (showAnimations.get(mount) !== animation) return\n showAnimations.delete(mount)\n animation.cancel()\n }\n animation.finished.then(finish, (error: unknown) => {\n if (showAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading appearance.', error)\n finish()\n })\n}\n\nfunction cancelHeadingHide (mount: HTMLElement): void {\n const animation = hideAnimations.get(mount)\n hideAnimations.delete(mount)\n animation?.cancel()\n mount.inert = false\n mount.removeAttribute('aria-hidden')\n}\n\nfunction hideHeading (mount: HTMLElement): void {\n if (hideAnimations.has(mount)) return\n\n const style = getComputedStyle(mount)\n const height = mount.getBoundingClientRect().height\n const opacity = style.opacity\n const marginTop = style.marginTop\n const marginBottom = style.marginBottom\n const showing = showAnimations.get(mount)\n showAnimations.delete(mount)\n showing?.cancel()\n\n const finish = () => {\n mount.hidden = true\n mount.replaceChildren()\n }\n mount.inert = true\n mount.setAttribute('aria-hidden', 'true')\n\n if (mount.hidden || !mount.firstElementChild ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') {\n finish()\n return\n }\n\n const animation = mount.animate([\n {\n height: `${height}px`,\n opacity,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n },\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' }\n ], { duration: 300, easing: 'ease', fill: 'forwards' })\n hideAnimations.set(mount, animation)\n animation.finished.then(() => {\n if (hideAnimations.get(mount) !== animation) return\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n }, (error: unknown) => {\n if (hideAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading disappearance.', error)\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n })\n}\n\nfunction refreshAfterAuthChange (): void {\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after an authentication change.', error)\n })\n}\n\nfunction ensureMountPoint (): HTMLElement | null {\n const mainContent = document.getElementById('MainContent')\n if (!mainContent) return null\n\n let mount = document.getElementById(PROFILE_HEADING_MOUNT_ID)\n if (!mount) {\n mount = document.createElement('div')\n mount.id = PROFILE_HEADING_MOUNT_ID\n mount.setAttribute('aria-label', 'Profile heading')\n }\n\n const navbar = document.querySelector('solid-panes-navbar')\n const outlineView = document.getElementById('OutlineView')\n const insertionPoint = navbar?.parentNode === mainContent\n ? navbar\n : outlineView?.parentNode === mainContent\n ? outlineView\n : null\n if (insertionPoint && mount.nextSibling !== insertionPoint) {\n mainContent.insertBefore(mount, insertionPoint)\n } else if (!insertionPoint && mount.parentNode !== mainContent) {\n mainContent.appendChild(mount)\n }\n return mount\n}\n\nexport async function refreshProfileHeading (force = false): Promise<void> {\n await authReady\n\n const pageUrl = headingPageUrl()\n const pod = await getPodContext(pageUrl)\n const mount = ensureMountPoint()\n if (!mount) return\n\n if (force) {\n refreshRequest++\n displayedPaneKey = ''\n loadingPaneKey = ''\n }\n\n const { view, viaAccountMenu } = readNavigationState()\n const decision = deriveHeading({\n view,\n viaAccountMenu,\n viewer: authn.currentUser()?.value,\n pageUrl,\n owner: pod.owner,\n storageUris: pod.storagePanes.map(pane => pane.subject.value)\n })\n\n if (decision.mode === 'none') {\n refreshRequest++\n loadingPaneKey = ''\n displayedPaneKey = ''\n displayedSubjectUri = ''\n hideHeading(mount)\n return\n }\n\n const { subjectUri } = decision\n const isProfilePane = decision.mode === 'full'\n cancelHeadingHide(mount)\n const paneKey = `${decision.paneName}:${subjectUri}`\n if (paneKey === displayedPaneKey || paneKey === loadingPaneKey) return\n\n const request = ++refreshRequest\n loadingPaneKey = paneKey\n let subject: NamedNode\n let profileData: ProfileDetails\n let canEdit: boolean\n let viewerMode: ViewerMode\n try {\n subject = await loadProfileFromURI(store.sym(subjectUri))\n profileData = presentProfile(subject, store)\n viewerMode = isProfilePane ? await getViewerMode(subject) : 'anonymous'\n canEdit = viewerMode === 'owner'\n } catch (error) {\n if (request === refreshRequest) loadingPaneKey = ''\n throw error\n }\n if (request !== refreshRequest) return\n\n const heading = (mount.querySelector(PROFILE_HEADING_TAG) ||\n document.createElement(PROFILE_HEADING_TAG)) as HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n const viewer = authn.currentUser()\n heading.friendSubject = offersFriendAction(decision.paneName) && viewer && !viewer.sameTerm(subject)\n ? subject\n : undefined\n heading.editContext = canEdit\n ? {\n subject,\n profileData,\n viewerMode,\n onSaved: () => refreshProfileHeading(true)\n }\n : undefined\n heading.compact = !isProfilePane\n const appearing = mount.hidden || !mount.firstElementChild\n mount.hidden = false\n if (heading.parentNode !== mount) mount.replaceChildren(heading)\n displayedPaneKey = paneKey\n displayedSubjectUri = subject.value\n loadingPaneKey = ''\n if (appearing) {\n await heading.updateComplete\n if (request === refreshRequest && mount.isConnected && !mount.hidden && !hideAnimations.has(mount)) {\n showHeading(mount)\n }\n }\n}\n\n/** Put the heading where it belongs, above the navbar, after the navbar has been added. */\nexport function placeProfileHeading (): void {\n ensureMountPoint()\n}\n\n/** Shells browsing another resource can supply its current URL instead of the page URL. */\nexport function initializeProfileHeading (getPageUrl = () => window.location.href): Promise<void> {\n headingPageUrl = getPageUrl\n ensureMountPoint()\n\n if (!profileSavedListenerRegistered) {\n document.addEventListener('profile-pane-saved', (event) => {\n if (!(event instanceof CustomEvent) || event.detail?.subjectUri !== displayedSubjectUri) return\n\n const heading = document.querySelector<HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n }>(`#${PROFILE_HEADING_MOUNT_ID} ${PROFILE_HEADING_TAG}`)\n if (heading && event.detail.profileData) {\n refreshRequest++\n loadingPaneKey = ''\n heading.profileData = event.detail.profileData\n if (heading.editContext) {\n heading.editContext = { ...heading.editContext, profileData: event.detail.profileData }\n }\n return\n }\n\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after saving profile information.', error)\n })\n })\n profileSavedListenerRegistered = true\n }\n\n const readiness = authReady ?? authn.checkUser().then(() => undefined)\n authReady = readiness\n\n if (!authListenersRegistered) {\n authSession.events.on('login', refreshAfterAuthChange)\n authSession.events.on('sessionRestore', refreshAfterAuthChange)\n authSession.events.on('logout', refreshAfterAuthChange)\n authSession.events.on('sessionChange', refreshAfterAuthChange)\n authSession.events.on('identityReplaced', refreshAfterAuthChange)\n authListenersRegistered = true\n }\n\n // Navigations the page's own navigation does not make, such as links and buttons in solid-ui\n if (!navigatedListenerRegistered) {\n onNavigated(() => {\n refreshProfileHeading().catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n })\n navigatedListenerRegistered = true\n }\n\n readiness.then(() => refreshProfileHeading(true)).catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n return readiness\n}\n"],"mappings":"A,gZAcA,IAAMgB,EAAsB,8BACtBC,EAA2B,wBAE7BC,EAAiB,EACjBC,EAA8B,GAC9BC,EAA0B,GAC1BC,EAAiC,GACjCC,EACAC,EAAmB,GACnBC,EAAsB,GACtBC,EAAiB,GACjBC,MAAuB,OAAO,SAAS,KACrCC,EAAiB,IAAI,QACrBC,EAAiB,IAAI,QAE3B,SAASC,EAAa,EAA0B,CAC9C,GAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,SACxD,OAAOC,EAAM,SAAY,WAAY,OAEzC,IAAMC,EAAQ,iBAAiBD,CAAK,EAC9BE,EAAYD,EAAM,WAAa,OAC/BE,EAAeF,EAAM,cAAgB,OACrCG,EAAYJ,EAAM,QAAQ,CAC9B,CAAE,OAAQ,MAAO,QAAS,EAAG,UAAW,MAAO,aAAc,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B,EACtD3B,EAAA,YAAY,OAAO,GAAG,gBAAiB2B,CAAsB,EAC7D3B,EAAA,YAAY,OAAO,GAAG,mBAAoB2B,CAAsB,EACtC,IAI5B,AAMEvB,KALAN,EAAA,gBAAkB,CAChB8B,EAAsB,CAAC,CAAC,MAAO,GAAmB,CAChD,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,CACH,CAAC,EAC6B,IAGhCiC,EAAU,SAAW1B,EAAsB,EAAI,CAAC,CAAC,CAAC,MAAO,GAAmB,CAC1E,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,EACMiC,CACT,C"}
@@ -1,15 +1,15 @@
1
1
  (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { loadProfileFromURI as e } from "../utils/webIdUtils.esm.js";
2
- import { deriveHeading as t } from "../navigation/chrome.esm.js";
3
- import { getPodContext as n } from "../navigation/podContext.esm.js";
4
- import { readNavigationState as r } from "../navigation/state.esm.js";
5
- import { onNavigated as i } from "../navigation/events.esm.js";
6
- import { getViewerMode as a, presentProfile as o } from "../components/profile-heading/profileHeadingData.esm.js";
2
+ import { deriveHeading as t, offersFriendAction as n } from "../navigation/chrome.esm.js";
3
+ import { getPodContext as r } from "../navigation/podContext.esm.js";
4
+ import { readNavigationState as i } from "../navigation/state.esm.js";
5
+ import { onNavigated as a } from "../navigation/events.esm.js";
6
+ import { getViewerMode as o, presentProfile as s } from "../components/profile-heading/profileHeadingData.esm.js";
7
7
  import "../components/profile-heading/index.esm.js";
8
8
 
9
- import { authSession as s, authn as c, store as l } from "solid-logic";
10
- //#region src/mainPage/profileHeading.ts
11
- var u = "solid-panes-profile-heading", d = "profile-heading-mount", f = 0, p = !1, m = !1, h = !1, g, _ = "", v = "", y = "", b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
12
- function S(e) {
9
+ import { authSession as c, authn as l, store as u } from "solid-logic";
10
+ // src/mainPage/profileHeading.ts
11
+ var d = "solid-panes-profile-heading", f = "profile-heading-mount", p = 0, m = !1, h = !1, g = !1, _, v = "", y = "", b = "", x = () => window.location.href, S = /* @__PURE__ */ new WeakMap(), C = /* @__PURE__ */ new WeakMap();
12
+ function w(e) {
13
13
  if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof e.animate != "function") return;
14
14
  let t = getComputedStyle(e), n = t.marginTop || "18px", r = t.marginBottom || "20px", i = e.animate([{
15
15
  height: "0px",
@@ -28,22 +28,22 @@ function S(e) {
28
28
  easing: "ease",
29
29
  fill: "both"
30
30
  });
31
- x.set(e, i);
31
+ C.set(e, i);
32
32
  let a = () => {
33
- x.get(e) === i && (x.delete(e), i.cancel());
33
+ C.get(e) === i && (C.delete(e), i.cancel());
34
34
  };
35
35
  i.finished.then(a, (t) => {
36
- x.get(e) === i && (console.error("Failed to animate profile heading appearance.", t), a());
36
+ C.get(e) === i && (console.error("Failed to animate profile heading appearance.", t), a());
37
37
  });
38
38
  }
39
- function C(e) {
40
- let t = b.get(e);
41
- b.delete(e), t?.cancel(), e.inert = !1, e.removeAttribute("aria-hidden");
39
+ function T(e) {
40
+ let t = S.get(e);
41
+ S.delete(e), t?.cancel(), e.inert = !1, e.removeAttribute("aria-hidden");
42
42
  }
43
- function w(e) {
44
- if (b.has(e)) return;
45
- let t = getComputedStyle(e), n = e.getBoundingClientRect().height, r = t.opacity, i = t.marginTop, a = t.marginBottom, o = x.get(e);
46
- x.delete(e), o?.cancel();
43
+ function E(e) {
44
+ if (S.has(e)) return;
45
+ let t = getComputedStyle(e), n = e.getBoundingClientRect().height, r = t.opacity, i = t.marginTop, a = t.marginBottom, o = C.get(e);
46
+ C.delete(e), o?.cancel();
47
47
  let s = () => {
48
48
  e.hidden = !0, e.replaceChildren();
49
49
  };
@@ -68,91 +68,90 @@ function w(e) {
68
68
  easing: "ease",
69
69
  fill: "forwards"
70
70
  });
71
- b.set(e, c), c.finished.then(() => {
72
- b.get(e) === c && (s(), b.delete(e), c.cancel());
71
+ S.set(e, c), c.finished.then(() => {
72
+ S.get(e) === c && (s(), S.delete(e), c.cancel());
73
73
  }, (t) => {
74
- b.get(e) === c && (console.error("Failed to animate profile heading disappearance.", t), s(), b.delete(e), c.cancel());
74
+ S.get(e) === c && (console.error("Failed to animate profile heading disappearance.", t), s(), S.delete(e), c.cancel());
75
75
  });
76
76
  }
77
- function T() {
78
- D(!0).catch((e) => {
77
+ function D() {
78
+ k(!0).catch((e) => {
79
79
  console.error("Failed to refresh profile heading after an authentication change.", e);
80
80
  });
81
81
  }
82
- function E() {
82
+ function O() {
83
83
  let e = document.getElementById("MainContent");
84
84
  if (!e) return null;
85
- let t = document.getElementById(d);
86
- t || (t = document.createElement("div"), t.id = d, t.setAttribute("aria-label", "Profile heading"));
85
+ let t = document.getElementById(f);
86
+ t || (t = document.createElement("div"), t.id = f, t.setAttribute("aria-label", "Profile heading"));
87
87
  let n = document.querySelector("solid-panes-navbar"), r = document.getElementById("OutlineView"), i = n?.parentNode === e ? n : r?.parentNode === e ? r : null;
88
88
  return i && t.nextSibling !== i ? e.insertBefore(t, i) : !i && t.parentNode !== e && e.appendChild(t), t;
89
89
  }
90
- async function D(i = !1) {
91
- await g;
92
- let s = await n(window.location.href), d = E();
93
- if (!d) return;
94
- i && (f++, _ = "", y = "");
95
- let { view: p, viaAccountMenu: m } = r(), h = t({
96
- view: p,
97
- viaAccountMenu: m,
98
- viewer: c.currentUser()?.value,
99
- pageUrl: window.location.href,
100
- owner: s.owner,
101
- storageUris: s.storagePanes.map((e) => e.subject.value)
90
+ async function k(a = !1) {
91
+ await _;
92
+ let c = x(), f = await r(c), m = O();
93
+ if (!m) return;
94
+ a && (p++, v = "", b = "");
95
+ let { view: h, viaAccountMenu: g } = i(), C = t({
96
+ view: h,
97
+ viaAccountMenu: g,
98
+ viewer: l.currentUser()?.value,
99
+ pageUrl: c,
100
+ owner: f.owner,
101
+ storageUris: f.storagePanes.map((e) => e.subject.value)
102
102
  });
103
- if (h.mode === "none") {
104
- f++, y = "", _ = "", v = "", w(d);
103
+ if (C.mode === "none") {
104
+ p++, b = "", v = "", y = "", E(m);
105
105
  return;
106
106
  }
107
- let { subjectUri: x } = h, T = h.mode === "full";
108
- C(d);
109
- let O = `${h.paneName}:${x}`;
110
- if (O === _ || O === y) return;
111
- let k = ++f;
112
- y = O;
113
- let A, j, M, N;
107
+ let { subjectUri: D } = C, A = C.mode === "full";
108
+ T(m);
109
+ let j = `${C.paneName}:${D}`;
110
+ if (j === v || j === b) return;
111
+ let M = ++p;
112
+ b = j;
113
+ let N, P, F, I;
114
114
  try {
115
- A = await e(l.sym(x)), j = o(A, l), N = T ? await a(A) : "anonymous", M = N === "owner";
115
+ N = await e(u.sym(D)), P = s(N, u), I = A ? await o(N) : "anonymous", F = I === "owner";
116
116
  } catch (e) {
117
- throw k === f && (y = ""), e;
117
+ throw M === p && (b = ""), e;
118
118
  }
119
- if (k !== f) return;
120
- let P = d.querySelector(u) || document.createElement(u);
121
- P.profileData = j;
122
- let F = c.currentUser();
123
- P.friendSubject = T && F && !F.sameTerm(A) ? A : void 0, P.editContext = M ? {
124
- subject: A,
125
- profileData: j,
126
- viewerMode: N,
127
- onSaved: () => D(!0)
128
- } : void 0, P.compact = !T;
129
- let I = d.hidden || !d.firstElementChild;
130
- d.hidden = !1, P.parentNode !== d && d.replaceChildren(P), _ = O, v = A.value, y = "", I && (await P.updateComplete, k === f && d.isConnected && !d.hidden && !b.has(d) && S(d));
119
+ if (M !== p) return;
120
+ let L = m.querySelector(d) || document.createElement(d);
121
+ L.profileData = P;
122
+ let R = l.currentUser();
123
+ L.friendSubject = n(C.paneName) && R && !R.sameTerm(N) ? N : void 0, L.editContext = F ? {
124
+ subject: N,
125
+ profileData: P,
126
+ viewerMode: I,
127
+ onSaved: () => k(!0)
128
+ } : void 0, L.compact = !A;
129
+ let z = m.hidden || !m.firstElementChild;
130
+ m.hidden = !1, L.parentNode !== m && m.replaceChildren(L), v = j, y = N.value, b = "", z && (await L.updateComplete, M === p && m.isConnected && !m.hidden && !S.has(m) && w(m));
131
131
  }
132
- function O() {
133
- E();
132
+ function A() {
133
+ O();
134
134
  }
135
- function k() {
136
- E(), h ||= (document.addEventListener("profile-pane-saved", (e) => {
137
- if (!(e instanceof CustomEvent) || e.detail?.subjectUri !== v) return;
138
- let t = document.querySelector(`#${d} ${u}`);
139
- t && e.detail.profileData ? (f++, y = "", t.profileData = e.detail.profileData, t.editContext &&= {
135
+ function j(e = () => window.location.href) {
136
+ x = e, O(), g ||= (document.addEventListener("profile-pane-saved", (e) => {
137
+ if (!(e instanceof CustomEvent) || e.detail?.subjectUri !== y) return;
138
+ let t = document.querySelector(`#${f} ${d}`);
139
+ t && e.detail.profileData ? (p++, b = "", t.profileData = e.detail.profileData, t.editContext &&= {
140
140
  ...t.editContext,
141
141
  profileData: e.detail.profileData
142
- }) : D(!0).catch((e) => {
142
+ }) : k(!0).catch((e) => {
143
143
  console.error("Failed to refresh profile heading after saving profile information.", e);
144
144
  });
145
145
  }), !0);
146
- let e = g ?? c.checkUser().then(() => void 0);
147
- g = e, m ||= (s.events.on("login", T), s.events.on("sessionRestore", T), s.events.on("logout", T), s.events.on("sessionChange", T), s.events.on("identityReplaced", T), !0), p ||= (i(() => {
148
- D().catch((e) => {
146
+ let t = _ ?? l.checkUser().then(() => void 0);
147
+ return _ = t, h ||= (c.events.on("login", D), c.events.on("sessionRestore", D), c.events.on("logout", D), c.events.on("sessionChange", D), c.events.on("identityReplaced", D), !0), m ||= (a(() => {
148
+ k().catch((e) => {
149
149
  console.error("Failed to refresh profile heading.", e);
150
150
  });
151
- }), !0), e.then(() => D(!0)).catch((e) => {
151
+ }), !0), t.then(() => k(!0)).catch((e) => {
152
152
  console.error("Failed to refresh profile heading.", e);
153
- });
153
+ }), t;
154
154
  }
155
- //#endregion
156
- export { k as initializeProfileHeading, O as placeProfileHeading, D as refreshProfileHeading };
155
+ export { j as initializeProfileHeading, A as placeProfileHeading, k as refreshProfileHeading };
157
156
 
158
157
  //# sourceMappingURL=profileHeading2.esm.js.map