@abraca/junis 2.80.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 +594 -0
- package/dist/module.d.mts +158 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +957 -0
- package/dist/runtime/assets/css/jun.css +13 -0
- package/dist/runtime/components/JunAnnouncement.d.vue.ts +3 -0
- package/dist/runtime/components/JunAnnouncement.vue +88 -0
- package/dist/runtime/components/JunAnnouncement.vue.d.ts +3 -0
- package/dist/runtime/components/JunAppreciate.d.vue.ts +6 -0
- package/dist/runtime/components/JunAppreciate.vue +71 -0
- package/dist/runtime/components/JunAppreciate.vue.d.ts +6 -0
- package/dist/runtime/components/JunBackgroundPhoto.d.vue.ts +3 -0
- package/dist/runtime/components/JunBackgroundPhoto.vue +23 -0
- package/dist/runtime/components/JunBackgroundPhoto.vue.d.ts +3 -0
- package/dist/runtime/components/JunBlobBackdrop.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunBlobBackdrop.client.vue +120 -0
- package/dist/runtime/components/JunBlobBackdrop.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunBreadcrumbs.d.vue.ts +16 -0
- package/dist/runtime/components/JunBreadcrumbs.vue +63 -0
- package/dist/runtime/components/JunBreadcrumbs.vue.d.ts +16 -0
- package/dist/runtime/components/JunCampfireChat.d.vue.ts +14 -0
- package/dist/runtime/components/JunCampfireChat.vue +136 -0
- package/dist/runtime/components/JunCampfireChat.vue.d.ts +14 -0
- package/dist/runtime/components/JunCampfirePanel.d.vue.ts +33 -0
- package/dist/runtime/components/JunCampfirePanel.vue +202 -0
- package/dist/runtime/components/JunCampfirePanel.vue.d.ts +33 -0
- package/dist/runtime/components/JunCampfirePresence.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunCampfirePresence.client.vue +321 -0
- package/dist/runtime/components/JunCampfirePresence.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunCampfireRoster.d.vue.ts +19 -0
- package/dist/runtime/components/JunCampfireRoster.vue +259 -0
- package/dist/runtime/components/JunCampfireRoster.vue.d.ts +19 -0
- package/dist/runtime/components/JunCampfireYou.d.vue.ts +10 -0
- package/dist/runtime/components/JunCampfireYou.vue +157 -0
- package/dist/runtime/components/JunCampfireYou.vue.d.ts +10 -0
- package/dist/runtime/components/JunDocSurface.d.vue.ts +34 -0
- package/dist/runtime/components/JunDocSurface.vue +117 -0
- package/dist/runtime/components/JunDocSurface.vue.d.ts +34 -0
- package/dist/runtime/components/JunFestivalPlayer.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunFestivalPlayer.client.vue +471 -0
- package/dist/runtime/components/JunFestivalPlayer.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunFooter.d.vue.ts +3 -0
- package/dist/runtime/components/JunFooter.vue +102 -0
- package/dist/runtime/components/JunFooter.vue.d.ts +3 -0
- package/dist/runtime/components/JunGlobeEditor.client.d.vue.ts +43 -0
- package/dist/runtime/components/JunGlobeEditor.client.vue +315 -0
- package/dist/runtime/components/JunGlobeEditor.client.vue.d.ts +43 -0
- package/dist/runtime/components/JunGlobeMap.client.d.vue.ts +58 -0
- package/dist/runtime/components/JunGlobeMap.client.vue +495 -0
- package/dist/runtime/components/JunGlobeMap.client.vue.d.ts +58 -0
- package/dist/runtime/components/JunHead.d.vue.ts +3 -0
- package/dist/runtime/components/JunHead.vue +79 -0
- package/dist/runtime/components/JunHead.vue.d.ts +3 -0
- package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +0 -0
- package/dist/runtime/components/JunHorizontalTimeline.vue +363 -0
- package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +0 -0
- package/dist/runtime/components/JunImagePopup.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunImagePopup.client.vue +422 -0
- package/dist/runtime/components/JunImagePopup.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunIntro.d.vue.ts +3 -0
- package/dist/runtime/components/JunIntro.vue +156 -0
- package/dist/runtime/components/JunIntro.vue.d.ts +3 -0
- package/dist/runtime/components/JunItemMenu.d.vue.ts +50 -0
- package/dist/runtime/components/JunItemMenu.vue +97 -0
- package/dist/runtime/components/JunItemMenu.vue.d.ts +50 -0
- package/dist/runtime/components/JunLinksRow.d.vue.ts +19 -0
- package/dist/runtime/components/JunLinksRow.vue +96 -0
- package/dist/runtime/components/JunLinksRow.vue.d.ts +19 -0
- package/dist/runtime/components/JunLogo.d.vue.ts +15 -0
- package/dist/runtime/components/JunLogo.vue +360 -0
- package/dist/runtime/components/JunLogo.vue.d.ts +15 -0
- package/dist/runtime/components/JunMedia.client.d.vue.ts +40 -0
- package/dist/runtime/components/JunMedia.client.vue +117 -0
- package/dist/runtime/components/JunMedia.client.vue.d.ts +40 -0
- package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +24 -0
- package/dist/runtime/components/JunMosaicPane.client.vue +95 -0
- package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +24 -0
- package/dist/runtime/components/JunNavigation.d.vue.ts +26 -0
- package/dist/runtime/components/JunNavigation.vue +1149 -0
- package/dist/runtime/components/JunNavigation.vue.d.ts +26 -0
- package/dist/runtime/components/JunNodePanel.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunNodePanel.client.vue +23 -0
- package/dist/runtime/components/JunNodePanel.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunNotFound.d.vue.ts +7 -0
- package/dist/runtime/components/JunNotFound.vue +137 -0
- package/dist/runtime/components/JunNotFound.vue.d.ts +7 -0
- package/dist/runtime/components/JunPageHero.d.vue.ts +25 -0
- package/dist/runtime/components/JunPageHero.vue +90 -0
- package/dist/runtime/components/JunPageHero.vue.d.ts +25 -0
- package/dist/runtime/components/JunPatternBackdrop.client.d.vue.ts +7 -0
- package/dist/runtime/components/JunPatternBackdrop.client.vue +95 -0
- package/dist/runtime/components/JunPatternBackdrop.client.vue.d.ts +7 -0
- package/dist/runtime/components/JunPeerCursors.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunPeerCursors.client.vue +123 -0
- package/dist/runtime/components/JunPeerCursors.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunPresenceBlobs.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunPresenceBlobs.client.vue +172 -0
- package/dist/runtime/components/JunPresenceBlobs.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunSearch.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunSearch.client.vue +809 -0
- package/dist/runtime/components/JunSearch.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunServiceCard.d.vue.ts +10 -0
- package/dist/runtime/components/JunServiceCard.vue +145 -0
- package/dist/runtime/components/JunServiceCard.vue.d.ts +10 -0
- package/dist/runtime/components/JunShaderBackdrop.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunShaderBackdrop.client.vue +82 -0
- package/dist/runtime/components/JunShaderBackdrop.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunShell.d.vue.ts +17 -0
- package/dist/runtime/components/JunShell.vue +80 -0
- package/dist/runtime/components/JunShell.vue.d.ts +17 -0
- package/dist/runtime/components/JunStudioBar.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunStudioBar.client.vue +462 -0
- package/dist/runtime/components/JunStudioBar.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunStudioLogin.client.d.vue.ts +3 -0
- package/dist/runtime/components/JunStudioLogin.client.vue +58 -0
- package/dist/runtime/components/JunStudioLogin.client.vue.d.ts +3 -0
- package/dist/runtime/components/JunThemeToggle.d.vue.ts +3 -0
- package/dist/runtime/components/JunThemeToggle.vue +32 -0
- package/dist/runtime/components/JunThemeToggle.vue.d.ts +3 -0
- package/dist/runtime/components/JunTravellersChip.d.vue.ts +9 -0
- package/dist/runtime/components/JunTravellersChip.vue +111 -0
- package/dist/runtime/components/JunTravellersChip.vue.d.ts +9 -0
- package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +23 -0
- package/dist/runtime/components/JunVideoEmbed.client.vue +124 -0
- package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +23 -0
- package/dist/runtime/components/css-modules.d.ts +7 -0
- package/dist/runtime/components/renderers/.gitkeep +0 -0
- package/dist/runtime/components/renderers/JunAppsRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunAppsRenderer.vue +271 -0
- package/dist/runtime/components/renderers/JunAppsRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunCinemaRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunCinemaRenderer.vue +465 -0
- package/dist/runtime/components/renderers/JunCinemaRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunConfigRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunConfigRenderer.vue +2045 -0
- package/dist/runtime/components/renderers/JunConfigRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunCvRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunCvRenderer.vue +256 -0
- package/dist/runtime/components/renderers/JunCvRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunEntryRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunEntryRenderer.vue +429 -0
- package/dist/runtime/components/renderers/JunEntryRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunFestivalRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunFestivalRenderer.vue +557 -0
- package/dist/runtime/components/renderers/JunFestivalRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunGlobeRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunGlobeRenderer.vue +91 -0
- package/dist/runtime/components/renderers/JunGlobeRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunGuestbookRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +326 -0
- package/dist/runtime/components/renderers/JunGuestbookRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunHomeRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunHomeRenderer.vue +585 -0
- package/dist/runtime/components/renderers/JunHomeRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunJournalRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunJournalRenderer.vue +420 -0
- package/dist/runtime/components/renderers/JunJournalRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunLibraryRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunLibraryRenderer.vue +319 -0
- package/dist/runtime/components/renderers/JunLibraryRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunLinksRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunLinksRenderer.vue +206 -0
- package/dist/runtime/components/renderers/JunLinksRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunLiveRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunLiveRenderer.vue +684 -0
- package/dist/runtime/components/renderers/JunLiveRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunMosaicRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue +572 -0
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunMovieRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunMovieRenderer.vue +539 -0
- package/dist/runtime/components/renderers/JunMovieRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunNowRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunNowRenderer.vue +382 -0
- package/dist/runtime/components/renderers/JunNowRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.vue +413 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunRedirectRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunRedirectRenderer.vue +133 -0
- package/dist/runtime/components/renderers/JunRedirectRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunServicesRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunServicesRenderer.vue +267 -0
- package/dist/runtime/components/renderers/JunServicesRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunStatsRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunStatsRenderer.vue +230 -0
- package/dist/runtime/components/renderers/JunStatsRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunTrackRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunTrackRenderer.vue +380 -0
- package/dist/runtime/components/renderers/JunTrackRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunUsesRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunUsesRenderer.vue +254 -0
- package/dist/runtime/components/renderers/JunUsesRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunWallRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunWallRenderer.vue +276 -0
- package/dist/runtime/components/renderers/JunWallRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunWindowRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunWindowRenderer.vue +516 -0
- package/dist/runtime/components/renderers/JunWindowRenderer.vue.d.ts +10 -0
- package/dist/runtime/composables/useJunBackdrop.d.ts +9 -0
- package/dist/runtime/composables/useJunBackdrop.js +27 -0
- package/dist/runtime/composables/useJunBackground.d.ts +78 -0
- package/dist/runtime/composables/useJunBackground.js +65 -0
- package/dist/runtime/composables/useJunCampfire.d.ts +156 -0
- package/dist/runtime/composables/useJunCampfire.js +225 -0
- package/dist/runtime/composables/useJunChrome.d.ts +66 -0
- package/dist/runtime/composables/useJunChrome.js +233 -0
- package/dist/runtime/composables/useJunColorMode.d.ts +8 -0
- package/dist/runtime/composables/useJunColorMode.js +11 -0
- package/dist/runtime/composables/useJunCommands.d.ts +37 -0
- package/dist/runtime/composables/useJunCommands.js +225 -0
- package/dist/runtime/composables/useJunCreatePage.d.ts +17 -0
- package/dist/runtime/composables/useJunCreatePage.js +30 -0
- package/dist/runtime/composables/useJunCurrentDoc.d.ts +5 -0
- package/dist/runtime/composables/useJunCurrentDoc.js +14 -0
- package/dist/runtime/composables/useJunDocMenu.d.ts +71 -0
- package/dist/runtime/composables/useJunDocMenu.js +344 -0
- package/dist/runtime/composables/useJunDocPage.d.ts +99 -0
- package/dist/runtime/composables/useJunDocPage.js +155 -0
- package/dist/runtime/composables/useJunFollow.d.ts +11 -0
- package/dist/runtime/composables/useJunFollow.js +38 -0
- package/dist/runtime/composables/useJunGroupedDnD.d.ts +74 -0
- package/dist/runtime/composables/useJunGroupedDnD.js +186 -0
- package/dist/runtime/composables/useJunImagePopup.d.ts +37 -0
- package/dist/runtime/composables/useJunImagePopup.js +24 -0
- package/dist/runtime/composables/useJunIntro.d.ts +7 -0
- package/dist/runtime/composables/useJunIntro.js +8 -0
- package/dist/runtime/composables/useJunListDnD.d.ts +65 -0
- package/dist/runtime/composables/useJunListDnD.js +159 -0
- package/dist/runtime/composables/useJunMediaImport.d.ts +27 -0
- package/dist/runtime/composables/useJunMediaImport.js +90 -0
- package/dist/runtime/composables/useJunNavSettings.d.ts +57 -0
- package/dist/runtime/composables/useJunNavSettings.js +74 -0
- package/dist/runtime/composables/useJunNodePanel.d.ts +41 -0
- package/dist/runtime/composables/useJunNodePanel.js +36 -0
- package/dist/runtime/composables/useJunOpenDoc.d.ts +7 -0
- package/dist/runtime/composables/useJunOpenDoc.js +30 -0
- package/dist/runtime/composables/useJunOptions.d.ts +68 -0
- package/dist/runtime/composables/useJunOptions.js +68 -0
- package/dist/runtime/composables/useJunPalette.d.ts +16 -0
- package/dist/runtime/composables/useJunPalette.js +72 -0
- package/dist/runtime/composables/useJunPeopleAdmin.d.ts +69 -0
- package/dist/runtime/composables/useJunPeopleAdmin.js +73 -0
- package/dist/runtime/composables/useJunPlayer.d.ts +99 -0
- package/dist/runtime/composables/useJunPlayer.js +208 -0
- package/dist/runtime/composables/useJunPresence.d.ts +32 -0
- package/dist/runtime/composables/useJunPresence.js +53 -0
- package/dist/runtime/composables/useJunPressDrag.d.ts +20 -0
- package/dist/runtime/composables/useJunPressDrag.js +85 -0
- package/dist/runtime/composables/useJunRecent.d.ts +9 -0
- package/dist/runtime/composables/useJunRecent.js +44 -0
- package/dist/runtime/composables/useJunRename.d.ts +19 -0
- package/dist/runtime/composables/useJunRename.js +62 -0
- package/dist/runtime/composables/useJunRouteGeoHeal.d.ts +1 -0
- package/dist/runtime/composables/useJunRouteGeoHeal.js +45 -0
- package/dist/runtime/composables/useJunRouting.d.ts +29 -0
- package/dist/runtime/composables/useJunRouting.js +101 -0
- package/dist/runtime/composables/useJunSearch.d.ts +6 -0
- package/dist/runtime/composables/useJunSearch.js +16 -0
- package/dist/runtime/composables/useJunSelfId.d.ts +1 -0
- package/dist/runtime/composables/useJunSelfId.js +28 -0
- package/dist/runtime/composables/useJunSiteConfig.d.ts +229 -0
- package/dist/runtime/composables/useJunSiteConfig.js +95 -0
- package/dist/runtime/composables/useJunSiteConfigValues.d.ts +33 -0
- package/dist/runtime/composables/useJunSiteConfigValues.js +21 -0
- package/dist/runtime/composables/useJunStagger.d.ts +54 -0
- package/dist/runtime/composables/useJunStagger.js +23 -0
- package/dist/runtime/composables/useJunStudio.d.ts +11 -0
- package/dist/runtime/composables/useJunStudio.js +51 -0
- package/dist/runtime/composables/useJunSurface.d.ts +19 -0
- package/dist/runtime/composables/useJunSurface.js +8 -0
- package/dist/runtime/composables/useJunTheme.d.ts +21 -0
- package/dist/runtime/composables/useJunTheme.js +138 -0
- package/dist/runtime/composables/useJunThemeTransition.d.ts +5 -0
- package/dist/runtime/composables/useJunThemeTransition.js +32 -0
- package/dist/runtime/composables/useJunUpload.d.ts +12 -0
- package/dist/runtime/composables/useJunUpload.js +44 -0
- package/dist/runtime/composables/useJunViewingAccent.d.ts +6 -0
- package/dist/runtime/composables/useJunViewingAccent.js +28 -0
- package/dist/runtime/error.d.vue.ts +7 -0
- package/dist/runtime/error.vue +74 -0
- package/dist/runtime/error.vue.d.ts +7 -0
- package/dist/runtime/layouts/jun.d.vue.ts +13 -0
- package/dist/runtime/layouts/jun.vue +162 -0
- package/dist/runtime/layouts/jun.vue.d.ts +13 -0
- package/dist/runtime/pages/doc.d.vue.ts +3 -0
- package/dist/runtime/pages/doc.vue +142 -0
- package/dist/runtime/pages/doc.vue.d.ts +3 -0
- package/dist/runtime/pages/index.d.vue.ts +3 -0
- package/dist/runtime/pages/index.vue +64 -0
- package/dist/runtime/pages/index.vue.d.ts +3 -0
- package/dist/runtime/plugins/jun-drag-affordance.client.d.ts +2 -0
- package/dist/runtime/plugins/jun-drag-affordance.client.js +9 -0
- package/dist/runtime/router.options.d.ts +3 -0
- package/dist/runtime/router.options.js +72 -0
- package/dist/runtime/server/api/nav.get.d.ts +9 -0
- package/dist/runtime/server/api/nav.get.js +16 -0
- package/dist/runtime/server/api/resolve/[...slug].get.d.ts +18 -0
- package/dist/runtime/server/api/resolve/[...slug].get.js +20 -0
- package/dist/runtime/server/api/search.get.d.ts +13 -0
- package/dist/runtime/server/api/search.get.js +72 -0
- package/dist/runtime/server/api/service.get.d.ts +12 -0
- package/dist/runtime/server/api/service.get.js +39 -0
- package/dist/runtime/server/api/site-config.get.d.ts +2 -0
- package/dist/runtime/server/api/site-config.get.js +3 -0
- package/dist/runtime/server/api/stats.get.d.ts +12 -0
- package/dist/runtime/server/api/stats.get.js +56 -0
- package/dist/runtime/server/janitor/junJanitorActor.d.ts +179 -0
- package/dist/runtime/server/janitor/junJanitorActor.js +305 -0
- package/dist/runtime/server/janitor/junJanitorChores.d.ts +137 -0
- package/dist/runtime/server/janitor/junJanitorChores.js +189 -0
- package/dist/runtime/server/janitor/junJanitorDiff.d.ts +41 -0
- package/dist/runtime/server/janitor/junJanitorDiff.js +109 -0
- package/dist/runtime/server/janitor/junJanitorListen.d.ts +33 -0
- package/dist/runtime/server/janitor/junJanitorListen.js +43 -0
- package/dist/runtime/server/janitor/junJanitorMachine.d.ts +60 -0
- package/dist/runtime/server/janitor/junJanitorMachine.js +598 -0
- package/dist/runtime/server/janitor/junJanitorMotor.d.ts +211 -0
- package/dist/runtime/server/janitor/junJanitorMotor.js +241 -0
- package/dist/runtime/server/janitor/junJanitorPatrol.d.ts +68 -0
- package/dist/runtime/server/janitor/junJanitorPatrol.js +34 -0
- package/dist/runtime/server/janitor/junJanitorPerform.d.ts +70 -0
- package/dist/runtime/server/janitor/junJanitorPerform.js +72 -0
- package/dist/runtime/server/janitor/junJanitorRandom.d.ts +54 -0
- package/dist/runtime/server/janitor/junJanitorRandom.js +48 -0
- package/dist/runtime/server/janitor/junJanitorStore.d.ts +159 -0
- package/dist/runtime/server/janitor/junJanitorStore.js +269 -0
- package/dist/runtime/server/janitor/junJanitorVoice.d.ts +86 -0
- package/dist/runtime/server/janitor/junJanitorVoice.js +193 -0
- package/dist/runtime/server/janitor/junJanitorYText.d.ts +164 -0
- package/dist/runtime/server/janitor/junJanitorYText.js +258 -0
- package/dist/runtime/server/plugins/jun-bootstrap.d.ts +25 -0
- package/dist/runtime/server/plugins/jun-bootstrap.js +652 -0
- package/dist/runtime/server/plugins/jun-doc-cache.d.ts +2 -0
- package/dist/runtime/server/plugins/jun-doc-cache.js +142 -0
- package/dist/runtime/server/plugins/jun-janitor.d.ts +2 -0
- package/dist/runtime/server/plugins/jun-janitor.js +176 -0
- package/dist/runtime/server/plugins/jun-rpc.d.ts +2 -0
- package/dist/runtime/server/plugins/jun-rpc.js +455 -0
- package/dist/runtime/server/routes/feed.json.get.d.ts +21 -0
- package/dist/runtime/server/routes/feed.json.get.js +25 -0
- package/dist/runtime/server/routes/feed.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/feed.xml.get.js +34 -0
- package/dist/runtime/server/routes/sitemap.xml.get.d.ts +2 -0
- package/dist/runtime/server/routes/sitemap.xml.get.js +27 -0
- package/dist/runtime/server/utils/junCache.d.ts +41 -0
- package/dist/runtime/server/utils/junCache.js +32 -0
- package/dist/runtime/server/utils/junFeed.d.ts +20 -0
- package/dist/runtime/server/utils/junFeed.js +71 -0
- package/dist/runtime/server/utils/junServiceFetch.d.ts +46 -0
- package/dist/runtime/server/utils/junServiceFetch.js +320 -0
- package/dist/runtime/server/utils/junVisibility.d.ts +31 -0
- package/dist/runtime/server/utils/junVisibility.js +6 -0
- package/dist/runtime/types.d.ts +853 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/utils/junDate.d.ts +38 -0
- package/dist/runtime/utils/junDate.js +30 -0
- package/dist/runtime/utils/junDndGeometry.d.ts +62 -0
- package/dist/runtime/utils/junDndGeometry.js +56 -0
- package/dist/runtime/utils/junDocTypeIcons.d.ts +30 -0
- package/dist/runtime/utils/junDocTypeIcons.js +30 -0
- package/dist/runtime/utils/junEditorBodyText.d.ts +32 -0
- package/dist/runtime/utils/junEditorBodyText.js +10 -0
- package/dist/runtime/utils/junMapboxToken.d.ts +1 -0
- package/dist/runtime/utils/junMapboxToken.js +5 -0
- package/dist/runtime/utils/junMatch.d.ts +45 -0
- package/dist/runtime/utils/junMatch.js +37 -0
- package/dist/runtime/utils/junMetaSchemas.d.ts +23 -0
- package/dist/runtime/utils/junMetaSchemas.js +94 -0
- package/dist/runtime/utils/junMotion.d.ts +71 -0
- package/dist/runtime/utils/junMotion.js +3 -0
- package/dist/runtime/utils/junServiceRef.d.ts +21 -0
- package/dist/runtime/utils/junServiceRef.js +94 -0
- package/dist/runtime/utils/junSimplifyPath.d.ts +23 -0
- package/dist/runtime/utils/junSimplifyPath.js +57 -0
- package/dist/runtime/utils/junTransportModes.d.ts +49 -0
- package/dist/runtime/utils/junTransportModes.js +37 -0
- package/dist/runtime/utils/junVideoSource.d.ts +51 -0
- package/dist/runtime/utils/junVideoSource.js +110 -0
- package/dist/runtime/utils/junVisibility.d.ts +14 -0
- package/dist/runtime/utils/junVisibility.js +6 -0
- package/dist/types.d.mts +5 -0
- package/package.json +111 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, shallowRef, watch } from "vue";
|
|
3
|
+
import { useRoute, useRouter } from "vue-router";
|
|
4
|
+
import {
|
|
5
|
+
definePageMeta,
|
|
6
|
+
navigateTo,
|
|
7
|
+
setResponseStatus,
|
|
8
|
+
useDocSlugs,
|
|
9
|
+
useFetch,
|
|
10
|
+
useJunDocPage,
|
|
11
|
+
useJunOptions,
|
|
12
|
+
useJunRename,
|
|
13
|
+
useSlugRoute
|
|
14
|
+
} from "#imports";
|
|
15
|
+
definePageMeta({ layout: "jun" });
|
|
16
|
+
const route = useRoute();
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
const { apiBase, typeIds } = useJunOptions();
|
|
19
|
+
const {
|
|
20
|
+
slugPath,
|
|
21
|
+
docId: clientDocId,
|
|
22
|
+
notFound: clientNotFound
|
|
23
|
+
} = useSlugRoute();
|
|
24
|
+
const request = useFetch(
|
|
25
|
+
() => `${apiBase}/resolve/${slugPath.value}`,
|
|
26
|
+
{
|
|
27
|
+
// NO `key` option. Passing `key: () => …` — a function — is what broke
|
|
28
|
+
// every in-app navigation: Nuxt expects a string here, the function never
|
|
29
|
+
// resolves to a stable key, the fetch promise never settles, and because
|
|
30
|
+
// this `await` makes the page an async-setup component its Suspense
|
|
31
|
+
// boundary stays pending FOREVER. Vue then renders nothing at all — two
|
|
32
|
+
// empty fragment anchors in <main>, no error, no warning. First load was
|
|
33
|
+
// unaffected because that path is SSR.
|
|
34
|
+
//
|
|
35
|
+
// Nuxt derives a correct per-URL key from the reactive URL above.
|
|
36
|
+
// A 404 here only means the SERVER cache doesn't know the slug — the
|
|
37
|
+
// client map may still resolve it, so this must not throw.
|
|
38
|
+
ignoreResponseError: true
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
const resolved = request.data;
|
|
42
|
+
if (import.meta.server) await request;
|
|
43
|
+
if (import.meta.server && resolved.value?.canonical) {
|
|
44
|
+
await navigateTo(`/${resolved.value.canonical}`, { redirectCode: 301 });
|
|
45
|
+
}
|
|
46
|
+
if (import.meta.server && typeIds.redirect && resolved.value?.type === typeIds.redirect) {
|
|
47
|
+
const target = resolved.value.meta?.url;
|
|
48
|
+
if (typeof target === "string" && target.trim()) {
|
|
49
|
+
await navigateTo(target.trim(), {
|
|
50
|
+
external: /^https?:\/\//i.test(target.trim()),
|
|
51
|
+
redirectCode: resolved.value.meta?.redirectPermanent ? 301 : 302
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (import.meta.server && resolved.value?.cacheReady && !resolved.value.found) {
|
|
56
|
+
setResponseStatus(404);
|
|
57
|
+
}
|
|
58
|
+
const { docIdForAlias } = useJunRename();
|
|
59
|
+
const { slugMap } = useDocSlugs();
|
|
60
|
+
const aliasDocId = computed(
|
|
61
|
+
() => clientNotFound.value ? docIdForAlias(slugPath.value) : null
|
|
62
|
+
);
|
|
63
|
+
const docId = computed(
|
|
64
|
+
() => clientDocId.value ?? aliasDocId.value ?? resolved.value?.docId ?? null
|
|
65
|
+
);
|
|
66
|
+
const notFound = computed(
|
|
67
|
+
() => clientNotFound.value && !aliasDocId.value && !resolved.value?.docId
|
|
68
|
+
);
|
|
69
|
+
const latched = shallowRef(null);
|
|
70
|
+
watch(
|
|
71
|
+
[() => route.path, docId],
|
|
72
|
+
([path, id]) => {
|
|
73
|
+
if (id) latched.value = { path, docId: id };
|
|
74
|
+
},
|
|
75
|
+
{ immediate: true }
|
|
76
|
+
);
|
|
77
|
+
watch(
|
|
78
|
+
() => latched.value ? slugMap.value.idToSlug[latched.value.docId] : void 0,
|
|
79
|
+
(slug) => {
|
|
80
|
+
if (!import.meta.client || !slug || !latched.value) return;
|
|
81
|
+
if (latched.value.path !== route.path) return;
|
|
82
|
+
const target = `/${slug}`;
|
|
83
|
+
if (route.path === target) return;
|
|
84
|
+
void router.replace(target);
|
|
85
|
+
},
|
|
86
|
+
// `immediate` also covers the ALIAS landing: the old URL resolves to the
|
|
87
|
+
// document, this fires once, and the address bar rewrites to the new one.
|
|
88
|
+
{ immediate: true }
|
|
89
|
+
);
|
|
90
|
+
const { bucket, flowMaxW, renderKey, cachedEntry, editing, ownerOnly, canEdit } = useJunDocPage(docId, { resolved });
|
|
91
|
+
const hidden = computed(() => ownerOnly.value && !canEdit.value);
|
|
92
|
+
const cachedHtml = computed(() => hidden.value ? "" : resolved.value?.html ?? "");
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<template>
|
|
96
|
+
<!-- A real ELEMENT root, and it is load-bearing.
|
|
97
|
+
`<ClientOnly>` renders a fragment (a comment node before mount), and the
|
|
98
|
+
`jun-fade` page transition wraps this component in a `<Transition>`. A
|
|
99
|
+
Transition cannot animate a non-element root: it has nothing to attach
|
|
100
|
+
to, so the fade never runs and — under the `out-in` this codebase is not
|
|
101
|
+
allowed to use — the incoming page never paints at all. Nuxt warns about
|
|
102
|
+
exactly this ("does not have a single root node and will cause errors
|
|
103
|
+
when navigating between routes"). Do not remove this wrapper. -->
|
|
104
|
+
<div class="jun-doc-root">
|
|
105
|
+
<ClientOnly>
|
|
106
|
+
<!-- Rendered ON THE SERVER and held until mount: this is what a crawler
|
|
107
|
+
indexes and what a cold visitor sees first. The same HTML goes into
|
|
108
|
+
the renderer's #loading slot inside JunDocSurface, so there is no gap
|
|
109
|
+
between this unmounting and the live renderer painting. -->
|
|
110
|
+
<template #fallback>
|
|
111
|
+
<div
|
|
112
|
+
v-if="cachedHtml"
|
|
113
|
+
class="min-h-screen pt-24"
|
|
114
|
+
>
|
|
115
|
+
<div :class="['mx-auto w-full', flowMaxW]">
|
|
116
|
+
<div
|
|
117
|
+
class="prose dark:prose-invert max-w-none"
|
|
118
|
+
v-html="cachedHtml"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<JunNotFound
|
|
125
|
+
v-if="notFound || hidden"
|
|
126
|
+
:path="route.path"
|
|
127
|
+
/>
|
|
128
|
+
|
|
129
|
+
<JunDocSurface
|
|
130
|
+
v-else-if="docId"
|
|
131
|
+
:doc-id="docId"
|
|
132
|
+
:bucket="bucket"
|
|
133
|
+
:flow-max-w="flowMaxW"
|
|
134
|
+
:render-key="renderKey"
|
|
135
|
+
:editable="editing"
|
|
136
|
+
:entry="cachedEntry"
|
|
137
|
+
:html="cachedHtml"
|
|
138
|
+
breadcrumbs
|
|
139
|
+
/>
|
|
140
|
+
</ClientOnly>
|
|
141
|
+
</div>
|
|
142
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useRouter } from "vue-router";
|
|
4
|
+
import {
|
|
5
|
+
definePageMeta,
|
|
6
|
+
useAbracadabra,
|
|
7
|
+
useChildTree,
|
|
8
|
+
useDocSlugs,
|
|
9
|
+
useJunDocPage
|
|
10
|
+
} from "#imports";
|
|
11
|
+
definePageMeta({ layout: "jun" });
|
|
12
|
+
const abra = useAbracadabra();
|
|
13
|
+
const docId = computed(() => abra.spaceDocId.value ?? null);
|
|
14
|
+
const { bucket, flowMaxW, renderKey, cachedEntry, editing } = useJunDocPage(docId);
|
|
15
|
+
const childTree = useChildTree(abra.doc, "jun-index-child-create");
|
|
16
|
+
const { getDocUrl } = useDocSlugs();
|
|
17
|
+
const router = useRouter();
|
|
18
|
+
function addChild() {
|
|
19
|
+
if (!docId.value) return;
|
|
20
|
+
const id = childTree.createChild(docId.value, "New page", "doc");
|
|
21
|
+
const url = getDocUrl(id);
|
|
22
|
+
if (url) void router.push(url);
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<!-- The root doc resolves from the live CRDT connection, so this branch is
|
|
28
|
+
client-only and the ambient backdrop fills the pre-connect window.
|
|
29
|
+
Unlike `doc.vue` there is no slug to resolve server-side, so there is no
|
|
30
|
+
cached-HTML fallback to emit here — the root's SSR is the layout chrome
|
|
31
|
+
and the navigation. -->
|
|
32
|
+
<!-- Element root — see the note in `doc.vue`. A `<ClientOnly>` root is a
|
|
33
|
+
fragment, and the page transition cannot animate one, which breaks every
|
|
34
|
+
in-app navigation while first load still works. -->
|
|
35
|
+
<div class="jun-doc-root">
|
|
36
|
+
<ClientOnly>
|
|
37
|
+
<JunDocSurface
|
|
38
|
+
v-if="docId"
|
|
39
|
+
:doc-id="docId"
|
|
40
|
+
:bucket="bucket"
|
|
41
|
+
:flow-max-w="flowMaxW"
|
|
42
|
+
:render-key="renderKey"
|
|
43
|
+
:editable="editing"
|
|
44
|
+
:entry="cachedEntry"
|
|
45
|
+
>
|
|
46
|
+
<template #footer>
|
|
47
|
+
<div
|
|
48
|
+
v-if="editing"
|
|
49
|
+
class="px-4 py-4 sm:px-8"
|
|
50
|
+
>
|
|
51
|
+
<UButton
|
|
52
|
+
icon="i-lucide-plus"
|
|
53
|
+
size="sm"
|
|
54
|
+
color="neutral"
|
|
55
|
+
variant="soft"
|
|
56
|
+
label="New page"
|
|
57
|
+
@click="addChild"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
</JunDocSurface>
|
|
62
|
+
</ClientOnly>
|
|
63
|
+
</div>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { watch } from "vue";
|
|
2
|
+
import { defineNuxtPlugin } from "#app";
|
|
3
|
+
import { useDocDragBus } from "#imports";
|
|
4
|
+
export default defineNuxtPlugin(() => {
|
|
5
|
+
const bus = useDocDragBus();
|
|
6
|
+
watch(bus.isDragging, (on) => {
|
|
7
|
+
document.documentElement.classList.toggle("doc-dragging", on);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useNuxtApp } from "#app";
|
|
2
|
+
const DEADLINE_MS = 1600;
|
|
3
|
+
const EPSILON = 2;
|
|
4
|
+
function markRestoring() {
|
|
5
|
+
document.documentElement.dataset.junRestore = "";
|
|
6
|
+
}
|
|
7
|
+
function clearRestoring() {
|
|
8
|
+
delete document.documentElement.dataset.junRestore;
|
|
9
|
+
}
|
|
10
|
+
if (import.meta.client) {
|
|
11
|
+
window.addEventListener("popstate", markRestoring);
|
|
12
|
+
}
|
|
13
|
+
function restore(top, left) {
|
|
14
|
+
if (import.meta.server) return;
|
|
15
|
+
let aborted = false;
|
|
16
|
+
const events = ["wheel", "touchstart", "keydown", "pointerdown"];
|
|
17
|
+
const abort = () => {
|
|
18
|
+
aborted = true;
|
|
19
|
+
teardown();
|
|
20
|
+
clearRestoring();
|
|
21
|
+
};
|
|
22
|
+
const teardown = () => {
|
|
23
|
+
for (const type of events) window.removeEventListener(type, abort);
|
|
24
|
+
};
|
|
25
|
+
for (const type of events) {
|
|
26
|
+
window.addEventListener(type, abort, { passive: true });
|
|
27
|
+
}
|
|
28
|
+
const deadline = performance.now() + DEADLINE_MS;
|
|
29
|
+
const tick = () => {
|
|
30
|
+
if (aborted) return;
|
|
31
|
+
window.scrollTo({ top, left, behavior: "instant" });
|
|
32
|
+
const reached = Math.abs(window.scrollY - top) <= EPSILON;
|
|
33
|
+
if (reached || performance.now() >= deadline) {
|
|
34
|
+
teardown();
|
|
35
|
+
requestAnimationFrame(clearRestoring);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
requestAnimationFrame(tick);
|
|
39
|
+
};
|
|
40
|
+
requestAnimationFrame(tick);
|
|
41
|
+
}
|
|
42
|
+
export default {
|
|
43
|
+
scrollBehavior(to, from, savedPosition) {
|
|
44
|
+
const nuxtApp = useNuxtApp();
|
|
45
|
+
if (to.path === from.path && to.hash) {
|
|
46
|
+
if (import.meta.client) clearRestoring();
|
|
47
|
+
return { el: to.hash, behavior: "smooth" };
|
|
48
|
+
}
|
|
49
|
+
const hook = "page:finish";
|
|
50
|
+
return new Promise((resolve) => {
|
|
51
|
+
nuxtApp.hooks.hookOnce(hook, () => {
|
|
52
|
+
requestAnimationFrame(() => {
|
|
53
|
+
if (savedPosition) {
|
|
54
|
+
restore(savedPosition.top, savedPosition.left ?? 0);
|
|
55
|
+
resolve(false);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
clearRestoring();
|
|
59
|
+
if (to.hash) {
|
|
60
|
+
resolve({ el: to.hash, behavior: "instant" });
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (to.meta.scrollToTop === false) {
|
|
64
|
+
resolve(false);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
resolve({ left: 0, top: 0 });
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { defineEventHandler } from "h3";
|
|
2
|
+
import { junDocTree, junRootDocId, junSlugMap } from "../utils/junCache.js";
|
|
3
|
+
export default defineEventHandler(async () => {
|
|
4
|
+
const rootDocId = junRootDocId();
|
|
5
|
+
const [tree, idToSlug] = await Promise.all([junDocTree(), junSlugMap()]);
|
|
6
|
+
return Object.entries(tree).filter(
|
|
7
|
+
([id, e]) => !!e && !e.trashed && id !== rootDocId && (!e.parentId || e.parentId === rootDocId) && e.meta?.hidden !== true
|
|
8
|
+
).sort(([, a], [, b]) => (a.order ?? 0) - (b.order ?? 0)).map(([id, e]) => ({
|
|
9
|
+
id,
|
|
10
|
+
name: e.label || "Untitled",
|
|
11
|
+
// Fall back to the id when the slug map hasn't caught up — matches the client.
|
|
12
|
+
href: `/${idToSlug[id] ?? id}`,
|
|
13
|
+
type: e.type ?? "doc",
|
|
14
|
+
icon: typeof e.meta?.icon === "string" ? e.meta.icon : void 0
|
|
15
|
+
}));
|
|
16
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
2
|
+
found: false;
|
|
3
|
+
cacheReady: boolean;
|
|
4
|
+
docId?: undefined;
|
|
5
|
+
title?: undefined;
|
|
6
|
+
type?: undefined;
|
|
7
|
+
meta?: undefined;
|
|
8
|
+
html?: undefined;
|
|
9
|
+
} | {
|
|
10
|
+
found: true;
|
|
11
|
+
cacheReady: boolean;
|
|
12
|
+
docId: string;
|
|
13
|
+
title: string | null;
|
|
14
|
+
type: string;
|
|
15
|
+
meta: Record<string, unknown>;
|
|
16
|
+
html: string | null;
|
|
17
|
+
}>>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineEventHandler, getRouterParam } from "h3";
|
|
2
|
+
import { junDocHtml, junDocTree, junSlugMap } from "../../utils/junCache.js";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
const raw = getRouterParam(event, "slug") ?? getRouterParam(event, "_") ?? "";
|
|
5
|
+
const slug = raw.replace(/^\/+|\/+$/g, "");
|
|
6
|
+
const [tree, idToSlug] = await Promise.all([junDocTree(), junSlugMap()]);
|
|
7
|
+
const cacheReady = Object.keys(tree).length > 0;
|
|
8
|
+
const docId = Object.entries(idToSlug).find(([, s]) => s === slug)?.[0];
|
|
9
|
+
if (!docId) return { found: false, cacheReady };
|
|
10
|
+
const entry = tree[docId];
|
|
11
|
+
return {
|
|
12
|
+
found: true,
|
|
13
|
+
cacheReady,
|
|
14
|
+
docId,
|
|
15
|
+
title: entry?.label ?? null,
|
|
16
|
+
type: entry?.type ?? "doc",
|
|
17
|
+
meta: entry?.meta ?? {},
|
|
18
|
+
html: await junDocHtml(docId)
|
|
19
|
+
};
|
|
20
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface JunSearchHit {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
/** Resolved href, so a consumer never needs the slug map. */
|
|
5
|
+
href: string;
|
|
6
|
+
type: string;
|
|
7
|
+
parentId?: string | null;
|
|
8
|
+
/** HTML-safe, with the match wrapped in `<mark>`. */
|
|
9
|
+
snippet?: string;
|
|
10
|
+
rank: number;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<JunSearchHit[]>>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { defineEventHandler, getQuery } from "h3";
|
|
2
|
+
import { junDocHtml, junDocTree, junRootDocId, junSlugMap } from "../utils/junCache.js";
|
|
3
|
+
import { isJunOwnerOnlyDoc } from "../utils/junVisibility.js";
|
|
4
|
+
const escapeHtml = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
5
|
+
function toText(html) {
|
|
6
|
+
return html.replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<[^>]+>/g, " ").replace(/ /g, " ").replace(/\s+/g, " ").trim();
|
|
7
|
+
}
|
|
8
|
+
function markSnippet(text, q) {
|
|
9
|
+
const idx = text.toLowerCase().indexOf(q.toLowerCase());
|
|
10
|
+
if (idx < 0) return escapeHtml(text.slice(0, 140));
|
|
11
|
+
const start = Math.max(0, idx - 40);
|
|
12
|
+
const pre = (start > 0 ? "\u2026" : "") + text.slice(start, idx);
|
|
13
|
+
const hit = text.slice(idx, idx + q.length);
|
|
14
|
+
const post = text.slice(idx + q.length, idx + q.length + 80);
|
|
15
|
+
const tail = idx + q.length + 80 < text.length ? "\u2026" : "";
|
|
16
|
+
return `${escapeHtml(pre)}<mark>${escapeHtml(hit)}</mark>${escapeHtml(post)}${tail}`;
|
|
17
|
+
}
|
|
18
|
+
export default defineEventHandler(async (event) => {
|
|
19
|
+
const q = String(getQuery(event).q ?? "").trim();
|
|
20
|
+
const limit = Math.min(Number(getQuery(event).limit ?? 20) || 20, 50);
|
|
21
|
+
if (q.length < 2) return [];
|
|
22
|
+
const ql = q.toLowerCase();
|
|
23
|
+
const rootId = junRootDocId();
|
|
24
|
+
const [tree, idToSlug] = await Promise.all([junDocTree(), junSlugMap()]);
|
|
25
|
+
const hits = [];
|
|
26
|
+
for (const [id, entry] of Object.entries(tree)) {
|
|
27
|
+
if (!entry || entry.trashed) continue;
|
|
28
|
+
if (id === rootId) continue;
|
|
29
|
+
if (isJunOwnerOnlyDoc(entry)) continue;
|
|
30
|
+
const label = entry.label ?? "";
|
|
31
|
+
const meta = entry.meta ?? {};
|
|
32
|
+
const excerpt = [meta.excerpt, meta.description].filter((v) => typeof v === "string" && !!v).join(" \u2014 ");
|
|
33
|
+
const labelIdx = label.toLowerCase().indexOf(ql);
|
|
34
|
+
const excerptIdx = excerpt.toLowerCase().indexOf(ql);
|
|
35
|
+
let rank = 0;
|
|
36
|
+
let snippet;
|
|
37
|
+
if (labelIdx === 0) rank = 100;
|
|
38
|
+
else if (labelIdx > 0) rank = 80;
|
|
39
|
+
if (excerptIdx >= 0 && rank < 60) {
|
|
40
|
+
rank = 60;
|
|
41
|
+
snippet = markSnippet(excerpt, q);
|
|
42
|
+
}
|
|
43
|
+
if (!rank) {
|
|
44
|
+
const body = typeof meta.body === "string" ? meta.body : "";
|
|
45
|
+
if (body && body.toLowerCase().includes(ql)) {
|
|
46
|
+
rank = 45;
|
|
47
|
+
snippet = markSnippet(body, q);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (!rank) {
|
|
51
|
+
const html = await junDocHtml(id);
|
|
52
|
+
if (html) {
|
|
53
|
+
const text = toText(html);
|
|
54
|
+
if (text.toLowerCase().includes(ql)) {
|
|
55
|
+
rank = 40;
|
|
56
|
+
snippet = markSnippet(text, q);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (!rank) continue;
|
|
61
|
+
hits.push({
|
|
62
|
+
id,
|
|
63
|
+
title: label || "Untitled",
|
|
64
|
+
href: `/${idToSlug[id] ?? id}`,
|
|
65
|
+
type: entry.type ?? "doc",
|
|
66
|
+
parentId: entry.parentId ?? null,
|
|
67
|
+
snippet,
|
|
68
|
+
rank
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return hits.sort((a, b) => b.rank - a.rank).slice(0, limit);
|
|
72
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JunServiceCard } from '../utils/junServiceFetch.js';
|
|
2
|
+
export type JunServiceResponse = {
|
|
3
|
+
ok: true;
|
|
4
|
+
card: JunServiceCard;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
error: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
ref: string;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import("h3").EventHandler<Omit<import("h3").EventHandlerRequest, "body">, Promise<JunServiceResponse>>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineCachedEventHandler, useRuntimeConfig } from "nitropack/runtime";
|
|
2
|
+
import { getQuery } from "h3";
|
|
3
|
+
import { JunServiceError, junFetchService } from "../utils/junServiceFetch.js";
|
|
4
|
+
export default defineCachedEventHandler(async (event) => {
|
|
5
|
+
const query = getQuery(event);
|
|
6
|
+
const provider = String(query.provider ?? "").trim();
|
|
7
|
+
const ref = String(query.ref ?? "").trim();
|
|
8
|
+
const config = useRuntimeConfig();
|
|
9
|
+
const jun = config.public.jun;
|
|
10
|
+
const allowed = jun?.services?.adapters ?? [];
|
|
11
|
+
const githubToken = config.jun?.githubToken ?? "";
|
|
12
|
+
if (!allowed.includes(provider)) {
|
|
13
|
+
return { ok: false, error: "This site does not use that provider", provider, ref };
|
|
14
|
+
}
|
|
15
|
+
try {
|
|
16
|
+
return { ok: true, card: await junFetchService(provider, ref, { githubToken }) };
|
|
17
|
+
} catch (err) {
|
|
18
|
+
const message = err instanceof JunServiceError ? err.message : "Could not reach that service";
|
|
19
|
+
return { ok: false, error: message, provider, ref };
|
|
20
|
+
}
|
|
21
|
+
}, {
|
|
22
|
+
name: "jun-service",
|
|
23
|
+
// Per provider+ref. Without an explicit key every card on the page shares
|
|
24
|
+
// one cache slot and they all render whichever answer landed first.
|
|
25
|
+
getKey: (event) => {
|
|
26
|
+
const q = getQuery(event);
|
|
27
|
+
return `${String(q.provider ?? "")}:${String(q.ref ?? "")}`;
|
|
28
|
+
},
|
|
29
|
+
maxAge: cacheTtl(),
|
|
30
|
+
swr: true
|
|
31
|
+
});
|
|
32
|
+
function cacheTtl() {
|
|
33
|
+
try {
|
|
34
|
+
const jun = useRuntimeConfig().public.jun;
|
|
35
|
+
return jun?.services?.ttl ?? 600;
|
|
36
|
+
} catch {
|
|
37
|
+
return 600;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: import("h3").EventHandler<Omit<import("h3").EventHandlerRequest, "body">, Promise<{
|
|
2
|
+
pages: number;
|
|
3
|
+
journalEntries: number;
|
|
4
|
+
livePosts: number;
|
|
5
|
+
photos: number;
|
|
6
|
+
signatures: number;
|
|
7
|
+
appreciations: number;
|
|
8
|
+
words: number;
|
|
9
|
+
newestEdit: number;
|
|
10
|
+
generatedAt: number;
|
|
11
|
+
}>>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineCachedEventHandler, useRuntimeConfig, useStorage } from "nitropack/runtime";
|
|
2
|
+
import { junDocTree, junRootDocId } from "../utils/junCache.js";
|
|
3
|
+
export default defineCachedEventHandler(async () => {
|
|
4
|
+
const jun = useRuntimeConfig().public.jun;
|
|
5
|
+
const types = jun?.typeIds ?? {};
|
|
6
|
+
const rootDocId = junRootDocId();
|
|
7
|
+
const tree = await junDocTree();
|
|
8
|
+
const counted = {};
|
|
9
|
+
for (const [id, entry] of Object.entries(tree)) {
|
|
10
|
+
if (!entry || entry.trashed || id === rootDocId) continue;
|
|
11
|
+
if (entry.meta?.seedTest === true || entry.meta?.draft === true) continue;
|
|
12
|
+
counted[id] = entry;
|
|
13
|
+
}
|
|
14
|
+
let pages = 0;
|
|
15
|
+
let journalEntries = 0;
|
|
16
|
+
let livePosts = 0;
|
|
17
|
+
let photos = 0;
|
|
18
|
+
let signatures = 0;
|
|
19
|
+
let appreciations = 0;
|
|
20
|
+
let newestEdit = 0;
|
|
21
|
+
for (const entry of Object.values(counted)) {
|
|
22
|
+
pages++;
|
|
23
|
+
if (types.entry && entry.type === types.entry) journalEntries++;
|
|
24
|
+
if (types.now && entry.type === types.now) livePosts++;
|
|
25
|
+
const parent = entry.parentId ? counted[entry.parentId] ?? tree[entry.parentId] : void 0;
|
|
26
|
+
if (types.wall && parent?.type === types.wall && entry.meta?.coverUploadId) photos++;
|
|
27
|
+
if (types.guestbook && parent?.type === types.guestbook && typeof entry.meta?.message === "string") {
|
|
28
|
+
signatures++;
|
|
29
|
+
}
|
|
30
|
+
if (Array.isArray(entry.meta?.appreciatedBy)) appreciations += entry.meta.appreciatedBy.length;
|
|
31
|
+
const updated = typeof entry.updatedAt === "number" ? entry.updatedAt : 0;
|
|
32
|
+
if (updated > newestEdit) newestEdit = updated;
|
|
33
|
+
}
|
|
34
|
+
let words = 0;
|
|
35
|
+
const storage = useStorage();
|
|
36
|
+
const htmlKeys = await storage.getKeys("doc-cache:html");
|
|
37
|
+
for (const key of htmlKeys) {
|
|
38
|
+
const docId = key.slice(key.lastIndexOf(":") + 1);
|
|
39
|
+
if (!counted[docId]) continue;
|
|
40
|
+
const html = await storage.getItem(key);
|
|
41
|
+
if (typeof html !== "string" || !html) continue;
|
|
42
|
+
const text = html.replace(/<[^>]*>/g, " ").replace(/&[a-z#0-9]+;/gi, " ");
|
|
43
|
+
words += text.split(/\s+/).filter(Boolean).length;
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
pages,
|
|
47
|
+
journalEntries,
|
|
48
|
+
livePosts,
|
|
49
|
+
photos,
|
|
50
|
+
signatures,
|
|
51
|
+
appreciations,
|
|
52
|
+
words,
|
|
53
|
+
newestEdit,
|
|
54
|
+
generatedAt: Date.now()
|
|
55
|
+
};
|
|
56
|
+
}, { name: "jun-stats", maxAge: 60, swr: true });
|