@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,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useJunGroupedDnD — drag and drop for renderers whose list is SECTIONED.
|
|
3
|
+
*
|
|
4
|
+
* `useJunListDnD` handles a flat list: one container, one order. The gear list
|
|
5
|
+
* and the reading list are not that shape — their items are bucketed by a meta
|
|
6
|
+
* value (`meta.category`, `meta.status`) and the sections ARE the structure.
|
|
7
|
+
* Both shipped with the comment "not reorderable, position carries no meaning",
|
|
8
|
+
* which was true of position and false of the thing people actually want to do:
|
|
9
|
+
* **move an item to another shelf.**
|
|
10
|
+
*
|
|
11
|
+
* So this composable makes the GROUP the drop target. Dragging an item onto a
|
|
12
|
+
* section writes that section's value into the item's meta — a CRDT move, live
|
|
13
|
+
* for every peer — and dropping it among its own siblings reorders within the
|
|
14
|
+
* section. One gesture does both, and which one happened is decided by where
|
|
15
|
+
* the pointer let go, not by a mode.
|
|
16
|
+
*
|
|
17
|
+
* Everything else matches `useJunListDnD` exactly, because a renderer must not
|
|
18
|
+
* behave differently depending on which composable it happens to use:
|
|
19
|
+
*
|
|
20
|
+
* - items are HTML5 drag sources carrying `application/x-abracadabra-doc`, so
|
|
21
|
+
* they drop into the navbar, the tree, a sub-page list or the editor;
|
|
22
|
+
* - the container accepts documents from any other surface and reparents them;
|
|
23
|
+
* - slot geometry is measured with the item's CURRENT TRANSFORM SUBTRACTED,
|
|
24
|
+
* because `getBoundingClientRect()` reports mid-flight rects during a FLIP
|
|
25
|
+
* move and nearest-slot maths would otherwise oscillate against its own
|
|
26
|
+
* animation.
|
|
27
|
+
*/
|
|
28
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
29
|
+
import type { JunTreeEntryValue } from '../types.js';
|
|
30
|
+
export interface JunGroupedEntry {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
type?: string;
|
|
34
|
+
meta?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
interface JunGroupedDnDOptions<T extends JunGroupedEntry> {
|
|
37
|
+
/** `useChildTree(abra.doc, containerDocId)`. */
|
|
38
|
+
tree: {
|
|
39
|
+
treeMap: {
|
|
40
|
+
get: (id: string) => JunTreeEntryValue | undefined;
|
|
41
|
+
set: (id: string, v: JunTreeEntryValue) => unknown;
|
|
42
|
+
};
|
|
43
|
+
moveEntry: (id: string, parentId: string | null, order: number) => void;
|
|
44
|
+
updateMeta: (id: string, patch: Record<string, unknown>) => void;
|
|
45
|
+
};
|
|
46
|
+
/** The container document the sections belong to. */
|
|
47
|
+
containerDocId: string;
|
|
48
|
+
/** The canonical, sorted children — flat, across every section. */
|
|
49
|
+
items: Ref<T[]> | ComputedRef<T[]>;
|
|
50
|
+
/** The element wrapping ALL the sections. */
|
|
51
|
+
containerEl: Ref<HTMLElement | null>;
|
|
52
|
+
/** The meta key the sections bucket on — `'category'`, `'status'`. */
|
|
53
|
+
groupKey: string;
|
|
54
|
+
/**
|
|
55
|
+
* The group value written for a section whose displayed name means "no
|
|
56
|
+
* value" — the "Other"/"Unsorted" bucket. Returning `undefined` CLEARS the
|
|
57
|
+
* key, which is what keeps an uncategorised item uncategorised rather than
|
|
58
|
+
* literally categorised as "Other".
|
|
59
|
+
*/
|
|
60
|
+
groupValueFor?: (sectionName: string) => string | undefined;
|
|
61
|
+
/** Lucide icon for the drag-bus ghost. */
|
|
62
|
+
ghostIconFor?: (entry: T) => string;
|
|
63
|
+
}
|
|
64
|
+
export declare function useJunGroupedDnD<T extends JunGroupedEntry>(opts: JunGroupedDnDOptions<T>): {
|
|
65
|
+
orderedItems: Ref<T[], T[]>;
|
|
66
|
+
dragId: Ref<string | null, string | null>;
|
|
67
|
+
hoverGroup: Ref<string | null, string | null>;
|
|
68
|
+
onItemDragStart: (entry: T, e: DragEvent) => void;
|
|
69
|
+
onItemDragEnd: (e: DragEvent) => void;
|
|
70
|
+
onGroupDragOver: (section: string, e: DragEvent) => void;
|
|
71
|
+
onGroupDragLeave: (e: DragEvent) => void;
|
|
72
|
+
onGroupDrop: (section: string, e: DragEvent) => void;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { nextTick, onMounted, ref, watch } from "vue";
|
|
2
|
+
import { useDocDragBus } from "#imports";
|
|
3
|
+
import { DOC_DRAG_MIME } from "./useJunListDnD.js";
|
|
4
|
+
import { useJunStudio } from "./useJunStudio.js";
|
|
5
|
+
export function useJunGroupedDnD(opts) {
|
|
6
|
+
const { editing } = useJunStudio();
|
|
7
|
+
const dragBus = useDocDragBus();
|
|
8
|
+
const dragId = ref(null);
|
|
9
|
+
const hoverGroup = ref(null);
|
|
10
|
+
const orderedItems = ref([...opts.items.value]);
|
|
11
|
+
watch(
|
|
12
|
+
opts.items,
|
|
13
|
+
(n) => {
|
|
14
|
+
if (!dragId.value) orderedItems.value = [...n];
|
|
15
|
+
},
|
|
16
|
+
{ deep: true }
|
|
17
|
+
);
|
|
18
|
+
function resync() {
|
|
19
|
+
void nextTick(() => {
|
|
20
|
+
if (!dragId.value) orderedItems.value = [...opts.items.value];
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
let dragStartOrder = [];
|
|
24
|
+
let orderPersisted = false;
|
|
25
|
+
let blankDragImage = null;
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
blankDragImage = new Image(1, 1);
|
|
28
|
+
blankDragImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
29
|
+
});
|
|
30
|
+
const hasDocDrag = (e) => !!e.dataTransfer?.types.includes(DOC_DRAG_MIME);
|
|
31
|
+
const hasFileDrag = (e) => !!e.dataTransfer?.types.includes("Files");
|
|
32
|
+
const groupValue = (section) => opts.groupValueFor ? opts.groupValueFor(section) : section;
|
|
33
|
+
function slotCenter(el) {
|
|
34
|
+
const r = el.getBoundingClientRect();
|
|
35
|
+
let tx = 0;
|
|
36
|
+
let ty = 0;
|
|
37
|
+
const t = getComputedStyle(el).transform;
|
|
38
|
+
if (t && t !== "none") {
|
|
39
|
+
try {
|
|
40
|
+
const m = new DOMMatrixReadOnly(t);
|
|
41
|
+
tx = m.e;
|
|
42
|
+
ty = m.f;
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return { x: r.left + r.width / 2 - tx, y: r.top + r.height / 2 - ty };
|
|
47
|
+
}
|
|
48
|
+
function reorderWithin(sectionEl, x, y) {
|
|
49
|
+
const dragIdx = orderedItems.value.findIndex((n) => n.id === dragId.value);
|
|
50
|
+
if (dragIdx < 0) return;
|
|
51
|
+
for (const el of Array.from(sectionEl.querySelectorAll("[data-dnd-id]"))) {
|
|
52
|
+
const id = el.dataset.dndId;
|
|
53
|
+
if (!id || id === dragId.value) continue;
|
|
54
|
+
const idx = orderedItems.value.findIndex((n) => n.id === id);
|
|
55
|
+
if (idx < 0) continue;
|
|
56
|
+
const c = slotCenter(el);
|
|
57
|
+
const r = el.getBoundingClientRect();
|
|
58
|
+
const [pos, mid] = r.width > r.height * 2 ? [x, c.x] : [y, c.y];
|
|
59
|
+
if (idx > dragIdx && pos > mid || idx < dragIdx && pos < mid) {
|
|
60
|
+
const [moving] = orderedItems.value.splice(dragIdx, 1);
|
|
61
|
+
orderedItems.value.splice(idx, 0, moving);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function draggedIsIn(sectionEl) {
|
|
67
|
+
const id = dragId.value;
|
|
68
|
+
if (!id) return false;
|
|
69
|
+
return !!sectionEl.querySelector(`[data-dnd-id="${CSS.escape(id)}"]`);
|
|
70
|
+
}
|
|
71
|
+
function onItemDragStart(entry, e) {
|
|
72
|
+
if (!editing.value) {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
dragId.value = entry.id;
|
|
77
|
+
dragStartOrder = [...orderedItems.value];
|
|
78
|
+
orderPersisted = false;
|
|
79
|
+
if (e.dataTransfer) {
|
|
80
|
+
e.dataTransfer.effectAllowed = "all";
|
|
81
|
+
e.dataTransfer.setData("text/plain", entry.id);
|
|
82
|
+
e.dataTransfer.setData(DOC_DRAG_MIME, JSON.stringify({ id: entry.id, label: entry.label }));
|
|
83
|
+
if (blankDragImage) e.dataTransfer.setDragImage(blankDragImage, 0, 0);
|
|
84
|
+
}
|
|
85
|
+
dragBus.startDrag({
|
|
86
|
+
docIds: [entry.id],
|
|
87
|
+
labels: [entry.label],
|
|
88
|
+
icons: [opts.ghostIconFor?.(entry) ?? "i-lucide-file-text"],
|
|
89
|
+
source: "renderer",
|
|
90
|
+
sourceDocId: opts.containerDocId,
|
|
91
|
+
pointer: { x: e.clientX, y: e.clientY }
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function onItemDragEnd(e) {
|
|
95
|
+
if (dragId.value && !orderPersisted && e.dataTransfer?.dropEffect === "none") {
|
|
96
|
+
orderedItems.value = [...dragStartOrder];
|
|
97
|
+
}
|
|
98
|
+
dragId.value = null;
|
|
99
|
+
hoverGroup.value = null;
|
|
100
|
+
dragBus.endDrag();
|
|
101
|
+
resync();
|
|
102
|
+
}
|
|
103
|
+
function onGroupDragOver(section, e) {
|
|
104
|
+
if (!editing.value) return;
|
|
105
|
+
if (dragId.value) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
|
|
108
|
+
dragBus.updatePointer(e.clientX, e.clientY);
|
|
109
|
+
hoverGroup.value = section;
|
|
110
|
+
const sectionEl = e.currentTarget;
|
|
111
|
+
if (!draggedIsIn(sectionEl)) return;
|
|
112
|
+
reorderWithin(sectionEl, e.clientX, e.clientY);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (hasDocDrag(e)) {
|
|
116
|
+
e.preventDefault();
|
|
117
|
+
if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
|
|
118
|
+
dragBus.updatePointer(e.clientX, e.clientY);
|
|
119
|
+
hoverGroup.value = section;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (hasFileDrag(e) && !e.defaultPrevented) {
|
|
123
|
+
e.preventDefault();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function onGroupDragLeave(e) {
|
|
127
|
+
const related = e.relatedTarget;
|
|
128
|
+
if (related && e.currentTarget.contains(related)) return;
|
|
129
|
+
hoverGroup.value = null;
|
|
130
|
+
}
|
|
131
|
+
function persistOrder() {
|
|
132
|
+
orderedItems.value.forEach((item, i) => {
|
|
133
|
+
const entry = opts.tree.treeMap.get(item.id);
|
|
134
|
+
if (entry) {
|
|
135
|
+
opts.tree.treeMap.set(item.id, { ...entry, order: (i + 1) * 1e3, updatedAt: Date.now() });
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
orderPersisted = true;
|
|
139
|
+
}
|
|
140
|
+
function onGroupDrop(section, e) {
|
|
141
|
+
if (!editing.value) return;
|
|
142
|
+
hoverGroup.value = null;
|
|
143
|
+
if (dragId.value) {
|
|
144
|
+
e.preventDefault();
|
|
145
|
+
const id2 = dragId.value;
|
|
146
|
+
const current = orderedItems.value.find((n) => n.id === id2);
|
|
147
|
+
const next = groupValue(section);
|
|
148
|
+
if (current && (current.meta?.[opts.groupKey] ?? void 0) !== next) {
|
|
149
|
+
opts.tree.updateMeta(id2, { [opts.groupKey]: next });
|
|
150
|
+
}
|
|
151
|
+
persistOrder();
|
|
152
|
+
resync();
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const raw = e.dataTransfer?.getData(DOC_DRAG_MIME);
|
|
156
|
+
if (!raw) {
|
|
157
|
+
if (hasFileDrag(e) && !e.defaultPrevented) e.preventDefault();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
e.preventDefault();
|
|
161
|
+
let payload;
|
|
162
|
+
try {
|
|
163
|
+
payload = JSON.parse(raw);
|
|
164
|
+
} catch {
|
|
165
|
+
payload = null;
|
|
166
|
+
}
|
|
167
|
+
const id = payload?.id;
|
|
168
|
+
if (!id || id === opts.containerDocId) return;
|
|
169
|
+
if (!opts.tree.treeMap.get(id)) return;
|
|
170
|
+
opts.tree.moveEntry(id, null, Date.now());
|
|
171
|
+
const moved = opts.tree.treeMap.get(id);
|
|
172
|
+
if (!moved || moved.parentId !== opts.containerDocId) return;
|
|
173
|
+
opts.tree.updateMeta(id, { [opts.groupKey]: groupValue(section) });
|
|
174
|
+
resync();
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
orderedItems,
|
|
178
|
+
dragId,
|
|
179
|
+
hoverGroup,
|
|
180
|
+
onItemDragStart,
|
|
181
|
+
onItemDragEnd,
|
|
182
|
+
onGroupDragOver,
|
|
183
|
+
onGroupDragLeave,
|
|
184
|
+
onGroupDrop
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface JunPopupMedia {
|
|
2
|
+
/** Content-addressed upload: the document that owns the blob… */
|
|
3
|
+
docId?: string;
|
|
4
|
+
uploadId?: string;
|
|
5
|
+
mime?: string;
|
|
6
|
+
/** …or a plain URL. */
|
|
7
|
+
url?: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface JunPopupState {
|
|
11
|
+
items: JunPopupMedia[];
|
|
12
|
+
index: number;
|
|
13
|
+
/** The `<img>` the popup morphed out of — and the morph target on close. */
|
|
14
|
+
sourceEl: HTMLImageElement | null;
|
|
15
|
+
/** The source rect captured at open time, before any layout shift. */
|
|
16
|
+
sourceRect: DOMRect | null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Open the popup on `items[index]`, morphing out of the clicked element.
|
|
20
|
+
*
|
|
21
|
+
* > Opening and STEPPING are different animations. `state` carries the index,
|
|
22
|
+
* > so a naive implementation re-enters the open sequence on every arrow press
|
|
23
|
+
* > and each step fights a stray open-morph pulling the image back toward a
|
|
24
|
+
* > thumbnail somewhere up the page. `<JunImagePopup>`'s watcher recognises an
|
|
25
|
+
* > index-only change (same `items` array, same `sourceEl`) and leaves it
|
|
26
|
+
* > alone; `step()` animates the outgoing ghost and the incoming stage along
|
|
27
|
+
* > the IDENTICAL rect path while they cross-dissolve, so the box morphs
|
|
28
|
+
* > exactly once.
|
|
29
|
+
*/
|
|
30
|
+
declare function openImagePopup(source: Event | HTMLElement | null, items: JunPopupMedia[], index?: number): void;
|
|
31
|
+
declare function closeImagePopup(): void;
|
|
32
|
+
export declare function useJunImagePopup(): {
|
|
33
|
+
state: import("vue").ShallowRef<JunPopupState | null, JunPopupState | null>;
|
|
34
|
+
openImagePopup: typeof openImagePopup;
|
|
35
|
+
closeImagePopup: typeof closeImagePopup;
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { shallowRef } from "vue";
|
|
2
|
+
const state = shallowRef(null);
|
|
3
|
+
function resolveImg(source) {
|
|
4
|
+
const el = source instanceof Event ? source.currentTarget : source;
|
|
5
|
+
if (!el) return null;
|
|
6
|
+
if (el instanceof HTMLImageElement) return el;
|
|
7
|
+
return el.querySelector("img");
|
|
8
|
+
}
|
|
9
|
+
function openImagePopup(source, items, index = 0) {
|
|
10
|
+
if (!items.length) return;
|
|
11
|
+
const img = resolveImg(source);
|
|
12
|
+
state.value = {
|
|
13
|
+
items,
|
|
14
|
+
index: Math.min(Math.max(index, 0), items.length - 1),
|
|
15
|
+
sourceEl: img,
|
|
16
|
+
sourceRect: img?.getBoundingClientRect() ?? null
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function closeImagePopup() {
|
|
20
|
+
state.value = null;
|
|
21
|
+
}
|
|
22
|
+
export function useJunImagePopup() {
|
|
23
|
+
return { state, openImagePopup, closeImagePopup };
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type JunIntroPhase = 'intro' | 'reveal' | 'done';
|
|
2
|
+
export declare function useJunIntro(): {
|
|
3
|
+
phase: import("vue").Ref<JunIntroPhase, JunIntroPhase>;
|
|
4
|
+
navVeiled: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
contentVeiled: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
navLogoVeiled: import("vue").Ref<boolean, boolean>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useState } from "#imports";
|
|
2
|
+
export function useJunIntro() {
|
|
3
|
+
const phase = useState("jun-intro:phase", () => "intro");
|
|
4
|
+
const navVeiled = useState("jun-intro:nav", () => true);
|
|
5
|
+
const contentVeiled = useState("jun-intro:content", () => true);
|
|
6
|
+
const navLogoVeiled = useState("jun-intro:nav-logo", () => true);
|
|
7
|
+
return { phase, navVeiled, contentVeiled, navLogoVeiled };
|
|
8
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useJunListDnD — shared owner-mode drag-and-drop for every renderer showing a
|
|
3
|
+
* LIST OF TREE CHILDREN (the apps grid, link rows, journey stations, journal
|
|
4
|
+
* cards, live posts).
|
|
5
|
+
*
|
|
6
|
+
* One composable, so every surface speaks the same wire contract as the navbar,
|
|
7
|
+
* the document tree and the editor:
|
|
8
|
+
*
|
|
9
|
+
* - **drag OUT** — items are HTML5 drag sources carrying the
|
|
10
|
+
* `application/x-abracadabra-doc` payload plus the drag-bus ghost, so a
|
|
11
|
+
* journal card can be dropped onto a nav pill slot, into the editor as an
|
|
12
|
+
* embed, onto a sub-page list — anywhere a document drag is accepted.
|
|
13
|
+
* - **drop IN** — the container accepts document drags from any other surface
|
|
14
|
+
* and REPARENTS the document into itself. A CRDT move, live for every peer.
|
|
15
|
+
* - **reorder** — for containers whose order IS stored meta (`reorderable`),
|
|
16
|
+
* dragging an item over its siblings live-reorders a working copy, which the
|
|
17
|
+
* renderer's `TransitionGroup` FLIP-animates, and persists stepped orders on
|
|
18
|
+
* drop. Feeds sorted by date (journal, live, journey) skip this: their order
|
|
19
|
+
* is DERIVED, so persisting one would be meaningless.
|
|
20
|
+
*
|
|
21
|
+
* The reorder RULE itself lives in `junDndGeometry` and is shared with the
|
|
22
|
+
* grouped composable and the navbar's track, because it has exactly one correct
|
|
23
|
+
* shape and three copies of it drifted into two different bugs. See that file
|
|
24
|
+
* for why "nearest slot" flickers and the directional rule does not.
|
|
25
|
+
*/
|
|
26
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
27
|
+
import type { JunTreeEntryValue } from '../types.js';
|
|
28
|
+
export interface JunDndEntry {
|
|
29
|
+
id: string;
|
|
30
|
+
label: string;
|
|
31
|
+
type?: string;
|
|
32
|
+
meta?: Record<string, unknown>;
|
|
33
|
+
}
|
|
34
|
+
export declare const DOC_DRAG_MIME = "application/x-abracadabra-doc";
|
|
35
|
+
interface JunListDnDOptions<T extends JunDndEntry> {
|
|
36
|
+
/** `useChildTree(abra.doc, containerDocId)` — `moveEntry` and `treeMap` are used. */
|
|
37
|
+
tree: {
|
|
38
|
+
treeMap: {
|
|
39
|
+
get: (id: string) => JunTreeEntryValue | undefined;
|
|
40
|
+
set: (id: string, v: JunTreeEntryValue) => unknown;
|
|
41
|
+
};
|
|
42
|
+
moveEntry: (id: string, parentId: string | null, order: number) => void;
|
|
43
|
+
};
|
|
44
|
+
/** The container document the list belongs to. A drop reparents into it. */
|
|
45
|
+
containerDocId: string;
|
|
46
|
+
/** The canonical, sorted children the renderer displays. */
|
|
47
|
+
items: Ref<T[]> | ComputedRef<T[]>;
|
|
48
|
+
/** The element holding the item nodes, each tagged `data-dnd-id`. */
|
|
49
|
+
containerEl: Ref<HTMLElement | null>;
|
|
50
|
+
/** True when a STORED `order` drives the list. */
|
|
51
|
+
reorderable?: boolean;
|
|
52
|
+
/** Lucide icon for the drag-bus ghost. */
|
|
53
|
+
ghostIconFor?: (entry: T) => string;
|
|
54
|
+
}
|
|
55
|
+
export declare function useJunListDnD<T extends JunDndEntry>(opts: JunListDnDOptions<T>): {
|
|
56
|
+
orderedItems: Ref<T[], T[]>;
|
|
57
|
+
dragId: Ref<string | null, string | null>;
|
|
58
|
+
externalHover: Ref<boolean, boolean>;
|
|
59
|
+
onItemDragStart: (entry: T, e: DragEvent) => void;
|
|
60
|
+
onItemDragEnd: (e: DragEvent) => void;
|
|
61
|
+
onContainerDragOver: (e: DragEvent) => void;
|
|
62
|
+
onContainerDragLeave: (e: DragEvent) => void;
|
|
63
|
+
onContainerDrop: (e: DragEvent) => void;
|
|
64
|
+
};
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { nextTick, onMounted, ref, watch } from "vue";
|
|
2
|
+
import { useDocDragBus } from "#imports";
|
|
3
|
+
import { junNearestSlotIndex, junReorderStep } from "../utils/junDndGeometry.js";
|
|
4
|
+
import { useJunStudio } from "./useJunStudio.js";
|
|
5
|
+
export const DOC_DRAG_MIME = "application/x-abracadabra-doc";
|
|
6
|
+
export function useJunListDnD(opts) {
|
|
7
|
+
const { editing } = useJunStudio();
|
|
8
|
+
const dragBus = useDocDragBus();
|
|
9
|
+
const dragId = ref(null);
|
|
10
|
+
const externalHover = ref(false);
|
|
11
|
+
const orderedItems = ref([...opts.items.value]);
|
|
12
|
+
watch(
|
|
13
|
+
opts.items,
|
|
14
|
+
(n) => {
|
|
15
|
+
if (!dragId.value) orderedItems.value = [...n];
|
|
16
|
+
},
|
|
17
|
+
{ deep: true }
|
|
18
|
+
);
|
|
19
|
+
function resync() {
|
|
20
|
+
void nextTick(() => {
|
|
21
|
+
if (!dragId.value) orderedItems.value = [...opts.items.value];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
let dragStartOrder = [];
|
|
25
|
+
let orderPersisted = false;
|
|
26
|
+
let blankDragImage = null;
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
blankDragImage = new Image(1, 1);
|
|
29
|
+
blankDragImage.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
30
|
+
});
|
|
31
|
+
const hasDocDrag = (e) => !!e.dataTransfer?.types.includes(DOC_DRAG_MIME);
|
|
32
|
+
const hasFileDrag = (e) => !!e.dataTransfer?.types.includes("Files");
|
|
33
|
+
function slotEls() {
|
|
34
|
+
const c = opts.containerEl.value;
|
|
35
|
+
return c ? Array.from(c.querySelectorAll("[data-dnd-id]")) : [];
|
|
36
|
+
}
|
|
37
|
+
const orderIds = () => orderedItems.value.map((i) => i.id);
|
|
38
|
+
function onItemDragStart(entry, e) {
|
|
39
|
+
if (!editing.value) {
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
dragId.value = entry.id;
|
|
44
|
+
dragStartOrder = [...orderedItems.value];
|
|
45
|
+
orderPersisted = false;
|
|
46
|
+
if (e.dataTransfer) {
|
|
47
|
+
e.dataTransfer.effectAllowed = "all";
|
|
48
|
+
e.dataTransfer.setData("text/plain", entry.id);
|
|
49
|
+
e.dataTransfer.setData(DOC_DRAG_MIME, JSON.stringify({ id: entry.id, label: entry.label }));
|
|
50
|
+
if (blankDragImage) e.dataTransfer.setDragImage(blankDragImage, 0, 0);
|
|
51
|
+
}
|
|
52
|
+
dragBus.startDrag({
|
|
53
|
+
docIds: [entry.id],
|
|
54
|
+
labels: [entry.label],
|
|
55
|
+
icons: [opts.ghostIconFor?.(entry) ?? "i-lucide-file-text"],
|
|
56
|
+
source: "renderer",
|
|
57
|
+
sourceDocId: opts.containerDocId,
|
|
58
|
+
pointer: { x: e.clientX, y: e.clientY }
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function onItemDragEnd(e) {
|
|
62
|
+
if (dragId.value && !orderPersisted && e.dataTransfer?.dropEffect === "none") {
|
|
63
|
+
orderedItems.value = [...dragStartOrder];
|
|
64
|
+
}
|
|
65
|
+
dragId.value = null;
|
|
66
|
+
dragBus.endDrag();
|
|
67
|
+
resync();
|
|
68
|
+
}
|
|
69
|
+
function onContainerDragOver(e) {
|
|
70
|
+
if (!editing.value) return;
|
|
71
|
+
if (dragId.value) {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
|
|
74
|
+
dragBus.updatePointer(e.clientX, e.clientY);
|
|
75
|
+
if (!opts.reorderable) return;
|
|
76
|
+
const step = junReorderStep(orderIds(), dragId.value, slotEls(), e.clientX, e.clientY);
|
|
77
|
+
if (step) {
|
|
78
|
+
const [moving] = orderedItems.value.splice(step.from, 1);
|
|
79
|
+
orderedItems.value.splice(step.to, 0, moving);
|
|
80
|
+
}
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (hasDocDrag(e)) {
|
|
84
|
+
e.preventDefault();
|
|
85
|
+
if (e.dataTransfer) e.dataTransfer.dropEffect = "move";
|
|
86
|
+
dragBus.updatePointer(e.clientX, e.clientY);
|
|
87
|
+
externalHover.value = true;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (hasFileDrag(e) && !e.defaultPrevented) {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function onContainerDragLeave(e) {
|
|
95
|
+
const related = e.relatedTarget;
|
|
96
|
+
if (related && e.currentTarget.contains(related)) return;
|
|
97
|
+
externalHover.value = false;
|
|
98
|
+
}
|
|
99
|
+
function persistOrder() {
|
|
100
|
+
orderedItems.value.forEach((item, i) => {
|
|
101
|
+
const entry = opts.tree.treeMap.get(item.id);
|
|
102
|
+
if (entry) {
|
|
103
|
+
opts.tree.treeMap.set(item.id, { ...entry, order: (i + 1) * 1e3, updatedAt: Date.now() });
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
orderPersisted = true;
|
|
107
|
+
}
|
|
108
|
+
function onContainerDrop(e) {
|
|
109
|
+
if (!editing.value) return;
|
|
110
|
+
externalHover.value = false;
|
|
111
|
+
if (dragId.value) {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
if (opts.reorderable) persistOrder();
|
|
114
|
+
else orderPersisted = true;
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
const raw = e.dataTransfer?.getData(DOC_DRAG_MIME);
|
|
118
|
+
if (!raw) {
|
|
119
|
+
if (hasFileDrag(e) && !e.defaultPrevented) e.preventDefault();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
let payload;
|
|
124
|
+
try {
|
|
125
|
+
payload = JSON.parse(raw);
|
|
126
|
+
} catch {
|
|
127
|
+
payload = null;
|
|
128
|
+
}
|
|
129
|
+
const id = payload?.id;
|
|
130
|
+
if (!id || id === opts.containerDocId) return;
|
|
131
|
+
if (!opts.tree.treeMap.get(id)) return;
|
|
132
|
+
const insertAt = junNearestSlotIndex(orderIds(), slotEls(), e.clientX, e.clientY);
|
|
133
|
+
opts.tree.moveEntry(id, null, Date.now());
|
|
134
|
+
const moved = opts.tree.treeMap.get(id);
|
|
135
|
+
if (!moved || moved.parentId !== opts.containerDocId) return;
|
|
136
|
+
if (opts.reorderable) {
|
|
137
|
+
const withoutIt = orderedItems.value.filter((it) => it.id !== id);
|
|
138
|
+
const dropped = {
|
|
139
|
+
id,
|
|
140
|
+
label: moved.label ?? "Untitled",
|
|
141
|
+
type: moved.type,
|
|
142
|
+
meta: moved.meta
|
|
143
|
+
};
|
|
144
|
+
withoutIt.splice(Math.min(insertAt, withoutIt.length), 0, dropped);
|
|
145
|
+
orderedItems.value = withoutIt;
|
|
146
|
+
persistOrder();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return {
|
|
150
|
+
orderedItems,
|
|
151
|
+
dragId,
|
|
152
|
+
externalHover,
|
|
153
|
+
onItemDragStart,
|
|
154
|
+
onItemDragEnd,
|
|
155
|
+
onContainerDragOver,
|
|
156
|
+
onContainerDragLeave,
|
|
157
|
+
onContainerDrop
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface JunImportedMedia {
|
|
2
|
+
/** The new child document's id. */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Upload id, or `''` when the file block could not be read back. */
|
|
5
|
+
uploadId: string;
|
|
6
|
+
mimeType: string;
|
|
7
|
+
}
|
|
8
|
+
export interface JunImportMediaOptions {
|
|
9
|
+
/**
|
|
10
|
+
* The page type the new child should be — `typeIdFor('movie')` for a film,
|
|
11
|
+
* `typeIdFor('track')` for a track. Resolved by the CALLER, never a literal:
|
|
12
|
+
* a site may remap a type, and a hard-coded id creates children no renderer
|
|
13
|
+
* claims.
|
|
14
|
+
*/
|
|
15
|
+
type?: string;
|
|
16
|
+
/** Merged into the entry's meta in the same write — a status, a stage. */
|
|
17
|
+
meta?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
/** Does this file look like video, by MIME or — failing that — by extension? */
|
|
20
|
+
export declare function junIsVideoFile(file: File): boolean;
|
|
21
|
+
/** Does this file look like audio, by MIME or — failing that — by extension? */
|
|
22
|
+
export declare function junIsAudioFile(file: File): boolean;
|
|
23
|
+
export declare function useJunMediaImport(): {
|
|
24
|
+
importMedia: (file: File, parentId: string, opts?: JunImportMediaOptions) => Promise<JunImportedMedia | null>;
|
|
25
|
+
videoFiles: (source: DataTransfer | FileList | null | undefined) => File[];
|
|
26
|
+
audioFiles: (source: DataTransfer | FileList | null | undefined) => File[];
|
|
27
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useAbracadabra, useChildTree, useDocImport, useDocTree, useToast } from "#imports";
|
|
2
|
+
const VIDEO_EXTENSIONS = ["mkv", "m4v", "mov", "avi", "webm", "mp4", "mpg", "mpeg", "ogv"];
|
|
3
|
+
const AUDIO_EXTENSIONS = ["flac", "m4a", "aac", "opus", "oga", "wma", "aiff", "aif", "mp3", "wav", "ogg"];
|
|
4
|
+
function extensionOf(file) {
|
|
5
|
+
return file.name.split(".").pop()?.toLowerCase() ?? "";
|
|
6
|
+
}
|
|
7
|
+
export function junIsVideoFile(file) {
|
|
8
|
+
return file.type.startsWith("video/") || !file.type && VIDEO_EXTENSIONS.includes(extensionOf(file));
|
|
9
|
+
}
|
|
10
|
+
export function junIsAudioFile(file) {
|
|
11
|
+
return file.type.startsWith("audio/") || !file.type && AUDIO_EXTENSIONS.includes(extensionOf(file));
|
|
12
|
+
}
|
|
13
|
+
function findFileBlock(nodes, depth = 0) {
|
|
14
|
+
if (depth > 4) return null;
|
|
15
|
+
for (const node of nodes) {
|
|
16
|
+
const el = node;
|
|
17
|
+
if (el?.nodeName === "fileBlock") return el;
|
|
18
|
+
const children = typeof el?.toArray === "function" ? el.toArray() : null;
|
|
19
|
+
if (children?.length) {
|
|
20
|
+
const hit = findFileBlock(children, depth + 1);
|
|
21
|
+
if (hit) return hit;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export function useJunMediaImport() {
|
|
27
|
+
const abra = useAbracadabra();
|
|
28
|
+
const { importFile } = useDocImport();
|
|
29
|
+
const { getEntry } = useDocTree();
|
|
30
|
+
const toast = useToast();
|
|
31
|
+
async function importMedia(file, parentId, opts = {}) {
|
|
32
|
+
const mimeType = file.type || "application/octet-stream";
|
|
33
|
+
let id;
|
|
34
|
+
try {
|
|
35
|
+
id = await importFile(file, parentId);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
toast.add({
|
|
38
|
+
title: "Import failed",
|
|
39
|
+
description: err?.message || "The file could not be added.",
|
|
40
|
+
color: "error",
|
|
41
|
+
icon: "i-lucide-circle-x"
|
|
42
|
+
});
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
const tree = useChildTree(abra.doc, parentId);
|
|
46
|
+
let uploadId = "";
|
|
47
|
+
let uploadDocId = id;
|
|
48
|
+
try {
|
|
49
|
+
const provider = abra.provider.value;
|
|
50
|
+
const child = await provider?.loadChild?.(id);
|
|
51
|
+
const doc = child?.document;
|
|
52
|
+
const fragment = doc?.getXmlFragment?.("default");
|
|
53
|
+
const block = fragment?.toArray ? findFileBlock(fragment.toArray()) : null;
|
|
54
|
+
uploadId = block?.getAttribute?.("uploadId") ?? "";
|
|
55
|
+
uploadDocId = block?.getAttribute?.("docId") ?? id;
|
|
56
|
+
} catch {
|
|
57
|
+
}
|
|
58
|
+
const patch = { ...opts.meta ?? {} };
|
|
59
|
+
if (uploadId) {
|
|
60
|
+
patch.mediaUploadId = uploadId;
|
|
61
|
+
patch.mediaDocId = uploadDocId;
|
|
62
|
+
patch.mediaMimeType = mimeType;
|
|
63
|
+
}
|
|
64
|
+
const existing = getEntry(id)?.meta ?? {};
|
|
65
|
+
if (!existing.date) patch.date = (/* @__PURE__ */ new Date()).toISOString();
|
|
66
|
+
const entry = tree.treeMap.get(id);
|
|
67
|
+
if (entry) {
|
|
68
|
+
tree.treeMap.set(id, {
|
|
69
|
+
...entry,
|
|
70
|
+
...opts.type ? { type: opts.type } : {},
|
|
71
|
+
meta: { ...entry.meta ?? {}, ...patch },
|
|
72
|
+
updatedAt: Date.now()
|
|
73
|
+
});
|
|
74
|
+
} else if (Object.keys(patch).length) {
|
|
75
|
+
tree.updateMeta(id, patch);
|
|
76
|
+
}
|
|
77
|
+
return { id, uploadId, mimeType };
|
|
78
|
+
}
|
|
79
|
+
function videoFiles(source) {
|
|
80
|
+
return mediaFiles(source, junIsVideoFile);
|
|
81
|
+
}
|
|
82
|
+
function audioFiles(source) {
|
|
83
|
+
return mediaFiles(source, junIsAudioFile);
|
|
84
|
+
}
|
|
85
|
+
function mediaFiles(source, predicate) {
|
|
86
|
+
const files = source instanceof DataTransfer ? source.files : source;
|
|
87
|
+
return files ? Array.from(files).filter(predicate) : [];
|
|
88
|
+
}
|
|
89
|
+
return { importMedia, videoFiles, audioFiles };
|
|
90
|
+
}
|