@abraca/junis 2.96.0 → 2.97.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 (38) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/JunBreadcrumbs.vue +40 -4
  3. package/dist/runtime/components/JunCampfireRoster.vue +4 -0
  4. package/dist/runtime/components/JunDocMenuHost.d.vue.ts +3 -0
  5. package/dist/runtime/components/JunDocMenuHost.vue +39 -0
  6. package/dist/runtime/components/JunDocMenuHost.vue.d.ts +3 -0
  7. package/dist/runtime/components/JunHorizontalTimeline.vue +5 -0
  8. package/dist/runtime/components/JunItemMenu.vue +51 -2
  9. package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +11 -0
  10. package/dist/runtime/components/JunMosaicPane.client.vue +14 -2
  11. package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +11 -0
  12. package/dist/runtime/components/JunNavDock.vue +3 -0
  13. package/dist/runtime/components/JunNavMenu.client.vue +4 -0
  14. package/dist/runtime/components/JunNavigation.vue +10 -0
  15. package/dist/runtime/components/JunNotFound.vue +4 -0
  16. package/dist/runtime/components/JunNoteLinks.vue +3 -0
  17. package/dist/runtime/components/JunSearch.client.vue +8 -0
  18. package/dist/runtime/components/JunSectionBar.vue +4 -0
  19. package/dist/runtime/components/JunTravellersChip.vue +3 -0
  20. package/dist/runtime/components/renderers/JunCourseRenderer.vue +8 -0
  21. package/dist/runtime/components/renderers/JunEntryRenderer.vue +4 -0
  22. package/dist/runtime/components/renderers/JunGardenRenderer.vue +94 -36
  23. package/dist/runtime/components/renderers/JunHomeRenderer.vue +4 -0
  24. package/dist/runtime/components/renderers/JunItemRenderer.vue +4 -0
  25. package/dist/runtime/components/renderers/JunMosaicRenderer.vue +1 -0
  26. package/dist/runtime/components/renderers/JunTrackRenderer.vue +3 -0
  27. package/dist/runtime/composables/useJunChrome.d.ts +14 -0
  28. package/dist/runtime/composables/useJunChrome.js +17 -0
  29. package/dist/runtime/composables/useJunDocLinkMenu.d.ts +69 -0
  30. package/dist/runtime/composables/useJunDocLinkMenu.js +99 -0
  31. package/dist/runtime/composables/useJunDocMenuHost.d.ts +18 -0
  32. package/dist/runtime/composables/useJunDocMenuHost.js +26 -0
  33. package/dist/runtime/composables/useJunSurface.d.ts +13 -0
  34. package/dist/runtime/composables/useJunSurface.js +4 -0
  35. package/dist/runtime/layouts/jun.vue +7 -0
  36. package/dist/runtime/server/plugins/jun-bootstrap.js +46 -2
  37. package/dist/runtime/server/utils/junServiceFetch.js +22 -10
  38. package/package.json +1 -1
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "2.96.0",
7
+ "version": "2.97.0",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -2,6 +2,7 @@
2
2
  import { computed } from "vue";
3
3
  import { useAbracadabra, useDocSlugs, useDocTree } from "#imports";
4
4
  import { useJunDocIcon } from "../composables/useJunOptions";
