@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.
Files changed (383) hide show
  1. package/README.md +594 -0
  2. package/dist/module.d.mts +158 -0
  3. package/dist/module.json +12 -0
  4. package/dist/module.mjs +957 -0
  5. package/dist/runtime/assets/css/jun.css +13 -0
  6. package/dist/runtime/components/JunAnnouncement.d.vue.ts +3 -0
  7. package/dist/runtime/components/JunAnnouncement.vue +88 -0
  8. package/dist/runtime/components/JunAnnouncement.vue.d.ts +3 -0
  9. package/dist/runtime/components/JunAppreciate.d.vue.ts +6 -0
  10. package/dist/runtime/components/JunAppreciate.vue +71 -0
  11. package/dist/runtime/components/JunAppreciate.vue.d.ts +6 -0
  12. package/dist/runtime/components/JunBackgroundPhoto.d.vue.ts +3 -0
  13. package/dist/runtime/components/JunBackgroundPhoto.vue +23 -0
  14. package/dist/runtime/components/JunBackgroundPhoto.vue.d.ts +3 -0
  15. package/dist/runtime/components/JunBlobBackdrop.client.d.vue.ts +3 -0
  16. package/dist/runtime/components/JunBlobBackdrop.client.vue +120 -0
  17. package/dist/runtime/components/JunBlobBackdrop.client.vue.d.ts +3 -0
  18. package/dist/runtime/components/JunBreadcrumbs.d.vue.ts +16 -0
  19. package/dist/runtime/components/JunBreadcrumbs.vue +63 -0
  20. package/dist/runtime/components/JunBreadcrumbs.vue.d.ts +16 -0
  21. package/dist/runtime/components/JunCampfireChat.d.vue.ts +14 -0
  22. package/dist/runtime/components/JunCampfireChat.vue +136 -0
  23. package/dist/runtime/components/JunCampfireChat.vue.d.ts +14 -0
  24. package/dist/runtime/components/JunCampfirePanel.d.vue.ts +33 -0
  25. package/dist/runtime/components/JunCampfirePanel.vue +202 -0
  26. package/dist/runtime/components/JunCampfirePanel.vue.d.ts +33 -0
  27. package/dist/runtime/components/JunCampfirePresence.client.d.vue.ts +3 -0
  28. package/dist/runtime/components/JunCampfirePresence.client.vue +321 -0
  29. package/dist/runtime/components/JunCampfirePresence.client.vue.d.ts +3 -0
  30. package/dist/runtime/components/JunCampfireRoster.d.vue.ts +19 -0
  31. package/dist/runtime/components/JunCampfireRoster.vue +259 -0
  32. package/dist/runtime/components/JunCampfireRoster.vue.d.ts +19 -0
  33. package/dist/runtime/components/JunCampfireYou.d.vue.ts +10 -0
  34. package/dist/runtime/components/JunCampfireYou.vue +157 -0
  35. package/dist/runtime/components/JunCampfireYou.vue.d.ts +10 -0
  36. package/dist/runtime/components/JunDocSurface.d.vue.ts +34 -0
  37. package/dist/runtime/components/JunDocSurface.vue +117 -0
  38. package/dist/runtime/components/JunDocSurface.vue.d.ts +34 -0
  39. package/dist/runtime/components/JunFestivalPlayer.client.d.vue.ts +3 -0
  40. package/dist/runtime/components/JunFestivalPlayer.client.vue +471 -0
  41. package/dist/runtime/components/JunFestivalPlayer.client.vue.d.ts +3 -0
  42. package/dist/runtime/components/JunFooter.d.vue.ts +3 -0
  43. package/dist/runtime/components/JunFooter.vue +102 -0
  44. package/dist/runtime/components/JunFooter.vue.d.ts +3 -0
  45. package/dist/runtime/components/JunGlobeEditor.client.d.vue.ts +43 -0
  46. package/dist/runtime/components/JunGlobeEditor.client.vue +315 -0
  47. package/dist/runtime/components/JunGlobeEditor.client.vue.d.ts +43 -0
  48. package/dist/runtime/components/JunGlobeMap.client.d.vue.ts +58 -0
  49. package/dist/runtime/components/JunGlobeMap.client.vue +495 -0
  50. package/dist/runtime/components/JunGlobeMap.client.vue.d.ts +58 -0
  51. package/dist/runtime/components/JunHead.d.vue.ts +3 -0
  52. package/dist/runtime/components/JunHead.vue +79 -0
  53. package/dist/runtime/components/JunHead.vue.d.ts +3 -0
  54. package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +0 -0
  55. package/dist/runtime/components/JunHorizontalTimeline.vue +363 -0
  56. package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +0 -0
  57. package/dist/runtime/components/JunImagePopup.client.d.vue.ts +3 -0
  58. package/dist/runtime/components/JunImagePopup.client.vue +422 -0
  59. package/dist/runtime/components/JunImagePopup.client.vue.d.ts +3 -0
  60. package/dist/runtime/components/JunIntro.d.vue.ts +3 -0
  61. package/dist/runtime/components/JunIntro.vue +156 -0
  62. package/dist/runtime/components/JunIntro.vue.d.ts +3 -0
  63. package/dist/runtime/components/JunItemMenu.d.vue.ts +50 -0
  64. package/dist/runtime/components/JunItemMenu.vue +97 -0
  65. package/dist/runtime/components/JunItemMenu.vue.d.ts +50 -0
  66. package/dist/runtime/components/JunLinksRow.d.vue.ts +19 -0
  67. package/dist/runtime/components/JunLinksRow.vue +96 -0
  68. package/dist/runtime/components/JunLinksRow.vue.d.ts +19 -0
  69. package/dist/runtime/components/JunLogo.d.vue.ts +15 -0
  70. package/dist/runtime/components/JunLogo.vue +360 -0
  71. package/dist/runtime/components/JunLogo.vue.d.ts +15 -0
  72. package/dist/runtime/components/JunMedia.client.d.vue.ts +40 -0
  73. package/dist/runtime/components/JunMedia.client.vue +117 -0
  74. package/dist/runtime/components/JunMedia.client.vue.d.ts +40 -0
  75. package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +24 -0
  76. package/dist/runtime/components/JunMosaicPane.client.vue +95 -0
  77. package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +24 -0
  78. package/dist/runtime/components/JunNavigation.d.vue.ts +26 -0
  79. package/dist/runtime/components/JunNavigation.vue +1149 -0
  80. package/dist/runtime/components/JunNavigation.vue.d.ts +26 -0
  81. package/dist/runtime/components/JunNodePanel.client.d.vue.ts +3 -0
  82. package/dist/runtime/components/JunNodePanel.client.vue +23 -0
  83. package/dist/runtime/components/JunNodePanel.client.vue.d.ts +3 -0
  84. package/dist/runtime/components/JunNotFound.d.vue.ts +7 -0
  85. package/dist/runtime/components/JunNotFound.vue +137 -0
  86. package/dist/runtime/components/JunNotFound.vue.d.ts +7 -0
  87. package/dist/runtime/components/JunPageHero.d.vue.ts +25 -0
  88. package/dist/runtime/components/JunPageHero.vue +90 -0
  89. package/dist/runtime/components/JunPageHero.vue.d.ts +25 -0
  90. package/dist/runtime/components/JunPatternBackdrop.client.d.vue.ts +7 -0
  91. package/dist/runtime/components/JunPatternBackdrop.client.vue +95 -0
  92. package/dist/runtime/components/JunPatternBackdrop.client.vue.d.ts +7 -0
  93. package/dist/runtime/components/JunPeerCursors.client.d.vue.ts +3 -0
  94. package/dist/runtime/components/JunPeerCursors.client.vue +123 -0
  95. package/dist/runtime/components/JunPeerCursors.client.vue.d.ts +3 -0
  96. package/dist/runtime/components/JunPresenceBlobs.client.d.vue.ts +3 -0
  97. package/dist/runtime/components/JunPresenceBlobs.client.vue +172 -0
  98. package/dist/runtime/components/JunPresenceBlobs.client.vue.d.ts +3 -0
  99. package/dist/runtime/components/JunSearch.client.d.vue.ts +3 -0
  100. package/dist/runtime/components/JunSearch.client.vue +809 -0
  101. package/dist/runtime/components/JunSearch.client.vue.d.ts +3 -0
  102. package/dist/runtime/components/JunServiceCard.d.vue.ts +10 -0
  103. package/dist/runtime/components/JunServiceCard.vue +145 -0
  104. package/dist/runtime/components/JunServiceCard.vue.d.ts +10 -0
  105. package/dist/runtime/components/JunShaderBackdrop.client.d.vue.ts +3 -0
  106. package/dist/runtime/components/JunShaderBackdrop.client.vue +82 -0
  107. package/dist/runtime/components/JunShaderBackdrop.client.vue.d.ts +3 -0
  108. package/dist/runtime/components/JunShell.d.vue.ts +17 -0
  109. package/dist/runtime/components/JunShell.vue +80 -0
  110. package/dist/runtime/components/JunShell.vue.d.ts +17 -0
  111. package/dist/runtime/components/JunStudioBar.client.d.vue.ts +3 -0
  112. package/dist/runtime/components/JunStudioBar.client.vue +462 -0
  113. package/dist/runtime/components/JunStudioBar.client.vue.d.ts +3 -0
  114. package/dist/runtime/components/JunStudioLogin.client.d.vue.ts +3 -0
  115. package/dist/runtime/components/JunStudioLogin.client.vue +58 -0
  116. package/dist/runtime/components/JunStudioLogin.client.vue.d.ts +3 -0
  117. package/dist/runtime/components/JunThemeToggle.d.vue.ts +3 -0
  118. package/dist/runtime/components/JunThemeToggle.vue +32 -0
  119. package/dist/runtime/components/JunThemeToggle.vue.d.ts +3 -0
  120. package/dist/runtime/components/JunTravellersChip.d.vue.ts +9 -0
  121. package/dist/runtime/components/JunTravellersChip.vue +111 -0
  122. package/dist/runtime/components/JunTravellersChip.vue.d.ts +9 -0
  123. package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +23 -0
  124. package/dist/runtime/components/JunVideoEmbed.client.vue +124 -0
  125. package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +23 -0
  126. package/dist/runtime/components/css-modules.d.ts +7 -0
  127. package/dist/runtime/components/renderers/.gitkeep +0 -0
  128. package/dist/runtime/components/renderers/JunAppsRenderer.d.vue.ts +10 -0
  129. package/dist/runtime/components/renderers/JunAppsRenderer.vue +271 -0
  130. package/dist/runtime/components/renderers/JunAppsRenderer.vue.d.ts +10 -0
  131. package/dist/runtime/components/renderers/JunCinemaRenderer.d.vue.ts +10 -0
  132. package/dist/runtime/components/renderers/JunCinemaRenderer.vue +465 -0
  133. package/dist/runtime/components/renderers/JunCinemaRenderer.vue.d.ts +10 -0
  134. package/dist/runtime/components/renderers/JunConfigRenderer.d.vue.ts +10 -0
  135. package/dist/runtime/components/renderers/JunConfigRenderer.vue +2045 -0
  136. package/dist/runtime/components/renderers/JunConfigRenderer.vue.d.ts +10 -0
  137. package/dist/runtime/components/renderers/JunCvRenderer.d.vue.ts +10 -0
  138. package/dist/runtime/components/renderers/JunCvRenderer.vue +256 -0
  139. package/dist/runtime/components/renderers/JunCvRenderer.vue.d.ts +10 -0
  140. package/dist/runtime/components/renderers/JunEntryRenderer.d.vue.ts +10 -0
  141. package/dist/runtime/components/renderers/JunEntryRenderer.vue +429 -0
  142. package/dist/runtime/components/renderers/JunEntryRenderer.vue.d.ts +10 -0
  143. package/dist/runtime/components/renderers/JunFestivalRenderer.d.vue.ts +10 -0
  144. package/dist/runtime/components/renderers/JunFestivalRenderer.vue +557 -0
  145. package/dist/runtime/components/renderers/JunFestivalRenderer.vue.d.ts +10 -0
  146. package/dist/runtime/components/renderers/JunGlobeRenderer.d.vue.ts +10 -0
  147. package/dist/runtime/components/renderers/JunGlobeRenderer.vue +91 -0
  148. package/dist/runtime/components/renderers/JunGlobeRenderer.vue.d.ts +10 -0
  149. package/dist/runtime/components/renderers/JunGuestbookRenderer.d.vue.ts +10 -0
  150. package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +326 -0
  151. package/dist/runtime/components/renderers/JunGuestbookRenderer.vue.d.ts +10 -0
  152. package/dist/runtime/components/renderers/JunHomeRenderer.d.vue.ts +10 -0
  153. package/dist/runtime/components/renderers/JunHomeRenderer.vue +585 -0
  154. package/dist/runtime/components/renderers/JunHomeRenderer.vue.d.ts +10 -0
  155. package/dist/runtime/components/renderers/JunJournalRenderer.d.vue.ts +10 -0
  156. package/dist/runtime/components/renderers/JunJournalRenderer.vue +420 -0
  157. package/dist/runtime/components/renderers/JunJournalRenderer.vue.d.ts +10 -0
  158. package/dist/runtime/components/renderers/JunLibraryRenderer.d.vue.ts +10 -0
  159. package/dist/runtime/components/renderers/JunLibraryRenderer.vue +319 -0
  160. package/dist/runtime/components/renderers/JunLibraryRenderer.vue.d.ts +10 -0
  161. package/dist/runtime/components/renderers/JunLinksRenderer.d.vue.ts +10 -0
  162. package/dist/runtime/components/renderers/JunLinksRenderer.vue +206 -0
  163. package/dist/runtime/components/renderers/JunLinksRenderer.vue.d.ts +10 -0
  164. package/dist/runtime/components/renderers/JunLiveRenderer.d.vue.ts +10 -0
  165. package/dist/runtime/components/renderers/JunLiveRenderer.vue +684 -0
  166. package/dist/runtime/components/renderers/JunLiveRenderer.vue.d.ts +10 -0
  167. package/dist/runtime/components/renderers/JunMosaicRenderer.d.vue.ts +10 -0
  168. package/dist/runtime/components/renderers/JunMosaicRenderer.vue +572 -0
  169. package/dist/runtime/components/renderers/JunMosaicRenderer.vue.d.ts +10 -0
  170. package/dist/runtime/components/renderers/JunMovieRenderer.d.vue.ts +10 -0
  171. package/dist/runtime/components/renderers/JunMovieRenderer.vue +539 -0
  172. package/dist/runtime/components/renderers/JunMovieRenderer.vue.d.ts +10 -0
  173. package/dist/runtime/components/renderers/JunNowRenderer.d.vue.ts +10 -0
  174. package/dist/runtime/components/renderers/JunNowRenderer.vue +382 -0
  175. package/dist/runtime/components/renderers/JunNowRenderer.vue.d.ts +10 -0
  176. package/dist/runtime/components/renderers/JunProjectRenderer.d.vue.ts +10 -0
  177. package/dist/runtime/components/renderers/JunProjectRenderer.vue +413 -0
  178. package/dist/runtime/components/renderers/JunProjectRenderer.vue.d.ts +10 -0
  179. package/dist/runtime/components/renderers/JunRedirectRenderer.d.vue.ts +10 -0
  180. package/dist/runtime/components/renderers/JunRedirectRenderer.vue +133 -0
  181. package/dist/runtime/components/renderers/JunRedirectRenderer.vue.d.ts +10 -0
  182. package/dist/runtime/components/renderers/JunServicesRenderer.d.vue.ts +10 -0
  183. package/dist/runtime/components/renderers/JunServicesRenderer.vue +267 -0
  184. package/dist/runtime/components/renderers/JunServicesRenderer.vue.d.ts +10 -0
  185. package/dist/runtime/components/renderers/JunStatsRenderer.d.vue.ts +10 -0
  186. package/dist/runtime/components/renderers/JunStatsRenderer.vue +230 -0
  187. package/dist/runtime/components/renderers/JunStatsRenderer.vue.d.ts +10 -0
  188. package/dist/runtime/components/renderers/JunTrackRenderer.d.vue.ts +10 -0
  189. package/dist/runtime/components/renderers/JunTrackRenderer.vue +380 -0
  190. package/dist/runtime/components/renderers/JunTrackRenderer.vue.d.ts +10 -0
  191. package/dist/runtime/components/renderers/JunUsesRenderer.d.vue.ts +10 -0
  192. package/dist/runtime/components/renderers/JunUsesRenderer.vue +254 -0
  193. package/dist/runtime/components/renderers/JunUsesRenderer.vue.d.ts +10 -0
  194. package/dist/runtime/components/renderers/JunWallRenderer.d.vue.ts +10 -0
  195. package/dist/runtime/components/renderers/JunWallRenderer.vue +276 -0
  196. package/dist/runtime/components/renderers/JunWallRenderer.vue.d.ts +10 -0
  197. package/dist/runtime/components/renderers/JunWindowRenderer.d.vue.ts +10 -0
  198. package/dist/runtime/components/renderers/JunWindowRenderer.vue +516 -0
  199. package/dist/runtime/components/renderers/JunWindowRenderer.vue.d.ts +10 -0
  200. package/dist/runtime/composables/useJunBackdrop.d.ts +9 -0
  201. package/dist/runtime/composables/useJunBackdrop.js +27 -0
  202. package/dist/runtime/composables/useJunBackground.d.ts +78 -0
  203. package/dist/runtime/composables/useJunBackground.js +65 -0
  204. package/dist/runtime/composables/useJunCampfire.d.ts +156 -0
  205. package/dist/runtime/composables/useJunCampfire.js +225 -0
  206. package/dist/runtime/composables/useJunChrome.d.ts +66 -0
  207. package/dist/runtime/composables/useJunChrome.js +233 -0
  208. package/dist/runtime/composables/useJunColorMode.d.ts +8 -0
  209. package/dist/runtime/composables/useJunColorMode.js +11 -0
  210. package/dist/runtime/composables/useJunCommands.d.ts +37 -0
  211. package/dist/runtime/composables/useJunCommands.js +225 -0
  212. package/dist/runtime/composables/useJunCreatePage.d.ts +17 -0
  213. package/dist/runtime/composables/useJunCreatePage.js +30 -0
  214. package/dist/runtime/composables/useJunCurrentDoc.d.ts +5 -0
  215. package/dist/runtime/composables/useJunCurrentDoc.js +14 -0
  216. package/dist/runtime/composables/useJunDocMenu.d.ts +71 -0
  217. package/dist/runtime/composables/useJunDocMenu.js +344 -0
  218. package/dist/runtime/composables/useJunDocPage.d.ts +99 -0
  219. package/dist/runtime/composables/useJunDocPage.js +155 -0
  220. package/dist/runtime/composables/useJunFollow.d.ts +11 -0
  221. package/dist/runtime/composables/useJunFollow.js +38 -0
  222. package/dist/runtime/composables/useJunGroupedDnD.d.ts +74 -0
  223. package/dist/runtime/composables/useJunGroupedDnD.js +186 -0
  224. package/dist/runtime/composables/useJunImagePopup.d.ts +37 -0
  225. package/dist/runtime/composables/useJunImagePopup.js +24 -0
  226. package/dist/runtime/composables/useJunIntro.d.ts +7 -0
  227. package/dist/runtime/composables/useJunIntro.js +8 -0
  228. package/dist/runtime/composables/useJunListDnD.d.ts +65 -0
  229. package/dist/runtime/composables/useJunListDnD.js +159 -0
  230. package/dist/runtime/composables/useJunMediaImport.d.ts +27 -0
  231. package/dist/runtime/composables/useJunMediaImport.js +90 -0
  232. package/dist/runtime/composables/useJunNavSettings.d.ts +57 -0
  233. package/dist/runtime/composables/useJunNavSettings.js +74 -0
  234. package/dist/runtime/composables/useJunNodePanel.d.ts +41 -0
  235. package/dist/runtime/composables/useJunNodePanel.js +36 -0
  236. package/dist/runtime/composables/useJunOpenDoc.d.ts +7 -0
  237. package/dist/runtime/composables/useJunOpenDoc.js +30 -0
  238. package/dist/runtime/composables/useJunOptions.d.ts +68 -0
  239. package/dist/runtime/composables/useJunOptions.js +68 -0
  240. package/dist/runtime/composables/useJunPalette.d.ts +16 -0
  241. package/dist/runtime/composables/useJunPalette.js +72 -0
  242. package/dist/runtime/composables/useJunPeopleAdmin.d.ts +69 -0
  243. package/dist/runtime/composables/useJunPeopleAdmin.js +73 -0
  244. package/dist/runtime/composables/useJunPlayer.d.ts +99 -0
  245. package/dist/runtime/composables/useJunPlayer.js +208 -0
  246. package/dist/runtime/composables/useJunPresence.d.ts +32 -0
  247. package/dist/runtime/composables/useJunPresence.js +53 -0
  248. package/dist/runtime/composables/useJunPressDrag.d.ts +20 -0
  249. package/dist/runtime/composables/useJunPressDrag.js +85 -0
  250. package/dist/runtime/composables/useJunRecent.d.ts +9 -0
  251. package/dist/runtime/composables/useJunRecent.js +44 -0
  252. package/dist/runtime/composables/useJunRename.d.ts +19 -0
  253. package/dist/runtime/composables/useJunRename.js +62 -0
  254. package/dist/runtime/composables/useJunRouteGeoHeal.d.ts +1 -0
  255. package/dist/runtime/composables/useJunRouteGeoHeal.js +45 -0
  256. package/dist/runtime/composables/useJunRouting.d.ts +29 -0
  257. package/dist/runtime/composables/useJunRouting.js +101 -0
  258. package/dist/runtime/composables/useJunSearch.d.ts +6 -0
  259. package/dist/runtime/composables/useJunSearch.js +16 -0
  260. package/dist/runtime/composables/useJunSelfId.d.ts +1 -0
  261. package/dist/runtime/composables/useJunSelfId.js +28 -0
  262. package/dist/runtime/composables/useJunSiteConfig.d.ts +229 -0
  263. package/dist/runtime/composables/useJunSiteConfig.js +95 -0
  264. package/dist/runtime/composables/useJunSiteConfigValues.d.ts +33 -0
  265. package/dist/runtime/composables/useJunSiteConfigValues.js +21 -0
  266. package/dist/runtime/composables/useJunStagger.d.ts +54 -0
  267. package/dist/runtime/composables/useJunStagger.js +23 -0
  268. package/dist/runtime/composables/useJunStudio.d.ts +11 -0
  269. package/dist/runtime/composables/useJunStudio.js +51 -0
  270. package/dist/runtime/composables/useJunSurface.d.ts +19 -0
  271. package/dist/runtime/composables/useJunSurface.js +8 -0
  272. package/dist/runtime/composables/useJunTheme.d.ts +21 -0
  273. package/dist/runtime/composables/useJunTheme.js +138 -0
  274. package/dist/runtime/composables/useJunThemeTransition.d.ts +5 -0
  275. package/dist/runtime/composables/useJunThemeTransition.js +32 -0
  276. package/dist/runtime/composables/useJunUpload.d.ts +12 -0
  277. package/dist/runtime/composables/useJunUpload.js +44 -0
  278. package/dist/runtime/composables/useJunViewingAccent.d.ts +6 -0
  279. package/dist/runtime/composables/useJunViewingAccent.js +28 -0
  280. package/dist/runtime/error.d.vue.ts +7 -0
  281. package/dist/runtime/error.vue +74 -0
  282. package/dist/runtime/error.vue.d.ts +7 -0
  283. package/dist/runtime/layouts/jun.d.vue.ts +13 -0
  284. package/dist/runtime/layouts/jun.vue +162 -0
  285. package/dist/runtime/layouts/jun.vue.d.ts +13 -0
  286. package/dist/runtime/pages/doc.d.vue.ts +3 -0
  287. package/dist/runtime/pages/doc.vue +142 -0
  288. package/dist/runtime/pages/doc.vue.d.ts +3 -0
  289. package/dist/runtime/pages/index.d.vue.ts +3 -0
  290. package/dist/runtime/pages/index.vue +64 -0
  291. package/dist/runtime/pages/index.vue.d.ts +3 -0
  292. package/dist/runtime/plugins/jun-drag-affordance.client.d.ts +2 -0
  293. package/dist/runtime/plugins/jun-drag-affordance.client.js +9 -0
  294. package/dist/runtime/router.options.d.ts +3 -0
  295. package/dist/runtime/router.options.js +72 -0
  296. package/dist/runtime/server/api/nav.get.d.ts +9 -0
  297. package/dist/runtime/server/api/nav.get.js +16 -0
  298. package/dist/runtime/server/api/resolve/[...slug].get.d.ts +18 -0
  299. package/dist/runtime/server/api/resolve/[...slug].get.js +20 -0
  300. package/dist/runtime/server/api/search.get.d.ts +13 -0
  301. package/dist/runtime/server/api/search.get.js +72 -0
  302. package/dist/runtime/server/api/service.get.d.ts +12 -0
  303. package/dist/runtime/server/api/service.get.js +39 -0
  304. package/dist/runtime/server/api/site-config.get.d.ts +2 -0
  305. package/dist/runtime/server/api/site-config.get.js +3 -0
  306. package/dist/runtime/server/api/stats.get.d.ts +12 -0
  307. package/dist/runtime/server/api/stats.get.js +56 -0
  308. package/dist/runtime/server/janitor/junJanitorActor.d.ts +179 -0
  309. package/dist/runtime/server/janitor/junJanitorActor.js +305 -0
  310. package/dist/runtime/server/janitor/junJanitorChores.d.ts +137 -0
  311. package/dist/runtime/server/janitor/junJanitorChores.js +189 -0
  312. package/dist/runtime/server/janitor/junJanitorDiff.d.ts +41 -0
  313. package/dist/runtime/server/janitor/junJanitorDiff.js +109 -0
  314. package/dist/runtime/server/janitor/junJanitorListen.d.ts +33 -0
  315. package/dist/runtime/server/janitor/junJanitorListen.js +43 -0
  316. package/dist/runtime/server/janitor/junJanitorMachine.d.ts +60 -0
  317. package/dist/runtime/server/janitor/junJanitorMachine.js +598 -0
  318. package/dist/runtime/server/janitor/junJanitorMotor.d.ts +211 -0
  319. package/dist/runtime/server/janitor/junJanitorMotor.js +241 -0
  320. package/dist/runtime/server/janitor/junJanitorPatrol.d.ts +68 -0
  321. package/dist/runtime/server/janitor/junJanitorPatrol.js +34 -0
  322. package/dist/runtime/server/janitor/junJanitorPerform.d.ts +70 -0
  323. package/dist/runtime/server/janitor/junJanitorPerform.js +72 -0
  324. package/dist/runtime/server/janitor/junJanitorRandom.d.ts +54 -0
  325. package/dist/runtime/server/janitor/junJanitorRandom.js +48 -0
  326. package/dist/runtime/server/janitor/junJanitorStore.d.ts +159 -0
  327. package/dist/runtime/server/janitor/junJanitorStore.js +269 -0
  328. package/dist/runtime/server/janitor/junJanitorVoice.d.ts +86 -0
  329. package/dist/runtime/server/janitor/junJanitorVoice.js +193 -0
  330. package/dist/runtime/server/janitor/junJanitorYText.d.ts +164 -0
  331. package/dist/runtime/server/janitor/junJanitorYText.js +258 -0
  332. package/dist/runtime/server/plugins/jun-bootstrap.d.ts +25 -0
  333. package/dist/runtime/server/plugins/jun-bootstrap.js +652 -0
  334. package/dist/runtime/server/plugins/jun-doc-cache.d.ts +2 -0
  335. package/dist/runtime/server/plugins/jun-doc-cache.js +142 -0
  336. package/dist/runtime/server/plugins/jun-janitor.d.ts +2 -0
  337. package/dist/runtime/server/plugins/jun-janitor.js +176 -0
  338. package/dist/runtime/server/plugins/jun-rpc.d.ts +2 -0
  339. package/dist/runtime/server/plugins/jun-rpc.js +455 -0
  340. package/dist/runtime/server/routes/feed.json.get.d.ts +21 -0
  341. package/dist/runtime/server/routes/feed.json.get.js +25 -0
  342. package/dist/runtime/server/routes/feed.xml.get.d.ts +2 -0
  343. package/dist/runtime/server/routes/feed.xml.get.js +34 -0
  344. package/dist/runtime/server/routes/sitemap.xml.get.d.ts +2 -0
  345. package/dist/runtime/server/routes/sitemap.xml.get.js +27 -0
  346. package/dist/runtime/server/utils/junCache.d.ts +41 -0
  347. package/dist/runtime/server/utils/junCache.js +32 -0
  348. package/dist/runtime/server/utils/junFeed.d.ts +20 -0
  349. package/dist/runtime/server/utils/junFeed.js +71 -0
  350. package/dist/runtime/server/utils/junServiceFetch.d.ts +46 -0
  351. package/dist/runtime/server/utils/junServiceFetch.js +320 -0
  352. package/dist/runtime/server/utils/junVisibility.d.ts +31 -0
  353. package/dist/runtime/server/utils/junVisibility.js +6 -0
  354. package/dist/runtime/types.d.ts +853 -0
  355. package/dist/runtime/types.js +1 -0
  356. package/dist/runtime/utils/junDate.d.ts +38 -0
  357. package/dist/runtime/utils/junDate.js +30 -0
  358. package/dist/runtime/utils/junDndGeometry.d.ts +62 -0
  359. package/dist/runtime/utils/junDndGeometry.js +56 -0
  360. package/dist/runtime/utils/junDocTypeIcons.d.ts +30 -0
  361. package/dist/runtime/utils/junDocTypeIcons.js +30 -0
  362. package/dist/runtime/utils/junEditorBodyText.d.ts +32 -0
  363. package/dist/runtime/utils/junEditorBodyText.js +10 -0
  364. package/dist/runtime/utils/junMapboxToken.d.ts +1 -0
  365. package/dist/runtime/utils/junMapboxToken.js +5 -0
  366. package/dist/runtime/utils/junMatch.d.ts +45 -0
  367. package/dist/runtime/utils/junMatch.js +37 -0
  368. package/dist/runtime/utils/junMetaSchemas.d.ts +23 -0
  369. package/dist/runtime/utils/junMetaSchemas.js +94 -0
  370. package/dist/runtime/utils/junMotion.d.ts +71 -0
  371. package/dist/runtime/utils/junMotion.js +3 -0
  372. package/dist/runtime/utils/junServiceRef.d.ts +21 -0
  373. package/dist/runtime/utils/junServiceRef.js +94 -0
  374. package/dist/runtime/utils/junSimplifyPath.d.ts +23 -0
  375. package/dist/runtime/utils/junSimplifyPath.js +57 -0
  376. package/dist/runtime/utils/junTransportModes.d.ts +49 -0
  377. package/dist/runtime/utils/junTransportModes.js +37 -0
  378. package/dist/runtime/utils/junVideoSource.d.ts +51 -0
  379. package/dist/runtime/utils/junVideoSource.js +110 -0
  380. package/dist/runtime/utils/junVisibility.d.ts +14 -0
  381. package/dist/runtime/utils/junVisibility.js +6 -0
  382. package/dist/types.d.mts +5 -0
  383. package/package.json +111 -0
