@abraca/junis 2.85.0 → 2.87.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 (161) hide show
  1. package/dist/module.d.mts +17 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +253 -21
  4. package/dist/runtime/assets/css/jun.css +1 -1
  5. package/dist/runtime/components/JunCampfirePresence.client.vue +75 -10
  6. package/dist/runtime/components/JunCollectionIntro.d.vue.ts +11 -0
  7. package/dist/runtime/components/JunCollectionIntro.vue +45 -0
  8. package/dist/runtime/components/JunCollectionIntro.vue.d.ts +11 -0
  9. package/dist/runtime/components/JunConfigRow.d.vue.ts +43 -0
  10. package/dist/runtime/components/JunConfigRow.vue +34 -0
  11. package/dist/runtime/components/JunConfigRow.vue.d.ts +43 -0
  12. package/dist/runtime/components/JunDocSurface.vue +3 -0
  13. package/dist/runtime/components/JunFooter.vue +1 -1
  14. package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +30 -0
  15. package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +30 -0
  16. package/dist/runtime/components/JunLinksRow.d.vue.ts +16 -1
  17. package/dist/runtime/components/JunLinksRow.vue +17 -7
  18. package/dist/runtime/components/JunLinksRow.vue.d.ts +16 -1
  19. package/dist/runtime/components/JunMedia.client.d.vue.ts +1 -1
  20. package/dist/runtime/components/JunMedia.client.vue.d.ts +1 -1
  21. package/dist/runtime/components/JunNavigation.vue +21 -4
  22. package/dist/runtime/components/JunNoteLinks.d.vue.ts +6 -0
  23. package/dist/runtime/components/JunNoteLinks.vue +57 -0
  24. package/dist/runtime/components/JunNoteLinks.vue.d.ts +6 -0
  25. package/dist/runtime/components/JunPageHero.d.vue.ts +8 -2
  26. package/dist/runtime/components/JunPageHero.vue +15 -3
  27. package/dist/runtime/components/JunPageHero.vue.d.ts +8 -2
  28. package/dist/runtime/components/JunReaders.d.vue.ts +11 -0
  29. package/dist/runtime/components/JunReaders.vue +99 -0
  30. package/dist/runtime/components/JunReaders.vue.d.ts +11 -0
  31. package/dist/runtime/components/JunSearch.client.vue +2 -2
  32. package/dist/runtime/components/JunSectionPresence.d.vue.ts +17 -0
  33. package/dist/runtime/components/JunSectionPresence.vue +99 -0
  34. package/dist/runtime/components/JunSectionPresence.vue.d.ts +17 -0
  35. package/dist/runtime/components/JunThreadComposer.d.vue.ts +37 -0
  36. package/dist/runtime/components/JunThreadComposer.vue +54 -0
  37. package/dist/runtime/components/JunThreadComposer.vue.d.ts +37 -0
  38. package/dist/runtime/components/JunTravellersChip.vue +35 -5
  39. package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +1 -1
  40. package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +1 -1
  41. package/dist/runtime/components/JunViewControl.d.vue.ts +29 -0
  42. package/dist/runtime/components/JunViewControl.vue +340 -0
  43. package/dist/runtime/components/JunViewControl.vue.d.ts +29 -0
  44. package/dist/runtime/components/JunViewControls.d.vue.ts +27 -0
  45. package/dist/runtime/components/JunViewControls.vue +94 -0
  46. package/dist/runtime/components/JunViewControls.vue.d.ts +27 -0
  47. package/dist/runtime/components/renderers/JunAppsRenderer.vue +45 -4
  48. package/dist/runtime/components/renderers/JunCinemaRenderer.vue +42 -4
  49. package/dist/runtime/components/renderers/JunConfigRenderer.vue +348 -225
  50. package/dist/runtime/components/renderers/JunCourseRenderer.d.vue.ts +10 -0
  51. package/dist/runtime/components/renderers/JunCourseRenderer.vue +229 -0
  52. package/dist/runtime/components/renderers/JunCourseRenderer.vue.d.ts +10 -0
  53. package/dist/runtime/components/renderers/JunCvRenderer.vue +44 -6
  54. package/dist/runtime/components/renderers/JunDeckRenderer.d.vue.ts +9 -0
  55. package/dist/runtime/components/renderers/JunDeckRenderer.vue +370 -0
  56. package/dist/runtime/components/renderers/JunDeckRenderer.vue.d.ts +9 -0
  57. package/dist/runtime/components/renderers/JunEntryRenderer.vue +151 -23
  58. package/dist/runtime/components/renderers/JunFestivalRenderer.vue +41 -4
  59. package/dist/runtime/components/renderers/JunGardenRenderer.d.vue.ts +10 -0
  60. package/dist/runtime/components/renderers/JunGardenRenderer.vue +280 -0
  61. package/dist/runtime/components/renderers/JunGardenRenderer.vue.d.ts +10 -0
  62. package/dist/runtime/components/renderers/JunGlobeRenderer.vue +43 -26
  63. package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +96 -14
  64. package/dist/runtime/components/renderers/JunHomeRenderer.vue +28 -129
  65. package/dist/runtime/components/renderers/JunItemRenderer.d.vue.ts +10 -0
  66. package/dist/runtime/components/renderers/JunItemRenderer.vue +398 -0
  67. package/dist/runtime/components/renderers/JunItemRenderer.vue.d.ts +10 -0
  68. package/dist/runtime/components/renderers/JunJournalRenderer.vue +141 -11
  69. package/dist/runtime/components/renderers/JunLibraryRenderer.vue +295 -12
  70. package/dist/runtime/components/renderers/JunLinksRenderer.vue +33 -1
  71. package/dist/runtime/components/renderers/JunLiveRenderer.vue +37 -1
  72. package/dist/runtime/components/renderers/JunMosaicRenderer.vue +3 -2
  73. package/dist/runtime/components/renderers/JunMovieRenderer.vue +32 -5
  74. package/dist/runtime/components/renderers/JunNowRenderer.vue +38 -5
  75. package/dist/runtime/components/renderers/JunPollRenderer.d.vue.ts +9 -0
  76. package/dist/runtime/components/renderers/JunPollRenderer.vue +231 -0
  77. package/dist/runtime/components/renderers/JunPollRenderer.vue.d.ts +9 -0
  78. package/dist/runtime/components/renderers/JunProjectRenderer.vue +74 -18
  79. package/dist/runtime/components/renderers/JunServicesRenderer.vue +40 -2
  80. package/dist/runtime/components/renderers/JunStatsRenderer.vue +37 -50
  81. package/dist/runtime/components/renderers/JunThreadRenderer.d.vue.ts +9 -0
  82. package/dist/runtime/components/renderers/JunThreadRenderer.vue +304 -0
  83. package/dist/runtime/components/renderers/JunThreadRenderer.vue.d.ts +9 -0
  84. package/dist/runtime/components/renderers/JunTrackRenderer.vue +32 -4
  85. package/dist/runtime/components/renderers/JunUsesRenderer.vue +51 -5
  86. package/dist/runtime/components/renderers/JunWallRenderer.vue +60 -5
  87. package/dist/runtime/composables/useJunDeck.d.ts +66 -0
  88. package/dist/runtime/composables/useJunDeck.js +61 -0
  89. package/dist/runtime/composables/useJunDocPage.d.ts +14 -11
  90. package/dist/runtime/composables/useJunDocPage.js +67 -3
  91. package/dist/runtime/composables/useJunFollow.d.ts +65 -9
  92. package/dist/runtime/composables/useJunFollow.js +237 -20
  93. package/dist/runtime/composables/useJunGarden.d.ts +67 -0
  94. package/dist/runtime/composables/useJunGarden.js +92 -0
  95. package/dist/runtime/composables/useJunPresence.d.ts +26 -0
  96. package/dist/runtime/composables/useJunPresence.js +9 -2
  97. package/dist/runtime/composables/useJunSections.d.ts +73 -0
  98. package/dist/runtime/composables/useJunSections.js +117 -0
  99. package/dist/runtime/composables/useJunSettings.d.ts +1 -1
  100. package/dist/runtime/composables/useJunSettings.js +5 -1
  101. package/dist/runtime/composables/useJunSiteConfig.d.ts +37 -0
  102. package/dist/runtime/composables/useJunTheme.js +40 -2
  103. package/dist/runtime/composables/useJunViewOptions.d.ts +85 -0
  104. package/dist/runtime/composables/useJunViewOptions.js +63 -0
  105. package/dist/runtime/pages/doc.vue +52 -42
  106. package/dist/runtime/pages/index.vue +61 -35
  107. package/dist/runtime/plugins/jun-doc-tree.d.ts +2 -0
  108. package/dist/runtime/plugins/jun-doc-tree.js +26 -0
  109. package/dist/runtime/server/api/health.get.d.ts +19 -0
  110. package/dist/runtime/server/api/health.get.js +40 -0
  111. package/dist/runtime/server/api/links.get.d.ts +19 -0
  112. package/dist/runtime/server/api/links.get.js +37 -0
  113. package/dist/runtime/server/api/resolve/[...slug].get.d.ts +9 -0
  114. package/dist/runtime/server/api/resolve/[...slug].get.js +7 -2
  115. package/dist/runtime/server/api/stats.get.js +2 -1
  116. package/dist/runtime/server/api/tree.get.d.ts +9 -0
  117. package/dist/runtime/server/api/tree.get.js +23 -0
  118. package/dist/runtime/server/janitor/junJanitorActor.d.ts +13 -0
  119. package/dist/runtime/server/janitor/junJanitorActor.js +36 -5
  120. package/dist/runtime/server/janitor/junJanitorChores.js +8 -0
  121. package/dist/runtime/server/plugins/jun-bootstrap.js +103 -15
  122. package/dist/runtime/server/plugins/jun-doc-cache.js +42 -4
  123. package/dist/runtime/server/plugins/jun-janitor.js +7 -0
  124. package/dist/runtime/server/plugins/jun-rpc.js +293 -0
  125. package/dist/runtime/server/plugins/jun-watchdog.d.ts +2 -0
  126. package/dist/runtime/server/plugins/jun-watchdog.js +54 -0
  127. package/dist/runtime/server/routes/sitemap.xml.get.js +2 -0
  128. package/dist/runtime/server/utils/junBoot.d.ts +1 -0
  129. package/dist/runtime/server/utils/junBoot.js +4 -0
  130. package/dist/runtime/server/utils/junCache.d.ts +17 -0
  131. package/dist/runtime/server/utils/junCache.js +5 -0
  132. package/dist/runtime/server/utils/junSeedGate.d.ts +68 -0
  133. package/dist/runtime/server/utils/junSeedGate.js +41 -0
  134. package/dist/runtime/types.d.ts +57 -1
  135. package/dist/runtime/utils/junCourse.d.ts +106 -0
  136. package/dist/runtime/utils/junCourse.js +65 -0
  137. package/dist/runtime/utils/junGarden.d.ts +193 -0
  138. package/dist/runtime/utils/junGarden.js +233 -0
  139. package/dist/runtime/utils/junMetaSchemas.js +8 -1
  140. package/dist/runtime/utils/junModeration.d.ts +67 -0
  141. package/dist/runtime/utils/junModeration.js +20 -0
  142. package/dist/runtime/utils/junMotion.d.ts +26 -0
  143. package/dist/runtime/utils/junMotion.js +31 -0
  144. package/dist/runtime/utils/junPeople.d.ts +43 -0
  145. package/dist/runtime/utils/junPeople.js +9 -0
  146. package/dist/runtime/utils/junPoll.d.ts +79 -0
  147. package/dist/runtime/utils/junPoll.js +82 -0
  148. package/dist/runtime/utils/junReadiness.d.ts +131 -0
  149. package/dist/runtime/utils/junReadiness.js +69 -0
  150. package/dist/runtime/utils/junSections.d.ts +115 -0
  151. package/dist/runtime/utils/junSections.js +45 -0
  152. package/dist/runtime/utils/junSlides.d.ts +66 -0
  153. package/dist/runtime/utils/junSlides.js +47 -0
  154. package/dist/runtime/utils/junThread.d.ts +81 -0
  155. package/dist/runtime/utils/junThread.js +75 -0
  156. package/dist/runtime/utils/junViewSpecs.d.ts +671 -0
  157. package/dist/runtime/utils/junViewSpecs.js +534 -0
  158. package/dist/runtime/utils/junViewValues.d.ts +125 -0
  159. package/dist/runtime/utils/junViewValues.js +104 -0
  160. package/dist/types.d.mts +1 -1
  161. package/package.json +5 -1
