solid-panes 5.1.0-2 → 5.1.0-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +6 -0
  2. package/dist/components/profile-heading/ProfileHeading.cjs.js +2 -2
  3. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
  4. package/dist/components/profile-heading/ProfileHeading.esm.js +2 -2
  5. package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -1
  6. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +1 -1
  7. package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -1
  8. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +1 -1
  9. package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -1
  10. package/dist/index.cjs.js +1 -1
  11. package/dist/index.cjs.js.map +1 -1
  12. package/dist/index.d.ts +1 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.esm.js +16 -15
  15. package/dist/index.esm.js.map +1 -1
  16. package/dist/mainPage/index.cjs.js +1 -1
  17. package/dist/mainPage/index.cjs.js.map +1 -1
  18. package/dist/mainPage/index.d.ts.map +1 -1
  19. package/dist/mainPage/index.esm.js +36 -25
  20. package/dist/mainPage/index.esm.js.map +1 -1
  21. package/dist/mainPage/profileHeading.d.ts +2 -1
  22. package/dist/mainPage/profileHeading.d.ts.map +1 -1
  23. package/dist/mainPage/profileHeading2.cjs.js +1 -1
  24. package/dist/mainPage/profileHeading2.cjs.js.map +1 -1
  25. package/dist/mainPage/profileHeading2.esm.js +75 -75
  26. package/dist/mainPage/profileHeading2.esm.js.map +1 -1
  27. package/dist/navigation/chrome.cjs.js +1 -1
  28. package/dist/navigation/chrome.cjs.js.map +1 -1
  29. package/dist/navigation/chrome.d.ts +20 -2
  30. package/dist/navigation/chrome.d.ts.map +1 -1
  31. package/dist/navigation/chrome.esm.js +14 -8
  32. package/dist/navigation/chrome.esm.js.map +1 -1
  33. package/dist/navigation/controller.cjs.js +1 -1
  34. package/dist/navigation/controller.cjs.js.map +1 -1
  35. package/dist/navigation/controller.d.ts +3 -0
  36. package/dist/navigation/controller.d.ts.map +1 -1
  37. package/dist/navigation/controller.esm.js +49 -28
  38. package/dist/navigation/controller.esm.js.map +1 -1
  39. package/dist/navigation/options.cjs.js +1 -1
  40. package/dist/navigation/options.cjs.js.map +1 -1
  41. package/dist/navigation/options.d.ts +12 -0
  42. package/dist/navigation/options.d.ts.map +1 -1
  43. package/dist/navigation/options.esm.js +4 -1
  44. package/dist/navigation/options.esm.js.map +1 -1
  45. package/dist/navigation/podContext.cjs.js +1 -1
  46. package/dist/navigation/podContext.cjs.js.map +1 -1
  47. package/dist/navigation/podContext.d.ts.map +1 -1
  48. package/dist/navigation/podContext.esm.js +14 -14
  49. package/dist/navigation/podContext.esm.js.map +1 -1
  50. package/dist/outline/manager2.cjs.js +1 -1
  51. package/dist/outline/manager2.cjs.js.map +1 -1
  52. package/dist/outline/manager2.esm.js +352 -321
  53. package/dist/outline/manager2.esm.js.map +1 -1
  54. package/dist/versionInfo.cjs.js +1 -1
  55. package/dist/versionInfo.cjs.js.map +1 -1
  56. package/dist/versionInfo.esm.js +3 -3
  57. package/dist/versionInfo.esm.js.map +1 -1
  58. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":["OutlineManager","versionInfo_default","manager_default","UI","getOutliner","dom","environment","context","createContext","store","solidLogicSingleton","updateEnvironment","outliner","registerPanes","register","cjsOrEsModule","byName","initMainPage","isHandlingBrowserNavigation","list","paneForIcon","paneForPredicate","refreshUI"],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport { registerPanes } from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName,\n RenderEnvironment\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport { initMainPage, refreshUI } from './mainPage'\nimport { isHandlingBrowserNavigation } from './navigation/browserEvents'\n\nfunction getOutliner (dom, environment?: RenderEnvironment): OutlineManager {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton,\n environment\n )\n dom.outlineManager = new OutlineManager(context)\n } else if (environment) {\n dom.outlineManager.context = dom.outlineManager.context || {}\n dom.outlineManager.context.environment = environment\n }\n return dom.outlineManager\n}\n\nfunction updateEnvironment (outliner: OutlineManager, environment: RenderEnvironment) {\n if (!outliner) return\n outliner.context = outliner.context || {}\n outliner.context.environment = environment\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n updateEnvironment,\n UI,\n versionInfo,\n initMainPage,\n refreshUI,\n isHandlingBrowserNavigation,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":";;;;;;;;;;AA8BA,SAASI,EAAa,GAAK,GAAiD;CAC1E,IAAKC,EAAI,gBASF,AAAIC,MACT,EAAI,eAAe,UAAUD,EAAI,eAAe,WAAW,CAAC,GAC5D,EAAI,eAAe,QAAQ,cAAcC;MAXlB;EACvB,IAAMC,IAAUC,EACdH,GACA;GAAE;GAAM;GAAa;GAAkB;GAAU;EAAO,GACxDI,GACAC,GACAJ,CACF;EACA,EAAI,iBAAiB,IAAIN,EAAeO,CAAO;CACjD;CAIA,OAAOF,EAAI;AACb;AAEA,SAASM,EAAmB,GAA0B,GAAgC;CACpF,AAAKC,MACL,EAAS,UAAUA,EAAS,WAAW,CAAC,GACxC,EAAS,QAAQ,cAAcN;AACjC;AAEI,OAAO,SAAW,OACpBF,EAAY,OAAO,QAAQ,GAG7BS,GAAe,MAAuBC,EAASC,EAAc,WAAWA,CAAa,CAAC,GAwBlF,OAAO,SAAW,QACnB,OAAc,QAAQ,EACrB,eACF"}
