@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.
- package/dist/module.d.mts +4 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +64 -6
- package/dist/runtime/assets/css/jun.css +2 -2
- package/dist/runtime/components/JunDocSurface.d.vue.ts +20 -2
- package/dist/runtime/components/JunDocSurface.vue +27 -2
- package/dist/runtime/components/JunDocSurface.vue.d.ts +20 -2
- package/dist/runtime/components/JunHead.vue +16 -4
- package/dist/runtime/components/JunNavDock.d.vue.ts +15 -0
- package/dist/runtime/components/JunNavDock.vue +94 -0
- package/dist/runtime/components/JunNavDock.vue.d.ts +15 -0
- package/dist/runtime/components/JunNavMenu.client.d.vue.ts +15 -0
- package/dist/runtime/components/JunNavMenu.client.vue +478 -0
- package/dist/runtime/components/JunNavMenu.client.vue.d.ts +15 -0
- package/dist/runtime/components/JunNavPreview.d.vue.ts +17 -0
- package/dist/runtime/components/JunNavPreview.vue +169 -0
- package/dist/runtime/components/JunNavPreview.vue.d.ts +17 -0
- package/dist/runtime/components/JunNavigation.d.vue.ts +4 -11
- package/dist/runtime/components/JunNavigation.vue +813 -138
- package/dist/runtime/components/JunNavigation.vue.d.ts +4 -11
- package/dist/runtime/components/JunNoteLinks.vue +1 -1
- package/dist/runtime/components/JunPageHero.vue +3 -3
- package/dist/runtime/components/JunSectionBar.d.vue.ts +41 -0
- package/dist/runtime/components/JunSectionBar.vue +144 -0
- package/dist/runtime/components/JunSectionBar.vue.d.ts +41 -0
- package/dist/runtime/components/renderers/JunConfigRenderer.vue +486 -6
- package/dist/runtime/components/renderers/JunEntryRenderer.vue +48 -0
- package/dist/runtime/composables/useJunCreatePage.js +7 -1
- package/dist/runtime/composables/useJunDocPage.d.ts +28 -0
- package/dist/runtime/composables/useJunDocPage.js +111 -20
- package/dist/runtime/composables/useJunGarden.d.ts +1 -1
- package/dist/runtime/composables/useJunGarden.js +3 -2
- package/dist/runtime/composables/useJunGestures.d.ts +53 -0
- package/dist/runtime/composables/useJunGestures.js +89 -0
- package/dist/runtime/composables/useJunMenuState.d.ts +4 -0
- package/dist/runtime/composables/useJunMenuState.js +5 -0
- package/dist/runtime/composables/useJunNavItems.d.ts +50 -0
- package/dist/runtime/composables/useJunNavItems.js +188 -0
- package/dist/runtime/composables/useJunNavSettings.d.ts +58 -1
- package/dist/runtime/composables/useJunNavSettings.js +110 -8
- package/dist/runtime/composables/useJunOptions.d.ts +1 -0
- package/dist/runtime/composables/useJunSiblings.d.ts +30 -0
- package/dist/runtime/composables/useJunSiblings.js +38 -0
- package/dist/runtime/composables/useJunSiteConfig.d.ts +51 -3
- package/dist/runtime/composables/useJunTheme.js +4 -1
- package/dist/runtime/composables/useJunViewingAccent.js +10 -0
- package/dist/runtime/layouts/jun.vue +21 -1
- package/dist/runtime/pages/doc.vue +2 -0
- package/dist/runtime/pages/index.vue +2 -0
- package/dist/runtime/server/api/health.get.d.ts +15 -0
- package/dist/runtime/server/api/health.get.js +7 -2
- package/dist/runtime/server/api/links.get.js +27 -3
- package/dist/runtime/server/api/resolve/[...slug].get.d.ts +20 -0
- package/dist/runtime/server/api/resolve/[...slug].get.js +31 -0
- package/dist/runtime/server/api/search.get.d.ts +1 -1
- package/dist/runtime/server/api/search.get.js +42 -39
- package/dist/runtime/server/api/tree.get.js +3 -1
- package/dist/runtime/server/janitor/junJanitorChores.d.ts +14 -7
- package/dist/runtime/server/janitor/junJanitorChores.js +21 -3
- package/dist/runtime/server/janitor/junJanitorMachine.js +36 -4
- package/dist/runtime/server/janitor/junJanitorPerform.d.ts +15 -1
- package/dist/runtime/server/janitor/junJanitorPerform.js +13 -5
- package/dist/runtime/server/janitor/junJanitorYText.d.ts +40 -3
- package/dist/runtime/server/janitor/junJanitorYText.js +60 -14
- package/dist/runtime/server/plugins/jun-janitor.js +132 -81
- package/dist/runtime/server/routes/jun-card.png.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-card.png.get.js +40 -0
- package/dist/runtime/server/utils/junCard.d.ts +39 -0
- package/dist/runtime/server/utils/junCard.js +159 -0
- package/dist/runtime/server/utils/junIcon.d.ts +27 -2
- package/dist/runtime/server/utils/junIcon.js +5 -5
- package/dist/runtime/server/utils/junJanitorStatus.d.ts +59 -0
- package/dist/runtime/server/utils/junJanitorStatus.js +27 -0
- package/dist/runtime/types.d.ts +225 -0
- package/dist/runtime/utils/junAdopt.d.ts +43 -0
- package/dist/runtime/utils/junAdopt.js +7 -0
- package/dist/runtime/utils/junGesture.d.ts +84 -0
- package/dist/runtime/utils/junGesture.js +40 -0
- package/dist/runtime/utils/junLetters.d.ts +86 -0
- package/dist/runtime/utils/junLetters.js +173 -0
- package/dist/runtime/utils/junNavValue.d.ts +56 -0
- package/dist/runtime/utils/junNavValue.js +36 -0
- package/dist/runtime/utils/junSearchRank.d.ts +79 -0
- package/dist/runtime/utils/junSearchRank.js +73 -0
- package/dist/runtime/utils/junSocial.d.ts +59 -0
- package/dist/runtime/utils/junSocial.js +56 -0
- package/dist/runtime/utils/junViewSpecs.d.ts +38 -0
- package/dist/runtime/utils/junViewSpecs.js +92 -1
- package/package.json +10 -8
|
@@ -69,6 +69,39 @@ const shapeOptions = [
|
|
|
69
69
|
{ label: "Square", value: "square", radius: "0px" },
|
|
70
70
|
{ label: "Ghost", value: "ghost", radius: "8px", bare: true }
|
|
71
71
|
];
|
|
72
|
+
const mobileModeOptions = [
|
|
73
|
+
{ label: "Track", value: "track", icon: "i-lucide-more-horizontal", hint: "The same scrolling row as the desktop. What phones had before this setting" },
|
|
74
|
+
{ label: "Sheet", value: "sheet", icon: "i-lucide-panel-bottom-open", hint: "A menu button opens a sheet from the bottom edge" },
|
|
75
|
+
{ label: "Drawer left", value: "drawer-left", icon: "i-lucide-panel-left-open", hint: "A side panel, from the left" },
|
|
76
|
+
{ label: "Drawer right", value: "drawer-right", icon: "i-lucide-panel-right-open", hint: "A side panel, from the right" },
|
|
77
|
+
{ label: "Full screen", value: "fullscreen", icon: "i-lucide-maximize", hint: "The whole viewport, one page per line" },
|
|
78
|
+
{ label: "Grid", value: "grid", icon: "i-lucide-layout-grid", hint: "The whole viewport, an icon grid" },
|
|
79
|
+
{ label: "Dock", value: "dock", icon: "i-lucide-panel-bottom", hint: "A fixed tab bar at the foot, app-style. The rest go behind \u22EF" }
|
|
80
|
+
];
|
|
81
|
+
const overflowOptions = [
|
|
82
|
+
{ label: "Scroll", value: "scroll", icon: "i-lucide-move-horizontal", hint: "The track scrolls, with arrows over its edges" },
|
|
83
|
+
{ label: "Wrap", value: "wrap", icon: "i-lucide-wrap-text", hint: "A second row. Nothing hides; the bar grows" },
|
|
84
|
+
{ label: "Menu", value: "more", icon: "i-lucide-ellipsis", hint: "What does not fit goes behind \u22EF \u2014 every page one press away" },
|
|
85
|
+
{ label: "Shrink", value: "shrink", icon: "i-lucide-minimize-2", hint: "Drop to icons rather than scroll" }
|
|
86
|
+
];
|
|
87
|
+
const childrenOptions = [
|
|
88
|
+
{ label: "None", value: "none", icon: "i-lucide-minus", hint: "Items are links and nothing else" },
|
|
89
|
+
{ label: "On hover", value: "hover", icon: "i-lucide-mouse-pointer", hint: "Sub-pages open when the pointer rests on an item" },
|
|
90
|
+
{ label: "On click", value: "click", icon: "i-lucide-chevron-down", hint: "A chevron opens them" },
|
|
91
|
+
{ label: "Mega", value: "mega", icon: "i-lucide-layout-panel-top", hint: "A wide multi-column panel" }
|
|
92
|
+
];
|
|
93
|
+
const alignOptions = [
|
|
94
|
+
{ label: "Centre", value: "center", icon: "i-lucide-align-center" },
|
|
95
|
+
{ label: "Start", value: "start", icon: "i-lucide-align-left" },
|
|
96
|
+
{ label: "End", value: "end", icon: "i-lucide-align-right" },
|
|
97
|
+
{ label: "Spread", value: "spread", icon: "i-lucide-align-horizontal-space-between" }
|
|
98
|
+
];
|
|
99
|
+
const navWidthOptions = [
|
|
100
|
+
{ label: "Contained", value: "contained", hint: "The default \u2014 a comfortable maximum" },
|
|
101
|
+
{ label: "Narrow", value: "narrow", hint: "Tighter than the reading column" },
|
|
102
|
+
{ label: "Wide", value: "wide", hint: "Most of a large screen" },
|
|
103
|
+
{ label: "Full", value: "full", hint: "Edge to edge" }
|
|
104
|
+
];
|
|
72
105
|
const navSizeOptions = [
|
|
73
106
|
{ label: "Small", value: "sm", bar: "h-1.5" },
|
|
74
107
|
{ label: "Medium", value: "md", bar: "h-2.5" },
|
|
@@ -133,7 +166,12 @@ const fontOptions = [
|
|
|
133
166
|
{ value: "default", label: "Outfit", family: '"Outfit", system-ui, sans-serif' },
|
|
134
167
|
{ value: "serif", label: "Newsreader", family: '"Newsreader", Georgia, serif' },
|
|
135
168
|
{ value: "grotesk", label: "Space Grotesk", family: '"Space Grotesk", system-ui, sans-serif' },
|
|
136
|
-
{ value: "mono", label: "JetBrains Mono", family: '"JetBrains Mono", ui-monospace, monospace' }
|
|
169
|
+
{ value: "mono", label: "JetBrains Mono", family: '"JetBrains Mono", ui-monospace, monospace' },
|
|
170
|
+
// Pairings: the specimen shows the DISPLAY face, which is the one a visitor
|
|
171
|
+
// notices first — the body face is named in the label under it.
|
|
172
|
+
{ value: "editorial", label: "Playfair + Source", family: '"Playfair Display", Georgia, serif' },
|
|
173
|
+
{ value: "humanist", label: "Fraunces + Inter", family: '"Fraunces", Georgia, serif' },
|
|
174
|
+
{ value: "technical", label: "IBM Plex", family: '"IBM Plex Mono", ui-monospace, monospace' }
|
|
137
175
|
];
|
|
138
176
|
function navChoice(key, allowed, fallback) {
|
|
139
177
|
return computed({
|
|
@@ -178,10 +216,64 @@ const navBlur = navFlag("navBlur", navigation.blur);
|
|
|
178
216
|
const navHomeItem = navFlag("navHomeItem", navigation.homeItem);
|
|
179
217
|
const navShowLogo = navFlag("navShowLogo", navigation.showLogo);
|
|
180
218
|
const navSearchButton = navFlag("navSearchButton", navigation.searchButton);
|
|
219
|
+
const SECTION_MODES = ["off", "row", "segmented", "tabs"];
|
|
220
|
+
const COUNT_MODES = ["off", "children", "new"];
|
|
221
|
+
const navSection = navChoice("navSection", SECTION_MODES, navigation.section);
|
|
222
|
+
const navCounts = navChoice("navCounts", COUNT_MODES, navigation.counts);
|
|
223
|
+
const gesturePages = navFlag("gesturePages", true);
|
|
224
|
+
const gestureEdge = navFlag("gestureEdge", true);
|
|
181
225
|
const navLogoAction = navChoice("navLogoAction", ["home", "palette"], navigation.logoAction);
|
|
182
226
|
const navCenterActive = navFlag("navCenterActive", navigation.centerActive);
|
|
183
227
|
const navTravellers = navFlag("navTravellers", navigation.travellers);
|
|
184
228
|
const navTravellersList = navFlag("navTravellersList", navigation.travellersList);
|
|
229
|
+
const navMobileMode = navChoice(
|
|
230
|
+
"navMobileMode",
|
|
231
|
+
mobileModeOptions.map((o) => o.value),
|
|
232
|
+
navigation.mobileMode
|
|
233
|
+
);
|
|
234
|
+
const navMobilePlacement = navChoice(
|
|
235
|
+
"navMobilePlacement",
|
|
236
|
+
["inherit", "top", "top-bar", "bottom"],
|
|
237
|
+
navigation.mobilePlacement
|
|
238
|
+
);
|
|
239
|
+
const navBreakpoint = navChoice(
|
|
240
|
+
"navBreakpoint",
|
|
241
|
+
["sm", "md", "lg"],
|
|
242
|
+
navigation.breakpoint
|
|
243
|
+
);
|
|
244
|
+
const navMenuIcon = navChoice(
|
|
245
|
+
"navMenuIcon",
|
|
246
|
+
["menu", "grid", "dots", "chevron"],
|
|
247
|
+
navigation.menuIcon
|
|
248
|
+
);
|
|
249
|
+
const navMenuSide = navChoice(
|
|
250
|
+
"navMenuSide",
|
|
251
|
+
["left", "right"],
|
|
252
|
+
navigation.menuSide
|
|
253
|
+
);
|
|
254
|
+
const navMobileItemMode = navChoice(
|
|
255
|
+
"navMobileItemMode",
|
|
256
|
+
["inherit", ...itemModeOptions.map((o) => o.value)],
|
|
257
|
+
navigation.mobileItemMode
|
|
258
|
+
);
|
|
259
|
+
const navMenuChildren = navFlag("navMenuChildren", navigation.menuChildren);
|
|
260
|
+
const navMenuExtras = navFlag("navMenuExtras", navigation.menuExtras);
|
|
261
|
+
const navDesktopMenu = navFlag("navDesktopMenu", navigation.desktopMenu);
|
|
262
|
+
const navOverflow = navChoice("navOverflow", overflowOptions.map((o) => o.value), navigation.overflow);
|
|
263
|
+
const navChildren = navChoice("navChildren", childrenOptions.map((o) => o.value), navigation.children);
|
|
264
|
+
const navAlign = navChoice("navAlign", alignOptions.map((o) => o.value), navigation.align);
|
|
265
|
+
const navWidth = navChoice("navWidth", navWidthOptions.map((o) => o.value), navigation.width);
|
|
266
|
+
const navRailBreakpoint = navChoice(
|
|
267
|
+
"navRailBreakpoint",
|
|
268
|
+
["md", "lg", "xl"],
|
|
269
|
+
navigation.railBreakpoint
|
|
270
|
+
);
|
|
271
|
+
const navSeparators = navFlag("navSeparators", navigation.separators);
|
|
272
|
+
const navScrollArrows = navFlag("navScrollArrows", navigation.scrollArrows);
|
|
273
|
+
const navEdgeFade = navFlag("navEdgeFade", navigation.edgeFade);
|
|
274
|
+
const navSnap = navFlag("navSnap", navigation.snap);
|
|
275
|
+
const placementIsRail = computed(() => placement.value.startsWith("rail-"));
|
|
276
|
+
const menuInUse = computed(() => navMobileMode.value !== "track" || navDesktopMenu.value);
|
|
185
277
|
const presenceBlobsAvailable = computed(
|
|
186
278
|
() => opts.features.presence !== false && opts.features.awareBlobs === true
|
|
187
279
|
);
|
|
@@ -674,7 +766,7 @@ function shows(id) {
|
|
|
674
766
|
</UFormField>
|
|
675
767
|
<UFormField
|
|
676
768
|
label="Social image URL"
|
|
677
|
-
help="og:image and twitter:image."
|
|
769
|
+
help="og:image and twitter:image. Empty draws a card per page."
|
|
678
770
|
>
|
|
679
771
|
<UInput
|
|
680
772
|
:model-value="config.seoOgImage ?? ''"
|
|
@@ -684,6 +776,18 @@ function shows(id) {
|
|
|
684
776
|
@change="setText('seoOgImage', $event)"
|
|
685
777
|
/>
|
|
686
778
|
</UFormField>
|
|
779
|
+
<UFormField
|
|
780
|
+
label="Canonical site address"
|
|
781
|
+
help="Used for canonical links and og:url. Empty uses the address the visitor arrived on."
|
|
782
|
+
>
|
|
783
|
+
<UInput
|
|
784
|
+
:model-value="config.seoSiteUrl ?? ''"
|
|
785
|
+
:disabled="!editing"
|
|
786
|
+
placeholder="https://example.com"
|
|
787
|
+
class="w-full"
|
|
788
|
+
@change="setText('seoSiteUrl', $event)"
|
|
789
|
+
/>
|
|
790
|
+
</UFormField>
|
|
687
791
|
</section>
|
|
688
792
|
|
|
689
793
|
<!-- Navigation -->
|
|
@@ -723,9 +827,12 @@ function shows(id) {
|
|
|
723
827
|
:title="opt.hint"
|
|
724
828
|
@click="placement = opt.value"
|
|
725
829
|
>
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
830
|
+
<!-- The shape, not just the word. Every one of these was a name
|
|
831
|
+
for an arrangement nobody could see without switching their
|
|
832
|
+
own site to it and reloading. -->
|
|
833
|
+
<JunNavPreview
|
|
834
|
+
:placement="opt.value"
|
|
835
|
+
:active="placement === opt.value"
|
|
729
836
|
/>
|
|
730
837
|
<span class="text-xs">{{ opt.label }}</span>
|
|
731
838
|
</button>
|
|
@@ -861,6 +968,61 @@ function shows(id) {
|
|
|
861
968
|
color="neutral"
|
|
862
969
|
/>
|
|
863
970
|
</JunConfigRow>
|
|
971
|
+
<JunConfigRow
|
|
972
|
+
label="Section bar"
|
|
973
|
+
hint="The pages beside this one"
|
|
974
|
+
>
|
|
975
|
+
<USelect
|
|
976
|
+
v-model="navSection"
|
|
977
|
+
:items="[
|
|
978
|
+
{ label: 'None', value: 'off' },
|
|
979
|
+
{ label: 'Row', value: 'row' },
|
|
980
|
+
{ label: 'Segmented', value: 'segmented' },
|
|
981
|
+
{ label: 'Tabs', value: 'tabs' }
|
|
982
|
+
]"
|
|
983
|
+
:disabled="!editing"
|
|
984
|
+
size="xs"
|
|
985
|
+
class="w-32"
|
|
986
|
+
/>
|
|
987
|
+
</JunConfigRow>
|
|
988
|
+
<JunConfigRow
|
|
989
|
+
label="Item counts"
|
|
990
|
+
hint="Pages inside, or what's new"
|
|
991
|
+
>
|
|
992
|
+
<USelect
|
|
993
|
+
v-model="navCounts"
|
|
994
|
+
:items="[
|
|
995
|
+
{ label: 'None', value: 'off' },
|
|
996
|
+
{ label: 'Pages inside', value: 'children' },
|
|
997
|
+
{ label: 'New since your visit', value: 'new' }
|
|
998
|
+
]"
|
|
999
|
+
:disabled="!editing"
|
|
1000
|
+
size="xs"
|
|
1001
|
+
class="w-32"
|
|
1002
|
+
/>
|
|
1003
|
+
</JunConfigRow>
|
|
1004
|
+
<JunConfigRow
|
|
1005
|
+
v-if="opts.features.gestures"
|
|
1006
|
+
label="Swipe between pages"
|
|
1007
|
+
hint="Left and right, on touch"
|
|
1008
|
+
>
|
|
1009
|
+
<USwitch
|
|
1010
|
+
v-model="gesturePages"
|
|
1011
|
+
:disabled="!editing"
|
|
1012
|
+
color="neutral"
|
|
1013
|
+
/>
|
|
1014
|
+
</JunConfigRow>
|
|
1015
|
+
<JunConfigRow
|
|
1016
|
+
v-if="opts.features.gestures"
|
|
1017
|
+
label="Edge swipe opens the menu"
|
|
1018
|
+
hint="From either side"
|
|
1019
|
+
>
|
|
1020
|
+
<USwitch
|
|
1021
|
+
v-model="gestureEdge"
|
|
1022
|
+
:disabled="!editing"
|
|
1023
|
+
color="neutral"
|
|
1024
|
+
/>
|
|
1025
|
+
</JunConfigRow>
|
|
864
1026
|
<JunConfigRow
|
|
865
1027
|
label="Frosted panel"
|
|
866
1028
|
hint="Blur behind the bar"
|
|
@@ -980,9 +1142,327 @@ function shows(id) {
|
|
|
980
1142
|
</JunConfigRow>
|
|
981
1143
|
</div>
|
|
982
1144
|
|
|
1145
|
+
<!-- ── On a phone ──────────────────────────────────────────────────
|
|
1146
|
+
Its own block because it is a different navbar, not a smaller one:
|
|
1147
|
+
below the breakpoint the track can be replaced outright by a menu
|
|
1148
|
+
or a dock. `Track` is the default and is exactly what phones had
|
|
1149
|
+
before this existed. -->
|
|
1150
|
+
<div class="space-y-4 border-t border-default pt-5">
|
|
1151
|
+
<div>
|
|
1152
|
+
<p class="text-xs font-semibold text-highlighted">
|
|
1153
|
+
On a phone
|
|
1154
|
+
</p>
|
|
1155
|
+
<p class="text-[11px] text-muted">
|
|
1156
|
+
Below the breakpoint the track can step aside for a menu you can read
|
|
1157
|
+
without scrubbing sideways. Every page stays in the page source either way.
|
|
1158
|
+
</p>
|
|
1159
|
+
</div>
|
|
1160
|
+
|
|
1161
|
+
<UFormField label="Mobile navigation">
|
|
1162
|
+
<div class="grid grid-cols-2 gap-2 sm:grid-cols-4">
|
|
1163
|
+
<button
|
|
1164
|
+
v-for="opt in mobileModeOptions"
|
|
1165
|
+
:key="opt.value"
|
|
1166
|
+
type="button"
|
|
1167
|
+
:disabled="!editing"
|
|
1168
|
+
:class="[cardBase, navMobileMode === opt.value ? cardOn : cardOff]"
|
|
1169
|
+
:title="opt.hint"
|
|
1170
|
+
@click="navMobileMode = opt.value"
|
|
1171
|
+
>
|
|
1172
|
+
<JunNavPreview
|
|
1173
|
+
phone
|
|
1174
|
+
:mobile="opt.value"
|
|
1175
|
+
:active="navMobileMode === opt.value"
|
|
1176
|
+
/>
|
|
1177
|
+
<span class="text-xs">{{ opt.label }}</span>
|
|
1178
|
+
</button>
|
|
1179
|
+
</div>
|
|
1180
|
+
</UFormField>
|
|
1181
|
+
|
|
1182
|
+
<div class="grid grid-cols-1 gap-x-8 gap-y-3 sm:grid-cols-3">
|
|
1183
|
+
<JunConfigRow
|
|
1184
|
+
label="Breakpoint"
|
|
1185
|
+
hint="Below this width, the phone navbar"
|
|
1186
|
+
>
|
|
1187
|
+
<USelect
|
|
1188
|
+
v-model="navBreakpoint"
|
|
1189
|
+
:items="[
|
|
1190
|
+
{ label: 'Small (640px)', value: 'sm' },
|
|
1191
|
+
{ label: 'Medium (768px)', value: 'md' },
|
|
1192
|
+
{ label: 'Large (1024px)', value: 'lg' }
|
|
1193
|
+
]"
|
|
1194
|
+
:disabled="!editing"
|
|
1195
|
+
size="xs"
|
|
1196
|
+
class="w-40"
|
|
1197
|
+
/>
|
|
1198
|
+
</JunConfigRow>
|
|
1199
|
+
<JunConfigRow
|
|
1200
|
+
label="Bar placement"
|
|
1201
|
+
hint="Where the bar itself sits on a phone"
|
|
1202
|
+
>
|
|
1203
|
+
<USelect
|
|
1204
|
+
v-model="navMobilePlacement"
|
|
1205
|
+
:items="[
|
|
1206
|
+
{ label: 'Same as desktop', value: 'inherit' },
|
|
1207
|
+
{ label: 'Top', value: 'top' },
|
|
1208
|
+
{ label: 'Top bar', value: 'top-bar' },
|
|
1209
|
+
{ label: 'Bottom', value: 'bottom' }
|
|
1210
|
+
]"
|
|
1211
|
+
:disabled="!editing"
|
|
1212
|
+
size="xs"
|
|
1213
|
+
class="w-40"
|
|
1214
|
+
/>
|
|
1215
|
+
</JunConfigRow>
|
|
1216
|
+
<JunConfigRow
|
|
1217
|
+
label="Menu items"
|
|
1218
|
+
hint="How pages read inside the menu"
|
|
1219
|
+
:muted="!menuInUse"
|
|
1220
|
+
>
|
|
1221
|
+
<USelect
|
|
1222
|
+
v-model="navMobileItemMode"
|
|
1223
|
+
:items="[
|
|
1224
|
+
{ label: 'Same as the bar', value: 'inherit' },
|
|
1225
|
+
{ label: 'Text', value: 'text' },
|
|
1226
|
+
{ label: 'Icons', value: 'icon' },
|
|
1227
|
+
{ label: 'Icon + title', value: 'icon-text' },
|
|
1228
|
+
{ label: 'Stacked', value: 'icon-stack' }
|
|
1229
|
+
]"
|
|
1230
|
+
:disabled="!editing || !menuInUse"
|
|
1231
|
+
size="xs"
|
|
1232
|
+
class="w-40"
|
|
1233
|
+
/>
|
|
1234
|
+
</JunConfigRow>
|
|
1235
|
+
<JunConfigRow
|
|
1236
|
+
label="Trigger icon"
|
|
1237
|
+
hint="The glyph on the menu button"
|
|
1238
|
+
:muted="!menuInUse"
|
|
1239
|
+
>
|
|
1240
|
+
<USelect
|
|
1241
|
+
v-model="navMenuIcon"
|
|
1242
|
+
:items="[
|
|
1243
|
+
{ label: 'Menu', value: 'menu' },
|
|
1244
|
+
{ label: 'Grid', value: 'grid' },
|
|
1245
|
+
{ label: 'Dots', value: 'dots' },
|
|
1246
|
+
{ label: 'Chevron', value: 'chevron' }
|
|
1247
|
+
]"
|
|
1248
|
+
:disabled="!editing || !menuInUse"
|
|
1249
|
+
size="xs"
|
|
1250
|
+
class="w-40"
|
|
1251
|
+
/>
|
|
1252
|
+
</JunConfigRow>
|
|
1253
|
+
<JunConfigRow
|
|
1254
|
+
label="Trigger side"
|
|
1255
|
+
hint="Which end of the bar it sits at"
|
|
1256
|
+
:muted="!menuInUse"
|
|
1257
|
+
>
|
|
1258
|
+
<USelect
|
|
1259
|
+
v-model="navMenuSide"
|
|
1260
|
+
:items="[
|
|
1261
|
+
{ label: 'Right', value: 'right' },
|
|
1262
|
+
{ label: 'Left', value: 'left' }
|
|
1263
|
+
]"
|
|
1264
|
+
:disabled="!editing || !menuInUse"
|
|
1265
|
+
size="xs"
|
|
1266
|
+
class="w-40"
|
|
1267
|
+
/>
|
|
1268
|
+
</JunConfigRow>
|
|
1269
|
+
<JunConfigRow
|
|
1270
|
+
label="Sub-pages"
|
|
1271
|
+
hint="Child pages fold out in the menu"
|
|
1272
|
+
:muted="!menuInUse"
|
|
1273
|
+
>
|
|
1274
|
+
<USwitch
|
|
1275
|
+
v-model="navMenuChildren"
|
|
1276
|
+
:disabled="!editing || !menuInUse"
|
|
1277
|
+
color="neutral"
|
|
1278
|
+
/>
|
|
1279
|
+
</JunConfigRow>
|
|
1280
|
+
<!-- Search, the theme and the studio live in the ⌘K palette on a
|
|
1281
|
+
desktop, and a phone has no keyboard to open it with — so a
|
|
1282
|
+
menu without them takes them away from precisely the visitors
|
|
1283
|
+
who cannot reach them any other way. -->
|
|
1284
|
+
<JunConfigRow
|
|
1285
|
+
label="Menu extras"
|
|
1286
|
+
hint="Search + theme inside the menu"
|
|
1287
|
+
:muted="!menuInUse"
|
|
1288
|
+
>
|
|
1289
|
+
<USwitch
|
|
1290
|
+
v-model="navMenuExtras"
|
|
1291
|
+
:disabled="!editing || !menuInUse"
|
|
1292
|
+
color="neutral"
|
|
1293
|
+
/>
|
|
1294
|
+
</JunConfigRow>
|
|
1295
|
+
<JunConfigRow
|
|
1296
|
+
label="Menu on desktop too"
|
|
1297
|
+
hint="One button at every width"
|
|
1298
|
+
>
|
|
1299
|
+
<USwitch
|
|
1300
|
+
v-model="navDesktopMenu"
|
|
1301
|
+
:disabled="!editing"
|
|
1302
|
+
color="neutral"
|
|
1303
|
+
/>
|
|
1304
|
+
</JunConfigRow>
|
|
1305
|
+
</div>
|
|
1306
|
+
</div>
|
|
1307
|
+
|
|
1308
|
+
<!-- ── Layout & overflow ───────────────────────────────────────────
|
|
1309
|
+
What the track does with the room it has, and what happens when it
|
|
1310
|
+
runs out. Every default here describes what the navbar already
|
|
1311
|
+
did. -->
|
|
1312
|
+
<div class="space-y-4 border-t border-default pt-5">
|
|
1313
|
+
<div>
|
|
1314
|
+
<p class="text-xs font-semibold text-highlighted">
|
|
1315
|
+
Layout & overflow
|
|
1316
|
+
</p>
|
|
1317
|
+
<p class="text-[11px] text-muted">
|
|
1318
|
+
How the items sit, and what happens when there are more of them than room.
|
|
1319
|
+
</p>
|
|
1320
|
+
</div>
|
|
1321
|
+
|
|
1322
|
+
<UFormField
|
|
1323
|
+
label="When items do not fit"
|
|
1324
|
+
help="Menu is the only one where every page is reachable without a gesture."
|
|
1325
|
+
>
|
|
1326
|
+
<div class="grid grid-cols-2 gap-2 sm:grid-cols-4">
|
|
1327
|
+
<button
|
|
1328
|
+
v-for="opt in overflowOptions"
|
|
1329
|
+
:key="opt.value"
|
|
1330
|
+
type="button"
|
|
1331
|
+
:disabled="!editing"
|
|
1332
|
+
:class="[cardBase, navOverflow === opt.value ? cardOn : cardOff]"
|
|
1333
|
+
:title="opt.hint"
|
|
1334
|
+
@click="navOverflow = opt.value"
|
|
1335
|
+
>
|
|
1336
|
+
<JunNavPreview
|
|
1337
|
+
:overflow="opt.value"
|
|
1338
|
+
:active="navOverflow === opt.value"
|
|
1339
|
+
/>
|
|
1340
|
+
<span class="text-xs">{{ opt.label }}</span>
|
|
1341
|
+
</button>
|
|
1342
|
+
</div>
|
|
1343
|
+
</UFormField>
|
|
1344
|
+
|
|
1345
|
+
<UFormField
|
|
1346
|
+
label="Sub-pages"
|
|
1347
|
+
help="Child pages of a top-level page, as an overlay. Nothing here ever reflows the page."
|
|
1348
|
+
>
|
|
1349
|
+
<div class="grid grid-cols-2 gap-2 sm:grid-cols-4">
|
|
1350
|
+
<button
|
|
1351
|
+
v-for="opt in childrenOptions"
|
|
1352
|
+
:key="opt.value"
|
|
1353
|
+
type="button"
|
|
1354
|
+
:disabled="!editing"
|
|
1355
|
+
:class="[cardBase, navChildren === opt.value ? cardOn : cardOff]"
|
|
1356
|
+
:title="opt.hint"
|
|
1357
|
+
@click="navChildren = opt.value"
|
|
1358
|
+
>
|
|
1359
|
+
<UIcon
|
|
1360
|
+
:name="opt.icon"
|
|
1361
|
+
class="size-4.5 opacity-80"
|
|
1362
|
+
/>
|
|
1363
|
+
<span class="text-xs">{{ opt.label }}</span>
|
|
1364
|
+
</button>
|
|
1365
|
+
</div>
|
|
1366
|
+
</UFormField>
|
|
1367
|
+
|
|
1368
|
+
<UFormField label="Alignment">
|
|
1369
|
+
<div class="grid grid-cols-4 gap-2">
|
|
1370
|
+
<button
|
|
1371
|
+
v-for="opt in alignOptions"
|
|
1372
|
+
:key="opt.value"
|
|
1373
|
+
type="button"
|
|
1374
|
+
:disabled="!editing"
|
|
1375
|
+
:class="[cardBase, navAlign === opt.value ? cardOn : cardOff]"
|
|
1376
|
+
@click="navAlign = opt.value"
|
|
1377
|
+
>
|
|
1378
|
+
<UIcon
|
|
1379
|
+
:name="opt.icon"
|
|
1380
|
+
class="size-4.5 opacity-80"
|
|
1381
|
+
/>
|
|
1382
|
+
<span class="text-xs">{{ opt.label }}</span>
|
|
1383
|
+
</button>
|
|
1384
|
+
</div>
|
|
1385
|
+
</UFormField>
|
|
1386
|
+
|
|
1387
|
+
<div class="grid grid-cols-1 gap-x-8 gap-y-3 sm:grid-cols-3">
|
|
1388
|
+
<JunConfigRow
|
|
1389
|
+
label="Bar width"
|
|
1390
|
+
hint="How wide the panel may grow"
|
|
1391
|
+
>
|
|
1392
|
+
<USelect
|
|
1393
|
+
v-model="navWidth"
|
|
1394
|
+
:items="navWidthOptions.map((o) => ({ label: o.label, value: o.value }))"
|
|
1395
|
+
:disabled="!editing"
|
|
1396
|
+
size="xs"
|
|
1397
|
+
class="w-40"
|
|
1398
|
+
/>
|
|
1399
|
+
</JunConfigRow>
|
|
1400
|
+
<JunConfigRow
|
|
1401
|
+
label="Separators"
|
|
1402
|
+
hint="A hairline between items"
|
|
1403
|
+
>
|
|
1404
|
+
<USwitch
|
|
1405
|
+
v-model="navSeparators"
|
|
1406
|
+
:disabled="!editing"
|
|
1407
|
+
color="neutral"
|
|
1408
|
+
/>
|
|
1409
|
+
</JunConfigRow>
|
|
1410
|
+
<JunConfigRow
|
|
1411
|
+
label="Scroll arrows"
|
|
1412
|
+
hint="Chevrons over the track edges"
|
|
1413
|
+
:muted="navOverflow !== 'scroll' && navOverflow !== 'shrink'"
|
|
1414
|
+
>
|
|
1415
|
+
<USwitch
|
|
1416
|
+
v-model="navScrollArrows"
|
|
1417
|
+
:disabled="!editing"
|
|
1418
|
+
color="neutral"
|
|
1419
|
+
/>
|
|
1420
|
+
</JunConfigRow>
|
|
1421
|
+
<JunConfigRow
|
|
1422
|
+
label="Edge fade"
|
|
1423
|
+
hint="Items dissolve at the edges"
|
|
1424
|
+
>
|
|
1425
|
+
<USwitch
|
|
1426
|
+
v-model="navEdgeFade"
|
|
1427
|
+
:disabled="!editing"
|
|
1428
|
+
color="neutral"
|
|
1429
|
+
/>
|
|
1430
|
+
</JunConfigRow>
|
|
1431
|
+
<JunConfigRow
|
|
1432
|
+
label="Snap"
|
|
1433
|
+
hint="The track settles on an item"
|
|
1434
|
+
>
|
|
1435
|
+
<USwitch
|
|
1436
|
+
v-model="navSnap"
|
|
1437
|
+
:disabled="!editing"
|
|
1438
|
+
color="neutral"
|
|
1439
|
+
/>
|
|
1440
|
+
</JunConfigRow>
|
|
1441
|
+
<!-- A rail on a narrow viewport eats the page, so it falls back to
|
|
1442
|
+
the top pill. This is where it stops doing that. -->
|
|
1443
|
+
<JunConfigRow
|
|
1444
|
+
label="Rail from"
|
|
1445
|
+
hint="Below this a rail becomes the top bar"
|
|
1446
|
+
:muted="!placementIsRail"
|
|
1447
|
+
>
|
|
1448
|
+
<USelect
|
|
1449
|
+
v-model="navRailBreakpoint"
|
|
1450
|
+
:items="[
|
|
1451
|
+
{ label: 'Medium (768px)', value: 'md' },
|
|
1452
|
+
{ label: 'Large (1024px)', value: 'lg' },
|
|
1453
|
+
{ label: 'X-large (1280px)', value: 'xl' }
|
|
1454
|
+
]"
|
|
1455
|
+
:disabled="!editing || !placementIsRail"
|
|
1456
|
+
size="xs"
|
|
1457
|
+
class="w-40"
|
|
1458
|
+
/>
|
|
1459
|
+
</JunConfigRow>
|
|
1460
|
+
</div>
|
|
1461
|
+
</div>
|
|
1462
|
+
|
|
983
1463
|
<p class="text-[11px] text-muted">
|
|
984
1464
|
A page's item can carry a short <span class="font-medium">nav label</span> separate from
|
|
985
|
-
its title — right-click the item while editing.
|
|
1465
|
+
its title — right-click the item while editing, or press and hold on a phone.
|
|
986
1466
|
</p>
|
|
987
1467
|
</section>
|
|
988
1468
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
junMotion,
|
|
8
8
|
useAbracadabra,
|
|
9
9
|
useChildTree,
|
|
10
|
+
useDocSlugs,
|
|
10
11
|
useDocTree,
|
|
11
12
|
useJunImagePopup,
|
|
12
13
|
useJunRename,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
useJunViewOptions
|
|
16
17
|
} from "#imports";
|
|
17
18
|
import { junViewSpecFor } from "../../utils/junViewSpecs";
|
|
19
|
+
import { useJunSiblings } from "../../composables/useJunSiblings";
|
|
18
20
|
import { useJunSectionScan } from "../../composables/useJunSections";
|
|
19
21
|
const props = defineProps({
|
|
20
22
|
docId: { type: String, required: true },
|
|
@@ -26,6 +28,7 @@ const props = defineProps({
|
|
|
26
28
|
const abra = useAbracadabra();
|
|
27
29
|
const tree = useChildTree(abra.doc, props.docId);
|
|
28
30
|
const { getEntry } = useDocTree();
|
|
31
|
+
const { getDocUrl } = useDocSlugs();
|
|
29
32
|
const { editing } = useJunStudio();
|
|
30
33
|
const { renameDoc } = useJunRename();
|
|
31
34
|
const { uploadTo, imageFiles } = useJunUpload();
|
|
@@ -37,6 +40,7 @@ const title = computed(() => entry.value?.label ?? props.docLabel ?? "Untitled")
|
|
|
37
40
|
function patchMeta(p) {
|
|
38
41
|
tree.updateMeta(props.docId, p);
|
|
39
42
|
}
|
|
43
|
+
const { neighbours } = useJunSiblings(computed(() => props.docId));
|
|
40
44
|
const titleEl = ref(null);
|
|
41
45
|
function commitTitle() {
|
|
42
46
|
const t = titleEl.value?.textContent?.trim();
|
|
@@ -544,6 +548,50 @@ function removeCover() {
|
|
|
544
548
|
</JunSectionPresence>
|
|
545
549
|
</div>
|
|
546
550
|
|
|
551
|
+
<!-- The entries either side. Client-only: it reads the live tree, which is
|
|
552
|
+
empty during SSR, and a pair of links that appear on hydration is
|
|
553
|
+
better than a pair rendered empty. -->
|
|
554
|
+
<ClientOnly>
|
|
555
|
+
<nav
|
|
556
|
+
v-if="view.neighbours && (neighbours.prev || neighbours.next)"
|
|
557
|
+
class="mt-12 grid grid-cols-1 gap-3 border-t border-default pt-6 sm:grid-cols-2"
|
|
558
|
+
aria-label="More entries"
|
|
559
|
+
>
|
|
560
|
+
<NuxtLink
|
|
561
|
+
v-if="neighbours.prev"
|
|
562
|
+
:to="getDocUrl(neighbours.prev.id)"
|
|
563
|
+
class="group flex flex-col gap-1 rounded-xl border border-default px-4 py-3 transition-colors hover:bg-black/5 dark:hover:bg-white/5"
|
|
564
|
+
>
|
|
565
|
+
<span class="flex items-center gap-1.5 text-[10px] font-medium tracking-[0.22em] text-dimmed uppercase">
|
|
566
|
+
<UIcon
|
|
567
|
+
name="i-lucide-arrow-left"
|
|
568
|
+
class="size-3 transition-transform duration-300 group-hover:-translate-x-0.5"
|
|
569
|
+
/>
|
|
570
|
+
Newer
|
|
571
|
+
</span>
|
|
572
|
+
<span class="line-clamp-2 text-sm text-default">{{ neighbours.prev.label }}</span>
|
|
573
|
+
</NuxtLink>
|
|
574
|
+
<span
|
|
575
|
+
v-else
|
|
576
|
+
class="hidden sm:block"
|
|
577
|
+
/>
|
|
578
|
+
<NuxtLink
|
|
579
|
+
v-if="neighbours.next"
|
|
580
|
+
:to="getDocUrl(neighbours.next.id)"
|
|
581
|
+
class="group flex flex-col gap-1 rounded-xl border border-default px-4 py-3 text-right transition-colors hover:bg-black/5 sm:col-start-2 dark:hover:bg-white/5"
|
|
582
|
+
>
|
|
583
|
+
<span class="flex items-center justify-end gap-1.5 text-[10px] font-medium tracking-[0.22em] text-dimmed uppercase">
|
|
584
|
+
Older
|
|
585
|
+
<UIcon
|
|
586
|
+
name="i-lucide-arrow-right"
|
|
587
|
+
class="size-3 transition-transform duration-300 group-hover:translate-x-0.5"
|
|
588
|
+
/>
|
|
589
|
+
</span>
|
|
590
|
+
<span class="line-clamp-2 text-sm text-default">{{ neighbours.next.label }}</span>
|
|
591
|
+
</NuxtLink>
|
|
592
|
+
</nav>
|
|
593
|
+
</ClientOnly>
|
|
594
|
+
|
|
547
595
|
<!-- What links here. Renders nothing on a site with no garden, and nothing on
|
|
548
596
|
a page nobody has cited — see the component's header. -->
|
|
549
597
|
<JunNoteLinks :doc-id="docId" />
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useAbracadabra, useChildTree, useDocSlugs, useRouter } from "#imports";
|
|
2
|
+
import { junAdoptedMeta } from "../utils/junAdopt.js";
|
|
2
3
|
export function useJunCreatePage() {
|
|
3
4
|
const abra = useAbracadabra();
|
|
4
5
|
const tree = useChildTree(abra.doc, "jun-create-page");
|
|
@@ -17,7 +18,12 @@ export function useJunCreatePage() {
|
|
|
17
18
|
order: now,
|
|
18
19
|
type,
|
|
19
20
|
createdAt: now,
|
|
20
|
-
updatedAt: now
|
|
21
|
+
updatedAt: now,
|
|
22
|
+
// Only somebody with write access can reach this function, so this page
|
|
23
|
+
// is the SITE rather than litter — see `junAdopt`. Without it a janitor
|
|
24
|
+
// running in `clean` mode removes a page made in the studio within a
|
|
25
|
+
// patrol or two, which is correct for a demo and wrong for a site.
|
|
26
|
+
meta: junAdoptedMeta()
|
|
21
27
|
});
|
|
22
28
|
tree.registerDoc(id, parent, { label, type });
|
|
23
29
|
if (options.navigate !== false) {
|