@@ -0,0 +1,57 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { useDocSlugs, useDocTree, useJunLinkGraph, useJunPageType } from "#imports";
4
+ const props = defineProps({
5
+ docId: { type: String, required: true }
6
+ });
7
+ const { typeIdFor } = useJunPageType();
8
+ const gardenOn = computed(() => !!typeIdFor("garden"));
9
+ const { graph } = useJunLinkGraph();
10
+ const { entries } = useDocTree();
11
+ const { getDocUrl } = useDocSlugs();
12
+ const labelOf = computed(() => {
13
+ const map = /* @__PURE__ */ new Map();
14
+ for (const node of graph.value.nodes) map.set(node.id, node.label);
15
+ for (const entry of entries.value ?? []) {
16
+ if (!entry.trashed && entry.label) map.set(entry.id, entry.label);
17
+ }
18
+ return map;
19
+ });
20
+ const inbound = computed(() => {
21
+ const seen = /* @__PURE__ */ new Map();
22
+ for (const edge of graph.value.edges) {
23
+ if (edge.target !== props.docId || edge.source === props.docId) continue;
24
+ const label = labelOf.value.get(edge.source);
25
+ if (!label) continue;
26
+ seen.set(edge.source, { id: edge.source, label, weight: edge.weight });
27
+ }
28
+ return [...seen.values()].sort((a, b) => b.weight - a.weight || a.label.localeCompare(b.label));
29
+ });
30
+ </script>
31
+
32
+ <template>
33
+ <nav
34
+ v-if="gardenOn && inbound.length"
35
+ class="jun-note-links mt-10 border-t border-default pt-4"
36
+ data-jun-note-links="inbound"
37
+ aria-label="Pages that link here"
38
+ >
39
+ <h2 class="mb-2 text-[11px] tracking-wider text-dimmed uppercase">
40
+ Linked from
41
+ </h2>
42
+ <ul class="flex flex-wrap gap-x-3 gap-y-1.5">
43
+ <li
44
+ v-for="cite in inbound"
45
+ :key="cite.id"
46
+ >
47
+ <NuxtLink
48
+ :to="getDocUrl(cite.id)"
49
+ class="text-sm text-muted underline-offset-4 hover:underline"
50
+ :data-jun-cite="cite.id"
51
+ >
52
+ {{ cite.label }}
53
+ </NuxtLink>
54
+ </li>
55
+ </ul>
56
+ </nav>
57
+ </template>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ docId: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -3,10 +3,16 @@ type __VLS_Props = {
3
3
  subtitle?: string;
4
4
  /** Owner edit mode: headline + subtitle become inline-editable. */
5
5
  editable?: boolean;
6
+ /**
7
+ * The document this page renders. Given one, the hero carries the page's
8
+ * READERS — who else is here, and a click to travel with them. Optional so a
9
+ * hero over something that is not a document still works.
10
+ */
11
+ docId?: string;
6
12
  };