1
+ {"version":3,"file":"index.esm.js","names":["OutlineManager","versionInfo_default","manager_default","UI","getOutliner","dom","environment","context","createContext","store","solidLogicSingleton","updateEnvironment","outliner","registerPanes","register","cjsOrEsModule","byName","initMainPage","initializeProfileHeading","isHandlingBrowserNavigation","list","paneForIcon","paneForPredicate","refreshProfileHeading","refreshUI"],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport { registerPanes } from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName,\n RenderEnvironment\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport { initMainPage, refreshUI } from './mainPage'\nimport { isHandlingBrowserNavigation } from './navigation/browserEvents'\n\nfunction getOutliner (dom, environment?: RenderEnvironment): OutlineManager {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton,\n environment\n )\n dom.outlineManager = new OutlineManager(context)\n } else if (environment) {\n dom.outlineManager.context = dom.outlineManager.context || {}\n dom.outlineManager.context.environment = environment\n }\n return dom.outlineManager\n}\n\nfunction updateEnvironment (outliner: OutlineManager, environment: RenderEnvironment) {\n if (!outliner) return\n outliner.context = outliner.context || {}\n outliner.context.environment = environment\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n updateEnvironment,\n UI,\n versionInfo,\n initMainPage,\n refreshUI,\n isHandlingBrowserNavigation,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\nexport {\n initializeProfileHeading,\n refreshProfileHeading\n} from './mainPage/profileHeading'\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":";;;;;;;;;;;AA8BA,SAASI,EAAa,GAAK,GAAiD;CAC1E,IAAKC,EAAI,gBASF,AAAIC,MACT,EAAI,eAAe,UAAUD,EAAI,eAAe,WAAW,CAAC,GAC5D,EAAI,eAAe,QAAQ,cAAcC;MAXlB;EACvB,IAAMC,IAAUC,EACdH,GACA;GAAE;GAAM;GAAa;GAAkB;GAAU;EAAO,GACxDI,GACAC,GACAJ,CACF;EACA,EAAI,iBAAiB,IAAIN,EAAeO,CAAO;CACjD;CAIA,OAAOF,EAAI;AACb;AAEA,SAASM,EAAmB,GAA0B,GAAgC;CACpF,AAAKC,MACL,EAAS,UAAUA,EAAS,WAAW,CAAC,GACxC,EAAS,QAAQ,cAAcN;AACjC;AAEI,OAAO,SAAW,OACpBF,EAAY,OAAO,QAAQ,GAG7BS,GAAe,MAAuBC,EAASC,EAAc,WAAWA,CAAa,CAAC,GA6BlF,OAAO,SAAW,QACnB,OAAc,QAAQ,EACrB,eACF"}
@@ -1,2 +1,2 @@
1
- const e=require("../navigation/state.cjs.js");require("../humanReadablePane2.cjs.js");const t=require("./header.cjs.js"),n=require("./navbar.cjs.js"),r=require("./profileHeading2.cjs.js"),i=require("./navigation.cjs.js"),a=require("../navigation/browserEvents.cjs.js"),o=require("../index.cjs.js");var s=`__lastRenderEnvSignature`;function c(e){return e?[e.layout,e.theme,e.inputMode].join(`|`):``}function l(){let e=document.getElementById(`MainContent`);return e||(e=document.createElement(`main`),e.id=`MainContent`,e.setAttribute(`role`,`main`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`aria-live`,`polite`),document.body.appendChild(e)),e}async function u(u,d,f){if(window.name===`solidos-human-readable-preview`&&window.self!==window.top){document.body.textContent=`This resource cannot be previewed here. Open it in a new tab instead.`;return}l(),d||=window.location.href;let p=typeof d==`string`?u.sym(d):d;e.clearPaneState(),r.initializeProfileHeading();let m=o.getOutliner(document,f);m[s]=c(f);let h=i.navigationFor(m,u);a.registerBrowserNavigation(h),await h.show({kind:`restore`,subject:p.uri});let g=await t.createHeader(h),_=await n.createNavbar(h);return r.placeProfileHeading(),Promise.all([g,_])}async function d(e){let t=e?.context?.session?.store,n=c(e?.context?.environment);n!==(e?.[s]??``)&&t&&typeof e?.GotoSubject==`function`&&(await i.navigationFor(e,t).show({kind:`restore`}),e[s]=n)}exports.initMainPage=u,exports.refreshUI=d;
1
+ const e=require("../navigation/podContext.cjs.js"),t=require("../navigation/state.cjs.js");require("../humanReadablePane2.cjs.js");const n=require("./header.cjs.js"),r=require("./navbar.cjs.js"),i=require("./profileHeading2.cjs.js"),a=require("./navigation.cjs.js"),o=require("../navigation/browserEvents.cjs.js"),s=require("../index.cjs.js");let c=require("solid-logic");var l=`__lastRenderEnvSignature`;function u(e){return e?[e.layout,e.theme,e.inputMode].join(`|`):``}function d(){let e=document.getElementById(`MainContent`);return e||(e=document.createElement(`main`),e.id=`MainContent`,e.setAttribute(`role`,`main`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`aria-live`,`polite`),document.body.appendChild(e)),e}async function f(f,p,m){if(window.name===`solidos-human-readable-preview`&&window.self!==window.top){document.body.textContent=`This resource cannot be previewed here. Open it in a new tab instead.`;return}d(),p||=window.location.href;let h=typeof p==`string`?f.sym(p):p;t.clearPaneState(),await i.initializeProfileHeading();let g=s.getOutliner(document,m);g[l]=u(m);let _=a.navigationFor(g,f);o.registerBrowserNavigation(_);let v=()=>{e.resetPodContexts(),_.show({kind:`restore`,forceHeading:!0}).catch(e=>{console.error(`Failed to refresh navigation after an authentication change.`,e)})};c.authSession.events.on(`login`,v),c.authSession.events.on(`sessionRestore`,v),c.authSession.events.on(`logout`,v),c.authSession.events.on(`sessionChange`,v),c.authSession.events.on(`identityReplaced`,v),await _.show({kind:`restore`,subject:h.uri});let y=await n.createHeader(_),b=await r.createNavbar(_);return i.placeProfileHeading(),Promise.all([y,b])}async function p(e){let t=e?.context?.session?.store,n=u(e?.context?.environment);n!==(e?.[l]??``)&&t&&typeof e?.GotoSubject==`function`&&(await a.navigationFor(e,t).show({kind:`restore`}),e[l]=n)}exports.initMainPage=f,exports.refreshUI=p;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","names":["getOutliner","navigationFor","createHeader","createNavbar","require_state","require_header","require_navbar","require_profileHeading","require_navigation","require_browserEvents","require_index","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","outliner","environment","navigation","header","navbar","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"A,0SAkBA,IAAMW,EAAsB,2BAE5B,SAASC,EAAoB,EAAiC,CAE5D,OADKC,EACE,CAACA,EAAI,OAAQA,EAAI,MAAOA,EAAI,SAAS,CAAC,CAAC,KAAK,GAAG,EADrC,EAEnB,CAEA,SAASC,GAAqB,CAC5B,IAAIC,EAAO,SAAS,eAAe,aAAa,EAShD,OARKA,IACH,EAAO,SAAS,cAAc,MAAM,EACpC,EAAK,GAAK,cACVA,EAAK,aAAa,OAAQ,MAAM,EAChCA,EAAK,aAAa,WAAY,IAAI,EAClCA,EAAK,aAAa,YAAa,QAAQ,EACvC,SAAS,KAAK,YAAYA,CAAI,GAEzBA,CACT,CAEA,eAAsBC,EACpB,EACA,EACA,EACA,CAGA,GAAI,OAAO,OAAA,kCAA8C,OAAO,OAAS,OAAO,IAAK,CACnF,SAAS,KAAK,YAAc,wEAC5B,MACF,CACAF,EAAkB,EAClB,IAAa,OAAO,SAAS,KAC7B,IAAMG,EAAqB,OAAOC,GAAQ,SAAWC,EAAM,IAAID,CAAG,EAAIA,EAKtEd,EAAA,eAAe,EACfG,EAAA,yBAAyB,EACzB,IAAMa,EAAWpB,EAAAA,YAAY,SAAUqB,CAAW,EACjD,EAAkBV,GAAuBC,EAAmBS,CAAW,EACxE,IAAMC,EAAarB,EAAAA,cAAcmB,EAAUD,CAAK,EAChDV,EAAA,0BAA0Ba,CAAU,EACpC,MAAMA,EAAW,KAAK,CAAE,KAAM,UAAW,QAASL,EAAQ,GAAI,CAAC,EAE/D,IAAMM,EAAS,MAAMrB,EAAAA,aAAaoB,CAAU,EACtCE,EAAS,MAAMrB,EAAAA,aAAamB,CAAU,EAG5C,OADAf,EAAA,oBAAoB,EACb,QAAQ,IAAI,CAACgB,EAAQC,CAAM,CAAC,CACrC,CAEA,eAAsBC,EAAW,EAA0B,CACzD,IAAMN,EAAQC,GAAU,SAAS,SAAS,MAIpCM,EAAmBd,EAAmBQ,GAAU,SAAS,WAAW,EAEvDM,KADQN,IAAmBT,IAAwB,KAGpDQ,GAAS,OAAOC,GAAU,aAAgB,aAG1D,MAAMnB,EAAAA,cAAcmB,EAAUD,CAAK,CAAC,CAAC,KAAK,CAAE,KAAM,SAAU,CAAC,EAC5D,EAAkBR,GAAuBe,EAE9C,C"}
1
+ {"version":3,"file":"index.cjs.js","names":["initializeProfileHeading","getOutliner","navigationFor","createHeader","createNavbar","require_podContext","require_state","require_header","require_navbar","require_profileHeading","require_navigation","require_browserEvents","require_index","solid_logic","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","outliner","environment","navigation","refreshNavigationAfterAuth","error","header","navbar","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authSession } from 'solid-logic'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { resetPodContexts } from '../navigation/podContext'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n await initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n const refreshNavigationAfterAuth = () => {\n resetPodContexts()\n navigation.show({ kind: 'restore', forceHeading: true }).catch((error: unknown) => {\n console.error('Failed to refresh navigation after an authentication change.', error)\n })\n }\n authSession.events.on('login', refreshNavigationAfterAuth)\n authSession.events.on('sessionRestore', refreshNavigationAfterAuth)\n authSession.events.on('logout', refreshNavigationAfterAuth)\n authSession.events.on('sessionChange', refreshNavigationAfterAuth)\n authSession.events.on('identityReplaced', refreshNavigationAfterAuth)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"A,oXAoBA,IAAMc,EAAsB,2BAE5B,SAASC,EAAoB,EAAiC,CAE5D,OADKC,EACE,CAACA,EAAI,OAAQA,EAAI,MAAOA,EAAI,SAAS,CAAC,CAAC,KAAK,GAAG,EADrC,EAEnB,CAEA,SAASC,GAAqB,CAC5B,IAAIC,EAAO,SAAS,eAAe,aAAa,EAShD,OARKA,IACH,EAAO,SAAS,cAAc,MAAM,EACpC,EAAK,GAAK,cACVA,EAAK,aAAa,OAAQ,MAAM,EAChCA,EAAK,aAAa,WAAY,IAAI,EAClCA,EAAK,aAAa,YAAa,QAAQ,EACvC,SAAS,KAAK,YAAYA,CAAI,GAEzBA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,KADQR,IAAmBT,IAAwB,KAGpDQ,GAAS,OAAOC,GAAU,aAAgB,aAG1D,MAAMrB,EAAAA,cAAcqB,EAAUD,CAAK,CAAC,CAAC,KAAK,CAAE,KAAM,SAAU,CAAC,EAC5D,EAAkBR,GAAuBiB,EAE9C,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mainPage/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAe,cAAc,EAAE,MAAM,UAAU,CAAA;AA+BtD,wBAAsB,YAAY,CAChC,KAAK,EAAE,SAAS,EAChB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,WAAW,CAAC,EAAE,iBAAiB,+CA4BhC;AAED,wBAAsB,SAAS,CAAE,QAAQ,EAAE,cAAc,iBAexD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mainPage/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAE7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAe,cAAc,EAAE,MAAM,UAAU,CAAA;AAgCtD,wBAAsB,YAAY,CAChC,KAAK,EAAE,SAAS,EAChB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,WAAW,CAAC,EAAE,iBAAiB,+CAuChC;AAED,wBAAsB,SAAS,CAAE,QAAQ,EAAE,cAAc,iBAexD"}
@@ -1,46 +1,57 @@
1
- import { clearPaneState as e } from "../navigation/state.esm.js";
1
+ import { resetPodContexts as e } from "../navigation/podContext.esm.js";
2
+ import { clearPaneState as t } from "../navigation/state.esm.js";
2
3
  import "../humanReadablePane2.esm.js";
3
- import { createHeader as t } from "./header.esm.js";
4
- import { createNavbar as n } from "./navbar.esm.js";
5
- import { initializeProfileHeading as r, placeProfileHeading as i } from "./profileHeading2.esm.js";
6
- import { navigationFor as a } from "./navigation.esm.js";
7
- import { registerBrowserNavigation as o } from "../navigation/browserEvents.esm.js";
8
- import { getOutliner as s } from "../index.esm.js";
4
+ import { createHeader as n } from "./header.esm.js";
5
+ import { createNavbar as r } from "./navbar.esm.js";
6
+ import { initializeProfileHeading as i, placeProfileHeading as a } from "./profileHeading2.esm.js";
7
+ import { navigationFor as o } from "./navigation.esm.js";
8
+ import { registerBrowserNavigation as s } from "../navigation/browserEvents.esm.js";
9
+ import { getOutliner as c } from "../index.esm.js";
10
+ import { authSession as l } from "solid-logic";
9
11
  // src/mainPage/index.ts
10
- var c = "__lastRenderEnvSignature";
11
- function l(e) {
12
+ var u = "__lastRenderEnvSignature";
13
+ function d(e) {
12
14
  return e ? [
13
15
  e.layout,
14
16
  e.theme,
15
17
  e.inputMode
16
18
  ].join("|") : "";
17
19
  }
18
- function u() {
20
+ function f() {
19
21
  let e = document.getElementById("MainContent");
20
22
  return e || (e = document.createElement("main"), e.id = "MainContent", e.setAttribute("role", "main"), e.setAttribute("tabindex", "-1"), e.setAttribute("aria-live", "polite"), document.body.appendChild(e)), e;
21
23
  }
22
- async function d(d, f, p) {
24
+ async function p(p, m, h) {
23
25
  if (window.name === "solidos-human-readable-preview" && window.self !== window.top) {
24
26
  document.body.textContent = "This resource cannot be previewed here. Open it in a new tab instead.";
25
27
  return;
26
28
  }
27
- u(), f ||= window.location.href;
28
- let m = typeof f == "string" ? d.sym(f) : f;
29
- e(), r();
30
- let h = s(document, p);
31
- h[c] = l(p);
32
- let g = a(h, d);
33
- o(g), await g.show({
29
+ f(), m ||= window.location.href;
30
+ let g = typeof m == "string" ? p.sym(m) : m;
31
+ t(), await i();
32
+ let _ = c(document, h);
33
+ _[u] = d(h);
34
+ let v = o(_, p);
35
+ s(v);
36
+ let y = () => {
37
+ e(), v.show({
38
+ kind: "restore",
39
+ forceHeading: !0
40
+ }).catch((e) => {
41
+ console.error("Failed to refresh navigation after an authentication change.", e);
42
+ });
43
+ };
44
+ l.events.on("login", y), l.events.on("sessionRestore", y), l.events.on("logout", y), l.events.on("sessionChange", y), l.events.on("identityReplaced", y), await v.show({
34
45
  kind: "restore",
35
- subject: m.uri
46
+ subject: g.uri
36
47
  });
37
- let _ = await t(g), v = await n(g);
38
- return i(), Promise.all([_, v]);
48
+ let b = await n(v), x = await r(v);
49
+ return a(), Promise.all([b, x]);
39
50
  }
40
- async function f(e) {
41
- let t = e?.context?.session?.store, n = l(e?.context?.environment);
42
- n !== (e?.[c] ?? "") && t && typeof e?.GotoSubject == "function" && (await a(e, t).show({ kind: "restore" }), e[c] = n);
51
+ async function m(e) {
52
+ let t = e?.context?.session?.store, n = d(e?.context?.environment);
53
+ n !== (e?.[u] ?? "") && t && typeof e?.GotoSubject == "function" && (await o(e, t).show({ kind: "restore" }), e[u] = n);
43
54
  }
44
- export { d as initMainPage, f as refreshUI };
55
+ export { p as initMainPage, m as refreshUI };
45
56
 
46
57
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","registerBrowserNavigation","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMA,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CAGA,IAAI,OAAO,SAAA,oCAA8C,OAAO,SAAS,OAAO,KAAK;EACnF,SAAS,KAAK,cAAc;EAC5B;CACF;CAEA,AADAF,EAAkB,GAClB,MAAa,OAAO,SAAS;CAC7B,IAAMG,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA;CAMtE,AADAE,EAAe,GACfC,EAAyB;CACzB,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CACjD,EAAkBb,KAAuBC,EAAmBY,CAAW;CACxE,IAAMC,IAAaC,EAAcJ,GAAUH,CAAK;CAEhD,AADAQ,EAA0BF,CAAU,GACpC,MAAMA,EAAW,KAAK;EAAE,MAAM;EAAW,SAASR,EAAQ;CAAI,CAAC;CAE/D,IAAMW,IAAS,MAAMC,EAAaJ,CAAU,GACtCK,IAAS,MAAMC,EAAaN,CAAU;CAG5C,OADAO,EAAoB,GACb,QAAQ,IAAI,CAACJ,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBG,EAAW,GAA0B;CACzD,IAAMd,IAAQG,GAAU,SAAS,SAAS,OAIpCY,IAAmBtB,EAAmBU,GAAU,SAAS,WAAW;CAI1E,AAFmBY,OADQZ,IAAmBX,MAAwB,OAGpDQ,KAAS,OAAOG,GAAU,eAAgB,eAG1D,MAAMI,EAAcJ,GAAUH,CAAK,CAAC,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,GAC5D,EAAkBR,KAAuBuB;AAE9C"}
1
+ {"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","refreshNavigationAfterAuth","resetPodContexts","error","authSession","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport { authSession } from 'solid-logic'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { resetPodContexts } from '../navigation/podContext'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n await initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n const refreshNavigationAfterAuth = () => {\n resetPodContexts()\n navigation.show({ kind: 'restore', forceHeading: true }).catch((error: unknown) => {\n console.error('Failed to refresh navigation after an authentication change.', error)\n })\n }\n authSession.events.on('login', refreshNavigationAfterAuth)\n authSession.events.on('sessionRestore', refreshNavigationAfterAuth)\n authSession.events.on('logout', refreshNavigationAfterAuth)\n authSession.events.on('sessionChange', refreshNavigationAfterAuth)\n authSession.events.on('identityReplaced', refreshNavigationAfterAuth)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAMA,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CAGA,IAAI,OAAO,SAAA,oCAA8C,OAAO,SAAS,OAAO,KAAK;EACnF,SAAS,KAAK,cAAc;EAC5B;CACF;CAEA,AADAF,EAAkB,GAClB,MAAa,OAAO,SAAS;CAC7B,IAAMG,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA;CAMtE,AADAE,EAAe,GACf,MAAMC,EAAyB;CAC/B,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CACjD,EAAkBb,KAAuBC,EAAmBY,CAAW;CACxE,IAAMC,IAAaC,EAAcJ,GAAUH,CAAK;CAChD,EAA0BM,CAAU;CACpC,IAAME,UAAmC;EAEvC,AADAC,EAAiB,GACjBH,EAAW,KAAK;GAAE,MAAM;GAAW,cAAc;EAAK,CAAC,CAAC,CAAC,OAAO,MAAmB;GACjF,QAAQ,MAAM,gEAAgEI,CAAK;EACrF,CAAC;CACH;CAMA,AALAC,EAAY,OAAO,GAAG,SAASH,CAA0B,GACzDG,EAAY,OAAO,GAAG,kBAAkBH,CAA0B,GAClEG,EAAY,OAAO,GAAG,UAAUH,CAA0B,GAC1DG,EAAY,OAAO,GAAG,iBAAiBH,CAA0B,GACjEG,EAAY,OAAO,GAAG,oBAAoBH,CAA0B,GACpE,MAAMF,EAAW,KAAK;EAAE,MAAM;EAAW,SAASR,EAAQ;CAAI,CAAC;CAE/D,IAAMc,IAAS,MAAMC,EAAaP,CAAU,GACtCQ,IAAS,MAAMC,EAAaT,CAAU;CAG5C,OADAU,EAAoB,GACb,QAAQ,IAAI,CAACJ,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBG,EAAW,GAA0B;CACzD,IAAMjB,IAAQG,GAAU,SAAS,SAAS,OAIpCe,IAAmBzB,EAAmBU,GAAU,SAAS,WAAW;CAI1E,AAFmBe,OADQf,IAAmBX,MAAwB,OAGpDQ,KAAS,OAAOG,GAAU,eAAgB,eAG1D,MAAMI,EAAcJ,GAAUH,CAAK,CAAC,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,GAC5D,EAAkBR,KAAuB0B;AAE9C"}
@@ -1,5 +1,6 @@
1
1
  export declare function refreshProfileHeading(force?: boolean): Promise<void>;
2
2
  /** Put the heading where it belongs, above the navbar, after the navbar has been added. */
3
3
  export declare function placeProfileHeading(): void;
4
- export declare function initializeProfileHeading(): void;
4
+ /** Shells browsing another resource can supply its current URL instead of the page URL. */
5
+ export declare function initializeProfileHeading(getPageUrl?: () => string): Promise<void>;
5
6
  //# sourceMappingURL=profileHeading.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileHeading.d.ts","sourceRoot":"","sources":["../../src/mainPage/profileHeading.ts"],"names":[],"mappings":"AAOA,OAAO,+BAA+B,CAAA;AACtC,OAAO,sBAAsB,CAAA;AA6I7B,wBAAsB,qBAAqB,CAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAyFzE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,IAAK,IAAI,CAE3C;AAED,wBAAgB,wBAAwB,IAAK,IAAI,CAqDhD"}
1
+ {"version":3,"file":"profileHeading.d.ts","sourceRoot":"","sources":["../../src/mainPage/profileHeading.ts"],"names":[],"mappings":"AAOA,OAAO,+BAA+B,CAAA;AACtC,OAAO,sBAAsB,CAAA;AA8I7B,wBAAsB,qBAAqB,CAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA0FzE;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,IAAK,IAAI,CAE3C;AAED,2FAA2F;AAC3F,wBAAgB,wBAAwB,CAAE,UAAU,eAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDhG"}
@@ -1,2 +1,2 @@
1
- (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../utils/webIdUtils.cjs.js"),t=require("../navigation/chrome.cjs.js"),n=require("../navigation/podContext.cjs.js"),r=require("../navigation/state.cjs.js"),i=require("../navigation/events.cjs.js"),a=require("../components/profile-heading/profileHeadingData.cjs.js");require("../components/profile-heading/index.cjs.js");let o=require("solid-logic");var s=`solid-panes-profile-heading`,c=`profile-heading-mount`,l=0,u=!1,d=!1,f=!1,p,m=``,h=``,g=``,_=new WeakMap,v=new WeakMap;function y(e){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`)return;let t=getComputedStyle(e),n=t.marginTop||`18px`,r=t.marginBottom||`20px`,i=e.animate([{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`},{height:`${e.getBoundingClientRect().height}px`,opacity:1,marginTop:n,marginBottom:r,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`both`});v.set(e,i);let a=()=>{v.get(e)===i&&(v.delete(e),i.cancel())};i.finished.then(a,t=>{v.get(e)===i&&(console.error(`Failed to animate profile heading appearance.`,t),a())})}function b(e){let t=_.get(e);_.delete(e),t?.cancel(),e.inert=!1,e.removeAttribute(`aria-hidden`)}function x(e){if(_.has(e))return;let t=getComputedStyle(e),n=e.getBoundingClientRect().height,r=t.opacity,i=t.marginTop,a=t.marginBottom,o=v.get(e);v.delete(e),o?.cancel();let s=()=>{e.hidden=!0,e.replaceChildren()};if(e.inert=!0,e.setAttribute(`aria-hidden`,`true`),e.hidden||!e.firstElementChild||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`){s();return}let c=e.animate([{height:`${n}px`,opacity:r,marginTop:i,marginBottom:a,overflow:`hidden`},{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`forwards`});_.set(e,c),c.finished.then(()=>{_.get(e)===c&&(s(),_.delete(e),c.cancel())},t=>{_.get(e)===c&&(console.error(`Failed to animate profile heading disappearance.`,t),s(),_.delete(e),c.cancel())})}function S(){w(!0).catch(e=>{console.error(`Failed to refresh profile heading after an authentication change.`,e)})}function C(){let e=document.getElementById(`MainContent`);if(!e)return null;let t=document.getElementById(c);t||(t=document.createElement(`div`),t.id=c,t.setAttribute(`aria-label`,`Profile heading`));let n=document.querySelector(`solid-panes-navbar`),r=document.getElementById(`OutlineView`),i=n?.parentNode===e?n:r?.parentNode===e?r:null;return i&&t.nextSibling!==i?e.insertBefore(t,i):!i&&t.parentNode!==e&&e.appendChild(t),t}async function w(i=!1){await p;let c=await n.getPodContext(window.location.href),u=C();if(!u)return;i&&(l++,m=``,g=``);let{view:d,viaAccountMenu:f}=r.readNavigationState(),v=t.deriveHeading({view:d,viaAccountMenu:f,viewer:o.authn.currentUser()?.value,pageUrl:window.location.href,owner:c.owner,storageUris:c.storagePanes.map(e=>e.subject.value)});if(v.mode===`none`){l++,g=``,m=``,h=``,x(u);return}let{subjectUri:S}=v,T=v.mode===`full`;b(u);let E=`${v.paneName}:${S}`;if(E===m||E===g)return;let D=++l;g=E;let O,k,A,j;try{O=await e.loadProfileFromURI(o.store.sym(S)),k=a.presentProfile(O,o.store),j=T?await a.getViewerMode(O):`anonymous`,A=j===`owner`}catch(e){throw D===l&&(g=``),e}if(D!==l)return;let M=u.querySelector(s)||document.createElement(s);M.profileData=k;let N=o.authn.currentUser();M.friendSubject=T&&N&&!N.sameTerm(O)?O:void 0,M.editContext=A?{subject:O,profileData:k,viewerMode:j,onSaved:()=>w(!0)}:void 0,M.compact=!T;let P=u.hidden||!u.firstElementChild;u.hidden=!1,M.parentNode!==u&&u.replaceChildren(M),m=E,h=O.value,g=``,P&&(await M.updateComplete,D===l&&u.isConnected&&!u.hidden&&!_.has(u)&&y(u))}function T(){C()}function E(){C(),f||=(document.addEventListener(`profile-pane-saved`,e=>{if(!(e instanceof CustomEvent)||e.detail?.subjectUri!==h)return;let t=document.querySelector(`#${c} ${s}`);t&&e.detail.profileData?(l++,g=``,t.profileData=e.detail.profileData,t.editContext&&={...t.editContext,profileData:e.detail.profileData}):w(!0).catch(e=>{console.error(`Failed to refresh profile heading after saving profile information.`,e)})}),!0);let e=p??o.authn.checkUser().then(()=>void 0);p=e,d||=(o.authSession.events.on(`login`,S),o.authSession.events.on(`sessionRestore`,S),o.authSession.events.on(`logout`,S),o.authSession.events.on(`sessionChange`,S),o.authSession.events.on(`identityReplaced`,S),!0),u||=(i.onNavigated(()=>{w().catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}),!0),e.then(()=>w(!0)).catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}exports.initializeProfileHeading=E,exports.placeProfileHeading=T,exports.refreshProfileHeading=w;
1
+ (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../utils/webIdUtils.cjs.js"),t=require("../navigation/chrome.cjs.js"),n=require("../navigation/podContext.cjs.js"),r=require("../navigation/state.cjs.js"),i=require("../navigation/events.cjs.js"),a=require("../components/profile-heading/profileHeadingData.cjs.js");require("../components/profile-heading/index.cjs.js");let o=require("solid-logic");var s=`solid-panes-profile-heading`,c=`profile-heading-mount`,l=0,u=!1,d=!1,f=!1,p,m=``,h=``,g=``,_=()=>window.location.href,v=new WeakMap,y=new WeakMap;function b(e){if(window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`)return;let t=getComputedStyle(e),n=t.marginTop||`18px`,r=t.marginBottom||`20px`,i=e.animate([{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`},{height:`${e.getBoundingClientRect().height}px`,opacity:1,marginTop:n,marginBottom:r,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`both`});y.set(e,i);let a=()=>{y.get(e)===i&&(y.delete(e),i.cancel())};i.finished.then(a,t=>{y.get(e)===i&&(console.error(`Failed to animate profile heading appearance.`,t),a())})}function x(e){let t=v.get(e);v.delete(e),t?.cancel(),e.inert=!1,e.removeAttribute(`aria-hidden`)}function S(e){if(v.has(e))return;let t=getComputedStyle(e),n=e.getBoundingClientRect().height,r=t.opacity,i=t.marginTop,a=t.marginBottom,o=y.get(e);y.delete(e),o?.cancel();let s=()=>{e.hidden=!0,e.replaceChildren()};if(e.inert=!0,e.setAttribute(`aria-hidden`,`true`),e.hidden||!e.firstElementChild||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches||typeof e.animate!=`function`){s();return}let c=e.animate([{height:`${n}px`,opacity:r,marginTop:i,marginBottom:a,overflow:`hidden`},{height:`0px`,opacity:0,marginTop:`0px`,marginBottom:`0px`,overflow:`hidden`}],{duration:300,easing:`ease`,fill:`forwards`});v.set(e,c),c.finished.then(()=>{v.get(e)===c&&(s(),v.delete(e),c.cancel())},t=>{v.get(e)===c&&(console.error(`Failed to animate profile heading disappearance.`,t),s(),v.delete(e),c.cancel())})}function C(){T(!0).catch(e=>{console.error(`Failed to refresh profile heading after an authentication change.`,e)})}function w(){let e=document.getElementById(`MainContent`);if(!e)return null;let t=document.getElementById(c);t||(t=document.createElement(`div`),t.id=c,t.setAttribute(`aria-label`,`Profile heading`));let n=document.querySelector(`solid-panes-navbar`),r=document.getElementById(`OutlineView`),i=n?.parentNode===e?n:r?.parentNode===e?r:null;return i&&t.nextSibling!==i?e.insertBefore(t,i):!i&&t.parentNode!==e&&e.appendChild(t),t}async function T(i=!1){await p;let c=_(),u=await n.getPodContext(c),d=w();if(!d)return;i&&(l++,m=``,g=``);let{view:f,viaAccountMenu:y}=r.readNavigationState(),C=t.deriveHeading({view:f,viaAccountMenu:y,viewer:o.authn.currentUser()?.value,pageUrl:c,owner:u.owner,storageUris:u.storagePanes.map(e=>e.subject.value)});if(C.mode===`none`){l++,g=``,m=``,h=``,S(d);return}let{subjectUri:E}=C,D=C.mode===`full`;x(d);let O=`${C.paneName}:${E}`;if(O===m||O===g)return;let k=++l;g=O;let A,j,M,N;try{A=await e.loadProfileFromURI(o.store.sym(E)),j=a.presentProfile(A,o.store),N=D?await a.getViewerMode(A):`anonymous`,M=N===`owner`}catch(e){throw k===l&&(g=``),e}if(k!==l)return;let P=d.querySelector(s)||document.createElement(s);P.profileData=j;let F=o.authn.currentUser();P.friendSubject=t.offersFriendAction(C.paneName)&&F&&!F.sameTerm(A)?A:void 0,P.editContext=M?{subject:A,profileData:j,viewerMode:N,onSaved:()=>T(!0)}:void 0,P.compact=!D;let I=d.hidden||!d.firstElementChild;d.hidden=!1,P.parentNode!==d&&d.replaceChildren(P),m=O,h=A.value,g=``,I&&(await P.updateComplete,k===l&&d.isConnected&&!d.hidden&&!v.has(d)&&b(d))}function E(){w()}function D(e=()=>window.location.href){_=e,w(),f||=(document.addEventListener(`profile-pane-saved`,e=>{if(!(e instanceof CustomEvent)||e.detail?.subjectUri!==h)return;let t=document.querySelector(`#${c} ${s}`);t&&e.detail.profileData?(l++,g=``,t.profileData=e.detail.profileData,t.editContext&&={...t.editContext,profileData:e.detail.profileData}):T(!0).catch(e=>{console.error(`Failed to refresh profile heading after saving profile information.`,e)})}),!0);let t=p??o.authn.checkUser().then(()=>void 0);return p=t,d||=(o.authSession.events.on(`login`,C),o.authSession.events.on(`sessionRestore`,C),o.authSession.events.on(`logout`,C),o.authSession.events.on(`sessionChange`,C),o.authSession.events.on(`identityReplaced`,C),!0),u||=(i.onNavigated(()=>{T().catch(e=>{console.error(`Failed to refresh profile heading.`,e)})}),!0),t.then(()=>T(!0)).catch(e=>{console.error(`Failed to refresh profile heading.`,e)}),t}exports.initializeProfileHeading=D,exports.placeProfileHeading=E,exports.refreshProfileHeading=T;
2
2
  //# sourceMappingURL=profileHeading2.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileHeading2.cjs.js","names":["getPodContext","readNavigationState","deriveHeading","authn","loadProfileFromURI","store","presentProfile","getViewerMode","require_webIdUtils","require_chrome","require_podContext","require_state","require_events","require_profileHeadingData","solid_logic","PROFILE_HEADING_TAG","PROFILE_HEADING_MOUNT_ID","refreshRequest","navigatedListenerRegistered","authListenersRegistered","profileSavedListenerRegistered","authReady","displayedPaneKey","displayedSubjectUri","loadingPaneKey","hideAnimations","showAnimations","showHeading","mount","style","marginTop","marginBottom","animation","finish","error","cancelHeadingHide","hideHeading","height","opacity","showing","refreshAfterAuthChange","refreshProfileHeading","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","pod","force","decision","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","event","readiness"],"sources":["../../src/mainPage/profileHeading.ts"],"sourcesContent":["import { authn, authSession, store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport type { ProfileDetails } from '../components/profile-heading/editor/sections/heading/types'\nimport type { ProfileHeadingEditContext } from '../components/profile-heading/ProfileHeading'\nimport { getViewerMode, presentProfile } from '../components/profile-heading/profileHeadingData'\nimport type { ViewerMode } from '../types'\nimport { loadProfileFromURI } from '../utils/webIdUtils'\nimport '../components/profile-heading'\nimport './profileHeading.css'\nimport { deriveHeading } from '../navigation/chrome'\nimport { getPodContext } from '../navigation/podContext'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState } from '../navigation/state'\n\nconst PROFILE_HEADING_TAG = 'solid-panes-profile-heading'\nconst PROFILE_HEADING_MOUNT_ID = 'profile-heading-mount'\n\nlet refreshRequest = 0\nlet navigatedListenerRegistered = false\nlet authListenersRegistered = false\nlet profileSavedListenerRegistered = false\nlet authReady: Promise<void> | undefined\nlet displayedPaneKey = ''\nlet displayedSubjectUri = ''\nlet loadingPaneKey = ''\nconst hideAnimations = new WeakMap<HTMLElement, Animation>()\nconst showAnimations = new WeakMap<HTMLElement, Animation>()\n\nfunction showHeading (mount: HTMLElement): void {\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') return\n\n const style = getComputedStyle(mount)\n const marginTop = style.marginTop || '18px'\n const marginBottom = style.marginBottom || '20px'\n const animation = mount.animate([\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' },\n {\n height: `${mount.getBoundingClientRect().height}px`,\n opacity: 1,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n }\n ], { duration: 300, easing: 'ease', fill: 'both' })\n showAnimations.set(mount, animation)\n const finish = () => {\n if (showAnimations.get(mount) !== animation) return\n showAnimations.delete(mount)\n animation.cancel()\n }\n animation.finished.then(finish, (error: unknown) => {\n if (showAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading appearance.', error)\n finish()\n })\n}\n\nfunction cancelHeadingHide (mount: HTMLElement): void {\n const animation = hideAnimations.get(mount)\n hideAnimations.delete(mount)\n animation?.cancel()\n mount.inert = false\n mount.removeAttribute('aria-hidden')\n}\n\nfunction hideHeading (mount: HTMLElement): void {\n if (hideAnimations.has(mount)) return\n\n const style = getComputedStyle(mount)\n const height = mount.getBoundingClientRect().height\n const opacity = style.opacity\n const marginTop = style.marginTop\n const marginBottom = style.marginBottom\n const showing = showAnimations.get(mount)\n showAnimations.delete(mount)\n showing?.cancel()\n\n const finish = () => {\n mount.hidden = true\n mount.replaceChildren()\n }\n mount.inert = true\n mount.setAttribute('aria-hidden', 'true')\n\n if (mount.hidden || !mount.firstElementChild ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') {\n finish()\n return\n }\n\n const animation = mount.animate([\n {\n height: `${height}px`,\n opacity,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n },\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' }\n ], { duration: 300, easing: 'ease', fill: 'forwards' })\n hideAnimations.set(mount, animation)\n animation.finished.then(() => {\n if (hideAnimations.get(mount) !== animation) return\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n }, (error: unknown) => {\n if (hideAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading disappearance.', error)\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n })\n}\n\nfunction refreshAfterAuthChange (): void {\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after an authentication change.', error)\n })\n}\n\nfunction ensureMountPoint (): HTMLElement | null {\n const mainContent = document.getElementById('MainContent')\n if (!mainContent) return null\n\n let mount = document.getElementById(PROFILE_HEADING_MOUNT_ID)\n if (!mount) {\n mount = document.createElement('div')\n mount.id = PROFILE_HEADING_MOUNT_ID\n mount.setAttribute('aria-label', 'Profile heading')\n }\n\n const navbar = document.querySelector('solid-panes-navbar')\n const outlineView = document.getElementById('OutlineView')\n const insertionPoint = navbar?.parentNode === mainContent\n ? navbar\n : outlineView?.parentNode === mainContent\n ? outlineView\n : null\n if (insertionPoint && mount.nextSibling !== insertionPoint) {\n mainContent.insertBefore(mount, insertionPoint)\n } else if (!insertionPoint && mount.parentNode !== mainContent) {\n mainContent.appendChild(mount)\n }\n return mount\n}\n\nexport async function refreshProfileHeading (force = false): Promise<void> {\n await authReady\n\n const pod = await getPodContext(window.location.href)\n const mount = ensureMountPoint()\n if (!mount) return\n\n if (force) {\n refreshRequest++\n displayedPaneKey = ''\n loadingPaneKey = ''\n }\n\n const { view, viaAccountMenu } = readNavigationState()\n const decision = deriveHeading({\n view,\n viaAccountMenu,\n viewer: authn.currentUser()?.value,\n pageUrl: window.location.href,\n owner: pod.owner,\n storageUris: pod.storagePanes.map(pane => pane.subject.value)\n })\n\n if (decision.mode === 'none') {\n refreshRequest++\n loadingPaneKey = ''\n displayedPaneKey = ''\n displayedSubjectUri = ''\n hideHeading(mount)\n return\n }\n\n const { subjectUri } = decision\n const isProfilePane = decision.mode === 'full'\n cancelHeadingHide(mount)\n const paneKey = `${decision.paneName}:${subjectUri}`\n if (paneKey === displayedPaneKey || paneKey === loadingPaneKey) return\n\n const request = ++refreshRequest\n loadingPaneKey = paneKey\n let subject: NamedNode\n let profileData: ProfileDetails\n let canEdit: boolean\n let viewerMode: ViewerMode\n try {\n subject = await loadProfileFromURI(store.sym(subjectUri))\n profileData = presentProfile(subject, store)\n viewerMode = isProfilePane ? await getViewerMode(subject) : 'anonymous'\n canEdit = viewerMode === 'owner'\n } catch (error) {\n if (request === refreshRequest) loadingPaneKey = ''\n throw error\n }\n if (request !== refreshRequest) return\n\n const heading = (mount.querySelector(PROFILE_HEADING_TAG) ||\n document.createElement(PROFILE_HEADING_TAG)) as HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n const viewer = authn.currentUser()\n heading.friendSubject = isProfilePane && viewer && !viewer.sameTerm(subject)\n ? subject\n : undefined\n heading.editContext = canEdit\n ? {\n subject,\n profileData,\n viewerMode,\n onSaved: () => refreshProfileHeading(true)\n }\n : undefined\n heading.compact = !isProfilePane\n const appearing = mount.hidden || !mount.firstElementChild\n mount.hidden = false\n if (heading.parentNode !== mount) mount.replaceChildren(heading)\n displayedPaneKey = paneKey\n displayedSubjectUri = subject.value\n loadingPaneKey = ''\n if (appearing) {\n await heading.updateComplete\n if (request === refreshRequest && mount.isConnected && !mount.hidden && !hideAnimations.has(mount)) {\n showHeading(mount)\n }\n }\n}\n\n/** Put the heading where it belongs, above the navbar, after the navbar has been added. */\nexport function placeProfileHeading (): void {\n ensureMountPoint()\n}\n\nexport function initializeProfileHeading (): void {\n ensureMountPoint()\n\n if (!profileSavedListenerRegistered) {\n document.addEventListener('profile-pane-saved', (event) => {\n if (!(event instanceof CustomEvent) || event.detail?.subjectUri !== displayedSubjectUri) return\n\n const heading = document.querySelector<HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n }>(`#${PROFILE_HEADING_MOUNT_ID} ${PROFILE_HEADING_TAG}`)\n if (heading && event.detail.profileData) {\n refreshRequest++\n loadingPaneKey = ''\n heading.profileData = event.detail.profileData\n if (heading.editContext) {\n heading.editContext = { ...heading.editContext, profileData: event.detail.profileData }\n }\n return\n }\n\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after saving profile information.', error)\n })\n })\n profileSavedListenerRegistered = true\n }\n\n const readiness = authReady ?? authn.checkUser().then(() => undefined)\n authReady = readiness\n\n if (!authListenersRegistered) {\n authSession.events.on('login', refreshAfterAuthChange)\n authSession.events.on('sessionRestore', refreshAfterAuthChange)\n authSession.events.on('logout', refreshAfterAuthChange)\n authSession.events.on('sessionChange', refreshAfterAuthChange)\n authSession.events.on('identityReplaced', refreshAfterAuthChange)\n authListenersRegistered = true\n }\n\n // Navigations the page's own navigation does not make, such as links and buttons in solid-ui\n if (!navigatedListenerRegistered) {\n onNavigated(() => {\n refreshProfileHeading().catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n })\n navigatedListenerRegistered = true\n }\n\n readiness.then(() => refreshProfileHeading(true)).catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n}\n"],"mappings":"A,gZAcA,IAAMe,EAAsB,8BACtBC,EAA2B,wBAE7BC,EAAiB,EACjBC,EAA8B,GAC9BC,EAA0B,GAC1BC,EAAiC,GACjCC,EACAC,EAAmB,GACnBC,EAAsB,GACtBC,EAAiB,GACfC,EAAiB,IAAI,QACrBC,EAAiB,IAAI,QAE3B,SAASC,EAAa,EAA0B,CAC9C,GAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,SACxD,OAAOC,EAAM,SAAY,WAAY,OAEzC,IAAMC,EAAQ,iBAAiBD,CAAK,EAC9BE,EAAYD,EAAM,WAAa,OAC/BE,EAAeF,EAAM,cAAgB,OACrCG,EAAYJ,EAAM,QAAQ,CAC9B,CAAE,OAAQ,MAAO,QAAS,EAAG,UAAW,MAAO,aAAc,MAAO,SAAU,QAAS,EACvF,CACE,OAAQ,GAAGA,EAAM,sBAAsB,CAAC,CAAC,OAAO,IAChD,QAAS,EACT,YACA,eACA,SAAU,QACZ,CACF,EAAG,CAAE,SAAU,IAAK,OAAQ,OAAQ,KAAM,MAAO,CAAC,EAClDF,EAAe,IAAIE,EAAOI,CAAS,EACnC,IAAMC,MAAe,CACfP,EAAe,IAAIE,CAAK,IAAMI,IAClCN,EAAe,OAAOE,CAAK,EAC3BI,EAAU,OAAO,EACnB,EACAA,EAAU,SAAS,KAAKC,EAAS,GAAmB,CAC9CP,EAAe,IAAIE,CAAK,IAAMI,IAClC,QAAQ,MAAM,gDAAiDE,CAAK,EACpED,EAAO,EACT,CAAC,CACH,CAEA,SAASE,EAAmB,EAA0B,CAC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BA,SAAS,iBAAiB,qBAAuB,GAAU,CACzD,GAAI,EAAE4C,aAAiB,cAAgBA,EAAM,QAAQ,aAAezC,EAAqB,OAEzF,IAAMoC,EAAU,SAAS,cAGtB,IAAI3C,EAAyB,GAAGD,GAAqB,EACpD4C,GAAWK,EAAM,OAAO,aAC1B,IACA,EAAiB,GACjB,EAAQ,YAAcA,EAAM,OAAO,YACnC,AACEL,EAAQ,cAAc,CAAE,GAAGA,EAAQ,YAAa,YAAaK,EAAM,OAAO,WAAY,GAK1FvB,EAAsB,EAAI,CAAC,CAAC,MAAO,GAAmB,CACpD,QAAQ,MAAM,sEAAuEP,CAAK,CAC5F,CAAC,CACH,CAAC,EACgC,IAGnC,IAAM+B,EAAY5C,GAAalB,EAAAA,MAAM,UAAU,CAAC,CAAC,SAAW,IAAA,EAAS,EACrE,EAAY8D,EAEZ,AAME9C,KALAL,EAAA,YAAY,OAAO,GAAG,QAAS0B,CAAsB,EACrD1B,EAAA,YAAY,OAAO,GAAG,iBAAkB0B,CAAsB,EAC9D1B,EAAA,YAAY,OAAO,GAAG,SAAU0B,CAAsB,EACtD1B,EAAA,YAAY,OAAO,GAAG,gBAAiB0B,CAAsB,EAC7D1B,EAAA,YAAY,OAAO,GAAG,mBAAoB0B,CAAsB,EACtC,IAI5B,AAMEtB,KALAN,EAAA,gBAAkB,CAChB6B,EAAsB,CAAC,CAAC,MAAO,GAAmB,CAChD,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,CACH,CAAC,EAC6B,IAGhC+B,EAAU,SAAWxB,EAAsB,EAAI,CAAC,CAAC,CAAC,MAAO,GAAmB,CAC1E,QAAQ,MAAM,qCAAsCP,CAAK,CAC3D,CAAC,CACH,C"}
1
+ {"version":3,"file":"profileHeading2.cjs.js","names":["getPodContext","readNavigationState","deriveHeading","authn","loadProfileFromURI","store","presentProfile","getViewerMode","offersFriendAction","require_webIdUtils","require_chrome","require_podContext","require_state","require_events","require_profileHeadingData","solid_logic","PROFILE_HEADING_TAG","PROFILE_HEADING_MOUNT_ID","refreshRequest","navigatedListenerRegistered","authListenersRegistered","profileSavedListenerRegistered","authReady","displayedPaneKey","displayedSubjectUri","loadingPaneKey","headingPageUrl","hideAnimations","showAnimations","showHeading","mount","style","marginTop","marginBottom","animation","finish","error","cancelHeadingHide","hideHeading","height","opacity","showing","refreshAfterAuthChange","refreshProfileHeading","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","pageUrl","pod","force","decision","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","getPageUrl","event","readiness"],"sources":["../../src/mainPage/profileHeading.ts"],"sourcesContent":["import { authn, authSession, store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport type { ProfileDetails } from '../components/profile-heading/editor/sections/heading/types'\nimport type { ProfileHeadingEditContext } from '../components/profile-heading/ProfileHeading'\nimport { getViewerMode, presentProfile } from '../components/profile-heading/profileHeadingData'\nimport type { ViewerMode } from '../types'\nimport { loadProfileFromURI } from '../utils/webIdUtils'\nimport '../components/profile-heading'\nimport './profileHeading.css'\nimport { deriveHeading, offersFriendAction } from '../navigation/chrome'\nimport { getPodContext } from '../navigation/podContext'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState } from '../navigation/state'\n\nconst PROFILE_HEADING_TAG = 'solid-panes-profile-heading'\nconst PROFILE_HEADING_MOUNT_ID = 'profile-heading-mount'\n\nlet refreshRequest = 0\nlet navigatedListenerRegistered = false\nlet authListenersRegistered = false\nlet profileSavedListenerRegistered = false\nlet authReady: Promise<void> | undefined\nlet displayedPaneKey = ''\nlet displayedSubjectUri = ''\nlet loadingPaneKey = ''\nlet headingPageUrl = () => window.location.href\nconst hideAnimations = new WeakMap<HTMLElement, Animation>()\nconst showAnimations = new WeakMap<HTMLElement, Animation>()\n\nfunction showHeading (mount: HTMLElement): void {\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') return\n\n const style = getComputedStyle(mount)\n const marginTop = style.marginTop || '18px'\n const marginBottom = style.marginBottom || '20px'\n const animation = mount.animate([\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' },\n {\n height: `${mount.getBoundingClientRect().height}px`,\n opacity: 1,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n }\n ], { duration: 300, easing: 'ease', fill: 'both' })\n showAnimations.set(mount, animation)\n const finish = () => {\n if (showAnimations.get(mount) !== animation) return\n showAnimations.delete(mount)\n animation.cancel()\n }\n animation.finished.then(finish, (error: unknown) => {\n if (showAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading appearance.', error)\n finish()\n })\n}\n\nfunction cancelHeadingHide (mount: HTMLElement): void {\n const animation = hideAnimations.get(mount)\n hideAnimations.delete(mount)\n animation?.cancel()\n mount.inert = false\n mount.removeAttribute('aria-hidden')\n}\n\nfunction hideHeading (mount: HTMLElement): void {\n if (hideAnimations.has(mount)) return\n\n const style = getComputedStyle(mount)\n const height = mount.getBoundingClientRect().height\n const opacity = style.opacity\n const marginTop = style.marginTop\n const marginBottom = style.marginBottom\n const showing = showAnimations.get(mount)\n showAnimations.delete(mount)\n showing?.cancel()\n\n const finish = () => {\n mount.hidden = true\n mount.replaceChildren()\n }\n mount.inert = true\n mount.setAttribute('aria-hidden', 'true')\n\n if (mount.hidden || !mount.firstElementChild ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') {\n finish()\n return\n }\n\n const animation = mount.animate([\n {\n height: `${height}px`,\n opacity,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n },\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' }\n ], { duration: 300, easing: 'ease', fill: 'forwards' })\n hideAnimations.set(mount, animation)\n animation.finished.then(() => {\n if (hideAnimations.get(mount) !== animation) return\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n }, (error: unknown) => {\n if (hideAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading disappearance.', error)\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n })\n}\n\nfunction refreshAfterAuthChange (): void {\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after an authentication change.', error)\n })\n}\n\nfunction ensureMountPoint (): HTMLElement | null {\n const mainContent = document.getElementById('MainContent')\n if (!mainContent) return null\n\n let mount = document.getElementById(PROFILE_HEADING_MOUNT_ID)\n if (!mount) {\n mount = document.createElement('div')\n mount.id = PROFILE_HEADING_MOUNT_ID\n mount.setAttribute('aria-label', 'Profile heading')\n }\n\n const navbar = document.querySelector('solid-panes-navbar')\n const outlineView = document.getElementById('OutlineView')\n const insertionPoint = navbar?.parentNode === mainContent\n ? navbar\n : outlineView?.parentNode === mainContent\n ? outlineView\n : null\n if (insertionPoint && mount.nextSibling !== insertionPoint) {\n mainContent.insertBefore(mount, insertionPoint)\n } else if (!insertionPoint && mount.parentNode !== mainContent) {\n mainContent.appendChild(mount)\n }\n return mount\n}\n\nexport async function refreshProfileHeading (force = false): Promise<void> {\n await authReady\n\n const pageUrl = headingPageUrl()\n const pod = await getPodContext(pageUrl)\n const mount = ensureMountPoint()\n if (!mount) return\n\n if (force) {\n refreshRequest++\n displayedPaneKey = ''\n loadingPaneKey = ''\n }\n\n const { view, viaAccountMenu } = readNavigationState()\n const decision = deriveHeading({\n view,\n viaAccountMenu,\n viewer: authn.currentUser()?.value,\n pageUrl,\n owner: pod.owner,\n storageUris: pod.storagePanes.map(pane => pane.subject.value)\n })\n\n if (decision.mode === 'none') {\n refreshRequest++\n loadingPaneKey = ''\n displayedPaneKey = ''\n displayedSubjectUri = ''\n hideHeading(mount)\n return\n }\n\n const { subjectUri } = decision\n const isProfilePane = decision.mode === 'full'\n cancelHeadingHide(mount)\n const paneKey = `${decision.paneName}:${subjectUri}`\n if (paneKey === displayedPaneKey || paneKey === loadingPaneKey) return\n\n const request = ++refreshRequest\n loadingPaneKey = paneKey\n let subject: NamedNode\n let profileData: ProfileDetails\n let canEdit: boolean\n let viewerMode: ViewerMode\n try {\n subject = await loadProfileFromURI(store.sym(subjectUri))\n profileData = presentProfile(subject, store)\n viewerMode = isProfilePane ? await getViewerMode(subject) : 'anonymous'\n canEdit = viewerMode === 'owner'\n } catch (error) {\n if (request === refreshRequest) loadingPaneKey = ''\n throw error\n }\n if (request !== refreshRequest) return\n\n const heading = (mount.querySelector(PROFILE_HEADING_TAG) ||\n document.createElement(PROFILE_HEADING_TAG)) as HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n const viewer = authn.currentUser()\n heading.friendSubject = offersFriendAction(decision.paneName) && viewer && !viewer.sameTerm(subject)\n ? subject\n : undefined\n heading.editContext = canEdit\n ? {\n subject,\n profileData,\n viewerMode,\n onSaved: () => refreshProfileHeading(true)\n }\n : undefined\n heading.compact = !isProfilePane\n const appearing = mount.hidden || !mount.firstElementChild\n mount.hidden = false\n if (heading.parentNode !== mount) mount.replaceChildren(heading)\n displayedPaneKey = paneKey\n displayedSubjectUri = subject.value\n loadingPaneKey = ''\n if (appearing) {\n await heading.updateComplete\n if (request === refreshRequest && mount.isConnected && !mount.hidden && !hideAnimations.has(mount)) {\n showHeading(mount)\n }\n }\n}\n\n/** Put the heading where it belongs, above the navbar, after the navbar has been added. */\nexport function placeProfileHeading (): void {\n ensureMountPoint()\n}\n\n/** Shells browsing another resource can supply its current URL instead of the page URL. */\nexport function initializeProfileHeading (getPageUrl = () => window.location.href): Promise<void> {\n headingPageUrl = getPageUrl\n ensureMountPoint()\n\n if (!profileSavedListenerRegistered) {\n document.addEventListener('profile-pane-saved', (event) => {\n if (!(event instanceof CustomEvent) || event.detail?.subjectUri !== displayedSubjectUri) return\n\n const heading = document.querySelector<HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n }>(`#${PROFILE_HEADING_MOUNT_ID} ${PROFILE_HEADING_TAG}`)\n if (heading && event.detail.profileData) {\n refreshRequest++\n loadingPaneKey = ''\n heading.profileData = event.detail.profileData\n if (heading.editContext) {\n heading.editContext = { ...heading.editContext, profileData: event.detail.profileData }\n }\n return\n }\n\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after saving profile information.', error)\n })\n })\n profileSavedListenerRegistered = true\n }\n\n const readiness = authReady ?? authn.checkUser().then(() => undefined)\n authReady = readiness\n\n if (!authListenersRegistered) {\n authSession.events.on('login', refreshAfterAuthChange)\n authSession.events.on('sessionRestore', refreshAfterAuthChange)\n authSession.events.on('logout', refreshAfterAuthChange)\n authSession.events.on('sessionChange', refreshAfterAuthChange)\n authSession.events.on('identityReplaced', refreshAfterAuthChange)\n authListenersRegistered = true\n }\n\n // Navigations the page's own navigation does not make, such as links and buttons in solid-ui\n if (!navigatedListenerRegistered) {\n onNavigated(() => {\n refreshProfileHeading().catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n })\n navigatedListenerRegistered = true\n }\n\n readiness.then(() => refreshProfileHeading(true)).catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n return readiness\n}\n"],"mappings":"A,gZAcA,IAAMgB,EAAsB,8BACtBC,EAA2B,wBAE7BC,EAAiB,EACjBC,EAA8B,GAC9BC,EAA0B,GAC1BC,EAAiC,GACjCC,EACAC,EAAmB,GACnBC,EAAsB,GACtBC,EAAiB,GACjBC,MAAuB,OAAO,SAAS,KACrCC,EAAiB,IAAI,QACrBC,EAAiB,IAAI,QAE3B,SAASC,EAAa,EAA0B,CAC9C,GAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,SACxD,OAAOC,EAAM,SAAY,WAAY,OAEzC,IAAMC,EAAQ,iBAAiBD,CAAK,EAC9BE,EAAYD,EAAM,WAAa,OAC/BE,EAAeF,EAAM,cAAgB,OACrCG,EAAYJ,EAAM,QAAQ,CAC9B,CAAE,OAAQ,M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AA,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
1
  (function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`#profile-heading-mount{margin-top:18px;margin-bottom:20px}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { loadProfileFromURI as e } from "../utils/webIdUtils.esm.js";
2
- import { deriveHeading as t } from "../navigation/chrome.esm.js";
3
- import { getPodContext as n } from "../navigation/podContext.esm.js";
4
- import { readNavigationState as r } from "../navigation/state.esm.js";
5
- import { onNavigated as i } from "../navigation/events.esm.js";
6
- import { getViewerMode as a, presentProfile as o } from "../components/profile-heading/profileHeadingData.esm.js";
2
+ import { deriveHeading as t, offersFriendAction as n } from "../navigation/chrome.esm.js";
3
+ import { getPodContext as r } from "../navigation/podContext.esm.js";
4
+ import { readNavigationState as i } from "../navigation/state.esm.js";
5
+ import { onNavigated as a } from "../navigation/events.esm.js";
6
+ import { getViewerMode as o, presentProfile as s } from "../components/profile-heading/profileHeadingData.esm.js";
7
7
  import "../components/profile-heading/index.esm.js";
8
8
 
9
- import { authSession as s, authn as c, store as l } from "solid-logic";
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(a = !1) {
91
+ await _;
92
+ let c = x(), f = await r(c), m = O();
93
+ if (!m) return;
94
+ a && (p++, v = "", b = "");
95
+ let { view: h, viaAccountMenu: g } = i(), C = t({
96
+ view: h,
97
+ viaAccountMenu: g,
98
+ viewer: l.currentUser()?.value,
99
+ pageUrl: c,
100
+ owner: f.owner,
101
+ storageUris: f.storagePanes.map((e) => e.subject.value)
102
102
  });
103
- if (h.mode === "none") {
104
- f++, y = "", _ = "", v = "", w(d);
103
+ if (C.mode === "none") {
104
+ p++, b = "", v = "", y = "", E(m);
105
105
  return;
106
106
  }
107
- let { subjectUri: x } = h, T = h.mode === "full";
108
- C(d);
109
- let O = `${h.paneName}:${x}`;
110
- if (O === _ || O === y) return;
111
- let k = ++f;
112
- y = O;
113
- let A, j, M, N;
107
+ let { subjectUri: D } = C, A = C.mode === "full";
108
+ T(m);
109
+ let j = `${C.paneName}:${D}`;
110
+ if (j === v || j === b) return;
111
+ let M = ++p;
112
+ b = j;
113
+ let N, P, F, I;
114
114
  try {
115
- A = await e(l.sym(x)), j = o(A, l), N = T ? await a(A) : "anonymous", M = N === "owner";
115
+ N = await e(u.sym(D)), P = s(N, u), I = A ? await o(N) : "anonymous", F = I === "owner";
116
116
  } catch (e) {
117
- throw k === f && (y = ""), e;
117
+ throw M === p && (b = ""), e;
118
118
  }
119
- if (k !== f) return;
120
- let P = d.querySelector(u) || document.createElement(u);
121
- P.profileData = j;
122
- let F = c.currentUser();
123
- P.friendSubject = T && F && !F.sameTerm(A) ? A : void 0, P.editContext = M ? {
124
- subject: A,
125
- profileData: j,
126
- viewerMode: N,
127
- onSaved: () => D(!0)
128
- } : void 0, P.compact = !T;
129
- let I = d.hidden || !d.firstElementChild;
130
- d.hidden = !1, P.parentNode !== d && d.replaceChildren(P), _ = O, v = A.value, y = "", I && (await P.updateComplete, k === f && d.isConnected && !d.hidden && !b.has(d) && S(d));
119
+ if (M !== p) return;
120
+ let L = m.querySelector(d) || document.createElement(d);
121
+ L.profileData = P;
122
+ let R = l.currentUser();
123
+ L.friendSubject = n(C.paneName) && R && !R.sameTerm(N) ? N : void 0, L.editContext = F ? {
124
+ subject: N,
125
+ profileData: P,
126
+ viewerMode: I,
127
+ onSaved: () => k(!0)
128
+ } : void 0, L.compact = !A;
129
+ let z = m.hidden || !m.firstElementChild;
130
+ m.hidden = !1, L.parentNode !== m && m.replaceChildren(L), v = j, y = N.value, b = "", z && (await L.updateComplete, M === p && m.isConnected && !m.hidden && !S.has(m) && w(m));
131
131
  }
132
- function O() {
133
- E();
132
+ function A() {
133
+ O();
134
134
  }
135
- function k() {
136
- E(), h ||= (document.addEventListener("profile-pane-saved", (e) => {
137
- if (!(e instanceof CustomEvent) || e.detail?.subjectUri !== v) return;
138
- let t = document.querySelector(`#${d} ${u}`);
139
- t && e.detail.profileData ? (f++, y = "", t.profileData = e.detail.profileData, t.editContext &&= {
135
+ function j(e = () => window.location.href) {
136
+ x = e, O(), g ||= (document.addEventListener("profile-pane-saved", (e) => {
137
+ if (!(e instanceof CustomEvent) || e.detail?.subjectUri !== y) return;
138
+ let t = document.querySelector(`#${f} ${d}`);
139
+ t && e.detail.profileData ? (p++, b = "", t.profileData = e.detail.profileData, t.editContext &&= {
140
140
  ...t.editContext,
141
141
  profileData: e.detail.profileData
142
- }) : D(!0).catch((e) => {
142
+ }) : k(!0).catch((e) => {
143
143
  console.error("Failed to refresh profile heading after saving profile information.", e);
144
144
  });
145
145
  }), !0);
146
- let e = g ?? c.checkUser().then(() => void 0);
147
- g = e, m ||= (s.events.on("login", T), s.events.on("sessionRestore", T), s.events.on("logout", T), s.events.on("sessionChange", T), s.events.on("identityReplaced", T), !0), p ||= (i(() => {
148
- D().catch((e) => {
146
+ let t = _ ?? l.checkUser().then(() => void 0);
147
+ return _ = t, h ||= (c.events.on("login", D), c.events.on("sessionRestore", D), c.events.on("logout", D), c.events.on("sessionChange", D), c.events.on("identityReplaced", D), !0), m ||= (a(() => {
148
+ k().catch((e) => {
149
149
  console.error("Failed to refresh profile heading.", e);
150
150
  });
151
- }), !0), e.then(() => D(!0)).catch((e) => {
151
+ }), !0), t.then(() => k(!0)).catch((e) => {
152
152
  console.error("Failed to refresh profile heading.", e);
153
- });
153
+ }), t;
154
154
  }
155
- 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