@abraca/nuxt 2.10.0 → 2.13.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 (127) hide show
  1. package/dist/module.d.mts +14 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -0
  4. package/dist/runtime/assets/editor.css +1 -1
  5. package/dist/runtime/components/AConnectionBadge.d.vue.ts +29 -0
  6. package/dist/runtime/components/AConnectionBadge.vue +79 -0
  7. package/dist/runtime/components/AConnectionBadge.vue.d.ts +29 -0
  8. package/dist/runtime/components/ADocPickerModal.d.vue.ts +31 -0
  9. package/dist/runtime/components/ADocPickerModal.vue +191 -0
  10. package/dist/runtime/components/ADocPickerModal.vue.d.ts +31 -0
  11. package/dist/runtime/components/ADocumentTree.vue +65 -0
  12. package/dist/runtime/components/AEditor.d.vue.ts +19 -12
  13. package/dist/runtime/components/AEditor.vue +243 -165
  14. package/dist/runtime/components/AEditor.vue.d.ts +19 -12
  15. package/dist/runtime/components/AEncryptionModePicker.d.vue.ts +33 -0
  16. package/dist/runtime/components/AEncryptionModePicker.vue +211 -0
  17. package/dist/runtime/components/AEncryptionModePicker.vue.d.ts +33 -0
  18. package/dist/runtime/components/AModalShell.d.vue.ts +48 -0
  19. package/dist/runtime/components/AModalShell.vue +105 -0
  20. package/dist/runtime/components/AModalShell.vue.d.ts +48 -0
  21. package/dist/runtime/components/ANodePanel.d.vue.ts +17 -7
  22. package/dist/runtime/components/ANodePanel.vue +550 -451
  23. package/dist/runtime/components/ANodePanel.vue.d.ts +17 -7
  24. package/dist/runtime/components/ANodePanelHeader.d.vue.ts +20 -10
  25. package/dist/runtime/components/ANodePanelHeader.vue +17 -3
  26. package/dist/runtime/components/ANodePanelHeader.vue.d.ts +20 -10
  27. package/dist/runtime/components/ANodeSettingsPanel.d.vue.ts +2 -0
  28. package/dist/runtime/components/ANodeSettingsPanel.vue +21 -1
  29. package/dist/runtime/components/ANodeSettingsPanel.vue.d.ts +2 -0
  30. package/dist/runtime/components/ASnapshotPreviewModal.d.vue.ts +33 -0
  31. package/dist/runtime/components/ASnapshotPreviewModal.vue +430 -0
  32. package/dist/runtime/components/ASnapshotPreviewModal.vue.d.ts +33 -0
  33. package/dist/runtime/components/ATagsEditor.d.vue.ts +19 -0
  34. package/dist/runtime/components/ATagsEditor.vue +60 -0
  35. package/dist/runtime/components/ATagsEditor.vue.d.ts +19 -0
  36. package/dist/runtime/components/aware/AMedia.d.vue.ts +1 -1
  37. package/dist/runtime/components/aware/AMedia.vue.d.ts +1 -1
  38. package/dist/runtime/components/chat/AChatInput.d.vue.ts +11 -6
  39. package/dist/runtime/components/chat/AChatInput.vue +33 -2
  40. package/dist/runtime/components/chat/AChatInput.vue.d.ts +11 -6
  41. package/dist/runtime/components/chat/AChatList.d.vue.ts +12 -0
  42. package/dist/runtime/components/chat/AChatList.vue +76 -32
  43. package/dist/runtime/components/chat/AChatList.vue.d.ts +12 -0
  44. package/dist/runtime/components/chat/AChatMessages.d.vue.ts +4 -0
  45. package/dist/runtime/components/chat/AChatMessages.vue +57 -4
  46. package/dist/runtime/components/chat/AChatMessages.vue.d.ts +4 -0
  47. package/dist/runtime/components/chat/AChatPanel.d.vue.ts +6 -2
  48. package/dist/runtime/components/chat/AChatPanel.vue +17 -1
  49. package/dist/runtime/components/chat/AChatPanel.vue.d.ts +6 -2
  50. package/dist/runtime/components/chat/ANodeChatPanel.vue +1 -1
  51. package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +1 -1
  52. package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +1 -1
  53. package/dist/runtime/components/editor/ALocationPickerPopover.vue +28 -7
  54. package/dist/runtime/components/registry/APluginDetail.d.vue.ts +2 -2
  55. package/dist/runtime/components/registry/APluginDetail.vue.d.ts +2 -2
  56. package/dist/runtime/components/renderers/AChartRenderer.client.d.vue.ts +17 -0
  57. package/dist/runtime/components/renderers/AChartRenderer.client.vue +622 -0
  58. package/dist/runtime/components/renderers/AChartRenderer.client.vue.d.ts +17 -0
  59. package/dist/runtime/components/renderers/AGraphRenderer.vue +64 -15
  60. package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +2 -2
  61. package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +2 -2
  62. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +2 -2
  63. package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +2 -2
  64. package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +2 -2
  65. package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +2 -2
  66. package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +2 -2
  67. package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +2 -2
  68. package/dist/runtime/components/settings/ASettingsAppearancePanel.d.vue.ts +3 -0
  69. package/dist/runtime/components/settings/ASettingsAppearancePanel.vue +67 -0
  70. package/dist/runtime/components/settings/ASettingsAppearancePanel.vue.d.ts +3 -0
  71. package/dist/runtime/components/settings/ASettingsGroup.d.vue.ts +24 -0
  72. package/dist/runtime/components/settings/ASettingsGroup.vue +31 -0
  73. package/dist/runtime/components/settings/ASettingsGroup.vue.d.ts +24 -0
  74. package/dist/runtime/components/settings/ASettingsModal.vue +84 -53
  75. package/dist/runtime/components/settings/ASettingsPlaceholder.d.vue.ts +20 -0
  76. package/dist/runtime/components/settings/ASettingsPlaceholder.vue +32 -0
  77. package/dist/runtime/components/settings/ASettingsPlaceholder.vue.d.ts +20 -0
  78. package/dist/runtime/components/settings/ASettingsRow.d.vue.ts +34 -0
  79. package/dist/runtime/components/settings/ASettingsRow.vue +34 -0
  80. package/dist/runtime/components/settings/ASettingsRow.vue.d.ts +34 -0
  81. package/dist/runtime/components/settings/sections.d.ts +37 -0
  82. package/dist/runtime/components/settings/sections.js +45 -0
  83. package/dist/runtime/components/shell/ABreadcrumbForDoc.d.vue.ts +6 -0
  84. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue +75 -3
  85. package/dist/runtime/components/shell/ABreadcrumbForDoc.vue.d.ts +6 -0
  86. package/dist/runtime/components/shell/ADocPanelServerSettings.d.vue.ts +17 -0
  87. package/dist/runtime/components/shell/ADocPanelServerSettings.vue +253 -0
  88. package/dist/runtime/components/shell/ADocPanelServerSettings.vue.d.ts +17 -0
  89. package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +2 -0
  90. package/dist/runtime/components/shell/ADocPanelSettings.vue +15 -4
  91. package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +2 -0
  92. package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +1 -1
  93. package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +1 -1
  94. package/dist/runtime/composables/useChat.d.ts +22 -1
  95. package/dist/runtime/composables/useChat.js +79 -8
  96. package/dist/runtime/composables/useDocBreadcrumb.d.ts +17 -2
  97. package/dist/runtime/composables/useDocBreadcrumb.js +17 -3
  98. package/dist/runtime/composables/useDocSnapshots.d.ts +2 -1
  99. package/dist/runtime/composables/useDocSnapshots.js +5 -0
  100. package/dist/runtime/composables/useEditor.d.ts +1 -1
  101. package/dist/runtime/composables/useEditor.js +120 -0
  102. package/dist/runtime/composables/useEditorToolbar.d.ts +12 -4
  103. package/dist/runtime/composables/useEditorToolbar.js +78 -56
  104. package/dist/runtime/composables/useNodeContextMenu.d.ts +14 -0
  105. package/dist/runtime/composables/useNodeContextMenu.js +59 -1
  106. package/dist/runtime/composables/useSettingsModal.d.ts +1 -1
  107. package/dist/runtime/composables/useSwipeGesture.d.ts +48 -0
  108. package/dist/runtime/composables/useSwipeGesture.js +140 -0
  109. package/dist/runtime/extensions/document-header.js +16 -6
  110. package/dist/runtime/extensions/document-meta.js +344 -19
  111. package/dist/runtime/extensions/meta-field.js +42 -0
  112. package/dist/runtime/extensions/views/DocumentMetaView.vue +33 -7
  113. package/dist/runtime/extensions/views/FieldView.vue +51 -19
  114. package/dist/runtime/extensions/views/MetaFieldView.vue +30 -4
  115. package/dist/runtime/locale.d.ts +8 -0
  116. package/dist/runtime/locale.js +9 -1
  117. package/dist/runtime/middleware/abracadabra-auth.d.ts +1 -1
  118. package/dist/runtime/plugin-abracadabra.client.d.ts +1 -1
  119. package/dist/runtime/plugin-abracadabra.client.js +12 -2
  120. package/dist/runtime/plugin-abracadabra.server.d.ts +1 -1
  121. package/dist/runtime/plugin-shared-globals.client.d.ts +1 -1
  122. package/dist/runtime/utils/chatContent.d.ts +20 -2
  123. package/dist/runtime/utils/chatContent.js +20 -1
  124. package/dist/runtime/utils/docTypes.js +43 -0
  125. package/dist/runtime/utils/titleSync.d.ts +130 -0
  126. package/dist/runtime/utils/titleSync.js +53 -0
  127. package/package.json +11 -4
