@abraca/junis 2.92.0 → 2.95.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 (48) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +27 -5
  3. package/dist/runtime/assets/css/jun.css +1 -1
  4. package/dist/runtime/components/JunDocSurface.vue +1 -1
  5. package/dist/runtime/components/JunHead.vue +35 -4
  6. package/dist/runtime/components/JunHorizontalTimeline.vue +1 -1
  7. package/dist/runtime/components/JunImagePopup.client.vue +7 -2
  8. package/dist/runtime/components/JunNavMenu.client.vue +3 -3
  9. package/dist/runtime/components/JunNavPreview.d.vue.ts +2 -1
  10. package/dist/runtime/components/JunNavPreview.vue +61 -1
  11. package/dist/runtime/components/JunNavPreview.vue.d.ts +2 -1
  12. package/dist/runtime/components/JunNavigation.vue +110 -4
  13. package/dist/runtime/components/JunNotFound.vue +1 -1
  14. package/dist/runtime/components/JunReaders.vue +1 -1
  15. package/dist/runtime/components/JunShell.vue +20 -3
  16. package/dist/runtime/components/JunStudioBar.client.vue +1 -1
  17. package/dist/runtime/components/renderers/JunConfigRenderer.vue +179 -0
  18. package/dist/runtime/components/renderers/JunGardenRenderer.vue +45 -8
  19. package/dist/runtime/components/renderers/JunHomeRenderer.vue +2 -2
  20. package/dist/runtime/composables/useJunMobile.d.ts +5 -0
  21. package/dist/runtime/composables/useJunMobile.js +56 -0
  22. package/dist/runtime/composables/useJunNavItems.js +22 -1
  23. package/dist/runtime/composables/useJunNavSettings.d.ts +8 -1
  24. package/dist/runtime/composables/useJunNavSettings.js +21 -1
  25. package/dist/runtime/composables/useJunOptions.d.ts +2 -2
  26. package/dist/runtime/composables/useJunSettings.d.ts +1 -1
  27. package/dist/runtime/composables/useJunSettings.js +4 -0
  28. package/dist/runtime/composables/useJunSiteConfig.d.ts +63 -2
  29. package/dist/runtime/composables/useJunTheme.js +3 -7
  30. package/dist/runtime/error.vue +2 -2
  31. package/dist/runtime/layouts/jun.vue +3 -1
  32. package/dist/runtime/pages/doc.vue +1 -1
  33. package/dist/runtime/pages/index.vue +1 -1
  34. package/dist/runtime/server/janitor/junJanitorActor.d.ts +40 -0
  35. package/dist/runtime/server/janitor/junJanitorActor.js +118 -3
  36. package/dist/runtime/server/janitor/junJanitorMachine.js +25 -2
  37. package/dist/runtime/server/janitor/junJanitorStore.d.ts +30 -6
  38. package/dist/runtime/server/janitor/junJanitorStore.js +32 -15
  39. package/dist/runtime/server/plugins/jun-doc-cache.js +6 -8
  40. package/dist/runtime/server/plugins/jun-janitor.js +7 -0
  41. package/dist/runtime/server/routes/manifest.webmanifest.get.js +18 -0
  42. package/dist/runtime/types.d.ts +56 -2
  43. package/dist/runtime/utils/junIdentity.d.ts +13 -0
  44. package/dist/runtime/utils/junIdentity.js +7 -3
  45. package/dist/runtime/utils/junMark.d.ts +35 -0
  46. package/dist/runtime/utils/junMark.js +11 -0
  47. package/dist/runtime/utils/junNavValue.js +8 -1
  48. package/package.json +2 -1
@@ -27,7 +27,7 @@ const props = defineProps({
27
27
  });
28
28
  const router = useRouter();
29
29
  const route = useRoute();
30
- const { features } = useJunOptions();
30
+ const { features, brand: junBrand } = useJunOptions();
31
31
  const { isImmersiveType, isPanelType } = useJunLayoutPolicy();
32
32
  const { resolveType } = useJunPageType();
33
33
  const { navVeiled: introNavVeiled, navLogoVeiled: introLogoVeiled } = useJunIntro();
@@ -137,7 +137,7 @@ const navNumberById = computed(() => {
137
137
  return m;
138
138
  });
139
139
  const navNumberFor = (item) => navNumberById.value.get(item.id ?? item.href) ?? 0;
140
- const showArrows = computed(() => nav.scrollArrows.value && (vertical.value || nav.overflow.value !== "wrap" && nav.overflow.value !== "more"));
140
+ const showArrows = computed(() => nav.scrollArrows.value && !isTouch.value && (vertical.value || nav.overflow.value !== "wrap" && nav.overflow.value !== "more"));
141
141
  const { editing, openLogin } = useJunStudio();
142
142
  const abra = useAbracadabra();
