@abraca/nuxt 2.95.0 → 2.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/ADocSubPageList.vue +8 -0
  3. package/dist/runtime/components/ANodePanel.vue +11 -1
  4. package/dist/runtime/components/ANodePanelStack.d.vue.ts +19 -0
  5. package/dist/runtime/components/ANodePanelStack.vue +35 -0
  6. package/dist/runtime/components/ANodePanelStack.vue.d.ts +19 -0
  7. package/dist/runtime/components/APresence.d.vue.ts +1 -13
  8. package/dist/runtime/components/APresence.vue.d.ts +1 -13
  9. package/dist/runtime/components/ATagsPopover.d.vue.ts +34 -0
  10. package/dist/runtime/components/ATagsPopover.vue +114 -0
  11. package/dist/runtime/components/ATagsPopover.vue.d.ts +34 -0
  12. package/dist/runtime/components/chat/AChatMessages.d.vue.ts +14 -0
  13. package/dist/runtime/components/chat/AChatMessages.vue +94 -14
  14. package/dist/runtime/components/chat/AChatMessages.vue.d.ts +14 -0
  15. package/dist/runtime/components/chat/AChatPanel.d.vue.ts +10 -0
  16. package/dist/runtime/components/chat/AChatPanel.vue +5 -1
  17. package/dist/runtime/components/chat/AChatPanel.vue.d.ts +10 -0
  18. package/dist/runtime/components/chat/ANodeChatPanel.d.vue.ts +10 -3
  19. package/dist/runtime/components/chat/ANodeChatPanel.vue +6 -2
  20. package/dist/runtime/components/chat/ANodeChatPanel.vue.d.ts +10 -3
  21. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +2 -2
  22. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +2 -2
  23. package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +1 -1
  24. package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +1 -1
  25. package/dist/runtime/components/editor/AMetaChip.vue +18 -16
  26. package/dist/runtime/components/settings/ASettingsAboutPanel.d.vue.ts +3 -0
  27. package/dist/runtime/components/settings/ASettingsAboutPanel.vue +143 -0
  28. package/dist/runtime/components/settings/ASettingsAboutPanel.vue.d.ts +3 -0
  29. package/dist/runtime/components/settings/ASettingsConnectionPanel.vue +65 -100
  30. package/dist/runtime/components/settings/ASettingsModal.vue +7 -2
  31. package/dist/runtime/components/settings/sections.d.ts +28 -2
  32. package/dist/runtime/components/settings/sections.js +23 -0
  33. package/dist/runtime/components/shell/AUserMenu.d.vue.ts +2 -2
  34. package/dist/runtime/components/shell/AUserMenu.vue.d.ts +2 -2
  35. package/dist/runtime/composables/awarenessView.d.ts +46 -0
  36. package/dist/runtime/composables/awarenessView.js +65 -0
  37. package/dist/runtime/composables/useAwareness.js +19 -28
  38. package/dist/runtime/composables/useAwarenessPeers.d.ts +1 -25
  39. package/dist/runtime/composables/useChat.d.ts +21 -0
  40. package/dist/runtime/composables/useChat.js +77 -3
  41. package/dist/runtime/composables/useDocOpen.d.ts +69 -0
  42. package/dist/runtime/composables/useDocOpen.js +158 -0
  43. package/dist/runtime/composables/useRendererBase.d.ts +1 -25
  44. package/dist/runtime/composables/useSettingsModal.d.ts +1 -1
  45. package/dist/runtime/composables/useSpaceConnections.js +1 -60
  46. package/dist/runtime/composables/useYDoc.d.ts +3 -75
  47. package/dist/runtime/composables/useYDoc.js +28 -33
  48. package/dist/runtime/extensions/views/DocLinkView.vue +15 -5
  49. package/dist/runtime/extensions/views/MetaFieldView.vue +61 -49
  50. package/dist/runtime/locale.d.ts +2 -0
  51. package/dist/runtime/locale.js +1 -0
  52. package/dist/runtime/utils/observeYMap.d.ts +44 -0
  53. package/dist/runtime/utils/observeYMap.js +86 -0
  54. package/package.json +5 -5