@@ -1,14 +1,14 @@
1
- /**
2
- * Chat message input with @mention autocomplete and document drop support.
3
- *
4
- * Ported from cou-sh/app/components/chat/ChatInput.vue — decoupled from
5
- * useChat/useChatUsers/usePermissions. App provides handlers via emits.
6
- */
7
1
  export interface ChatMentionUser {
8
2
  id: string;
9
3
  name: string;
10
4
  isAgent?: boolean;
11
5
  }
6
+ /** Minimal shape of the message being replied to (for the draft chip). */
7
+ export interface ReplyTarget {
8
+ id: string;
9
+ senderName?: string;
10
+ content?: string;
11
+ }
12
12
  type __VLS_Props = {
13
13
  /** Whether to auto-focus the input on mount */
14
14
  autofocus?: boolean;
@@ -17,6 +17,8 @@ type __VLS_Props = {
17
17
  canSend?: boolean;
18
18
  /** Online users for @mention autocomplete */
19
19
  mentionUsers?: ChatMentionUser[];
20
+ /** Message being replied to — shows a draft chip above the composer. */
21
+ replyTo?: ReplyTarget | null;
20
22
  };
21
23
  declare function focus(): void;
22
24
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
@@ -28,6 +30,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
28
30
  docId: string;
29
31
  label: string;
30
32
  }) => any;