143
143
  const navTree = useChildTree(abra.doc, "jun-nav-reorder");
@@ -573,6 +573,27 @@ const triggerDisplayClass = computed(() => {
573
573
  return TRIGGER_BELOW[nav.breakpoint.value] ?? "flex sm:hidden";
574
574
  });
575
575
  const dockDisplayClass = computed(() => TRIGGER_BELOW[nav.breakpoint.value] ?? "flex sm:hidden");
576
+ const PANEL_AT = {
577
+ sm: "hidden sm:block",
578
+ md: "hidden md:block",
579
+ lg: "hidden lg:block"
580
+ };
581
+ const PANEL_SHAPES = /* @__PURE__ */ new Set(["bar", "inset", "edge", "split"]);
582
+ const panelDisplayClass = computed(() => PANEL_SHAPES.has(nav.mobileBar.value) ? "" : PANEL_AT[nav.breakpoint.value] ?? "hidden sm:block");
583
+ const floatDisplayClass = computed(() => nav.mobileBar.value === "float" ? TRIGGER_BELOW[nav.breakpoint.value] ?? "flex sm:hidden" : "hidden");
584
+ const barTitle = computed(() => {
585
+ const site = junBrand.name;
586
+ if (nav.mobileTitle.value === "site") return site;
587
+ if (nav.mobileTitle.value !== "page") return "";
588
+ const entry = docId.value ? getEntry(docId.value) : void 0;
589
+ return entry?.label || site;
590
+ });
591
+ const titleDisplayClass = computed(() => {
592
+ if (nav.mobileTitle.value === "off") return "hidden";
593
+ if (!PANEL_SHAPES.has(nav.mobileBar.value) || nav.mobileBar.value === "split") return "hidden";
594
+ if (nav.mobileMode.value === "track" && !nav.desktopMenu.value) return "hidden";
595
+ return TRIGGER_BELOW[nav.breakpoint.value] ?? "flex sm:hidden";
596
+ });
576
597
  const hasTrigger = computed(() => triggerDisplayClass.value !== "hidden");
577
598
  const leftTrigger = computed(() => hasTrigger.value && nav.menuSide.value === "left");
