solid-panes 5.0.0-0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RDFXMLPane.d.ts.map +1 -1
- package/dist/RDFXMLPane2.cjs.js +1 -2
- package/dist/RDFXMLPane2.cjs.js.map +1 -1
- package/dist/RDFXMLPane2.esm.js +15 -42
- package/dist/RDFXMLPane2.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/folder-open.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/folder.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/folder.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/{trash-2.esm.js → folder.esm.js} +4 -4
- package/dist/_virtual/~icons/lucide/folder.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/help-circle.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/help-circle.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/pencil.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/pencil.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/settings-2.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/settings-2.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/share-2.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/user.esm.js.map +1 -1
- package/dist/_virtual/~icons/lucide/users.cjs.js.map +1 -1
- package/dist/_virtual/~icons/lucide/users.esm.js.map +1 -1
- package/dist/audio/audioPane.cjs.js.map +1 -1
- package/dist/audio/audioPane.esm.js.map +1 -1
- package/dist/classInstancePane.cjs.js.map +1 -1
- package/dist/classInstancePane.esm.js.map +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js +6 -0
- package/dist/components/editor-card/EditorCard.cjs.js.map +1 -0
- package/dist/components/editor-card/EditorCard.d.ts +16 -0
- package/dist/components/editor-card/EditorCard.d.ts.map +1 -0
- package/dist/components/editor-card/EditorCard.esm.js +268 -0
- package/dist/components/editor-card/EditorCard.esm.js.map +1 -0
- package/dist/components/editor-card/EditorCard.styles.cjs.js +2 -0
- package/dist/components/editor-card/EditorCard.styles.cjs.js.map +1 -0
- package/dist/components/editor-card/EditorCard.styles.esm.js +7 -0
- package/dist/components/editor-card/EditorCard.styles.esm.js.map +1 -0
- package/dist/components/editor-card/index.cjs.js +1 -0
- package/dist/components/editor-card/index.d.ts +4 -0
- package/dist/components/editor-card/index.d.ts.map +1 -0
- package/dist/components/editor-card/index.esm.js +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +2 -2
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +1 -2
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +16 -16
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +24 -14
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +7 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +94 -66
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +22 -7
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +3 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +90 -65
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +1 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +4 -4
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +17 -16
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +1 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +1 -1
- package/dist/components/file-explorer-header/index.cjs.js +1 -0
- package/dist/components/file-explorer-header/index.d.ts +3 -0
- package/dist/components/file-explorer-header/index.d.ts.map +1 -0
- package/dist/components/file-explorer-header/index.esm.js +2 -0
- package/dist/components/file-explorer-header/types.d.ts +8 -0
- package/dist/components/file-explorer-header/types.d.ts.map +1 -1
- package/dist/components/header/Header.cjs.js +1 -1
- package/dist/components/header/Header.cjs.js.map +1 -1
- package/dist/components/header/Header.esm.js +4 -4
- package/dist/components/header/Header.esm.js.map +1 -1
- package/dist/components/header/Header.styles.cjs.js +1 -1
- package/dist/components/header/Header.styles.cjs.js.map +1 -1
- package/dist/components/header/Header.styles.esm.js +1 -1
- package/dist/components/header/Header.styles.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.cjs.js +2 -2
- package/dist/components/navbar/Navbar.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.esm.js +5 -5
- package/dist/components/navbar/Navbar.esm.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.styles.esm.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +23 -9
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +7 -4
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +146 -84
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js +2 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js +7 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +1 -0
- package/dist/dashboard/basicPreferences.cjs.js.map +1 -1
- package/dist/dashboard/basicPreferences.esm.js.map +1 -1
- package/dist/dashboard/dashboardPane.cjs.js.map +1 -1
- package/dist/dashboard/dashboardPane.esm.js.map +1 -1
- package/dist/dashboard/homepage.cjs.js.map +1 -1
- package/dist/dashboard/homepage.esm.js.map +1 -1
- package/dist/dashboard/ontologyData.cjs.js.map +1 -1
- package/dist/dashboard/ontologyData.esm.js.map +1 -1
- package/dist/dashboard/preferencesFormText.cjs.js.map +1 -1
- package/dist/dashboard/preferencesFormText.esm.js.map +1 -1
- package/dist/dataContentPane2.cjs.js +1 -1
- package/dist/dataContentPane2.cjs.js.map +1 -1
- package/dist/dataContentPane2.esm.js +1 -1
- package/dist/dataContentPane2.esm.js.map +1 -1
- package/dist/defaultPane2.cjs.js +1 -1
- package/dist/defaultPane2.cjs.js.map +1 -1
- package/dist/defaultPane2.esm.js +2 -2
- package/dist/defaultPane2.esm.js.map +1 -1
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
- package/dist/dokieli/dokieliPane.esm.js.map +1 -1
- package/dist/dokieli/new.cjs.js.map +1 -1
- package/dist/dokieli/new.esm.js.map +1 -1
- package/dist/form/pane.cjs.js.map +1 -1
- package/dist/form/pane.esm.js.map +1 -1
- package/dist/home/homePane.cjs.js +1 -1
- package/dist/home/homePane.cjs.js.map +1 -1
- package/dist/home/homePane.esm.js +1 -1
- package/dist/home/homePane.esm.js.map +1 -1
- package/dist/humanReadablePane.d.ts +1 -1
- package/dist/humanReadablePane.d.ts.map +1 -1
- package/dist/humanReadablePane2.cjs.js +1 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/humanReadablePane2.esm.js +2 -2
- package/dist/humanReadablePane2.esm.js.map +1 -1
- package/dist/icons/folder.cjs.js.map +1 -1
- package/dist/icons/folder.esm.js.map +1 -1
- package/dist/icons/friends.cjs.js.map +1 -1
- package/dist/icons/friends.esm.js.map +1 -1
- package/dist/icons/person.cjs.js.map +1 -1
- package/dist/icons/person.esm.js.map +1 -1
- package/dist/imagePane2.cjs.js +1 -1
- package/dist/imagePane2.cjs.js.map +1 -1
- package/dist/imagePane2.esm.js +1 -1
- package/dist/imagePane2.esm.js.map +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/internal/internalPane2.cjs.js +1 -1
- package/dist/internal/internalPane2.cjs.js.map +1 -1
- package/dist/internal/internalPane2.esm.js +2 -2
- package/dist/internal/internalPane2.esm.js.map +1 -1
- package/dist/mainPage/header.cjs.js.map +1 -1
- package/dist/mainPage/header.esm.js.map +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.cjs.js.map +1 -1
- package/dist/mainPage/navbar.esm.js.map +1 -1
- package/dist/n3Pane.d.ts.map +1 -1
- package/dist/n3Pane2.cjs.js +1 -2
- package/dist/n3Pane2.cjs.js.map +1 -1
- package/dist/n3Pane2.esm.js +10 -34
- package/dist/n3Pane2.esm.js.map +1 -1
- package/dist/outline/context.cjs.js.map +1 -1
- package/dist/outline/context.esm.js.map +1 -1
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +9 -12
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/outlineIcons.cjs.js.map +1 -1
- package/dist/outline/outlineIcons.esm.js.map +1 -1
- package/dist/outline/propertyViews.cjs.js.map +1 -1
- package/dist/outline/propertyViews.esm.js.map +1 -1
- package/dist/outline/queryByExample.cjs.js +1 -1
- package/dist/outline/queryByExample.cjs.js.map +1 -1
- package/dist/outline/queryByExample.esm.js +4 -4
- package/dist/outline/queryByExample.esm.js.map +1 -1
- package/dist/outline/userInput.cjs.js +1 -1
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +2 -2
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/outline/viewAsImage.cjs.js.map +1 -1
- package/dist/outline/viewAsImage.esm.js.map +1 -1
- package/dist/outline/viewAsMbox.cjs.js.map +1 -1
- package/dist/outline/viewAsMbox.esm.js.map +1 -1
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.cjs.js.map +1 -1
- package/dist/pad/padPane2.esm.js +3 -3
- package/dist/pad/padPane2.esm.js.map +1 -1
- package/dist/playlist/playlistPane.cjs.js +1 -1
- package/dist/playlist/playlistPane.cjs.js.map +1 -1
- package/dist/playlist/playlistPane.esm.js +1 -1
- package/dist/playlist/playlistPane.esm.js.map +1 -1
- package/dist/registerPanes.cjs.js.map +1 -1
- package/dist/registerPanes.esm.js.map +1 -1
- package/dist/schedule/formsForSchedule.cjs.js.map +1 -1
- package/dist/schedule/formsForSchedule.esm.js.map +1 -1
- package/dist/schedule/schedulePane2.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/sharing/sharingPane.cjs.js +1 -1
- package/dist/sharing/sharingPane.cjs.js.map +1 -1
- package/dist/sharing/sharingPane.esm.js +1 -1
- package/dist/sharing/sharingPane.esm.js.map +1 -1
- package/dist/slideshow/slideshowPane.cjs.js.map +1 -1
- package/dist/slideshow/slideshowPane.esm.js.map +1 -1
- package/dist/social/editProfileDetails.cjs.js.map +1 -1
- package/dist/social/editProfileDetails.esm.js.map +1 -1
- package/dist/social/icons.cjs.js.map +1 -1
- package/dist/social/icons.esm.js.map +1 -1
- package/dist/social/socialPane2.cjs.js +2 -2
- package/dist/social/socialPane2.cjs.js.map +1 -1
- package/dist/social/socialPane2.esm.js +3 -3
- package/dist/social/socialPane2.esm.js.map +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/social/socialSections.esm.js.map +1 -1
- package/dist/social/triage.cjs.js +1 -1
- package/dist/social/triage.cjs.js.map +1 -1
- package/dist/social/triage.esm.js +1 -1
- package/dist/social/triage.esm.js.map +1 -1
- package/dist/tabbed/tabbedPane.cjs.js.map +1 -1
- package/dist/tabbed/tabbedPane.esm.js.map +1 -1
- package/dist/tableViewPane.cjs.js.map +1 -1
- package/dist/tableViewPane.esm.js.map +1 -1
- package/dist/transaction/pane.cjs.js.map +1 -1
- package/dist/transaction/pane.esm.js.map +1 -1
- package/dist/transaction/period.cjs.js +1 -1
- package/dist/transaction/period.cjs.js.map +1 -1
- package/dist/transaction/period.esm.js +1 -1
- package/dist/transaction/period.esm.js.map +1 -1
- package/dist/trip/tripPane.cjs.js.map +1 -1
- package/dist/trip/tripPane.esm.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.dom.esm.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.utils.esm.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -1
- package/dist/trustedApplications/trustedApplications.view.esm.js.map +1 -1
- package/dist/ui/pane.cjs.js.map +1 -1
- package/dist/ui/pane.esm.js.map +1 -1
- package/dist/utils/paneUtils.cjs.js.map +1 -1
- 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 +6 -1
- package/dist/utils/podUtils.d.ts.map +1 -1
- package/dist/utils/podUtils.esm.js +93 -22
- package/dist/utils/podUtils.esm.js.map +1 -1
- package/dist/utils/webIdUtils.cjs.js.map +1 -1
- package/dist/utils/webIdUtils.esm.js.map +1 -1
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +3 -3
- package/dist/versionInfo.esm.js.map +1 -1
- package/dist/video/videoPane.cjs.js.map +1 -1
- package/dist/video/videoPane.esm.js.map +1 -1
- package/package.json +13 -13
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +0 -1
- package/dist/components/file-explorer-header/helper.cjs.js +0 -2
- package/dist/components/file-explorer-header/helper.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/helper.d.ts +0 -15
- package/dist/components/file-explorer-header/helper.d.ts.map +0 -1
- package/dist/components/file-explorer-header/helper.esm.js +0 -64
- package/dist/components/file-explorer-header/helper.esm.js.map +0 -1
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js +0 -16
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js.map +0 -1
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js +0 -215
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.cjs.js","names":[],"sources":["../../src/mainPage/header.ts"],"sourcesContent":["import { authn } from 'solid-logic'\nimport { html, render } from 'lit-html'\nimport type { AccountMenuItem } from 'solid-ui/components/account'\nimport type { OutlineManager } from '../outline/manager'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '~icons/lucide/layout-dashboard'\nimport '~icons/lucide/settings-2'\nimport '../components/header'\nimport { getProfilePaneFromURI, getSocialPaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { sym } from 'rdflib'\n\nexport async function createHeader (outliner: OutlineManager) {\n const existingHeader = document.querySelector('solid-panes-header')\n\n if (existingHeader) {\n return existingHeader\n }\n\n const me = authn.currentUser()\n\n const main = document.getElementById('MainContent')\n const outlineView = document.getElementById('OutlineView')\n const tmpContainer = document.createElement('div')\n\n function hideNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.add('navbar--hidden')\n }\n }\n\n const storagePanes = me ? await getFolderPanesFromURI(me) : []\n const storageMenuItems: AccountMenuItem[] = storagePanes.map(pane => ({\n label: html`<icon-lucide-folder-open slot=\"left-icon\"></icon-lucide-folder-open> ${pane.label()}`,\n async onSelected () {\n hideNavbar()\n if (me) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }))\n const menuItems: AccountMenuItem[] = [\n {\n label: html`<icon-lucide-user slot=\"left-icon\"></icon-lucide-user> Profile`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const profilePane = await getProfilePaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, profilePane, true, undefined, outlineView, false)\n }\n }\n },\n {\n label: html`<icon-lucide-users slot=\"left-icon\"></icon-lucide-users> Friends`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const socialPane = await getSocialPaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, socialPane, true, undefined, outlineView, false)\n }\n }\n },\n ...storageMenuItems,\n {\n label: html`<icon-lucide-layout-dashboard slot=\"left-icon\"></icon-lucide-layout-dashboard> Dashboard`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('home')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n {\n label: html`<icon-lucide-settings-2 slot=\"left-icon\"></icon-lucide-settings-2> Preferences`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('basicPreferences')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n ]\n\n render(\n html`<solid-panes-header .menuItems=${menuItems}></solid-panes-header>`,\n tmpContainer\n )\n\n const header = tmpContainer.firstElementChild\n\n if (!header) {\n throw new Error('Failed to create header')\n }\n\n // ensure it is in DOM (before MainContent for consistency)\n if (main && main.parentNode) {\n main.parentNode.insertBefore(header, main)\n } else {\n document.body.prepend(header)\n }\n\n return header\n}\n"],"mappings":"gbAcA,
|
|
1
|
+
{"version":3,"file":"header.cjs.js","names":["authn","getFolderPanesFromURI","sym","getProfilePaneFromURI","getSocialPaneFromURI","require_paneUtils","solid_logic","rdflib","lit_html","createHeader","existingHeader","me","main","outlineView","tmpContainer","hideNavbar","navbar","storageMenuItems","pane","outliner","menuItems","profilePane","socialPane","header"],"sources":["../../src/mainPage/header.ts"],"sourcesContent":["import { authn } from 'solid-logic'\nimport { html, render } from 'lit-html'\nimport type { AccountMenuItem } from 'solid-ui/components/account'\nimport type { OutlineManager } from '../outline/manager'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '~icons/lucide/layout-dashboard'\nimport '~icons/lucide/settings-2'\nimport '../components/header'\nimport { getProfilePaneFromURI, getSocialPaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { sym } from 'rdflib'\n\nexport async function createHeader (outliner: OutlineManager) {\n const existingHeader = document.querySelector('solid-panes-header')\n\n if (existingHeader) {\n return existingHeader\n }\n\n const me = authn.currentUser()\n\n const main = document.getElementById('MainContent')\n const outlineView = document.getElementById('OutlineView')\n const tmpContainer = document.createElement('div')\n\n function hideNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.add('navbar--hidden')\n }\n }\n\n const storagePanes = me ? await getFolderPanesFromURI(me) : []\n const storageMenuItems: AccountMenuItem[] = storagePanes.map(pane => ({\n label: html`<icon-lucide-folder-open slot=\"left-icon\"></icon-lucide-folder-open> ${pane.label()}`,\n async onSelected () {\n hideNavbar()\n if (me) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }))\n const menuItems: AccountMenuItem[] = [\n {\n label: html`<icon-lucide-user slot=\"left-icon\"></icon-lucide-user> Profile`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const profilePane = await getProfilePaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, profilePane, true, undefined, outlineView, false)\n }\n }\n },\n {\n label: html`<icon-lucide-users slot=\"left-icon\"></icon-lucide-users> Friends`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const socialPane = await getSocialPaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, socialPane, true, undefined, outlineView, false)\n }\n }\n },\n ...storageMenuItems,\n {\n label: html`<icon-lucide-layout-dashboard slot=\"left-icon\"></icon-lucide-layout-dashboard> Dashboard`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('home')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n {\n label: html`<icon-lucide-settings-2 slot=\"left-icon\"></icon-lucide-settings-2> Preferences`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('basicPreferences')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n ]\n\n render(\n html`<solid-panes-header .menuItems=${menuItems}></solid-panes-header>`,\n tmpContainer\n )\n\n const header = tmpContainer.firstElementChild\n\n if (!header) {\n throw new Error('Failed to create header')\n }\n\n // ensure it is in DOM (before MainContent for consistency)\n if (main && main.parentNode) {\n main.parentNode.insertBefore(header, main)\n } else {\n document.body.prepend(header)\n }\n\n return header\n}\n"],"mappings":"gbAcA,eAAsBS,EAAc,EAA0B,CAC5D,IAAMC,EAAiB,SAAS,cAAc,oBAAoB,EAElE,GAAIA,EACF,OAAOA,EAGT,IAAMC,EAAKX,EAAAA,MAAM,YAAY,EAEvBY,EAAO,SAAS,eAAe,aAAa,EAC5CC,EAAc,SAAS,eAAe,aAAa,EACnDC,EAAe,SAAS,cAAc,KAAK,EAEjD,SAASC,GAAc,CACrB,IAAMC,EAAS,SAAS,cAA2B,oBAAoB,EACnEA,GACFA,EAAO,UAAU,IAAI,gBAAgB,CAEzC,CAGA,IAAMC,GADeN,EAAK,MAAMV,EAAAA,sBAAsBU,CAAE,EAAI,CAAC,EAAA,CACJ,IAAI,IAAS,CACpE,MAAO,EAAA,IAAI,wEAAwEO,EAAK,MAAM,IAC9F,MAAM,YAAc,CAClBH,EAAW,EACPJ,GACFQ,EAAS,aAAA,EAAYjB,EAAAA,IAAAA,CAAI,OAAO,SAAS,IAAI,EAAG,GAAMgB,EAAM,GAAM,IAAA,GAAWL,EAAa,EAAK,CAEnG,CACF,EAAE,EACIO,EAA+B,CACnC,CACE,MAAO,EAAA,IAAI,iEACX,MAAM,YAAc,CAElB,GADAL,EAAW,EACPJ,EAAI,CACN,IAAMU,EAAc,MAAMlB,EAAAA,sBAAsBQ,CAAE,EAClDQ,EAAS,aAAA,EAAYjB,EAAAA,IAAAA,CAAI,OAAO,SAAS,IAAI,EAAG,GAAMmB,EAAa,GAAM,IAAA,GAAWR,EAAa,EAAK,CACxG,CACF,CACF,EACA,CACE,MAAO,EAAA,IAAI,mEACX,MAAM,YAAc,CAElB,GADAE,EAAW,EACPJ,EAAI,CACN,IAAMW,EAAa,MAAMlB,EAAAA,qBAAqBO,CAAE,EAChDQ,EAAS,aAAA,EAAYjB,EAAAA,IAAAA,CAAI,OAAO,SAAS,IAAI,EAAG,GAAMoB,EAAY,GAAM,IAAA,GAAWT,EAAa,EAAK,CACvG,CACF,CACF,EACA,GAAGI,EACH,CACE,MAAO,EAAA,IAAI,2FACX,YAAc,CAEZ,GADAF,EAAW,EACPJ,EAAI,CACN,IAAMO,EAAOC,EAAS,QAAQ,QAAQ,aAAa,OAAO,MAAM,EAC5DD,GACFC,EAAS,aAAA,EAAYjB,EAAAA,IAAAA,CAAI,OAAO,SAAS,IAAI,EAAG,GAAMgB,EAAM,GAAM,IAAA,GAAWL,EAAa,EAAK,CAEnG,CACF,CACF,EACA,CACE,MAAO,EAAA,IAAI,iFACX,YAAc,CAEZ,GADAE,EAAW,EACPJ,EAAI,CACN,IAAMO,EAAOC,EAAS,QAAQ,QAAQ,aAAa,OAAO,kBAAkB,EACxED,GACFC,EAAS,aAAA,EAAYjB,EAAAA,IAAAA,CAAI,OAAO,SAAS,IAAI,EAAG,GAAMgB,EAAM,GAAM,IAAA,GAAWL,EAAa,EAAK,CAEnG,CACF,CACF,CACF,GAEA,EAAAL,EAAA,OAAA,CACE,EAAA,IAAI,kCAAkCY,EAAU,wBAChDN,CACF,EAEA,IAAMS,EAAST,EAAa,kBAE5B,GAAI,CAACS,EACH,MAAU,MAAM,yBAAyB,EAU3C,OANIX,GAAQA,EAAK,WACfA,EAAK,WAAW,aAAaW,EAAQX,CAAI,EAEzC,SAAS,KAAK,QAAQW,CAAM,EAGvBA,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.esm.js","names":[],"sources":["../../src/mainPage/header.ts"],"sourcesContent":["import { authn } from 'solid-logic'\nimport { html, render } from 'lit-html'\nimport type { AccountMenuItem } from 'solid-ui/components/account'\nimport type { OutlineManager } from '../outline/manager'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '~icons/lucide/layout-dashboard'\nimport '~icons/lucide/settings-2'\nimport '../components/header'\nimport { getProfilePaneFromURI, getSocialPaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { sym } from 'rdflib'\n\nexport async function createHeader (outliner: OutlineManager) {\n const existingHeader = document.querySelector('solid-panes-header')\n\n if (existingHeader) {\n return existingHeader\n }\n\n const me = authn.currentUser()\n\n const main = document.getElementById('MainContent')\n const outlineView = document.getElementById('OutlineView')\n const tmpContainer = document.createElement('div')\n\n function hideNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.add('navbar--hidden')\n }\n }\n\n const storagePanes = me ? await getFolderPanesFromURI(me) : []\n const storageMenuItems: AccountMenuItem[] = storagePanes.map(pane => ({\n label: html`<icon-lucide-folder-open slot=\"left-icon\"></icon-lucide-folder-open> ${pane.label()}`,\n async onSelected () {\n hideNavbar()\n if (me) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }))\n const menuItems: AccountMenuItem[] = [\n {\n label: html`<icon-lucide-user slot=\"left-icon\"></icon-lucide-user> Profile`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const profilePane = await getProfilePaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, profilePane, true, undefined, outlineView, false)\n }\n }\n },\n {\n label: html`<icon-lucide-users slot=\"left-icon\"></icon-lucide-users> Friends`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const socialPane = await getSocialPaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, socialPane, true, undefined, outlineView, false)\n }\n }\n },\n ...storageMenuItems,\n {\n label: html`<icon-lucide-layout-dashboard slot=\"left-icon\"></icon-lucide-layout-dashboard> Dashboard`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('home')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n {\n label: html`<icon-lucide-settings-2 slot=\"left-icon\"></icon-lucide-settings-2> Preferences`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('basicPreferences')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n ]\n\n render(\n html`<solid-panes-header .menuItems=${menuItems}></solid-panes-header>`,\n tmpContainer\n )\n\n const header = tmpContainer.firstElementChild\n\n if (!header) {\n throw new Error('Failed to create header')\n }\n\n // ensure it is in DOM (before MainContent for consistency)\n if (main && main.parentNode) {\n main.parentNode.insertBefore(header, main)\n } else {\n document.body.prepend(header)\n }\n\n return header\n}\n"],"mappings":";;;;;;;;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"header.esm.js","names":["createHeader","existingHeader","me","authn","main","outlineView","tmpContainer","hideNavbar","navbar","storageMenuItems","getFolderPanesFromURI","pane","outliner","sym","menuItems","profilePane","getProfilePaneFromURI","socialPane","getSocialPaneFromURI","header"],"sources":["../../src/mainPage/header.ts"],"sourcesContent":["import { authn } from 'solid-logic'\nimport { html, render } from 'lit-html'\nimport type { AccountMenuItem } from 'solid-ui/components/account'\nimport type { OutlineManager } from '../outline/manager'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '~icons/lucide/layout-dashboard'\nimport '~icons/lucide/settings-2'\nimport '../components/header'\nimport { getProfilePaneFromURI, getSocialPaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { sym } from 'rdflib'\n\nexport async function createHeader (outliner: OutlineManager) {\n const existingHeader = document.querySelector('solid-panes-header')\n\n if (existingHeader) {\n return existingHeader\n }\n\n const me = authn.currentUser()\n\n const main = document.getElementById('MainContent')\n const outlineView = document.getElementById('OutlineView')\n const tmpContainer = document.createElement('div')\n\n function hideNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.add('navbar--hidden')\n }\n }\n\n const storagePanes = me ? await getFolderPanesFromURI(me) : []\n const storageMenuItems: AccountMenuItem[] = storagePanes.map(pane => ({\n label: html`<icon-lucide-folder-open slot=\"left-icon\"></icon-lucide-folder-open> ${pane.label()}`,\n async onSelected () {\n hideNavbar()\n if (me) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }))\n const menuItems: AccountMenuItem[] = [\n {\n label: html`<icon-lucide-user slot=\"left-icon\"></icon-lucide-user> Profile`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const profilePane = await getProfilePaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, profilePane, true, undefined, outlineView, false)\n }\n }\n },\n {\n label: html`<icon-lucide-users slot=\"left-icon\"></icon-lucide-users> Friends`,\n async onSelected () {\n hideNavbar()\n if (me) {\n const socialPane = await getSocialPaneFromURI(me)\n outliner.GotoSubject(sym(window.location.href), true, socialPane, true, undefined, outlineView, false)\n }\n }\n },\n ...storageMenuItems,\n {\n label: html`<icon-lucide-layout-dashboard slot=\"left-icon\"></icon-lucide-layout-dashboard> Dashboard`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('home')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n {\n label: html`<icon-lucide-settings-2 slot=\"left-icon\"></icon-lucide-settings-2> Preferences`,\n onSelected () {\n hideNavbar()\n if (me) {\n const pane = outliner.context.session.paneRegistry.byName('basicPreferences')\n if (pane) {\n outliner.GotoSubject(sym(window.location.href), true, pane, true, undefined, outlineView, false)\n }\n }\n }\n },\n ]\n\n render(\n html`<solid-panes-header .menuItems=${menuItems}></solid-panes-header>`,\n tmpContainer\n )\n\n const header = tmpContainer.firstElementChild\n\n if (!header) {\n throw new Error('Failed to create header')\n }\n\n // ensure it is in DOM (before MainContent for consistency)\n if (main && main.parentNode) {\n main.parentNode.insertBefore(header, main)\n } else {\n document.body.prepend(header)\n }\n\n return header\n}\n"],"mappings":";;;;;;;;;;;AAcA,eAAsBA,EAAc,GAA0B;CAC5D,IAAMC,IAAiB,SAAS,cAAc,oBAAoB;CAElE,IAAIA,GACF,OAAOA;CAGT,IAAMC,IAAKC,EAAM,YAAY,GAEvBC,IAAO,SAAS,eAAe,aAAa,GAC5CC,IAAc,SAAS,eAAe,aAAa,GACnDC,IAAe,SAAS,cAAc,KAAK;CAEjD,SAASC,IAAc;EACrB,IAAMC,IAAS,SAAS,cAA2B,oBAAoB;EACvE,AAAIA,KACFA,EAAO,UAAU,IAAI,gBAAgB;CAEzC;CAGA,IAAMC,KADeP,IAAK,MAAMQ,EAAsBR,CAAE,IAAI,CAAC,EAAA,CACJ,KAAI,OAAS;EACpE,OAAO,CAAI,wEAAwES,EAAK,MAAM;EAC9F,MAAM,aAAc;GAElB,AADAJ,EAAW,GACPL,KACFU,EAAS,YAAYC,EAAI,OAAO,SAAS,IAAI,GAAG,IAAMF,GAAM,IAAM,KAAA,GAAWN,GAAa,EAAK;EAEnG;CACF,EAAE,GACIS,IAA+B;EACnC;GACE,OAAO,CAAI;GACX,MAAM,aAAc;IAElB,IADAP,EAAW,GACPL,GAAI;KACN,IAAMa,IAAc,MAAMC,EAAsBd,CAAE;KAClD,EAAS,YAAYW,EAAI,OAAO,SAAS,IAAI,GAAG,IAAME,GAAa,IAAM,KAAA,GAAWV,GAAa,EAAK;IACxG;GACF;EACF;EACA;GACE,OAAO,CAAI;GACX,MAAM,aAAc;IAElB,IADAE,EAAW,GACPL,GAAI;KACN,IAAMe,IAAa,MAAMC,EAAqBhB,CAAE;KAChD,EAAS,YAAYW,EAAI,OAAO,SAAS,IAAI,GAAG,IAAMI,GAAY,IAAM,KAAA,GAAWZ,GAAa,EAAK;IACvG;GACF;EACF;EACA,GAAGI;EACH;GACE,OAAO,CAAI;GACX,aAAc;IAEZ,IADAF,EAAW,GACPL,GAAI;KACN,IAAMS,IAAOC,EAAS,QAAQ,QAAQ,aAAa,OAAO,MAAM;KAChE,AAAID,KACFC,EAAS,YAAYC,EAAI,OAAO,SAAS,IAAI,GAAG,IAAMF,GAAM,IAAM,KAAA,GAAWN,GAAa,EAAK;IAEnG;GACF;EACF;EACA;GACE,OAAO,CAAI;GACX,aAAc;IAEZ,IADAE,EAAW,GACPL,GAAI;KACN,IAAMS,IAAOC,EAAS,QAAQ,QAAQ,aAAa,OAAO,kBAAkB;KAC5E,AAAID,KACFC,EAAS,YAAYC,EAAI,OAAO,SAAS,IAAI,GAAG,IAAMF,GAAM,IAAM,KAAA,GAAWN,GAAa,EAAK;IAEnG;GACF;EACF;CACF;CAEA,EACE,CAAI,kCAAkCS,EAAU,yBAChDR,CACF;CAEA,IAAMa,IAASb,EAAa;CAE5B,IAAI,CAACa,GACH,MAAU,MAAM,yBAAyB;CAU3C,OANIf,KAAQA,EAAK,aACfA,EAAK,WAAW,aAAae,GAAQf,CAAI,IAEzC,SAAS,KAAK,QAAQe,CAAM,GAGvBA;AACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":[],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport * as paneRegistry from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { getProfilePaneFromURI } from '../utils/paneUtils'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const historyPaneName = window.history.state?.paneName\n const historyPane = historyPaneName\n ? paneRegistry.byName(historyPaneName)\n : undefined\n const initialPane = historyPane ??\n (!historyPaneName && isWebIdUri(subject)\n ? await getProfilePaneFromURI(subject)\n : undefined)\n\n outliner.GotoSubject(subject, true, initialPane, true, undefined, undefined, true, false)\n\n const header = await createHeader(outliner)\n const navbar = await createNavbar(outliner)\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n const paneRegistry = outliner?.context?.session?.paneRegistry\n const paneName = window.history.state?.paneName\n const paneUri = window.history.state?.paneUri\n // Panes rendered for a subject other than the page URL (storage/profile/social)\n // must be restored from paneUri, since byName() returns the pane without that subject.\n const usesOwnSubject = paneName === 'profile' || paneName === 'social' || paneName === 'folder'\n const subjectUri = paneUri && usesOwnSubject\n ? paneUri\n : window.document.location.href\n const pane = paneName ? paneRegistry?.byName?.(paneName) : undefined\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n outliner.GotoSubject(store.sym(subjectUri), true, pane, true, undefined, undefined, true, false)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"4QAgBA,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["getOutliner","paneRegistry","isWebIdUri","getProfilePaneFromURI","createHeader","createNavbar","require_runtime","require_webIdUtils","require_paneUtils","require_header","require_navbar","require_index","pane_registry","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","outliner","environment","subject","uri","store","historyPaneName","initialPane","header","navbar","refreshUI","paneRegistry","paneName","paneUri","subjectUri","pane","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport * as paneRegistry from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { getProfilePaneFromURI } from '../utils/paneUtils'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const historyPaneName = window.history.state?.paneName\n const historyPane = historyPaneName\n ? paneRegistry.byName(historyPaneName)\n : undefined\n const initialPane = historyPane ??\n (!historyPaneName && isWebIdUri(subject)\n ? await getProfilePaneFromURI(subject)\n : undefined)\n\n outliner.GotoSubject(subject, true, initialPane, true, undefined, undefined, true, false)\n\n const header = await createHeader(outliner)\n const navbar = await createNavbar(outliner)\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n const paneRegistry = outliner?.context?.session?.paneRegistry\n const paneName = window.history.state?.paneName\n const paneUri = window.history.state?.paneUri\n // Panes rendered for a subject other than the page URL (storage/profile/social)\n // must be restored from paneUri, since byName() returns the pane without that subject.\n const usesOwnSubject = paneName === 'profile' || paneName === 'social' || paneName === 'folder'\n const subjectUri = paneUri && usesOwnSubject\n ? paneUri\n : window.document.location.href\n const pane = paneName ? paneRegistry?.byName?.(paneName) : undefined\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n outliner.GotoSubject(store.sym(subjectUri), true, pane, true, undefined, undefined, true, false)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"4QAgBA,IAAMa,EAAsB,2BAE5B,SAASC,EAAoB,EAAiC,CAE5D,OADKC,EACE,CAACA,EAAI,OAAQA,EAAI,MAAOA,EAAI,SAAS,CAAC,CAAC,KAAK,GAAG,EADrC,EAEnB,CAEA,SAASC,GAAqB,CAC5B,IAAIC,EAAO,SAAS,eAAe,aAAa,EAShD,OARKA,IACH,EAAO,SAAS,cAAc,MAAM,EACpC,EAAK,GAAK,cACVA,EAAK,aAAa,OAAQ,MAAM,EAChCA,EAAK,aAAa,WAAY,IAAI,EAClCA,EAAK,aAAa,YAAa,QAAQ,EACvC,SAAS,KAAK,YAAYA,CAAI,GAEzBA,CACT,CAEA,eAAsBC,EACpB,EACA,EACA,EACA,CACAF,EAAkB,EAClB,IAAMG,EAAWnB,EAAAA,YAAY,SAAUoB,CAAW,EACjD,EAAkBP,GAAuBC,EAAmBM,CAAW,EACxE,IAAa,OAAO,SAAS,KAC7B,IAAMC,EAAqB,OAAOC,GAAQ,SAAWC,EAAM,IAAID,CAAG,EAAIA,EAChEE,EAAkB,OAAO,QAAQ,OAAO,SAIxCC,GAHcD,EAChBvB,EAAa,OAAOuB,CAAe,EACnC,IAAA,MAED,CAACA,GAAmBtB,EAAAA,WAAWmB,CAAO,EACnC,MAAMlB,EAAAA,sBAAsBkB,CAAO,EACnC,IAAA,IAENF,EAAS,YAAYE,EAAS,GAAMI,EAAa,GAAM,IAAA,GAAW,IAAA,GAAW,GAAM,EAAK,EAExF,IAAMC,EAAS,MAAMtB,EAAAA,aAAae,CAAQ,EACpCQ,EAAS,MAAMtB,EAAAA,aAAac,CAAQ,EAC1C,OAAO,QAAQ,IAAI,CAACO,EAAQC,CAAM,CAAC,CACrC,CAEA,eAAsBC,EAAW,EAA0B,CACzD,IAAML,EAAQJ,GAAU,SAAS,SAAS,MACpCU,EAAeV,GAAU,SAAS,SAAS,aAC3CW,EAAW,OAAO,QAAQ,OAAO,SACjCC,EAAU,OAAO,QAAQ,OAAO,QAIhCC,EAAaD,IADID,IAAa,WAAaA,IAAa,UAAYA,IAAa,UAEnFC,EACA,OAAO,SAAS,SAAS,KACvBE,EAAOH,EAAWD,GAAc,SAASC,CAAQ,EAAI,IAAA,GAIrDI,EAAmBpB,EAAmBK,GAAU,SAAS,WAAW,EAEvDe,KADQf,IAAmBN,IAAwB,KAGpDU,GAAS,OAAOJ,GAAU,aAAgB,aAC1DA,EAAS,YAAYI,EAAM,IAAIS,CAAU,EAAG,GAAMC,EAAM,GAAM,IAAA,GAAW,IAAA,GAAW,GAAM,EAAK,EAC9F,EAAkBpB,GAAuBqB,EAE9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":[],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport * as paneRegistry from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { getProfilePaneFromURI } from '../utils/paneUtils'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const historyPaneName = window.history.state?.paneName\n const historyPane = historyPaneName\n ? paneRegistry.byName(historyPaneName)\n : undefined\n const initialPane = historyPane ??\n (!historyPaneName && isWebIdUri(subject)\n ? await getProfilePaneFromURI(subject)\n : undefined)\n\n outliner.GotoSubject(subject, true, initialPane, true, undefined, undefined, true, false)\n\n const header = await createHeader(outliner)\n const navbar = await createNavbar(outliner)\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n const paneRegistry = outliner?.context?.session?.paneRegistry\n const paneName = window.history.state?.paneName\n const paneUri = window.history.state?.paneUri\n // Panes rendered for a subject other than the page URL (storage/profile/social)\n // must be restored from paneUri, since byName() returns the pane without that subject.\n const usesOwnSubject = paneName === 'profile' || paneName === 'social' || paneName === 'folder'\n const subjectUri = paneUri && usesOwnSubject\n ? paneUri\n : window.document.location.href\n const pane = paneName ? paneRegistry?.byName?.(paneName) : undefined\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n outliner.GotoSubject(store.sym(subjectUri), true, pane, true, undefined, undefined, true, false)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;AAgBA,
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["paneRegistry","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","outliner","getOutliner","environment","subject","uri","store","historyPaneName","initialPane","isWebIdUri","getProfilePaneFromURI","header","createHeader","navbar","createNavbar","refreshUI","paneName","paneUri","subjectUri","pane","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport * as paneRegistry from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { getProfilePaneFromURI } from '../utils/paneUtils'\nimport { isWebIdUri } from '../utils/webIdUtils'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const historyPaneName = window.history.state?.paneName\n const historyPane = historyPaneName\n ? paneRegistry.byName(historyPaneName)\n : undefined\n const initialPane = historyPane ??\n (!historyPaneName && isWebIdUri(subject)\n ? await getProfilePaneFromURI(subject)\n : undefined)\n\n outliner.GotoSubject(subject, true, initialPane, true, undefined, undefined, true, false)\n\n const header = await createHeader(outliner)\n const navbar = await createNavbar(outliner)\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n const paneRegistry = outliner?.context?.session?.paneRegistry\n const paneName = window.history.state?.paneName\n const paneUri = window.history.state?.paneUri\n // Panes rendered for a subject other than the page URL (storage/profile/social)\n // must be restored from paneUri, since byName() returns the pane without that subject.\n const usesOwnSubject = paneName === 'profile' || paneName === 'social' || paneName === 'folder'\n const subjectUri = paneUri && usesOwnSubject\n ? paneUri\n : window.document.location.href\n const pane = paneName ? paneRegistry?.byName?.(paneName) : undefined\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n outliner.GotoSubject(store.sym(subjectUri), true, pane, true, undefined, undefined, true, false)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;AAgBA,IAAMC,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CACA,EAAkB;CAClB,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CAElD,AADC,EAAkBR,KAAuBC,EAAmBO,CAAW,GACxE,MAAa,OAAO,SAAS;CAC7B,IAAMC,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA,GAChEE,IAAkB,OAAO,QAAQ,OAAO,UAIxCC,KAHcD,IAChBb,EAAa,OAAOa,CAAe,IACnC,KAAA,OAED,CAACA,KAAmBE,EAAWL,CAAO,IACnC,MAAMM,EAAsBN,CAAO,IACnC,KAAA;CAEN,EAAS,YAAYA,GAAS,IAAMI,GAAa,IAAM,KAAA,GAAW,KAAA,GAAW,IAAM,EAAK;CAExF,IAAMG,IAAS,MAAMC,EAAaX,CAAQ,GACpCY,IAAS,MAAMC,EAAab,CAAQ;CAC1C,OAAO,QAAQ,IAAI,CAACU,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBE,EAAW,GAA0B;CACzD,IAAMT,IAAQL,GAAU,SAAS,SAAS,OACpCP,IAAeO,GAAU,SAAS,SAAS,cAC3Ce,IAAW,OAAO,QAAQ,OAAO,UACjCC,IAAU,OAAO,QAAQ,OAAO,SAIhCC,IAAaD,MADID,MAAa,aAAaA,MAAa,YAAYA,MAAa,YAEnFC,IACA,OAAO,SAAS,SAAS,MACvBE,IAAOH,IAAWtB,GAAc,SAASsB,CAAQ,IAAI,KAAA,GAIrDI,IAAmBxB,EAAmBK,GAAU,SAAS,WAAW;CAI1E,AAFmBmB,OADQnB,IAAmBN,MAAwB,OAGpDW,KAAS,OAAOL,GAAU,eAAgB,eAC1DA,EAAS,YAAYK,EAAM,IAAIY,CAAU,GAAG,IAAMC,GAAM,IAAM,KAAA,GAAW,KAAA,GAAW,IAAM,EAAK,GAC9F,EAAkBxB,KAAuByB;AAE9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.cjs.js","names":[],"sources":["../../src/mainPage/navbar.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport { getSocialPaneFromURI, getProfilePaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { html, render } from 'lit-html'\nimport type { OutlineManager } from '../outline/manager'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '../components/navbar'\n\nimport type { NavbarMenuItem } from '../components/navbar/Navbar'\n\nfunction showNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.remove('navbar--hidden')\n }\n}\n\nfunction createNavItem (\n label: string,\n onSelected: () => void,\n selected = false\n): NavbarMenuItem {\n return {\n label,\n onSelected () {\n showNavbar()\n return onSelected()\n },\n selected\n }\n}\n\nasync function createNavbarMenuItems (\n outliner: OutlineManager,\n subject: NamedNode,\n outlineView: HTMLElement | null,\n selectedPaneName?: string,\n selectedPaneUri?: string\n): Promise<NavbarMenuItem[]> {\n const webId = await loadProfileFromURI(subject)\n const selectedPane = selectedPaneName || (isWebIdUri(subject) ? 'profile' : undefined)\n\n const menuItems: NavbarMenuItem[] = []\n\n if (webId) {\n menuItems.push(\n createNavItem('Profile', async () => {\n const profilePane = await getProfilePaneFromURI(webId)\n outliner.GotoSubject(subject, true, profilePane, true, undefined, outlineView)\n }, selectedPane === 'profile'),\n createNavItem('Friends', async () => {\n const socialPane = await getSocialPaneFromURI(webId)\n outliner.GotoSubject(subject, true, socialPane, true, undefined, outlineView)\n }, selectedPane === 'social')\n )\n }\n\n const storagePanes = await getFolderPanesFromURI(subject)\n storagePanes.forEach(pane => {\n menuItems.push(\n createNavItem(\n pane.label(),\n async () => {\n outliner.GotoSubject(subject, true, pane, true, undefined, outlineView)\n },\n selectedPane === pane.paneName &&\n (selectedPaneUri ? selectedPaneUri === pane.subject.value : storagePanes.length === 1)\n )\n )\n })\n\n return menuItems\n}\n\nexport async function createNavbar (outliner: OutlineManager) {\n const existingNavbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n\n if (existingNavbar) {\n existingNavbar.classList.remove('navbar--hidden')\n return existingNavbar\n }\n\n const OutlineView = document.getElementById('OutlineView')\n const mainContent = document.getElementById('MainContent')\n const tmpContainer = document.createElement('div')\n const uri = window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const selectedPaneName = window.history.state?.paneName\n const selectedPaneUri = window.history.state?.paneUri\n let menuItems = await createNavbarMenuItems(outliner, subject, OutlineView, selectedPaneName, selectedPaneUri).catch((err) => {\n console.error('Failed to build navbar menu items:', err)\n return []\n })\n\n function setSelectedItem (selectedItem: NavbarMenuItem) {\n menuItems = menuItems.map((menuItem) => ({\n ...menuItem,\n selected: menuItem === selectedItem\n }))\n }\n\n function handleSelectionChanged (event: Event) {\n const { detail: selectedItem } = event as CustomEvent<NavbarMenuItem>\n setSelectedItem(selectedItem)\n\n Promise.resolve(selectedItem.onSelected?.()).catch((error) => {\n console.error('Navbar menu item selection failed:', error)\n })\n\n renderNavbar()\n }\n\n function renderNavbar () {\n render(\n html`<solid-panes-navbar .navbarItems=${menuItems} @solid-ui-select=${handleSelectionChanged}></solid-panes-navbar>`,\n tmpContainer\n )\n }\n\n renderNavbar()\n\n const navbar = tmpContainer.firstElementChild as HTMLElement | null\n\n if (!navbar) {\n throw new Error('Failed to create nav bar')\n }\n\n if (mainContent) {\n mainContent.insertBefore(navbar, mainContent.firstChild)\n } else {\n document.body.prepend(navbar)\n }\n\n return navbar\n}\n"],"mappings":"sVAcA,
|
|
1
|
+
{"version":3,"file":"navbar.cjs.js","names":["loadProfileFromURI","isWebIdUri","getProfilePaneFromURI","getSocialPaneFromURI","getFolderPanesFromURI","store","require_webIdUtils","require_paneUtils","solid_logic","lit_html","showNavbar","navbar","createNavItem","onSelected","createNavbarMenuItems","webId","subject","selectedPane","selectedPaneName","menuItems","profilePane","outliner","outlineView","socialPane","storagePanes","pane","selectedPaneUri","createNavbar","existingNavbar","OutlineView","mainContent","tmpContainer","uri","err","setSelectedItem","menuItem","selectedItem","handleSelectionChanged","event","error","renderNavbar"],"sources":["../../src/mainPage/navbar.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport { getSocialPaneFromURI, getProfilePaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { html, render } from 'lit-html'\nimport type { OutlineManager } from '../outline/manager'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '../components/navbar'\n\nimport type { NavbarMenuItem } from '../components/navbar/Navbar'\n\nfunction showNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.remove('navbar--hidden')\n }\n}\n\nfunction createNavItem (\n label: string,\n onSelected: () => void,\n selected = false\n): NavbarMenuItem {\n return {\n label,\n onSelected () {\n showNavbar()\n return onSelected()\n },\n selected\n }\n}\n\nasync function createNavbarMenuItems (\n outliner: OutlineManager,\n subject: NamedNode,\n outlineView: HTMLElement | null,\n selectedPaneName?: string,\n selectedPaneUri?: string\n): Promise<NavbarMenuItem[]> {\n const webId = await loadProfileFromURI(subject)\n const selectedPane = selectedPaneName || (isWebIdUri(subject) ? 'profile' : undefined)\n\n const menuItems: NavbarMenuItem[] = []\n\n if (webId) {\n menuItems.push(\n createNavItem('Profile', async () => {\n const profilePane = await getProfilePaneFromURI(webId)\n outliner.GotoSubject(subject, true, profilePane, true, undefined, outlineView)\n }, selectedPane === 'profile'),\n createNavItem('Friends', async () => {\n const socialPane = await getSocialPaneFromURI(webId)\n outliner.GotoSubject(subject, true, socialPane, true, undefined, outlineView)\n }, selectedPane === 'social')\n )\n }\n\n const storagePanes = await getFolderPanesFromURI(subject)\n storagePanes.forEach(pane => {\n menuItems.push(\n createNavItem(\n pane.label(),\n async () => {\n outliner.GotoSubject(subject, true, pane, true, undefined, outlineView)\n },\n selectedPane === pane.paneName &&\n (selectedPaneUri ? selectedPaneUri === pane.subject.value : storagePanes.length === 1)\n )\n )\n })\n\n return menuItems\n}\n\nexport async function createNavbar (outliner: OutlineManager) {\n const existingNavbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n\n if (existingNavbar) {\n existingNavbar.classList.remove('navbar--hidden')\n return existingNavbar\n }\n\n const OutlineView = document.getElementById('OutlineView')\n const mainContent = document.getElementById('MainContent')\n const tmpContainer = document.createElement('div')\n const uri = window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const selectedPaneName = window.history.state?.paneName\n const selectedPaneUri = window.history.state?.paneUri\n let menuItems = await createNavbarMenuItems(outliner, subject, OutlineView, selectedPaneName, selectedPaneUri).catch((err) => {\n console.error('Failed to build navbar menu items:', err)\n return []\n })\n\n function setSelectedItem (selectedItem: NavbarMenuItem) {\n menuItems = menuItems.map((menuItem) => ({\n ...menuItem,\n selected: menuItem === selectedItem\n }))\n }\n\n function handleSelectionChanged (event: Event) {\n const { detail: selectedItem } = event as CustomEvent<NavbarMenuItem>\n setSelectedItem(selectedItem)\n\n Promise.resolve(selectedItem.onSelected?.()).catch((error) => {\n console.error('Navbar menu item selection failed:', error)\n })\n\n renderNavbar()\n }\n\n function renderNavbar () {\n render(\n html`<solid-panes-navbar .navbarItems=${menuItems} @solid-ui-select=${handleSelectionChanged}></solid-panes-navbar>`,\n tmpContainer\n )\n }\n\n renderNavbar()\n\n const navbar = tmpContainer.firstElementChild as HTMLElement | null\n\n if (!navbar) {\n throw new Error('Failed to create nav bar')\n }\n\n if (mainContent) {\n mainContent.insertBefore(navbar, mainContent.firstChild)\n } else {\n document.body.prepend(navbar)\n }\n\n return navbar\n}\n"],"mappings":"sVAcA,SAASU,GAAc,CACrB,IAAMC,EAAS,SAAS,cAA2B,oBAAoB,EACnEA,GACFA,EAAO,UAAU,OAAO,gBAAgB,CAE5C,CAEA,SAASC,EACP,EACA,EACA,EAAW,GACK,CAChB,MAAO,CACL,QACA,YAAc,CAEZ,OADAF,EAAW,EACJG,EAAW,CACpB,EACA,UACF,CACF,CAEA,eAAeC,EACb,EACA,EACA,EACA,EACA,EAC2B,CAC3B,IAAMC,EAAQ,MAAMf,EAAAA,mBAAmBgB,CAAO,EACxCC,EAAeC,IAAqBjB,EAAAA,WAAWe,CAAO,EAAI,UAAY,IAAA,IAEtEG,EAA8B,CAAC,EAEjCJ,GACFI,EAAU,KACRP,EAAc,UAAW,SAAY,CACnC,IAAMQ,EAAc,MAAMlB,EAAAA,sBAAsBa,CAAK,EACrDM,EAAS,YAAYL,EAAS,GAAMI,EAAa,GAAM,IAAA,GAAWE,CAAW,CAC/E,EAAGL,IAAiB,SAAS,EAC7BL,EAAc,UAAW,SAAY,CACnC,IAAMW,EAAa,MAAMpB,EAAAA,qBAAqBY,CAAK,EACnDM,EAAS,YAAYL,EAAS,GAAMO,EAAY,GAAM,IAAA,GAAWD,CAAW,CAC9E,EAAGL,IAAiB,QAAQ,CAC9B,EAGF,IAAMO,EAAe,MAAMpB,EAAAA,sBAAsBY,CAAO,EAcxD,OAbAQ,EAAa,QAAQ,GAAQ,CAC3BL,EAAU,KACRP,EACEa,EAAK,MAAM,EACX,SAAY,CACVJ,EAAS,YAAYL,EAAS,GAAMS,EAAM,GAAM,IAAA,GAAWH,CAAW,CACxE,EACAL,IAAiBQ,EAAK,WACnBC,EAAkBA,IAAoBD,EAAK,QAAQ,MAAQD,EAAa,SAAW,EACxF,CACF,CACF,CAAC,EAEML,CACT,CAEA,eAAsBQ,EAAc,EAA0B,CAC5D,IAAMC,EAAiB,SAAS,cAA2B,oBAAoB,EAE/E,GAAIA,EAEF,OADAA,EAAe,UAAU,OAAO,gBAAgB,EACzCA,EAGT,IAAMC,EAAc,SAAS,eAAe,aAAa,EACnDC,EAAc,SAAS,eAAe,aAAa,EACnDC,EAAe,SAAS,cAAc,KAAK,EAC3CC,EAAM,OAAO,SAAS,KACtBhB,EAAqB,OAAOgB,GAAQ,SAAW3B,EAAAA,MAAM,IAAI2B,CAAG,EAAIA,EAChEd,EAAmB,OAAO,QAAQ,OAAO,SACzCQ,EAAkB,OAAO,QAAQ,OAAO,QAC1CP,EAAY,MAAML,EAAsBO,EAAUL,EAASa,EAAaX,EAAkBQ,CAAe,CAAC,CAAC,MAAO,IACpH,QAAQ,MAAM,qCAAsCO,CAAG,EAChD,CAAC,EACT,EAED,SAASC,EAAiB,EAA8B,CACtD,EAAYf,EAAU,IAAK,IAAc,CACvC,GAAGgB,EACH,SAAUA,IAAaC,CACzB,EAAE,CACJ,CAEA,SAASC,EAAwB,EAAc,CAC7C,GAAM,CAAE,OAAQD,GAAiBE,EACjCJ,EAAgBE,CAAY,EAE5B,QAAQ,QAAQA,EAAa,aAAa,CAAC,CAAC,CAAC,MAAO,GAAU,CAC5D,QAAQ,MAAM,qCAAsCG,CAAK,CAC3D,CAAC,EAEDC,EAAa,CACf,CAEA,SAASA,GAAgB,EACvB,EAAA/B,EAAA,OAAA,CACE,EAAA,IAAI,oCAAoCU,EAAU,oBAAoBkB,EAAuB,wBAC7FN,CACF,CACF,CAEAS,EAAa,EAEb,IAAM7B,EAASoB,EAAa,kBAE5B,GAAI,CAACpB,EACH,MAAU,MAAM,0BAA0B,EAS5C,OANImB,EACFA,EAAY,aAAanB,EAAQmB,EAAY,UAAU,EAEvD,SAAS,KAAK,QAAQnB,CAAM,EAGvBA,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navbar.esm.js","names":[],"sources":["../../src/mainPage/navbar.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport { getSocialPaneFromURI, getProfilePaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { html, render } from 'lit-html'\nimport type { OutlineManager } from '../outline/manager'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '../components/navbar'\n\nimport type { NavbarMenuItem } from '../components/navbar/Navbar'\n\nfunction showNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.remove('navbar--hidden')\n }\n}\n\nfunction createNavItem (\n label: string,\n onSelected: () => void,\n selected = false\n): NavbarMenuItem {\n return {\n label,\n onSelected () {\n showNavbar()\n return onSelected()\n },\n selected\n }\n}\n\nasync function createNavbarMenuItems (\n outliner: OutlineManager,\n subject: NamedNode,\n outlineView: HTMLElement | null,\n selectedPaneName?: string,\n selectedPaneUri?: string\n): Promise<NavbarMenuItem[]> {\n const webId = await loadProfileFromURI(subject)\n const selectedPane = selectedPaneName || (isWebIdUri(subject) ? 'profile' : undefined)\n\n const menuItems: NavbarMenuItem[] = []\n\n if (webId) {\n menuItems.push(\n createNavItem('Profile', async () => {\n const profilePane = await getProfilePaneFromURI(webId)\n outliner.GotoSubject(subject, true, profilePane, true, undefined, outlineView)\n }, selectedPane === 'profile'),\n createNavItem('Friends', async () => {\n const socialPane = await getSocialPaneFromURI(webId)\n outliner.GotoSubject(subject, true, socialPane, true, undefined, outlineView)\n }, selectedPane === 'social')\n )\n }\n\n const storagePanes = await getFolderPanesFromURI(subject)\n storagePanes.forEach(pane => {\n menuItems.push(\n createNavItem(\n pane.label(),\n async () => {\n outliner.GotoSubject(subject, true, pane, true, undefined, outlineView)\n },\n selectedPane === pane.paneName &&\n (selectedPaneUri ? selectedPaneUri === pane.subject.value : storagePanes.length === 1)\n )\n )\n })\n\n return menuItems\n}\n\nexport async function createNavbar (outliner: OutlineManager) {\n const existingNavbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n\n if (existingNavbar) {\n existingNavbar.classList.remove('navbar--hidden')\n return existingNavbar\n }\n\n const OutlineView = document.getElementById('OutlineView')\n const mainContent = document.getElementById('MainContent')\n const tmpContainer = document.createElement('div')\n const uri = window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const selectedPaneName = window.history.state?.paneName\n const selectedPaneUri = window.history.state?.paneUri\n let menuItems = await createNavbarMenuItems(outliner, subject, OutlineView, selectedPaneName, selectedPaneUri).catch((err) => {\n console.error('Failed to build navbar menu items:', err)\n return []\n })\n\n function setSelectedItem (selectedItem: NavbarMenuItem) {\n menuItems = menuItems.map((menuItem) => ({\n ...menuItem,\n selected: menuItem === selectedItem\n }))\n }\n\n function handleSelectionChanged (event: Event) {\n const { detail: selectedItem } = event as CustomEvent<NavbarMenuItem>\n setSelectedItem(selectedItem)\n\n Promise.resolve(selectedItem.onSelected?.()).catch((error) => {\n console.error('Navbar menu item selection failed:', error)\n })\n\n renderNavbar()\n }\n\n function renderNavbar () {\n render(\n html`<solid-panes-navbar .navbarItems=${menuItems} @solid-ui-select=${handleSelectionChanged}></solid-panes-navbar>`,\n tmpContainer\n )\n }\n\n renderNavbar()\n\n const navbar = tmpContainer.firstElementChild as HTMLElement | null\n\n if (!navbar) {\n throw new Error('Failed to create nav bar')\n }\n\n if (mainContent) {\n mainContent.insertBefore(navbar, mainContent.firstChild)\n } else {\n document.body.prepend(navbar)\n }\n\n return navbar\n}\n"],"mappings":";;;;;;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"navbar.esm.js","names":["showNavbar","navbar","createNavItem","onSelected","createNavbarMenuItems","webId","loadProfileFromURI","subject","selectedPane","selectedPaneName","isWebIdUri","menuItems","profilePane","getProfilePaneFromURI","outlineView","socialPane","getSocialPaneFromURI","storagePanes","getFolderPanesFromURI","pane","selectedPaneUri","createNavbar","existingNavbar","OutlineView","mainContent","tmpContainer","uri","store","outliner","err","setSelectedItem","menuItem","selectedItem","handleSelectionChanged","event","error","renderNavbar"],"sources":["../../src/mainPage/navbar.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { NamedNode } from 'rdflib'\nimport { getSocialPaneFromURI, getProfilePaneFromURI, getFolderPanesFromURI } from '../utils/paneUtils'\nimport { html, render } from 'lit-html'\nimport type { OutlineManager } from '../outline/manager'\nimport { isWebIdUri, loadProfileFromURI } from '../utils/webIdUtils'\n\nimport '~icons/lucide/user'\nimport '~icons/lucide/users'\nimport '~icons/lucide/folder-open'\nimport '../components/navbar'\n\nimport type { NavbarMenuItem } from '../components/navbar/Navbar'\n\nfunction showNavbar () {\n const navbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n if (navbar) {\n navbar.classList.remove('navbar--hidden')\n }\n}\n\nfunction createNavItem (\n label: string,\n onSelected: () => void,\n selected = false\n): NavbarMenuItem {\n return {\n label,\n onSelected () {\n showNavbar()\n return onSelected()\n },\n selected\n }\n}\n\nasync function createNavbarMenuItems (\n outliner: OutlineManager,\n subject: NamedNode,\n outlineView: HTMLElement | null,\n selectedPaneName?: string,\n selectedPaneUri?: string\n): Promise<NavbarMenuItem[]> {\n const webId = await loadProfileFromURI(subject)\n const selectedPane = selectedPaneName || (isWebIdUri(subject) ? 'profile' : undefined)\n\n const menuItems: NavbarMenuItem[] = []\n\n if (webId) {\n menuItems.push(\n createNavItem('Profile', async () => {\n const profilePane = await getProfilePaneFromURI(webId)\n outliner.GotoSubject(subject, true, profilePane, true, undefined, outlineView)\n }, selectedPane === 'profile'),\n createNavItem('Friends', async () => {\n const socialPane = await getSocialPaneFromURI(webId)\n outliner.GotoSubject(subject, true, socialPane, true, undefined, outlineView)\n }, selectedPane === 'social')\n )\n }\n\n const storagePanes = await getFolderPanesFromURI(subject)\n storagePanes.forEach(pane => {\n menuItems.push(\n createNavItem(\n pane.label(),\n async () => {\n outliner.GotoSubject(subject, true, pane, true, undefined, outlineView)\n },\n selectedPane === pane.paneName &&\n (selectedPaneUri ? selectedPaneUri === pane.subject.value : storagePanes.length === 1)\n )\n )\n })\n\n return menuItems\n}\n\nexport async function createNavbar (outliner: OutlineManager) {\n const existingNavbar = document.querySelector<HTMLElement>('solid-panes-navbar')\n\n if (existingNavbar) {\n existingNavbar.classList.remove('navbar--hidden')\n return existingNavbar\n }\n\n const OutlineView = document.getElementById('OutlineView')\n const mainContent = document.getElementById('MainContent')\n const tmpContainer = document.createElement('div')\n const uri = window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n const selectedPaneName = window.history.state?.paneName\n const selectedPaneUri = window.history.state?.paneUri\n let menuItems = await createNavbarMenuItems(outliner, subject, OutlineView, selectedPaneName, selectedPaneUri).catch((err) => {\n console.error('Failed to build navbar menu items:', err)\n return []\n })\n\n function setSelectedItem (selectedItem: NavbarMenuItem) {\n menuItems = menuItems.map((menuItem) => ({\n ...menuItem,\n selected: menuItem === selectedItem\n }))\n }\n\n function handleSelectionChanged (event: Event) {\n const { detail: selectedItem } = event as CustomEvent<NavbarMenuItem>\n setSelectedItem(selectedItem)\n\n Promise.resolve(selectedItem.onSelected?.()).catch((error) => {\n console.error('Navbar menu item selection failed:', error)\n })\n\n renderNavbar()\n }\n\n function renderNavbar () {\n render(\n html`<solid-panes-navbar .navbarItems=${menuItems} @solid-ui-select=${handleSelectionChanged}></solid-panes-navbar>`,\n tmpContainer\n )\n }\n\n renderNavbar()\n\n const navbar = tmpContainer.firstElementChild as HTMLElement | null\n\n if (!navbar) {\n throw new Error('Failed to create nav bar')\n }\n\n if (mainContent) {\n mainContent.insertBefore(navbar, mainContent.firstChild)\n } else {\n document.body.prepend(navbar)\n }\n\n return navbar\n}\n"],"mappings":";;;;;;;;;AAcA,SAASA,IAAc;CACrB,IAAMC,IAAS,SAAS,cAA2B,oBAAoB;CACvE,AAAIA,KACFA,EAAO,UAAU,OAAO,gBAAgB;AAE5C;AAEA,SAASC,EACP,GACA,GACA,IAAW,IACK;CAChB,OAAO;EACL;EACA,aAAc;GAEZ,OADAF,EAAW,GACJG,EAAW;EACpB;EACA;CACF;AACF;AAEA,eAAeC,EACb,GACA,GACA,GACA,GACA,GAC2B;CAC3B,IAAMC,IAAQ,MAAMC,EAAmBC,CAAO,GACxCC,IAAeC,MAAqBC,EAAWH,CAAO,IAAI,YAAY,KAAA,IAEtEI,IAA8B,CAAC;CAErC,AAAIN,KACFM,EAAU,KACRT,EAAc,WAAW,YAAY;EACnC,IAAMU,IAAc,MAAMC,EAAsBR,CAAK;EACrD,EAAS,YAAYE,GAAS,IAAMK,GAAa,IAAM,KAAA,GAAWE,CAAW;CAC/E,GAAGN,MAAiB,SAAS,GAC7BN,EAAc,WAAW,YAAY;EACnC,IAAMa,IAAa,MAAMC,EAAqBX,CAAK;EACnD,EAAS,YAAYE,GAAS,IAAMQ,GAAY,IAAM,KAAA,GAAWD,CAAW;CAC9E,GAAGN,MAAiB,QAAQ,CAC9B;CAGF,IAAMS,IAAe,MAAMC,EAAsBX,CAAO;CAcxD,OAbAU,EAAa,SAAQ,MAAQ;EAC3B,EAAU,KACRf,EACEiB,EAAK,MAAM,GACX,YAAY;GACV,EAAS,YAAYZ,GAAS,IAAMY,GAAM,IAAM,KAAA,GAAWL,CAAW;EACxE,GACAN,MAAiBW,EAAK,aACnBC,IAAkBA,MAAoBD,EAAK,QAAQ,QAAQF,EAAa,WAAW,EACxF,CACF;CACF,CAAC,GAEMN;AACT;AAEA,eAAsBU,EAAc,GAA0B;CAC5D,IAAMC,IAAiB,SAAS,cAA2B,oBAAoB;CAE/E,IAAIA,GAEF,OADAA,EAAe,UAAU,OAAO,gBAAgB,GACzCA;CAGT,IAAMC,IAAc,SAAS,eAAe,aAAa,GACnDC,IAAc,SAAS,eAAe,aAAa,GACnDC,IAAe,SAAS,cAAc,KAAK,GAC3CC,IAAM,OAAO,SAAS,MACtBnB,IAAqB,OAAOmB,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA,GAChEjB,IAAmB,OAAO,QAAQ,OAAO,UACzCW,IAAkB,OAAO,QAAQ,OAAO,SAC1CT,IAAY,MAAMP,EAAsBwB,GAAUrB,GAASgB,GAAad,GAAkBW,CAAe,CAAC,CAAC,OAAO,OACpH,QAAQ,MAAM,sCAAsCS,CAAG,GAChD,CAAC,EACT;CAED,SAASC,EAAiB,GAA8B;EACtD,IAAYnB,EAAU,KAAK,OAAc;GACvC,GAAGoB;GACH,UAAUA,MAAaC;EACzB,EAAE;CACJ;CAEA,SAASC,EAAwB,GAAc;EAC7C,IAAM,EAAE,QAAQD,MAAiBE;EAOjC,AANAJ,EAAgBE,CAAY,GAE5B,QAAQ,QAAQA,EAAa,aAAa,CAAC,CAAC,CAAC,OAAO,MAAU;GAC5D,QAAQ,MAAM,sCAAsCG,CAAK;EAC3D,CAAC,GAEDC,EAAa;CACf;CAEA,SAASA,IAAgB;EACvB,EACE,CAAI,oCAAoCzB,EAAU,oBAAoBsB,EAAuB,yBAC7FR,CACF;CACF;CAEA,EAAa;CAEb,IAAMxB,IAASwB,EAAa;CAE5B,IAAI,CAACxB,GACH,MAAU,MAAM,0BAA0B;CAS5C,OANIuB,IACFA,EAAY,aAAavB,GAAQuB,EAAY,UAAU,IAEvD,SAAS,KAAK,QAAQvB,CAAM,GAGvBA;AACT"}
|
package/dist/n3Pane.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n3Pane.d.ts","sourceRoot":"","sources":["../src/n3Pane.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"n3Pane.d.ts","sourceRoot":"","sources":["../src/n3Pane.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAA;AAClD,OAAO,cAAc,CAAA;AACrB,OAAO,0BAA0B,CAAA;AAIjC,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,IAAI,CAAA;IACzE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,UAsDpB,CAAA"}
|
package/dist/n3Pane2.cjs.js
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border
|
|
2
|
-
`).forEach(e=>{let t=r.createElement(`div`),n=i(e);t.classList.add(`n3-pane__line`),t.style.setProperty(`--n3-indent`,`${n}ch`),t.textContent=e.length>0?e:` `,d.appendChild(t)}),s.appendChild(d),s}};exports.n3Pane=a;
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border:1px solid var(--solid-ui-color-slate-200,#e2e8f0);box-sizing:border-box;width:100%;min-width:0}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");require("./components/editor-card/index.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("rdflib");n=e.__toESM(n);var r=t.ns,i={icon:t.icons.originalIconBase+`w3c/n3_smaller.png`,name:`n3`,audience:[r.solid(`Developer`)],label:function(e,t){let n=t.session.store;if(`http://www.w3.org/2007/ont/link#ProtocolEvent`in n.findTypeURIs(e))return null;let r=n.statementsMatching(void 0,void 0,void 0,e).length;return r===0?null:`Data (`+r+`) as N3`},render:function(e,t){let r=t.dom,i=t.session.store,a=r.createElement(`div`);a.setAttribute(`class`,`n3-pane`);let o=i.statementsMatching(void 0,void 0,void 0,e),s=n.Serializer(i);s.suggestNamespaces(i.namespaces),s.setBase(e.uri);let c=s.statementsToN3(o),l=r.createElement(`solid-panes-editor-card`);return l.contentType=`text/n3`,l.content=c,a.appendChild(l),a}};exports.n3Pane=i;
|
|
3
2
|
//# sourceMappingURL=n3Pane2.cjs.js.map
|
package/dist/n3Pane2.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n3Pane2.cjs.js","names":[],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext
|
|
1
|
+
{"version":3,"file":"n3Pane2.cjs.js","names":["UI","$rdf","require_runtime","solid_ui","rdflib","ns","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":"mNAaA,IAAMK,EAAKL,EAAG,GAUDM,EAAqB,CAChC,KAAMN,EAAG,MAAM,iBAAmB,qBAElC,KAAM,KAEN,SAAU,CAACK,EAAG,MAAM,WAAW,CAAC,EAEhC,MAAO,SAAU,EAAoB,EAA4C,CAC/E,IAAME,EAAQC,EAAQ,QAAQ,MAC9B,GACE,kDACAD,EAAM,aAAaE,CAAO,EAE1B,OAAO,KAET,IAAMC,EAAIH,EAAM,mBAAmB,IAAA,GAAW,IAAA,GAAW,IAAA,GAAWE,CAAO,CAAC,CACzE,OAEH,OADIC,IAAM,EAAU,KACb,SAAWA,EAAI,SACxB,EAEA,OAAQ,SACN,EACA,EACgB,CAChB,IAAMC,EAAaH,EAAQ,IACrBI,EAAKJ,EAAQ,QAAQ,MAErBK,EAAMF,EAAW,cAAc,KAAK,EAC1CE,EAAI,aAAa,QAAS,SAAS,EAInC,IAAMC,EAAaF,EAAG,mBACpB,IAAA,GACA,IAAA,GACA,IAAA,GACAH,CACF,EAEMM,EAAKd,EAAK,WAAWW,CAAE,EAC7BG,EAAG,kBAAkBH,EAAG,UAAU,EAClCG,EAAG,QAAQN,EAAQ,GAAG,EACtB,IAAMO,EAAoBD,EAAG,eAAeD,CAAU,EAChDG,EAASN,EAAW,cAAc,yBAAyB,EAQjE,MAJA,GAAO,YAAc,UACrB,EAAO,QAAUK,EAEjBH,EAAI,YAAYI,CAAM,EACfJ,CACT,CACF"}
|
package/dist/n3Pane2.esm.js
CHANGED
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.n3-pane{border:1px solid var(--solid-ui-color-slate-200,#e2e8f0);box-sizing:border-box;width:100%;min-width:0}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
+
import "./components/editor-card/index.esm.js";
|
|
2
3
|
import * as e from "solid-ui";
|
|
3
4
|
import * as t from "rdflib";
|
|
4
5
|
//#region src/n3Pane.ts
|
|
5
|
-
var n = e.ns
|
|
6
|
-
function r(e) {
|
|
7
|
-
if (e.trim().length === 0) return 0;
|
|
8
|
-
let t = 0;
|
|
9
|
-
for (let n of e) {
|
|
10
|
-
if (n === " ") {
|
|
11
|
-
t += 1;
|
|
12
|
-
continue;
|
|
13
|
-
}
|
|
14
|
-
if (n === " ") {
|
|
15
|
-
t += 2;
|
|
16
|
-
continue;
|
|
17
|
-
}
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
return Math.max(t, 2);
|
|
21
|
-
}
|
|
22
|
-
var i = {
|
|
6
|
+
var n = e.ns, r = {
|
|
23
7
|
icon: e.icons.originalIconBase + "w3c/n3_smaller.png",
|
|
24
8
|
name: "n3",
|
|
25
9
|
audience: [n.solid("Developer")],
|
|
@@ -30,23 +14,15 @@ var i = {
|
|
|
30
14
|
return r === 0 ? null : "Data (" + r + ") as N3";
|
|
31
15
|
},
|
|
32
16
|
render: function(e, n) {
|
|
33
|
-
let
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
s.setAttribute("class", "n3-pane"), o(s);
|
|
40
|
-
let c = a.statementsMatching(void 0, void 0, void 0, e), l = t.Serializer(a);
|
|
41
|
-
l.suggestNamespaces(a.namespaces), l.setBase(e.uri);
|
|
42
|
-
let u = l.statementsToN3(c), d = i.createElement("div");
|
|
43
|
-
return d.classList.add("n3-pane__source"), u.split("\n").forEach((e) => {
|
|
44
|
-
let t = i.createElement("div"), n = r(e);
|
|
45
|
-
t.classList.add("n3-pane__line"), t.style.setProperty("--n3-indent", `${n}ch`), t.textContent = e.length > 0 ? e : " ", d.appendChild(t);
|
|
46
|
-
}), s.appendChild(d), s;
|
|
17
|
+
let r = n.dom, i = n.session.store, a = r.createElement("div");
|
|
18
|
+
a.setAttribute("class", "n3-pane");
|
|
19
|
+
let o = i.statementsMatching(void 0, void 0, void 0, e), s = t.Serializer(i);
|
|
20
|
+
s.suggestNamespaces(i.namespaces), s.setBase(e.uri);
|
|
21
|
+
let c = s.statementsToN3(o), l = r.createElement("solid-panes-editor-card");
|
|
22
|
+
return l.contentType = "text/n3", l.content = c, a.appendChild(l), a;
|
|
47
23
|
}
|
|
48
24
|
};
|
|
49
25
|
//#endregion
|
|
50
|
-
export {
|
|
26
|
+
export { r as n3Pane };
|
|
51
27
|
|
|
52
28
|
//# sourceMappingURL=n3Pane2.esm.js.map
|
package/dist/n3Pane2.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"n3Pane2.esm.js","names":[],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext
|
|
1
|
+
{"version":3,"file":"n3Pane2.esm.js","names":["ns","UI","$rdf","ns$1","n3Pane","store","context","subject","n","myDocument","kb","div","statements","sz","serializedContent","source"],"sources":["../src/n3Pane.ts"],"sourcesContent":["/* Notation3 content Pane\n **\n ** This pane shows the content of a particular RDF resource\n ** or at least the RDF semantics we attribute to that resource,\n ** in generated N3 syntax.\n */\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode, Statement } from 'rdflib'\nimport './n3Pane.css'\nimport './components/editor-card'\n\nconst ns = UI.ns\n\ntype N3PaneLike = {\n icon: string\n name: string\n audience: NamedNode[]\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nexport const n3Pane: N3PaneLike = {\n icon: UI.icons.originalIconBase + 'w3c/n3_smaller.png',\n\n name: 'n3',\n\n audience: [ns.solid('Developer')],\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store\n if (\n 'http://www.w3.org/2007/ont/link#ProtocolEvent' in\n store.findTypeURIs(subject)\n ) {\n return null\n }\n const n = store.statementsMatching(undefined, undefined, undefined, subject)\n .length\n if (n === 0) return null\n return 'Data (' + n + ') as N3'\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const kb = context.session.store\n\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'n3-pane')\n // Because of smushing etc, this will not be a copy of the original source\n // We could instead either fetch and re-parse the source,\n // or we could keep all the pre-smushed triples.\n const statements = kb.statementsMatching(\n undefined,\n undefined,\n undefined,\n subject\n ) as Statement[] // @@ slow with current store!\n\n const sz = $rdf.Serializer(kb)\n sz.suggestNamespaces(kb.namespaces)\n sz.setBase(subject.uri)\n const serializedContent = sz.statementsToN3(statements)\n const source = myDocument.createElement('solid-panes-editor-card') as HTMLElement & {\n contentType?: string\n content?: string\n }\n source.contentType = 'text/n3'\n source.content = serializedContent\n\n div.appendChild(source)\n return div\n }\n}\n"],"mappings":";;;;;AAaA,IAAMA,IAAKC,EAAG,IAUDG,IAAqB;CAChC,MAAMH,EAAG,MAAM,mBAAmB;CAElC,MAAM;CAEN,UAAU,CAACD,EAAG,MAAM,WAAW,CAAC;CAEhC,OAAO,SAAU,GAAoB,GAA4C;EAC/E,IAAMK,IAAQC,EAAQ,QAAQ;EAC9B,IACE,mDACAD,EAAM,aAAaE,CAAO,GAE1B,OAAO;EAET,IAAMC,IAAIH,EAAM,mBAAmB,KAAA,GAAW,KAAA,GAAW,KAAA,GAAWE,CAAO,CAAC,CACzE;EAEH,OADIC,MAAM,IAAU,OACb,WAAWA,IAAI;CACxB;CAEA,QAAQ,SACN,GACA,GACgB;EAChB,IAAMC,IAAaH,EAAQ,KACrBI,IAAKJ,EAAQ,QAAQ,OAErBK,IAAMF,EAAW,cAAc,KAAK;EAC1C,EAAI,aAAa,SAAS,SAAS;EAInC,IAAMG,IAAaF,EAAG,mBACpB,KAAA,GACA,KAAA,GACA,KAAA,GACAH,CACF,GAEMM,IAAKX,EAAK,WAAWQ,CAAE;EAE7B,AADAG,EAAG,kBAAkBH,EAAG,UAAU,GAClCG,EAAG,QAAQN,EAAQ,GAAG;EACtB,IAAMO,IAAoBD,EAAG,eAAeD,CAAU,GAChDG,IAASN,EAAW,cAAc,yBAAyB;EAQjE,OAJA,EAAO,cAAc,WACrB,EAAO,UAAUK,GAEjBH,EAAI,YAAYI,CAAM,GACfJ;CACT;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.cjs.js","names":[],"sources":["../../src/outline/context.ts"],"sourcesContent":["import { DataBrowserContext, PaneRegistry, RenderEnvironment } from 'pane-registry'\nimport { getOutliner } from '../index'\nimport { SolidLogic } from 'solid-logic'\nimport { LiveStore } from 'rdflib'\n\nexport function createContext (\n dom: HTMLDocument,\n paneRegistry: PaneRegistry,\n store: LiveStore,\n logic: SolidLogic,\n environment?: RenderEnvironment\n): DataBrowserContext {\n return {\n dom,\n getOutliner,\n session: {\n paneRegistry,\n // @ts-ignore\n store,\n // @ts-ignore\n logic\n },\n environment\n }\n}\n"],"mappings":"mCAKA,
|
|
1
|
+
{"version":3,"file":"context.cjs.js","names":["require_index","createContext"],"sources":["../../src/outline/context.ts"],"sourcesContent":["import { DataBrowserContext, PaneRegistry, RenderEnvironment } from 'pane-registry'\nimport { getOutliner } from '../index'\nimport { SolidLogic } from 'solid-logic'\nimport { LiveStore } from 'rdflib'\n\nexport function createContext (\n dom: HTMLDocument,\n paneRegistry: PaneRegistry,\n store: LiveStore,\n logic: SolidLogic,\n environment?: RenderEnvironment\n): DataBrowserContext {\n return {\n dom,\n getOutliner,\n session: {\n paneRegistry,\n // @ts-ignore\n store,\n // @ts-ignore\n logic\n },\n environment\n }\n}\n"],"mappings":"mCAKA,SAAgBC,EACd,EACA,EACA,EACA,EACA,EACoB,CACpB,MAAO,CACL,MACA,YAAAD,EAAA,YACA,QAAS,CACP,eAEA,QAEA,OACF,EACA,aACF,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.esm.js","names":[],"sources":["../../src/outline/context.ts"],"sourcesContent":["import { DataBrowserContext, PaneRegistry, RenderEnvironment } from 'pane-registry'\nimport { getOutliner } from '../index'\nimport { SolidLogic } from 'solid-logic'\nimport { LiveStore } from 'rdflib'\n\nexport function createContext (\n dom: HTMLDocument,\n paneRegistry: PaneRegistry,\n store: LiveStore,\n logic: SolidLogic,\n environment?: RenderEnvironment\n): DataBrowserContext {\n return {\n dom,\n getOutliner,\n session: {\n paneRegistry,\n // @ts-ignore\n store,\n // @ts-ignore\n logic\n },\n environment\n }\n}\n"],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"context.esm.js","names":["createContext"],"sources":["../../src/outline/context.ts"],"sourcesContent":["import { DataBrowserContext, PaneRegistry, RenderEnvironment } from 'pane-registry'\nimport { getOutliner } from '../index'\nimport { SolidLogic } from 'solid-logic'\nimport { LiveStore } from 'rdflib'\n\nexport function createContext (\n dom: HTMLDocument,\n paneRegistry: PaneRegistry,\n store: LiveStore,\n logic: SolidLogic,\n environment?: RenderEnvironment\n): DataBrowserContext {\n return {\n dom,\n getOutliner,\n session: {\n paneRegistry,\n // @ts-ignore\n store,\n // @ts-ignore\n logic\n },\n environment\n }\n}\n"],"mappings":";;AAKA,SAAgBA,EACd,GACA,GACA,GACA,GACA,GACoB;CACpB,OAAO;EACL;EACA;EACA,SAAS;GACP;GAEA;GAEA;EACF;EACA;CACF;AACF"}
|
|
@@ -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}.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{width:100%;min-width:0;display:block}.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}`)),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");require("../components/file-explorer-header/FileExplorerProvider.cjs.js");let s=require("solid-ui");s=e.__toESM(s);let c=require("solid-logic"),l=require("pane-registry");l=e.__toESM(l);let u=require("rdflib");u=e.__toESM(u);function d(e){let d=e.dom;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let f=this,p=this,m=[];this.selection=m,this.ancestor=s.utils.ancestor,this.sparql=u.UpdateManager,this.kb=c.store;let h=c.store,g=c.store.fetcher;d.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let _=this.outlineElement;this.init=function(){let e=b();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`},v.lastkbsize=0;function v(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 s.log.info(`BENCHMARK: kb delta: `+(h.statements.length-v.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),v.lastkbsize=h.statements.length,r}function y(e,t,r){let i=s.utils.AJARImage(n.outlineIcons.src.icon_remove_node,`remove`,void 0,d);return i.addEventListener(`click`,K),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],p.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=u.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=g.getState(r),a,o,c;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,c=G;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,c=U;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,c=W,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,c=U;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,c=U,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,c=U,o=`cannot fetch`;break;default:s.log.error(`?? state = `+i)}let l=s.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),d);return l.classList.add(`objectValueAccessIcon`),l.setAttribute(`uri`,t),l.addEventListener(`click`,c),P(l,r),e.appendChild(l),l},this.outlineObjectTD=function(e,t,n,r){let i=d.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(s.utils.AJARImage(s.icons.originalIconBase+`tbl-expand-trans.png`,`expand`,void 0,d)).addEventListener(`click`,V)),i.setAttribute(`class`,`obj`),h.whether(e,s.ns.rdf(`type`),s.ns.link(`Request`))&&(i.className=`undetermined`),t||=ne,i.appendChild(t(e)),n&&y(i,e,n),i.tabulatorSelect=function(){z(this,!0)},i.tabulatorDeselect=function(){z(this,!1)},i.addEventListener(`click`,q),i):(i.textContent=`No object available.`,i)},this.outlinePredicateTD=function(e,t,r,i){let a=d.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=s.utils.predicateLabelForXML(e,r);break;case`Collection`:o=s.utils.predicateLabelForXML(e.elements[0],r)}o=o?o.slice(0,1).toUpperCase()+o.slice(1):`...`;let c=d.createElement(`TD`);c.classList.add(`labelTD`),c.setAttribute(`notSelectable`,`true`),c.appendChild(d.createTextNode(o)),a.appendChild(c),c.style.width=`100%`,a.appendChild(N.construct(d));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)&&N.addIcon(a,n.outlineIcons.termWidgets[e])}return a.tabulatorSelect=function(){z(this,!0)},a.tabulatorDeselect=function(){z(this,!1)},a.addEventListener(`click`,q),a};function b(){return C(`OutlineView`,`Resource browser`)}function x(){return document.querySelector(`solid-panes-navbar`)}function S(){let e=x();e&&e.classList.remove(`navbar--hidden`)}function C(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 w(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 s.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 T(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function E(e){let t=d.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function D(t,n,r,i){if(!t||!r)return;let a;try{s.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=d.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=d.createElement(`pre`);a.appendChild(t),t.appendChild(d.createTextNode(s.utils.stackString(e)))}a.classList.add(`paneDiv`);let o=t.querySelector(`.paneDiv`);o?o.replaceWith(a):t.appendChild(a)}function O(e,t){let n=d.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`);if(a){if(!t){s.log.warn(`outline: Unable to open pane in place: pane is undefined.`);return}E(!!t.requireQueryButton),a.openSelectedPane?.(t),D(a,e,t,a.paneRenderOptions)}}async function ee(t,n,r){r||={};let i=d.createElement(`tr`);r.hover&&i.classList.add(`hoverControl`);let o=i.appendChild(d.createElement(`td`));o.classList.add(`paneView`,`tdFlex`),o.setAttribute(`notSelectable`,`true`),o.setAttribute(`about`,t.toNT()),o.setAttribute(`colspan`,`2`);let s=o.appendChild(d.createElement(`file-explorer-provider`));s.context=e,s.subjectUri=t.uri,s.onBack=()=>H({target:s});let c=r.hideList?[]:await w(t,e);return s.relevantPanes=c,s.pane=n||T(c,t),s.showHeader=!(t&&t.uri&&t.site&&t.site().uri===t.uri)&&!a.isWebIdUri(t),s.paneRenderOptions=r,s.soloPane=r.solo,s.openPane=(e,t)=>O(e,l.byName(t)),s.handleSharingClick=()=>O(t,l.byName(`sharing`)),s.pane&&(i.classList.add(`outlinePaneRow`),D(s,t,s.pane,r)),i}function k(e){let t=e.parentNode,n=t.parentNode,r=d.createElement(`table`);r.classList.add(`placeholderTable`),n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let A=this.propertyTable=function(e,t,n,r){return s.log.debug(`Property table for: `+e),e=h.canon(e),t?(s.log.info(`Re-expand: `+t),t):(t=d.createElement(`table`),t.classList.add(`tableFullWidth`),ee(e,n,r).then(e=>{t.appendChild(e)}),t)};function j(e,t,n){let r=e.createElement(`TR`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`);let i=p.outlinePredicateTD(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=j;function M(e,t,n,r){if(s.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(s.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(s.utils.RDFComparePredicateObject));let c=t.length;for(a=0;a<c;a++){let l=t[a];if(r&&!r(l.predicate,n))continue;let u=j(d,l,n);e.appendChild(u);let m=u.firstChild,g=$.defaults[l.predicate.uri],_=0,v=0,y=0;for(o=0;o+a<c&&t[a+o].predicate.sameTerm(l.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&_++,i(t[a+o]).lang&&f.labeller.LanguagePreference&&(v+=1,i(t[a+o]).lang.indexOf(f.labeller.LanguagePreference)>=0&&y++);if(y>0&&v===_+1){for(let e=a;e<=a+_;e++)if(f.labeller.LanguagePreference&&i(t[e]).lang.indexOf(f.labeller.LanguagePreference)>=0){u.appendChild(p.outlineObjectTD(i(t[e]),g,void 0,l));break}a+=_;continue}u.appendChild(p.outlineObjectTD(i(l),g,void 0,l)),u.showNobj=function(r){let c=o-_,u=2*r<c?r:c,f=[];if(c!==1){m.setAttribute(`rowspan`,u===c?c:r+1);let _;u<c&&u===1&&m.setAttribute(`rowspan`,2);let v=0;for(_=1;_<o;_++)if(h.canon(i(t[a+_])).sameTerm(h.canon(i(t[a+_-1]))))s.log.info(`there are duplicates here: %s`,t[a+_-1]);else{v++,l=t[a+_],g=$.defaults[l.predicate.uri];let r=d.createElement(`tr`);r.style.colspan=`1`,r.appendChild(p.outlineObjectTD(i(t[a+_]),g,void 0,l)),r.AJAR_statement=l,r.AJAR_inverse=n,e.appendChild(r),v>=u&&(r.style.display=`none`,f.push(r))}u===c&&m.setAttribute(`rowspan`,v+1)}if(u<c){let t=d.createElement(`tr`),n=t.appendChild(d.createElement(`td`));if(n.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),n.setAttribute(`notSelectable`,`false`),c>r){let e=d.createElement(`a`);n.appendChild(e);let t=(function(e){return e(m,o,_,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,d)),e.appendChild(d.createTextNode(c-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,d)),t.setAttribute(`rowspan`,c+1));for(let e=0;e<f.length;e++){let t=f[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)}},u.showAllobj=function(){u.showNobj(o-_)},u.showNobj(10),a+=o-1}}this.appendPropertyTRs=M;let N={};globalThis.termWidget=N,N.construct=function(e){e||=document;let t=e.createElement(`TD`);return t.setAttribute(`style`,`margin: 0.2em; border: none; padding: 0; vertical-align: top;`),t.setAttribute(`class`,`iconTD`),t.setAttribute(`notSelectable`,`true`),t.style.width=`0px`,t},N.addIcon=function(e,t,n){let r=e.childNodes[1];if(!r)return;let i=r.style.width,a=s.utils.AJARImage(t.src,t.alt,t.tooltip,d);i=parseInt(i),i+=t.width,r.style.width=i+`px`,r.appendChild(a),n&&a.addEventListener(`click`,n)},N.removeIcon=function(e,t){let n=e.childNodes[1],r;if(!n)return;let i=n.style.width;i=parseInt(i),i-=t.width,n.style.width=i+`px`;for(let e=0;e<n.childNodes.length;e++){let i=n.childNodes[e],a=i.src;try{r=d.location.href.split(`?`)[0]}catch{r=``}a===u.uri.join(t.src,r)&&n.removeChild(i)}},N.replaceIcon=function(e,t,n,r){N.removeIcon(e,t),N.addIcon(e,n,r)};function P(e,t){s.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!f.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};g.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),g.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),g.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function F(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function I(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,L),t.parentNode.parentNode.removeAttribute(`optional`)}function L(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,I),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function R(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&&N.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?I:L),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),N.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=s.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&d.getElementById(`UserURI`)&&(d.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<m.length;e++){if(!m[e].parentNode)continue;let t=m[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return m};function z(e,t){if(e.nodeName!==`TD`)throw s.log.debug(`down`+e.nodeName),Error(`Expected TD in setSelected: `+e.nodeName+` : `+e.textContent);s.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,1),m.push(e);let t=s.utils.getTerm(e);p.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;c.store.updater.editable(t.uri,h)&&r.indexOf(`pred`)>=0&&N.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else s.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,-1),r.indexOf(`pred`)>=0&&N.removeIcon(e,n.outlineIcons.termWidgets.addTri),m=m.filter(function(t){return t===e}),s.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&p.showSource(),e.setAttribute(`class`,r)}function B(){let e=m.length;for(let t=e-1;t>=0;t--)z(m[t],!1);m=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return s.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||m[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}B(),z(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}B(),z(r,!0);break;case`right`:if(B(),n.nextSibling||n.lastChild.tagName===`strong`)z(n.nextSibling,!0);else{let e=d.evaluate(`table/div/tr/td[2]`,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;z(e,!0)}break;case`left`:if(B(),n.previousSibling&&n.previousSibling.className===`undetermined`)return z(n.previousSibling,!0),!0;z(s.utils.ancestor(n.parentNode,`TD`),!0);break;case`moveTo`:B(),z(t,!0)}(e===`down`||e===`up`)&&(r.tabulatorSelect||this.walk(e))},this.OutlinerKeypressPanel=function(e){s.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]?!0:(o(`right`,a),t(s.utils.getAbout(h,m[0])),!0)}let r,i;if(s.utils.getTarget(e).tagName===`TEXTAREA`||s.utils.getTarget(e).id===`UserURI`||m.length>1)return;if(m.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,p.focusTd),t(s.utils.getAbout(h,m[0])));return}let a=m[0];switch(g.removeCallback(`done`,`setSelectedAfterward`),g.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(s.utils.getTarget(e).tagName===`HTML`){let e=s.utils.getAbout(h,a);r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),e?f.GotoSubject(e,!0):i&&p.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(s.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=s.utils.ancestor(a.parentNode,`TD`);Z(a,s.utils.getAbout(h,e));break}case 39:{let e=s.utils.getAbout(h,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstChild.tagName!==`TABLE`&&(g.addCallback(`done`,n),g.addCallback(`fail`,n),X(a,e,{pane:l.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){p.UserInput.copyToClipboard(p.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){p.UserInput.pasteFromClipboard(p.clipboardAddress,a);break}break;default:s.utils.getTarget(e).tagName}}t(s.utils.getAbout(h,m[0]))},this.OutlinerMouseclickPanel=function(e){switch(p.UserInput._tabulatorMode){case 0:J(e);break;case 1:p.UserInput.Click(e)}};function V(e){let t=p.targetOf(e),n=t.parentNode,r=s.utils.getAbout(h,t),i=e.altKey?l.byName(`internal`):void 0;e.shiftKey?Q(n,r,i):e.altKey?X(n,r,{pane:l.byName(`internal`),immediate:!0}):X(n,r)}function H(e){let t=p.targetOf(e),n=s.utils.getAbout(h,t),r=e.altKey?l.byName(`internal`):void 0,i=t.parentNode.parentNode;Z(i,n,r)}function U(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function W(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function G(e){let t=p.targetOf(e).getAttribute(`uri`);g.fetch(u.uri.docpart(t))}function K(e){let t=p.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),k(n)}function q(e){if(p.UserInput._tabulatorMode)return p.UserInput.Click(e);let t=p.targetOf(e),n;for(n=s.utils.ancestor(t,`TD`);n&&n.getAttribute(`notSelectable`)!==`false`;n=s.utils.ancestor(n.parentNode,`TD`));if(!n)return;let r=F(n);if(s.log.debug(`Was node selected before: `+r),e.altKey)z(n,!F(n));else if(e.shiftKey)z(n,!0);else{if(B(),p.UserInput.clearInputAndSave(e),z(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=c.store.updater.editable(i.uri,h);r&&a&&p.UserInput.Click(e,m[0])}s.log.debug(`Was node selected after: `+F(n)+`, count=`+m.length),e.stopPropagation()}function J(e){s.log.info(`@TabulatorMousedown, dom.location is now `+d.location);let t=p.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(p.UserInput.clearMenu(),p.UserInput.lastModified&&p.UserInput.lastModified.parentNode.nextSibling&&p.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)&&p.UserInput.clearInputAndSave(e),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices)&&p.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){d.title=s.utils.label(e),d.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;s.log.info(`@outlineExpand, dom is now `+d.location),g.removeCallback(`done`,`expand`),g.removeCallback(`fail`,`expand`);let o=h.canon(t);function c(){if(o=h.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;if(s.log.info(`@@ REPAINTING `),!i)t=A(o,void 0,r,n);else{for(s.log.info(` ... p is `+e),t=e.firstChild;t.nextSibling&&(s.log.info(` ... checking node `+t),t.nodeName!==`table`);t=t.nextSibling);t=A(o,t,r,n)}i=!0,s.utils.ancestor(e,`TABLE`)&&s.utils.ancestor(e,`TABLE`).style.backgroundColor===`white`?t.style.backgroundColor=`#eee`:t.style.backgroundColor=`white`,s.utils.emptyNode(e).appendChild(t),p.focusTd=e,s.log.debug(`expand: Node for `+o+` expanded`);let a=h.each(o,s.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&s.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),g.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=h.canon(o);s.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=h.sym(u.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=h.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=u.uri.docpart(r[t]);n;n=h.HTTPRedirects[n])if(e===n)return!0;return!!h.anyStatementMatching(t,void 0,void 0,n)}()||(s.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}n.solo&&Y(o),s.log.debug(`outlineExpand: dereferencing `+o);let f=d.createElement(`span`);e.appendChild(f),g.addCallback(`done`,l),g.addCallback(`fail`,l);let m=[];if(o.uri&&o.uri.split(`:`)[0]===`rdf`){c();return}for(let e=0;e<m.length;e++){let t;if(t===m[e](o)){c(),s.log.debug(`outline 1815`),t[1]&&_.removeChild(_.lastChild);return}}if(o.uri&&!a&&!s.widgets.isAudio(o)&&!s.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),c=o?r(o):n,l=s.widgets.errorMessageBlock(d,c,`#fee`,a instanceof Error?a:void 0);t&&l.setAttribute(`data-outline-error-for`,t),e.appendChild(l)},l=!1,u=g.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(g.lookUpThing(o),c(),n.solo&&Y(o)):(l=!0,a(t,void 0))});u&&typeof u.catch==`function`&&u.catch(function(e){l||(l=!0,a(e,e))})}else c()}function Z(e,t){let n=s.utils.ancestor(e,`TR`);n=s.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}s.log.debug(`Collapsing subject `+t);let a;r&&(s.log.debug(`looking up pred `+r.predicate.uri+`in defaults`),a=$.defaults[r.predicate.uri]),s.log.debug(`view= `+a);let o;i.parentNode.parentNode.id===`outline`&&(o=i.parentNode),p.replaceTD(p.outlineObjectTD(t,a,o,r),i)}this.replaceTD=function(e,t){let n;F(t)&&(n=!0);for(let e=m.length-1;e>-1;e--)for(let n=m[e];n.parentNode;n=n.parentNode)n===t&&z(m[e],!1);t.parentNode.replaceChild(e,t),n&&z(e,!0)};function Q(e,t){let n=null;for(let t=e.parentNode;t;t=t.parentNode)s.log.debug(`level `+t.tagName),t.tagName===`TD`&&(n=t);s.utils.emptyNode(n).appendChild(A(t)),Y(t),n.setAttribute(`about`,t.toNT())}f.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&f.GotoFormURI(e)},this.GotoFormURI=function(e){te(d.getElementById(`UserURI`).value)};function te(e){let t=h.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=h.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o=!0){let c=b();o&&(!a||a===c)&&S(),a||=c,r&&(s.utils.emptyNode(a),a.style.width=`100%`);function l(){let t=d.createElement(`tr`);t.classList.add(`outlineRow1`),t.style.verticalAlign=`top`,a.appendChild(t);let n=p.outlineObjectTD(e,void 0,t);return t.appendChild(n),n}let u=l();if(r&&Y(e),t&&X(u,e,{pane:n,solo:r}),r&&d&&d.defaultView&&d.defaultView.history){let t=d.defaultView.history.state||{},r=n?{paneName:n.name}:{};n&&n.subject&&typeof n.subject.uri==`string`&&(r.paneUri=n.subject.uri);let i={...t,...r};try{let n=new URL(document.location.href),r=new URL(e.uri,document.location.href);n.origin===r.origin&&(document.location.href===e.uri?JSON.stringify(t)!==JSON.stringify(i)&&d.defaultView.history.replaceState(i,e.uri,e.uri):d.defaultView.history.pushState(i,e.uri,e.uri))}catch{}}return e};let $=t.propertyViews(d);function ne(t){let r;if(t.termType===`Literal`){if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=s.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=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),p.appendAccessIcons(h,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=d.createElement(`a`);r.appendChild(d.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(s.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,d)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(d.createTextNode(s.utils.label(t)));let e=s.widgets.linkIcon(d,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),s.widgets.makeDraggable(r,t)}}else r.appendChild(d.createTextNode(s.utils.label(t)))}else if(t.termType===`Collection`){r=d.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(d.createElement(`tr`)),a=i.appendChild(d.createElement(`td`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(p.outlineObjectTD(n))}}else t.termType===`Graph`?(r=l.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(s.log.error(`Object `+t+` has unknown term type: `+t.termType),r=d.createTextNode(`[unknownTermType:`+t.termType+`]`));return s.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){d.getElementById(`UserURI`).value=d.URL+`?uri=`+d.getElementById(`UserURI`).value},this.UserInput.setSelected=z,this.UserInput.deselectAll=B,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=d;
|
|
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");require("../components/file-explorer-header/index.cjs.js");let s=require("solid-ui");s=e.__toESM(s);let c=require("solid-logic"),l=require("pane-registry");l=e.__toESM(l);let u=require("rdflib");u=e.__toESM(u);function d(e){let d=e.dom;this.document=e.dom,this.context=e,this.outlineIcons=n.outlineIcons,this.labeller=this.labeller||{},this.labeller.LanguagePreference=``;let f=this,p=this,m=[];this.selection=m,this.ancestor=s.utils.ancestor,this.sparql=u.UpdateManager,this.kb=c.store;let h=c.store,g=c.store.fetcher;d.outline=this,this.qs=new i.QuerySource,this.UserInput=new r.UserInput(this),this.clipboardAddress=`tabulator:clipboard`,this.UserInput.clipboardInit(this.clipboardAddress);let _=this.outlineElement;this.init=function(){let e=b();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`},v.lastkbsize=0;function v(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 s.log.info(`BENCHMARK: kb delta: `+(h.statements.length-v.lastkbsize)+`, time elapsed for `+e+` was `+(i-n)+`ms`),v.lastkbsize=h.statements.length,r}function y(e,t,r){let i=s.utils.AJARImage(n.outlineIcons.src.icon_remove_node,`remove`,void 0,d);return i.addEventListener(`click`,K),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],p.appendAccessIcon(t,i))},this.appendAccessIcon=function(e,t){if(!t)return``;let r=u.uri.docpart(t);if(r.slice(0,5)!==`http:`)return``;let i=g.getState(r),a,o,c;switch(i){case`unrequested`:a=n.outlineIcons.src.icon_unrequested,o=`fetch`,c=G;break;case`requested`:a=n.outlineIcons.src.icon_requested,o=`fetching`,c=U;break;case`fetched`:a=n.outlineIcons.src.icon_fetched,c=W,o=`loaded`;break;case`failed`:a=n.outlineIcons.src.icon_failed,o=`failed`,c=U;break;case`unpermitted`:a=n.outlineIcons.src.icon_failed,c=U,o=`no perm`;break;case`unfetchable`:a=n.outlineIcons.src.icon_failed,c=U,o=`cannot fetch`;break;default:s.log.error(`?? state = `+i)}let l=s.utils.AJARImage(a,o,n.outlineIcons.tooltips[a].replace(/[Tt]his resource/,r),d);return l.classList.add(`objectValueAccessIcon`),l.setAttribute(`uri`,t),l.addEventListener(`click`,c),P(l,r),e.appendChild(l),l},this.outlineObjectTD=function(e,t,n,r){let i=d.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(s.utils.AJARImage(s.icons.originalIconBase+`tbl-expand-trans.png`,`expand`,void 0,d)).addEventListener(`click`,V)),i.setAttribute(`class`,`obj`),h.whether(e,s.ns.rdf(`type`),s.ns.link(`Request`))&&(i.className=`undetermined`),t||=ne,i.appendChild(t(e)),n&&y(i,e,n),i.tabulatorSelect=function(){z(this,!0)},i.tabulatorDeselect=function(){z(this,!1)},i.addEventListener(`click`,q),i):(i.textContent=`No object available.`,i)},this.outlinePredicateTD=function(e,t,r,i){let a=d.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=s.utils.predicateLabelForXML(e,r);break;case`Collection`:o=s.utils.predicateLabelForXML(e.elements[0],r)}o=o?o.slice(0,1).toUpperCase()+o.slice(1):`...`;let c=d.createElement(`TD`);c.classList.add(`labelTD`),c.setAttribute(`notSelectable`,`true`),c.appendChild(d.createTextNode(o)),a.appendChild(c),c.style.width=`100%`,a.appendChild(N.construct(d));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)&&N.addIcon(a,n.outlineIcons.termWidgets[e])}return a.tabulatorSelect=function(){z(this,!0)},a.tabulatorDeselect=function(){z(this,!1)},a.addEventListener(`click`,q),a};function b(){return C(`OutlineView`,`Resource browser`)}function x(){return document.querySelector(`solid-panes-navbar`)}function S(){let e=x();e&&e.classList.remove(`navbar--hidden`)}function C(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 w(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 s.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 T(e,t){return e.find(e=>e.shouldGetFocus&&e.shouldGetFocus(t))||e[0]}function E(e){let t=d.getElementById(`queryButton`);t&&(e?t.removeAttribute(`style`):t.setAttribute(`style`,`display:none;`))}function D(t,n,r,i){if(!t||!r)return;let a;try{s.log.info(`outline: Rendering pane (menu): `+r.name),a=r.render(n,e,i)}catch(e){a=d.createElement(`div`),a.setAttribute(`class`,`exceptionPane`);let t=d.createElement(`pre`);a.appendChild(t),t.appendChild(d.createTextNode(s.utils.stackString(e)))}a.classList.add(`paneDiv`);let o=t.querySelector(`.paneDiv`);o?o.replaceWith(a):t.appendChild(a)}function O(e,t){let n=d.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`);if(a){if(!t){s.log.warn(`outline: Unable to open pane in place: pane is undefined.`);return}E(!!t.requireQueryButton),a.openSelectedPane?.(t),D(a,e,t,a.paneRenderOptions)}}async function ee(t,n,r){r||={};let i=d.createElement(`tr`);r.hover&&i.classList.add(`hoverControl`);let o=i.appendChild(d.createElement(`td`));o.classList.add(`paneView`,`tdFlex`),o.setAttribute(`notSelectable`,`true`),o.setAttribute(`about`,t.toNT()),o.setAttribute(`colspan`,`2`);let s=o.appendChild(d.createElement(`file-explorer-provider`));s.context=e,s.subjectUri=t.uri,s.onBack=()=>H({target:s});let c=r.hideList?[]:await w(t,e);return s.relevantPanes=c,s.pane=n||T(c,t),s.showHeader=!(t&&t.uri&&t.site&&t.site().uri===t.uri)&&!a.isWebIdUri(t),s.paneRenderOptions=r,s.soloPane=r.solo,s.openPane=(e,t)=>O(e,l.byName(t)),s.handleAccessClick=()=>O(t,l.byName(`sharing`)),s.pane&&(i.classList.add(`outlinePaneRow`),D(s,t,s.pane,r)),i}function k(e){let t=e.parentNode,n=t.parentNode,r=d.createElement(`table`);r.classList.add(`placeholderTable`),n.replaceChild(r,t),t.removeChild(e),n.replaceChild(t,r)}let A=this.propertyTable=function(e,t,n,r){return s.log.debug(`Property table for: `+e),e=h.canon(e),t?(s.log.info(`Re-expand: `+t),t):(t=d.createElement(`table`),t.classList.add(`tableFullWidth`),ee(e,n,r).then(e=>{t.appendChild(e)}),t)};function j(e,t,n){let r=e.createElement(`TR`);r.AJAR_statement=t,r.AJAR_inverse=n,r.setAttribute(`predTR`,`true`);let i=p.outlinePredicateTD(t.predicate,r,n);return r.appendChild(i),r}this.propertyTR=j;function M(e,t,n,r){if(s.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(s.utils.RDFComparePredicateSubject)):(i=function(e){return e.object},t=t.sort(s.utils.RDFComparePredicateObject));let c=t.length;for(a=0;a<c;a++){let l=t[a];if(r&&!r(l.predicate,n))continue;let u=j(d,l,n);e.appendChild(u);let m=u.firstChild,g=$.defaults[l.predicate.uri],_=0,v=0,y=0;for(o=0;o+a<c&&t[a+o].predicate.sameTerm(l.predicate);o++)o>0&&i(t[a+o]).sameTerm(i(t[a+o-1]))&&_++,i(t[a+o]).lang&&f.labeller.LanguagePreference&&(v+=1,i(t[a+o]).lang.indexOf(f.labeller.LanguagePreference)>=0&&y++);if(y>0&&v===_+1){for(let e=a;e<=a+_;e++)if(f.labeller.LanguagePreference&&i(t[e]).lang.indexOf(f.labeller.LanguagePreference)>=0){u.appendChild(p.outlineObjectTD(i(t[e]),g,void 0,l));break}a+=_;continue}u.appendChild(p.outlineObjectTD(i(l),g,void 0,l)),u.showNobj=function(r){let c=o-_,u=2*r<c?r:c,f=[];if(c!==1){m.setAttribute(`rowspan`,u===c?c:r+1);let _;u<c&&u===1&&m.setAttribute(`rowspan`,2);let v=0;for(_=1;_<o;_++)if(h.canon(i(t[a+_])).sameTerm(h.canon(i(t[a+_-1]))))s.log.info(`there are duplicates here: %s`,t[a+_-1]);else{v++,l=t[a+_],g=$.defaults[l.predicate.uri];let r=d.createElement(`tr`);r.style.colspan=`1`,r.appendChild(p.outlineObjectTD(i(t[a+_]),g,void 0,l)),r.AJAR_statement=l,r.AJAR_inverse=n,e.appendChild(r),v>=u&&(r.style.display=`none`,f.push(r))}u===c&&m.setAttribute(`rowspan`,v+1)}if(u<c){let t=d.createElement(`tr`),n=t.appendChild(d.createElement(`td`));if(n.classList.add(`obj`),n.setAttribute(`notSelectable`,`false`),c>r){let e=d.createElement(`a`);n.appendChild(e);let t=(function(e){return e(m,o,_,r)})(function(t,n,r,i){return function(n){e.innerHTML=``,n===`none`?(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-more-trans.png`,`more`,`See all`,d)),e.appendChild(d.createTextNode(c-i+` more...`)),t.setAttribute(`rowspan`,i+1)):(e.appendChild(s.utils.AJARImage(s.icons.originalIconBase+`tbl-shrink.png`,`(less)`,void 0,d)),t.setAttribute(`rowspan`,c+1));for(let e=0;e<f.length;e++){let t=f[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)}},u.showAllobj=function(){u.showNobj(o-_)},u.showNobj(10),a+=o-1}}this.appendPropertyTRs=M;let N={};globalThis.termWidget=N,N.construct=function(e){e||=document;let t=e.createElement(`TD`);return t.setAttribute(`class`,`iconTD`),t.setAttribute(`notSelectable`,`true`),t},N.addIcon=function(e,t,n){let r=e.childNodes[1];if(!r)return;let i=s.utils.AJARImage(t.src,t.alt,t.tooltip,d);r.appendChild(i),n&&i.addEventListener(`click`,n)},N.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=d.location.href.split(`?`)[0]}catch{r=``}a===u.uri.join(t.src,r)&&n.removeChild(i)}},N.replaceIcon=function(e,t,n,r){N.removeIcon(e,t),N.addIcon(e,n,r)};function P(e,t){s.log.debug(`Button callbacks for `+t+` added`);let r=function(r){return function(i){return i.indexOf(`#`),!e||!f.ancestor(e,`DIV`)?!1:(i===t&&(e.src=r,e.title=n.outlineIcons.tooltips[r]),!0)}};g.addCallback(`request`,r(n.outlineIcons.src.icon_requested)),g.addCallback(`done`,r(n.outlineIcons.src.icon_fetched)),g.addCallback(`fail`,r(n.outlineIcons.src.icon_failed))}function F(e){let t=e.getAttribute(`class`);return!!(t&&t.indexOf(`selected`)>=0)}function I(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOn,n.outlineIcons.termWidgets.optOff,L),t.parentNode.parentNode.removeAttribute(`optional`)}function L(e){let t=p.targetOf(e).parentNode;N.replaceIcon(t.parentNode,n.outlineIcons.termWidgets.optOff,n.outlineIcons.termWidgets.optOn,I),t.parentNode.parentNode.setAttribute(`optional`,`true`)}function R(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&&N.addIcon(n.childNodes[0],n.getAttribute(`optional`)?r:i,n.getAttribute(`optional`)?I:L),e+=t,n.setAttribute(`parentOfSelected`,e),e===0&&(n.removeAttribute(`parentOfSelected`),N.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=s.utils.getTarget(e);t.label&&(window.content.location=t.label)},this.showURI=function(e){e&&d.getElementById(`UserURI`)&&(d.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<m.length;e++){if(!m[e].parentNode)continue;let t=m[e].parentNode.AJAR_statement;if(!t)continue;let n=t.why;n&&n.uri&&sourceWidget.highlight(n,!0)}}},this.getSelection=function(){return m};function z(e,t){if(e.nodeName!==`TD`)throw s.log.debug(`down`+e.nodeName),Error(`Expected TD in setSelected: `+e.nodeName+` : `+e.textContent);s.log.debug(`pass`);let r=e.getAttribute(`class`);if(r||=``,t){r+=` selected`,(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,1),m.push(e);let t=s.utils.getTerm(e);p.showURI(t);let i=e.AJAR_statement;if(i===void 0&&e.parentNode&&(i=e.parentNode.AJAR_statement),i){let t=i.why;c.store.updater.editable(t.uri,h)&&r.indexOf(`pred`)>=0&&N.addIcon(e,n.outlineIcons.termWidgets.addTri)}}else s.log.debug(`cla=$`+r+`$`),r===`selected`&&(r=``),r=r.replace(` selected`,``),(r.indexOf(`pred`)>=0||r.indexOf(`obj`)>=0)&&R(e,-1),r.indexOf(`pred`)>=0&&N.removeIcon(e,n.outlineIcons.termWidgets.addTri),m=m.filter(function(t){return t===e}),s.log.info(`Deselecting `+e.textContent);typeof sourceWidget<`u`&&p.showSource(),e.setAttribute(`class`,r)}function B(){let e=m.length;for(let t=e-1;t>=0;t--)z(m[t],!1);m=[]}this.targetOf=function(e){let t;if(e||=window.event,e.target)t=e.target;else if(e.srcElement)t=e.srcElement;else return s.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||m[0],r;switch(e){case`down`:try{r=n.parentNode.nextSibling.lastChild}catch{this.walk(`up`);return}B(),z(r,!0);break;case`up`:try{r=n.parentNode.previousSibling.lastChild}catch{return}B(),z(r,!0);break;case`right`:if(B(),n.nextSibling||n.lastChild.tagName===`strong`)z(n.nextSibling,!0);else{let e=d.evaluate(`table/div/tr/td[2]`,n,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;z(e,!0)}break;case`left`:if(B(),n.previousSibling&&n.previousSibling.className===`undetermined`)return z(n.previousSibling,!0),!0;z(s.utils.ancestor(n.parentNode,`TD`),!0);break;case`moveTo`:B(),z(t,!0)}(e===`down`||e===`up`)&&(r.tabulatorSelect||this.walk(e))},this.OutlinerKeypressPanel=function(e){s.log.info(`Key `+e.keyCode+` pressed`);function t(e){e&&d.getElementById(`UserURI`)&&(d.getElementById(`UserURI`).value=e.termType===`NamedNode`?e.uri:``)}function n(e){return arguments[3]?!0:(o(`right`,a),t(s.utils.getAbout(h,m[0])),!0)}let r,i;if(s.utils.getTarget(e).tagName===`TEXTAREA`||s.utils.getTarget(e).id===`UserURI`||m.length>1)return;if(m.length===0){(e.keyCode===13||e.keyCode===38||e.keyCode===40||e.keyCode===37||e.keyCode===39)&&(this.walk(`right`,p.focusTd),t(s.utils.getAbout(h,m[0])));return}let a=m[0];switch(g.removeCallback(`done`,`setSelectedAfterward`),g.removeCallback(`fail`,`setSelectedAfterward`),e.keyCode){case 13:if(s.utils.getTarget(e).tagName===`HTML`){let e=s.utils.getAbout(h,a);r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),e?f.GotoSubject(e,!0):i&&p.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(s.utils.getTarget(e).tagName===`INPUT`)return;let o;switch(e.keyCode){case 46:case 8:r=a.parentNode.AJAR_statement.why,i=c.store.updater.editable(r.uri,h),i&&(e.preventDefault(),this.UserInput.Delete(a));break;case 37:{if(this.walk(`left`))return;let e=s.utils.ancestor(a.parentNode,`TD`);Z(a,s.utils.getAbout(h,e));break}case 39:{let e=s.utils.getAbout(h,a);if(e){if(o=this.walk,a.nextSibling){this.walk(`right`);return}a.firstChild.tagName!==`TABLE`&&(g.addCallback(`done`,n),g.addCallback(`fail`,n),X(a,e,{pane:l.byName(`defaultPane`)})),n()}}break;case 38:case 40:break;default:switch(e.charCode){case 99:if(e.ctrlKey){p.UserInput.copyToClipboard(p.clipboardAddress,a);break}break;case 118:case 112:if(e.ctrlKey){p.UserInput.pasteFromClipboard(p.clipboardAddress,a);break}break;default:s.utils.getTarget(e).tagName}}t(s.utils.getAbout(h,m[0]))},this.OutlinerMouseclickPanel=function(e){switch(p.UserInput._tabulatorMode){case 0:J(e);break;case 1:p.UserInput.Click(e)}};function V(e){let t=p.targetOf(e),n=t.parentNode,r=s.utils.getAbout(h,t),i=e.altKey?l.byName(`internal`):void 0;e.shiftKey?Q(n,r,i):e.altKey?X(n,r,{pane:l.byName(`internal`),immediate:!0}):X(n,r)}function H(e){let t=p.targetOf(e),n=s.utils.getAbout(h,t),r=e.altKey?l.byName(`internal`):void 0,i=t.parentNode.parentNode;Z(i,n,r)}function U(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function W(e){let t=p.targetOf(e).getAttribute(`uri`);e.altKey?g.fetch(u.uri.docpart(t),{force:!0}):g.refresh(h.sym(u.uri.docpart(t)))}function G(e){let t=p.targetOf(e).getAttribute(`uri`);g.fetch(u.uri.docpart(t))}function K(e){let t=p.targetOf(e),n=t.node;n.childNodes.length>1&&(n=t.parentNode),k(n)}function q(e){if(p.UserInput._tabulatorMode)return p.UserInput.Click(e);let t=p.targetOf(e),n;for(n=s.utils.ancestor(t,`TD`);n&&n.getAttribute(`notSelectable`)!==`false`;n=s.utils.ancestor(n.parentNode,`TD`));if(!n)return;let r=F(n);if(s.log.debug(`Was node selected before: `+r),e.altKey)z(n,!F(n));else if(e.shiftKey)z(n,!0);else{if(B(),p.UserInput.clearInputAndSave(e),z(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=c.store.updater.editable(i.uri,h);r&&a&&p.UserInput.Click(e,m[0])}s.log.debug(`Was node selected after: `+F(n)+`, count=`+m.length),e.stopPropagation()}function J(e){s.log.info(`@TabulatorMousedown, dom.location is now `+d.location);let t=p.targetOf(e);if(!t)return;let r=t.tagName;r!==`INPUT`&&r!==`TEXTAREA`&&(p.UserInput.clearMenu(),p.UserInput.lastModified&&p.UserInput.lastModified.parentNode.nextSibling&&p.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)&&p.UserInput.clearInputAndSave(e),(!t.src||t.src.slice(t.src.indexOf(`/icons/`)+1)!==n.outlineIcons.src.icon_show_choices)&&p.UserInput.clearMenu(),e&&e.stopPropagation())}function Y(e){d.title=s.utils.label(e),d.location.href.startsWith(e.site().uri)}function X(e,t,n){n||={};let r=n.pane,i=!!n.already,a=n.immediate;s.log.info(`@outlineExpand, dom is now `+d.location),g.removeCallback(`done`,`expand`),g.removeCallback(`fail`,`expand`);let o=h.canon(t);function c(){if(o=h.canon(o),!e||!e.parentNode||!e.parentNode.parentNode)return!1;let t;if(s.log.info(`@@ REPAINTING `),!i)t=A(o,void 0,r,n);else{for(s.log.info(` ... p is `+e),t=e.firstChild;t.nextSibling&&(s.log.info(` ... checking node `+t),t.nodeName!==`table`);t=t.nextSibling);t=A(o,t,r,n)}i=!0,s.utils.ancestor(e,`TABLE`)&&s.utils.ancestor(e,`TABLE`).style.backgroundColor===`white`?t.style.backgroundColor=`#eee`:t.style.backgroundColor=`white`,s.utils.emptyNode(e).appendChild(t),p.focusTd=e,s.log.debug(`expand: Node for `+o+` expanded`);let a=h.each(o,s.ns.rdfs(`seeAlso`));for(let e=0;e<a.length;e++)e===25&&s.log.warn(`expand: Warning: many (`+a.length+`) seeAlso links for `+o),g.lookUpThing(a[e],o)}function l(e){if(arguments[3])return!0;let t=h.canon(o);s.log.info(`@@ expand: relevant subject=`+t+`, uri=`+e+`, already=`+i);let n=h.sym(u.uri.docpart(e));if(e.indexOf(`#`)>=0)throw Error(`Internal error: hash in `+e);return!function(){if(!t.uri)return!0;let r=h.uris(t);if(!r)return!1;for(let t=0;t<r.length;t++)for(let n=u.uri.docpart(r[t]);n;n=h.HTTPRedirects[n])if(e===n)return!0;return!!h.anyStatementMatching(t,void 0,void 0,n)}()||(s.log.success(`@@ expand OK: relevant subject=`+t+`, uri=`+e+`, source=`+i),c(),!1)}n.solo&&Y(o),s.log.debug(`outlineExpand: dereferencing `+o);let f=d.createElement(`span`);e.appendChild(f),g.addCallback(`done`,l),g.addCallback(`fail`,l);let m=[];if(o.uri&&o.uri.split(`:`)[0]===`rdf`){c();return}for(let e=0;e<m.length;e++){let t;if(t===m[e](o)){c(),s.log.debug(`outline 1815`),t[1]&&_.removeChild(_.lastChild);return}}if(o.uri&&!a&&!s.widgets.isAudio(o)&&!s.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),c=o?r(o):n,l=s.widgets.errorMessageBlock(d,c,`#fee`,a instanceof Error?a:void 0);t&&l.setAttribute(`data-outline-error-for`,t),e.appendChild(l)},l=!1,u=g.nowOrWhenFetched(o.doc(),void 0,function(e,t){e?(g.lookUpThing(o),c(),n.solo&&Y(o)):(l=!0,a(t,void 0))});u&&typeof u.catch==`function`&&u.catch(function(e){l||(l=!0,a(e,e))})}else c()}function Z(e,t){let n=s.utils.ancestor(e,`TR`);n=s.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}s.log.debug(`Collapsing subject `+t);let a;r&&(s.log.debug(`looking up pred `+r.predicate.uri+`in defaults`),a=$.defaults[r.predicate.uri]),s.log.debug(`view= `+a);let o;i.parentNode.parentNode.id===`outline`&&(o=i.parentNode),p.replaceTD(p.outlineObjectTD(t,a,o,r),i)}this.replaceTD=function(e,t){let n;F(t)&&(n=!0);for(let e=m.length-1;e>-1;e--)for(let n=m[e];n.parentNode;n=n.parentNode)n===t&&z(m[e],!1);t.parentNode.replaceChild(e,t),n&&z(e,!0)};function Q(e,t){let n=null;for(let t=e.parentNode;t;t=t.parentNode)s.log.debug(`level `+t.tagName),t.tagName===`TD`&&(n=t);s.utils.emptyNode(n).appendChild(A(t)),Y(t),n.setAttribute(`about`,t.toNT())}f.outlineRefocus=Q,this.GotoFormURI_enterKey=function(e){e.keyCode===13&&f.GotoFormURI(e)},this.GotoFormURI=function(e){te(d.getElementById(`UserURI`).value)};function te(e){let t=h.sym(e);this.GotoSubject(t,!0)}this.GotoURIinit=function(e){let t=h.sym(e);this.GotoSubject(t)},this.GotoSubject=function(e,t,n,r,i,a,o=!0){let c=b();o&&(!a||a===c)&&S(),a||=c,r&&(s.utils.emptyNode(a),a.style.width=`100%`);function l(){let t=d.createElement(`tr`);t.classList.add(`outlineRow1`),t.style.verticalAlign=`top`,a.appendChild(t);let n=p.outlineObjectTD(e,void 0,t);return t.appendChild(n),n}let u=l();if(r&&Y(e),t&&X(u,e,{pane:n,solo:r}),r&&d&&d.defaultView&&d.defaultView.history){let t=d.defaultView.history.state||{},r=n?{paneName:n.name}:{};n&&n.subject&&typeof n.subject.uri==`string`&&(r.paneUri=n.subject.uri);let i={...t,...r};try{let n=new URL(document.location.href),r=new URL(e.uri,document.location.href);n.origin===r.origin&&(document.location.href===e.uri?JSON.stringify(t)!==JSON.stringify(i)&&d.defaultView.history.replaceState(i,e.uri,e.uri):d.defaultView.history.pushState(i,e.uri,e.uri))}catch{}}return e};let $=t.propertyViews(d);function ne(t){let r;if(t.termType===`Literal`){if(r=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--literal`),r.textContent=t.value,t.datatype&&t.datatype.uri){let e=s.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=d.createElement(`span`),r.classList.add(`objectValue`,`objectValue--resource`),r.setAttribute(`about`,t.toNT()),p.appendAccessIcons(h,r,t),t.termType===`NamedNode`){if(t.uri.slice(0,4)===`tel:`){let e=t.uri.slice(4),i=d.createElement(`a`);r.appendChild(d.createTextNode(e)),i.setAttribute(`href`,t.uri),i.appendChild(s.utils.AJARImage(n.outlineIcons.src.icon_telephone,`phone`,`phone `+e,d)),r.appendChild(i),i.firstChild.setAttribute(`class`,`phoneIcon`),i.firstChild.classList.add(`objectValueLinkIcon`)}else{r.appendChild(d.createTextNode(s.utils.label(t)));let e=s.widgets.linkIcon(d,t);e.firstChild&&e.firstChild.classList.add(`objectValueLinkIcon`),r.appendChild(e),s.widgets.makeDraggable(r,t)}}else r.appendChild(d.createTextNode(s.utils.label(t)))}else if(t.termType===`Collection`){r=d.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(d.createElement(`tr`)),a=i.appendChild(d.createElement(`td`));a.classList.add(`obj`),a.setAttribute(`notSelectable`,`false`),a.setAttribute(`about`,t.toNT()),a.innerHTML=e+1+`)`,i.appendChild(p.outlineObjectTD(n))}}else t.termType===`Graph`?(r=l.byName(`dataContentPane`).statementsAsTables(t.statements,e),r.setAttribute(`class`,`nestedFormula`)):(s.log.error(`Object `+t+` has unknown term type: `+t.termType),r=d.createTextNode(`[unknownTermType:`+t.termType+`]`));return s.log.debug(`contents: `+r.innerHTML),r}return this.createTabURI=function(){d.getElementById(`UserURI`).value=d.URL+`?uri=`+d.getElementById(`UserURI`).value},this.UserInput.setSelected=z,this.UserInput.deselectAll=B,this.UserInput.views=$,this.outlineExpand=X,this}exports.default=d;
|
|
2
2
|
//# sourceMappingURL=manager2.cjs.js.map
|