solid-panes 5.1.0-2 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/README.md +6 -0
  2. package/dist/RDFXMLPane.d.ts.map +1 -1
  3. package/dist/RDFXMLPane2.cjs.js +1 -1
  4. package/dist/RDFXMLPane2.cjs.js.map +1 -1
  5. package/dist/RDFXMLPane2.esm.js +3 -3
  6. package/dist/RDFXMLPane2.esm.js.map +1 -1
  7. package/dist/components/editor-card/EditorCard.cjs.js +2 -2
  8. package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
  9. package/dist/components/editor-card/EditorCard.d.ts +2 -0
  10. package/dist/components/editor-card/EditorCard.d.ts.map +1 -1
  11. package/dist/components/editor-card/EditorCard.esm.js +68 -43
  12. package/dist/components/editor-card/EditorCard.esm.js.map +1 -1
  13. package/dist/components/editor-card/EditorCard.styles.cjs.js.map +1 -1
  14. package/dist/components/editor-card/EditorCard.styles.esm.js.map +1 -1
  15. package/dist/components/header/Header.cjs.js.map +1 -1
  16. package/dist/components/header/Header.esm.js.map +1 -1
  17. package/dist/components/header/Header.styles.cjs.js.map +1 -1
  18. package/dist/components/header/Header.styles.esm.js.map +1 -1
  19. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  20. package/dist/components/navbar/Navbar.esm.js.map +1 -1
  21. package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
  22. package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
  23. package/dist/components/profile-heading/ProfileHeading.cjs.js +6 -6
  24. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
  25. package/dist/components/profile-heading/ProfileHeading.d.ts +4 -0
  26. package/dist/components/profile-heading/ProfileHeading.d.ts.map +1 -1
  27. package/dist/components/profile-heading/ProfileHeading.esm.js +123 -107
  28. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -1
  29. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +1 -1
  30. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -1
  31. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +1 -1
  32. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -1
  33. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +19 -19
  34. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js.map +1 -1
  35. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +86 -86
  36. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js.map +1 -1
  37. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js.map +1 -1
  38. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js.map +1 -1
  39. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js.map +1 -1
  40. package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js.map +1 -1
  41. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js +1 -1
  42. package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js.map +1 -1
  43. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +61 -61
  44. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js.map +1 -1
  45. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js.map +1 -1
  46. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js.map +1 -1
  47. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js.map +1 -1
  48. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js.map +1 -1
  49. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js.map +1 -1
  50. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js.map +1 -1
  51. package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js.map +1 -1
  52. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js.map +1 -1
  53. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js.map +1 -1
  54. package/dist/components/profile-heading/editor/textUtils.cjs.js.map +1 -1
  55. package/dist/components/profile-heading/editor/textUtils.esm.js.map +1 -1
  56. package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js.map +1 -1
  57. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js.map +1 -1
  58. package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js.map +1 -1
  59. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js.map +1 -1
  60. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +1 -1
  61. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -1
  62. package/dist/components/profile-heading/editor/ui/dialog2.esm.js +1 -1
  63. package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -1
  64. package/dist/components/profile-heading/friendActions.cjs.js +1 -1
  65. package/dist/components/profile-heading/friendActions.cjs.js.map +1 -1
  66. package/dist/components/profile-heading/friendActions.esm.js +5 -5
  67. package/dist/components/profile-heading/profileHeadingData.cjs.js.map +1 -1
  68. package/dist/components/resource-action-dialog/ResourceActionDialog.cjs.js +33 -0
  69. package/dist/components/resource-action-dialog/ResourceActionDialog.cjs.js.map +1 -0
  70. package/dist/components/resource-action-dialog/ResourceActionDialog.d.ts +16 -0
  71. package/dist/components/resource-action-dialog/ResourceActionDialog.d.ts.map +1 -0
  72. package/dist/components/resource-action-dialog/ResourceActionDialog.esm.js +309 -0
  73. package/dist/components/resource-action-dialog/ResourceActionDialog.esm.js.map +1 -0
  74. package/dist/components/resource-action-dialog/ResourceActionDialog.styles.cjs.js +2 -0
  75. package/dist/components/resource-action-dialog/ResourceActionDialog.styles.cjs.js.map +1 -0
  76. package/dist/components/resource-action-dialog/ResourceActionDialog.styles.esm.js +6 -0
  77. package/dist/components/resource-action-dialog/ResourceActionDialog.styles.esm.js.map +1 -0
  78. package/dist/dataContentPane.d.ts.map +1 -1
  79. package/dist/dataContentPane2.cjs.js +1 -1
  80. package/dist/dataContentPane2.cjs.js.map +1 -1
  81. package/dist/dataContentPane2.esm.js +90 -78
  82. package/dist/dataContentPane2.esm.js.map +1 -1
  83. package/dist/humanReadablePane.d.ts +1 -0
  84. package/dist/humanReadablePane.d.ts.map +1 -1
  85. package/dist/humanReadablePane2.cjs.js +147 -15
  86. package/dist/humanReadablePane2.cjs.js.map +1 -1
  87. package/dist/humanReadablePane2.esm.js +281 -114
  88. package/dist/humanReadablePane2.esm.js.map +1 -1
  89. package/dist/imagePane.d.ts.map +1 -1
  90. package/dist/imagePane2.cjs.js +1 -1
  91. package/dist/imagePane2.cjs.js.map +1 -1
  92. package/dist/imagePane2.esm.js +9 -7
  93. package/dist/imagePane2.esm.js.map +1 -1
  94. package/dist/index.cjs.js +1 -1
  95. package/dist/index.cjs.js.map +1 -1
  96. package/dist/index.d.ts +1 -0
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.esm.js +16 -15
  99. package/dist/index.esm.js.map +1 -1
  100. package/dist/internal/internalPane.d.ts.map +1 -1
  101. package/dist/internal/internalPane2.cjs.js +1 -1
  102. package/dist/internal/internalPane2.cjs.js.map +1 -1
  103. package/dist/internal/internalPane2.esm.js +55 -60
  104. package/dist/internal/internalPane2.esm.js.map +1 -1
  105. package/dist/mainPage/header.cjs.js +1 -1
  106. package/dist/mainPage/header.esm.js +2 -2
  107. package/dist/mainPage/index.cjs.js +1 -1
  108. package/dist/mainPage/index.cjs.js.map +1 -1
  109. package/dist/mainPage/index.d.ts.map +1 -1
  110. package/dist/mainPage/index.esm.js +44 -24
  111. package/dist/mainPage/index.esm.js.map +1 -1
  112. package/dist/mainPage/navbar.cjs.js +1 -1
  113. package/dist/mainPage/navbar.cjs.js.map +1 -1
  114. package/dist/mainPage/navbar.esm.js +15 -15
  115. package/dist/mainPage/navigation.cjs.js +1 -1
  116. package/dist/mainPage/navigation.cjs.js.map +1 -1
  117. package/dist/mainPage/navigation.esm.js +4 -4
  118. package/dist/mainPage/profileHeading.d.ts +2 -1
  119. package/dist/mainPage/profileHeading.d.ts.map +1 -1
  120. package/dist/mainPage/profileHeading2.cjs.js +1 -1
  121. package/dist/mainPage/profileHeading2.cjs.js.map +1 -1
  122. package/dist/mainPage/profileHeading2.esm.js +76 -76
  123. package/dist/mainPage/profileHeading2.esm.js.map +1 -1
  124. package/dist/n3Pane.d.ts.map +1 -1
  125. package/dist/n3Pane2.cjs.js +1 -1
  126. package/dist/n3Pane2.cjs.js.map +1 -1
  127. package/dist/n3Pane2.esm.js +1 -1
  128. package/dist/n3Pane2.esm.js.map +1 -1
  129. package/dist/navigation/browserEvents.cjs.js +1 -1
  130. package/dist/navigation/browserEvents.cjs.js.map +1 -1
  131. package/dist/navigation/browserEvents.d.ts.map +1 -1
  132. package/dist/navigation/browserEvents.esm.js +17 -17
  133. package/dist/navigation/browserEvents.esm.js.map +1 -1
  134. package/dist/navigation/chrome.cjs.js +1 -1
  135. package/dist/navigation/chrome.cjs.js.map +1 -1
  136. package/dist/navigation/chrome.d.ts +20 -2
  137. package/dist/navigation/chrome.d.ts.map +1 -1
  138. package/dist/navigation/chrome.esm.js +14 -8
  139. package/dist/navigation/chrome.esm.js.map +1 -1
  140. package/dist/navigation/controller.cjs.js +1 -1
  141. package/dist/navigation/controller.cjs.js.map +1 -1
  142. package/dist/navigation/controller.d.ts +3 -0
  143. package/dist/navigation/controller.d.ts.map +1 -1
  144. package/dist/navigation/controller.esm.js +50 -29
  145. package/dist/navigation/controller.esm.js.map +1 -1
  146. package/dist/navigation/options.cjs.js +1 -1
  147. package/dist/navigation/options.cjs.js.map +1 -1
  148. package/dist/navigation/options.d.ts +12 -0
  149. package/dist/navigation/options.d.ts.map +1 -1
  150. package/dist/navigation/options.esm.js +4 -1
  151. package/dist/navigation/options.esm.js.map +1 -1
  152. package/dist/navigation/podContext.cjs.js +1 -1
  153. package/dist/navigation/podContext.cjs.js.map +1 -1
  154. package/dist/navigation/podContext.d.ts.map +1 -1
  155. package/dist/navigation/podContext.esm.js +17 -17
  156. package/dist/navigation/podContext.esm.js.map +1 -1
  157. package/dist/navigation/state.cjs.js +1 -1
  158. package/dist/navigation/state.cjs.js.map +1 -1
  159. package/dist/navigation/state.d.ts +4 -0
  160. package/dist/navigation/state.d.ts.map +1 -1
  161. package/dist/navigation/state.esm.js +18 -5
  162. package/dist/navigation/state.esm.js.map +1 -1
  163. package/dist/outline/fileExplorerHelpers.cjs.js +1 -1
  164. package/dist/outline/fileExplorerHelpers.cjs.js.map +1 -1
  165. package/dist/outline/fileExplorerHelpers.d.ts +2 -5
  166. package/dist/outline/fileExplorerHelpers.d.ts.map +1 -1
  167. package/dist/outline/fileExplorerHelpers.esm.js +11 -13
  168. package/dist/outline/fileExplorerHelpers.esm.js.map +1 -1
  169. package/dist/outline/manager2.cjs.js +1 -1
  170. package/dist/outline/manager2.cjs.js.map +1 -1
  171. package/dist/outline/manager2.esm.js +355 -296
  172. package/dist/outline/manager2.esm.js.map +1 -1
  173. package/dist/registerPanes.cjs.js +1 -1
  174. package/dist/registerPanes.cjs.js.map +1 -1
  175. package/dist/registerPanes.esm.js +1 -1
  176. package/dist/registerPanes.esm.js.map +1 -1
  177. package/dist/slideshow/slideshowPane.cjs.js +1 -1
  178. package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
  179. package/dist/slideshow/slideshowPane.esm.js +30 -30
  180. package/dist/slideshow/slideshowPane.esm.js.map +1 -1
  181. package/dist/social/socialPane2.cjs.js +1 -1
  182. package/dist/social/socialPane2.esm.js +1 -1
  183. package/dist/social/socialSections.cjs.js +1 -1
  184. package/dist/social/socialSections.esm.js +1 -1
  185. package/dist/utils/paneUtils.cjs.js +1 -1
  186. package/dist/utils/paneUtils.cjs.js.map +1 -1
  187. package/dist/utils/paneUtils.esm.js +15 -15
  188. package/dist/versionInfo.cjs.js +1 -1
  189. package/dist/versionInfo.cjs.js.map +1 -1
  190. package/dist/versionInfo.esm.js +9 -9
  191. package/dist/versionInfo.esm.js.map +1 -1
  192. package/package.json +11 -12
