solid-panes 5.0.0 → 5.1.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -2
- package/dist/RDFXMLPane2.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/cake.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/cake.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/cake.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/cake.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/camera.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/camera.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/camera.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/camera.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/mail.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/mail.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/mail.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/mail.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/map-pin.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/map-pin.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/map-pin.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/map-pin.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/phone.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/phone.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/phone.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/phone.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/x.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/x.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/x.esm.js.map +1 -0
- package/dist/audio/audioPane.cjs.js +1 -1
- package/dist/audio/audioPane.cjs.js.map +1 -1
- package/dist/audio/audioPane.esm.js +1 -5
- package/dist/audio/audioPane.esm.js.map +1 -1
- package/dist/classInstancePane.cjs.js.map +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
- package/dist/components/editor-card/EditorCard.esm.js +4 -7
- package/dist/components/editor-card/EditorCard.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +5 -5
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +97 -96
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -1
- package/dist/components/header/Header.cjs.js +1 -1
- package/dist/components/header/Header.cjs.js.map +1 -1
- package/dist/components/header/Header.esm.js +2 -2
- package/dist/components/header/Header.styles.cjs.js +1 -1
- package/dist/components/header/Header.styles.cjs.js.map +1 -1
- package/dist/components/header/Header.styles.esm.js +1 -1
- package/dist/components/header/Header.styles.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.cjs.js +1 -1
- package/dist/components/navbar/Navbar.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.d.ts +2 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -1
- package/dist/components/navbar/Navbar.esm.js +2 -2
- package/dist/components/navbar/Navbar.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.cjs.js +1 -1
- package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.esm.js +1 -1
- package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.cjs.js +95 -0
- package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.d.ts +45 -0
- package/dist/components/profile-heading/ProfileHeading.d.ts.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.esm.js +480 -0
- package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +2 -0
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -0
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js +7 -0
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/index.d.ts +3 -0
- package/dist/components/profile-heading/editor/index.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts +44 -0
- package/dist/components/profile-heading/editor/sections/contactInfo/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +297 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +642 -0
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts +4 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +16 -0
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +76 -0
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js +19 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts +2 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +28 -0
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts +4 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +151 -0
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/heading/types.d.ts +34 -0
- package/dist/components/profile-heading/editor/sections/heading/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts +7 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +20 -0
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts +3 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +11 -0
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts +20 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +1291 -0
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts +45 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +211 -0
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts +21 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +18 -0
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts +5 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +18 -0
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/sections/shared/types.d.ts +31 -0
- package/dist/components/profile-heading/editor/sections/shared/types.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.cjs.js +2 -0
- package/dist/components/profile-heading/editor/textUtils.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.d.ts +6 -0
- package/dist/components/profile-heading/editor/textUtils.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/textUtils.esm.js +26 -0
- package/dist/components/profile-heading/editor/textUtils.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts +9 -0
- package/dist/components/profile-heading/editor/texts/buttonTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js +2 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts +14 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +6 -0
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js +2 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.d.ts +42 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +6 -0
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/texts/profileTexts.d.ts +14 -0
- package/dist/components/profile-heading/editor/texts/profileTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts +2 -0
- package/dist/components/profile-heading/editor/texts/qrCodeTexts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/texts.d.ts +6 -0
- package/dist/components/profile-heading/editor/texts.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog.d.ts +41 -0
- package/dist/components/profile-heading/editor/ui/dialog.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +17 -0
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js +263 -0
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.cjs.js +5 -0
- package/dist/components/profile-heading/editor/ui/spinner.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.d.ts +3 -0
- package/dist/components/profile-heading/editor/ui/spinner.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/ui/spinner.esm.js +12 -0
- package/dist/components/profile-heading/editor/ui/spinner.esm.js.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js +2 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.cjs.js.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts +2 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.d.ts.map +1 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +18 -0
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js.map +1 -0
- package/dist/components/profile-heading/friendActions.cjs.js +2 -0
- package/dist/components/profile-heading/friendActions.cjs.js.map +1 -0
- package/dist/components/profile-heading/friendActions.d.ts +11 -0
- package/dist/components/profile-heading/friendActions.d.ts.map +1 -0
- package/dist/components/profile-heading/friendActions.esm.js +32 -0
- package/dist/components/profile-heading/friendActions.esm.js.map +1 -0
- package/dist/components/profile-heading/index.cjs.js +1 -0
- package/dist/components/profile-heading/index.d.ts +5 -0
- package/dist/components/profile-heading/index.d.ts.map +1 -0
- package/dist/components/profile-heading/index.esm.js +1 -0
- package/dist/components/profile-heading/profileHeadingData.cjs.js +2 -0
- package/dist/components/profile-heading/profileHeadingData.cjs.js.map +1 -0
- package/dist/components/profile-heading/profileHeadingData.d.ts +6 -0
- package/dist/components/profile-heading/profileHeadingData.d.ts.map +1 -0
- package/dist/components/profile-heading/profileHeadingData.esm.js +81 -0
- package/dist/components/profile-heading/profileHeadingData.esm.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +2 -2
- package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
- package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
- package/dist/dashboard/homepage.cjs.js.map +1 -1
- package/dist/dataContentPane2.cjs.js.map +1 -1
- package/dist/defaultPane2.cjs.js.map +1 -1
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
- package/dist/form/pane.cjs.js.map +1 -1
- package/dist/home/homePane.cjs.js.map +1 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/icons/folder.cjs.js.map +1 -1
- package/dist/icons/friends.cjs.js.map +1 -1
- package/dist/icons/person.cjs.js.map +1 -1
- package/dist/imagePane2.cjs.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +15 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/internal/internalPane2.cjs.js +1 -1
- package/dist/internal/internalPane2.cjs.js.map +1 -1
- package/dist/internal/internalPane2.esm.js +2 -5
- package/dist/internal/internalPane2.esm.js.map +1 -1
- package/dist/mainPage/header.cjs.js +1 -1
- package/dist/mainPage/header.cjs.js.map +1 -1
- package/dist/mainPage/header.d.ts +2 -2
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.esm.js +48 -44
- package/dist/mainPage/header.esm.js.map +1 -1
- package/dist/mainPage/index.cjs.js +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +27 -21
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.cjs.js +1 -1
- package/dist/mainPage/navbar.cjs.js.map +1 -1
- package/dist/mainPage/navbar.d.ts +3 -2
- package/dist/mainPage/navbar.d.ts.map +1 -1
- package/dist/mainPage/navbar.esm.js +77 -42
- package/dist/mainPage/navbar.esm.js.map +1 -1
- package/dist/mainPage/navigation.cjs.js +2 -0
- package/dist/mainPage/navigation.cjs.js.map +1 -0
- package/dist/mainPage/navigation.d.ts +6 -0
- package/dist/mainPage/navigation.d.ts.map +1 -0
- package/dist/mainPage/navigation.esm.js +22 -0
- package/dist/mainPage/navigation.esm.js.map +1 -0
- package/dist/mainPage/profileHeading.d.ts +5 -0
- package/dist/mainPage/profileHeading.d.ts.map +1 -0
- package/dist/mainPage/profileHeading2.cjs.js +2 -0
- package/dist/mainPage/profileHeading2.cjs.js.map +1 -0
- package/dist/mainPage/profileHeading2.esm.js +158 -0
- package/dist/mainPage/profileHeading2.esm.js.map +1 -0
- package/dist/n3Pane2.cjs.js.map +1 -1
- package/dist/navigation/browserEvents.cjs.js +2 -0
- package/dist/navigation/browserEvents.cjs.js.map +1 -0
- package/dist/navigation/browserEvents.d.ts +15 -0
- package/dist/navigation/browserEvents.d.ts.map +1 -0
- package/dist/navigation/browserEvents.esm.js +32 -0
- package/dist/navigation/browserEvents.esm.js.map +1 -0
- package/dist/navigation/chrome.cjs.js +2 -0
- package/dist/navigation/chrome.cjs.js.map +1 -0
- package/dist/navigation/chrome.d.ts +69 -0
- package/dist/navigation/chrome.d.ts.map +1 -0
- package/dist/navigation/chrome.esm.js +43 -0
- package/dist/navigation/chrome.esm.js.map +1 -0
- package/dist/navigation/controller.cjs.js +2 -0
- package/dist/navigation/controller.cjs.js.map +1 -0
- package/dist/navigation/controller.d.ts +51 -0
- package/dist/navigation/controller.d.ts.map +1 -0
- package/dist/navigation/controller.esm.js +45 -0
- package/dist/navigation/controller.esm.js.map +1 -0
- package/dist/navigation/events.cjs.js +2 -0
- package/dist/navigation/events.cjs.js.map +1 -0
- package/dist/navigation/events.d.ts +17 -0
- package/dist/navigation/events.d.ts.map +1 -0
- package/dist/navigation/events.esm.js +18 -0
- package/dist/navigation/events.esm.js.map +1 -0
- package/dist/navigation/navbarVisibility.cjs.js +2 -0
- package/dist/navigation/navbarVisibility.cjs.js.map +1 -0
- package/dist/navigation/navbarVisibility.d.ts +5 -0
- package/dist/navigation/navbarVisibility.d.ts.map +1 -0
- package/dist/navigation/navbarVisibility.esm.js +26 -0
- package/dist/navigation/navbarVisibility.esm.js.map +1 -0
- package/dist/navigation/options.cjs.js +2 -0
- package/dist/navigation/options.cjs.js.map +1 -0
- package/dist/navigation/options.d.ts +16 -0
- package/dist/navigation/options.d.ts.map +1 -0
- package/dist/navigation/options.esm.js +8 -0
- package/dist/navigation/options.esm.js.map +1 -0
- package/dist/navigation/podContext.cjs.js +2 -0
- package/dist/navigation/podContext.cjs.js.map +1 -0
- package/dist/navigation/podContext.d.ts +21 -0
- package/dist/navigation/podContext.d.ts.map +1 -0
- package/dist/navigation/podContext.esm.js +62 -0
- package/dist/navigation/podContext.esm.js.map +1 -0
- package/dist/navigation/state.cjs.js +2 -0
- package/dist/navigation/state.cjs.js.map +1 -0
- package/dist/navigation/state.d.ts +40 -0
- package/dist/navigation/state.d.ts.map +1 -0
- package/dist/navigation/state.esm.js +41 -0
- package/dist/navigation/state.esm.js.map +1 -0
- package/dist/outline/context.cjs.js.map +1 -1
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +387 -353
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/outlineIcons.cjs.js.map +1 -1
- package/dist/outline/propertyViews.cjs.js.map +1 -1
- package/dist/outline/queryByExample.cjs.js.map +1 -1
- package/dist/outline/userInput.cjs.js +1 -1
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +12 -13
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/outline/viewAsImage.cjs.js.map +1 -1
- package/dist/outline/viewAsMbox.cjs.js.map +1 -1
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.cjs.js.map +1 -1
- package/dist/pad/padPane2.esm.js +2 -6
- package/dist/pad/padPane2.esm.js.map +1 -1
- package/dist/playlist/playlistPane.cjs.js.map +1 -1
- package/dist/registerPanes.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.cjs.js +1 -1
- package/dist/schedule/schedulePane2.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.esm.js +1 -5
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/sharing/sharingPane.cjs.js.map +1 -1
- package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
- package/dist/social/editProfileDetails.cjs.js +1 -1
- package/dist/social/editProfileDetails.cjs.js.map +1 -1
- package/dist/social/editProfileDetails.esm.js +0 -2
- package/dist/social/editProfileDetails.esm.js.map +1 -1
- package/dist/social/icons.cjs.js +4 -4
- package/dist/social/icons.cjs.js.map +1 -1
- package/dist/social/icons.esm.js +5 -5
- package/dist/social/icons.esm.js.map +1 -1
- package/dist/social/socialPane.d.ts +0 -1
- package/dist/social/socialPane.d.ts.map +1 -1
- package/dist/social/socialPane2.cjs.js +3 -3
- package/dist/social/socialPane2.cjs.js.map +1 -1
- package/dist/social/socialPane2.esm.js +97 -154
- package/dist/social/socialPane2.esm.js.map +1 -1
- package/dist/social/socialSections.cjs.js +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/social/socialSections.d.ts +2 -2
- package/dist/social/socialSections.d.ts.map +1 -1
- package/dist/social/socialSections.esm.js +62 -139
- package/dist/social/socialSections.esm.js.map +1 -1
- package/dist/social/triage.cjs.js.map +1 -1
- package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
- package/dist/tableViewPane.cjs.js.map +1 -1
- package/dist/transaction/pane.cjs.js.map +1 -1
- package/dist/transaction/pane.esm.js +1 -1
- package/dist/transaction/pane.esm.js.map +1 -1
- package/dist/transaction/period.cjs.js.map +1 -1
- package/dist/trip/tripPane.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/pane.cjs.js +1 -1
- package/dist/ui/pane.cjs.js.map +1 -1
- package/dist/ui/pane.esm.js +2 -5
- package/dist/ui/pane.esm.js.map +1 -1
- package/dist/utils/paneUtils.cjs.js +1 -1
- package/dist/utils/paneUtils.cjs.js.map +1 -1
- package/dist/utils/paneUtils.esm.js +4 -4
- package/dist/utils/paneUtils.esm.js.map +1 -1
- package/dist/utils/podUtils.cjs.js.map +1 -1
- package/dist/utils/viewerUtils.cjs.js +2 -0
- package/dist/utils/viewerUtils.cjs.js.map +1 -0
- package/dist/utils/viewerUtils.d.ts +5 -0
- package/dist/utils/viewerUtils.d.ts.map +1 -0
- package/dist/utils/viewerUtils.esm.js +13 -0
- package/dist/utils/viewerUtils.esm.js.map +1 -0
- package/dist/utils/webIdUtils.cjs.js +1 -1
- package/dist/utils/webIdUtils.cjs.js.map +1 -1
- package/dist/utils/webIdUtils.d.ts +1 -0
- package/dist/utils/webIdUtils.d.ts.map +1 -1
- package/dist/utils/webIdUtils.esm.js +23 -19
- package/dist/utils/webIdUtils.esm.js.map +1 -1
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +11 -11
- package/dist/versionInfo.esm.js.map +1 -1
- package/dist/video/videoPane.cjs.js.map +1 -1
- package/package.json +7 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.esm.js","names":["showNavbar","
|
|
1
|
+
{"version":3,"file":"navbar.esm.js","names":["showNavbar","refreshNavbarVisibility","readNavigationState","selectPaneInNavbar","selectNavbarPane","paneName","paneUri","createNavItem","onSelected","createNavbarMenuItems","selection","deriveNavbarSelection","view","isWebIdUri","store","menuItems","context","owner","navigation","isNavbarItemSelected","pane","createNavbar","existingNavbar","mainContent","tmpContainer","podContext","getPodContext","setSelectedItem","menuItem","selectedItem","handleSelectionChanged","event","error","renderNavbar","item","pickNavbarItem","navbar","rebuildRequest","stopListening","onNavigated","url","state","request","isSamePod","next","selectedItems","index"],"sources":["../../src/mainPage/navbar.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { html, render } from 'lit-html'\nimport type { NavigationController } from '../navigation/controller'\nimport { isWebIdUri } from '../utils/webIdUtils'\nimport { deriveNavbarSelection, isNavbarItemSelected, pickNavbarItem } from '../navigation/chrome'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState, type NavigationView } from '../navigation/state'\nimport { getPodContext, isSamePod, type PodContext } from '../navigation/podContext'\nimport { refreshNavbarVisibility } from '../navigation/navbarVisibility'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '../components/navbar'\n\nimport type { NavbarMenuItem } from '../components/navbar/Navbar'\n\nfunction showNavbar () {\n return refreshNavbarVisibility(window.location.href, readNavigationState().viaAccountMenu)\n}\n\nlet selectPaneInNavbar: ((paneName: string, paneUri?: string) => void) | undefined\n\nexport function selectNavbarPane (paneName: string, paneUri?: string): void {\n selectPaneInNavbar?.(paneName, paneUri)\n}\n\nfunction createNavItem (\n label: string,\n paneName: string,\n paneUri: string,\n onSelected: () => void,\n selected = false\n): NavbarMenuItem {\n return {\n label,\n paneName,\n paneUri,\n async onSelected () {\n await showNavbar()\n return onSelected()\n },\n selected\n }\n}\n\n// The items offered for the pod the page is in. Choosing one displays that pane while the\n// page URL stays as it is.\nfunction createNavbarMenuItems (\n context: PodContext,\n navigation: NavigationController,\n view: NavigationView\n): NavbarMenuItem[] {\n const selection = deriveNavbarSelection(view, isWebIdUri(store.sym(window.location.href)))\n\n const menuItems: NavbarMenuItem[] = []\n\n if (context.owner) {\n const owner = context.owner\n menuItems.push(\n createNavItem('Profile', 'profile', owner, () => navigation.show({ kind: 'profile', subject: owner }),\n isNavbarItemSelected({ paneName: 'profile' }, selection, 0)),\n createNavItem('Friends', 'social', owner, () => navigation.show({ kind: 'friends', subject: owner }),\n isNavbarItemSelected({ paneName: 'social' }, selection, 0))\n )\n }\n\n context.storagePanes.forEach(pane => {\n menuItems.push(\n createNavItem(\n pane.label(),\n pane.paneName,\n pane.subject.value,\n () => navigation.show({ kind: 'storage', pane }),\n isNavbarItemSelected(\n { paneName: pane.paneName, paneUri: pane.subject.value },\n selection,\n context.storagePanes.length\n )\n )\n )\n })\n\n return menuItems\n}\n\nexport async function createNavbar (navigation: NavigationController) {\n const existingNavbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n\n if (existingNavbar) {\n await showNavbar()\n return existingNavbar\n }\n\n const mainContent = document.getElementById('MainContent')\n const tmpContainer = document.createElement('div')\n let podContext = await getPodContext(window.location.href)\n let menuItems = createNavbarMenuItems(podContext, navigation, readNavigationState().view)\n\n function setSelectedItem (selectedItem: NavbarMenuItem) {\n menuItems = menuItems.map((menuItem) => ({\n ...menuItem,\n selected: menuItem === selectedItem\n }))\n }\n\n function handleSelectionChanged (event: Event) {\n const { detail: selectedItem } = event as CustomEvent<NavbarMenuItem>\n setSelectedItem(selectedItem)\n\n Promise.resolve(selectedItem.onSelected?.()).catch((error) => {\n console.error('Navbar menu item selection failed:', error)\n })\n\n renderNavbar()\n }\n\n function renderNavbar () {\n render(\n html`<solid-panes-navbar .navbarItems=${menuItems} @solid-ui-select=${handleSelectionChanged}></solid-panes-navbar>`,\n tmpContainer\n )\n }\n\n renderNavbar()\n\n selectPaneInNavbar = (paneName, paneUri) => {\n const item = pickNavbarItem(menuItems, paneName, paneUri)\n if (!item) return\n setSelectedItem(item)\n renderNavbar()\n }\n\n const navbar = tmpContainer.firstElementChild as HTMLElement | null\n\n if (!navbar) {\n throw new Error('Failed to create nav bar')\n }\n\n if (mainContent) {\n mainContent.insertBefore(navbar, mainContent.firstChild)\n } else {\n document.body.prepend(navbar)\n }\n\n await showNavbar()\n\n // The items belong to one pod. When a navigation (a link, back or forward) lands in another\n // pod, they would offer the wrong profile and storages, so build them again.\n let rebuildRequest = 0\n const stopListening = onNavigated(({ url, state }) => {\n if (!navbar.isConnected) return stopListening()\n\n refreshNavbarVisibility(url, state.viaAccountMenu)\n .catch(error => console.error('Failed to update navbar visibility:', error))\n\n const request = ++rebuildRequest\n getPodContext(url).then(next => {\n if (request !== rebuildRequest) return\n if (isSamePod(podContext, next)) {\n const selection = deriveNavbarSelection(state.view, isWebIdUri(store.sym(url)))\n const selectedItems = menuItems.map(menuItem => ({\n ...menuItem,\n selected: isNavbarItemSelected(menuItem, selection, podContext.storagePanes.length)\n }))\n if (selectedItems.some((item, index) => item.selected !== menuItems[index].selected)) {\n menuItems = selectedItems\n renderNavbar()\n }\n return\n }\n podContext = next\n menuItems = createNavbarMenuItems(next, navigation, state.view)\n renderNavbar()\n }).catch(error => console.error('Failed to rebuild the navbar for the new pod:', error))\n })\n\n return navbar\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAASA,IAAc;CACrB,OAAOC,EAAwB,OAAO,SAAS,MAAMC,EAAoB,CAAC,CAAC,cAAc;AAC3F;AAEA,IAAIC;AAEJ,SAAgBC,EAAkB,GAAkB,GAAwB;CAC1E,IAAqBC,GAAUC,CAAO;AACxC;AAEA,SAASC,EACP,GACA,GACA,GACA,GACA,IAAW,IACK;CAChB,OAAO;EACL;EACA;EACA;EACA,MAAM,aAAc;GAElB,OADA,MAAMP,EAAW,GACVQ,EAAW;EACpB;EACA;CACF;AACF;AAIA,SAASC,EACP,GACA,GACA,GACkB;CAClB,IAAMC,IAAYC,EAAsBC,GAAMC,EAAWC,EAAM,IAAI,OAAO,SAAS,IAAI,CAAC,CAAC,GAEnFC,IAA8B,CAAC;CAErC,IAAIC,EAAQ,OAAO;EACjB,IAAMC,IAAQD,EAAQ;EACtB,EAAU,KACRT,EAAc,WAAW,WAAWU,SAAaC,EAAW,KAAK;GAAE,MAAM;GAAW,SAASD;EAAM,CAAC,GAClGE,EAAqB,EAAE,UAAU,UAAU,GAAGT,GAAW,CAAC,CAAC,GAC7DH,EAAc,WAAW,UAAUU,SAAaC,EAAW,KAAK;GAAE,MAAM;GAAW,SAASD;EAAM,CAAC,GACjGE,EAAqB,EAAE,UAAU,SAAS,GAAGT,GAAW,CAAC,CAAC,CAC9D;CACF;CAkBA,OAhBAM,EAAQ,aA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b,EAAY,UAAU,IAEvD,SAAS,KAAK,QAAQa,CAAM,GAG9B,MAAMpC,EAAW;CAIjB,IAAIqC,IAAiB,GACfC,IAAgBC,GAAa,EAAE,QAAK,eAAY;EACpD,IAAI,CAACH,EAAO,aAAa,OAAOE,EAAc;EAE9C,EAAwBE,GAAKC,EAAM,cAAc,CAAC,CAC/C,OAAM,MAAS,QAAQ,MAAM,uCAAuCT,CAAK,CAAC;EAE7E,IAAMU,IAAU,EAAEL;EAClB,EAAcG,CAAG,CAAC,CAAC,MAAK,MAAQ;GAC9B,IAAIE,MAAYL,GAChB;QAAIM,EAAUlB,GAAYmB,CAAI,GAAG;KAC/B,IAAMlC,IAAYC,EAAsB8B,EAAM,MAAM5B,EAAWC,EAAM,IAAI0B,CAAG,CAAC,CAAC,GACxEK,IAAgB9B,EAAU,KAAI,OAAa;MAC/C,GAAGa;MACH,UAAUT,EAAqBS,GAAUlB,GAAWe,EAAW,aAAa,MAAM;KACpF,EAAE;KACF,AAAIoB,EAAc,MAAM,GAAM,MAAUX,EAAK,aAAanB,EAAU+B,EAAM,CAAC,QAAQ,MACjF,IAAYD,GACZZ,EAAa;IAGjB,OAGA,AAFA,IAAaW,GACb,IAAYnC,EAAsBmC,GAAM1B,GAAYuB,EAAM,IAAI,GAC9DR,EAAa;GAHb;EAIF,CAAC,CAAC,CAAC,OAAM,MAAS,QAAQ,MAAM,iDAAiDD,CAAK,CAAC;CACzF,CAAC;CAED,OAAOI;AACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./navbar.cjs.js"),n=require("../navigation/controller.cjs.js"),r=require("./profileHeading2.cjs.js");let i=require("pane-registry");i=e.__toESM(i);var a=new WeakMap;function o(e,o){let s=a.get(e);return s||(s=n.createNavigationController({store:o,outliner:e,byName:i.byName,effects:{selectNavbarPane:t.selectNavbarPane,refreshHeading:r.refreshProfileHeading}}),a.set(e,s)),s}exports.navigationFor=o;
|
|
2
|
+
//# sourceMappingURL=navigation.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.cjs.js","names":["createNavigationController","paneRegistry","refreshProfileHeading","require_runtime","require_navbar","require_controller","require_profileHeading","pane_registry","controllers","navigationFor","controller","outliner"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n controller = createNavigationController({\n store,\n outliner,\n byName: paneRegistry.byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":"A,sNAOA,IAAMQ,EAAc,IAAI,QAGxB,SAAgBC,EAAe,EAA0B,EAAwC,CAC/F,IAAIC,EAAaF,EAAY,IAAIG,CAAQ,EAUzC,OATKD,IACH,EAAaV,EAAAA,2BAA2B,CACtC,QACA,WACA,OAAQC,EAAa,OACrB,QAAS,CAAE,iBAAAG,EAAA,iBAAkB,eAAgBF,EAAAA,qBAAsB,CACrE,CAAC,EACDM,EAAY,IAAIG,EAAUD,CAAU,GAE/BA,CACT,C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LiveStore } from '../../node_modules/rdflib';
|
|
2
|
+
import { OutlineManager } from '../outline/manager';
|
|
3
|
+
import { NavigationController } from '../navigation/controller';
|
|
4
|
+
/** The page's navigation controller for an outliner, created on first use. */
|
|
5
|
+
export declare function navigationFor(outliner: OutlineManager, store: LiveStore): NavigationController;
|
|
6
|
+
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/mainPage/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAMhG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,CAY/F"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { selectNavbarPane as e } from "./navbar.esm.js";
|
|
2
|
+
import { createNavigationController as t } from "../navigation/controller.esm.js";
|
|
3
|
+
import { refreshProfileHeading as n } from "./profileHeading2.esm.js";
|
|
4
|
+
import * as r from "pane-registry";
|
|
5
|
+
//#region src/mainPage/navigation.ts
|
|
6
|
+
var i = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
function a(a, o) {
|
|
8
|
+
let s = i.get(a);
|
|
9
|
+
return s || (s = t({
|
|
10
|
+
store: o,
|
|
11
|
+
outliner: a,
|
|
12
|
+
byName: r.byName,
|
|
13
|
+
effects: {
|
|
14
|
+
selectNavbarPane: e,
|
|
15
|
+
refreshHeading: n
|
|
16
|
+
}
|
|
17
|
+
}), i.set(a, s)), s;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { a as navigationFor };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=navigation.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.esm.js","names":["paneRegistry","controllers","navigationFor","controller","outliner","createNavigationController","refreshProfileHeading"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n controller = createNavigationController({\n store,\n outliner,\n byName: paneRegistry.byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":";;;;;AAOA,IAAMC,oBAAc,IAAI,QAA8C;AAGtE,SAAgBC,EAAe,GAA0B,GAAwC;CAC/F,IAAIC,IAAaF,EAAY,IAAIG,CAAQ;CAUzC,OATKD,MACH,IAAaE,EAA2B;EACtC;EACA;EACA,QAAQL,EAAa;EACrB,SAAS;GAAE;GAAkB,gBAAgBM;EAAsB;CACrE,CAAC,GACDL,EAAY,IAAIG,GAAUD,CAAU,IAE/BA;AACT"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function refreshProfileHeading(force?: boolean): Promise<void>;
|
|
2
|
+
/** Put the heading where it belongs, above the navbar, after the navbar has been added. */
|
|
3
|
+
export declare function placeProfileHeading(): void;
|
|
4
|
+
export declare function initializeProfileHeading(): void;
|
|
5
|
+
//# sourceMappingURL=profileHeading.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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;
|
|
2
|
+
//# sourceMappingURL=profileHeading2.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profileHeading2.cjs.js","names":["getPodContext","readNavigationState","deriveHeading","authn","loadProfileFromURI","store","presentProfile","getViewerMode","require_webIdUtils","require_chrome","require_podContext","require_state","require_events","require_profileHeadingData","solid_logic","PROFILE_HEADING_TAG","PROFILE_HEADING_MOUNT_ID","refreshRequest","navigatedListenerRegistered","authListenersRegistered","profileSavedListenerRegistered","authReady","displayedPaneKey","displayedSubjectUri","loadingPaneKey","hideAnimations","showAnimations","showHeading","mount","style","marginTop","marginBottom","animation","finish","error","cancelHeadingHide","hideHeading","height","opacity","showing","refreshAfterAuthChange","refreshProfileHeading","ensureMountPoint","mainContent","navbar","outlineView","insertionPoint","pod","force","decision","pane","isProfilePane","paneKey","subjectUri","request","subject","profileData","canEdit","viewerMode","heading","viewer","appearing","placeProfileHeading","initializeProfileHeading","event","readiness"],"sources":["../../src/mainPage/profileHeading.ts"],"sourcesContent":["import { authn, authSession, store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport type { ProfileDetails } from '../components/profile-heading/editor/sections/heading/types'\nimport type { ProfileHeadingEditContext } from '../components/profile-heading/ProfileHeading'\nimport { getViewerMode, presentProfile } from '../components/profile-heading/profileHeadingData'\nimport type { ViewerMode } from '../types'\nimport { loadProfileFromURI } from '../utils/webIdUtils'\nimport '../components/profile-heading'\nimport './profileHeading.css'\nimport { deriveHeading } from '../navigation/chrome'\nimport { getPodContext } from '../navigation/podContext'\nimport { onNavigated } from '../navigation/events'\nimport { readNavigationState } from '../navigation/state'\n\nconst PROFILE_HEADING_TAG = 'solid-panes-profile-heading'\nconst PROFILE_HEADING_MOUNT_ID = 'profile-heading-mount'\n\nlet refreshRequest = 0\nlet navigatedListenerRegistered = false\nlet authListenersRegistered = false\nlet profileSavedListenerRegistered = false\nlet authReady: Promise<void> | undefined\nlet displayedPaneKey = ''\nlet displayedSubjectUri = ''\nlet loadingPaneKey = ''\nconst hideAnimations = new WeakMap<HTMLElement, Animation>()\nconst showAnimations = new WeakMap<HTMLElement, Animation>()\n\nfunction showHeading (mount: HTMLElement): void {\n if (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') return\n\n const style = getComputedStyle(mount)\n const marginTop = style.marginTop || '18px'\n const marginBottom = style.marginBottom || '20px'\n const animation = mount.animate([\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' },\n {\n height: `${mount.getBoundingClientRect().height}px`,\n opacity: 1,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n }\n ], { duration: 300, easing: 'ease', fill: 'both' })\n showAnimations.set(mount, animation)\n const finish = () => {\n if (showAnimations.get(mount) !== animation) return\n showAnimations.delete(mount)\n animation.cancel()\n }\n animation.finished.then(finish, (error: unknown) => {\n if (showAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading appearance.', error)\n finish()\n })\n}\n\nfunction cancelHeadingHide (mount: HTMLElement): void {\n const animation = hideAnimations.get(mount)\n hideAnimations.delete(mount)\n animation?.cancel()\n mount.inert = false\n mount.removeAttribute('aria-hidden')\n}\n\nfunction hideHeading (mount: HTMLElement): void {\n if (hideAnimations.has(mount)) return\n\n const style = getComputedStyle(mount)\n const height = mount.getBoundingClientRect().height\n const opacity = style.opacity\n const marginTop = style.marginTop\n const marginBottom = style.marginBottom\n const showing = showAnimations.get(mount)\n showAnimations.delete(mount)\n showing?.cancel()\n\n const finish = () => {\n mount.hidden = true\n mount.replaceChildren()\n }\n mount.inert = true\n mount.setAttribute('aria-hidden', 'true')\n\n if (mount.hidden || !mount.firstElementChild ||\n window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ||\n typeof mount.animate !== 'function') {\n finish()\n return\n }\n\n const animation = mount.animate([\n {\n height: `${height}px`,\n opacity,\n marginTop,\n marginBottom,\n overflow: 'hidden'\n },\n { height: '0px', opacity: 0, marginTop: '0px', marginBottom: '0px', overflow: 'hidden' }\n ], { duration: 300, easing: 'ease', fill: 'forwards' })\n hideAnimations.set(mount, animation)\n animation.finished.then(() => {\n if (hideAnimations.get(mount) !== animation) return\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n }, (error: unknown) => {\n if (hideAnimations.get(mount) !== animation) return\n console.error('Failed to animate profile heading disappearance.', error)\n finish()\n hideAnimations.delete(mount)\n animation.cancel()\n })\n}\n\nfunction refreshAfterAuthChange (): void {\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after an authentication change.', error)\n })\n}\n\nfunction ensureMountPoint (): HTMLElement | null {\n const mainContent = document.getElementById('MainContent')\n if (!mainContent) return null\n\n let mount = document.getElementById(PROFILE_HEADING_MOUNT_ID)\n if (!mount) {\n mount = document.createElement('div')\n mount.id = PROFILE_HEADING_MOUNT_ID\n mount.setAttribute('aria-label', 'Profile heading')\n }\n\n const navbar = document.querySelector('solid-panes-navbar')\n const outlineView = document.getElementById('OutlineView')\n const insertionPoint = navbar?.parentNode === mainContent\n ? navbar\n : outlineView?.parentNode === mainContent\n ? outlineView\n : null\n if (insertionPoint && mount.nextSibling !== insertionPoint) {\n mainContent.insertBefore(mount, insertionPoint)\n } else if (!insertionPoint && mount.parentNode !== mainContent) {\n mainContent.appendChild(mount)\n }\n return mount\n}\n\nexport async function refreshProfileHeading (force = false): Promise<void> {\n await authReady\n\n const pod = await getPodContext(window.location.href)\n const mount = ensureMountPoint()\n if (!mount) return\n\n if (force) {\n refreshRequest++\n displayedPaneKey = ''\n loadingPaneKey = ''\n }\n\n const { view, viaAccountMenu } = readNavigationState()\n const decision = deriveHeading({\n view,\n viaAccountMenu,\n viewer: authn.currentUser()?.value,\n pageUrl: window.location.href,\n owner: pod.owner,\n storageUris: pod.storagePanes.map(pane => pane.subject.value)\n })\n\n if (decision.mode === 'none') {\n refreshRequest++\n loadingPaneKey = ''\n displayedPaneKey = ''\n displayedSubjectUri = ''\n hideHeading(mount)\n return\n }\n\n const { subjectUri } = decision\n const isProfilePane = decision.mode === 'full'\n cancelHeadingHide(mount)\n const paneKey = `${decision.paneName}:${subjectUri}`\n if (paneKey === displayedPaneKey || paneKey === loadingPaneKey) return\n\n const request = ++refreshRequest\n loadingPaneKey = paneKey\n let subject: NamedNode\n let profileData: ProfileDetails\n let canEdit: boolean\n let viewerMode: ViewerMode\n try {\n subject = await loadProfileFromURI(store.sym(subjectUri))\n profileData = presentProfile(subject, store)\n viewerMode = isProfilePane ? await getViewerMode(subject) : 'anonymous'\n canEdit = viewerMode === 'owner'\n } catch (error) {\n if (request === refreshRequest) loadingPaneKey = ''\n throw error\n }\n if (request !== refreshRequest) return\n\n const heading = (mount.querySelector(PROFILE_HEADING_TAG) ||\n document.createElement(PROFILE_HEADING_TAG)) as HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n friendSubject?: NamedNode\n compact?: boolean\n updateComplete?: Promise<unknown>\n }\n heading.profileData = profileData\n const viewer = authn.currentUser()\n heading.friendSubject = isProfilePane && viewer && !viewer.sameTerm(subject)\n ? subject\n : undefined\n heading.editContext = canEdit\n ? {\n subject,\n profileData,\n viewerMode,\n onSaved: () => refreshProfileHeading(true)\n }\n : undefined\n heading.compact = !isProfilePane\n const appearing = mount.hidden || !mount.firstElementChild\n mount.hidden = false\n if (heading.parentNode !== mount) mount.replaceChildren(heading)\n displayedPaneKey = paneKey\n displayedSubjectUri = subject.value\n loadingPaneKey = ''\n if (appearing) {\n await heading.updateComplete\n if (request === refreshRequest && mount.isConnected && !mount.hidden && !hideAnimations.has(mount)) {\n showHeading(mount)\n }\n }\n}\n\n/** Put the heading where it belongs, above the navbar, after the navbar has been added. */\nexport function placeProfileHeading (): void {\n ensureMountPoint()\n}\n\nexport function initializeProfileHeading (): void {\n ensureMountPoint()\n\n if (!profileSavedListenerRegistered) {\n document.addEventListener('profile-pane-saved', (event) => {\n if (!(event instanceof CustomEvent) || event.detail?.subjectUri !== displayedSubjectUri) return\n\n const heading = document.querySelector<HTMLElement & {\n profileData?: ProfileDetails\n editContext?: ProfileHeadingEditContext\n }>(`#${PROFILE_HEADING_MOUNT_ID} ${PROFILE_HEADING_TAG}`)\n if (heading && event.detail.profileData) {\n refreshRequest++\n loadingPaneKey = ''\n heading.profileData = event.detail.profileData\n if (heading.editContext) {\n heading.editContext = { ...heading.editContext, profileData: event.detail.profileData }\n }\n return\n }\n\n refreshProfileHeading(true).catch((error: unknown) => {\n console.error('Failed to refresh profile heading after saving profile information.', error)\n })\n })\n profileSavedListenerRegistered = true\n }\n\n const readiness = authReady ?? authn.checkUser().then(() => undefined)\n authReady = readiness\n\n if (!authListenersRegistered) {\n authSession.events.on('login', refreshAfterAuthChange)\n authSession.events.on('sessionRestore', refreshAfterAuthChange)\n authSession.events.on('logout', refreshAfterAuthChange)\n authSession.events.on('sessionChange', refreshAfterAuthChange)\n authSession.events.on('identityReplaced', refreshAfterAuthChange)\n authListenersRegistered = true\n }\n\n // Navigations the page's own navigation does not make, such as links and buttons in solid-ui\n if (!navigatedListenerRegistered) {\n onNavigated(() => {\n refreshProfileHeading().catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n })\n navigatedListenerRegistered = true\n }\n\n readiness.then(() => refreshProfileHeading(true)).catch((error: unknown) => {\n console.error('Failed to refresh profile heading.', error)\n })\n}\n"],"mappings":"A,gZAcA,IAAMe,EAAsB,8BACtBC,EAA2B,wBAE7BC,EAAiB,EACjBC,EAA8B,GAC9BC,EAA0B,GAC1BC,EAAiC,GACjCC,EACAC,EAAmB,GACnBC,EAAsB,GACtBC,EAAiB,GACfC,EAAiB,IAAI,QACrBC,EAAiB,IAAI,QAE3B,SAASC,EAAa,EAA0B,CAC9C,GAAI,OAAO,aAAa,kCAAkC,CAAC,CAAC,SACxD,OAAOC,EAAM,SAAY,WAAY,OAEzC,IAAMC,EAAQ,iBAAiBD,CAAK,EAC9BE,EAAYD,EAAM,WAAa,OAC/BE,EAAeF,EAAM,cAAgB,OACrCG,EAAYJ,EAAM,QAAQ,CAC9B,CAAE,OAAQ,MAAO,QAAS,EAAG,UAAW,MAAO,aAAc,MAAO,SAAU,QAAS,EACvF,CACE,OAAQ,GAAGA,EAAM,sBAAsB,CAAC,CAAC,OAAO,IAChD,QAAS,EACT,YACA,eACA,SAAU,QACZ,CACF,EAAG,CAAE,SAAU,IAAK,OAAQ,OAAQ,KAAM,MAAO,CAAC,EAClDF,EAAe,IAAIE,EAAOI,CAAS,EACnC,IAAMC,MAAe,CACfP,EAAe,IAAIE,CAAK,IAAMI,IAClCN,EAAe,OAAOE,CAAK,EAC3BI,EAAU,OAAO,EACnB,EACAA,EAAU,SAAS,KAAKC,EAAS,GAAmB,CAC9CP,EAAe,IAAIE,CAAK,IAAMI,IAClC,QAAQ,MAAM,gDAAiDE,CAAK,EACpED,EAAO,EACT,CAAC,CACH,CAEA,SAASE,EAAmB,EAA0B,CACpD,IAAMH,EAAYP,EAAe,IAAIG,CAAK,EAC1CH,EAAe,OAAOG,CAAK,EAC3BI,GAAW,OAAO,EAClB,EAAM,M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EzF,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"}
|
|
@@ -0,0 +1,158 @@
|
|
|
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";
|
|
7
|
+
import "../components/profile-heading/index.esm.js";
|
|
8
|
+
|
|
9
|
+
import { authSession as s, authn as c, store as l } from "solid-logic";
|
|
10
|
+
//#region src/mainPage/profileHeading.ts
|
|
11
|
+
var u = "solid-panes-profile-heading", d = "profile-heading-mount", f = 0, p = !1, m = !1, h = !1, g, _ = "", v = "", y = "", b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
|
|
12
|
+
function S(e) {
|
|
13
|
+
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof e.animate != "function") return;
|
|
14
|
+
let t = getComputedStyle(e), n = t.marginTop || "18px", r = t.marginBottom || "20px", i = e.animate([{
|
|
15
|
+
height: "0px",
|
|
16
|
+
opacity: 0,
|
|
17
|
+
marginTop: "0px",
|
|
18
|
+
marginBottom: "0px",
|
|
19
|
+
overflow: "hidden"
|
|
20
|
+
}, {
|
|
21
|
+
height: `${e.getBoundingClientRect().height}px`,
|
|
22
|
+
opacity: 1,
|
|
23
|
+
marginTop: n,
|
|
24
|
+
marginBottom: r,
|
|
25
|
+
overflow: "hidden"
|
|
26
|
+
}], {
|
|
27
|
+
duration: 300,
|
|
28
|
+
easing: "ease",
|
|
29
|
+
fill: "both"
|
|
30
|
+
});
|
|
31
|
+
x.set(e, i);
|
|
32
|
+
let a = () => {
|
|
33
|
+
x.get(e) === i && (x.delete(e), i.cancel());
|
|
34
|
+
};
|
|
35
|
+
i.finished.then(a, (t) => {
|
|
36
|
+
x.get(e) === i && (console.error("Failed to animate profile heading appearance.", t), a());
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function C(e) {
|
|
40
|
+
let t = b.get(e);
|
|
41
|
+
b.delete(e), t?.cancel(), e.inert = !1, e.removeAttribute("aria-hidden");
|
|
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();
|
|
47
|
+
let s = () => {
|
|
48
|
+
e.hidden = !0, e.replaceChildren();
|
|
49
|
+
};
|
|
50
|
+
if (e.inert = !0, e.setAttribute("aria-hidden", "true"), e.hidden || !e.firstElementChild || window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof e.animate != "function") {
|
|
51
|
+
s();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
let c = e.animate([{
|
|
55
|
+
height: `${n}px`,
|
|
56
|
+
opacity: r,
|
|
57
|
+
marginTop: i,
|
|
58
|
+
marginBottom: a,
|
|
59
|
+
overflow: "hidden"
|
|
60
|
+
}, {
|
|
61
|
+
height: "0px",
|
|
62
|
+
opacity: 0,
|
|
63
|
+
marginTop: "0px",
|
|
64
|
+
marginBottom: "0px",
|
|
65
|
+
overflow: "hidden"
|
|
66
|
+
}], {
|
|
67
|
+
duration: 300,
|
|
68
|
+
easing: "ease",
|
|
69
|
+
fill: "forwards"
|
|
70
|
+
});
|
|
71
|
+
b.set(e, c), c.finished.then(() => {
|
|
72
|
+
b.get(e) === c && (s(), b.delete(e), c.cancel());
|
|
73
|
+
}, (t) => {
|
|
74
|
+
b.get(e) === c && (console.error("Failed to animate profile heading disappearance.", t), s(), b.delete(e), c.cancel());
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function T() {
|
|
78
|
+
D(!0).catch((e) => {
|
|
79
|
+
console.error("Failed to refresh profile heading after an authentication change.", e);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function E() {
|
|
83
|
+
let e = document.getElementById("MainContent");
|
|
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"));
|
|
87
|
+
let n = document.querySelector("solid-panes-navbar"), r = document.getElementById("OutlineView"), i = n?.parentNode === e ? n : r?.parentNode === e ? r : null;
|
|
88
|
+
return i && t.nextSibling !== i ? e.insertBefore(t, i) : !i && t.parentNode !== e && e.appendChild(t), t;
|
|
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)
|
|
102
|
+
});
|
|
103
|
+
if (h.mode === "none") {
|
|
104
|
+
f++, y = "", _ = "", v = "", w(d);
|
|
105
|
+
return;
|
|
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;
|
|
114
|
+
try {
|
|
115
|
+
A = await e(l.sym(x)), j = o(A, l), N = T ? await a(A) : "anonymous", M = N === "owner";
|
|
116
|
+
} catch (e) {
|
|
117
|
+
throw k === f && (y = ""), e;
|
|
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));
|
|
131
|
+
}
|
|
132
|
+
function O() {
|
|
133
|
+
E();
|
|
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 &&= {
|
|
140
|
+
...t.editContext,
|
|
141
|
+
profileData: e.detail.profileData
|
|
142
|
+
}) : D(!0).catch((e) => {
|
|
143
|
+
console.error("Failed to refresh profile heading after saving profile information.", e);
|
|
144
|
+
});
|
|
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) => {
|
|
149
|
+
console.error("Failed to refresh profile heading.", e);
|
|
150
|
+
});
|
|
151
|
+
}), !0), e.then(() => D(!0)).catch((e) => {
|
|
152
|
+
console.error("Failed to refresh profile heading.", e);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { k as initializeProfileHeading, O as placeProfileHeading, D as refreshProfileHeading };
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=profileHeading2.esm.js.map
|
|
@@ -0,0 +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,Q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EtB,OALAyD,QAAkB;EAChB,EAAsB,CAAC,CAAC,OAAO,MAAmB;GAChD,QAAQ,MAAM,sCAAsCzC,CAAK;EAC3D,CAAC;CACH,CAAC,GAC6B,KAGhCuC,EAAU,WAAW3B,EAAsB,EAAI,CAAC,CAAC,CAAC,OAAO,MAAmB;EAC1E,QAAQ,MAAM,sCAAsCZ,CAAK;CAC3D,CAAC;AACH"}
|
package/dist/n3Pane2.cjs.js.map
CHANGED
|
@@ -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":"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"}
|
|
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"}
|
|
@@ -0,0 +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;
|
|
2
|
+
//# sourceMappingURL=browserEvents.cjs.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NavigationController } from './controller';
|
|
2
|
+
/**
|
|
3
|
+
* Whether the main page handles back and forward itself. Packages that used to re-render on
|
|
4
|
+
* `popstate` (mashlib) ask this and leave it to the main page.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isHandlingBrowserNavigation(): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Starts handling Enter, back and forward for a controller. The listeners are added once;
|
|
9
|
+
* calling this again only changes which controller they use.
|
|
10
|
+
*
|
|
11
|
+
* The Navigation API is used where the browser has it; the places that fall back to an older
|
|
12
|
+
* mechanism are marked NAVIGATION API FALLBACK. See "Browser support" in docs/navigation-design.md.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerBrowserNavigation(controller: NavigationController): void;
|
|
15
|
+
//# sourceMappingURL=browserEvents.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { clearPaneState as e } from "./state.esm.js";
|
|
2
|
+
//#region src/navigation/browserEvents.ts
|
|
3
|
+
var t, n = !1;
|
|
4
|
+
function r() {
|
|
5
|
+
return n;
|
|
6
|
+
}
|
|
7
|
+
function i(e) {
|
|
8
|
+
console.error("Failed to show the page after browser navigation.", e);
|
|
9
|
+
}
|
|
10
|
+
function a(r) {
|
|
11
|
+
if (t = r, n) return;
|
|
12
|
+
n = !0;
|
|
13
|
+
let a = () => (e(), (t?.show({
|
|
14
|
+
kind: "restore",
|
|
15
|
+
forceHeading: !0
|
|
16
|
+
}) ?? Promise.resolve()).catch(i)), o = window.navigation;
|
|
17
|
+
o ? (o.addEventListener("navigate", (e) => {
|
|
18
|
+
e.canIntercept && e.userInitiated && e.navigationType === "replace" && e.destination.url === window.location.href && e.intercept({
|
|
19
|
+
scroll: "manual",
|
|
20
|
+
focusReset: "manual",
|
|
21
|
+
handler: a
|
|
22
|
+
});
|
|
23
|
+
}), o.addEventListener("currententrychange", (e) => {
|
|
24
|
+
e.navigationType === "traverse" && a();
|
|
25
|
+
})) : window.addEventListener("popstate", () => {
|
|
26
|
+
a();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { r as isHandlingBrowserNavigation, a as registerBrowserNavigation };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=browserEvents.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserEvents.esm.js","names":["navigation","listenersRegistered","isHandlingBrowserNavigation","reportError","error","registerBrowserNavigation","controller","showUrl","clearPaneState","navigationApi","event"],"sources":["../../src/navigation/browserEvents.ts"],"sourcesContent":["/*\n * What the page does when the browser changes the URL or the history entry without reloading.\n *\n * Like a reload, both cases show what the URL is, not what the entry last displayed through the\n * navbar or the account menu:\n * - Enter on the current URL (typically one ending in #me)\n * - back and forward\n */\n\nimport type { NavigationController } from './controller'\nimport { clearPaneState } from './state'\n\ninterface NavigationEvent extends Event {\n canIntercept: boolean\n userInitiated: boolean\n navigationType: string\n destination: { url: string }\n intercept: (options: { handler: () => Promise<void>, scroll: 'manual', focusReset: 'manual' }) => void\n}\n\ninterface NavigationApi {\n addEventListener: (type: 'navigate' | 'currententrychange', listener: (event: NavigationEvent) => void) => void\n}\n\nlet navigation: NavigationController | undefined\nlet listenersRegistered = false\n\n/**\n * Whether the main page handles back and forward itself. Packages that used to re-render on\n * `popstate` (mashlib) ask this and leave it to the main page.\n */\nexport function isHandlingBrowserNavigation (): boolean {\n return listenersRegistered\n}\n\nfunction reportError (error: unknown) {\n console.error('Failed to show the page after browser navigation.', error)\n}\n\n/**\n * Starts handling Enter, back and forward for a controller. The listeners are added once;\n * calling this again only changes which controller they use.\n *\n * The Navigation API is used where the browser has it; the places that fall back to an older\n * mechanism are marked NAVIGATION API FALLBACK. See \"Browser support\" in docs/navigation-design.md.\n */\nexport function registerBrowserNavigation (controller: NavigationController): void {\n navigation = controller\n if (listenersRegistered) return\n listenersRegistered = true\n\n const showUrl = () => {\n clearPaneState()\n return (navigation?.show({ kind: 'restore', forceHeading: true }) ?? Promise.resolve()).catch(reportError)\n }\n\n const navigationApi = (window as unknown as { navigation?: NavigationApi }).navigation\n if (!navigationApi) {\n // NAVIGATION API FALLBACK (Firefox before 147, Safari before 26.2, older Chromium).\n // Back and forward use `popstate`, which cannot tell them from in-page `#` links, so a\n // fragment link also re-renders the page. Enter on the current URL is not handled at all\n // here: without a fragment the browser reloads the page, and `initMainPage` shows the URL.\n window.addEventListener('popstate', () => { showUrl() })\n return\n }\n\n // NAVIGATION API: Enter on the current URL (typically one ending in #me) is a same-URL\n // \"replace\" navigation; intercepting it shows the URL without reloading. Without the API\n // there is no equivalent, see the fallback above.\n navigationApi.addEventListener('navigate', event => {\n if (!event.canIntercept || !event.userInitiated || event.navigationType !== 'replace' ||\n event.destination.url !== window.location.href) return\n\n event.intercept({\n scroll: 'manual',\n focusReset: 'manual',\n handler: showUrl\n })\n })\n\n // NAVIGATION API: unlike the `popstate` fallback above, this does not fire for in-page\n // fragment links.\n navigationApi.addEventListener('currententrychange', event => {\n if (event.navigationType === 'traverse') showUrl()\n })\n}\n"],"mappings":";;AAwBA,IAAIA,GACAC,IAAsB;AAM1B,SAAgBC,IAAwC;CACtD,OAAOD;AACT;AAEA,SAASE,EAAa,GAAgB;CACpC,QAAQ,MAAM,qDAAqDC,CAAK;AAC1E;AASA,SAAgBC,EAA2B,GAAwC;CAEjF,IADA,IAAaC,GACTL,GAAqB;CACzB,IAAsB;CAEtB,IAAMM,WACJC,EAAe,IACPR,GAAY,KAAK;EAAE,MAAM;EAAW,cAAc;CAAK,CAAC,KAAK,QAAQ,QAAQ,EAAA,CAAG,MAAMG,CAAW,IAGrGM,IAAiB,OAAqD;CAC5E,AAAKA,KAYLA,EAAc,iBAAiB,aAAY,MAAS;EAClD,AAAKC,EAAM,gBAAiBA,EAAM,iBAAiBA,EAAM,mBAAmB,aACxEA,EAAM,YAAY,QAAQ,OAAO,SAAS,QAE9CA,EAAM,UAAU;GACd,QAAQ;GACR,YAAY;GACZ,SAASH;EACX,CAAC;CACH,CAAC,GAIDE,EAAc,iBAAiB,uBAAsB,MAAS;EAC5D,AAAIC,EAAM,mBAAmB,cAAYH,EAAQ;CACnD,CAAC,KAtBC,OAAO,iBAAiB,kBAAkB;EAAE,EAAQ;CAAE,CAAC;AAuB3D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e=[`profile`,`social`];function t(t){return t!==void 0&&e.includes(t)}function n(e){let{view:n,viaAccountMenu:r,viewer:i,pageUrl:a,owner:o,storageUris:s}=e,c=n.pane,l=c===`profile`||c===`social`?o!==void 0:c===`folder`&&s.some(e=>!n.subject||e===n.subject),u=l||!r?o:void 0;return t(c)?{mode:c===`profile`?`full`:`compact`,subjectUri:n.subject||(l?o:void 0)||a,paneName:c}:!u||u===i?{mode:`none`}:{mode:`compact`,subjectUri:u,paneName:c}}function r(e,t){return{paneName:e.pane??(t?`profile`:void 0),paneUri:e.subject}}function i(e,t,n){return!t.paneName||e.paneName!==t.paneName?!1:e.paneName===`folder`?t.paneUri?t.paneUri===e.paneUri:n===1:!0}function a(e,t,n){let r=e.filter(e=>e.paneName===t);return r.find(e=>e.paneUri===n)??r[0]}function o(e){return e.viaAccountMenu||e.ownProfile||e.inViewerPod}function s(e){return e.isRootResource||e.isWebId?!1:!e.viewerPodOnly||e.inViewerPod}function c(e,n){return e&&!t(n)}exports.PERSON_PANES=e,exports.deriveExplorerHeader=s,exports.deriveHeading=n,exports.deriveNavbarSelection=r,exports.explorerHeaderForPane=c,exports.isNavbarHidden=o,exports.isNavbarItemSelected=i,exports.isPersonPane=t,exports.pickNavbarItem=a;
|
|
2
|
+
//# sourceMappingURL=chrome.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome.cjs.js","names":["PERSON_PANES","isPersonPane","paneName","deriveHeading","input","view","ownerHasPane","owner","storageUris","uri","ownerUri","viaAccountMenu","pageUrl","viewer","deriveNavbarSelection","pageIsWebId","isNavbarItemSelected","selection","item","storageItemCount","pickNavbarItem","forPane","items","paneUri","isNavbarHidden","deriveExplorerHeader","explorerHeaderForPane","resourceHeader"],"sources":["../../src/navigation/chrome.ts"],"sourcesContent":["/*\n * The rules for what the page chrome shows, as pure functions.\n *\n * What the user sees depends on the page URL, the pane that was last opened, whether the\n * account menu opened it, who is logged in and whose pod the URL is in. These functions\n * decide it from those inputs alone: they read no history, DOM or session, so every rule\n * can be tested in one place. The heading, navbar, outline and file explorer provider\n * only apply the result.\n */\n\nimport { type NavigationView } from './state'\n\n/** Registry names of the panes that present a person rather than a resource. */\nexport const PERSON_PANES = ['profile', 'social']\n\nexport function isPersonPane (paneName?: string): boolean {\n return paneName !== undefined && PERSON_PANES.includes(paneName)\n}\n\n/** The parts of a navbar item that the rules look at. */\nexport interface NavbarItemRef {\n paneName?: string\n paneUri?: string\n}\n\n// Profile heading\n\nexport type HeadingDecision =\n | { mode: 'none' }\n | {\n /** Full on the profile pane, compact everywhere else. */\n mode: 'full' | 'compact'\n /** The profile (WebID or document) to present. */\n subjectUri: string\n paneName?: string\n }\n\nexport interface HeadingInput {\n view: NavigationView\n viaAccountMenu: boolean\n /** WebID of the logged-in user. */\n viewer?: string\n pageUrl: string\n /** WebID of the person whose pod the page is in, if known. */\n owner?: string\n /** URIs of the storages of that pod. */\n storageUris: string[]\n}\n\n/**\n * Profile and friends panes present their own subject. Any other pane shows the owner of\n * the pod the page is in, unless that is the viewer, or the view came from the account menu\n * and so shows the viewer's own content.\n */\nexport function deriveHeading (input: HeadingInput): HeadingDecision {\n const { view, viaAccountMenu, viewer, pageUrl, owner, storageUris } = input\n const paneName = view.pane\n\n // Whether the pod owner's navbar has an item for the displayed pane: Profile and Friends\n // whenever there is an owner, and a storage by its URI (any of them when the view names none).\n const ownerHasPane = paneName === 'profile' || paneName === 'social'\n ? owner !== undefined\n : paneName === 'folder' && storageUris.some(uri => !view.subject || uri === view.subject)\n const ownerUri = ownerHasPane || !viaAccountMenu ? owner : undefined\n\n if (!isPersonPane(paneName)) {\n if (!ownerUri || ownerUri === viewer) return { mode: 'none' }\n return { mode: 'compact', subjectUri: ownerUri, paneName }\n }\n\n return {\n mode: paneName === 'profile' ? 'full' : 'compact',\n subjectUri: view.subject || (ownerHasPane ? owner : undefined) || pageUrl,\n paneName\n }\n}\n\n// Navbar\n\nexport interface NavbarSelection {\n paneName?: string\n paneUri?: string\n}\n\n/** What the navbar should have selected: the displayed pane, or Profile on a WebID. */\nexport function deriveNavbarSelection (view: NavigationView, pageIsWebId: boolean): NavbarSelection {\n return {\n paneName: view.pane ?? (pageIsWebId ? 'profile' : undefined),\n paneUri: view.subject\n }\n}\n\n/**\n * @param storageItemCount how many storage items the navbar has; a single storage is\n * selected even when the view does not say which one it was\n */\nexport function isNavbarItemSelected (\n item: NavbarItemRef,\n selection: NavbarSelection,\n storageItemCount: number\n): boolean {\n if (!selection.paneName || item.paneName !== selection.paneName) return false\n if (item.paneName === 'folder') {\n return selection.paneUri ? selection.paneUri === item.paneUri : storageItemCount === 1\n }\n return true\n}\n\n/** The item to select for a pane: the one for that subject, else the first for that pane. */\nexport function pickNavbarItem<Item extends NavbarItemRef> (\n items: Item[],\n paneName: string,\n paneUri?: string\n): Item | undefined {\n const forPane = items.filter(item => item.paneName === paneName)\n return forPane.find(item => item.paneUri === paneUri) ?? forPane[0]\n}\n\n/** The navbar is not offered in the viewer's own pod, nor over account-menu content. */\nexport function isNavbarHidden (input: { viaAccountMenu: boolean, ownProfile: boolean, inViewerPod: boolean }): boolean {\n return input.viaAccountMenu || input.ownProfile || input.inViewerPod\n}\n\n// File explorer header\n\nexport interface ExplorerHeaderInput {\n isRootResource: boolean\n isWebId: boolean\n /**\n * The view shows a person's own subject or the viewer's content, not the resource the\n * page URL points at, so the resource header only fits inside the viewer's own pod.\n */\n viewerPodOnly: boolean\n inViewerPod: boolean\n}\n\n/** Whether the header describing a resource fits the view. */\nexport function deriveExplorerHeader (input: ExplorerHeaderInput): boolean {\n if (input.isRootResource || input.isWebId) return false\n return !input.viewerPodOnly || input.inViewerPod\n}\n\n/** The header is never shown over a person's profile or friends, whatever the resource. */\nexport function explorerHeaderForPane (resourceHeader: boolean, paneName?: string): boolean {\n return resourceHeader && !isPersonPane(paneName)\n}\n"],"mappings":"AAaA,IAAaA,EAAe,CAAC,UAAW,QAAQ,EAEhD,SAAgBC,EAAc,EAA4B,CACxD,OAAOC,IAAa,IAAA,IAAaF,EAAa,SAASE,CAAQ,CACjE,CAqCA,SAAgBC,EAAe,EAAsC,CACnE,GAAM,CAAE,OAAM,iBAAgB,SAAQ,UAAS,QAAO,eAAgBC,EAChEF,EAAWG,EAAK,KAIhBC,EAAeJ,IAAa,WAAaA,IAAa,SACxDK,IAAU,IAAA,GACVL,IAAa,UAAYM,EAAY,KAAK,GAAO,CAACH,EAAK,SAAWI,IAAQJ,EAAK,OAAO,EACpFK,EAAWJ,GAAgB,CAACK,EAAiBJ,EAAQ,IAAA,GAO3D,OALKN,EAAaC,CAAQ,EAKnB,CACL,KAAMA,IAAa,UAAY,OAAS,UACxC,WAAYG,EAAK,UAAYC,EAAeC,EAAQ,IAAA,KAAcK,EAClE,UACF,EARM,CAACF,GAAYA,IAAaG,EAAe,CAAE,KAAM,MAAO,EACrD,CAAE,KAAM,UAAW,WAAYH,EAAU,UAAS,CAQ7D,CAUA,SAAgBI,EAAuB,EAAsB,EAAuC,CAClG,MAAO,CACL,SAAUT,EAAK,OAASU,EAAc,UAAY,IAAA,IAClD,QAASV,EAAK,OAChB,CACF,CAMA,SAAgBW,EACd,EACA,EACA,EACS,CAKT,MAJI,CAACC,EAAU,UAAYC,EAAK,WAAaD,EAAU,SAAiB,GACpEC,EAAK,WAAa,SACbD,EAAU,QAAUA,EAAU,UAAYC,EAAK,QAAUC,IAAqB,EAEhF,EACT,CAGA,SAAgBC,EACd,EACA,EACA,EACkB,CAClB,IAAMC,EAAUC,EAAM,OAAO,GAAQJ,EAAK,WAAahB,CAAQ,EAC/D,OAAOmB,EAAQ,KAAK,GAAQH,EAAK,UAAYK,CAAO,GAAKF,EAAQ,EACnE,CAGA,SAAgBG,EAAgB,EAAwF,CACtH,OAAOpB,EAAM,gBAAkBA,EAAM,YAAcA,EAAM,WAC3D,CAgBA,SAAgBqB,EAAsB,EAAqC,CAEzE,OADIrB,EAAM,gBAAkBA,EAAM,QAAgB,GAC3C,CAACA,EAAM,eAAiBA,EAAM,WACvC,CAGA,SAAgBsB,EAAuB,EAAyB,EAA4B,CAC1F,OAAOC,GAAkB,CAAC1B,EAAaC,CAAQ,CACjD,C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { NavigationView } from './state';
|
|
2
|
+
/** Registry names of the panes that present a person rather than a resource. */
|
|
3
|
+
export declare const PERSON_PANES: string[];
|
|
4
|
+
export declare function isPersonPane(paneName?: string): boolean;
|
|
5
|
+
/** The parts of a navbar item that the rules look at. */
|
|
6
|
+
export interface NavbarItemRef {
|
|
7
|
+
paneName?: string;
|
|
8
|
+
paneUri?: string;
|
|
9
|
+
}
|
|
10
|
+
export type HeadingDecision = {
|
|
11
|
+
mode: 'none';
|
|
12
|
+
} | {
|
|
13
|
+
/** Full on the profile pane, compact everywhere else. */
|
|
14
|
+
mode: 'full' | 'compact';
|
|
15
|
+
/** The profile (WebID or document) to present. */
|
|
16
|
+
subjectUri: string;
|
|
17
|
+
paneName?: string;
|
|
18
|
+
};
|
|
19
|
+
export interface HeadingInput {
|
|
20
|
+
view: NavigationView;
|
|
21
|
+
viaAccountMenu: boolean;
|
|
22
|
+
/** WebID of the logged-in user. */
|
|
23
|
+
viewer?: string;
|
|
24
|
+
pageUrl: string;
|
|
25
|
+
/** WebID of the person whose pod the page is in, if known. */
|
|
26
|
+
owner?: string;
|
|
27
|
+
/** URIs of the storages of that pod. */
|
|
28
|
+
storageUris: string[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Profile and friends panes present their own subject. Any other pane shows the owner of
|
|
32
|
+
* the pod the page is in, unless that is the viewer, or the view came from the account menu
|
|
33
|
+
* and so shows the viewer's own content.
|
|
34
|
+
*/
|
|
35
|
+
export declare function deriveHeading(input: HeadingInput): HeadingDecision;
|
|
36
|
+
export interface NavbarSelection {
|
|
37
|
+
paneName?: string;
|
|
38
|
+
paneUri?: string;
|
|
39
|
+
}
|
|
40
|
+
/** What the navbar should have selected: the displayed pane, or Profile on a WebID. */
|
|
41
|
+
export declare function deriveNavbarSelection(view: NavigationView, pageIsWebId: boolean): NavbarSelection;
|
|
42
|
+
/**
|
|
43
|
+
* @param storageItemCount how many storage items the navbar has; a single storage is
|
|
44
|
+
* selected even when the view does not say which one it was
|
|
45
|
+
*/
|
|
46
|
+
export declare function isNavbarItemSelected(item: NavbarItemRef, selection: NavbarSelection, storageItemCount: number): boolean;
|
|
47
|
+
/** The item to select for a pane: the one for that subject, else the first for that pane. */
|
|
48
|
+
export declare function pickNavbarItem<Item extends NavbarItemRef>(items: Item[], paneName: string, paneUri?: string): Item | undefined;
|
|
49
|
+
/** The navbar is not offered in the viewer's own pod, nor over account-menu content. */
|
|
50
|
+
export declare function isNavbarHidden(input: {
|
|
51
|
+
viaAccountMenu: boolean;
|
|
52
|
+
ownProfile: boolean;
|
|
53
|
+
inViewerPod: boolean;
|
|
54
|
+
}): boolean;
|
|
55
|
+
export interface ExplorerHeaderInput {
|
|
56
|
+
isRootResource: boolean;
|
|
57
|
+
isWebId: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The view shows a person's own subject or the viewer's content, not the resource the
|
|
60
|
+
* page URL points at, so the resource header only fits inside the viewer's own pod.
|
|
61
|
+
*/
|
|
62
|
+
viewerPodOnly: boolean;
|
|
63
|
+
inViewerPod: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** Whether the header describing a resource fits the view. */
|
|
66
|
+
export declare function deriveExplorerHeader(input: ExplorerHeaderInput): boolean;
|
|
67
|
+
/** The header is never shown over a person's profile or friends, whatever the resource. */
|
|
68
|
+
export declare function explorerHeaderForPane(resourceHeader: boolean, paneName?: string): boolean;
|
|
69
|
+
//# sourceMappingURL=chrome.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../src/navigation/chrome.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,gFAAgF;AAChF,eAAO,MAAM,YAAY,UAAwB,CAAA;AAEjD,wBAAgB,YAAY,CAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,yDAAyD;AACzD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAID,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IACA,yDAAyD;IACzD,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,kDAAkD;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAEH,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