@abraca/junis 2.83.0 → 2.84.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/README.md +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +14 -2
- package/dist/runtime/components/JunCampfireChat.vue +6 -4
- package/dist/runtime/components/JunCampfireComposer.d.vue.ts +27 -0
- package/dist/runtime/components/JunCampfireComposer.vue +158 -0
- package/dist/runtime/components/JunCampfireComposer.vue.d.ts +27 -0
- package/dist/runtime/components/JunCampfirePanel.vue +8 -18
- package/dist/runtime/components/JunCampfirePresence.client.vue +102 -2
- package/dist/runtime/components/JunCampfireReactions.d.vue.ts +13 -0
- package/dist/runtime/components/JunCampfireReactions.vue +142 -0
- package/dist/runtime/components/JunCampfireReactions.vue.d.ts +13 -0
- package/dist/runtime/components/JunCampfireRoster.vue +82 -31
- package/dist/runtime/components/JunMosaicPane.client.d.vue.ts +9 -0
- package/dist/runtime/components/JunMosaicPane.client.vue +63 -3
- package/dist/runtime/components/JunMosaicPane.client.vue.d.ts +9 -0
- package/dist/runtime/components/JunStudioBar.client.vue +2 -1
- package/dist/runtime/components/renderers/JunMosaicRenderer.vue +14 -12
- package/dist/runtime/composables/useJunCampfire.d.ts +2 -0
- package/dist/runtime/composables/useJunCampfire.js +11 -1
- package/dist/runtime/composables/useJunDocMenu.d.ts +16 -1
- package/dist/runtime/composables/useJunDocMenu.js +8 -0
- package/dist/runtime/layouts/jun.vue +10 -0
- package/dist/runtime/types.d.ts +26 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -8,14 +8,14 @@ visitor interaction — all driven by documents rather than code.
|
|
|
8
8
|
> **Status: pre-1.0, and honest about it.** All **23** page types render and are
|
|
9
9
|
> exercised on every boot from an **empty database** — the playground ships no
|
|
10
10
|
> database, deliberately, because one that ships a database never proves its
|
|
11
|
-
> seeder works. A cold start seeds **
|
|
11
|
+
> seeder works. A cold start seeds **98 documents**, **34 bodies** and two
|
|
12
12
|
> generated photographs for the wall.
|
|
13
13
|
>
|
|
14
14
|
> Verified on every change, and these numbers are what the commands print:
|
|
15
15
|
>
|
|
16
16
|
> | | |
|
|
17
17
|
> |---|---|
|
|
18
|
-
> | `pnpm parity` | **
|
|
18
|
+
> | `pnpm parity` | **619** SSR assertions across all 23 types |
|
|
19
19
|
> | `pnpm parity:nav` | **56** assertions — the only check that catches broken client-side navigation |
|
|
20
20
|
> | `pnpm test` | **150** assertions, no server needed |
|
|
21
21
|
> | `pnpm lint` · `pnpm typecheck` | clean |
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -424,12 +424,21 @@ const DEFAULT_CAMPFIRE = {
|
|
|
424
424
|
roster: true,
|
|
425
425
|
identity: true,
|
|
426
426
|
reactions: true,
|
|
427
|
+
bubbles: true,
|
|
427
428
|
follow: true,
|
|
428
429
|
showPages: true,
|
|
429
430
|
showBots: false,
|
|
430
431
|
allowRename: true,
|
|
431
|
-
// Warmth, welcome, a
|
|
432
|
-
|
|
432
|
+
// The QUICK row — one press each, no picker. Warmth, welcome, agreement, a
|
|
433
|
+
// shared drink, and enough range that a passing traveller has something to
|
|
434
|
+
// say that is not just approval. Never sparkles.
|
|
435
|
+
//
|
|
436
|
+
// Eight rather than four: the footer row was laid out for eight from the
|
|
437
|
+
// start and shipped with half of them, so a visitor's whole vocabulary was
|
|
438
|
+
// fire, heart, wave, coffee. Anything beyond this row lives in the picker
|
|
439
|
+
// (`JunCampfireReactions`), which is the full set and always available —
|
|
440
|
+
// this is the shortcut, not the ceiling.
|
|
441
|
+
reactionSet: ["\u{1F525}", "\u2764\uFE0F", "\u{1F44B}", "\u2615", "\u{1F604}", "\u{1F389}", "\u{1F44F}", "\u{1F914}"],
|
|
433
442
|
historyLimit: 60,
|
|
434
443
|
placement: "bottom-right",
|
|
435
444
|
size: "md",
|
|
@@ -511,6 +520,9 @@ const module$1 = defineNuxtModule({
|
|
|
511
520
|
awareBlobs: true,
|
|
512
521
|
// Kept, deliberately unmounted — see runtime/types.ts for why.
|
|
513
522
|
peerCursors: false,
|
|
523
|
+
// ON: unlike cursors, this shows exactly one person's selection and only
|
|
524
|
+
// while you have chosen to follow them. That is company, not surveillance.
|
|
525
|
+
peerSelection: true,
|
|
514
526
|
travellersChip: false,
|
|
515
527
|
campfire: false,
|
|
516
528
|
studio: true,
|
|
@@ -122,12 +122,14 @@ onBeforeUnmount(() => {
|
|
|
122
122
|
<span>{{ sendError }}</span>
|
|
123
123
|
</p>
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
<!-- `JunCampfireComposer`, not `<AChatInput>`: that one is built for a
|
|
126
|
+
full-width panel and brought 62px of chrome and a primary-coloured
|
|
127
|
+
focus ring into a 320px monochrome surface. See its header. -->
|
|
128
|
+
<div class="px-1.5 pb-1.5">
|
|
129
|
+
<JunCampfireComposer
|
|
127
130
|
:autofocus="true"
|
|
128
|
-
:can-send="true"
|
|
129
131
|
:mention-users="mentionUsers"
|
|
130
|
-
:placeholder="`
|
|
132
|
+
:placeholder="`say something to ${place}\u2026`"
|
|
131
133
|
@send="onSend"
|
|
132
134
|
@typing="typing()"
|
|
133
135
|
/>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
placeholder?: string;
|
|
3
|
+
/** Live peers, for `@` completion. Bots included — you may want to address one. */
|
|
4
|
+
mentionUsers?: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
isAgent?: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
autofocus?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
send: (content: string) => any;
|
|
13
|
+
typing: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onSend?: ((content: string) => any) | undefined;
|
|
16
|
+
onTyping?: (() => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
autofocus: boolean;
|
|
19
|
+
mentionUsers: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
isAgent?: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
placeholder: string;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
placeholder: { type: String, required: false, default: "say something\u2026" },
|
|
5
|
+
mentionUsers: { type: Array, required: false, default: () => [] },
|
|
6
|
+
autofocus: { type: Boolean, required: false, default: false }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["send", "typing"]);
|
|
9
|
+
const draft = ref("");
|
|
10
|
+
const inputEl = ref(null);
|
|
11
|
+
const MAX_ROWS_PX = 84;
|
|
12
|
+
function autoGrow() {
|
|
13
|
+
const el = inputEl.value;
|
|
14
|
+
if (!el) return;
|
|
15
|
+
el.style.height = "auto";
|
|
16
|
+
el.style.height = `${Math.min(el.scrollHeight, MAX_ROWS_PX)}px`;
|
|
17
|
+
}
|
|
18
|
+
const canSend = computed(() => draft.value.trim().length > 0);
|
|
19
|
+
function send() {
|
|
20
|
+
const text = draft.value.trim();
|
|
21
|
+
if (!text) return;
|
|
22
|
+
emit("send", text);
|
|
23
|
+
draft.value = "";
|
|
24
|
+
closeMentions();
|
|
25
|
+
void nextTick(autoGrow);
|
|
26
|
+
}
|
|
27
|
+
const mentionOpen = ref(false);
|
|
28
|
+
const mentionQuery = ref("");
|
|
29
|
+
const mentionIndex = ref(0);
|
|
30
|
+
const mentionMatches = computed(() => {
|
|
31
|
+
if (!mentionOpen.value) return [];
|
|
32
|
+
const q = mentionQuery.value.toLowerCase();
|
|
33
|
+
return props.mentionUsers.filter((u) => !q || u.name.toLowerCase().includes(q)).slice(0, 6);
|
|
34
|
+
});
|
|
35
|
+
function closeMentions() {
|
|
36
|
+
mentionOpen.value = false;
|
|
37
|
+
mentionQuery.value = "";
|
|
38
|
+
mentionIndex.value = 0;
|
|
39
|
+
}
|
|
40
|
+
function syncMentions() {
|
|
41
|
+
const el = inputEl.value;
|
|
42
|
+
if (!el) return;
|
|
43
|
+
const upto = draft.value.slice(0, el.selectionStart ?? draft.value.length);
|
|
44
|
+
const m = /(?:^|\s)@([^\s@]*)$/.exec(upto);
|
|
45
|
+
if (!m) return closeMentions();
|
|
46
|
+
mentionOpen.value = true;
|
|
47
|
+
mentionQuery.value = m[1] ?? "";
|
|
48
|
+
mentionIndex.value = 0;
|
|
49
|
+
}
|
|
50
|
+
function acceptMention(name) {
|
|
51
|
+
const el = inputEl.value;
|
|
52
|
+
const caret = el?.selectionStart ?? draft.value.length;
|
|
53
|
+
const before = draft.value.slice(0, caret).replace(/(?:^|\s)@([^\s@]*)$/, (s) => `${s.startsWith("@") ? "" : s[0]}@${name} `);
|
|
54
|
+
draft.value = before + draft.value.slice(caret);
|
|
55
|
+
closeMentions();
|
|
56
|
+
void nextTick(() => {
|
|
57
|
+
el?.focus();
|
|
58
|
+
const at = before.length;
|
|
59
|
+
el?.setSelectionRange(at, at);
|
|
60
|
+
autoGrow();
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function onInput() {
|
|
64
|
+
autoGrow();
|
|
65
|
+
syncMentions();
|
|
66
|
+
emit("typing");
|
|
67
|
+
}
|
|
68
|
+
function onKeydown(e) {
|
|
69
|
+
if (mentionOpen.value && mentionMatches.value.length) {
|
|
70
|
+
if (e.key === "ArrowDown") {
|
|
71
|
+
e.preventDefault();
|
|
72
|
+
mentionIndex.value = (mentionIndex.value + 1) % mentionMatches.value.length;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (e.key === "ArrowUp") {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
mentionIndex.value = (mentionIndex.value - 1 + mentionMatches.value.length) % mentionMatches.value.length;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (e.key === "Enter" || e.key === "Tab") {
|
|
81
|
+
e.preventDefault();
|
|
82
|
+
acceptMention(mentionMatches.value[mentionIndex.value].name);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (e.key === "Escape") {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
closeMentions();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
92
|
+
e.preventDefault();
|
|
93
|
+
send();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<div class="jun-campfire-composer relative flex items-end gap-1 px-2.5 py-1.5">
|
|
100
|
+
<!-- Mentions. Anchored to the composer and floating ABOVE it: the panel
|
|
101
|
+
clips, so a list opening downward would be cut off by the footer. -->
|
|
102
|
+
<div
|
|
103
|
+
v-if="mentionOpen && mentionMatches.length"
|
|
104
|
+
class="jun-campfire-mentions absolute right-2 bottom-full left-2 mb-1 overflow-hidden rounded-lg"
|
|
105
|
+
>
|
|
106
|
+
<button
|
|
107
|
+
v-for="(u, i) in mentionMatches"
|
|
108
|
+
:key="u.id"
|
|
109
|
+
type="button"
|
|
110
|
+
class="jun-campfire-mention flex w-full items-center gap-1.5 px-2.5 py-1 text-left text-xs"
|
|
111
|
+
:class="i === mentionIndex ? 'is-on' : ''"
|
|
112
|
+
@mousedown.prevent="acceptMention(u.name)"
|
|
113
|
+
>
|
|
114
|
+
<span class="truncate text-neutral-700 dark:text-neutral-200">{{ u.name }}</span>
|
|
115
|
+
<span
|
|
116
|
+
v-if="u.isAgent"
|
|
117
|
+
class="text-[9px] tracking-wide text-neutral-400 dark:text-neutral-500"
|
|
118
|
+
>bot</span>
|
|
119
|
+
</button>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<textarea
|
|
123
|
+
ref="inputEl"
|
|
124
|
+
v-model="draft"
|
|
125
|
+
rows="1"
|
|
126
|
+
:placeholder="placeholder"
|
|
127
|
+
:autofocus="autofocus"
|
|
128
|
+
class="jun-campfire-field max-h-[84px] min-h-[1.75rem] flex-1 resize-none bg-transparent py-1
|
|
129
|
+
text-xs leading-snug text-neutral-800 outline-none placeholder:text-neutral-400
|
|
130
|
+
dark:text-neutral-100 dark:placeholder:text-neutral-500"
|
|
131
|
+
@input="onInput"
|
|
132
|
+
@keydown="onKeydown"
|
|
133
|
+
@blur="closeMentions"
|
|
134
|
+
/>
|
|
135
|
+
|
|
136
|
+
<!-- Only when there is something to send. A permanently-lit send button on
|
|
137
|
+
an empty composer is a control that does nothing, taking the eye. -->
|
|
138
|
+
<Transition name="jun-campfire-send">
|
|
139
|
+
<button
|
|
140
|
+
v-if="canSend"
|
|
141
|
+
type="button"
|
|
142
|
+
class="jun-campfire-send mb-0.5 flex size-6 shrink-0 items-center justify-center rounded-md
|
|
143
|
+
text-neutral-500 dark:text-neutral-400"
|
|
144
|
+
aria-label="Send"
|
|
145
|
+
@click="send()"
|
|
146
|
+
>
|
|
147
|
+
<UIcon
|
|
148
|
+
name="i-lucide-arrow-up"
|
|
149
|
+
class="size-3.5"
|
|
150
|
+
/>
|
|
151
|
+
</button>
|
|
152
|
+
</Transition>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<style scoped>
|
|
157
|
+
.jun-campfire-composer{border-radius:.625rem;transition:background-color .2s ease}.jun-campfire-composer:focus-within{background:rgba(0,0,0,.04)}:root.dark .jun-campfire-composer:focus-within{background:hsla(0,0%,100%,.06)}.jun-campfire-field{scrollbar-width:none}.jun-campfire-field::-webkit-scrollbar{display:none}.jun-campfire-send{transition:background-color .2s ease,color .2s ease}.jun-campfire-send:hover{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-send:hover{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}.jun-campfire-send-enter-active,.jun-campfire-send-leave-active{transition:opacity .15s ease,transform .15s cubic-bezier(.22,1,.36,1)}.jun-campfire-send-enter-from,.jun-campfire-send-leave-to{opacity:0;transform:scale(.8)}.jun-campfire-mentions{background:var(--color-white);box-shadow:0 8px 24px rgba(0,0,0,.12),inset 0 0 0 1px rgba(0,0,0,.08)}:root.dark .jun-campfire-mentions{background:var(--color-neutral-900);box-shadow:0 8px 24px rgba(0,0,0,.4),inset 0 0 0 1px hsla(0,0%,100%,.12)}.jun-campfire-mention.is-on{background:rgba(0,0,0,.06)}:root.dark .jun-campfire-mention.is-on{background:hsla(0,0%,100%,.08)}@media (prefers-reduced-motion:reduce){.jun-campfire-composer,.jun-campfire-send,.jun-campfire-send-enter-active,.jun-campfire-send-leave-active{transition:none}.jun-campfire-send-enter-from,.jun-campfire-send-leave-to{transform:none}}
|
|
158
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
placeholder?: string;
|
|
3
|
+
/** Live peers, for `@` completion. Bots included — you may want to address one. */
|
|
4
|
+
mentionUsers?: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
isAgent?: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
autofocus?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
send: (content: string) => any;
|
|
13
|
+
typing: () => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onSend?: ((content: string) => any) | undefined;
|
|
16
|
+
onTyping?: (() => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
autofocus: boolean;
|
|
19
|
+
mentionUsers: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
isAgent?: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
placeholder: string;
|
|
25
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -176,27 +176,17 @@ const bodyClass = "jun-scrollbar-hide min-h-0 flex-1 overflow-y-auto";
|
|
|
176
176
|
/>
|
|
177
177
|
</div>
|
|
178
178
|
|
|
179
|
-
<!-- Reactions — a gesture at the fire, on every tab.
|
|
180
|
-
|
|
179
|
+
<!-- Reactions — a gesture at the fire, on every tab. The quick row is the
|
|
180
|
+
owner's set; `+` opens the rest. See `JunCampfireReactions`. -->
|
|
181
|
+
<JunCampfireReactions
|
|
181
182
|
v-if="settings.reactions"
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
:key="r"
|
|
187
|
-
type="button"
|
|
188
|
-
:data-jun-action="`react:${r}`"
|
|
189
|
-
class="jun-campfire-react inline-flex size-8 items-center justify-center rounded-lg text-base"
|
|
190
|
-
:class="hot === `react:${r}` ? 'is-hot' : ''"
|
|
191
|
-
:aria-label="`React ${r}`"
|
|
192
|
-
@click="emit('react', r)"
|
|
193
|
-
>
|
|
194
|
-
{{ r }}
|
|
195
|
-
</button>
|
|
196
|
-
</div>
|
|
183
|
+
:set="settings.reactionSet"
|
|
184
|
+
:hot="hot"
|
|
185
|
+
@react="emit('react', $event)"
|
|
186
|
+
/>
|
|
197
187
|
</div>
|
|
198
188
|
</template>
|
|
199
189
|
|
|
200
190
|
<style scoped>
|
|
201
|
-
.jun-campfire-panel.is-sm{max-height:min(27.5rem,calc(100dvh - 9rem));min-height:min(13rem,calc(100dvh - 9rem));width:min(17rem,calc(100vw - 2rem))}.jun-campfire-panel.is-md{max-height:min(32.375rem,calc(100dvh - 9rem));min-height:min(14.5rem,calc(100dvh - 9rem));width:min(20rem,calc(100vw - 2rem))}.jun-campfire-panel.is-lg{max-height:min(37.25rem,calc(100dvh - 9rem));min-height:min(16rem,calc(100dvh - 9rem));width:min(23rem,calc(100vw - 2rem))}.jun-campfire-panel.is-blurred{backdrop-filter:blur(24px);background:hsla(0,0%,100%,.7)}:root.dark .jun-campfire-panel.is-blurred{background:color-mix(in srgb,var(--color-neutral-900) 70%,transparent)}.jun-campfire-panel.is-opaque{background:hsla(0,0%,100%,.97)}:root.dark .jun-campfire-panel.is-opaque{background:color-mix(in srgb,var(--color-neutral-900) 97%,transparent)}.jun-campfire-tab{color:var(--color-neutral-500);transition:background-color .2s ease,color .2s ease}:root.dark .jun-campfire-tab{color:var(--color-neutral-400)}.jun-campfire-tab:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-tab:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-tab.is-on{background:rgba(0,0,0,.06);color:var(--color-neutral-900)}:root.dark .jun-campfire-tab.is-on{background:hsla(0,0%,100%,.09);color:var(--color-neutral-100)}.jun-campfire-unread{background:rgba(0,0,0,.55);border-radius:999px;color:#fff;font-size:9px;font-variant-numeric:tabular-nums;line-height:.9rem;min-width:.9rem;padding:0 .2rem;position:absolute;right:.35rem;top:.1rem}:root.dark .jun-campfire-unread{background:hsla(0,0%,100%,.65);color:var(--color-neutral-900)}.jun-campfire-unread.is-ember{background:var(--jun-ember);color:#fff}.jun-campfire-close{transition:background-color .2s ease,color .2s ease}.jun-campfire-close:hover{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-close:hover{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}
|
|
191
|
+
.jun-campfire-panel.is-sm{max-height:min(27.5rem,calc(100dvh - 9rem));min-height:min(13rem,calc(100dvh - 9rem));width:min(17rem,calc(100vw - 2rem))}.jun-campfire-panel.is-md{max-height:min(32.375rem,calc(100dvh - 9rem));min-height:min(14.5rem,calc(100dvh - 9rem));width:min(20rem,calc(100vw - 2rem))}.jun-campfire-panel.is-lg{max-height:min(37.25rem,calc(100dvh - 9rem));min-height:min(16rem,calc(100dvh - 9rem));width:min(23rem,calc(100vw - 2rem))}.jun-campfire-panel.is-blurred{backdrop-filter:blur(24px);background:hsla(0,0%,100%,.7)}:root.dark .jun-campfire-panel.is-blurred{background:color-mix(in srgb,var(--color-neutral-900) 70%,transparent)}.jun-campfire-panel.is-opaque{background:hsla(0,0%,100%,.97)}:root.dark .jun-campfire-panel.is-opaque{background:color-mix(in srgb,var(--color-neutral-900) 97%,transparent)}.jun-campfire-tab{color:var(--color-neutral-500);transition:background-color .2s ease,color .2s ease}:root.dark .jun-campfire-tab{color:var(--color-neutral-400)}.jun-campfire-tab:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-tab:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-tab.is-on{background:rgba(0,0,0,.06);color:var(--color-neutral-900)}:root.dark .jun-campfire-tab.is-on{background:hsla(0,0%,100%,.09);color:var(--color-neutral-100)}.jun-campfire-unread{background:rgba(0,0,0,.55);border-radius:999px;color:#fff;font-size:9px;font-variant-numeric:tabular-nums;line-height:.9rem;min-width:.9rem;padding:0 .2rem;position:absolute;right:.35rem;top:.1rem}:root.dark .jun-campfire-unread{background:hsla(0,0%,100%,.65);color:var(--color-neutral-900)}.jun-campfire-unread.is-ember{background:var(--jun-ember);color:#fff}.jun-campfire-close{transition:background-color .2s ease,color .2s ease}.jun-campfire-close:hover{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-close:hover{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}@media (prefers-reduced-motion:reduce){.jun-campfire-close,.jun-campfire-tab{transition:none}}
|
|
202
192
|
</style>
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
useJunPressDrag,
|
|
15
15
|
useJunStudio
|
|
16
16
|
} from "#imports";
|
|
17
|
-
import { junCampfireLabel } from "../composables/useJunCampfire";
|
|
17
|
+
import { junCampfireLabel, useJunCampfireNames } from "../composables/useJunCampfire";
|
|
18
18
|
const settings = useJunCampfireSettings();
|
|
19
19
|
const abra = useAbracadabra();
|
|
20
20
|
const { others, self, everyone } = useJunCampfirePeople();
|
|
@@ -86,6 +86,9 @@ const emberStyle = computed(() => ({
|
|
|
86
86
|
"--jun-bar-stack": `calc(${stack.value} + 2.5rem)`,
|
|
87
87
|
"--jun-bar-inset": "2.5rem"
|
|
88
88
|
}));
|
|
89
|
+
const bubbleStyle = computed(() => ({
|
|
90
|
+
"--jun-bar-stack": `calc(${stack.value} + var(--jun-hearth-h, 0px) + 0.5rem${isFollowing.value && followingUser.value ? " + 2.25rem" : ""})`
|
|
91
|
+
}));
|
|
89
92
|
const PILL_SIZE = {
|
|
90
93
|
sm: "gap-2 py-1 pr-3 pl-2 text-[11px]",
|
|
91
94
|
md: "gap-2.5 py-1.5 pr-3.5 pl-2.5 text-xs",
|
|
@@ -134,6 +137,69 @@ watch(
|
|
|
134
137
|
},
|
|
135
138
|
{ immediate: true }
|
|
136
139
|
);
|
|
140
|
+
const BUBBLE_TTL = 12e3;
|
|
141
|
+
const BUBBLE_MAX = 3;
|
|
142
|
+
const BUBBLE_CHARS = 90;
|
|
143
|
+
const bubbles = ref([]);
|
|
144
|
+
const bubbleTimers = /* @__PURE__ */ new Map();
|
|
145
|
+
const { nameFor } = useJunCampfireNames();
|
|
146
|
+
function dropBubble(key) {
|
|
147
|
+
const t = bubbleTimers.get(key);
|
|
148
|
+
if (t) clearTimeout(t);
|
|
149
|
+
bubbleTimers.delete(key);
|
|
150
|
+
bubbles.value = bubbles.value.filter((b) => b.key !== key);
|
|
151
|
+
}
|
|
152
|
+
function pushBubble(b) {
|
|
153
|
+
bubbles.value = [...bubbles.value, b].slice(-BUBBLE_MAX);
|
|
154
|
+
bubbleTimers.set(b.key, setTimeout(() => dropBubble(b.key), BUBBLE_TTL));
|
|
155
|
+
}
|
|
156
|
+
function clearBubbles() {
|
|
157
|
+
for (const t of bubbleTimers.values()) clearTimeout(t);
|
|
158
|
+
bubbleTimers.clear();
|
|
159
|
+
bubbles.value = [];
|
|
160
|
+
}
|
|
161
|
+
function speaker(senderId, fallbackName) {
|
|
162
|
+
const person = others.value.find((p) => p.publicKey === senderId);
|
|
163
|
+
return {
|
|
164
|
+
name: person?.name || fallbackName || nameFor(senderId),
|
|
165
|
+
color: person?.color || "var(--ui-text-muted)"
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const arrivedAt = Date.now();
|
|
169
|
+
const bubbledKeys = /* @__PURE__ */ new Set();
|
|
170
|
+
watch(
|
|
171
|
+
() => channelDocId.value ? messagesByChannel.value[channelDocId.value] : void 0,
|
|
172
|
+
(list) => {
|
|
173
|
+
if (!list?.length) return;
|
|
174
|
+
const mine = abra.publicKeyB64.value;
|
|
175
|
+
for (const m of list) {
|
|
176
|
+
const key = m.id || `${m.senderId}:${m.createdAt}`;
|
|
177
|
+
if (bubbledKeys.has(key)) continue;
|
|
178
|
+
bubbledKeys.add(key);
|
|
179
|
+
if (m.senderId === mine || m.createdAt <= arrivedAt) continue;
|
|
180
|
+
if (!settings.value.bubbles || open.value) continue;
|
|
181
|
+
const text = String(m.content ?? "").trim();
|
|
182
|
+
if (!text) continue;
|
|
183
|
+
const who = speaker(m.senderId, m.senderName);
|
|
184
|
+
pushBubble({
|
|
185
|
+
key,
|
|
186
|
+
name: who.name,
|
|
187
|
+
color: who.color,
|
|
188
|
+
text: text.length > BUBBLE_CHARS ? `${text.slice(0, BUBBLE_CHARS - 1)}\u2026` : text
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
{ deep: true }
|
|
193
|
+
);
|
|
194
|
+
watch(open, (isOpen) => {
|
|
195
|
+
if (isOpen) clearBubbles();
|
|
196
|
+
});
|
|
197
|
+
function openFromBubble() {
|
|
198
|
+
clearBubbles();
|
|
199
|
+
wantedTab.value = "fire";
|
|
200
|
+
open.value = true;
|
|
201
|
+
markRead();
|
|
202
|
+
}
|
|
137
203
|
const { peers: peerReactions, setLocal } = useAAEphemeral("campfire:react");
|
|
138
204
|
const EMBER_TTL = 1900;
|
|
139
205
|
const embers = [];
|
|
@@ -223,6 +289,40 @@ onBeforeUnmount(() => {
|
|
|
223
289
|
/>
|
|
224
290
|
</Transition>
|
|
225
291
|
|
|
292
|
+
<!-- Speech bubbles. They occupy the same corner slot the panel would, so
|
|
293
|
+
they read as the panel's quiet form rather than as a separate widget
|
|
294
|
+
— and they clear the follow banner when both are up. -->
|
|
295
|
+
<TransitionGroup
|
|
296
|
+
v-if="bubbles.length && !open"
|
|
297
|
+
name="jun-campfire-bubble"
|
|
298
|
+
tag="div"
|
|
299
|
+
class="jun-bar jun-campfire-bubbles"
|
|
300
|
+
:data-jun-corner="corner"
|
|
301
|
+
:style="bubbleStyle"
|
|
302
|
+
>
|
|
303
|
+
<button
|
|
304
|
+
v-for="b in bubbles"
|
|
305
|
+
:key="b.key"
|
|
306
|
+
type="button"
|
|
307
|
+
class="jun-bar-pill jun-chrome jun-campfire-bubble gap-2 rounded-2xl py-1.5 pr-3 pl-2.5"
|
|
308
|
+
:aria-label="`${b.name}: ${b.text}. Open ${settings.title}`"
|
|
309
|
+
@click="openFromBubble()"
|
|
310
|
+
>
|
|
311
|
+
<span
|
|
312
|
+
class="jun-campfire-bubble-mark mt-0.5 size-2 shrink-0 rounded-full"
|
|
313
|
+
:style="{ background: b.color }"
|
|
314
|
+
/>
|
|
315
|
+
<span class="min-w-0 text-left">
|
|
316
|
+
<span
|
|
317
|
+
class="block truncate text-[10px] tracking-wide text-neutral-400 dark:text-neutral-500"
|
|
318
|
+
>{{ b.name }}</span>
|
|
319
|
+
<span
|
|
320
|
+
class="block text-xs leading-snug text-neutral-700 dark:text-neutral-200"
|
|
321
|
+
>{{ b.text }}</span>
|
|
322
|
+
</span>
|
|
323
|
+
</button>
|
|
324
|
+
</TransitionGroup>
|
|
325
|
+
|
|
226
326
|
<Transition name="jun-campfire-rise">
|
|
227
327
|
<button
|
|
228
328
|
v-if="isFollowing && followingUser && !open"
|
|
@@ -317,5 +417,5 @@ onBeforeUnmount(() => {
|
|
|
317
417
|
</template>
|
|
318
418
|
|
|
319
419
|
<style scoped>
|
|
320
|
-
.jun-campfire-pill{transition:transform .5s cubic-bezier(.22,1,.36,1)}.jun-campfire-pill:hover{transform:scale(1.03)}.jun-campfire-pill:active{transform:scale(.97)}.jun-campfire-pill.is-static{cursor:default}.jun-campfire-pill.is-static:hover{transform:none}.jun-campfire-badge{background:var(--color-neutral-900);border-radius:999px;color:#fff;font-size:9px;font-variant-numeric:tabular-nums;font-weight:500;line-height:.95rem;min-width:.95rem;padding:0 .2rem;position:absolute;right:-.35rem;top:-.25rem}:root.dark .jun-campfire-badge{background:var(--color-neutral-100);color:var(--color-neutral-900)}.jun-campfire-badge.is-ember{background:var(--jun-ember);color:#fff}.jun-campfire-glow{animation:jun-campfire-breathe 3.2s ease-in-out infinite;background:radial-gradient(circle at 50% 55%,color-mix(in srgb,var(--jun-ember-glow) 55%,transparent),color-mix(in srgb,var(--jun-ember) 18%,transparent) 55%,transparent 72%)}@keyframes jun-campfire-breathe{0%,to{opacity:.5;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}.jun-campfire-floater{animation:jun-campfire-float 1.9s cubic-bezier(.22,1,.36,1) forwards;bottom:0;filter:drop-shadow(0 0 8px currentColor);font-size:1.25rem;position:absolute;right:0}@keyframes jun-campfire-float{0%{opacity:0;transform:translate(0) scale(.6)}18%{opacity:1;transform:translate(var(--dx),-1.5rem) scale(1.1)}to{opacity:0;transform:translate(calc(var(--dx)*1.6),-7.5rem) scale(.8)}}.jun-campfire-rise-enter-active,.jun-campfire-rise-leave-active{transition:opacity .28s ease,transform .28s cubic-bezier(.22,1,.36,1)}.jun-campfire-rise-enter-from,.jun-campfire-rise-leave-to{opacity:0;transform:translateY(12px) scale(.98)}@media (prefers-reduced-motion:reduce){.jun-campfire-glow{animation:none;opacity:.7}.jun-campfire-floater{animation-duration:1.2s}.jun-campfire-pill{transition:none}.jun-campfire-pill:hover{transform:none}.jun-campfire-rise-enter-active,.jun-campfire-rise-leave-active{transition:opacity .2s ease}.jun-campfire-rise-enter-from,.jun-campfire-rise-leave-to{transform:none}}
|
|
420
|
+
.jun-campfire-pill{transition:transform .5s cubic-bezier(.22,1,.36,1)}.jun-campfire-pill:hover{transform:scale(1.03)}.jun-campfire-pill:active{transform:scale(.97)}.jun-campfire-pill.is-static{cursor:default}.jun-campfire-pill.is-static:hover{transform:none}.jun-campfire-badge{background:var(--color-neutral-900);border-radius:999px;color:#fff;font-size:9px;font-variant-numeric:tabular-nums;font-weight:500;line-height:.95rem;min-width:.95rem;padding:0 .2rem;position:absolute;right:-.35rem;top:-.25rem}:root.dark .jun-campfire-badge{background:var(--color-neutral-100);color:var(--color-neutral-900)}.jun-campfire-badge.is-ember{background:var(--jun-ember);color:#fff}.jun-campfire-glow{animation:jun-campfire-breathe 3.2s ease-in-out infinite;background:radial-gradient(circle at 50% 55%,color-mix(in srgb,var(--jun-ember-glow) 55%,transparent),color-mix(in srgb,var(--jun-ember) 18%,transparent) 55%,transparent 72%)}@keyframes jun-campfire-breathe{0%,to{opacity:.5;transform:scale(.9)}50%{opacity:1;transform:scale(1.15)}}.jun-campfire-floater{animation:jun-campfire-float 1.9s cubic-bezier(.22,1,.36,1) forwards;bottom:0;filter:drop-shadow(0 0 8px currentColor);font-size:1.25rem;position:absolute;right:0}@keyframes jun-campfire-float{0%{opacity:0;transform:translate(0) scale(.6)}18%{opacity:1;transform:translate(var(--dx),-1.5rem) scale(1.1)}to{opacity:0;transform:translate(calc(var(--dx)*1.6),-7.5rem) scale(.8)}}.jun-campfire-rise-enter-active,.jun-campfire-rise-leave-active{transition:opacity .28s ease,transform .28s cubic-bezier(.22,1,.36,1)}.jun-campfire-rise-enter-from,.jun-campfire-rise-leave-to{opacity:0;transform:translateY(12px) scale(.98)}.jun-campfire-bubbles{align-items:flex-end;display:flex;flex-direction:column-reverse;gap:.375rem;max-width:min(19rem,calc(100vw - 2rem));pointer-events:none}[data-jun-corner^=top].jun-campfire-bubbles{flex-direction:column}.jun-campfire-bubble,[data-jun-corner$=left].jun-campfire-bubbles{align-items:flex-start}.jun-campfire-bubble{display:flex;max-width:100%;pointer-events:auto;text-align:left;transition:transform .2s cubic-bezier(.22,1,.36,1)}.jun-campfire-bubble:hover{transform:translateY(-1px)}.jun-campfire-bubble span>span:last-child{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}.jun-campfire-bubble-enter-active,.jun-campfire-bubble-leave-active{transition:opacity .3s ease,transform .3s cubic-bezier(.22,1,.36,1)}.jun-campfire-bubble-enter-from,.jun-campfire-bubble-leave-to{opacity:0;transform:translateY(8px) scale(.96)}.jun-campfire-bubble-move{transition:transform .3s cubic-bezier(.22,1,.36,1)}@media (prefers-reduced-motion:reduce){.jun-campfire-glow{animation:none;opacity:.7}.jun-campfire-floater{animation-duration:1.2s}.jun-campfire-pill{transition:none}.jun-campfire-pill:hover{transform:none}.jun-campfire-rise-enter-active,.jun-campfire-rise-leave-active{transition:opacity .2s ease}.jun-campfire-rise-enter-from,.jun-campfire-rise-leave-to{transform:none}.jun-campfire-bubble,.jun-campfire-bubble-move{transition:none}.jun-campfire-bubble:hover{transform:none}.jun-campfire-bubble-enter-active,.jun-campfire-bubble-leave-active{transition:opacity .2s ease}.jun-campfire-bubble-enter-from,.jun-campfire-bubble-leave-to{transform:none}}
|
|
321
421
|
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The owner's quick row, already validated and capped. */
|
|
3
|
+
set: string[];
|
|
4
|
+
/** The action key under a dragging pointer — see `useJunPressDrag`. */
|
|
5
|
+
hot?: string | null;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
react: (emoji: string) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onReact?: ((emoji: string) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
set: { type: Array, required: true },
|
|
5
|
+
hot: { type: [String, null], required: false }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["react"]);
|
|
8
|
+
const GROUPS = [
|
|
9
|
+
{ label: "Warmth", emoji: ["\u{1F525}", "\u2728", "\u2B50", "\u{1F31F}", "\u{1F4AB}", "\u{1F389}", "\u{1F38A}", "\u{1F973}"] },
|
|
10
|
+
{ label: "Faces", emoji: ["\u{1F604}", "\u{1F60A}", "\u{1F642}", "\u{1F60D}", "\u{1F929}", "\u{1F602}", "\u{1F972}", "\u{1F62E}", "\u{1F914}", "\u{1F605}", "\u{1F634}", "\u{1FAE0}"] },
|
|
11
|
+
{ label: "Hands", emoji: ["\u{1F44B}", "\u{1F44F}", "\u{1F64C}", "\u{1F91D}", "\u{1F44D}", "\u{1F44C}", "\u{1F919}", "\u270C\uFE0F", "\u{1F64F}", "\u{1F4AA}"] },
|
|
12
|
+
{ label: "Hearts", emoji: ["\u2764\uFE0F", "\u{1F9E1}", "\u{1F49B}", "\u{1F49A}", "\u{1F499}", "\u{1F49C}", "\u{1F5A4}", "\u{1F90D}", "\u{1F496}", "\u{1F494}"] },
|
|
13
|
+
{ label: "Around", emoji: ["\u2615", "\u{1F375}", "\u{1F37A}", "\u{1F377}", "\u{1F370}", "\u{1F355}", "\u{1F319}", "\u2600\uFE0F", "\u{1F327}\uFE0F", "\u{1F30A}", "\u{1F331}", "\u{1F342}"] },
|
|
14
|
+
{ label: "Marks", emoji: ["\u{1F440}", "\u{1F4A1}", "\u{1F4CC}", "\u{1F516}", "\u{1F3A7}", "\u{1F4F7}", "\u270F\uFE0F", "\u{1F9ED}", "\u{1F5FA}\uFE0F", "\u{1F56F}\uFE0F"] }
|
|
15
|
+
];
|
|
16
|
+
const RECENT_KEY = "jun:campfire:reactions";
|
|
17
|
+
const RECENT_CAP = 8;
|
|
18
|
+
function loadRecent() {
|
|
19
|
+
if (typeof localStorage === "undefined") return [];
|
|
20
|
+
try {
|
|
21
|
+
const raw = JSON.parse(localStorage.getItem(RECENT_KEY) || "[]");
|
|
22
|
+
return Array.isArray(raw) ? raw.filter((e) => typeof e === "string") : [];
|
|
23
|
+
} catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const recent = ref(loadRecent());
|
|
28
|
+
function remember(emoji) {
|
|
29
|
+
recent.value = [emoji, ...recent.value.filter((e) => e !== emoji)].slice(0, RECENT_CAP);
|
|
30
|
+
if (typeof localStorage === "undefined") return;
|
|
31
|
+
try {
|
|
32
|
+
localStorage.setItem(RECENT_KEY, JSON.stringify(recent.value));
|
|
33
|
+
} catch {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const shownRecent = computed(() => recent.value.filter((e) => !props.set.includes(e)));
|
|
37
|
+
const open = ref(false);
|
|
38
|
+
function pick(emoji) {
|
|
39
|
+
remember(emoji);
|
|
40
|
+
emit("react", emoji);
|
|
41
|
+
open.value = false;
|
|
42
|
+
}
|
|
43
|
+
function quick(emoji) {
|
|
44
|
+
emit("react", emoji);
|
|
45
|
+
}
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div
|
|
50
|
+
class="flex items-center gap-1.5 border-t border-neutral-900/5 px-3 py-2 dark:border-white/10"
|
|
51
|
+
>
|
|
52
|
+
<!-- ONE row, always. The panel is 17–23rem wide and its proportions are
|
|
53
|
+
load-bearing (see the golden-ratio note in `JunCampfirePanel`), so a
|
|
54
|
+
quick row that wrapped to a second line took 35px off the roster and
|
|
55
|
+
the chat at every size.
|
|
56
|
+
`size-7` + `gap-1` rather than the `size-8` + `gap-1.5` this row wore
|
|
57
|
+
when it held four: eight buttons and `+` measure 284px against the
|
|
58
|
+
296px a `md` panel has to give, so the default set fits whole at `md`
|
|
59
|
+
and `lg`. Only `sm` scrolls, and a twelve-emoji set scrolls everywhere
|
|
60
|
+
— which is why the strip scrolls at all rather than assuming. -->
|
|
61
|
+
<div class="jun-scrollbar-hide flex min-w-0 flex-1 items-center gap-1 overflow-x-auto">
|
|
62
|
+
<button
|
|
63
|
+
v-for="r in set"
|
|
64
|
+
:key="r"
|
|
65
|
+
type="button"
|
|
66
|
+
:data-jun-action="`react:${r}`"
|
|
67
|
+
class="jun-campfire-react inline-flex size-7 shrink-0 items-center justify-center rounded-lg
|
|
68
|
+
text-base"
|
|
69
|
+
:class="hot === `react:${r}` ? 'is-hot' : ''"
|
|
70
|
+
:aria-label="`React ${r}`"
|
|
71
|
+
@click="quick(r)"
|
|
72
|
+
>
|
|
73
|
+
{{ r }}
|
|
74
|
+
</button>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<UPopover
|
|
78
|
+
v-model:open="open"
|
|
79
|
+
:content="{ side: 'top', align: 'end' }"
|
|
80
|
+
>
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
class="jun-campfire-react jun-campfire-more inline-flex size-7 shrink-0 items-center
|
|
84
|
+
justify-center rounded-lg text-neutral-400 dark:text-neutral-500"
|
|
85
|
+
:class="open ? 'is-on' : ''"
|
|
86
|
+
aria-label="More reactions"
|
|
87
|
+
>
|
|
88
|
+
<UIcon
|
|
89
|
+
name="i-lucide-smile-plus"
|
|
90
|
+
class="size-4"
|
|
91
|
+
/>
|
|
92
|
+
</button>
|
|
93
|
+
|
|
94
|
+
<template #content>
|
|
95
|
+
<div class="jun-campfire-picker jun-scrollbar-hide max-h-72 w-64 overflow-y-auto p-2">
|
|
96
|
+
<template v-if="shownRecent.length">
|
|
97
|
+
<p class="jun-campfire-picker-label">
|
|
98
|
+
Recent
|
|
99
|
+
</p>
|
|
100
|
+
<div class="grid grid-cols-8 gap-0.5 pb-1">
|
|
101
|
+
<button
|
|
102
|
+
v-for="r in shownRecent"
|
|
103
|
+
:key="`recent:${r}`"
|
|
104
|
+
type="button"
|
|
105
|
+
class="jun-campfire-react inline-flex size-7 items-center justify-center rounded-md text-base"
|
|
106
|
+
:aria-label="`React ${r}`"
|
|
107
|
+
@click="pick(r)"
|
|
108
|
+
>
|
|
109
|
+
{{ r }}
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
</template>
|
|
113
|
+
|
|
114
|
+
<template
|
|
115
|
+
v-for="g in GROUPS"
|
|
116
|
+
:key="g.label"
|
|
117
|
+
>
|
|
118
|
+
<p class="jun-campfire-picker-label">
|
|
119
|
+
{{ g.label }}
|
|
120
|
+
</p>
|
|
121
|
+
<div class="grid grid-cols-8 gap-0.5 pb-1">
|
|
122
|
+
<button
|
|
123
|
+
v-for="r in g.emoji"
|
|
124
|
+
:key="r"
|
|
125
|
+
type="button"
|
|
126
|
+
class="jun-campfire-react inline-flex size-7 items-center justify-center rounded-md text-base"
|
|
127
|
+
:aria-label="`React ${r}`"
|
|
128
|
+
@click="pick(r)"
|
|
129
|
+
>
|
|
130
|
+
{{ r }}
|
|
131
|
+
</button>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
134
|
+
</div>
|
|
135
|
+
</template>
|
|
136
|
+
</UPopover>
|
|
137
|
+
</div>
|
|
138
|
+
</template>
|
|
139
|
+
|
|
140
|
+
<style scoped>
|
|
141
|
+
.jun-campfire-react{background:hsla(0,0%,100%,.5);box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);transition:transform .2s cubic-bezier(.22,1,.36,1)}:root.dark .jun-campfire-react{background:hsla(0,0%,100%,.05);box-shadow:inset 0 0 0 1px hsla(0,0%,100%,.1)}.jun-campfire-react:hover{transform:translateY(-2px)}.jun-campfire-react:active{transform:scale(.92)}@media (prefers-reduced-motion:reduce){.jun-campfire-react{transition:none}.jun-campfire-react:hover{transform:none}}.jun-campfire-more.is-on{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-more.is-on{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}.jun-campfire-picker-label{color:var(--color-neutral-400);font-size:10px;letter-spacing:.06em;padding:.25rem .25rem .125rem;text-transform:uppercase}:root.dark .jun-campfire-picker-label{color:var(--color-neutral-500)}
|
|
142
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The owner's quick row, already validated and capped. */
|
|
3
|
+
set: string[];
|
|
4
|
+
/** The action key under a dragging pointer — see `useJunPressDrag`. */
|
|
5
|
+
hot?: string | null;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
react: (emoji: string) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
onReact?: ((emoji: string) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -24,6 +24,7 @@ function placeFor(p) {
|
|
|
24
24
|
if (p.page) return { label: p.page === "/" ? "the front page" : p.page.slice(1), to: p.page };
|
|
25
25
|
return { label: "somewhere", to: null };
|
|
26
26
|
}
|
|
27
|
+
const rows = computed(() => props.people.map((p) => ({ p, place: placeFor(p) })));
|
|
27
28
|
function initial(name) {
|
|
28
29
|
return [...name.trim()][0]?.toUpperCase() ?? "\xB7";
|
|
29
30
|
}
|
|
@@ -34,7 +35,7 @@ function canFollow(p) {
|
|
|
34
35
|
return props.follow && !p.isSelf && !p.isBot && p.clientId >= 0;
|
|
35
36
|
}
|
|
36
37
|
const FACEPILE_MAX = 7;
|
|
37
|
-
const faces = computed(() =>
|
|
38
|
+
const faces = computed(() => rows.value.slice(0, FACEPILE_MAX));
|
|
38
39
|
const overflow = computed(() => Math.max(0, props.people.length - FACEPILE_MAX));
|
|
39
40
|
const { canAdmin, grants, busy, setRole, revoke, refresh } = useJunPeopleAdmin();
|
|
40
41
|
onMounted(() => {
|
|
@@ -90,7 +91,7 @@ function roleMenu(p) {
|
|
|
90
91
|
class="space-y-0.5 px-1.5 py-1"
|
|
91
92
|
>
|
|
92
93
|
<li
|
|
93
|
-
v-for="p in
|
|
94
|
+
v-for="{ p, place } in rows"
|
|
94
95
|
:key="p.publicKey || p.clientId"
|
|
95
96
|
class="jun-campfire-person group flex items-center gap-2.5 rounded-lg px-2 py-1.5"
|
|
96
97
|
:class="p.idle ? 'opacity-55' : ''"
|
|
@@ -109,7 +110,15 @@ function roleMenu(p) {
|
|
|
109
110
|
/>
|
|
110
111
|
</span>
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
<!-- THE WHOLE identity block is the journey — name, badges and the place
|
|
114
|
+
line together. See `rows` for why it is not the second line alone. -->
|
|
115
|
+
<component
|
|
116
|
+
:is="place.to ? NuxtLink : 'span'"
|
|
117
|
+
:to="place.to ?? void 0"
|
|
118
|
+
class="jun-campfire-who min-w-0 flex-1"
|
|
119
|
+
:class="place.to ? 'is-linked' : ''"
|
|
120
|
+
:title="place.to ? `Go to ${place.label}` : void 0"
|
|
121
|
+
>
|
|
113
122
|
<span class="flex items-baseline gap-1.5">
|
|
114
123
|
<span class="truncate text-sm text-neutral-800 dark:text-neutral-100">{{ p.name }}</span>
|
|
115
124
|
<span
|
|
@@ -130,6 +139,13 @@ function roleMenu(p) {
|
|
|
130
139
|
v-if="canAdmin && grantFor(p)"
|
|
131
140
|
class="jun-campfire-grant"
|
|
132
141
|
>{{ grantFor(p) }}</span>
|
|
142
|
+
<!-- Only where there is somewhere to go, and only on hover: a
|
|
143
|
+
permanent arrow on every row is eight arrows saying nothing. -->
|
|
144
|
+
<UIcon
|
|
145
|
+
v-if="place.to"
|
|
146
|
+
name="i-lucide-corner-up-right"
|
|
147
|
+
class="jun-campfire-goto size-3 shrink-0 text-neutral-400 dark:text-neutral-500"
|
|
148
|
+
/>
|
|
133
149
|
</span>
|
|
134
150
|
<span class="flex items-center gap-1 text-[11px] text-neutral-400 dark:text-neutral-500">
|
|
135
151
|
<UIcon
|
|
@@ -137,19 +153,28 @@ function roleMenu(p) {
|
|
|
137
153
|
:name="`i-lucide-${p.statusIcon}`"
|
|
138
154
|
class="size-3 shrink-0"
|
|
139
155
|
/>
|
|
156
|
+
<!-- Status and place SHARE this line. They used to be alternatives,
|
|
157
|
+
which cost anyone with a status their only link. -->
|
|
140
158
|
<span
|
|
141
159
|
v-if="p.statusText"
|
|
142
160
|
class="truncate"
|
|
143
161
|
>{{ p.statusText }}</span>
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
162
|
+
<span
|
|
163
|
+
v-if="p.statusText && showPages"
|
|
164
|
+
class="shrink-0 opacity-50"
|
|
165
|
+
aria-hidden="true"
|
|
166
|
+
>·</span>
|
|
167
|
+
<!-- The verb is dropped for yourself and after a status: "here, with
|
|
168
|
+
you" is already a sentence, and "reading" in front of it is not.
|
|
169
|
+
`placeFor` returns the phrase; this only decides the verb. -->
|
|
170
|
+
<span
|
|
171
|
+
v-if="showPages"
|
|
148
172
|
class="truncate"
|
|
149
|
-
|
|
150
|
-
|
|
173
|
+
>{{
|
|
174
|
+
p.isSelf || p.statusText ? place.label : `${p.idle ? "resting on" : "reading"} ${place.label}`
|
|
175
|
+
}}</span>
|
|
151
176
|
</span>
|
|
152
|
-
</
|
|
177
|
+
</component>
|
|
153
178
|
|
|
154
179
|
<button
|
|
155
180
|
v-if="canFollow(p)"
|
|
@@ -196,24 +221,46 @@ function roleMenu(p) {
|
|
|
196
221
|
v-else-if="style === 'grid'"
|
|
197
222
|
class="grid grid-cols-4 gap-1.5 p-2.5"
|
|
198
223
|
>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
224
|
+
<!-- A tile GOES THERE. Following is a separate, smaller control in the
|
|
225
|
+
corner — it used to be the tile's only action, which meant the one
|
|
226
|
+
obvious thing to do with a person's face did not take you to them. -->
|
|
227
|
+
<div
|
|
228
|
+
v-for="{ p, place } in rows"
|
|
202
229
|
:key="p.publicKey || p.clientId"
|
|
203
|
-
|
|
204
|
-
class="jun-campfire-tile flex flex-col items-center gap-1 rounded-lg px-1 py-2"
|
|
205
|
-
:class="[p.idle ? 'opacity-55' : '', isFollowed(p) ? 'is-on' : '']"
|
|
206
|
-
:title="showPages ? `${p.name} \u2014 ${placeFor(p).label}` : p.name"
|
|
207
|
-
@click="canFollow(p) && emit('follow', p.clientId)"
|
|
230
|
+
class="jun-campfire-cell relative"
|
|
208
231
|
>
|
|
209
|
-
<
|
|
210
|
-
|
|
211
|
-
:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
{
|
|
215
|
-
|
|
216
|
-
|
|
232
|
+
<component
|
|
233
|
+
:is="place.to ? NuxtLink : 'div'"
|
|
234
|
+
:to="place.to ?? void 0"
|
|
235
|
+
class="jun-campfire-tile flex flex-col items-center gap-1 rounded-lg px-1 py-2"
|
|
236
|
+
:class="[p.idle ? 'opacity-55' : '', isFollowed(p) ? 'is-on' : '']"
|
|
237
|
+
:title="showPages ? `${p.name} \u2014 ${place.label}` : p.name"
|
|
238
|
+
>
|
|
239
|
+
<span
|
|
240
|
+
class="jun-campfire-mark flex size-8 items-center justify-center rounded-full text-xs font-medium"
|
|
241
|
+
:style="{ color: p.color, boxShadow: `inset 0 0 0 1.5px ${p.color}` }"
|
|
242
|
+
>{{ initial(p.name) }}</span>
|
|
243
|
+
<span class="w-full truncate text-center text-[10px] text-neutral-500 dark:text-neutral-400">
|
|
244
|
+
{{ p.isSelf ? "you" : p.name }}
|
|
245
|
+
</span>
|
|
246
|
+
</component>
|
|
247
|
+
|
|
248
|
+
<button
|
|
249
|
+
v-if="canFollow(p)"
|
|
250
|
+
type="button"
|
|
251
|
+
class="jun-campfire-follow absolute top-0.5 right-0.5 flex size-5 items-center justify-center
|
|
252
|
+
rounded-md text-neutral-400 dark:text-neutral-500"
|
|
253
|
+
:class="isFollowed(p) ? 'is-on' : ''"
|
|
254
|
+
:aria-pressed="isFollowed(p)"
|
|
255
|
+
:aria-label="isFollowed(p) ? `Stop following ${p.name}` : `Follow ${p.name}`"
|
|
256
|
+
@click="emit('follow', p.clientId)"
|
|
257
|
+
>
|
|
258
|
+
<UIcon
|
|
259
|
+
:name="isFollowed(p) ? 'i-lucide-eye' : 'i-lucide-eye-off'"
|
|
260
|
+
class="size-3"
|
|
261
|
+
/>
|
|
262
|
+
</button>
|
|
263
|
+
</div>
|
|
217
264
|
</div>
|
|
218
265
|
|
|
219
266
|
<!-- FACEPILE — one stack, one count. -->
|
|
@@ -222,15 +269,19 @@ function roleMenu(p) {
|
|
|
222
269
|
class="flex flex-wrap items-center gap-2 px-3.5 py-4"
|
|
223
270
|
>
|
|
224
271
|
<span class="flex -space-x-2">
|
|
225
|
-
|
|
226
|
-
|
|
272
|
+
<!-- Ambient, but still a destination: a face you can see is a face you
|
|
273
|
+
should be able to walk to. -->
|
|
274
|
+
<component
|
|
275
|
+
:is="place.to ? NuxtLink : 'span'"
|
|
276
|
+
v-for="{ p, place } in faces"
|
|
227
277
|
:key="p.publicKey || p.clientId"
|
|
278
|
+
:to="place.to ?? void 0"
|
|
228
279
|
class="jun-campfire-mark flex size-7 items-center justify-center rounded-full bg-white
|
|
229
280
|
text-[10px] font-medium ring-2 ring-white dark:bg-neutral-900 dark:ring-neutral-900"
|
|
230
281
|
:class="p.idle ? 'opacity-55' : ''"
|
|
231
282
|
:style="{ color: p.color, boxShadow: `inset 0 0 0 1.5px ${p.color}` }"
|
|
232
|
-
:title="p.name"
|
|
233
|
-
>{{ initial(p.name) }}</
|
|
283
|
+
:title="showPages && place.to ? `${p.name} \u2014 ${place.label}` : p.name"
|
|
284
|
+
>{{ initial(p.name) }}</component>
|
|
234
285
|
</span>
|
|
235
286
|
<span
|
|
236
287
|
v-if="overflow"
|
|
@@ -255,5 +306,5 @@ function roleMenu(p) {
|
|
|
255
306
|
</template>
|
|
256
307
|
|
|
257
308
|
<style scoped>
|
|
258
|
-
.jun-campfire-person{transition:background-color .2s ease}.jun-campfire-person:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-person:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-mark{transition:transform .25s cubic-bezier(.22,1,.36,1)}.jun-campfire-person:hover .jun-campfire-mark,.jun-campfire-tile:hover .jun-campfire-mark{transform:scale(1.08)}.jun-campfire-tile{transition:background-color .2s ease}.jun-campfire-tile:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-tile:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-tile.is-on{background:rgba(0,0,0,.07)}:root.dark .jun-campfire-tile.is-on{background:hsla(0,0%,100%,.1)}.jun-campfire-follow{opacity:0;transition:opacity .2s ease,color .2s ease,background-color .2s ease}.jun-campfire-follow.is-on,.jun-campfire-follow:focus-visible,.jun-campfire-person:hover .jun-campfire-follow{opacity:1}.jun-campfire-follow:hover{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-follow:hover{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}.jun-campfire-follow.is-on{color:var(--color-neutral-700)}:root.dark .jun-campfire-follow.is-on{color:var(--color-neutral-200)}.jun-campfire-grant{background:rgba(0,0,0,.07);border-radius:999px;color:var(--color-neutral-600);font-size:9px;letter-spacing:.04em;line-height:.95rem;padding:0 .3rem;text-transform:uppercase}:root.dark .jun-campfire-grant{background:hsla(0,0%,100%,.1);color:var(--color-neutral-300)}.jun-campfire-alive,.jun-campfire-pulse{animation:jun-campfire-pulse 5s ease-in-out infinite}@keyframes jun-campfire-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.18)}}@media (prefers-reduced-motion:reduce){.jun-campfire-alive,.jun-campfire-mark,.jun-campfire-pulse{animation:none;transition:none}}
|
|
309
|
+
.jun-campfire-person{transition:background-color .2s ease}.jun-campfire-person:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-person:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-mark{transition:transform .25s cubic-bezier(.22,1,.36,1)}.jun-campfire-person:hover .jun-campfire-mark,.jun-campfire-tile:hover .jun-campfire-mark{transform:scale(1.08)}.jun-campfire-who{color:inherit;display:block;min-width:0;text-decoration:none}.jun-campfire-who.is-linked{cursor:pointer}.jun-campfire-goto{opacity:0;transition:opacity .2s ease}.jun-campfire-person:hover .jun-campfire-goto,.jun-campfire-who:focus-visible .jun-campfire-goto{opacity:1}.jun-campfire-tile{color:inherit;display:flex;text-decoration:none;transition:background-color .2s ease}.jun-campfire-tile:hover{background:rgba(0,0,0,.035)}:root.dark .jun-campfire-tile:hover{background:hsla(0,0%,100%,.05)}.jun-campfire-tile.is-on{background:rgba(0,0,0,.07)}:root.dark .jun-campfire-tile.is-on{background:hsla(0,0%,100%,.1)}.jun-campfire-follow{opacity:0;transition:opacity .2s ease,color .2s ease,background-color .2s ease}.jun-campfire-cell:hover .jun-campfire-follow,.jun-campfire-follow.is-on,.jun-campfire-follow:focus-visible,.jun-campfire-person:hover .jun-campfire-follow{opacity:1}.jun-campfire-follow:hover{background:rgba(0,0,0,.06);color:var(--color-neutral-700)}:root.dark .jun-campfire-follow:hover{background:hsla(0,0%,100%,.08);color:var(--color-neutral-200)}.jun-campfire-follow.is-on{color:var(--color-neutral-700)}:root.dark .jun-campfire-follow.is-on{color:var(--color-neutral-200)}.jun-campfire-grant{background:rgba(0,0,0,.07);border-radius:999px;color:var(--color-neutral-600);font-size:9px;letter-spacing:.04em;line-height:.95rem;padding:0 .3rem;text-transform:uppercase}:root.dark .jun-campfire-grant{background:hsla(0,0%,100%,.1);color:var(--color-neutral-300)}.jun-campfire-alive,.jun-campfire-pulse{animation:jun-campfire-pulse 5s ease-in-out infinite}@keyframes jun-campfire-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.18)}}@media (prefers-reduced-motion:reduce){.jun-campfire-alive,.jun-campfire-mark,.jun-campfire-pulse{animation:none;transition:none}}
|
|
259
310
|
</style>
|
|
@@ -13,12 +13,21 @@ type __VLS_Props = {
|
|
|
13
13
|
live?: boolean;
|
|
14
14
|
/** Why it is a card rather than a renderer. Shown to the owner only. */
|
|
15
15
|
fallbackNote?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Where clicking the tile goes. `null` suppresses the click layer entirely
|
|
18
|
+
* — an interactive pane, or the owner arranging the grid.
|
|
19
|
+
*/
|
|
20
|
+
to?: string | null;
|
|
21
|
+
/** `meta.paneScroll === false`. Clips like it used to. */
|
|
22
|
+
noScroll?: boolean;
|
|
16
23
|
};
|
|
17
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
to: string | null;
|
|
18
26
|
interactive: boolean;
|
|
19
27
|
icon: string;
|
|
20
28
|
live: boolean;
|
|
21
29
|
fallbackNote: string;
|
|
30
|
+
noScroll: boolean;
|
|
22
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
32
|
declare const _default: typeof __VLS_export;
|
|
24
33
|
export default _default;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
2
|
+
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
|
|
3
3
|
const props = defineProps({
|
|
4
4
|
targetDocId: { type: String, required: true },
|
|
5
5
|
label: { type: String, required: true },
|
|
6
6
|
icon: { type: String, required: false, default: "i-lucide-file-text" },
|
|
7
7
|
interactive: { type: Boolean, required: false, default: false },
|
|
8
8
|
live: { type: Boolean, required: false, default: true },
|
|
9
|
-
fallbackNote: { type: String, required: false, default: "" }
|
|
9
|
+
fallbackNote: { type: String, required: false, default: "" },
|
|
10
|
+
to: { type: [String, null], required: false, default: null },
|
|
11
|
+
noScroll: { type: Boolean, required: false, default: false }
|
|
10
12
|
});
|
|
13
|
+
const scrolls = computed(() => !props.interactive && !props.noScroll);
|
|
11
14
|
const el = ref(null);
|
|
12
15
|
const mounted = ref(false);
|
|
13
16
|
let observer = null;
|
|
@@ -40,8 +43,50 @@ onBeforeUnmount(() => {
|
|
|
40
43
|
class="relative h-full w-full overflow-hidden"
|
|
41
44
|
>
|
|
42
45
|
<template v-if="live">
|
|
46
|
+
<!-- SCROLLING. `awareness` is off: an aware ring and hover broadcast per
|
|
47
|
+
tile would put a `useAAField` on every pane of every mosaic, and the
|
|
48
|
+
tile already carries the mosaic's own presence anchor. `peers` is
|
|
49
|
+
kept — where somebody else is reading inside a tile is exactly the
|
|
50
|
+
sort of thing this site is for. -->
|
|
51
|
+
<AScroll
|
|
52
|
+
v-if="mounted && scrolls"
|
|
53
|
+
:field-key="`jun-mosaic:${targetDocId}`"
|
|
54
|
+
:awareness="false"
|
|
55
|
+
peers
|
|
56
|
+
class="jun-mosaic-scroll h-full w-full"
|
|
57
|
+
>
|
|
58
|
+
<!-- `min-h-full`, NOT `h-full`: the content must be free to EXCEED the
|
|
59
|
+
tile (that is the whole point) while a renderer with no intrinsic
|
|
60
|
+
height — one that used to size itself off the `h-full` this
|
|
61
|
+
replaces — still fills it instead of collapsing to nothing.
|
|
62
|
+
`relative` because the click layer below is sized to this box. -->
|
|
63
|
+
<div class="relative min-h-full w-full">
|
|
64
|
+
<div :class="interactive ? '' : 'pointer-events-none select-none'">
|
|
65
|
+
<ADocRenderer
|
|
66
|
+
:doc-id="targetDocId"
|
|
67
|
+
:editable="false"
|
|
68
|
+
:show-sub-pages="false"
|
|
69
|
+
editor-class="w-full"
|
|
70
|
+
renderer-class="w-full"
|
|
71
|
+
>
|
|
72
|
+
<template #loading>
|
|
73
|
+
<div class="h-40 w-full animate-pulse bg-black/[0.04] dark:bg-white/[0.06]" />
|
|
74
|
+
</template>
|
|
75
|
+
</ADocRenderer>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<!-- Inside the scroller, over the whole CONTENT. See the header. -->
|
|
79
|
+
<NuxtLink
|
|
80
|
+
v-if="to"
|
|
81
|
+
:to="to"
|
|
82
|
+
class="absolute inset-0 z-10"
|
|
83
|
+
:aria-label="label"
|
|
84
|
+
/>
|
|
85
|
+
</div>
|
|
86
|
+
</AScroll>
|
|
87
|
+
|
|
43
88
|
<div
|
|
44
|
-
v-if="mounted"
|
|
89
|
+
v-else-if="mounted"
|
|
45
90
|
class="h-full w-full overflow-hidden"
|
|
46
91
|
:class="interactive ? '' : 'pointer-events-none select-none'"
|
|
47
92
|
>
|
|
@@ -91,5 +136,20 @@ onBeforeUnmount(() => {
|
|
|
91
136
|
{{ fallbackNote }}
|
|
92
137
|
</p>
|
|
93
138
|
</div>
|
|
139
|
+
|
|
140
|
+
<!-- The click layer for every case the scroller does NOT cover: a card, a
|
|
141
|
+
pane still waiting to come into view, and one opted out of scrolling.
|
|
142
|
+
The scrolling case renders its own INSIDE the scroller, because an
|
|
143
|
+
anchor over the tile swallows the wheel. -->
|
|
144
|
+
<NuxtLink
|
|
145
|
+
v-if="to && !(live && mounted && scrolls)"
|
|
146
|
+
:to="to"
|
|
147
|
+
class="absolute inset-0 z-10"
|
|
148
|
+
:aria-label="label"
|
|
149
|
+
/>
|
|
94
150
|
</div>
|
|
95
151
|
</template>
|
|
152
|
+
|
|
153
|
+
<style scoped>
|
|
154
|
+
.jun-mosaic-scroll{scrollbar-width:none}.jun-mosaic-scroll::-webkit-scrollbar{display:none}
|
|
155
|
+
</style>
|
|
@@ -13,12 +13,21 @@ type __VLS_Props = {
|
|
|
13
13
|
live?: boolean;
|
|
14
14
|
/** Why it is a card rather than a renderer. Shown to the owner only. */
|
|
15
15
|
fallbackNote?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Where clicking the tile goes. `null` suppresses the click layer entirely
|
|
18
|
+
* — an interactive pane, or the owner arranging the grid.
|
|
19
|
+
*/
|
|
20
|
+
to?: string | null;
|
|
21
|
+
/** `meta.paneScroll === false`. Clips like it used to. */
|
|
22
|
+
noScroll?: boolean;
|
|
16
23
|
};
|
|
17
24
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
25
|
+
to: string | null;
|
|
18
26
|
interactive: boolean;
|
|
19
27
|
icon: string;
|
|
20
28
|
live: boolean;
|
|
21
29
|
fallbackNote: string;
|
|
30
|
+
noScroll: boolean;
|
|
22
31
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
32
|
declare const _default: typeof __VLS_export;
|
|
24
33
|
export default _default;
|
|
@@ -80,7 +80,8 @@ const typeMenuItems = computed(() => [
|
|
|
80
80
|
docTypes.value.map((t) => ({
|
|
81
81
|
label: t.label,
|
|
82
82
|
icon: normalizeIcon(t.icon),
|
|
83
|
-
|
|
83
|
+
type: "checkbox",
|
|
84
|
+
checked: t.key === currentType.value,
|
|
84
85
|
onSelect: () => changeType(t.key, t.label)
|
|
85
86
|
}))
|
|
86
87
|
]);
|
|
@@ -117,7 +117,11 @@ const panes = computed(
|
|
|
117
117
|
live: !cyclic && !overCap,
|
|
118
118
|
note: cyclic ? "This pane points at a page that contains it." : overCap ? "Past the live-pane limit \u2014 still here, just not rendered." : "",
|
|
119
119
|
icon: iconFor(targetEntry?.type, targetEntry?.meta?.icon),
|
|
120
|
-
interactive: meta.paneInteractive === true
|
|
120
|
+
interactive: meta.paneInteractive === true,
|
|
121
|
+
// Scrolling is ON for a window pane, because clipping a document with no
|
|
122
|
+
// indication that anything was clipped is the bug. `false` is the opt
|
|
123
|
+
// OUT — for a tile that is meant to read as a crop.
|
|
124
|
+
noScroll: meta.paneScroll === false
|
|
121
125
|
};
|
|
122
126
|
})
|
|
123
127
|
);
|
|
@@ -495,25 +499,23 @@ const hereNow = computed(() => travellers.value.filter((t) => !t.idle).length);
|
|
|
495
499
|
|
|
496
500
|
<!-- ── A document ──────────────────────────────────────────────── -->
|
|
497
501
|
<template v-else>
|
|
502
|
+
<!-- The click layer is the PANE's now, not the tile's. A pane is a
|
|
503
|
+
WINDOW: it opens the document rather than letting you work
|
|
504
|
+
inside it — but an anchor stretched over the whole tile also
|
|
505
|
+
swallowed every wheel event, which is why a scrollable tile
|
|
506
|
+
could never have worked while this lived out here. Interactive
|
|
507
|
+
panes get no link, and neither does edit mode, where the tile
|
|
508
|
+
itself is the thing being arranged. -->
|
|
498
509
|
<JunMosaicPane
|
|
499
510
|
:target-doc-id="pane.targetId"
|
|
500
511
|
:label="pane.entry.label"
|
|
501
512
|
:icon="pane.icon"
|
|
502
513
|
:interactive="pane.interactive"
|
|
503
514
|
:live="pane.live"
|
|
515
|
+
:no-scroll="pane.noScroll"
|
|
516
|
+
:to="!pane.interactive && !editing ? getDocUrl(pane.targetId) : null"
|
|
504
517
|
:fallback-note="editing ? pane.note : ''"
|
|
505
518
|
/>
|
|
506
|
-
|
|
507
|
-
<!-- The click layer. A pane is a WINDOW: it opens the document rather
|
|
508
|
-
than letting you work inside it. Interactive panes skip this, and
|
|
509
|
-
so does edit mode, where the tile itself is the thing being
|
|
510
|
-
arranged. -->
|
|
511
|
-
<NuxtLink
|
|
512
|
-
v-if="!pane.interactive && !editing"
|
|
513
|
-
:to="getDocUrl(pane.targetId)"
|
|
514
|
-
class="absolute inset-0 z-10"
|
|
515
|
-
:aria-label="pane.entry.label"
|
|
516
|
-
/>
|
|
517
519
|
</template>
|
|
518
520
|
|
|
519
521
|
<!-- ── Owner affordances ───────────────────────────────────────── -->
|
|
@@ -9,7 +9,7 @@ const TABS = ["auto", "here", "fire", "you"];
|
|
|
9
9
|
const SIZES = ["sm", "md", "lg"];
|
|
10
10
|
const HISTORY_MIN = 5;
|
|
11
11
|
const HISTORY_MAX = 300;
|
|
12
|
-
const REACTIONS_MAX =
|
|
12
|
+
const REACTIONS_MAX = 12;
|
|
13
13
|
const TITLE_MAX = 32;
|
|
14
14
|
const ICON_RE = /^i-lucide-[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
15
15
|
export function junCampfireReactions(raw) {
|
|
@@ -56,6 +56,16 @@ export function useJunCampfireSettings() {
|
|
|
56
56
|
roster,
|
|
57
57
|
identity,
|
|
58
58
|
reactions,
|
|
59
|
+
// `&& chat` is the whole rule: a bubble is a chat message, so a site with
|
|
60
|
+
// the fire out must not have sentences drifting past its hearth.
|
|
61
|
+
//
|
|
62
|
+
// `?? true` because a MISSING build default must not read as "off". This
|
|
63
|
+
// key is newer than the option object some consumers ship, and an absent
|
|
64
|
+
// `campfire.bubbles` made `flag()` hand back `undefined` — falsy, so the
|
|
65
|
+
// whole feature was silently disabled for anyone whose `runtimeConfig`
|
|
66
|
+
// predates it. Every other flag here has a real boolean behind it; this
|
|
67
|
+
// is the one that could arrive without one.
|
|
68
|
+
bubbles: chat && flag(c.campfireBubbles, build.bubbles ?? true),
|
|
59
69
|
follow: flag(c.campfireFollow, build.follow),
|
|
60
70
|
showPages: flag(c.campfireShowPages, build.showPages),
|
|
61
71
|
showBots: flag(c.campfireShowBots, build.showBots),
|
|
@@ -10,7 +10,21 @@ export interface JunMenuCtx {
|
|
|
10
10
|
/** True while the owner is in edit mode. */
|
|
11
11
|
editing: boolean;
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* A `UContextMenu`/`UDropdownMenu` item. Kept structural — Nuxt UI's own type
|
|
15
|
+
* is not exported in a usable form.
|
|
16
|
+
*
|
|
17
|
+
* > **`checked` alone renders NOTHING. An item that reports a current choice
|
|
18
|
+
* > must also carry `type: 'checkbox'`.** Nuxt UI paints the tick from
|
|
19
|
+
* > `ContextMenu.ItemIndicator`, which only exists inside the
|
|
20
|
+
* > `ContextMenu.CheckboxItem` branch — every other item type drops `checked`
|
|
21
|
+
* > on the floor in silence. Both the "Page type ▸" and "Icon ▸" submenus here
|
|
22
|
+
* > shipped without it, so the one thing a switcher has to say — which option
|
|
23
|
+
* > you are ON — was the one thing it never said. (The indicator lands in the
|
|
24
|
+
* > TRAILING slot, so a checkbox item keeps its leading icon; there is no
|
|
25
|
+
* > trade.) `active` is not a menu-item prop at all, and setting it does
|
|
26
|
+
* > nothing anywhere.
|
|
27
|
+
*/
|
|
14
28
|
export interface JunMenuItem {
|
|
15
29
|
label?: string;
|
|
16
30
|
icon?: string;
|
|
@@ -18,6 +32,7 @@ export interface JunMenuItem {
|
|
|
18
32
|
kbds?: string[];
|
|
19
33
|
disabled?: boolean;
|
|
20
34
|
type?: 'label' | 'separator' | 'checkbox';
|
|
35
|
+
/** Requires `type: 'checkbox'` to render. See the note above. */
|
|
21
36
|
checked?: boolean;
|
|
22
37
|
children?: JunMenuItem[];
|
|
23
38
|
onSelect?: (e?: Event) => void;
|
|
@@ -182,12 +182,18 @@ export function useJunDocMenu() {
|
|
|
182
182
|
...ICON_CHOICES.map((choice) => ({
|
|
183
183
|
label: choice.label,
|
|
184
184
|
icon: choice.icon,
|
|
185
|
+
// `type: 'checkbox'` is what MAKES the tick — see `JunMenuItem`.
|
|
186
|
+
type: "checkbox",
|
|
185
187
|
checked: current === choice.icon,
|
|
186
188
|
onSelect: () => tree.updateMeta(ctx.docId, { icon: choice.icon })
|
|
187
189
|
})),
|
|
188
190
|
{
|
|
189
191
|
label: "Use page-type icon",
|
|
190
192
|
icon: "i-lucide-rotate-ccw",
|
|
193
|
+
// Ticked when nothing is overridden — "inherits the page type" is a
|
|
194
|
+
// state of this list, not an escape from it.
|
|
195
|
+
type: "checkbox",
|
|
196
|
+
checked: !current,
|
|
191
197
|
onSelect: () => tree.updateMeta(ctx.docId, { icon: void 0 })
|
|
192
198
|
}
|
|
193
199
|
]
|
|
@@ -206,12 +212,14 @@ export function useJunDocMenu() {
|
|
|
206
212
|
{
|
|
207
213
|
label: "Document",
|
|
208
214
|
icon: "i-lucide-file-text",
|
|
215
|
+
type: "checkbox",
|
|
209
216
|
checked: currentType === "doc" || !currentType,
|
|
210
217
|
onSelect: () => setType("doc")
|
|
211
218
|
},
|
|
212
219
|
...opts.pageTypes.map((type) => ({
|
|
213
220
|
label: labelForType(type) ?? type,
|
|
214
221
|
icon: opts.typeIcons[type] ?? "i-lucide-file-text",
|
|
222
|
+
type: "checkbox",
|
|
215
223
|
checked: currentType === type,
|
|
216
224
|
onSelect: () => setType(type)
|
|
217
225
|
}))
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { computed, resolveComponent } from "vue";
|
|
3
3
|
import { useEventListener } from "@vueuse/core";
|
|
4
4
|
import {
|
|
5
|
+
useAAFocus,
|
|
5
6
|
useJunBackdrop,
|
|
6
7
|
useJunCampfireSettings,
|
|
7
8
|
useJunEffectiveConfig,
|
|
@@ -35,6 +36,7 @@ const presenceBlobsLit = computed(() => {
|
|
|
35
36
|
const stored = effectiveConfig.value.presenceBlobs;
|
|
36
37
|
return typeof stored === "boolean" ? stored : true;
|
|
37
38
|
});
|
|
39
|
+
if (features.presence && features.peerSelection) useAAFocus({ selectionOnly: true });
|
|
38
40
|
useJunSiteConfigMigration();
|
|
39
41
|
useJunSlugAliasTracker();
|
|
40
42
|
useJunRouteGeoHeal();
|
|
@@ -123,6 +125,14 @@ if (import.meta.client && contextMenu.suppressNative) {
|
|
|
123
125
|
and read as surveillance rather than company. -->
|
|
124
126
|
<JunPeerCursors v-if="features.presence && features.peerCursors" />
|
|
125
127
|
|
|
128
|
+
<!-- The selection of the traveller you are FOLLOWING, and nobody else's.
|
|
129
|
+
`follow-only` gates the RENDER; the broadcast above is unconditional
|
|
130
|
+
because a leader who follows nobody must still be followable. -->
|
|
131
|
+
<AGlobalFocusLayer
|
|
132
|
+
v-if="features.presence && features.peerSelection"
|
|
133
|
+
follow-only
|
|
134
|
+
/>
|
|
135
|
+
|
|
126
136
|
<!-- The user center. Off by default — "too much for now" on the reference
|
|
127
137
|
site — but the gate is the EFFECTIVE setting, not the build flag, so an
|
|
128
138
|
owner can light the fire from the settings page without a redeploy.
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -60,6 +60,21 @@ export interface JunFeatures {
|
|
|
60
60
|
awareBlobs?: boolean;
|
|
61
61
|
/** Named site-wide cursors. Off by default — reads as surveillance, not company. */
|
|
62
62
|
peerCursors?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Paint the text selection of the traveller you are FOLLOWING.
|
|
65
|
+
*
|
|
66
|
+
* Only theirs, and only while you follow them: a visitor highlighting a
|
|
67
|
+
* sentence to copy it is not performing, and eight anonymous highlights
|
|
68
|
+
* moving at once is noise rather than presence. Following someone is the
|
|
69
|
+
* moment it becomes useful — you are reading over their shoulder, and what
|
|
70
|
+
* they have picked out is the point.
|
|
71
|
+
*
|
|
72
|
+
* The broadcast still runs for everyone, because it must: a leader who
|
|
73
|
+
* follows nobody would otherwise have nothing for their follower to mirror.
|
|
74
|
+
* It runs in `selectionOnly` mode, so it costs one `selectionchange`
|
|
75
|
+
* listener and nothing per pointer move.
|
|
76
|
+
*/
|
|
77
|
+
peerSelection?: boolean;
|
|
63
78
|
/** Dot stack + roster in the nav's right cluster. Off by default — reads as a "who's online" widget. */
|
|
64
79
|
travellersChip?: boolean;
|
|
65
80
|
/** Slide-up chat panel with emoji embers and follow-a-traveller. Off by default. */
|
|
@@ -445,6 +460,17 @@ export interface JunCampfireOptions {
|
|
|
445
460
|
identity?: boolean;
|
|
446
461
|
/** Emoji embers, rising in the corner whether or not the panel is open. */
|
|
447
462
|
reactions?: boolean;
|
|
463
|
+
/**
|
|
464
|
+
* Speech bubbles beside a CLOSED hearth when somebody speaks.
|
|
465
|
+
*
|
|
466
|
+
* A collapsed user center only ever showed a number — you learned that
|
|
467
|
+
* somebody had said something, never what, and the only way to find out was
|
|
468
|
+
* to open the panel. A reaction already warms the corner while the panel is
|
|
469
|
+
* shut (that is what the embers are for); a sentence did not.
|
|
470
|
+
*
|
|
471
|
+
* Requires `chat`. Never shows your own words, and never replays history.
|
|
472
|
+
*/
|
|
473
|
+
bubbles?: boolean;
|
|
448
474
|
/** Tap a traveller to follow their journey through the site. */
|
|
449
475
|
follow?: boolean;
|
|
450
476
|
/** Show which page each traveller is on. Off is the more private choice. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abraca/junis",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.84.0",
|
|
4
4
|
"description": "Website-builder Nuxt module for the Abracadabra CRDT platform — page-type renderers, presence chrome, studio editing and SSR, all driven by documents",
|
|
5
5
|
"repository": "abracadabra/jun-is",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"//deps": "SINGLETONS ARE PEERS, NEVER DEPENDENCIES. @abraca/convert was a dependency until 2.79.0 and had to move: it peers on yjs, and a nested second copy of it means a Y.XmlElement built by one yjs crossing into a fragment owned by another — 'Unexpected content type in insert operation', which no bundler config fixes. Same reason @tiptap/core, vue and yjs are peers. Anything holding global identity or editor/CRDT state belongs here so the app resolves exactly one copy; wand.toml [pins] + `wand doctor` enforce the versions.",
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@abraca/convert": "^2.
|
|
37
|
-
"@abraca/dabra": "^2.
|
|
38
|
-
"@abraca/nuxt": "^2.
|
|
36
|
+
"@abraca/convert": "^2.83.0",
|
|
37
|
+
"@abraca/dabra": "^2.83.0",
|
|
38
|
+
"@abraca/nuxt": "^2.83.0",
|
|
39
39
|
"@nuxt/fonts": "^0.14.0",
|
|
40
40
|
"@nuxt/icon": "^2.0.0",
|
|
41
41
|
"@nuxt/image": "^2.0.0",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@abraca/convert": "^2.
|
|
68
|
-
"@abraca/dabra": "^2.
|
|
69
|
-
"@abraca/nuxt": "^2.
|
|
67
|
+
"@abraca/convert": "^2.83.0",
|
|
68
|
+
"@abraca/dabra": "^2.83.0",
|
|
69
|
+
"@abraca/nuxt": "^2.83.0",
|
|
70
70
|
"@iconify-json/lucide": "^1.2.108",
|
|
71
71
|
"@iconify-json/simple-icons": "^1.2.83",
|
|
72
72
|
"@nuxt/eslint-config": "^1.15.2",
|