578
599
  const placement = computed(() => {
@@ -615,6 +636,7 @@ const isAtTop = computed(
615
636
  );
616
637
  const panelEl = ref(null);
617
638
  const dockEl = ref(null);
639
+ const fabEl = ref(null);
618
640
  function publishNavGeometry() {
619
641
  if (!import.meta.client) return;
620
642
  const root = document.documentElement;
@@ -629,6 +651,11 @@ function publishNavGeometry() {
629
651
  delete root.dataset.junDock;
630
652
  root.style.removeProperty("--jun-nav-dock-h");
631
653
  }
654
+ const fabH = fabEl.value ? Math.round(fabEl.value.getBoundingClientRect().height) : 0;
655
+ const panelShown = !!panelEl.value && panelEl.value.getBoundingClientRect().height > 0;
656
+ if (fabH > 0) root.dataset.junBar = "float";
657
+ else if (!panelShown) root.dataset.junBar = "none";
658
+ else delete root.dataset.junBar;
632
659
  if (vertical.value && panelEl.value) {
633
660
  const r = panelEl.value.getBoundingClientRect();
634
661
  root.style.setProperty("--jun-nav-rail-w", `${Math.round(r.width) + 12}px`);
@@ -1124,6 +1151,9 @@ onUnmounted(() => {
1124
1151
  class="jun-nav-root fixed z-50 transition-all duration-500"
1125
1152
  :data-jun-nav-mode="nav.itemMode.value"
1126
1153
  :data-jun-nav-placement="placement"
1154
+ :data-jun-bar-shape="nav.mobileBar.value"
1155
+ :data-jun-bp="nav.breakpoint.value"
1156
+ :data-jun-menu-side="nav.menuSide.value"
1127
1157
  :class="[
1128
1158
  hiddenClass,
1129
1159
  introNavVeiled ? `jun-nav-intro-hidden jun-nav-intro-${placement}` : '',
@@ -1156,7 +1186,13 @@ onUnmounted(() => {
1156
1186
  chromeClass,
1157
1187
  blurClass,
1158
1188
  shadowClass,
1159
- vertical ? ['flex max-h-[80vh] flex-col overflow-hidden', shapeClass] : isBar ? 'jun-nav-docked' : [
1189
+ // Below the breakpoint, `mobileBar` may take the whole panel away —
1190
+ // for the bare floating trigger, or for a site whose dock is its
1191
+ // navigation. A responsive display class rather than a `v-if`, so both
1192
+ // shapes are in the served HTML and a crawler reads the links either
1193
+ // way. See `panelDisplayClass`.
1194
+ panelDisplayClass,
1195
+ vertical ? ['flex max-h-[80dvh] flex-col overflow-hidden', shapeClass] : isBar ? 'jun-nav-docked' : [
1160
1196
  'mx-auto',
1161
1197
  widthClass,
1162
1198
  panelHeightClass,
@@ -1201,6 +1237,7 @@ onUnmounted(() => {
1201
1237
  <button
1202
1238
  v-if="leftTrigger"
1203
1239
  type="button"
1240
+ data-jun-nav-slot="trigger"
1204
1241
  class="ml-2 h-8 w-8 flex-none items-center justify-center rounded-full text-black/55 transition-colors duration-200 hover:scale-110 hover:text-black active:scale-95 dark:text-white/55 dark:hover:text-white"
1205
1242
  :class="triggerDisplayClass"
1206
1243
  style="pointer-events: auto"
@@ -1220,6 +1257,7 @@ onUnmounted(() => {
1220
1257
  <component
1221
1258
  :is="logoOpensPalette ? 'button' : NuxtLink"
1222
1259
  v-if="nav.showLogo.value"
1260
+ data-jun-nav-slot="logo"
1223
1261
  :to="logoOpensPalette ? void 0 : '/'"
1224
1262
  :type="logoOpensPalette ? 'button' : void 0"
1225
1263
  :aria-label="logoOpensPalette ? 'Search' : 'Home'"
@@ -1264,7 +1302,34 @@ onUnmounted(() => {
1264
1302
  rather than on the track, so the wrapper's box IS the track's
1265
1303
  box — which is what lets the arrows use a plain `left-0` /
1266
1304
  `right-0` and land exactly on the scrolling edges. -->
1305
+ <!-- The page's name, in the TRACK's slot.
1306
+
1307
+ A sibling wearing the same reserve classes, rather than a span
1308
+ dropped into the row: the logo is absolutely placed in a bar and
1309
+ the track compensates with `ml-9`, so anything that wants the
1310
+ track's box has to wear the track's box. Below the breakpoint
1311
+ only, and only where the track is not already there — see
1312
+ `titleDisplayClass`. -->
1267
1313
  <div
1314
+ data-jun-nav-slot="title"
1315
+ :class="[
1316
+ 'relative min-w-0 flex-1 ml-9 items-center',
1317
+ titleDisplayClass,
1318
+ !nav.showLogo.value ? '!ml-3' : '',
1319
+ logoInFlow ? '!ml-0' : ''
1320
+ ]"
1321
+ >
1322
+ <!-- `px-3` is not decoration: it is the same internal padding a
1323
+ nav ITEM carries, and the reason the `ml-9` reserve works at
1324
+ all. The reserve clears the logo's 28px mark; the item's own
1325
+ padding clears its 12px box. A bare span with no padding
1326
+ started 16px INSIDE the logo — measured, the mark ran to x=61
1327
+ and the title began at x=45. -->
1328
+ <span class="min-w-0 truncate px-3 text-sm font-medium text-black/70 dark:text-white/70">{{ barTitle }}</span>
1329
+ </div>
1330
+
1331
+ <div
1332
+ data-jun-nav-slot="track"
1268
1333
  :class="[
1269
1334
  vertical ? 'relative min-h-0 w-full flex-1 flex-col' : 'relative min-w-0 flex-1 ml-9',
1270
1335
  trackDisplayClass,
@@ -1668,6 +1733,7 @@ onUnmounted(() => {
1668
1733
  <button
1669
1734
  v-if="hasTrigger && nav.menuSide.value === 'right'"
1670
1735
  type="button"
1736
+ data-jun-nav-slot="trigger"
1671
1737
  class="h-8 w-8 flex-none items-center justify-center rounded-full text-black/55 transition-colors duration-200 hover:scale-110 hover:text-black active:scale-95 dark:text-white/55 dark:hover:text-white"
1672
1738
  :class="triggerDisplayClass"
1673
1739
  style="pointer-events: auto"
@@ -1767,6 +1833,46 @@ onUnmounted(() => {
1767
1833
  </UDropdownMenu>
1768
1834
  </nav>
1769
1835
 
1836
+ <!-- ── `mobileBar: 'float'` — the trigger, and nothing else ──────────────
1837
+ A sibling of the panel rather than the panel stripped down, because a
1838
+ panel reduced to one control is a different element with different
1839
+ geometry: no width cap, no shared radius, no logo reserve, and nothing
1840
+ `useJunChrome` should measure as a bar taking an edge. Rendering both
1841
+ and letting the breakpoint pick keeps each one honest.
1842
+
1843
+ 44px square, which is the finger-sized floor by construction rather
1844
+ than by a hit-area patch — a control this component is inventing has
1845
+ no excuse to start too small.
1846
+
1847
+ It takes the ROOT's placement, so `mobilePlacement: 'bottom'` puts it
1848
+ in thumb reach and the safe-area rules that already inset the root
1849
+ apply to it unchanged. `menuSide` picks the corner. -->
1850
+ <div
1851
+ :class="[
1852
+ floatDisplayClass,
1853
+ isBar ? 'px-2' : '',
1854
+ nav.menuSide.value === 'left' ? 'justify-start' : 'justify-end'
1855
+ ]"
1856
+ class="w-full"
1857
+ >
1858
+ <button
1859
+ ref="fabEl"
1860
+ type="button"
1861
+ class="jun-chrome jun-nav-fab flex h-11 w-11 items-center justify-center rounded-full text-black/60 transition-transform duration-200 hover:scale-105 active:scale-95 dark:text-white/60"
1862
+ style="pointer-events: auto"
1863
+ aria-label="Open navigation"
1864
+ aria-haspopup="dialog"
1865
+ aria-controls="jun-nav-menu-panel"
1866
+ :aria-expanded="menuOpen"
1867
+ @click="menuOpen = true"
1868
+ >
1869
+ <UIcon
1870
+ :name="menuIcon"
1871
+ class="size-5"
1872
+ />
1873
+ </button>
1874
+ </div>
1875
+
1770
1876
  <!-- The sub-page panel. Client-only by construction: it exists only once
1771
1877
  somebody has hovered or pressed, so there is nothing to server-render
1772
1878
  and nothing to mismatch. Fixed, and positioned from the item's own
@@ -1779,7 +1885,7 @@ onUnmounted(() => {
1779
1885
  ref="childPanel"
1780
1886
  role="group"
1781
1887
  :aria-label="`Sub-pages of ${childMenuLabel}`"
1782
- class="jun-nav-children jun-blur fixed z-[55] max-h-[70vh] overflow-y-auto overscroll-contain rounded-xl border border-white/10 p-1.5 shadow-xl shadow-black/20 ring-1 ring-black/5 dark:border-black/5 dark:ring-white/10"
1888
+ class="jun-nav-children jun-blur fixed z-[55] max-h-[70dvh] overflow-y-auto overscroll-contain rounded-xl border border-white/10 p-1.5 shadow-xl shadow-black/20 ring-1 ring-black/5 dark:border-black/5 dark:ring-white/10"
1783
1889
  :style="{
1784
1890
  left: `${childMenuAt.x}px`,
1785
1891
  top: `${childMenuAt.y}px`,
@@ -51,7 +51,7 @@ onUnmounted(() => {
51
51
  </script>
52
52
 
53
53
  <template>
54
- <div class="flex min-h-[70vh] items-center justify-center px-4">
54
+ <div class="flex min-h-[70dvh] items-center justify-center px-4">
55
55
  <div class="w-full max-w-md text-center">
56
56
  <p
57
57
  class="select-none text-[80px] leading-none font-semibold tracking-tight
@@ -54,7 +54,7 @@ function titleFor(t) {
54
54
  v-for="t in shown"
55
55
  :key="t.clientId"
56
56
  type="button"
57
- class="jun-readers__chip group flex items-center gap-1.5 rounded-full py-0.5 pr-2 pl-1
57
+ class="jun-readers__chip jun-tap group flex items-center gap-1.5 rounded-full py-0.5 pr-2 pl-1
58
58
  text-[11px] whitespace-nowrap text-black/50 transition-colors duration-200
59
59
  hover:bg-black/[0.05] hover:text-black/80 dark:text-white/50
60
60
  dark:hover:bg-white/[0.07] dark:hover:text-white/85"
@@ -52,11 +52,28 @@ const navigation = computed(() => {
52
52
  </script>
53
53
 
54
54
  <template>
55
- <div class="min-h-screen">
55
+ <div class="jun-app-floor">
56
56
  <!-- Top fade — content dissolves into the navbar rather than sliding under
57
- a hard edge. -->
57
+ a hard edge.
58
+
59
+ `top-0`, and that one word is a bug fix. This element carried no
60
+ positioning at all, so a `fixed` box fell back to its STATIC position —
61
+ the top of body's CONTENT box, which `jun.css` pushes down by
62
+ `--jun-safe-t` to clear the notch. In a browser tab that inset is `0px`,
63
+ the box lands at `-81…-1` after its own `-translate-y-20`, and the fade
64
+ is entirely off-screen: invisible, which is how it went unexamined.
65
+
66
+ In a standalone install on an iPhone the same arithmetic starts 59px
67
+ lower and lands the box at `-22…58` — i.e. ON the status bar, and
68
+ nowhere else. So the one place this fade ever painted was over the
69
+ status-bar scrim, as a pale gradient across a dark strip. That is the
70
+ "hard black/white gradient in the top safe area", and it was this
71
+ element rather than the scrim underneath it.
72
+
73
+ Anchored to the viewport it does the same nothing in both, which is
74
+ what it did in every browser tab the site has ever been opened in. -->
58
75
  <div
59
- class="jun-blur-inverted fixed z-50 mx-auto -mt-px h-[80px] w-full -translate-y-20"
76
+ class="jun-blur-inverted pointer-events-none fixed top-0 z-50 mx-auto -mt-px h-[80px] w-full -translate-y-20"
60
77
  aria-hidden="true"
61
78
  />
62
79
 
@@ -340,7 +340,7 @@ const iconActions = computed(() => {
340
340
  <button
341
341
  type="button"
342
342
  data-jun-action="edit"
343
- class="rounded px-1.5 py-0.5 font-medium tracking-wide whitespace-nowrap"
343
+ class="jun-tap rounded px-1.5 py-0.5 font-medium tracking-wide whitespace-nowrap"
344
344
  :class="hot === 'edit' ? 'is-hot' : ''"
345
345
  :aria-label="editMode ? 'Stop editing' : 'Start editing'"
346
346
  @click="toggleEdit()"
@@ -69,6 +69,14 @@ const shapeOptions = [
69
69
  { label: "Square", value: "square", radius: "0px" },
70
70
  { label: "Ghost", value: "ghost", radius: "8px", bare: true }
71
71
  ];
72
+ const mobileBarOptions = [
73
+ { label: "Bar", value: "bar", hint: "A floating bar across the width. What every phone had before this." },
74
+ { label: "Inset", value: "inset", hint: "The same bar, shrunk to its contents and pushed to one side." },
75
+ { label: "Edge", value: "edge", hint: "Full-bleed and flush, with the status area backed by the bar itself." },
76
+ { label: "Split", value: "split", hint: "No bar: the mark in one corner, the trigger in the other." },
77
+ { label: "Button", value: "float", hint: "The trigger alone, as a circle. The page gets the whole screen." },
78
+ { label: "Nothing", value: "none", hint: "No bar at all \u2014 for a site the dock or a gesture navigates." }
79
+ ];
72
80
  const mobileModeOptions = [
73
81
  { label: "Track", value: "track", icon: "i-lucide-more-horizontal", hint: "The same scrolling row as the desktop. What phones had before this setting" },
74
82
  { label: "Sheet", value: "sheet", icon: "i-lucide-panel-bottom-open", hint: "A menu button opens a sheet from the bottom edge" },
@@ -222,6 +230,28 @@ const navSection = navChoice("navSection", SECTION_MODES, navigation.section);
222
230
  const navCounts = navChoice("navCounts", COUNT_MODES, navigation.counts);
223
231
  const gesturePages = navFlag("gesturePages", true);
224
232
  const gestureEdge = navFlag("gestureEdge", true);
233
+ const ZOOM_MODES = ["on", "app", "off"];
234
+ const STATUS_BAR_MODES = ["auto", "contrast", "none"];
235
+ const zoomOptions = [
236
+ { label: "Always", value: "on" },
237
+ { label: "Not in the app", value: "app" },
238
+ { label: "Never", value: "off" }
239
+ ];
240
+ const statusBarOptions = [
241
+ { label: "Automatic", value: "auto" },
242
+ { label: "Solid band", value: "contrast" },
243
+ { label: "None", value: "none" }
244
+ ];
245
+ const mobileZoom = navChoice("mobileZoom", ZOOM_MODES, opts.features.lockZoom ? "off" : "on");
246
+ const mobileStatusBar = navChoice("mobileStatusBar", STATUS_BAR_MODES, "auto");
247
+ const mobilePullRefresh = navFlag("mobilePullRefresh", false);
248
+ const mobileChromeSelect = computed({
249
+ get: () => {
250
+ const v = config.value.mobileChromeSelect;
251
+ return v === true ? "on" : v === false ? "off" : "auto";
252
+ },
253
+ set: (v) => set({ mobileChromeSelect: v === "on" ? true : v === "off" ? false : void 0 })
254
+ });
225
255
  const navLogoAction = navChoice("navLogoAction", ["home", "palette"], navigation.logoAction);
226
256
  const navCenterActive = navFlag("navCenterActive", navigation.centerActive);
227
257
  const navTravellers = navFlag("navTravellers", navigation.travellers);
@@ -236,6 +266,16 @@ const navMobilePlacement = navChoice(
236
266
  ["inherit", "top", "top-bar", "bottom"],
237
267
  navigation.mobilePlacement
238
268
  );
269
+ const navMobileBar = navChoice(
270
+ "navMobileBar",
271
+ ["bar", "inset", "edge", "split", "float", "none"],
272
+ navigation.mobileBar
273
+ );
274
+ const navMobileTitle = navChoice(
275
+ "navMobileTitle",
276
+ ["off", "page", "site"],
277
+ navigation.mobileTitle
278
+ );
239
279
  const navBreakpoint = navChoice(
240
280
  "navBreakpoint",
241
281
  ["sm", "md", "lg"],
@@ -274,6 +314,7 @@ const navEdgeFade = navFlag("navEdgeFade", navigation.edgeFade);
274
314
  const navSnap = navFlag("navSnap", navigation.snap);
275
315
  const placementIsRail = computed(() => placement.value.startsWith("rail-"));
276
316
  const menuInUse = computed(() => navMobileMode.value !== "track" || navDesktopMenu.value);
317
+ const mobileStranded = computed(() => navMobileBar.value === "none" && navMobileMode.value !== "dock" && !gestureEdge.value);
277
318
  const presenceBlobsAvailable = computed(
278
319
  () => opts.features.presence !== false && opts.features.awareBlobs === true
279
320
  );
@@ -1196,6 +1237,13 @@ function shows(id) {
1196
1237
  Below the breakpoint the track can step aside for a menu you can read
1197
1238
  without scrubbing sideways. Every page stays in the page source either way.
1198
1239
  </p>
1240
+ <p
1241
+ v-if="mobileStranded"
1242
+ class="mt-1.5 text-[11px] text-warning"
1243
+ >
1244
+ Nothing opens the menu on a phone. Turn on the edge swipe, pick the
1245
+ dock, or give the bar a shape.
1246
+ </p>
1199
1247
  </div>
1200
1248
 
1201
1249
  <UFormField label="Mobile navigation">
@@ -1219,6 +1267,31 @@ function shows(id) {
1219
1267
  </div>
1220
1268
  </UFormField>
1221
1269
 
1270
+ <UFormField label="Bar shape">
1271
+ <template #help>
1272
+ What the bar IS, as opposed to what the menu is. Every mode above
1273
+ drew the same full-width pill until these existed.
1274
+ </template>
1275
+ <div class="grid grid-cols-3 gap-2 sm:grid-cols-6">
1276
+ <button
1277
+ v-for="opt in mobileBarOptions"
1278
+ :key="opt.value"
1279
+ type="button"
1280
+ :disabled="!editing"
1281
+ :class="[cardBase, navMobileBar === opt.value ? cardOn : cardOff]"
1282
+ :title="opt.hint"
1283
+ @click="navMobileBar = opt.value"
1284
+ >
1285
+ <JunNavPreview
1286
+ phone
1287
+ :bar="opt.value"
1288
+ :active="navMobileBar === opt.value"
1289
+ />
1290
+ <span class="text-xs">{{ opt.label }}</span>
1291
+ </button>
1292
+ </div>
1293
+ </UFormField>
1294
+
1222
1295
  <div class="grid grid-cols-1 gap-x-8 gap-y-3 sm:grid-cols-3">
1223
1296
  <JunConfigRow
1224
1297
  label="Breakpoint"
@@ -1247,6 +1320,23 @@ function shows(id) {
1247
1320
  { label: 'Top', value: 'top' },
1248
1321
  { label: 'Top bar', value: 'top-bar' },
1249
1322
  { label: 'Bottom', value: 'bottom' }
1323
+ ]"
1324
+ :disabled="!editing"
1325
+ size="xs"
1326
+ class="w-40"
1327
+ />
1328
+ </JunConfigRow>
1329
+ <JunConfigRow
1330
+ label="Bar title"
1331
+ hint="What the phone bar names"
1332
+ :muted="navMobileBar !== 'bar' || navMobileMode === 'track' && !navDesktopMenu"
1333
+ >
1334
+ <USelect
1335
+ v-model="navMobileTitle"
1336
+ :items="[
1337
+ { label: 'Nothing', value: 'off' },
1338
+ { label: 'This page', value: 'page' },
1339
+ { label: 'The site', value: 'site' }
1250
1340
  ]"
1251
1341
  :disabled="!editing"
1252
1342
  size="xs"
@@ -2722,6 +2812,95 @@ function shows(id) {
2722
2812
  </div>
2723
2813
  </section>
2724
2814
 
2815
+ <!-- Mobile -->
2816
+ <section
2817
+ v-if="shows('mobile')"
2818
+ class="space-y-5"
2819
+ :class="bare ? '' : 'jun-card rounded-2xl p-6'"
2820
+ >
2821
+ <header class="flex items-start gap-3">
2822
+ <span class="flex size-9 flex-none items-center justify-center rounded-lg bg-black/5 dark:bg-white/10">
2823
+ <UIcon
2824
+ name="i-lucide-smartphone"
2825
+ class="size-4.5"
2826
+ />
2827
+ </span>
2828
+ <div>
2829
+ <h2 class="text-sm font-semibold text-highlighted">
2830
+ Mobile
2831
+ </h2>
2832
+ <p class="text-xs text-muted">
2833
+ How the site behaves on a phone, and how much of an app it is once
2834
+ somebody adds it to their home screen. Most of this is invisible
2835
+ from a desktop — including on this page.
2836
+ </p>
2837
+ </div>
2838
+ </header>
2839
+
2840
+ <div class="space-y-4">
2841
+ <JunConfigRow label="Pinch to zoom">
2842
+ <template #hint>
2843
+ Blocking zoom on a public page fails WCAG 1.4.4, so the default is
2844
+ to allow it. <strong>Not in the app</strong> is the middle answer:
2845
+ a page in a browser is a page, an installed app is an app. Takes
2846
+ effect on a reader's next load.
2847
+ </template>
2848
+ <USelect
2849
+ v-model="mobileZoom"
2850
+ :items="zoomOptions"
2851
+ :disabled="!editing"
2852
+ size="xs"
2853
+ class="w-44"
2854
+ />
2855
+ </JunConfigRow>
2856
+
2857
+ <JunConfigRow label="Status bar">
2858
+ <template #hint>
2859
+ An installed app draws underneath the iPhone's clock, and iOS
2860
+ paints that clock white with no way to ask otherwise — so a pale
2861
+ page needs something behind it. <strong>Automatic</strong> scrims
2862
+ a light page and leaves a dark one seamless.
2863
+ </template>
2864
+ <USelect
2865
+ v-model="mobileStatusBar"
2866
+ :items="statusBarOptions"
2867
+ :disabled="!editing"
2868
+ size="xs"
2869
+ class="w-44"
2870
+ />
2871
+ </JunConfigRow>
2872
+
2873
+ <JunConfigRow
2874
+ label="Pull down to refresh"
2875
+ hint="Off by default: this site is realtime, so there is nothing to refresh to, and an app that reloads when a reader over-scrolls is not an app. Sideways over-scroll stays off either way — on iOS it is the browser's back gesture."
2876
+ >
2877
+ <USwitch
2878
+ v-model="mobilePullRefresh"
2879
+ :disabled="!editing"
2880
+ color="neutral"
2881
+ />
2882
+ </JunConfigRow>
2883
+
2884
+ <JunConfigRow label="Select the chrome">
2885
+ <template #hint>
2886
+ Whether a long press may select the navbar and the floating bars.
2887
+ Prose always selects; this is only about the furniture.
2888
+ </template>
2889
+ <USelect
2890
+ v-model="mobileChromeSelect"
2891
+ :items="[
2892
+ { label: 'In a browser only', value: 'auto' },
2893
+ { label: 'Always', value: 'on' },
2894
+ { label: 'Never', value: 'off' }
2895
+ ]"
2896
+ :disabled="!editing"
2897
+ size="xs"
2898
+ class="w-44"
2899
+ />
2900
+ </JunConfigRow>
2901
+ </div>
2902
+ </section>
2903
+
2725
2904
  <!-- Visitors -->
2726
2905
  <section
2727
2906
  v-if="shows('visitors')"
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed } from "vue";
2
+ import { computed, onBeforeUnmount, onMounted, ref } from "vue";
3
3
  import {
4
4
  useDocSlugs,
5
5
  useJunGarden,
@@ -60,6 +60,23 @@ const lines = computed(() => edges.value.flatMap((edge) => {
60
60
  function radiusOf(note) {
61
61
  return Math.min(16, 5 + note.inbound.length * 2.5);
62
62
  }
63
+ const graphEl = ref(null);
64
+ onMounted(() => {
65
+ if (!graphEl.value || typeof ResizeObserver === "undefined") return;
66
+ const publish = () => {
67
+ const el = graphEl.value?.querySelector("svg");
68
+ if (!el) return;
69
+ const w = el.getBoundingClientRect().width;
70
+ if (w > 1) graphEl.value?.style.setProperty("--jun-garden-k", String(WIDTH / w));
71
+ };
72
+ const ro = new ResizeObserver(publish);
73
+ ro.observe(graphEl.value);
74
+ publish();
75
+ onBeforeUnmount(() => ro.disconnect());
76
+ });
77
+ function labelsLeft(note) {
78
+ return (pointById.value.get(note.id)?.x ?? 0) > WIDTH * 0.6;
79
+ }
63
80
  const MATURITY_LABEL = Object.fromEntries(
64
81
  JUN_MATURITIES.map((m) => [m.value, m.label])
65
82
  );
@@ -128,7 +145,8 @@ function renamePage(t) {
128
145
  and the client draw the same picture. -->
129
146
  <div
130
147
  v-if="showGraph && notes.length"
131
- class="jun-card mb-8 overflow-hidden rounded-2xl"
148
+ ref="graphEl"
149
+ class="jun-garden-graph jun-card mb-8 rounded-2xl"
132
150
  data-jun-garden="graph"
133
151
  >
134
152
  <svg
@@ -157,6 +175,20 @@ function renamePage(t) {
157
175
  :href="note.href ?? getDocUrl(note.id)"
158
176
  :data-jun-node="note.id"
159
177
  >
178
+ <!-- The finger's target, and it is invisible. A note's disc is 5–16
179
+ user units, which on a phone is a handful of screen pixels —
180
+ `.jun-tap`'s pseudo-element cannot help here (an SVG node takes
181
+ no `position: relative`), so this is the SVG spelling of the
182
+ same idea: a transparent circle sized in CSS from the drawn
183
+ scale, so it is ~22 CSS px across whatever the graph is
184
+ squeezed to. `fill="transparent"` rather than `none` — a
185
+ `none` fill is not hit-tested at all. -->
186
+ <circle
187
+ class="jun-garden-hit"
188
+ :cx="pointById.get(note.id)?.x ?? 0"
189
+ :cy="pointById.get(note.id)?.y ?? 0"
190
+ fill="transparent"
191
+ />
160
192
  <circle
161
193
  :cx="pointById.get(note.id)?.x ?? 0"
162
194
  :cy="pointById.get(note.id)?.y ?? 0"
@@ -166,9 +198,10 @@ function renamePage(t) {
166
198
  />
167
199
  <text
168
200
  v-if="view.labels"
169
- :x="(pointById.get(note.id)?.x ?? 0) + radiusOf(note) + 6"
201
+ class="jun-garden-label fill-current"
202
+ :x="labelsLeft(note) ? (pointById.get(note.id)?.x ?? 0) - radiusOf(note) - 6 : (pointById.get(note.id)?.x ?? 0) + radiusOf(note) + 6"
170
203
  :y="(pointById.get(note.id)?.y ?? 0) + 4"
171
- class="fill-current text-[13px]"
204
+ :text-anchor="labelsLeft(note) ? 'end' : 'start'"
172
205
  fill-opacity="0.75"
173
206
  >{{ note.label }}</text>
174
207
  </a>
@@ -221,11 +254,11 @@ function renamePage(t) {
221
254
  >
222
255
  <span class="text-dimmed">linked from</span>
223
256
  <NuxtLink
224
- v-for="ref in note.inbound"
225
- :key="ref.id"
226
- :to="ref.href ?? getDocUrl(ref.id)"
257
+ v-for="from in note.inbound"
258
+ :key="from.id"
259
+ :to="from.href ?? getDocUrl(from.id)"
227
260
  class="underline-offset-4 hover:underline"
228
- >{{ ref.label }}</NuxtLink>
261
+ >{{ from.label }}</NuxtLink>
229
262
  </p>
230
263
  <p
231
264
  v-else
@@ -278,3 +311,7 @@ function renamePage(t) {
278
311
  </div>
279
312
  </div>
280
313
  </template>
314
+
315
+ <style scoped>
316
+ .jun-garden-graph{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain}.jun-garden-graph svg{min-width:32rem}.jun-garden-label{font-size:calc(12px*var(--jun-garden-k, 1))}.jun-garden-hit{r:calc(13px*var(--jun-garden-k, 1))}
317
+ </style>
@@ -228,7 +228,7 @@ const titleOfSection = (id, fallback) => (id === "latest" ? journalPage.value?.l
228
228
  <NuxtLink
229
229
  v-if="journalPage"
230
230
  :to="hrefOf(journalPage)"
231
- class="text-xs text-muted transition-colors hover:text-default"
231
+ class="jun-tap text-xs text-muted transition-colors hover:text-default"
232
232
  >All →</NuxtLink>
233
233
  </div>
234
234
  <ul :class="layout === 'magazine' ? 'grid grid-cols-1 gap-3 sm:grid-cols-2' : 'flex flex-col gap-3'">
@@ -286,7 +286,7 @@ const titleOfSection = (id, fallback) => (id === "latest" ? journalPage.value?.l
286
286
  <NuxtLink
287
287
  v-if="appsPage"
288
288
  :to="hrefOf(appsPage)"
289
- class="text-xs text-muted transition-colors hover:text-default"
289
+ class="jun-tap text-xs text-muted transition-colors hover:text-default"
290
290
  >All →</NuxtLink>
291
291
  </div>
292
292
  <div class="grid grid-cols-3 gap-3 sm:grid-cols-4 sm:gap-4">
@@ -0,0 +1,5 @@
1
+ import type { JunMobileStatusBar, JunMobileZoom } from './useJunSiteConfig.js';
2
+ export declare function useJunMobile(): {
3
+ zoom: import("vue").ComputedRef<JunMobileZoom>;
4
+ statusBar: import("vue").ComputedRef<JunMobileStatusBar>;
5
+ };