@@ -1 +1 @@
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
+ {"version":3,"file":"navigation.cjs.js","names":["paneRegistry","createNavigationController","refreshProfileHeading","require_runtime","require_controller","require_navbar","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,iBAAAI,EAAA,iBAAkB,eAAgBH,EAAAA,qBAAsB,CACrE,CAAC,EACDM,EAAY,IAAIG,EAAUD,CAAU,CACtC,CACA,OAAOA,CACT,C"}
@@ -1,5 +1,5 @@
1
- import { selectNavbarPane as e } from "./navbar.esm.js";
2
- import { createNavigationController as t } from "../navigation/controller.esm.js";
1
+ import { createNavigationController as e } from "../navigation/controller.esm.js";
2
+ import { selectNavbarPane as t } from "./navbar.esm.js";
3
3
  import { refreshProfileHeading as n } from "./profileHeading2.esm.js";
4
4
  import * as r from "pane-registry";
5
5
  // src/mainPage/navigation.ts
@@ -8,12 +8,12 @@ function a(a, o) {
8
8
  let s = i.get(a);
9
9
  if (!s) {
10
10
  let c = a.context?.session?.paneRegistry, l = typeof c?.byName == "function" ? c.byName.bind(c) : r.byName;
11
- s = t({
11
+ s = e({
12
12
  store: o,
13
13
  outliner: a,
14
14
  byName: l,
15
15
  effects: {
16
- selectNavbarPane: e,
16
+ selectNavbarPane: t,
17
17
  refreshHeading: n
18
18
  }
19
19
  }), i.set(a, s);
@@ -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,CA4FzE;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("../components/profile-heading/profileHeadingData.cjs.js"),t=require("../utils/webIdUtils.cjs.js");require("../components/profile-heading/index.cjs.js");const n=require("../navigation/chrome.cjs.js"),r=require("../navigation/podContext.cjs.js"),i=require("../navigation/events.cjs.js"),a=require("../navigation/state.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 r.getPodContext(c),d=w();if(!d)return;i&&(l++,m=``,g=``);let{view:f,viaAccountMenu:y}=a.readNavigationState(),C=n.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 t.loadProfileFromURI(o.store.sym(E)),j=e.presentProfile(A,o.store),N=D?await e.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,P.subject=A;let F=o.authn.currentUser();P.friendSubject=n.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,EAA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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_profileHeadingData","require_webIdUtils","require_chrome","require_podContext","require_events","require_state","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 subject?: NamedNode\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n heading.subject = subject\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,sZAcA,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,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,CAAK,EAC1CH,EAAe,OAAOG,CAAK,EAC3BI,GAAW,OAAO,EAClB,EAAM,MAAQ,GACdJ,EAAM,gBAAgB,aAAa,CACrC,C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cAAgBA,EAAM,QAAQ,aAAe5C,EAAqB,OAEzF,IAAMsC,EAAU,SAAS,cAGtB,IAAI7C,EAAyB,GAAGD,GAAqB,EACpD8C,GAAWM,EAAM,OAAO,aAC1B,IACA,EAAiB,GACjB,EAAQ,YAAcA,EAAM,OAAO,YACnC,AACEN,EAAQ,cAAc,CAAE,GAAGA,EAAQ,YAAa,YAAaM,EAAM,OAAO,WAAY,GAK1FzB,EAAsB,EAAI,CAAC,CAAC,MAAO,GAAmB,CACpD,QAAQ,MAAM,sEAAuEP,CAAK,CAC5F,CAAC,CACH,CAAC,EACgC,IAGnC,IAAMiC,EAAY/C,GAAanB,EAAAA,MAAM,UAAU,CAAC,CAAC,SAAW,IAAA,EAAS,EAyBrE,MAxBA,GAAYkE,EAEZ,AAMEjD,KALAL,EAAA,YAAY,OAAO,GAAG,QAAS2B,CAAsB,EACrD3B,EAAA,YAAY,OAAO,GAAG,iBAAkB2B,CAAsB,EAC9D3B,EAAA,YAAY,OAAO,GAAG,SAAU2B,CAAsB,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
- (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";
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 { getViewerMode as e, presentProfile as t } from "../components/profile-heading/profileHeadingData.esm.js";
2
+ import { loadProfileFromURI as n } from "../utils/webIdUtils.esm.js";
7
3
  import "../components/profile-heading/index.esm.js";
8
4
 
9
- import { authSession as s, authn as c, store as l } from "solid-logic";
5
+ import { deriveHeading as r, offersFriendAction as i } from "../navigation/chrome.esm.js";
6
+ import { getPodContext as a } from "../navigation/podContext.esm.js";
7
+ import { onNavigated as o } from "../navigation/events.esm.js";
8
+ import { readNavigationState as s } from "../navigation/state.esm.js";
9
+ import { authSession as c, authn as l, store as u } from "solid-logic";
10
10
  // 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) {
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,90 +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(o = !1) {
91
+ await _;
92
+ let c = x(), f = await a(c), m = O();
93
+ if (!m) return;
94
+ o && (p++, v = "", b = "");
95
+ let { view: h, viaAccountMenu: g } = s(), C = r({
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 n(u.sym(D)), P = t(N, u), I = A ? await e(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, L.subject = N;
122
+ let R = l.currentUser();
123
+ L.friendSubject = i(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 ||= (o(() => {
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
- export { k as initializeProfileHeading, O as placeProfileHeading, D as refreshProfileHeading };
155
+ export { j as initializeProfileHeading, A as placeProfileHeading, k as refreshProfileHeading };
156
156
 
157
157
  //# sourceMappingURL=profileHeading2.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileHeading2.esm.js","names":["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","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","refreshProfileHeading","pod","getPodContext","force","readNavigationState","decision","deriveHeading","authn","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","loadProfileFromURI","store","presentProfile","getViewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","event","readiness","authSession","onNavigated"],"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":";;;;;;;;;;AAcA,IAAMA,IAAsB,+BACtBC,IAA2B,yBAE7BC,IAAiB,GACjBC,IAA8B,IAC9BC,IAA0B,IAC1BC,IAAiC,IACjCC,GACAC,IAAmB,IACnBC,IAAsB,IACtBC,IAAiB,IACfC,oBAAiB,IAAI,QAAgC,GACrDC,oBAAiB,IAAI,QAAgC;AAE3D,SAASC,EAAa,GAA0B;CAC9C,IAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,WACxD,OAAOC,EAAM,WAAY,YAAY;CAEzC,IAAMC,IAAQ,iBAAiBD,CAAK,GAC9BE,IAAYD,EAAM,aAAa,QAC/BE,IAAeF,EAAM,gBAAgB,QACrCG,IAAYJ,EAAM,QAAQ,CAC9B;EAAE,QAAQ;EAAO,SAAS;EAAG,WAAW;EAAO,cAAc;EAAO,UAAU;CAAS,GACvF;EACE,QAAQ,GAAGA,EAAM,sBAAsB,CAAC,CAAC,OAAO;EAChD,SAAS;EACT;EACA;EACA,UAAU;CACZ,CACF,GAAG;EAAE,UAAU;EAAK,QAAQ;EAAQ,MAAM;CAAO,CAAC;CAClD,EAAe,IAAIA,GAAOI,CAAS;CACnC,IAAMC,UAAe;EACnB,AAAIP,EAAe,IAAIE,CAAK,MAAMI,MAClCN,EAAe,OAAOE,CAAK,GAC3BI,EAAU,OAAO;CACnB;CACA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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","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","refreshProfileHeading","pageUrl","pod","getPodContext","force","readNavigationState","decision","deriveHeading","authn","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","loadProfileFromURI","store","presentProfile","getViewerMode","heading","viewer","offersFriendAction","appearing","placeProfileHeading","initializeProfileHeading","getPageUrl","event","readiness","authSession","onNavigated"],"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 subject?: NamedNode\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n heading.subject = subject\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":";;;;;;;;;;AAcA,IAAMA,IAAsB,+BACtBC,IAA2B,yBAE7BC,IAAiB,GACjBC,IAA8B,IAC9BC,IAA0B,IAC1BC,IAAiC,IACjCC,GACAC,IAAmB,IACnBC,IAAsB,IACtBC,IAAiB,IACjBC,UAAuB,OAAO,SAAS,MACrCC,oBAAiB,IAAI,QAAgC,GACrDC,oBAAiB,IAAI,QAAgC;AAE3D,SAASC,EAAa,GAA0B;CAC9C,IAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,WACxD,OAAOC,EAAM,WAAY,YAAY;CAEzC,IAAMC,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AAS;CAyBrE,OAxBA,IAAYsB,GAEZ,AAME1D,OALA2D,EAAY,OAAO,GAAG,SAASrC,CAAsB,GACrDqC,EAAY,OAAO,GAAG,kBAAkBrC,CAAsB,GAC9DqC,EAAY,OAAO,GAAG,UAAUrC,CAAsB,GACtDqC,EAAY,OAAO,GAAG,iBAAiBrC,CAAsB,GAC7DqC,EAAY,OAAO,GAAG,oBAAoBrC,CAAsB,GACtC,KAI5B,AAMEvB,OALA6D,QAAkB;EAChB,EAAsB,CAAC,CAAC,OAAO,MAAmB;GAChD,QAAQ,MAAM,sCAAsC5C,CAAK;EAC3D,CAAC;CACH,CAAC,GAC6B,KAGhC0C,EAAU,WAAW9B,EAAsB,EAAI,CAAC,CAAC,CAAC,OAAO,MAAmB;EAC1E,QAAQ,MAAM,sCAAsCZ,CAAK;CAC3D,CAAC,GACM0C;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"n3Pane.d.ts","sourceRoot":"","sources":["../src/n3Pane.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAClD,OAAO,cAAc,CAAA;AACrB,OAAO,0BAA0B,CAAA;AAIjC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,IAAI,CAAA;IACzE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,UAsDpB,CAAA"}
1
+ {"version":3,"file":"n3Pane.d.ts","sourceRoot":"","sources":["../src/n3Pane.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAClD,OAAO,cAAc,CAAA;AACrB,OAAO,0BAA0B,CAAA;AAIjC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,IAAI,CAAA;IACzE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,UA2DpB,CAAA"}
@@ -1,2 +1,2 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border:1px solid var(--solid-ui-color-slate-200,#e2e8f0);box-sizing:border-box;width:100%;min-width:0}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");require("./components/editor-card/index.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns,i={icon:t.icons.originalIconBase+`w3c/n3_smaller.png`,name:`n3`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`Data (`+r+`) as N3`},render:function(e,t){let r=t.dom,i=t.session.store,a=r.createElement(`div`);a.setAttribute(`class`,`n3-pane`);let o=i.statementsMatching(void 0,void 0,void 0,e),s=n.Serializer(i);s.suggestNamespaces(i.namespaces),s.setBase(e.uri);let c=s.statementsToN3(o),l=r.createElement(`solid-panes-editor-card`);return l.contentType=`text/n3`,l.content=c,a.appendChild(l),a}};exports.n3Pane=i;
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border:1px solid var(--solid-ui-color-slate-200,#e2e8f0);box-sizing:border-box;width:100%;min-width:0}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");require("./components/editor-card/index.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns,i={icon:t.icons.originalIconBase+`w3c/n3_smaller.png`,name:`n3`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`Data (`+r+`) as N3`},render:function(e,t){let r=t.dom,i=t.session.store,a=r.createElement(`div`);a.setAttribute(`class`,`n3-pane`);let o=i.statementsMatching(void 0,void 0,void 0,e),s=n.Serializer(i);s.suggestNamespaces(i.namespaces),s.setBase(e.uri);let c=s.statementsToN3(o),l=r.createElement(`solid-panes-editor-card`);return l.contentType=`text/n3`,l.content=c,l.accessibilityLabel=`Generated N3 for ${e.uri}`,l.accessibilityDescription=`Generated N3 serialization. This content is read-only.`,a.appendChild(l),a}};exports.n3Pane=i;
2
2
  //# sourceMappingURL=n3Pane2.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"n3Pane2.cjs.js","names":["UI","$rdf","require_runtime","solid_ui","rdflib","ns","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":"A,mNAaA,IAAMK,EAAKL,EAAG,GAUDM,EAAqB,CAChC,KAAMN,EAAG,MAAM,iBAAmB,qBAElC,KAAM,KAEN,SAAU,CAACK,EAAG,MAAM,WAAW,CAAC,EAEhC,MAAO,SAAU,EAAoB,EAA4C,CAC/E,IAAME,EAAQC,EAAQ,QAAQ,MAC9B,GACE,kDACAD,EAAM,aAAaE,CAAO,EAE1B,OAAO,KAET,IAAMC,EAAIH,EAAM,mBAAmB,IAAA,GAAW,IAAA,GAAW,IAAA,GAAWE,CAAO,CAAC,CACzE,OAEH,OADIC,IAAM,EAAU,KACb,SAAWA,EAAI,SACxB,EAEA,OAAQ,SACN,EACA,EACgB,CAChB,IAAMC,EAAaH,EAAQ,IACrBI,EAAKJ,EAAQ,QAAQ,MAErBK,EAAMF,EAAW,cAAc,KAAK,EAC1CE,EAAI,aAAa,QAAS,SAAS,EAInC,IAAMC,EAAaF,EAAG,mBACpB,IAAA,GACA,IAAA,GACA,IAAA,GACAH,CACF,EAEMM,EAAKd,EAAK,WAAWW,CAAE,EAC7BG,EAAG,kBAAkBH,EAAG,UAAU,EAClCG,EAAG,QAAQN,EAAQ,GAAG,EACtB,IAAMO,EAAoBD,EAAG,eAAeD,CAAU,EAChDG,EAASN,EAAW,cAAc,yBAAyB,EAQjE,MAJA,GAAO,YAAc,UACrB,EAAO,QAAUK,EAEjBH,EAAI,YAAYI,CAAM,EACfJ,CACT,CACF,E"}
1
+ {"version":3,"file":"n3Pane2.cjs.js","names":["UI","$rdf","require_runtime","solid_ui","rdflib","ns","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n accessibilityLabel?: string\n accessibilityDescription?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n source.accessibilityLabel = `Generated N3 for ${subject.uri}`\n source.accessibilityDescription =\n 'Generated N3 serialization. This content is read-only.'\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":"A,mNAaA,IAAMK,EAAKL,EAAG,GAUDM,EAAqB,CAChC,KAAMN,EAAG,MAAM,iBAAmB,qBAElC,KAAM,KAEN,SAAU,CAACK,EAAG,MAAM,WAAW,CAAC,EAEhC,MAAO,SAAU,EAAoB,EAA4C,CAC/E,IAAME,EAAQC,EAAQ,QAAQ,MAC9B,GACE,kDACAD,EAAM,aAAaE,CAAO,EAE1B,OAAO,KAET,IAAMC,EAAIH,EAAM,mBAAmB,IAAA,GAAW,IAAA,GAAW,IAAA,GAAWE,CAAO,CAAC,CACzE,OAEH,OADIC,IAAM,EAAU,KACb,SAAWA,EAAI,SACxB,EAEA,OAAQ,SACN,EACA,EACgB,CAChB,IAAMC,EAAaH,EAAQ,IACrBI,EAAKJ,EAAQ,QAAQ,MAErBK,EAAMF,EAAW,cAAc,KAAK,EAC1CE,EAAI,aAAa,QAAS,SAAS,EAInC,IAAMC,EAAaF,EAAG,mBACpB,IAAA,GACA,IAAA,GACA,IAAA,GACAH,CACF,EAEMM,EAAKd,EAAK,WAAWW,CAAE,EAC7BG,EAAG,kBAAkBH,EAAG,UAAU,EAClCG,EAAG,QAAQN,EAAQ,GAAG,EACtB,IAAMO,EAAoBD,EAAG,eAAeD,CAAU,EAChDG,EAASN,EAAW,cAAc,yBAAyB,EAajE,MAPA,GAAO,YAAc,UACrB,EAAO,QAAUK,EACjB,EAAO,mBAAqB,oBAAoBP,EAAQ,MACxD,EAAO,yBACL,yDAEFI,EAAI,YAAYI,CAAM,EACfJ,CACT,CACF,E"}
@@ -19,7 +19,7 @@ var n = e.ns, r = {
19
19
  let o = i.statementsMatching(void 0, void 0, void 0, e), s = t.Serializer(i);
20
20
  s.suggestNamespaces(i.namespaces), s.setBase(e.uri);
21
21
  let c = s.statementsToN3(o), l = r.createElement("solid-panes-editor-card");
22
- return l.contentType = "text/n3", l.content = c, a.appendChild(l), a;
22
+ return l.contentType = "text/n3", l.content = c, l.accessibilityLabel = `Generated N3 for ${e.uri}`, l.accessibilityDescription = "Generated N3 serialization. This content is read-only.", a.appendChild(l), a;
23
23
  }
24
24
  };
25
25
  export { r as n3Pane };
@@ -1 +1 @@
1
- {"version":3,"file":"n3Pane2.esm.js","names":["ns","UI","$rdf","ns$1","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":";;;;;AAaA,IAAMA,IAAKC,EAAG,IAUDG,IAAqB;CAChC,MAAMH,EAAG,MAAM,mBAAmB;CAElC,MAAM;CAEN,UAAU,CAACD,EAAG,MAAM,WAAW,CAAC;CAEhC,OAAO,SAAU,GAAoB,GAA4C;EAC/E,IAAMK,IAAQC,EAAQ,QAAQ;EAC9B,IACE,mDACAD,EAAM,aAAaE,CAAO,GAE1B,OAAO;EAET,IAAMC,IAAIH,EAAM,mBAAmB,KAAA,GAAW,KAAA,GAAW,KAAA,GAAWE,CAAO,CAAC,CACzE;EAEH,OADIC,MAAM,IAAU,OACb,WAAWA,IAAI;CACxB;CAEA,QAAQ,SACN,GACA,GACgB;EAChB,IAAMC,IAAaH,EAAQ,KACrBI,IAAKJ,EAAQ,QAAQ,OAErBK,IAAMF,EAAW,cAAc,KAAK;EAC1C,EAAI,aAAa,SAAS,SAAS;EAInC,IAAMG,IAAaF,EAAG,mBACpB,KAAA,GACA,KAAA,GACA,KAAA,GACAH,CACF,GAEMM,IAAKX,EAAK,WAAWQ,CAAE;EAE7B,AADAG,EAAG,kBAAkBH,EAAG,UAAU,GAClCG,EAAG,QAAQN,EAAQ,GAAG;EACtB,IAAMO,IAAoBD,EAAG,eAAeD,CAAU,GAChDG,IAASN,EAAW,cAAc,yBAAyB;EAQjE,OAJA,EAAO,cAAc,WACrB,EAAO,UAAUK,GAEjBH,EAAI,YAAYI,CAAM,GACfJ;CACT;AACF"}
1
+ {"version":3,"file":"n3Pane2.esm.js","names":["ns","UI","$rdf","ns$1","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n accessibilityLabel?: string\n accessibilityDescription?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n source.accessibilityLabel = `Generated N3 for ${subject.uri}`\n source.accessibilityDescription =\n 'Generated N3 serialization. This content is read-only.'\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":";;;;;AAaA,IAAMA,IAAKC,EAAG,IAUDG,IAAqB;CAChC,MAAMH,EAAG,MAAM,mBAAmB;CAElC,MAAM;CAEN,UAAU,CAACD,EAAG,MAAM,WAAW,CAAC;CAEhC,OAAO,SAAU,GAAoB,GAA4C;EAC/E,IAAMK,IAAQC,EAAQ,QAAQ;EAC9B,IACE,mDACAD,EAAM,aAAaE,CAAO,GAE1B,OAAO;EAET,IAAMC,IAAIH,EAAM,mBAAmB,KAAA,GAAW,KAAA,GAAW,KAAA,GAAWE,CAAO,CAAC,CACzE;EAEH,OADIC,MAAM,IAAU,OACb,WAAWA,IAAI;CACxB;CAEA,QAAQ,SACN,GACA,GACgB;EAChB,IAAMC,IAAaH,EAAQ,KACrBI,IAAKJ,EAAQ,QAAQ,OAErBK,IAAMF,EAAW,cAAc,KAAK;EAC1C,EAAI,aAAa,SAAS,SAAS;EAInC,IAAMG,IAAaF,EAAG,mBACpB,KAAA,GACA,KAAA,GACA,KAAA,GACAH,CACF,GAEMM,IAAKX,EAAK,WAAWQ,CAAE;EAE7B,AADAG,EAAG,kBAAkBH,EAAG,UAAU,GAClCG,EAAG,QAAQN,EAAQ,GAAG;EACtB,IAAMO,IAAoBD,EAAG,eAAeD,CAAU,GAChDG,IAASN,EAAW,cAAc,yBAAyB;EAajE,OAPA,EAAO,cAAc,WACrB,EAAO,UAAUK,GACjB,EAAO,qBAAqB,oBAAoBP,EAAQ,OACxD,EAAO,2BACL,0DAEFI,EAAI,YAAYI,CAAM,GACfJ;CACT;AACF"}
@@ -1,2 +1,2 @@
1
- const e=require("./state.cjs.js");var t,n=!1;function r(){return n}function i(e){console.error(`Failed to show the page after browser navigation.`,e)}function a(r){if(t=r,n)return;n=!0;let a=()=>(e.clearPaneState(),(t?.show({kind:`restore`,forceHeading:!0})??Promise.resolve()).catch(i)),o=window.navigation;o?(o.addEventListener(`navigate`,e=>{e.canIntercept&&e.userInitiated&&e.navigationType===`replace`&&e.destination.url===window.location.href&&e.intercept({scroll:`manual`,focusReset:`manual`,handler:a})}),o.addEventListener(`currententrychange`,e=>{e.navigationType===`traverse`&&a()})):window.addEventListener(`popstate`,()=>{a()})}exports.isHandlingBrowserNavigation=r,exports.registerBrowserNavigation=a;
1
+ const e=require("./state.cjs.js");var t,n=!1;function r(){return n}function i(e){console.error(`Failed to show the page after browser navigation.`,e)}function a(r){if(t=r,n)return;n=!0;let a=()=>(e.clearPaneState(),(t?.show({kind:`restore`,forceHeading:!0})??Promise.resolve()).catch(i)),o=window.navigation;o?(o.addEventListener(`navigate`,t=>{!e.isWritingNavigationHistory(window.history)&&(t.hashChange||t.destination.sameDocument===!1||t.destination.url!==window.location.href)&&t.canIntercept&&t.userInitiated&&t.navigationType===`replace`&&t.destination.url===window.location.href&&t.intercept({scroll:`manual`,focusReset:`manual`,handler:a})}),o.addEventListener(`currententrychange`,e=>{e.navigationType===`traverse`&&a()})):window.addEventListener(`popstate`,()=>{a()})}exports.isHandlingBrowserNavigation=r,exports.registerBrowserNavigation=a;
2
2
  //# sourceMappingURL=browserEvents.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browserEvents.cjs.js","names":["require_state","navigation","listenersRegistered","isHandlingBrowserNavigation","reportError","error","registerBrowserNavigation","controller","showUrl","navigationApi","event"],"sources":["../../src/navigation/browserEvents.ts"],"sourcesContent":["/*\n * What the page does when the browser changes the URL or the history entry without reloading.\n *\n * Like a reload, both cases show what the URL is, not what the entry last displayed through the\n * navbar or the account menu:\n * - Enter on the current URL (typically one ending in #me)\n * - back and forward\n */\n\nimport type { NavigationController } from './controller'\nimport { clearPaneState } from './state'\n\ninterface NavigationEvent extends Event {\n canIntercept: boolean\n userInitiated: boolean\n navigationType: string\n destination: { url: string }\n intercept: (options: { handler: () => Promise<void>, scroll: 'manual', focusReset: 'manual' }) => void\n}\n\ninterface NavigationApi {\n addEventListener: (type: 'navigate' | 'currententrychange', listener: (event: NavigationEvent) => void) => void\n}\n\nlet navigation: NavigationController | undefined\nlet listenersRegistered = false\n\n/**\n * Whether the main page handles back and forward itself. Packages that used to re-render on\n * `popstate` (mashlib) ask this and leave it to the main page.\n */\nexport function isHandlingBrowserNavigation (): boolean {\n return listenersRegistered\n}\n\nfunction reportError (error: unknown) {\n console.error('Failed to show the page after browser navigation.', error)\n}\n\n/**\n * Starts handling Enter, back and forward for a controller. The listeners are added once;\n * calling this again only changes which controller they use.\n *\n * The Navigation API is used where the browser has it; the places that fall back to an older\n * mechanism are marked NAVIGATION API FALLBACK. See \"Browser support\" in docs/navigation-design.md.\n */\nexport function registerBrowserNavigation (controller: NavigationController): void {\n navigation = controller\n if (listenersRegistered) return\n listenersRegistered = true\n\n const showUrl = () => {\n clearPaneState()\n return (navigation?.show({ kind: 'restore', forceHeading: true }) ?? Promise.resolve()).catch(reportError)\n }\n\n const navigationApi = (window as unknown as { navigation?: NavigationApi }).navigation\n if (!navigationApi) {\n // NAVIGATION API FALLBACK (Firefox before 147, Safari before 26.2, older Chromium).\n // Back and forward use `popstate`, which cannot tell them from in-page `#` links, so a\n // fragment link also re-renders the page. Enter on the current URL is not handled at all\n // here: without a fragment the browser reloads the page, and `initMainPage` shows the URL.\n window.addEventListener('popstate', () => { showUrl() })\n return\n }\n\n // NAVIGATION API: Enter on the current URL (typically one ending in #me) is a same-URL\n // \"replace\" navigation; intercepting it shows the URL without reloading. Without the API\n // there is no equivalent, see the fallback above.\n navigationApi.addEventListener('navigate', event => {\n if (!event.canIntercept || !event.userInitiated || event.navigationType !== 'replace' ||\n event.destination.url !== window.location.href) return\n\n event.intercept({\n scroll: 'manual',\n focusReset: 'manual',\n handler: showUrl\n })\n })\n\n // NAVIGATION API: unlike the `popstate` fallback above, this does not fire for in-page\n // fragment links.\n navigationApi.addEventListener('currententrychange', event => {\n if (event.navigationType === 'traverse') showUrl()\n })\n}\n"],"mappings":"A,kCAwBA,IAAIC,EACAC,EAAsB,GAM1B,SAAgBC,GAAwC,CACtD,OAAOD,CACT,CAEA,SAASE,EAAa,EAAgB,CACpC,QAAQ,MAAM,oDAAqDC,CAAK,CAC1E,CASA,SAAgBC,EAA2B,EAAwC,CAEjF,GADA,EAAaC,EACTL,EAAqB,OACzB,EAAsB,GAEtB,IAAMM,OACJR,EAAA,eAAe,GACPC,GAAY,KAAK,CAAE,KAAM,UAAW,aAAc,EAAK,CAAC,GAAK,QAAQ,QAAQ,EAAA,CAAG,MAAMG,CAAW,GAGrGK,EAAiB,OAAqD,WACvEA,GAYLA,EAAc,iBAAiB,WAAY,GAAS,CAC7CC,EAAM,cAAiBA,EAAM,eAAiBA,EAAM,iBAAmB,WACxEA,EAAM,YAAY,MAAQ,OAAO,SAAS,MAE9CA,EAAM,UAAU,CACd,OAAQ,SACR,WAAY,SACZ,QAASF,CACX,CAAC,CACH,CAAC,EAIDC,EAAc,iBAAiB,qBAAsB,GAAS,CACxDC,EAAM,iBAAmB,YAAYF,EAAQ,CACnD,CAAC,GAtBC,OAAO,iBAAiB,eAAkB,CAAEA,EAAQ,CAAE,CAAC,CAuB3D,C"}
1
+ {"version":3,"file":"browserEvents.cjs.js","names":["isWritingNavigationHistory","require_state","navigation","listenersRegistered","isHandlingBrowserNavigation","reportError","error","registerBrowserNavigation","controller","showUrl","navigationApi","event"],"sources":["../../src/navigation/browserEvents.ts"],"sourcesContent":["/*\n * What the page does when the browser changes the URL or the history entry without reloading.\n *\n * Like a reload, both cases show what the URL is, not what the entry last displayed through the\n * navbar or the account menu:\n * - Enter on the current URL (typically one ending in #me)\n * - back and forward\n */\n\nimport type { NavigationController } from './controller'\nimport { clearPaneState, isWritingNavigationHistory } from './state'\n\ninterface NavigationEvent extends Event {\n canIntercept: boolean\n userInitiated: boolean\n navigationType: string\n hashChange: boolean\n destination: { url: string, sameDocument: boolean }\n intercept: (options: { handler: () => Promise<void>, scroll: 'manual', focusReset: 'manual' }) => void\n}\n\ninterface NavigationApi {\n addEventListener: (type: 'navigate' | 'currententrychange', listener: (event: NavigationEvent) => void) => void\n}\n\nlet navigation: NavigationController | undefined\nlet listenersRegistered = false\n\n/**\n * Whether the main page handles back and forward itself. Packages that used to re-render on\n * `popstate` (mashlib) ask this and leave it to the main page.\n */\nexport function isHandlingBrowserNavigation (): boolean {\n return listenersRegistered\n}\n\nfunction reportError (error: unknown) {\n console.error('Failed to show the page after browser navigation.', error)\n}\n\n/**\n * Starts handling Enter, back and forward for a controller. The listeners are added once;\n * calling this again only changes which controller they use.\n *\n * The Navigation API is used where the browser has it; the places that fall back to an older\n * mechanism are marked NAVIGATION API FALLBACK. See \"Browser support\" in docs/navigation-design.md.\n */\nexport function registerBrowserNavigation (controller: NavigationController): void {\n navigation = controller\n if (listenersRegistered) return\n listenersRegistered = true\n\n const showUrl = () => {\n clearPaneState()\n return (navigation?.show({ kind: 'restore', forceHeading: true }) ?? Promise.resolve()).catch(reportError)\n }\n\n const navigationApi = (window as unknown as { navigation?: NavigationApi }).navigation\n if (!navigationApi) {\n // NAVIGATION API FALLBACK (Firefox before 147, Safari before 26.2, older Chromium).\n // Back and forward use `popstate`, which cannot tell them from in-page `#` links, so a\n // fragment link also re-renders the page. Enter on the current URL is not handled at all\n // here: without a fragment the browser reloads the page, and `initMainPage` shows the URL.\n window.addEventListener('popstate', () => { showUrl() })\n return\n }\n\n // NAVIGATION API: Enter on the current URL (typically one ending in #me) is a same-URL\n // \"replace\" navigation; intercepting it shows the URL without reloading. Without the API\n // there is no equivalent, see the fallback above.\n //\n // Enter is either a fragment navigation (`hashChange`) or a cross-document one. A replacement\n // to the current URL without a hash change is a `history.replaceState` write. Safari marks the\n // application's own writes as `userInitiated` during a tap and can dispatch them after\n // `writeNavigationHistory` returns, so that guard alone does not stop them. Use the URL and hash\n // rather than `sameDocument` here because WebKit versions differ in whether they report that\n // property for a history API write.\n navigationApi.addEventListener('navigate', event => {\n if (isWritingNavigationHistory(window.history) ||\n (!event.hashChange && event.destination.sameDocument !== false &&\n event.destination.url === window.location.href) ||\n !event.canIntercept || !event.userInitiated || event.navigationType !== 'replace' ||\n event.destination.url !== window.location.href) return\n\n event.intercept({\n scroll: 'manual',\n focusReset: 'manual',\n handler: showUrl\n })\n })\n\n // NAVIGATION API: unlike the `popstate` fallback above, this does not fire for in-page\n // fragment links.\n navigationApi.addEventListener('currententrychange', event => {\n if (event.navigationType === 'traverse') showUrl()\n })\n}\n"],"mappings":"A,kCAyBA,IAAIE,EACAC,EAAsB,GAM1B,SAAgBC,GAAwC,CACtD,OAAOD,CACT,CAEA,SAASE,EAAa,EAAgB,CACpC,QAAQ,MAAM,oDAAqDC,CAAK,CAC1E,CASA,SAAgBC,EAA2B,EAAwC,CAEjF,GADA,EAAaC,EACTL,EAAqB,OACzB,EAAsB,GAEtB,IAAMM,OACJR,EAAA,eAAe,GACPC,GAAY,KAAK,CAAE,KAAM,UAAW,aAAc,EAAK,CAAC,GAAK,QAAQ,QAAQ,EAAA,CAAG,MAAMG,CAAW,GAGrGK,EAAiB,OAAqD,WACvEA,GAmBLA,EAAc,iBAAiB,WAAY,GAAS,CAC9CV,GAAAA,2BAA2B,OAAO,OAAO,IACvCW,EAAM,YAAcA,EAAM,YAAY,eAAiB,IACvDA,EAAM,YAAY,MAAQ,OAAO,SAAS,OAC3CA,EAAM,cAAiBA,EAAM,eAAiBA,EAAM,iBAAmB,WACxEA,EAAM,YAAY,MAAQ,OAAO,SAAS,MAE9CA,EAAM,UAAU,CACd,OAAQ,SACR,WAAY,SACZ,QAASF,CACX,CAAC,CACH,CAAC,EAIDC,EAAc,iBAAiB,qBAAsB,GAAS,CACxDC,EAAM,iBAAmB,YAAYF,EAAQ,CACnD,CAAC,GAhCC,OAAO,iBAAiB,eAAkB,CAAEA,EAAQ,CAAE,CAAC,CAiC3D,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"browserEvents.d.ts","sourceRoot":"","sources":["../../src/navigation/browserEvents.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAkBxD;;;GAGG;AACH,wBAAgB,2BAA2B,IAAK,OAAO,CAEtD;AAMD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,UAAU,EAAE,oBAAoB,GAAG,IAAI,CAuCjF"}
1
+ {"version":3,"file":"browserEvents.d.ts","sourceRoot":"","sources":["../../src/navigation/browserEvents.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAmBxD;;;GAGG;AACH,wBAAgB,2BAA2B,IAAK,OAAO,CAEtD;AAMD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAE,UAAU,EAAE,oBAAoB,GAAG,IAAI,CAiDjF"}