@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,652 @@
|
|
|
1
|
+
import * as Y from "yjs";
|
|
2
|
+
import { AbracadabraProvider } from "@abraca/dabra";
|
|
3
|
+
import { markdownToFragmentNodes } from "@abraca/convert";
|
|
4
|
+
import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
|
|
5
|
+
const BOOT_DELAY_MS = 4e3;
|
|
6
|
+
const SYNC_TIMEOUT_MS = 1e4;
|
|
7
|
+
const ECHO_TIMEOUT_MS = 8e3;
|
|
8
|
+
const BODY_CONCURRENCY = 4;
|
|
9
|
+
const BODY_FLUSH_MS = 400;
|
|
10
|
+
function plain(e) {
|
|
11
|
+
if (!e) return void 0;
|
|
12
|
+
const v = e;
|
|
13
|
+
return typeof v.toJSON === "function" ? v.toJSON() : e;
|
|
14
|
+
}
|
|
15
|
+
export function junIconStorageValue(raw) {
|
|
16
|
+
if (typeof raw !== "string" || !raw) return void 0;
|
|
17
|
+
return raw.replace(/^i-lucide[-:]/, "").replace(/^lucide[-:]/, "");
|
|
18
|
+
}
|
|
19
|
+
function withNormalisedIcon(meta) {
|
|
20
|
+
const bare = junIconStorageValue(meta.icon);
|
|
21
|
+
if (bare === void 0 || bare === meta.icon) return meta;
|
|
22
|
+
return { ...meta, icon: bare };
|
|
23
|
+
}
|
|
24
|
+
function repairIconFormat(ydoc, tree) {
|
|
25
|
+
const fixes = [];
|
|
26
|
+
tree.forEach((raw, id) => {
|
|
27
|
+
const entry = plain(raw);
|
|
28
|
+
const meta = entry?.meta;
|
|
29
|
+
if (!meta) return;
|
|
30
|
+
const bare = junIconStorageValue(meta.icon);
|
|
31
|
+
if (bare === void 0 || bare === meta.icon) return;
|
|
32
|
+
fixes.push([id, { ...entry, meta: { ...meta, icon: bare } }]);
|
|
33
|
+
});
|
|
34
|
+
if (!fixes.length) return;
|
|
35
|
+
ydoc.transact(() => {
|
|
36
|
+
for (const [id, entry] of fixes) tree.set(id, entry);
|
|
37
|
+
});
|
|
38
|
+
console.log(
|
|
39
|
+
`[jun:bootstrap] icon format: rewrote ${fixes.length} prefixed meta.icon value(s) to bare \u2014 see junIconStorageValue`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
function defaultTree(typeIds) {
|
|
43
|
+
const nodes = [
|
|
44
|
+
{
|
|
45
|
+
label: "About",
|
|
46
|
+
type: "doc",
|
|
47
|
+
icon: "i-lucide-user",
|
|
48
|
+
meta: { excerpt: "Who this site belongs to." },
|
|
49
|
+
body: "This page is a live document. Sign in from the studio and edit it in place \u2014 every change syncs to anyone else reading it."
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
if (typeIds.journal) {
|
|
53
|
+
nodes.push({
|
|
54
|
+
label: "Writing",
|
|
55
|
+
type: typeIds.journal,
|
|
56
|
+
icon: "i-lucide-feather",
|
|
57
|
+
meta: { excerpt: "Longer pieces." },
|
|
58
|
+
children: [
|
|
59
|
+
{
|
|
60
|
+
// Dated, so it takes the featured slot rather than leaving the feed
|
|
61
|
+
// looking empty above an unpublished-looking grid.
|
|
62
|
+
label: "Hello, world",
|
|
63
|
+
type: typeIds.entry ?? "doc",
|
|
64
|
+
meta: {
|
|
65
|
+
excerpt: "The first entry on a fresh deployment.",
|
|
66
|
+
date: (/* @__PURE__ */ new Date()).toISOString(),
|
|
67
|
+
tags: ["welcome"]
|
|
68
|
+
},
|
|
69
|
+
body: "Rename this page and watch the address bar follow \u2014 the old URL keeps working, because renaming records it as an alias."
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: "A second entry",
|
|
73
|
+
type: typeIds.entry ?? "doc",
|
|
74
|
+
meta: {
|
|
75
|
+
excerpt: "So the feed has both a featured card and a grid.",
|
|
76
|
+
// A day earlier, so the ordering is visible rather than incidental.
|
|
77
|
+
date: new Date(Date.now() - 864e5).toISOString()
|
|
78
|
+
},
|
|
79
|
+
body: "Entries sort by their date, newest first. An entry with no date sorts last \u2014 never first, so an undated page cannot displace real writing at the top of the feed."
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
if (typeIds.live) {
|
|
85
|
+
nodes.push({
|
|
86
|
+
label: "Live",
|
|
87
|
+
type: typeIds.live,
|
|
88
|
+
icon: "i-lucide-radio",
|
|
89
|
+
meta: { excerpt: "Shorter, more often." },
|
|
90
|
+
children: [
|
|
91
|
+
{
|
|
92
|
+
label: "A first post",
|
|
93
|
+
type: typeIds.now ?? "doc",
|
|
94
|
+
meta: {
|
|
95
|
+
date: new Date(Date.now() - 36e5).toISOString(),
|
|
96
|
+
body: "Posts are documents. Open one and it has its own page, its own prose, and its own sub-pages.",
|
|
97
|
+
nowPlaying: "Something quiet"
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: "An older post",
|
|
102
|
+
type: typeIds.now ?? "doc",
|
|
103
|
+
meta: {
|
|
104
|
+
date: new Date(Date.now() - 2 * 864e5).toISOString(),
|
|
105
|
+
body: "The composer is a draft document, so an abandoned draft survives a reload."
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (typeIds.apps) {
|
|
112
|
+
nodes.push({
|
|
113
|
+
label: "Projects",
|
|
114
|
+
type: typeIds.apps,
|
|
115
|
+
icon: "i-lucide-grid-2x2",
|
|
116
|
+
meta: { excerpt: "Things built and shipped." },
|
|
117
|
+
children: [
|
|
118
|
+
{
|
|
119
|
+
label: "A first project",
|
|
120
|
+
type: typeIds.app ?? "doc",
|
|
121
|
+
meta: {
|
|
122
|
+
status: "live",
|
|
123
|
+
url: "https://example.com",
|
|
124
|
+
description: "Drop an image on the tile to give it an icon."
|
|
125
|
+
},
|
|
126
|
+
body: "A project page carries its own write-up. Screenshots are real uploads into this document, not remote URLs."
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: "Something in progress",
|
|
130
|
+
type: typeIds.app ?? "doc",
|
|
131
|
+
meta: { status: "building", description: "Tiles reorder by dragging \u2014 their order is stored." }
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (typeIds.cv) {
|
|
137
|
+
nodes.push({
|
|
138
|
+
label: "Journey",
|
|
139
|
+
type: typeIds.cv,
|
|
140
|
+
icon: "i-lucide-milestone",
|
|
141
|
+
meta: { excerpt: "Stations so far." },
|
|
142
|
+
children: [
|
|
143
|
+
{
|
|
144
|
+
label: "Started this site",
|
|
145
|
+
type: "doc",
|
|
146
|
+
meta: {
|
|
147
|
+
start: String((/* @__PURE__ */ new Date()).getFullYear()),
|
|
148
|
+
place: "Everywhere",
|
|
149
|
+
description: 'An open end reads as "now" \u2014 leave it blank while something is ongoing.',
|
|
150
|
+
icon: "sprout"
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
label: "Something earlier",
|
|
155
|
+
type: "doc",
|
|
156
|
+
meta: {
|
|
157
|
+
start: "2019",
|
|
158
|
+
end: "2021",
|
|
159
|
+
place: "Elsewhere",
|
|
160
|
+
description: "A bare year is fine. Stations sort newest first by their start."
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
if (typeIds.links) {
|
|
167
|
+
nodes.push({
|
|
168
|
+
label: "Elsewhere",
|
|
169
|
+
type: typeIds.links,
|
|
170
|
+
icon: "i-lucide-link",
|
|
171
|
+
meta: { excerpt: "Where else to find this site." },
|
|
172
|
+
children: [
|
|
173
|
+
{
|
|
174
|
+
label: "Abracadabra",
|
|
175
|
+
type: "doc",
|
|
176
|
+
meta: {
|
|
177
|
+
url: "https://github.com/abracadabra",
|
|
178
|
+
icon: "github",
|
|
179
|
+
description: "The platform this site is built on."
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
// No url on purpose: a row without one links to its own page, which
|
|
184
|
+
// is how a link grows into a real page later.
|
|
185
|
+
label: "A link with no URL",
|
|
186
|
+
type: "doc",
|
|
187
|
+
meta: {
|
|
188
|
+
icon: "file-text",
|
|
189
|
+
description: "No URL, so this row opens its own page instead."
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
if (typeIds.uses) {
|
|
196
|
+
nodes.push({
|
|
197
|
+
label: "Uses",
|
|
198
|
+
type: typeIds.uses,
|
|
199
|
+
icon: "i-lucide-wrench",
|
|
200
|
+
meta: { excerpt: "The tools behind the work." },
|
|
201
|
+
children: [
|
|
202
|
+
{
|
|
203
|
+
label: "A laptop",
|
|
204
|
+
type: "doc",
|
|
205
|
+
meta: { category: "Hardware", icon: "laptop", description: "Sections come from the page's own meta.categories." }
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: "An editor",
|
|
209
|
+
type: "doc",
|
|
210
|
+
meta: { category: "Software", icon: "code", description: "Change an item's category and it moves section." }
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
// No category on purpose: it must surface under "Other" rather than
|
|
214
|
+
// vanish, which is the rule that makes page types convertible.
|
|
215
|
+
label: "Something uncategorised",
|
|
216
|
+
type: "doc",
|
|
217
|
+
meta: { icon: "box", description: 'No category \u2014 shows under "Other".' }
|
|
218
|
+
}
|
|
219
|
+
]
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
if (typeIds.library) {
|
|
223
|
+
nodes.push({
|
|
224
|
+
label: "Library",
|
|
225
|
+
type: typeIds.library,
|
|
226
|
+
icon: "i-lucide-library",
|
|
227
|
+
meta: { excerpt: "Reading, and what it did." },
|
|
228
|
+
children: [
|
|
229
|
+
{
|
|
230
|
+
label: "Something being read",
|
|
231
|
+
type: "doc",
|
|
232
|
+
meta: { status: "reading", author: "An author", rating: 4 }
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: "Something finished",
|
|
236
|
+
type: "doc",
|
|
237
|
+
meta: { status: "read", author: "Another author", rating: 5 }
|
|
238
|
+
},
|
|
239
|
+
{ label: "Something next", type: "doc", meta: { status: "want" } }
|
|
240
|
+
]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
if (typeIds.wall) {
|
|
244
|
+
nodes.push({
|
|
245
|
+
label: "Wall",
|
|
246
|
+
type: typeIds.wall,
|
|
247
|
+
icon: "i-lucide-images",
|
|
248
|
+
// No children: a wall's items are UPLOADED images, and the seeder has no
|
|
249
|
+
// binaries to upload. It seeds the page so the type is reachable and its
|
|
250
|
+
// empty state is what a new owner actually sees first.
|
|
251
|
+
meta: { excerpt: "Drop images here to pin them." }
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
if (typeIds.guestbook) {
|
|
255
|
+
nodes.push({
|
|
256
|
+
label: "Guestbook",
|
|
257
|
+
type: typeIds.guestbook,
|
|
258
|
+
icon: "i-lucide-pen-line",
|
|
259
|
+
// No children: signatures are written by VISITORS through the RPC
|
|
260
|
+
// runner. Seeding fake ones would put words in strangers' mouths.
|
|
261
|
+
meta: { excerpt: "Passing through? Leave a trace." }
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
if (typeIds.stats) {
|
|
265
|
+
nodes.push({
|
|
266
|
+
label: "Pulse",
|
|
267
|
+
type: typeIds.stats,
|
|
268
|
+
icon: "i-lucide-activity",
|
|
269
|
+
meta: { excerpt: "Live numbers over this site's document tree." }
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
if (typeIds.cinema) {
|
|
273
|
+
nodes.push({
|
|
274
|
+
label: "Cinema",
|
|
275
|
+
type: typeIds.cinema,
|
|
276
|
+
icon: "i-lucide-clapperboard",
|
|
277
|
+
meta: { excerpt: "Films, shelved by whether they have been watched." },
|
|
278
|
+
children: [
|
|
279
|
+
{
|
|
280
|
+
// No `videoUrl` and no upload: the seeder has no binaries and must
|
|
281
|
+
// not put a third party's video on a site that never asked for one.
|
|
282
|
+
// The page still demonstrates the shelves, the poster grid and the
|
|
283
|
+
// empty player's own instructions.
|
|
284
|
+
label: "Something to watch",
|
|
285
|
+
type: typeIds.movie ?? "doc",
|
|
286
|
+
meta: { status: "watchlist", year: String((/* @__PURE__ */ new Date()).getFullYear()) },
|
|
287
|
+
body: "Drop a video file onto the cinema page, or paste a link. An uploaded film STREAMS \u2014 it seeks before it has finished downloading."
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
label: "Something seen",
|
|
291
|
+
type: typeIds.movie ?? "doc",
|
|
292
|
+
meta: { status: "seen", rating: 4 }
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
if (typeIds.festival) {
|
|
298
|
+
nodes.push({
|
|
299
|
+
label: "Festival",
|
|
300
|
+
type: typeIds.festival,
|
|
301
|
+
icon: "i-lucide-disc-3",
|
|
302
|
+
meta: {
|
|
303
|
+
excerpt: "A stage each. Press play and keep reading \u2014 it follows you.",
|
|
304
|
+
stages: "Main stage, Late night"
|
|
305
|
+
},
|
|
306
|
+
children: [
|
|
307
|
+
{
|
|
308
|
+
label: "A track with no audio yet",
|
|
309
|
+
type: typeIds.track ?? "doc",
|
|
310
|
+
meta: { stage: "Main stage" },
|
|
311
|
+
body: "Drop an audio file onto the festival page. Its title, artist and album come out of the file's own tags."
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
if (typeIds.services) {
|
|
317
|
+
nodes.push({
|
|
318
|
+
label: "Signals",
|
|
319
|
+
type: typeIds.services,
|
|
320
|
+
icon: "i-lucide-radar",
|
|
321
|
+
meta: { excerpt: "Live numbers from public APIs, fetched and cached by this site's own server." },
|
|
322
|
+
children: [
|
|
323
|
+
// Real, keyless references so a fresh deployment shows genuine figures
|
|
324
|
+
// rather than an empty grid — and so a broken adapter is visible on the
|
|
325
|
+
// first boot rather than the first time an owner tries one.
|
|
326
|
+
{
|
|
327
|
+
label: "nuxt/nuxt",
|
|
328
|
+
type: "doc",
|
|
329
|
+
meta: { provider: "github-repo", ref: "nuxt/nuxt" }
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
label: "yjs",
|
|
333
|
+
type: "doc",
|
|
334
|
+
meta: { provider: "npm", ref: "yjs" }
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (typeIds.window) {
|
|
340
|
+
nodes.push({
|
|
341
|
+
label: "Console",
|
|
342
|
+
type: typeIds.window,
|
|
343
|
+
icon: "i-lucide-app-window",
|
|
344
|
+
meta: {
|
|
345
|
+
excerpt: "A pretend app, genuinely multiplayer. Open it in two tabs.",
|
|
346
|
+
windowUrl: "example.com/console"
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
if (typeIds.mosaic) {
|
|
351
|
+
nodes.push({
|
|
352
|
+
label: "Mosaic",
|
|
353
|
+
type: typeIds.mosaic,
|
|
354
|
+
icon: "i-lucide-layout-dashboard",
|
|
355
|
+
meta: { excerpt: "A page composed of other pages. Drag the tiles; drag pages in." },
|
|
356
|
+
children: [
|
|
357
|
+
// `paneRefLabel` is resolved to a real `paneDoc` id after the plan is
|
|
358
|
+
// built — see `linkPaneRefs`. A seeded mosaic that points at nothing
|
|
359
|
+
// would demonstrate the layout and hide the actual feature.
|
|
360
|
+
{
|
|
361
|
+
label: "Writing",
|
|
362
|
+
type: "doc",
|
|
363
|
+
meta: { paneRefLabel: "Writing", paneSpan: { c: 6, r: 3 } }
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
label: "Now",
|
|
367
|
+
type: "doc",
|
|
368
|
+
meta: { paneRefLabel: "Live", paneSpan: { c: 6, r: 3 } }
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
label: "Here now",
|
|
372
|
+
type: "doc",
|
|
373
|
+
meta: { paneWidget: "presence", paneSpan: { c: 3, r: 1 } }
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
label: "Clock",
|
|
377
|
+
type: "doc",
|
|
378
|
+
meta: { paneWidget: "clock", paneSpan: { c: 3, r: 1 } }
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
// No `paneDoc`: a pane with none renders ITSELF, so this is a text
|
|
382
|
+
// tile drawn by the very same code path as the embeds.
|
|
383
|
+
label: "About this page",
|
|
384
|
+
type: "doc",
|
|
385
|
+
meta: { paneSpan: { c: 6, r: 1 } },
|
|
386
|
+
body: "Every tile here is a document rendered by its own page type. Drag one to rearrange, drag its corner to resize, or drag a page in from the navigation."
|
|
387
|
+
}
|
|
388
|
+
]
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
nodes.push({
|
|
392
|
+
label: "Colophon",
|
|
393
|
+
type: "doc",
|
|
394
|
+
icon: "i-lucide-info",
|
|
395
|
+
meta: { excerpt: "How this site is built." },
|
|
396
|
+
body: "Every page here is a document in a tree. Navigation, routing, search and feeds are all derived from that tree \u2014 nothing is hard-coded."
|
|
397
|
+
});
|
|
398
|
+
return nodes;
|
|
399
|
+
}
|
|
400
|
+
export default defineNitroPlugin((nitroApp) => {
|
|
401
|
+
const seed = useRuntimeConfig().jun?.seed;
|
|
402
|
+
if (!seed || seed.enabled === false) return;
|
|
403
|
+
nitroApp.hooks.hook("abracadabra:before-runners", () => {
|
|
404
|
+
registerServerPlugin({
|
|
405
|
+
name: "jun:bootstrap",
|
|
406
|
+
serverRunners: [
|
|
407
|
+
{
|
|
408
|
+
name: "jun:bootstrap",
|
|
409
|
+
start(ctx) {
|
|
410
|
+
const timer = setTimeout(() => {
|
|
411
|
+
void bootstrap(ctx, seed).catch((err) => {
|
|
412
|
+
console.warn("[jun:bootstrap] failed:", err?.message ?? err);
|
|
413
|
+
});
|
|
414
|
+
}, BOOT_DELAY_MS);
|
|
415
|
+
return () => clearTimeout(timer);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
});
|
|
420
|
+
});
|
|
421
|
+
});
|
|
422
|
+
async function bootstrap(ctx, seed) {
|
|
423
|
+
const rootId = ctx.rootDocId;
|
|
424
|
+
const typeIds = useRuntimeConfig().public.jun?.typeIds ?? {};
|
|
425
|
+
const nodes = !seed.tree || seed.tree === "default" ? defaultTree(typeIds) : seed.tree;
|
|
426
|
+
if (!nodes.length) return;
|
|
427
|
+
const ydoc = new Y.Doc();
|
|
428
|
+
const provider = new AbracadabraProvider({
|
|
429
|
+
name: rootId,
|
|
430
|
+
// The casts are the TWO-YJS-COPIES hazard showing up at the type level:
|
|
431
|
+
// this file resolves `yjs` through @abraca/nuxt while `@abraca/dabra`
|
|
432
|
+
// brings its own, so the two `Y.Doc` types are structurally identical but
|
|
433
|
+
// nominally different. At RUNTIME the workspace `pnpm.overrides` pin them
|
|
434
|
+
// to one copy, which is what makes this safe — if that pin is ever lost,
|
|
435
|
+
// `instanceof Y.Map` starts returning false everywhere and the cache
|
|
436
|
+
// silently empties. See CLAUDE.md, "Dependency hazards".
|
|
437
|
+
document: ydoc,
|
|
438
|
+
client: ctx.client,
|
|
439
|
+
disableOfflineStore: true,
|
|
440
|
+
subdocLoading: "lazy"
|
|
441
|
+
});
|
|
442
|
+
try {
|
|
443
|
+
if (!provider.isSynced) {
|
|
444
|
+
await new Promise((resolve, reject) => {
|
|
445
|
+
const t = setTimeout(() => reject(new Error("root sync timeout")), SYNC_TIMEOUT_MS);
|
|
446
|
+
provider.on("synced", () => {
|
|
447
|
+
clearTimeout(t);
|
|
448
|
+
resolve();
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
const tree = ydoc.getMap("doc-tree");
|
|
453
|
+
let hasContent = false;
|
|
454
|
+
tree.forEach((e) => {
|
|
455
|
+
const entry = plain(e);
|
|
456
|
+
if (!entry || entry.trashed) return;
|
|
457
|
+
if (entry.parentId === rootId && entry.meta?.siteConfig !== true) hasContent = true;
|
|
458
|
+
});
|
|
459
|
+
if (hasContent) {
|
|
460
|
+
console.log("[jun:bootstrap] root already has content \u2014 skipping seed");
|
|
461
|
+
repairIconFormat(ydoc, tree);
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
console.log("[jun:bootstrap] empty root \u2014 seeding starter content");
|
|
465
|
+
const now = Date.now();
|
|
466
|
+
const plan = nodes.map(toPlan);
|
|
467
|
+
linkPaneRefs(plan);
|
|
468
|
+
ydoc.transact(() => {
|
|
469
|
+
if (!tree.get(rootId)) {
|
|
470
|
+
tree.set(rootId, {
|
|
471
|
+
label: seed.root?.label ?? "",
|
|
472
|
+
type: seed.root?.type ?? "doc",
|
|
473
|
+
parentId: null,
|
|
474
|
+
order: now,
|
|
475
|
+
createdAt: now,
|
|
476
|
+
updatedAt: now,
|
|
477
|
+
meta: { ...seed.root?.meta ?? {} }
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
let order = now + 1;
|
|
481
|
+
const write = (node, parentId) => {
|
|
482
|
+
tree.set(node.id, {
|
|
483
|
+
label: node.label,
|
|
484
|
+
type: node.type,
|
|
485
|
+
parentId,
|
|
486
|
+
order: order++,
|
|
487
|
+
createdAt: now,
|
|
488
|
+
updatedAt: now,
|
|
489
|
+
meta: withNormalisedIcon(node.meta)
|
|
490
|
+
});
|
|
491
|
+
for (const child of node.children) write(child, node.id);
|
|
492
|
+
};
|
|
493
|
+
for (const node of plan) write(node, rootId);
|
|
494
|
+
});
|
|
495
|
+
const lastId = plan[plan.length - 1].id;
|
|
496
|
+
const shared = ctx.rootDoc.getMap("doc-tree");
|
|
497
|
+
await new Promise((resolve) => {
|
|
498
|
+
if (shared.get(lastId)) return resolve();
|
|
499
|
+
const timer = setTimeout(() => {
|
|
500
|
+
shared.unobserve(check);
|
|
501
|
+
console.warn(
|
|
502
|
+
"[jun:bootstrap] seed did not echo back \u2014 does the runner identity have write access?"
|
|
503
|
+
);
|
|
504
|
+
resolve();
|
|
505
|
+
}, ECHO_TIMEOUT_MS);
|
|
506
|
+
const check = () => {
|
|
507
|
+
if (!shared.get(lastId)) return;
|
|
508
|
+
clearTimeout(timer);
|
|
509
|
+
shared.unobserve(check);
|
|
510
|
+
resolve();
|
|
511
|
+
};
|
|
512
|
+
shared.observe(check);
|
|
513
|
+
});
|
|
514
|
+
const flat = [];
|
|
515
|
+
const collect = (n) => {
|
|
516
|
+
flat.push(n);
|
|
517
|
+
n.children.forEach(collect);
|
|
518
|
+
};
|
|
519
|
+
plan.forEach(collect);
|
|
520
|
+
for (const node of flat) {
|
|
521
|
+
try {
|
|
522
|
+
await ctx.client.createChild(rootId, {
|
|
523
|
+
child_id: node.id,
|
|
524
|
+
label: node.label,
|
|
525
|
+
// The REAL page type. Server-side listings, the admin TUI and every
|
|
526
|
+
// non-CRDT consumer read this column; a tree where every row claims
|
|
527
|
+
// to be a plain document is a lie that surfaces as "Document" next
|
|
528
|
+
// to every seeded page.
|
|
529
|
+
doc_type: node.type
|
|
530
|
+
});
|
|
531
|
+
} catch (err) {
|
|
532
|
+
const msg = err?.message ?? String(err);
|
|
533
|
+
if (/409|already exists|conflict/i.test(msg)) continue;
|
|
534
|
+
console.warn(`[jun:bootstrap] register ${node.label} (${node.id}) failed:`, msg);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
await writeBodies(ctx, flat);
|
|
538
|
+
console.log(`[jun:bootstrap] seeded ${flat.length} documents \u2014 site is live`);
|
|
539
|
+
} finally {
|
|
540
|
+
try {
|
|
541
|
+
provider.destroy();
|
|
542
|
+
} catch {
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
function attachJsonNodes(target, nodes) {
|
|
547
|
+
for (const node of nodes) {
|
|
548
|
+
if (node.kind === "element") {
|
|
549
|
+
const el = new Y.XmlElement(node.tag);
|
|
550
|
+
target.insert(target.length, [el]);
|
|
551
|
+
for (const [k, v] of Object.entries(node.attrs ?? {})) {
|
|
552
|
+
el.setAttribute(k, v);
|
|
553
|
+
}
|
|
554
|
+
attachJsonNodes(el, node.children);
|
|
555
|
+
} else {
|
|
556
|
+
const text = new Y.XmlText();
|
|
557
|
+
target.insert(target.length, [text]);
|
|
558
|
+
let offset = 0;
|
|
559
|
+
for (const run of node.runs) {
|
|
560
|
+
if (run.attributes) text.insert(offset, run.insert, run.attributes);
|
|
561
|
+
else text.insert(offset, run.insert);
|
|
562
|
+
offset += run.insert.length;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
async function writeBodies(ctx, flat) {
|
|
568
|
+
const withBody = flat.filter((n) => typeof n.meta.body === "string" && n.meta.body);
|
|
569
|
+
if (!withBody.length) return;
|
|
570
|
+
let written = 0;
|
|
571
|
+
for (let i = 0; i < withBody.length; i += BODY_CONCURRENCY) {
|
|
572
|
+
await Promise.all(
|
|
573
|
+
withBody.slice(i, i + BODY_CONCURRENCY).map(async (node) => {
|
|
574
|
+
const ydoc = new Y.Doc({ guid: node.id });
|
|
575
|
+
const provider = new AbracadabraProvider({
|
|
576
|
+
name: node.id,
|
|
577
|
+
document: ydoc,
|
|
578
|
+
client: ctx.client,
|
|
579
|
+
disableOfflineStore: true,
|
|
580
|
+
subdocLoading: "lazy"
|
|
581
|
+
});
|
|
582
|
+
try {
|
|
583
|
+
if (!provider.isSynced) {
|
|
584
|
+
await new Promise((resolve, reject) => {
|
|
585
|
+
const t = setTimeout(() => reject(new Error("sync timeout")), SYNC_TIMEOUT_MS);
|
|
586
|
+
provider.on("synced", () => {
|
|
587
|
+
clearTimeout(t);
|
|
588
|
+
resolve();
|
|
589
|
+
});
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
const fragment = ydoc.getXmlFragment("default");
|
|
593
|
+
if (fragment.length > 0) return;
|
|
594
|
+
const { header, meta, body } = markdownToFragmentNodes(
|
|
595
|
+
String(node.meta.body),
|
|
596
|
+
node.label
|
|
597
|
+
);
|
|
598
|
+
ydoc.transact(() => {
|
|
599
|
+
attachJsonNodes(fragment, [
|
|
600
|
+
...header ? [header] : [],
|
|
601
|
+
...meta ? [meta] : [],
|
|
602
|
+
...body
|
|
603
|
+
]);
|
|
604
|
+
});
|
|
605
|
+
written++;
|
|
606
|
+
unobserveDoc(node.id);
|
|
607
|
+
observeDoc(node.id, ydoc);
|
|
608
|
+
} catch (err) {
|
|
609
|
+
console.warn(
|
|
610
|
+
`[jun:bootstrap] body for ${node.label} (${node.id}) failed:`,
|
|
611
|
+
err?.message ?? err
|
|
612
|
+
);
|
|
613
|
+
} finally {
|
|
614
|
+
await new Promise((r) => setTimeout(r, BODY_FLUSH_MS));
|
|
615
|
+
try {
|
|
616
|
+
provider.destroy();
|
|
617
|
+
} catch {
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
})
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
if (written) console.log(`[jun:bootstrap] wrote ${written} document bodies`);
|
|
624
|
+
}
|
|
625
|
+
function linkPaneRefs(plan) {
|
|
626
|
+
const byLabel = new Map(plan.map((node) => [node.label, node.id]));
|
|
627
|
+
const walk = (node) => {
|
|
628
|
+
const ref = node.meta.paneRefLabel;
|
|
629
|
+
if (typeof ref === "string") {
|
|
630
|
+
const target = byLabel.get(ref);
|
|
631
|
+
if (target) node.meta.paneDoc = target;
|
|
632
|
+
delete node.meta.paneRefLabel;
|
|
633
|
+
}
|
|
634
|
+
node.children.forEach(walk);
|
|
635
|
+
};
|
|
636
|
+
plan.forEach(walk);
|
|
637
|
+
}
|
|
638
|
+
function toPlan(node) {
|
|
639
|
+
const meta = { ...node.meta ?? {} };
|
|
640
|
+
if (node.icon) meta.icon = node.icon;
|
|
641
|
+
if (node.body) {
|
|
642
|
+
meta.body = node.body;
|
|
643
|
+
meta.bodyIsMirror = true;
|
|
644
|
+
}
|
|
645
|
+
return {
|
|
646
|
+
id: crypto.randomUUID(),
|
|
647
|
+
label: node.label,
|
|
648
|
+
type: node.type,
|
|
649
|
+
meta,
|
|
650
|
+
children: (node.children ?? []).map(toPlan)
|
|
651
|
+
};
|
|
652
|
+
}
|