@abraca/junis 2.87.0 → 2.88.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 (89) hide show
  1. package/dist/module.d.mts +4 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +64 -6
  4. package/dist/runtime/assets/css/jun.css +2 -2
  5. package/dist/runtime/components/JunDocSurface.d.vue.ts +20 -2
  6. package/dist/runtime/components/JunDocSurface.vue +27 -2
  7. package/dist/runtime/components/JunDocSurface.vue.d.ts +20 -2
  8. package/dist/runtime/components/JunHead.vue +16 -4
  9. package/dist/runtime/components/JunNavDock.d.vue.ts +15 -0
  10. package/dist/runtime/components/JunNavDock.vue +94 -0
  11. package/dist/runtime/components/JunNavDock.vue.d.ts +15 -0
  12. package/dist/runtime/components/JunNavMenu.client.d.vue.ts +15 -0
  13. package/dist/runtime/components/JunNavMenu.client.vue +478 -0
  14. package/dist/runtime/components/JunNavMenu.client.vue.d.ts +15 -0
  15. package/dist/runtime/components/JunNavPreview.d.vue.ts +17 -0
  16. package/dist/runtime/components/JunNavPreview.vue +169 -0
  17. package/dist/runtime/components/JunNavPreview.vue.d.ts +17 -0
  18. package/dist/runtime/components/JunNavigation.d.vue.ts +4 -11
  19. package/dist/runtime/components/JunNavigation.vue +813 -138
  20. package/dist/runtime/components/JunNavigation.vue.d.ts +4 -11
  21. package/dist/runtime/components/JunNoteLinks.vue +1 -1
  22. package/dist/runtime/components/JunPageHero.vue +3 -3
  23. package/dist/runtime/components/JunSectionBar.d.vue.ts +41 -0
  24. package/dist/runtime/components/JunSectionBar.vue +144 -0
  25. package/dist/runtime/components/JunSectionBar.vue.d.ts +41 -0
  26. package/dist/runtime/components/renderers/JunConfigRenderer.vue +486 -6
  27. package/dist/runtime/components/renderers/JunEntryRenderer.vue +48 -0
  28. package/dist/runtime/composables/useJunCreatePage.js +7 -1
  29. package/dist/runtime/composables/useJunDocPage.d.ts +28 -0
  30. package/dist/runtime/composables/useJunDocPage.js +111 -20
  31. package/dist/runtime/composables/useJunGarden.d.ts +1 -1
  32. package/dist/runtime/composables/useJunGarden.js +3 -2
  33. package/dist/runtime/composables/useJunGestures.d.ts +53 -0
  34. package/dist/runtime/composables/useJunGestures.js +89 -0
  35. package/dist/runtime/composables/useJunMenuState.d.ts +4 -0
  36. package/dist/runtime/composables/useJunMenuState.js +5 -0
  37. package/dist/runtime/composables/useJunNavItems.d.ts +50 -0
  38. package/dist/runtime/composables/useJunNavItems.js +188 -0
  39. package/dist/runtime/composables/useJunNavSettings.d.ts +58 -1
  40. package/dist/runtime/composables/useJunNavSettings.js +110 -8
  41. package/dist/runtime/composables/useJunOptions.d.ts +1 -0
  42. package/dist/runtime/composables/useJunSiblings.d.ts +30 -0
  43. package/dist/runtime/composables/useJunSiblings.js +38 -0
  44. package/dist/runtime/composables/useJunSiteConfig.d.ts +51 -3
  45. package/dist/runtime/composables/useJunTheme.js +4 -1
  46. package/dist/runtime/composables/useJunViewingAccent.js +10 -0
  47. package/dist/runtime/layouts/jun.vue +21 -1
  48. package/dist/runtime/pages/doc.vue +2 -0
  49. package/dist/runtime/pages/index.vue +2 -0
  50. package/dist/runtime/server/api/health.get.d.ts +15 -0
  51. package/dist/runtime/server/api/health.get.js +7 -2
  52. package/dist/runtime/server/api/links.get.js +27 -3
  53. package/dist/runtime/server/api/resolve/[...slug].get.d.ts +20 -0
  54. package/dist/runtime/server/api/resolve/[...slug].get.js +31 -0
  55. package/dist/runtime/server/api/search.get.d.ts +1 -1
  56. package/dist/runtime/server/api/search.get.js +42 -39
  57. package/dist/runtime/server/api/tree.get.js +3 -1
  58. package/dist/runtime/server/janitor/junJanitorChores.d.ts +14 -7
  59. package/dist/runtime/server/janitor/junJanitorChores.js +21 -3
  60. package/dist/runtime/server/janitor/junJanitorMachine.js +36 -4
  61. package/dist/runtime/server/janitor/junJanitorPerform.d.ts +15 -1
  62. package/dist/runtime/server/janitor/junJanitorPerform.js +13 -5
  63. package/dist/runtime/server/janitor/junJanitorYText.d.ts +40 -3
  64. package/dist/runtime/server/janitor/junJanitorYText.js +60 -14
  65. package/dist/runtime/server/plugins/jun-janitor.js +132 -81
  66. package/dist/runtime/server/routes/jun-card.png.get.d.ts +2 -0
  67. package/dist/runtime/server/routes/jun-card.png.get.js +40 -0
  68. package/dist/runtime/server/utils/junCard.d.ts +39 -0
  69. package/dist/runtime/server/utils/junCard.js +159 -0
  70. package/dist/runtime/server/utils/junIcon.d.ts +27 -2
  71. package/dist/runtime/server/utils/junIcon.js +5 -5
  72. package/dist/runtime/server/utils/junJanitorStatus.d.ts +59 -0
  73. package/dist/runtime/server/utils/junJanitorStatus.js +27 -0
  74. package/dist/runtime/types.d.ts +225 -0
  75. package/dist/runtime/utils/junAdopt.d.ts +43 -0
  76. package/dist/runtime/utils/junAdopt.js +7 -0
  77. package/dist/runtime/utils/junGesture.d.ts +84 -0
  78. package/dist/runtime/utils/junGesture.js +40 -0
  79. package/dist/runtime/utils/junLetters.d.ts +86 -0
  80. package/dist/runtime/utils/junLetters.js +173 -0
  81. package/dist/runtime/utils/junNavValue.d.ts +56 -0
  82. package/dist/runtime/utils/junNavValue.js +36 -0
  83. package/dist/runtime/utils/junSearchRank.d.ts +79 -0
  84. package/dist/runtime/utils/junSearchRank.js +73 -0
  85. package/dist/runtime/utils/junSocial.d.ts +59 -0
  86. package/dist/runtime/utils/junSocial.js +56 -0
  87. package/dist/runtime/utils/junViewSpecs.d.ts +38 -0
  88. package/dist/runtime/utils/junViewSpecs.js +92 -1
  89. package/package.json +10 -8