7
- declare var __VLS_1: {};
13
+ declare var __VLS_6: {};
8
14
  type __VLS_Slots = {} & {
9
- right?: (props: typeof __VLS_1) => any;
15
+ right?: (props: typeof __VLS_6) => any;
10
16
  };
11
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
18
  rename: (title: string) => any;
@@ -4,7 +4,8 @@ import { junMotion } from "#imports";
4
4
  const props = defineProps({
5
5
  title: { type: String, required: true },
6
6
  subtitle: { type: String, required: false },
7
- editable: { type: Boolean, required: false }
7
+ editable: { type: Boolean, required: false },
8
+ docId: { type: String, required: false }
8
9
  });
9
10
  const emit = defineEmits(["rename", "rename-subtitle"]);
10
11
  const h1El = ref(null);
@@ -79,8 +80,19 @@ const editableRing = "cursor-text rounded-md px-1 -mx-1 transition-shadow hover:
79
80
  {{ subtitle }}
80
81
  </p>
81
82
  </div>
82
- <div class="hidden shrink-0 sm:block">
83
- <slot name="right" />
83
+ <div class="flex shrink-0 items-center gap-3">
84
+ <!-- Who else is on this page, and one click to travel with them. Renders
85
+ nothing at all when you are alone, so the cluster stays empty on the
86
+ overwhelming majority of page views. It is NOT inside the `sm:`
87
+ branch below: presence is worth more on a phone, not less. -->
88
+ <JunReaders
89
+ v-if="docId"
90
+ :doc-id="docId"
91
+ :names="false"
92
+ />
93
+ <div class="hidden sm:block">
94
+ <slot name="right" />
95
+ </div>
84
96
  </div>
