@abraca/junis 2.84.0 → 2.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.d.mts +17 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +270 -22
- package/dist/runtime/assets/css/jun.css +1 -1
- package/dist/runtime/components/JunBlobBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunCampfirePresence.client.vue +75 -10
- package/dist/runtime/components/JunCollectionIntro.d.vue.ts +11 -0
- package/dist/runtime/components/JunCollectionIntro.vue +45 -0
- package/dist/runtime/components/JunCollectionIntro.vue.d.ts +11 -0
- package/dist/runtime/components/JunConfigRow.d.vue.ts +43 -0
- package/dist/runtime/components/JunConfigRow.vue +34 -0
- package/dist/runtime/components/JunConfigRow.vue.d.ts +43 -0
- package/dist/runtime/components/JunFooter.vue +1 -1
- package/dist/runtime/components/JunHead.vue +37 -5
- package/dist/runtime/components/JunHorizontalTimeline.d.vue.ts +30 -0
- package/dist/runtime/components/JunHorizontalTimeline.vue.d.ts +30 -0
- package/dist/runtime/components/JunLinksRow.d.vue.ts +16 -1
- package/dist/runtime/components/JunLinksRow.vue +17 -7
- package/dist/runtime/components/JunLinksRow.vue.d.ts +16 -1
- package/dist/runtime/components/JunLogo.vue +10 -45
- package/dist/runtime/components/JunMedia.client.d.vue.ts +1 -1
- package/dist/runtime/components/JunMedia.client.vue.d.ts +1 -1
- package/dist/runtime/components/JunNavigation.vue +21 -4
- package/dist/runtime/components/JunNoteLinks.d.vue.ts +6 -0
- package/dist/runtime/components/JunNoteLinks.vue +57 -0
- package/dist/runtime/components/JunNoteLinks.vue.d.ts +6 -0
- package/dist/runtime/components/JunPageHero.d.vue.ts +8 -2
- package/dist/runtime/components/JunPageHero.vue +15 -3
- package/dist/runtime/components/JunPageHero.vue.d.ts +8 -2
- package/dist/runtime/components/JunPatternBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunReaders.d.vue.ts +11 -0
- package/dist/runtime/components/JunReaders.vue +99 -0
- package/dist/runtime/components/JunReaders.vue.d.ts +11 -0
- package/dist/runtime/components/JunSearch.client.vue +2 -2
- package/dist/runtime/components/JunSectionPresence.client.d.vue.ts +17 -0
- package/dist/runtime/components/JunSectionPresence.client.vue +99 -0
- package/dist/runtime/components/JunSectionPresence.client.vue.d.ts +17 -0
- package/dist/runtime/components/JunShaderBackdrop.client.vue +1 -1
- package/dist/runtime/components/JunThreadComposer.d.vue.ts +37 -0
- package/dist/runtime/components/JunThreadComposer.vue +54 -0
- package/dist/runtime/components/JunThreadComposer.vue.d.ts +37 -0
- package/dist/runtime/components/JunTravellersChip.vue +35 -5
- package/dist/runtime/components/JunVideoEmbed.client.d.vue.ts +1 -1
- package/dist/runtime/components/JunVideoEmbed.client.vue.d.ts +1 -1
- package/dist/runtime/components/JunViewControl.d.vue.ts +29 -0
- package/dist/runtime/components/JunViewControl.vue +340 -0
- package/dist/runtime/components/JunViewControl.vue.d.ts +29 -0
- package/dist/runtime/components/JunViewControls.d.vue.ts +27 -0
- package/dist/runtime/components/JunViewControls.vue +94 -0
- package/dist/runtime/components/JunViewControls.vue.d.ts +27 -0
- package/dist/runtime/components/renderers/JunAppsRenderer.vue +45 -4
- package/dist/runtime/components/renderers/JunCinemaRenderer.vue +42 -4
- package/dist/runtime/components/renderers/JunConfigRenderer.vue +362 -239
- package/dist/runtime/components/renderers/JunCourseRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunCourseRenderer.vue +229 -0
- package/dist/runtime/components/renderers/JunCourseRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunCvRenderer.vue +44 -6
- package/dist/runtime/components/renderers/JunDeckRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunDeckRenderer.vue +370 -0
- package/dist/runtime/components/renderers/JunDeckRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunEntryRenderer.vue +157 -31
- package/dist/runtime/components/renderers/JunFestivalRenderer.vue +42 -5
- package/dist/runtime/components/renderers/JunGardenRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunGardenRenderer.vue +280 -0
- package/dist/runtime/components/renderers/JunGardenRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunGuestbookRenderer.vue +96 -14
- package/dist/runtime/components/renderers/JunHomeRenderer.vue +31 -132
- package/dist/runtime/components/renderers/JunItemRenderer.d.vue.ts +10 -0
- package/dist/runtime/components/renderers/JunItemRenderer.vue +398 -0
- package/dist/runtime/components/renderers/JunItemRenderer.vue.d.ts +10 -0
- package/dist/runtime/components/renderers/JunJournalRenderer.vue +141 -11
- package/dist/runtime/components/renderers/JunLibraryRenderer.vue +295 -12
- package/dist/runtime/components/renderers/JunLinksRenderer.vue +33 -1
- package/dist/runtime/components/renderers/JunLiveRenderer.vue +38 -2
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue +3 -2
- package/dist/runtime/components/renderers/JunMovieRenderer.vue +32 -5
- package/dist/runtime/components/renderers/JunNowRenderer.vue +40 -7
- package/dist/runtime/components/renderers/JunPollRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunPollRenderer.vue +231 -0
- package/dist/runtime/components/renderers/JunPollRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunProjectRenderer.vue +74 -18
- package/dist/runtime/components/renderers/JunServicesRenderer.vue +40 -2
- package/dist/runtime/components/renderers/JunStatsRenderer.vue +37 -50
- package/dist/runtime/components/renderers/JunThreadRenderer.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/JunThreadRenderer.vue +304 -0
- package/dist/runtime/components/renderers/JunThreadRenderer.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/JunTrackRenderer.vue +32 -4
- package/dist/runtime/components/renderers/JunUsesRenderer.vue +57 -13
- package/dist/runtime/components/renderers/JunWallRenderer.vue +60 -5
- package/dist/runtime/composables/useJunDeck.d.ts +66 -0
- package/dist/runtime/composables/useJunDeck.js +61 -0
- package/dist/runtime/composables/useJunDocPage.d.ts +14 -11
- package/dist/runtime/composables/useJunDocPage.js +67 -3
- package/dist/runtime/composables/useJunFollow.d.ts +65 -9
- package/dist/runtime/composables/useJunFollow.js +237 -20
- package/dist/runtime/composables/useJunGarden.d.ts +67 -0
- package/dist/runtime/composables/useJunGarden.js +92 -0
- package/dist/runtime/composables/useJunOptions.d.ts +1 -0
- package/dist/runtime/composables/useJunPresence.d.ts +26 -0
- package/dist/runtime/composables/useJunPresence.js +9 -2
- package/dist/runtime/composables/useJunSections.d.ts +73 -0
- package/dist/runtime/composables/useJunSections.js +117 -0
- package/dist/runtime/composables/useJunSettings.d.ts +1 -1
- package/dist/runtime/composables/useJunSettings.js +5 -1
- package/dist/runtime/composables/useJunSiteConfig.d.ts +37 -0
- package/dist/runtime/composables/useJunTheme.js +49 -50
- package/dist/runtime/composables/useJunViewOptions.d.ts +85 -0
- package/dist/runtime/composables/useJunViewOptions.js +63 -0
- package/dist/runtime/pages/doc.vue +14 -8
- package/dist/runtime/plugins/jun-sw.client.d.ts +2 -0
- package/dist/runtime/plugins/jun-sw.client.js +36 -0
- package/dist/runtime/server/api/health.get.d.ts +19 -0
- package/dist/runtime/server/api/health.get.js +40 -0
- package/dist/runtime/server/api/links.get.d.ts +19 -0
- package/dist/runtime/server/api/links.get.js +37 -0
- package/dist/runtime/server/api/resolve/[...slug].get.d.ts +9 -0
- package/dist/runtime/server/api/resolve/[...slug].get.js +5 -0
- package/dist/runtime/server/api/stats.get.js +2 -1
- package/dist/runtime/server/janitor/junJanitorChores.js +8 -0
- package/dist/runtime/server/plugins/jun-bootstrap.js +103 -15
- package/dist/runtime/server/plugins/jun-doc-cache.js +42 -4
- package/dist/runtime/server/plugins/jun-janitor.js +9 -1
- package/dist/runtime/server/plugins/jun-rpc.js +293 -0
- package/dist/runtime/server/plugins/jun-watchdog.d.ts +2 -0
- package/dist/runtime/server/plugins/jun-watchdog.js +54 -0
- package/dist/runtime/server/routes/jun-icon.png.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-icon.png.get.js +25 -0
- package/dist/runtime/server/routes/jun-icon.svg.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-icon.svg.get.js +9 -0
- package/dist/runtime/server/routes/jun-splash.png.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-splash.png.get.js +37 -0
- package/dist/runtime/server/routes/jun-sw.js.get.d.ts +2 -0
- package/dist/runtime/server/routes/jun-sw.js.get.js +126 -0
- package/dist/runtime/server/routes/manifest.webmanifest.get.d.ts +24 -0
- package/dist/runtime/server/routes/manifest.webmanifest.get.js +51 -0
- package/dist/runtime/server/routes/sitemap.xml.get.js +2 -0
- package/dist/runtime/server/utils/junBoot.d.ts +1 -0
- package/dist/runtime/server/utils/junBoot.js +4 -0
- package/dist/runtime/server/utils/junBrand.d.ts +4 -0
- package/dist/runtime/server/utils/junBrand.js +9 -0
- package/dist/runtime/server/utils/junCache.d.ts +17 -0
- package/dist/runtime/server/utils/junCache.js +5 -0
- package/dist/runtime/server/utils/junIcon.d.ts +44 -0
- package/dist/runtime/server/utils/junIcon.js +374 -0
- package/dist/runtime/server/utils/junSeedGate.d.ts +68 -0
- package/dist/runtime/server/utils/junSeedGate.js +41 -0
- package/dist/runtime/types.d.ts +82 -3
- package/dist/runtime/utils/junCourse.d.ts +106 -0
- package/dist/runtime/utils/junCourse.js +65 -0
- package/dist/runtime/utils/junGarden.d.ts +193 -0
- package/dist/runtime/utils/junGarden.js +233 -0
- package/dist/runtime/utils/junIdentity.d.ts +121 -0
- package/dist/runtime/utils/junIdentity.js +115 -0
- package/dist/runtime/utils/junMark.d.ts +254 -0
- package/dist/runtime/utils/junMark.js +169 -0
- package/dist/runtime/utils/junMetaSchemas.js +8 -1
- package/dist/runtime/utils/junModeration.d.ts +67 -0
- package/dist/runtime/utils/junModeration.js +20 -0
- package/dist/runtime/utils/junMotion.d.ts +26 -0
- package/dist/runtime/utils/junMotion.js +31 -0
- package/dist/runtime/utils/junPeople.d.ts +43 -0
- package/dist/runtime/utils/junPeople.js +9 -0
- package/dist/runtime/utils/junPoll.d.ts +79 -0
- package/dist/runtime/utils/junPoll.js +82 -0
- package/dist/runtime/utils/junReadiness.d.ts +131 -0
- package/dist/runtime/utils/junReadiness.js +69 -0
- package/dist/runtime/utils/junSections.d.ts +115 -0
- package/dist/runtime/utils/junSections.js +45 -0
- package/dist/runtime/utils/junSlides.d.ts +66 -0
- package/dist/runtime/utils/junSlides.js +47 -0
- package/dist/runtime/utils/junThread.d.ts +81 -0
- package/dist/runtime/utils/junThread.js +75 -0
- package/dist/runtime/utils/junViewSpecs.d.ts +671 -0
- package/dist/runtime/utils/junViewSpecs.js +534 -0
- package/dist/runtime/utils/junViewValues.d.ts +125 -0
- package/dist/runtime/utils/junViewValues.js +104 -0
- package/dist/types.d.mts +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The post being answered, or null for a new top-level one. */
|
|
3
|
+
replyTo: string | null;
|
|
4
|
+
sending?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
/**
|
|
8
|
+
* JunThreadComposer — the box a visitor writes in.
|
|
9
|
+
*
|
|
10
|
+
* Its own component because a conversation has THREE of it in different places:
|
|
11
|
+
* above the posts when the newest are first, below them when they are in order,
|
|
12
|
+
* and inside whichever post is being replied to — so a reply is written where it
|
|
13
|
+
* will appear. Three copies of the markup would be three places to fix a keyboard
|
|
14
|
+
* shortcut.
|
|
15
|
+
*
|
|
16
|
+
* It only emits. The write is `jun.thread.post@1`, and the renderer owns it: a
|
|
17
|
+
* component that could post would need the identity rules too, and there would be
|
|
18
|
+
* two places that decide what a legal reply is.
|
|
19
|
+
*
|
|
20
|
+
* ⌘/Ctrl+Enter sends. Enter does NOT — a comment box that submits on Enter cannot
|
|
21
|
+
* hold a second paragraph, and people write paragraphs when they are answering
|
|
22
|
+
* something.
|
|
23
|
+
*/
|
|
24
|
+
modelValue: string;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
send: () => any;
|
|
29
|
+
"update:modelValue": (value: string) => any;
|
|
30
|
+
cancelReply: () => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
onSend?: (() => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
34
|
+
onCancelReply?: (() => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const model = defineModel({ type: String, ...{ required: true } });
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
replyTo: { type: [String, null], required: true },
|
|
5
|
+
sending: { type: Boolean, required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["send", "cancelReply"]);
|
|
8
|
+
function onKeydown(event) {
|
|
9
|
+
if ((event.metaKey || event.ctrlKey) && event.key === "Enter") {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
emit("send");
|
|
12
|
+
} else if (event.key === "Escape" && props.replyTo) {
|
|
13
|
+
event.preventDefault();
|
|
14
|
+
emit("cancelReply");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="jun-thread-composer flex flex-col gap-2">
|
|
21
|
+
<textarea
|
|
22
|
+
v-model="model"
|
|
23
|
+
:placeholder="replyTo ? 'Your reply\u2026' : 'Say something\u2026'"
|
|
24
|
+
rows="3"
|
|
25
|
+
class="w-full resize-y rounded-xl bg-black/[0.03] px-3.5 py-2.5 text-sm text-default
|
|
26
|
+
outline-none ring-1 ring-black/5 placeholder:text-dimmed
|
|
27
|
+
dark:bg-white/[0.05] dark:ring-white/10"
|
|
28
|
+
data-jun-thread="input"
|
|
29
|
+
:disabled="sending"
|
|
30
|
+
@keydown="onKeydown"
|
|
31
|
+
/>
|
|
32
|
+
<div class="flex items-center gap-2">
|
|
33
|
+
<UButton
|
|
34
|
+
size="xs"
|
|
35
|
+
color="neutral"
|
|
36
|
+
variant="soft"
|
|
37
|
+
:loading="sending"
|
|
38
|
+
:disabled="!model.trim() || sending"
|
|
39
|
+
:label="replyTo ? 'Reply' : 'Post'"
|
|
40
|
+
data-jun-thread="send"
|
|
41
|
+
@click="emit('send')"
|
|
42
|
+
/>
|
|
43
|
+
<UButton
|
|
44
|
+
v-if="replyTo"
|
|
45
|
+
size="xs"
|
|
46
|
+
color="neutral"
|
|
47
|
+
variant="ghost"
|
|
48
|
+
label="Cancel"
|
|
49
|
+
@click="emit('cancelReply')"
|
|
50
|
+
/>
|
|
51
|
+
<span class="text-[11px] text-dimmed">⌘↩ to send</span>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The post being answered, or null for a new top-level one. */
|
|
3
|
+
replyTo: string | null;
|
|
4
|
+
sending?: boolean;
|
|
5
|
+
};
|
|
6
|
+
type __VLS_ModelProps = {
|
|
7
|
+
/**
|
|
8
|
+
* JunThreadComposer — the box a visitor writes in.
|
|
9
|
+
*
|
|
10
|
+
* Its own component because a conversation has THREE of it in different places:
|
|
11
|
+
* above the posts when the newest are first, below them when they are in order,
|
|
12
|
+
* and inside whichever post is being replied to — so a reply is written where it
|
|
13
|
+
* will appear. Three copies of the markup would be three places to fix a keyboard
|
|
14
|
+
* shortcut.
|
|
15
|
+
*
|
|
16
|
+
* It only emits. The write is `jun.thread.post@1`, and the renderer owns it: a
|
|
17
|
+
* component that could post would need the identity rules too, and there would be
|
|
18
|
+
* two places that decide what a legal reply is.
|
|
19
|
+
*
|
|
20
|
+
* ⌘/Ctrl+Enter sends. Enter does NOT — a comment box that submits on Enter cannot
|
|
21
|
+
* hold a second paragraph, and people write paragraphs when they are answering
|
|
22
|
+
* something.
|
|
23
|
+
*/
|
|
24
|
+
modelValue: string;
|
|
25
|
+
};
|
|
26
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
27
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
28
|
+
send: () => any;
|
|
29
|
+
"update:modelValue": (value: string) => any;
|
|
30
|
+
cancelReply: () => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
32
|
+
onSend?: (() => any) | undefined;
|
|
33
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
34
|
+
onCancelReply?: (() => any) | undefined;
|
|
35
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed, resolveComponent } from "vue";
|
|
3
|
-
import { useAbracadabra, useDocSlugs, useDocTree } from "#imports";
|
|
3
|
+
import { useAbracadabra, useDocSlugs, useDocTree, useJunFollow } from "#imports";
|
|
4
4
|
import { useJunTravellers } from "../composables/useJunPresence";
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
list: { type: Boolean, required: false, default: false }
|
|
7
7
|
});
|
|
8
8
|
const NuxtLink = resolveComponent("NuxtLink");
|
|
9
|
-
const { travellers } = useJunTravellers();
|
|
9
|
+
const { people: travellers } = useJunTravellers();
|
|
10
|
+
const { toggle: toggleFollow, followingClientId } = useJunFollow();
|
|
10
11
|
const { getDocUrl } = useDocSlugs();
|
|
11
12
|
const { getEntry } = useDocTree();
|
|
12
13
|
const abra = useAbracadabra();
|
|
@@ -73,7 +74,12 @@ function placeFor(t) {
|
|
|
73
74
|
</button>
|
|
74
75
|
|
|
75
76
|
<template #content>
|
|
76
|
-
|
|
77
|
+
<!-- `data-jun-follow-ui`: going to where a traveller IS, from the list
|
|
78
|
+
that says where they are, must not read as leaving the journey. -->
|
|
79
|
+
<div
|
|
80
|
+
class="w-64 py-1.5"
|
|
81
|
+
data-jun-follow-ui
|
|
82
|
+
>
|
|
77
83
|
<p class="px-3.5 pt-1.5 pb-1 text-[10px] tracking-[0.22em] uppercase text-black/35 dark:text-white/35">
|
|
78
84
|
{{ travellers.length === 1 ? "Fellow traveller" : "Fellow travellers" }}
|
|
79
85
|
</p>
|
|
@@ -81,12 +87,16 @@ function placeFor(t) {
|
|
|
81
87
|
<li
|
|
82
88
|
v-for="t in travellers"
|
|
83
89
|
:key="t.clientId"
|
|
84
|
-
|
|
90
|
+
class="group flex items-center transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.05]"
|
|
91
|
+
:class="[
|
|
92
|
+
t.idle ? 'opacity-50' : '',
|
|
93
|
+
followingClientId === t.clientId ? 'bg-black/[0.05] dark:bg-white/[0.06]' : ''
|
|
94
|
+
]"
|
|
85
95
|
>
|
|
86
96
|
<component
|
|
87
97
|
:is="placeFor(t).to ? NuxtLink : 'div'"
|
|
88
98
|
:to="placeFor(t).to ?? void 0"
|
|
89
|
-
class="flex items-center gap-2.5
|
|
99
|
+
class="flex min-w-0 flex-1 items-center gap-2.5 py-2 pl-3.5"
|
|
90
100
|
>
|
|
91
101
|
<span
|
|
92
102
|
class="inline-block size-2 shrink-0 rounded-full"
|
|
@@ -99,6 +109,26 @@ function placeFor(t) {
|
|
|
99
109
|
</span>
|
|
100
110
|
</span>
|
|
101
111
|
</component>
|
|
112
|
+
<!-- Always rendered, never hover-only: a control that appears on
|
|
113
|
+
hover is unreachable from a keyboard and invisible on a touch
|
|
114
|
+
screen. It fades UP on hover instead. -->
|
|
115
|
+
<button
|
|
116
|
+
type="button"
|
|
117
|
+
class="mr-2 flex size-7 shrink-0 items-center justify-center rounded-full text-black/35
|
|
118
|
+
opacity-60 transition-all duration-200 group-hover:opacity-100 hover:bg-black/[0.06]
|
|
119
|
+
hover:text-black/70 focus-visible:opacity-100 dark:text-white/35
|
|
120
|
+
dark:hover:bg-white/[0.08] dark:hover:text-white/80"
|
|
121
|
+
:class="followingClientId === t.clientId ? 'opacity-100 text-black/70 dark:text-white/80' : ''"
|
|
122
|
+
:title="followingClientId === t.clientId ? `Stop following ${t.name}` : `Travel with ${t.name}`"
|
|
123
|
+
:aria-label="followingClientId === t.clientId ? `Stop following ${t.name}` : `Travel with ${t.name}`"
|
|
124
|
+
:aria-pressed="followingClientId === t.clientId"
|
|
125
|
+
@click="toggleFollow(t.clientId)"
|
|
126
|
+
>
|
|
127
|
+
<UIcon
|
|
128
|
+
:name="followingClientId === t.clientId ? 'i-lucide-footprints' : 'i-lucide-arrow-right-to-line'"
|
|
129
|
+
class="size-3.5"
|
|
130
|
+
/>
|
|
131
|
+
</button>
|
|
102
132
|
</li>
|
|
103
133
|
</ul>
|
|
104
134
|
</div>
|
|
@@ -16,8 +16,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
16
16
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
17
|
title: string;
|
|
18
18
|
start: number;
|
|
19
|
-
poster: string;
|
|
20
19
|
ratio: boolean;
|
|
20
|
+
poster: string;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -16,8 +16,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
16
16
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
17
|
title: string;
|
|
18
18
|
start: number;
|
|
19
|
-
poster: string;
|
|
20
19
|
ratio: boolean;
|
|
20
|
+
poster: string;
|
|
21
21
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
22
|
declare const _default: typeof __VLS_export;
|
|
23
23
|
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JunViewControl — ONE display setting, rendered as whatever kind it is.
|
|
3
|
+
*
|
|
4
|
+
* Ten kinds: `variant`, `select`, `order`, `number`, `range`, `color`, `text`,
|
|
5
|
+
* `tags`, `doc`, `toggle`. A renderer gains a control by adding a line to its
|
|
6
|
+
* spec in `utils/junViewSpecs.ts`; nothing here is per-renderer.
|
|
7
|
+
*
|
|
8
|
+
* Split out of `<JunViewControls>` when the settings modal needed the same
|
|
9
|
+
* controls WITHOUT a popover around them, to set the site-wide default for the
|
|
10
|
+
* same options. One implementation, two surfaces — the alternative was ten kinds
|
|
11
|
+
* written twice, which is the duplication the panel was extracted to end.
|
|
12
|
+
*
|
|
13
|
+
* Writes nothing itself: it emits, and `useJunViewOptions` owns the
|
|
14
|
+
* default-clearing rule that keeps a stored default from pinning a site's
|
|
15
|
+
* house style forever.
|
|
16
|
+
*/
|
|
17
|
+
import type { JunViewOption, JunViewValue } from '../composables/useJunViewOptions.js';
|
|
18
|
+
type __VLS_Props = {
|
|
19
|
+
option: JunViewOption;
|
|
20
|
+
/** Every resolved value, so a control can read its own by key. */
|
|
21
|
+
values: Record<string, JunViewValue>;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
set: (key: string, value: JunViewValue) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
onSet?: ((key: string, value: JunViewValue) => any) | undefined;
|
|
27
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
option: { type: Object, required: true },
|
|
4
|
+
values: { type: Object, required: true }
|
|
5
|
+
});
|
|
6
|
+
const emit = defineEmits(["set"]);
|
|
7
|
+
function rows(option) {
|
|
8
|
+
const current = props.values[option.key];
|
|
9
|
+
const on = Array.isArray(current) ? current : [];
|
|
10
|
+
const choices = option.choices ?? [];
|
|
11
|
+
const byValue = new Map(choices.map((c) => [c.value, c]));
|
|
12
|
+
const out = on.map((v) => byValue.get(v)).filter((c) => !!c).map((c) => ({ ...c, on: true }));
|
|
13
|
+
for (const c of choices) if (!on.includes(c.value)) out.push({ ...c, on: false });
|
|
14
|
+
return out;
|
|
15
|
+
}
|
|
16
|
+
function toggleOrder(option, value) {
|
|
17
|
+
const current = props.values[option.key];
|
|
18
|
+
const on = Array.isArray(current) ? [...current] : [];
|
|
19
|
+
const i = on.indexOf(value);
|
|
20
|
+
if (i >= 0) on.splice(i, 1);
|
|
21
|
+
else on.push(value);
|
|
22
|
+
emit("set", option.key, on);
|
|
23
|
+
}
|
|
24
|
+
function moveOrder(option, value, delta) {
|
|
25
|
+
const current = props.values[option.key];
|
|
26
|
+
const on = Array.isArray(current) ? [...current] : [];
|
|
27
|
+
const i = on.indexOf(value);
|
|
28
|
+
const j = i + delta;
|
|
29
|
+
if (i < 0 || j < 0 || j >= on.length) return;
|
|
30
|
+
[on[i], on[j]] = [on[j], on[i]];
|
|
31
|
+
emit("set", option.key, on);
|
|
32
|
+
}
|
|
33
|
+
function tagsOf(option) {
|
|
34
|
+
const current = props.values[option.key];
|
|
35
|
+
return Array.isArray(current) ? current : [];
|
|
36
|
+
}
|
|
37
|
+
function removeTag(option, tag) {
|
|
38
|
+
emit("set", option.key, tagsOf(option).filter((t) => t !== tag));
|
|
39
|
+
}
|
|
40
|
+
function addTags(option, event) {
|
|
41
|
+
const el = event.target;
|
|
42
|
+
const parts = el.value.split(",").map((t) => t.trim()).filter(Boolean);
|
|
43
|
+
if (!parts.length) return;
|
|
44
|
+
emit("set", option.key, [...tagsOf(option), ...parts]);
|
|
45
|
+
el.value = "";
|
|
46
|
+
}
|
|
47
|
+
function hexOf(option) {
|
|
48
|
+
const v = props.values[option.key];
|
|
49
|
+
if (typeof v === "string" && /^#[0-9a-f]{6}$/i.test(v)) return v;
|
|
50
|
+
return "#808080";
|
|
51
|
+
}
|
|
52
|
+
function step(option, delta) {
|
|
53
|
+
const current = Number(props.values[option.key] ?? option.default);
|
|
54
|
+
const next = current + delta * (option.step ?? 1);
|
|
55
|
+
const min = option.min ?? Number.NEGATIVE_INFINITY;
|
|
56
|
+
const max = option.max ?? Number.POSITIVE_INFINITY;
|
|
57
|
+
if (next < min || next > max) return;
|
|
58
|
+
emit("set", option.key, next);
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<template>
|
|
63
|
+
<!-- A VARIANT is the page's shape, so it gets the most room: a
|
|
64
|
+
segmented row of icons, labelled, wrapping rather than
|
|
65
|
+
scrolling. -->
|
|
66
|
+
<div v-if="props.option.kind === 'variant'">
|
|
67
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
68
|
+
{{ props.option.label }}
|
|
69
|
+
</p>
|
|
70
|
+
<div class="flex flex-wrap gap-1">
|
|
71
|
+
<button
|
|
72
|
+
v-for="choice in props.option.choices"
|
|
73
|
+
:key="choice.value"
|
|
74
|
+
type="button"
|
|
75
|
+
class="flex flex-1 basis-20 flex-col items-center gap-1 rounded-lg px-2 py-2
|
|
76
|
+
text-[11px] transition-colors duration-200"
|
|
77
|
+
:class="values[props.option.key] === choice.value ? 'bg-black/[0.07] text-highlighted dark:bg-white/[0.10]' : 'text-muted hover:bg-black/[0.035] dark:hover:bg-white/[0.05]'"
|
|
78
|
+
:title="choice.hint"
|
|
79
|
+
:aria-pressed="values[props.option.key] === choice.value"
|
|
80
|
+
@click="emit('set', props.option.key, choice.value)"
|
|
81
|
+
>
|
|
82
|
+
<UIcon
|
|
83
|
+
v-if="choice.icon"
|
|
84
|
+
:name="choice.icon"
|
|
85
|
+
class="size-4"
|
|
86
|
+
/>
|
|
87
|
+
{{ choice.label }}
|
|
88
|
+
</button>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<!-- A SELECT is a value among several, not a shape — a chip row. -->
|
|
93
|
+
<div v-else-if="props.option.kind === 'select'">
|
|
94
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
95
|
+
{{ props.option.label }}
|
|
96
|
+
</p>
|
|
97
|
+
<div class="flex flex-wrap gap-1">
|
|
98
|
+
<button
|
|
99
|
+
v-for="choice in props.option.choices"
|
|
100
|
+
:key="choice.value"
|
|
101
|
+
type="button"
|
|
102
|
+
class="rounded-full px-2.5 py-1 text-[11px] transition-colors duration-200"
|
|
103
|
+
:class="values[props.option.key] === choice.value ? 'bg-black/[0.07] text-highlighted dark:bg-white/[0.10]' : 'text-muted hover:bg-black/[0.035] dark:hover:bg-white/[0.05]'"
|
|
104
|
+
:title="choice.hint"
|
|
105
|
+
:aria-pressed="values[props.option.key] === choice.value"
|
|
106
|
+
@click="emit('set', props.option.key, choice.value)"
|
|
107
|
+
>
|
|
108
|
+
{{ choice.label }}
|
|
109
|
+
</button>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
<!-- An ORDER is a list the owner both reorders and switches off, so
|
|
114
|
+
it is the one control that needs its own rows. The move buttons
|
|
115
|
+
are only offered on rows that are ON — reordering something
|
|
116
|
+
hidden is a promise about a position nobody can see. -->
|
|
117
|
+
<div v-else-if="props.option.kind === 'order'">
|
|
118
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
119
|
+
{{ props.option.label }}
|
|
120
|
+
</p>
|
|
121
|
+
<ul class="flex flex-col gap-0.5">
|
|
122
|
+
<li
|
|
123
|
+
v-for="(row, i) in rows(props.option)"
|
|
124
|
+
:key="row.value"
|
|
125
|
+
class="flex items-center gap-1.5 rounded-md px-1.5 py-1 text-[11px] transition-colors hover:bg-black/[0.03] dark:hover:bg-white/[0.04]"
|
|
126
|
+
:class="row.on ? 'text-highlighted' : 'text-dimmed'"
|
|
127
|
+
>
|
|
128
|
+
<UIcon
|
|
129
|
+
v-if="row.icon"
|
|
130
|
+
:name="row.icon"
|
|
131
|
+
class="size-3.5 shrink-0 opacity-70"
|
|
132
|
+
/>
|
|
133
|
+
<span
|
|
134
|
+
class="flex-1 truncate"
|
|
135
|
+
:title="row.hint"
|
|
136
|
+
>{{ row.label }}</span>
|
|
137
|
+
<template v-if="row.on">
|
|
138
|
+
<UButton
|
|
139
|
+
icon="i-lucide-chevron-up"
|
|
140
|
+
size="xs"
|
|
141
|
+
color="neutral"
|
|
142
|
+
variant="ghost"
|
|
143
|
+
:aria-label="`Move ${row.label} up`"
|
|
144
|
+
:disabled="i === 0"
|
|
145
|
+
@click="moveOrder(props.option, row.value, -1)"
|
|
146
|
+
/>
|
|
147
|
+
<UButton
|
|
148
|
+
icon="i-lucide-chevron-down"
|
|
149
|
+
size="xs"
|
|
150
|
+
color="neutral"
|
|
151
|
+
variant="ghost"
|
|
152
|
+
:aria-label="`Move ${row.label} down`"
|
|
153
|
+
@click="moveOrder(props.option, row.value, 1)"
|
|
154
|
+
/>
|
|
155
|
+
</template>
|
|
156
|
+
<USwitch
|
|
157
|
+
:model-value="row.on"
|
|
158
|
+
size="xs"
|
|
159
|
+
color="neutral"
|
|
160
|
+
:aria-label="row.label"
|
|
161
|
+
@update:model-value="toggleOrder(props.option, row.value)"
|
|
162
|
+
/>
|
|
163
|
+
</li>
|
|
164
|
+
</ul>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<div
|
|
168
|
+
v-else-if="props.option.kind === 'number'"
|
|
169
|
+
class="flex items-center gap-2"
|
|
170
|
+
>
|
|
171
|
+
<UIcon
|
|
172
|
+
v-if="props.option.icon"
|
|
173
|
+
:name="props.option.icon"
|
|
174
|
+
class="size-3.5 shrink-0 text-dimmed"
|
|
175
|
+
/>
|
|
176
|
+
<span class="flex-1 text-[11px] text-muted">{{ props.option.label }}</span>
|
|
177
|
+
<UButton
|
|
178
|
+
icon="i-lucide-minus"
|
|
179
|
+
size="xs"
|
|
180
|
+
color="neutral"
|
|
181
|
+
variant="ghost"
|
|
182
|
+
:aria-label="`Fewer \u2014 ${props.option.label}`"
|
|
183
|
+
:disabled="Number(values[props.option.key]) <= (props.option.min ?? -Infinity)"
|
|
184
|
+
@click="step(props.option, -1)"
|
|
185
|
+
/>
|
|
186
|
+
<span class="w-5 text-center text-xs tabular-nums text-highlighted">
|
|
187
|
+
{{ values[props.option.key] }}
|
|
188
|
+
</span>
|
|
189
|
+
<UButton
|
|
190
|
+
icon="i-lucide-plus"
|
|
191
|
+
size="xs"
|
|
192
|
+
color="neutral"
|
|
193
|
+
variant="ghost"
|
|
194
|
+
:aria-label="`More \u2014 ${props.option.label}`"
|
|
195
|
+
:disabled="Number(values[props.option.key]) >= (props.option.max ?? Infinity)"
|
|
196
|
+
@click="step(props.option, 1)"
|
|
197
|
+
/>
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
<!-- A RANGE is a number you sweep rather than nudge. A density
|
|
201
|
+
between 0 and 1 in steps of 0.05 is absurd to click twenty
|
|
202
|
+
times, which is the only reason this is not a stepper. -->
|
|
203
|
+
<div
|
|
204
|
+
v-else-if="props.option.kind === 'range'"
|
|
205
|
+
class="flex items-center gap-2"
|
|
206
|
+
>
|
|
207
|
+
<UIcon
|
|
208
|
+
v-if="props.option.icon"
|
|
209
|
+
:name="props.option.icon"
|
|
210
|
+
class="size-3.5 shrink-0 text-dimmed"
|
|
211
|
+
/>
|
|
212
|
+
<span class="flex-1 text-[11px] text-muted">{{ props.option.label }}</span>
|
|
213
|
+
<input
|
|
214
|
+
type="range"
|
|
215
|
+
class="jun-view-range w-24"
|
|
216
|
+
:min="props.option.min ?? 0"
|
|
217
|
+
:max="props.option.max ?? 1"
|
|
218
|
+
:step="props.option.step ?? 0.05"
|
|
219
|
+
:value="Number(values[props.option.key])"
|
|
220
|
+
:aria-label="props.option.label"
|
|
221
|
+
@input="emit('set', props.option.key, Number($event.target.value))"
|
|
222
|
+
>
|
|
223
|
+
<span class="w-7 text-right text-[11px] tabular-nums text-highlighted">
|
|
224
|
+
{{ values[props.option.key] }}
|
|
225
|
+
</span>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
<!-- A COLOUR: the offered swatches, plus a picker. The swatches are a
|
|
229
|
+
suggestion — a brand colour that is not on the ramp is still a
|
|
230
|
+
brand colour — and the picker is what makes that true. -->
|
|
231
|
+
<div v-else-if="props.option.kind === 'color'">
|
|
232
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
233
|
+
{{ props.option.label }}
|
|
234
|
+
</p>
|
|
235
|
+
<div class="flex flex-wrap items-center gap-1">
|
|
236
|
+
<button
|
|
237
|
+
v-for="choice in props.option.choices"
|
|
238
|
+
:key="choice.value"
|
|
239
|
+
type="button"
|
|
240
|
+
class="flex items-center gap-1.5 rounded-full px-2 py-1 text-[11px] transition-colors duration-200"
|
|
241
|
+
:class="values[props.option.key] === choice.value ? 'bg-black/[0.07] text-highlighted dark:bg-white/[0.10]' : 'text-muted hover:bg-black/[0.035] dark:hover:bg-white/[0.05]'"
|
|
242
|
+
:aria-pressed="values[props.option.key] === choice.value"
|
|
243
|
+
@click="emit('set', props.option.key, choice.value)"
|
|
244
|
+
>
|
|
245
|
+
<span
|
|
246
|
+
v-if="choice.value.startsWith('#')"
|
|
247
|
+
class="size-2.5 rounded-full ring-1 ring-black/10 dark:ring-white/15"
|
|
248
|
+
:style="{ background: choice.value }"
|
|
249
|
+
/>
|
|
250
|
+
{{ choice.label }}
|
|
251
|
+
</button>
|
|
252
|
+
<input
|
|
253
|
+
type="color"
|
|
254
|
+
class="jun-view-swatch size-6 shrink-0 cursor-pointer rounded-full"
|
|
255
|
+
:value="hexOf(props.option)"
|
|
256
|
+
:aria-label="`${props.option.label} \u2014 pick a colour`"
|
|
257
|
+
@input="emit('set', props.option.key, $event.target.value)"
|
|
258
|
+
>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<!-- TEXT. Committed on blur and on Enter, never per keystroke: every
|
|
263
|
+
character would otherwise be a CRDT meta write, and every peer
|
|
264
|
+
would watch the label being typed one letter at a time. -->
|
|
265
|
+
<div v-else-if="props.option.kind === 'text'">
|
|
266
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
267
|
+
{{ props.option.label }}
|
|
268
|
+
</p>
|
|
269
|
+
<input
|
|
270
|
+
type="text"
|
|
271
|
+
class="w-full rounded-md bg-black/[0.04] px-2 py-1 text-xs text-highlighted
|
|
272
|
+
outline-none placeholder:text-dimmed dark:bg-white/[0.06]"
|
|
273
|
+
:value="String(values[props.option.key] ?? '')"
|
|
274
|
+
:maxlength="props.option.maxLength ?? 120"
|
|
275
|
+
:placeholder="props.option.placeholder"
|
|
276
|
+
:aria-label="props.option.label"
|
|
277
|
+
spellcheck="false"
|
|
278
|
+
@change="emit('set', props.option.key, $event.target.value)"
|
|
279
|
+
@keydown.enter="$event.target.blur()"
|
|
280
|
+
>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<!-- TAGS. The chips are the value; the field only adds. Removing is
|
|
284
|
+
one press on the chip, which is where a person looks for it. -->
|
|
285
|
+
<div v-else-if="props.option.kind === 'tags'">
|
|
286
|
+
<p class="mb-1.5 text-[11px] text-muted">
|
|
287
|
+
{{ props.option.label }}
|
|
288
|
+
</p>
|
|
289
|
+
<div class="flex flex-wrap gap-1">
|
|
290
|
+
<button
|
|
291
|
+
v-for="tag in tagsOf(props.option)"
|
|
292
|
+
:key="tag"
|
|
293
|
+
type="button"
|
|
294
|
+
class="group/tag flex items-center gap-1 rounded-full bg-black/[0.06] px-2 py-0.5
|
|
295
|
+
text-[11px] text-muted transition-colors hover:text-highlighted dark:bg-white/[0.08]"
|
|
296
|
+
:aria-label="`Remove ${tag}`"
|
|
297
|
+
@click="removeTag(props.option, tag)"
|
|
298
|
+
>
|
|
299
|
+
{{ tag }}
|
|
300
|
+
<UIcon
|
|
301
|
+
name="i-lucide-x"
|
|
302
|
+
class="size-2.5 opacity-40 group-hover/tag:opacity-90"
|
|
303
|
+
/>
|
|
304
|
+
</button>
|
|
305
|
+
</div>
|
|
306
|
+
<input
|
|
307
|
+
type="text"
|
|
308
|
+
class="mt-1 w-full rounded-md bg-black/[0.04] px-2 py-1 text-xs text-highlighted
|
|
309
|
+
outline-none placeholder:text-dimmed dark:bg-white/[0.06]"
|
|
310
|
+
placeholder="add, separated by commas"
|
|
311
|
+
:aria-label="`Add to ${props.option.label}`"
|
|
312
|
+
spellcheck="false"
|
|
313
|
+
@change="addTags(props.option, $event)"
|
|
314
|
+
@keydown.enter.prevent="addTags(props.option, $event)"
|
|
315
|
+
>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
<div
|
|
319
|
+
v-else
|
|
320
|
+
class="flex items-center gap-2"
|
|
321
|
+
>
|
|
322
|
+
<UIcon
|
|
323
|
+
v-if="props.option.icon"
|
|
324
|
+
:name="props.option.icon"
|
|
325
|
+
class="size-3.5 shrink-0 text-dimmed"
|
|
326
|
+
/>
|
|
327
|
+
<span class="flex-1 text-[11px] text-muted">{{ props.option.label }}</span>
|
|
328
|
+
<USwitch
|
|
329
|
+
:model-value="values[props.option.key] === true"
|
|
330
|
+
size="xs"
|
|
331
|
+
color="neutral"
|
|
332
|
+
:aria-label="props.option.label"
|
|
333
|
+
@update:model-value="emit('set', props.option.key, $event)"
|
|
334
|
+
/>
|
|
335
|
+
</div>
|
|
336
|
+
</template>
|
|
337
|
+
|
|
338
|
+
<style scoped>
|
|
339
|
+
.jun-view-range{accent-color:currentColor;height:1rem}.jun-view-swatch{background:transparent;border:none;padding:0}.jun-view-swatch::-webkit-color-swatch-wrapper{padding:0}.jun-view-swatch::-webkit-color-swatch{border:1px solid color-mix(in srgb,currentColor 20%,transparent);border-radius:9999px}
|
|
340
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JunViewControl — ONE display setting, rendered as whatever kind it is.
|
|
3
|
+
*
|
|
4
|
+
* Ten kinds: `variant`, `select`, `order`, `number`, `range`, `color`, `text`,
|
|
5
|
+
* `tags`, `doc`, `toggle`. A renderer gains a control by adding a line to its
|
|
6
|
+
* spec in `utils/junViewSpecs.ts`; nothing here is per-renderer.
|
|
7
|
+
*
|
|
8
|
+
* Split out of `<JunViewControls>` when the settings modal needed the same
|
|
9
|
+
* controls WITHOUT a popover around them, to set the site-wide default for the
|
|
10
|
+
* same options. One implementation, two surfaces — the alternative was ten kinds
|
|
11
|
+
* written twice, which is the duplication the panel was extracted to end.
|
|
12
|
+
*
|
|
13
|
+
* Writes nothing itself: it emits, and `useJunViewOptions` owns the
|
|
14
|
+
* default-clearing rule that keeps a stored default from pinning a site's
|
|
15
|
+
* house style forever.
|
|
16
|
+
*/
|
|
17
|
+
import type { JunViewOption, JunViewValue } from '../composables/useJunViewOptions.js';
|
|
18
|
+
type __VLS_Props = {
|
|
19
|
+
option: JunViewOption;
|
|
20
|
+
/** Every resolved value, so a control can read its own by key. */
|
|
21
|
+
values: Record<string, JunViewValue>;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
24
|
+
set: (key: string, value: JunViewValue) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
onSet?: ((key: string, value: JunViewValue) => any) | undefined;
|
|
27
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { JunViewOption, JunViewValue } from '../composables/useJunViewOptions.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
options: JunViewOption[];
|
|
4
|
+
values: Record<string, JunViewValue>;
|
|
5
|
+
/** Nothing stored on the document: the page follows the site's own defaults. */
|
|
6
|
+
isDefault?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Render WITHOUT the popover — no trigger, no card.
|
|
9
|
+
*
|
|
10
|
+
* For the settings modal's *Renderers* section, which is already a panel: a
|
|
11
|
+
* popover inside a modal is a card inside a card.
|
|
12
|
+
*/
|
|
13
|
+
inline?: boolean;
|
|
14
|
+
/** Inline only: the heading over the controls. */
|
|
15
|
+
title?: string;
|
|
16
|
+
/** Inline only: what Reset says, since "Reset" alone is ambiguous there. */
|
|
17
|
+
resetLabel?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
set: (key: string, value: JunViewValue) => any;
|
|
21
|
+
reset: () => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
23
|
+
onSet?: ((key: string, value: JunViewValue) => any) | undefined;
|
|
24
|
+
onReset?: (() => any) | undefined;
|
|
25
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|