33
+ "cancel-reply": () => any;
31
34
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
32
35
  onSend?: ((content: string) => any) | undefined;
33
36
  onTyping?: (() => any) | undefined;
@@ -35,7 +38,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
35
38
  docId: string;
36
39
  label: string;
37
40
  }) => any) | undefined;
41
+ "onCancel-reply"?: (() => any) | undefined;
38
42
  }>, {
43
+ replyTo: ReplyTarget | null;
39
44
  placeholder: string;
40
45
  autofocus: boolean;
41
46
  canSend: boolean;
@@ -32,28 +32,40 @@ type __VLS_Props = {
32
32
  channels?: ChatChannelItem[];
33
33
  notifications?: NotificationItem[];
34
34
  notificationUnreadCount?: number;
35
+ /** Ids of muted channels (shown dimmed; right-click to toggle). */
36
+ mutedIds?: string[];
37
+ /** Ids of pinned channels (shown with a pin; right-click to toggle). */
38
+ pinnedIds?: string[];
35
39
  };
36
40
  type __VLS_ModelProps = {
37
41
  'selectedChannelId'?: string | null;
38
42
  };
39
43
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
40
44
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
+ hide: (channelId: string) => any;
41
46
  "select-channel": (channelId: string) => any;
42
47
  "select-notification": (notification: NotificationItem) => any;
43
48
  "mark-all-read": () => any;
44
49
  "load-more": () => any;
50
+ "toggle-mute": (channelId: string) => any;
51
+ "toggle-pin": (channelId: string) => any;
45
52
  "update:selectedChannelId": (value: string | null) => any;
46
53
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
54
+ onHide?: ((channelId: string) => any) | undefined;
47
55
  "onSelect-channel"?: ((channelId: string) => any) | undefined;
48
56
  "onSelect-notification"?: ((notification: NotificationItem) => any) | undefined;
49
57
  "onMark-all-read"?: (() => any) | undefined;
50
58
  "onLoad-more"?: (() => any) | undefined;
59
+ "onToggle-mute"?: ((channelId: string) => any) | undefined;
60
+ "onToggle-pin"?: ((channelId: string) => any) | undefined;
51
61
  "onUpdate:selectedChannelId"?: ((value: string | null) => any) | undefined;
52
62
  }>, {
53
63
  notifications: NotificationItem[];
54
64
  mode: "chat" | "notifications";
55
65
  channels: ChatChannelItem[];
56
66
  notificationUnreadCount: number;
67
+ mutedIds: string[];
68
+ pinnedIds: string[];
57
69
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
70
  declare const _default: typeof __VLS_export;
59
71
  export default _default;
@@ -1,15 +1,44 @@
1
1
  <script setup>
2
- const _props = defineProps({
2
+ const props = defineProps({
3
3
  mode: { type: String, required: false, default: "chat" },
4
4
  channels: { type: Array, required: false, default: () => [] },
5
5
  notifications: { type: Array, required: false, default: () => [] },
6
- notificationUnreadCount: { type: Number, required: false, default: 0 }
6
+ notificationUnreadCount: { type: Number, required: false, default: 0 },
7
+ mutedIds: { type: Array, required: false, default: () => [] },
8
+ pinnedIds: { type: Array, required: false, default: () => [] }
7
9
  });
8
- const emit = defineEmits(["select-channel", "select-notification", "mark-all-read", "load-more"]);
10
+ const emit = defineEmits(["select-channel", "select-notification", "mark-all-read", "load-more", "toggle-mute", "toggle-pin", "hide"]);
9
11
  const selectedChannelId = defineModel("selectedChannelId", { type: [String, null], ...{ default: null } });
10
12
  function channelIcon(ch) {
11
13
  return ch.type === "dm" ? "i-lucide-user" : "i-lucide-users";
12
14
  }
15
+ function isMutedItem(id) {
16
+ return props.mutedIds.includes(id);
17
+ }
18
+ function isPinnedItem(id) {
19
+ return props.pinnedIds.includes(id);
20
+ }
21
+ function channelMenuItems(ch) {
22
+ return [[
23
+ {
24
+ label: isPinnedItem(ch.id) ? "Unpin" : "Pin",
25
+ icon: isPinnedItem(ch.id) ? "i-lucide-pin-off" : "i-lucide-pin",
26
+ onSelect: () => emit("toggle-pin", ch.id)
27
+ },
28
+ {
29
+ label: isMutedItem(ch.id) ? "Unmute" : "Mute",
30
+ icon: isMutedItem(ch.id) ? "i-lucide-bell" : "i-lucide-bell-off",
31
+ onSelect: () => emit("toggle-mute", ch.id)
32
+ }
33
+ ], [
34
+ {
35
+ label: "Hide",
36
+ icon: "i-lucide-eye-off",
37
+ color: "error",
38
+ onSelect: () => emit("hide", ch.id)
39
+ }
40
+ ]];
41
+ }
13
42
  function formatTimestamp(ts) {
14
43
  if (!ts) return "";
15
44
  const d = new Date(ts);
@@ -142,43 +171,58 @@ function onClickNotification(n) {
142
171
  </p>
143
172
  </div>
144
173
 
145
- <div
174
+ <UContextMenu
146
175
  v-for="ch in channels"
147
176
  :key="ch.id"
148
- class="p-4 sm:px-6 text-sm cursor-pointer border-l-2 transition-colors"
149
- :class="[
177
+ :items="channelMenuItems(ch)"
178
+ >
179
+ <div
180
+ class="p-4 sm:px-6 text-sm cursor-pointer border-l-2 transition-colors"
181
+ :class="[
150
182
  ch.unreadCount > 0 ? 'text-(--ui-text-highlighted)' : 'text-(--ui-text-muted)',
183
+ isMutedItem(ch.id) ? 'opacity-60' : '',
151
184
  selectedChannelId === ch.id ? 'border-(--ui-color-primary-500) bg-(--ui-color-primary-500)/10' : 'border-transparent hover:border-(--ui-color-primary-500) hover:bg-(--ui-color-primary-500)/5'
152
185
  ]"
153
- @click="selectedChannelId = ch.id;
186
+ @click="selectedChannelId = ch.id;
154
187
  emit('select-channel', ch.id)"
155
- >
156
- <div
157
- class="flex items-center justify-between"
158
- :class="[ch.unreadCount > 0 && 'font-semibold']"
159
188
  >
160
- <div class="flex items-center gap-2.5">
161
- <UIcon
162
- :name="channelIcon(ch)"
163
- class="size-4 text-(--ui-text-dimmed) shrink-0"
164
- />
165
- <span class="truncate">{{ ch.label }}</span>
166
- <span
167
- v-if="ch.unreadCount > 0"
168
- class="inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-full bg-(--ui-color-error-500) text-white text-[11px] font-bold leading-none"
169
- >{{ ch.unreadCount }}</span>
189
+ <div
190
+ class="flex items-center justify-between"
191
+ :class="[ch.unreadCount > 0 && 'font-semibold']"
192
+ >
193
+ <div class="flex items-center gap-2.5 min-w-0">
194
+ <UIcon
195
+ :name="channelIcon(ch)"
196
+ class="size-4 text-(--ui-text-dimmed) shrink-0"
197
+ />
198
+ <span class="truncate">{{ ch.label }}</span>
199
+ <UIcon
200
+ v-if="isPinnedItem(ch.id)"
201
+ name="i-lucide-pin"
202
+ class="size-3 text-(--ui-text-dimmed) shrink-0"
203
+ />
204
+ <UIcon
205
+ v-if="isMutedItem(ch.id)"
206
+ name="i-lucide-bell-off"
207
+ class="size-3 text-(--ui-text-dimmed) shrink-0"
208
+ />
209
+ <span
210
+ v-if="ch.unreadCount > 0 && !isMutedItem(ch.id)"
211
+ class="inline-flex items-center justify-center min-w-5 h-5 px-1.5 rounded-full bg-(--ui-color-error-500) text-white text-[11px] font-bold leading-none"
212
+ >{{ ch.unreadCount }}</span>
213
+ </div>
214
+ <span class="text-xs text-(--ui-text-dimmed) shrink-0">
215
+ {{ formatTimestamp(ch.lastMessage?.createdAt) }}
216
+ </span>
217
+ </div>
218
+ <div
219
+ v-if="ch.lastMessage"
220
+ class="flex items-center gap-1 mt-0.5 pl-6.5 min-w-0"
221
+ >
222
+ <span class="text-xs text-(--ui-text-dimmed) font-medium shrink-0">{{ ch.lastMessage.senderName }}:</span>
223
+ <span class="text-xs text-(--ui-text-dimmed) truncate flex-1">{{ ch.lastMessage.content }}</span>
170
224
  </div>
171
- <span class="text-xs text-(--ui-text-dimmed) shrink-0">
172
- {{ formatTimestamp(ch.lastMessage?.createdAt) }}
173
- </span>
174
- </div>
175
- <div
176
- v-if="ch.lastMessage"
177
- class="flex items-center gap-1 mt-0.5 pl-6.5 min-w-0"
178
- >
179
- <span class="text-xs text-(--ui-text-dimmed) font-medium shrink-0">{{ ch.lastMessage.senderName }}:</span>
180
- <span class="text-xs text-(--ui-text-dimmed) truncate flex-1">{{ ch.lastMessage.content }}</span>
181
225
  </div>
182
- </div>
226
+ </UContextMenu>
183
227
  </div>
184
228
  </template>
@@ -32,28 +32,40 @@ type __VLS_Props = {
32
32
  channels?: ChatChannelItem[];
33
33
  notifications?: NotificationItem[];
34
34
  notificationUnreadCount?: number;
35
+ /** Ids of muted channels (shown dimmed; right-click to toggle). */
36
+ mutedIds?: string[];
37
+ /** Ids of pinned channels (shown with a pin; right-click to toggle). */
38
+ pinnedIds?: string[];
35
39
  };
36
40
  type __VLS_ModelProps = {
37
41
  'selectedChannelId'?: string | null;
38
42
  };
39
43
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
40
44
  declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
45
+ hide: (channelId: string) => any;
41
46
  "select-channel": (channelId: string) => any;
42
47
  "select-notification": (notification: NotificationItem) => any;
43
48
  "mark-all-read": () => any;
44
49
  "load-more": () => any;
50
+ "toggle-mute": (channelId: string) => any;
51
+ "toggle-pin": (channelId: string) => any;
45
52
  "update:selectedChannelId": (value: string | null) => any;
46
53
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
54
+ onHide?: ((channelId: string) => any) | undefined;
47
55
  "onSelect-channel"?: ((channelId: string) => any) | undefined;
48
56
  "onSelect-notification"?: ((notification: NotificationItem) => any) | undefined;
49
57
  "onMark-all-read"?: (() => any) | undefined;
50
58
  "onLoad-more"?: (() => any) | undefined;
59
+ "onToggle-mute"?: ((channelId: string) => any) | undefined;
60
+ "onToggle-pin"?: ((channelId: string) => any) | undefined;
51
61
  "onUpdate:selectedChannelId"?: ((value: string | null) => any) | undefined;
52
62
  }>, {
53
63
  notifications: NotificationItem[];
54
64
  mode: "chat" | "notifications";
55
65
  channels: ChatChannelItem[];
56
66
  notificationUnreadCount: number;
67
+ mutedIds: string[];
68
+ pinnedIds: string[];
57
69
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
58
70
  declare const _default: typeof __VLS_export;
59
71
  export default _default;
@@ -6,6 +6,8 @@ export interface ChatMessage {
6
6
  createdAt: number;
7
7
  /** 'sending' | 'delivered' | 'read' */
8
8
  readState?: string;
9
+ /** Id of the message this one replies to (threaded reply). */
10
+ replyTo?: string;
9
11
  }
10
12
  type __VLS_Props = {
11
13
  messages: ChatMessage[];
@@ -16,9 +18,11 @@ type __VLS_Props = {
16
18
  emptySubtext?: string;
17
19
  };
18
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ reply: (message: ChatMessage) => any;
19
22
  "open-doc": (docId: string) => any;
20
23
  "jump-to-quote": (docId: string, from: number, to: number) => any;
21
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onReply?: ((message: ChatMessage) => any) | undefined;
22
26
  "onOpen-doc"?: ((docId: string) => any) | undefined;
23
27
  "onJump-to-quote"?: ((docId: string, from: number, to: number) => any) | undefined;
24
28
  }>, {
@@ -1,6 +1,6 @@
1
1
  <script setup>
2
2
  import { computed } from "vue";
3
- import { parseMessageContent, renderMessageSegments } from "../../utils/chatContent";
3
+ import { hasRichText, parseMessageContent, previewMessageContent, renderMessageSegments } from "../../utils/chatContent";
4
4
  const props = defineProps({
5
5
  messages: { type: Array, required: true },
6
6
  currentUserId: { type: String, required: false, default: "" },
@@ -8,7 +8,15 @@ const props = defineProps({
8
8
  emptyText: { type: String, required: false, default: "No messages yet" },
9
9
  emptySubtext: { type: String, required: false, default: "Be the first to send a message" }
10
10
  });
11
- const emit = defineEmits(["open-doc", "jump-to-quote"]);
11
+ const emit = defineEmits(["open-doc", "jump-to-quote", "reply"]);
12
+ const messageById = computed(() => {
13
+ const map = /* @__PURE__ */ new Map();
14
+ for (const m of props.messages) map.set(m.id, m);
15
+ return map;
16
+ });
17
+ function repliedTo(msg) {
18
+ return msg.replyTo ? messageById.value.get(msg.replyTo) : void 0;
19
+ }
12
20
  const groupedMessages = computed(() => {
13
21
  return props.messages.map((msg, i) => {
14
22
  const prev = props.messages[i - 1];
@@ -27,7 +35,7 @@ function isSelf(senderId) {
27
35
  return senderId === props.currentUserId;
28
36
  }
29
37
  function hasRichContent(text) {
30
- return /@\w+/.test(text) || /https?:\/\//.test(text);
38
+ return hasRichText(text);
31
39
  }
32
40
  </script>
33
41
 
@@ -70,12 +78,44 @@ function hasRichContent(text) {
70
78
  </div>
71
79
 
72
80
  <div
73
- class="max-w-[75%] rounded-xl px-3 py-2"
81
+ class="group relative max-w-[75%] rounded-xl px-3 py-2"
74
82
  :class="[
75
83
  isSelf(msg.senderId) ? 'bg-(--ui-color-primary-100) dark:bg-(--ui-color-primary-900)/30' : 'bg-(--ui-bg-elevated)',
76
84
  msg.isFirstInGroup ? '' : isSelf(msg.senderId) ? 'rounded-tr-sm' : 'rounded-tl-sm'
77
85
  ]"
78
86
  >
87
+ <!-- Reply affordance — appears on hover -->
88
+ <UButton
89
+ icon="i-lucide-reply"
90
+ size="xs"
91
+ color="neutral"
92
+ variant="ghost"
93
+ class="absolute -top-2 opacity-0 group-hover:opacity-100 transition-opacity bg-(--ui-bg-elevated) ring-1 ring-(--ui-border)"
94
+ :class="isSelf(msg.senderId) ? '-left-2' : '-right-2'"
95
+ :aria-label="`Reply to ${msg.senderName}`"
96
+ @click="emit('reply', msg)"
97
+ />
98
+
99
+ <!-- Quoted preview of the message being replied to -->
100
+ <button
101
+ v-if="msg.replyTo"
102
+ type="button"
103
+ class="flex items-center gap-1.5 w-full mb-1 px-2 py-1 rounded-md bg-(--ui-bg)/50 border-l-2 border-(--ui-primary) text-left"
104
+ @click="repliedTo(msg) && emit('reply', repliedTo(msg))"
105
+ >
106
+ <UIcon
107
+ name="i-lucide-reply"
108
+ class="size-3 shrink-0 text-(--ui-text-dimmed)"
109
+ />
110
+ <span class="text-[11px] text-(--ui-text-muted) truncate">
111
+ <template v-if="repliedTo(msg)">
112
+ <span class="font-medium">{{ repliedTo(msg).senderName || "message" }}</span>
113
+ · {{ previewMessageContent(repliedTo(msg).content) }}
114
+ </template>
115
+ <template v-else>Replied to an earlier message</template>
116
+ </span>
117
+ </button>
118
+
79
119
  <!-- Name + time: first in group -->
80
120
  <div
81
121
  v-if="msg.isFirstInGroup"
@@ -123,6 +163,19 @@ function hasRichContent(text) {
123
163
  v-else-if="seg.type === 'mention'"
124
164
  class="text-(--ui-color-primary-500) font-medium"
125
165
  >@{{ seg.name }}</span>
166
+ <strong
167
+ v-else-if="seg.type === 'bold'"
168
+ class="font-semibold"
169
+ >{{ seg.value }}</strong>
170
+ <em v-else-if="seg.type === 'italic'">{{ seg.value }}</em>
171
+ <span
172
+ v-else-if="seg.type === 'strike'"
173
+ class="line-through"
174
+ >{{ seg.value }}</span>
175
+ <code
176
+ v-else-if="seg.type === 'code'"
177
+ class="px-1 py-0.5 rounded bg-(--ui-bg-accented) font-mono text-[0.85em]"
178
+ >{{ seg.value }}</code>
126
179
  <template v-else>
127
180
  {{ seg.value }}
128
181
  </template>
@@ -6,6 +6,8 @@ export interface ChatMessage {
6
6
  createdAt: number;
7
7
  /** 'sending' | 'delivered' | 'read' */
8
8
  readState?: string;
9
+ /** Id of the message this one replies to (threaded reply). */
10
+ replyTo?: string;
9
11
  }
10
12
  type __VLS_Props = {
11
13
  messages: ChatMessage[];
@@ -16,9 +18,11 @@ type __VLS_Props = {
16
18
  emptySubtext?: string;
17
19
  };
18
20
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ reply: (message: ChatMessage) => any;
19
22
  "open-doc": (docId: string) => any;
20
23
  "jump-to-quote": (docId: string, from: number, to: number) => any;
21
24
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
+ onReply?: ((message: ChatMessage) => any) | undefined;
22
26
  "onOpen-doc"?: ((docId: string) => any) | undefined;
23
27
  "onJump-to-quote"?: ((docId: string, from: number, to: number) => any) | undefined;
24
28
  }>, {
@@ -44,7 +44,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
44
44
  focus: () => void | undefined;
45
45
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
46
  close: () => any;
47
- send: (content: string) => any;
47
+ send: (content: string, opts?: {
48
+ replyTo?: string;
49
+ } | undefined) => any;
48
50
  "open-doc": (docId: string) => any;
49
51
  "jump-to-quote": (docId: string, from: number, to: number) => any;
50
52
  typing: () => any;
@@ -54,7 +56,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
54
56
  }) => any;
55
57
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
56
58
  onClose?: (() => any) | undefined;
57
- onSend?: ((content: string) => any) | undefined;
59
+ onSend?: ((content: string, opts?: {
60
+ replyTo?: string;
61
+ } | undefined) => any) | undefined;
58
62
  "onOpen-doc"?: ((docId: string) => any) | undefined;
59
63
  "onJump-to-quote"?: ((docId: string, from: number, to: number) => any) | undefined;
60
64
  onTyping?: (() => any) | undefined;
@@ -17,6 +17,19 @@ const props = defineProps({
17
17
  const emit = defineEmits(["send", "typing", "doc-drop", "open-doc", "jump-to-quote", "close"]);
18
18
  const messagesContainer = ref(null);
19
19
  const chatInputRef = ref(null);
20
+ const replyingTo = ref(null);
21
+ function startReply(message) {
22
+ replyingTo.value = message;
23
+ nextTick(() => chatInputRef.value?.focus());
24
+ }
25
+ function cancelReply() {
26
+ replyingTo.value = null;
27
+ }
28
+ function onSend(content) {
29
+ const replyTo = replyingTo.value?.id;
30
+ emit("send", content, replyTo ? { replyTo } : void 0);
31
+ replyingTo.value = null;
32
+ }
20
33
  function scrollToBottom() {
21
34
  if (messagesContainer.value) {
22
35
  messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight;
@@ -68,6 +81,7 @@ defineExpose({
68
81
  :empty-subtext="emptySubtext"
69
82
  @open-doc="(docId) => emit('open-doc', docId)"
70
83
  @jump-to-quote="(docId, from, to) => emit('jump-to-quote', docId, from, to)"
84
+ @reply="startReply"
71
85
  />
72
86
 
73
87
  <AChatAgentStatus :agents="activeAgents" />
@@ -81,9 +95,11 @@ defineExpose({
81
95
  :can-send="canSend"
82
96
  :placeholder="placeholder"
83
97
  :mention-users="mentionUsers"
84
- @send="(content) => emit('send', content)"
98
+ :reply-to="replyingTo"
99
+ @send="onSend"
85
100
  @typing="emit('typing')"
86
101
  @doc-drop="(payload) => emit('doc-drop', payload)"
102
+ @cancel-reply="cancelReply"
87
103
  />
88
104
  </div>
89
105
  </template>
@@ -44,7 +44,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
44
44
  focus: () => void | undefined;
45
45
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
46
  close: () => any;
47
- send: (content: string) => any;
47
+ send: (content: string, opts?: {
48
+ replyTo?: string;
49
+ } | undefined) => any;
48
50
  "open-doc": (docId: string) => any;
49
51
  "jump-to-quote": (docId: string, from: number, to: number) => any;
50
52
  typing: () => any;
@@ -54,7 +56,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
54
56
  }) => any;
55
57
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
56
58
  onClose?: (() => any) | undefined;
57
- onSend?: ((content: string) => any) | undefined;
59
+ onSend?: ((content: string, opts?: {
60
+ replyTo?: string;
61
+ } | undefined) => any) | undefined;
58
62
  "onOpen-doc"?: ((docId: string) => any) | undefined;
59
63
  "onJump-to-quote"?: ((docId: string, from: number, to: number) => any) | undefined;
60
64
  onTyping?: (() => any) | undefined;
@@ -38,7 +38,7 @@ const typingUsersAdapted = computed(
38
38
  :empty-text="emptyText"
39
39
  :empty-subtext="emptySubtext"
40
40
  can-send
41
- @send="(content) => send(content)"
41
+ @send="(content, opts) => send(content, opts)"
42
42
  @typing="typing"
43
43
  @open-doc="(id) => emit('open-doc', id)"
44
44
  @jump-to-quote="(id, from, to) => emit('jump-to-quote', id, from, to)"
@@ -238,9 +238,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
238
238
  transition: boolean;
239
239
  autofocus: boolean;
240
240
  loading: boolean;
241
+ dismissible: boolean;
241
242
  colorMode: boolean;
242
243
  overlay: boolean;
243
- dismissible: boolean;
244
244
  fullscreen: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -238,9 +238,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
238
238
  transition: boolean;
239
239
  autofocus: boolean;
240
240
  loading: boolean;
241
+ dismissible: boolean;
241
242
  colorMode: boolean;
242
243
  overlay: boolean;
243
- dismissible: boolean;
244
244
  fullscreen: boolean;
245
245
  modal: boolean;
246
246
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, __VLS_Slots>;
@@ -1,17 +1,28 @@
1
1
  <script setup>
2
2
  import { ref, watch, nextTick, onUnmounted } from "vue";
3
- import mapboxgl from "mapbox-gl";
4
3
  import { useRuntimeConfig } from "#imports";
5
- if (typeof window !== "undefined") {
6
- import("mapbox-gl/dist/mapbox-gl.css");
7
- }
8
4
  const props = defineProps({
9
5
  latValue: { type: Number, required: false },
10
6
  lngValue: { type: Number, required: false },
11
7
  open: { type: Boolean, required: true }
12
8
  });
13
9
  const emit = defineEmits(["update:lat", "update:lng", "update:open", "clear"]);
14
- mapboxgl.accessToken = useRuntimeConfig().public.mapboxAccessToken;
10
+ const mapboxAccessToken = useRuntimeConfig().public?.abracadabra?.mapboxToken;
11
+ let mapboxgl = null;
12
+ const mapboxError = ref(null);
13
+ async function loadMapbox() {
14
+ if (mapboxgl) return true;
15
+ try {
16
+ const mod = await import("mapbox-gl");
17
+ mapboxgl = mod.default || mod;
18
+ await import("mapbox-gl/dist/mapbox-gl.css");
19
+ mapboxgl.accessToken = mapboxAccessToken;
20
+ return true;
21
+ } catch {
22
+ mapboxError.value = "Location picker requires mapbox-gl. Install it with: pnpm add mapbox-gl";
23
+ return false;
24
+ }
25
+ }
15
26
  const mapContainer = ref(null);
16
27
  let map = null;
17
28
  let marker = null;
@@ -37,9 +48,11 @@ function destroyMap() {
37
48
  map = null;
38
49
  marker = null;
39
50
  }
40
- function initMap() {
51
+ async function initMap() {
41
52
  const el = mapContainer.value;
42
53
  if (!el || map) return;
54
+ if (!await loadMapbox()) return;
55
+ if (!mapContainer.value || !props.open || map) return;
43
56
  const center = hasCoords() ? [props.lngValue, props.latValue] : [0, 20];
44
57
  const zoom = hasCoords() ? 10 : 1;
45
58
  map = new mapboxgl.Map({
@@ -110,7 +123,7 @@ async function doSearch(q) {
110
123
  if (!q.trim()) return;
111
124
  searching.value = true;
112
125
  try {
113
- const url = `https://api.mapbox.com/search/geocode/v6/forward?q=${encodeURIComponent(q)}&limit=5&access_token=${mapboxgl.accessToken}`;
126
+ const url = `https://api.mapbox.com/search/geocode/v6/forward?q=${encodeURIComponent(q)}&limit=5&access_token=${mapboxAccessToken}`;
114
127
  const res = await fetch(url);
115
128
  const data = await res.json();
116
129
  searchResults.value = (data.features ?? []).map((f) => ({
@@ -195,10 +208,18 @@ function useMyPosition() {
195
208
 
196
209
  <!-- Map -->
197
210
  <div
211
+ v-show="!mapboxError"
198
212
  ref="mapContainer"
199
213
  class="w-full rounded-md overflow-hidden"
200
214
  style="height: 220px;"
201
215
  />
216
+ <div
217
+ v-if="mapboxError"
218
+ class="w-full rounded-md border border-(--ui-border) bg-(--ui-bg-elevated) flex items-center justify-center p-3 text-center text-xs text-(--ui-text-muted)"
219
+ style="height: 220px;"
220
+ >
221
+ {{ mapboxError }}
222
+ </div>
202
223
 
203
224
  <!-- Footer -->
204
225
  <div class="flex items-center justify-between">
@@ -6,13 +6,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
6
6
  /** See `<APluginBrowser>` — same fallback chain. */
7
7
  serverUrl?: string;
8
8
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- installed: (detail: CatalogVersionDetail) => any;
10
9
  back: () => any;
10
+ installed: (detail: CatalogVersionDetail) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<{
12
12
  id: string;
13
13
  /** See `<APluginBrowser>` — same fallback chain. */
14
14
  serverUrl?: string;
15
15
  }> & Readonly<{
16
- onInstalled?: ((detail: CatalogVersionDetail) => any) | undefined;
17
16
  onBack?: (() => any) | undefined;
17
+ onInstalled?: ((detail: CatalogVersionDetail) => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -6,13 +6,13 @@ declare const __VLS_export: import("vue").DefineComponent<{
6
6
  /** See `<APluginBrowser>` — same fallback chain. */
7
7
  serverUrl?: string;
8
8
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
9
- installed: (detail: CatalogVersionDetail) => any;
10
9
  back: () => any;
10
+ installed: (detail: CatalogVersionDetail) => any;
11
11
  }, string, import("vue").PublicProps, Readonly<{
12
12
  id: string;
13
13
  /** See `<APluginBrowser>` — same fallback chain. */
14
14
  serverUrl?: string;
15
15
  }> & Readonly<{
16
- onInstalled?: ((detail: CatalogVersionDetail) => any) | undefined;
17
16
  onBack?: (() => any) | undefined;
17
+ onInstalled?: ((detail: CatalogVersionDetail) => any) | undefined;
18
18
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,17 @@
1
+ import { type RendererBaseProps } from '../../composables/useRendererBase.js';
2
+ type __VLS_Props = RendererBaseProps & {
3
+ followingUser?: string | null;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
6
+ connectedUsers: import("vue").ComputedRef<{
7
+ clientId: number;
8
+ name: string;
9
+ color: string;
10
+ avatar: string | undefined;
11
+ publicKey: any;
12
+ }[]>;
13
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
+ followingUser: string | null;
15
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;