85
97
  </header>
86
98
  </template>
@@ -3,10 +3,16 @@ type __VLS_Props = {
3
3
  subtitle?: string;
4
4
  /** Owner edit mode: headline + subtitle become inline-editable. */
5
5
  editable?: boolean;
6
+ /**
7
+ * The document this page renders. Given one, the hero carries the page's
8
+ * READERS — who else is here, and a click to travel with them. Optional so a
9
+ * hero over something that is not a document still works.
10
+ */
11
+ docId?: string;
6
12
  };
7
- declare var __VLS_1: {};
13
+ declare var __VLS_6: {};
8
14
  type __VLS_Slots = {} & {
9
- right?: (props: typeof __VLS_1) => any;
15
+ right?: (props: typeof __VLS_6) => any;
10
16
  };
11
17
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
18
  rename: (title: string) => any;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ /** The document this page IS. Peers are matched on the awareness `docId`. */
3
+ docId?: string;
4
+ /** Names beside the dots. Off gives dots and a count only. */
5
+ names?: boolean;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ names: boolean;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,99 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref } from "vue";
3
+ import { useJunFollow } from "#imports";
4
+ import { useJunTravellers } from "../composables/useJunPresence";
5
+ import { useJunSectionMarks } from "../composables/useJunSections";
6
+ import { junSectionLabel } from "../utils/junSections";
7
+ const props = defineProps({
8
+ docId: { type: String, required: false },
9
+ names: { type: Boolean, required: false, default: true }
10
+ });
11
+ const { byDocId } = useJunTravellers();
12
+ const { toggle, followingClientId } = useJunFollow();
13
+ const { markFor } = useJunSectionMarks();
14
+ const mounted = ref(false);
15
+ onMounted(() => mounted.value = true);
16
+ const readers = computed(() => {
17
+ if (!mounted.value || !props.docId) return [];
18
+ return byDocId.value.get(props.docId) ?? [];
19
+ });
20
+ const MAX = 3;
21
+ const shown = computed(() => readers.value.slice(0, MAX));
22
+ const overflow = computed(() => Math.max(0, readers.value.length - MAX));
23
+ const label = computed(() => {
24
+ const n = readers.value.length;
25
+ if (n === 1) {
26
+ const where = sectionFor(readers.value[0]);
27
+ return where ? `${readers.value[0].name} is reading ${where}` : `${readers.value[0].name} is reading this`;
28
+ }
29
+ return `${n} others are reading this`;
30
+ });
31
+ function sectionFor(t) {
32
+ const mark = markFor(t.clientId);
33
+ if (!mark || mark.d !== props.docId) return "";
34
+ return junSectionLabel(mark.t, 28);
35
+ }
36
+ function titleFor(t) {
37
+ const where = sectionFor(t);
38
+ const who = followingClientId.value === t.clientId ? `Stop following ${t.name}` : `Travel with ${t.name}`;
39
+ return where ? `${who} \u2014 reading ${where}` : who;
40
+ }
41
+ </script>
42
+
43
+ <template>
44
+ <!-- `data-jun-follow-ui`: clicking a reader is not "taking the wheel". Every
45
+ other link on the page ends a follow in progress; the control that starts
46
+ one must not be the control that ends it. -->
47
+ <div
48
+ v-if="readers.length"
49
+ class="jun-readers flex items-center gap-1.5"
50
+ data-jun-follow-ui
51
+ :aria-label="label"
52
+ >
53
+ <button
54
+ v-for="t in shown"
55
+ :key="t.clientId"
56
+ type="button"
57
+ class="jun-readers__chip group flex items-center gap-1.5 rounded-full py-0.5 pr-2 pl-1
58
+ text-[11px] whitespace-nowrap text-black/50 transition-colors duration-200
59
+ hover:bg-black/[0.05] hover:text-black/80 dark:text-white/50
60
+ dark:hover:bg-white/[0.07] dark:hover:text-white/85"
61
+ :class="[
62
+ t.idle ? 'opacity-50' : '',
63
+ followingClientId === t.clientId ? 'bg-black/[0.06] dark:bg-white/[0.08]' : ''
64
+ ]"
65
+ :title="titleFor(t)"
66
+ :aria-label="titleFor(t)"
67
+ @click="toggle(t.clientId)"
68
+ >
69
+ <span
70
+ class="jun-readers__dot inline-block size-2 shrink-0 rounded-full"
71
+ :style="{ background: t.color }"
72
+ />
73
+ <span
74
+ v-if="names"
75
+ class="max-w-24 truncate"
76
+ >{{ t.name }}</span>
77
+ <!-- Where in the page they are. Hidden on narrow screens, where a heading
78
+ beside a name is most of the viewport — the title still carries it. -->
79
+ <span
80
+ v-if="names && sectionFor(t)"
81
+ class="jun-readers__section hidden max-w-32 truncate text-black/35 sm:inline dark:text-white/35"
82
+ >· {{ sectionFor(t) }}</span>
83
+ <UIcon
84
+ v-if="followingClientId === t.clientId"
85
+ name="i-lucide-footprints"
86
+ class="size-3 shrink-0"
87
+ />
88
+ </button>
89
+
90
+ <span
91
+ v-if="overflow"
92
+ class="text-[11px] text-black/35 tabular-nums dark:text-white/35"
93
+ >+{{ overflow }}</span>
94
+ </div>
95
+ </template>
96
+
97
+ <style scoped>
98
+ .jun-readers__dot{animation:jun-readers-breathe 5s ease-in-out infinite}@keyframes jun-readers-breathe{0%,to{transform:scale(1)}50%{transform:scale(1.18)}}@media (prefers-reduced-motion:reduce){.jun-readers__dot{animation:none}}
99
+ </style>
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ /** The document this page IS. Peers are matched on the awareness `docId`. */
3
+ docId?: string;
4
+ /** Names beside the dots. Off gives dots and a count only. */
5
+ names?: boolean;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
8
+ names: boolean;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -31,7 +31,7 @@ const { commands } = useJunCommands();
31
31
  const { createPage } = useJunCreatePage();