@@ -0,0 +1,455 @@
1
+ import * as Y from "yjs";
2
+ import { AbracadabraProvider } from "@abraca/dabra";
3
+ import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
4
+ const SYNC_TIMEOUT_MS = 8e3;
5
+ const ECHO_TIMEOUT_MS = 6e3;
6
+ const APPRECIATED_CAP = 500;
7
+ const SWEEP_INTERVAL_MS = 6e4;
8
+ const SWEEP_BOOT_DELAY_MS = 1e4;
9
+ const CAMPFIRE_LABEL = "Campfire";
10
+ const CAMPFIRE_KIND = "channel";
11
+ const CAMPFIRE_SETTLE_MS = 400;
12
+ function plain(e) {
13
+ if (!e) return void 0;
14
+ const v = e;
15
+ return typeof v.toJSON === "function" ? v.toJSON() : e;
16
+ }
17
+ function parseWhen(v) {
18
+ if (typeof v === "number" && Number.isFinite(v)) return v;
19
+ if (typeof v === "string" && v.trim()) {
20
+ const t = Date.parse(v);
21
+ if (!Number.isNaN(t)) return t;
22
+ }
23
+ return 0;
24
+ }
25
+ const MAX_MESSAGE = 280;
26
+ const MAX_HANDLE = 40;
27
+ const PER_SIGNER_MAX = 3;
28
+ const PER_SIGNER_COOLDOWN_MS = 10 * 6e4;
29
+ const FLOOD_WINDOW_MS = 6e4;
30
+ const FLOOD_MAX = 8;
31
+ function cleanText(raw) {
32
+ return raw.replace(/[\u0000-\u0008\u000B-\u001F\u007F]/g, "").replace(/\n{3,}/g, "\n\n").trim();
33
+ }
34
+ const signSchema = {
35
+ parse(value) {
36
+ const v = value;
37
+ if (typeof v?.docId !== "string" || !v.docId) throw new Error("docId required");
38
+ if (typeof v?.message !== "string") throw new Error("message required");
39
+ const message = cleanText(v.message);
40
+ if (!message) throw new Error("message is empty");
41
+ if (message.length > MAX_MESSAGE) throw new Error(`message too long (max ${MAX_MESSAGE})`);
42
+ const handle = cleanText(String(v.handle ?? "")).replace(/\n/g, " ").slice(0, MAX_HANDLE) || "Traveller";
43
+ return { docId: v.docId, message, handle };
44
+ }
45
+ };
46
+ const reactSchema = {
47
+ parse(value) {
48
+ const v = value;
49
+ if (typeof v?.docId !== "string" || !v.docId) throw new Error("docId required");
50
+ return { docId: v.docId };
51
+ }
52
+ };
53
+ export default defineNitroPlugin((nitroApp) => {
54
+ const jun = useRuntimeConfig().public.jun;
55
+ if (!jun?.features?.rpc) return;
56
+ nitroApp.hooks.hook("abracadabra:before-runners", () => {
57
+ let runner = null;
58
+ const sharedTree = () => runner.rootDoc.getMap("doc-tree");
59
+ const siteConfig = () => {
60
+ let cfg = {};
61
+ sharedTree().forEach((e) => {
62
+ const entry = plain(e);
63
+ if (entry?.meta?.siteConfig === true && !entry.trashed) cfg = entry.meta;
64
+ });
65
+ return cfg;
66
+ };
67
+ let writeChain = Promise.resolve();
68
+ function withRootTree(mutate, confirmed) {
69
+ const run = async () => {
70
+ const ydoc = new Y.Doc();
71
+ const provider = new AbracadabraProvider({
72
+ name: runner.rootDocId,
73
+ // Same two-yjs-copies cast as the other runners — see jun-bootstrap.
74
+ document: ydoc,
75
+ client: runner.client,
76
+ disableOfflineStore: true,
77
+ subdocLoading: "lazy"
78
+ });
79
+ try {
80
+ if (!provider.isSynced) {
81
+ await new Promise((resolve, reject) => {
82
+ const t = setTimeout(
83
+ // @ts-expect-error — server auto-import from @abraca/nuxt
84
+ () => reject(new RpcError("INTERNAL", "root sync timeout")),
85
+ SYNC_TIMEOUT_MS
86
+ );
87
+ provider.on("synced", () => {
88
+ clearTimeout(t);
89
+ resolve();
90
+ });
91
+ });
92
+ }
93
+ let result;
94
+ ydoc.transact(() => {
95
+ result = mutate(ydoc.getMap("doc-tree"), ydoc);
96
+ });
97
+ await new Promise((resolve, reject) => {
98
+ if (confirmed()) return resolve();
99
+ const shared = sharedTree();
100
+ const timer = setTimeout(() => {
101
+ shared.unobserve(check);
102
+ reject(
103
+ // @ts-expect-error — server auto-import from @abraca/nuxt
104
+ new RpcError(
105
+ "INTERNAL",
106
+ "write did not propagate \u2014 does the runner identity have write access?"
107
+ )
108
+ );
109
+ }, ECHO_TIMEOUT_MS);
110
+ const check = () => {
111
+ if (!confirmed()) return;
112
+ clearTimeout(timer);
113
+ shared.unobserve(check);
114
+ resolve();
115
+ };
116
+ shared.observe(check);
117
+ });
118
+ return result;
119
+ } finally {
120
+ try {
121
+ provider.destroy();
122
+ } catch {
123
+ }
124
+ }
125
+ };
126
+ const next = writeChain.then(run, run);
127
+ writeChain = next.catch(() => {
128
+ });
129
+ return next;
130
+ }
131
+ async function sweepDuePublishes() {
132
+ if (!runner) return;
133
+ const now = Date.now();
134
+ const due = [];
135
+ sharedTree().forEach((e, id) => {
136
+ const entry = plain(e);
137
+ if (!entry || entry.trashed || entry.meta?.draft !== true) return;
138
+ const at = parseWhen(entry.meta?.publishAt);
139
+ if (at && at <= now) due.push(id);
140
+ });
141
+ for (const id of due) {
142
+ try {
143
+ await withRootTree(
144
+ (tree) => {
145
+ const cur = plain(tree.get(id));
146
+ if (!cur || cur.meta?.draft !== true) return;
147
+ const at = parseWhen(cur.meta?.publishAt) || now;
148
+ tree.set(id, {
149
+ ...cur,
150
+ updatedAt: now,
151
+ meta: {
152
+ ...cur.meta ?? {},
153
+ draft: void 0,
154
+ publishAt: void 0,
155
+ // Respect a backdated chip rather than stamping over it.
156
+ date: cur.meta?.date ?? new Date(at).toISOString()
157
+ }
158
+ });
159
+ },
160
+ () => plain(sharedTree().get(id))?.meta?.draft !== true
161
+ );
162
+ console.log(`[jun:rpc] scheduled publish: ${id}`);
163
+ } catch (err) {
164
+ console.warn(`[jun:rpc] scheduled publish ${id} failed:`, err?.message ?? err);
165
+ }
166
+ }
167
+ }
168
+ function campfireWantsWrites() {
169
+ const cfg = siteConfig();
170
+ const build = jun?.campfire;
171
+ const lit = typeof cfg.campfireEnabled === "boolean" ? cfg.campfireEnabled : jun?.features?.campfire === true;
172
+ const chat = typeof cfg.campfireChat === "boolean" ? cfg.campfireChat : build?.chat !== false;
173
+ return lit && chat;
174
+ }
175
+ function campfireCandidates(tree) {
176
+ const found = [];
177
+ tree.forEach((e, id) => {
178
+ const entry = plain(e);
179
+ if (entry?.meta?.campfire === true && !entry.trashed) {
180
+ found.push({ id, at: entry.createdAt ?? 0 });
181
+ }
182
+ });
183
+ return found.sort((a, b) => a.at - b.at || (a.id < b.id ? -1 : 1)).map((c) => c.id);
184
+ }
185
+ async function hasHistory(docId) {
186
+ try {
187
+ const kids = await runner.client.listChildren(docId, { kind: "channel-period" });
188
+ return kids.length > 0;
189
+ } catch {
190
+ return true;
191
+ }
192
+ }
193
+ async function retireEmptyDuplicates(extras) {
194
+ for (const dupe of extras) {
195
+ if (await hasHistory(dupe)) {
196
+ console.warn(
197
+ `[jun:rpc] campfire: ${dupe} is a duplicate channel WITH history \u2014 left alone. Merge or trash it by hand; visitors only ever see the canonical one.`
198
+ );
199
+ continue;
200
+ }
201
+ await withRootTree(
202
+ (tree) => {
203
+ const cur = plain(tree.get(dupe));
204
+ if (!cur) return;
205
+ tree.doc.getMap("doc-trash").set(dupe, {
206
+ ...cur,
207
+ trashed: true,
208
+ updatedAt: Date.now()
209
+ });
210
+ tree.delete(dupe);
211
+ },
212
+ () => !sharedTree().get(dupe)
213
+ );
214
+ console.log(`[jun:rpc] campfire: retired empty duplicate ${dupe}`);
215
+ }
216
+ }
217
+ async function ensureCampfireDoc() {
218
+ const known = campfireCandidates(sharedTree());
219
+ if (known.length) return known[0];
220
+ const fresh = crypto.randomUUID();
221
+ let resolved = fresh;
222
+ const now = Date.now();
223
+ await withRootTree(
224
+ (tree) => {
225
+ const existing = campfireCandidates(tree);
226
+ if (existing.length) {
227
+ resolved = existing[0];
228
+ return;
229
+ }
230
+ tree.set(fresh, {
231
+ label: CAMPFIRE_LABEL,
232
+ // No page type: this is a container, not a page. `hidden` keeps it
233
+ // out of navigation and `meta.campfire` keeps it out of search, the
234
+ // sitemap and the resolve endpoint — see `isJunOwnerOnlyDoc`.
235
+ type: "doc",
236
+ parentId: runner.rootDocId,
237
+ order: now,
238
+ createdAt: now,
239
+ updatedAt: now,
240
+ meta: { campfire: true, hidden: true }
241
+ });
242
+ },
243
+ () => !!sharedTree().get(resolved)
244
+ );
245
+ if (resolved !== fresh) return resolved;
246
+ await runner.client.createChild(runner.rootDocId, {
247
+ child_id: fresh,
248
+ label: CAMPFIRE_LABEL,
249
+ doc_type: "doc",
250
+ kind: CAMPFIRE_KIND
251
+ });
252
+ console.log(`[jun:rpc] campfire channel created: ${fresh}`);
253
+ return fresh;
254
+ }
255
+ async function reconcileCampfire() {
256
+ if (!runner) return;
257
+ const want = campfireWantsWrites();
258
+ const known = campfireCandidates(sharedTree());
259
+ if (!known.length && !want) return;
260
+ const id = known[0] ?? await ensureCampfireDoc();
261
+ if (known.length > 1) await retireEmptyDuplicates(known.slice(1));
262
+ const desired = want ? "editor" : null;
263
+ const current = await runner.client.getDocumentAccess(id);
264
+ const now = current.public_access === "none" ? null : current.public_access;
265
+ if (now === desired) return;
266
+ await runner.client.setDocumentAccess(id, desired);
267
+ console.log(
268
+ `[jun:rpc] campfire ${id}: public_access ${now ?? "inherit"} \u2192 ${desired ?? "inherit"}`
269
+ );
270
+ }
271
+ registerServerPlugin({
272
+ name: "jun:rpc",
273
+ serverRunners: [
274
+ {
275
+ /**
276
+ * Keeps the campfire channel in step with the settings, for as long
277
+ * as the server is up. It watches the tree rather than polling
278
+ * because the trigger IS a tree change — the owner flipping a switch
279
+ * on the settings page writes the config document's meta.
280
+ */
281
+ name: "jun:campfire",
282
+ start(ctx) {
283
+ runner ??= ctx;
284
+ let settle = null;
285
+ let running = false;
286
+ const reconcile = () => {
287
+ if (running) return;
288
+ running = true;
289
+ void reconcileCampfire().catch((err) => {
290
+ console.warn(
291
+ "[jun:rpc] campfire reconcile failed:",
292
+ err?.message ?? err
293
+ );
294
+ }).finally(() => {
295
+ running = false;
296
+ });
297
+ };
298
+ const schedule = () => {
299
+ if (settle) clearTimeout(settle);
300
+ settle = setTimeout(reconcile, CAMPFIRE_SETTLE_MS);
301
+ };
302
+ const tree = ctx.rootDoc.getMap("doc-tree");
303
+ tree.observe(schedule);
304
+ const boot = setInterval(() => {
305
+ if (tree.size === 0) return;
306
+ clearInterval(boot);
307
+ reconcile();
308
+ }, CAMPFIRE_SETTLE_MS);
309
+ return () => {
310
+ tree.unobserve(schedule);
311
+ if (settle) clearTimeout(settle);
312
+ clearInterval(boot);
313
+ };
314
+ }
315
+ },
316
+ {
317
+ name: "jun:publish-sweep",
318
+ start(ctx) {
319
+ runner ??= ctx;
320
+ const timer = setInterval(() => {
321
+ void sweepDuePublishes();
322
+ }, SWEEP_INTERVAL_MS);
323
+ const boot = setTimeout(() => {
324
+ void sweepDuePublishes();
325
+ }, SWEEP_BOOT_DELAY_MS);
326
+ return () => {
327
+ clearInterval(timer);
328
+ clearTimeout(boot);
329
+ };
330
+ }
331
+ },
332
+ // @ts-expect-error — server auto-import from @abraca/nuxt
333
+ defineRpcRunner({
334
+ name: "jun:rpc",
335
+ onStart(ctx) {
336
+ runner = ctx;
337
+ },
338
+ handlers: [
339
+ // @ts-expect-error — server auto-import from @abraca/nuxt
340
+ defineRpcHandler({
341
+ method: "jun.guestbook.sign@1",
342
+ schema: signSchema,
343
+ async handler({ docId, message, handle }, ctx) {
344
+ if (siteConfig().guestbookEnabled === false) {
345
+ throw new RpcError("DISABLED", "the guestbook is closed right now");
346
+ }
347
+ const page = plain(sharedTree().get(docId));
348
+ const guestbookType = jun?.typeIds?.guestbook;
349
+ if (!page || page.trashed || guestbookType && page.type !== guestbookType) {
350
+ throw new RpcError("NOT_FOUND", "no guestbook here");
351
+ }
352
+ const now = Date.now();
353
+ let mine = 0;
354
+ let mineNewest = 0;
355
+ let recentAny = 0;
356
+ sharedTree().forEach((e) => {
357
+ const entry = plain(e);
358
+ if (!entry || entry.parentId !== docId || entry.trashed) return;
359
+ const date = typeof entry.meta?.date === "number" ? entry.meta.date : 0;
360
+ if (date > now - FLOOD_WINDOW_MS) recentAny++;
361
+ if (entry.meta?.signerId !== ctx.from) return;
362
+ mine++;
363
+ if (date > mineNewest) mineNewest = date;
364
+ });
365
+ if (mine >= PER_SIGNER_MAX) {
366
+ throw new RpcError("LIMIT", "you have already signed a few times \u2014 thank you!");
367
+ }
368
+ if (mineNewest > now - PER_SIGNER_COOLDOWN_MS) {
369
+ throw new RpcError("RATE_LIMITED", "one signature at a time \u2014 try again in a bit");
370
+ }
371
+ if (recentAny >= FLOOD_MAX) {
372
+ throw new RpcError("RATE_LIMITED", "the guestbook is busy \u2014 try again in a minute");
373
+ }
374
+ const id = crypto.randomUUID();
375
+ await withRootTree(
376
+ (tree) => {
377
+ tree.set(id, {
378
+ label: handle,
379
+ type: "doc",
380
+ parentId: docId,
381
+ order: now,
382
+ createdAt: now,
383
+ updatedAt: now,
384
+ meta: {
385
+ // Out of navigation and the graph; the page itself
386
+ // stays routable, like every other hidden document.
387
+ hidden: true,
388
+ message,
389
+ // The SERVER stamps the identity, never the client.
390
+ signerId: ctx.from,
391
+ signerHandle: handle,
392
+ date: now
393
+ }
394
+ });
395
+ },
396
+ () => !!sharedTree().get(id)
397
+ );
398
+ try {
399
+ await runner.client.createChild(docId, {
400
+ child_id: id,
401
+ label: handle,
402
+ doc_type: "doc"
403
+ });
404
+ } catch (err) {
405
+ console.warn(`[jun:rpc] register signature ${id} failed:`, err?.message ?? err);
406
+ }
407
+ return { id, date: now };
408
+ }
409
+ }),
410
+ // @ts-expect-error — server auto-import from @abraca/nuxt
411
+ defineRpcHandler({
412
+ method: "jun.react@1",
413
+ schema: reactSchema,
414
+ async handler({ docId }, ctx) {
415
+ if (siteConfig().reactionsEnabled === false) {
416
+ throw new RpcError("DISABLED", "reactions are off right now");
417
+ }
418
+ const target = plain(sharedTree().get(docId));
419
+ if (!target || target.trashed) {
420
+ throw new RpcError("NOT_FOUND", "nothing to appreciate here");
421
+ }
422
+ let count = 0;
423
+ let active = false;
424
+ await withRootTree(
425
+ (tree) => {
426
+ const entry = plain(tree.get(docId));
427
+ if (!entry) {
428
+ throw new RpcError("NOT_FOUND", "nothing to appreciate here");
429
+ }
430
+ const prev = Array.isArray(entry.meta?.appreciatedBy) ? entry.meta.appreciatedBy.filter((s) => typeof s === "string") : [];
431
+ const had = prev.includes(ctx.from);
432
+ const nextList = had ? prev.filter((s) => s !== ctx.from) : [...prev.slice(-(APPRECIATED_CAP - 1)), ctx.from];
433
+ active = !had;
434
+ count = nextList.length;
435
+ tree.set(docId, {
436
+ ...entry,
437
+ // updatedAt deliberately NOT bumped — see the header.
438
+ meta: { ...entry.meta ?? {}, appreciatedBy: nextList }
439
+ });
440
+ },
441
+ () => {
442
+ const entry = plain(sharedTree().get(docId));
443
+ const list = Array.isArray(entry?.meta?.appreciatedBy) ? entry.meta.appreciatedBy : [];
444
+ return list.includes(ctx.from) === active;
445
+ }
446
+ );
447
+ return { count, active };
448
+ }
449
+ })
450
+ ]
451
+ })
452
+ ]
453
+ });
454
+ });
455
+ });
@@ -0,0 +1,21 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
+ version?: undefined;
3
+ title?: undefined;
4
+ home_page_url?: undefined;
5
+ feed_url?: undefined;
6
+ items?: undefined;
7
+ } | {
8
+ version: string;
9
+ title: string;
10
+ home_page_url: string;
11
+ feed_url: string;
12
+ items: {
13
+ id: string;
14
+ url: string;
15
+ title: string;
16
+ summary: string | undefined;
17
+ content_html: string | undefined;
18
+ date_published: string;
19
+ }[];
20
+ }>>;
21
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { defineEventHandler, setResponseHeader } from "h3";
2
+ import { junFeedItems, junSiteUrl } from "../utils/junFeed.js";
3
+ import { junSiteConfigMeta } from "../utils/junCache.js";
4
+ import { useRuntimeConfig } from "nitropack/runtime";
5
+ export default defineEventHandler(async (event) => {
6
+ const config = await junSiteConfigMeta();
7
+ if (config.feedsEnabled === false) return {};
8
+ const brand = useRuntimeConfig().public.jun.brand;
9
+ const site = junSiteUrl();
10
+ setResponseHeader(event, "content-type", "application/feed+json; charset=utf-8");
11
+ return {
12
+ version: "https://jsonfeed.org/version/1.1",
13
+ title: brand.name,
14
+ home_page_url: `${site}/`,
15
+ feed_url: `${site}/feed.json`,
16
+ items: (await junFeedItems()).map((i) => ({
17
+ id: `${site}${i.url}`,
18
+ url: `${site}${i.url}`,
19
+ title: i.title,
20
+ summary: i.summary,
21
+ content_html: i.contentHtml,
22
+ date_published: i.date
23
+ }))
24
+ };
25
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string>>;
2
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { defineEventHandler, setResponseHeader } from "h3";
2
+ import { junFeedItems, junSiteUrl } from "../utils/junFeed.js";
3
+ import { junSiteConfigMeta } from "../utils/junCache.js";
4
+ import { useRuntimeConfig } from "nitropack/runtime";
5
+ const esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
6
+ export default defineEventHandler(async (event) => {
7
+ const config = await junSiteConfigMeta();
8
+ if (config.feedsEnabled === false) return "";
9
+ const brand = useRuntimeConfig().public.jun.brand;
10
+ const site = junSiteUrl();
11
+ const items = await junFeedItems();
12
+ const updated = items[0]?.date ?? (/* @__PURE__ */ new Date()).toISOString();
13
+ setResponseHeader(event, "content-type", "application/atom+xml; charset=utf-8");
14
+ return [
15
+ '<?xml version="1.0" encoding="utf-8"?>',
16
+ '<feed xmlns="http://www.w3.org/2005/Atom">',
17
+ ` <title>${esc(brand.name)}</title>`,
18
+ ` <id>${site}/</id>`,
19
+ ` <link href="${site}/"/>`,
20
+ ` <link rel="self" href="${site}/feed.xml"/>`,
21
+ ` <updated>${updated}</updated>`,
22
+ ...items.flatMap((i) => [
23
+ " <entry>",
24
+ ` <title>${esc(i.title)}</title>`,
25
+ ` <id>${site}${i.url}</id>`,
26
+ ` <link href="${site}${i.url}"/>`,
27
+ ` <updated>${i.date}</updated>`,
28
+ i.summary ? ` <summary>${esc(i.summary)}</summary>` : "",
29
+ i.contentHtml ? ` <content type="html">${esc(i.contentHtml)}</content>` : "",
30
+ " </entry>"
31
+ ].filter(Boolean)),
32
+ "</feed>"
33
+ ].join("\n");
34
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string>>;
2
+ export default _default;
@@ -0,0 +1,27 @@
1
+ import { defineEventHandler, setResponseHeader } from "h3";
2
+ import { junDocTree, junRootDocId, junSlugMap } from "../utils/junCache.js";
3
+ import { junSiteUrl } from "../utils/junFeed.js";
4
+ import { isJunOwnerOnlyDoc } from "../utils/junVisibility.js";
5
+ export default defineEventHandler(async (event) => {
6
+ const site = junSiteUrl();
7
+ const rootDocId = junRootDocId();
8
+ const [tree, idToSlug] = await Promise.all([junDocTree(), junSlugMap()]);
9
+ const urls = Object.entries(idToSlug).filter(([id]) => {
10
+ if (id === rootDocId) return false;
11
+ const e = tree[id];
12
+ if (!e || e.trashed) return false;
13
+ if (isJunOwnerOnlyDoc(e)) return false;
14
+ if (e.meta?.draft === true) return false;
15
+ if (e.meta?.signerId) return false;
16
+ if ((e.type ?? "").endsWith("-redirect")) return false;
17
+ return true;
18
+ }).map(([, slug]) => `${site}/${slug}`);
19
+ setResponseHeader(event, "content-type", "application/xml; charset=utf-8");
20
+ return [
21
+ '<?xml version="1.0" encoding="UTF-8"?>',
22
+ '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
23
+ ` <url><loc>${site}/</loc></url>`,
24
+ ...urls.map((u) => ` <url><loc>${u}</loc></url>`),
25
+ "</urlset>"
26
+ ].join("\n");
27
+ });
@@ -0,0 +1,41 @@
1
+ export interface JunTreeEntry {
2
+ label?: string;
3
+ parentId?: string | null;
4
+ type?: string;
5
+ order?: number;
6
+ createdAt?: number;
7
+ trashed?: boolean;
8
+ updatedAt?: number | string;
9
+ meta?: Record<string, unknown>;
10
+ }
11
+ /**
12
+ * The site's root document id.
13
+ *
14
+ * Read from the module's own config, NOT from the backend's `/info root_doc_id`
15
+ * — that is the server world root (all zeros), and syncing it gives an empty
16
+ * tree, zero slugs and no SSR at all.
17
+ */
18
+ export declare function junRootDocId(): string;
19
+ /** The root document's `doc-tree` map, or `{}` before the cache is warm. */
20
+ export declare function junDocTree(): Promise<Record<string, JunTreeEntry>>;
21
+ /** Document id → canonical slug, as persisted by the doc-tree-cache runner. */
22
+ export declare function junSlugMap(): Promise<Record<string, string>>;
23
+ /** A document's cached HTML body, or `null` if it has not been rendered yet. */
24
+ export declare function junDocHtml(docId: string): Promise<string | null>;
25
+ /**
26
+ * The Site Config document's meta — the site's runtime configuration.
27
+ *
28
+ * **The client picks the same document by the same rule** (`useJunSiteConfig`).
29
+ * This used to return whichever candidate came first out of
30
+ * `Object.values(tree)` — Y.Map iteration order, which is not stable and is
31
+ * nothing like the client's rule. A healthy site has exactly one config
32
+ * document so it has not bitten yet, but the moment a site has two, the two
33
+ * sides read different ones and the server's SSR disagrees with the client
34
+ * for reasons nothing on screen explains. That is exactly how the campfire
35
+ * channel broke.
36
+ *
37
+ * The rule, both sides: untrashed `meta.siteConfig` candidates; prefer the ones
38
+ * actually parented to the space root; among those, the OLDEST by `createdAt`,
39
+ * ties broken on the id.
40
+ */
41
+ export declare function junSiteConfigMeta(): Promise<Record<string, unknown>>;
@@ -0,0 +1,32 @@
1
+ import { useRuntimeConfig, useStorage } from "nitropack/runtime";
2
+ export function junRootDocId() {
3
+ const pub = useRuntimeConfig().public;
4
+ return pub?.abracadabra?.entryDocId || process.env.ABRA_ENTRY_DOC_ID || "";
5
+ }
6
+ export async function junDocTree() {
7
+ const rootDocId = junRootDocId();
8
+ if (!rootDocId) return {};
9
+ const json = await useStorage().getItem(
10
+ `doc-cache:json:${rootDocId}`
11
+ );
12
+ return json?.["doc-tree"] ?? {};
13
+ }
14
+ export async function junSlugMap() {
15
+ const map = await useStorage().getItem(
16
+ "doc-cache:slug-map"
17
+ );
18
+ return map?.idToSlug ?? {};
19
+ }
20
+ export async function junDocHtml(docId) {
21
+ return await useStorage().getItem(`doc-cache:html:${docId}`) ?? null;
22
+ }
23
+ export async function junSiteConfigMeta() {
24
+ const tree = await junDocTree();
25
+ const root = junRootDocId();
26
+ const candidates = Object.entries(tree).filter(([, e]) => e?.meta?.siteConfig === true && !e.trashed).map(([id, entry]) => ({ id, entry }));
27
+ if (!candidates.length) return {};
28
+ const parented = candidates.filter((c) => c.entry.parentId === root);
29
+ const pool = parented.length ? parented : candidates;
30
+ pool.sort((a, b) => (a.entry.createdAt ?? 0) - (b.entry.createdAt ?? 0) || (a.id < b.id ? -1 : 1));
31
+ return pool[0].entry.meta ?? {};
32
+ }
@@ -0,0 +1,20 @@
1
+ export interface JunFeedItem {
2
+ id: string;
3
+ title: string;
4
+ /** Site-relative, leading slash — the routes absolutise it. */
5
+ url: string;
6
+ /** RFC 3339, which both Atom and JSON Feed want. */
7
+ date: string;
8
+ summary?: string;
9
+ contentHtml?: string;
10
+ }
11
+ export declare function junFeedItems(): Promise<JunFeedItem[]>;
12
+ /**
13
+ * Absolute site origin for feed and sitemap URLs.
14
+ *
15
+ * `SITE_URL` is the deployment's own knob — there is no sensible default for a
16
+ * module that does not know whose site it is running, so the fallback is the
17
+ * dev origin and a deployment that forgets it gets obviously-wrong URLs rather
18
+ * than subtly-wrong ones.
19
+ */
20
+ export declare function junSiteUrl(): string;