@@ -1,10 +1,26 @@
1
- import type { JunNavActiveStyle, JunNavItemMode, JunNavLogoAction, JunNavPlacement, JunNavShape, JunNavSize } from '../types.js';
1
+ import type { JunNavActiveStyle, JunNavAlign, JunNavBreakpoint, JunNavChildrenMode, JunNavItemMode, JunNavLogoAction, JunNavMenuIcon, JunNavMenuSide, JunNavMobileItemMode, JunNavMobileMode, JunNavMobilePlacement, JunNavOverflow, JunNavPlacement, JunNavRailBreakpoint, JunNavCountMode, JunNavSectionMode, JunNavShape, JunNavSize, JunNavWidth } from '../types.js';
2
+ /**
3
+ * The pixel width of each breakpoint, for the ONE consumer that cannot use a
4
+ * Tailwind class: `useMediaQuery`. Everything that can express the switch in
5
+ * CSS does, because a media query resolved in JavaScript is `false` on the
6
+ * server — the trap the rail fallback carries a paragraph about.
7
+ */
8
+ export declare const JUN_NAV_BREAKPOINT_PX: Record<string, number>;
2
9
  export declare function useJunNavSettings(): {
3
10
  placement: import("vue").ComputedRef<JunNavPlacement>;
4
11
  shape: import("vue").ComputedRef<JunNavShape>;
5
12
  size: import("vue").ComputedRef<JunNavSize>;
6
13
  itemMode: import("vue").ComputedRef<JunNavItemMode>;
7
14
  activeStyle: import("vue").ComputedRef<JunNavActiveStyle>;
15
+ /** The section bar's shape — `off` unless a site asked for one. */
16
+ section: import("vue").ComputedRef<JunNavSectionMode>;
17
+ /** What a nav item's badge counts — `off` unless a site asked for one. */
18
+ counts: import("vue").ComputedRef<JunNavCountMode>;
19
+ /**
20
+ * …and the document may answer this one too, as `on` / `off` rather than a
21
+ * boolean: `junView` values are the strings a `select` stores, and a
22
+ * boolean has no way to spell "no opinion".
23
+ */
8
24
  autoHide: import("vue").ComputedRef<boolean>;
9
25
  blur: import("vue").ComputedRef<boolean>;
10
26
  homeItem: import("vue").ComputedRef<boolean>;
@@ -45,6 +61,36 @@ export declare function useJunNavSettings(): {
45
61
  logoVariant: import("vue").ComputedRef<import("../types.js").JunLogoVariant>;
46
62
  /** True for the two vertical placements — the track then stacks. */
47
63
  isRail: import("vue").ComputedRef<boolean>;
64
+ /**
65
+ * The phone presentation. `track` — today's scrolling row — is the default
66
+ * and the only one that renders no trigger at all.
67
+ */
68
+ mobileMode: import("vue").ComputedRef<JunNavMobileMode>;
69
+ mobilePlacement: import("vue").ComputedRef<JunNavMobilePlacement>;
70
+ breakpoint: import("vue").ComputedRef<JunNavBreakpoint>;
71
+ railBreakpoint: import("vue").ComputedRef<JunNavRailBreakpoint>;
72
+ menuIcon: import("vue").ComputedRef<JunNavMenuIcon>;
73
+ menuSide: import("vue").ComputedRef<JunNavMenuSide>;
74
+ /**
75
+ * Item rendering inside the menu, with `inherit` already resolved — no
76
+ * consumer should have to know that `inherit` means "ask `itemMode`", and
77
+ * `icon-focus` is silently downgraded because a phone has no hover to
78
+ * reveal the label with.
79
+ */
80
+ menuItemMode: import("vue").ComputedRef<JunNavItemMode>;
81
+ menuChildren: import("vue").ComputedRef<boolean>;
82
+ menuExtras: import("vue").ComputedRef<boolean>;
83
+ desktopMenu: import("vue").ComputedRef<boolean>;
84
+ /** True when SOME viewport gets a menu — i.e. the trigger has to exist. */
85
+ menuEnabled: import("vue").ComputedRef<boolean>;
86
+ overflow: import("vue").ComputedRef<JunNavOverflow>;
87
+ children: import("vue").ComputedRef<JunNavChildrenMode>;
88
+ align: import("vue").ComputedRef<JunNavAlign>;
89
+ width: import("vue").ComputedRef<JunNavWidth>;
90
+ separators: import("vue").ComputedRef<boolean>;
91
+ scrollArrows: import("vue").ComputedRef<boolean>;
92
+ edgeFade: import("vue").ComputedRef<boolean>;
93
+ snap: import("vue").ComputedRef<boolean>;
48
94
  /** The vocabularies, so the settings page never keeps a second copy. */
49
95
  vocab: {
50
96
  PLACEMENTS: JunNavPlacement[];
@@ -53,5 +99,16 @@ export declare function useJunNavSettings(): {
53
99
  ITEM_MODES: JunNavItemMode[];
54
100
  ACTIVE_STYLES: JunNavActiveStyle[];
55
101
  LOGO_ACTIONS: JunNavLogoAction[];
102
+ MOBILE_MODES: JunNavMobileMode[];
103
+ MOBILE_PLACEMENTS: JunNavMobilePlacement[];
104
+ BREAKPOINTS: JunNavBreakpoint[];
105
+ RAIL_BREAKPOINTS: JunNavRailBreakpoint[];
106
+ MENU_ICONS: JunNavMenuIcon[];
107
+ MENU_SIDES: JunNavMenuSide[];
108
+ MOBILE_ITEM_MODES: JunNavMobileItemMode[];
109
+ OVERFLOWS: JunNavOverflow[];
110
+ CHILDREN_MODES: JunNavChildrenMode[];
111
+ ALIGNS: JunNavAlign[];
112
+ WIDTHS: JunNavWidth[];
56
113
  };
57
114
  };
@@ -1,4 +1,6 @@
1
1
  import { computed } from "vue";
2
+ import { useAbracadabra, useDocTree, useRoute, useSlugRoute } from "#imports";
3
+ import { junNavFlag, junNavPick, junNavPreview } from "../utils/junNavValue.js";
2
4
  import { useJunOptions } from "./useJunOptions.js";
3
5
  import { useJunEffectiveConfig } from "./useJunSiteConfig.js";
4
6
  const PLACEMENTS = ["top", "top-bar", "bottom", "rail-left", "rail-right"];
@@ -8,27 +10,69 @@ const ITEM_MODES = ["text", "icon", "icon-focus", "icon-text", "icon-stack"];
8
10
  const ACTIVE_STYLES = ["underline", "pill", "dot", "bold", "glow", "box", "bracket"];
9
11
  const LOGO_VARIANTS = ["mark", "lockup", "wordmark"];
10
12
  const LOGO_ACTIONS = ["home", "palette"];
13
+ const COUNT_MODES = ["off", "children", "new"];
14
+ const SECTION_MODES = ["off", "row", "segmented", "tabs"];
15
+ const MOBILE_MODES = ["track", "sheet", "drawer-left", "drawer-right", "fullscreen", "grid", "dock"];
16
+ const MOBILE_PLACEMENTS = ["inherit", "top", "top-bar", "bottom"];
17
+ const BREAKPOINTS = ["sm", "md", "lg"];
18
+ const RAIL_BREAKPOINTS = ["lg", "md", "xl"];
19
+ const MENU_ICONS = ["menu", "grid", "dots", "chevron"];
20
+ const MENU_SIDES = ["right", "left"];
21
+ const MOBILE_ITEM_MODES = ["inherit", ...ITEM_MODES];
22
+ const OVERFLOWS = ["scroll", "wrap", "more", "shrink"];
23
+ const CHILDREN_MODES = ["none", "hover", "click", "mega"];
24
+ const ALIGNS = ["center", "start", "end", "spread"];
25
+ const WIDTHS = ["contained", "narrow", "wide", "full"];
26
+ export const JUN_NAV_BREAKPOINT_PX = {
27
+ sm: 640,
28
+ md: 768,
29
+ lg: 1024,
30
+ xl: 1280
31
+ };
11
32
  export function useJunNavSettings() {
12
33
  const { navigation, brand } = useJunOptions();
34
+ const route = useRoute();
35
+ const abra = useAbracadabra();
36
+ const { getEntry } = useDocTree();
37
+ const { docId } = useSlugRoute();
38
+ const docNav = computed(() => {
39
+ const id = docId.value ?? (route.path === "/" ? abra.spaceDocId.value : null);
40
+ if (!id) return {};
41
+ const view = getEntry(id)?.meta?.junView;
42
+ const stored = view && typeof view === "object" ? view : {};
43
+ return { ...stored, ...junNavPreview(route.query["jun-nav"]) };
44
+ });
13
45
  const config = useJunEffectiveConfig();
14
- function pick(stored, allowed, fallback) {
15
- return typeof stored === "string" && allowed.includes(stored) ? stored : fallback;
46
+ function pick(stored, allowed, fallback, doc) {
47
+ return junNavPick({ doc, site: stored, build: fallback }, allowed);
16
48
  }
17
- function flag(stored, fallback) {
18
- return typeof stored === "boolean" ? stored : fallback;
49
+ function flag(stored, fallback, doc) {
50
+ return junNavFlag({ doc, site: stored, build: fallback });
19
51
  }
20
- const placement = computed(() => pick(config.value.navPlacement, PLACEMENTS, navigation.placement));
52
+ const placement = computed(() => pick(config.value.navPlacement, PLACEMENTS, navigation.placement, docNav.value.navPlacement));
21
53
  const shape = computed(() => pick(config.value.navShape, SHAPES, navigation.shape));
22
54
  const size = computed(() => pick(config.value.navSize, SIZES, navigation.size));
23
- const itemMode = computed(() => pick(config.value.navItemMode, ITEM_MODES, navigation.itemMode));
55
+ const itemMode = computed(() => pick(config.value.navItemMode, ITEM_MODES, navigation.itemMode, docNav.value.navItemMode));
24
56
  const activeStyle = computed(() => pick(config.value.navActiveStyle, ACTIVE_STYLES, navigation.activeStyle));
57
+ const section = computed(() => pick(config.value.navSection, SECTION_MODES, navigation.section, docNav.value.navSection));
58
+ const counts = computed(() => pick(config.value.navCounts, COUNT_MODES, navigation.counts));
59
+ const mobileMode = computed(() => pick(config.value.navMobileMode, MOBILE_MODES, navigation.mobileMode, docNav.value.navMobileMode));
25
60
  return {
26
61
  placement,
27
62
  shape,
28
63
  size,
29
64
  itemMode,
30
65
  activeStyle,
31
- autoHide: computed(() => flag(config.value.navAutoHide, navigation.autoHide)),
66
+ /** The section bar's shape — `off` unless a site asked for one. */
67
+ section,
68
+ /** What a nav item's badge counts — `off` unless a site asked for one. */
69
+ counts,
70
+ /**
71
+ * …and the document may answer this one too, as `on` / `off` rather than a
72
+ * boolean: `junView` values are the strings a `select` stores, and a
73
+ * boolean has no way to spell "no opinion".
74
+ */
75
+ autoHide: computed(() => flag(config.value.navAutoHide, navigation.autoHide, docNav.value.navAutoHide)),
32
76
  blur: computed(() => flag(config.value.navBlur, navigation.blur)),
33
77
  homeItem: computed(() => flag(config.value.navHomeItem, navigation.homeItem)),
34
78
  showLogo: computed(() => flag(config.value.navShowLogo, navigation.showLogo)),
@@ -68,7 +112,65 @@ export function useJunNavSettings() {
68
112
  logoVariant: computed(() => pick(config.value.brandLogoVariant, LOGO_VARIANTS, brand.logoVariant)),
69
113
  /** True for the two vertical placements — the track then stacks. */
70
114
  isRail: computed(() => placement.value === "rail-left" || placement.value === "rail-right"),
115
+ // ── Mobile ───────────────────────────────────────────────────────────────
116
+ /**
117
+ * The phone presentation. `track` — today's scrolling row — is the default
118
+ * and the only one that renders no trigger at all.
119
+ */
120
+ mobileMode,
121
+ mobilePlacement: computed(() => pick(config.value.navMobilePlacement, MOBILE_PLACEMENTS, navigation.mobilePlacement)),
122
+ breakpoint: computed(() => pick(config.value.navBreakpoint, BREAKPOINTS, navigation.breakpoint)),
123
+ railBreakpoint: computed(() => pick(config.value.navRailBreakpoint, RAIL_BREAKPOINTS, navigation.railBreakpoint)),
124
+ menuIcon: computed(() => pick(config.value.navMenuIcon, MENU_ICONS, navigation.menuIcon)),
125
+ menuSide: computed(() => pick(config.value.navMenuSide, MENU_SIDES, navigation.menuSide)),
126
+ /**
127
+ * Item rendering inside the menu, with `inherit` already resolved — no
128
+ * consumer should have to know that `inherit` means "ask `itemMode`", and
129
+ * `icon-focus` is silently downgraded because a phone has no hover to
130
+ * reveal the label with.
131
+ */
132
+ menuItemMode: computed(() => {
133
+ const stored = pick(
134
+ config.value.navMobileItemMode,
135
+ MOBILE_ITEM_MODES,
136
+ navigation.mobileItemMode
137
+ );
138
+ const resolved = stored === "inherit" ? itemMode.value : stored;
139
+ return resolved === "icon-focus" ? "icon-text" : resolved;
140
+ }),
141
+ menuChildren: computed(() => flag(config.value.navMenuChildren, navigation.menuChildren)),
142
+ menuExtras: computed(() => flag(config.value.navMenuExtras, navigation.menuExtras)),
143
+ desktopMenu: computed(() => flag(config.value.navDesktopMenu, navigation.desktopMenu)),
144
+ /** True when SOME viewport gets a menu — i.e. the trigger has to exist. */
145
+ menuEnabled: computed(() => mobileMode.value !== "track" || flag(config.value.navDesktopMenu, navigation.desktopMenu)),
146
+ // ── Track layout ─────────────────────────────────────────────────────────
147
+ overflow: computed(() => pick(config.value.navOverflow, OVERFLOWS, navigation.overflow)),
148
+ children: computed(() => pick(config.value.navChildren, CHILDREN_MODES, navigation.children)),
149
+ align: computed(() => pick(config.value.navAlign, ALIGNS, navigation.align)),
150
+ width: computed(() => pick(config.value.navWidth, WIDTHS, navigation.width)),
151
+ separators: computed(() => flag(config.value.navSeparators, navigation.separators)),
152
+ scrollArrows: computed(() => flag(config.value.navScrollArrows, navigation.scrollArrows)),
153
+ edgeFade: computed(() => flag(config.value.navEdgeFade, navigation.edgeFade)),
154
+ snap: computed(() => flag(config.value.navSnap, navigation.snap)),
71
155
  /** The vocabularies, so the settings page never keeps a second copy. */
72
- vocab: { PLACEMENTS, SHAPES, SIZES, ITEM_MODES, ACTIVE_STYLES, LOGO_ACTIONS }
156
+ vocab: {
157
+ PLACEMENTS,
158
+ SHAPES,
159
+ SIZES,
160
+ ITEM_MODES,
161
+ ACTIVE_STYLES,
162
+ LOGO_ACTIONS,
163
+ MOBILE_MODES,
164
+ MOBILE_PLACEMENTS,
165
+ BREAKPOINTS,
166
+ RAIL_BREAKPOINTS,
167
+ MENU_ICONS,
168
+ MENU_SIDES,
169
+ MOBILE_ITEM_MODES,
170
+ OVERFLOWS,
171
+ CHILDREN_MODES,
172
+ ALIGNS,
173
+ WIDTHS
174
+ }
73
175
  };
74
176
  }
@@ -10,6 +10,7 @@ export declare function useJunBrand(): import("vue").ComputedRef<{
10
10
  logoMark: import("../types.js").JunLogoMark;
11
11
  logoVariant: import("../types.js").JunLogoVariant;
12
12
  themeColor: string;
13
+ lang: string;
13
14
  iconBackground: string;
14
15
  schemaType: import("../types.js").JunBrand["schemaType"];
15
16
  }>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * useJunSiblings — the pages either side of this one.
3
+ *
4
+ * Round eight gave journal entries a "newer / older" pair, computed inside the
5
+ * renderer. Round nine needs the same pair for a SWIPE, on any page type, so
6
+ * the arithmetic moved here — one list, one order, one visibility rule, read by
7
+ * the renderer that draws the links and by the gesture that follows them.
8
+ *
9
+ * Two things it will not do:
10
+ *
11
+ * - **Wrap.** A finite collection should feel finite; see `junNeighboursOf`.
12
+ * - **Offer a page nobody was shown.** Drafts, hidden pages, owner-only
13
+ * documents and the parent's own self-descriptor are all filtered out — a
14
+ * "next" that lands on the Site Config document is worse than no next.
15
+ */
16
+ import { type ComputedRef, type Ref } from 'vue';
17
+ import { type JunNeighbourPair } from '../utils/junGesture.js';
18
+ export interface JunSibling {
19
+ id: string;
20
+ label: string;
21
+ parentId?: string | null;
22
+ type?: string;
23
+ order?: number;
24
+ meta?: Record<string, unknown>;
25
+ }
26
+ export declare function useJunSiblings(docId: Ref<string | null> | ComputedRef<string | null>): {
27
+ siblings: ComputedRef<JunSibling[]>;
28
+ neighbours: ComputedRef<JunNeighbourPair<JunSibling>>;
29
+ parentId: ComputedRef<string | null>;
30
+ };
@@ -0,0 +1,38 @@
1
+ import { computed } from "vue";
2
+ import { useDocTree, useJunOptions } from "#imports";
3
+ import { junNeighboursOf, junSortSiblings } from "../utils/junGesture.js";
4
+ export function useJunSiblings(docId) {
5
+ const { entries, getEntry } = useDocTree();
6
+ const opts = useJunOptions();
7
+ const parentId = computed(() => {
8
+ const id = docId.value;
9
+ return id ? getEntry(id)?.parentId ?? null : null;
10
+ });
11
+ const orderMode = computed(() => {
12
+ const parentType = parentId.value ? getEntry(parentId.value)?.type : void 0;
13
+ return parentType && opts.feedItemTypes?.includes(parentType) ? "dated" : "order";
14
+ });
15
+ const siblings = computed(() => {
16
+ const parent = parentId.value;
17
+ if (!parent) return [];
18
+ const list = entries.value.filter(
19
+ (entry) => entry.parentId === parent && entry.id !== parent && !entry.trashed && !!entry.label && entry.meta?.draft !== true && entry.meta?.hidden !== true && entry.meta?.ownerOnly !== true && entry.meta?.siteConfig !== true && !entry.meta?.signerId && entry.meta?.replyTo == null
20
+ ).map((entry) => ({
21
+ id: entry.id,
22
+ label: entry.label ?? "",
23
+ parentId: entry.parentId ?? null,
24
+ type: entry.type,
25
+ order: entry.order,
26
+ meta: entry.meta
27
+ }));
28
+ return junSortSiblings(
29
+ list.map((entry) => ({ ...entry, date: entry.meta?.date })),
30
+ orderMode.value
31
+ );
32
+ });
33
+ const neighbours = computed(() => {
34
+ const id = docId.value;
35
+ return id ? junNeighboursOf(siblings.value, id) : { prev: null, next: null };
36
+ });
37
+ return { siblings, neighbours, parentId };
38
+ }
@@ -48,13 +48,20 @@
48
48
  */
49
49
  import { type ComputedRef } from 'vue';
50
50
  import type { TreeEntry } from '@abraca/nuxt';
51
- import type { JunBackdropKind, JunBackgroundFit, JunCampfirePillMode, JunCampfirePlacement, JunCampfireRosterStyle, JunCampfireSize, JunCampfireTab, JunNavActiveStyle, JunNavItemMode, JunNavLogoAction, JunNavPlacement, JunNavShape, JunNavSize } from '../types.js';
52
- export type { JunBackdropKind, JunBackgroundFit, JunCampfirePillMode, JunCampfirePlacement, JunCampfireRosterStyle, JunCampfireSize, JunCampfireTab, JunNavActiveStyle, JunNavItemMode, JunNavLogoAction, JunNavPlacement, JunNavShape, JunNavSize, } from '../types.js';
51
+ import type { JunBackdropKind, JunBackgroundFit, JunCampfirePillMode, JunCampfirePlacement, JunCampfireRosterStyle, JunCampfireSize, JunCampfireTab, JunNavActiveStyle, JunNavAlign, JunNavBreakpoint, JunNavChildrenMode, JunNavItemMode, JunNavLogoAction, JunNavMenuIcon, JunNavMenuSide, JunNavMobileItemMode, JunNavMobileMode, JunNavMobilePlacement, JunNavOverflow, JunNavPlacement, JunNavCountMode, JunNavSectionMode, JunNavRailBreakpoint, JunNavShape, JunNavSize, JunNavWidth } from '../types.js';
52
+ export type { JunBackdropKind, JunBackgroundFit, JunCampfirePillMode, JunCampfirePlacement, JunCampfireRosterStyle, JunCampfireSize, JunCampfireTab, JunNavActiveStyle, JunNavAlign, JunNavBreakpoint, JunNavChildrenMode, JunNavItemMode, JunNavLogoAction, JunNavMenuIcon, JunNavMenuSide, JunNavMobileItemMode, JunNavMobileMode, JunNavMobilePlacement, JunNavOverflow, JunNavPlacement, JunNavRailBreakpoint, JunNavShape, JunNavSize, JunNavWidth, } from '../types.js';
53
53
  export type JunThemeRadius = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
54
54
  export type JunThemeAccent = 'mono' | 'sun' | 'blue' | 'emerald' | 'violet' | 'amber' | 'rose' | 'teal';
55
55
  export type JunThemeNeutral = 'slate' | 'zinc' | 'stone';
56
56
  export type JunThemeBlobs = 'off' | 'quiet' | 'normal' | 'bold';
57
- export type JunThemeFont = 'default' | 'serif' | 'grotesk' | 'mono';
57
+ /**
58
+ * The site's typeface.
59
+ *
60
+ * The first four are ONE face each and are what the module has always offered;
61
+ * the last three are PAIRINGS — a body face and a display face — because a
62
+ * site's type is two decisions and only one of them was on offer.
63
+ */
64
+ export type JunThemeFont = 'default' | 'serif' | 'grotesk' | 'mono' | 'editorial' | 'humanist' | 'technical';
58
65
  /**
59
66
  * How much glass the site wears. `backdrop-filter` is the most expensive thing
60
67
  * on the page and this site has a lot of them, so this is a performance
@@ -67,10 +74,30 @@ export interface JunSiteConfig {
67
74
  seoTitleTemplate?: string;
68
75
  seoDescription?: string;
69
76
  seoOgImage?: string;
77
+ /**
78
+ * The address this site calls its own — `https://jun.is`.
79
+ *
80
+ * Only the owner can answer it. A site reachable at a preview domain, an IP,
81
+ * `www.` and bare has to name ONE of them in its canonical tag and its
82
+ * `og:url`, or every address competes with the others for the same page.
83
+ * Empty means "whatever address the visitor arrived on", which is right for
84
+ * a deployment with one.
85
+ */
86
+ seoSiteUrl?: string;
87
+ /** The site's language for `<html lang>` — a BCP-47 tag. */
88
+ seoLang?: string;
89
+ /** Swipe left/right to reach the next or previous page. Unset means on. */
90
+ gesturePages?: boolean;
91
+ /** Swipe in from a screen edge to open the navigation menu. Unset means on. */
92
+ gestureEdge?: boolean;
70
93
  /** Navigation — every key falls back to the build-time `jun.navigation` default. */
71
94
  navItemMode?: JunNavItemMode;
72
95
  navActiveStyle?: JunNavActiveStyle;
73
96
  navPlacement?: JunNavPlacement;
97
+ /** The section bar's shape. `off` is the default and what the site did before. */
98
+ navSection?: JunNavSectionMode;
99
+ /** What a nav item's badge counts. `off` is the default. */
100
+ navCounts?: JunNavCountMode;
74
101
  navShape?: JunNavShape;
75
102
  navSize?: JunNavSize;
76
103
  navAutoHide?: boolean;
@@ -89,6 +116,27 @@ export interface JunSiteConfig {
89
116
  /** The fellow-travellers dot stack, and whether hovering it names them. */
90
117
  navTravellers?: boolean;
91
118
  navTravellersList?: boolean;
119
+ /** Mobile navigation — the menu that replaces the track below `navBreakpoint`. */
120
+ navMobileMode?: JunNavMobileMode;
121
+ navMobilePlacement?: JunNavMobilePlacement;
122
+ navBreakpoint?: JunNavBreakpoint;
123
+ navMenuIcon?: JunNavMenuIcon;
124
+ navMenuSide?: JunNavMenuSide;
125
+ navMobileItemMode?: JunNavMobileItemMode;
126
+ navMenuChildren?: boolean;
127
+ navMenuExtras?: boolean;
128
+ /** Collapse the DESKTOP navbar into the same menu. */
129
+ navDesktopMenu?: boolean;
130
+ /** Track layout — overflow, submenus, alignment, width and the scroll chrome. */
131
+ navOverflow?: JunNavOverflow;
132
+ navChildren?: JunNavChildrenMode;
133
+ navAlign?: JunNavAlign;
134
+ navWidth?: JunNavWidth;
135
+ navSeparators?: boolean;
136
+ navScrollArrows?: boolean;
137
+ navEdgeFade?: boolean;
138
+ navSnap?: boolean;
139
+ navRailBreakpoint?: JunNavRailBreakpoint;
92
140
  /** Which built-in mark `<JunLogo>` draws, and whether it carries the name. */
93
141
  brandLogo?: 'sprout' | 'node' | 'page' | 'sun';
94
142
  brandLogoVariant?: 'mark' | 'lockup' | 'wordmark';
@@ -38,7 +38,10 @@ const BLOBS = {
38
38
  const FONT_CLASS = {
39
39
  serif: "jun-font-serif",
40
40
  grotesk: "jun-font-grotesk",
41
- mono: "jun-font-mono"
41
+ mono: "jun-font-mono",
42
+ editorial: "jun-font-editorial",
43
+ humanist: "jun-font-humanist",
44
+ technical: "jun-font-technical"
42
45
  };
43
46
  const SURFACE_CLASS = {
44
47
  glass: "",
@@ -1,8 +1,16 @@
1
+ import { getCurrentInstance, onMounted, ref } from "vue";
1
2
  import { useItemPresence } from "#imports";
2
3
  export function useJunViewingAccent() {
3
4
  const { getViewers } = useItemPresence();
5
+ const mounted = ref(false);
6
+ if (getCurrentInstance()) {
7
+ onMounted(() => {
8
+ mounted.value = true;
9
+ });
10
+ }
4
11
  const tint = (color, pct) => `color-mix(in oklab, ${color} ${pct}%, transparent)`;
5
12
  function accentStyle(id) {
13
+ if (!mounted.value) return void 0;
6
14
  const color = getViewers(id)[0]?.color;
7
15
  if (!color) return void 0;
8
16
  return {
@@ -10,6 +18,7 @@ export function useJunViewingAccent() {
10
18
  };
11
19
  }
12
20
  function accentInsetStyle(id) {
21
+ if (!mounted.value) return void 0;
13
22
  const color = getViewers(id)[0]?.color;
14
23
  if (!color) return void 0;
15
24
  return {
@@ -17,6 +26,7 @@ export function useJunViewingAccent() {
17
26
  };
18
27
  }
19
28
  function accentTitle(id) {
29
+ if (!mounted.value) return void 0;
20
30
  const viewers = getViewers(id);
21
31
  if (!viewers.length) return void 0;
22
32
  const first = viewers[0].name;
@@ -57,6 +57,26 @@ if (import.meta.client && contextMenu.suppressNative) {
57
57
 
58
58
  <template>
59
59
  <div class="relative min-h-screen">
60
+ <!-- Bypass the navbar. THE FIRST FOCUSABLE THING ON THE PAGE, and that is
61
+ the whole feature: put it inside `<JunShell>` and the navbar renders
62
+ first, so the link is stop twenty-six rather than stop one. (It was,
63
+ briefly. The check that caught it presses Tab once and reads what has
64
+ focus.)
65
+
66
+ Measured before it was written: a keyboard visitor passes FOURTEEN
67
+ stops without reaching the content on this demo, and the navbar has
68
+ twenty-three items — so the real number is about twenty-five, on every
69
+ page of the site. WCAG 2.4.1 is a Level A criterion; this is its
70
+ standard remedy.
71
+
72
+ Outside the veil, too: the intro fades the CONTENT in, and a skip link
73
+ that is invisible for the first second is invisible exactly when a
74
+ keyboard reader arrives. -->
75
+ <a
76
+ href="#jun-main"
77
+ class="jun-skip-link"
78
+ >Skip to content</a>
79
+
60
80
  <!-- The persistent ambient backdrop. Always present; it quiets itself on
61
81
  locked page types. The page base stays the plain theme background —
62
82
  the backdrop paints ONLY the blobs. -->
@@ -91,7 +111,7 @@ if (import.meta.client && contextMenu.suppressNative) {
91
111
  :class="contentVeiled ? 'jun-content-veiled' : ''"
92
112
  >
93
113
  <JunShell>
94
- <UMain>
114
+ <UMain id="jun-main" tabindex="-1">
95
115
  <slot />
96
116
  </UMain>
97
117
 
@@ -132,6 +132,8 @@ const cachedHtml = computed(() => hidden.value ? "" : resolved.value?.html ?? ""
132
132
  :editable="editing"
133
133
  :entry="cachedEntry"
134
134
  :html="cachedHtml"
135
+ :section="resolved?.section ?? null"
136
+ :trail="resolved?.trail"
135
137
  breadcrumbs
136
138
  />
137
139
 
@@ -67,6 +67,8 @@ function addChild() {
67
67
  :editable="editing"
68
68
  :entry="cachedEntry"
69
69
  :html="cachedHtml"
70
+ :section="resolved?.section ?? null"
71
+ :trail="resolved?.trail"
70
72
  >
71
73
  <template #footer>
72
74
  <div
@@ -1,3 +1,4 @@
1
+ import { type JunJanitorStatus } from '../utils/junJanitorStatus.js';
1
2
  import { type JunReadinessState } from '../../utils/junReadiness.js';
2
3
  export interface JunHealthReport {
3
4
  state: JunReadinessState;
@@ -14,6 +15,20 @@ export interface JunHealthReport {
14
15
  sweptMsAgo: number | null;
15
16
  rootDocId: string;
16
17
  ageMs: number;
18
+ /**
19
+ * The `@abraca/junis` version this image was BUILT from — the answer to "is
20
+ * the fix actually deployed", which is not a question the source tree can be
21
+ * asked. See `JunRuntimeOptions.version`.
22
+ */
23
+ version: string;
24
+ /** When this image was built, epoch ms — see `JunRuntimeOptions.builtAt`. */
25
+ builtAt: number | null;
26
+ /**
27
+ * What the janitor runner is doing. Reported even when the feature is off, so
28
+ * "there is no janitor" is always distinguishable from "there is no janitor
29
+ * IN THIS BUILD" — the two states that cost jun.is weeks.
30
+ */
31
+ janitor: JunJanitorStatus;
17
32
  }
18
33
  declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<JunHealthReport>>;
19
34
  export default _default;
@@ -2,6 +2,7 @@ import { defineEventHandler, setResponseStatus } from "h3";
2
2
  import { useRuntimeConfig, useStorage } from "nitropack/runtime";
3
3
  import { junDocTree, junHeartbeat, junRootDocId, junSlugMap } from "../utils/junCache.js";
4
4
  import { junBootedAt } from "../utils/junBoot.js";
5
+ import { junJanitorStatus } from "../utils/junJanitorStatus.js";
5
6
  import { junReadiness } from "../../utils/junReadiness.js";
6
7
  export default defineEventHandler(async (event) => {
7
8
  const storage = useStorage();
@@ -13,7 +14,8 @@ export default defineEventHandler(async (event) => {
13
14
  ]);
14
15
  const ageMs = Date.now() - junBootedAt();
15
16
  const sweptMsAgo = beat && beat.at >= junBootedAt() ? Date.now() - beat.at : null;
16
- const features = (useRuntimeConfig().public.jun ?? {}).features ?? {};
17
+ const jun = useRuntimeConfig().public.jun ?? {};
18
+ const features = jun.features ?? {};
17
19
  const verdict = junReadiness({
18
20
  treeSize: Object.keys(tree).length,
19
21
  slugCount: Object.keys(slugs).length,
@@ -35,6 +37,9 @@ export default defineEventHandler(async (event) => {
35
37
  },
36
38
  sweptMsAgo,
37
39
  rootDocId: junRootDocId(),
38
- ageMs
40
+ ageMs,
41
+ version: jun.version ?? "unknown",
42
+ builtAt: jun.builtAt ?? null,
43
+ janitor: junJanitorStatus()
39
44
  };
40
45
  });
@@ -1,10 +1,12 @@
1
+ import { getQuery } from "h3";
1
2
  import { defineCachedEventHandler } from "nitropack/runtime";
2
3
  import { junDocHtml, junDocTree, junRootDocId, junSlugMap } from "../utils/junCache.js";
3
4
  import { isJunOwnerOnlyDoc } from "../utils/junVisibility.js";
4
5
  import { junGardenEdges, junMaturityOf } from "../../utils/junGarden.js";
5
- export default defineCachedEventHandler(async () => {
6
+ export default defineCachedEventHandler(async (event) => {
6
7
  const rootDocId = junRootDocId();
7
8
  const [tree, idToSlug] = await Promise.all([junDocTree(), junSlugMap()]);
9
+ const doc = String(getQuery(event).doc ?? "").trim();
8
10
  const nodes = [];
9
11
  const slugToId = {};
10
12
  const knownIds = /* @__PURE__ */ new Set();
@@ -28,10 +30,32 @@ export default defineCachedEventHandler(async () => {
28
30
  nodes.map(async (node) => ({ id: node.id, html: await junDocHtml(node.id) }))
29
31
  );
30
32
  const scanned = bodies.filter((b) => b.html).length;
33
+ const edges = junGardenEdges(bodies, slugToId, knownIds);
34
+ if (doc) {
35
+ const mine = edges.filter((edge) => edge.source === doc || edge.target === doc);
36
+ const wanted = /* @__PURE__ */ new Set([doc]);
37
+ for (const edge of mine) {
38
+ wanted.add(edge.source);
39
+ wanted.add(edge.target);
40
+ }
41
+ return {
42
+ nodes: nodes.filter((node) => wanted.has(node.id)),
43
+ edges: mine,
44
+ scanned,
45
+ generatedAt: Date.now()
46
+ };
47
+ }
31
48
  return {
32
49
  nodes,
33
- edges: junGardenEdges(bodies, slugToId, knownIds),
50
+ edges,
34
51
  scanned,
35
52
  generatedAt: Date.now()
36
53
  };
37
- }, { maxAge: 60, swr: true, name: "jun-links", getKey: () => "graph" });
54
+ }, {
55
+ maxAge: 60,
56
+ swr: true,
57
+ name: "jun-links",
58
+ // The doc is PART OF THE KEY. Without it the first caller's answer — whole
59
+ // graph or one document's — would be served to the other for a minute.
60
+ getKey: (event) => `graph:${String(getQuery(event).doc ?? "")}`
61
+ });
@@ -11,6 +11,8 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
11
11
  parentId?: undefined;
12
12
  parentType?: undefined;
13
13
  parentTitle?: undefined;
14
+ trail?: undefined;
15
+ section?: undefined;
14
16
  } | {
15
17
  found: true;
16
18
  cacheReady: boolean;
@@ -24,6 +26,8 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
24
26
  parentId?: undefined;
25
27
  parentType?: undefined;
26
28
  parentTitle?: undefined;
29
+ trail?: undefined;
30
+ section?: undefined;
27
31
  } | {
28
32
  found: true;
29
33
  cacheReady: boolean;
@@ -35,6 +39,22 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
35
39
  parentId: string | null;
36
40
  parentType: string | null;
37
41
  parentTitle: string | null;
42
+ trail: {
43
+ id: string;
44
+ title: string;
45
+ slug: string | null;
46
+ }[];
47
+ section: {
48
+ parentId: string;
49
+ parentTitle: string;
50
+ parentSlug: string | null;
51
+ items: {
52
+ id: string;
53
+ title: string;
54
+ slug: string | null;
55
+ icon: string | undefined;
56
+ }[];
57
+ } | null;
38
58
  html: string | null;
39
59
  ownerOnly?: undefined;
40
60
  }>>;