5
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
5
6
  const props = defineProps({
6
7
  docId: { type: String, required: true },
7
8
  floating: { type: Boolean, required: false },
@@ -23,18 +24,25 @@ const items = computed(() => {
23
24
  chain.unshift({
24
25
  label: entry.label || "Untitled",
25
26
  icon: docIcon(entry.type, entry.meta?.icon),
26
- to: getDocUrl(entry.id)
27
+ to: getDocUrl(entry.id),
28
+ docId: entry.id,
29
+ type: entry.type,
30
+ meta: entry.meta
27
31
  });
28
32
  parentId = entry.parentId ?? null;
29
33
  }
30
34
  if (cursor) {
31
35
  chain.push({
32
36
  label: cursor.label || "Untitled",
33
- icon: docIcon(cursor.type, cursor.meta?.icon)
37
+ icon: docIcon(cursor.type, cursor.meta?.icon),
38
+ docId: cursor.id,
39
+ type: cursor.type,
40
+ meta: cursor.meta
34
41
  });
35
42
  }
36
43
  return chain;
37
44
  });
45
+ const menu = useJunDocLinkMenu({ surface: "breadcrumb", noOpen: false });
38
46
  </script>
39
47
 
40
48
  <template>
@@ -47,7 +55,21 @@ const items = computed(() => {
47
55
  <UBreadcrumb
48
56
  :items="items"
49
57
  class="text-xs sm:text-sm"
50
- />
58
+ >
59
+ <template #item="{ item }">
60
+ <span
61
+ class="inline-flex items-center gap-1.5"
62
+ v-bind="menu.bindFor({ id: item.docId, label: item.label, type: item.type, meta: item.meta })"
63
+ >
64
+ <UIcon
65
+ v-if="item.icon"
66
+ :name="item.icon"
67
+ class="size-3.5 shrink-0 opacity-70"
68
+ />
69
+ <span class="truncate">{{ item.label }}</span>
70
+ </span>
71
+ </template>
72
+ </UBreadcrumb>
51
73
  </div>
52
74
 
53
75
  <!-- Inline — centred above flowing content. -->
@@ -58,6 +80,20 @@ const items = computed(() => {
58
80
  <UBreadcrumb
59
81
  :items="items"
60
82
  class="text-sm"
61
- />
83
+ >
84
+ <template #item="{ item }">
85
+ <span
86
+ class="inline-flex items-center gap-1.5"
87
+ v-bind="menu.bindFor({ id: item.docId, label: item.label, type: item.type, meta: item.meta })"
88
+ >
89
+ <UIcon
90
+ v-if="item.icon"
91
+ :name="item.icon"
92
+ class="size-3.5 shrink-0 opacity-70"
93
+ />
94
+ <span class="truncate">{{ item.label }}</span>
95
+ </span>
96
+ </template>
97
+ </UBreadcrumb>
62
98
  </div>
63
99
  </template>
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, onMounted, resolveComponent } from "vue";
3
3
  import { useDocSlugs, useDocTree, useJunPeopleAdmin } from "#imports";
4
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
5
  import { JUN_PERSON_ROLES } from "../composables/useJunPeopleAdmin";
5
6
  const props = defineProps({
6
7
  people: { type: Array, required: true },
@@ -13,6 +14,7 @@ const props = defineProps({
13
14
  const emit = defineEmits(["follow"]);
14
15
  const NuxtLink = resolveComponent("NuxtLink");
15
16
  const { getDocUrl } = useDocSlugs();
17
+ const placeMenu = useJunDocLinkMenu({ surface: "list" });
16
18
  const { getEntry } = useDocTree();
17
19
  function placeFor(p) {
18
20
  if (p.isSelf) return { label: "here, with you", to: null };
@@ -118,6 +120,7 @@ function roleMenu(p) {
118
120
  class="jun-campfire-who min-w-0 flex-1"
119
121
  :class="place.to ? 'is-linked' : ''"
120
122
  :title="place.to ? `Go to ${place.label}` : void 0"
123
+ v-bind="p.docId && place.to ? placeMenu.bindForId(p.docId, place.label) : {}"
121
124
  >
122
125
  <span class="flex items-baseline gap-1.5">
123
126
  <span class="truncate text-sm text-neutral-800 dark:text-neutral-100">{{ p.name }}</span>
@@ -235,6 +238,7 @@ function roleMenu(p) {
235
238
  class="jun-campfire-tile flex flex-col items-center gap-1 rounded-lg px-1 py-2"
236
239
  :class="[p.idle ? 'opacity-55' : '', isFollowed(p) ? 'is-on' : '']"
237
240
  :title="showPages ? `${p.name} \u2014 ${place.label}` : p.name"
241
+ v-bind="p.docId && place.to ? placeMenu.bindForId(p.docId, place.label) : {}"
238
242
  >
239
243
  <span
240
244
  class="jun-campfire-mark flex size-8 items-center justify-center rounded-full text-xs font-medium"
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,39 @@
1
+ <script setup>
2
+ import { computed, onMounted, watch } from "vue";
3
+ import { useRoute } from "vue-router";
4
+ import { useAbracadabra, useChildTree } from "#imports";
5
+ import { provideJunMenuTree, useJunDocMenuHost } from "../composables/useJunDocMenuHost";
6
+ const { at, hide } = useJunDocMenuHost();
7
+ const route = useRoute();
8
+ const abra = useAbracadabra();
9
+ const tree = useChildTree(abra.doc, "jun-doc-menu");
10
+ onMounted(() => provideJunMenuTree(tree));
11
+ watch(() => route.fullPath, hide);
12
+ const content = computed(() => ({
13
+ align: "start",
14
+ side: at.value?.side ?? "bottom",
15
+ // Keep it inside the viewport when the press landed near an edge — a menu
16
+ // opened on the last breadcrumb of a narrow phone otherwise renders half
17
+ // off-screen.
18
+ collisionPadding: 8
19
+ }));
20
+ </script>
21
+
22
+ <template>
23
+ <UDropdownMenu
24
+ v-if="at"
25
+ :items="at.items"
26
+ :open="true"
27
+ :modal="false"
28
+ :content="content"
29
+ @update:open="(v) => {
30
+ if (!v) hide();
31
+ }"
32
+ >
33
+ <span
34
+ class="fixed size-0"
35
+ :style="{ left: `${at.x}px`, top: `${at.y}px` }"
36
+ aria-hidden="true"
37
+ />
38
+ </UDropdownMenu>
39
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -5,6 +5,7 @@ let seenOnce = false;
5
5
  <script setup>
6
6
  import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from "vue";
7
7
  import { useJunSurface } from "#imports";
8
+ import { junChromeNudge } from "../composables/useJunChrome";
8
9
  import { JUN_TRANSPORT as TRANSPORT, normalizeTransport } from "../utils/junTransportModes";
9
10
  const props = defineProps({
10
11
  waypoints: { type: Array, required: true },
@@ -46,6 +47,9 @@ watch(
46
47
  },
47
48
  { immediate: true }
48
49
  );
50
+ watch(shown, () => junChromeNudge(), { flush: "post" });
51
+ watch(() => items.value.length, () => junChromeNudge(), { flush: "post" });
52
+ onBeforeUnmount(() => junChromeNudge());
49
53
  const { isEmbedded } = useJunSurface();
50
54
  const isDragging = ref(false);
51
55
  const pressing = ref(false);
@@ -214,6 +218,7 @@ function fmt(s) {
214
218
  v-show="shown"
215
219
  class="jun-tl-root inset-x-0 bottom-0 z-30 px-2 sm:px-8 pointer-events-none"
216
220
  :class="isEmbedded ? 'absolute' : 'fixed'"
221
+ :data-jun-chrome-edge="isEmbedded ? void 0 : 'bottom'"
217
222
  >
218
223
  <footer
219
224
  class="jun-timeline jun-chrome group/tl pointer-events-auto relative mx-auto w-full max-w-6xl
@@ -1,8 +1,10 @@
1
1
  <script setup>
2
- import { computed, nextTick, ref } from "vue";
2
+ import { computed, nextTick, onMounted, ref } from "vue";
3
+ import { useMediaQuery } from "@vueuse/core";
3
4
  import {
4
5
  useJunDocMenu
5
6
  } from "../composables/useJunDocMenu";
7
+ import { useJunDocMenuHost } from "../composables/useJunDocMenuHost";
6
8
  import { useJunRename } from "../composables/useJunRename";
7
9
  import { useJunStudio } from "../composables/useJunStudio";
8
10
  const props = defineProps({
@@ -60,14 +62,61 @@ const items = computed(() => {
60
62
  );
61
63
  });
62
64
  const active = computed(() => items.value.length > 0);
65
+ const mounted = ref(false);
66
+ onMounted(() => mounted.value = true);
67
+ const coarse = useMediaQuery("(pointer: coarse)");
68
+ const isTouch = computed(() => mounted.value && coarse.value);
69
+ const { show, hide } = useJunDocMenuHost();
70
+ const PRESS_SLOP_PX = 8;
71
+ const PRESS_MS = 500;
72
+ const CLICK_GUARD_MS = 700;
73
+ let pressTimer = null;
74
+ let pressStart = null;
75
+ let suppressClickUntil = 0;
76
+ function cancelPress() {
77
+ if (pressTimer) clearTimeout(pressTimer);
78
+ pressTimer = null;
79
+ pressStart = null;
80
+ }
81
+ function onPointerDown(e) {
82
+ if (e.pointerType === "mouse" || !active.value) return;
83
+ cancelPress();
84
+ pressStart = { x: e.clientX, y: e.clientY };
85
+ const at = { x: e.clientX, y: e.clientY };
86
+ pressTimer = setTimeout(() => {
87
+ pressTimer = null;
88
+ if (!items.value.length) return;
89
+ suppressClickUntil = performance.now() + CLICK_GUARD_MS;
90
+ show(items.value, at.x, at.y);
91
+ }, PRESS_MS);
92
+ }
93
+ function onPointerMove(e) {
94
+ if (!pressStart) return;
95
+ if (Math.hypot(e.clientX - pressStart.x, e.clientY - pressStart.y) <= PRESS_SLOP_PX) return;
96
+ cancelPress();
97
+ hide();
98
+ }
99
+ function onClickCapture(e) {
100
+ if (performance.now() >= suppressClickUntil) return;
101
+ e.preventDefault();
102
+ e.stopPropagation();
103
+ }
63
104
  </script>
64
105
 
65
106
  <template>
66
107
  <UContextMenu
67
108
  v-if="active"
68
109
  :items="items"
110
+ :disabled="isTouch"
69
111
  >
70
- <div class="relative">
112
+ <div
113
+ class="relative"
114
+ @pointerdown="onPointerDown"
115
+ @pointermove="onPointerMove"
116
+ @pointerup="cancelPress"
117
+ @pointercancel="cancelPress"
118
+ @click.capture="onClickCapture"
119
+ >
71
120
  <slot />
72
121
 
73
122
  <!-- Rename overlay — floats over the item so no renderer needs its own
@@ -20,6 +20,16 @@ type __VLS_Props = {
20
20
  to?: string | null;
21
21
  /** `meta.paneScroll === false`. Clips like it used to. */
22
22
  noScroll?: boolean;
23
+ /**
24
+ * The document the click layer LEADS to, when it is a document at all.
25
+ *
26
+ * `to` is a path and cannot be turned back into an id: the pane's own
27
+ * context menu belongs to the PANE (that is what the owner arranges), while
28
+ * the tile a reader presses leads somewhere else entirely. Given this, the
29
+ * click layer carries the TARGET's menu — the same vocabulary that
30
+ * document's card has anywhere else on the site.
31
+ */
32
+ linkDocId?: string | null;
23
33
  };
24
34
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
35
  to: string | null;
@@ -28,6 +38,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
28
38
  live: boolean;
29
39
  fallbackNote: string;
30
40
  noScroll: boolean;
41
+ linkDocId: string | null;
31
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
43
  declare const _default: typeof __VLS_export;
33
44
  export default _default;
@@ -1,5 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, onBeforeUnmount, onMounted, ref } from "vue";
3
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
+ import { provideJunPanelSurface } from "../composables/useJunSurface";
3
5
  const props = defineProps({
4
6
  targetDocId: { type: String, required: true },
5
7
  label: { type: String, required: true },
@@ -8,8 +10,11 @@ const props = defineProps({
8
10
  live: { type: Boolean, required: false, default: true },
9
11
  fallbackNote: { type: String, required: false, default: "" },
10
12
  to: { type: [String, null], required: false, default: null },
11
- noScroll: { type: Boolean, required: false, default: false }
13
+ noScroll: { type: Boolean, required: false, default: false },
14
+ linkDocId: { type: [String, null], required: false, default: null }
12
15
  });
16
+ const linkMenu = useJunDocLinkMenu({ surface: "card" });
17
+ provideJunPanelSurface();
13
18
  const scrolls = computed(() => !props.interactive && !props.noScroll);
14
19
  const el = ref(null);
15
20
  const mounted = ref(false);
@@ -38,9 +43,14 @@ onBeforeUnmount(() => {
38
43
  </script>
39
44
 
40
45
  <template>
46
+ <!-- `[contain:layout_paint]` makes this element the containing block for its
47
+ own `position: fixed` descendants, so a renderer that pins something to
48
+ "the viewport" pins it to the TILE. That is what keeps an embedded
49
+ globe's timeline, a locked renderer's toolbar and any future full-bleed
50
+ chrome inside the pane without any of them knowing a mosaic exists. -->
41
51
  <div
42
52
  ref="el"
43
- class="relative h-full w-full overflow-hidden"
53
+ class="relative h-full w-full overflow-hidden [contain:layout_paint]"
44
54
  >
45
55
  <template v-if="live">
46
56
  <!-- SCROLLING. `awareness` is off: an aware ring and hover broadcast per
@@ -81,6 +91,7 @@ onBeforeUnmount(() => {
81
91
  :to="to"
82
92
  class="absolute inset-0 z-10"
83
93
  :aria-label="label"
94
+ v-bind="linkDocId ? linkMenu.bindForId(linkDocId, label) : {}"
84
95
  />
85
96
  </div>
86
97
  </AScroll>
@@ -146,6 +157,7 @@ onBeforeUnmount(() => {
146
157
  :to="to"
147
158
  class="absolute inset-0 z-10"
148
159
  :aria-label="label"
160
+ v-bind="linkDocId ? linkMenu.bindForId(linkDocId, label) : {}"
149
161
  />
150
162
  </div>
151
163
  </template>
@@ -20,6 +20,16 @@ type __VLS_Props = {
20
20
  to?: string | null;
21
21
  /** `meta.paneScroll === false`. Clips like it used to. */
22
22
  noScroll?: boolean;
23
+ /**
24
+ * The document the click layer LEADS to, when it is a document at all.
25
+ *
26
+ * `to` is a path and cannot be turned back into an id: the pane's own
27
+ * context menu belongs to the PANE (that is what the owner arranges), while
28
+ * the tile a reader presses leads somewhere else entirely. Given this, the
29
+ * click layer carries the TARGET's menu — the same vocabulary that
30
+ * document's card has anywhere else on the site.
31
+ */
32
+ linkDocId?: string | null;
23
33
  };
24
34
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
25
35
  to: string | null;
@@ -28,6 +38,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
28
38
  live: boolean;
29
39
  fallbackNote: string;
30
40
  noScroll: boolean;
41
+ linkDocId: string | null;
31
42
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
43
  declare const _default: typeof __VLS_export;
33
44
  export default _default;
@@ -2,6 +2,7 @@
2
2
  import { computed, onMounted, ref } from "vue";
3
3
  import { useJunNavItems } from "../composables/useJunNavItems";
4
4
  import { useJunNavSettings } from "../composables/useJunNavSettings";
5
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
5
6
  const props = defineProps({
6
7
  items: { type: Array, required: true },
7
8
  max: { type: Number, required: false, default: 4 }
@@ -10,6 +11,7 @@ const emit = defineEmits(["more"]);
10
11
  const nav = useJunNavSettings();
11
12
  const items = computed(() => props.items);
12
13
  const { iconFor, navLabelFor, redirectTargetFor, isExternalTarget, presenceFor, freshFor } = useJunNavItems(items);
14
+ const menu = useJunDocLinkMenu({ surface: "nav", side: "top" });
13
15
  const mounted = ref(false);
14
16
  onMounted(() => {
15
17
  mounted.value = true;
@@ -41,6 +43,7 @@ const showLabel = computed(() => nav.menuItemMode.value !== "icon");
41
43
  :rel="isExternalTarget(redirectTargetFor(item)) ? 'noopener noreferrer' : void 0"
42
44
  class="relative flex min-w-0 flex-1 flex-col items-center justify-center gap-0.5 px-1 py-2 text-black/55 transition-colors dark:text-white/55"
43
45
  :class="item.current ? 'text-black dark:text-white' : ''"
46
+ v-bind="item.id ? menu.bindForId(item.id, navLabelFor(item)) : {}"
44
47
  >
45
48
  <span class="relative flex-none">
46
49
  <UIcon
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, nextTick, onUnmounted, ref, watch } from "vue";
3
3
  import { useRoute } from "#imports";
4
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
5
  import { onKeyStroke } from "@vueuse/core";
5
6
  import { useJunNavItems } from "../composables/useJunNavItems";
6
7
  import { useJunNavSettings } from "../composables/useJunNavSettings";
@@ -209,6 +210,7 @@ const isGrid = computed(() => shape.value === "grid");
209
210
  const showIcon = computed(() => isGrid.value || nav.menuItemMode.value !== "text");
210
211
  const showLabel = computed(() => !isGrid.value ? nav.menuItemMode.value !== "icon" : true);
211
212
  const hasExtras = computed(() => nav.menuExtras.value);
213
+ const menu = useJunDocLinkMenu({ surface: "nav" });
212
214
  const { openOffline } = useJunOffline();
213
215
  const effectiveConfig = useJunEffectiveConfig();
214
216
  const offlineOffered = computed(() => pwa && offline.enabled && effectiveConfig.value.offlineOffer !== false);
@@ -310,6 +312,7 @@ const offlineOffered = computed(() => pwa && offline.enabled && effectiveConfig.
310
312
  :rel="isExternalTarget(redirectTargetFor(item)) ? 'noopener noreferrer' : void 0"
311
313
  class="jun-nav-menu-item relative flex aspect-square flex-col items-center justify-center gap-2 rounded-xl px-3 py-3 text-center text-black/70 transition-colors hover:bg-black/5 dark:text-white/70 dark:hover:bg-white/10"
312
314
  :class="item.current ? 'bg-black/5 font-medium text-black dark:bg-white/10 dark:text-white' : ''"
315
+ v-bind="item.id ? menu.bindForId(item.id, navLabelFor(item)) : {}"
313
316
  @click="close"
314
317
  >
315
318
  <UIcon
@@ -366,6 +369,7 @@ const offlineOffered = computed(() => pwa && offline.enabled && effectiveConfig.
366
369
  ]"
367
370
  :style="{ paddingLeft: `${0.75 + row.depth * 1}rem` }"
368
371
  :aria-current="row.current ? 'page' : void 0"
372
+ v-bind="row.external || !row.id ? {} : menu.bindForId(row.id, row.name)"
369
373
  @click="close"
370
374
  >
371
375
  <UIcon
@@ -14,6 +14,7 @@ import {
14
14
  } from "#imports";
15
15
  import { useJunOptions, useJunLayoutPolicy, useJunPageType } from "../composables/useJunOptions";
16
16
  import { useJunDocMenu } from "../composables/useJunDocMenu";
17
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
17
18
  import { useJunNavItems } from "../composables/useJunNavItems";
18
19
  import { junAdoptedMeta } from "../utils/junAdopt";
19
20
  import { useJunMenuState } from "../composables/useJunMenuState";
@@ -387,6 +388,7 @@ const menuItemsById = computed(() => {
387
388
  return map;
388
389
  });
389
390
  const contextItemsFor = (item) => (item.id ? menuItemsById.value.get(item.id) : void 0) ?? [];
391
+ const childMenu = useJunDocLinkMenu({ surface: "nav", tree: navTree });
390
392
  let logoClicks = 0;
391
393
  let logoClickTimer = null;
392
394
  function onLogoClick() {
@@ -1899,11 +1901,19 @@ onUnmounted(() => {
1899
1901
  @focusout="onItemBlur"
1900
1902
  >
1901
1903
  <div :class="isMegaChildren ? 'grid grid-cols-2 gap-1 sm:grid-cols-3' : 'flex flex-col gap-0.5'">
1904
+ <!-- Sub-pages carry the SAME menu the track's own items do. They
1905
+ did not: the flyout was the one navigation surface a
1906
+ right-click did nothing on, and it is the surface a site with
1907
+ `navChildren: 'hover'` navigates through. It cannot be
1908
+ `<UContextMenu>` — this panel closes on `focusout` and on
1909
+ pointer travel, and a menu that mounts its own focus trap and
1910
+ dismissable layer inside it fights both. -->
1902
1911
  <NuxtLink
1903
1912
  v-for="child in openChildItems"
1904
1913
  :key="child.id"
1905
1914
  :to="child.href"
1906
1915
  class="flex items-center gap-2 rounded-lg px-2.5 py-2 text-sm text-black/70 transition-colors hover:bg-black/5 hover:text-black dark:text-white/70 dark:hover:bg-white/10 dark:hover:text-white"
1916
+ v-bind="childMenu.bindForId(child.id, child.name)"
1907
1917
  @click="closeChildren"
1908
1918
  >
1909
1919
  <UIcon
@@ -3,6 +3,7 @@ import { computed, onMounted, onUnmounted, ref, watch } from "vue";
3
3
  import { $fetch } from "ofetch";
4
4
  import { useNuxtData } from "#app";
5
5
  import { useJunOptions, junConfigStr } from "#imports";
6
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
6
7
  const props = defineProps({
7
8
  path: { type: String, required: false }
8
9
  });
@@ -12,6 +13,7 @@ const message = computed(
12
13
  () => junConfigStr(ssrConfig.value?.notFoundText) ?? "Nothing grows here \u2014 yet."
13
14
  );
14
15
  const suggestions = ref([]);
16
+ const menu = useJunDocLinkMenu({ surface: "list" });
15
17
  const hits = ref([]);
16
18
  const q = ref("");
17
19
  async function search(term) {
@@ -97,6 +99,7 @@ onUnmounted(() => {
97
99
  <NuxtLink
98
100
  :to="h.href"
99
101
  class="block px-4 py-2.5 text-sm transition-colors hover:bg-black/5 dark:hover:bg-white/10"
102
+ v-bind="menu.bindForId(h.id, h.title)"
100
103
  >
101
104
  {{ h.title || "Untitled" }}
102
105
  </NuxtLink>
@@ -120,6 +123,7 @@ onUnmounted(() => {
120
123
  color="neutral"
121
124
  variant="soft"
122
125
  :label="s.title || 'Untitled'"
126
+ v-bind="menu.bindForId(s.id, s.title)"
123
127
  />
124
128
  </div>
125
129
  </div>
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
3
  import { useDocSlugs, useDocTree, useJunLinkGraph, useJunPageType } from "#imports";
4
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
5
  const props = defineProps({
5
6
  docId: { type: String, required: true }
6
7
  });
@@ -27,6 +28,7 @@ const inbound = computed(() => {
27
28
  }
28
29
  return [...seen.values()].sort((a, b) => b.weight - a.weight || a.label.localeCompare(b.label));
29
30
  });
31
+ const menu = useJunDocLinkMenu({ surface: "list" });
30
32
  </script>
31
33
 
32
34
  <template>
@@ -48,6 +50,7 @@ const inbound = computed(() => {
48
50
  :to="getDocUrl(cite.id)"
49
51
  class="text-sm text-muted underline-offset-4 hover:underline"
50
52
  :data-jun-cite="cite.id"
53
+ v-bind="menu.bindForId(cite.id, cite.label)"
51
54
  >
52
55
  {{ cite.label }}
53
56
  </NuxtLink>
@@ -22,6 +22,7 @@ import {
22
22
  useJunStudio,
23
23
  useJunTravellers
24
24
  } from "#imports";
25
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
25
26
  const { open, closeSearch } = useJunSearch();
26
27
  const { apiBase, typeIds } = useJunOptions();
27
28
  const { getDocUrl } = useDocSlugs();
@@ -288,6 +289,7 @@ const rows = computed(() => {
288
289
  return [...recentRows.value, ...commandRows.value, ...jumpRows.value];
289
290
  });
290
291
  const hasRows = computed(() => rows.value.length > 0);
292
+ const resultMenu = useJunDocLinkMenu({ surface: "list", noOpen: false });
291
293
  const presenceOn = (id) => id ? byDocId.value.get(id) ?? [] : [];
292
294
  function move(delta) {
293
295
  const n = rows.value.length;
@@ -681,11 +683,17 @@ function headingAt(i) {
681
683
  >
682
684
  {{ headingAt(i) }}
683
685
  </p>
686
+ <!-- A result that names a DOCUMENT carries the document menu; a
687
+ command row has no document and gets none, so the bind is
688
+ conditional on `row.id`. It is the palette that most needs
689
+ one: it is the only surface that can reach a page that is in
690
+ no navigation at all. -->
684
691
  <button
685
692
  type="button"
686
693
  :data-row="i"
687
694
  class="relative flex w-full items-start gap-3 px-4 py-2.5 text-left"
688
695
  :style="staged ? { animationDelay: `${Math.min(i, 12) * 22}ms` } : void 0"
696
+ v-bind="row.id ? resultMenu.bindForId(row.id, row.label) : {}"
689
697
  @mousemove="hoverSelect(i)"
690
698
  @focus="hoverSelect(i)"
691
699
  @click="run(i, $event.metaKey || $event.ctrlKey)"
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, onMounted, ref } from "vue";
3
3
  import { useDocSlugs, useDocTree, useJunDocIcon, useRoute } from "#imports";
4
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
5
  import { useJunNavSettings } from "../composables/useJunNavSettings";
5
6
  const props = defineProps({
6
7
  docId: { type: String, required: true },
@@ -18,6 +19,7 @@ const nav = useJunNavSettings();
18
19
  const { entries, getEntry } = useDocTree();
19
20
  const { getDocUrl } = useDocSlugs();
20
21
  const docIcon = useJunDocIcon();
22
+ const menu = useJunDocLinkMenu({ surface: "nav" });
21
23
  const branchId = computed(() => {
22
24
  const live = mounted.value ? getEntry(props.docId) : void 0;
23
25
  if (!live) return props.ssrSection?.parentId ?? null;
@@ -114,6 +116,7 @@ const itemClass = computed(() => ITEM_CLASS[mode.value] ?? ITEM_CLASS.row);
114
116
  v-if="branchHref && mode !== 'segmented'"
115
117
  :to="branchHref"
116
118
  class="mr-1 flex-none truncate text-[11px] font-medium tracking-[0.18em] text-dimmed uppercase transition-colors hover:text-muted"
119
+ v-bind="branchId ? menu.bindForId(branchId, branchTitle) : {}"
117
120
  >
118
121
  {{ branchTitle }}
119
122
  </NuxtLink>
@@ -128,6 +131,7 @@ const itemClass = computed(() => ITEM_CLASS[mode.value] ?? ITEM_CLASS.row);
128
131
  isAncestor(item) ? 'opacity-80' : ''
129
132
  ]"
130
133
  :aria-current="isCurrent(item) ? 'page' : isAncestor(item) ? 'true' : void 0"
134
+ v-bind="menu.bindForId(item.id, item.title)"
131
135
  >
132
136
  <UIcon
133
137
  v-if="item.icon && mode !== 'tabs'"
@@ -1,6 +1,7 @@
1
1
  <script setup>
2
2
  import { computed, resolveComponent } from "vue";
3
3
  import { useAbracadabra, useDocSlugs, useDocTree, useJunFollow } from "#imports";
4
+ import { useJunDocLinkMenu } from "../composables/useJunDocLinkMenu";
4
5
  import { useJunTravellers } from "../composables/useJunPresence";
5
6
  const props = defineProps({
6
7
  list: { type: Boolean, required: false, default: false }
@@ -9,6 +10,7 @@ const NuxtLink = resolveComponent("NuxtLink");
9
10
  const { people: travellers } = useJunTravellers();
10
11
  const { toggle: toggleFollow, followingClientId } = useJunFollow();
11
12
  const { getDocUrl } = useDocSlugs();
13
+ const placeMenu = useJunDocLinkMenu({ surface: "list" });
12
14
  const { getEntry } = useDocTree();
13
15
  const abra = useAbracadabra();
14
16
  const MAX_DOTS = 3;
@@ -97,6 +99,7 @@ function placeFor(t) {
97
99
  :is="placeFor(t).to ? NuxtLink : 'div'"
98
100
  :to="placeFor(t).to ?? void 0"
99
101
  class="flex min-w-0 flex-1 items-center gap-2.5 py-2 pl-3.5"
102
+ v-bind="t.docId && placeFor(t).to ? placeMenu.bindForId(t.docId, placeFor(t).label) : {}"
100
103
  >
101
104
  <span
102
105
  class="inline-block size-2 shrink-0 rounded-full"
@@ -13,6 +13,7 @@ import {
13
13
  } from "#imports";
14
14
  import { junViewSpecFor } from "../../utils/junViewSpecs";
15
15
  import { junCourseView } from "../../utils/junCourse";
16
+ import { useJunDocLinkMenu } from "../../composables/useJunDocLinkMenu";
16
17
  const props = defineProps({
17
18
  docId: { type: String, required: true },
18
19
  docLabel: { type: String, required: false },
@@ -28,6 +29,11 @@ const { editing } = useJunStudio();
28
29
  const { renameDoc } = useJunRename();
29
30
  const selfId = useJunSelfId();
30
31
  const toast = useToast();
32
+ const stepMenu = useJunDocLinkMenu({
33
+ surface: "list",
34
+ tree,
35
+ siblings: () => course.value.steps.map((s) => s.id)
36
+ });
31
37
  const entry = computed(() => getEntry(props.docId));
32
38
  const meta = computed(
33
39
  () => entry.value?.meta ?? props.docMeta ?? {}
@@ -149,6 +155,7 @@ function renameSubtitle(s) {
149
155
  trailing-icon="i-lucide-arrow-right"
150
156
  :label="course.done ? `Continue \u2014 ${course.next.label}` : `Start \u2014 ${course.next.label}`"
151
157
  data-jun-course="continue"
158
+ v-bind="stepMenu.bindForId(course.next.id, course.next.label)"
152
159
  />
153
160
  </div>
154
161
  <p
@@ -180,6 +187,7 @@ function renameSubtitle(s) {
180
187
  class="jun-card flex items-center gap-3 rounded-xl px-3.5 py-3"
181
188
  :data-jun-step="step.id"
182
189
  :data-jun-step-done="step.done ? 'true' : 'false'"
190
+ v-bind="stepMenu.bindForId(step.id, step.label)"
183
191
  >
184
192
  <!-- The tick is a BUTTON, not a checkbox: it is a request to the server,
185
193
  which may refuse, so its state must follow the answer rather than the