32
32
  const { currentDocId, isRoot } = useJunCurrentDoc();
33
33
  const { recent, record } = useJunRecent();
34
- const { travellers } = useJunTravellers();
34
+ const { byDocId } = useJunTravellers();
35
35
  const nav = useJunNavSettings();
36
36
  const abra = useAbracadabra();
37
37
  const router = useRouter();
@@ -288,7 +288,7 @@ const rows = computed(() => {
288
288
  return [...recentRows.value, ...commandRows.value, ...jumpRows.value];
289
289
  });
290
290
  const hasRows = computed(() => rows.value.length > 0);
291
- const presenceOn = (id) => id ? travellers.value.filter((t) => t.docId === id) : [];
291
+ const presenceOn = (id) => id ? byDocId.value.get(id) ?? [] : [];
292
292
  function move(delta) {
293
293
  const n = rows.value.length;
294
294
  if (!n) return;
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ /** The document whose prose this is. Marks from other documents are ignored. */
3
+ docId: string;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,99 @@
1
+ <script setup>
2
+ import { computed, onBeforeUnmount, ref, watch } from "vue";
3
+ import { useJunFollow } from "#imports";
4
+ import { useJunSectionMarks, useJunSectionScan } from "../composables/useJunSections";
5
+ import { useJunTravellers } from "../composables/useJunPresence";
6
+ import { junDedupePeople } from "../utils/junPeople";
7
+ import { junGroupBySection, junSectionLabel, junShouldBroadcastSection } from "../utils/junSections";
8
+ const props = defineProps({
9
+ docId: { type: String, required: true }
10
+ });
11
+ const box = ref(null);
12
+ const { headings, currentIndex, measure } = useJunSectionScan(box);
13
+ const { peers, setLocal } = useJunSectionMarks();
14
+ const { byDocId } = useJunTravellers();
15
+ const { followers, toggle, followingClientId } = useJunFollow();
16
+ const watched = computed(() => junShouldBroadcastSection(
17
+ (byDocId.value.get(props.docId) ?? []).length,
18
+ followers.value.length
19
+ ));
20
+ watch(watched, (on) => {
21
+ if (on) measure();
22
+ else setLocal(null);
23
+ });
24
+ watch([() => props.docId, currentIndex, watched, headings], () => {
25
+ if (!watched.value) return;
26
+ const heading = headings.value[currentIndex.value];
27
+ if (!heading) {
28
+ setLocal(null);
29
+ return;
30
+ }
31
+ setLocal({ d: props.docId, i: heading.index, t: heading.text });
32
+ }, { immediate: true });
33
+ onBeforeUnmount(() => setLocal(null));
34
+ const marks = computed(() => {
35
+ const grouped = junGroupBySection(junDedupePeople(peers.value), props.docId);
36
+ const out = [];
37
+ for (const [index, readers] of grouped) {
38
+ const heading = headings.value[index];
39
+ if (!heading) continue;
40
+ out.push({ index, offset: heading.offset, readers });
41
+ }
42
+ return out;
43
+ });
44
+ function titleFor(readers, index) {
45
+ const where = junSectionLabel(headings.value[index]?.text ?? "");
46
+ const who = readers.length === 1 ? readers[0].name : `${readers.length} travellers`;
47
+ return `${who} \u2014 ${where}`;
48
+ }
49
+ </script>
50
+
51
+ <template>
52
+ <!-- `relative`: the markers are positioned against THIS box, whose offsets the
53
+ scan measured. `min-w-0` so it never widens a flex parent. -->
54
+ <div
55
+ ref="box"
56
+ class="jun-sections relative min-w-0"
57
+ :data-jun-sections="marks.length || void 0"
58
+ >
59
+ <slot />
60
+
61
+ <!-- The margin column. `pointer-events-none` on the layer, re-enabled on the
62
+ buttons, so a marker beside a paragraph never eats a text selection. -->
63
+ <div
64
+ v-if="marks.length"
65
+ class="pointer-events-none absolute inset-y-0 left-0 hidden w-0 sm:block"
66
+ aria-hidden="false"
67
+ data-jun-follow-ui
68
+ >
69
+ <button
70
+ v-for="m in marks"
71
+ :key="m.index"
72
+ type="button"
73
+ class="jun-sections__mark pointer-events-auto absolute flex -translate-x-full items-center gap-1 pr-3
74
+ transition-opacity duration-300 hover:opacity-100"
75
+ :style="{ top: `${m.offset}px` }"
76
+ :data-jun-section="m.index"
77
+ :title="titleFor(m.readers, m.index)"
78
+ :aria-label="titleFor(m.readers, m.index)"
79
+ @click="toggle(m.readers[0].clientId)"
80
+ >
81
+ <span
82
+ v-for="r in m.readers.slice(0, 3)"
83
+ :key="r.clientId"
84
+ class="jun-sections__dot inline-block size-2 shrink-0 rounded-full"
85
+ :class="followingClientId === r.clientId ? 'ring-2 ring-black/15 dark:ring-white/20' : ''"
86
+ :style="{ background: r.color }"
87
+ />
88
+ <span
89
+ v-if="m.readers.length > 3"
90
+ class="text-[10px] text-black/35 tabular-nums dark:text-white/35"
91
+ >+{{ m.readers.length - 3 }}</span>
92
+ </button>
93
+ </div>
94
+ </div>
95
+ </template>
96
+
97
+ <style scoped>
98
+ .jun-sections__dot{animation:jun-sections-breathe 5s ease-in-out infinite}@keyframes jun-sections-breathe{0%,to{opacity:.75;transform:scale(1)}50%{opacity:1;transform:scale(1.2)}}@media (prefers-reduced-motion:reduce){.jun-sections__dot{animation:none;opacity:.85}}
99
+ </style>
@@ -0,0 +1,17 @@
1
+ type __VLS_Props = {
2
+ /** The document whose prose this is. Marks from other documents are ignored. */
3
+ docId: string;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,37 @@
1
+ type __VLS_Props = {
2
+ /** The post being answered, or null for a new top-level one. */
3
+ replyTo: string | null;
4
+ sending?: boolean;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ /**
8
+ * JunThreadComposer — the box a visitor writes in.
9
+ *
10
+ * Its own component because a conversation has THREE of it in different places:
11
+ * above the posts when the newest are first, below them when they are in order,
12
+ * and inside whichever post is being replied to — so a reply is written where it
13
+ * will appear. Three copies of the markup would be three places to fix a keyboard
14
+ * shortcut.
15
+ *
16
+ * It only emits. The write is `jun.thread.post@1`, and the renderer owns it: a
17
+ * component that could post would need the identity rules too, and there would be
18
+ * two places that decide what a legal reply is.
19
+ *
20
+ * ⌘/Ctrl+Enter sends. Enter does NOT — a comment box that submits on Enter cannot
21
+ * hold a second paragraph, and people write paragraphs when they are answering
22
+ * something.
23
+ */
24
+ modelValue: string;
25
+ };
26
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
27
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ send: () => any;
29
+ "update:modelValue": (value: string) => any;
30
+ cancelReply: () => any;
31
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
32
+ onSend?: (() => any) | undefined;
33
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
34
+ onCancelReply?: (() => any) | undefined;
35
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
@@ -0,0 +1,54 @@
1
+ <script setup>
2
+ const model = defineModel({ type: String, ...{ required: true } });
3
+ const props = defineProps({
4
+ replyTo: { type: [String, null], required: true },
5
+ sending: { type: Boolean, required: false }
6
+ });
7
+ const emit = defineEmits(["send", "cancelReply"]);
8
+ function onKeydown(event) {
9
+ if ((event.metaKey || event.ctrlKey) && event.key === "Enter") {
10
+ event.preventDefault();
11
+ emit("send");
12
+ } else if (event.key === "Escape" && props.replyTo) {
13
+ event.preventDefault();
14
+ emit("cancelReply");
15
+ }
16
+ }
17
+ </script>
18
+
19
+ <template>
20
+ <div class="jun-thread-composer flex flex-col gap-2">
21
+ <textarea
22
+ v-model="model"
23
+ :placeholder="replyTo ? 'Your reply\u2026' : 'Say something\u2026'"
24
+ rows="3"
25
+ class="w-full resize-y rounded-xl bg-black/[0.03] px-3.5 py-2.5 text-sm text-default
26
+ outline-none ring-1 ring-black/5 placeholder:text-dimmed
27
+ dark:bg-white/[0.05] dark:ring-white/10"
28
+ data-jun-thread="input"
29
+ :disabled="sending"
30
+ @keydown="onKeydown"
31
+ />
32
+ <div class="flex items-center gap-2">
33
+ <UButton
34
+ size="xs"
35
+ color="neutral"
36
+ variant="soft"
37
+ :loading="sending"
38
+ :disabled="!model.trim() || sending"
39
+ :label="replyTo ? 'Reply' : 'Post'"
40
+ data-jun-thread="send"
41
+ @click="emit('send')"
42
+ />
43
+ <UButton
44
+ v-if="replyTo"
45
+ size="xs"
46
+ color="neutral"
47
+ variant="ghost"
48
+ label="Cancel"
49
+ @click="emit('cancelReply')"
50
+ />
51
+ <span class="text-[11px] text-dimmed">⌘↩ to send</span>
52
+ </div>
53
+ </div>
54
+ </template>
@@ -0,0 +1,37 @@
1
+ type __VLS_Props = {
2
+ /** The post being answered, or null for a new top-level one. */
3
+ replyTo: string | null;
4
+ sending?: boolean;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ /**
8
+ * JunThreadComposer — the box a visitor writes in.
9
+ *
10
+ * Its own component because a conversation has THREE of it in different places:
11
+ * above the posts when the newest are first, below them when they are in order,
12
+ * and inside whichever post is being replied to — so a reply is written where it
13
+ * will appear. Three copies of the markup would be three places to fix a keyboard
14
+ * shortcut.
15
+ *
16
+ * It only emits. The write is `jun.thread.post@1`, and the renderer owns it: a
17
+ * component that could post would need the identity rules too, and there would be
18
+ * two places that decide what a legal reply is.
19
+ *
20
+ * ⌘/Ctrl+Enter sends. Enter does NOT — a comment box that submits on Enter cannot
21
+ * hold a second paragraph, and people write paragraphs when they are answering
22
+ * something.
23
+ */
24
+ modelValue: string;
25
+ };
26
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
27
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
+ send: () => any;
29
+ "update:modelValue": (value: string) => any;
30
+ cancelReply: () => any;
31
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
32
+ onSend?: (() => any) | undefined;
33
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
34
+ onCancelReply?: (() => any) | undefined;
35
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
@@ -1,12 +1,13 @@
1
1
  <script setup>
2
2
  import { computed, resolveComponent } from "vue";
3
- import { useAbracadabra, useDocSlugs, useDocTree } from "#imports";
3
+ import { useAbracadabra, useDocSlugs, useDocTree, useJunFollow } from "#imports";
4
4
  import { useJunTravellers } from "../composables/useJunPresence";
5
5
  const props = defineProps({
6
6
  list: { type: Boolean, required: false, default: false }
7
7
  });
8
8
  const NuxtLink = resolveComponent("NuxtLink");
9
- const { travellers } = useJunTravellers();
9
+ const { people: travellers } = useJunTravellers();
10
+ const { toggle: toggleFollow, followingClientId } = useJunFollow();
10
11
  const { getDocUrl } = useDocSlugs();
11
12
  const { getEntry } = useDocTree();
12
13
  const abra = useAbracadabra();
@@ -73,7 +74,12 @@ function placeFor(t) {
73
74
  </button>
74
75
 
75
76
  <template #content>
76
- <div class="w-56 py-1.5">
77
+ <!-- `data-jun-follow-ui`: going to where a traveller IS, from the list
78
+ that says where they are, must not read as leaving the journey. -->
79
+ <div
80
+ class="w-64 py-1.5"
81
+ data-jun-follow-ui
82
+ >
77
83
  <p class="px-3.5 pt-1.5 pb-1 text-[10px] tracking-[0.22em] uppercase text-black/35 dark:text-white/35">
78
84
  {{ travellers.length === 1 ? "Fellow traveller" : "Fellow travellers" }}
79
85
  </p>
@@ -81,12 +87,16 @@ function placeFor(t) {
81
87
  <li
82
88
  v-for="t in travellers"
83
89
  :key="t.clientId"
84
- :class="t.idle ? 'opacity-50' : ''"
90
+ class="group flex items-center transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.05]"
91
+ :class="[
92
+ t.idle ? 'opacity-50' : '',
93
+ followingClientId === t.clientId ? 'bg-black/[0.05] dark:bg-white/[0.06]' : ''
94
+ ]"
85
95
  >
86
96
  <component
87
97
  :is="placeFor(t).to ? NuxtLink : 'div'"
88
98
  :to="placeFor(t).to ?? void 0"
89
- class="flex items-center gap-2.5 px-3.5 py-2 transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.05]"
99
+ class="flex min-w-0 flex-1 items-center gap-2.5 py-2 pl-3.5"
90
100
  >
91
101
  <span
92
102
  class="inline-block size-2 shrink-0 rounded-full"
@@ -99,6 +109,26 @@ function placeFor(t) {
99
109
  </span>
100
110
  </span>
101
111
  </component>
112
+ <!-- Always rendered, never hover-only: a control that appears on
113
+ hover is unreachable from a keyboard and invisible on a touch
114
+ screen. It fades UP on hover instead. -->
115
+ <button
116
+ type="button"
117
+ class="mr-2 flex size-7 shrink-0 items-center justify-center rounded-full text-black/35
118
+ opacity-60 transition-all duration-200 group-hover:opacity-100 hover:bg-black/[0.06]
119
+ hover:text-black/70 focus-visible:opacity-100 dark:text-white/35
120
+ dark:hover:bg-white/[0.08] dark:hover:text-white/80"
121
+ :class="followingClientId === t.clientId ? 'opacity-100 text-black/70 dark:text-white/80' : ''"
122
+ :title="followingClientId === t.clientId ? `Stop following ${t.name}` : `Travel with ${t.name}`"
123
+ :aria-label="followingClientId === t.clientId ? `Stop following ${t.name}` : `Travel with ${t.name}`"
124
+ :aria-pressed="followingClientId === t.clientId"
125
+ @click="toggleFollow(t.clientId)"
126
+ >
127
+ <UIcon
128
+ :name="followingClientId === t.clientId ? 'i-lucide-footprints' : 'i-lucide-arrow-right-to-line'"
129
+ class="size-3.5"
130
+ />
131
+ </button>
102
132
  </li>
103
133
  </ul>
104
134
  </div>
@@ -16,8 +16,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
16
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
17
  title: string;
18
18
  start: number;
19
- poster: string;
20
19
  ratio: boolean;
20
+ poster: string;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  export default _default;
@@ -16,8 +16,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
16
16
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
17
  title: string;
18
18
  start: number;
19
- poster: string;
20
19
  ratio: boolean;
20
+ poster: string;
21
21
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
22
  declare const _default: typeof __VLS_export;
23
23
  export default _default;