solid-panes 5.1.0-0 → 5.1.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/RDFXMLPane2.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/cake.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/camera.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/folder-open.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/help-circle.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/mail.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/map-pin.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/pencil.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/phone.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/settings-2.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/user.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/users.esm.js +1 -2
- package/dist/_virtual/~icons/lucide/x.esm.js +1 -2
- package/dist/audio/audioPane.esm.js +1 -2
- package/dist/classInstancePane.esm.js +1 -2
- package/dist/components/editor-card/EditorCard.cjs.js +1 -1
- package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
- package/dist/components/editor-card/EditorCard.esm.js +6 -7
- package/dist/components/editor-card/EditorCard.styles.esm.js +1 -2
- package/dist/components/header/Header.cjs.js +1 -1
- package/dist/components/header/Header.cjs.js.map +1 -1
- package/dist/components/header/Header.esm.js +7 -8
- package/dist/components/header/Header.styles.esm.js +1 -2
- package/dist/components/navbar/Navbar.cjs.js +2 -2
- package/dist/components/navbar/Navbar.cjs.js.map +1 -1
- package/dist/components/navbar/Navbar.esm.js +8 -9
- package/dist/components/navbar/Navbar.styles.esm.js +1 -2
- package/dist/components/profile-heading/ProfileHeading.cjs.js +17 -17
- package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
- package/dist/components/profile-heading/ProfileHeading.esm.js +28 -29
- package/dist/components/profile-heading/ProfileHeading.styles.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +1 -1
- package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +2 -3
- package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +0 -1
- package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +1 -2
- package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/textUtils.esm.js +1 -2
- package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +1 -2
- package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +1 -2
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +3 -3
- package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -1
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js +4 -19
- package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -1
- package/dist/components/profile-heading/editor/ui/spinner.esm.js +1 -2
- package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +1 -2
- package/dist/components/profile-heading/friendActions.esm.js +1 -2
- package/dist/components/profile-heading/profileHeadingData.esm.js +1 -2
- package/dist/dashboard/basicPreferences.esm.js +1 -2
- package/dist/dashboard/dashboardPane.esm.js +0 -1
- package/dist/dashboard/homepage.esm.js +1 -2
- package/dist/dashboard/ontologyData.esm.js +1 -2
- package/dist/dashboard/preferencesFormText.esm.js +1 -2
- package/dist/dataContentPane2.cjs.js +1 -1
- package/dist/dataContentPane2.esm.js +2 -3
- package/dist/defaultPane2.cjs.js +1 -1
- package/dist/defaultPane2.esm.js +2 -3
- package/dist/dokieli/dokieliPane.cjs.js +1 -1
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
- package/dist/dokieli/dokieliPane.esm.js +7 -12
- package/dist/dokieli/dokieliPane.esm.js.map +1 -1
- package/dist/dokieli/new.esm.js +1 -2
- package/dist/form/pane.esm.js +1 -2
- package/dist/home/homePane.esm.js +1 -2
- package/dist/humanReadablePane.d.ts +3 -0
- package/dist/humanReadablePane.d.ts.map +1 -1
- package/dist/humanReadablePane2.cjs.js +276 -1
- package/dist/humanReadablePane2.cjs.js.map +1 -1
- package/dist/humanReadablePane2.esm.js +428 -31
- package/dist/humanReadablePane2.esm.js.map +1 -1
- package/dist/icons/folder.esm.js +1 -2
- package/dist/icons/friends.esm.js +1 -2
- package/dist/icons/person.esm.js +1 -2
- package/dist/imagePane.d.ts.map +1 -1
- package/dist/imagePane2.cjs.js +1 -1
- package/dist/imagePane2.cjs.js.map +1 -1
- package/dist/imagePane2.esm.js +2 -3
- package/dist/imagePane2.esm.js.map +1 -1
- package/dist/index.esm.js +1 -2
- package/dist/internal/internalPane2.cjs.js +1 -1
- package/dist/internal/internalPane2.esm.js +2 -3
- package/dist/mainPage/header.esm.js +1 -2
- package/dist/mainPage/index.cjs.js +1 -1
- package/dist/mainPage/index.cjs.js.map +1 -1
- package/dist/mainPage/index.d.ts +1 -1
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +6 -2
- package/dist/mainPage/index.esm.js.map +1 -1
- package/dist/mainPage/navbar.esm.js +1 -2
- package/dist/mainPage/navigation.cjs.js +1 -1
- package/dist/mainPage/navigation.cjs.js.map +1 -1
- package/dist/mainPage/navigation.d.ts.map +1 -1
- package/dist/mainPage/navigation.esm.js +14 -11
- package/dist/mainPage/navigation.esm.js.map +1 -1
- package/dist/mainPage/profileHeading2.esm.js +1 -2
- package/dist/n3Pane2.esm.js +1 -2
- package/dist/navigation/browserEvents.esm.js +1 -2
- package/dist/navigation/chrome.esm.js +1 -2
- package/dist/navigation/controller.cjs.js +1 -1
- package/dist/navigation/controller.cjs.js.map +1 -1
- package/dist/navigation/controller.esm.js +6 -7
- package/dist/navigation/controller.esm.js.map +1 -1
- package/dist/navigation/events.esm.js +1 -2
- package/dist/navigation/navbarVisibility.esm.js +1 -2
- package/dist/navigation/options.esm.js +1 -2
- package/dist/navigation/podContext.esm.js +1 -2
- package/dist/navigation/state.esm.js +1 -2
- package/dist/outline/context.esm.js +1 -2
- package/dist/outline/fileExplorerHelpers.cjs.js +2 -0
- package/dist/outline/fileExplorerHelpers.cjs.js.map +1 -0
- package/dist/outline/fileExplorerHelpers.d.ts +13 -0
- package/dist/outline/fileExplorerHelpers.d.ts.map +1 -0
- package/dist/outline/fileExplorerHelpers.esm.js +24 -0
- package/dist/outline/fileExplorerHelpers.esm.js.map +1 -0
- package/dist/outline/manager2.cjs.js +1 -1
- package/dist/outline/manager2.cjs.js.map +1 -1
- package/dist/outline/manager2.esm.js +422 -433
- package/dist/outline/manager2.esm.js.map +1 -1
- package/dist/outline/outlineDomHelpers.cjs.js +2 -0
- package/dist/outline/outlineDomHelpers.cjs.js.map +1 -0
- package/dist/outline/outlineDomHelpers.d.ts +30 -0
- package/dist/outline/outlineDomHelpers.d.ts.map +1 -0
- package/dist/outline/outlineDomHelpers.esm.js +79 -0
- package/dist/outline/outlineDomHelpers.esm.js.map +1 -0
- package/dist/outline/outlineIcons.esm.js +1 -2
- package/dist/outline/propertyViews.esm.js +1 -2
- package/dist/outline/queryByExample.cjs.js.map +1 -1
- package/dist/outline/queryByExample.esm.js +1 -2
- package/dist/outline/queryByExample.esm.js.map +1 -1
- package/dist/outline/userInput.cjs.js +9 -9
- package/dist/outline/userInput.cjs.js.map +1 -1
- package/dist/outline/userInput.esm.js +50 -40
- package/dist/outline/userInput.esm.js.map +1 -1
- package/dist/outline/viewAsImage.esm.js +1 -2
- package/dist/outline/viewAsMbox.esm.js +1 -2
- package/dist/pad/padPane2.cjs.js +1 -1
- package/dist/pad/padPane2.esm.js +2 -3
- package/dist/playlist/playlistPane.esm.js +1 -2
- package/dist/registerPanes.esm.js +1 -2
- package/dist/schedule/formsForSchedule.esm.js +1 -2
- package/dist/schedule/schedulePane.d.ts.map +1 -1
- package/dist/schedule/schedulePane2.cjs.js +1 -1
- package/dist/schedule/schedulePane2.cjs.js.map +1 -1
- package/dist/schedule/schedulePane2.esm.js +60 -59
- package/dist/schedule/schedulePane2.esm.js.map +1 -1
- package/dist/sharing/sharingPane.esm.js +1 -2
- package/dist/slideshow/slideshowPane.esm.js +1 -2
- package/dist/social/editProfileDetails.cjs.js +1 -1
- package/dist/social/editProfileDetails.esm.js +1 -2
- package/dist/social/icons.esm.js +1 -2
- package/dist/social/socialPane2.cjs.js +1 -1
- package/dist/social/socialPane2.esm.js +2 -3
- package/dist/social/socialSections.cjs.js +1 -1
- package/dist/social/socialSections.cjs.js.map +1 -1
- package/dist/social/socialSections.d.ts +0 -1
- package/dist/social/socialSections.d.ts.map +1 -1
- package/dist/social/socialSections.esm.js +15 -18
- package/dist/social/socialSections.esm.js.map +1 -1
- package/dist/social/triage.esm.js +1 -2
- package/dist/tabbed/tabbedPane.esm.js +1 -2
- package/dist/tableViewPane.esm.js +1 -2
- package/dist/transaction/pane.esm.js +1 -2
- package/dist/transaction/period.esm.js +1 -2
- package/dist/trip/tripPane.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.dom.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.utils.esm.js +1 -2
- package/dist/trustedApplications/trustedApplications.view.esm.js +1 -2
- package/dist/ui/pane.esm.js +1 -2
- package/dist/utils/paneUtils.cjs.js +1 -1
- package/dist/utils/paneUtils.cjs.js.map +1 -1
- package/dist/utils/paneUtils.d.ts +5 -3
- package/dist/utils/paneUtils.d.ts.map +1 -1
- package/dist/utils/paneUtils.esm.js +36 -29
- package/dist/utils/paneUtils.esm.js.map +1 -1
- package/dist/utils/podUtils.cjs.js +1 -1
- package/dist/utils/podUtils.cjs.js.map +1 -1
- package/dist/utils/podUtils.d.ts +9 -1
- package/dist/utils/podUtils.d.ts.map +1 -1
- package/dist/utils/podUtils.esm.js +22 -95
- package/dist/utils/podUtils.esm.js.map +1 -1
- package/dist/utils/viewerUtils.esm.js +1 -2
- package/dist/utils/webIdUtils.esm.js +1 -2
- package/dist/versionInfo.cjs.js +1 -1
- package/dist/versionInfo.cjs.js.map +1 -1
- package/dist/versionInfo.esm.js +4 -5
- package/dist/versionInfo.esm.js.map +1 -1
- package/dist/video/videoPane.esm.js +1 -2
- package/package.json +7 -6
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/folder.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/folder.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/folder.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/folder.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/globe.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/globe.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/share-2.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/share-2.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/share-2.esm.js.map +0 -1
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js +0 -2
- package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +0 -1
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js +0 -11
- package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +0 -14
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +0 -18
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +0 -292
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +0 -32
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +0 -21
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +0 -294
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +0 -34
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +0 -20
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +0 -346
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +0 -13
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +0 -36
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +0 -470
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +0 -2
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +0 -1
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +0 -7
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +0 -1
- package/dist/components/file-explorer-header/index.cjs.js +0 -1
- package/dist/components/file-explorer-header/index.d.ts +0 -3
- package/dist/components/file-explorer-header/index.d.ts.map +0 -1
- package/dist/components/file-explorer-header/index.esm.js +0 -2
- package/dist/components/file-explorer-header/types.d.ts +0 -10
- package/dist/components/file-explorer-header/types.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +0 -8
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +0 -32
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +0 -19
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +0 -322
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js +0 -2
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +0 -1
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js +0 -7
- package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socialSections.esm.js","names":["createMutualSection","options","refreshMutualFriends","mutualSection","dom","mutualContent","relationshipSummary","createRelationshipLine","line","youAndThem","link","text","meUri","familiar","subject","incoming","outgoing","incomingLine","confirmLabel","relationshipForm","buildCheckboxForm","Statement","me","knows","profile","editable","mutualConnections","mutualFriendsTable","createMutualRow","widgets","ns","target","sortedMutualConnections","leftLabel","utils","left","rightLabel","right","thing","createAllFriendsSection","allFriends","mainTable","friendsList","friendsListRow","friendsListPromptCell","friendsListRightCell","friendsHeaderActions","friendsHeaderDropzone","friendsItemsTable","createRequestsSection","requestsSection","requestsContent","note","createRequestGroup","group","header","heading","title","blurb","description","empty","emptyText","table","incomingGroup","pendingGroup","createPersonRow","sortNodes","nodes","syncRequestGroup","sortedNodes","refreshRequests","nextTriage","triage"],"sources":["../../src/social/socialSections.ts"],"sourcesContent":["import { DataBrowserContext } from 'pane-registry'\n// import { createAddMeToYourFriendsButton } from 'profile-pane'\nimport { Statement, NamedNode } from 'rdflib'\nimport { ns, utils, widgets } from 'solid-ui'\nimport { appendProfileLinks } from './editProfileDetails'\nimport { locationIcon, personInCircleIcon as personInCircleIconSvg } from './icons'\nimport { FriendshipTriage } from './triage'\nimport type { ViewerMode } from '../types'\n\nexport type HeaderControls = {\n canEdit: boolean,\n viewerMode: ViewerMode,\n showAddFriendAction?: boolean\n}\n\nexport type SocialHeaderElement = HTMLElement & {\n refreshSocialHeader?: (controls: HeaderControls) => void\n}\n\nexport type HeaderStats = {\n friendCount: number,\n mutualFriendCount: number | null,\n onSelectFriends?: () => void,\n onSelectMutual?: () => void\n}\n\nexport type HeaderProfileData = {\n imageUrl?: string,\n name?: string,\n pronouns?: string,\n jobTitle?: string,\n organization?: string,\n location?: string | null\n} | null\n\nexport type FriendRowRenderers = {\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}\n\nexport function createHeaderSection (\n context: DataBrowserContext,\n subject: NamedNode,\n controls: HeaderControls,\n stats: HeaderStats,\n getProfileData: () => HeaderProfileData\n): SocialHeaderElement {\n const dom = context.dom\n const kb = context.session.store\n const header = dom.createElement('header') as SocialHeaderElement\n header.className = 'social-pane__header'\n let headerControls = controls\n\n const renderHeader = function () {\n header.replaceChildren()\n const profileData = getProfileData()\n\n const headerContent = dom.createElement('div')\n headerContent.className = 'social-pane__header-content'\n\n const headerActions = dom.createElement('div')\n headerActions.className = 'social-pane__header-actions profile__actions profile__heading-actions'\n\n if (headerControls.canEdit) {\n // Hidden for now because the social pane header edit control does not match the new design.\n // Revisit later if we decide to restore profile-link editing here.\n } else if (headerControls.viewerMode === 'authenticated' && headerControls.showAddFriendAction) {\n headerActions.classList.add('social-pane__header-actions--friend')\n\n const friendDropButton = dom.createElement('button')\n friendDropButton.setAttribute('title', 'Drop friend here')\n friendDropButton.setAttribute('aria-label', 'Drop friend here')\n const buttonImage = dom.createElement('img')\n buttonImage.setAttribute('title', 'Drop friend here')\n buttonImage.setAttribute('alt', 'Drop friend here')\n friendDropButton.appendChild(buttonImage)\n\n const dropHint = dom.createElement('span')\n dropHint.className = 'social-friends-header-hint'\n dropHint.textContent = 'Drag a WebId on the target to add a friend.'\n friendDropButton.appendChild(dropHint)\n headerActions.appendChild(friendDropButton)\n }\n\n // const addToFriendsButton = createAddMeToYourFriendsButton(subject, context)\n // addToFriendsButton.classList.add('flex-center')\n // headerActions.appendChild(addToFriendsButton)\n // }\n\n header.appendChild(headerContent)\n\n const headerMedia = dom.createElement('div')\n headerMedia.className = 'social-pane__header-media'\n headerContent.appendChild(headerMedia)\n\n if (profileData) {\n headerMedia.appendChild(createImage(dom, profileData.imageUrl, profileData.name))\n }\n\n const headerDetails = dom.createElement('div')\n headerDetails.className = 'social-pane__header-details'\n headerContent.appendChild(headerDetails)\n\n if (headerActions.childNodes.length > 0) {\n headerContent.appendChild(headerActions)\n }\n\n const headerSummary = dom.createElement('div')\n headerSummary.classList.add('social-pane__header-summary', 'flex-column')\n headerDetails.appendChild(headerSummary)\n\n const name = profileData?.name || utils.label(subject)\n const h1 = dom.createElement('h1')\n h1.classList.add('social-pane__header-name')\n h1.appendChild(dom.createTextNode(name))\n headerSummary.appendChild(h1)\n\n const pronounsSpan = dom.createElement('span')\n pronounsSpan.classList.add('social-pane_header-pronouns')\n headerSummary.appendChild(pronounsSpan)\n\n const jobAndOrganization = [profileData?.jobTitle, profileData?.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = dom.createElement('div')\n jobLine.className = 'social-pane__header-job-org'\n jobLine.textContent = jobAndOrganization\n headerSummary.appendChild(jobLine)\n }\n\n if (profileData?.location) {\n const locationLine = dom.createElement('div')\n locationLine.className = 'social-pane__header-location'\n\n const locationIconSpan = dom.createElement('span')\n locationIconSpan.classList.add('social-pane__header-location-icon', 'inline-flex-row')\n locationIconSpan.innerHTML = locationIcon\n locationLine.appendChild(locationIconSpan)\n locationLine.appendChild(dom.createTextNode(profileData.location))\n\n headerSummary.appendChild(locationLine)\n }\n\n const statsRow = dom.createElement('div')\n statsRow.className = 'social-pane__header-stats'\n\n const friendCount = dom.createElement('button')\n friendCount.className = 'social-pane__header-stat'\n friendCount.type = 'button'\n const friendCountLabel = dom.createElement('span')\n friendCountLabel.className = 'social-pane__header-stat-label'\n friendCountLabel.textContent = `${stats.friendCount} friend${stats.friendCount === 1 ? '' : 's'}`\n friendCount.appendChild(friendCountLabel)\n if (stats.onSelectFriends) {\n friendCount.addEventListener('click', stats.onSelectFriends)\n }\n statsRow.appendChild(friendCount)\n\n if (typeof stats.mutualFriendCount === 'number') {\n const mutualCount = dom.createElement('button')\n mutualCount.className = 'social-pane__header-stat'\n mutualCount.type = 'button'\n const mutualCountLabel = dom.createElement('span')\n mutualCountLabel.className = 'social-pane__header-stat-label'\n mutualCountLabel.textContent = `${stats.mutualFriendCount} mutual friend${stats.mutualFriendCount === 1 ? '' : 's'}`\n mutualCount.appendChild(mutualCountLabel)\n if (stats.onSelectMutual) {\n mutualCount.addEventListener('click', stats.onSelectMutual)\n }\n statsRow.appendChild(mutualCount)\n }\n\n headerSummary.appendChild(statsRow)\n appendProfileLinks(headerMedia, dom, kb, subject)\n }\n\n header.refreshSocialHeader = function (nextControls: HeaderControls) {\n headerControls = nextControls\n renderHeader()\n }\n\n renderHeader()\n\n return header\n}\n\nfunction createImage (dom: HTMLDocument, src: string | null | undefined, alt = ''): HTMLElement {\n if (src) {\n const img = dom.createElement('img')\n img.className = 'social-pane__header-hero'\n img.src = src\n img.alt = alt\n img.width = 180\n img.height = 180\n img.loading = 'eager'\n return img\n }\n\n const fallback = dom.createElement('div')\n fallback.className = 'social-pane__header-hero-alt flex-center'\n fallback.setAttribute('role', 'img')\n fallback.setAttribute('aria-label', alt)\n fallback.tabIndex = 0\n\n const icon = dom.createElement('span')\n icon.classList.add('social-pane__header-hero-icon', 'inline-flex-row')\n icon.innerHTML = personInCircleIconSvg\n fallback.appendChild(icon)\n\n return fallback\n}\n\nexport function createMutualSection (options: {\n dom: HTMLDocument,\n subject: NamedNode,\n familiar: string,\n me: NamedNode,\n meUri: string | null,\n incoming: boolean | NamedNode[] | undefined,\n outgoing: boolean | NamedNode[] | undefined,\n editable: boolean,\n profile: NamedNode | null,\n knows: NamedNode,\n mutualConnections: NamedNode[],\n link: (contents: Node, uri: string | null | undefined) => Node,\n text: (value: string) => Text,\n buildCheckboxForm: (\n label: string | Node,\n statement: Statement,\n state: boolean,\n options?: { disabled?: boolean, disabledTitle?: string }\n ) => HTMLElement,\n renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'],\n renderNameSuffix: FriendRowRenderers['renderNameSuffix']\n}): { section: HTMLElement, content: HTMLElement, refreshMutualFriends: () => void } {\n const {\n dom,\n subject,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n } = options\n\n let refreshMutualFriends = function () {}\n\n const mutualSection = dom.createElement('section')\n mutualSection.className = 'social-pane__mutual-friends social-primary__panel'\n mutualSection.id = 'social-panel-mutual'\n mutualSection.setAttribute('role', 'tabpanel')\n mutualSection.setAttribute('aria-labelledby', 'social-tab-mutual')\n\n const mutualContent = mutualSection.appendChild(dom.createElement('div'))\n mutualContent.classList.add('social-main', 'social-main--mutual', 'flex-column')\n\n const relationshipSummary = dom.createElement('div')\n relationshipSummary.classList.add('social-mutual-summary', 'flex-column')\n mutualContent.appendChild(relationshipSummary)\n\n const createRelationshipLine = function () {\n const line = relationshipSummary.appendChild(dom.createElement('div'))\n line.classList.add('social-mutual-summary-line')\n return line\n }\n\n const youAndThem = function () {\n const line = createRelationshipLine()\n line.appendChild(link(text('You'), meUri))\n line.appendChild(text(' and '))\n line.appendChild(link(text(familiar), subject.uri))\n return line\n }\n\n if (!incoming) {\n if (!outgoing) {\n const line = youAndThem()\n line.appendChild(text(' have not said you know each other.'))\n } else {\n const line = createRelationshipLine()\n line.appendChild(link(text('You'), meUri))\n line.appendChild(text(' know '))\n line.appendChild(link(text(familiar), subject.uri))\n line.appendChild(text(' (unconfirmed).'))\n }\n } else if (!outgoing) {\n relationshipSummary.classList.add('social-mutual-summary--confirm')\n\n const incomingLine = relationshipSummary.appendChild(dom.createElement('div'))\n incomingLine.classList.add('social-mutual-summary-line')\n incomingLine.appendChild(link(text(familiar), subject.uri))\n incomingLine.appendChild(text(' knows '))\n incomingLine.appendChild(link(text('you'), meUri))\n incomingLine.appendChild(text(' (unconfirmed).'))\n } else {\n const line = youAndThem()\n line.appendChild(text(' say you know each other.'))\n }\n\n const shouldShowCheckboxPreview = Boolean(incoming) && !outgoing\n if (shouldShowCheckboxPreview) {\n const confirmLabel = dom.createElement('span')\n confirmLabel.className = 'social-mutual-confirm-prompt'\n confirmLabel.appendChild(text('Confirm you know '))\n confirmLabel.appendChild(link(text(familiar), subject.uri))\n\n const relationshipForm = buildCheckboxForm(\n confirmLabel,\n new Statement(me, knows, subject, profile ?? undefined),\n Boolean(outgoing),\n {\n disabled: !editable,\n disabledTitle: !editable ? 'Your profile is not editable' : undefined\n }\n )\n relationshipForm.classList.add('social-mutual-checkbox-form')\n\n mutualContent.appendChild(relationshipForm)\n }\n\n if (mutualConnections.length) {\n const mutualFriendsTable = mutualContent.appendChild(dom.createElement('table'))\n mutualFriendsTable.className = 'social-main social-friends-list social-friends-grid'\n\n const createMutualRow = function (target: NamedNode) {\n return widgets.personTR(dom, ns.foaf('knows'), target, {\n renderSupportingInfo,\n renderNameSuffix\n })\n }\n\n refreshMutualFriends = function () {\n const sortedMutualConnections = [...mutualConnections].sort((left, right) => {\n const leftLabel = utils.label(left) || left.value\n const rightLabel = utils.label(right) || right.value\n return leftLabel.localeCompare(rightLabel)\n })\n\n utils.syncTableToArray(\n mutualFriendsTable,\n sortedMutualConnections,\n createMutualRow,\n function (row, thing) {\n const replacement = createMutualRow(thing)\n return replacement\n }\n )\n }\n\n refreshMutualFriends()\n }\n\n return { section: mutualSection, content: mutualContent, refreshMutualFriends }\n}\n\nexport function createAllFriendsSection (options: {\n dom: HTMLDocument,\n subject: NamedNode,\n profile: NamedNode | null,\n editable: boolean,\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}): { section: HTMLElement, mainTable: HTMLTableElement, friendsList: HTMLElement } {\n const { dom, subject, profile, editable, renderSupportingInfo, renderNameSuffix } = options\n\n const allFriends = dom.createElement('section')\n allFriends.className = 'social-pane__all-friends social-primary__panel'\n allFriends.id = 'social-panel-all-friends'\n allFriends.setAttribute('role', 'tabpanel')\n allFriends.setAttribute('aria-labelledby', 'social-tab-all-friends')\n\n const mainTable = allFriends.appendChild(dom.createElement('table'))\n mainTable.className = 'social-main'\n\n const friendsList = widgets.attachmentList(dom, subject, mainTable, {\n doc: profile,\n modify: !!editable,\n predicate: ns.foaf('knows'),\n noun: 'friend',\n // Social pane already owns the async refresh cycle for friend data in\n // socialPane.ts. Leave attachmentList's generic follow-up rerender disabled\n // here or each fetched friend profile will trigger an extra whole-table refresh\n // on top of the pane's own batched updates.\n refreshOnDocumentLoad: false,\n renderSupportingInfo,\n renderNameSuffix\n })\n friendsList.classList.add('social-friends-list')\n friendsList.style.marginTop = '0'\n\n const friendsListRow = friendsList.querySelector('tr')\n const friendsListPromptCell = friendsListRow?.children?.[0]\n const friendsListRightCell = friendsListRow?.children?.[1]\n const friendsHeaderActions = dom.createElement('div')\n friendsHeaderActions.classList.add('social-friends-header-actions')\n\n if (friendsListPromptCell instanceof HTMLTableCellElement) {\n friendsListPromptCell.classList.add('social-friends-header-dropzone-cell')\n const friendsHeaderDropzone = dom.createElement('table')\n friendsHeaderDropzone.className = 'social-friends-header-dropzone'\n friendsHeaderDropzone.setAttribute('role', 'presentation')\n const friendsHeaderDropzoneBody = friendsHeaderDropzone.appendChild(dom.createElement('tbody'))\n const friendsHeaderDropzoneRow = friendsHeaderDropzoneBody.appendChild(dom.createElement('tr'))\n friendsHeaderDropzoneRow.appendChild(friendsListPromptCell)\n friendsHeaderActions.appendChild(friendsHeaderDropzone)\n } else if (friendsListPromptCell instanceof HTMLElement) {\n while (friendsListPromptCell.firstChild) {\n friendsHeaderActions.appendChild(friendsListPromptCell.firstChild)\n }\n friendsListPromptCell.remove()\n }\n\n if (friendsListRightCell instanceof HTMLTableCellElement) {\n friendsListRightCell.colSpan = 2\n }\n\n const friendsItemsTable = friendsList.querySelector('td table')\n if (friendsItemsTable instanceof HTMLTableElement) {\n friendsItemsTable.classList.add('social-friends-grid')\n }\n\n return { section: allFriends, mainTable, friendsList }\n}\n\nexport function createRequestsSection (options: {\n dom: HTMLDocument,\n triage: FriendshipTriage,\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}): { section: HTMLElement, refreshRequests: (triage: FriendshipTriage) => void } {\n const { dom, triage, renderSupportingInfo, renderNameSuffix } = options\n\n const requestsSection = dom.createElement('section')\n requestsSection.className = 'social-pane__requests social-primary__panel'\n requestsSection.id = 'social-panel-requests'\n requestsSection.setAttribute('role', 'tabpanel')\n requestsSection.setAttribute('aria-labelledby', 'social-tab-requests')\n\n const requestsContent = requestsSection.appendChild(dom.createElement('div'))\n requestsContent.classList.add('social-main', 'social-main--requests', 'flex-column')\n\n const note = requestsContent.appendChild(dom.createElement('p'))\n note.className = 'social-requests__note'\n note.textContent = 'Best effort preview: this view only reflects profile documents that are currently loaded. A dedicated inbox would still be needed for complete request discovery.'\n\n const createRequestGroup = function (title: string, description: string, emptyText: string) {\n const group = requestsContent.appendChild(dom.createElement('section'))\n group.classList.add('social-requests__group', 'flex-column')\n\n const header = group.appendChild(dom.createElement('div'))\n header.className = 'social-requests__group-header'\n\n const heading = header.appendChild(dom.createElement('h2'))\n heading.className = 'social-requests__group-title'\n heading.textContent = title\n\n const blurb = header.appendChild(dom.createElement('p'))\n blurb.className = 'social-requests__group-description'\n blurb.textContent = description\n\n const empty = group.appendChild(dom.createElement('p'))\n empty.className = 'social-requests__empty'\n empty.textContent = emptyText\n\n const table = group.appendChild(dom.createElement('table'))\n table.className = 'social-main social-friends-list social-friends-grid social-requests__table'\n\n return { empty, table }\n }\n\n const incomingGroup = createRequestGroup(\n 'Incoming requests',\n 'People who say they know this profile, but have not been confirmed yet.',\n 'No incoming requests are visible from the currently loaded data.'\n )\n const pendingGroup = createRequestGroup(\n 'Awaiting confirmation',\n 'People this profile knows who have not linked back yet.',\n 'Nothing is waiting for confirmation right now.'\n )\n\n const createPersonRow = function (target: NamedNode) {\n return widgets.personTR(dom, ns.foaf('knows'), target, {\n renderSupportingInfo,\n renderNameSuffix\n })\n }\n\n const sortNodes = function (nodes: NamedNode[]) {\n return [...nodes].sort((left, right) => {\n const leftLabel = utils.label(left) || left.value\n const rightLabel = utils.label(right) || right.value\n return leftLabel.localeCompare(rightLabel)\n })\n }\n\n const syncRequestGroup = function (\n group: { empty: HTMLElement, table: HTMLTableElement },\n nodes: NamedNode[]\n ) {\n const sortedNodes = sortNodes(nodes)\n group.empty.hidden = sortedNodes.length > 0\n group.table.hidden = sortedNodes.length === 0\n\n utils.syncTableToArray(\n group.table,\n sortedNodes,\n createPersonRow,\n function (_row, thing) {\n return createPersonRow(thing)\n }\n )\n }\n\n const refreshRequests = function (nextTriage: FriendshipTriage) {\n syncRequestGroup(incomingGroup, nextTriage.requests)\n syncRequestGroup(pendingGroup, nextTriage.unconfirmed)\n }\n\n refreshRequests(triage)\n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AAStB;EAAiB;CAAgB;AACrD"}
|
|
1
|
+
{"version":3,"file":"socialSections.esm.js","names":["createMutualSection","options","refreshMutualFriends","mutualSection","dom","mutualContent","relationshipSummary","createRelationshipLine","line","youAndThem","link","text","meUri","familiar","subject","incoming","outgoing","incomingLine","confirmLabel","relationshipForm","buildCheckboxForm","Statement","me","knows","profile","editable","mutualConnections","mutualFriendsTable","createMutualRow","widgets","ns","target","sortedMutualConnections","leftLabel","utils","left","rightLabel","right","thing","createAllFriendsSection","allFriends","confirmationContainer","mainTable","friendsList","friendsListRow","dropCell","itemsCell","hint","friendsItemsTable","createRequestsSection","requestsSection","requestsContent","note","createRequestGroup","group","header","heading","title","blurb","description","empty","emptyText","table","incomingGroup","pendingGroup","createPersonRow","sortNodes","nodes","syncRequestGroup","sortedNodes","refreshRequests","nextTriage","triage"],"sources":["../../src/social/socialSections.ts"],"sourcesContent":["import { DataBrowserContext } from 'pane-registry'\n// import { createAddMeToYourFriendsButton } from 'profile-pane'\nimport { Statement, NamedNode } from 'rdflib'\nimport { ns, utils, widgets } from 'solid-ui'\nimport { appendProfileLinks } from './editProfileDetails'\nimport { locationIcon, personInCircleIcon as personInCircleIconSvg } from './icons'\nimport { FriendshipTriage } from './triage'\nimport type { ViewerMode } from '../types'\n\nexport type HeaderControls = {\n canEdit: boolean,\n viewerMode: ViewerMode\n}\n\nexport type SocialHeaderElement = HTMLElement & {\n refreshSocialHeader?: (controls: HeaderControls) => void\n}\n\nexport type HeaderStats = {\n friendCount: number,\n mutualFriendCount: number | null,\n onSelectFriends?: () => void,\n onSelectMutual?: () => void\n}\n\nexport type HeaderProfileData = {\n imageUrl?: string,\n name?: string,\n pronouns?: string,\n jobTitle?: string,\n organization?: string,\n location?: string | null\n} | null\n\nexport type FriendRowRenderers = {\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}\n\nexport function createHeaderSection (\n context: DataBrowserContext,\n subject: NamedNode,\n controls: HeaderControls,\n stats: HeaderStats,\n getProfileData: () => HeaderProfileData\n): SocialHeaderElement {\n const dom = context.dom\n const kb = context.session.store\n const header = dom.createElement('header') as SocialHeaderElement\n header.className = 'social-pane__header'\n let headerControls = controls\n\n const renderHeader = function () {\n header.replaceChildren()\n const profileData = getProfileData()\n\n const headerContent = dom.createElement('div')\n headerContent.className = 'social-pane__header-content'\n\n const headerActions = dom.createElement('div')\n headerActions.className = 'social-pane__header-actions profile__actions profile__heading-actions'\n\n if (headerControls.canEdit) {\n // Hidden for now because the social pane header edit control does not match the new design.\n // Revisit later if we decide to restore profile-link editing here.\n }\n\n // const addToFriendsButton = createAddMeToYourFriendsButton(subject, context)\n // addToFriendsButton.classList.add('flex-center')\n // headerActions.appendChild(addToFriendsButton)\n // }\n\n header.appendChild(headerContent)\n\n const headerMedia = dom.createElement('div')\n headerMedia.className = 'social-pane__header-media'\n headerContent.appendChild(headerMedia)\n\n if (profileData) {\n headerMedia.appendChild(createImage(dom, profileData.imageUrl, profileData.name))\n }\n\n const headerDetails = dom.createElement('div')\n headerDetails.className = 'social-pane__header-details'\n headerContent.appendChild(headerDetails)\n\n if (headerActions.childNodes.length > 0) {\n headerContent.appendChild(headerActions)\n }\n\n const headerSummary = dom.createElement('div')\n headerSummary.classList.add('social-pane__header-summary', 'flex-column')\n headerDetails.appendChild(headerSummary)\n\n const name = profileData?.name || utils.label(subject)\n const h1 = dom.createElement('h1')\n h1.classList.add('social-pane__header-name')\n h1.appendChild(dom.createTextNode(name))\n headerSummary.appendChild(h1)\n\n const pronounsSpan = dom.createElement('span')\n pronounsSpan.classList.add('social-pane_header-pronouns')\n headerSummary.appendChild(pronounsSpan)\n\n const jobAndOrganization = [profileData?.jobTitle, profileData?.organization].filter(Boolean).join(' | ')\n if (jobAndOrganization) {\n const jobLine = dom.createElement('div')\n jobLine.className = 'social-pane__header-job-org'\n jobLine.textContent = jobAndOrganization\n headerSummary.appendChild(jobLine)\n }\n\n if (profileData?.location) {\n const locationLine = dom.createElement('div')\n locationLine.className = 'social-pane__header-location'\n\n const locationIconSpan = dom.createElement('span')\n locationIconSpan.classList.add('social-pane__header-location-icon', 'inline-flex-row')\n locationIconSpan.innerHTML = locationIcon\n locationLine.appendChild(locationIconSpan)\n locationLine.appendChild(dom.createTextNode(profileData.location))\n\n headerSummary.appendChild(locationLine)\n }\n\n const statsRow = dom.createElement('div')\n statsRow.className = 'social-pane__header-stats'\n\n const friendCount = dom.createElement('button')\n friendCount.className = 'social-pane__header-stat'\n friendCount.type = 'button'\n const friendCountLabel = dom.createElement('span')\n friendCountLabel.className = 'social-pane__header-stat-label'\n friendCountLabel.textContent = `${stats.friendCount} friend${stats.friendCount === 1 ? '' : 's'}`\n friendCount.appendChild(friendCountLabel)\n if (stats.onSelectFriends) {\n friendCount.addEventListener('click', stats.onSelectFriends)\n }\n statsRow.appendChild(friendCount)\n\n if (typeof stats.mutualFriendCount === 'number') {\n const mutualCount = dom.createElement('button')\n mutualCount.className = 'social-pane__header-stat'\n mutualCount.type = 'button'\n const mutualCountLabel = dom.createElement('span')\n mutualCountLabel.className = 'social-pane__header-stat-label'\n mutualCountLabel.textContent = `${stats.mutualFriendCount} mutual friend${stats.mutualFriendCount === 1 ? '' : 's'}`\n mutualCount.appendChild(mutualCountLabel)\n if (stats.onSelectMutual) {\n mutualCount.addEventListener('click', stats.onSelectMutual)\n }\n statsRow.appendChild(mutualCount)\n }\n\n headerSummary.appendChild(statsRow)\n appendProfileLinks(headerMedia, dom, kb, subject)\n }\n\n header.refreshSocialHeader = function (nextControls: HeaderControls) {\n headerControls = nextControls\n renderHeader()\n }\n\n renderHeader()\n\n return header\n}\n\nfunction createImage (dom: HTMLDocument, src: string | null | undefined, alt = ''): HTMLElement {\n if (src) {\n const img = dom.createElement('img')\n img.className = 'social-pane__header-hero'\n img.src = src\n img.alt = alt\n img.width = 180\n img.height = 180\n img.loading = 'eager'\n return img\n }\n\n const fallback = dom.createElement('div')\n fallback.className = 'social-pane__header-hero-alt flex-center'\n fallback.setAttribute('role', 'img')\n fallback.setAttribute('aria-label', alt)\n fallback.tabIndex = 0\n\n const icon = dom.createElement('span')\n icon.classList.add('social-pane__header-hero-icon', 'inline-flex-row')\n icon.innerHTML = personInCircleIconSvg\n fallback.appendChild(icon)\n\n return fallback\n}\n\nexport function createMutualSection (options: {\n dom: HTMLDocument,\n subject: NamedNode,\n familiar: string,\n me: NamedNode,\n meUri: string | null,\n incoming: boolean | NamedNode[] | undefined,\n outgoing: boolean | NamedNode[] | undefined,\n editable: boolean,\n profile: NamedNode | null,\n knows: NamedNode,\n mutualConnections: NamedNode[],\n link: (contents: Node, uri: string | null | undefined) => Node,\n text: (value: string) => Text,\n buildCheckboxForm: (\n label: string | Node,\n statement: Statement,\n state: boolean,\n options?: { disabled?: boolean, disabledTitle?: string }\n ) => HTMLElement,\n renderSupportingInfo: FriendRowRenderers['renderSupportingInfo'],\n renderNameSuffix: FriendRowRenderers['renderNameSuffix']\n}): { section: HTMLElement, content: HTMLElement, refreshMutualFriends: () => void } {\n const {\n dom,\n subject,\n familiar,\n me,\n meUri,\n incoming,\n outgoing,\n editable,\n profile,\n knows,\n mutualConnections,\n link,\n text,\n buildCheckboxForm,\n renderSupportingInfo,\n renderNameSuffix\n } = options\n\n let refreshMutualFriends = function () {}\n\n const mutualSection = dom.createElement('section')\n mutualSection.className = 'social-pane__mutual-friends social-primary__panel'\n mutualSection.id = 'social-panel-mutual'\n mutualSection.setAttribute('role', 'tabpanel')\n mutualSection.setAttribute('aria-labelledby', 'social-tab-mutual')\n\n const mutualContent = mutualSection.appendChild(dom.createElement('div'))\n mutualContent.classList.add('social-main', 'social-main--mutual', 'flex-column')\n\n const relationshipSummary = dom.createElement('div')\n relationshipSummary.classList.add('social-mutual-summary', 'flex-column')\n mutualContent.appendChild(relationshipSummary)\n\n const createRelationshipLine = function () {\n const line = relationshipSummary.appendChild(dom.createElement('div'))\n line.classList.add('social-mutual-summary-line')\n return line\n }\n\n const youAndThem = function () {\n const line = createRelationshipLine()\n line.appendChild(link(text('You'), meUri))\n line.appendChild(text(' and '))\n line.appendChild(link(text(familiar), subject.uri))\n return line\n }\n\n if (!incoming) {\n if (!outgoing) {\n const line = youAndThem()\n line.appendChild(text(' have not said you know each other.'))\n } else {\n const line = createRelationshipLine()\n line.appendChild(link(text('You'), meUri))\n line.appendChild(text(' know '))\n line.appendChild(link(text(familiar), subject.uri))\n line.appendChild(text(' (unconfirmed).'))\n }\n } else if (!outgoing) {\n relationshipSummary.classList.add('social-mutual-summary--confirm')\n\n const incomingLine = relationshipSummary.appendChild(dom.createElement('div'))\n incomingLine.classList.add('social-mutual-summary-line')\n incomingLine.appendChild(link(text(familiar), subject.uri))\n incomingLine.appendChild(text(' knows '))\n incomingLine.appendChild(link(text('you'), meUri))\n incomingLine.appendChild(text(' (unconfirmed).'))\n } else {\n const line = youAndThem()\n line.appendChild(text(' say you know each other.'))\n }\n\n const shouldShowCheckboxPreview = Boolean(incoming) && !outgoing\n if (shouldShowCheckboxPreview) {\n const confirmLabel = dom.createElement('span')\n confirmLabel.className = 'social-mutual-confirm-prompt'\n confirmLabel.appendChild(text('Confirm you know '))\n confirmLabel.appendChild(link(text(familiar), subject.uri))\n\n const relationshipForm = buildCheckboxForm(\n confirmLabel,\n new Statement(me, knows, subject, profile ?? undefined),\n Boolean(outgoing),\n {\n disabled: !editable,\n disabledTitle: !editable ? 'Your profile is not editable' : undefined\n }\n )\n relationshipForm.classList.add('social-mutual-checkbox-form')\n\n mutualContent.appendChild(relationshipForm)\n }\n\n if (mutualConnections.length) {\n const mutualFriendsTable = mutualContent.appendChild(dom.createElement('table'))\n mutualFriendsTable.className = 'social-main social-friends-list social-friends-grid'\n\n const createMutualRow = function (target: NamedNode) {\n return widgets.personTR(dom, ns.foaf('knows'), target, {\n renderSupportingInfo,\n renderNameSuffix\n })\n }\n\n refreshMutualFriends = function () {\n const sortedMutualConnections = [...mutualConnections].sort((left, right) => {\n const leftLabel = utils.label(left) || left.value\n const rightLabel = utils.label(right) || right.value\n return leftLabel.localeCompare(rightLabel)\n })\n\n utils.syncTableToArray(\n mutualFriendsTable,\n sortedMutualConnections,\n createMutualRow,\n function (row, thing) {\n const replacement = createMutualRow(thing)\n return replacement\n }\n )\n }\n\n refreshMutualFriends()\n }\n\n return { section: mutualSection, content: mutualContent, refreshMutualFriends }\n}\n\nexport function createAllFriendsSection (options: {\n dom: HTMLDocument,\n subject: NamedNode,\n profile: NamedNode | null,\n editable: boolean,\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}): { section: HTMLElement, mainTable: HTMLTableElement, friendsList: HTMLElement } {\n const { dom, subject, profile, editable, renderSupportingInfo, renderNameSuffix } = options\n\n const allFriends = dom.createElement('section')\n allFriends.className = 'social-pane__all-friends social-primary__panel'\n allFriends.id = 'social-panel-all-friends'\n allFriends.setAttribute('role', 'tabpanel')\n allFriends.setAttribute('aria-labelledby', 'social-tab-all-friends')\n\n const confirmationContainer = allFriends.appendChild(dom.createElement('div'))\n confirmationContainer.className = 'social-friends-delete-confirmation'\n\n const mainTable = allFriends.appendChild(dom.createElement('table'))\n mainTable.className = 'social-main'\n\n const friendsList = widgets.attachmentList(dom, subject, mainTable, {\n doc: profile,\n modify: !!editable,\n predicate: ns.foaf('knows'),\n noun: 'friend',\n confirmationContainer,\n // Social pane already owns the async refresh cycle for friend data in\n // socialPane.ts. Leave attachmentList's generic follow-up rerender disabled\n // here or each fetched friend profile will trigger an extra whole-table refresh\n // on top of the pane's own batched updates.\n refreshOnDocumentLoad: false,\n renderSupportingInfo,\n renderNameSuffix\n })\n friendsList.classList.add('social-friends-list')\n friendsList.style.marginTop = '0'\n\n const friendsListRow = friendsList.rows[0]\n const dropCell = friendsListRow.cells[0]\n const itemsCell = friendsListRow.cells[1]\n // Keep attachmentList's wired drop cell and move the grid into it, so drops\n // anywhere in the list use the widget's existing save and refresh handlers.\n dropCell.replaceChildren(...Array.from(itemsCell.childNodes))\n dropCell.classList.add('social-friends-list-surface')\n itemsCell.remove()\n\n if (editable) {\n const hint = dom.createElement('p')\n hint.className = 'social-friends-drop-hint'\n hint.textContent = 'Drop a WebID anywhere here to add a friend.'\n dropCell.prepend(hint)\n }\n\n const friendsItemsTable = friendsList.querySelector('td table')\n if (friendsItemsTable instanceof HTMLTableElement) {\n friendsItemsTable.classList.add('social-friends-grid')\n }\n\n return { section: allFriends, mainTable, friendsList }\n}\n\nexport function createRequestsSection (options: {\n dom: HTMLDocument,\n triage: FriendshipTriage,\n renderSupportingInfo: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null,\n renderNameSuffix: (target: NamedNode, renderDom: HTMLDocument) => HTMLElement | null\n}): { section: HTMLElement, refreshRequests: (triage: FriendshipTriage) => void } {\n const { dom, triage, renderSupportingInfo, renderNameSuffix } = options\n\n const requestsSection = dom.createElement('section')\n requestsSection.className = 'social-pane__requests social-primary__panel'\n requestsSection.id = 'social-panel-requests'\n requestsSection.setAttribute('role', 'tabpanel')\n requestsSection.setAttribute('aria-labelledby', 'social-tab-requests')\n\n const requestsContent = requestsSection.appendChild(dom.createElement('div'))\n requestsContent.classList.add('social-main', 'social-main--requests', 'flex-column')\n\n const note = requestsContent.appendChild(dom.createElement('p'))\n note.className = 'social-requests__note'\n note.textContent = 'Best effort preview: this view only reflects profile documents that are currently loaded. A dedicated inbox would still be needed for complete request discovery.'\n\n const createRequestGroup = function (title: string, description: string, emptyText: string) {\n const group = requestsContent.appendChild(dom.createElement('section'))\n group.classList.add('social-requests__group', 'flex-column')\n\n const header = group.appendChild(dom.createElement('div'))\n header.className = 'social-requests__group-header'\n\n const heading = header.appendChild(dom.createElement('h2'))\n heading.className = 'social-requests__group-title'\n heading.textContent = title\n\n const blurb = header.appendChild(dom.createElement('p'))\n blurb.className = 'social-requests__group-description'\n blurb.textContent = description\n\n const empty = group.appendChild(dom.createElement('p'))\n empty.className = 'social-requests__empty'\n empty.textContent = emptyText\n\n const table = group.appendChild(dom.createElement('table'))\n table.className = 'social-main social-friends-list social-friends-grid social-requests__table'\n\n return { empty, table }\n }\n\n const incomingGroup = createRequestGroup(\n 'Incoming requests',\n 'People who say they know this profile, but have not been confirmed yet.',\n 'No incoming requests are visible from the currently loaded data.'\n )\n const pendingGroup = createRequestGroup(\n 'Awaiting confirmation',\n 'People this profile knows who have not linked back yet.',\n 'Nothing is waiting for confirmation right now.'\n )\n\n const createPersonRow = function (target: NamedNode) {\n return widgets.personTR(dom, ns.foaf('knows'), target, {\n renderSupportingInfo,\n renderNameSuffix\n })\n }\n\n const sortNodes = function (nodes: NamedNode[]) {\n return [...nodes].sort((left, right) => {\n const leftLabel = utils.label(left) || left.value\n const rightLabel = utils.label(right) || right.value\n return leftLabel.localeCompare(rightLabel)\n })\n }\n\n const syncRequestGroup = function (\n group: { empty: HTMLElement, table: HTMLTableElement },\n nodes: NamedNode[]\n ) {\n const sortedNodes = sortNodes(nodes)\n group.empty.hidden = sortedNodes.length > 0\n group.table.hidden = sortedNodes.length === 0\n\n utils.syncTableToArray(\n group.table,\n sortedNodes,\n createPersonRow,\n function (_row, thing) {\n return createPersonRow(thing)\n }\n )\n }\n\n const refreshRequests = function (nextTriage: FriendshipTriage) {\n syncRequestGroup(incomingGroup, nextTriage.requests)\n syncRequestGroup(pendingGroup, nextTriage.unconfirmed)\n }\n\n refreshRequests(triage)\n\n return { section: requestsSection, refreshRequests }\n}\n"],"mappings":";;;;;AAkMA,SAAgBA,EAAqB,GAsBgD;CACnF,IAAM,EACJ,QACA,YACA,aACA,OACA,UACA,aACA,aACA,aACA,YACA,UACA,sBACA,SACA,SACA,sBACA,yBACA,wBACEC,GAEAC,IAAuB,WAAY,CAAC,GAElCC,IAAgBC,EAAI,cAAc,SAAS;CAIjD,AAHA,EAAc,YAAY,qDAC1B,EAAc,KAAK,uBACnBD,EAAc,aAAa,QAAQ,UAAU,GAC7CA,EAAc,aA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rD;GACA;EACF,CAAC;CACH,GAEMmC,IAAY,SAAU,GAAoB;EAC9C,OAAO,CAAC,GAAGC,CAAK,CAAC,CAAC,MAAM,GAAM,MAAU;GACtC,IAAMlC,IAAYC,EAAM,MAAMC,CAAI,KAAKA,EAAK,OACtCC,IAAaF,EAAM,MAAMG,CAAK,KAAKA,EAAM;GAC/C,OAAOJ,EAAU,cAAcG,CAAU;EAC3C,CAAC;CACH,GAEMgC,IAAmB,SACvB,GACA,GACA;EACA,IAAMC,IAAcH,EAAUC,CAAK;EAInC,AAHA,EAAM,MAAM,SAASE,EAAY,SAAS,GAC1C,EAAM,MAAM,SAASA,EAAY,WAAW,GAE5CnC,EAAM,iBACJoB,EAAM,OACNe,GACAJ,GACA,SAAU,GAAM,GAAO;GACrB,OAAOA,EAAgB3B,CAAK;EAC9B,CACF;CACF,GAEMgC,IAAkB,SAAU,GAA8B;EAE9D,AADAF,EAAiBL,GAAeQ,EAAW,QAAQ,GACnDH,EAAiBJ,GAAcO,EAAW,WAAW;CACvD;CAIA,OAFAD,EAAgBE,CAAM,GAEf;EAAE,SAAStB;EAAiB;CAAgB;AACrD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ns as e } from "solid-ui";
|
|
2
|
-
|
|
2
|
+
// src/social/triage.ts
|
|
3
3
|
function t(e) {
|
|
4
4
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
5
5
|
for (let r of e) {
|
|
@@ -38,7 +38,6 @@ async function r(t, r) {
|
|
|
38
38
|
} catch {}
|
|
39
39
|
return n(i, r);
|
|
40
40
|
}
|
|
41
|
-
//#endregion
|
|
42
41
|
export { r as loadFriendshipTriage, n as triageFriends };
|
|
43
42
|
|
|
44
43
|
//# sourceMappingURL=triage.esm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { icons as e, ns as t, tabs as n, widgets as r } from "solid-ui";
|
|
2
|
-
|
|
2
|
+
// src/tabbed/tabbedPane.ts
|
|
3
3
|
var i = {
|
|
4
4
|
icon: e.iconBase + "noun_688606.svg",
|
|
5
5
|
name: "tabbed",
|
|
@@ -32,7 +32,6 @@ var i = {
|
|
|
32
32
|
})(), s;
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
//#endregion
|
|
36
35
|
export { i as default };
|
|
37
36
|
|
|
38
37
|
//# sourceMappingURL=tabbedPane.esm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "solid-ui";
|
|
2
|
-
|
|
2
|
+
// src/tableViewPane.js
|
|
3
3
|
var t = {
|
|
4
4
|
icon: e.icons.originalIconBase + "table.png",
|
|
5
5
|
name: "tableOfClass",
|
|
@@ -14,7 +14,6 @@ var t = {
|
|
|
14
14
|
return i.setAttribute("class", "tablePane"), i.appendChild(e.table(r, { tableClass: t })), i;
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { t as tableViewPane };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=tableViewPane.esm.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as e from "solid-ui";
|
|
2
2
|
import * as t from "rdflib";
|
|
3
|
-
|
|
3
|
+
// src/transaction/pane.js
|
|
4
4
|
var n = e.ns, r = {
|
|
5
5
|
icon: e.icons.iconBase + "noun_106746.svg",
|
|
6
6
|
name: "transaction",
|
|
@@ -206,7 +206,6 @@ var n = e.ns, r = {
|
|
|
206
206
|
return u;
|
|
207
207
|
}
|
|
208
208
|
};
|
|
209
|
-
//#endregion
|
|
210
209
|
export { r as default };
|
|
211
210
|
|
|
212
211
|
//# sourceMappingURL=pane.esm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "solid-ui";
|
|
2
|
-
|
|
2
|
+
// src/transaction/period.js
|
|
3
3
|
var t = e.ns, n = {
|
|
4
4
|
icon: e.icons.iconBase + "noun_142708.svg",
|
|
5
5
|
name: "period",
|
|
@@ -120,7 +120,6 @@ var t = e.ns, n = {
|
|
|
120
120
|
return o;
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
|
-
//#endregion
|
|
124
123
|
export { n as default };
|
|
125
124
|
|
|
126
125
|
//# sourceMappingURL=period.esm.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as e from "solid-ui";
|
|
2
2
|
import * as t from "rdflib";
|
|
3
|
-
|
|
3
|
+
// src/trip/tripPane.js
|
|
4
4
|
var n = e.ns, r = {
|
|
5
5
|
icon: e.icons.iconBase + "noun_62007.svg",
|
|
6
6
|
name: "travel expenses",
|
|
@@ -79,7 +79,6 @@ var n = e.ns, r = {
|
|
|
79
79
|
return l;
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
//#endregion
|
|
83
82
|
export { r as default };
|
|
84
83
|
|
|
85
84
|
//# sourceMappingURL=tripPane.esm.js.map
|
|
@@ -2,7 +2,7 @@ import { generateRandomString as e, getStatementsToAdd as t, getStatementsToDele
|
|
|
2
2
|
import { ns as r } from "solid-ui";
|
|
3
3
|
import { store as i } from "solid-logic";
|
|
4
4
|
import { sym as a } from "rdflib";
|
|
5
|
-
|
|
5
|
+
// src/trustedApplications/trustedApplications.dom.ts
|
|
6
6
|
function o(e) {
|
|
7
7
|
let t = c("table", { class: "results" }), n = l("tr", [
|
|
8
8
|
u("th", "Application URL"),
|
|
@@ -102,7 +102,6 @@ function d({ appModes: e, formElements: t }) {
|
|
|
102
102
|
value: r.acl(n).uri
|
|
103
103
|
}, {}, (e) => t.modes.push(e)), u("span", n)]));
|
|
104
104
|
}
|
|
105
|
-
//#endregion
|
|
106
105
|
export { o as createApplicationTable, l as createContainer, u as createText };
|
|
107
106
|
|
|
108
107
|
//# sourceMappingURL=trustedApplications.dom.esm.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlankNode as e, st as t, sym as n } from "rdflib";
|
|
2
|
-
|
|
2
|
+
// src/trustedApplications/trustedApplications.utils.ts
|
|
3
3
|
function r(e, t, n, r) {
|
|
4
4
|
return n.statementsMatching(null, r.acl("origin"), e).reduce((e, i) => e.concat(n.statementsMatching(t, r.acl("trustedApp"), i.subject)).concat(n.statementsMatching(i.subject)), []);
|
|
5
5
|
}
|
|
@@ -14,7 +14,6 @@ function i(r, i, a, o, s) {
|
|
|
14
14
|
function a() {
|
|
15
15
|
return Math.random().toString(36).substr(2, 5);
|
|
16
16
|
}
|
|
17
|
-
//#endregion
|
|
18
17
|
export { a as generateRandomString, i as getStatementsToAdd, r as getStatementsToDelete };
|
|
19
18
|
|
|
20
19
|
//# sourceMappingURL=trustedApplications.utils.esm.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createApplicationTable as e, createContainer as t, createText as n } from "./trustedApplications.dom.esm.js";
|
|
2
2
|
import { icons as r, login as i, widgets as a } from "solid-ui";
|
|
3
3
|
import { store as o } from "solid-logic";
|
|
4
|
-
|
|
4
|
+
// src/trustedApplications/trustedApplications.view.ts
|
|
5
5
|
var s = {
|
|
6
6
|
global: !0,
|
|
7
7
|
icon: `${r.iconBase}noun_15177.svg`,
|
|
@@ -35,7 +35,6 @@ async function c(r, s, c) {
|
|
|
35
35
|
s.appendChild(n("li", "They will not gain more access than you have."))
|
|
36
36
|
])), s.appendChild(n("p", "Application URLs must be valid URL. Examples are http://localhost:3000, https://trusted.app, and https://sub.trusted.app."));
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { s as default };
|
|
40
39
|
|
|
41
40
|
//# sourceMappingURL=trustedApplications.view.esm.js.map
|
package/dist/ui/pane.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as e from "solid-ui";
|
|
2
2
|
import * as t from "rdflib";
|
|
3
|
-
|
|
3
|
+
// src/ui/pane.js
|
|
4
4
|
var n = e.ns, r = {
|
|
5
5
|
icon: e.icons.iconBase + "noun_170702.svg",
|
|
6
6
|
name: "ui",
|
|
@@ -47,7 +47,6 @@ var n = e.ns, r = {
|
|
|
47
47
|
}), s;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
//#endregion
|
|
51
50
|
export { r as default };
|
|
52
51
|
|
|
53
52
|
//# sourceMappingURL=pane.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./webIdUtils.cjs.js"),n=require("./podUtils.cjs.js"),r=require("../icons/folder.cjs.js"),i=require("../icons/person.cjs.js"),a=require("../icons/friends.cjs.js");let o=require("pane-registry");o=e.__toESM(o);let s=require("rdflib");var c=r.default,l=i.default,u=a.default;function d(e,t,n,r,i,a){return{name:e.name,paneName:n,tabName:a,label:function(){return r},render:function(
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./webIdUtils.cjs.js"),n=require("./podUtils.cjs.js"),r=require("../icons/folder.cjs.js"),i=require("../icons/person.cjs.js"),a=require("../icons/friends.cjs.js");let o=require("pane-registry");o=e.__toESM(o);let s=require("rdflib");var c=r.default,l=i.default,u=a.default;function d(e,t,n,r,i,a){return{name:e.name,paneName:n,tabName:a,label:function(){return r},render:function(r,i,a){return e.render(t,i,n===`folder`?{...a,solo:!1,fullView:!1}:a)},shouldGetFocus:function(){return!1},requireQueryButton:!!e.requireQueryButton,subject:t,icon:i}}async function f(e,n,r=`Pane`,i=``,a=o.byName){let c=new URL(window.location.href),l=n||(0,s.sym)(c.toString()),u=await t.loadProfileFromURI(l);if(!u||!u.value)return null;let f=a(e);return f?d(f,u,e,r,i):null}async function p(e,n=o.byName){if(e&&t.isWebIdUri(e)){let t=n(`profile`);return t?d(t,e,`profile`,`Profile`,l):null}return f(`profile`,e,`Profile`,l,n)}async function m(e,t=o.byName){return f(`social`,e,`Social`,u,t)}async function h(e,t){let n=o.byName(`folder`);return n?d(n,e,n.name,t||`Storage`,c):null}async function g(e){let t=await n.getPodStorages(e);return t.length===0?[]:Promise.all(t.map((e,n)=>h(e,t.length>1?`Storage ${n+1}`:`Storage`))).then(e=>e.filter(e=>e!==null))}exports.createPaneItem=d,exports.getFolderPaneForStorage=h,exports.getFolderPanesFromURI=g,exports.getPaneItemFromURI=f,exports.getProfilePaneFromURI=p,exports.getSocialPaneFromURI=m;
|
|
2
2
|
//# sourceMappingURL=paneUtils.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paneUtils.cjs.js","names":["folderIcon","personIcon","friendsIcon","sym","loadProfileFromURI","
|
|
1
|
+
{"version":3,"file":"paneUtils.cjs.js","names":["folderIcon","personIcon","friendsIcon","paneRegistry","sym","loadProfileFromURI","isWebIdUri","getPodStorages","require_runtime","require_webIdUtils","require_podUtils","require_folder","require_person","require_friends","pane_registry","rdflib","FOLDER_ICON","PERSON_ICON","FRIENDS_ICON","createPaneItem","pane","labelText","subject","context","paneName","options","getPaneItemFromURI","windowHref","finalURL","webId","byName","icon","getProfilePaneFromURI","getSocialPaneFromURI","getFolderPaneForStorage","folderPane","podUrl","label","getFolderPanesFromURI","podStorages","pod","index","panes"],"sources":["../../src/utils/paneUtils.ts"],"sourcesContent":["import * as paneRegistry from 'pane-registry'\nimport folderIcon from '../icons/folder.svg'\nimport personIcon from '../icons/person.svg'\nimport friendsIcon from '../icons/friends.svg'\nimport { isWebIdUri, loadProfileFromURI } from './webIdUtils'\nimport { getPodStorages } from './podUtils'\nimport { NamedNode, sym } from 'rdflib'\n\nconst FOLDER_ICON = folderIcon\nconst PERSON_ICON = personIcon\nconst FRIENDS_ICON = friendsIcon\n\nexport type PaneItem = {\n name: string\n paneName: string\n tabName?: string\n label: () => string\n render: (subject: NamedNode, context: any, options: any) => any\n shouldGetFocus: () => boolean\n requireQueryButton: boolean\n subject: NamedNode\n icon: string\n}\n\ntype PaneLookup = (name: string) => any\n\nexport function createPaneItem (\n pane: any,\n subject: NamedNode,\n paneName: string,\n labelText: string,\n icon: string,\n tabName?: string\n): PaneItem {\n return {\n name: pane.name,\n paneName,\n tabName,\n label: function () {\n return labelText\n },\n render: function (_subject, context, options) {\n // Storage is an explicit browser view, even though GotoSubject uses solo for top-level navigation.\n return pane.render(subject, context, paneName === 'folder' ? { ...options, solo: false, fullView: false } : options)\n },\n shouldGetFocus: function () {\n return false\n },\n requireQueryButton: !!pane.requireQueryButton,\n subject,\n icon\n }\n}\n\nexport async function getPaneItemFromURI (\n paneName: string,\n subject?: NamedNode,\n labelText = 'Pane',\n icon = '',\n byName: PaneLookup = paneRegistry.byName\n): Promise<PaneItem | null> {\n const windowHref = new URL(window.location.href)\n const finalURL = subject || sym(windowHref.toString())\n const webId = await loadProfileFromURI(finalURL)\n if (!webId || !webId.value) return null\n\n const pane = byName(paneName)\n if (!pane) return null\n\n return createPaneItem(pane, webId, paneName, labelText, icon)\n}\n\nexport async function getProfilePaneFromURI (subject?: NamedNode, byName: PaneLookup = paneRegistry.byName) {\n if (subject && isWebIdUri(subject)) {\n const pane = byName('profile')\n return pane\n ? createPaneItem(pane, subject, 'profile', 'Profile', PERSON_ICON)\n : null\n }\n return getPaneItemFromURI('profile', subject, 'Profile', PERSON_ICON, byName)\n}\n\nexport async function getSocialPaneFromURI (subject?: NamedNode, byName: PaneLookup = paneRegistry.byName) {\n return getPaneItemFromURI('social', subject, 'Social', FRIENDS_ICON, byName)\n}\n\nexport async function getFolderPaneForStorage (podUrl: NamedNode, label?: string): Promise<PaneItem | null> {\n const folderPane = paneRegistry.byName('folder')\n if (!folderPane) return null\n\n return createPaneItem(folderPane, podUrl, folderPane.name, label || 'Storage', FOLDER_ICON)\n}\nexport async function getFolderPanesFromURI (subject: NamedNode): Promise<PaneItem[]> {\n const podStorages = await getPodStorages(subject)\n if (podStorages.length === 0) return []\n\n return Promise.all(\n podStorages.map((pod, index) =>\n getFolderPaneForStorage(\n pod,\n podStorages.length > 1 ? `Storage ${index + 1}` : 'Storage'\n )\n )\n ).then(panes => panes.filter((pane): pane is PaneItem => pane !== null))\n}\n"],"mappings":"A,2SAQA,IAAMgB,EAAchB,EAAAA,QACdiB,EAAchB,EAAAA,QACdiB,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a,OAAO,QAAQ,EAG/C,OAFKgC,EAEEhB,EAAegB,EAAYC,EAAQD,EAAW,KAAME,GAAS,UAAWrB,CAAW,EAFlE,IAG1B,CACA,eAAsBsB,EAAuB,EAAyC,CACpF,IAAMC,EAAc,MAAMhC,EAAAA,eAAee,CAAO,EAGhD,OAFIiB,EAAY,SAAW,EAAU,CAAC,EAE/B,QAAQ,IACbA,EAAY,KAAK,EAAK,IACpBL,EACEM,EACAD,EAAY,OAAS,EAAI,WAAWE,EAAQ,IAAM,SACpD,CACF,CACF,CAAC,CAAC,KAAK,GAASC,EAAM,OAAQ,GAA2BtB,IAAS,IAAI,CAAC,CACzE,C"}
|
|
@@ -10,10 +10,12 @@ export type PaneItem = {
|
|
|
10
10
|
subject: NamedNode;
|
|
11
11
|
icon: string;
|
|
12
12
|
};
|
|
13
|
+
type PaneLookup = (name: string) => any;
|
|
13
14
|
export declare function createPaneItem(pane: any, subject: NamedNode, paneName: string, labelText: string, icon: string, tabName?: string): PaneItem;
|
|
14
|
-
export declare function getPaneItemFromURI(paneName: string, subject?: NamedNode, labelText?: string, icon?: string): Promise<PaneItem | null>;
|
|
15
|
-
export declare function getProfilePaneFromURI(subject?: NamedNode): Promise<PaneItem | null>;
|
|
16
|
-
export declare function getSocialPaneFromURI(subject?: NamedNode): Promise<PaneItem | null>;
|
|
15
|
+
export declare function getPaneItemFromURI(paneName: string, subject?: NamedNode, labelText?: string, icon?: string, byName?: PaneLookup): Promise<PaneItem | null>;
|
|
16
|
+
export declare function getProfilePaneFromURI(subject?: NamedNode, byName?: PaneLookup): Promise<PaneItem | null>;
|
|
17
|
+
export declare function getSocialPaneFromURI(subject?: NamedNode, byName?: PaneLookup): Promise<PaneItem | null>;
|
|
17
18
|
export declare function getFolderPaneForStorage(podUrl: NamedNode, label?: string): Promise<PaneItem | null>;
|
|
18
19
|
export declare function getFolderPanesFromURI(subject: NamedNode): Promise<PaneItem[]>;
|
|
20
|
+
export {};
|
|
19
21
|
//# sourceMappingURL=paneUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paneUtils.d.ts","sourceRoot":"","sources":["../../src/utils/paneUtils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAMvC,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,MAAM,CAAA;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,GAAG,CAAA;IAC/D,cAAc,EAAE,MAAM,OAAO,CAAA;IAC7B,kBAAkB,EAAE,OAAO,CAAA;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,QAAQ,
|
|
1
|
+
{"version":3,"file":"paneUtils.d.ts","sourceRoot":"","sources":["../../src/utils/paneUtils.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAO,MAAM,QAAQ,CAAA;AAMvC,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,MAAM,CAAA;IACnB,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,KAAK,GAAG,CAAA;IAC/D,cAAc,EAAE,MAAM,OAAO,CAAA;IAC7B,kBAAkB,EAAE,OAAO,CAAA;IAC3B,OAAO,EAAE,SAAS,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,UAAU,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAA;AAEvC,wBAAgB,cAAc,CAC5B,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,SAAS,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GACf,QAAQ,CAmBV;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,SAAS,EACnB,SAAS,SAAS,EAClB,IAAI,SAAK,EACT,MAAM,GAAE,UAAgC,GACvC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAU1B;AAED,wBAAsB,qBAAqB,CAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAE,UAAgC,4BAQzG;AAED,wBAAsB,oBAAoB,CAAE,OAAO,CAAC,EAAE,SAAS,EAAE,MAAM,GAAE,UAAgC,4BAExG;AAED,wBAAsB,uBAAuB,CAAE,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAK1G;AACD,wBAAsB,qBAAqB,CAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAYpF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getPodStorages as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import { sym as
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
function
|
|
1
|
+
import { isWebIdUri as e, loadProfileFromURI as t } from "./webIdUtils.esm.js";
|
|
2
|
+
import { getPodStorages as n } from "./podUtils.esm.js";
|
|
3
|
+
import r from "../icons/folder.esm.js";
|
|
4
|
+
import i from "../icons/person.esm.js";
|
|
5
|
+
import a from "../icons/friends.esm.js";
|
|
6
|
+
import * as o from "pane-registry";
|
|
7
|
+
import { sym as s } from "rdflib";
|
|
8
|
+
// src/utils/paneUtils.ts
|
|
9
|
+
var c = r, l = i, u = a;
|
|
10
|
+
function d(e, t, n, r, i, a) {
|
|
11
11
|
return {
|
|
12
12
|
name: e.name,
|
|
13
13
|
paneName: n,
|
|
@@ -15,8 +15,12 @@ function u(e, t, n, r, i, a) {
|
|
|
15
15
|
label: function() {
|
|
16
16
|
return r;
|
|
17
17
|
},
|
|
18
|
-
render: function(
|
|
19
|
-
return e.render(t,
|
|
18
|
+
render: function(r, i, a) {
|
|
19
|
+
return e.render(t, i, n === "folder" ? {
|
|
20
|
+
...a,
|
|
21
|
+
solo: !1,
|
|
22
|
+
fullView: !1
|
|
23
|
+
} : a);
|
|
20
24
|
},
|
|
21
25
|
shouldGetFocus: function() {
|
|
22
26
|
return !1;
|
|
@@ -26,27 +30,30 @@ function u(e, t, n, r, i, a) {
|
|
|
26
30
|
icon: i
|
|
27
31
|
};
|
|
28
32
|
}
|
|
29
|
-
async function
|
|
30
|
-
let
|
|
31
|
-
if (!
|
|
32
|
-
let
|
|
33
|
-
return
|
|
33
|
+
async function f(e, n, r = "Pane", i = "", a = o.byName) {
|
|
34
|
+
let c = new URL(window.location.href), l = n || s(c.toString()), u = await t(l);
|
|
35
|
+
if (!u || !u.value) return null;
|
|
36
|
+
let f = a(e);
|
|
37
|
+
return f ? d(f, u, e, r, i) : null;
|
|
34
38
|
}
|
|
35
|
-
async function
|
|
36
|
-
|
|
39
|
+
async function p(t, n = o.byName) {
|
|
40
|
+
if (t && e(t)) {
|
|
41
|
+
let e = n("profile");
|
|
42
|
+
return e ? d(e, t, "profile", "Profile", l) : null;
|
|
43
|
+
}
|
|
44
|
+
return f("profile", t, "Profile", l, n);
|
|
37
45
|
}
|
|
38
|
-
async function
|
|
39
|
-
return
|
|
46
|
+
async function m(e, t = o.byName) {
|
|
47
|
+
return f("social", e, "Social", u, t);
|
|
40
48
|
}
|
|
41
|
-
async function
|
|
42
|
-
let n =
|
|
43
|
-
return n ?
|
|
49
|
+
async function h(e, t) {
|
|
50
|
+
let n = o.byName("folder");
|
|
51
|
+
return n ? d(n, e, n.name, t || "Storage", c) : null;
|
|
44
52
|
}
|
|
45
|
-
async function
|
|
46
|
-
let
|
|
47
|
-
return
|
|
53
|
+
async function g(e) {
|
|
54
|
+
let t = await n(e);
|
|
55
|
+
return t.length === 0 ? [] : Promise.all(t.map((e, n) => h(e, t.length > 1 ? `Storage ${n + 1}` : "Storage"))).then((e) => e.filter((e) => e !== null));
|
|
48
56
|
}
|
|
49
|
-
|
|
50
|
-
export { u as createPaneItem, m as getFolderPaneForStorage, h as getFolderPanesFromURI, d as getPaneItemFromURI, f as getProfilePaneFromURI, p as getSocialPaneFromURI };
|
|
57
|
+
export { d as createPaneItem, h as getFolderPaneForStorage, g as getFolderPanesFromURI, f as getPaneItemFromURI, p as getProfilePaneFromURI, m as getSocialPaneFromURI };
|
|
51
58
|
|
|
52
59
|
//# sourceMappingURL=paneUtils.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paneUtils.esm.js","names":["folderIcon","personIcon","friendsIcon","folder_default","person_default","friends_default","paneRegistry","FOLDER_ICON","PERSON_ICON","FRIENDS_ICON","createPaneItem","pane","labelText","subject","context","options","getPaneItemFromURI","windowHref","finalURL","sym","webId","loadProfileFromURI","
|
|
1
|
+
{"version":3,"file":"paneUtils.esm.js","names":["folderIcon","personIcon","friendsIcon","folder_default","person_default","friends_default","paneRegistry","FOLDER_ICON","PERSON_ICON","FRIENDS_ICON","createPaneItem","pane","labelText","subject","context","paneName","options","getPaneItemFromURI","windowHref","finalURL","sym","webId","loadProfileFromURI","byName","icon","getProfilePaneFromURI","isWebIdUri","getSocialPaneFromURI","getFolderPaneForStorage","folderPane","podUrl","label","getFolderPanesFromURI","podStorages","getPodStorages","pod","index","panes"],"sources":["../../src/utils/paneUtils.ts"],"sourcesContent":["import * as paneRegistry from 'pane-registry'\nimport folderIcon from '../icons/folder.svg'\nimport personIcon from '../icons/person.svg'\nimport friendsIcon from '../icons/friends.svg'\nimport { isWebIdUri, loadProfileFromURI } from './webIdUtils'\nimport { getPodStorages } from './podUtils'\nimport { NamedNode, sym } from 'rdflib'\n\nconst FOLDER_ICON = folderIcon\nconst PERSON_ICON = personIcon\nconst FRIENDS_ICON = friendsIcon\n\nexport type PaneItem = {\n name: string\n paneName: string\n tabName?: string\n label: () => string\n render: (subject: NamedNode, context: any, options: any) => any\n shouldGetFocus: () => boolean\n requireQueryButton: boolean\n subject: NamedNode\n icon: string\n}\n\ntype PaneLookup = (name: string) => any\n\nexport function createPaneItem (\n pane: any,\n subject: NamedNode,\n paneName: string,\n labelText: string,\n icon: string,\n tabName?: string\n): PaneItem {\n return {\n name: pane.name,\n paneName,\n tabName,\n label: function () {\n return labelText\n },\n render: function (_subject, context, options) {\n // Storage is an explicit browser view, even though GotoSubject uses solo for top-level navigation.\n return pane.render(subject, context, paneName === 'folder' ? { ...options, solo: false, fullView: false } : options)\n },\n shouldGetFocus: function () {\n return false\n },\n requireQueryButton: !!pane.requireQueryButton,\n subject,\n icon\n }\n}\n\nexport async function getPaneItemFromURI (\n paneName: string,\n subject?: NamedNode,\n labelText = 'Pane',\n icon = '',\n byName: PaneLookup = paneRegistry.byName\n): Promise<PaneItem | null> {\n const windowHref = new URL(window.location.href)\n const finalURL = subject || sym(windowHref.toString())\n const webId = await loadProfileFromURI(finalURL)\n if (!webId || !webId.value) return null\n\n const pane = byName(paneName)\n if (!pane) return null\n\n return createPaneItem(pane, webId, paneName, labelText, icon)\n}\n\nexport async function getProfilePaneFromURI (subject?: NamedNode, byName: PaneLookup = paneRegistry.byName) {\n if (subject && isWebIdUri(subject)) {\n const pane = byName('profile')\n return pane\n ? createPaneItem(pane, subject, 'profile', 'Profile', PERSON_ICON)\n : null\n }\n return getPaneItemFromURI('profile', subject, 'Profile', PERSON_ICON, byName)\n}\n\nexport async function getSocialPaneFromURI (subject?: NamedNode, byName: PaneLookup = paneRegistry.byName) {\n return getPaneItemFromURI('social', subject, 'Social', FRIENDS_ICON, byName)\n}\n\nexport async function getFolderPaneForStorage (podUrl: NamedNode, label?: string): Promise<PaneItem | null> {\n const folderPane = paneRegistry.byName('folder')\n if (!folderPane) return null\n\n return createPaneItem(folderPane, podUrl, folderPane.name, label || 'Storage', FOLDER_ICON)\n}\nexport async function getFolderPanesFromURI (subject: NamedNode): Promise<PaneItem[]> {\n const podStorages = await getPodStorages(subject)\n if (podStorages.length === 0) return []\n\n return Promise.all(\n podStorages.map((pod, index) =>\n getFolderPaneForStorage(\n pod,\n podStorages.length > 1 ? `Storage ${index + 1}` : 'Storage'\n )\n )\n ).then(panes => panes.filter((pane): pane is PaneItem => pane !== null))\n}\n"],"mappings":";;;;;;;;AAQA,IAAMO,IAAcP,GACdQ,IAAcP,GACdQ,IAAeP;AAgBrB,SAAgBQ,EACd,GACA,GACA,GACA,GACA,GACA,GACU;CACV,OAAO;EACL,MAAMC,EAAK;EACX;EACA;EACA,OAAO,WAAY;GACjB,OAAOC;EACT;EACA,QAAQ,SAAU,GAAU,GAAS,GAAS;GAE5C,OAAOD,EAAK,OAAOE,GAASC,GAASC,MAAa,WAAW;IAAE,GAAGC;IAAS,MAAM;IAAO,UAAU;GAAM,IAAIA,CAAO;EACrH;EACA,gBAAgB,WAAY;GAC1B,OAAO;EACT;EACA,oBAAoB,CAAC,CAACL,EAAK;EAC3B;EACA;CACF;AACF;AAEA,eAAsBM,EACpB,GACA,GACA,IAAY,QACZ,IAAO,IACP,IAAqBX,EAAa,QACR;CAC1B,IAAMY,IAAa,IAAI,IAAI,OAAO,SAAS,IAAI,GACzCC,IAAWN,KAAWO,EAAIF,EAAW,SAAS,CAAC,GAC/CG,IAAQ,MAAMC,EAAmBH,CAAQ;CAC/C,IAAI,CAACE,KAAS,CAACA,EAAM,OAAO,OAAO;CAEnC,IAAMV,IAAOY,EAAOR,CAAQ;CAG5B,OAFKJ,IAEED,EAAeC,GAAMU,GAAON,GAAUH,GAAWY,CAAI,IAF1C;AAGpB;AAEA,eAAsBC,EAAuB,GAAqB,IAAqBnB,EAAa,QAAQ;CAC1G,IAAIO,KAAWa,EAAWb,CAAO,GAAG;EAClC,IAAMF,IAAOY,EAAO,SAAS;EAC7B,OAAOZ,IACHD,EAAeC,GAAME,GAAS,WAAW,WAAWL,CAAW,IAC/D;CACN;CACA,OAAOS,EAAmB,WAAWJ,GAAS,WAAWL,GAAae,CAAM;AAC9E;AAEA,eAAsBI,EAAsB,GAAqB,IAAqBrB,EAAa,QAAQ;CACzG,OAAOW,EAAmB,UAAUJ,GAAS,UAAUJ,GAAcc,CAAM;AAC7E;AAEA,eAAsBK,EAAyB,GAAmB,GAA0C;CAC1G,IAAMC,IAAavB,EAAa,OAAO,QAAQ;CAG/C,OAFKuB,IAEEnB,EAAemB,GAAYC,GAAQD,EAAW,MAAME,KAAS,WAAWxB,CAAW,IAFlE;AAG1B;AACA,eAAsByB,EAAuB,GAAyC;CACpF,IAAMC,IAAc,MAAMC,EAAerB,CAAO;CAGhD,OAFIoB,EAAY,WAAW,IAAU,CAAC,IAE/B,QAAQ,IACbA,EAAY,KAAK,GAAK,MACpBL,EACEO,GACAF,EAAY,SAAS,IAAI,WAAWG,IAAQ,MAAM,SACpD,CACF,CACF,CAAC,CAAC,MAAK,MAASC,EAAM,QAAQ,MAA2B1B,MAAS,IAAI,CAAC;AACzE"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("./webIdUtils.cjs.js");let t=require("solid-ui"),n=require("solid-logic"),r=require("rdflib");
|
|
1
|
+
const e=require("./webIdUtils.cjs.js");let t=require("solid-ui"),n=require("solid-logic"),r=require("rdflib");async function i(r){if(e.isWebIdUri(r)){try{await n.store.fetcher.load(r.doc())}catch(e){console.warn(`Unable to load profile document for WebID`,r.doc().uri,e)}return n.store.each(r,t.ns.space(`storage`)).filter(e=>e.termType===`NamedNode`)}try{let e=await a(r);return e?[e]:[]}catch(e){return console.error(`cannot load container`,e),[]}}async function a(e){let t=new URL(e.value||e.uri),r=t.pathname;for(;r.length;){r=r.substring(0,r.lastIndexOf(`/`));let e=n.store.sym(`${t.origin}${r}/`);if(await o(e))return e}return null}async function o(e){return await s(e),n.store.holds(e,t.ns.rdf(`type`),t.ns.space(`Storage`),e.doc())}async function s(e){if(!n.store.any(e,t.ns.ldp(`contains`),void 0,e.doc()))try{let t=(await n.store.fetcher.webOperation(`GET`,e.uri,n.store.fetcher.initFetchOptions(e.uri,{headers:{accept:`text/turtle`}}))).responseText;e.uri&&t&&(0,r.parse)(t,n.store,e.uri,`text/turtle`)}catch(t){console.warn(`Unable to load container representation for`,e.uri,t)}}exports.getPodStorages=i,exports.loadContainerRepresentation=s;
|
|
2
2
|
//# sourceMappingURL=podUtils.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podUtils.cjs.js","names":["isWebIdUri","store","ns","ACL_LINK","require_webIdUtils","solid_ui","solid_logic","rdflib","parseWacAllowHeader","permissions","headerValue","entry","match","permissionGroup","accessModes","modes","mode","deriveAccessFlags","wacAllow","userModes","publicModes","getPodStorages","url","err","podStorages","isPodStorage","pod","storage","findPodStorageFromUrl","podStorage","pathStorage","candidate","loadContainerRepresentation","subject","containerTurtle","isContainerSubject","store","subjectUri","typeUris","getContainerItemCount","seen","item","resource","parent","pathEnd","getResponseMetadata","contentType","canEdit","isPublic","eTag","modified","response","accessFlags","responseNode","req","aclUri","fetchResourceMetadata","metadata"],"sources":["../../src/utils/podUtils.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { ns } from 'solid-ui'\nimport { LiveStore, NamedNode, parse } from 'rdflib'\nimport { isWebIdUri } from './webIdUtils'\nimport { ACL_LINK } from 'solid-logic'\nimport { FileExplorerResourceMetadata } from 'src/components/file-explorer-header/types'\n\nfunction parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nfunction deriveAccessFlags (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, isPublic: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n isPublic: publicModes.has('read') || publicModes.has('write')\n }\n}\n\nexport async function getPodStorages (url: NamedNode): Promise<NamedNode[]> {\n if (isWebIdUri(url)) {\n try {\n await store.fetcher.load(url.doc())\n } catch (err) {\n console.warn('Unable to load profile document for WebID', url.doc().uri, err)\n }\n const podStorages = store.each(url, ns.space('storage'))\n const results = await Promise.all(podStorages.map(async pod => await isPodStorage(pod as NamedNode) ? pod as NamedNode : null))\n return results.filter(pod => pod !== null) as NamedNode[]\n }\n try {\n const storage = await findPodStorageFromUrl(url)\n return storage ? [storage] : []\n } catch (err) {\n console.error('cannot load container', err)\n return []\n }\n}\n\nasync function findPodStorageFromUrl (url: NamedNode): Promise<NamedNode | null> {\n const podStorage = new URL(url.value || url.uri)\n let pathStorage = podStorage.pathname\n\n while (pathStorage.length) {\n pathStorage = pathStorage.substring(0, pathStorage.lastIndexOf('/'))\n const candidate = store.sym(`${podStorage.origin}${pathStorage}/`)\n if (await isPodStorage(candidate)) return candidate\n }\n\n // TODO should url.origin be added to pods list when there are no pim:Storage ???\n return null\n}\n\nasync function isPodStorage (pod: NamedNode): Promise<boolean> {\n await loadContainerRepresentation(pod)\n return store.holds(pod, ns.rdf('type'), ns.space('Storage'), pod.doc())\n}\n\nexport async function loadContainerRepresentation (subject) {\n // force reload for index.html with RDFa\n if (!store.any(subject, ns.ldp('contains'), undefined, subject.doc())) {\n try {\n const response = await store.fetcher.webOperation('GET', subject.uri, store.fetcher.initFetchOptions(subject.uri, { headers: { accept: 'text/turtle' } }))\n const containerTurtle = response.responseText\n if (subject.uri && containerTurtle) {\n parse(containerTurtle, store, subject.uri, 'text/turtle')\n }\n } catch (err) {\n console.warn('Unable to load container representation for', subject.uri, err)\n }\n }\n}\n\nexport function isContainerSubject (store: LiveStore | undefined, subjectUri: string | undefined): boolean {\n if (!store || !subjectUri) return false\n\n const subject = store.sym(subjectUri)\n const typeUris = store.findTypeURIs(subject)\n return Boolean(\n typeUris[ns.ldp('Container').uri] ||\n typeUris[ns.ldp('BasicContainer').uri] ||\n subject.uri.endsWith('/')\n )\n}\n\n// The shared rdflib store can hold duplicate ldp:contains statements for the\n// same child resource when the container and companion metadata are both loaded.\n// Count unique visible children here so the header summary matches the list UI.\nexport function getContainerItemCount (store: LiveStore | undefined, subjectUri: string | undefined): number {\n if (!store || !subjectUri) return 0\n\n const subject = store.sym(subjectUri)\n const seen = new Set<string>()\n\n for (const item of store.each(subject, ns.ldp('contains'))) {\n if (item.termType === 'NamedNode') {\n const resource = item as NamedNode\n const parent = resource.dir()\n\n if (parent) {\n const pathEnd = resource.uri.slice(parent.uri.length)\n if (\n !pathEnd.startsWith('.') &&\n !pathEnd.endsWith('.acl') &&\n !pathEnd.endsWith('~')\n ) {\n seen.add(resource.uri)\n }\n }\n }\n }\n return seen.size\n}\n\nexport function getResponseMetadata (store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let isPublic = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers && response.headers.get('content-type')) {\n contentType = response.headers.get('content-type')?.split(';')[0] ?? undefined\n const accessFlags = deriveAccessFlags(response.headers.get('wac-allow'))\n\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n } else {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.forEach((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n contentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = deriveAccessFlags(wacAllow)\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n return { contentType, canEdit, isPublic, aclUri, eTag, modified }\n}\n\nexport async function fetchResourceMetadata (store: LiveStore, subject: NamedNode): Promise<FileExplorerResourceMetadata> {\n const response = await store.fetcher.webOperation('HEAD', subject.uri)\n\n if (!response.ok) {\n throw new Error(`HEAD request failed with status ${response.status}`)\n }\n\n const metadata = getResponseMetadata(store, subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available!')\n }\n\n return metadata\n}\n"],"mappings":"A,8GAOA,SAASQ,EAAqB,EAAwC,CACpE,IAAMC,EAAc,IAAI,IACxB,GAAI,CAACC,EAAa,OAAOD,EAEzB,IAAK,IAAME,KAASD,EAAY,MAAM,GAAG,EAAG,CAC1C,IAAME,EAAQD,EAAM,KAAK,CAAC,CAAC,MAAM,+BAA+B,EAChE,GAAIC,EAAO,CACT,GAAM,EAAGC,EAAiBC,GAAeF,EACnCG,EAAQD,EAAY,KAAK,CAAC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AAejB,EAAM,IACzBkB,EACAlB,EAAM,IAAI,0CAA0C,CACtD,EACA,GAAIiB,GAAgBA,EAAa,WAAa,YAAa,CACzD,EAAcjB,EAAM,SAASiB,EAAqBnD,EAAAA,GAAG,MAAM,cAAc,CAAC,GAAK,IAAA,GAG/E,IAAMkD,EAAcnC,EAFFmB,EAAM,SAASiB,EAAqBnD,EAAAA,GAAG,MAAM,WAAW,CAAC,GACxEkC,EAAM,SAASiB,EAAqBnD,EAAAA,GAAG,MAAM,WAAW,CAAC,CACd,EAC9C,EAAUkD,EAAY,QACtB,EAAWA,EAAY,SACvB,EAAOhB,EAAM,SAASiB,EAAqBnD,EAAAA,GAAG,MAAM,MAAM,CAAC,GAAK,IAAA,GAChE,EAAWkC,EAAM,SAASH,EAAgB/B,EAAAA,GAAG,IAAI,UAAU,CAAC,GAAKkC,EAAM,SAASH,EAAgB/B,EAAAA,GAAG,GAAG,UAAU,CAAC,GAAK,IAAA,EACxH,CACF,CAAC,EAGH,IAAMqD,EAASnB,EAAM,IAAIH,EAAS9B,EAAAA,QAAQ,CAAC,EAAE,OAAS,IAAA,GACtD,MAAO,CAAE,cAAa,UAAS,WAAU,SAAQ,OAAM,UAAS,CAClE,CAEA,eAAsBqD,EAAuB,EAAkB,EAA2D,CACxH,IAAML,EAAW,MAAMf,EAAM,QAAQ,aAAa,OAAQH,EAAQ,GAAG,EAErE,GAAI,CAACkB,EAAS,GACZ,MAAU,MAAM,mCAAmCA,EAAS,QAAQ,EAGtE,IAAMM,EAAWZ,EAAoBT,EAAOH,EAASkB,CAAQ,EAC7D,GAAI,CAACM,EAAS,YACZ,MAAU,MAAM,4BAA4B,EAG9C,OAAOA,CACT,C"}
|
|
1
|
+
{"version":3,"file":"podUtils.cjs.js","names":["isWebIdUri","store","ns","require_webIdUtils","solid_ui","solid_logic","rdflib","getPodStorages","url","err","pod","storage","findPodStorageFromUrl","podStorage","pathStorage","candidate","isPodStorage","loadContainerRepresentation","subject","containerTurtle"],"sources":["../../src/utils/podUtils.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport { ns } from 'solid-ui'\nimport { LiveStore, NamedNode, parse } from 'rdflib'\nimport { isWebIdUri } from './webIdUtils'\nimport { ACL_LINK } from 'solid-logic'\n\ntype FileExplorerResourceMetadata = {\n contentType: string | undefined\n canEdit: boolean\n isPublic: boolean\n aclUri: string | undefined\n eTag: string | undefined\n modified: string | undefined\n}\n\nfunction parseWacAllowHeader (headerValue: string | null | undefined) {\n const permissions = new Map<string, Set<string>>()\n if (!headerValue) return permissions\n\n for (const entry of headerValue.split(',')) {\n const match = entry.trim().match(/^([A-Za-z]+)\\s*=\\s*\"([^\"]*)\"$/)\n if (match) {\n const [, permissionGroup, accessModes] = match\n const modes = accessModes.trim().split(/\\s+/).filter(Boolean)\n permissions.set(permissionGroup.toLowerCase(), new Set(modes.map(mode => mode.toLowerCase())))\n }\n }\n\n return permissions\n}\n\nfunction deriveAccessFlags (wacAllow: string | null | undefined) {\n if (!wacAllow) {\n return { canEdit: false, isPublic: false }\n }\n\n const permissions = parseWacAllowHeader(wacAllow)\n const userModes = permissions.get('user') ?? new Set<string>()\n const publicModes = permissions.get('public') ?? new Set<string>()\n\n return {\n canEdit: userModes.has('write'),\n isPublic: publicModes.has('read') || publicModes.has('write')\n }\n}\n\nexport async function getPodStorages (url: NamedNode): Promise<NamedNode[]> {\n if (isWebIdUri(url)) {\n try {\n await store.fetcher.load(url.doc())\n } catch (err) {\n console.warn('Unable to load profile document for WebID', url.doc().uri, err)\n }\n const podStorages = store.each(url, ns.space('storage'))\n // A WebID's pim:storage assertion is authoritative; not every server serializes space:Storage on its root container.\n return podStorages.filter((pod): pod is NamedNode => pod.termType === 'NamedNode')\n }\n try {\n const storage = await findPodStorageFromUrl(url)\n return storage ? [storage] : []\n } catch (err) {\n console.error('cannot load container', err)\n return []\n }\n}\n\nasync function findPodStorageFromUrl (url: NamedNode): Promise<NamedNode | null> {\n const podStorage = new URL(url.value || url.uri)\n let pathStorage = podStorage.pathname\n\n while (pathStorage.length) {\n pathStorage = pathStorage.substring(0, pathStorage.lastIndexOf('/'))\n const candidate = store.sym(`${podStorage.origin}${pathStorage}/`)\n if (await isPodStorage(candidate)) return candidate\n }\n\n // TODO should url.origin be added to pods list when there are no pim:Storage ???\n return null\n}\n\nasync function isPodStorage (pod: NamedNode): Promise<boolean> {\n await loadContainerRepresentation(pod)\n return store.holds(pod, ns.rdf('type'), ns.space('Storage'), pod.doc())\n}\n\nexport async function loadContainerRepresentation (subject) {\n // force reload for index.html with RDFa\n if (!store.any(subject, ns.ldp('contains'), undefined, subject.doc())) {\n try {\n const response = await store.fetcher.webOperation('GET', subject.uri, store.fetcher.initFetchOptions(subject.uri, { headers: { accept: 'text/turtle' } }))\n const containerTurtle = response.responseText\n if (subject.uri && containerTurtle) {\n parse(containerTurtle, store, subject.uri, 'text/turtle')\n }\n } catch (err) {\n console.warn('Unable to load container representation for', subject.uri, err)\n }\n }\n}\n\nexport function isContainerSubject (store: LiveStore | undefined, subjectUri: string | undefined): boolean {\n if (!store || !subjectUri) return false\n\n const subject = store.sym(subjectUri)\n const typeUris = store.findTypeURIs(subject)\n return Boolean(\n typeUris[ns.ldp('Container').uri] ||\n typeUris[ns.ldp('BasicContainer').uri] ||\n subject.uri.endsWith('/')\n )\n}\n\n// The shared rdflib store can hold duplicate ldp:contains statements for the\n// same child resource when the container and companion metadata are both loaded.\n// Count unique visible children here so the header summary matches the list UI.\nexport function getContainerItemCount (store: LiveStore | undefined, subjectUri: string | undefined): number {\n if (!store || !subjectUri) return 0\n\n const subject = store.sym(subjectUri)\n const seen = new Set<string>()\n\n for (const item of store.each(subject, ns.ldp('contains'))) {\n if (item.termType === 'NamedNode') {\n const resource = item as NamedNode\n const parent = resource.dir()\n\n if (parent) {\n const pathEnd = resource.uri.slice(parent.uri.length)\n if (\n !pathEnd.startsWith('.') &&\n !pathEnd.endsWith('.acl') &&\n !pathEnd.endsWith('~')\n ) {\n seen.add(resource.uri)\n }\n }\n }\n }\n return seen.size\n}\n\nexport function getResponseMetadata (store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata {\n let contentType: string | undefined\n let canEdit = false\n let isPublic = false\n let eTag: string | undefined\n let modified: string | undefined\n\n if (response.headers && response.headers.get('content-type')) {\n contentType = response.headers.get('content-type')?.split(';')[0] ?? undefined\n const accessFlags = deriveAccessFlags(response.headers.get('wac-allow'))\n\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = response.headers.get('etag') ?? undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n } else {\n const reqs = store.each(\n null,\n store.sym('http://www.w3.org/2007/ont/link#requestedURI'),\n subject\n )\n reqs.forEach((req: any) => {\n const responseNode = store.any(\n req as any,\n store.sym('http://www.w3.org/2007/ont/link#response')\n )\n if (responseNode && responseNode.termType === 'NamedNode') {\n contentType = store.anyValue(responseNode as any, ns.httph('content-type')) || undefined\n const wacAllow = (store.anyValue(responseNode as any, ns.httph('wac-allow')) as string | undefined) ||\n (store.anyValue(responseNode as any, ns.httph('WAC-Allow')) as string | undefined)\n const accessFlags = deriveAccessFlags(wacAllow)\n canEdit = accessFlags.canEdit\n isPublic = accessFlags.isPublic\n eTag = store.anyValue(responseNode as any, ns.httph('etag')) || undefined\n modified = store.anyValue(subject as any, ns.dct('modified')) || store.anyValue(subject as any, ns.dc('modified')) || undefined\n }\n })\n }\n\n const aclUri = store.any(subject, ACL_LINK)?.value || undefined\n return { contentType, canEdit, isPublic, aclUri, eTag, modified }\n}\n\nexport async function fetchResourceMetadata (store: LiveStore, subject: NamedNode): Promise<FileExplorerResourceMetadata> {\n const response = await store.fetcher.webOperation('HEAD', subject.uri)\n\n if (!response.ok) {\n throw new Error(`HEAD request failed with status ${response.status}`)\n }\n\n const metadata = getResponseMetadata(store, subject, response)\n if (!metadata.contentType) {\n throw new Error('No content-type available!')\n }\n\n return metadata\n}\n"],"mappings":"A,8GA8CA,eAAsB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AAM,QAAQ,aAAa,MAAOiB,EAAQ,IAAKjB,EAAAA,MAAM,QAAQ,iBAAiBiB,EAAQ,IAAK,CAAE,QAAS,CAAE,OAAQ,aAAc,CAAE,CAAC,CAAC,EAAA,CACxH,aAC7BA,EAAQ,KAAOC,IACjB,EAAAb,EAAA,MAAA,CAAMa,EAAiBlB,EAAAA,MAAOiB,EAAQ,IAAK,aAAa,CAE5D,OAAST,EAAK,CACZ,QAAQ,KAAK,8CAA+CS,EAAQ,IAAKT,CAAG,CAC9E,CAEJ,C"}
|
package/dist/utils/podUtils.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { LiveStore, NamedNode } from '../../node_modules/rdflib';
|
|
2
|
-
|
|
2
|
+
type FileExplorerResourceMetadata = {
|
|
3
|
+
contentType: string | undefined;
|
|
4
|
+
canEdit: boolean;
|
|
5
|
+
isPublic: boolean;
|
|
6
|
+
aclUri: string | undefined;
|
|
7
|
+
eTag: string | undefined;
|
|
8
|
+
modified: string | undefined;
|
|
9
|
+
};
|
|
3
10
|
export declare function getPodStorages(url: NamedNode): Promise<NamedNode[]>;
|
|
4
11
|
export declare function loadContainerRepresentation(subject: any): Promise<void>;
|
|
5
12
|
export declare function isContainerSubject(store: LiveStore | undefined, subjectUri: string | undefined): boolean;
|
|
6
13
|
export declare function getContainerItemCount(store: LiveStore | undefined, subjectUri: string | undefined): number;
|
|
7
14
|
export declare function getResponseMetadata(store: LiveStore, subject: NamedNode, response: Response): FileExplorerResourceMetadata;
|
|
8
15
|
export declare function fetchResourceMetadata(store: LiveStore, subject: NamedNode): Promise<FileExplorerResourceMetadata>;
|
|
16
|
+
export {};
|
|
9
17
|
//# sourceMappingURL=podUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"podUtils.d.ts","sourceRoot":"","sources":["../../src/utils/podUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"podUtils.d.ts","sourceRoot":"","sources":["../../src/utils/podUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAS,MAAM,QAAQ,CAAA;AAIpD,KAAK,4BAA4B,GAAG;IAClC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B,CAAA;AAiCD,wBAAsB,cAAc,CAAE,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAkB1E;AAqBD,wBAAsB,2BAA2B,CAAE,OAAO,KAAA,iBAazD;AAED,wBAAgB,kBAAkB,CAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAUzG;AAKD,wBAAgB,qBAAqB,CAAE,KAAK,EAAE,SAAS,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAwB3G;AAED,wBAAgB,mBAAmB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,4BAA4B,CAyC3H;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAaxH"}
|