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":"humanReadablePane2.esm.js","names":["DOMPurify","isMarkdownFile","uri","path","dokieliCache","applyFrameClasses","frame","modifier","lines","humanReadablePane","subject","icons","kb","context","cachedResult","responseText","text","isDokieli","cts","response","allowed","hasContentTypeIn","x","j","k","displayables","hasContentTypeIn2","t","Util","ns","myDocument","div","applyEnvironmentAttributes","environment","ct","isMarkdown","isPlainText","renderMarkdownContent","markdownText","res","marked","error","renderPlainTextContent","plainText","setIframeAttributes","frameContainer","blobText","newLines"],"sources":["../src/humanReadablePane.ts"],"sourcesContent":["/* Human-readable Pane\n **\n ** This outline pane contains the document contents for an HTML document\n ** This is for peeking at a page, because the user might not want to leave the data browser.\n */\nimport { icons, ns } from 'solid-ui'\nimport { Util } from 'rdflib'\nimport { marked } from 'marked'\nimport DOMPurify from 'dompurify'\nimport type { DataBrowserContext, RenderEnvironment } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './humanReadablePane.css'\n\n// Helper function to check if a URI has a markdown file extension\ntype DokieliCacheValue = 'dokieli' | 'html'\n\ntype HumanReadableIcon = string | Promise<string>\n\ntype HumanReadablePaneDefinition = {\n icon: (subject: NamedNode, context: DataBrowserContext) => HumanReadableIcon\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => 'Webpage' | 'View' | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nconst isMarkdownFile = (uri?: string | null): boolean => {\n if (!uri) return false\n const path = uri.split('?')[0].split('#')[0] // Remove query string and fragment\n return /\\.(md|markdown|mdown|mkd|mkdn)$/i.test(path)\n}\n\n// Cache for dokieli detection results (keyed by subject URI)\nconst dokieliCache = new Map<string, DokieliCacheValue>()\n\nfunction applyFrameClasses (\n frame: HTMLElement,\n modifier: 'markdown' | 'plain-text' | 'iframe',\n lines: number\n): void {\n frame.className = ''\n frame.classList.add('human-readable-pane__frame')\n frame.classList.add(`human-readable-pane__frame--${modifier}`)\n frame.style.setProperty('--human-readable-pane-height', `${lines}em`)\n}\n\nconst humanReadablePane: HumanReadablePaneDefinition = {\n icon: function (subject: NamedNode, context: DataBrowserContext): HumanReadableIcon {\n // Markdown files detected by extension\n if (subject && isMarkdownFile(subject.uri)) {\n return icons.iconBase + 'markdown.svg'\n }\n\n // Dokieli files detected by content check\n if (subject) {\n const kb = context.session.store\n\n // Check cache from previous detection\n const cachedResult = dokieliCache.get(subject.uri)\n if (cachedResult === 'dokieli') {\n return icons.iconBase + 'dokieli-logo.png'\n } else if (cachedResult === 'html') {\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n }\n\n // Check if content already fetched (synchronous)\n const responseText = kb.fetcher.getHeader(subject.doc(), 'content')\n if (responseText && responseText.length > 0) {\n const text = responseText[0]\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n return isDokieli\n ? icons.iconBase + 'dokieli-logo.png'\n : icons.originalIconBase + 'tango/22-text-x-generic.png'\n }\n\n // Content not yet fetched - return a promise (async detection)\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null\n\n if (ct === 'text/html') {\n return kb.fetcher._fetch(subject.uri)\n .then(response => response.text())\n .then(text => {\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n return isDokieli\n ? icons.iconBase + 'dokieli-logo.png'\n : icons.originalIconBase + 'tango/22-text-x-generic.png'\n })\n .catch(() => {\n dokieliCache.set(subject.uri, 'html')\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n })\n }\n }\n\n // Default for all other human-readable content\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n },\n\n name: 'humanReadable',\n\n label: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): 'Webpage' | 'View' | null {\n const kb = context.session.store\n\n // See also the source pane, which has lower precedence.\n\n const allowed = [\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/xhtml+xml',\n 'image/png',\n 'image/jpeg',\n 'application/pdf',\n 'video/mp4'\n ]\n\n const hasContentTypeIn = function (\n kb: typeof context.session.store,\n x: NamedNode,\n displayables: string[]\n ): boolean {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data could come from a fetch OR from ldp container\n const hasContentTypeIn2 = function (\n kb: typeof context.session.store,\n x: NamedNode,\n displayables: string[]\n ): boolean {\n const t = kb.findTypeURIs(x)\n for (let k = 0; k < displayables.length; k++) {\n if (Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'Webpage'\n\n // Check file extension for markdown files\n if (isMarkdownFile(subject.uri)) {\n return 'View'\n }\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n // For HTML files, check if it's dokieli (async check, store result for later)\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null\n\n if (ct === 'text/html' && !dokieliCache.has(subject.uri)) {\n // Async check for dokieli, don't wait for result\n kb.fetcher._fetch(subject.uri)\n .then(response => response.text())\n .then(text => {\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n })\n .catch(() => {\n dokieliCache.set(subject.uri, 'html')\n })\n }\n\n return 'View'\n }\n\n return null\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n function applyEnvironmentAttributes (element: HTMLDivElement): void {\n const environment = (context.environment ?? {}) as Partial<RenderEnvironment>\n element.dataset.layout = environment.layout ?? 'desktop'\n }\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null // remove content-type parameters\n\n // Fallback: detect markdown by file extension if content-type is not text/markdown\n const isMarkdown = ct === 'text/markdown' || isMarkdownFile(subject.uri)\n const isPlainText = ct === 'text/plain'\n\n if (ct) {\n // console.log('humanReadablePane: c-t:' + ct)\n } else {\n console.log('humanReadablePane: unknown content-type?')\n }\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.classList.add('human-readable-pane')\n applyEnvironmentAttributes(div)\n\n // render markdown to html in a DIV element\n const renderMarkdownContent = function (frame: HTMLDivElement) {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const markdownText = response.responseText ?? ''\n const lines = Math.min(30, markdownText.split(/\\n/).length + 5)\n const res = marked.parse(markdownText, { async: false })\n const clean = DOMPurify.sanitize(res)\n frame.innerHTML = clean\n applyFrameClasses(frame, 'markdown', lines)\n }).catch(error => {\n console.error('Error fetching markdown content:', error)\n frame.innerHTML = '<p>Error loading content</p>'\n })\n }\n\n // render plain text in a PRE element\n const renderPlainTextContent = function (frame: HTMLPreElement) {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const plainText = response.responseText ?? ''\n const lines = Math.min(30, plainText.split(/\\n/).length + 5)\n frame.textContent = plainText\n applyFrameClasses(frame, 'plain-text', lines)\n }).catch(error => {\n console.error('Error fetching plain text content:', error)\n frame.textContent = 'Error loading content'\n })\n }\n\n const setIframeAttributes = (frame: HTMLIFrameElement, lines: number) => {\n frame.setAttribute('src', subject.uri)\n applyFrameClasses(frame, 'iframe', lines)\n }\n\n if (isMarkdown) {\n // For markdown, use a DIV element and render the content\n const frame = myDocument.createElement('div')\n renderMarkdownContent(frame)\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n } else if (isPlainText) {\n // For plain text, use a PRE element and render the content\n const frame = myDocument.createElement('pre')\n renderPlainTextContent(frame)\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n } else {\n // For other content types, use IFRAME\n const frame = myDocument.createElement('iframe')\n\n // Apply sandbox for HTML/XHTML\n if (ct === 'text/html' || ct === 'application/xhtml+xml') {\n frame.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms')\n }\n\n // Fetch content to calculate lines dynamically\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const blobText = response.responseText ?? ''\n const newLines = blobText.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ? -10 : 5\n const lines = Math.min(30, blobText.split(/\\n/).length + newLines)\n\n // Cache dokieli detection result\n const isDokieli = blobText.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n blobText.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n\n setIframeAttributes(frame, lines)\n }).catch(error => {\n console.error('Error fetching content for line calculation:', error)\n // Fallback to default height\n setIframeAttributes(frame, 30)\n })\n\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n }\n\n return div\n }\n}\n\nexport default humanReadablePane\n// ends\n"],"mappings":";;;;;;AAyBA,IAAMC,KAAkB,MAAiC;CACvD,IAAI,CAACC,GAAK,OAAO;CACjB,IAAMC,IAAOD,EAAI,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;CAC1C,OAAO,mCAAmC,KAAKC,CAAI;AACrD,GAGMC,oBAAe,IAAI,IAA+B;AAExD,SAASC,EACP,GACA,GACA,GACM;CAIN,AAHA,EAAM,YAAY,IAClBC,EAAM,UAAU,IAAI,4BAA4B,GAChDA,EAAM,UAAU,IAAI,+BAA+BC,GAAU,GAC7DD,EAAM,MAAM,YAAY,gCAAgC,GAAGE,EAAM,GAAG;AACtE;AAEA,IAAMC,IAAiD;CACrD,MAAM,SAAU,GAAoB,GAAgD;EAElF,IAAIC,KAAWT,EAAeS,EAAQ,GAAG,GACvC,OAAOC,EAAM,WAAW;EAI1B,IAAID,GAAS;GACX,IAAME,IAAKC,EAAQ,QAAQ,OAGrBC,IAAeV,EAAa,IAAIM,EAAQ,GAAG;GACjD,IAAII,MAAiB,WACnB,OAAOH,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GAAOE,CAAK;GAClC,CAAC,CAAC,CAAC,OAAM,MAAS;IAGhB,AAFA,QAAQ,MAAM,gDAAgDiC,CAAK,GAEnEG,EAAoBtC,GAAO,EAAE;GAC/B,CAAC;GAED,IAAMuC,IAAiBf,EAAW,cAAc,KAAK;GAGrD,AAFAe,EAAe,UAAU,IAAI,gCAAgC,GAC7DA,EAAe,YAAYvC,CAAK,GAChCyB,EAAI,YAAYc,CAAc;EAChC;EAEA,OAAOd;CACT;AACF"}
|
|
1
|
+
{"version":3,"file":"humanReadablePane2.esm.js","names":["DOMPurify","isMarkdownFile","uri","path","dokieliCache","applyFrameClasses","frame","modifier","lines","HUMAN_READABLE_PREVIEW_FRAME_NAME","HTML_PREVIEW_SANDBOX","isDokieliHtml","text","escapeAttribute","value","withBaseHref","existingBase","html","href","existingHref","resolvedHref","baseUri","resolvedBase","base","headMatch","insertAt","resourceFilename","encodedFilename","documentTitle","fallback","PREVIEW_REQUEST_TYPE","PREVIEW_RESPONSE_TYPE","PREVIEW_METHODS","isSrcdocUrl","url","previewRequestUrl","resolvedUrl","documentUri","createPreviewBridge","bridge","nonce","match","mountDokieliBridge","ownerWindow","randomValues","expectedUri","request","event","respond","response","error","humanReadablePane","subject","icons","kb","context","cachedResult","responseText","isDokieli","cts","allowed","hasContentTypeIn","x","j","k","displayables","hasContentTypeIn2","t","Util","ns","myDocument","div","applyEnvironmentAttributes","environment","ct","isMarkdown","isPlainText","renderMarkdownContent","markdownText","res","marked","renderPlainTextContent","plainText","frameContainer","isHtml","previewUrl","disposed","wasConnected","mutationObserver","wasAdded","records","record","node","showError","message","init","responseContentType","objectUrl"],"sources":["../src/humanReadablePane.ts"],"sourcesContent":["/* Human-readable Pane\n **\n ** This outline pane contains the document contents for an HTML document\n ** This is for peeking at a page, because the user might not want to leave the data browser.\n */\nimport { icons, ns } from 'solid-ui'\nimport { Util } from 'rdflib'\nimport { marked } from 'marked'\nimport DOMPurify from 'dompurify'\nimport type { DataBrowserContext, RenderEnvironment } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './humanReadablePane.css'\n\n// Helper function to check if a URI has a markdown file extension\ntype DokieliCacheValue = 'dokieli' | 'html'\n\ntype HumanReadableIcon = string | Promise<string>\n\ntype HumanReadablePaneDefinition = {\n icon: (subject: NamedNode, context: DataBrowserContext) => HumanReadableIcon\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => 'Webpage' | 'View' | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nconst isMarkdownFile = (uri?: string | null): boolean => {\n if (!uri) return false\n const path = uri.split('?')[0].split('#')[0] // Remove query string and fragment\n return /\\.(md|markdown|mdown|mkd|mkdn)$/i.test(path)\n}\n\n// Cache for dokieli detection results (keyed by subject URI)\nconst dokieliCache = new Map<string, DokieliCacheValue>()\n\nfunction applyFrameClasses (\n frame: HTMLElement,\n modifier: 'markdown' | 'plain-text' | 'iframe',\n lines?: number\n): void {\n frame.className = ''\n frame.classList.add('human-readable-pane__frame')\n frame.classList.add(`human-readable-pane__frame--${modifier}`)\n if (lines !== undefined) {\n frame.style.setProperty('--human-readable-pane-height', `${lines}em`)\n }\n}\n\n// window.name of preview iframes; initMainPage refuses to boot SolidOS inside such a frame.\nexport const HUMAN_READABLE_PREVIEW_FRAME_NAME = 'solidos-human-readable-preview'\n\n// Scripts may run but get an opaque origin, so previewed pages cannot reach the SolidOS session.\nconst HTML_PREVIEW_SANDBOX = 'allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-modals'\n\nconst isDokieliHtml = (text: string): boolean =>\n text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') || text.includes('dokieli.css')\n\nfunction escapeAttribute (value: string): string {\n return value.replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>')\n}\n\n// srcdoc documents resolve relative URLs against about:srcdoc, so point them back at the resource.\nexport function withBaseHref (html: string, baseUri: string): string {\n const existingBase = html.match(/<base(\\s[^>]*)?>/i)\n if (existingBase && existingBase.index !== undefined) {\n const href = existingBase[0].match(/\\bhref\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/i)\n const existingHref = href?.[1] ?? href?.[2] ?? href?.[3]\n if (!href || existingHref === undefined) return html\n if (/^[a-z][a-z\\d+.-]*:/i.test(existingHref) || existingHref.startsWith('//')) return html\n let resolvedHref: string\n try {\n resolvedHref = new URL(existingHref, baseUri).href\n } catch {\n return html\n }\n const resolvedBase = existingBase[0].replace(href[0], `href=\"${escapeAttribute(resolvedHref)}\"`)\n return html.slice(0, existingBase.index) + resolvedBase + html.slice(existingBase.index + existingBase[0].length)\n }\n const base = `<base href=\"${escapeAttribute(baseUri)}\">`\n const headMatch = html.match(/<head(\\s[^>]*)?>/i)\n if (headMatch && headMatch.index !== undefined) {\n const insertAt = headMatch.index + headMatch[0].length\n return html.slice(0, insertAt) + base + html.slice(insertAt)\n }\n return base + html\n}\n\nfunction resourceFilename (uri: string): string {\n const encodedFilename = uri.split('/').pop() || uri\n try {\n return decodeURIComponent(encodedFilename)\n } catch {\n return encodedFilename\n }\n}\n\nfunction documentTitle (html: string, uri: string): string {\n const fallback = resourceFilename(uri)\n try {\n const title = new DOMParser().parseFromString(html, 'text/html').querySelector('title')?.textContent?.trim()\n return title || fallback\n } catch {\n return fallback\n }\n}\n\ntype PreviewRequest = {\n type: 'solidos-preview-request'\n nonce: string\n id: string\n url: string\n method: string\n headers?: Record<string, string>\n body?: string\n}\n\ntype PreviewResponse = {\n type: 'solidos-preview-response'\n nonce: string\n id: string\n ok: boolean\n status: number\n headers: Array<[string, string]>\n body: string\n error?: string\n}\n\nconst PREVIEW_REQUEST_TYPE = 'solidos-preview-request'\nconst PREVIEW_RESPONSE_TYPE = 'solidos-preview-response'\nconst PREVIEW_METHODS = new Set(['GET', 'PUT', 'PATCH', 'DELETE'])\n\nfunction isSrcdocUrl (url: string): boolean {\n return url === 'about:srcdoc' || /^file:\\/\\/srcdoc\\/?(?:[?#].*)?$/i.test(url)\n}\n\nexport function previewRequestUrl (url: string, documentUri: string): string {\n const resolvedUrl = new URL(url, documentUri).href\n return isSrcdocUrl(resolvedUrl) ? documentUri : resolvedUrl\n}\n\nfunction createPreviewBridge (html: string, uri: string, nonce: string): string {\n const bridge = `<script>\n(() => {\n const documentUri = ${JSON.stringify(uri)}\n const nonce = ${JSON.stringify(nonce)}\n const pending = new Map()\n let requestId = 0\n try {\n history.replaceState(null, '', documentUri)\n } catch {\n // Sandboxed documents may reject cross-origin history URLs.\n }\n // Opaque sandbox origins cannot use IndexedDB. Dokieli uses it for local\n // preferences and history, so provide an in-memory implementation without\n // granting the preview a persistent storage capability.\n try {\n window.indexedDB.open('__solidos_probe__')\n } catch {\n const databases = new Map()\n const request = (result) => ({ result, error: null, onsuccess: null, onerror: null, onupgradeneeded: null })\n const isolatedIndexedDB = {\n open (name) {\n const stores = databases.get(name) || new Map()\n databases.set(name, stores)\n const database = {\n objectStoreNames: { contains: storeName => stores.has(storeName) },\n createObjectStore (storeName) {\n if (!stores.has(storeName)) stores.set(storeName, new Map())\n return database.transaction(storeName, 'readwrite').objectStore(storeName)\n },\n transaction (storeName, mode = 'readonly') {\n const store = stores.get(storeName) || new Map()\n stores.set(storeName, store)\n let pending = 0\n let completed = false\n const transaction = {\n oncomplete: null,\n onerror: null,\n onabort: null,\n objectStore: () => {\n const run = (result, change) => {\n const operation = request(result)\n pending++\n queueMicrotask(() => {\n try {\n change?.()\n operation.onsuccess?.({ target: operation })\n } catch (error) {\n operation.error = error\n operation.onerror?.({ target: operation })\n } finally {\n pending--\n if (!pending && !completed) {\n completed = true\n transaction.oncomplete?.({ target: transaction })\n }\n }\n })\n return operation\n }\n return {\n get: key => run(store.get(key)),\n getAll: () => run(Array.from(store.values())),\n getAllKeys: () => run(Array.from(store.keys())),\n count: () => run(store.size),\n openKeyCursor () {\n const keys = Array.from(store.keys())\n const operation = request(null)\n pending++\n let index = 0\n const emit = () => {\n operation.result = index < keys.length\n ? { key: keys[index], continue: () => { index++; queueMicrotask(emit) } }\n : null\n operation.onsuccess?.({ target: operation })\n if (!operation.result) {\n pending--\n if (!pending && !completed) {\n completed = true\n transaction.oncomplete?.({ target: transaction })\n }\n }\n }\n queueMicrotask(emit)\n return operation\n },\n put: (value, key) => run(undefined, () => store.set(key, value)),\n add: (value, key) => run(undefined, () => store.set(key, value)),\n delete: key => run(undefined, () => store.delete(key)),\n clear: () => run(undefined, () => store.clear())\n }\n }\n }\n return transaction\n },\n close () {}\n }\n const operation = request(database)\n queueMicrotask(() => {\n operation.onupgradeneeded?.({ target: operation })\n operation.onsuccess?.({ target: operation })\n })\n return operation\n },\n deleteDatabase (name) {\n databases.delete(name)\n const operation = request(undefined)\n queueMicrotask(() => operation.onsuccess?.({ target: operation }))\n return operation\n }\n }\n Object.defineProperty(window, 'indexedDB', { configurable: true, value: isolatedIndexedDB })\n }\n const nativeFetch = window.fetch.bind(window)\n\n function isSrcdocUrl (url) {\n return url === 'about:srcdoc' || /^file:\\\\/\\\\/srcdoc\\\\/?(?:[?#].*)?$/i.test(url)\n }\n\n function documentRequestUrl (url) {\n const resolvedUrl = new URL(url, documentUri).href\n // srcdoc keeps this URL even when history.replaceState is unavailable in\n // an opaque sandbox. Dokieli saves via document.location.href.\n return isSrcdocUrl(resolvedUrl) ? documentUri : resolvedUrl\n }\n\n function requestParent (url, init) {\n const id = String(++requestId)\n return new Promise((resolve, reject) => {\n pending.set(id, { resolve, reject })\n window.parent.postMessage({\n type: ${JSON.stringify(PREVIEW_REQUEST_TYPE)},\n nonce,\n id,\n url,\n method: init.method,\n headers: init.headers,\n body: init.body\n }, '*')\n })\n }\n\n window.addEventListener('message', event => {\n const message = event.data\n if (!message || message.type !== ${JSON.stringify(PREVIEW_RESPONSE_TYPE)} || message.nonce !== nonce) return\n const entry = pending.get(message.id)\n if (!entry) return\n pending.delete(message.id)\n if (!message.ok) {\n entry.reject(new Error(message.error || 'Preview request failed'))\n return\n }\n const responseBody = [204, 205, 304].includes(message.status) ? null : message.body\n entry.resolve(new Response(responseBody, {\n status: message.status,\n headers: message.headers\n }))\n })\n\n window.fetch = async (input, init = {}) => {\n const request = input instanceof Request ? input : null\n const url = documentRequestUrl(request ? request.url : input)\n const method = (init.method || (request && request.method) || 'GET').toUpperCase()\n if (url !== documentUri || !${JSON.stringify(Array.from(PREVIEW_METHODS))}.includes(method)) {\n return nativeFetch(input, init)\n }\n const headers = new Headers(request ? request.headers : undefined)\n for (const [key, value] of new Headers(init.headers || {}).entries()) headers.set(key, value)\n const body = method === 'GET' || method === 'HEAD'\n ? undefined\n : (init.body || (request ? await request.clone().text() : undefined))\n return requestParent(url, {\n method,\n headers: Object.fromEntries(headers.entries()),\n body\n })\n }\n\n const NativeXMLHttpRequest = window.XMLHttpRequest\n window.XMLHttpRequest = class PreviewXMLHttpRequest {\n constructor () {\n this._native = new NativeXMLHttpRequest()\n this._headers = {}\n this._listeners = {}\n this._intercepted = false\n this.readyState = 0\n this.status = 0\n this.statusText = ''\n this.response = null\n this.responseText = ''\n }\n\n addEventListener (type, listener) {\n this._listeners[type] = this._listeners[type] || []\n this._listeners[type].push(listener)\n }\n\n _emit (type) {\n const event = { target: this, currentTarget: this, type }\n if (typeof this['on' + type] === 'function') this['on' + type](event)\n for (const listener of this._listeners[type] || []) listener.call(this, event)\n }\n\n open (method, url, async = true, user, password) {\n const resolvedUrl = documentRequestUrl(url)\n this._method = String(method || 'GET').toUpperCase()\n this._url = resolvedUrl\n this._intercepted = resolvedUrl === documentUri &&\n ${JSON.stringify(Array.from(PREVIEW_METHODS))}.includes(this._method)\n if (!this._intercepted) {\n this._native.open(method, url, async, user, password)\n for (const type of ['abort', 'error', 'load', 'loadend', 'progress', 'readystatechange', 'timeout']) {\n this._native.addEventListener(type, event => this._emitNative(type, event))\n }\n }\n this.readyState = 1\n this._emit('readystatechange')\n }\n\n _emitNative (type, event) {\n this.readyState = this._native.readyState\n this.status = this._native.status\n this.statusText = this._native.statusText\n this.response = this._native.response\n this.responseText = this._native.responseText\n this._emit(type)\n }\n\n setRequestHeader (name, value) {\n if (this._intercepted) this._headers[name] = value\n else this._native.setRequestHeader(name, value)\n }\n\n send (body) {\n if (!this._intercepted) {\n this._native.send(body)\n return\n }\n requestParent(this._url, {\n method: this._method,\n headers: this._headers,\n body: this._method === 'GET' || this._method === 'HEAD' ? undefined : body\n }).then(async response => {\n this.status = response.status\n this.statusText = response.statusText\n this._responseHeaders = response.headers\n this.responseText = await response.text()\n this.response = this.responseText\n this.readyState = 4\n this._emit('readystatechange')\n this._emit(response.ok ? 'load' : 'error')\n this._emit('loadend')\n }).catch(() => {\n this.readyState = 4\n this._emit('readystatechange')\n this._emit('error')\n this._emit('loadend')\n })\n }\n\n abort () {\n if (!this._intercepted) this._native.abort()\n this._emit('abort')\n }\n\n getResponseHeader (name) {\n return this._responseHeaders?.get(name) || null\n }\n\n getAllResponseHeaders () {\n return this._responseHeaders\n ? Array.from(this._responseHeaders.entries()).map(([key, value]) => key + ': ' + value).join('\\\\r\\\\n')\n : ''\n }\n }\n})()\n</script>`\n return withBaseHref(html, uri).replace(/<head(\\s[^>]*)?>/i, match => `${match}${bridge}`)\n}\n\nfunction mountDokieliBridge (\n frame: HTMLIFrameElement,\n uri: string,\n html: string,\n authenticatedFetch: (url: string, init?: RequestInit) => Promise<Response>\n): void {\n const ownerWindow = frame.ownerDocument.defaultView\n if (!ownerWindow) return\n\n const randomValues = new Uint32Array(4)\n ownerWindow.crypto.getRandomValues(randomValues)\n const nonce = Array.from(randomValues, value => value.toString(16)).join('-')\n const expectedUri = new URL(uri).href\n const listener = (event: MessageEvent<PreviewRequest>) => {\n const request = event.data\n if (\n event.source !== frame.contentWindow ||\n !request ||\n request.type !== PREVIEW_REQUEST_TYPE ||\n request.nonce !== nonce ||\n previewRequestUrl(request.url, expectedUri) !== expectedUri ||\n !PREVIEW_METHODS.has(request.method)\n ) return\n\n const respond = (response: PreviewResponse) => {\n frame.contentWindow?.postMessage(response, '*')\n }\n\n authenticatedFetch(expectedUri, {\n method: request.method,\n headers: request.headers,\n body: request.method === 'GET' ? undefined : request.body\n }).then(async response => {\n respond({\n type: PREVIEW_RESPONSE_TYPE,\n nonce,\n id: request.id,\n ok: response.ok,\n status: response.status,\n headers: Array.from(response.headers.entries()),\n body: await response.text()\n })\n }).catch(error => {\n respond({\n type: PREVIEW_RESPONSE_TYPE,\n nonce,\n id: request.id,\n ok: false,\n status: 0,\n headers: [],\n body: '',\n error: error instanceof Error ? error.message : String(error)\n })\n })\n }\n\n ownerWindow.addEventListener('message', listener)\n frame.setAttribute('sandbox', HTML_PREVIEW_SANDBOX)\n frame.srcdoc = createPreviewBridge(html, expectedUri, nonce)\n}\n\nconst humanReadablePane: HumanReadablePaneDefinition = {\n icon: function (subject: NamedNode, context: DataBrowserContext): HumanReadableIcon {\n // Markdown files detected by extension\n if (subject && isMarkdownFile(subject.uri)) {\n return icons.iconBase + 'markdown.svg'\n }\n\n // Dokieli files detected by content check\n if (subject) {\n const kb = context.session.store\n\n // Check cache from previous detection\n const cachedResult = dokieliCache.get(subject.uri)\n if (cachedResult === 'dokieli') {\n return icons.iconBase + 'dokieli-logo.png'\n } else if (cachedResult === 'html') {\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n }\n\n // Check if content already fetched (synchronous)\n const responseText = kb.fetcher.getHeader(subject.doc(), 'content')\n if (responseText && responseText.length > 0) {\n const text = responseText[0]\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n return isDokieli\n ? icons.iconBase + 'dokieli-logo.png'\n : icons.originalIconBase + 'tango/22-text-x-generic.png'\n }\n\n // Content not yet fetched - return a promise (async detection)\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null\n\n if (ct === 'text/html') {\n return kb.fetcher._fetch(subject.uri)\n .then(response => response.text())\n .then(text => {\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n return isDokieli\n ? icons.iconBase + 'dokieli-logo.png'\n : icons.originalIconBase + 'tango/22-text-x-generic.png'\n })\n .catch(() => {\n dokieliCache.set(subject.uri, 'html')\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n })\n }\n }\n\n // Default for all other human-readable content\n return icons.originalIconBase + 'tango/22-text-x-generic.png'\n },\n\n name: 'humanReadable',\n\n label: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): 'Webpage' | 'View' | null {\n const kb = context.session.store\n\n // See also the source pane, which has lower precedence.\n\n const allowed = [\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/xhtml+xml',\n 'application/pdf',\n 'video/mp4'\n ]\n\n const hasContentTypeIn = function (\n kb: typeof context.session.store,\n x: NamedNode,\n displayables: string[]\n ): boolean {\n const cts = kb.fetcher.getHeader(x, 'content-type')\n if (cts) {\n for (let j = 0; j < cts.length; j++) {\n for (let k = 0; k < displayables.length; k++) {\n if (cts[j].indexOf(displayables[k]) >= 0) {\n return true\n }\n }\n }\n }\n return false\n }\n\n // This data could come from a fetch OR from ldp container\n const hasContentTypeIn2 = function (\n kb: typeof context.session.store,\n x: NamedNode,\n displayables: string[]\n ): boolean {\n const t = kb.findTypeURIs(x)\n for (let k = 0; k < displayables.length; k++) {\n if (Util.mediaTypeClass(displayables[k]).uri in t) {\n return true\n }\n }\n return false\n }\n\n if (!subject.uri) return null // no bnodes\n\n const t = kb.findTypeURIs(subject)\n if (t[ns.link('WebPage').uri]) return 'Webpage'\n\n // Check file extension for markdown files\n if (isMarkdownFile(subject.uri)) {\n return 'View'\n }\n\n if (\n hasContentTypeIn(kb, subject, allowed) ||\n hasContentTypeIn2(kb, subject, allowed)\n ) {\n // For HTML files, check if it's dokieli (async check, store result for later)\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null\n\n if (ct === 'text/html' && !dokieliCache.has(subject.uri)) {\n // Async check for dokieli, don't wait for result\n kb.fetcher._fetch(subject.uri)\n .then(response => response.text())\n .then(text => {\n const isDokieli = text.includes('<script src=\"https://dokie.li/scripts/dokieli.js\">') ||\n text.includes('dokieli.css')\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n })\n .catch(() => {\n dokieliCache.set(subject.uri, 'html')\n })\n }\n\n return 'View'\n }\n\n return null\n },\n\n render: function (\n subject: NamedNode,\n context: DataBrowserContext\n ): HTMLDivElement {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n const kb = context.session.store\n\n function applyEnvironmentAttributes (element: HTMLDivElement): void {\n const environment = (context.environment ?? {}) as Partial<RenderEnvironment>\n element.dataset.layout = environment.layout ?? 'desktop'\n }\n\n const cts = kb.fetcher.getHeader(subject.doc(), 'content-type')\n const ct = cts ? cts[0].split(';', 1)[0].trim() : null // remove content-type parameters\n\n // Fallback: detect markdown by file extension if content-type is not text/markdown\n const isMarkdown = ct === 'text/markdown' || isMarkdownFile(subject.uri)\n const isPlainText = ct === 'text/plain'\n\n if (ct) {\n // console.log('humanReadablePane: c-t:' + ct)\n } else {\n console.log('humanReadablePane: unknown content-type?')\n }\n\n // @@ When we can, use CSP to turn off scripts within the iframe\n div.classList.add('human-readable-pane')\n applyEnvironmentAttributes(div)\n\n // render markdown to html in a DIV element\n const renderMarkdownContent = function (frame: HTMLDivElement) {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const markdownText = response.responseText ?? ''\n const lines = Math.min(30, markdownText.split(/\\n/).length + 5)\n const res = marked.parse(markdownText, { async: false })\n const clean = DOMPurify.sanitize(res)\n frame.innerHTML = clean\n applyFrameClasses(frame, 'markdown', lines)\n }).catch(error => {\n console.error('Error fetching markdown content:', error)\n frame.innerHTML = '<p>Error loading content</p>'\n })\n }\n\n // render plain text in a PRE element\n const renderPlainTextContent = function (frame: HTMLPreElement) {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const plainText = response.responseText ?? ''\n const lines = Math.min(30, plainText.split(/\\n/).length + 5)\n frame.textContent = plainText\n applyFrameClasses(frame, 'plain-text', lines)\n }).catch(error => {\n console.error('Error fetching plain text content:', error)\n frame.textContent = 'Error loading content'\n })\n }\n\n if (isMarkdown) {\n // For markdown, use a DIV element and render the content\n const frame = myDocument.createElement('div')\n renderMarkdownContent(frame)\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n } else if (isPlainText) {\n // For plain text, use a PRE element and render the content\n const frame = myDocument.createElement('pre')\n renderPlainTextContent(frame)\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n } else {\n // For other content types, use IFRAME.\n // The iframe's own request would be anonymous (Solid auth is not cookie based), so the\n // content is fetched with the authenticated fetcher and handed to the frame directly.\n const frame = myDocument.createElement('iframe')\n frame.name = HUMAN_READABLE_PREVIEW_FRAME_NAME\n frame.title = resourceFilename(subject.uri)\n applyFrameClasses(frame, 'iframe')\n const isHtml = ct === 'text/html' || ct === 'application/xhtml+xml'\n let previewUrl: string | null = null\n let disposed = false\n let wasConnected = false\n const mutationObserver = typeof MutationObserver === 'undefined'\n ? null\n : new MutationObserver(records => {\n const wasAdded = records.some(record =>\n Array.from(record.addedNodes).some(node =>\n node === div || (node.nodeType === Node.ELEMENT_NODE && (node as Element).contains(div))\n )\n )\n if (div.isConnected) {\n wasConnected = true\n } else if (wasConnected || wasAdded) {\n disposed = true\n if (previewUrl) {\n URL.revokeObjectURL(previewUrl)\n previewUrl = null\n }\n mutationObserver?.disconnect()\n }\n })\n mutationObserver?.observe(myDocument, { childList: true, subtree: true })\n\n const showError = (message: string) => {\n frame.removeAttribute('src')\n frame.setAttribute('sandbox', '')\n frame.srcdoc = `<p style=\"font-family: sans-serif\">${escapeAttribute(message)}</p>`\n }\n\n if (isHtml) {\n kb.fetcher.webOperation('GET', subject.uri).then(response => {\n const html = response.responseText ?? ''\n frame.title = documentTitle(html, subject.uri)\n const isDokieli = isDokieliHtml(html)\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n if (isDokieli) {\n mountDokieliBridge(frame, subject.uri, html, (url, init) => kb.fetcher._fetch(url, init))\n } else {\n frame.setAttribute('sandbox', HTML_PREVIEW_SANDBOX)\n frame.srcdoc = withBaseHref(html, subject.uri)\n }\n }).catch(error => {\n console.error('Error fetching HTML content:', error)\n showError('Error loading content')\n })\n } else {\n kb.fetcher._fetch(subject.uri).then(async response => {\n if (!response.ok) throw new Error(`HTTP ${response.status}`)\n const responseContentType = response.headers.get('content-type')?.split(';', 1)[0].trim().toLowerCase()\n if (responseContentType === 'text/html' || responseContentType === 'application/xhtml+xml') {\n const html = await response.text()\n frame.title = documentTitle(html, subject.uri)\n const isDokieli = isDokieliHtml(html)\n dokieliCache.set(subject.uri, isDokieli ? 'dokieli' : 'html')\n if (isDokieli) {\n mountDokieliBridge(frame, subject.uri, html, (url, init) => kb.fetcher._fetch(url, init))\n } else {\n frame.setAttribute('sandbox', HTML_PREVIEW_SANDBOX)\n frame.srcdoc = withBaseHref(html, subject.uri)\n }\n return\n }\n frame.setAttribute('sandbox', HTML_PREVIEW_SANDBOX)\n const objectUrl = URL.createObjectURL(await response.blob())\n if (disposed) {\n URL.revokeObjectURL(objectUrl)\n return\n }\n previewUrl = objectUrl\n frame.src = objectUrl\n }).catch(error => {\n console.error('Error fetching content:', error)\n showError('Error loading content')\n })\n }\n\n const frameContainer = myDocument.createElement('div')\n frameContainer.classList.add('human-readable-pane__container')\n frameContainer.classList.add('human-readable-pane__container--iframe')\n frameContainer.appendChild(frame)\n div.appendChild(frameContainer)\n div.classList.add('human-readable-pane--iframe')\n }\n\n return div\n }\n}\n\nexport default humanReadablePane\n// ends\n"],"mappings":";;;;;;AAyBA,IAAMC,KAAkB,MAAiC;C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ACF,IAAI,gBAAgBW,CAAS,KAG/B,IAAaA,GACb,EAAM,MAAMA;GACd,CAAC,CAAC,CAAC,OAAM,MAAS;IAEhB,AADA,QAAQ,MAAM,2BAA2B/C,CAAK,GAC9C2C,EAAU,uBAAuB;GACnC,CAAC;GAGH,IAAMV,IAAiBb,EAAW,cAAc,KAAK;GAKrD,AAJAa,EAAe,UAAU,IAAI,gCAAgC,GAC7DA,EAAe,UAAU,IAAI,wCAAwC,GACrEA,EAAe,YAAY7E,CAAK,GAChCiE,EAAI,YAAYY,CAAc,GAC9BZ,EAAI,UAAU,IAAI,6BAA6B;EACjD;EAEA,OAAOA;CACT;AACF"}
|
package/dist/icons/folder.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/icons/folder.svg
|
|
2
2
|
var e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%20fill='none'%20%3e%3cpath%20d='M13.334%2013.3333C13.6876%2013.3333%2014.0267%2013.1929%2014.2768%2012.9428C14.5268%2012.6928%2014.6673%2012.3536%2014.6673%2012V5.33333C14.6673%204.97971%2014.5268%204.64057%2014.2768%204.39052C14.0267%204.14048%2013.6876%204%2013.334%204H8.06732C7.84433%204.00219%207.62435%203.94841%207.42752%203.84359C7.23069%203.73877%207.06329%203.58625%206.94065%203.4L6.40065%202.6C6.27924%202.41565%206.11397%202.26432%205.91965%202.1596C5.72533%202.05488%205.50806%202.00004%205.28732%202H2.66732C2.3137%202%201.97456%202.14048%201.72451%202.39052C1.47446%202.64057%201.33398%202.97971%201.33398%203.33333V12C1.33398%2012.3536%201.47446%2012.6928%201.72451%2012.9428C1.97456%2013.1929%202.3137%2013.3333%202.66732%2013.3333H13.334Z'%20stroke='currentColor'%20stroke-width='1.33333'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=folder.esm.js.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/icons/friends.svg
|
|
2
2
|
var e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%20%3e%3cpath%20d='M13.3327%2017.5V15.8333C13.3327%2014.9493%2012.9815%2014.1014%2012.3564%2013.4763C11.7313%2012.8512%2010.8834%2012.5%209.99935%2012.5H4.99935C4.11529%2012.5%203.26745%2012.8512%202.64233%2013.4763C2.01721%2014.1014%201.66602%2014.9493%201.66602%2015.8333V17.5'%20stroke='currentColor'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M13.334%202.60669C14.0488%202.792%2014.6818%203.20941%2015.1337%203.79341C15.5856%204.37741%2015.8308%205.09493%2015.8308%205.83336C15.8308%206.57178%2015.5856%207.28931%2015.1337%207.8733C14.6818%208.4573%2014.0488%208.87471%2013.334%209.06002'%20stroke='currentColor'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M18.334%2017.5001V15.8334C18.3334%2015.0948%2018.0876%2014.3774%2017.6351%2013.7937C17.1826%2013.2099%2016.5491%2012.793%2015.834%2012.6084'%20stroke='currentColor'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M7.49935%209.16667C9.3403%209.16667%2010.8327%207.67428%2010.8327%205.83333C10.8327%203.99238%209.3403%202.5%207.49935%202.5C5.6584%202.5%204.16602%203.99238%204.16602%205.83333C4.16602%207.67428%205.6584%209.16667%207.49935%209.16667Z'%20stroke='currentColor'%20stroke-width='1.66667'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=friends.esm.js.map
|
package/dist/icons/person.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
// src/icons/person.svg
|
|
2
2
|
var e = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2020%2020'%20fill='none'%20%3e%3cpath%20d='M13.0151%209.27363C14.2948%208.34031%2015.1282%206.82984%2015.1282%205.1282C15.1282%202.30051%2012.8277%200%209.99998%200C7.17228%200%204.87177%202.30051%204.87177%205.1282C4.87177%206.82984%205.70509%208.34031%206.98486%209.27363C3.80361%2010.491%201.53845%2013.5754%201.53845%2017.1795C1.53845%2018.7347%202.80373%2020%204.35896%2020H15.641C17.1962%2020%2018.4615%2018.7347%2018.4615%2017.1795C18.4615%2013.5754%2016.1963%2010.491%2013.0151%209.27363ZM6.41025%205.1282C6.41025%203.14883%208.0206%201.53848%209.99998%201.53848C11.9794%201.53848%2013.5897%203.14883%2013.5897%205.1282C13.5897%207.10758%2011.9794%208.71797%209.99998%208.71797C8.0206%208.71797%206.41025%207.10758%206.41025%205.1282ZM15.641%2018.4615H4.35896C3.65205%2018.4615%203.07693%2017.8864%203.07693%2017.1795C3.07693%2013.362%206.18255%2010.2564%2010%2010.2564C13.8175%2010.2564%2016.9231%2013.362%2016.9231%2017.1795C16.9231%2017.8864%2016.3479%2018.4615%2015.641%2018.4615Z'%20fill='currentColor'/%3e%3c/svg%3e";
|
|
3
|
-
//#endregion
|
|
4
3
|
export { e as default };
|
|
5
4
|
|
|
6
5
|
//# sourceMappingURL=person.esm.js.map
|
package/dist/imagePane.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagePane.d.ts","sourceRoot":"","sources":["../src/imagePane.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,iBAAiB,CAAA;AAWxB,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,IAAI,CAAA;IACzE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAuBD,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"imagePane.d.ts","sourceRoot":"","sources":["../src/imagePane.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,iBAAiB,CAAA;AAWxB,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,MAAM,GAAG,IAAI,CAAA;IACzE,MAAM,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB,KAAK,cAAc,CAAA;CAC5E,CAAA;AAuBD,eAAO,MAAM,SAAS,EAAE,SA8CvB,CAAA"}
|
package/dist/imagePane2.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.image-pane__image{max-width:100%;max-height:100%}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);function n(e,t,n){let r=e.fetcher.getHeader(t,`content-type`);if(!r)return!1;for(let e of r)for(let t of n)if(e.includes(t))return!0;return!1}var r={icon:t.icons.originalIconBase+`tango/22-image-x-generic.png`,name:`image`,label:function(e,r){let i=r.session.store;return!i.anyStatementMatching(e,t.ns.rdf(`type`),i.sym(`http://purl.org/dc/terms/Image`))||n(i,e,[`application/pdf`])?null:`Image`},render:function(e,t){let n=t.dom,r=t.session.store,i=n.createElement(`div`);i.setAttribute(`class`,`image-pane`);let a=n.createElement(`img`);return r.fetcher._fetch(e.uri).then(function(e){return e.blob()}).then(function(e){let t=URL.createObjectURL(e);a.setAttribute(`src`,t)}),a.classList.add(`image-pane__image`),i.appendChild(a),i}};exports.imagePane=r;
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.image-pane__image{max-width:100%;max-height:100%}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();const e=require("./_virtual/_rolldown/runtime.cjs.js");;let t=require("solid-ui");t=e.__toESM(t);function n(e,t,n){let r=e.fetcher.getHeader(t,`content-type`);if(!r)return!1;for(let e of r)for(let t of n)if(e.includes(t))return!0;return!1}var r={icon:t.icons.originalIconBase+`tango/22-image-x-generic.png`,name:`image`,label:function(e,r){let i=r.session.store;return!(i.anyStatementMatching(e,t.ns.rdf(`type`),i.sym(`http://purl.org/dc/terms/Image`))||n(i,e,[`image/`]))||n(i,e,[`application/pdf`])?null:`Image`},render:function(e,t){let n=t.dom,r=t.session.store,i=n.createElement(`div`);i.setAttribute(`class`,`image-pane`);let a=n.createElement(`img`);return r.fetcher._fetch(e.uri).then(function(e){return e.blob()}).then(function(e){let t=URL.createObjectURL(e);a.setAttribute(`src`,t)}),a.classList.add(`image-pane__image`),i.appendChild(a),i}};exports.imagePane=r;
|
|
2
2
|
//# sourceMappingURL=imagePane2.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagePane2.cjs.js","names":["UI","require_runtime","solid_ui","contentTypeMatch","contentTypesForSubject","store","subject","contentType","candidate","contentTypes","imagePane","context","myDocument","div","img","response","objectURL","myBlob"],"sources":["../src/imagePane.ts"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nimport * as UI from 'solid-ui'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './imagePane.css'\n\ntype FetcherLike = {\n getHeader: (subject: NamedNode, header: string) => string[] | undefined\n _fetch: (uri: string) => Promise<Response>\n}\n\ntype ImageStore = DataBrowserContext['session']['store'] & {\n fetcher: FetcherLike\n}\n\ntype ImagePane = {\n icon: string\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nfunction contentTypeMatch (\n store: ImageStore,\n subject: NamedNode,\n contentTypes: string[]\n): boolean {\n const contentTypesForSubject = store.fetcher.getHeader(subject, 'content-type')\n if (!contentTypesForSubject) {\n return false\n }\n\n for (const contentType of contentTypesForSubject) {\n for (const candidate of contentTypes) {\n if (contentType.includes(candidate)) {\n return true\n }\n }\n }\n\n return false\n}\n\nexport const imagePane: ImagePane = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store as ImageStore\n
|
|
1
|
+
{"version":3,"file":"imagePane2.cjs.js","names":["UI","require_runtime","solid_ui","contentTypeMatch","contentTypesForSubject","store","subject","contentType","candidate","contentTypes","imagePane","context","myDocument","div","img","response","objectURL","myBlob"],"sources":["../src/imagePane.ts"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nimport * as UI from 'solid-ui'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './imagePane.css'\n\ntype FetcherLike = {\n getHeader: (subject: NamedNode, header: string) => string[] | undefined\n _fetch: (uri: string) => Promise<Response>\n}\n\ntype ImageStore = DataBrowserContext['session']['store'] & {\n fetcher: FetcherLike\n}\n\ntype ImagePane = {\n icon: string\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nfunction contentTypeMatch (\n store: ImageStore,\n subject: NamedNode,\n contentTypes: string[]\n): boolean {\n const contentTypesForSubject = store.fetcher.getHeader(subject, 'content-type')\n if (!contentTypesForSubject) {\n return false\n }\n\n for (const contentType of contentTypesForSubject) {\n for (const candidate of contentTypes) {\n if (contentType.includes(candidate)) {\n return true\n }\n }\n }\n\n return false\n}\n\nexport const imagePane: ImagePane = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store as ImageStore\n const isImageResource = store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n ) || contentTypeMatch(store, subject, ['image/'])\n if (!isImageResource) {\n // NB: Not dc: namespace!\n return null\n }\n\n // See also the source pane, which has lower precedence.\n\n const suppressed = ['application/pdf']\n if (contentTypeMatch(store, subject, suppressed)) {\n return null\n }\n return 'Image'\n },\n\n render: function (subject: NamedNode, context: DataBrowserContext): HTMLDivElement {\n const myDocument = context.dom\n const store = context.session.store as ImageStore\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'image-pane')\n const img = myDocument.createElement('img')\n\n // get image with authenticated fetch\n store.fetcher._fetch(subject.uri)\n .then(function (response: Response) {\n return response.blob()\n })\n .then(function (myBlob: Blob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n img.classList.add('image-pane__image')\n div.appendChild(img)\n return div\n }\n}\n\n// ends\n"],"mappings":"A,8HAyBA,SAASG,EACP,EACA,EACA,EACS,CACT,IAAMC,EAAyBC,EAAM,QAAQ,UAAUC,EAAS,cAAc,EAC9E,GAAI,CAACF,EACH,MAAO,GAGT,IAAK,IAAMG,KAAeH,EACxB,IAAK,IAAMI,KAAaC,EACtB,GAAIF,EAAY,SAASC,CAAS,EAChC,MAAO,GAKb,MAAO,EACT,CAEA,IAAaE,EAAuB,CAClC,KAAMV,EAAG,MAAM,iBAAmB,+BAElC,KAAM,QAEN,MAAO,SAAU,EAAoB,EAA4C,CAC/E,IAAMK,EAAQM,EAAQ,QAAQ,MAiB9B,MAXI,EALoBN,EAAM,qBAC5BC,EACAN,EAAG,GAAG,IAAI,MAAM,EAChBK,EAAM,IAAI,gCAAgC,CAC5C,GAAKF,EAAiBE,EAAOC,EAAS,CAAC,QAAQ,CAAC,IAS5CH,EAAiBE,EAAOC,EAAS,CADjB,iBACiB,CAAU,EACtC,KAEF,OACT,EAEA,OAAQ,SAAU,EAAoB,EAA6C,CACjF,IAAMM,EAAaD,EAAQ,IACrBN,EAAQM,EAAQ,QAAQ,MACxBE,EAAMD,EAAW,cAAc,KAAK,EAC1CC,EAAI,aAAa,QAAS,YAAY,EACtC,IAAMC,EAAMF,EAAW,cAAc,KAAK,EAa1C,OAVAP,EAAM,QAAQ,OAAOC,EAAQ,GAAG,CAAC,CAC9B,KAAK,SAAU,EAAoB,CAClC,OAAOS,EAAS,KAAK,CACvB,CAAC,CAAC,CACD,KAAK,SAAU,EAAc,CAC5B,IAAMC,EAAY,IAAI,gBAAgBC,CAAM,EAC5CH,EAAI,aAAa,MAAOE,CAAS,CACnC,CAAC,EACHF,EAAI,UAAU,IAAI,mBAAmB,EACrCD,EAAI,YAAYC,CAAG,EACZD,CACT,CACF,E"}
|
package/dist/imagePane2.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.image-pane__image{max-width:100%;max-height:100%}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
import * as e from "solid-ui";
|
|
3
|
-
|
|
3
|
+
// src/imagePane.ts
|
|
4
4
|
function t(e, t, n) {
|
|
5
5
|
let r = e.fetcher.getHeader(t, "content-type");
|
|
6
6
|
if (!r) return !1;
|
|
@@ -12,7 +12,7 @@ var n = {
|
|
|
12
12
|
name: "image",
|
|
13
13
|
label: function(n, r) {
|
|
14
14
|
let i = r.session.store;
|
|
15
|
-
return !i.anyStatementMatching(n, e.ns.rdf("type"), i.sym("http://purl.org/dc/terms/Image")) || t(i, n, ["application/pdf"]) ? null : "Image";
|
|
15
|
+
return !(i.anyStatementMatching(n, e.ns.rdf("type"), i.sym("http://purl.org/dc/terms/Image")) || t(i, n, ["image/"])) || t(i, n, ["application/pdf"]) ? null : "Image";
|
|
16
16
|
},
|
|
17
17
|
render: function(e, t) {
|
|
18
18
|
let n = t.dom, r = t.session.store, i = n.createElement("div");
|
|
@@ -26,7 +26,6 @@ var n = {
|
|
|
26
26
|
}), a.classList.add("image-pane__image"), i.appendChild(a), i;
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
|
-
//#endregion
|
|
30
29
|
export { n as imagePane };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=imagePane2.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imagePane2.esm.js","names":["UI","contentTypeMatch","contentTypesForSubject","store","subject","contentType","candidate","contentTypes","imagePane","context","myDocument","div","img","response","objectURL","myBlob"],"sources":["../src/imagePane.ts"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nimport * as UI from 'solid-ui'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './imagePane.css'\n\ntype FetcherLike = {\n getHeader: (subject: NamedNode, header: string) => string[] | undefined\n _fetch: (uri: string) => Promise<Response>\n}\n\ntype ImageStore = DataBrowserContext['session']['store'] & {\n fetcher: FetcherLike\n}\n\ntype ImagePane = {\n icon: string\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nfunction contentTypeMatch (\n store: ImageStore,\n subject: NamedNode,\n contentTypes: string[]\n): boolean {\n const contentTypesForSubject = store.fetcher.getHeader(subject, 'content-type')\n if (!contentTypesForSubject) {\n return false\n }\n\n for (const contentType of contentTypesForSubject) {\n for (const candidate of contentTypes) {\n if (contentType.includes(candidate)) {\n return true\n }\n }\n }\n\n return false\n}\n\nexport const imagePane: ImagePane = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store as ImageStore\n
|
|
1
|
+
{"version":3,"file":"imagePane2.esm.js","names":["UI","contentTypeMatch","contentTypesForSubject","store","subject","contentType","candidate","contentTypes","imagePane","context","myDocument","div","img","response","objectURL","myBlob"],"sources":["../src/imagePane.ts"],"sourcesContent":["/* Image Pane\n **\n ** This outline pane contains the document contents for an Image document\n */\nimport * as UI from 'solid-ui'\nimport type { DataBrowserContext } from 'pane-registry'\nimport type { NamedNode } from 'rdflib'\nimport './imagePane.css'\n\ntype FetcherLike = {\n getHeader: (subject: NamedNode, header: string) => string[] | undefined\n _fetch: (uri: string) => Promise<Response>\n}\n\ntype ImageStore = DataBrowserContext['session']['store'] & {\n fetcher: FetcherLike\n}\n\ntype ImagePane = {\n icon: string\n name: string\n label: (subject: NamedNode, context: DataBrowserContext) => string | null\n render: (subject: NamedNode, context: DataBrowserContext) => HTMLDivElement\n}\n\nfunction contentTypeMatch (\n store: ImageStore,\n subject: NamedNode,\n contentTypes: string[]\n): boolean {\n const contentTypesForSubject = store.fetcher.getHeader(subject, 'content-type')\n if (!contentTypesForSubject) {\n return false\n }\n\n for (const contentType of contentTypesForSubject) {\n for (const candidate of contentTypes) {\n if (contentType.includes(candidate)) {\n return true\n }\n }\n }\n\n return false\n}\n\nexport const imagePane: ImagePane = {\n icon: UI.icons.originalIconBase + 'tango/22-image-x-generic.png',\n\n name: 'image',\n\n label: function (subject: NamedNode, context: DataBrowserContext): string | null {\n const store = context.session.store as ImageStore\n const isImageResource = store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n ) || contentTypeMatch(store, subject, ['image/'])\n if (!isImageResource) {\n // NB: Not dc: namespace!\n return null\n }\n\n // See also the source pane, which has lower precedence.\n\n const suppressed = ['application/pdf']\n if (contentTypeMatch(store, subject, suppressed)) {\n return null\n }\n return 'Image'\n },\n\n render: function (subject: NamedNode, context: DataBrowserContext): HTMLDivElement {\n const myDocument = context.dom\n const store = context.session.store as ImageStore\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'image-pane')\n const img = myDocument.createElement('img')\n\n // get image with authenticated fetch\n store.fetcher._fetch(subject.uri)\n .then(function (response: Response) {\n return response.blob()\n })\n .then(function (myBlob: Blob) {\n const objectURL = URL.createObjectURL(myBlob)\n img.setAttribute('src', objectURL) // w640 h480 //\n })\n img.classList.add('image-pane__image')\n div.appendChild(img)\n return div\n }\n}\n\n// ends\n"],"mappings":";;;AAyBA,SAASC,EACP,GACA,GACA,GACS;CACT,IAAMC,IAAyBC,EAAM,QAAQ,UAAUC,GAAS,cAAc;CAC9E,IAAI,CAACF,GACH,OAAO;CAGT,KAAK,IAAMG,KAAeH,GACxB,KAAK,IAAMI,KAAaC,GACtB,IAAIF,EAAY,SAASC,CAAS,GAChC,OAAO;CAKb,OAAO;AACT;AAEA,IAAaE,IAAuB;CAClC,MAAMR,EAAG,MAAM,mBAAmB;CAElC,MAAM;CAEN,OAAO,SAAU,GAAoB,GAA4C;EAC/E,IAAMG,IAAQM,EAAQ,QAAQ;EAiB9B,OAXI,EALoBN,EAAM,qBAC5BC,GACAJ,EAAG,GAAG,IAAI,MAAM,GAChBG,EAAM,IAAI,gCAAgC,CAC5C,KAAKF,EAAiBE,GAAOC,GAAS,CAAC,QAAQ,CAAC,MAS5CH,EAAiBE,GAAOC,GAAS,CADjB,iBACiB,CAAU,IACtC,OAEF;CACT;CAEA,QAAQ,SAAU,GAAoB,GAA6C;EACjF,IAAMM,IAAaD,EAAQ,KACrBN,IAAQM,EAAQ,QAAQ,OACxBE,IAAMD,EAAW,cAAc,KAAK;EAC1C,EAAI,aAAa,SAAS,YAAY;EACtC,IAAME,IAAMF,EAAW,cAAc,KAAK;EAa1C,OAVAP,EAAM,QAAQ,OAAOC,EAAQ,GAAG,CAAC,CAC9B,KAAK,SAAU,GAAoB;GAClC,OAAOS,EAAS,KAAK;EACvB,CAAC,CAAC,CACD,KAAK,SAAU,GAAc;GAC5B,IAAMC,IAAY,IAAI,gBAAgBC,CAAM;GAC5C,EAAI,aAAa,OAAOD,CAAS;EACnC,CAAC,GACHF,EAAI,UAAU,IAAI,mBAAmB,GACrCD,EAAI,YAAYC,CAAG,GACZD;CACT;AACF"}
|
package/dist/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ import { initMainPage as a, refreshUI as o } from "./mainPage/index.esm.js";
|
|
|
7
7
|
import * as s from "solid-ui";
|
|
8
8
|
import { solidLogicSingleton as c, store as l } from "solid-logic";
|
|
9
9
|
import { byName as u, list as d, paneForIcon as f, paneForPredicate as p, register as m } from "pane-registry";
|
|
10
|
-
|
|
10
|
+
// src/index.ts
|
|
11
11
|
function h(e, n) {
|
|
12
12
|
if (e.outlineManager) n && (e.outlineManager.context = e.outlineManager.context || {}, e.outlineManager.context.environment = n);
|
|
13
13
|
else {
|
|
@@ -26,7 +26,6 @@ function g(e, t) {
|
|
|
26
26
|
e && (e.context = e.context || {}, e.context.environment = t);
|
|
27
27
|
}
|
|
28
28
|
typeof window < "u" && h(window.document), n((e) => m(e.default || e)), typeof window < "u" && (window.panes = { getOutliner: h });
|
|
29
|
-
//#endregion
|
|
30
29
|
export { t as OutlineManager, s as UI, u as byName, h as getOutliner, a as initMainPage, i as isHandlingBrowserNavigation, d as list, f as paneForIcon, p as paneForPredicate, o as refreshUI, m as register, g as updateEnvironment, e as versionInfo };
|
|
31
30
|
|
|
32
31
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.internalPaneContent{padding:var(--spacing-xs,.5em);background-color:#ddf}.internalPaneControls{width:100%;margin:var(--spacing-sm,1em)}.internalPaneDeleteButton{height:var(--icon-base,2em)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();;let e=require("solid-ui"),t=require("rdflib");var n={icon:e.icons.originalIconBase+`tango/22-emblem-system.png`,name:`internal`,label:function(){return`Under The Hood`},render:function(n,i){let a=i.dom,o=i.session.store,s=o.canon(n),c=o.findTypeURIs(s);function l(e){if(c[`http://www.w3.org/2007/ont/link#ProtocolEvent`])return!0;let t=i.session.paneRegistry.byName(`internal`);return t&&t.predicates&&t.predicates[e.uri]!==void 0}let u=a.createElement(`div`);u.classList.add(`internalPane`,`internalPaneContent`);function d(t,n){let r=t.fetcher;if(!r)console.error(`No fetcher available`);else return new Promise(function(i,a){r.load(n).then(function(){let o=t.each(n,e.ns.ldp(`contains`)).map(n=>t.holds(n,e.ns.rdf(`type`),e.ns.ldp(`BasicContainer`))?d(t,n):(console.log(`deleteRecursive leaf file: `+n),r.webOperation(`DELETE`,n.uri)));Promise.all(o).then(()=>{console.log(`deleteRecursive empty folder: `+n),r.webOperation(`DELETE`,n.uri).then(()=>{console.log(`Deleted Ok: `+n),i(void 0)}).catch(e=>{let t=`Unable to delete `+n+`: `+e;console.log(t),a(Error(t))}),i(void 0)},e=>{alert(e),a(e)})})})}if(n.uri&&!n.uri.includes(`#`)){let t=u.appendChild(a.createElement(`table`));t.classList.add(`internalPaneControls`);let i=t.appendChild(a.createElement(`tr`)),s=i.appendChild(a.createElement(`td`)),c=n.uri&&n.uri.endsWith(`/`)||o.holds(n,e.ns.rdf(`type`),e.ns.ldp(`Container`)),l=c?`folder`:`file`;if(!r(n)){console.log(n);let t=e.widgets.deleteButtonWithCheck(a,s,l,function(){if(confirm(`Are you sure you want to delete ${n}? This cannot be undone.`)){if(!o.fetcher)throw Error(`Store has no fetcher`);(c?d(o,n)||Promise.resolve():o.fetcher.webOperation(`DELETE`,n.uri)||Promise.resolve()).then(()=>{let e=`Deleted: `+n;console.log(e)}).catch(e=>{let t=`Unable to delete `+n+`: `+e;console.log(t),alert(t)})}});t.removeAttribute(`class`),t.classList.add(`internalPaneDeleteButton`),s.appendChild(t)}let f=i.appendChild(a.createElement(`td`)),p=e.widgets.button(a,e.icons.iconBase+`noun_479395.svg`,`refresh`);f.appendChild(p),p.addEventListener(`click`,()=>{if(!o.fetcher)throw Error(`Store has no fetcher`);o.fetcher.refresh(n,function(e,t){let r;r=e?`Refreshed OK: `+n:`Error refreshing: `+n+`: `+t,console.log(r),alert(r)})})}let f=o.statementsMatching(n),p=``;if(!o.fetcher)throw Error(`Store has no fetcher`);if(n.uri&&(f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#uri`),n.uri,o.fetcher.appNode)),n.uri.indexOf(`#`)>=0?(p=n.uri.split(`#`)[0],f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#documentURI`),n.uri.split(`#`)[0],o.fetcher.appNode)),f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#document`),(0,t.sym)(n.uri.split(`#`)[0]),o.fetcher.appNode))):p=n.uri),p){if(!o.updater)throw Error(`Store has no updater`);let e=o.updater.editable(p);e&&f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/ns/rww#editable`),(0,t.literal)(e.toString()),o.fetcher.appNode))}let m=i.getOutliner(a);return m.appendPropertyTRs(u,f,!1,l),f=o.statementsMatching(void 0,void 0,n),m.appendPropertyTRs(u,f,!0,l),u},predicates:{"http://www.w3.org/2007/ont/link#request":1,"http://www.w3.org/2007/ont/link#requestedBy":1,"http://www.w3.org/2007/ont/link#source":1,"http://www.w3.org/2007/ont/link#session":2,"http://www.w3.org/2007/ont/link#uri":1,"http://www.w3.org/2007/ont/link#documentURI":1,"http://www.w3.org/2007/ont/link#document":1,"http://www.w3.org/2007/ont/link#all":1,"http://www.w3.org/2007/ont/link#Document":1,"http://www.w3.org/ns/rww#editable":1,"http://www.w3.org/2000/01/rdf-schema#seeAlso":1,"http://www.w3.org/2002/07/owl#":1},classes:{"http://www.w3.org/2007/ont/link#ProtocolEvent":1}};function r(e){let t=e.site().uri;return e.uri===t||e.uri===t+`profile/`||e.uri===t+`profile/card`||e.uri===t+`settings/`||e.uri===t+`settings/prefs.ttl`||e.uri===t+`settings/privateTypeIndex.ttl`||e.uri===t+`settings/publicTypeIndex.ttl`||e.uri===t+`settings/serverSide.ttl`}exports.default=n;
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.internalPaneContent{padding:var(--spacing-xs,.5em) 40px;box-sizing:border-box;background-color:#ddf}.internalPaneControls{width:100%;margin:var(--spacing-sm,1em) 0;box-sizing:border-box}.internalPaneDeleteButton{height:var(--icon-base,2em)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();;let e=require("solid-ui"),t=require("rdflib");var n={icon:e.icons.originalIconBase+`tango/22-emblem-system.png`,name:`internal`,label:function(){return`Under The Hood`},render:function(n,i){let a=i.dom,o=i.session.store,s=o.canon(n),c=o.findTypeURIs(s);function l(e){if(c[`http://www.w3.org/2007/ont/link#ProtocolEvent`])return!0;let t=i.session.paneRegistry.byName(`internal`);return t&&t.predicates&&t.predicates[e.uri]!==void 0}let u=a.createElement(`div`);u.classList.add(`internalPane`,`internalPaneContent`);function d(t,n){let r=t.fetcher;if(!r)console.error(`No fetcher available`);else return new Promise(function(i,a){r.load(n).then(function(){let o=t.each(n,e.ns.ldp(`contains`)).map(n=>t.holds(n,e.ns.rdf(`type`),e.ns.ldp(`BasicContainer`))?d(t,n):(console.log(`deleteRecursive leaf file: `+n),r.webOperation(`DELETE`,n.uri)));Promise.all(o).then(()=>{console.log(`deleteRecursive empty folder: `+n),r.webOperation(`DELETE`,n.uri).then(()=>{console.log(`Deleted Ok: `+n),i(void 0)}).catch(e=>{let t=`Unable to delete `+n+`: `+e;console.log(t),a(Error(t))}),i(void 0)},e=>{alert(e),a(e)})})})}if(n.uri&&!n.uri.includes(`#`)){let t=u.appendChild(a.createElement(`table`));t.classList.add(`internalPaneControls`);let i=t.appendChild(a.createElement(`tr`)),s=i.appendChild(a.createElement(`td`)),c=n.uri&&n.uri.endsWith(`/`)||o.holds(n,e.ns.rdf(`type`),e.ns.ldp(`Container`)),l=c?`folder`:`file`;if(!r(n)){console.log(n);let t=e.widgets.deleteButtonWithCheck(a,s,l,function(){if(confirm(`Are you sure you want to delete ${n}? This cannot be undone.`)){if(!o.fetcher)throw Error(`Store has no fetcher`);(c?d(o,n)||Promise.resolve():o.fetcher.webOperation(`DELETE`,n.uri)||Promise.resolve()).then(()=>{let e=`Deleted: `+n;console.log(e)}).catch(e=>{let t=`Unable to delete `+n+`: `+e;console.log(t),alert(t)})}});t.removeAttribute(`class`),t.classList.add(`internalPaneDeleteButton`),s.appendChild(t)}let f=i.appendChild(a.createElement(`td`)),p=e.widgets.button(a,e.icons.iconBase+`noun_479395.svg`,`refresh`);f.appendChild(p),p.addEventListener(`click`,()=>{if(!o.fetcher)throw Error(`Store has no fetcher`);o.fetcher.refresh(n,function(e,t){let r;r=e?`Refreshed OK: `+n:`Error refreshing: `+n+`: `+t,console.log(r),alert(r)})})}let f=o.statementsMatching(n),p=``;if(!o.fetcher)throw Error(`Store has no fetcher`);if(n.uri&&(f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#uri`),n.uri,o.fetcher.appNode)),n.uri.indexOf(`#`)>=0?(p=n.uri.split(`#`)[0],f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#documentURI`),n.uri.split(`#`)[0],o.fetcher.appNode)),f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/2007/ont/link#document`),(0,t.sym)(n.uri.split(`#`)[0]),o.fetcher.appNode))):p=n.uri),p){if(!o.updater)throw Error(`Store has no updater`);let e=o.updater.editable(p);e&&f.push((0,t.st)(n,(0,t.sym)(`http://www.w3.org/ns/rww#editable`),(0,t.literal)(e.toString()),o.fetcher.appNode))}let m=i.getOutliner(a);return m.appendPropertyTRs(u,f,!1,l),f=o.statementsMatching(void 0,void 0,n),m.appendPropertyTRs(u,f,!0,l),u},predicates:{"http://www.w3.org/2007/ont/link#request":1,"http://www.w3.org/2007/ont/link#requestedBy":1,"http://www.w3.org/2007/ont/link#source":1,"http://www.w3.org/2007/ont/link#session":2,"http://www.w3.org/2007/ont/link#uri":1,"http://www.w3.org/2007/ont/link#documentURI":1,"http://www.w3.org/2007/ont/link#document":1,"http://www.w3.org/2007/ont/link#all":1,"http://www.w3.org/2007/ont/link#Document":1,"http://www.w3.org/ns/rww#editable":1,"http://www.w3.org/2000/01/rdf-schema#seeAlso":1,"http://www.w3.org/2002/07/owl#":1},classes:{"http://www.w3.org/2007/ont/link#ProtocolEvent":1}};function r(e){let t=e.site().uri;return e.uri===t||e.uri===t+`profile/`||e.uri===t+`profile/card`||e.uri===t+`settings/`||e.uri===t+`settings/prefs.ttl`||e.uri===t+`settings/privateTypeIndex.ttl`||e.uri===t+`settings/publicTypeIndex.ttl`||e.uri===t+`settings/serverSide.ttl`}exports.default=n;
|
|
2
2
|
//# sourceMappingURL=internalPane2.cjs.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.internalPaneContent{padding:var(--spacing-xs,.5em);background-color:#ddf}.internalPaneControls{width:100%;margin:var(--spacing-sm,1em)}.internalPaneDeleteButton{height:var(--icon-base,2em)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.internalPaneContent{padding:var(--spacing-xs,.5em) 40px;box-sizing:border-box;background-color:#ddf}.internalPaneControls{width:100%;margin:var(--spacing-sm,1em) 0;box-sizing:border-box}.internalPaneDeleteButton{height:var(--icon-base,2em)}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
import { icons as e, ns as t, widgets as n } from "solid-ui";
|
|
3
3
|
import { literal as r, st as i, sym as a } from "rdflib";
|
|
4
|
-
|
|
4
|
+
// src/internal/internalPane.ts
|
|
5
5
|
var o = {
|
|
6
6
|
icon: e.originalIconBase + "tango/22-emblem-system.png",
|
|
7
7
|
name: "internal",
|
|
@@ -95,7 +95,6 @@ function s(e) {
|
|
|
95
95
|
let t = e.site().uri;
|
|
96
96
|
return e.uri === t || e.uri === t + "profile/" || e.uri === t + "profile/card" || e.uri === t + "settings/" || e.uri === t + "settings/prefs.ttl" || e.uri === t + "settings/privateTypeIndex.ttl" || e.uri === t + "settings/publicTypeIndex.ttl" || e.uri === t + "settings/serverSide.ttl";
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { o as default };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=internalPane2.esm.js.map
|
|
@@ -7,7 +7,7 @@ import "../_virtual/~icons/lucide/layout-dashboard.esm.js";
|
|
|
7
7
|
import "../_virtual/~icons/lucide/settings-2.esm.js";
|
|
8
8
|
import "../components/header/index.esm.js";
|
|
9
9
|
import { html as n, render as r } from "lit-html";
|
|
10
|
-
|
|
10
|
+
// src/mainPage/header.ts
|
|
11
11
|
async function i(i) {
|
|
12
12
|
let a = document.querySelector("solid-panes-header");
|
|
13
13
|
if (a) return a;
|
|
@@ -70,7 +70,6 @@ async function i(i) {
|
|
|
70
70
|
if (!f) throw Error("Failed to create header");
|
|
71
71
|
return c && c.parentNode ? c.parentNode.insertBefore(f, c) : document.body.prepend(f), f;
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { i as createHeader };
|
|
75
74
|
|
|
76
75
|
//# sourceMappingURL=header.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../navigation/state.cjs.js")
|
|
1
|
+
const e=require("../navigation/state.cjs.js");require("../humanReadablePane2.cjs.js");const t=require("./header.cjs.js"),n=require("./navbar.cjs.js"),r=require("./profileHeading2.cjs.js"),i=require("./navigation.cjs.js"),a=require("../navigation/browserEvents.cjs.js"),o=require("../index.cjs.js");var s=`__lastRenderEnvSignature`;function c(e){return e?[e.layout,e.theme,e.inputMode].join(`|`):``}function l(){let e=document.getElementById(`MainContent`);return e||(e=document.createElement(`main`),e.id=`MainContent`,e.setAttribute(`role`,`main`),e.setAttribute(`tabindex`,`-1`),e.setAttribute(`aria-live`,`polite`),document.body.appendChild(e)),e}async function u(u,d,f){if(window.name===`solidos-human-readable-preview`&&window.self!==window.top){document.body.textContent=`This resource cannot be previewed here. Open it in a new tab instead.`;return}l(),d||=window.location.href;let p=typeof d==`string`?u.sym(d):d;e.clearPaneState(),r.initializeProfileHeading();let m=o.getOutliner(document,f);m[s]=c(f);let h=i.navigationFor(m,u);a.registerBrowserNavigation(h),await h.show({kind:`restore`,subject:p.uri});let g=await t.createHeader(h),_=await n.createNavbar(h);return r.placeProfileHeading(),Promise.all([g,_])}async function d(e){let t=e?.context?.session?.store,n=c(e?.context?.environment);n!==(e?.[s]??``)&&t&&typeof e?.GotoSubject==`function`&&(await i.navigationFor(e,t).show({kind:`restore`}),e[s]=n)}exports.initMainPage=u,exports.refreshUI=d;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","names":["getOutliner","navigationFor","createHeader","createNavbar","require_state","require_header","require_navbar","require_profileHeading","require_navigation","require_browserEvents","require_index","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","outliner","environment","navigation","header","navbar","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":["getOutliner","navigationFor","createHeader","createNavbar","require_state","require_header","require_navbar","require_profileHeading","require_navigation","require_browserEvents","require_index","LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","outliner","environment","navigation","header","navbar","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"A,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GpDQ,GAAS,OAAOC,GAAU,aAAgB,aAG1D,MAAMnB,EAAAA,cAAcmB,EAAUD,CAAK,CAAC,CAAC,KAAK,CAAE,KAAM,SAAU,CAAC,EAC5D,EAAkBR,GAAuBe,EAE9C,C"}
|
package/dist/mainPage/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LiveStore, NamedNode } from '../../node_modules/rdflib';
|
|
2
2
|
import { RenderEnvironment } from '../../node_modules/pane-registry';
|
|
3
3
|
import { OutlineManager } from '../index';
|
|
4
|
-
export declare function initMainPage(store: LiveStore, uri?: string | NamedNode | null, environment?: RenderEnvironment): Promise<[Element, HTMLElement]>;
|
|
4
|
+
export declare function initMainPage(store: LiveStore, uri?: string | NamedNode | null, environment?: RenderEnvironment): Promise<[Element, HTMLElement] | undefined>;
|
|
5
5
|
export declare function refreshUI(outliner: OutlineManager): Promise<void>;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mainPage/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAe,cAAc,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mainPage/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtD,OAAO,EAAe,cAAc,EAAE,MAAM,UAAU,CAAA;AA+BtD,wBAAsB,YAAY,CAChC,KAAK,EAAE,SAAS,EAChB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EAC/B,WAAW,CAAC,EAAE,iBAAiB,+CA4BhC;AAED,wBAAsB,SAAS,CAAE,QAAQ,EAAE,cAAc,iBAexD"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { clearPaneState as e } from "../navigation/state.esm.js";
|
|
2
|
+
import "../humanReadablePane2.esm.js";
|
|
2
3
|
import { createHeader as t } from "./header.esm.js";
|
|
3
4
|
import { createNavbar as n } from "./navbar.esm.js";
|
|
4
5
|
import { initializeProfileHeading as r, placeProfileHeading as i } from "./profileHeading2.esm.js";
|
|
5
6
|
import { navigationFor as a } from "./navigation.esm.js";
|
|
6
7
|
import { registerBrowserNavigation as o } from "../navigation/browserEvents.esm.js";
|
|
7
8
|
import { getOutliner as s } from "../index.esm.js";
|
|
8
|
-
|
|
9
|
+
// src/mainPage/index.ts
|
|
9
10
|
var c = "__lastRenderEnvSignature";
|
|
10
11
|
function l(e) {
|
|
11
12
|
return e ? [
|
|
@@ -19,6 +20,10 @@ function u() {
|
|
|
19
20
|
return e || (e = document.createElement("main"), e.id = "MainContent", e.setAttribute("role", "main"), e.setAttribute("tabindex", "-1"), e.setAttribute("aria-live", "polite"), document.body.appendChild(e)), e;
|
|
20
21
|
}
|
|
21
22
|
async function d(d, f, p) {
|
|
23
|
+
if (window.name === "solidos-human-readable-preview" && window.self !== window.top) {
|
|
24
|
+
document.body.textContent = "This resource cannot be previewed here. Open it in a new tab instead.";
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
22
27
|
u(), f ||= window.location.href;
|
|
23
28
|
let m = typeof f == "string" ? d.sym(f) : f;
|
|
24
29
|
e(), r();
|
|
@@ -36,7 +41,6 @@ async function f(e) {
|
|
|
36
41
|
let t = e?.context?.session?.store, n = l(e?.context?.environment);
|
|
37
42
|
n !== (e?.[c] ?? "") && t && typeof e?.GotoSubject == "function" && (await a(e, t).show({ kind: "restore" }), e[c] = n);
|
|
38
43
|
}
|
|
39
|
-
//#endregion
|
|
40
44
|
export { d as initMainPage, f as refreshUI };
|
|
41
45
|
|
|
42
46
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","registerBrowserNavigation","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":["LAST_RENDER_ENV_KEY","renderEnvSignature","env","ensureMainContent","main","initMainPage","subject","uri","store","clearPaneState","initializeProfileHeading","outliner","getOutliner","environment","navigation","navigationFor","registerBrowserNavigation","header","createHeader","navbar","createNavbar","placeProfileHeading","refreshUI","currentSignature"],"sources":["../../src/mainPage/index.ts"],"sourcesContent":["/* Main Page\n **\n ** This code is called in mashlib and renders the header and left side menu of the Databrowser.\n */\n\nimport { LiveStore, NamedNode } from 'rdflib'\nimport type { RenderEnvironment } from 'pane-registry'\nimport { getOutliner, OutlineManager } from '../index'\nimport { createHeader } from './header'\nimport { createNavbar } from './navbar'\nimport { navigationFor } from './navigation'\nimport { initializeProfileHeading, placeProfileHeading } from './profileHeading'\nimport { registerBrowserNavigation } from '../navigation/browserEvents'\nimport { clearPaneState } from '../navigation/state'\nimport { HUMAN_READABLE_PREVIEW_FRAME_NAME } from '../humanReadablePane'\n\n// Symbol used to stash the last render-relevant env snapshot on the outliner\n// so refreshUI can skip a full GotoSubject re-render when nothing changed.\nconst LAST_RENDER_ENV_KEY = '__lastRenderEnvSignature'\n\nfunction renderEnvSignature (env?: RenderEnvironment): string {\n if (!env) return ''\n return [env.layout, env.theme, env.inputMode].join('|')\n}\n\nfunction ensureMainContent () {\n let main = document.getElementById('MainContent') as HTMLElement | null\n if (!main) {\n main = document.createElement('main')\n main.id = 'MainContent'\n main.setAttribute('role', 'main')\n main.setAttribute('tabindex', '-1')\n main.setAttribute('aria-live', 'polite')\n document.body.appendChild(main)\n }\n return main\n}\n\nexport async function initMainPage (\n store: LiveStore,\n uri?: string | NamedNode | null,\n environment?: RenderEnvironment\n) {\n // A page inside a preview frame navigated to a resource the server answered with the\n // data browser (e.g. a 401); never nest a second SolidOS inside the pane.\n if (window.name === HUMAN_READABLE_PREVIEW_FRAME_NAME && window.self !== window.top) {\n document.body.textContent = 'This resource cannot be previewed here. Open it in a new tab instead.'\n return\n }\n ensureMainContent()\n uri = uri || window.location.href\n const subject: NamedNode = typeof uri === 'string' ? store.sym(uri) : uri\n // A reload shows what the URL is, whatever the history entry last displayed through the navbar\n // or the account menu: the profile on a profile page, otherwise the resource or container itself.\n // This is also what Enter on the current URL ends in where the Navigation API is missing (see\n // NAVIGATION API FALLBACK in navigation/browserEvents.ts): the browser reloads the page.\n clearPaneState()\n initializeProfileHeading()\n const outliner = getOutliner(document, environment)\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = renderEnvSignature(environment)\n const navigation = navigationFor(outliner, store)\n registerBrowserNavigation(navigation)\n await navigation.show({ kind: 'restore', subject: subject.uri })\n\n const header = await createHeader(navigation)\n const navbar = await createNavbar(navigation)\n // The navbar went in at the top of the page; the heading belongs above it\n placeProfileHeading()\n return Promise.all([header, navbar])\n}\n\nexport async function refreshUI (outliner: OutlineManager) {\n const store = outliner?.context?.session?.store\n\n // Only re-run GotoSubject (full pane re-render) when render-relevant\n // environment fields actually changed since the last render.\n const currentSignature = renderEnvSignature(outliner?.context?.environment)\n const previousSignature = (outliner as any)?.[LAST_RENDER_ENV_KEY] ?? ''\n const envChanged = currentSignature !== previousSignature\n\n if (envChanged && store && typeof outliner?.GotoSubject === 'function') {\n // Re-render what the current history entry displays without changing the\n // URL or losing that it came from the account menu.\n await navigationFor(outliner, store).show({ kind: 'restore' })\n ;(outliner as any)[LAST_RENDER_ENV_KEY] = currentSignature\n }\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAMA,IAAsB;AAE5B,SAASC,EAAoB,GAAiC;CAE5D,OADKC,IACE;EAACA,EAAI;EAAQA,EAAI;EAAOA,EAAI;CAAS,CAAC,CAAC,KAAK,GAAG,IADrC;AAEnB;AAEA,SAASC,IAAqB;CAC5B,IAAIC,IAAO,SAAS,eAAe,aAAa;CAShD,OARKA,MACH,IAAO,SAAS,cAAc,MAAM,GACpC,EAAK,KAAK,eACVA,EAAK,aAAa,QAAQ,MAAM,GAChCA,EAAK,aAAa,YAAY,IAAI,GAClCA,EAAK,aAAa,aAAa,QAAQ,GACvC,SAAS,KAAK,YAAYA,CAAI,IAEzBA;AACT;AAEA,eAAsBC,EACpB,GACA,GACA,GACA;CAGA,IAAI,OAAO,SAAA,oCAA8C,OAAO,SAAS,OAAO,KAAK;EACnF,SAAS,KAAK,cAAc;EAC5B;CACF;CAEA,AADAF,EAAkB,GAClB,MAAa,OAAO,SAAS;CAC7B,IAAMG,IAAqB,OAAOC,KAAQ,WAAWC,EAAM,IAAID,CAAG,IAAIA;CAMtE,AADAE,EAAe,GACfC,EAAyB;CACzB,IAAMC,IAAWC,EAAY,UAAUC,CAAW;CACjD,EAAkBb,KAAuBC,EAAmBY,CAAW;CACxE,IAAMC,IAAaC,EAAcJ,GAAUH,CAAK;CAEhD,AADAQ,EAA0BF,CAAU,GACpC,MAAMA,EAAW,KAAK;EAAE,MAAM;EAAW,SAASR,EAAQ;CAAI,CAAC;CAE/D,IAAMW,IAAS,MAAMC,EAAaJ,CAAU,GACtCK,IAAS,MAAMC,EAAaN,CAAU;CAG5C,OADAO,EAAoB,GACb,QAAQ,IAAI,CAACJ,GAAQE,CAAM,CAAC;AACrC;AAEA,eAAsBG,EAAW,GAA0B;CACzD,IAAMd,IAAQG,GAAU,SAAS,SAAS,OAIpCY,IAAmBtB,EAAmBU,GAAU,SAAS,WAAW;CAI1E,AAFmBY,OADQZ,IAAmBX,MAAwB,OAGpDQ,KAAS,OAAOG,GAAU,eAAgB,eAG1D,MAAMI,EAAcJ,GAAUH,CAAK,CAAC,CAAC,KAAK,EAAE,MAAM,UAAU,CAAC,GAC5D,EAAkBR,KAAuBuB;AAE9C"}
|
|
@@ -10,7 +10,7 @@ import "../_virtual/~icons/lucide/folder-open.esm.js";
|
|
|
10
10
|
import "../components/navbar/index.esm.js";
|
|
11
11
|
import { store as l } from "solid-logic";
|
|
12
12
|
import { html as u, render as d } from "lit-html";
|
|
13
|
-
|
|
13
|
+
// src/mainPage/navbar.ts
|
|
14
14
|
function f() {
|
|
15
15
|
return c(window.location.href, o().viaAccountMenu);
|
|
16
16
|
}
|
|
@@ -95,7 +95,6 @@ async function _(m) {
|
|
|
95
95
|
});
|
|
96
96
|
return w;
|
|
97
97
|
}
|
|
98
|
-
//#endregion
|
|
99
98
|
export { _ as createNavbar, m as selectNavbarPane };
|
|
100
99
|
|
|
101
100
|
//# sourceMappingURL=navbar.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./navbar.cjs.js"),n=require("../navigation/controller.cjs.js"),r=require("./profileHeading2.cjs.js");let i=require("pane-registry");i=e.__toESM(i);var a=new WeakMap;function o(e,o){let s=a.get(e);
|
|
1
|
+
const e=require("../_virtual/_rolldown/runtime.cjs.js"),t=require("./navbar.cjs.js"),n=require("../navigation/controller.cjs.js"),r=require("./profileHeading2.cjs.js");let i=require("pane-registry");i=e.__toESM(i);var a=new WeakMap;function o(e,o){let s=a.get(e);if(!s){let c=e.context?.session?.paneRegistry,l=typeof c?.byName==`function`?c.byName.bind(c):i.byName;s=n.createNavigationController({store:o,outliner:e,byName:l,effects:{selectNavbarPane:t.selectNavbarPane,refreshHeading:r.refreshProfileHeading}}),a.set(e,s)}return s}exports.navigationFor=o;
|
|
2
2
|
//# sourceMappingURL=navigation.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.cjs.js","names":["
|
|
1
|
+
{"version":3,"file":"navigation.cjs.js","names":["paneRegistry","createNavigationController","refreshProfileHeading","require_runtime","require_navbar","require_controller","require_profileHeading","pane_registry","controllers","navigationFor","controller","outliner","registry","byName"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n const registry = (outliner as any).context?.session?.paneRegistry\n const byName = typeof registry?.byName === 'function'\n ? registry.byName.bind(registry)\n : paneRegistry.byName\n controller = createNavigationController({\n store,\n outliner,\n byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":"A,sNAOA,IAAMQ,EAAc,IAAI,QAGxB,SAAgBC,EAAe,EAA0B,EAAwC,CAC/F,IAAIC,EAAaF,EAAY,IAAIG,CAAQ,EACzC,GAAI,CAACD,EAAY,CACf,IAAME,EAAYD,EAAiB,SAAS,SAAS,aAC/CE,EAAS,OAAOD,GAAU,QAAW,WACvCA,EAAS,OAAO,KAAKA,CAAQ,EAC7BZ,EAAa,OACjB,EAAaC,EAAAA,2BAA2B,CACtC,QACA,WACA,SACA,QAAS,CAAE,iBAAAG,EAAA,iBAAkB,eAAgBF,EAAAA,qBAAsB,CACrE,CAAC,EACDM,EAAY,IAAIG,EAAUD,CAAU,CACtC,CACA,OAAOA,CACT,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/mainPage/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAMhG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/mainPage/navigation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAA8B,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAMhG,8EAA8E;AAC9E,wBAAgB,aAAa,CAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,GAAG,oBAAoB,CAgB/F"}
|
|
@@ -2,21 +2,24 @@ import { selectNavbarPane as e } from "./navbar.esm.js";
|
|
|
2
2
|
import { createNavigationController as t } from "../navigation/controller.esm.js";
|
|
3
3
|
import { refreshProfileHeading as n } from "./profileHeading2.esm.js";
|
|
4
4
|
import * as r from "pane-registry";
|
|
5
|
-
|
|
5
|
+
// src/mainPage/navigation.ts
|
|
6
6
|
var i = /* @__PURE__ */ new WeakMap();
|
|
7
7
|
function a(a, o) {
|
|
8
8
|
let s = i.get(a);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
if (!s) {
|
|
10
|
+
let c = a.context?.session?.paneRegistry, l = typeof c?.byName == "function" ? c.byName.bind(c) : r.byName;
|
|
11
|
+
s = t({
|
|
12
|
+
store: o,
|
|
13
|
+
outliner: a,
|
|
14
|
+
byName: l,
|
|
15
|
+
effects: {
|
|
16
|
+
selectNavbarPane: e,
|
|
17
|
+
refreshHeading: n
|
|
18
|
+
}
|
|
19
|
+
}), i.set(a, s);
|
|
20
|
+
}
|
|
21
|
+
return s;
|
|
18
22
|
}
|
|
19
|
-
//#endregion
|
|
20
23
|
export { a as navigationFor };
|
|
21
24
|
|
|
22
25
|
//# sourceMappingURL=navigation.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation.esm.js","names":["paneRegistry","controllers","navigationFor","controller","outliner","createNavigationController","refreshProfileHeading"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n controller = createNavigationController({\n store,\n outliner,\n byName
|
|
1
|
+
{"version":3,"file":"navigation.esm.js","names":["paneRegistry","controllers","navigationFor","controller","outliner","registry","byName","createNavigationController","refreshProfileHeading"],"sources":["../../src/mainPage/navigation.ts"],"sourcesContent":["import type { LiveStore } from 'rdflib'\nimport * as paneRegistry from 'pane-registry'\nimport type { OutlineManager } from '../outline/manager'\nimport { createNavigationController, type NavigationController } from '../navigation/controller'\nimport { selectNavbarPane } from './navbar'\nimport { refreshProfileHeading } from './profileHeading'\n\nconst controllers = new WeakMap<OutlineManager, NavigationController>()\n\n/** The page's navigation controller for an outliner, created on first use. */\nexport function navigationFor (outliner: OutlineManager, store: LiveStore): NavigationController {\n let controller = controllers.get(outliner)\n if (!controller) {\n const registry = (outliner as any).context?.session?.paneRegistry\n const byName = typeof registry?.byName === 'function'\n ? registry.byName.bind(registry)\n : paneRegistry.byName\n controller = createNavigationController({\n store,\n outliner,\n byName,\n effects: { selectNavbarPane, refreshHeading: refreshProfileHeading }\n })\n controllers.set(outliner, controller)\n }\n return controller\n}\n"],"mappings":";;;;;AAOA,IAAMC,oBAAc,IAAI,QAA8C;AAGtE,SAAgBC,EAAe,GAA0B,GAAwC;CAC/F,IAAIC,IAAaF,EAAY,IAAIG,CAAQ;CACzC,IAAI,CAACD,GAAY;EACf,IAAME,IAAYD,EAAiB,SAAS,SAAS,cAC/CE,IAAS,OAAOD,GAAU,UAAW,aACvCA,EAAS,OAAO,KAAKA,CAAQ,IAC7BL,EAAa;EAOjB,AANA,IAAaO,EAA2B;GACtC;GACA;GACA;GACA,SAAS;IAAE;IAAkB,gBAAgBC;GAAsB;EACrE,CAAC,GACDP,EAAY,IAAIG,GAAUD,CAAU;CACtC;CACA,OAAOA;AACT"}
|
|
@@ -7,7 +7,7 @@ import { getViewerMode as a, presentProfile as o } from "../components/profile-h
|
|
|
7
7
|
import "../components/profile-heading/index.esm.js";
|
|
8
8
|
|
|
9
9
|
import { authSession as s, authn as c, store as l } from "solid-logic";
|
|
10
|
-
|
|
10
|
+
// src/mainPage/profileHeading.ts
|
|
11
11
|
var u = "solid-panes-profile-heading", d = "profile-heading-mount", f = 0, p = !1, m = !1, h = !1, g, _ = "", v = "", y = "", b = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakMap();
|
|
12
12
|
function S(e) {
|
|
13
13
|
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || typeof e.animate != "function") return;
|
|
@@ -152,7 +152,6 @@ function k() {
|
|
|
152
152
|
console.error("Failed to refresh profile heading.", e);
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
//#endregion
|
|
156
155
|
export { k as initializeProfileHeading, O as placeProfileHeading, D as refreshProfileHeading };
|
|
157
156
|
|
|
158
157
|
//# sourceMappingURL=profileHeading2.esm.js.map
|