@abraca/junis 2.84.0 → 2.86.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/dist/module.d.mts +17 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +270 -22
- package/dist/runtime/assets/css/jun.css +1 -1
- package/dist/runtime/components/JunBlobBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunCampfirePresence.client.vue +75 -10
- package/dist/runtime/components/JunCollectionIntro.d.vue.ts +11 -0
- package/dist/runtime/components/JunCollectionIntro.vue +45 -0
- package/dist/runtime/components/JunCollectionIntro.vue.d.ts +11 -0
- package/dist/runtime/components/JunConfigRow.d.vue.ts +43 -0
- package/dist/runtime/components/JunConfigRow.vue +34 -0
- package/dist/runtime/components/JunConfigRow.vue.d.ts +43 -0
- package/dist/runtime/components/JunFooter.vue +1 -1
- package/dist/runtime/components/JunHead.vue +37 -5
- package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +30 -0
- package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +30 -0
- package/dist/runtime/components/JunLinksRow.d.vue.ts +16 -1
- package/dist/runtime/components/JunLinksRow.vue +17 -7
- package/dist/runtime/components/JunLinksRow.vue.d.ts +16 -1
- package/dist/runtime/components/JunLogo.vue +10 -45
- package/dist/runtime/components/JunMedia.client.d.vue.ts +1 -1
- package/dist/runtime/components/JunMedia.client.vue.d.ts +1 -1
- package/dist/runtime/components/JunNavigation.vue +21 -4
- package/dist/runtime/components/JunNoteLinks.d.vue.ts +6 -0
- package/dist/runtime/components/JunNoteLinks.vue +57 -0
- package/dist/runtime/components/JunNoteLinks.vue.d.ts +6 -0
- package/dist/runtime/components/JunPageHero.d.vue.ts +8 -2
- package/dist/runtime/components/JunPageHero.vue +15 -3
- package/dist/runtime/components/JunPageHero.vue.d.ts +8 -2
- package/dist/runtime/components/JunPatternBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunReaders.d.vue.ts +11 -0
- package/dist/runtime/components/JunReaders.vue +99 -0
- package/dist/runtime/components/JunReaders.vue.d.ts +11 -0
- package/dist/runtime/components/JunSearch.client.vue +2 -2
- package/dist/runtime/components/JunSectionPresence.client.d.vue.ts +17 -0
- package/dist/runtime/components/JunSectionPresence.client.vue +99 -0
- package/dist/runtime/components/JunSectionPresence.client.vue.d.ts +17 -0
- package/dist/runtime/components/JunShaderBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunThreadComposer.d.vue.ts +37 -0
- package/dist/runtime/components/JunThreadComposer.vue +54 -0
- package/dist/runtime/components/JunThreadComposer.vue.d.ts +37 -0
- package/dist/runtime/components/JunTravellersChip.vue +35 -5
- package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +1 -1
- package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +1 -1
- package/dist/runtime/components/JunViewControl.d.vue.ts +29 -0
- package/dist/runtime/components/JunViewControl.vue +340 -0
- package/dist/runtime/components/JunViewControl.vue.d.ts +29 -0
- package/dist/runtime/components/JunViewControls.d.vue.ts +27 -0
- package/dist/runtime/components/JunViewControls.vue +94 -0
- package/dist/runtime/components/JunViewControls.vue.d.ts +27 -0
- package/dist/runtime/components/renderers/JunAppsRenderer.vue +45 -4
- package/dist/runtime/components/renderers/JunCinemaRenderer.vue +42 -4
- package/dist/runtime/components/renderers/JunConfigRenderer.vue +362 -239
- package/dist/runtime/components/renderers/JunCourseRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunCourseRenderer.vue +229 -0
- package/dist/runtime/components/renderers/JunCourseRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunCvRenderer.vue +44 -6
- package/dist/runtime/components/renderers/JunDeckRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunDeckRenderer.vue +370 -0
- package/dist/runtime/components/renderers/JunDeckRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunEntryRenderer.vue +157 -31
- package/dist/runtime/components/renderers/JunFestivalRenderer.vue +42 -5
- package/dist/runtime/components/renderers/JunGardenRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunGardenRenderer.vue +280 -0
- package/dist/runtime/components/renderers/JunGardenRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +96 -14
- package/dist/runtime/components/renderers/JunHomeRenderer.vue +31 -132
- package/dist/runtime/components/renderers/JunItemRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunItemRenderer.vue +398 -0
- package/dist/runtime/components/renderers/JunItemRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunJournalRenderer.vue +141 -11
- package/dist/runtime/components/renderers/JunLibraryRenderer.vue +295 -12
- package/dist/runtime/components/renderers/JunLinksRenderer.vue +33 -1
- package/dist/runtime/components/renderers/JunLiveRenderer.vue +38 -2
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue +3 -2
- package/dist/runtime/components/renderers/JunMovieRenderer.vue +32 -5
- package/dist/runtime/components/renderers/JunNowRenderer.vue +40 -7
- package/dist/runtime/components/renderers/JunPollRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunPollRenderer.vue +231 -0
- package/dist/runtime/components/renderers/JunPollRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.vue +74 -18
- package/dist/runtime/components/renderers/JunServicesRenderer.vue +40 -2
- package/dist/runtime/components/renderers/JunStatsRenderer.vue +37 -50
- package/dist/runtime/components/renderers/JunThreadRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunThreadRenderer.vue +304 -0
- package/dist/runtime/components/renderers/JunThreadRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunTrackRenderer.vue +32 -4
- package/dist/runtime/components/renderers/JunUsesRenderer.vue +57 -13
- package/dist/runtime/components/renderers/JunWallRenderer.vue +60 -5
- package/dist/runtime/composables/useJunDeck.d.ts +66 -0
- package/dist/runtime/composables/useJunDeck.js +61 -0
- package/dist/runtime/composables/useJunDocPage.d.ts +14 -11
- package/dist/runtime/composables/useJunDocPage.js +67 -3
- package/dist/runtime/composables/useJunFollow.d.ts +65 -9
- package/dist/runtime/composables/useJunFollow.js +237 -20
- package/dist/runtime/composables/useJunGarden.d.ts +67 -0
- package/dist/runtime/composables/useJunGarden.js +92 -0
- package/dist/runtime/composables/useJunOptions.d.ts +1 -0
- package/dist/runtime/composables/useJunPresence.d.ts +26 -0
- package/dist/runtime/composables/useJunPresence.js +9 -2
- package/dist/runtime/composables/useJunSections.d.ts +73 -0
- package/dist/runtime/composables/useJunSections.js +117 -0
- package/dist/runtime/composables/useJunSettings.d.ts +1 -1
- package/dist/runtime/composables/useJunSettings.js +5 -1
- package/dist/runtime/composables/useJunSiteConfig.d.ts +37 -0
- package/dist/runtime/composables/useJunTheme.js +49 -50
- package/dist/runtime/composables/useJunViewOptions.d.ts +85 -0
- package/dist/runtime/composables/useJunViewOptions.js +63 -0
- package/dist/runtime/pages/doc.vue +14 -8
- package/dist/runtime/plugins/jun-sw.client.d.ts +2 -0
- package/dist/runtime/plugins/jun-sw.client.js +36 -0
- package/dist/runtime/server/api/health.get.d.ts +19 -0
- package/dist/runtime/server/api/health.get.js +40 -0
- package/dist/runtime/server/api/links.get.d.ts +19 -0
- package/dist/runtime/server/api/links.get.js +37 -0
- package/dist/runtime/server/api/resolve/[...slug].get.d.ts +9 -0
- package/dist/runtime/server/api/resolve/[...slug].get.js +5 -0
- package/dist/runtime/server/api/stats.get.js +2 -1
- package/dist/runtime/server/janitor/junJanitorChores.js +8 -0
- package/dist/runtime/server/plugins/jun-bootstrap.js +103 -15
- package/dist/runtime/server/plugins/jun-doc-cache.js +42 -4
- package/dist/runtime/server/plugins/jun-janitor.js +9 -1
- package/dist/runtime/server/plugins/jun-rpc.js +293 -0
- package/dist/runtime/server/plugins/jun-watchdog.d.ts +2 -0
- package/dist/runtime/server/plugins/jun-watchdog.js +54 -0
- package/dist/runtime/server/routes/jun-icon.png.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-icon.png.get.js +25 -0
- package/dist/runtime/server/routes/jun-icon.svg.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-icon.svg.get.js +9 -0
- package/dist/runtime/server/routes/jun-splash.png.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-splash.png.get.js +37 -0
- package/dist/runtime/server/routes/jun-sw.js.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-sw.js.get.js +126 -0
- package/dist/runtime/server/routes/manifest.webmanifest.get.d.ts +24 -0
- package/dist/runtime/server/routes/manifest.webmanifest.get.js +51 -0
- package/dist/runtime/server/routes/sitemap.xml.get.js +2 -0
- package/dist/runtime/server/utils/junBoot.d.ts +1 -0
- package/dist/runtime/server/utils/junBoot.js +4 -0
- package/dist/runtime/server/utils/junBrand.d.ts +4 -0
- package/dist/runtime/server/utils/junBrand.js +9 -0
- package/dist/runtime/server/utils/junCache.d.ts +17 -0
- package/dist/runtime/server/utils/junCache.js +5 -0
- package/dist/runtime/server/utils/junIcon.d.ts +44 -0
- package/dist/runtime/server/utils/junIcon.js +374 -0
- package/dist/runtime/server/utils/junSeedGate.d.ts +68 -0
- package/dist/runtime/server/utils/junSeedGate.js +41 -0
- package/dist/runtime/types.d.ts +82 -3
- package/dist/runtime/utils/junCourse.d.ts +106 -0
- package/dist/runtime/utils/junCourse.js +65 -0
- package/dist/runtime/utils/junGarden.d.ts +193 -0
- package/dist/runtime/utils/junGarden.js +233 -0
- package/dist/runtime/utils/junIdentity.d.ts +121 -0
- package/dist/runtime/utils/junIdentity.js +115 -0
- package/dist/runtime/utils/junMark.d.ts +254 -0
- package/dist/runtime/utils/junMark.js +169 -0
- package/dist/runtime/utils/junMetaSchemas.js +8 -1
- package/dist/runtime/utils/junModeration.d.ts +67 -0
- package/dist/runtime/utils/junModeration.js +20 -0
- package/dist/runtime/utils/junMotion.d.ts +26 -0
- package/dist/runtime/utils/junMotion.js +31 -0
- package/dist/runtime/utils/junPeople.d.ts +43 -0
- package/dist/runtime/utils/junPeople.js +9 -0
- package/dist/runtime/utils/junPoll.d.ts +79 -0
- package/dist/runtime/utils/junPoll.js +82 -0
- package/dist/runtime/utils/junReadiness.d.ts +131 -0
- package/dist/runtime/utils/junReadiness.js +69 -0
- package/dist/runtime/utils/junSections.d.ts +115 -0
- package/dist/runtime/utils/junSections.js +45 -0
- package/dist/runtime/utils/junSlides.d.ts +66 -0
- package/dist/runtime/utils/junSlides.js +47 -0
- package/dist/runtime/utils/junThread.d.ts +81 -0
- package/dist/runtime/utils/junThread.js +75 -0
- package/dist/runtime/utils/junViewSpecs.d.ts +671 -0
- package/dist/runtime/utils/junViewSpecs.js +534 -0
- package/dist/runtime/utils/junViewValues.d.ts +125 -0
- package/dist/runtime/utils/junViewValues.js +104 -0
- package/dist/types.d.mts +1 -1
- package/package.json +5 -1
|
@@ -2,53 +2,18 @@
|
|
|
2
2
|
import { computed, useId } from "vue";
|
|
3
3
|
import { useJunOptions } from "../composables/useJunOptions";
|
|
4
4
|
import { useJunEffectiveConfig } from "../composables/useJunSiteConfig";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
// centred in the box at every size, and the shoot leaves it at the same
|
|
9
|
-
// angle the hook exits — the two arms balance instead of one out-weighing
|
|
10
|
-
// the other, which is what made the old draw lean right.
|
|
11
|
-
sprout: {
|
|
12
|
-
paths: [
|
|
13
|
-
{ d: "M24 18v12.2c0 7.4-3.6 11.1-9.8 9", w: 3.4 },
|
|
14
|
-
{ d: "M24 25.4 32.6 18.6", w: 3.4 }
|
|
15
|
-
],
|
|
16
|
-
dots: [
|
|
17
|
-
{ cx: 24, cy: 9.6, r: 3.4 },
|
|
18
|
-
{ cx: 35.4, cy: 16.4, r: 2.8 },
|
|
19
|
-
{ cx: 11.2, cy: 38.2, r: 2.8 }
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
// The graph. Edges stop SHORT of each node and tuck under it, so the joins
|
|
23
|
-
// stay clean when the stroke is only a couple of device pixels wide.
|
|
24
|
-
node: {
|
|
25
|
-
paths: [
|
|
26
|
-
{ d: "M31.5 13.5V24.5", w: 3.2 },
|
|
27
|
-
{ d: "M29.2 28.6 18.9 35.2", w: 3.2 }
|
|
28
|
-
],
|
|
29
|
-
dots: [
|
|
30
|
-
{ cx: 31.5, cy: 10.8, r: 3.5 },
|
|
31
|
-
{ cx: 31.5, cy: 27.2, r: 3.5 },
|
|
32
|
-
{ cx: 16.6, cy: 36.6, r: 3.5 }
|
|
33
|
-
]
|
|
34
|
-
},
|
|
35
|
-
// The document, with the bang set inside it. The old three-stroke mini-tree
|
|
36
|
-
// in there turned to mush below ~20px; one stem and one dot survive it.
|
|
37
|
-
page: {
|
|
38
|
-
paths: [
|
|
39
|
-
{ d: "M13 6h14l8 8v28H13z", w: 3, join: true },
|
|
40
|
-
{ d: "M27 6v8h8", w: 3, join: true },
|
|
41
|
-
{ d: "M24 18v8.6", w: 3.2 }
|
|
42
|
-
],
|
|
43
|
-
dots: [
|
|
44
|
-
{ cx: 24, cy: 31.8, r: 2.2 }
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
};
|
|
5
|
+
import { JUN_MARKS, JUN_MARK_NAMES, JUN_SUN } from "../utils/junMark";
|
|
6
|
+
const KNOWN_MARKS = JUN_MARK_NAMES;
|
|
7
|
+
const MARKS = JUN_MARKS;
|
|
48
8
|
const SUN = {
|
|
49
9
|
body: { from: "var(--jun-sun-from)", to: "var(--jun-sun-to)" },
|
|
50
10
|
core: "var(--jun-sun-core)",
|
|
51
|
-
|
|
11
|
+
// The NUMBERS come from `JUN_SUN`, for the same reason `MARKS` does: the
|
|
12
|
+
// favicon and the app icon draw this orb too, and a glow centre that is 45
|
|
13
|
+
// here and 44 there is a mark that quietly differs between the tab and the
|
|
14
|
+
// navbar. Only the COLOURS are stated here, because only the DOM has CSS
|
|
15
|
+
// variables to state them with.
|
|
16
|
+
glow: { color: "var(--jun-sun-glow)", cx: JUN_SUN.glow.cx, cy: JUN_SUN.glow.cy, r: JUN_SUN.glow.r },
|
|
52
17
|
/**
|
|
53
18
|
* The core's soft ring — the blob's `box-shadow: 0 0 20px rgba(0,0,0,.2)`,
|
|
54
19
|
* drawn as GEOMETRY rather than as a CSS `drop-shadow`.
|
|
@@ -63,7 +28,7 @@ const SUN = {
|
|
|
63
28
|
* `r` 17 against the core's 12 is the old 10-unit blur radius, and the two
|
|
64
29
|
* inner stops reproduce its falloff — flat to the core's edge, then out.
|
|
65
30
|
*/
|
|
66
|
-
halo:
|
|
31
|
+
halo: JUN_SUN.halo
|
|
67
32
|
};
|
|
68
33
|
const props = defineProps({
|
|
69
34
|
title: { type: String, required: false, default: "Home" },
|
|
@@ -31,10 +31,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
31
31
|
full: boolean;
|
|
32
32
|
mimeType: string;
|
|
33
33
|
stream: boolean;
|
|
34
|
+
poster: string;
|
|
34
35
|
autoplay: boolean;
|
|
35
36
|
alt: string;
|
|
36
37
|
mediaClass: string;
|
|
37
|
-
poster: string;
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
declare const _default: typeof __VLS_export;
|
|
40
40
|
export default _default;
|
|
@@ -31,10 +31,10 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
31
31
|
full: boolean;
|
|
32
32
|
mimeType: string;
|
|
33
33
|
stream: boolean;
|
|
34
|
+
poster: string;
|
|
34
35
|
autoplay: boolean;
|
|
35
36
|
alt: string;
|
|
36
37
|
mediaClass: string;
|
|
37
|
-
poster: string;
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
declare const _default: typeof __VLS_export;
|
|
40
40
|
export default _default;
|
|
@@ -19,7 +19,7 @@ import { useJunNavSettings } from "../composables/useJunNavSettings";
|
|
|
19
19
|
import { useJunSearch } from "../composables/useJunSearch";
|
|
20
20
|
import { useJunStudio } from "../composables/useJunStudio";
|
|
21
21
|
import { useJunRename } from "../composables/useJunRename";
|
|
22
|
-
import { useJunTravellers } from "../composables/useJunPresence";
|
|
22
|
+
import { junDedupeTravellers, useJunTravellers } from "../composables/useJunPresence";
|
|
23
23
|
const props = defineProps({
|
|
24
24
|
navigation: { type: Array, required: true }
|
|
25
25
|
});
|
|
@@ -185,6 +185,7 @@ const presenceByNavId = computed(() => {
|
|
|
185
185
|
list.push(t);
|
|
186
186
|
map.set(top, list);
|
|
187
187
|
}
|
|
188
|
+
for (const [id, list] of map) map.set(id, junDedupeTravellers(list));
|
|
188
189
|
return map;
|
|
189
190
|
});
|
|
190
191
|
const presenceFor = (id) => id ? presenceByNavId.value.get(id) ?? [] : [];
|
|
@@ -1033,9 +1034,25 @@ onUnmounted(() => {
|
|
|
1033
1034
|
aria-hidden="true"
|
|
1034
1035
|
/>
|
|
1035
1036
|
|
|
1036
|
-
<!-- Ambient presence. Colour rides on presence ONLY.
|
|
1037
|
+
<!-- Ambient presence. Colour rides on presence ONLY.
|
|
1038
|
+
|
|
1039
|
+
Both dots are gated on `mounted`, and that gate is
|
|
1040
|
+
load-bearing rather than cosmetic. Presence comes
|
|
1041
|
+
from awareness and freshness from this browser's own
|
|
1042
|
+
last-seen stamps — neither exists on the server, so
|
|
1043
|
+
whenever a peer was connected (the janitor and the
|
|
1044
|
+
doc-cache runner always are) the client's first
|
|
1045
|
+
render added a `<span>` where the server had emitted
|
|
1046
|
+
a comment placeholder, and Vue reported a hydration
|
|
1047
|
+
node mismatch on EVERY page of the site. `parity:nav`
|
|
1048
|
+
failed on it for as long as it has existed.
|
|
1049
|
+
|
|
1050
|
+
Deferring to `mounted` makes the first client render
|
|
1051
|
+
identical to the server's and the dot an ordinary
|
|
1052
|
+
reactive update one tick later — the same fix, and
|
|
1053
|
+
the same reasoning, as the navbar mode above. -->
|
|
1037
1054
|
<span
|
|
1038
|
-
v-if="presenceFor(item.id).length"
|
|
1055
|
+
v-if="mounted && presenceFor(item.id).length"
|
|
1039
1056
|
class="jun-nav-presence-dot absolute -top-0.5 -right-0.5 size-1.5 rounded-full"
|
|
1040
1057
|
:style="{ background: presenceFor(item.id)[0].color }"
|
|
1041
1058
|
:title="`${presenceFor(item.id).length} ${presenceFor(item.id).length === 1 ? 'traveller' : 'travellers'} here`"
|
|
@@ -1043,7 +1060,7 @@ onUnmounted(() => {
|
|
|
1043
1060
|
<!-- Freshness. Hollow and monochrome, so presence stays the
|
|
1044
1061
|
only colour in the chrome. -->
|
|
1045
1062
|
<span
|
|
1046
|
-
v-else-if="freshFor(item)"
|
|
1063
|
+
v-else-if="mounted && freshFor(item)"
|
|
1047
1064
|
class="absolute -top-0.5 -right-0.5 size-1.5 rounded-full ring-1 ring-inset ring-current opacity-50"
|
|
1048
1065
|
title="Updated since your last visit"
|
|
1049
1066
|
aria-hidden="true"
|
|
@@ -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;
|
|
@@ -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
|
|
13
|
+
declare var __VLS_6: {};
|
|
8
14
|
type __VLS_Slots = {} & {
|
|
9
|
-
right?: (props: typeof
|
|
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="
|
|
83
|
-
|
|
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
|
|
13
|
+
declare var __VLS_6: {};
|
|
8
14
|
type __VLS_Slots = {} & {
|
|
9
|
-
right?: (props: typeof
|
|
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;
|
|
@@ -91,5 +91,5 @@ onBeforeUnmount(() => {
|
|
|
91
91
|
</template>
|
|
92
92
|
|
|
93
93
|
<style scoped>
|
|
94
|
-
.jun-pattern-backdrop{background
|
|
94
|
+
.jun-pattern-backdrop{background:var(--jun-canvas);min-height:100lvh}.pattern-parallax{inset:-3%;opacity:var(--jun-blob-opacity,1);position:absolute;transform:translate3d(var(--px,0),var(--py,0),0);transition:opacity .6s ease;will-change:transform}.is-quiet .pattern-parallax{opacity:0}.layer{inset:0;position:absolute;will-change:transform,opacity}.is-paused .layer{animation-play-state:paused}.is-dots .layer--1{animation:pattern-drift-dots 60s linear infinite;background-image:radial-gradient(circle at center,var(--jun-bd-a) 1.1px,transparent 1.2px);background-size:26px 26px;opacity:.18}.is-dots .layer--2{background:radial-gradient(ellipse 70% 60% at 50% 0,var(--jun-bd-c) 0,transparent 70%);opacity:.22}:root.dark .is-dots .layer--1{opacity:.4}:root.dark .is-dots .layer--2{opacity:.34}.is-grid .layer--1{animation:pattern-drift-grid 90s linear infinite;background-size:64px 64px;-webkit-mask-image:radial-gradient(ellipse 80% 70% at 50% 40%,#000 20%,transparent 78%);mask-image:radial-gradient(ellipse 80% 70% at 50% 40%,#000 20%,transparent 78%);opacity:.13}.is-grid .layer--1,.is-grid .layer--2{background-image:linear-gradient(to right,var(--jun-bd-a) 1px,transparent 1px),linear-gradient(to bottom,var(--jun-bd-a) 1px,transparent 1px)}.is-grid .layer--2{background-size:16px 16px;-webkit-mask-image:radial-gradient(ellipse 60% 50% at 50% 40%,#000 10%,transparent 70%);mask-image:radial-gradient(ellipse 60% 50% at 50% 40%,#000 10%,transparent 70%);opacity:.06}:root.dark .is-grid .layer--1{opacity:.32}:root.dark .is-grid .layer--2{opacity:.14}.is-aurora .layer--1{animation:pattern-aurora-a 38s ease-in-out infinite;background:linear-gradient(115deg,transparent 12%,var(--jun-bd-a) 38%,transparent 62%);mix-blend-mode:multiply;opacity:.3}.is-aurora .layer--2{animation:pattern-aurora-b 52s ease-in-out infinite;background:linear-gradient(-70deg,transparent 20%,var(--jun-bd-c) 50%,transparent 80%);mix-blend-mode:multiply;opacity:.26}:root.dark .is-aurora .layer--1,:root.dark .is-aurora .layer--2{mix-blend-mode:screen;opacity:.55}.is-mesh .layer--1{animation:pattern-mesh-a 44s ease-in-out infinite;background:radial-gradient(closest-side at 12% 18%,var(--jun-bd-a) 0,transparent 70%),radial-gradient(closest-side at 88% 12%,var(--jun-bd-c) 0,transparent 72%);background-repeat:no-repeat;background-size:70% 70%,65% 65%;mix-blend-mode:multiply;opacity:.5}.is-mesh .layer--2{animation:pattern-mesh-b 57s ease-in-out infinite;background:radial-gradient(closest-side at 20% 88%,var(--jun-bd-b) 0,transparent 72%),radial-gradient(closest-side at 82% 82%,var(--jun-bd-a) 0,transparent 68%);background-repeat:no-repeat;background-size:68% 68%,62% 62%;mix-blend-mode:multiply;opacity:.42}:root.dark .is-mesh .layer--1{mix-blend-mode:screen;opacity:.62}:root.dark .is-mesh .layer--2{mix-blend-mode:screen;opacity:.55}.is-rings .layer--1{animation:pattern-rings 26s ease-out infinite;background:repeating-radial-gradient(circle at 50% 42%,var(--jun-bd-a) 0 1px,transparent 1px 84px);-webkit-mask-image:radial-gradient(circle at 50% 42%,#000 5%,transparent 72%);mask-image:radial-gradient(circle at 50% 42%,#000 5%,transparent 72%);opacity:.16}.is-rings .layer--2{background:radial-gradient(circle at 50% 42%,var(--jun-bd-c) 0,transparent 55%);mix-blend-mode:multiply;opacity:.3}:root.dark .is-rings .layer--1{--jun-ring-o:0.34}:root.dark .is-rings .layer--2{mix-blend-mode:screen;opacity:.4}.is-waves .layer--1{animation:pattern-wave-a 30s ease-in-out infinite;background:radial-gradient(ellipse 120% 60% at 50% 118%,var(--jun-bd-a) 0,transparent 70%);mix-blend-mode:multiply;opacity:.34}.is-waves .layer--2{animation:pattern-wave-b 43s ease-in-out infinite;background:radial-gradient(ellipse 150% 55% at 30% 126%,var(--jun-bd-c) 0,transparent 68%);mix-blend-mode:multiply;opacity:.3}.is-waves .layer--3{animation:pattern-wave-c 37s ease-in-out infinite;background:radial-gradient(ellipse 100% 70% at 78% 132%,var(--jun-bd-b) 0,transparent 65%);mix-blend-mode:multiply;opacity:.24}:root.dark .is-waves .layer--1,:root.dark .is-waves .layer--2,:root.dark .is-waves .layer--3{mix-blend-mode:screen;opacity:.56}.is-noise .layer--1{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='a'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3' type='fractalNoise'/%3E%3C/filter%3E%3Cpath d='M0 0h120v120H0z' filter='url(%23a)' opacity='.5'/%3E%3C/svg%3E");opacity:.055}.is-noise .layer--2{background:radial-gradient(ellipse 90% 70% at 50% 0,var(--jun-bd-c) 0,transparent 72%);mix-blend-mode:multiply;opacity:.28}:root.dark .is-noise .layer--1{opacity:.13}:root.dark .is-noise .layer--2{mix-blend-mode:screen;opacity:.36}@keyframes pattern-drift-dots{0%{transform:translate(0)}to{transform:translate(26px,26px)}}@keyframes pattern-drift-grid{0%{transform:translate(0)}to{transform:translate(64px)}}@keyframes pattern-aurora-a{0%,to{transform:translate(-6%,-4%) scale(1.15)}50%{transform:translate(8%,6%) scale(1.3)}}@keyframes pattern-aurora-b{0%,to{transform:translate(7%,5%) scale(1.25)}50%{transform:translate(-8%,-6%) scale(1.1)}}@keyframes pattern-mesh-a{0%,to{transform:translate(0) scale(1)}50%{transform:translate(5%,4%) scale(1.12)}}@keyframes pattern-mesh-b{0%,to{transform:translate(0) scale(1.06)}50%{transform:translate(-6%,-3%) scale(.96)}}@keyframes pattern-rings{0%{opacity:var(--jun-ring-o,.16);transform:scale(1)}to{opacity:0;transform:scale(1.9)}}@keyframes pattern-wave-a{0%,to{transform:translate(0)}50%{transform:translate(-4%,-3%)}}@keyframes pattern-wave-b{0%,to{transform:translate(0)}50%{transform:translate(5%,-2%)}}@keyframes pattern-wave-c{0%,to{transform:translate(0)}50%{transform:translate(-3%,-4%)}}@media (prefers-reduced-motion:reduce){.layer{animation:none!important}.pattern-parallax{transform:none!important}}
|
|
95
95
|
</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;
|
|
@@ -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 {
|
|
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 ?
|
|
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
|
+
};
|
|
@@ -78,5 +78,5 @@ const plasmaWarp = computed(() => paletteName.value === "globe" ? 0.45 : 0.55);
|
|
|
78
78
|
</template>
|
|
79
79
|
|
|
80
80
|
<style scoped>
|
|
81
|
-
.jun-shader-backdrop{-webkit-mask-image:radial-gradient(160% 130% at 50% 50%,#000 0,#000 80%,rgba(0,0,0,.9) 100%);mask-image:radial-gradient(160% 130% at 50% 50%,#000 0,#000 80%,rgba(0,0,0,.9) 100%)}.jun-shader-backdrop :deep(.shader),.jun-shader-backdrop :deep(canvas){display:block;height:100%!important;width:100%!important}.jun-vignette{background:radial-gradient(130% 90% at 50% 50%,transparent 40%,hsla(0,0%,100%,.18) 100%);inset:0;pointer-events:none;position:absolute}:root.dark .jun-vignette{background:radial-gradient(130% 90% at 50% 50%,transparent 40%,rgba(0,0,0,.3) 100%)}
|
|
81
|
+
.jun-shader-backdrop{background:var(--jun-canvas);-webkit-mask-image:radial-gradient(160% 130% at 50% 50%,#000 0,#000 80%,rgba(0,0,0,.9) 100%);mask-image:radial-gradient(160% 130% at 50% 50%,#000 0,#000 80%,rgba(0,0,0,.9) 100%);min-height:100lvh}.jun-shader-backdrop :deep(.shader),.jun-shader-backdrop :deep(canvas){display:block;height:100%!important;width:100%!important}.jun-vignette{background:radial-gradient(130% 90% at 50% 50%,transparent 40%,hsla(0,0%,100%,.18) 100%);inset:0;pointer-events:none;position:absolute}:root.dark .jun-vignette{background:radial-gradient(130% 90% at 50% 50%,transparent 40%,rgba(0,0,0,.3) 100%)}
|
|
82
82
|
</style>
|