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":"socialPane2.cjs.js","names":[],"sources":["../../src/social/socialPane.ts"],"sourcesContent":["/* Social Pane\n **\n ** This outline pane provides social network functions\n ** Using for example the FOAF ontology.\n ** Goal: A *distributed* version of facebook, advogato, etc etc\n ** - Similarly easy user interface, but data storage distributed\n ** - Read and write both user-private (address book) and public data clearly\n ** -- todo: use common code to get username and load profile and set 'me'\n */\n\nimport './socialPane.css'\nimport { icons, utils, ns, log, widgets } from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport { LiveStore, NamedNode, Statement } from 'rdflib'\nimport { DataBrowserContext } from 'pane-registry'\nimport { locationIcon } from './icons'\nimport {\n createAllFriendsSection,\n createHeaderSection,\n FriendRowRenderers,\n createMutualSection,\n createRequestsSection,\n HeaderControls,\n SocialHeaderElement\n} from './socialSections'\nimport type { ViewerMode } from './socialSections'\nimport { FriendshipTriage, loadFriendshipTriage, triageFriends } from './triage'\n\nfunction applyEnvironmentAttributes (\n element: HTMLElement,\n context: DataBrowserContext\n): void {\n const layout = context.environment?.layout ?? 'desktop'\n const theme = context.environment?.theme ?? 'light'\n const inputMode = context.environment?.inputMode ?? 'pointer'\n\n element.classList.add('social-pane-host')\n element.dataset.layout = layout\n element.dataset.theme = theme\n element.dataset.inputMode = inputMode\n}\n\nexport const socialPane = {\n icon: icons.originalIconBase + 'foaf/foafTiny.gif',\n\n name: 'social',\n\n label: function (subject, context) {\n const kb = context.session.store\n const types = kb.findTypeURIs(subject)\n if (\n types[ns.foaf('Person').uri] ||\n types[ns.vcard('Individual').uri]\n ) {\n return 'Friends'\n }\n return null\n },\n global: false,\n\n render: function (s, context) {\n const dom = context.dom\n const common = function (x: NamedNode[], y: NamedNode[]) {\n // Find common members of two lists\n const both: NamedNode[] = []\n for (let i = 0; i < x.length; i++) {\n for (let j = 0; j < y.length; j++) {\n if (y[j].sameTerm(x[i])) {\n both.push(y[j])\n break\n }\n }\n }\n return both\n }\n\n const uniqueNodes = function (nodes: NamedNode[]) {\n const seen = new Set<string>()\n const unique: NamedNode[] = []\n for (const node of nodes) {\n if (!node?.value || seen.has(node.value)) continue\n seen.add(node.value)\n unique.push(node)\n }\n return unique\n }\n\n const link = function (contents: Node, uri: string | null | undefined) {\n if (!uri) return contents\n const a = dom.createElement('a')\n a.setAttribute('href', uri)\n a.appendChild(contents)\n return a\n }\n\n const text = function (str: string) {\n return dom.createTextNode(str)\n }\n\n let refreshRelationshipUi = function () {}\n\n const buildCheckboxForm = function (\n lab: string | Node,\n statement: Statement,\n state: boolean,\n options: { disabled?: boolean, disabledTitle?: string } = {}\n ) {\n const f = dom.createElement('form')\n const label = dom.createElement('label')\n const input = dom.createElement('input')\n const tx = dom.createElement('span')\n tx.className = 'question'\n if (typeof lab === 'string') {\n tx.textContent = lab\n } else {\n tx.appendChild(lab)\n }\n input.setAttribute('type', 'checkbox')\n if (options.disabled) {\n input.disabled = true\n if (options.disabledTitle) {\n input.title = options.disabledTitle\n input.setAttribute('aria-label', options.disabledTitle)\n }\n }\n label.appendChild(tx)\n label.appendChild(input)\n f.appendChild(label)\n const boxHandler = function (this: HTMLInputElement, _e: Event) {\n if (this.checked) {\n try {\n outliner.UserInput.sparqler.insert_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while inserting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = false // rollback UI\n return\n }\n kb.add(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n })\n } catch (e) {\n log.error('Data write fails:' + e)\n log.alert('Data write fails:' + e)\n input.checked = false // rollback UI\n tx.className = 'question'\n }\n } else {\n try {\n outliner.UserInput.sparqler.delete_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while deleting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = true // Rollback UI\n } else {\n kb.removeMany(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n }\n })\n } catch (e) {\n log.alert('Delete fails:' + e)\n input.checked = true // Rollback UI\n // return\n }\n }\n }\n input.checked = state\n input.addEventListener('click', boxHandler, false)\n return f\n }\n\n // ////////// Body of render():\n\n const outliner = context.getOutliner(dom)\n const kb = context.session.store\n const socialPane = dom.createElement('div')\n socialPane.classList.add('social-pane', 'flex-column', 'gap-xxs')\n applyEnvironmentAttributes(socialPane, context)\n const foaf = ns.foaf\n const vcard = ns.vcard\n const me = authn.currentUser()\n const meUri = me ? me.uri : null\n\n const thisIsYou = me && kb.sameThings(me, s)\n\n const knows = foaf('knows')\n // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')\n const familiar =\n kb.anyValue(s, foaf('givenname')) ||\n kb.anyValue(s, foaf('firstName')) ||\n kb.anyValue(s, foaf('nick')) ||\n kb.anyValue(s, foaf('name')) ||\n kb.anyValue(s, vcard('fn'))\n const friends = kb.each(s, knows)\n const uniqueFriends = uniqueNodes(friends as NamedNode[])\n const myFriends = me ? uniqueNodes(kb.each(me, foaf('knows')) as NamedNode[]) : []\n const mutualConnections = me && !thisIsYou\n ? uniqueNodes(common(uniqueFriends, myFriends)).filter(friend => !kb.sameThings(friend, me))\n : []\n const mutualFriendCount = me && !thisIsYou ? mutualConnections.length : null\n const viewerMode = getViewerMode(s, me)\n\n // Do I have a public profile document?\n let profile: NamedNode | null = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }\n let editable = false\n let incoming: boolean | NamedNode[] = false\n let outgoing: boolean | NamedNode[] = false\n\n const structure = socialPane.appendChild(dom.createElement('div'))\n structure.className = 'social-layout'\n const primary = structure.appendChild(dom.createElement('div'))\n primary.className = 'social-primary'\n\n const tabs = primary.appendChild(dom.createElement('div'))\n tabs.classList.add('social-primary__tabs', 'flex-center')\n tabs.setAttribute('role', 'tablist')\n tabs.setAttribute('aria-label', 'Social sections')\n\n const allFriendsTab = tabs.appendChild(dom.createElement('button'))\n allFriendsTab.className = 'social-primary__tab'\n allFriendsTab.type = 'button'\n allFriendsTab.id = 'social-tab-all-friends'\n allFriendsTab.textContent = 'All Friends'\n allFriendsTab.setAttribute('role', 'tab')\n allFriendsTab.setAttribute('aria-controls', 'social-panel-all-friends')\n allFriendsTab.setAttribute('aria-selected', 'true')\n allFriendsTab.tabIndex = 0\n\n const mutualTab = tabs.appendChild(dom.createElement('button'))\n mutualTab.className = 'social-primary__tab'\n mutualTab.type = 'button'\n mutualTab.id = 'social-tab-mutual'\n mutualTab.textContent = 'Mutual'\n mutualTab.setAttribute('role', 'tab')\n mutualTab.setAttribute('aria-controls', 'social-panel-mutual')\n mutualTab.setAttribute('aria-selected', 'false')\n mutualTab.tabIndex = -1\n\n if (me) {\n // The definition of FOAF personal profile document is ..\n const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic\n let message = ''\n for (let i = 0; i < works.length; i++) {\n if (\n kb.whether(\n works[i],\n ns.rdf('type'),\n foaf('PersonalProfileDocument')\n )\n ) {\n const doc = works[i]\n editable = outliner.UserInput.sparqler.editable(doc.uri, kb)\n if (!editable) {\n message +=\n 'Your profile <' +\n utils.escapeForXML(doc.uri) +\n '> is not remotely editable.'\n } else {\n profile = doc\n break\n }\n }\n }\n\n /*\n if (!profile) {\n say(\n message + '\\nI couldn\\'t find your editable personal profile document.'\n )\n } else {\n say('Editing your profile ' + profile + '.')\n editable = outliner.UserInput.sparqler.editable(profile.uri, kb)\n }\n */\n\n if (thisIsYou) {\n // This is about me\n // pass... @@\n } else {\n // This is about someone else\n // My relationship with this person\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n outgoing = false\n const outgoingSt = kb.statementsMatching(cme, knows, s)\n if (outgoingSt.length) {\n outgoing = true\n if (!profile) profile = outgoingSt[0].why\n }\n } // About someone else\n } // me is defined\n // End of you and s\n\n const shouldShowHeaderAddFriendAction = (mode: ViewerMode) => {\n return mode === 'authenticated' && !thisIsYou && !outgoing\n }\n\n const canEditOwnedProfile = viewerMode === 'owner' && editable\n const canManageRelationship = viewerMode === 'authenticated' && !thisIsYou && editable && Boolean(profile)\n const canModifyFriendsTab = canEditOwnedProfile\n\n let headerControls: HeaderControls = {\n canEdit: canEditOwnedProfile,\n viewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(viewerMode)\n }\n\n const header = createHeaderSection(context, s, headerControls, {\n friendCount: uniqueFriends.length,\n mutualFriendCount,\n onSelectFriends: function () {\n setActivePanel('all-friends')\n },\n onSelectMutual: typeof mutualFriendCount === 'number'\n ? function () {\n setActivePanel('mutual')\n }\n : undefined\n }, function () {\n return selectProfileData(context, s)\n })\n header.classList.add('social-pane__header-section', 'flex-column')\n socialPane.prepend(header)\n\n // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))\n\n // ///////////////////////////////////////////// Main block\n //\n // Should: Find the intersection and difference sets\n\n const friendDetailsByUri = new Map<string, FriendDetails>()\n\n const hydrateFriendDetailsCache = function (friendNodes: NamedNode[]) {\n const nextCache = new Map<string, FriendDetails>()\n\n friendNodes.forEach(friendNode => {\n if (!friendNode?.value || friendNode.value === s.value) return\n nextCache.set(friendNode.value, toFriendDetails(kb, friendNode))\n })\n\n friendDetailsByUri.clear()\n nextCache.forEach((value, key) => {\n friendDetailsByUri.set(key, value)\n })\n }\n\n hydrateFriendDetailsCache(uniqueFriends)\n\n const renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n\n const container = renderDom.createElement('div')\n const jobAndOrganization = [friend.jobTitle, friend.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = container.appendChild(renderDom.createElement('div'))\n jobLine.className = 'social-friend-job-org'\n jobLine.textContent = jobAndOrganization\n }\n\n if (friend.location) {\n const locationLine = container.appendChild(renderDom.createElement('div'))\n locationLine.className = 'social-friend-location'\n locationLine.innerHTML = `${locationIcon} ${friend.location}`\n }\n\n if (!container.childNodes.length) return null\n\n return container\n }\n\n const renderNameSuffix: FriendRowRenderers['renderNameSuffix'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n const pronouns = friend.pronouns\n if (!pronouns) return null\n\n const suffix = renderDom.createElement('span')\n suffix.className = 'social-friend-pronouns'\n suffix.textContent = `(${pronouns})`\n return suffix\n }\n\n let mutualSection = me && !thisIsYou\n ? createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n : {\n section: dom.createElement('section'),\n content: dom.createElement('div'),\n refreshMutualFriends: function () {}\n }\n\n let mutualFriends = mutualSection.section\n let mutualContent = mutualSection.content\n if (!mutualFriends.className) {\n mutualFriends.className = 'social-pane__mutual-friends social-primary__panel'\n mutualFriends.id = 'social-panel-mutual'\n mutualFriends.setAttribute('role', 'tabpanel')\n mutualFriends.setAttribute('aria-labelledby', 'social-tab-mutual')\n mutualContent.className = 'social-main social-main--mutual'\n mutualFriends.appendChild(mutualContent)\n }\n primary.appendChild(mutualFriends)\n\n const allFriendsSection = createAllFriendsSection({\n dom,\n subject: s,\n profile: canModifyFriendsTab ? profile : null,\n editable: canModifyFriendsTab,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n const allFriends = allFriendsSection.section\n const friendsList = allFriendsSection.friendsList\n primary.appendChild(allFriends)\n\n let requestsTriage: FriendshipTriage = triageFriends(kb, s)\n const requestsSection = createRequestsSection({\n dom,\n triage: requestsTriage,\n renderSupportingInfo,\n renderNameSuffix\n })\n const requestsPanel = requestsSection.section\n primary.appendChild(requestsPanel)\n\n const requestsTab = tabs.appendChild(dom.createElement('button'))\n requestsTab.className = 'social-primary__tab'\n requestsTab.type = 'button'\n requestsTab.id = 'social-tab-requests'\n requestsTab.textContent = 'Requests'\n requestsTab.setAttribute('role', 'tab')\n requestsTab.setAttribute('aria-controls', 'social-panel-requests')\n requestsTab.setAttribute('aria-selected', 'false')\n requestsTab.tabIndex = -1\n\n type SocialPanel = 'mutual' | 'all-friends' | 'requests'\n let activePanel: SocialPanel = 'all-friends'\n let showRequestsTab = viewerMode === 'owner'\n\n const setActivePanel = function (panel: SocialPanel) {\n activePanel = panel\n const showMutual = panel === 'mutual'\n const showAllFriends = panel === 'all-friends'\n const showRequests = showRequestsTab && panel === 'requests'\n mutualTab.classList.toggle('social-primary__tab--active', showMutual)\n mutualTab.setAttribute('aria-selected', String(showMutual))\n mutualTab.tabIndex = showMutual ? 0 : -1\n\n allFriendsTab.classList.toggle('social-primary__tab--active', showAllFriends)\n allFriendsTab.setAttribute('aria-selected', String(showAllFriends))\n allFriendsTab.tabIndex = showAllFriends ? 0 : -1\n\n requestsTab.classList.toggle('social-primary__tab--active', showRequests)\n requestsTab.setAttribute('aria-selected', String(showRequests))\n requestsTab.tabIndex = showRequests ? 0 : -1\n\n mutualFriends.classList.toggle('social-primary__panel--active', showMutual)\n mutualFriends.setAttribute('aria-hidden', String(!showMutual))\n\n allFriends.classList.toggle('social-primary__panel--active', showAllFriends)\n allFriends.setAttribute('aria-hidden', String(!showAllFriends))\n\n requestsPanel.classList.toggle('social-primary__panel--active', showRequests)\n requestsPanel.setAttribute('aria-hidden', String(!showRequests))\n requestsPanel.hidden = !showRequestsTab || !showRequests\n }\n const rebuildMutualSection = function () {\n if (!me || thisIsYou) return\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n\n const outgoingStatements = kb.statementsMatching(cme, knows, s)\n outgoing = outgoingStatements.length > 0\n\n const nextMutualSection = createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n mutualFriends.replaceWith(nextMutualSection.section)\n mutualSection = nextMutualSection\n mutualFriends = nextMutualSection.section\n mutualContent = nextMutualSection.content\n }\n\n refreshRelationshipUi = function () {\n rebuildMutualSection()\n headerControls = {\n ...headerControls,\n showAddFriendAction: shouldShowHeaderAddFriendAction(headerControls.viewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n requestsTriage = triageFriends(kb, s)\n requestsSection.refreshRequests(requestsTriage)\n setActivePanel(activePanel)\n }\n\n setActivePanel('all-friends')\n\n const applyViewerMode = function (mode: ViewerMode) {\n const showMutualTab = mode === 'authenticated' && !thisIsYou\n showRequestsTab = mode === 'owner'\n mutualTab.hidden = !showMutualTab\n requestsTab.hidden = !showRequestsTab\n if (!showRequestsTab && activePanel === 'requests') {\n setActivePanel('all-friends')\n return\n }\n setActivePanel('all-friends')\n }\n\n mutualTab.addEventListener('click', function () {\n setActivePanel('mutual')\n })\n\n allFriendsTab.addEventListener('click', function () {\n setActivePanel('all-friends')\n })\n\n requestsTab.addEventListener('click', function () {\n setActivePanel('requests')\n })\n\n const refreshFriendsList = function () {\n const refresh = (friendsList as HTMLTableElement & { refresh?: () => void }).refresh\n if (typeof refresh !== 'function') return\n\n refresh.call(friendsList)\n }\n\n const refreshMutualFriends = function () {\n mutualSection.refreshMutualFriends()\n }\n\n ;(async () => {\n try {\n for await (const streamedFriends of streamFriends(context, s)) {\n friendDetailsByUri.clear()\n streamedFriends.forEach(friend => {\n friendDetailsByUri.set(friend.url, friend)\n })\n refreshFriendsList()\n refreshMutualFriends()\n }\n } catch {\n // Keep the initial snapshot if async friend loading fails.\n }\n })()\n\n ;(async () => {\n try {\n requestsTriage = await loadFriendshipTriage(context, s)\n requestsSection.refreshRequests(requestsTriage)\n refreshFriendsList()\n refreshMutualFriends()\n } catch {\n // Keep the initial requests snapshot if additional loading fails.\n }\n })()\n\n // Older triage logic is preserved below as a reusable data helper.\n\n applyViewerMode('anonymous')\n\n authn.checkUser()\n .then(webId => {\n const confirmedViewerMode = getViewerMode(s, webId)\n applyViewerMode(confirmedViewerMode)\n const confirmedCanEditOwnedProfile = confirmedViewerMode === 'owner' && editable\n headerControls = {\n ...headerControls,\n canEdit: confirmedCanEditOwnedProfile,\n viewerMode: confirmedViewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(confirmedViewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n .catch(() => {\n applyViewerMode('anonymous')\n headerControls = {\n ...headerControls,\n canEdit: false,\n viewerMode: 'anonymous',\n showAddFriendAction: false\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n\n return socialPane\n } // render()\n} //\n// ends\n// ***************** Social Pane Selectors **********/\n/* Should move to another file, but will leave for now */\n/* Will create a social pane folder or maybe repo later */\n\nconst FRIEND_BATCH_SIZE = 3\n\nexport interface ProfileDetails {\n url: string\n imageUrl?: string\n name?: string\n nickname?: string\n jobTitle?: string\n organization?: string\n location?: string | null\n pronouns?: string\n birthdate?: string\n}\n\nexport interface FriendDetails extends ProfileDetails {\n subjectNode: NamedNode\n}\n\n/* pronounsAsText and formatLocation were copied from HeadingSection selectors */\nexport function pronounsAsText (store: LiveStore, subject: NamedNode): string {\n let pronouns = store.anyJS(subject, ns.solid('preferredSubjectPronoun')) || ''\n if (pronouns) {\n const them = store.anyJS(subject, ns.solid('preferredObjectPronoun'))\n if (them) {\n pronouns += '/' + them\n }\n }\n return pronouns || ''\n}\n\nfunction formatLocation (countryName: string | void, locality: string | void) {\n return countryName && locality\n ? `${locality}, ${countryName}`\n : countryName || locality || null\n}\n\nfunction toFriendDetails (store: any, friendNode: NamedNode): FriendDetails {\n const name =\n store.anyValue(friendNode, ns.vcard('fn')) ||\n store.anyValue(friendNode, ns.foaf('name')) ||\n null\n const nickname =\n store.anyValue(friendNode, ns.vcard('nickname')) ||\n store.anyValue(friendNode, ns.foaf('nick')) ||\n null\n const dateOfBirth = store.anyValue(friendNode, ns.vcard('bday')) || null\n const imageSrc = widgets.findImage(friendNode)\n const jobTitle = store.anyValue(friendNode, ns.vcard('role')) || null\n const orgName = store.anyValue(friendNode, ns.vcard('organization-name')) || null\n const primaryAddressEntryNode = store.any(friendNode, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : null\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : null\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, friendNode)\n\n return {\n url: friendNode.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns,\n subjectNode: friendNode\n }\n}\n\nexport async function * streamFriends (\n context: DataBrowserContext,\n subject: NamedNode,\n batchSize = FRIEND_BATCH_SIZE\n): AsyncGenerator<FriendDetails[], void, void> {\n const store = context.session.store\n const fetcher = (store as any)?.fetcher\n\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(subject.doc())\n } catch {\n // Continue with whatever is already in the store.\n }\n }\n\n const seen = new Set<string>()\n const friendNodes = store.each(subject, ns.foaf('knows'), null, subject.doc())\n const uniqueFriendNodes: NamedNode[] = []\n\n for (const friendNode of friendNodes) {\n const key = friendNode?.value\n if (!key || seen.has(key) || subject.value === key) continue\n seen.add(key)\n uniqueFriendNodes.push(friendNode as NamedNode)\n }\n\n const friends: FriendDetails[] = []\n\n for (const friendNode of uniqueFriendNodes) {\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(friendNode.doc())\n } catch {\n // Keep partial friend data when one linked document fails to load.\n }\n }\n\n friends.push(toFriendDetails(store, friendNode))\n\n if (friends.length % batchSize === 0) {\n yield [...friends]\n }\n }\n\n if (friends.length > 0 && friends.length % batchSize !== 0) {\n yield [...friends]\n }\n}\n\nexport async function extractFriends (context: DataBrowserContext, subject: NamedNode): Promise<FriendDetails[] | null> {\n let latestFriends: FriendDetails[] | null = null\n\n for await (const friends of streamFriends(context, subject)) {\n latestFriends = friends\n }\n\n return latestFriends\n}\n\nexport function selectProfileData (context: DataBrowserContext, subject: NamedNode): ProfileDetails | null {\n const store = context.session.store\n\n const name =\n store.anyValue(subject, ns.vcard('fn')) ||\n store.anyValue(subject, ns.foaf('name')) ||\n undefined\n const nickname =\n store.anyValue(subject, ns.vcard('nickname')) ||\n store.anyValue(subject, ns.foaf('nick')) ||\n undefined\n const dateOfBirth = store.anyValue(subject, ns.vcard('bday')) || undefined\n const imageSrc = widgets.findImage(subject)\n const jobTitle = store.anyValue(subject, ns.vcard('role')) || undefined\n const orgName = store.anyValue(subject, ns.vcard('organization-name')) || undefined\n const primaryAddressEntryNode = store.any(subject, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : undefined\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : undefined\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, subject)\n return {\n url: subject.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns\n }\n}\n\nexport type { ViewerMode } from './socialSections'\n\nfunction getViewerMode (subject: NamedNode, currentUser: unknown = authn.currentUser()): ViewerMode {\n const currentUserUri =\n typeof currentUser === 'string'\n ? currentUser\n : typeof currentUser === 'object' && currentUser !== null\n ? ((currentUser as { value?: string, uri?: string }).value ||\n (currentUser as { value?: string, uri?: string }).uri ||\n null)\n : null\n let mode: ViewerMode = 'anonymous'\n if (currentUserUri === subject.value) mode = 'owner'\n if (currentUserUri && currentUserUri !== subject.value) mode = 'authenticated'\n return mode\n}\n"],"mappings":"sLA4BA,SAAS,EACP,EACA,EACM,CACN,IAAM,EAAS,EAAQ,aAAa,QAAU,UACxC,EAAQ,EAAQ,aAAa,OAAS,QACtC,EAAY,EAAQ,aAAa,WAAa,UAEpD,EAAQ,UAAU,IAAI,kBAAkB,EACxC,EAAQ,QAAQ,OAAS,EACzB,EAAQ,QAAQ,MAAQ,EACxB,EAAQ,QAAQ,UAAY,CAC9B,CAEA,IAAa,EAAa,CACxB,KAAM,EAAA,MAAM,iBAAmB,oBAE/B,KAAM,SAEN,MAAO,SAAU,EAAS,EAAS,CAEjC,IAAM,EADK,EAAQ,QAAQ,MACV,aAAa,CAAO,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YAGvB,OAFI,IAAmB,EAAQ,QAAO,EAAO,SACzC,GAAkB,IAAmB,EAAQ,QAAO,EAAO,iBACxD,CACT"}
|
|
1
|
+
{"version":3,"file":"socialPane2.cjs.js","names":["icons","ns","authn","utils","createHeaderSection","locationIcon","createMutualSection","createAllFriendsSection","triageFriends","createRequestsSection","loadFriendshipTriage","widgets","require_icons","require_socialSections","require_triage","solid_ui","solid_logic","applyEnvironmentAttributes","layout","context","theme","inputMode","element","socialPane","types","subject","dom","common","both","i","x","j","y","uniqueNodes","seen","unique","node","nodes","link","uri","contents","a","text","str","refreshRelationshipUi","buildCheckboxForm","f","label","input","tx","lab","options","state","outliner","statement","success","errorBody","kb","foaf","vcard","me","meUri","thisIsYou","s","knows","familiar","uniqueFriends","myFriends","mutualConnections","friend","mutualFriendCount","viewerMode","getViewerMode","profile","editable","incoming","outgoing","structure","primary","tabs","allFriendsTab","mutualTab","works","message","doc","cme","outgoingSt","shouldShowHeaderAddFriendAction","mode","canEditOwnedProfile","canManageRelationship","canModifyFriendsTab","headerControls","header","setActivePanel","selectProfileData","friendDetailsByUri","nextCache","friendNodes","friendNode","toFriendDetails","key","value","renderSupportingInfo","target","container","renderDom","jobAndOrganization","jobLine","locationLine","renderNameSuffix","pronouns","suffix","mutualSection","mutualFriends","mutualContent","allFriendsSection","allFriends","friendsList","requestsTriage","requestsSection","requestsPanel","requestsTab","activePanel","showRequestsTab","panel","showMutual","showAllFriends","showRequests","rebuildMutualSection","nextMutualSection","applyViewerMode","showMutualTab","refreshFriendsList","refresh","refreshMutualFriends","streamedFriends","streamFriends","confirmedViewerMode","webId","confirmedCanEditOwnedProfile","FRIEND_BATCH_SIZE","pronounsAsText","store","them","formatLocation","countryName","locality","name","nickname","dateOfBirth","imageSrc","jobTitle","orgName","address","location","fetcher","uniqueFriendNodes","friends","batchSize","currentUserUri","currentUser"],"sources":["../../src/social/socialPane.ts"],"sourcesContent":["/* Social Pane\n **\n ** This outline pane provides social network functions\n ** Using for example the FOAF ontology.\n ** Goal: A *distributed* version of facebook, advogato, etc etc\n ** - Similarly easy user interface, but data storage distributed\n ** - Read and write both user-private (address book) and public data clearly\n ** -- todo: use common code to get username and load profile and set 'me'\n */\n\nimport './socialPane.css'\nimport { icons, utils, ns, log, widgets } from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport { LiveStore, NamedNode, Statement } from 'rdflib'\nimport { DataBrowserContext } from 'pane-registry'\nimport { locationIcon } from './icons'\nimport {\n createAllFriendsSection,\n createHeaderSection,\n FriendRowRenderers,\n createMutualSection,\n createRequestsSection,\n HeaderControls,\n SocialHeaderElement\n} from './socialSections'\nimport type { ViewerMode } from './socialSections'\nimport { FriendshipTriage, loadFriendshipTriage, triageFriends } from './triage'\n\nfunction applyEnvironmentAttributes (\n element: HTMLElement,\n context: DataBrowserContext\n): void {\n const layout = context.environment?.layout ?? 'desktop'\n const theme = context.environment?.theme ?? 'light'\n const inputMode = context.environment?.inputMode ?? 'pointer'\n\n element.classList.add('social-pane-host')\n element.dataset.layout = layout\n element.dataset.theme = theme\n element.dataset.inputMode = inputMode\n}\n\nexport const socialPane = {\n icon: icons.originalIconBase + 'foaf/foafTiny.gif',\n\n name: 'social',\n\n label: function (subject, context) {\n const kb = context.session.store\n const types = kb.findTypeURIs(subject)\n if (\n types[ns.foaf('Person').uri] ||\n types[ns.vcard('Individual').uri]\n ) {\n return 'Friends'\n }\n return null\n },\n global: false,\n\n render: function (s, context) {\n const dom = context.dom\n const common = function (x: NamedNode[], y: NamedNode[]) {\n // Find common members of two lists\n const both: NamedNode[] = []\n for (let i = 0; i < x.length; i++) {\n for (let j = 0; j < y.length; j++) {\n if (y[j].sameTerm(x[i])) {\n both.push(y[j])\n break\n }\n }\n }\n return both\n }\n\n const uniqueNodes = function (nodes: NamedNode[]) {\n const seen = new Set<string>()\n const unique: NamedNode[] = []\n for (const node of nodes) {\n if (!node?.value || seen.has(node.value)) continue\n seen.add(node.value)\n unique.push(node)\n }\n return unique\n }\n\n const link = function (contents: Node, uri: string | null | undefined) {\n if (!uri) return contents\n const a = dom.createElement('a')\n a.setAttribute('href', uri)\n a.appendChild(contents)\n return a\n }\n\n const text = function (str: string) {\n return dom.createTextNode(str)\n }\n\n let refreshRelationshipUi = function () {}\n\n const buildCheckboxForm = function (\n lab: string | Node,\n statement: Statement,\n state: boolean,\n options: { disabled?: boolean, disabledTitle?: string } = {}\n ) {\n const f = dom.createElement('form')\n const label = dom.createElement('label')\n const input = dom.createElement('input')\n const tx = dom.createElement('span')\n tx.className = 'question'\n if (typeof lab === 'string') {\n tx.textContent = lab\n } else {\n tx.appendChild(lab)\n }\n input.setAttribute('type', 'checkbox')\n if (options.disabled) {\n input.disabled = true\n if (options.disabledTitle) {\n input.title = options.disabledTitle\n input.setAttribute('aria-label', options.disabledTitle)\n }\n }\n label.appendChild(tx)\n label.appendChild(input)\n f.appendChild(label)\n const boxHandler = function (this: HTMLInputElement, _e: Event) {\n if (this.checked) {\n try {\n outliner.UserInput.sparqler.insert_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while inserting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = false // rollback UI\n return\n }\n kb.add(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n })\n } catch (e) {\n log.error('Data write fails:' + e)\n log.alert('Data write fails:' + e)\n input.checked = false // rollback UI\n tx.className = 'question'\n }\n } else {\n try {\n outliner.UserInput.sparqler.delete_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while deleting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = true // Rollback UI\n } else {\n kb.removeMany(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n }\n })\n } catch (e) {\n log.alert('Delete fails:' + e)\n input.checked = true // Rollback UI\n // return\n }\n }\n }\n input.checked = state\n input.addEventListener('click', boxHandler, false)\n return f\n }\n\n // ////////// Body of render():\n\n const outliner = context.getOutliner(dom)\n const kb = context.session.store\n const socialPane = dom.createElement('div')\n socialPane.classList.add('social-pane', 'flex-column', 'gap-xxs')\n applyEnvironmentAttributes(socialPane, context)\n const foaf = ns.foaf\n const vcard = ns.vcard\n const me = authn.currentUser()\n const meUri = me ? me.uri : null\n\n const thisIsYou = me && kb.sameThings(me, s)\n\n const knows = foaf('knows')\n // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')\n const familiar =\n kb.anyValue(s, foaf('givenname')) ||\n kb.anyValue(s, foaf('firstName')) ||\n kb.anyValue(s, foaf('nick')) ||\n kb.anyValue(s, foaf('name')) ||\n kb.anyValue(s, vcard('fn'))\n const friends = kb.each(s, knows)\n const uniqueFriends = uniqueNodes(friends as NamedNode[])\n const myFriends = me ? uniqueNodes(kb.each(me, foaf('knows')) as NamedNode[]) : []\n const mutualConnections = me && !thisIsYou\n ? uniqueNodes(common(uniqueFriends, myFriends)).filter(friend => !kb.sameThings(friend, me))\n : []\n const mutualFriendCount = me && !thisIsYou ? mutualConnections.length : null\n const viewerMode = getViewerMode(s, me)\n\n // Do I have a public profile document?\n let profile: NamedNode | null = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }\n let editable = false\n let incoming: boolean | NamedNode[] = false\n let outgoing: boolean | NamedNode[] = false\n\n const structure = socialPane.appendChild(dom.createElement('div'))\n structure.className = 'social-layout'\n const primary = structure.appendChild(dom.createElement('div'))\n primary.className = 'social-primary'\n\n const tabs = primary.appendChild(dom.createElement('div'))\n tabs.classList.add('social-primary__tabs', 'flex-center')\n tabs.setAttribute('role', 'tablist')\n tabs.setAttribute('aria-label', 'Social sections')\n\n const allFriendsTab = tabs.appendChild(dom.createElement('button'))\n allFriendsTab.className = 'social-primary__tab'\n allFriendsTab.type = 'button'\n allFriendsTab.id = 'social-tab-all-friends'\n allFriendsTab.textContent = 'All Friends'\n allFriendsTab.setAttribute('role', 'tab')\n allFriendsTab.setAttribute('aria-controls', 'social-panel-all-friends')\n allFriendsTab.setAttribute('aria-selected', 'true')\n allFriendsTab.tabIndex = 0\n\n const mutualTab = tabs.appendChild(dom.createElement('button'))\n mutualTab.className = 'social-primary__tab'\n mutualTab.type = 'button'\n mutualTab.id = 'social-tab-mutual'\n mutualTab.textContent = 'Mutual'\n mutualTab.setAttribute('role', 'tab')\n mutualTab.setAttribute('aria-controls', 'social-panel-mutual')\n mutualTab.setAttribute('aria-selected', 'false')\n mutualTab.tabIndex = -1\n\n if (me) {\n // The definition of FOAF personal profile document is ..\n const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic\n let message = ''\n for (let i = 0; i < works.length; i++) {\n if (\n kb.whether(\n works[i],\n ns.rdf('type'),\n foaf('PersonalProfileDocument')\n )\n ) {\n const doc = works[i]\n editable = outliner.UserInput.sparqler.editable(doc.uri, kb)\n if (!editable) {\n message +=\n 'Your profile <' +\n utils.escapeForXML(doc.uri) +\n '> is not remotely editable.'\n } else {\n profile = doc\n break\n }\n }\n }\n\n /*\n if (!profile) {\n say(\n message + '\\nI couldn\\'t find your editable personal profile document.'\n )\n } else {\n say('Editing your profile ' + profile + '.')\n editable = outliner.UserInput.sparqler.editable(profile.uri, kb)\n }\n */\n\n if (thisIsYou) {\n // This is about me\n // pass... @@\n } else {\n // This is about someone else\n // My relationship with this person\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n outgoing = false\n const outgoingSt = kb.statementsMatching(cme, knows, s)\n if (outgoingSt.length) {\n outgoing = true\n if (!profile) profile = outgoingSt[0].why\n }\n } // About someone else\n } // me is defined\n // End of you and s\n\n const shouldShowHeaderAddFriendAction = (mode: ViewerMode) => {\n return mode === 'authenticated' && !thisIsYou && !outgoing\n }\n\n const canEditOwnedProfile = viewerMode === 'owner' && editable\n const canManageRelationship = viewerMode === 'authenticated' && !thisIsYou && editable && Boolean(profile)\n const canModifyFriendsTab = canEditOwnedProfile\n\n let headerControls: HeaderControls = {\n canEdit: canEditOwnedProfile,\n viewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(viewerMode)\n }\n\n const header = createHeaderSection(context, s, headerControls, {\n friendCount: uniqueFriends.length,\n mutualFriendCount,\n onSelectFriends: function () {\n setActivePanel('all-friends')\n },\n onSelectMutual: typeof mutualFriendCount === 'number'\n ? function () {\n setActivePanel('mutual')\n }\n : undefined\n }, function () {\n return selectProfileData(context, s)\n })\n header.classList.add('social-pane__header-section', 'flex-column')\n socialPane.prepend(header)\n\n // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))\n\n // ///////////////////////////////////////////// Main block\n //\n // Should: Find the intersection and difference sets\n\n const friendDetailsByUri = new Map<string, FriendDetails>()\n\n const hydrateFriendDetailsCache = function (friendNodes: NamedNode[]) {\n const nextCache = new Map<string, FriendDetails>()\n\n friendNodes.forEach(friendNode => {\n if (!friendNode?.value || friendNode.value === s.value) return\n nextCache.set(friendNode.value, toFriendDetails(kb, friendNode))\n })\n\n friendDetailsByUri.clear()\n nextCache.forEach((value, key) => {\n friendDetailsByUri.set(key, value)\n })\n }\n\n hydrateFriendDetailsCache(uniqueFriends)\n\n const renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n\n const container = renderDom.createElement('div')\n const jobAndOrganization = [friend.jobTitle, friend.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = container.appendChild(renderDom.createElement('div'))\n jobLine.className = 'social-friend-job-org'\n jobLine.textContent = jobAndOrganization\n }\n\n if (friend.location) {\n const locationLine = container.appendChild(renderDom.createElement('div'))\n locationLine.className = 'social-friend-location'\n locationLine.innerHTML = `${locationIcon} ${friend.location}`\n }\n\n if (!container.childNodes.length) return null\n\n return container\n }\n\n const renderNameSuffix: FriendRowRenderers['renderNameSuffix'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n const pronouns = friend.pronouns\n if (!pronouns) return null\n\n const suffix = renderDom.createElement('span')\n suffix.className = 'social-friend-pronouns'\n suffix.textContent = `(${pronouns})`\n return suffix\n }\n\n let mutualSection = me && !thisIsYou\n ? createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n : {\n section: dom.createElement('section'),\n content: dom.createElement('div'),\n refreshMutualFriends: function () {}\n }\n\n let mutualFriends = mutualSection.section\n let mutualContent = mutualSection.content\n if (!mutualFriends.className) {\n mutualFriends.className = 'social-pane__mutual-friends social-primary__panel'\n mutualFriends.id = 'social-panel-mutual'\n mutualFriends.setAttribute('role', 'tabpanel')\n mutualFriends.setAttribute('aria-labelledby', 'social-tab-mutual')\n mutualContent.className = 'social-main social-main--mutual'\n mutualFriends.appendChild(mutualContent)\n }\n primary.appendChild(mutualFriends)\n\n const allFriendsSection = createAllFriendsSection({\n dom,\n subject: s,\n profile: canModifyFriendsTab ? profile : null,\n editable: canModifyFriendsTab,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n const allFriends = allFriendsSection.section\n const friendsList = allFriendsSection.friendsList\n primary.appendChild(allFriends)\n\n let requestsTriage: FriendshipTriage = triageFriends(kb, s)\n const requestsSection = createRequestsSection({\n dom,\n triage: requestsTriage,\n renderSupportingInfo,\n renderNameSuffix\n })\n const requestsPanel = requestsSection.section\n primary.appendChild(requestsPanel)\n\n const requestsTab = tabs.appendChild(dom.createElement('button'))\n requestsTab.className = 'social-primary__tab'\n requestsTab.type = 'button'\n requestsTab.id = 'social-tab-requests'\n requestsTab.textContent = 'Requests'\n requestsTab.setAttribute('role', 'tab')\n requestsTab.setAttribute('aria-controls', 'social-panel-requests')\n requestsTab.setAttribute('aria-selected', 'false')\n requestsTab.tabIndex = -1\n\n type SocialPanel = 'mutual' | 'all-friends' | 'requests'\n let activePanel: SocialPanel = 'all-friends'\n let showRequestsTab = viewerMode === 'owner'\n\n const setActivePanel = function (panel: SocialPanel) {\n activePanel = panel\n const showMutual = panel === 'mutual'\n const showAllFriends = panel === 'all-friends'\n const showRequests = showRequestsTab && panel === 'requests'\n mutualTab.classList.toggle('social-primary__tab--active', showMutual)\n mutualTab.setAttribute('aria-selected', String(showMutual))\n mutualTab.tabIndex = showMutual ? 0 : -1\n\n allFriendsTab.classList.toggle('social-primary__tab--active', showAllFriends)\n allFriendsTab.setAttribute('aria-selected', String(showAllFriends))\n allFriendsTab.tabIndex = showAllFriends ? 0 : -1\n\n requestsTab.classList.toggle('social-primary__tab--active', showRequests)\n requestsTab.setAttribute('aria-selected', String(showRequests))\n requestsTab.tabIndex = showRequests ? 0 : -1\n\n mutualFriends.classList.toggle('social-primary__panel--active', showMutual)\n mutualFriends.setAttribute('aria-hidden', String(!showMutual))\n\n allFriends.classList.toggle('social-primary__panel--active', showAllFriends)\n allFriends.setAttribute('aria-hidden', String(!showAllFriends))\n\n requestsPanel.classList.toggle('social-primary__panel--active', showRequests)\n requestsPanel.setAttribute('aria-hidden', String(!showRequests))\n requestsPanel.hidden = !showRequestsTab || !showRequests\n }\n const rebuildMutualSection = function () {\n if (!me || thisIsYou) return\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n\n const outgoingStatements = kb.statementsMatching(cme, knows, s)\n outgoing = outgoingStatements.length > 0\n\n const nextMutualSection = createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n mutualFriends.replaceWith(nextMutualSection.section)\n mutualSection = nextMutualSection\n mutualFriends = nextMutualSection.section\n mutualContent = nextMutualSection.content\n }\n\n refreshRelationshipUi = function () {\n rebuildMutualSection()\n headerControls = {\n ...headerControls,\n showAddFriendAction: shouldShowHeaderAddFriendAction(headerControls.viewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n requestsTriage = triageFriends(kb, s)\n requestsSection.refreshRequests(requestsTriage)\n setActivePanel(activePanel)\n }\n\n setActivePanel('all-friends')\n\n const applyViewerMode = function (mode: ViewerMode) {\n const showMutualTab = mode === 'authenticated' && !thisIsYou\n showRequestsTab = mode === 'owner'\n mutualTab.hidden = !showMutualTab\n requestsTab.hidden = !showRequestsTab\n if (!showRequestsTab && activePanel === 'requests') {\n setActivePanel('all-friends')\n return\n }\n setActivePanel('all-friends')\n }\n\n mutualTab.addEventListener('click', function () {\n setActivePanel('mutual')\n })\n\n allFriendsTab.addEventListener('click', function () {\n setActivePanel('all-friends')\n })\n\n requestsTab.addEventListener('click', function () {\n setActivePanel('requests')\n })\n\n const refreshFriendsList = function () {\n const refresh = (friendsList as HTMLTableElement & { refresh?: () => void }).refresh\n if (typeof refresh !== 'function') return\n\n refresh.call(friendsList)\n }\n\n const refreshMutualFriends = function () {\n mutualSection.refreshMutualFriends()\n }\n\n ;(async () => {\n try {\n for await (const streamedFriends of streamFriends(context, s)) {\n friendDetailsByUri.clear()\n streamedFriends.forEach(friend => {\n friendDetailsByUri.set(friend.url, friend)\n })\n refreshFriendsList()\n refreshMutualFriends()\n }\n } catch {\n // Keep the initial snapshot if async friend loading fails.\n }\n })()\n\n ;(async () => {\n try {\n requestsTriage = await loadFriendshipTriage(context, s)\n requestsSection.refreshRequests(requestsTriage)\n refreshFriendsList()\n refreshMutualFriends()\n } catch {\n // Keep the initial requests snapshot if additional loading fails.\n }\n })()\n\n // Older triage logic is preserved below as a reusable data helper.\n\n applyViewerMode('anonymous')\n\n authn.checkUser()\n .then(webId => {\n const confirmedViewerMode = getViewerMode(s, webId)\n applyViewerMode(confirmedViewerMode)\n const confirmedCanEditOwnedProfile = confirmedViewerMode === 'owner' && editable\n headerControls = {\n ...headerControls,\n canEdit: confirmedCanEditOwnedProfile,\n viewerMode: confirmedViewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(confirmedViewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n .catch(() => {\n applyViewerMode('anonymous')\n headerControls = {\n ...headerControls,\n canEdit: false,\n viewerMode: 'anonymous',\n showAddFriendAction: false\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n\n return socialPane\n } // render()\n} //\n// ends\n// ***************** Social Pane Selectors **********/\n/* Should move to another file, but will leave for now */\n/* Will create a social pane folder or maybe repo later */\n\nconst FRIEND_BATCH_SIZE = 3\n\nexport interface ProfileDetails {\n url: string\n imageUrl?: string\n name?: string\n nickname?: string\n jobTitle?: string\n organization?: string\n location?: string | null\n pronouns?: string\n birthdate?: string\n}\n\nexport interface FriendDetails extends ProfileDetails {\n subjectNode: NamedNode\n}\n\n/* pronounsAsText and formatLocation were copied from HeadingSection selectors */\nexport function pronounsAsText (store: LiveStore, subject: NamedNode): string {\n let pronouns = store.anyJS(subject, ns.solid('preferredSubjectPronoun')) || ''\n if (pronouns) {\n const them = store.anyJS(subject, ns.solid('preferredObjectPronoun'))\n if (them) {\n pronouns += '/' + them\n }\n }\n return pronouns || ''\n}\n\nfunction formatLocation (countryName: string | void, locality: string | void) {\n return countryName && locality\n ? `${locality}, ${countryName}`\n : countryName || locality || null\n}\n\nfunction toFriendDetails (store: any, friendNode: NamedNode): FriendDetails {\n const name =\n store.anyValue(friendNode, ns.vcard('fn')) ||\n store.anyValue(friendNode, ns.foaf('name')) ||\n null\n const nickname =\n store.anyValue(friendNode, ns.vcard('nickname')) ||\n store.anyValue(friendNode, ns.foaf('nick')) ||\n null\n const dateOfBirth = store.anyValue(friendNode, ns.vcard('bday')) || null\n const imageSrc = widgets.findImage(friendNode)\n const jobTitle = store.anyValue(friendNode, ns.vcard('role')) || null\n const orgName = store.anyValue(friendNode, ns.vcard('organization-name')) || null\n const primaryAddressEntryNode = store.any(friendNode, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : null\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : null\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, friendNode)\n\n return {\n url: friendNode.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns,\n subjectNode: friendNode\n }\n}\n\nexport async function * streamFriends (\n context: DataBrowserContext,\n subject: NamedNode,\n batchSize = FRIEND_BATCH_SIZE\n): AsyncGenerator<FriendDetails[], void, void> {\n const store = context.session.store\n const fetcher = (store as any)?.fetcher\n\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(subject.doc())\n } catch {\n // Continue with whatever is already in the store.\n }\n }\n\n const seen = new Set<string>()\n const friendNodes = store.each(subject, ns.foaf('knows'), null, subject.doc())\n const uniqueFriendNodes: NamedNode[] = []\n\n for (const friendNode of friendNodes) {\n const key = friendNode?.value\n if (!key || seen.has(key) || subject.value === key) continue\n seen.add(key)\n uniqueFriendNodes.push(friendNode as NamedNode)\n }\n\n const friends: FriendDetails[] = []\n\n for (const friendNode of uniqueFriendNodes) {\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(friendNode.doc())\n } catch {\n // Keep partial friend data when one linked document fails to load.\n }\n }\n\n friends.push(toFriendDetails(store, friendNode))\n\n if (friends.length % batchSize === 0) {\n yield [...friends]\n }\n }\n\n if (friends.length > 0 && friends.length % batchSize !== 0) {\n yield [...friends]\n }\n}\n\nexport async function extractFriends (context: DataBrowserContext, subject: NamedNode): Promise<FriendDetails[] | null> {\n let latestFriends: FriendDetails[] | null = null\n\n for await (const friends of streamFriends(context, subject)) {\n latestFriends = friends\n }\n\n return latestFriends\n}\n\nexport function selectProfileData (context: DataBrowserContext, subject: NamedNode): ProfileDetails | null {\n const store = context.session.store\n\n const name =\n store.anyValue(subject, ns.vcard('fn')) ||\n store.anyValue(subject, ns.foaf('name')) ||\n undefined\n const nickname =\n store.anyValue(subject, ns.vcard('nickname')) ||\n store.anyValue(subject, ns.foaf('nick')) ||\n undefined\n const dateOfBirth = store.anyValue(subject, ns.vcard('bday')) || undefined\n const imageSrc = widgets.findImage(subject)\n const jobTitle = store.anyValue(subject, ns.vcard('role')) || undefined\n const orgName = store.anyValue(subject, ns.vcard('organization-name')) || undefined\n const primaryAddressEntryNode = store.any(subject, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : undefined\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : undefined\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, subject)\n return {\n url: subject.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns\n }\n}\n\nexport type { ViewerMode } from './socialSections'\n\nfunction getViewerMode (subject: NamedNode, currentUser: unknown = authn.currentUser()): ViewerMode {\n const currentUserUri =\n typeof currentUser === 'string'\n ? currentUser\n : typeof currentUser === 'object' && currentUser !== null\n ? ((currentUser as { value?: string, uri?: string }).value ||\n (currentUser as { value?: string, uri?: string }).uri ||\n null)\n : null\n let mode: ViewerMode = 'anonymous'\n if (currentUserUri === subject.value) mode = 'owner'\n if (currentUserUri && currentUserUri !== subject.value) mode = 'authenticated'\n return mode\n}\n"],"mappings":"sLA4BA,SAASiB,EACP,EACA,EACM,CACN,IAAMC,EAASC,EAAQ,aAAa,QAAU,UACxCC,EAAQD,EAAQ,aAAa,OAAS,QACtCE,EAAYF,EAAQ,aAAa,WAAa,UAEpDG,EAAQ,UAAU,IAAI,kBAAkB,EACxC,E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,EACd,UAAWH,EACX,WACA,UACF,CACF,CAIA,SAAS9E,EAAe,EAAoB,EAAuBtE,EAAAA,MAAM,YAAY,EAAe,CAClG,IAAM8J,EACJ,OAAOC,GAAgB,SACnBA,EACA,OAAOA,GAAgB,UAAYA,IAC/BA,EAAiD,OAChDA,EAAiD,MAEpD,KACJzE,EAAmB,YAGvB,OAFIwE,IAAmBvI,EAAQ,QAAO,EAAO,SACzCuI,GAAkBA,IAAmBvI,EAAQ,QAAO,EAAO,iBACxD+D,CACT"}
|
|
@@ -27,7 +27,7 @@ var p = {
|
|
|
27
27
|
return n;
|
|
28
28
|
}, m = function(e) {
|
|
29
29
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
30
|
-
for (let r of e)
|
|
30
|
+
for (let r of e) r?.value && !t.has(r.value) && (t.add(r.value), n.push(r));
|
|
31
31
|
return n;
|
|
32
32
|
}, h = function(e, t) {
|
|
33
33
|
if (!t) return e;
|
|
@@ -106,7 +106,7 @@ var p = {
|
|
|
106
106
|
(function(e) {
|
|
107
107
|
let t = /* @__PURE__ */ new Map();
|
|
108
108
|
e.forEach((e) => {
|
|
109
|
-
|
|
109
|
+
e?.value && e.value !== s.value && t.set(e.value, g(y, e));
|
|
110
110
|
}), z.clear(), t.forEach((e, t) => {
|
|
111
111
|
z.set(t, e);
|
|
112
112
|
});
|
|
@@ -291,7 +291,7 @@ async function* ne(e, t, n = te) {
|
|
|
291
291
|
let a = /* @__PURE__ */ new Set(), o = r.each(t, l.foaf("knows"), null, t.doc()), s = [];
|
|
292
292
|
for (let e of o) {
|
|
293
293
|
let n = e?.value;
|
|
294
|
-
|
|
294
|
+
n && !a.has(n) && t.value !== n && (a.add(n), s.push(e));
|
|
295
295
|
}
|
|
296
296
|
let c = [];
|
|
297
297
|
for (let e of s) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socialPane2.esm.js","names":[],"sources":["../../src/social/socialPane.ts"],"sourcesContent":["/* Social Pane\n **\n ** This outline pane provides social network functions\n ** Using for example the FOAF ontology.\n ** Goal: A *distributed* version of facebook, advogato, etc etc\n ** - Similarly easy user interface, but data storage distributed\n ** - Read and write both user-private (address book) and public data clearly\n ** -- todo: use common code to get username and load profile and set 'me'\n */\n\nimport './socialPane.css'\nimport { icons, utils, ns, log, widgets } from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport { LiveStore, NamedNode, Statement } from 'rdflib'\nimport { DataBrowserContext } from 'pane-registry'\nimport { locationIcon } from './icons'\nimport {\n createAllFriendsSection,\n createHeaderSection,\n FriendRowRenderers,\n createMutualSection,\n createRequestsSection,\n HeaderControls,\n SocialHeaderElement\n} from './socialSections'\nimport type { ViewerMode } from './socialSections'\nimport { FriendshipTriage, loadFriendshipTriage, triageFriends } from './triage'\n\nfunction applyEnvironmentAttributes (\n element: HTMLElement,\n context: DataBrowserContext\n): void {\n const layout = context.environment?.layout ?? 'desktop'\n const theme = context.environment?.theme ?? 'light'\n const inputMode = context.environment?.inputMode ?? 'pointer'\n\n element.classList.add('social-pane-host')\n element.dataset.layout = layout\n element.dataset.theme = theme\n element.dataset.inputMode = inputMode\n}\n\nexport const socialPane = {\n icon: icons.originalIconBase + 'foaf/foafTiny.gif',\n\n name: 'social',\n\n label: function (subject, context) {\n const kb = context.session.store\n const types = kb.findTypeURIs(subject)\n if (\n types[ns.foaf('Person').uri] ||\n types[ns.vcard('Individual').uri]\n ) {\n return 'Friends'\n }\n return null\n },\n global: false,\n\n render: function (s, context) {\n const dom = context.dom\n const common = function (x: NamedNode[], y: NamedNode[]) {\n // Find common members of two lists\n const both: NamedNode[] = []\n for (let i = 0; i < x.length; i++) {\n for (let j = 0; j < y.length; j++) {\n if (y[j].sameTerm(x[i])) {\n both.push(y[j])\n break\n }\n }\n }\n return both\n }\n\n const uniqueNodes = function (nodes: NamedNode[]) {\n const seen = new Set<string>()\n const unique: NamedNode[] = []\n for (const node of nodes) {\n if (!node?.value || seen.has(node.value)) continue\n seen.add(node.value)\n unique.push(node)\n }\n return unique\n }\n\n const link = function (contents: Node, uri: string | null | undefined) {\n if (!uri) return contents\n const a = dom.createElement('a')\n a.setAttribute('href', uri)\n a.appendChild(contents)\n return a\n }\n\n const text = function (str: string) {\n return dom.createTextNode(str)\n }\n\n let refreshRelationshipUi = function () {}\n\n const buildCheckboxForm = function (\n lab: string | Node,\n statement: Statement,\n state: boolean,\n options: { disabled?: boolean, disabledTitle?: string } = {}\n ) {\n const f = dom.createElement('form')\n const label = dom.createElement('label')\n const input = dom.createElement('input')\n const tx = dom.createElement('span')\n tx.className = 'question'\n if (typeof lab === 'string') {\n tx.textContent = lab\n } else {\n tx.appendChild(lab)\n }\n input.setAttribute('type', 'checkbox')\n if (options.disabled) {\n input.disabled = true\n if (options.disabledTitle) {\n input.title = options.disabledTitle\n input.setAttribute('aria-label', options.disabledTitle)\n }\n }\n label.appendChild(tx)\n label.appendChild(input)\n f.appendChild(label)\n const boxHandler = function (this: HTMLInputElement, _e: Event) {\n if (this.checked) {\n try {\n outliner.UserInput.sparqler.insert_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while inserting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = false // rollback UI\n return\n }\n kb.add(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n })\n } catch (e) {\n log.error('Data write fails:' + e)\n log.alert('Data write fails:' + e)\n input.checked = false // rollback UI\n tx.className = 'question'\n }\n } else {\n try {\n outliner.UserInput.sparqler.delete_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while deleting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = true // Rollback UI\n } else {\n kb.removeMany(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n }\n })\n } catch (e) {\n log.alert('Delete fails:' + e)\n input.checked = true // Rollback UI\n // return\n }\n }\n }\n input.checked = state\n input.addEventListener('click', boxHandler, false)\n return f\n }\n\n // ////////// Body of render():\n\n const outliner = context.getOutliner(dom)\n const kb = context.session.store\n const socialPane = dom.createElement('div')\n socialPane.classList.add('social-pane', 'flex-column', 'gap-xxs')\n applyEnvironmentAttributes(socialPane, context)\n const foaf = ns.foaf\n const vcard = ns.vcard\n const me = authn.currentUser()\n const meUri = me ? me.uri : null\n\n const thisIsYou = me && kb.sameThings(me, s)\n\n const knows = foaf('knows')\n // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')\n const familiar =\n kb.anyValue(s, foaf('givenname')) ||\n kb.anyValue(s, foaf('firstName')) ||\n kb.anyValue(s, foaf('nick')) ||\n kb.anyValue(s, foaf('name')) ||\n kb.anyValue(s, vcard('fn'))\n const friends = kb.each(s, knows)\n const uniqueFriends = uniqueNodes(friends as NamedNode[])\n const myFriends = me ? uniqueNodes(kb.each(me, foaf('knows')) as NamedNode[]) : []\n const mutualConnections = me && !thisIsYou\n ? uniqueNodes(common(uniqueFriends, myFriends)).filter(friend => !kb.sameThings(friend, me))\n : []\n const mutualFriendCount = me && !thisIsYou ? mutualConnections.length : null\n const viewerMode = getViewerMode(s, me)\n\n // Do I have a public profile document?\n let profile: NamedNode | null = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }\n let editable = false\n let incoming: boolean | NamedNode[] = false\n let outgoing: boolean | NamedNode[] = false\n\n const structure = socialPane.appendChild(dom.createElement('div'))\n structure.className = 'social-layout'\n const primary = structure.appendChild(dom.createElement('div'))\n primary.className = 'social-primary'\n\n const tabs = primary.appendChild(dom.createElement('div'))\n tabs.classList.add('social-primary__tabs', 'flex-center')\n tabs.setAttribute('role', 'tablist')\n tabs.setAttribute('aria-label', 'Social sections')\n\n const allFriendsTab = tabs.appendChild(dom.createElement('button'))\n allFriendsTab.className = 'social-primary__tab'\n allFriendsTab.type = 'button'\n allFriendsTab.id = 'social-tab-all-friends'\n allFriendsTab.textContent = 'All Friends'\n allFriendsTab.setAttribute('role', 'tab')\n allFriendsTab.setAttribute('aria-controls', 'social-panel-all-friends')\n allFriendsTab.setAttribute('aria-selected', 'true')\n allFriendsTab.tabIndex = 0\n\n const mutualTab = tabs.appendChild(dom.createElement('button'))\n mutualTab.className = 'social-primary__tab'\n mutualTab.type = 'button'\n mutualTab.id = 'social-tab-mutual'\n mutualTab.textContent = 'Mutual'\n mutualTab.setAttribute('role', 'tab')\n mutualTab.setAttribute('aria-controls', 'social-panel-mutual')\n mutualTab.setAttribute('aria-selected', 'false')\n mutualTab.tabIndex = -1\n\n if (me) {\n // The definition of FOAF personal profile document is ..\n const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic\n let message = ''\n for (let i = 0; i < works.length; i++) {\n if (\n kb.whether(\n works[i],\n ns.rdf('type'),\n foaf('PersonalProfileDocument')\n )\n ) {\n const doc = works[i]\n editable = outliner.UserInput.sparqler.editable(doc.uri, kb)\n if (!editable) {\n message +=\n 'Your profile <' +\n utils.escapeForXML(doc.uri) +\n '> is not remotely editable.'\n } else {\n profile = doc\n break\n }\n }\n }\n\n /*\n if (!profile) {\n say(\n message + '\\nI couldn\\'t find your editable personal profile document.'\n )\n } else {\n say('Editing your profile ' + profile + '.')\n editable = outliner.UserInput.sparqler.editable(profile.uri, kb)\n }\n */\n\n if (thisIsYou) {\n // This is about me\n // pass... @@\n } else {\n // This is about someone else\n // My relationship with this person\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n outgoing = false\n const outgoingSt = kb.statementsMatching(cme, knows, s)\n if (outgoingSt.length) {\n outgoing = true\n if (!profile) profile = outgoingSt[0].why\n }\n } // About someone else\n } // me is defined\n // End of you and s\n\n const shouldShowHeaderAddFriendAction = (mode: ViewerMode) => {\n return mode === 'authenticated' && !thisIsYou && !outgoing\n }\n\n const canEditOwnedProfile = viewerMode === 'owner' && editable\n const canManageRelationship = viewerMode === 'authenticated' && !thisIsYou && editable && Boolean(profile)\n const canModifyFriendsTab = canEditOwnedProfile\n\n let headerControls: HeaderControls = {\n canEdit: canEditOwnedProfile,\n viewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(viewerMode)\n }\n\n const header = createHeaderSection(context, s, headerControls, {\n friendCount: uniqueFriends.length,\n mutualFriendCount,\n onSelectFriends: function () {\n setActivePanel('all-friends')\n },\n onSelectMutual: typeof mutualFriendCount === 'number'\n ? function () {\n setActivePanel('mutual')\n }\n : undefined\n }, function () {\n return selectProfileData(context, s)\n })\n header.classList.add('social-pane__header-section', 'flex-column')\n socialPane.prepend(header)\n\n // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))\n\n // ///////////////////////////////////////////// Main block\n //\n // Should: Find the intersection and difference sets\n\n const friendDetailsByUri = new Map<string, FriendDetails>()\n\n const hydrateFriendDetailsCache = function (friendNodes: NamedNode[]) {\n const nextCache = new Map<string, FriendDetails>()\n\n friendNodes.forEach(friendNode => {\n if (!friendNode?.value || friendNode.value === s.value) return\n nextCache.set(friendNode.value, toFriendDetails(kb, friendNode))\n })\n\n friendDetailsByUri.clear()\n nextCache.forEach((value, key) => {\n friendDetailsByUri.set(key, value)\n })\n }\n\n hydrateFriendDetailsCache(uniqueFriends)\n\n const renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n\n const container = renderDom.createElement('div')\n const jobAndOrganization = [friend.jobTitle, friend.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = container.appendChild(renderDom.createElement('div'))\n jobLine.className = 'social-friend-job-org'\n jobLine.textContent = jobAndOrganization\n }\n\n if (friend.location) {\n const locationLine = container.appendChild(renderDom.createElement('div'))\n locationLine.className = 'social-friend-location'\n locationLine.innerHTML = `${locationIcon} ${friend.location}`\n }\n\n if (!container.childNodes.length) return null\n\n return container\n }\n\n const renderNameSuffix: FriendRowRenderers['renderNameSuffix'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n const pronouns = friend.pronouns\n if (!pronouns) return null\n\n const suffix = renderDom.createElement('span')\n suffix.className = 'social-friend-pronouns'\n suffix.textContent = `(${pronouns})`\n return suffix\n }\n\n let mutualSection = me && !thisIsYou\n ? createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n : {\n section: dom.createElement('section'),\n content: dom.createElement('div'),\n refreshMutualFriends: function () {}\n }\n\n let mutualFriends = mutualSection.section\n let mutualContent = mutualSection.content\n if (!mutualFriends.className) {\n mutualFriends.className = 'social-pane__mutual-friends social-primary__panel'\n mutualFriends.id = 'social-panel-mutual'\n mutualFriends.setAttribute('role', 'tabpanel')\n mutualFriends.setAttribute('aria-labelledby', 'social-tab-mutual')\n mutualContent.className = 'social-main social-main--mutual'\n mutualFriends.appendChild(mutualContent)\n }\n primary.appendChild(mutualFriends)\n\n const allFriendsSection = createAllFriendsSection({\n dom,\n subject: s,\n profile: canModifyFriendsTab ? profile : null,\n editable: canModifyFriendsTab,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n const allFriends = allFriendsSection.section\n const friendsList = allFriendsSection.friendsList\n primary.appendChild(allFriends)\n\n let requestsTriage: FriendshipTriage = triageFriends(kb, s)\n const requestsSection = createRequestsSection({\n dom,\n triage: requestsTriage,\n renderSupportingInfo,\n renderNameSuffix\n })\n const requestsPanel = requestsSection.section\n primary.appendChild(requestsPanel)\n\n const requestsTab = tabs.appendChild(dom.createElement('button'))\n requestsTab.className = 'social-primary__tab'\n requestsTab.type = 'button'\n requestsTab.id = 'social-tab-requests'\n requestsTab.textContent = 'Requests'\n requestsTab.setAttribute('role', 'tab')\n requestsTab.setAttribute('aria-controls', 'social-panel-requests')\n requestsTab.setAttribute('aria-selected', 'false')\n requestsTab.tabIndex = -1\n\n type SocialPanel = 'mutual' | 'all-friends' | 'requests'\n let activePanel: SocialPanel = 'all-friends'\n let showRequestsTab = viewerMode === 'owner'\n\n const setActivePanel = function (panel: SocialPanel) {\n activePanel = panel\n const showMutual = panel === 'mutual'\n const showAllFriends = panel === 'all-friends'\n const showRequests = showRequestsTab && panel === 'requests'\n mutualTab.classList.toggle('social-primary__tab--active', showMutual)\n mutualTab.setAttribute('aria-selected', String(showMutual))\n mutualTab.tabIndex = showMutual ? 0 : -1\n\n allFriendsTab.classList.toggle('social-primary__tab--active', showAllFriends)\n allFriendsTab.setAttribute('aria-selected', String(showAllFriends))\n allFriendsTab.tabIndex = showAllFriends ? 0 : -1\n\n requestsTab.classList.toggle('social-primary__tab--active', showRequests)\n requestsTab.setAttribute('aria-selected', String(showRequests))\n requestsTab.tabIndex = showRequests ? 0 : -1\n\n mutualFriends.classList.toggle('social-primary__panel--active', showMutual)\n mutualFriends.setAttribute('aria-hidden', String(!showMutual))\n\n allFriends.classList.toggle('social-primary__panel--active', showAllFriends)\n allFriends.setAttribute('aria-hidden', String(!showAllFriends))\n\n requestsPanel.classList.toggle('social-primary__panel--active', showRequests)\n requestsPanel.setAttribute('aria-hidden', String(!showRequests))\n requestsPanel.hidden = !showRequestsTab || !showRequests\n }\n const rebuildMutualSection = function () {\n if (!me || thisIsYou) return\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n\n const outgoingStatements = kb.statementsMatching(cme, knows, s)\n outgoing = outgoingStatements.length > 0\n\n const nextMutualSection = createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n mutualFriends.replaceWith(nextMutualSection.section)\n mutualSection = nextMutualSection\n mutualFriends = nextMutualSection.section\n mutualContent = nextMutualSection.content\n }\n\n refreshRelationshipUi = function () {\n rebuildMutualSection()\n headerControls = {\n ...headerControls,\n showAddFriendAction: shouldShowHeaderAddFriendAction(headerControls.viewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n requestsTriage = triageFriends(kb, s)\n requestsSection.refreshRequests(requestsTriage)\n setActivePanel(activePanel)\n }\n\n setActivePanel('all-friends')\n\n const applyViewerMode = function (mode: ViewerMode) {\n const showMutualTab = mode === 'authenticated' && !thisIsYou\n showRequestsTab = mode === 'owner'\n mutualTab.hidden = !showMutualTab\n requestsTab.hidden = !showRequestsTab\n if (!showRequestsTab && activePanel === 'requests') {\n setActivePanel('all-friends')\n return\n }\n setActivePanel('all-friends')\n }\n\n mutualTab.addEventListener('click', function () {\n setActivePanel('mutual')\n })\n\n allFriendsTab.addEventListener('click', function () {\n setActivePanel('all-friends')\n })\n\n requestsTab.addEventListener('click', function () {\n setActivePanel('requests')\n })\n\n const refreshFriendsList = function () {\n const refresh = (friendsList as HTMLTableElement & { refresh?: () => void }).refresh\n if (typeof refresh !== 'function') return\n\n refresh.call(friendsList)\n }\n\n const refreshMutualFriends = function () {\n mutualSection.refreshMutualFriends()\n }\n\n ;(async () => {\n try {\n for await (const streamedFriends of streamFriends(context, s)) {\n friendDetailsByUri.clear()\n streamedFriends.forEach(friend => {\n friendDetailsByUri.set(friend.url, friend)\n })\n refreshFriendsList()\n refreshMutualFriends()\n }\n } catch {\n // Keep the initial snapshot if async friend loading fails.\n }\n })()\n\n ;(async () => {\n try {\n requestsTriage = await loadFriendshipTriage(context, s)\n requestsSection.refreshRequests(requestsTriage)\n refreshFriendsList()\n refreshMutualFriends()\n } catch {\n // Keep the initial requests snapshot if additional loading fails.\n }\n })()\n\n // Older triage logic is preserved below as a reusable data helper.\n\n applyViewerMode('anonymous')\n\n authn.checkUser()\n .then(webId => {\n const confirmedViewerMode = getViewerMode(s, webId)\n applyViewerMode(confirmedViewerMode)\n const confirmedCanEditOwnedProfile = confirmedViewerMode === 'owner' && editable\n headerControls = {\n ...headerControls,\n canEdit: confirmedCanEditOwnedProfile,\n viewerMode: confirmedViewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(confirmedViewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n .catch(() => {\n applyViewerMode('anonymous')\n headerControls = {\n ...headerControls,\n canEdit: false,\n viewerMode: 'anonymous',\n showAddFriendAction: false\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n\n return socialPane\n } // render()\n} //\n// ends\n// ***************** Social Pane Selectors **********/\n/* Should move to another file, but will leave for now */\n/* Will create a social pane folder or maybe repo later */\n\nconst FRIEND_BATCH_SIZE = 3\n\nexport interface ProfileDetails {\n url: string\n imageUrl?: string\n name?: string\n nickname?: string\n jobTitle?: string\n organization?: string\n location?: string | null\n pronouns?: string\n birthdate?: string\n}\n\nexport interface FriendDetails extends ProfileDetails {\n subjectNode: NamedNode\n}\n\n/* pronounsAsText and formatLocation were copied from HeadingSection selectors */\nexport function pronounsAsText (store: LiveStore, subject: NamedNode): string {\n let pronouns = store.anyJS(subject, ns.solid('preferredSubjectPronoun')) || ''\n if (pronouns) {\n const them = store.anyJS(subject, ns.solid('preferredObjectPronoun'))\n if (them) {\n pronouns += '/' + them\n }\n }\n return pronouns || ''\n}\n\nfunction formatLocation (countryName: string | void, locality: string | void) {\n return countryName && locality\n ? `${locality}, ${countryName}`\n : countryName || locality || null\n}\n\nfunction toFriendDetails (store: any, friendNode: NamedNode): FriendDetails {\n const name =\n store.anyValue(friendNode, ns.vcard('fn')) ||\n store.anyValue(friendNode, ns.foaf('name')) ||\n null\n const nickname =\n store.anyValue(friendNode, ns.vcard('nickname')) ||\n store.anyValue(friendNode, ns.foaf('nick')) ||\n null\n const dateOfBirth = store.anyValue(friendNode, ns.vcard('bday')) || null\n const imageSrc = widgets.findImage(friendNode)\n const jobTitle = store.anyValue(friendNode, ns.vcard('role')) || null\n const orgName = store.anyValue(friendNode, ns.vcard('organization-name')) || null\n const primaryAddressEntryNode = store.any(friendNode, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : null\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : null\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, friendNode)\n\n return {\n url: friendNode.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns,\n subjectNode: friendNode\n }\n}\n\nexport async function * streamFriends (\n context: DataBrowserContext,\n subject: NamedNode,\n batchSize = FRIEND_BATCH_SIZE\n): AsyncGenerator<FriendDetails[], void, void> {\n const store = context.session.store\n const fetcher = (store as any)?.fetcher\n\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(subject.doc())\n } catch {\n // Continue with whatever is already in the store.\n }\n }\n\n const seen = new Set<string>()\n const friendNodes = store.each(subject, ns.foaf('knows'), null, subject.doc())\n const uniqueFriendNodes: NamedNode[] = []\n\n for (const friendNode of friendNodes) {\n const key = friendNode?.value\n if (!key || seen.has(key) || subject.value === key) continue\n seen.add(key)\n uniqueFriendNodes.push(friendNode as NamedNode)\n }\n\n const friends: FriendDetails[] = []\n\n for (const friendNode of uniqueFriendNodes) {\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(friendNode.doc())\n } catch {\n // Keep partial friend data when one linked document fails to load.\n }\n }\n\n friends.push(toFriendDetails(store, friendNode))\n\n if (friends.length % batchSize === 0) {\n yield [...friends]\n }\n }\n\n if (friends.length > 0 && friends.length % batchSize !== 0) {\n yield [...friends]\n }\n}\n\nexport async function extractFriends (context: DataBrowserContext, subject: NamedNode): Promise<FriendDetails[] | null> {\n let latestFriends: FriendDetails[] | null = null\n\n for await (const friends of streamFriends(context, subject)) {\n latestFriends = friends\n }\n\n return latestFriends\n}\n\nexport function selectProfileData (context: DataBrowserContext, subject: NamedNode): ProfileDetails | null {\n const store = context.session.store\n\n const name =\n store.anyValue(subject, ns.vcard('fn')) ||\n store.anyValue(subject, ns.foaf('name')) ||\n undefined\n const nickname =\n store.anyValue(subject, ns.vcard('nickname')) ||\n store.anyValue(subject, ns.foaf('nick')) ||\n undefined\n const dateOfBirth = store.anyValue(subject, ns.vcard('bday')) || undefined\n const imageSrc = widgets.findImage(subject)\n const jobTitle = store.anyValue(subject, ns.vcard('role')) || undefined\n const orgName = store.anyValue(subject, ns.vcard('organization-name')) || undefined\n const primaryAddressEntryNode = store.any(subject, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : undefined\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : undefined\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, subject)\n return {\n url: subject.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns\n }\n}\n\nexport type { ViewerMode } from './socialSections'\n\nfunction getViewerMode (subject: NamedNode, currentUser: unknown = authn.currentUser()): ViewerMode {\n const currentUserUri =\n typeof currentUser === 'string'\n ? currentUser\n : typeof currentUser === 'object' && currentUser !== null\n ? ((currentUser as { value?: string, uri?: string }).value ||\n (currentUser as { value?: string, uri?: string }).uri ||\n null)\n : null\n let mode: ViewerMode = 'anonymous'\n if (currentUserUri === subject.value) mode = 'owner'\n if (currentUserUri && currentUserUri !== subject.value) mode = 'authenticated'\n return mode\n}\n"],"mappings":";;;;;;;AA4BA,SAAS,GACP,GACA,GACM;CACN,IAAM,IAAS,EAAQ,aAAa,UAAU,WACxC,IAAQ,EAAQ,aAAa,SAAS,SACtC,IAAY,EAAQ,aAAa,aAAa;CAKpD,AAHA,EAAQ,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AAoB,IAAuB,EAAM,YAAY,GAAe;CAClG,IAAM,IACJ,OAAO,KAAgB,WACnB,IACA,OAAO,KAAgB,YAAY,MAC/B,EAAiD,SAChD,EAAiD,QAEpD,MACJ,IAAmB;CAGvB,OAFI,MAAmB,EAAQ,UAAO,IAAO,UACzC,KAAkB,MAAmB,EAAQ,UAAO,IAAO,kBACxD;AACT"}
|
|
1
|
+
{"version":3,"file":"socialPane2.esm.js","names":["applyEnvironmentAttributes","layout","context","theme","inputMode","element","socialPane","icons","types","subject","ns","dom","common","both","i","x","j","y","uniqueNodes","seen","unique","node","nodes","link","uri","contents","a","text","str","refreshRelationshipUi","buildCheckboxForm","f","label","input","tx","lab","options","state","statement","success","log","errorBody","kb","outliner","foaf","vcard","me","authn","meUri","thisIsYou","knows","familiar","uniqueFriends","myFriends","mutualConnections","friend","mutualFriendCount","viewerMode","getViewerMode","profile","editable","incoming","outgoing","structure","primary","tabs","allFriendsTab","mutualTab","works","message","doc","utils","cme","outgoingSt","shouldShowHeaderAddFriendAction","mode","canEditOwnedProfile","canManageRelationship","canModifyFriendsTab","headerControls","header","createHeaderSection","selectProfileData","friendDetailsByUri","nextCache","friendNodes","friendNode","toFriendDetails","key","value","renderSupportingInfo","target","container","renderDom","jobAndOrganization","jobLine","locationLine","locationIcon","renderNameSuffix","pronouns","suffix","mutualSection","createMutualSection","mutualFriends","mutualContent","allFriendsSection","createAllFriendsSection","allFriends","friendsList","requestsTriage","triageFriends","requestsSection","createRequestsSection","requestsPanel","requestsTab","activePanel","showRequestsTab","setActivePanel","panel","showMutual","showAllFriends","showRequests","rebuildMutualSection","nextMutualSection","applyViewerMode","showMutualTab","refreshFriendsList","refresh","refreshMutualFriends","streamedFriends","streamFriends","loadFriendshipTriage","confirmedViewerMode","webId","confirmedCanEditOwnedProfile","FRIEND_BATCH_SIZE","pronounsAsText","store","them","formatLocation","countryName","locality","name","nickname","dateOfBirth","imageSrc","widgets","jobTitle","orgName","address","location","fetcher","uniqueFriendNodes","friends","batchSize","currentUserUri","currentUser"],"sources":["../../src/social/socialPane.ts"],"sourcesContent":["/* Social Pane\n **\n ** This outline pane provides social network functions\n ** Using for example the FOAF ontology.\n ** Goal: A *distributed* version of facebook, advogato, etc etc\n ** - Similarly easy user interface, but data storage distributed\n ** - Read and write both user-private (address book) and public data clearly\n ** -- todo: use common code to get username and load profile and set 'me'\n */\n\nimport './socialPane.css'\nimport { icons, utils, ns, log, widgets } from 'solid-ui'\nimport { authn } from 'solid-logic'\nimport { LiveStore, NamedNode, Statement } from 'rdflib'\nimport { DataBrowserContext } from 'pane-registry'\nimport { locationIcon } from './icons'\nimport {\n createAllFriendsSection,\n createHeaderSection,\n FriendRowRenderers,\n createMutualSection,\n createRequestsSection,\n HeaderControls,\n SocialHeaderElement\n} from './socialSections'\nimport type { ViewerMode } from './socialSections'\nimport { FriendshipTriage, loadFriendshipTriage, triageFriends } from './triage'\n\nfunction applyEnvironmentAttributes (\n element: HTMLElement,\n context: DataBrowserContext\n): void {\n const layout = context.environment?.layout ?? 'desktop'\n const theme = context.environment?.theme ?? 'light'\n const inputMode = context.environment?.inputMode ?? 'pointer'\n\n element.classList.add('social-pane-host')\n element.dataset.layout = layout\n element.dataset.theme = theme\n element.dataset.inputMode = inputMode\n}\n\nexport const socialPane = {\n icon: icons.originalIconBase + 'foaf/foafTiny.gif',\n\n name: 'social',\n\n label: function (subject, context) {\n const kb = context.session.store\n const types = kb.findTypeURIs(subject)\n if (\n types[ns.foaf('Person').uri] ||\n types[ns.vcard('Individual').uri]\n ) {\n return 'Friends'\n }\n return null\n },\n global: false,\n\n render: function (s, context) {\n const dom = context.dom\n const common = function (x: NamedNode[], y: NamedNode[]) {\n // Find common members of two lists\n const both: NamedNode[] = []\n for (let i = 0; i < x.length; i++) {\n for (let j = 0; j < y.length; j++) {\n if (y[j].sameTerm(x[i])) {\n both.push(y[j])\n break\n }\n }\n }\n return both\n }\n\n const uniqueNodes = function (nodes: NamedNode[]) {\n const seen = new Set<string>()\n const unique: NamedNode[] = []\n for (const node of nodes) {\n if (!node?.value || seen.has(node.value)) continue\n seen.add(node.value)\n unique.push(node)\n }\n return unique\n }\n\n const link = function (contents: Node, uri: string | null | undefined) {\n if (!uri) return contents\n const a = dom.createElement('a')\n a.setAttribute('href', uri)\n a.appendChild(contents)\n return a\n }\n\n const text = function (str: string) {\n return dom.createTextNode(str)\n }\n\n let refreshRelationshipUi = function () {}\n\n const buildCheckboxForm = function (\n lab: string | Node,\n statement: Statement,\n state: boolean,\n options: { disabled?: boolean, disabledTitle?: string } = {}\n ) {\n const f = dom.createElement('form')\n const label = dom.createElement('label')\n const input = dom.createElement('input')\n const tx = dom.createElement('span')\n tx.className = 'question'\n if (typeof lab === 'string') {\n tx.textContent = lab\n } else {\n tx.appendChild(lab)\n }\n input.setAttribute('type', 'checkbox')\n if (options.disabled) {\n input.disabled = true\n if (options.disabledTitle) {\n input.title = options.disabledTitle\n input.setAttribute('aria-label', options.disabledTitle)\n }\n }\n label.appendChild(tx)\n label.appendChild(input)\n f.appendChild(label)\n const boxHandler = function (this: HTMLInputElement, _e: Event) {\n if (this.checked) {\n try {\n outliner.UserInput.sparqler.insert_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while inserting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = false // rollback UI\n return\n }\n kb.add(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n })\n } catch (e) {\n log.error('Data write fails:' + e)\n log.alert('Data write fails:' + e)\n input.checked = false // rollback UI\n tx.className = 'question'\n }\n } else {\n try {\n outliner.UserInput.sparqler.delete_statement(statement, function (\n uri,\n success,\n errorBody\n ) {\n tx.className = 'question'\n if (!success) {\n log.alert(\n 'Error occurs while deleting ' +\n statement +\n '\\n\\n' +\n errorBody\n )\n input.checked = true // Rollback UI\n } else {\n kb.removeMany(\n statement.subject,\n statement.predicate,\n statement.object,\n statement.why\n )\n refreshRelationshipUi()\n }\n })\n } catch (e) {\n log.alert('Delete fails:' + e)\n input.checked = true // Rollback UI\n // return\n }\n }\n }\n input.checked = state\n input.addEventListener('click', boxHandler, false)\n return f\n }\n\n // ////////// Body of render():\n\n const outliner = context.getOutliner(dom)\n const kb = context.session.store\n const socialPane = dom.createElement('div')\n socialPane.classList.add('social-pane', 'flex-column', 'gap-xxs')\n applyEnvironmentAttributes(socialPane, context)\n const foaf = ns.foaf\n const vcard = ns.vcard\n const me = authn.currentUser()\n const meUri = me ? me.uri : null\n\n const thisIsYou = me && kb.sameThings(me, s)\n\n const knows = foaf('knows')\n // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')\n const familiar =\n kb.anyValue(s, foaf('givenname')) ||\n kb.anyValue(s, foaf('firstName')) ||\n kb.anyValue(s, foaf('nick')) ||\n kb.anyValue(s, foaf('name')) ||\n kb.anyValue(s, vcard('fn'))\n const friends = kb.each(s, knows)\n const uniqueFriends = uniqueNodes(friends as NamedNode[])\n const myFriends = me ? uniqueNodes(kb.each(me, foaf('knows')) as NamedNode[]) : []\n const mutualConnections = me && !thisIsYou\n ? uniqueNodes(common(uniqueFriends, myFriends)).filter(friend => !kb.sameThings(friend, me))\n : []\n const mutualFriendCount = me && !thisIsYou ? mutualConnections.length : null\n const viewerMode = getViewerMode(s, me)\n\n // Do I have a public profile document?\n let profile: NamedNode | null = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }\n let editable = false\n let incoming: boolean | NamedNode[] = false\n let outgoing: boolean | NamedNode[] = false\n\n const structure = socialPane.appendChild(dom.createElement('div'))\n structure.className = 'social-layout'\n const primary = structure.appendChild(dom.createElement('div'))\n primary.className = 'social-primary'\n\n const tabs = primary.appendChild(dom.createElement('div'))\n tabs.classList.add('social-primary__tabs', 'flex-center')\n tabs.setAttribute('role', 'tablist')\n tabs.setAttribute('aria-label', 'Social sections')\n\n const allFriendsTab = tabs.appendChild(dom.createElement('button'))\n allFriendsTab.className = 'social-primary__tab'\n allFriendsTab.type = 'button'\n allFriendsTab.id = 'social-tab-all-friends'\n allFriendsTab.textContent = 'All Friends'\n allFriendsTab.setAttribute('role', 'tab')\n allFriendsTab.setAttribute('aria-controls', 'social-panel-all-friends')\n allFriendsTab.setAttribute('aria-selected', 'true')\n allFriendsTab.tabIndex = 0\n\n const mutualTab = tabs.appendChild(dom.createElement('button'))\n mutualTab.className = 'social-primary__tab'\n mutualTab.type = 'button'\n mutualTab.id = 'social-tab-mutual'\n mutualTab.textContent = 'Mutual'\n mutualTab.setAttribute('role', 'tab')\n mutualTab.setAttribute('aria-controls', 'social-panel-mutual')\n mutualTab.setAttribute('aria-selected', 'false')\n mutualTab.tabIndex = -1\n\n if (me) {\n // The definition of FOAF personal profile document is ..\n const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic\n let message = ''\n for (let i = 0; i < works.length; i++) {\n if (\n kb.whether(\n works[i],\n ns.rdf('type'),\n foaf('PersonalProfileDocument')\n )\n ) {\n const doc = works[i]\n editable = outliner.UserInput.sparqler.editable(doc.uri, kb)\n if (!editable) {\n message +=\n 'Your profile <' +\n utils.escapeForXML(doc.uri) +\n '> is not remotely editable.'\n } else {\n profile = doc\n break\n }\n }\n }\n\n /*\n if (!profile) {\n say(\n message + '\\nI couldn\\'t find your editable personal profile document.'\n )\n } else {\n say('Editing your profile ' + profile + '.')\n editable = outliner.UserInput.sparqler.editable(profile.uri, kb)\n }\n */\n\n if (thisIsYou) {\n // This is about me\n // pass... @@\n } else {\n // This is about someone else\n // My relationship with this person\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n outgoing = false\n const outgoingSt = kb.statementsMatching(cme, knows, s)\n if (outgoingSt.length) {\n outgoing = true\n if (!profile) profile = outgoingSt[0].why\n }\n } // About someone else\n } // me is defined\n // End of you and s\n\n const shouldShowHeaderAddFriendAction = (mode: ViewerMode) => {\n return mode === 'authenticated' && !thisIsYou && !outgoing\n }\n\n const canEditOwnedProfile = viewerMode === 'owner' && editable\n const canManageRelationship = viewerMode === 'authenticated' && !thisIsYou && editable && Boolean(profile)\n const canModifyFriendsTab = canEditOwnedProfile\n\n let headerControls: HeaderControls = {\n canEdit: canEditOwnedProfile,\n viewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(viewerMode)\n }\n\n const header = createHeaderSection(context, s, headerControls, {\n friendCount: uniqueFriends.length,\n mutualFriendCount,\n onSelectFriends: function () {\n setActivePanel('all-friends')\n },\n onSelectMutual: typeof mutualFriendCount === 'number'\n ? function () {\n setActivePanel('mutual')\n }\n : undefined\n }, function () {\n return selectProfileData(context, s)\n })\n header.classList.add('social-pane__header-section', 'flex-column')\n socialPane.prepend(header)\n\n // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))\n\n // ///////////////////////////////////////////// Main block\n //\n // Should: Find the intersection and difference sets\n\n const friendDetailsByUri = new Map<string, FriendDetails>()\n\n const hydrateFriendDetailsCache = function (friendNodes: NamedNode[]) {\n const nextCache = new Map<string, FriendDetails>()\n\n friendNodes.forEach(friendNode => {\n if (!friendNode?.value || friendNode.value === s.value) return\n nextCache.set(friendNode.value, toFriendDetails(kb, friendNode))\n })\n\n friendDetailsByUri.clear()\n nextCache.forEach((value, key) => {\n friendDetailsByUri.set(key, value)\n })\n }\n\n hydrateFriendDetailsCache(uniqueFriends)\n\n const renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n\n const container = renderDom.createElement('div')\n const jobAndOrganization = [friend.jobTitle, friend.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = container.appendChild(renderDom.createElement('div'))\n jobLine.className = 'social-friend-job-org'\n jobLine.textContent = jobAndOrganization\n }\n\n if (friend.location) {\n const locationLine = container.appendChild(renderDom.createElement('div'))\n locationLine.className = 'social-friend-location'\n locationLine.innerHTML = `${locationIcon} ${friend.location}`\n }\n\n if (!container.childNodes.length) return null\n\n return container\n }\n\n const renderNameSuffix: FriendRowRenderers['renderNameSuffix'] = function (target: NamedNode, renderDom: HTMLDocument) {\n const friend = friendDetailsByUri.get(target.value) || toFriendDetails(kb, target)\n friendDetailsByUri.set(target.value, friend)\n const pronouns = friend.pronouns\n if (!pronouns) return null\n\n const suffix = renderDom.createElement('span')\n suffix.className = 'social-friend-pronouns'\n suffix.textContent = `(${pronouns})`\n return suffix\n }\n\n let mutualSection = me && !thisIsYou\n ? createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n : {\n section: dom.createElement('section'),\n content: dom.createElement('div'),\n refreshMutualFriends: function () {}\n }\n\n let mutualFriends = mutualSection.section\n let mutualContent = mutualSection.content\n if (!mutualFriends.className) {\n mutualFriends.className = 'social-pane__mutual-friends social-primary__panel'\n mutualFriends.id = 'social-panel-mutual'\n mutualFriends.setAttribute('role', 'tabpanel')\n mutualFriends.setAttribute('aria-labelledby', 'social-tab-mutual')\n mutualContent.className = 'social-main social-main--mutual'\n mutualFriends.appendChild(mutualContent)\n }\n primary.appendChild(mutualFriends)\n\n const allFriendsSection = createAllFriendsSection({\n dom,\n subject: s,\n profile: canModifyFriendsTab ? profile : null,\n editable: canModifyFriendsTab,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n const allFriends = allFriendsSection.section\n const friendsList = allFriendsSection.friendsList\n primary.appendChild(allFriends)\n\n let requestsTriage: FriendshipTriage = triageFriends(kb, s)\n const requestsSection = createRequestsSection({\n dom,\n triage: requestsTriage,\n renderSupportingInfo,\n renderNameSuffix\n })\n const requestsPanel = requestsSection.section\n primary.appendChild(requestsPanel)\n\n const requestsTab = tabs.appendChild(dom.createElement('button'))\n requestsTab.className = 'social-primary__tab'\n requestsTab.type = 'button'\n requestsTab.id = 'social-tab-requests'\n requestsTab.textContent = 'Requests'\n requestsTab.setAttribute('role', 'tab')\n requestsTab.setAttribute('aria-controls', 'social-panel-requests')\n requestsTab.setAttribute('aria-selected', 'false')\n requestsTab.tabIndex = -1\n\n type SocialPanel = 'mutual' | 'all-friends' | 'requests'\n let activePanel: SocialPanel = 'all-friends'\n let showRequestsTab = viewerMode === 'owner'\n\n const setActivePanel = function (panel: SocialPanel) {\n activePanel = panel\n const showMutual = panel === 'mutual'\n const showAllFriends = panel === 'all-friends'\n const showRequests = showRequestsTab && panel === 'requests'\n mutualTab.classList.toggle('social-primary__tab--active', showMutual)\n mutualTab.setAttribute('aria-selected', String(showMutual))\n mutualTab.tabIndex = showMutual ? 0 : -1\n\n allFriendsTab.classList.toggle('social-primary__tab--active', showAllFriends)\n allFriendsTab.setAttribute('aria-selected', String(showAllFriends))\n allFriendsTab.tabIndex = showAllFriends ? 0 : -1\n\n requestsTab.classList.toggle('social-primary__tab--active', showRequests)\n requestsTab.setAttribute('aria-selected', String(showRequests))\n requestsTab.tabIndex = showRequests ? 0 : -1\n\n mutualFriends.classList.toggle('social-primary__panel--active', showMutual)\n mutualFriends.setAttribute('aria-hidden', String(!showMutual))\n\n allFriends.classList.toggle('social-primary__panel--active', showAllFriends)\n allFriends.setAttribute('aria-hidden', String(!showAllFriends))\n\n requestsPanel.classList.toggle('social-primary__panel--active', showRequests)\n requestsPanel.setAttribute('aria-hidden', String(!showRequests))\n requestsPanel.hidden = !showRequestsTab || !showRequests\n }\n const rebuildMutualSection = function () {\n if (!me || thisIsYou) return\n\n const cme = kb.canon(me)\n incoming = kb.whether(s, knows, cme)\n\n const outgoingStatements = kb.statementsMatching(cme, knows, s)\n outgoing = outgoingStatements.length > 0\n\n const nextMutualSection = createMutualSection({\n dom,\n subject: s,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable: canManageRelationship,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n })\n\n mutualFriends.replaceWith(nextMutualSection.section)\n mutualSection = nextMutualSection\n mutualFriends = nextMutualSection.section\n mutualContent = nextMutualSection.content\n }\n\n refreshRelationshipUi = function () {\n rebuildMutualSection()\n headerControls = {\n ...headerControls,\n showAddFriendAction: shouldShowHeaderAddFriendAction(headerControls.viewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n requestsTriage = triageFriends(kb, s)\n requestsSection.refreshRequests(requestsTriage)\n setActivePanel(activePanel)\n }\n\n setActivePanel('all-friends')\n\n const applyViewerMode = function (mode: ViewerMode) {\n const showMutualTab = mode === 'authenticated' && !thisIsYou\n showRequestsTab = mode === 'owner'\n mutualTab.hidden = !showMutualTab\n requestsTab.hidden = !showRequestsTab\n if (!showRequestsTab && activePanel === 'requests') {\n setActivePanel('all-friends')\n return\n }\n setActivePanel('all-friends')\n }\n\n mutualTab.addEventListener('click', function () {\n setActivePanel('mutual')\n })\n\n allFriendsTab.addEventListener('click', function () {\n setActivePanel('all-friends')\n })\n\n requestsTab.addEventListener('click', function () {\n setActivePanel('requests')\n })\n\n const refreshFriendsList = function () {\n const refresh = (friendsList as HTMLTableElement & { refresh?: () => void }).refresh\n if (typeof refresh !== 'function') return\n\n refresh.call(friendsList)\n }\n\n const refreshMutualFriends = function () {\n mutualSection.refreshMutualFriends()\n }\n\n ;(async () => {\n try {\n for await (const streamedFriends of streamFriends(context, s)) {\n friendDetailsByUri.clear()\n streamedFriends.forEach(friend => {\n friendDetailsByUri.set(friend.url, friend)\n })\n refreshFriendsList()\n refreshMutualFriends()\n }\n } catch {\n // Keep the initial snapshot if async friend loading fails.\n }\n })()\n\n ;(async () => {\n try {\n requestsTriage = await loadFriendshipTriage(context, s)\n requestsSection.refreshRequests(requestsTriage)\n refreshFriendsList()\n refreshMutualFriends()\n } catch {\n // Keep the initial requests snapshot if additional loading fails.\n }\n })()\n\n // Older triage logic is preserved below as a reusable data helper.\n\n applyViewerMode('anonymous')\n\n authn.checkUser()\n .then(webId => {\n const confirmedViewerMode = getViewerMode(s, webId)\n applyViewerMode(confirmedViewerMode)\n const confirmedCanEditOwnedProfile = confirmedViewerMode === 'owner' && editable\n headerControls = {\n ...headerControls,\n canEdit: confirmedCanEditOwnedProfile,\n viewerMode: confirmedViewerMode,\n showAddFriendAction: shouldShowHeaderAddFriendAction(confirmedViewerMode)\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n .catch(() => {\n applyViewerMode('anonymous')\n headerControls = {\n ...headerControls,\n canEdit: false,\n viewerMode: 'anonymous',\n showAddFriendAction: false\n }\n ;(header as SocialHeaderElement).refreshSocialHeader?.(headerControls)\n })\n\n return socialPane\n } // render()\n} //\n// ends\n// ***************** Social Pane Selectors **********/\n/* Should move to another file, but will leave for now */\n/* Will create a social pane folder or maybe repo later */\n\nconst FRIEND_BATCH_SIZE = 3\n\nexport interface ProfileDetails {\n url: string\n imageUrl?: string\n name?: string\n nickname?: string\n jobTitle?: string\n organization?: string\n location?: string | null\n pronouns?: string\n birthdate?: string\n}\n\nexport interface FriendDetails extends ProfileDetails {\n subjectNode: NamedNode\n}\n\n/* pronounsAsText and formatLocation were copied from HeadingSection selectors */\nexport function pronounsAsText (store: LiveStore, subject: NamedNode): string {\n let pronouns = store.anyJS(subject, ns.solid('preferredSubjectPronoun')) || ''\n if (pronouns) {\n const them = store.anyJS(subject, ns.solid('preferredObjectPronoun'))\n if (them) {\n pronouns += '/' + them\n }\n }\n return pronouns || ''\n}\n\nfunction formatLocation (countryName: string | void, locality: string | void) {\n return countryName && locality\n ? `${locality}, ${countryName}`\n : countryName || locality || null\n}\n\nfunction toFriendDetails (store: any, friendNode: NamedNode): FriendDetails {\n const name =\n store.anyValue(friendNode, ns.vcard('fn')) ||\n store.anyValue(friendNode, ns.foaf('name')) ||\n null\n const nickname =\n store.anyValue(friendNode, ns.vcard('nickname')) ||\n store.anyValue(friendNode, ns.foaf('nick')) ||\n null\n const dateOfBirth = store.anyValue(friendNode, ns.vcard('bday')) || null\n const imageSrc = widgets.findImage(friendNode)\n const jobTitle = store.anyValue(friendNode, ns.vcard('role')) || null\n const orgName = store.anyValue(friendNode, ns.vcard('organization-name')) || null\n const primaryAddressEntryNode = store.any(friendNode, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : null\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : null\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, friendNode)\n\n return {\n url: friendNode.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns,\n subjectNode: friendNode\n }\n}\n\nexport async function * streamFriends (\n context: DataBrowserContext,\n subject: NamedNode,\n batchSize = FRIEND_BATCH_SIZE\n): AsyncGenerator<FriendDetails[], void, void> {\n const store = context.session.store\n const fetcher = (store as any)?.fetcher\n\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(subject.doc())\n } catch {\n // Continue with whatever is already in the store.\n }\n }\n\n const seen = new Set<string>()\n const friendNodes = store.each(subject, ns.foaf('knows'), null, subject.doc())\n const uniqueFriendNodes: NamedNode[] = []\n\n for (const friendNode of friendNodes) {\n const key = friendNode?.value\n if (!key || seen.has(key) || subject.value === key) continue\n seen.add(key)\n uniqueFriendNodes.push(friendNode as NamedNode)\n }\n\n const friends: FriendDetails[] = []\n\n for (const friendNode of uniqueFriendNodes) {\n if (fetcher && typeof fetcher.load === 'function') {\n try {\n await fetcher.load(friendNode.doc())\n } catch {\n // Keep partial friend data when one linked document fails to load.\n }\n }\n\n friends.push(toFriendDetails(store, friendNode))\n\n if (friends.length % batchSize === 0) {\n yield [...friends]\n }\n }\n\n if (friends.length > 0 && friends.length % batchSize !== 0) {\n yield [...friends]\n }\n}\n\nexport async function extractFriends (context: DataBrowserContext, subject: NamedNode): Promise<FriendDetails[] | null> {\n let latestFriends: FriendDetails[] | null = null\n\n for await (const friends of streamFriends(context, subject)) {\n latestFriends = friends\n }\n\n return latestFriends\n}\n\nexport function selectProfileData (context: DataBrowserContext, subject: NamedNode): ProfileDetails | null {\n const store = context.session.store\n\n const name =\n store.anyValue(subject, ns.vcard('fn')) ||\n store.anyValue(subject, ns.foaf('name')) ||\n undefined\n const nickname =\n store.anyValue(subject, ns.vcard('nickname')) ||\n store.anyValue(subject, ns.foaf('nick')) ||\n undefined\n const dateOfBirth = store.anyValue(subject, ns.vcard('bday')) || undefined\n const imageSrc = widgets.findImage(subject)\n const jobTitle = store.anyValue(subject, ns.vcard('role')) || undefined\n const orgName = store.anyValue(subject, ns.vcard('organization-name')) || undefined\n const primaryAddressEntryNode = store.any(subject, ns.vcard('hasAddress')) as NamedNode | null\n const address: NamedNode | null = primaryAddressEntryNode || null\n const countryName =\n address != null\n ? store.anyValue(address, ns.vcard('country-name'))\n : undefined\n const locality =\n address != null\n ? store.anyValue(address, ns.vcard('locality'))\n : undefined\n\n const location = formatLocation(countryName, locality)\n const pronouns = pronounsAsText(store, subject)\n return {\n url: subject.value,\n imageUrl: imageSrc,\n name,\n nickname,\n jobTitle,\n organization: orgName,\n birthdate: dateOfBirth,\n location,\n pronouns\n }\n}\n\nexport type { ViewerMode } from './socialSections'\n\nfunction getViewerMode (subject: NamedNode, currentUser: unknown = authn.currentUser()): ViewerMode {\n const currentUserUri =\n typeof currentUser === 'string'\n ? currentUser\n : typeof currentUser === 'object' && currentUser !== null\n ? ((currentUser as { value?: string, uri?: string }).value ||\n (currentUser as { value?: string, uri?: string }).uri ||\n null)\n : null\n let mode: ViewerMode = 'anonymous'\n if (currentUserUri === subject.value) mode = 'owner'\n if (currentUserUri && currentUserUri !== subject.value) mode = 'authenticated'\n return mode\n}\n"],"mappings":";;;;;;;AA4BA,SAASA,GACP,GACA,GACM;CACN,IAAMC,IAASC,EAAQ,aAAa,UAAU,W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