solid-panes 4.5.0 → 5.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -40
- package/dist/RDFXMLPane.d.ts +2 -3
- package/dist/RDFXMLPane2.cjs.js +3 -0
- package/dist/RDFXMLPane2.cjs.js.map +1 -0
- package/dist/RDFXMLPane2.esm.js +55 -0
- package/dist/RDFXMLPane2.esm.js.map +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs.js +1 -0
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/folder-open.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/folder-open.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/globe.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/globe.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/help-circle.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/help-circle.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/help-circle.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/help-circle.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/pencil.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/pencil.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/pencil.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/pencil.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/settings-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/settings-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/settings-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/settings-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/share-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/share-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/share-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/trash-2.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/trash-2.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/user.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/user.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/user.esm.js.map +1 -0
- package/dist/_virtual/~icons/lucide/users.cjs.js +2 -0
- package/dist/_virtual/~icons/lucide/users.cjs.js.map +1 -0
- package/dist/_virtual/~icons/lucide/users.esm.js +11 -0
- package/dist/_virtual/~icons/lucide/users.esm.js.map +1 -0
- package/dist/audio/audioPane.cjs.js +2 -0
- package/dist/audio/audioPane.cjs.js.map +1 -0
- package/dist/audio/audioPane.esm.js +99 -0
- package/dist/audio/audioPane.esm.js.map +1 -0
- package/dist/classInstancePane.cjs.js +2 -0
- package/dist/classInstancePane.cjs.js.map +1 -0
- package/dist/classInstancePane.esm.js +50 -0
- package/dist/classInstancePane.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +14 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +292 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +22 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +15 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +266 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +19 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +321 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +13 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +36 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +468 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +2 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +7 -0
- package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +1 -0
- package/dist/components/file-explorer-header/helper.cjs.js +2 -0
- package/dist/components/file-explorer-header/helper.cjs.js.map +1 -0
- package/dist/components/file-explorer-header/helper.d.ts +15 -0
- package/dist/components/file-explorer-header/helper.d.ts.map +1 -0
- package/dist/components/file-explorer-header/helper.esm.js +64 -0
- package/dist/components/file-explorer-header/helper.esm.js.map +1 -0
- package/dist/components/file-explorer-header/types.d.ts +2 -0
- package/dist/components/file-explorer-header/types.d.ts.map +1 -0
- package/dist/components/header/Header.cjs.js +19 -0
- package/dist/components/header/Header.cjs.js.map +1 -0
- package/dist/components/header/Header.d.ts +8 -0
- package/dist/components/header/Header.d.ts.map +1 -0
- package/dist/components/header/Header.esm.js +228 -0
- package/dist/components/header/Header.esm.js.map +1 -0
- package/dist/components/header/Header.styles.cjs.js +2 -0
- package/dist/components/header/Header.styles.cjs.js.map +1 -0
- package/dist/components/header/Header.styles.esm.js +7 -0
- package/dist/components/header/Header.styles.esm.js.map +1 -0
- package/dist/components/header/index.cjs.js +1 -0
- package/dist/components/header/index.d.ts +4 -0
- package/dist/components/header/index.d.ts.map +1 -0
- package/dist/components/header/index.esm.js +1 -0
- package/dist/components/navbar/Navbar.cjs.js +15 -0
- package/dist/components/navbar/Navbar.cjs.js.map +1 -0
- package/dist/components/navbar/Navbar.d.ts +14 -0
- package/dist/components/navbar/Navbar.d.ts.map +1 -0
- package/dist/components/navbar/Navbar.esm.js +232 -0
- package/dist/components/navbar/Navbar.esm.js.map +1 -0
- package/dist/components/navbar/Navbar.styles.cjs.js +2 -0
- package/dist/components/navbar/Navbar.styles.cjs.js.map +1 -0
- package/dist/components/navbar/Navbar.styles.esm.js +7 -0
- package/dist/components/navbar/Navbar.styles.esm.js.map +1 -0
- package/dist/components/navbar/index.cjs.js +1 -0
- package/dist/components/navbar/index.d.ts +4 -0
- package/dist/components/navbar/index.d.ts.map +1 -0
- package/dist/components/navbar/index.esm.js +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js +16 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.cjs.js.map +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +8 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +1 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js +215 -0
- package/dist/components/resource-actions-menu/DeleteResourceDialog.esm.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +18 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +16 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +1 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +260 -0
- package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +1 -0
- package/dist/dashboard/basicPreferences.cjs.js +2 -0
- package/dist/dashboard/basicPreferences.cjs.js.map +1 -0
- package/dist/dashboard/basicPreferences.d.ts +1 -1
- package/dist/dashboard/basicPreferences.esm.js +70 -0
- package/dist/dashboard/basicPreferences.esm.js.map +1 -0
- package/dist/dashboard/dashboardPane.cjs.js +2 -0
- package/dist/dashboard/dashboardPane.cjs.js.map +1 -0
- package/dist/dashboard/dashboardPane.d.ts +1 -1
- package/dist/dashboard/dashboardPane.esm.js +7 -0
- package/dist/dashboard/dashboardPane.esm.js.map +1 -0
- package/dist/dashboard/homepage.cjs.js +2 -0
- package/dist/dashboard/homepage.cjs.js.map +1 -0
- package/dist/dashboard/homepage.d.ts +1 -1
- package/dist/dashboard/homepage.esm.js +26 -0
- package/dist/dashboard/homepage.esm.js.map +1 -0
- package/dist/dashboard/ontologyData.cjs.js +37 -0
- package/dist/dashboard/ontologyData.cjs.js.map +1 -0
- package/dist/dashboard/ontologyData.esm.js +6 -0
- package/dist/dashboard/ontologyData.esm.js.map +1 -0
- package/dist/dashboard/preferencesFormText.cjs.js +20 -0
- package/dist/dashboard/preferencesFormText.cjs.js.map +1 -0
- package/dist/dashboard/preferencesFormText.esm.js +6 -0
- package/dist/dashboard/preferencesFormText.esm.js.map +1 -0
- package/dist/dataContentPane.d.ts +2 -3
- package/dist/dataContentPane2.cjs.js +2 -0
- package/dist/dataContentPane2.cjs.js.map +1 -0
- package/dist/dataContentPane2.esm.js +109 -0
- package/dist/dataContentPane2.esm.js.map +1 -0
- package/dist/defaultPane.d.ts +2 -3
- package/dist/defaultPane2.cjs.js +2 -0
- package/dist/defaultPane2.cjs.js.map +1 -0
- package/dist/defaultPane2.esm.js +41 -0
- package/dist/defaultPane2.esm.js.map +1 -0
- package/dist/dev.d.ts +10 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dokieli/dokieliPane.cjs.js +2 -0
- package/dist/dokieli/dokieliPane.cjs.js.map +1 -0
- package/dist/dokieli/dokieliPane.esm.js +39 -0
- package/dist/dokieli/dokieliPane.esm.js.map +1 -0
- package/dist/dokieli/{new.js → new.cjs.js} +4 -10
- package/dist/dokieli/new.cjs.js.map +1 -0
- package/dist/dokieli/new.esm.js +6 -0
- package/dist/dokieli/new.esm.js.map +1 -0
- package/dist/form/pane.cjs.js +4 -0
- package/dist/form/pane.cjs.js.map +1 -0
- package/dist/form/pane.d.ts +1 -2
- package/dist/form/pane.esm.js +122 -0
- package/dist/form/pane.esm.js.map +1 -0
- package/dist/home/homePane.cjs.js +2 -0
- package/dist/home/homePane.cjs.js.map +1 -0
- package/dist/home/homePane.d.ts +1 -1
- package/dist/home/homePane.esm.js +35 -0
- package/dist/home/homePane.esm.js.map +1 -0
- package/dist/humanReadablePane.d.ts +2 -3
- package/dist/humanReadablePane2.cjs.js +2 -0
- package/dist/humanReadablePane2.cjs.js.map +1 -0
- package/dist/humanReadablePane2.esm.js +123 -0
- package/dist/humanReadablePane2.esm.js.map +1 -0
- package/dist/icons/folder.cjs.js +2 -0
- package/dist/icons/folder.cjs.js.map +1 -0
- package/dist/icons/folder.esm.js +6 -0
- package/dist/icons/folder.esm.js.map +1 -0
- package/dist/icons/friends.cjs.js +2 -0
- package/dist/icons/friends.cjs.js.map +1 -0
- package/dist/icons/friends.esm.js +6 -0
- package/dist/icons/friends.esm.js.map +1 -0
- package/dist/icons/person.cjs.js +2 -0
- package/dist/icons/person.cjs.js.map +1 -0
- package/dist/icons/person.esm.js +6 -0
- package/dist/icons/person.esm.js.map +1 -0
- package/dist/imagePane.d.ts +2 -3
- package/dist/imagePane2.cjs.js +2 -0
- package/dist/imagePane2.cjs.js.map +1 -0
- package/dist/imagePane2.esm.js +32 -0
- package/dist/imagePane2.esm.js.map +1 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +31 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/internal/internalPane.d.ts +1 -2
- package/dist/internal/internalPane2.cjs.js +2 -0
- package/dist/internal/internalPane2.cjs.js.map +1 -0
- package/dist/internal/internalPane2.esm.js +104 -0
- package/dist/internal/internalPane2.esm.js.map +1 -0
- package/dist/mainPage/header.cjs.js +2 -0
- package/dist/mainPage/header.cjs.js.map +1 -0
- package/dist/mainPage/header.d.ts +1 -15
- package/dist/mainPage/header.d.ts.map +1 -1
- package/dist/mainPage/header.esm.js +72 -0
- package/dist/mainPage/header.esm.js.map +1 -0
- package/dist/mainPage/index.cjs.js +2 -0
- package/dist/mainPage/index.cjs.js.map +1 -0
- package/dist/mainPage/index.d.ts +3 -15
- package/dist/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.esm.js +36 -0
- package/dist/mainPage/index.esm.js.map +1 -0
- package/dist/mainPage/navbar.cjs.js +2 -0
- package/dist/mainPage/navbar.cjs.js.map +1 -0
- package/dist/mainPage/navbar.d.ts +3 -0
- package/dist/mainPage/navbar.d.ts.map +1 -0
- package/dist/mainPage/navbar.esm.js +66 -0
- package/dist/mainPage/navbar.esm.js.map +1 -0
- package/dist/n3Pane.d.ts +2 -3
- package/dist/n3Pane2.cjs.js +3 -0
- package/dist/n3Pane2.cjs.js.map +1 -0
- package/dist/n3Pane2.esm.js +52 -0
- package/dist/n3Pane2.esm.js.map +1 -0
- package/dist/outline/context.cjs.js +2 -0
- package/dist/outline/context.cjs.js.map +1 -0
- package/dist/outline/context.d.ts +3 -3
- package/dist/outline/context.esm.js +18 -0
- package/dist/outline/context.esm.js.map +1 -0
- package/dist/outline/manager2.cjs.js +2 -0
- package/dist/outline/manager2.cjs.js.map +1 -0
- package/dist/outline/manager2.esm.js +711 -0
- package/dist/outline/manager2.esm.js.map +1 -0
- package/dist/outline/outlineIcons.cjs.js +2 -0
- package/dist/outline/outlineIcons.cjs.js.map +1 -0
- package/dist/outline/outlineIcons.esm.js +10 -0
- package/dist/outline/outlineIcons.esm.js.map +1 -0
- package/dist/outline/propertyViews.cjs.js +2 -0
- package/dist/outline/propertyViews.cjs.js.map +1 -0
- package/dist/outline/propertyViews.esm.js +19 -0
- package/dist/outline/propertyViews.esm.js.map +1 -0
- package/dist/outline/queryByExample.cjs.js +2 -0
- package/dist/outline/queryByExample.cjs.js.map +1 -0
- package/dist/outline/queryByExample.esm.js +26 -0
- package/dist/outline/queryByExample.esm.js.map +1 -0
- package/dist/outline/sourcePaneIcon.d.ts +2 -0
- package/dist/outline/sourcePaneIcon.d.ts.map +1 -0
- package/dist/outline/userInput.cjs.js +61 -0
- package/dist/outline/userInput.cjs.js.map +1 -0
- package/dist/outline/userInput.esm.js +784 -0
- package/dist/outline/userInput.esm.js.map +1 -0
- package/dist/outline/viewAsImage.cjs.js +2 -0
- package/dist/outline/viewAsImage.cjs.js.map +1 -0
- package/dist/outline/viewAsImage.esm.js +10 -0
- package/dist/outline/viewAsImage.esm.js.map +1 -0
- package/dist/outline/viewAsMbox.cjs.js +2 -0
- package/dist/outline/viewAsMbox.cjs.js.map +1 -0
- package/dist/outline/viewAsMbox.esm.js +9 -0
- package/dist/outline/viewAsMbox.esm.js.map +1 -0
- package/dist/pad/padPane.d.ts +1 -2
- package/dist/pad/padPane2.cjs.js +2 -0
- package/dist/pad/padPane2.cjs.js.map +1 -0
- package/dist/pad/padPane2.esm.js +173 -0
- package/dist/pad/padPane2.esm.js.map +1 -0
- package/dist/playlist/playlistPane.cjs.js +2 -0
- package/dist/playlist/playlistPane.cjs.js.map +1 -0
- package/dist/playlist/playlistPane.esm.js +49 -0
- package/dist/playlist/playlistPane.esm.js.map +1 -0
- package/dist/registerPanes.cjs.js +2 -0
- package/dist/registerPanes.cjs.js.map +1 -0
- package/dist/registerPanes.esm.js +46 -0
- package/dist/registerPanes.esm.js.map +1 -0
- package/dist/schedule/formsForSchedule.cjs.js +117 -0
- package/dist/schedule/formsForSchedule.cjs.js.map +1 -0
- package/dist/schedule/formsForSchedule.esm.js +6 -0
- package/dist/schedule/formsForSchedule.esm.js.map +1 -0
- package/dist/schedule/schedulePane.d.ts +2 -4
- package/dist/schedule/schedulePane2.cjs.js +8 -0
- package/dist/schedule/schedulePane2.cjs.js.map +1 -0
- package/dist/schedule/schedulePane2.esm.js +385 -0
- package/dist/schedule/schedulePane2.esm.js.map +1 -0
- package/dist/sharing/sharingPane.cjs.js +2 -0
- package/dist/sharing/sharingPane.cjs.js.map +1 -0
- package/dist/sharing/sharingPane.esm.js +22 -0
- package/dist/sharing/sharingPane.esm.js.map +1 -0
- package/dist/slideshow/slideshowPane.cjs.js +2 -0
- package/dist/slideshow/slideshowPane.cjs.js.map +1 -0
- package/dist/slideshow/slideshowPane.esm.js +46 -0
- package/dist/slideshow/slideshowPane.esm.js.map +1 -0
- package/dist/social/editProfileDetails.cjs.js +2 -0
- package/dist/social/editProfileDetails.cjs.js.map +1 -0
- package/dist/social/editProfileDetails.d.ts +1 -2
- package/dist/social/editProfileDetails.esm.js +12 -0
- package/dist/social/editProfileDetails.esm.js.map +1 -0
- package/dist/social/icons.cjs.js +82 -0
- package/dist/social/icons.cjs.js.map +1 -0
- package/dist/social/{icons.js → icons.esm.js} +12 -18
- package/dist/social/icons.esm.js.map +1 -0
- package/dist/social/socialPane.d.ts +2 -3
- package/dist/social/socialPane2.cjs.js +6 -0
- package/dist/social/socialPane2.cjs.js.map +1 -0
- package/dist/social/socialPane2.esm.js +326 -0
- package/dist/social/socialPane2.esm.js.map +1 -0
- package/dist/social/socialSections.cjs.js +2 -0
- package/dist/social/socialSections.cjs.js.map +1 -0
- package/dist/social/socialSections.d.ts +2 -2
- package/dist/social/socialSections.esm.js +222 -0
- package/dist/social/socialSections.esm.js.map +1 -0
- package/dist/social/spinner.cjs.js +1 -0
- package/dist/social/spinner.esm.js +1 -0
- package/dist/social/triage.cjs.js +2 -0
- package/dist/social/triage.cjs.js.map +1 -0
- package/dist/social/triage.d.ts +2 -2
- package/dist/social/triage.esm.js +44 -0
- package/dist/social/triage.esm.js.map +1 -0
- package/dist/tabbed/tabbedPane.cjs.js +2 -0
- package/dist/tabbed/tabbedPane.cjs.js.map +1 -0
- package/dist/tabbed/tabbedPane.d.ts +1 -1
- package/dist/tabbed/tabbedPane.esm.js +38 -0
- package/dist/tabbed/tabbedPane.esm.js.map +1 -0
- package/dist/tableViewPane.cjs.js +2 -0
- package/dist/tableViewPane.cjs.js.map +1 -0
- package/dist/tableViewPane.esm.js +20 -0
- package/dist/tableViewPane.esm.js.map +1 -0
- package/dist/transaction/pane.cjs.js +8 -0
- package/dist/transaction/pane.cjs.js.map +1 -0
- package/dist/transaction/pane.esm.js +212 -0
- package/dist/transaction/pane.esm.js.map +1 -0
- package/dist/transaction/period.cjs.js +4 -0
- package/dist/transaction/period.cjs.js.map +1 -0
- package/dist/transaction/period.esm.js +126 -0
- package/dist/transaction/period.esm.js.map +1 -0
- package/dist/trip/tripPane.cjs.js +2 -0
- package/dist/trip/tripPane.cjs.js.map +1 -0
- package/dist/trip/tripPane.esm.js +85 -0
- package/dist/trip/tripPane.esm.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.dom.cjs.js +2 -0
- package/dist/trustedApplications/trustedApplications.dom.cjs.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.dom.d.ts +1 -1
- package/dist/trustedApplications/trustedApplications.dom.esm.js +108 -0
- package/dist/trustedApplications/trustedApplications.dom.esm.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.utils.cjs.js +2 -0
- package/dist/trustedApplications/trustedApplications.utils.cjs.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.utils.d.ts +1 -1
- package/dist/trustedApplications/trustedApplications.utils.esm.js +20 -0
- package/dist/trustedApplications/trustedApplications.utils.esm.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.view.cjs.js +2 -0
- package/dist/trustedApplications/trustedApplications.view.cjs.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.view.d.ts +1 -1
- package/dist/trustedApplications/trustedApplications.view.esm.js +41 -0
- package/dist/trustedApplications/trustedApplications.view.esm.js.map +1 -0
- package/dist/ui/pane.cjs.js +4 -0
- package/dist/ui/pane.cjs.js.map +1 -0
- package/dist/ui/pane.esm.js +56 -0
- package/dist/ui/pane.esm.js.map +1 -0
- package/dist/utils/paneUtils.cjs.js +2 -0
- package/dist/utils/paneUtils.cjs.js.map +1 -0
- package/dist/utils/paneUtils.d.ts +19 -0
- package/dist/utils/paneUtils.d.ts.map +1 -0
- package/dist/utils/paneUtils.esm.js +52 -0
- package/dist/utils/paneUtils.esm.js.map +1 -0
- package/dist/utils/podUtils.cjs.js +2 -0
- package/dist/utils/podUtils.cjs.js.map +1 -0
- package/dist/utils/podUtils.d.ts +4 -0
- package/dist/utils/podUtils.d.ts.map +1 -0
- package/dist/utils/podUtils.esm.js +46 -0
- package/dist/utils/podUtils.esm.js.map +1 -0
- package/dist/utils/webIdUtils.cjs.js +2 -0
- package/dist/utils/webIdUtils.cjs.js.map +1 -0
- package/dist/utils/webIdUtils.d.ts +6 -0
- package/dist/utils/webIdUtils.d.ts.map +1 -0
- package/dist/utils/webIdUtils.esm.js +48 -0
- package/dist/utils/webIdUtils.esm.js.map +1 -0
- package/dist/versionInfo.cjs.js +2 -0
- package/dist/versionInfo.cjs.js.map +1 -0
- package/dist/versionInfo.esm.js +40 -0
- package/dist/versionInfo.esm.js.map +1 -0
- package/dist/video/videoPane.cjs.js +2 -0
- package/dist/video/videoPane.cjs.js.map +1 -0
- package/dist/video/videoPane.esm.js +25 -0
- package/dist/video/videoPane.esm.js.map +1 -0
- package/package.json +51 -66
- package/dist/0314353e28ce6e5539af.svg +0 -9
- package/dist/04567ff683933c35c465.png +0 -0
- package/dist/10163fd9b5a0e00d63a0.png +0 -0
- package/dist/1234dcb2eec2e45f252b.png +0 -0
- package/dist/20899934157df4db56cb.png +0 -0
- package/dist/33760bf79f097f449da5.png +0 -0
- package/dist/4cceba29ab33b1ddd9bb.svg +0 -6
- package/dist/578d2b6ed32e7624164e.png +0 -0
- package/dist/5f62a5b2b7e99b9640c7.png +0 -0
- package/dist/6525766ecd288ec60129.png +0 -0
- package/dist/7800be6f6c4b5b0f4f20.png +0 -0
- package/dist/7b7538c6f6b317968009.svg +0 -9
- package/dist/92d03142abe6efc0b42d.svg +0 -6
- package/dist/976473cf5fe24d657d4b.png +0 -0
- package/dist/RDFXMLPane.css +0 -70
- package/dist/RDFXMLPane.js +0 -100
- package/dist/argument/argumentPane.js +0 -60
- package/dist/attach/attachPane.js +0 -393
- package/dist/audio/audioPane.js +0 -181
- package/dist/bda84f59e7216675a208.png +0 -0
- package/dist/cd68e8f3990ba8b2139e.png +0 -0
- package/dist/classInstancePane.js +0 -91
- package/dist/dashboard/basicPreferences.js +0 -147
- package/dist/dashboard/dashboardPane.js +0 -73
- package/dist/dashboard/homepage.js +0 -42
- package/dist/dataContentPane.css +0 -271
- package/dist/dataContentPane.js +0 -226
- package/dist/defaultPane.css +0 -97
- package/dist/defaultPane.js +0 -81
- package/dist/dokieli/dokieliPane.js +0 -74
- package/dist/e7074a7e2cb69e51cfd3.png +0 -0
- package/dist/f3772696fb7ee53c23d8.png +0 -0
- package/dist/form/formPane.css +0 -120
- package/dist/form/pane.js +0 -250
- package/dist/home/homePane.js +0 -74
- package/dist/humanReadablePane.css +0 -129
- package/dist/humanReadablePane.js +0 -243
- package/dist/icons/clock.svg +0 -7
- package/dist/icons/comment.svg +0 -6
- package/dist/icons/dashboard.svg +0 -9
- package/dist/icons/downArrow.svg +0 -6
- package/dist/icons/folder.svg +0 -6
- package/dist/icons/friends.svg +0 -9
- package/dist/icons/help.svg +0 -8
- package/dist/icons/iconHelper.js +0 -23
- package/dist/icons/menu.svg +0 -8
- package/dist/icons/person.svg +0 -6
- package/dist/icons/personInCircle.svg +0 -8
- package/dist/icons/sharing.svg +0 -10
- package/dist/icons/signOut.svg +0 -8
- package/dist/icons/signUp.svg +0 -9
- package/dist/icons/star.svg +0 -3
- package/dist/imagePane.css +0 -4
- package/dist/imagePane.js +0 -67
- package/dist/index.js +0 -123
- package/dist/internal/internalPane.css +0 -14
- package/dist/internal/internalPane.js +0 -183
- package/dist/mainPage/footer.d.ts +0 -15
- package/dist/mainPage/footer.d.ts.map +0 -1
- package/dist/mainPage/footer.js +0 -29
- package/dist/mainPage/header.js +0 -203
- package/dist/mainPage/index.js +0 -78
- package/dist/mainPage/menu.css +0 -243
- package/dist/mainPage/menu.d.ts +0 -7
- package/dist/mainPage/menu.d.ts.map +0 -1
- package/dist/mainPage/menu.js +0 -436
- package/dist/microblogPane/mbStyle.css +0 -267
- package/dist/microblogPane/microblogPane.js +0 -1031
- package/dist/n3Pane.css +0 -49
- package/dist/n3Pane.js +0 -88
- package/dist/outline/context.js +0 -21
- package/dist/outline/manager.css +0 -78
- package/dist/outline/manager.js +0 -2115
- package/dist/outline/outlineIcons.js +0 -126
- package/dist/outline/propertyViews.js +0 -43
- package/dist/outline/queryByExample.js +0 -285
- package/dist/outline/userInput.js +0 -1821
- package/dist/outline/viewAsImage.js +0 -14
- package/dist/outline/viewAsMbox.js +0 -21
- package/dist/pad/padPane.css +0 -40
- package/dist/pad/padPane.js +0 -421
- package/dist/playlist/playlistPane.js +0 -119
- package/dist/profileUtils/ownerProfile.d.ts +0 -5
- package/dist/profileUtils/ownerProfile.d.ts.map +0 -1
- package/dist/profileUtils/ownerProfile.js +0 -84
- package/dist/registerPanes.js +0 -145
- package/dist/schedule/schedulePane.css +0 -294
- package/dist/schedule/schedulePane.js +0 -1022
- package/dist/sharing/sharingPane.js +0 -48
- package/dist/slideshow/slideshowPane.js +0 -79
- package/dist/social/editProfileDetails.js +0 -362
- package/dist/social/socialPane.css +0 -1464
- package/dist/social/socialPane.js +0 -651
- package/dist/social/socialSections.js +0 -393
- package/dist/social/spinner.js +0 -13
- package/dist/social/triage.js +0 -79
- package/dist/solid-panes.js +0 -84629
- package/dist/solid-panes.js.map +0 -1
- package/dist/solid-panes.min.js +0 -3933
- package/dist/solid-panes.min.js.map +0 -1
- package/dist/styles/tabbedtab.css +0 -1066
- package/dist/styles/utilities.css +0 -5
- package/dist/tabbed/tabbedPane.js +0 -59
- package/dist/tableViewPane.js +0 -56
- package/dist/transaction/pane.js +0 -477
- package/dist/transaction/period.js +0 -323
- package/dist/trip/tripPane.js +0 -174
- package/dist/trustedApplications/trustedApplications.dom.js +0 -145
- package/dist/trustedApplications/trustedApplications.utils.js +0 -23
- package/dist/trustedApplications/trustedApplications.view.js +0 -55
- package/dist/ui/pane.js +0 -146
- package/dist/versionInfo.js +0 -41
- package/dist/video/videoPane.js +0 -42
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanReadablePane2.cjs.js","names":[],"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) => 'view' | '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 ): 'view' | '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 'view'\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 }\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IAAO,aAAe,IAAO,0BAC/B,EAAM,aAAa,UAAW,6CAA6C,EAI7E,EAAG,QAAQ,aAAa,MAAO,EAAQ,GAAG,CAAC,CAAC,KAAK,GAAY,CAC3D,IAAM,EAAW,EAAS,cAAgB,GACpC,EAAW,EAAS,SAAS,oDAAoD,EAAI,IAAM,EAC3F,EAAQ,KAAK,IAAI,GAAI,EAAS,MAAM,IAAI,CAAC,CAAC,OAAS,CAAQ,EAG3D,EAAY,EAAS,SAAS,oDAAoD,GACvE,EAAS,SAAS,aAAa,EAChD,EAAa,IAAI,EAAQ,IAAK,EAAY,UAAY,MAAM,EAE5D,EAAoB,EAAO,CAAK,CAClC,CAAC,CAAC,CAAC,MAAM,GAAS,CAChB,QAAQ,MAAM,+CAAgD,CAAK,EAEnE,EAAoB,EAAO,EAAE,CAC/B,CAAC,EAED,IAAM,EAAiB,EAAW,cAAc,KAAK,EACrD,EAAe,UAAU,IAAI,gCAAgC,EAC7D,EAAe,YAAY,CAAK,EAChC,EAAI,YAAY,CAAc,CAChC,CAEA,OAAO,CACT,CACF"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`.human-readable-pane{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block}.human-readable-pane__container{box-sizing:border-box;width:100%;min-width:0;max-width:100%;display:block;overflow-x:hidden}.human-readable-pane__frame{height:var(--human-readable-pane-height,30rem);box-sizing:border-box;resize:both;border:1px solid;width:100%;min-width:0;max-width:100%;padding:1rem;display:block;overflow:auto}.human-readable-pane__frame--iframe{background:var(--color-background,white);width:100%;max-width:100%;min-height:18rem;padding:0;overflow:hidden}.human-readable-pane__frame--markdown{overflow-wrap:anywhere;word-break:break-word}.human-readable-pane__frame--plain-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font-family:monospace}.human-readable-pane__frame--markdown>*{box-sizing:border-box;max-width:100%}.human-readable-pane__frame--markdown img,.human-readable-pane__frame--markdown video,.human-readable-pane__frame--markdown canvas,.human-readable-pane__frame--markdown iframe{max-width:100%;height:auto}.human-readable-pane__frame--markdown pre,.human-readable-pane__frame--markdown code{overflow-wrap:anywhere;word-break:break-word;max-width:100%}.human-readable-pane__frame--markdown pre{white-space:pre-wrap}.human-readable-pane__frame--markdown table{box-sizing:border-box;width:100%;max-width:100%;display:block;overflow-x:auto}.human-readable-pane__frame--markdown th,.human-readable-pane__frame--markdown td{white-space:normal;overflow-wrap:anywhere;word-break:break-word}.human-readable-pane[data-layout=mobile] .human-readable-pane__frame{resize:none;min-width:0;padding:.75rem}.human-readable-pane[data-layout=mobile] .human-readable-pane__frame--markdown,.human-readable-pane[data-layout=mobile] .human-readable-pane__frame--plain-text{overflow-wrap:anywhere;word-break:break-word}.human-readable-pane[data-layout=mobile] .human-readable-pane__frame--iframe{width:100%;max-width:100%;min-height:16rem;height:min(var(--human-readable-pane-height,30rem), 75vh)}@media (width<=576px){.human-readable-pane__frame{resize:none;min-width:0;padding:.75rem}.human-readable-pane__frame--markdown,.human-readable-pane__frame--plain-text{overflow-wrap:anywhere;word-break:break-word}.human-readable-pane__frame--iframe{width:100%;max-width:100%;min-height:16rem;height:min(var(--human-readable-pane-height,30rem), 75vh)}}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
|
+
import { icons as e, ns as t } from "solid-ui";
|
|
3
|
+
import { Util as n } from "rdflib";
|
|
4
|
+
import { marked as r } from "marked";
|
|
5
|
+
import i from "dompurify";
|
|
6
|
+
//#region src/humanReadablePane.ts
|
|
7
|
+
var a = (e) => {
|
|
8
|
+
if (!e) return !1;
|
|
9
|
+
let t = e.split("?")[0].split("#")[0];
|
|
10
|
+
return /\.(md|markdown|mdown|mkd|mkdn)$/i.test(t);
|
|
11
|
+
}, o = /* @__PURE__ */ new Map();
|
|
12
|
+
function s(e, t, n) {
|
|
13
|
+
e.className = "", e.classList.add("human-readable-pane__frame"), e.classList.add(`human-readable-pane__frame--${t}`), e.style.setProperty("--human-readable-pane-height", `${n}em`);
|
|
14
|
+
}
|
|
15
|
+
var c = {
|
|
16
|
+
icon: function(t, n) {
|
|
17
|
+
if (t && a(t.uri)) return e.iconBase + "markdown.svg";
|
|
18
|
+
if (t) {
|
|
19
|
+
let r = n.session.store, i = o.get(t.uri);
|
|
20
|
+
if (i === "dokieli") return e.iconBase + "dokieli-logo.png";
|
|
21
|
+
if (i === "html") return e.originalIconBase + "tango/22-text-x-generic.png";
|
|
22
|
+
let a = r.fetcher.getHeader(t.doc(), "content");
|
|
23
|
+
if (a && a.length > 0) {
|
|
24
|
+
let n = a[0], r = n.includes("<script src=\"https://dokie.li/scripts/dokieli.js\">") || n.includes("dokieli.css");
|
|
25
|
+
return o.set(t.uri, r ? "dokieli" : "html"), r ? e.iconBase + "dokieli-logo.png" : e.originalIconBase + "tango/22-text-x-generic.png";
|
|
26
|
+
}
|
|
27
|
+
let s = r.fetcher.getHeader(t.doc(), "content-type");
|
|
28
|
+
if ((s ? s[0].split(";", 1)[0].trim() : null) === "text/html") return r.fetcher._fetch(t.uri).then((e) => e.text()).then((n) => {
|
|
29
|
+
let r = n.includes("<script src=\"https://dokie.li/scripts/dokieli.js\">") || n.includes("dokieli.css");
|
|
30
|
+
return o.set(t.uri, r ? "dokieli" : "html"), r ? e.iconBase + "dokieli-logo.png" : e.originalIconBase + "tango/22-text-x-generic.png";
|
|
31
|
+
}).catch(() => (o.set(t.uri, "html"), e.originalIconBase + "tango/22-text-x-generic.png"));
|
|
32
|
+
}
|
|
33
|
+
return e.originalIconBase + "tango/22-text-x-generic.png";
|
|
34
|
+
},
|
|
35
|
+
name: "humanReadable",
|
|
36
|
+
label: function(e, r) {
|
|
37
|
+
let i = r.session.store, s = [
|
|
38
|
+
"text/plain",
|
|
39
|
+
"text/html",
|
|
40
|
+
"text/markdown",
|
|
41
|
+
"application/xhtml+xml",
|
|
42
|
+
"image/png",
|
|
43
|
+
"image/jpeg",
|
|
44
|
+
"application/pdf",
|
|
45
|
+
"video/mp4"
|
|
46
|
+
], c = function(e, t, n) {
|
|
47
|
+
let r = e.fetcher.getHeader(t, "content-type");
|
|
48
|
+
if (r) {
|
|
49
|
+
for (let e = 0; e < r.length; e++) for (let t = 0; t < n.length; t++) if (r[e].indexOf(n[t]) >= 0) return !0;
|
|
50
|
+
}
|
|
51
|
+
return !1;
|
|
52
|
+
}, l = function(e, t, r) {
|
|
53
|
+
let i = e.findTypeURIs(t);
|
|
54
|
+
for (let e = 0; e < r.length; e++) if (n.mediaTypeClass(r[e]).uri in i) return !0;
|
|
55
|
+
return !1;
|
|
56
|
+
};
|
|
57
|
+
if (!e.uri) return null;
|
|
58
|
+
if (i.findTypeURIs(e)[t.link("WebPage").uri]) return "view";
|
|
59
|
+
if (a(e.uri)) return "View";
|
|
60
|
+
if (c(i, e, s) || l(i, e, s)) {
|
|
61
|
+
let t = i.fetcher.getHeader(e.doc(), "content-type");
|
|
62
|
+
return (t ? t[0].split(";", 1)[0].trim() : null) === "text/html" && !o.has(e.uri) && i.fetcher._fetch(e.uri).then((e) => e.text()).then((t) => {
|
|
63
|
+
let n = t.includes("<script src=\"https://dokie.li/scripts/dokieli.js\">") || t.includes("dokieli.css");
|
|
64
|
+
o.set(e.uri, n ? "dokieli" : "html");
|
|
65
|
+
}).catch(() => {
|
|
66
|
+
o.set(e.uri, "html");
|
|
67
|
+
}), "View";
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
70
|
+
},
|
|
71
|
+
render: function(e, t) {
|
|
72
|
+
let n = t.dom, c = n.createElement("div"), l = t.session.store;
|
|
73
|
+
function u(e) {
|
|
74
|
+
let n = t.environment ?? {};
|
|
75
|
+
e.dataset.layout = n.layout ?? "desktop";
|
|
76
|
+
}
|
|
77
|
+
let d = l.fetcher.getHeader(e.doc(), "content-type"), f = d ? d[0].split(";", 1)[0].trim() : null, p = f === "text/markdown" || a(e.uri), m = f === "text/plain";
|
|
78
|
+
f || console.log("humanReadablePane: unknown content-type?"), c.classList.add("human-readable-pane"), u(c);
|
|
79
|
+
let h = function(t) {
|
|
80
|
+
l.fetcher.webOperation("GET", e.uri).then((e) => {
|
|
81
|
+
let n = e.responseText ?? "", a = Math.min(30, n.split(/\n/).length + 5), o = r.parse(n, { async: !1 });
|
|
82
|
+
t.innerHTML = i.sanitize(o), s(t, "markdown", a);
|
|
83
|
+
}).catch((e) => {
|
|
84
|
+
console.error("Error fetching markdown content:", e), t.innerHTML = "<p>Error loading content</p>";
|
|
85
|
+
});
|
|
86
|
+
}, g = function(t) {
|
|
87
|
+
l.fetcher.webOperation("GET", e.uri).then((e) => {
|
|
88
|
+
let n = e.responseText ?? "", r = Math.min(30, n.split(/\n/).length + 5);
|
|
89
|
+
t.textContent = n, s(t, "plain-text", r);
|
|
90
|
+
}).catch((e) => {
|
|
91
|
+
console.error("Error fetching plain text content:", e), t.textContent = "Error loading content";
|
|
92
|
+
});
|
|
93
|
+
}, _ = (t, n) => {
|
|
94
|
+
t.setAttribute("src", e.uri), s(t, "iframe", n);
|
|
95
|
+
};
|
|
96
|
+
if (p) {
|
|
97
|
+
let e = n.createElement("div");
|
|
98
|
+
h(e);
|
|
99
|
+
let t = n.createElement("div");
|
|
100
|
+
t.classList.add("human-readable-pane__container"), t.appendChild(e), c.appendChild(t);
|
|
101
|
+
} else if (m) {
|
|
102
|
+
let e = n.createElement("pre");
|
|
103
|
+
g(e);
|
|
104
|
+
let t = n.createElement("div");
|
|
105
|
+
t.classList.add("human-readable-pane__container"), t.appendChild(e), c.appendChild(t);
|
|
106
|
+
} else {
|
|
107
|
+
let t = n.createElement("iframe");
|
|
108
|
+
(f === "text/html" || f === "application/xhtml+xml") && t.setAttribute("sandbox", "allow-scripts allow-same-origin allow-forms"), l.fetcher.webOperation("GET", e.uri).then((n) => {
|
|
109
|
+
let r = n.responseText ?? "", i = r.includes("<script src=\"https://dokie.li/scripts/dokieli.js\">") ? -10 : 5, a = Math.min(30, r.split(/\n/).length + i), s = r.includes("<script src=\"https://dokie.li/scripts/dokieli.js\">") || r.includes("dokieli.css");
|
|
110
|
+
o.set(e.uri, s ? "dokieli" : "html"), _(t, a);
|
|
111
|
+
}).catch((e) => {
|
|
112
|
+
console.error("Error fetching content for line calculation:", e), _(t, 30);
|
|
113
|
+
});
|
|
114
|
+
let r = n.createElement("div");
|
|
115
|
+
r.classList.add("human-readable-pane__container"), r.appendChild(t), c.appendChild(r);
|
|
116
|
+
}
|
|
117
|
+
return c;
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
export { c as default };
|
|
122
|
+
|
|
123
|
+
//# sourceMappingURL=humanReadablePane2.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"humanReadablePane2.esm.js","names":[],"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) => 'view' | '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 ): 'view' | '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 'view'\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,IAAM,KAAkB,MAAiC;CACvD,IAAI,CAAC,GAAK,OAAO;CACjB,IAAM,IAAO,EAAI,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,MA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AI,MAAM,GAC3F,IAAQ,KAAK,IAAI,IAAI,EAAS,MAAM,IAAI,CAAC,CAAC,SAAS,CAAQ,GAG3D,IAAY,EAAS,SAAS,sDAAoD,KACvE,EAAS,SAAS,aAAa;IAGhD,AAFA,EAAa,IAAI,EAAQ,KAAK,IAAY,YAAY,MAAM,GAE5D,EAAoB,GAAO,CAAK;GAClC,CAAC,CAAC,CAAC,OAAM,MAAS;IAGhB,AAFA,QAAQ,MAAM,gDAAgD,CAAK,GAEnE,EAAoB,GAAO,EAAE;GAC/B,CAAC;GAED,IAAM,IAAiB,EAAW,cAAc,KAAK;GAGrD,AAFA,EAAe,UAAU,IAAI,gCAAgC,GAC7D,EAAe,YAAY,CAAK,GAChC,EAAI,YAAY,CAAc;EAChC;EAEA,OAAO;CACT;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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`;exports.default=e;
|
|
2
|
+
//# sourceMappingURL=folder.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder.cjs.js","names":[],"sources":["../../src/icons/folder.svg"],"sourcesContent":["export default \"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\""],"mappings":"AAAA,IAAA,EAAe"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/icons/folder.svg
|
|
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
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=folder.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder.esm.js","names":[],"sources":["../../src/icons/folder.svg"],"sourcesContent":["export default \"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\""],"mappings":";AAAA,IAAA,IAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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`;exports.default=e;
|
|
2
|
+
//# sourceMappingURL=friends.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"friends.cjs.js","names":[],"sources":["../../src/icons/friends.svg"],"sourcesContent":["export default \"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\""],"mappings":"AAAA,IAAA,EAAe"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/icons/friends.svg
|
|
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
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=friends.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"friends.esm.js","names":[],"sources":["../../src/icons/friends.svg"],"sourcesContent":["export default \"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\""],"mappings":";AAAA,IAAA,IAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
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`;exports.default=e;
|
|
2
|
+
//# sourceMappingURL=person.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.cjs.js","names":[],"sources":["../../src/icons/person.svg"],"sourcesContent":["export default \"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\""],"mappings":"AAAA,IAAA,EAAe"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
//#region src/icons/person.svg
|
|
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
|
+
export { e as default };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=person.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person.esm.js","names":[],"sources":["../../src/icons/person.svg"],"sourcesContent":["export default \"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\""],"mappings":";AAAA,IAAA,IAAe"}
|
package/dist/imagePane.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import './imagePane.css';
|
|
1
|
+
import { DataBrowserContext } from '../node_modules/pane-registry';
|
|
2
|
+
import { NamedNode } from '../node_modules/rdflib';
|
|
4
3
|
type ImagePane = {
|
|
5
4
|
icon: string;
|
|
6
5
|
name: string;
|
|
@@ -0,0 +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:`view`},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
|
+
//# sourceMappingURL=imagePane2.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePane2.cjs.js","names":[],"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 if (\n !store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n )\n ) {\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 'view'\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":"8HAyBA,SAAS,EACP,EACA,EACA,EACS,CACT,IAAM,EAAyB,EAAM,QAAQ,UAAU,EAAS,cAAc,EAC9E,GAAI,CAAC,EACH,MAAO,GAGT,IAAK,IAAM,KAAe,EACxB,IAAK,IAAM,KAAa,EACtB,GAAI,EAAY,SAAS,CAAS,EAChC,MAAO,GAKb,MAAO,EACT,CAEA,IAAa,EAAuB,CAClC,KAAM,EAAG,MAAM,iBAAmB,+BAElC,KAAM,QAEN,MAAO,SAAU,EAAoB,EAA4C,CAC/E,IAAM,EAAQ,EAAQ,QAAQ,MAkB9B,MAhBE,CAAC,EAAM,qBACL,EACA,EAAG,GAAG,IAAI,MAAM,EAChB,EAAM,IAAI,gCAAgC,CAC5C,GASE,EAAiB,EAAO,EAAS,CADjB,iBACiB,CAAU,EACtC,KAEF,MACT,EAEA,OAAQ,SAAU,EAAoB,EAA6C,CACjF,IAAM,EAAa,EAAQ,IACrB,EAAQ,EAAQ,QAAQ,MACxB,EAAM,EAAW,cAAc,KAAK,EAC1C,EAAI,aAAa,QAAS,YAAY,EACtC,IAAM,EAAM,EAAW,cAAc,KAAK,EAa1C,OAVA,EAAM,QAAQ,OAAO,EAAQ,GAAG,CAAC,CAC9B,KAAK,SAAU,EAAoB,CAClC,OAAO,EAAS,KAAK,CACvB,CAAC,CAAC,CACD,KAAK,SAAU,EAAc,CAC5B,IAAM,EAAY,IAAI,gBAAgB,CAAM,EAC5C,EAAI,aAAa,MAAO,CAAS,CACnC,CAAC,EACH,EAAI,UAAU,IAAI,mBAAmB,EACrC,EAAI,YAAY,CAAG,EACZ,CACT,CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import * as e from "solid-ui";
|
|
3
|
+
//#region src/imagePane.ts
|
|
4
|
+
function t(e, t, n) {
|
|
5
|
+
let r = e.fetcher.getHeader(t, "content-type");
|
|
6
|
+
if (!r) return !1;
|
|
7
|
+
for (let e of r) for (let t of n) if (e.includes(t)) return !0;
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
var n = {
|
|
11
|
+
icon: e.icons.originalIconBase + "tango/22-image-x-generic.png",
|
|
12
|
+
name: "image",
|
|
13
|
+
label: function(n, r) {
|
|
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 : "view";
|
|
16
|
+
},
|
|
17
|
+
render: function(e, t) {
|
|
18
|
+
let n = t.dom, r = t.session.store, i = n.createElement("div");
|
|
19
|
+
i.setAttribute("class", "image-pane");
|
|
20
|
+
let a = n.createElement("img");
|
|
21
|
+
return r.fetcher._fetch(e.uri).then(function(e) {
|
|
22
|
+
return e.blob();
|
|
23
|
+
}).then(function(e) {
|
|
24
|
+
let t = URL.createObjectURL(e);
|
|
25
|
+
a.setAttribute("src", t);
|
|
26
|
+
}), a.classList.add("image-pane__image"), i.appendChild(a), i;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { n as imagePane };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=imagePane2.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imagePane2.esm.js","names":[],"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 if (\n !store.anyStatementMatching(\n subject,\n UI.ns.rdf('type'),\n store.sym('http://purl.org/dc/terms/Image')\n )\n ) {\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 'view'\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,SAAS,EACP,GACA,GACA,GACS;CACT,IAAM,IAAyB,EAAM,QAAQ,UAAU,GAAS,cAAc;CAC9E,IAAI,CAAC,GACH,OAAO;CAGT,KAAK,IAAM,KAAe,GACxB,KAAK,IAAM,KAAa,GACtB,IAAI,EAAY,SAAS,CAAS,GAChC,OAAO;CAKb,OAAO;AACT;AAEA,IAAa,IAAuB;CAClC,MAAM,EAAG,MAAM,mBAAmB;CAElC,MAAM;CAEN,OAAO,SAAU,GAAoB,GAA4C;EAC/E,IAAM,IAAQ,EAAQ,QAAQ;EAkB9B,OAhBE,CAAC,EAAM,qBACL,GACA,EAAG,GAAG,IAAI,MAAM,GAChB,EAAM,IAAI,gCAAgC,CAC5C,KASE,EAAiB,GAAO,GAAS,CADjB,iBACiB,CAAU,IACtC,OAEF;CACT;CAEA,QAAQ,SAAU,GAAoB,GAA6C;EACjF,IAAM,IAAa,EAAQ,KACrB,IAAQ,EAAQ,QAAQ,OACxB,IAAM,EAAW,cAAc,KAAK;EAC1C,EAAI,aAAa,SAAS,YAAY;EACtC,IAAM,IAAM,EAAW,cAAc,KAAK;EAa1C,OAVA,EAAM,QAAQ,OAAO,EAAQ,GAAG,CAAC,CAC9B,KAAK,SAAU,GAAoB;GAClC,OAAO,EAAS,KAAK;EACvB,CAAC,CAAC,CACD,KAAK,SAAU,GAAc;GAC5B,IAAM,IAAY,IAAI,gBAAgB,CAAM;GAC5C,EAAI,aAAa,OAAO,CAAS;EACnC,CAAC,GACH,EAAI,UAAU,IAAI,mBAAmB,GACrC,EAAI,YAAY,CAAG,GACZ;CACT;AACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_virtual/_rolldown/runtime.cjs.js"),t=require("./versionInfo.cjs.js"),n=require("./outline/manager2.cjs.js"),r=require("./registerPanes.cjs.js"),i=require("./outline/context.cjs.js"),a=require("./mainPage/index.cjs.js");let o=require("solid-ui");o=e.__toESM(o);let s=require("solid-logic"),c=require("pane-registry");function l(e,t){if(e.outlineManager)t&&(e.outlineManager.context=e.outlineManager.context||{},e.outlineManager.context.environment=t);else{let r=i.createContext(e,{list:c.list,paneForIcon:c.paneForIcon,paneForPredicate:c.paneForPredicate,register:c.register,byName:c.byName},s.store,s.solidLogicSingleton,t);e.outlineManager=new n.default(r)}return e.outlineManager}function u(e,t){e&&(e.context=e.context||{},e.context.environment=t)}typeof window<`u`&&l(window.document),r.registerPanes(e=>(0,c.register)(e.default||e)),typeof window<`u`&&(window.panes={getOutliner:l}),exports.OutlineManager=n.default,Object.defineProperty(exports,"UI",{enumerable:!0,get:function(){return o}}),exports.byName=c.byName,exports.getOutliner=l,exports.initMainPage=a.initMainPage,exports.list=c.list,exports.paneForIcon=c.paneForIcon,exports.paneForPredicate=c.paneForPredicate,exports.refreshUI=a.refreshUI,exports.register=c.register,exports.updateEnvironment=u,exports.versionInfo=t.default;
|
|
2
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport { registerPanes } from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName,\n RenderEnvironment\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport { initMainPage, refreshUI } from './mainPage'\n\nfunction getOutliner (dom, environment?: RenderEnvironment): OutlineManager {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton,\n environment\n )\n dom.outlineManager = new OutlineManager(context)\n } else if (environment) {\n dom.outlineManager.context = dom.outlineManager.context || {}\n dom.outlineManager.context.environment = environment\n }\n return dom.outlineManager\n}\n\nfunction updateEnvironment (outliner: OutlineManager, environment: RenderEnvironment) {\n if (!outliner) return\n outliner.context = outliner.context || {}\n outliner.context.environment = environment\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n updateEnvironment,\n UI,\n versionInfo,\n initMainPage,\n refreshUI,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":"mZA6BA,SAAS,EAAa,EAAK,EAAiD,CAC1E,GAAK,EAAI,eASE,IACT,EAAI,eAAe,QAAU,EAAI,eAAe,SAAW,CAAC,EAC5D,EAAI,eAAe,QAAQ,YAAc,OAXlB,CACvB,IAAM,EAAU,EAAA,cACd,EACA,CAAE,KAAA,EAAA,KAAM,YAAA,EAAA,YAAa,iBAAA,EAAA,iBAAkB,SAAA,EAAA,SAAU,OAAA,EAAA,MAAO,EACxD,EAAA,MACA,EAAA,oBACA,CACF,EACA,EAAI,eAAiB,IAAI,EAAA,QAAe,CAAO,CACjD,CAIA,OAAO,EAAI,cACb,CAEA,SAAS,EAAmB,EAA0B,EAAgC,CAC/E,IACL,EAAS,QAAU,EAAS,SAAW,CAAC,EACxC,EAAS,QAAQ,YAAc,EACjC,CAEI,OAAO,OAAW,KACpB,EAAY,OAAO,QAAQ,EAG7B,EAAA,cAAe,IAAA,EAAuB,EAAA,SAAA,CAAS,EAAc,SAAW,CAAa,CAAC,EAuBlF,OAAO,OAAW,MACnB,OAAc,MAAQ,CACrB,aACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import versionInfo from './versionInfo';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { list, paneForIcon, paneForPredicate, register, byName, RenderEnvironment } from 'pane-registry';
|
|
1
|
+
import { default as versionInfo } from './versionInfo';
|
|
2
|
+
import { default as OutlineManager } from './outline/manager.js';
|
|
3
|
+
import { list, paneForIcon, paneForPredicate, register, byName, RenderEnvironment } from '../node_modules/pane-registry';
|
|
5
4
|
import { initMainPage, refreshUI } from './mainPage';
|
|
5
|
+
import * as UI from 'solid-ui';
|
|
6
6
|
declare function getOutliner(dom: any, environment?: RenderEnvironment): OutlineManager;
|
|
7
7
|
declare function updateEnvironment(outliner: OutlineManager, environment: RenderEnvironment): void;
|
|
8
8
|
export { OutlineManager, getOutliner, updateEnvironment, UI, versionInfo, initMainPage, refreshUI, list, // from paneRegistry
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import e from "./versionInfo.esm.js";
|
|
2
|
+
import t from "./outline/manager2.esm.js";
|
|
3
|
+
import { registerPanes as n } from "./registerPanes.esm.js";
|
|
4
|
+
import { createContext as r } from "./outline/context.esm.js";
|
|
5
|
+
import { initMainPage as i, refreshUI as a } from "./mainPage/index.esm.js";
|
|
6
|
+
import * as o from "solid-ui";
|
|
7
|
+
import { solidLogicSingleton as s, store as c } from "solid-logic";
|
|
8
|
+
import { byName as l, list as u, paneForIcon as d, paneForPredicate as f, register as p } from "pane-registry";
|
|
9
|
+
//#region src/index.ts
|
|
10
|
+
function m(e, n) {
|
|
11
|
+
if (e.outlineManager) n && (e.outlineManager.context = e.outlineManager.context || {}, e.outlineManager.context.environment = n);
|
|
12
|
+
else {
|
|
13
|
+
let i = r(e, {
|
|
14
|
+
list: u,
|
|
15
|
+
paneForIcon: d,
|
|
16
|
+
paneForPredicate: f,
|
|
17
|
+
register: p,
|
|
18
|
+
byName: l
|
|
19
|
+
}, c, s, n);
|
|
20
|
+
e.outlineManager = new t(i);
|
|
21
|
+
}
|
|
22
|
+
return e.outlineManager;
|
|
23
|
+
}
|
|
24
|
+
function h(e, t) {
|
|
25
|
+
e && (e.context = e.context || {}, e.context.environment = t);
|
|
26
|
+
}
|
|
27
|
+
typeof window < "u" && m(window.document), n((e) => p(e.default || e)), typeof window < "u" && (window.panes = { getOutliner: m });
|
|
28
|
+
//#endregion
|
|
29
|
+
export { t as OutlineManager, o as UI, l as byName, m as getOutliner, i as initMainPage, u as list, d as paneForIcon, f as paneForPredicate, a as refreshUI, p as register, h as updateEnvironment, e as versionInfo };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* SOLID PANES\n **\n ** Panes are regions of the outline view in which a particular subject is\n ** displayed in a particular way.\n ** Different panes about the same subject are typically stacked vertically.\n ** Panes may be used naked or with a pane selection header.\n **\n ** The label() method has two functions: it determines whether the pane is\n ** relevant to a given subject, returning null if not.\n ** If it is relevant, then it returns a suitable tooltip for a control which selects the pane\n */\n\nimport versionInfo from './versionInfo'\nimport * as UI from 'solid-ui'\nimport { LiveStore } from 'rdflib'\nimport { solidLogicSingleton, store } from 'solid-logic'\nimport OutlineManager from './outline/manager.js'\nimport { registerPanes } from './registerPanes.js'\nimport {\n list,\n paneForIcon,\n paneForPredicate,\n register,\n byName,\n RenderEnvironment\n} from 'pane-registry'\nimport { createContext } from './outline/context'\nimport { initMainPage, refreshUI } from './mainPage'\n\nfunction getOutliner (dom, environment?: RenderEnvironment): OutlineManager {\n if (!dom.outlineManager) {\n const context = createContext(\n dom,\n { list, paneForIcon, paneForPredicate, register, byName },\n store as LiveStore,\n solidLogicSingleton,\n environment\n )\n dom.outlineManager = new OutlineManager(context)\n } else if (environment) {\n dom.outlineManager.context = dom.outlineManager.context || {}\n dom.outlineManager.context.environment = environment\n }\n return dom.outlineManager\n}\n\nfunction updateEnvironment (outliner: OutlineManager, environment: RenderEnvironment) {\n if (!outliner) return\n outliner.context = outliner.context || {}\n outliner.context.environment = environment\n}\n\nif (typeof window !== 'undefined') {\n getOutliner(window.document)\n}\n\nregisterPanes((cjsOrEsModule: any) => register(cjsOrEsModule.default || cjsOrEsModule))\n\n// This has common outline mode functionality for the default and other other panes\n// A separate outline manager is required per DOM in cases like a browser extension\n// where there are many occurrences of window and of window.document\n// But each DOM should have just one outline manager.\n\nexport {\n OutlineManager,\n getOutliner,\n updateEnvironment,\n UI,\n versionInfo,\n initMainPage,\n refreshUI,\n list, // from paneRegistry\n paneForIcon, // from paneRegistry\n paneForPredicate, // from paneRegistry\n register, // from paneRegistry\n byName // from paneRegistry\n}\n\n// export for simpler access by non-node scripts\nif (typeof window !== 'undefined') {\n ;(<any>window).panes = {\n getOutliner\n }\n}\n"],"mappings":";;;;;;;;;AA6BA,SAAS,EAAa,GAAK,GAAiD;CAC1E,IAAK,EAAI,gBASF,AAAI,MACT,EAAI,eAAe,UAAU,EAAI,eAAe,WAAW,CAAC,GAC5D,EAAI,eAAe,QAAQ,cAAc;MAXlB;EACvB,IAAM,IAAU,EACd,GACA;GAAE;GAAM;GAAa;GAAkB;GAAU;EAAO,GACxD,GACA,GACA,CACF;EACA,EAAI,iBAAiB,IAAI,EAAe,CAAO;CACjD;CAIA,OAAO,EAAI;AACb;AAEA,SAAS,EAAmB,GAA0B,GAAgC;CAC/E,MACL,EAAS,UAAU,EAAS,WAAW,CAAC,GACxC,EAAS,QAAQ,cAAc;AACjC;AAEI,OAAO,SAAW,OACpB,EAAY,OAAO,QAAQ,GAG7B,GAAe,MAAuB,EAAS,EAAc,WAAW,CAAa,CAAC,GAuBlF,OAAO,SAAW,QACnB,OAAc,QAAQ,EACrB,eACF"}
|
|
@@ -0,0 +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;border-radius:1rem}.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`);return}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
|
+
//# sourceMappingURL=internalPane2.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internalPane2.cjs.js","names":[],"sources":["../../src/internal/internalPane.ts"],"sourcesContent":["/* Internal Pane\n **\n ** This outline pane contains the properties which are\n ** internal to the user's interaction with the web, and are not normally displayed\n */\n/* global alert confirm */\n\nimport { icons, ns, widgets } from 'solid-ui'\nimport { BlankNode, IndexedFormula, literal, NamedNode, st, sym, Variable, Store } from 'rdflib'\nimport { PaneDefinition } from 'pane-registry'\nimport './internalPane.css'\n\nconst pane: PaneDefinition = {\n icon: icons.originalIconBase + 'tango/22-emblem-system.png',\n\n name: 'internal',\n\n label: function () {\n return 'under the hood' // There is often a URI even of no statements\n },\n\n render: function (subject, context) {\n const dom = context.dom\n // @ts-ignore\n const store = context.session.store as Store\n const canonizedSubject = store.canon(subject) as BlankNode | NamedNode | Variable\n const types = store.findTypeURIs(canonizedSubject)\n\n function filter (pred: NamedNode) {\n if (types['http://www.w3.org/2007/ont/link#ProtocolEvent']) return true // display everything for them\n const view = context.session.paneRegistry.byName('internal')\n return (\n view &&\n view.predicates &&\n !!(typeof view.predicates[pred.uri] !== 'undefined')\n )\n }\n\n const div = dom.createElement('div')\n div.classList.add('internalPane', 'internalPaneContent')\n\n function deleteRecursive (kb: IndexedFormula, folder: NamedNode) {\n const fetcher = (kb as any).fetcher\n if (!fetcher) {\n console.error('No fetcher available')\n return\n }\n return new Promise(function (resolve, reject) {\n fetcher.load(folder).then(function () {\n const promises = kb.each(folder, ns.ldp('contains')).map(file => {\n if (kb.holds(file, ns.rdf('type'), ns.ldp('BasicContainer'))) {\n return deleteRecursive(kb, file as NamedNode)\n } else {\n console.log('deleteRecursive leaf file: ' + file)\n return fetcher.webOperation('DELETE', (file as NamedNode).uri)\n }\n })\n Promise.all(promises).then(\n () => {\n console.log('deleteRecursive empty folder: ' + folder)\n fetcher\n .webOperation('DELETE', folder.uri)\n .then(() => {\n console.log('Deleted Ok: ' + folder)\n resolve(undefined)\n })\n .catch((err: string) => {\n const str = 'Unable to delete ' + folder + ': ' + err\n console.log(str)\n reject(new Error(str))\n })\n resolve(undefined)\n },\n err => {\n alert(err)\n reject(err)\n }\n )\n })\n })\n }\n\n const isDocument = subject.uri && !subject.uri.includes('#')\n if (isDocument) {\n const controls = div.appendChild(dom.createElement('table'))\n controls.classList.add('internalPaneControls')\n const controlRow = controls.appendChild(dom.createElement('tr'))\n\n const deleteCell = controlRow.appendChild(dom.createElement('td'))\n const isFolder =\n (subject.uri && subject.uri.endsWith('/')) ||\n store.holds(subject, ns.rdf('type'), ns.ldp('Container'))\n const noun = isFolder ? 'folder' : 'file'\n if (!isProtectedUri(subject)) {\n console.log(subject)\n const deleteButton = widgets.deleteButtonWithCheck(\n dom,\n deleteCell,\n noun,\n function () {\n if (\n !confirm(\n `Are you sure you want to delete ${subject}? This cannot be undone.`\n )\n ) {\n return\n }\n // @@ TODO Remove casing of store.fetcher\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n const promise = isFolder\n ? (deleteRecursive(store, subject) || Promise.resolve())\n : store.fetcher.webOperation('DELETE', subject.uri) || Promise.resolve()\n promise\n .then(() => {\n const str = 'Deleted: ' + subject\n console.log(str)\n })\n .catch((err: any) => {\n const str = 'Unable to delete ' + subject + ': ' + err\n console.log(str)\n alert(str)\n })\n }\n )\n\n deleteButton.removeAttribute('class') // Remove hover hide\n deleteButton.classList.add('internalPaneDeleteButton')\n deleteCell.appendChild(deleteButton)\n }\n\n const refreshCell = controlRow.appendChild(dom.createElement('td'))\n const refreshButton = widgets.button(\n dom,\n icons.iconBase + 'noun_479395.svg',\n 'refresh'\n )\n refreshCell.appendChild(refreshButton)\n refreshButton.addEventListener('click', () => {\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n store.fetcher.refresh(subject, function (\n ok,\n errm\n ) {\n let str\n if (ok) {\n str = 'Refreshed OK: ' + subject\n } else {\n str = 'Error refreshing: ' + subject + ': ' + errm\n }\n console.log(str)\n alert(str)\n })\n })\n }\n\n let plist = store.statementsMatching(subject)\n let docURI = ''\n if (!store.fetcher) {\n throw new Error('Store has no fetcher')\n }\n\n if (subject.uri) {\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#uri'),\n subject.uri as any, // @@ TODO Remove casting\n store.fetcher.appNode\n )\n )\n if (subject.uri.indexOf('#') >= 0) {\n docURI = subject.uri.split('#')[0]\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#documentURI'),\n subject.uri.split('#')[0] as any, // @@ TODO Remove casting\n store.fetcher.appNode\n )\n )\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/2007/ont/link#document'),\n sym(subject.uri.split('#')[0]),\n store.fetcher.appNode\n )\n )\n } else {\n docURI = subject.uri\n }\n }\n if (docURI) {\n if (!store.updater) {\n throw new Error('Store has no updater')\n }\n\n const ed = store.updater.editable(docURI)\n if (ed) {\n plist.push(\n st(\n subject,\n sym('http://www.w3.org/ns/rww#editable'),\n literal(ed.toString()),\n store.fetcher.appNode\n )\n )\n }\n }\n // @@ TODO get a proper type\n const outliner: any = context.getOutliner(dom)\n outliner.appendPropertyTRs(div, plist, false, filter)\n plist = store.statementsMatching(undefined, undefined, subject)\n outliner.appendPropertyTRs(div, plist, true, filter)\n return div\n },\n\n predicates: {\n // Predicates used for inner workings. Under the hood\n 'http://www.w3.org/2007/ont/link#request': 1,\n 'http://www.w3.org/2007/ont/link#requestedBy': 1,\n 'http://www.w3.org/2007/ont/link#source': 1,\n 'http://www.w3.org/2007/ont/link#session': 2, // 2= test neg but display\n 'http://www.w3.org/2007/ont/link#uri': 1,\n 'http://www.w3.org/2007/ont/link#documentURI': 1,\n 'http://www.w3.org/2007/ont/link#document': 1,\n 'http://www.w3.org/2007/ont/link#all': 1, // From userinput.js\n 'http://www.w3.org/2007/ont/link#Document': 1,\n 'http://www.w3.org/ns/rww#editable': 1,\n 'http://www.w3.org/2000/01/rdf-schema#seeAlso': 1,\n 'http://www.w3.org/2002/07/owl#': 1\n },\n\n classes: {\n // Things which are inherently already undercover\n 'http://www.w3.org/2007/ont/link#ProtocolEvent': 1\n }\n}\n\nfunction isProtectedUri (subject: NamedNode): boolean {\n // TODO: Could make the code below smarter by removing some of the redundancy by creating a recursive function, but did not bother now\n const siteUri = subject.site().uri\n return (\n subject.uri === siteUri ||\n subject.uri === siteUri + 'profile/' ||\n subject.uri === siteUri + 'profile/card' ||\n subject.uri === siteUri + 'settings/' ||\n subject.uri === siteUri + 'settings/prefs.ttl' ||\n subject.uri === siteUri + 'settings/privateTypeIndex.ttl' ||\n subject.uri === siteUri + 'settings/public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