@@ -5,6 +5,7 @@ const props = defineProps({
5
5
  messages: { type: Array, required: true },
6
6
  currentUserId: { type: String, required: false, default: "" },
7
7
  canSend: { type: Boolean, required: false, default: true },
8
+ allowEdit: { type: Boolean, required: false },
8
9
  typingUsers: { type: Array, required: false, default: () => [] },
9
10
  activeAgents: { type: Array, required: false, default: () => [] },
10
11
  mentionUsers: { type: Array, required: false, default: () => [] },
@@ -15,7 +16,7 @@ const props = defineProps({
15
16
  emptyText: { type: String, required: false, default: "No messages yet" },
16
17
  emptySubtext: { type: String, required: false, default: "Be the first to send a message" }
17
18
  });
18
- const emit = defineEmits(["send", "typing", "doc-drop", "open-doc", "jump-to-quote", "close"]);
19
+ const emit = defineEmits(["send", "edit", "delete", "typing", "doc-drop", "open-doc", "jump-to-quote", "close"]);
19
20
  const messagesContainer = ref(null);
20
21
  const chatInputRef = ref(null);
21
22
  const replyingTo = ref(null);
@@ -81,9 +82,12 @@ defineExpose({
81
82
  :empty-icon="emptyIcon"
82
83
  :empty-text="emptyText"
83
84
  :empty-subtext="emptySubtext"
85
+ :allow-edit="allowEdit"
84
86
  @open-doc="(docId) => emit('open-doc', docId)"
85
87
  @jump-to-quote="(docId, from, to) => emit('jump-to-quote', docId, from, to)"
86
88
  @reply="startReply"
89
+ @edit="(id, content) => emit('edit', id, content)"
90
+ @delete="(id) => emit('delete', id)"
87
91
  />
88
92
 
89
93
  <AChatAgentStatus :agents="activeAgents" />
@@ -17,6 +17,12 @@ type __VLS_Props = {
17
17
  currentUserId?: string;
18
18
  /** Whether the user can send messages */
19
19
  canSend?: boolean;
20
+ /**
21
+ * Offer edit/delete on the user's own messages. Off by default — the host
22
+ * must handle `@edit`/`@delete` (wire them to `useChatChannel().edit/remove`)
23
+ * for the affordances to do anything.
24
+ */
25
+ allowEdit?: boolean;
20
26
  /** Users currently typing */
21
27
  typingUsers?: TypingUser[];
22
28
  /** Active agent indicators */
@@ -53,9 +59,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
53
59
  focus: () => void | undefined;
54
60
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
55
61
  close: () => any;
62
+ delete: (messageId: string) => any;
56
63
  send: (content: string, opts?: {
57
64
  replyTo?: string;
58
65
  } | undefined) => any;
66
+ edit: (messageId: string, content: string) => any;
59
67
  "open-doc": (docId: string) => any;
60
68
  "jump-to-quote": (docId: string, from: number, to: number) => any;
61
69
  typing: () => any;
@@ -65,9 +73,11 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
65
73
  }) => any;
66
74
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
67
75
  onClose?: (() => any) | undefined;
76
+ onDelete?: ((messageId: string) => any) | undefined;
68
77
  onSend?: ((content: string, opts?: {
69
78
  replyTo?: string;
70
79
  } | undefined) => any) | undefined;
80
+ onEdit?: ((messageId: string, content: string) => any) | undefined;
71
81
  "onOpen-doc"?: ((docId: string) => any) | undefined;
72
82
  "onJump-to-quote"?: ((docId: string, from: number, to: number) => any) | undefined;
73
83
  onTyping?: (() => any) | undefined;
@@ -12,12 +12,18 @@ type __VLS_Props = {
12
12
  emptyIcon?: string;
13
13
  emptyText?: string;
14
14
  emptySubtext?: string;
15
+ /**
16
+ * Offer edit/delete on the user's own messages. On by default here — unlike
17
+ * the bare `<AChatPanel>`, this composer owns the channel, so it can fulfil
18
+ * the actions itself. The server still refuses anyone but the sender or an admin.
19
+ */
20
+ allowEdit?: boolean;
15
21
  };
16
- declare var __VLS_15: {}, __VLS_18: {};
22
+ declare var __VLS_17: {}, __VLS_20: {};
17
23
  type __VLS_Slots = {} & {
18
- leading?: (props: typeof __VLS_15) => any;
24
+ leading?: (props: typeof __VLS_17) => any;
19
25
  } & {
20
- trailing?: (props: typeof __VLS_18) => any;
26
+ trailing?: (props: typeof __VLS_20) => any;
21
27
  };
22
28
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
29
  close: () => any;
@@ -33,6 +39,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
33
39
  emptyText: string;
34
40
  emptyIcon: string;
35
41
  emptySubtext: string;
42
+ allowEdit: boolean;
36
43
  closable: boolean;
37
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
45
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -12,11 +12,12 @@ const props = defineProps({
12
12
  closable: { type: Boolean, required: false, default: true },
13
13
  emptyIcon: { type: String, required: false, default: "i-lucide-message-circle" },
14
14
  emptyText: { type: String, required: false, default: "No messages yet" },
15
- emptySubtext: { type: String, required: false, default: "Be the first to send a message" }
15
+ emptySubtext: { type: String, required: false, default: "Be the first to send a message" },
16
+ allowEdit: { type: Boolean, required: false, default: true }
16
17
  });
17
18
  const emit = defineEmits(["open-doc", "jump-to-quote", "close"]);
18
19
  const { publicKeyB64 } = useAbracadabra();
19
- const { messages, channel, typingUsers, send, typing } = useChatChannel(props.docId);
20
+ const { messages, channel, typingUsers, send, edit, remove, typing } = useChatChannel(props.docId);
20
21
  const { agentsForChannel } = useChatUsers();
21
22
  const channelAgents = computed(() => agentsForChannel(props.docId));
22
23
  const resolvedLabel = computed(() => props.label ?? channel.value?.label ?? "Chat");
@@ -44,7 +45,10 @@ const typingUsersAdapted = computed(
44
45
  :empty-text="emptyText"
45
46
  :empty-subtext="emptySubtext"
46
47
  can-send
48
+ :allow-edit="allowEdit"
47
49
  @send="(content, opts) => send(content, opts)"
50
+ @edit="(id, content) => edit(id, content)"
51
+ @delete="(id) => remove(id)"
48
52
  @typing="typing"
49
53
  @open-doc="(id) => emit('open-doc', id)"
50
54
  @jump-to-quote="(id, from, to) => emit('jump-to-quote', id, from, to)"
@@ -12,12 +12,18 @@ type __VLS_Props = {
12
12
  emptyIcon?: string;
13
13
  emptyText?: string;
14
14
  emptySubtext?: string;
15
+ /**
16
+ * Offer edit/delete on the user's own messages. On by default here — unlike
17
+ * the bare `<AChatPanel>`, this composer owns the channel, so it can fulfil
18
+ * the actions itself. The server still refuses anyone but the sender or an admin.
19
+ */
20
+ allowEdit?: boolean;
15
21
  };
16
- declare var __VLS_15: {}, __VLS_18: {};
22
+ declare var __VLS_17: {}, __VLS_20: {};
17
23
  type __VLS_Slots = {} & {
18
- leading?: (props: typeof __VLS_15) => any;
24
+ leading?: (props: typeof __VLS_17) => any;
19
25
  } & {
20
- trailing?: (props: typeof __VLS_18) => any;
26
+ trailing?: (props: typeof __VLS_20) => any;
21
27
  };
22
28
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
29
  close: () => any;
@@ -33,6 +39,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
33
39
  emptyText: string;
34
40
  emptyIcon: string;
35
41
  emptySubtext: string;
42
+ allowEdit: boolean;
36
43
  closable: boolean;
37
44
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
38
45
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -236,11 +236,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
236
236
  transition: boolean;
237
237
  close: boolean | Record<string, any>;
238
238
  shortcut: string;
239
+ loading: boolean;
239
240
  autofocus: boolean;
240
241
  fullscreen: boolean;
241
- dismissible: boolean;
242
- loading: boolean;
243
242
  colorMode: boolean;
243
+ dismissible: boolean;
244
244
  overlay: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -236,11 +236,11 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
236
236
  transition: boolean;
237
237
  close: boolean | Record<string, any>;
238
238
  shortcut: string;
239
+ loading: boolean;
239
240
  autofocus: boolean;
240
241
  fullscreen: boolean;
241
- dismissible: boolean;
242
- loading: boolean;
243
242
  colorMode: boolean;
243
+ dismissible: boolean;
244
244
  overlay: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -237,10 +237,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
237
237
  }>> & Readonly<{}>, {
238
238
  color: any;
239
239
  disabled: boolean;
240
+ loading: boolean;
240
241
  viewTransition: boolean;
241
242
  block: boolean;
242
243
  square: boolean;
243
- loading: boolean;
244
244
  collapsed: boolean;
245
245
  tooltip: boolean | Record<string, any>;
246
246
  leading: boolean;
@@ -237,10 +237,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
237
237
  }>> & Readonly<{}>, {
238
238
  color: any;
239
239
  disabled: boolean;
240
+ loading: boolean;
240
241
  viewTransition: boolean;
241
242
  block: boolean;
242
243
  square: boolean;
243
- loading: boolean;
244
244
  collapsed: boolean;
245
245
  tooltip: boolean | Record<string, any>;
246
246
  leading: boolean;
@@ -8,7 +8,7 @@ import {
8
8
  } from "@internationalized/date";
9
9
  import ALocationPickerPopover from "./ALocationPickerPopover.vue";
10
10
  import AIconPickerPopover from "./AIconPickerPopover.vue";
11
- import ATagsEditor from "../ATagsEditor.vue";
11
+ import ATagsPopover from "../ATagsPopover.vue";
12
12
  const props = defineProps({
13
13
  fieldType: { type: String, required: true },
14
14
  label: { type: String, required: false, default: "" },
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
  });
26
26
  const emit = defineEmits(["patch"]);
27
27
  const df = new DateFormatter("en-US", { dateStyle: "medium" });
28
- const CHIP_CLASS = "h-7 px-2.5 py-1 text-sm border border-(--ui-border) rounded-md hover:bg-(--ui-bg-elevated) gap-1.5 data-[state=open]:bg-(--ui-bg-elevated)";
28
+ const CHIP_CLASS = "h-7 px-2.5 py-1 text-sm border border-(--ui-border) rounded-md bg-(--ui-bg) hover:bg-(--ui-bg-elevated) gap-1.5 data-[state=open]:bg-(--ui-bg-elevated)";
29
29
  const DEFAULT_ICONS = {
30
30
  text: "i-lucide-text-cursor-input",
31
31
  url: "i-lucide-link",
@@ -279,31 +279,33 @@ function onIconPick(name) {
279
279
  />
280
280
  </template>
281
281
 
282
- <!-- tags delegates to the shared editor. It is a MODAL rather than a
283
- popover, so the chip is an ordinary button that opens it — an
284
- `<UInputTags>` inline in a popover loses its own focus to the popover's
285
- focus trap on the first Enter. -->
286
- <template v-else-if="fieldType === 'tags' && !readonly">
282
+ <!-- tags delegates to the shared POPOVER — the same shape as every other
283
+ field here. It used to be a modal, because an `<UInputTags>` inline in
284
+ a popover loses its own focus to the popover's focus scope on the first
285
+ Enter. `<ATagsPopover>` does not use `<UInputTags>`: its chips and its
286
+ input are its own markup, so there is nothing for a focus scope to
287
+ fight over, and a three-word field no longer dims the whole page to
288
+ edit. -->
289
+ <ATagsPopover
290
+ v-else-if="fieldType === 'tags' && !readonly"
291
+ v-model:open="popoverOpen"
292
+ :tags="tagList"
293
+ :title="label || 'Tags'"
294
+ @save="onTagsSave"
295
+ >
287
296
  <UButton
288
297
  size="sm"
289
298
  color="neutral"
290
299
  variant="ghost"
291
300
  :icon="chipIcon"
292
301
  :class="CHIP_CLASS"
293
- @click="popoverOpen = true"
294
302
  >
295
303
  <span
296
304
  class="max-w-44 truncate"
297
305
  :class="isEmpty ? 'text-(--ui-text-muted)' : ''"
298
306
  >{{ chipText }}</span>
299
307
  </UButton>
300
- <ATagsEditor
301
- v-model:open="popoverOpen"
302
- :tags="tagList"
303
- :title="label ? `Edit ${label.toLowerCase()}` : 'Edit tags'"
304
- @save="onTagsSave"
305
- />
306
- </template>
308
+ </ATagsPopover>
307
309
 
308
310
  <UPopover
309
311
  v-else-if="!readonly"
@@ -504,7 +506,7 @@ function onIconPick(name) {
504
506
  <!-- read-only chip -->
505
507
  <span
506
508
  v-else
507
- class="inline-flex items-center gap-1.5 h-7 px-2.5 py-1 text-sm border border-(--ui-border) rounded-md text-(--ui-text-muted)"
509
+ class="inline-flex items-center gap-1.5 h-7 px-2.5 py-1 text-sm border border-(--ui-border) rounded-md bg-(--ui-bg) text-(--ui-text-muted)"
508
510
  >
509
511
  <UIcon
510
512
  :name="chipIcon"
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,143 @@
1
+ <script setup>
2
+ import { computed, ref } from "vue";
3
+ import { useAbracadabra } from "../../composables/useAbracadabra";
4
+ import { useServerInfo } from "../../composables/useServerInfo";
5
+ import ASettingsGroup from "./ASettingsGroup.vue";
6
+ import ASettingsRow from "./ASettingsRow.vue";
7
+ const abra = useAbracadabra();
8
+ const {
9
+ serverName,
10
+ serverVersion,
11
+ rootDocId,
12
+ healthy,
13
+ readiness,
14
+ checkingReadiness,
15
+ loading,
16
+ error,
17
+ refresh,
18
+ checkReadiness
19
+ } = useServerInfo();
20
+ const serverUrl = computed(() => abra.currentServerUrl.value ?? "");
21
+ const publicKey = computed(() => abra.publicKeyB64?.value ?? "");
22
+ const readinessLabel = computed(() => {
23
+ if (checkingReadiness.value) return "Checking\u2026";
24
+ const r = readiness.value;
25
+ if (r === null || r === void 0) return "Not checked";
26
+ return typeof r === "string" ? r : JSON.stringify(r);
27
+ });
28
+ const copied = ref(false);
29
+ const diagnostics = computed(() => [
30
+ `server: ${serverName.value ?? "\u2014"}`,
31
+ `url: ${serverUrl.value || "\u2014"}`,
32
+ `version: ${serverVersion.value ?? "\u2014"}`,
33
+ `root: ${rootDocId.value ?? "\u2014"}`,
34
+ `key: ${publicKey.value || "\u2014"}`,
35
+ `agent: ${typeof navigator === "undefined" ? "\u2014" : navigator.userAgent}`
36
+ ].join("\n"));
37
+ async function copyDiagnostics() {
38
+ try {
39
+ await navigator.clipboard.writeText(diagnostics.value);
40
+ copied.value = true;
41
+ setTimeout(() => {
42
+ copied.value = false;
43
+ }, 1600);
44
+ } catch {
45
+ }
46
+ }
47
+ </script>
48
+
49
+ <template>
50
+ <div class="flex flex-col gap-8">
51
+ <ASettingsGroup
52
+ title="Server"
53
+ description="Read live from the server this client is connected to."
54
+ >
55
+ <ASettingsRow
56
+ label="Name"
57
+ :description="serverUrl || void 0"
58
+ >
59
+ <span class="text-sm text-(--ui-text-muted)">{{ serverName ?? "\u2014" }}</span>
60
+ </ASettingsRow>
61
+
62
+ <ASettingsRow label="Version">
63
+ <span class="text-sm font-mono text-(--ui-text-muted)">{{ serverVersion ?? "\u2014" }}</span>
64
+ </ASettingsRow>
65
+
66
+ <ASettingsRow
67
+ label="Health"
68
+ description="Whether the server answered its health check."
69
+ >
70
+ <UBadge
71
+ :color="healthy ? 'success' : 'error'"
72
+ variant="subtle"
73
+ size="xs"
74
+ :label="healthy ? 'Healthy' : 'Unreachable'"
75
+ />
76
+ <UButton
77
+ icon="i-lucide-refresh-cw"
78
+ size="xs"
79
+ color="neutral"
80
+ variant="ghost"
81
+ :loading="loading"
82
+ @click="refresh()"
83
+ />
84
+ </ASettingsRow>
85
+
86
+ <ASettingsRow
87
+ label="Readiness"
88
+ description="The server's own /readyz report."
89
+ >
90
+ <span class="text-xs font-mono text-(--ui-text-muted) truncate max-w-64">{{ readinessLabel }}</span>
91
+ <UButton
92
+ label="Check"
93
+ size="xs"
94
+ color="neutral"
95
+ variant="outline"
96
+ :loading="checkingReadiness"
97
+ @click="checkReadiness()"
98
+ />
99
+ </ASettingsRow>
100
+
101
+ <ASettingsRow
102
+ v-if="error"
103
+ label="Last error"
104
+ >
105
+ <span class="text-xs font-mono text-(--ui-color-error-500)">{{ error }}</span>
106
+ </ASettingsRow>
107
+ </ASettingsGroup>
108
+
109
+ <ASettingsGroup
110
+ title="This client"
111
+ description="Identity and document root for the current session."
112
+ >
113
+ <ASettingsRow
114
+ label="Public key"
115
+ description="This device's identity on the server."
116
+ >
117
+ <code class="text-xs font-mono text-(--ui-text-muted) bg-(--ui-bg-elevated) px-2 py-1 rounded truncate max-w-64">
118
+ {{ publicKey || "\u2014" }}
119
+ </code>
120
+ </ASettingsRow>
121
+
122
+ <ASettingsRow label="Root document">
123
+ <code class="text-xs font-mono text-(--ui-text-muted) bg-(--ui-bg-elevated) px-2 py-1 rounded truncate max-w-64">
124
+ {{ rootDocId ?? "\u2014" }}
125
+ </code>
126
+ </ASettingsRow>
127
+
128
+ <ASettingsRow
129
+ label="Diagnostics"
130
+ description="Copy the values above as text for a bug report."
131
+ >
132
+ <UButton
133
+ :label="copied ? 'Copied' : 'Copy'"
134
+ :icon="copied ? 'i-lucide-check' : 'i-lucide-clipboard'"
135
+ size="xs"
136
+ color="neutral"
137
+ variant="outline"
138
+ @click="copyDiagnostics"
139
+ />
140
+ </ASettingsRow>
141
+ </ASettingsGroup>
142
+ </div>
143
+ </template>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -5,6 +5,8 @@ import { useConnectionStatus } from "../../composables/useConnectionStatus";
5
5
  import { useWebRTC } from "../../composables/useWebRTC";
6
6
  import { useBroadcastSync } from "../../composables/useBroadcastSync";
7
7
  import { useServerInfo } from "../../composables/useServerInfo";
8
+ import ASettingsGroup from "./ASettingsGroup.vue";
9
+ import ASettingsRow from "./ASettingsRow.vue";
8
10
  const abra = useAbracadabra();
9
11
  const { label: connLabel, color: connColor, icon: connIcon } = useConnectionStatus();
10
12
  const { isConnected: p2pConnected, peerCount: p2pPeerCount, connect: connectP2P, disconnect: disconnectP2P } = useWebRTC();
@@ -21,126 +23,89 @@ async function toggleP2P() {
21
23
  }
22
24
  const serverName = computed(() => _serverName.value ?? currentUrl.value);
23
25
  const serverVersion = computed(() => _serverVersion.value ?? "Unknown");
26
+ const p2pDescription = computed(() => {
27
+ const base = "Direct peer connections for lower latency.";
28
+ if (!p2pConnected.value) return base;
29
+ return `${base} ${p2pPeerCount.value} peer${p2pPeerCount.value === 1 ? "" : "s"} connected.`;
30
+ });
24
31
  </script>
25
32
 
26
33
  <template>
27
- <div>
28
- <div class="mb-4">
29
- <h3 class="text-base font-semibold">
30
- Connection
31
- </h3>
32
- <p class="text-sm text-(--ui-text-muted) mt-1">
33
- Server connection and peer-to-peer sync settings.
34
- </p>
35
- </div>
36
-
37
- <div class="rounded-lg border border-(--ui-border) divide-y divide-(--ui-border)">
38
- <!-- Server status -->
39
- <div class="flex items-center justify-between gap-4 p-4">
40
- <div>
41
- <p class="text-sm font-medium">
42
- Server
43
- </p>
44
- <p class="text-xs text-(--ui-text-muted) mt-0.5">
45
- {{ serverName }}
46
- </p>
47
- </div>
48
- <div class="flex items-center gap-2">
49
- <UIcon
50
- :name="connIcon"
51
- class="size-4"
52
- :class="`text-${connColor}`"
53
- />
54
- <UBadge
55
- :color="connColor"
56
- variant="subtle"
57
- :label="connLabel"
58
- size="xs"
59
- />
60
- </div>
61
- </div>
34
+ <div class="flex flex-col gap-8">
35
+ <ASettingsGroup
36
+ title="Server"
37
+ description="Where this client is connected, and how it got there."
38
+ >
39
+ <ASettingsRow
40
+ label="Status"
41
+ :description="serverName"
42
+ >
43
+ <UIcon
44
+ :name="connIcon"
45
+ class="size-4"
46
+ :class="`text-${connColor}`"
47
+ />
48
+ <UBadge
49
+ :color="connColor"
50
+ variant="subtle"
51
+ :label="connLabel"
52
+ size="xs"
53
+ />
54
+ </ASettingsRow>
62
55
 
63
- <!-- Server URL -->
64
- <div class="flex max-sm:flex-col justify-between sm:items-center gap-4 p-4">
65
- <div>
66
- <p class="text-sm font-medium">
67
- Server URL
68
- </p>
69
- <p class="text-xs text-(--ui-text-muted) mt-0.5">
70
- The server you're connected to.
71
- </p>
72
- </div>
56
+ <ASettingsRow
57
+ label="Server URL"
58
+ description="The server you're connected to."
59
+ >
73
60
  <code class="text-xs font-mono text-(--ui-text-muted) bg-(--ui-bg-elevated) px-2 py-1 rounded">
74
61
  {{ currentUrl || "Not connected" }}
75
62
  </code>
76
- </div>
63
+ </ASettingsRow>
77
64
 
78
- <!-- Server version -->
79
- <div class="flex max-sm:flex-col justify-between sm:items-center gap-4 p-4">
80
- <div>
81
- <p class="text-sm font-medium">
82
- Server Version
83
- </p>
84
- </div>
65
+ <ASettingsRow label="Server version">
85
66
  <span class="text-sm text-(--ui-text-muted)">{{ serverVersion }}</span>
86
- </div>
67
+ </ASettingsRow>
68
+
69
+ <ASettingsRow
70
+ label="Reconnect"
71
+ description="Force reconnection to the server."
72
+ >
73
+ <UButton
74
+ label="Reconnect"
75
+ icon="i-lucide-refresh-cw"
76
+ color="neutral"
77
+ variant="outline"
78
+ size="xs"
79
+ @click="abra.reconnect()"
80
+ />
81
+ </ASettingsRow>
82
+ </ASettingsGroup>
87
83
 
88
- <!-- P2P Sync -->
89
- <div class="flex items-center justify-between gap-4 p-4">
90
- <div>
91
- <p class="text-sm font-medium">
92
- P2P Sync (WebRTC)
93
- </p>
94
- <p class="text-xs text-(--ui-text-muted) mt-0.5">
95
- Direct peer connections for lower latency.
96
- <template v-if="p2pConnected">
97
- {{ p2pPeerCount }} peer{{ p2pPeerCount === 1 ? "" : "s" }} connected.
98
- </template>
99
- </p>
100
- </div>
84
+ <ASettingsGroup
85
+ title="Transports"
86
+ description="Additional sync paths alongside the server socket."
87
+ >
88
+ <ASettingsRow
89
+ label="P2P sync (WebRTC)"
90
+ :description="p2pDescription"
91
+ >
101
92
  <USwitch
102
93
  v-model="p2pEnabled"
103
94
  @update:model-value="toggleP2P"
104
95
  />
105
- </div>
96
+ </ASettingsRow>
106
97
 
107
- <!-- Broadcast sync -->
108
- <div class="flex items-center justify-between gap-4 p-4">
109
- <div>
110
- <p class="text-sm font-medium">
111
- Cross-Tab Sync
112
- </p>
113
- <p class="text-xs text-(--ui-text-muted) mt-0.5">
114
- BroadcastChannel sync between browser tabs.
115
- </p>
116
- </div>
98
+ <ASettingsRow
99
+ label="Cross-tab sync"
100
+ description="BroadcastChannel sync between browser tabs."
101
+ >
117
102
  <UBadge
118
103
  :color="broadcastActive ? 'success' : 'neutral'"
119
104
  variant="subtle"
120
105
  :label="broadcastActive ? 'Active' : 'Inactive'"
121
106
  size="xs"
122
107
  />
123
- </div>
124
-
125
- <!-- Reconnect -->
126
- <div class="flex items-center justify-between gap-4 p-4">
127
- <div>
128
- <p class="text-sm font-medium">
129
- Reconnect
130
- </p>
131
- <p class="text-xs text-(--ui-text-muted) mt-0.5">
132
- Force reconnection to the server.
133
- </p>
134
- </div>
135
- <UButton
136
- label="Reconnect"
137
- icon="i-lucide-refresh-cw"
138
- color="neutral"
139
- variant="outline"
140
- size="xs"
141
- @click="abra.reconnect()"
142
- />
143
- </div>
144
- </div>
108
+ </ASettingsRow>
109
+ </ASettingsGroup>
145
110
  </div>
146
111
  </template>