solid-panes 5.1.0-1 → 5.1.0-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/RDFXMLPane2.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/cake.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/camera.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/folder-open.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/help-circle.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/mail.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/map-pin.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/pencil.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/phone.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/settings-2.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/user.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/users.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/x.esm.js +1 -2
- package/dist/audio/audioPane.esm.js +1 -2
- package/dist/classInstancePane.esm.js +1 -2
- 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 +6 -7
- package/dist/components/editor-card/EditorCard.styles.esm.js +1 -2
- 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 +7 -8
- package/dist/components/header/Header.styles.esm.js +1 -2
- package/dist/components/navbar/Navbar.cjs.js +2 -2
- package/dist/components/navbar/Navbar.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.esm.js +8 -9
- package/dist/components/navbar/Navbar.styles.esm.js +1 -2
- package/dist/components/profile-heading/ProfileHeading.cjs.js +17 -17
- package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.esm.js +28 -29
- package/dist/components/profile-heading/ProfileHeading.esm.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js +1 -1
- package/dist/components/profile-heading/ProfileHeading.styles.cjs.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js +2 -3
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js.map +1 -1
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +1 -1
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +2 -3
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +0 -1
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/textUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +1 -2
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +1 -2
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +3 -3
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -1
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js +4 -19
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -1
- package/dist/components/profile-heading/editor/ui/spinner.esm.js +1 -2
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +1 -2
- package/dist/components/profile-heading/friendActions.esm.js +1 -2
- package/dist/components/profile-heading/profileHeadingData.esm.js +1 -2
- package/dist/dashboard/basicPreferences.esm.js +1 -2
- package/dist/dashboard/dashboardPane.esm.js +0 -1
- package/dist/dashboard/homepage.esm.js +1 -2
- package/dist/dashboard/ontologyData.esm.js +1 -2
- package/dist/dashboard/preferencesFormText.esm.js +1 -2
- package/dist/dataContentPane2.cjs.js +1 -1
- package/dist/dataContentPane2.esm.js +2 -3
- package/dist/defaultPane2.cjs.js +1 -1
- package/dist/defaultPane2.esm.js +2 -3
- package/dist/dokieli/dokieliPane.cjs.js +1 -1
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
- package/dist/dokieli/dokieliPane.esm.js +7 -12
- package/dist/dokieli/dokieliPane.esm.js.map +1 -1
- package/dist/dokieli/new.esm.js +1 -2
- package/dist/form/pane.esm.js +1 -2
- package/dist/home/homePane.esm.js +1 -2
- package/dist/humanReadablePane.d.ts +3 -0
- package/dist/humanReadablePane.d.ts.map +1 -1
- package/dist/humanReadablePane2.cjs.js +276 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/humanReadablePane2.esm.js +428 -31
- package/dist/humanReadablePane2.esm.js.map +1 -1
- package/dist/icons/folder.esm.js +1 -2
- package/dist/icons/friends.esm.js +1 -2
- package/dist/icons/person.esm.js +1 -2
- package/dist/imagePane.d.ts.map +1 -1
- package/dist/imagePane2.cjs.js +1 -1
- package/dist/imagePane2.cjs.js.map +1 -1
- package/dist/imagePane2.esm.js +2 -3
- package/dist/imagePane2.esm.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +17 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/internal/internalPane2.cjs.js +1 -1
- package/dist/internal/internalPane2.esm.js +2 -3
- package/dist/mainPage/header.esm.js +1 -2
- package/dist/mainPage/index.cjs.js +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.d.ts +1 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +42 -27
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.esm.js +1 -2
- package/dist/mainPage/navigation.cjs.js +1 -1
- package/dist/mainPage/navigation.cjs.js.map +1 -1
- package/dist/mainPage/navigation.d.ts.map +1 -1
- package/dist/mainPage/navigation.esm.js +14 -11
- package/dist/mainPage/navigation.esm.js.map +1 -1
- package/dist/mainPage/profileHeading.d.ts +2 -1
- package/dist/mainPage/profileHeading.d.ts.map +1 -1
- package/dist/mainPage/profileHeading2.cjs.js +1 -1
- package/dist/mainPage/profileHeading2.cjs.js.map +1 -1
- package/dist/mainPage/profileHeading2.esm.js +76 -77
- package/dist/mainPage/profileHeading2.esm.js.map +1 -1
- package/dist/n3Pane2.esm.js +1 -2
- package/dist/navigation/browserEvents.esm.js +1 -2
- package/dist/navigation/chrome.cjs.js +1 -1
- package/dist/navigation/chrome.cjs.js.map +1 -1
- package/dist/navigation/chrome.d.ts +20 -2
- package/dist/navigation/chrome.d.ts.map +1 -1
- package/dist/navigation/chrome.esm.js +15 -10
- package/dist/navigation/chrome.esm.js.map +1 -1
- package/dist/navigation/controller.cjs.js +1 -1
- package/dist/navigation/controller.cjs.js.map +1 -1
- package/dist/navigation/controller.d.ts +3 -0
- package/dist/navigation/controller.d.ts.map +1 -1
- package/dist/navigation/controller.esm.js +50 -30
- package/dist/navigation/controller.esm.js.map +1 -1
- package/dist/navigation/events.esm.js +1 -2
- package/dist/navigation/navbarVisibility.esm.js +1 -2
- package/dist/navigation/options.cjs.js +1 -1
- package/dist/navigation/options.cjs.js.map +1 -1
- package/dist/navigation/options.d.ts +12 -0
- package/dist/navigation/options.d.ts.map +1 -1
- package/dist/navigation/options.esm.js +5 -3
- package/dist/navigation/options.esm.js.map +1 -1
- package/dist/navigation/podContext.cjs.js +1 -1
- package/dist/navigation/podContext.cjs.js.map +1 -1
- package/dist/navigation/podContext.d.ts.map +1 -1
- package/dist/navigation/podContext.esm.js +15 -16
- package/dist/navigation/podContext.esm.js.map +1 -1
- package/dist/navigation/state.esm.js +1 -2
- package/dist/outline/context.esm.js +1 -2
- package/dist/outline/fileExplorerHelpers.cjs.js +2 -0
- package/dist/outline/fileExplorerHelpers.cjs.js.map +1 -0
- package/dist/outline/fileExplorerHelpers.d.ts +13 -0
- package/dist/outline/fileExplorerHelpers.d.ts.map +1 -0
- package/dist/outline/fileExplorerHelpers.esm.js +24 -0
- package/dist/outline/fileExplorerHelpers.esm.js.map +1 -0
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +457 -437
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/outlineDomHelpers.cjs.js +2 -0
- package/dist/outline/outlineDomHelpers.cjs.js.map +1 -0
- package/dist/outline/outlineDomHelpers.d.ts +30 -0
- package/dist/outline/outlineDomHelpers.d.ts.map +1 -0
- package/dist/outline/outlineDomHelpers.esm.js +79 -0
- package/dist/outline/outlineDomHelpers.esm.js.map +1 -0
- package/dist/outline/outlineIcons.esm.js +1 -2
- package/dist/outline/propertyViews.esm.js +1 -2
- package/dist/outline/queryByExample.cjs.js.map +1 -1
- package/dist/outline/queryByExample.esm.js +1 -2
- package/dist/outline/queryByExample.esm.js.map +1 -1
- package/dist/outline/userInput.cjs.js +9 -9
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +50 -40
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/outline/viewAsImage.esm.js +1 -2
- package/dist/outline/viewAsMbox.esm.js +1 -2
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.esm.js +2 -3
- package/dist/playlist/playlistPane.esm.js +1 -2
- package/dist/registerPanes.esm.js +1 -2
- package/dist/schedule/formsForSchedule.esm.js +1 -2
- package/dist/schedule/schedulePane.d.ts.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 +60 -59
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/sharing/sharingPane.esm.js +1 -2
- package/dist/slideshow/slideshowPane.esm.js +1 -2
- package/dist/social/editProfileDetails.cjs.js +1 -1
- package/dist/social/editProfileDetails.esm.js +1 -2
- package/dist/social/icons.esm.js +1 -2
- package/dist/social/socialPane2.esm.js +1 -2
- package/dist/social/socialSections.esm.js +1 -2
- package/dist/social/triage.esm.js +1 -2
- package/dist/tabbed/tabbedPane.esm.js +1 -2
- package/dist/tableViewPane.esm.js +1 -2
- package/dist/transaction/pane.esm.js +1 -2
- package/dist/transaction/period.esm.js +1 -2
- package/dist/trip/tripPane.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.dom.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.utils.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.view.esm.js +1 -2
- package/dist/ui/pane.esm.js +1 -2
- package/dist/utils/paneUtils.cjs.js +1 -1
- package/dist/utils/paneUtils.cjs.js.map +1 -1
- package/dist/utils/paneUtils.d.ts +5 -3
- package/dist/utils/paneUtils.d.ts.map +1 -1
- package/dist/utils/paneUtils.esm.js +36 -29
- package/dist/utils/paneUtils.esm.js.map +1 -1
- package/dist/utils/podUtils.cjs.js +1 -1
- package/dist/utils/podUtils.cjs.js.map +1 -1
- package/dist/utils/podUtils.d.ts +9 -1
- package/dist/utils/podUtils.d.ts.map +1 -1
- package/dist/utils/podUtils.esm.js +22 -95
- package/dist/utils/podUtils.esm.js.map +1 -1
- package/dist/utils/viewerUtils.esm.js +1 -2
- package/dist/utils/webIdUtils.esm.js +1 -2
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +4 -5
- package/dist/versionInfo.esm.js.map +1 -1
- package/dist/video/videoPane.esm.js +1 -2
- package/package.json +7 -6
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/folder.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/folder.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/folder.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/folder.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/globe.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/globe.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/share-2.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/share-2.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/share-2.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +0 -14
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +0 -18
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +0 -292
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +0 -32
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +0 -21
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +0 -294
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +0 -34
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +0 -20
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +0 -346
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +0 -13
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +0 -36
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +0 -470
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/index.cjs.js +0 -1
- package/dist/components/file-explorer-header/index.d.ts +0 -3
- package/dist/components/file-explorer-header/index.d.ts.map +0 -1
- package/dist/components/file-explorer-header/index.esm.js +0 -2
- package/dist/components/file-explorer-header/types.d.ts +0 -10
- package/dist/components/file-explorer-header/types.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +0 -8
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +0 -32
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +0 -19
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +0 -322
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js +0 -2
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js +0 -7
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.cjs.js","names":["
|
|
1
|
+
{"version":3,"file":"options.cjs.js","names":["resolveFolderView","argument","resolveSource"],"sources":["../../src/navigation/options.ts"],"sourcesContent":["/**\n * Who asked for a view to be displayed. `GotoSubject` takes it as its seventh argument.\n *\n * - `default`: the page's own navigation (URL, navbar, links)\n * - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere\n */\nexport type NavigationSource = 'default' | 'accountMenu'\n\n/**\n * How the folder pane presents a container, when the caller decides it:\n * - `explorer`: storage header, sidebar and content\n * - `storage`: sidebar and content, under the navbar of someone else's pod\n * - `container`: the container alone\n */\nexport type FolderView = 'explorer' | 'storage' | 'container'\n\nexport interface GotoSubjectOptions {\n source?: NavigationSource\n folderView?: FolderView\n /** Keep the caller's document URL while displaying a different subject. */\n preserveUrl?: boolean\n}\n\n/** The folder view a `GotoSubject` caller asked for, if any. */\nexport function resolveFolderView (argument?: boolean | GotoSubjectOptions | null): FolderView | undefined {\n return typeof argument === 'object' && argument !== null ? argument.folderView : undefined\n}\n\n/**\n * The seventh argument used to be `showNavbar`: `false` meant \"opened by the account menu\"\n * and anything else meant the page's own navigation. That form is still accepted.\n */\nexport function resolveSource (argument?: boolean | GotoSubjectOptions | null): NavigationSource {\n if (typeof argument === 'object' && argument !== null) return argument.source ?? 'default'\n if (argument === undefined) return 'default'\n return argument ? 'default' : 'accountMenu'\n}\n"],"mappings":"AAwBA,SAAgBA,EAAmB,EAAwE,CACzG,OAAO,OAAOC,GAAa,UAAYA,EAAoBA,EAAS,WAAa,IAAA,EACnF,CAMA,SAAgBC,EAAe,EAAkE,CAG/F,OAFI,OAAOD,GAAa,UAAYA,EAA0BA,EAAS,QAAU,UAC7EA,IAAa,IAAA,IACVA,EAD4B,UACL,aAChC,C"}
|
|
@@ -5,9 +5,21 @@
|
|
|
5
5
|
* - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere
|
|
6
6
|
*/
|
|
7
7
|
export type NavigationSource = 'default' | 'accountMenu';
|
|
8
|
+
/**
|
|
9
|
+
* How the folder pane presents a container, when the caller decides it:
|
|
10
|
+
* - `explorer`: storage header, sidebar and content
|
|
11
|
+
* - `storage`: sidebar and content, under the navbar of someone else's pod
|
|
12
|
+
* - `container`: the container alone
|
|
13
|
+
*/
|
|
14
|
+
export type FolderView = 'explorer' | 'storage' | 'container';
|
|
8
15
|
export interface GotoSubjectOptions {
|
|
9
16
|
source?: NavigationSource;
|
|
17
|
+
folderView?: FolderView;
|
|
18
|
+
/** Keep the caller's document URL while displaying a different subject. */
|
|
19
|
+
preserveUrl?: boolean;
|
|
10
20
|
}
|
|
21
|
+
/** The folder view a `GotoSubject` caller asked for, if any. */
|
|
22
|
+
export declare function resolveFolderView(argument?: boolean | GotoSubjectOptions | null): FolderView | undefined;
|
|
11
23
|
/**
|
|
12
24
|
* The seventh argument used to be `showNavbar`: `false` meant "opened by the account menu"
|
|
13
25
|
* and anything else meant the page's own navigation. That form is still accepted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/navigation/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,CAAA;AAExD,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/navigation/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,aAAa,CAAA;AAExD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAA;AAE7D,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,GAAG,UAAU,GAAG,SAAS,CAEzG;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,GAAG,gBAAgB,CAI/F"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
// src/navigation/options.ts
|
|
2
2
|
function e(e) {
|
|
3
|
+
return typeof e == "object" && e ? e.folderView : void 0;
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
3
6
|
return typeof e == "object" && e ? e.source ?? "default" : e === void 0 || e ? "default" : "accountMenu";
|
|
4
7
|
}
|
|
5
|
-
|
|
6
|
-
export { e as resolveSource };
|
|
8
|
+
export { e as resolveFolderView, t as resolveSource };
|
|
7
9
|
|
|
8
10
|
//# sourceMappingURL=options.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.esm.js","names":["
|
|
1
|
+
{"version":3,"file":"options.esm.js","names":["resolveFolderView","argument","resolveSource"],"sources":["../../src/navigation/options.ts"],"sourcesContent":["/**\n * Who asked for a view to be displayed. `GotoSubject` takes it as its seventh argument.\n *\n * - `default`: the page's own navigation (URL, navbar, links)\n * - `accountMenu`: the viewer's own content, shown while the page URL keeps pointing elsewhere\n */\nexport type NavigationSource = 'default' | 'accountMenu'\n\n/**\n * How the folder pane presents a container, when the caller decides it:\n * - `explorer`: storage header, sidebar and content\n * - `storage`: sidebar and content, under the navbar of someone else's pod\n * - `container`: the container alone\n */\nexport type FolderView = 'explorer' | 'storage' | 'container'\n\nexport interface GotoSubjectOptions {\n source?: NavigationSource\n folderView?: FolderView\n /** Keep the caller's document URL while displaying a different subject. */\n preserveUrl?: boolean\n}\n\n/** The folder view a `GotoSubject` caller asked for, if any. */\nexport function resolveFolderView (argument?: boolean | GotoSubjectOptions | null): FolderView | undefined {\n return typeof argument === 'object' && argument !== null ? argument.folderView : undefined\n}\n\n/**\n * The seventh argument used to be `showNavbar`: `false` meant \"opened by the account menu\"\n * and anything else meant the page's own navigation. That form is still accepted.\n */\nexport function resolveSource (argument?: boolean | GotoSubjectOptions | null): NavigationSource {\n if (typeof argument === 'object' && argument !== null) return argument.source ?? 'default'\n if (argument === undefined) return 'default'\n return argument ? 'default' : 'accountMenu'\n}\n"],"mappings":";AAwBA,SAAgBA,EAAmB,GAAwE;CACzG,OAAO,OAAOC,KAAa,YAAYA,IAAoBA,EAAS,aAAa,KAAA;AACnF;AAMA,SAAgBC,EAAe,GAAkE;CAG/F,OAFI,OAAOD,KAAa,YAAYA,IAA0BA,EAAS,UAAU,YAC7EA,MAAa,KAAA,KACVA,IAD4B,YACL;AAChC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/podUtils.cjs.js"),n=require("../utils/paneUtils.cjs.js");let r=require("solid-logic"),i=require("rdflib");var a=500,o=new Map,s=new Map,c=new Map;function l(e){try{let t=new URL(e),[n=``]=t.pathname.split(`/`).filter(Boolean);return`${t.origin}|${n}`}catch{return e}}function u(e){return(0,i.sym)(e).doc().uri}function d(e,t,n,r,i){let o=e.get(t);if(o)return o;let s=r().catch(r=>(console.warn(`Could not load the ${n} for ${t}`,r),e.get(t)===s&&e.delete(t),i));return e.set(t,s),e.size>a&&e.delete(e.keys().next().value),s}function f(t){return d(o,u(t),`owner of the pod`,async()=>{let n=(0,i.sym)(t),r=await e.loadProfileFromURI(n);return r.uri===n.uri&&!e.isWebIdUri(n)?void 0:r.value},void 0)}function p(e){return d(s,l(e),`storages of the pod`,()=>n.getFolderPanesFromURI(
|
|
1
|
+
const e=require("../utils/webIdUtils.cjs.js"),t=require("../utils/podUtils.cjs.js"),n=require("../utils/paneUtils.cjs.js");let r=require("solid-logic"),i=require("rdflib");var a=500,o=new Map,s=new Map,c=new Map;function l(e){try{let t=new URL(e),[n=``]=t.pathname.split(`/`).filter(Boolean);return`${t.origin}|${n}`}catch{return e}}function u(e){return(0,i.sym)(e).doc().uri}function d(e,t,n,r,i){let o=e.get(t);if(o)return o;let s=r().catch(r=>(console.warn(`Could not load the ${n} for ${t}`,r),e.get(t)===s&&e.delete(t),i));return e.set(t,s),e.size>a&&e.delete(e.keys().next().value),s}function f(t){return d(o,u(t),`owner of the pod`,async()=>{let n=(0,i.sym)(t),r=await e.loadProfileFromURI(n);return r.uri===n.uri&&!e.isWebIdUri(n)?void 0:r.value},void 0)}function p(e,t){let r=t?(0,i.sym)(t):(0,i.sym)(e);return d(s,l(e),`storages of the pod`,()=>n.getFolderPanesFromURI(r),[])}function m(e){return e?d(c,e,`storages of the viewer`,async()=>(await t.getPodStorages((0,i.sym)(e))).map(e=>e.uri),[]):Promise.resolve([])}async function h(e=window.location.href){let t=r.authn.currentUser()?.value,[n,i]=await Promise.all([f(e),m(t)]);return{viewer:t,owner:n,storagePanes:await p(e,n),viewerStorages:i}}function g(){o.clear(),s.clear(),c.clear()}function _(e,t){return e.owner===t.owner&&e.viewer===t.viewer&&e.storagePanes.map(e=>e.subject.value).join()===t.storagePanes.map(e=>e.subject.value).join()}function v(e,t){return e.viewerStorages.some(e=>t.startsWith(e))}async function y(e){return v(await h(e),e)}exports.getPodContext=h,exports.isInViewerPod=v,exports.isPageInViewerPod=y,exports.isSamePod=_,exports.resetPodContexts=g;
|
|
2
2
|
//# sourceMappingURL=podContext.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podContext.cjs.js","names":["sym","loadProfileFromURI","isWebIdUri","getFolderPanesFromURI","getPodStorages","authn","require_webIdUtils","require_podUtils","require_paneUtils","solid_logic","rdflib","MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","storagesOf","storagesOfViewer","viewer","storage","getPodContext","
|
|
1
|
+
{"version":3,"file":"podContext.cjs.js","names":["sym","loadProfileFromURI","isWebIdUri","getFolderPanesFromURI","getPodStorages","authn","require_webIdUtils","require_podUtils","require_paneUtils","solid_logic","rdflib","MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","storagesOf","storageSubject","owner","storagesOfViewer","viewer","storage","getPodContext","ownStorages","resetPodContexts","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string, owner?: string): Promise<PaneItem[]> {\n const storageSubject = owner ? sym(owner) : sym(pageUrl)\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(storageSubject), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOfViewer(viewer)\n ])\n const storagePanes = await storagesOf(pageUrl, owner)\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":"A,4KA0BA,IAAMW,EAAiB,IAOjBC,EAAS,IAAI,IACbC,EAAW,IAAI,IACfC,EAAiB,IAAI,IAE3B,SAASC,EAAQ,EAAyB,CACxC,GAAI,CACF,IAAMC,EAAM,IAAI,IAAIC,CAAO,EACrB,CAACC,EAAQ,IAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,EAC3D,MAAO,GAAGA,EAAI,OAAO,GAAGE,GAC1B,MAAQ,CACN,OAAOD,CACT,CACF,CAEA,SAASE,EAAa,EAAyB,CAC7C,OAAA,EAAOnB,EAAAA,IAAAA,CAAIiB,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC,GAC5B,CAKA,SAASG,EACP,EACA,EACA,EACA,EACA,EACY,CACZ,IAAMC,EAAWC,EAAM,IAAIC,CAAG,EAC9B,GAAIF,EAAU,OAAOA,EAErB,IAAMG,EAAsBC,EAAK,CAAC,CAAC,MAAM,IACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,IAAOI,CAAK,EACvDL,EAAM,IAAIC,CAAG,IAAMC,GAASF,EAAM,OAAOC,CAAG,EACzCK,EACR,EAGD,OAFAN,EAAM,IAAIC,EAAKC,CAAO,EAClBF,EAAM,KAAOX,GAAgBW,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,EAC1EE,CACT,CAEA,SAASK,EAAS,EAA8C,CAC9D,OAAOT,EAASR,EAAQO,EAAYF,CAAO,EAAG,mBAAoB,SAAY,CAC5E,IAAMa,GAAA,EAAU9B,EAAAA,IAAAA,CAAIiB,CAAO,EACrBc,EAAQ,MAAM9B,EAAAA,mBAAmB6B,CAAO,EAE9C,OAAOC,EAAM,MAAQD,EAAQ,KAAO,CAAC5B,EAAAA,WAAW4B,CAAO,EAAI,IAAA,GAAYC,EAAM,KAC/E,EAAG,IAAA,EAAS,CACd,CAEA,SAASC,EAAY,EAAiB,EAAqC,CACzE,IAAMC,EAAiBC,GAAA,EAAQlC,EAAAA,IAAAA,CAAIkC,CAAK,GAAA,EAAIlC,EAAAA,IAAAA,CAAIiB,CAAO,EACvD,OAAOG,EAASP,EAAUE,EAAOE,CAAO,EAAG,0BAA6Bd,EAAAA,sBAAsB8B,CAAc,EAAG,CAAC,CAAC,CACnH,CAEA,SAASE,EAAkB,EAA+C,CAExE,OADKC,EACEhB,EAASN,EAAgBsB,EAAQ,yBAA0B,UACxD,MAAMhC,EAAAA,gBAAAA,EAAeJ,EAAAA,IAAAA,CAAIoC,CAAM,CAAC,EAAA,CAAG,IAAI,GAAWC,EAAQ,GAAG,EACpE,CAAC,CAAC,EAHe,QAAQ,QAAQ,CAAC,CAAC,CAIxC,CAGA,eAAsBC,EAAe,EAAkB,OAAO,SAAS,KAA2B,CAChG,IAAMF,EAAS/B,EAAAA,MAAM,YAAY,CAAC,EAAE,MAC9B,CAAC6B,EAAOK,GAAe,MAAM,QAAQ,IAAI,CAC7CV,EAAQZ,CAAO,EAAGkB,EAAiBC,CAAM,CAC3C,CAAC,EAED,MAAO,CAAE,SAAQ,QAAO,aAAA,MADGJ,EAAWf,EAASiB,CAAK,EACd,eAAgBK,CAAY,CACpE,CAGA,SAAgBC,GAA0B,CACxC5B,EAAO,MAAM,EACbC,EAAS,MAAM,EACfC,EAAe,MAAM,CACvB,CAGA,SAAgB2B,EAAW,EAAe,EAAwB,CAChE,OAAOC,EAAE,QAAUC,EAAE,OAASD,EAAE,SAAWC,EAAE,QAC3CD,EAAE,aAAa,IAAI,GAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,IAAMD,EAAE,aAAa,IAAI,GAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,CAClH,CAEA,SAAgBC,EAAe,EAAqB,EAAsB,CACxE,OAAOC,EAAQ,eAAe,KAAK,GAAW9B,EAAI,WAAWqB,CAAO,CAAC,CACvE,CAGA,eAAsBU,EAAmB,EAA+B,CACtE,OAAOF,EAAc,MAAMP,EAActB,CAAG,EAAGA,CAAG,CACpD,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podContext.d.ts","sourceRoot":"","sources":["../../src/navigation/podContext.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGzE,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,YAAY,EAAE,QAAQ,EAAE,CAAA;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;
|
|
1
|
+
{"version":3,"file":"podContext.d.ts","sourceRoot":"","sources":["../../src/navigation/podContext.ts"],"names":[],"mappings":"AAYA,OAAO,EAAyB,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGzE,MAAM,WAAW,UAAU;IACzB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8DAA8D;IAC9D,YAAY,EAAE,QAAQ,EAAE,CAAA;IACxB,oCAAoC;IACpC,cAAc,EAAE,MAAM,EAAE,CAAA;CACzB;AAuED,0EAA0E;AAC1E,wBAAsB,aAAa,CAAE,OAAO,GAAE,MAA6B,GAAG,OAAO,CAAC,UAAU,CAAC,CAOhG;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,IAAK,IAAI,CAIxC;AAED,kGAAkG;AAClG,wBAAgB,SAAS,CAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAGhE;AAED,wBAAgB,aAAa,CAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAExE;AAED,oEAAoE;AACpE,wBAAsB,iBAAiB,CAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAEtE"}
|
|
@@ -3,7 +3,7 @@ import { getPodStorages as n } from "../utils/podUtils.esm.js";
|
|
|
3
3
|
import { getFolderPanesFromURI as r } from "../utils/paneUtils.esm.js";
|
|
4
4
|
import { authn as i } from "solid-logic";
|
|
5
5
|
import { sym as a } from "rdflib";
|
|
6
|
-
|
|
6
|
+
// src/navigation/podContext.ts
|
|
7
7
|
var o = 500, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
8
8
|
function u(e) {
|
|
9
9
|
try {
|
|
@@ -28,35 +28,34 @@ function p(n) {
|
|
|
28
28
|
return i.uri === r.uri && !e(r) ? void 0 : i.value;
|
|
29
29
|
}, void 0);
|
|
30
30
|
}
|
|
31
|
-
function m(e) {
|
|
32
|
-
|
|
31
|
+
function m(e, t) {
|
|
32
|
+
let n = a(t || e);
|
|
33
|
+
return f(c, u(e), "storages of the pod", () => r(n), []);
|
|
33
34
|
}
|
|
34
35
|
function h(e) {
|
|
35
36
|
return e ? f(l, e, "storages of the viewer", async () => (await n(a(e))).map((e) => e.uri), []) : Promise.resolve([]);
|
|
36
37
|
}
|
|
37
38
|
async function g(e = window.location.href) {
|
|
38
|
-
let t = i.currentUser()?.value, [n, r
|
|
39
|
-
p(e),
|
|
40
|
-
m(e),
|
|
41
|
-
h(t)
|
|
42
|
-
]);
|
|
39
|
+
let t = i.currentUser()?.value, [n, r] = await Promise.all([p(e), h(t)]);
|
|
43
40
|
return {
|
|
44
41
|
viewer: t,
|
|
45
42
|
owner: n,
|
|
46
|
-
storagePanes:
|
|
47
|
-
viewerStorages:
|
|
43
|
+
storagePanes: await m(e, n),
|
|
44
|
+
viewerStorages: r
|
|
48
45
|
};
|
|
49
46
|
}
|
|
50
|
-
function _(
|
|
51
|
-
|
|
47
|
+
function _() {
|
|
48
|
+
s.clear(), c.clear(), l.clear();
|
|
52
49
|
}
|
|
53
50
|
function v(e, t) {
|
|
51
|
+
return e.owner === t.owner && e.viewer === t.viewer && e.storagePanes.map((e) => e.subject.value).join() === t.storagePanes.map((e) => e.subject.value).join();
|
|
52
|
+
}
|
|
53
|
+
function y(e, t) {
|
|
54
54
|
return e.viewerStorages.some((e) => t.startsWith(e));
|
|
55
55
|
}
|
|
56
|
-
async function
|
|
57
|
-
return
|
|
56
|
+
async function b(e) {
|
|
57
|
+
return y(await g(e), e);
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
export { g as getPodContext, v as isInViewerPod, y as isPageInViewerPod, _ as isSamePod };
|
|
59
|
+
export { g as getPodContext, y as isInViewerPod, b as isPageInViewerPod, v as isSamePod, _ as resetPodContexts };
|
|
61
60
|
|
|
62
61
|
//# sourceMappingURL=podContext.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podContext.esm.js","names":["MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","sym","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","loadProfileFromURI","isWebIdUri","storagesOf","getFolderPanesFromURI","storagesOfViewer","viewer","getPodStorages","storage","getPodContext","authn","
|
|
1
|
+
{"version":3,"file":"podContext.esm.js","names":["MAX_REMEMBERED","owners","storages","viewerStorages","podKey","url","pageUrl","first","documentKey","sym","remember","existing","cache","key","created","load","what","error","fallback","ownerOf","subject","webId","loadProfileFromURI","isWebIdUri","storagesOf","storageSubject","owner","getFolderPanesFromURI","storagesOfViewer","viewer","getPodStorages","storage","getPodContext","authn","ownStorages","resetPodContexts","isSamePod","a","b","pane","isInViewerPod","context","isPageInViewerPod"],"sources":["../../src/navigation/podContext.ts"],"sourcesContent":["/*\n * Whose pod the page is in, and which storages the viewer owns.\n *\n * Several parts of the page need this: the navbar builds its items from it, the profile heading\n * shows the owner, and the outline decides whether the file explorer header fits. Each part is\n * looked up once and cached, so they no longer each look it up, or read it back from each\n * other's DOM.\n */\n\nimport { authn } from 'solid-logic'\nimport { sym } from 'rdflib'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\nimport { getFolderPanesFromURI, type PaneItem } from '../utils/paneUtils'\nimport { getPodStorages } from '../utils/podUtils'\n\nexport interface PodContext {\n /** WebID of the logged-in user. */\n viewer?: string\n /** WebID of the person whose pod the page is in; unknown when no profile could be found. */\n owner?: string\n /** The storages of that pod, as panes the navbar can open. */\n storagePanes: PaneItem[]\n /** The storages the viewer owns. */\n viewerStorages: string[]\n}\n\nconst MAX_REMEMBERED = 500\n\n// What was found depends on different parts of the URL, so each part is remembered on its own:\n// - the owner depends on the document: the profile lookup can end with that document's own\n// foaf:primaryTopic, so two pages of one pod may not share an owner\n// - the storages depend on the pod, derived from the origin and the first path segment\n// - the viewer's storages depend only on who the viewer is\nconst owners = new Map<string, Promise<string | undefined>>()\nconst storages = new Map<string, Promise<PaneItem[]>>()\nconst viewerStorages = new Map<string, Promise<string[]>>()\n\nfunction podKey (pageUrl: string): string {\n try {\n const url = new URL(pageUrl)\n const [first = ''] = url.pathname.split('/').filter(Boolean)\n return `${url.origin}|${first}`\n } catch {\n return pageUrl\n }\n}\n\nfunction documentKey (pageUrl: string): string {\n return sym(pageUrl).doc().uri\n}\n\n/**\n * Remembers a lookup, unless it failed: a failure is not kept, so that the next request asks again.\n */\nfunction remember<T> (\n cache: Map<string, Promise<T>>,\n key: string,\n what: string,\n load: () => Promise<T>,\n fallback: T\n): Promise<T> {\n const existing = cache.get(key)\n if (existing) return existing\n\n const created: Promise<T> = load().catch(error => {\n console.warn(`Could not load the ${what} for ${key}`, error)\n if (cache.get(key) === created) cache.delete(key)\n return fallback\n })\n cache.set(key, created)\n if (cache.size > MAX_REMEMBERED) cache.delete(cache.keys().next().value as string)\n return created\n}\n\nfunction ownerOf (pageUrl: string): Promise<string | undefined> {\n return remember(owners, documentKey(pageUrl), 'owner of the pod', async () => {\n const subject = sym(pageUrl)\n const webId = await loadProfileFromURI(subject)\n // The lookup falls back to the URL itself when it finds no profile\n return webId.uri === subject.uri && !isWebIdUri(subject) ? undefined : webId.value\n }, undefined)\n}\n\nfunction storagesOf (pageUrl: string, owner?: string): Promise<PaneItem[]> {\n const storageSubject = owner ? sym(owner) : sym(pageUrl)\n return remember(storages, podKey(pageUrl), 'storages of the pod', () => getFolderPanesFromURI(storageSubject), [])\n}\n\nfunction storagesOfViewer (viewer: string | undefined): Promise<string[]> {\n if (!viewer) return Promise.resolve([])\n return remember(viewerStorages, viewer, 'storages of the viewer', async () => {\n return (await getPodStorages(sym(viewer))).map(storage => storage.uri)\n }, [])\n}\n\n/** The context for the pod a URL is in; the page's own URL by default. */\nexport async function getPodContext (pageUrl: string = window.location.href): Promise<PodContext> {\n const viewer = authn.currentUser()?.value\n const [owner, ownStorages] = await Promise.all([\n ownerOf(pageUrl), storagesOfViewer(viewer)\n ])\n const storagePanes = await storagesOf(pageUrl, owner)\n return { viewer, owner, storagePanes, viewerStorages: ownStorages }\n}\n\n/** Forget what was loaded, for example when tests start over. */\nexport function resetPodContexts (): void {\n owners.clear()\n storages.clear()\n viewerStorages.clear()\n}\n\n/** Whether two contexts describe the same pod, so that a navbar built from one fits the other. */\nexport function isSamePod (a: PodContext, b: PodContext): boolean {\n return a.owner === b.owner && a.viewer === b.viewer &&\n a.storagePanes.map(pane => pane.subject.value).join() === b.storagePanes.map(pane => pane.subject.value).join()\n}\n\nexport function isInViewerPod (context: PodContext, url: string): boolean {\n return context.viewerStorages.some(storage => url.startsWith(storage))\n}\n\n/** Whether the URL lies within one of the viewer's own storages. */\nexport async function isPageInViewerPod (url: string): Promise<boolean> {\n return isInViewerPod(await getPodContext(url), url)\n}\n"],"mappings":";;;;;;AA0BA,IAAMA,IAAiB,KAOjBC,oBAAS,IAAI,IAAyC,GACtDC,oBAAW,IAAI,IAAiC,GAChDC,oBAAiB,IAAI,IAA+B;AAE1D,SAASC,EAAQ,GAAyB;CACxC,IAAI;EACF,IAAMC,IAAM,IAAI,IAAIC,CAAO,GACrB,CAACC,IAAQ,MAAMF,EAAI,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO;EAC3D,OAAO,GAAGA,EAAI,OAAO,GAAGE;CAC1B,QAAQ;EACN,OAAOD;CACT;AACF;AAEA,SAASE,EAAa,GAAyB;CAC7C,OAAOC,EAAIH,CAAO,CAAC,CAAC,IAAI,CAAC,CAAC;AAC5B;AAKA,SAASI,EACP,GACA,GACA,GACA,GACA,GACY;CACZ,IAAMC,IAAWC,EAAM,IAAIC,CAAG;CAC9B,IAAIF,GAAU,OAAOA;CAErB,IAAMG,IAAsBC,EAAK,CAAC,CAAC,OAAM,OACvC,QAAQ,KAAK,sBAAsBC,EAAK,OAAOH,KAAOI,CAAK,GACvDL,EAAM,IAAIC,CAAG,MAAMC,KAASF,EAAM,OAAOC,CAAG,GACzCK,EACR;CAGD,OAFAN,EAAM,IAAIC,GAAKC,CAAO,GAClBF,EAAM,OAAOZ,KAAgBY,EAAM,OAAOA,EAAM,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAe,GAC1EE;AACT;AAEA,SAASK,EAAS,GAA8C;CAC9D,OAAOT,EAAST,GAAQO,EAAYF,CAAO,GAAG,oBAAoB,YAAY;EAC5E,IAAMc,IAAUX,EAAIH,CAAO,GACrBe,IAAQ,MAAMC,EAAmBF,CAAO;EAE9C,OAAOC,EAAM,QAAQD,EAAQ,OAAO,CAACG,EAAWH,CAAO,IAAI,KAAA,IAAYC,EAAM;CAC/E,GAAG,KAAA,CAAS;AACd;AAEA,SAASG,EAAY,GAAiB,GAAqC;CACzE,IAAMC,IAAyBhB,EAARiB,KAAyBpB,CAAO;CACvD,OAAOI,EAASR,GAAUE,EAAOE,CAAO,GAAG,6BAA6BqB,EAAsBF,CAAc,GAAG,CAAC,CAAC;AACnH;AAEA,SAASG,EAAkB,GAA+C;CAExE,OADKC,IACEnB,EAASP,GAAgB0B,GAAQ,0BAA0B,aACxD,MAAMC,EAAerB,EAAIoB,CAAM,CAAC,EAAA,CAAG,KAAI,MAAWE,EAAQ,GAAG,GACpE,CAAC,CAAC,IAHe,QAAQ,QAAQ,CAAC,CAAC;AAIxC;AAGA,eAAsBC,EAAe,IAAkB,OAAO,SAAS,MAA2B;CAChG,IAAMH,IAASI,EAAM,YAAY,CAAC,EAAE,OAC9B,CAACP,GAAOQ,KAAe,MAAM,QAAQ,IAAI,CAC7Cf,EAAQb,CAAO,GAAGsB,EAAiBC,CAAM,CAC3C,CAAC;CAED,OAAO;EAAE;EAAQ;EAAO,cAAA,MADGL,EAAWlB,GAASoB,CAAK;EACd,gBAAgBQ;CAAY;AACpE;AAGA,SAAgBC,IAA0B;CAGxC,AAFAlC,EAAO,MAAM,GACbC,EAAS,MAAM,GACfC,EAAe,MAAM;AACvB;AAGA,SAAgBiC,EAAW,GAAe,GAAwB;CAChE,OAAOC,EAAE,UAAUC,EAAE,SAASD,EAAE,WAAWC,EAAE,UAC3CD,EAAE,aAAa,KAAI,MAAQE,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK,MAAMD,EAAE,aAAa,KAAI,MAAQC,EAAK,QAAQ,KAAK,CAAC,CAAC,KAAK;AAClH;AAEA,SAAgBC,EAAe,GAAqB,GAAsB;CACxE,OAAOC,EAAQ,eAAe,MAAK,MAAWpC,EAAI,WAAW0B,CAAO,CAAC;AACvE;AAGA,eAAsBW,EAAmB,GAA+B;CACtE,OAAOF,EAAc,MAAMR,EAAc3B,CAAG,GAAGA,CAAG;AACpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/navigation/state.ts
|
|
2
2
|
var e = {
|
|
3
3
|
profile: "profile",
|
|
4
4
|
social: "friends",
|
|
@@ -35,7 +35,6 @@ function o(e) {
|
|
|
35
35
|
function s() {
|
|
36
36
|
window.history.replaceState(o(window.history.state), "", window.location.href);
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { s as clearPaneState, a as nextHistoryState, r as parseNavigationState, i as readNavigationState, n as viewFromPane, o as withoutPaneState };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=state.esm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getOutliner as e } from "../index.esm.js";
|
|
2
|
-
|
|
2
|
+
// src/outline/context.ts
|
|
3
3
|
function t(t, n, r, i, a) {
|
|
4
4
|
return {
|
|
5
5
|
dom: t,
|
|
@@ -12,7 +12,6 @@ function t(t, n, r, i, a) {
|
|
|
12
12
|
environment: a
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { t as createContext };
|
|
17
16
|
|
|
18
17
|
//# sourceMappingURL=context.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("../icons/person.cjs.js"),n=require("../icons/friends.cjs.js");let r=require("solid-ui");r=e.__toESM(r);function i(e,t,n){if(e)return typeof e.icon==`function`?e.icon(t,n):e.icon}async function a(e,a,o,s){return typeof s==`function`?(await Promise.all(o.map(async o=>{let c=o.label(e,a);if(!c)return;let l;l=o.name===`profile`?t.default:o.name===`social`?n.default:await i(o,e,a)||void 0;let u=r.utils.AJARImage(l||``,c,c,a.dom);return u.setAttribute(`slot`,`left-icon`),{label:c,icon:u,action:()=>s(e,o.name)}}))).filter(e=>e!==void 0):[]}exports.getPaneIcon=i,exports.getPaneItems=a;
|
|
2
|
+
//# sourceMappingURL=fileExplorerHelpers.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileExplorerHelpers.cjs.js","names":["personIcon","friendsIcon","UI","require_runtime","require_person","require_friends","solid_ui","getPaneIcon","pane","subject","context","getPaneItems","dispatchOpenPane","relevantPanes","label","iconSrc","icon","item"],"sources":["../../src/outline/fileExplorerHelpers.ts"],"sourcesContent":["import * as UI from 'solid-ui'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport personIcon from '../icons/person.svg'\nimport friendsIcon from '../icons/friends.svg'\n\ntype ExplorerPane = Omit<PaneDefinition, 'icon'> & {\n icon: string | ((subject: NamedNode, context: DataBrowserContext) => string | undefined)\n}\n\nexport function getPaneIcon (\n pane: ExplorerPane | undefined,\n subject: NamedNode,\n context: DataBrowserContext\n) {\n if (!pane) return undefined\n\n return typeof pane.icon === 'function'\n ? pane.icon(subject, context)\n : pane.icon\n}\n\nexport async function getPaneItems (\n subject: NamedNode,\n context: DataBrowserContext,\n relevantPanes: ExplorerPane[],\n dispatchOpenPane: ((subject: NamedNode, paneName: string) => void) | undefined\n) {\n if (typeof dispatchOpenPane !== 'function') return []\n\n const menuItems = await Promise.all(relevantPanes.map(async pane => {\n const label = pane.label(subject, context)\n if (!label) return undefined\n\n let iconSrc: string | undefined\n if (pane.name === 'profile') {\n iconSrc = personIcon\n } else if (pane.name === 'social') {\n iconSrc = friendsIcon\n } else {\n iconSrc = await getPaneIcon(pane, subject, context) || undefined\n }\n\n const icon = UI.utils.AJARImage(iconSrc || '', label, label, context.dom)\n icon.setAttribute('slot', 'left-icon')\n\n return {\n label,\n icon,\n action: () => dispatchOpenPane(subject, pane.name)\n }\n }))\n\n return menuItems.filter((item): item is NonNullable<typeof item> => item !== undefined)\n}\n"],"mappings":"A,0KAUA,SAAgBO,EACd,EACA,EACA,EACA,CACA,GAAKC,EAEL,OAAO,OAAOA,EAAK,MAAS,WACxBA,EAAK,KAAKC,EAASC,CAAO,EAC1BF,EAAK,IACX,CAEA,eAAsBG,EACpB,EACA,EACA,EACA,EACA,CA0BA,OAzBI,OAAOC,GAAqB,YAyBzB,MAvBiB,QAAQ,IAAIC,EAAc,IAAI,KAAM,IAAQ,CAClE,IAAMC,EAAQN,EAAK,MAAMC,EAASC,CAAO,EACzC,GAAI,CAACI,EAAO,OAEZ,IAAIC,EACJ,AAKEA,EALEP,EAAK,OAAS,UACNR,EAAAA,QACDQ,EAAK,OAAS,SACbP,EAAAA,QAEA,MAAMM,EAAYC,EAAMC,EAASC,CAAO,GAAK,IAAA,GAGzD,IAAMM,EAAOd,EAAG,MAAM,UAAUa,GAAW,GAAID,EAAOA,EAAOJ,EAAQ,GAAG,EAGxE,OAFAM,EAAK,aAAa,OAAQ,WAAW,EAE9B,CACL,QACA,OACA,WAAcJ,EAAiBH,EAASD,EAAK,IAAI,CACnD,CACF,CAAC,CAAC,EAAA,CAEe,OAAQ,GAA2CS,IAAS,IAAA,EAAS,EAzBnC,CAAC,CA0BtD,C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DataBrowserContext, PaneDefinition } from '../../node_modules/pane-registry';
|
|
2
|
+
import { NamedNode } from '../../node_modules/rdflib';
|
|
3
|
+
type ExplorerPane = Omit<PaneDefinition, 'icon'> & {
|
|
4
|
+
icon: string | ((subject: NamedNode, context: DataBrowserContext) => string | undefined);
|
|
5
|
+
};
|
|
6
|
+
export declare function getPaneIcon(pane: ExplorerPane | undefined, subject: NamedNode, context: DataBrowserContext): string | undefined;
|
|
7
|
+
export declare function getPaneItems(subject: NamedNode, context: DataBrowserContext, relevantPanes: ExplorerPane[], dispatchOpenPane: ((subject: NamedNode, paneName: string) => void) | undefined): Promise<{
|
|
8
|
+
label: string;
|
|
9
|
+
icon: any;
|
|
10
|
+
action: () => void;
|
|
11
|
+
}[]>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=fileExplorerHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileExplorerHelpers.d.ts","sourceRoot":"","sources":["../../src/outline/fileExplorerHelpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAIvC,KAAK,YAAY,GAAG,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,GAAG;IACjD,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,SAAS,CAAC,CAAA;CACzF,CAAA;AAED,wBAAgB,WAAW,CACzB,IAAI,EAAE,YAAY,GAAG,SAAS,EAC9B,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,sBAO5B;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,kBAAkB,EAC3B,aAAa,EAAE,YAAY,EAAE,EAC7B,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS;;;;KA4B/E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "../icons/person.esm.js";
|
|
2
|
+
import t from "../icons/friends.esm.js";
|
|
3
|
+
import * as n from "solid-ui";
|
|
4
|
+
// src/outline/fileExplorerHelpers.ts
|
|
5
|
+
function r(e, t, n) {
|
|
6
|
+
if (e) return typeof e.icon == "function" ? e.icon(t, n) : e.icon;
|
|
7
|
+
}
|
|
8
|
+
async function i(i, a, o, s) {
|
|
9
|
+
return typeof s == "function" ? (await Promise.all(o.map(async (o) => {
|
|
10
|
+
let c = o.label(i, a);
|
|
11
|
+
if (!c) return;
|
|
12
|
+
let l;
|
|
13
|
+
l = o.name === "profile" ? e : o.name === "social" ? t : await r(o, i, a) || void 0;
|
|
14
|
+
let u = n.utils.AJARImage(l || "", c, c, a.dom);
|
|
15
|
+
return u.setAttribute("slot", "left-icon"), {
|
|
16
|
+
label: c,
|
|
17
|
+
icon: u,
|
|
18
|
+
action: () => s(i, o.name)
|
|
19
|
+
};
|
|
20
|
+
}))).filter((e) => e !== void 0) : [];
|
|
21
|
+
}
|
|
22
|
+
export { r as getPaneIcon, i as getPaneItems };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=fileExplorerHelpers.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileExplorerHelpers.esm.js","names":["personIcon","friendsIcon","person_default","friends_default","UI","getPaneIcon","pane","subject","context","getPaneItems","dispatchOpenPane","relevantPanes","label","iconSrc","icon","item"],"sources":["../../src/outline/fileExplorerHelpers.ts"],"sourcesContent":["import * as UI from 'solid-ui'\nimport type { DataBrowserContext, PaneDefinition } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport personIcon from '../icons/person.svg'\nimport friendsIcon from '../icons/friends.svg'\n\ntype ExplorerPane = Omit<PaneDefinition, 'icon'> & {\n icon: string | ((subject: NamedNode, context: DataBrowserContext) => string | undefined)\n}\n\nexport function getPaneIcon (\n pane: ExplorerPane | undefined,\n subject: NamedNode,\n context: DataBrowserContext\n) {\n if (!pane) return undefined\n\n return typeof pane.icon === 'function'\n ? pane.icon(subject, context)\n : pane.icon\n}\n\nexport async function getPaneItems (\n subject: NamedNode,\n context: DataBrowserContext,\n relevantPanes: ExplorerPane[],\n dispatchOpenPane: ((subject: NamedNode, paneName: string) => void) | undefined\n) {\n if (typeof dispatchOpenPane !== 'function') return []\n\n const menuItems = await Promise.all(relevantPanes.map(async pane => {\n const label = pane.label(subject, context)\n if (!label) return undefined\n\n let iconSrc: string | undefined\n if (pane.name === 'profile') {\n iconSrc = personIcon\n } else if (pane.name === 'social') {\n iconSrc = friendsIcon\n } else {\n iconSrc = await getPaneIcon(pane, subject, context) || undefined\n }\n\n const icon = UI.utils.AJARImage(iconSrc || '', label, label, context.dom)\n icon.setAttribute('slot', 'left-icon')\n\n return {\n label,\n icon,\n action: () => dispatchOpenPane(subject, pane.name)\n }\n }))\n\n return menuItems.filter((item): item is NonNullable<typeof item> => item !== undefined)\n}\n"],"mappings":";;;;AAUA,SAAgBK,EACd,GACA,GACA,GACA;CACA,IAAKC,GAEL,OAAO,OAAOA,EAAK,QAAS,aACxBA,EAAK,KAAKC,GAASC,CAAO,IAC1BF,EAAK;AACX;AAEA,eAAsBG,EACpB,GACA,GACA,GACA,GACA;CA0BA,OAzBI,OAAOC,KAAqB,cAyBzB,MAvBiB,QAAQ,IAAIC,EAAc,IAAI,OAAM,MAAQ;EAClE,IAAMC,IAAQN,EAAK,MAAMC,GAASC,CAAO;EACzC,IAAI,CAACI,GAAO;EAEZ,IAAIC;EACJ,AAKEA,IALEP,EAAK,SAAS,YACNN,IACDM,EAAK,SAAS,WACbL,IAEA,MAAMI,EAAYC,GAAMC,GAASC,CAAO,KAAK,KAAA;EAGzD,IAAMM,IAAOV,EAAG,MAAM,UAAUS,KAAW,IAAID,GAAOA,GAAOJ,EAAQ,GAAG;EAGxE,OAFAM,EAAK,aAAa,QAAQ,WAAW,GAE9B;GACL;GACA;GACA,cAAcJ,EAAiBH,GAASD,EAAK,IAAI;EACnD;CACF,CAAC,CAAC,EAAA,CAEe,QAAQ,MAA2CS,MAAS,KAAA,CAAS,IAzBnC,CAAC;AA0BtD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0 0 5px}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.file-explorer-header{flex-wrap:wrap;justify-content:flex-start;align-items:center;display:flex}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{vertical-align:top;border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}.paneDiv,.exceptionPane{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block;overflow-x:hidden}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}@media (width<=600px){.obj,.iconTD{vertical-align:top;font-size:100%;margin:0!important}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js"),s=require("../navigation/chrome.cjs.js"),c=require("../navigation/podContext.cjs.js"),l=require("../navigation/state.cjs.js"),u=require("../navigation/events.cjs.js"),d=require("../navigation/options.cjs.js"),f=require("../navigation/navbarVisibility.cjs.js");require("../components/file-explorer-header/index.cjs.js");let p=require("solid-ui");p=e.__toESM(p);let m=require("solid-logic"),h=require("pane-registry");h=e.__toESM(h);let g=require("rdflib");g=e.__toESM(g);function _(e){let _=e.dom;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let v=this,y=this,b=[];this.selection=b,this.ancestor=p.utils.ancestor,this.sparql=g.UpdateManager,this.kb=m.store;let x=m.store,S=m.store.fetcher;_.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let C=this.outlineElement;this.init=function(){let e=E();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},w.lastkbsize=0;function w(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return p.log.info(`BENCHMARK: kb delta: `+(x.statements.length-w.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),w.lastkbsize=x.statements.length,r}function T(e,t,r){let i=p.utils.AJARImage(n.outlineIcons.src.icon_remove_node,`remove`,void 0,_);return i.addEventListener(`click`,ae),i.node=r,i.setAttribute(`about`,t.toNT()),i.style.marginLeft=`5px`,i.style.marginRight=`10px`,e.appendChild(i),i}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],y.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=g.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=S.getState(r),a,o,s;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,s=ie;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,s=G;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,s=K,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,s=G;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,s=G,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,s=G,o=`cannot fetch`;break;default:p.log.error(`?? state = `+i)}let c=p.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),_);return c.classList.add(`objectValueAccessIcon`),c.setAttribute(`uri`,t),c.addEventListener(`click`,s),I(c,r),e.appendChild(c),c},this.outlineObjectTD=function(e,t,n,r){let i=_.createElement(`td`);return i.classList.add(`obj`),i.setAttribute(`notSelectable`,`false`),e?((e.termType===`NamedNode`||e.termType===`BlankNode`||e.termType===`Literal`&&e.value.slice&&(e.value.slice(0,6)===`ftp://`||e.value.slice(0,8)===`https://`||e.value.slice(0,7)===`http://`))&&(i.setAttribute(`about`,e.toNT()),i.appendChild(p.utils.AJARImage(p.icons.originalIconBase+`tbl-expand-trans.png`,`expand`,void 0,_)).addEventListener(`click`,U)),i.setAttribute(`class`,`obj`),x.whether(e,p.ns.rdf(`type`),p.ns.link(`Request`))&&(i.className=`undetermined`),t||=le,i.appendChild(t(e)),n&&T(i,e,n),i.tabulatorSelect=function(){V(this,!0)},i.tabulatorDeselect=function(){V(this,!1)},i.addEventListener(`click`,q),i):(i.textContent=`No object available.`,i)},this.outlinePredicateTD=function(e,t,r,i){let a=_.createElement(`TD`);a.setAttribute(`about`,e.toNT()),a.setAttribute(`class`,i?`pred internal`:`pred`);let o;switch(e.termType){case`BlankNode`:a.className=`undetermined`;break;case`NamedNode`:o=p.utils.predicateLabelForXML(e,r);break;case`Collection`:o=p.utils.predicateLabelForXML(e.elements[0],r)}o=o?o.slice(0,1).toUpperCase()+o.slice(1):`...`;let s=_.createElement(`TD`);s.classList.add(`labelTD`),s.setAttribute(`notSelectable`,`true`),s.appendChild(_.createTextNode(o)),a.appendChild(s),s.style.width=`100%`,a.appendChild(F.construct(_));for(let e in n.outlineIcons.termWidgets){if(!t||!t.AJAR_statement)break;n.outlineIcons.termWidgets[e].filter&&n.outlineIcons.termWidgets[e].filter(t.AJAR_statement,`pred`,r)&&F.addIcon(a,n.outlineIcons.termWidgets[e])}return a.tabulatorSelect=function(){V(this,!0)},a.tabulatorDeselect=function(){V(this,!1)},a.addEventListener(`click`,q),a};function E(){return ee(`OutlineView`,`Resource browser`)}function D(e){f.refreshNavbarVisibility(e.uri).catch(e=>p.log.error(`Failed to update navbar visibility: `+e))}function ee(e){if(document.getElementById(`MainContent`)||document.body,e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`table`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function te(e,t){e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e);let n=t.session.paneRegistry,r=n.list.filter(n=>n.label(e,t)&&!n.global&&n.name!==`sharing`);if(r.length===0)return[n.byName(`internal`)];let i=await p.login.filterAvailablePanes(r);return i.length===0?[r[0]]:n.list.indexOf(r[0])<n.list.indexOf(i[0])?[r[0]].concat(i):i}function ne(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function re(e){let t=_.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function O(t,n,r,i){if(!t||!r)return;let a;try{p.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=_.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=_.createElement(`pre`);a.appendChild(t),t.appendChild(_.createTextNode(p.utils.stackString(e)))}a.classList.add(`paneDiv`);let o=t.querySelector(`.paneDiv`);o?o.replaceWith(a):t.appendChild(a)}function k(e,t){let n=_.getElementById(`OutlineView`);if(!n)return;let r=e.toNT(),i=n.querySelector(`td.paneView[about="`+r+`"]`);if(!i)return;let a=i.querySelector(`file-explorer-provider`);a&&(t?(re(!!t.requireQueryButton),a.openSelectedPane?.(t),O(a,e,t,a.paneRenderOptions)):p.log.warn(`outline: Unable to open pane in place: pane is undefined.`))}async function A(t,n,r){r||={};let i=_.createElement(`tr`);r.hover&&i.classList.add(`hoverControl`);let o=i.appendChild(_.createElement(`td`));o.classList.add(`paneView`,`tdFlex`),o.setAttribute(`notSelectable`,`true`),o.setAttribute(`about`,t.toNT()),o.setAttribute(`colspan`,`2`);let l=o.appendChild(_.createElement(`file-explorer-provider`));l.context=e,l.subjectUri=t.uri,l.onBack=()=>W({target:l});let u=r.hideList?[]:await te(t,e);l.relevantPanes=u,l.pane=n||ne(u,t);let d=!!(t&&t.uri&&t.site&&t.site().uri===t.uri),f=!!r.headerOnlyInViewerPod;return l.showHeader=s.deriveExplorerHeader({isRootResource:d,isWebId:a.isWebIdUri(t),viewerPodOnly:f,inViewerPod:!f||await c.isPageInViewerPod(document.location.href)}),l.paneRenderOptions=r,l.soloPane=r.solo,l.openPane=(e,t)=>k(e,h.byName(t)),l.handleAccessClick=()=>k(t,h.byName(`sharing`)),l.pane&&(i.classList.add(`outlinePaneRow`),O(l,t,l.pane,r)),i}function j(e){let t=e.parentNode,n=t.parentNode,r=_.createElement(`table`);r.classList.add(`placeholderTable`),n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let M=this.propertyTable=function(e,t,n,r){return p.log.debug(`Property table for: `+e),e=x.canon(e),t?(p.log.info(`Re-expand: `+t),t):(t=_.createElement(`table`),t.classList.add(`tableFullWidth`),A(e,n,r).then(e=>{t.appendChild(e)}),t)};function N(e,t,n){let r=e.createElement(`TR`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`);let i=y.outlinePredicateTD(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=N;function P(e,t,n,r){if(p.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(p.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(p.utils.RDFComparePredicateObject));let s=t.length;for(a=0;a<s;a++){let c=t[a];if(r&&!r(c.predicate,n))continue;let l=N(_,c,n);e.appendChild(l);let u=l.firstChild,d=$.defaults[c.predicate.uri],f=0,m=0,h=0;for(o=0;o+a<s&&t[a+o].predicate.sameTerm(c.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&f++,i(t[a+o]).lang&&v.labeller.LanguagePreference&&(m+=1,i(t[a+o]).lang.indexOf(v.labeller.LanguagePreference)>=0&&h++);if(h>0&&m===f+1){for(let e=a;e<=a+f;e++)if(v.labeller.LanguagePreference&&i(t[e]).lang.indexOf(v.labeller.LanguagePreference)>=0){l.appendChild(y.outlineObjectTD(i(t[e]),d,void 0,c));break}a+=f}else l.appendChild(y.outlineObjectTD(i(c),d,void 0,c)),l.showNobj=function(r){let s=o-f,l=2*r<s?r:s,m=[];if(s!==1){u.setAttribute(`rowspan`,l===s?s:r+1);let f;l<s&&l===1&&u.setAttribute(`rowspan`,2);let h=0;for(f=1;f<o;f++)if(x.canon(i(t[a+f])).sameTerm(x.canon(i(t[a+f-1]))))p.log.info(`there are duplicates here: %s`,t[a+f-1]);else{h++,c=t[a+f],d=$.defaults[c.predicate.uri];let r=_.createElement(`tr`);r.style.colspan=`1`,r.appendChild(y.outlineObjectTD(i(t[a+f]),d,void 0,c)),r.AJAR_statement=c,r.AJAR_inverse=n,e.appendChild(r),h>=l&&(r.style.display=`none`,m.push(r))}l===s&&u.setAttribute(`rowspan`,h+1)}if(l<s){let t=_.createElement(`tr`),n=t.appendChild(_.createElement(`td`));if(n.classList.add(`obj`),n.setAttribute(`notSelectable`,`false`),s>r){let e=_.createElement(`a`);n.appendChild(e);let t=(function(e){return e(u,o,f,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(p.utils.AJARImage(p.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,_)),e.appendChild(_.createTextNode(s-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(p.utils.AJARImage(p.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,_)),t.setAttribute(`rowspan`,s+1));for(let e=0;e<m.length;e++){let t=m[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},l.showAllobj=function(){l.showNobj(o-f)},l.showNobj(10),a+=o-1}}this.appendPropertyTRs=P;let F={};globalThis.termWidget=F,F.construct=function(e){e||=document;let t=e.createElement(`TD`);return t.setAttribute(`class`,`iconTD`),t.setAttribute(`notSelectable`,`true`),t},F.addIcon=function(e,t,n){let r=e.childNodes[1];if(!r)return;let i=p.utils.AJARImage(t.src,t.alt,t.tooltip,_);r.appendChild(i),n&&i.addEventListener(`click`,n)},F.removeIcon=function(e,t){let n=e.childNodes[1],r;if(n)for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e],a=i.src;try{r=_.location.href.split(`?`)[0]}catch{r=``}a===g.uri.join(t.src,r)&&n.removeChild(i)}},F.replaceIcon=function(e,t,n,r){F.removeIcon(e,t),F.addIcon(e,n,r)};function I(e,t){p.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!v.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};S.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),S.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),S.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function L(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function R(e){let t=y.targetOf(e).parentNode;F.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,z),t.parentNode.parentNode.removeAttribute(`optional`)}function z(e){let t=y.targetOf(e).parentNode;F.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,R),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function B(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff;for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(n.getAttribute(`predTR`)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&F.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?R:z),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),F.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousSibling&&n.previousSibling.nodeName===`TR`)n=n.previousSibling;else break}this.statusBarClick=function(e){let t=p.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&_.getElementById(`UserURI`)&&(_.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(typeof sourceWidget<`u`){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<b.length;e++){if(!b[e].parentNode)continue;let t=b[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return b};function V(e,t){if(e.nodeName!==`TD`)throw p.log.debug(`down`+e.nodeName),Error(`Expected TD in setSelected: `+e.nodeName+` : `+e.textContent);p.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&B(e,1),b.push(e);let t=p.utils.getTerm(e);y.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;m.store.updater.editable(t.uri,x)&&r.indexOf(`pred`)>=0&&F.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else p.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&B(e,-1),r.indexOf(`pred`)>=0&&F.removeIcon(e,n.outlineIcons.termWidgets.addTri),b=b.filter(function(t){return t===e}),p.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&y.showSource(),e.setAttribute(`class`,r)}function H(){let e=b.length;for(let t=e-1;t>=0;t--)V(b[t],!1);b=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return p.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||b[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}H(),V(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}H(),V(r,!0);break;case`right`:if(H(),n.nextSibling||n.lastChild.tagName===`strong`)V(n.nextSibling,!0);else{let e=_.evaluate(`table/div/tr/td[2]`,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;V(e,!0)}break;case`left`:if(H(),n.previousSibling&&n.previousSibling.className===`undetermined`)return V(n.previousSibling,!0),!0;V(p.utils.ancestor(n.parentNode,`TD`),!0);break;case`moveTo`:H(),V(t,!0)}(e===`down`||e===`up`)&&(r.tabulatorSelect||this.walk(e))},this.OutlinerKeypressPanel=function(e){p.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&_.getElementById(`UserURI`)&&(_.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]||(o(`right`,a),t(p.utils.getAbout(x,b[0]))),!0}let r,i;if(p.utils.getTarget(e).tagName===`TEXTAREA`||p.utils.getTarget(e).id===`UserURI`||b.length>1)return;if(b.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,y.focusTd),t(p.utils.getAbout(x,b[0])));return}let a=b[0];switch(S.removeCallback(`done`,`setSelectedAfterward`),S.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(p.utils.getTarget(e).tagName===`HTML`){let e=p.utils.getAbout(x,a);r=a.parentNode.AJAR_statement.why,i=m.store.updater.editable(r.uri,x),e?v.GotoSubject(e,!0):i&&y.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(p.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=m.store.updater.editable(r.uri,x),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=p.utils.ancestor(a.parentNode,`TD`);X(a,p.utils.getAbout(x,e));break}case 39:{let e=p.utils.getAbout(x,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstChild.tagName!==`TABLE`&&(S.addCallback(`done`,n),S.addCallback(`fail`,n),Y(a,e,{pane:h.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){y.UserInput.copyToClipboard(y.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){y.UserInput.pasteFromClipboard(y.clipboardAddress,a);break}break;default:p.utils.getTarget(e).tagName}}t(p.utils.getAbout(x,b[0]))},this.OutlinerMouseclickPanel=function(e){switch(y.UserInput._tabulatorMode){case 0:oe(e);break;case 1:y.UserInput.Click(e)}};function U(e){let t=y.targetOf(e),n=t.parentNode,r=p.utils.getAbout(x,t),i=e.altKey?h.byName(`internal`):void 0;e.shiftKey?Z(n,r,i):e.altKey?Y(n,r,{pane:h.byName(`internal`),immediate:!0}):Y(n,r)}function W(e){let t=y.targetOf(e),n=p.utils.getAbout(x,t),r=e.altKey?h.byName(`internal`):void 0,i=t.parentNode.parentNode;X(i,n,r)}function G(e){let t=y.targetOf(e).getAttribute(`uri`);e.altKey?S.fetch(g.uri.docpart(t),{force:!0}):S.refresh(x.sym(g.uri.docpart(t)))}function K(e){let t=y.targetOf(e).getAttribute(`uri`);e.altKey?S.fetch(g.uri.docpart(t),{force:!0}):S.refresh(x.sym(g.uri.docpart(t)))}function ie(e){let t=y.targetOf(e).getAttribute(`uri`);S.fetch(g.uri.docpart(t))}function ae(e){let t=y.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),j(n)}function q(e){if(y.UserInput._tabulatorMode)return y.UserInput.Click(e);let t=y.targetOf(e),n;for(n=p.utils.ancestor(t,`TD`);n&&n.getAttribute(`notSelectable`)!==`false`;n=p.utils.ancestor(n.parentNode,`TD`));if(!n)return;let r=L(n);if(p.log.debug(`Was node selected before: `+r),e.altKey)V(n,!L(n));else if(e.shiftKey)V(n,!0);else{if(H(),y.UserInput.clearInputAndSave(e),V(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=m.store.updater.editable(i.uri,x);r&&a&&y.UserInput.Click(e,b[0])}p.log.debug(`Was node selected after: `+L(n)+`, count=`+b.length),e.stopPropagation()}function oe(e){p.log.info(`@TabulatorMousedown, dom.location is now `+_.location);let t=y.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(y.UserInput.clearMenu(),y.UserInput.lastModified&&y.UserInput.lastModified.parentNode.nextSibling&&y.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&y.UserInput.clearInputAndSave(e),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices)&&y.UserInput.clearMenu(),e&&e.stopPropagation())}function J(e){_.title=p.utils.label(e),_.location.href.startsWith(e.site().uri)}function Y(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;p.log.info(`@outlineExpand, dom is now `+_.location),S.removeCallback(`done`,`expand`),S.removeCallback(`fail`,`expand`);let o=x.canon(t);function s(){if(o=x.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;if(p.log.info(`@@ REPAINTING `),!i)t=M(o,void 0,r,n);else{for(p.log.info(` ... p is `+e),t=e.firstChild;t.nextSibling&&(p.log.info(` ... checking node `+t),t.nodeName!==`table`);t=t.nextSibling);t=M(o,t,r,n)}i=!0,p.utils.ancestor(e,`TABLE`)&&p.utils.ancestor(e,`TABLE`).style.backgroundColor===`white`?t.style.backgroundColor=`#eee`:t.style.backgroundColor=`white`,p.utils.emptyNode(e).appendChild(t),y.focusTd=e,p.log.debug(`expand: Node for `+o+` expanded`);let a=x.each(o,p.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&p.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),S.lookUpThing(a[e],o)}function c(e){if(arguments[3])return!0;let t=x.canon(o);p.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=x.sym(g.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=x.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=g.uri.docpart(r[t]);n;n=x.HTTPRedirects[n])if(e===n)return!0;return!!x.anyStatementMatching(t,void 0,void 0,n)}()||(p.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),s(),!1)}n.solo&&J(o),p.log.debug(`outlineExpand: dereferencing `+o);let l=_.createElement(`span`);e.appendChild(l),S.addCallback(`done`,c),S.addCallback(`fail`,c);let u=[];if(o.uri&&o.uri.split(`:`)[0]===`rdf`)s();else{for(let e=0;e<u.length;e++){let t;if(t===u[e](o)){s(),p.log.debug(`outline 1815`),t[1]&&C.removeChild(C.lastChild);return}}if(o.uri&&!a&&!p.widgets.isAudio(o)&&!p.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(n,a){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let o=i(n,a),s=o?r(o):n,c=p.widgets.errorMessageBlock(_,s,`#fee`,a instanceof Error?a:void 0);t&&c.setAttribute(`data-outline-error-for`,t),e.appendChild(c)},c=!1,l=S.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(S.lookUpThing(o),s(),n.solo&&J(o)):(c=!0,a(t,void 0))});l&&typeof l.catch==`function`&&l.catch(function(e){c||(c=!0,a(e,e))})}else s()}}function X(e,t){let n=p.utils.ancestor(e,`TR`);n=p.utils.ancestor(n.parentNode,`TR`);let r;n&&(r=n.AJAR_statement);let i;for(i=e.parentNode;i.tagName!==`TD`;i=i.parentNode)if(i===void 0){alert(`Not enclosed in TD!`);return}p.log.debug(`Collapsing subject `+t);let a;r&&(p.log.debug(`looking up pred `+r.predicate.uri+`in defaults`),a=$.defaults[r.predicate.uri]),p.log.debug(`view= `+a);let o;i.parentNode.parentNode.id===`outline`&&(o=i.parentNode),y.replaceTD(y.outlineObjectTD(t,a,o,r),i)}this.replaceTD=function(e,t){let n;L(t)&&(n=!0);for(let e=b.length-1;e>-1;e--)for(let n=b[e];n.parentNode;n=n.parentNode)n===t&&V(b[e],!1);t.parentNode.replaceChild(e,t),n&&V(e,!0)};function Z(e,t){let n=null;for(let t=e.parentNode;t;t=t.parentNode)p.log.debug(`level `+t.tagName),t.tagName===`TD`&&(n=t);p.utils.emptyNode(n).appendChild(M(t)),J(t),n.setAttribute(`about`,t.toNT())}v.outlineRefocus=Z,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&v.GotoFormURI(e)},this.GotoFormURI=function(e){se(_.getElementById(`UserURI`).value)};function se(e){let t=x.sym(e);this.GotoSubject(t,!0)}let Q=0;function ce(e,t,n){let r=++Q,i=t.uri,a=n.uri.split(`#`)[0];if(!i.endsWith(`/`)||!a.startsWith(i)||a===i)return;let o=[],s=a.slice(i.length).split(`/`),c=i;s.forEach((e,t)=>{e&&(c+=t<s.length-1?e+`/`:e,o.push(c))});let l=t=>Array.from(e.querySelectorAll(`td.obj[about]`)).find(e=>e.getAttribute(`about`)===x.sym(t).toNT()),u=t=>new Promise(n=>{let i=l(t);if(i)return n(i);let a=setTimeout(()=>{o.disconnect(),n(null)},1e4),o=new MutationObserver(()=>{let e=l(t);(e||r!==Q)&&(clearTimeout(a),o.disconnect(),n(e))});o.observe(e,{childList:!0,subtree:!0})});(async()=>{for(let e of o){let t=await u(e);if(!t||r!==Q)return;(!t.firstChild||t.firstChild.nodeName!==`TABLE`)&&Y(t,x.sym(e)),e===o[o.length-1]&&typeof t.scrollIntoView==`function`&&t.scrollIntoView({block:`nearest`})}})().catch(e=>p.log.warn(`outline: could not open `+n.uri+` inside `+i+`: `+e))}this.GotoURIinit=function(e){let t=x.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o){let s=d.resolveSource(o)!==`accountMenu`,c=E();s&&(!a||a===c)&&D(e),a||=c,r&&(p.utils.emptyNode(a),a.style.width=`100%`);let f=n&&n.subject&&n.subject.uri?n.subject:e;function m(){let e=_.createElement(`tr`);e.classList.add(`outlineRow1`),e.style.verticalAlign=`top`,a.appendChild(e);let t=y.outlineObjectTD(f,void 0,e);return e.appendChild(t),t}let h=m();if(r&&J(f),t&&(Y(h,f,{pane:n,solo:r,headerOnlyInViewerPod:!s||!!(n&&n.subject&&n.subject.uri)}),r&&f!==e&&ce(a,f,e)),r&&_&&_.defaultView&&_.defaultView.history){let t=_.defaultView.history.state||{},r=document.location.href!==e.uri,i=l.nextHistoryState(t,{pane:n?{name:n.name,subject:n.subject&&typeof n.subject.uri==`string`?n.subject.uri:void 0}:void 0,leavingPage:r,viaAccountMenu:!s});try{let n=new URL(document.location.href),a=new URL(e.uri,document.location.href);n.origin===a.origin&&(r?_.defaultView.history.pushState(i,e.uri,e.uri):JSON.stringify(t)!==JSON.stringify(i)&&_.defaultView.history.replaceState(i,e.uri,e.uri))}catch{}}return r&&u.announceNavigation(_),e};let $=t.propertyViews(_);function le(t){let r;if(t.termType===`Literal`){if(r=_.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=p.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`){if(r=_.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),y.appendAccessIcons(x,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=_.createElement(`a`);r.appendChild(_.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(p.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,_)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(_.createTextNode(p.utils.label(t)));let e=p.widgets.linkIcon(_,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),p.widgets.makeDraggable(r,t)}}else r.appendChild(_.createTextNode(p.utils.label(t)))}else if(t.termType===`Collection`){r=_.createElement(`table`),r.classList.add(`tableFullWidth`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(_.createElement(`tr`)),a=i.appendChild(_.createElement(`td`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(y.outlineObjectTD(n))}}else t.termType===`Graph`?(r=h.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(p.log.error(`Object `+t+` has unknown term type: `+t.termType),r=_.createTextNode(`[unknownTermType:`+t.termType+`]`));return p.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){_.getElementById(`UserURI`).value=_.URL+`?uri=`+_.getElementById(`UserURI`).value},this.UserInput.setSelected=V,this.UserInput.deselectAll=H,this.UserInput.views=$,this.outlineExpand=Y,this}exports.default=_;
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.obj{vertical-align:top;border:none;margin:.2em;padding:0 0 5px}.iconTD{vertical-align:top;border:none;width:0;margin:.2em;padding:0}.labelTD{width:100%}.strongHeader{margin:0 .6rem 0 0;padding:.1rem .4rem;font-size:150%}.tableFullWidth{width:100%;background:var(--color-background,#f8f9fb)!important}.placeholderTable{width:100%}.tdFlex{vertical-align:top;border-radius:5px;flex-direction:row;justify-content:space-between;display:flex;overflow:hidden}solid-ui-file-explorer-provider{flex-direction:column;gap:0;width:100%;min-width:0;height:100%;min-height:0;display:flex;overflow:hidden}solid-ui-file-explorer-provider.tdFlex{flex-direction:column;align-items:stretch}solid-ui-file-explorer-provider>solid-ui-file-explorer-header{flex:none;width:100%}solid-ui-file-explorer-provider>.paneDiv,solid-ui-file-explorer-provider>.exceptionPane{flex:auto;width:100%;min-height:0;margin:0;overflow:hidden auto}.paneDiv,.exceptionPane{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block;overflow-x:hidden}.objectValue--literal{white-space:pre-wrap}.objectValue--integer,.objectValue--decimal,.objectValue--double{text-align:right;display:block}.objectValueAccessIcon,.objectValueLinkIcon,.phoneIcon{vertical-align:middle;display:inline-block}.objectValueLinkIcon,.phoneIcon{width:12px;height:12px}@media (width<=600px){.obj,.iconTD{vertical-align:top;font-size:100%;margin:0!important}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("../_virtual/_rolldown/runtime.cjs.js");;const t=require("./propertyViews.cjs.js"),n=require("./outlineIcons.cjs.js"),r=require("./userInput.cjs.js"),i=require("./queryByExample.cjs.js"),a=require("../utils/webIdUtils.cjs.js"),o=require("../utils/podUtils.cjs.js"),s=require("../navigation/chrome.cjs.js"),c=require("../navigation/podContext.cjs.js"),l=require("../navigation/state.cjs.js"),u=require("../navigation/events.cjs.js"),d=require("../navigation/options.cjs.js"),f=require("../navigation/navbarVisibility.cjs.js"),p=require("./outlineDomHelpers.cjs.js"),m=require("./fileExplorerHelpers.cjs.js");let h=require("solid-ui");h=e.__toESM(h);let g=require("solid-logic"),_=require("pane-registry");_=e.__toESM(_);let v=require("rdflib");v=e.__toESM(v),require("solid-ui/components/file-explorer-provider"),require("solid-ui/components/file-explorer-header"),require("solid-ui/components/error-state");let y=require("solid-ui/components/access-control-modal");y=e.__toESM(y);var b=`solid-ui-file-explorer-provider`;function x(e){let x=e.dom,S=new WeakMap,C=new WeakSet;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let w=this,T=this,E=[];this.selection=E,this.ancestor=h.utils.ancestor,this.sparql=v.UpdateManager,this.kb=g.store;let D=g.store,O=g.store.fetcher;x.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let{outlineObjectDiv:k,outlinePredicateDiv:A,termWidget:j}=p.createOutlineDomHelpers({dom:x,UI:h,kb:g.store,outlineIcons:n.outlineIcons,expandMouseDownListener:se,selectableTDClickListener:fe,setSelected:G,viewAsBoringDefault:he,removeNodeIconMouseDownListener:de});this.outlineObjectDiv=k,this.outlinePredicateDiv=A,this.outlineObjectTD=k,this.outlinePredicateTD=A,this.termWidget=j,this.init=function(){let e=N();e.outline=this},this.getLayoutMode=function(){let e=this.context?.environment?.layout;if(e===`mobile`||e===`desktop`)return e;if(typeof window<`u`&&window.matchMedia){let e=Math.round(Math.min(window.innerWidth,window.visualViewport?.width||window.innerWidth)),t=window.matchMedia(`(pointer: coarse)`).matches||navigator.maxTouchPoints>0;return e<=768||t&&e<=1024?`mobile`:`desktop`}return`desktop`},M.lastkbsize=0;function M(e){let t=[];for(let e=arguments.length-1;e>0;e--)t[e-1]=arguments[e];let n=new Date().getTime(),r=e.apply(e,t),i=new Date().getTime();return h.log.info(`BENCHMARK: kb delta: `+(D.statements.length-M.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),M.lastkbsize=D.statements.length,r}this.appendAccessIcons=function(e,t,n){if(n.termType!==`NamedNode`)return;let r=e.uris(n);r.sort();let i=null;for(let e=0;e<r.length;e++)r[e]!==i&&(i=r[e],T.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=v.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=O.getState(r),a,o,s;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,s=ue;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,s=J;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,s=le,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,s=J;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,s=J,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,s=J,o=`cannot fetch`;break;default:h.log.error(`?? state = `+i)}let c=h.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),x);return c.classList.add(`objectValueAccessIcon`),c.setAttribute(`uri`,t),c.addEventListener(`click`,s),oe(c,r),e.appendChild(c),c};function N(){return te(`OutlineView`,`Resource browser`)}function ee(e){f.refreshNavbarVisibility(e.uri).catch(e=>h.log.error(`Failed to update navbar visibility: `+e))}function te(e){if(e===`OutlineView`){let e=document.getElementById(`OutlineView`);if(e)return e;let t=document.getElementById(`MainContent`)||document.body;if(t){let e=document.createElement(`div`);return e.id=`OutlineView`,e.classList.add(`outline-view`),e.setAttribute(`aria-label`,`Resource browser`),t.appendChild(e),e}}}async function P(e,t){return e.uri.endsWith(`/`)&&await o.loadContainerRepresentation(e),h.getRelevantPanes(e,t,{excludedPaneNames:[`sharing`],fallbackPaneName:`internal`})}function ne(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function F(e){let t=x.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function I(t,n,r,i){if(!t||!r)return;let a;try{h.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=x.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=x.createElement(`pre`);a.appendChild(t),t.appendChild(x.createTextNode(h.utils.stackString(e)))}R(t,n,r,a)}function L(e,t,n){n?(F(!!n.requireQueryButton),e.pane=n,I(e,t,n,S.get(e)?.options||{})):h.log.warn(`outline: Unable to open pane in place: pane is undefined.`)}function R(t,n,r,i){let a=S.get(t);h.composeExplorer(t,{context:e,subjectUri:n.uri,pane:r,relevantPanes:t.relevantPanes||[],header:a&&s.explorerHeaderForPane(a.showHeader,r?.name,a.options.folderView)?{paneIcon:m.getPaneIcon(r,n,e),menuItems:a.menuItems}:void 0,paneElement:i})}async function re(t,n,r,i){r||={},i||=x.createElement(b);let o={generation:(S.get(i)?.generation||0)+1,menuItems:[],options:r};S.set(i,o),i.classList.add(`paneView`,`tdFlex`),i.setAttribute(`notSelectable`,`true`),i.setAttribute(`role`,`grid`),i.setAttribute(`about`,t.toNT()),r.hover&&i.classList.add(`hoverControl`),i.context=e,i.subjectUri=t.uri,i.soloPane=r.solo,C.has(i)||(i.addEventListener(h.FILE_EXPLORER_BACK_EVENT,e=>{h.isExplorerEvent(e,i)&&(e.stopPropagation(),ce({target:i}))}),i.addEventListener(h.FILE_EXPLORER_MANAGE_ACCESS_EVENT,e=>{e.stopPropagation();let t=v.sym(e.detail.subjectUri).doc();g.solidLogicSingleton.acl.findAccessGrants(t).then(e=>{h.showDialog(y.default,{props:{subjectUri:t.uri,accessGrants:e}})}).catch(e=>{h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))})}),i.addEventListener(h.FILE_EXPLORER_OPEN_PANE_EVENT,t=>{if(!h.isExplorerEvent(t,i))return;t.stopPropagation();let n=e.session.paneRegistry.byName(t.detail.paneName);L(i,v.sym(t.detail.subjectUri),n)}),C.add(i));let l=r.hideList?[]:await P(t,e);if(S.get(i)!==o)return i;let u=e.session.logic?.resource||g.solidLogicSingleton.resource,d=t.uri.endsWith(`/`)?v.sym(`${t.uri}index.ttl`):null;if(r.solo&&!n&&!r.folderView&&d&&(typeof u?.containerHasIndexDocument==`function`&&u.containerHasIndexDocument(t)||D.holds(t,h.ns.ldp(`contains`),d,t.doc()))){if(t=typeof u?.getContainerIndexThing==`function`?u.getContainerIndexThing(t):v.sym(`${d.uri}#this`),await D.fetcher.load(t.doc()),l=await P(t,e),S.get(i)!==o)return i;i.subjectUri=t.uri,i.setAttribute(`about`,t.toNT())}i.relevantPanes=l,i.pane=n||ne(l,t);let f=!!(t&&t.uri&&t.site&&t.site().uri===t.uri),p=!!r.headerOnlyInViewerPod,w=!t.uri.endsWith(`/index.ttl#this`)&&s.deriveExplorerHeader({isRootResource:f,isWebId:a.isWebIdUri(t),viewerPodOnly:p,inViewerPod:!p||await c.isPageInViewerPod(x.location.href)});if(S.get(i)!==o)return i;if(o.showHeader=w,i.paneRenderOptions=r,i.soloPane=r.solo,i.openPane=(e,t)=>L(i,e,_.byName(t)),i.handleAccessClick=async()=>{try{let e=t.doc(),n=await g.solidLogicSingleton.acl.findAccessGrants(e);h.showDialog(y.default,{props:{subjectUri:e.uri,accessGrants:n}})}catch(e){h.log.error(`outline: Failed to open access controls: `+h.utils.stackString(e))}},i.pane?I(i,t,i.pane,r):R(i,t,i.pane),w){let n=await m.getPaneItems(t,e,l,(e,t)=>{i.dispatchEvent(new CustomEvent(h.FILE_EXPLORER_OPEN_PANE_EVENT,{bubbles:!0,composed:!0,detail:{subjectUri:e.uri,paneName:t}}))});S.get(i)===o&&(o.menuItems=n,R(i,t,i.pane))}return i}function ie(e){let t=e.parentNode,n=t.parentNode,r=x.createElement(`div`);n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let z=this.propertyTable=function(e,t,n,r){h.log.debug(`Property block for: `+e),e=D.canon(e);let i=t?t.matches?.(b)?t:t.firstElementChild||t:x.createElement(b);return re(e,n,r,i).catch(e=>{h.log.error(`outline: Failed to set up file explorer: `+h.utils.stackString(e))}),t&&h.log.info(`Re-expand: `+t),t||i};function B(e,t,n){let r=e.createElement(`div`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`),r.setAttribute(`role`,`row`);let i=T.outlinePredicateDiv(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=B;function ae(e,t,n,r){if(h.log.debug(`Property list length = `+t.length),t.length===0)return``;let i,a,o;n?(i=function(e){return e.subject},t=t.sort(h.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(h.utils.RDFComparePredicateObject));let s=t.length;for(a=0;a<s;a++){let c=t[a];if(r&&!r(c.predicate,n))continue;let l=B(x,c,n);e.appendChild(l);let u=l.firstChild,d=$.defaults[c.predicate.uri],f=0,p=0,m=0;for(o=0;o+a<s&&t[a+o].predicate.sameTerm(c.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&f++,i(t[a+o]).lang&&w.labeller.LanguagePreference&&(p+=1,i(t[a+o]).lang.indexOf(w.labeller.LanguagePreference)>=0&&m++);if(m>0&&p===f+1){for(let e=a;e<=a+f;e++)if(w.labeller.LanguagePreference&&i(t[e]).lang.indexOf(w.labeller.LanguagePreference)>=0){l.appendChild(T.outlineObjectDiv(i(t[e]),d,void 0,c));break}a+=f}else l.appendChild(T.outlineObjectDiv(i(c),d,void 0,c)),l.showNobj=function(r){let s=o-f,l=2*r<s?r:s,p=[];if(s!==1){u.setAttribute(`rowspan`,l===s?s:r+1);let f;l<s&&l===1&&u.setAttribute(`rowspan`,2);let m=0;for(f=1;f<o;f++)if(D.canon(i(t[a+f])).sameTerm(D.canon(i(t[a+f-1]))))h.log.info(`there are duplicates here: %s`,t[a+f-1]);else{m++,c=t[a+f],d=$.defaults[c.predicate.uri];let r=x.createElement(`div`);r.style.colspan=`1`,r.appendChild(T.outlineObjectDiv(i(t[a+f]),d,void 0,c)),r.AJAR_statement=c,r.AJAR_inverse=n,e.appendChild(r),m>=l&&(r.style.display=`none`,p.push(r))}l===s&&u.setAttribute(`rowspan`,m+1)}if(l<s){let t=x.createElement(`div`),n=t.appendChild(x.createElement(`div`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.classList.add(`obj`),n.setAttribute(`notSelectable`,`false`),s>r){let e=x.createElement(`a`);n.appendChild(e);let t=(function(e){return e(u,o,f,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,x)),e.appendChild(x.createTextNode(s-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(h.utils.AJARImage(h.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,x)),t.setAttribute(`rowspan`,s+1));for(let e=0;e<p.length;e++){let t=p[e];t.style.display=n}}}),i=`none`,a=function(e){return t(i),i=i===`none`?``:`none`,e&&e.stopPropagation(),!1};a(),e.addEventListener(`click`,a,!1)}e.appendChild(t)}},l.showAllobj=function(){l.showNobj(o-f)},l.showNobj(10),a+=o-1}}this.appendPropertyTRs=ae;function oe(e,t){h.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!w.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};O.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),O.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),O.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function V(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function H(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,U),t.parentNode.parentNode.removeAttribute(`optional`)}function U(e){let t=T.targetOf(e).parentNode;j.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,H),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function W(e,t){let r=n.outlineIcons.termWidgets.optOn,i=n.outlineIcons.termWidgets.optOff,a=e=>!(!e||typeof e.getAttribute!=`function`||e.getAttribute(`predTR`)!==`true`&&e.getAttribute(`data-outline-node`)!==`predicate`);for(let n=e;n.parentNode;n=n.parentNode)for(;;)if(a(n)){let e=n.getAttribute(`parentOfSelected`);e=e?parseInt(e):0,e===0&&t>0&&j.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?H:U),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),j.removeIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i));break}else if(n.previousElementSibling)n=n.previousElementSibling;else break}this.statusBarClick=function(e){let t=h.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)},this.showSource=function(){if(typeof sourceWidget<`u`){for(let e in sourceWidget.sources)sourceWidget.sources[e].setAttribute(`class`,``);for(let e=0;e<E.length;e++){if(!E[e].parentNode)continue;let t=E[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return E};function G(e,t){if(e.nodeName!==`TD`&&e.nodeName!==`DIV`)throw h.log.debug(`down`+e.nodeName),Error(`Expected TD or DIV in setSelected: `+e.nodeName+` : `+e.textContent);h.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,1),E.push(e);let t=h.utils.getTerm(e);T.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;g.store.updater.editable(t.uri,D)&&r.indexOf(`pred`)>=0&&j.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else h.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&W(e,-1),r.indexOf(`pred`)>=0&&j.removeIcon(e,n.outlineIcons.termWidgets.addTri),E=E.filter(function(t){return t===e}),h.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&T.showSource(),e.setAttribute(`class`,r)}function K(){let e=E.length;for(let t=e-1;t>=0;t--)G(E[t],!1);E=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return h.log.error(`can't get target for event `+e),!1;return t.nodeType===3&&(t=t.parentNode),t},this.walk=function(e,t){let n=t||E[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}K(),G(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}K(),G(r,!0);break;case`right`:{let e=n.matches?.(b)?n:n.querySelector?.(b),t=e?.querySelector?.(`[data-outline-node="object"]`);if(e){t&&(K(),G(t,!0));return}}if(K(),n.nextSibling||n.lastChild.tagName===`strong`)G(n.nextSibling,!0);else{let e=n.parentNode&&n.parentNode.nextSibling,t=e?e.lastChild:null;if(!t){G(n,!0);return}G(t,!0)}break;case`left`:if(K(),n.previousSibling&&n.previousSibling.className===`undetermined`)return G(n.previousSibling,!0),!0;G(q(n)?.block||n.parentNode&&n.parentNode.firstChild,!0);break;case`moveTo`:K(),G(t,!0)}e!==`down`&&e!==`up`||r.tabulatorSelect||this.walk(e)},this.OutlinerKeypressPanel=function(e){h.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&x.getElementById(`UserURI`)&&(x.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]||(o(`right`,a),t(h.utils.getAbout(D,E[0]))),!0}let r,i;if(h.utils.getTarget(e).tagName===`TEXTAREA`||h.utils.getTarget(e).id===`UserURI`||E.length>1)return;if(E.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,T.focusTd),t(h.utils.getAbout(D,E[0])));return}let a=E[0];switch(O.removeCallback(`done`,`setSelectedAfterward`),O.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(h.utils.getTarget(e).tagName===`HTML`){let e=h.utils.getAbout(D,a);r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),e?w.GotoSubject(e,!0):i&&T.UserInput.Enter(a)}else this.UserInput.Keypress(e),this.walk(`down`),e.stopPropagation();return;case 38:this.walk(`up`),e.stopPropagation(),e.preventDefault();break;case 40:this.walk(`down`),e.stopPropagation(),e.preventDefault()}if(h.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=g.store.updater.editable(r.uri,D),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=q(a);if(!e)break;let t=h.utils.getAbout(D,e.provider);t&&Z(e.block,t);break}case 39:{let e=h.utils.getAbout(D,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstElementChild?.matches(b)||(O.addCallback(`done`,n),O.addCallback(`fail`,n),X(a,e,{pane:_.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){T.UserInput.copyToClipboard(T.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){T.UserInput.pasteFromClipboard(T.clipboardAddress,a);break}break;default:h.utils.getTarget(e).tagName}}t(h.utils.getAbout(D,E[0]))},this.OutlinerMouseclickPanel=function(e){switch(T.UserInput._tabulatorMode){case 0:pe(e);break;case 1:T.UserInput.Click(e)}};function se(e){let t=T.targetOf(e),n,r;for(let e=t;e&&e!==x;e=e.parentNode)e.matches?.(`[data-outline-node="object"]`)&&(n=e),e.matches?.(`.outline-subject-block`)&&(r=e);let i=r||n||t.parentNode,a=h.utils.getAbout(D,t),o=e.altKey?_.byName(`internal`):void 0;e.shiftKey?Q(i,a,o):e.altKey?X(i,a,{pane:_.byName(`internal`),immediate:!0}):X(i,a)}function ce(e){let t=T.targetOf(e),n=e.altKey?_.byName(`internal`):void 0,r=q(t);if(!r)return;let i=h.utils.getAbout(D,r.provider);i&&Z(r.block,i,n)}function q(e){for(let t=e;t&&t!==x;t=t.parentNode){if(t.matches?.(`[data-outline-node="object"]`)){let e=t.querySelector?.(b);if(e)return{block:t,provider:e}}if(t.matches?.(b))return{block:t.closest?.(`[data-outline-node="object"]`)||t.closest?.(`.outline-subject-block`)||t,provider:t}}return null}function J(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function le(e){let t=T.targetOf(e).getAttribute(`uri`);e.altKey?O.fetch(v.uri.docpart(t),{force:!0}):O.refresh(D.sym(v.uri.docpart(t)))}function ue(e){let t=T.targetOf(e).getAttribute(`uri`);O.fetch(v.uri.docpart(t))}function de(e){let t=T.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),ie(n)}function fe(e){if(T.UserInput._tabulatorMode)return T.UserInput.Click(e);let t=T.targetOf(e),n;for(n=h.utils.ancestor(t,`td`)||h.utils.ancestor(t,`tr`)||h.utils.ancestor(t,`div`);n&&n.getAttribute(`notSelectable`)!==`false`;n=h.utils.ancestor(n.parentNode,`td`)||h.utils.ancestor(n.parentNode,`tr`)||h.utils.ancestor(n.parentNode,`div`));if(!n)return;let r=V(n);if(h.log.debug(`Was node selected before: `+r),e.altKey)G(n,!V(n));else if(e.shiftKey)G(n,!0);else{if(K(),T.UserInput.clearInputAndSave(e),G(n,!0),e.detail===2){e.stopPropagation();return}let t;if(n.parentNode&&(t=n.parentNode.AJAR_statement),!t)return;let i=t.why,a=g.store.updater.editable(i.uri,D);r&&a&&T.UserInput.Click(e,E[0])}h.log.debug(`Was node selected after: `+V(n)+`, count=`+E.length),e.stopPropagation()}function pe(e){h.log.info(`@TabulatorMousedown, dom.location is now `+x.location);let t=T.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(T.UserInput.clearMenu(),T.UserInput.lastModified&&T.UserInput.lastModified.parentNode.nextSibling&&T.UserInput.backOut(),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices&&t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_add_triple)&&T.UserInput.clearInputAndSave(e),t.src&&t.src.slice(t.src.indexOf(`/icons/`)+1)===n.outlineIcons.src.icon_show_choices||T.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){x.title=h.utils.label(e),x.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;h.log.info(`@outlineExpand, dom is now `+x.location),O.removeCallback(`done`,`expand`),O.removeCallback(`fail`,`expand`);let o=D.canon(t),s=!1;function c(){if(s){if(O.getState(o.doc().uri)!==`fetched`)return!1;s=!1,i=!1}if(o=D.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;h.log.info(`@@ REPAINTING `),t=i?z(o,e,r,n):z(o,void 0,r,n),i=!0,t!==e&&h.utils.emptyNode(e).appendChild(t),T.focusTd=e,h.log.debug(`expand: Node for `+o+` expanded`);let a=D.each(o,h.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&h.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),O.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=D.canon(o);h.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=D.sym(v.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=D.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=v.uri.docpart(r[t]);n;n=D.HTTPRedirects[n])if(e===n)return!0;return!!D.anyStatementMatching(t,void 0,void 0,n)}()||(h.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}if(n.solo&&Y(o),r?.global){c();return}h.log.debug(`outlineExpand: dereferencing `+o);let u=x.createElement(`span`);if(e.appendChild(u),O.addCallback(`done`,l),O.addCallback(`fail`,l),o.uri&&o.uri.split(`:`)[0]===`rdf`)c();else if(o.uri&&!a&&!h.widgets.isAudio(o)&&!h.widgets.isVideo(o)){let t=o.doc()&&o.doc().uri?o.doc().uri:``+o.doc(),r=function(e){let t=!!(o&&o.uri&&o.site&&o.site().uri===o.uri);return e===403?t?`This root resource is not accessible with your current permissions. Try logging in with an authorized account or opening a public profile document.`:`This resource is not accessible with your current permissions.`:t?`This root resource is not publicly readable. Try logging in or opening a profile document.`:`This resource is not publicly readable. Try logging in or opening a different public resource.`},i=function(e,t){let n=typeof e==`string`?e:String(e||``),r=t?.status||t?.response?.status;return r===401||r===403?r:n.includes(`status: 403`)||n.includes(`status 403`)?403:n.includes(`status: 401`)||n.includes(`status 401`)?401:null},a=function(){let e=!!(o&&o.uri&&o.site&&o.site().uri===o.uri),t=!!g.solidLogicSingleton.authn.currentUser();return e?t?`You are logged in, but this root resource is not publicly readable. Select a storage location from the account menu to continue.`:`This root resource is not publicly readable. Try logging in or opening a profile document.`:t?`You are logged in, but your account does not have permission to view this resource.`:`This resource is not publicly readable. Log in to view it.`},l=function(){s=!0;let n=x.createElement(`solid-ui-error-state`);n.setAttribute(`title`,`Access denied`),n.setAttribute(`message`,a()),t&&n.setAttribute(`data-outline-error-for`,t),h.utils.emptyNode(e).appendChild(n),O.addCallback(`done`,function(n){return!s||!e.isConnected?!1:n!==t||(c(),!1)}),O.getState(t)===`fetched`&&c()},u=function(a,o){if(e.querySelector&&t&&e.querySelector(`[data-outline-error-for="`+t+`"]`))return;let s=i(a,o);if(s&&n.solo){if(!d&&g.solidLogicSingleton.authn.currentUser()){d=!0,f(!0);return}l();return}let c=s?r(s):a,u=h.widgets.errorMessageBlock(x,c,`#fee`,o instanceof Error?o:void 0);t&&u.setAttribute(`data-outline-error-for`,t),e.appendChild(u)},d=!1,f=function(e){let t=!1,r=O.nowOrWhenFetched(o.doc(),e?{force:!0}:{},function(e,r){e?(O.lookUpThing(o),c(),n.solo&&Y(o)):(t=!0,u(r,void 0))});r&&typeof r.catch==`function`&&r.catch(function(e){t||(t=!0,u(e,e))})},p=O.requested[t];f(!!n.solo&&(p===401||p===403))}else c()}function Z(e,t){let n=e.AJAR_statement||e.parentNode&&e.parentNode.AJAR_statement;h.log.debug(`Collapsing subject `+t);let r;n&&(h.log.debug(`looking up pred `+n.predicate.uri+`in defaults`),r=$.defaults[n.predicate.uri]),h.log.debug(`view= `+r);let i;e.parentNode&&e.parentNode.id===`outline`&&(i=e),T.replaceTD(T.outlineObjectDiv(t,r,i,n),e)}this.replaceTD=function(e,t){let n;V(t)&&(n=!0);for(let e=E.length-1;e>-1;e--)for(let n=E[e];n.parentNode;n=n.parentNode)n===t&&G(E[e],!1);t.parentNode.replaceChild(e,t),n&&G(e,!0)};function Q(e,t){h.utils.emptyNode(e).appendChild(z(t)),Y(t),e.setAttribute(`about`,t.toNT())}w.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&w.GotoFormURI(e)},this.GotoFormURI=function(e){me(x.getElementById(`UserURI`).value)};function me(e){let t=D.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=D.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o){let s=d.resolveSource(o)!==`accountMenu`,c=N();s&&(!a||a===c)&&ee(e);let f=a||c;r&&(f.style.width=`100%`,h.utils.emptyNode(f));let p=n&&n.subject&&n.subject.uri?n.subject:e;function m(){let e=x.createElement(`div`);e.classList.add(`outline-subject-block`);let t=T.outlineObjectDiv(p,void 0,e);return e.appendChild(t),f.appendChild(e),e}let g=r?m():f;if(r&&Y(p),t?X(g,p,{pane:n,solo:r,folderView:d.resolveFolderView(o),headerOnlyInViewerPod:!s||!!(n&&n.subject&&n.subject.uri)}):r||m(),r&&x&&x.defaultView&&x.defaultView.history){let t=o&&typeof o==`object`&&o.preserveUrl===!0,r=x.defaultView.history.state||{},i=document.location.href!==e.uri,a=l.nextHistoryState(r,{pane:n?{name:n.name,subject:n.subject&&typeof n.subject.uri==`string`?n.subject.uri:void 0}:void 0,leavingPage:i,viaAccountMenu:!s});try{let n=new URL(x.location.href),o=new URL(e.uri,x.location.href);t?x.defaultView.history.replaceState(a,``):n.origin===o.origin&&(i?x.defaultView.history.pushState(a,e.uri,e.uri):JSON.stringify(r)!==JSON.stringify(a)&&x.defaultView.history.replaceState(a,e.uri,e.uri))}catch{}}return r&&u.announceNavigation(x),e};let $=t.propertyViews(x);function he(t){let r;if(t.termType===`Literal`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=h.ns.xsd(``).uri;t.datatype.uri.slice(0,e.length)===e&&r.classList.add(`objectValue--`+t.datatype.uri.slice(e.length))}}else if(t.termType===`NamedNode`||t.termType===`BlankNode`){if(r=x.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),T.appendAccessIcons(D,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=x.createElement(`a`);r.appendChild(x.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(h.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,x)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(x.createTextNode(h.utils.label(t)));let e=h.widgets.linkIcon(x,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),h.widgets.makeDraggable(r,t)}}else r.appendChild(x.createTextNode(h.utils.label(t)))}else if(t.termType===`Collection`){r=x.createElement(`div`),r.setAttribute(`about`,t.toNT());for(let e=0;e<t.elements.length;e++){let n=t.elements[e],i=r.appendChild(x.createElement(`div`)),a=i.appendChild(x.createElement(`div`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(T.outlineObjectDiv(n))}}else t.termType===`Graph`?(r=_.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(h.log.error(`Object `+t+` has unknown term type: `+t.termType),r=x.createTextNode(`[unknownTermType:`+t.termType+`]`));return h.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){x.getElementById(`UserURI`).value=x.URL+`?uri=`+x.getElementById(`UserURI`).value},this.UserInput.setSelected=G,this.UserInput.deselectAll=K,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=x;
|
|
2
2
|
//# sourceMappingURL=manager2.cjs.js.map
|