@abraca/nuxt 0.1.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 +84 -0
- package/dist/module.d.mts +201 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +170 -0
- package/dist/runtime/components/ACollaborationUsers.d.vue.ts +11 -0
- package/dist/runtime/components/ACollaborationUsers.vue +48 -0
- package/dist/runtime/components/ACollaborationUsers.vue.d.ts +11 -0
- package/dist/runtime/components/AColorPicker.d.vue.ts +13 -0
- package/dist/runtime/components/AColorPicker.vue +71 -0
- package/dist/runtime/components/AColorPicker.vue.d.ts +13 -0
- package/dist/runtime/components/ACommandPalette.d.vue.ts +13 -0
- package/dist/runtime/components/ACommandPalette.vue +31 -0
- package/dist/runtime/components/ACommandPalette.vue.d.ts +13 -0
- package/dist/runtime/components/AConnectionStatus.d.vue.ts +13 -0
- package/dist/runtime/components/AConnectionStatus.vue +50 -0
- package/dist/runtime/components/AConnectionStatus.vue.d.ts +13 -0
- package/dist/runtime/components/ADocTypeSelect.d.vue.ts +10 -0
- package/dist/runtime/components/ADocTypeSelect.vue +34 -0
- package/dist/runtime/components/ADocTypeSelect.vue.d.ts +10 -0
- package/dist/runtime/components/ADocumentTree.d.vue.ts +53 -0
- package/dist/runtime/components/ADocumentTree.vue +350 -0
- package/dist/runtime/components/ADocumentTree.vue.d.ts +53 -0
- package/dist/runtime/components/AEditor.d.vue.ts +60 -0
- package/dist/runtime/components/AEditor.vue +174 -0
- package/dist/runtime/components/AEditor.vue.d.ts +60 -0
- package/dist/runtime/components/AFloatingWindow.d.vue.ts +24 -0
- package/dist/runtime/components/AFloatingWindow.vue +232 -0
- package/dist/runtime/components/AFloatingWindow.vue.d.ts +24 -0
- package/dist/runtime/components/AIconPicker.d.vue.ts +13 -0
- package/dist/runtime/components/AIconPicker.vue +257 -0
- package/dist/runtime/components/AIconPicker.vue.d.ts +13 -0
- package/dist/runtime/components/ANodePanel.d.vue.ts +15 -0
- package/dist/runtime/components/ANodePanel.vue +541 -0
- package/dist/runtime/components/ANodePanel.vue.d.ts +15 -0
- package/dist/runtime/components/ANotifications.d.vue.ts +7 -0
- package/dist/runtime/components/ANotifications.vue +75 -0
- package/dist/runtime/components/ANotifications.vue.d.ts +7 -0
- package/dist/runtime/components/APermissionGuard.d.vue.ts +21 -0
- package/dist/runtime/components/APermissionGuard.vue +22 -0
- package/dist/runtime/components/APermissionGuard.vue.d.ts +21 -0
- package/dist/runtime/components/APresence.d.vue.ts +43 -0
- package/dist/runtime/components/APresence.vue +36 -0
- package/dist/runtime/components/APresence.vue.d.ts +43 -0
- package/dist/runtime/components/AProvider.d.vue.ts +27 -0
- package/dist/runtime/components/AProvider.vue +42 -0
- package/dist/runtime/components/AProvider.vue.d.ts +27 -0
- package/dist/runtime/components/ARoleBadge.d.vue.ts +11 -0
- package/dist/runtime/components/ARoleBadge.vue +29 -0
- package/dist/runtime/components/ARoleBadge.vue.d.ts +11 -0
- package/dist/runtime/components/AVoiceBar.d.vue.ts +13 -0
- package/dist/runtime/components/AVoiceBar.vue +379 -0
- package/dist/runtime/components/AVoiceBar.vue.d.ts +13 -0
- package/dist/runtime/components/AVoiceTile.d.vue.ts +10 -0
- package/dist/runtime/components/AVoiceTile.vue +48 -0
- package/dist/runtime/components/AVoiceTile.vue.d.ts +10 -0
- package/dist/runtime/components/AWindowLayer.d.vue.ts +3 -0
- package/dist/runtime/components/AWindowLayer.vue +17 -0
- package/dist/runtime/components/AWindowLayer.vue.d.ts +3 -0
- package/dist/runtime/components/aware/AArea.d.vue.ts +42 -0
- package/dist/runtime/components/aware/AArea.vue +45 -0
- package/dist/runtime/components/aware/AArea.vue.d.ts +42 -0
- package/dist/runtime/components/aware/AAvatar.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AAvatar.vue +86 -0
- package/dist/runtime/components/aware/AAvatar.vue.d.ts +25 -0
- package/dist/runtime/components/aware/AButton.d.vue.ts +7 -0
- package/dist/runtime/components/aware/AButton.vue +39 -0
- package/dist/runtime/components/aware/AButton.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ACursorLabel.d.vue.ts +12 -0
- package/dist/runtime/components/aware/ACursorLabel.vue +44 -0
- package/dist/runtime/components/aware/ACursorLabel.vue.d.ts +12 -0
- package/dist/runtime/components/aware/ADocBadge.d.vue.ts +11 -0
- package/dist/runtime/components/aware/ADocBadge.vue +27 -0
- package/dist/runtime/components/aware/ADocBadge.vue.d.ts +11 -0
- package/dist/runtime/components/aware/AFacepile.d.vue.ts +20 -0
- package/dist/runtime/components/aware/AFacepile.vue +92 -0
- package/dist/runtime/components/aware/AFacepile.vue.d.ts +20 -0
- package/dist/runtime/components/aware/AInput.d.vue.ts +7 -0
- package/dist/runtime/components/aware/AInput.vue +44 -0
- package/dist/runtime/components/aware/AInput.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ASelect.d.vue.ts +7 -0
- package/dist/runtime/components/aware/ASelect.vue +51 -0
- package/dist/runtime/components/aware/ASelect.vue.d.ts +7 -0
- package/dist/runtime/components/aware/ATextarea.d.vue.ts +7 -0
- package/dist/runtime/components/aware/ATextarea.vue +44 -0
- package/dist/runtime/components/aware/ATextarea.vue.d.ts +7 -0
- package/dist/runtime/components/aware/AUserList.d.vue.ts +17 -0
- package/dist/runtime/components/aware/AUserList.vue +72 -0
- package/dist/runtime/components/aware/AUserList.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +154 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +88 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +179 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +180 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/ATableRenderer.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue +191 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue.d.ts +8 -0
- package/dist/runtime/composables/useAAField.d.ts +42 -0
- package/dist/runtime/composables/useAAField.js +62 -0
- package/dist/runtime/composables/useAbraLocale.d.ts +14 -0
- package/dist/runtime/composables/useAbraLocale.js +11 -0
- package/dist/runtime/composables/useAbracadabra.d.ts +11 -0
- package/dist/runtime/composables/useAbracadabra.js +3 -0
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +23 -0
- package/dist/runtime/composables/useAbracadabraAuth.js +22 -0
- package/dist/runtime/composables/useAwareness.d.ts +22 -0
- package/dist/runtime/composables/useAwareness.js +48 -0
- package/dist/runtime/composables/useAwarenessPeers.d.ts +34 -0
- package/dist/runtime/composables/useAwarenessPeers.js +33 -0
- package/dist/runtime/composables/useBackgroundSync.d.ts +37 -0
- package/dist/runtime/composables/useBackgroundSync.js +73 -0
- package/dist/runtime/composables/useChat.d.ts +65 -0
- package/dist/runtime/composables/useChat.js +210 -0
- package/dist/runtime/composables/useChatUsers.d.ts +21 -0
- package/dist/runtime/composables/useChatUsers.js +39 -0
- package/dist/runtime/composables/useChildTree.d.ts +119 -0
- package/dist/runtime/composables/useChildTree.js +100 -0
- package/dist/runtime/composables/useCommandPalette.d.ts +58 -0
- package/dist/runtime/composables/useCommandPalette.js +94 -0
- package/dist/runtime/composables/useConnectionStatus.d.ts +17 -0
- package/dist/runtime/composables/useConnectionStatus.js +37 -0
- package/dist/runtime/composables/useDashboard.d.ts +3 -0
- package/dist/runtime/composables/useDashboard.js +23 -0
- package/dist/runtime/composables/useDocExport.d.ts +5 -0
- package/dist/runtime/composables/useDocExport.js +256 -0
- package/dist/runtime/composables/useDocImport.d.ts +10 -0
- package/dist/runtime/composables/useDocImport.js +227 -0
- package/dist/runtime/composables/useDocJump.d.ts +29 -0
- package/dist/runtime/composables/useDocJump.js +17 -0
- package/dist/runtime/composables/useDocumentPermissions.d.ts +20 -0
- package/dist/runtime/composables/useDocumentPermissions.js +33 -0
- package/dist/runtime/composables/useEditor.d.ts +45 -0
- package/dist/runtime/composables/useEditor.js +121 -0
- package/dist/runtime/composables/useEditorDragHandle.d.ts +26 -0
- package/dist/runtime/composables/useEditorDragHandle.js +219 -0
- package/dist/runtime/composables/useEditorMentions.d.ts +28 -0
- package/dist/runtime/composables/useEditorMentions.js +40 -0
- package/dist/runtime/composables/useEditorSuggestions.d.ts +18 -0
- package/dist/runtime/composables/useEditorSuggestions.js +45 -0
- package/dist/runtime/composables/useEditorToolbar.d.ts +22 -0
- package/dist/runtime/composables/useEditorToolbar.js +60 -0
- package/dist/runtime/composables/useFileBlobStore.d.ts +15 -0
- package/dist/runtime/composables/useFileBlobStore.js +22 -0
- package/dist/runtime/composables/useFileIndex.d.ts +20 -0
- package/dist/runtime/composables/useFileIndex.js +69 -0
- package/dist/runtime/composables/useFollowUser.d.ts +5 -0
- package/dist/runtime/composables/useFollowUser.js +40 -0
- package/dist/runtime/composables/useNotifications.d.ts +82 -0
- package/dist/runtime/composables/useNotifications.js +171 -0
- package/dist/runtime/composables/useOfflineUploadQueue.d.ts +90 -0
- package/dist/runtime/composables/useOfflineUploadQueue.js +33 -0
- package/dist/runtime/composables/usePasskeyAccounts.d.ts +32 -0
- package/dist/runtime/composables/usePasskeyAccounts.js +46 -0
- package/dist/runtime/composables/usePluginRegistry.d.ts +6 -0
- package/dist/runtime/composables/usePluginRegistry.js +3 -0
- package/dist/runtime/composables/useRendererBase.d.ts +186 -0
- package/dist/runtime/composables/useRendererBase.js +46 -0
- package/dist/runtime/composables/useSearchIndex.d.ts +20 -0
- package/dist/runtime/composables/useSearchIndex.js +104 -0
- package/dist/runtime/composables/useTrash.d.ts +50 -0
- package/dist/runtime/composables/useTrash.js +127 -0
- package/dist/runtime/composables/useVoice.d.ts +51 -0
- package/dist/runtime/composables/useVoice.js +220 -0
- package/dist/runtime/composables/useWindowManager.d.ts +122 -0
- package/dist/runtime/composables/useWindowManager.js +141 -0
- package/dist/runtime/composables/useYDoc.d.ts +142 -0
- package/dist/runtime/composables/useYDoc.js +172 -0
- package/dist/runtime/extensions/accordion.d.ts +3 -0
- package/dist/runtime/extensions/accordion.js +49 -0
- package/dist/runtime/extensions/badge.d.ts +2 -0
- package/dist/runtime/extensions/badge.js +39 -0
- package/dist/runtime/extensions/callout.d.ts +2 -0
- package/dist/runtime/extensions/callout.js +28 -0
- package/dist/runtime/extensions/card.d.ts +3 -0
- package/dist/runtime/extensions/card.js +53 -0
- package/dist/runtime/extensions/code-collapse.d.ts +2 -0
- package/dist/runtime/extensions/code-collapse.js +32 -0
- package/dist/runtime/extensions/code-group.d.ts +2 -0
- package/dist/runtime/extensions/code-group.js +17 -0
- package/dist/runtime/extensions/collapsible.d.ts +2 -0
- package/dist/runtime/extensions/collapsible.js +35 -0
- package/dist/runtime/extensions/document-header.d.ts +11 -0
- package/dist/runtime/extensions/document-header.js +82 -0
- package/dist/runtime/extensions/document-meta.d.ts +20 -0
- package/dist/runtime/extensions/document-meta.js +121 -0
- package/dist/runtime/extensions/document.d.ts +6 -0
- package/dist/runtime/extensions/document.js +6 -0
- package/dist/runtime/extensions/file-block.d.ts +15 -0
- package/dist/runtime/extensions/file-block.js +34 -0
- package/dist/runtime/extensions/file-drop.d.ts +6 -0
- package/dist/runtime/extensions/file-drop.js +65 -0
- package/dist/runtime/extensions/kbd.d.ts +2 -0
- package/dist/runtime/extensions/kbd.js +33 -0
- package/dist/runtime/extensions/prose-icon.d.ts +2 -0
- package/dist/runtime/extensions/prose-icon.js +33 -0
- package/dist/runtime/extensions/search-highlight.d.ts +10 -0
- package/dist/runtime/extensions/search-highlight.js +129 -0
- package/dist/runtime/extensions/steps.d.ts +2 -0
- package/dist/runtime/extensions/steps.js +32 -0
- package/dist/runtime/extensions/tabs.d.ts +3 -0
- package/dist/runtime/extensions/tabs.js +49 -0
- package/dist/runtime/extensions/views/AccordionItemView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/AccordionItemView.vue +41 -0
- package/dist/runtime/extensions/views/AccordionItemView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/AccordionView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/AccordionView.vue +22 -0
- package/dist/runtime/extensions/views/AccordionView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/BadgeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/BadgeView.vue +23 -0
- package/dist/runtime/extensions/views/BadgeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CalloutView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CalloutView.vue +43 -0
- package/dist/runtime/extensions/views/CalloutView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CardGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CardGroupView.vue +22 -0
- package/dist/runtime/extensions/views/CardGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CardView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CardView.vue +28 -0
- package/dist/runtime/extensions/views/CardView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeCollapseView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue +45 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue +53 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue +42 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.vue +140 -0
- package/dist/runtime/extensions/views/FileNodeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/KbdView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/KbdView.vue +23 -0
- package/dist/runtime/extensions/views/KbdView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/ProseIconView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ProseIconView.vue +23 -0
- package/dist/runtime/extensions/views/ProseIconView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/StepsView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/StepsView.vue +32 -0
- package/dist/runtime/extensions/views/StepsView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/TabsItemView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/TabsItemView.vue +22 -0
- package/dist/runtime/extensions/views/TabsItemView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/TabsView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/TabsView.vue +56 -0
- package/dist/runtime/extensions/views/TabsView.vue.d.ts +4 -0
- package/dist/runtime/locale.d.ts +134 -0
- package/dist/runtime/locale.js +119 -0
- package/dist/runtime/middleware/abracadabra-auth.d.ts +11 -0
- package/dist/runtime/middleware/abracadabra-auth.js +9 -0
- package/dist/runtime/plugin-abracadabra.client.d.ts +7 -0
- package/dist/runtime/plugin-abracadabra.client.js +898 -0
- package/dist/runtime/plugin-abracadabra.server.d.ts +2 -0
- package/dist/runtime/plugin-abracadabra.server.js +71 -0
- package/dist/runtime/plugin-registry.d.ts +34 -0
- package/dist/runtime/plugin-registry.js +83 -0
- package/dist/runtime/plugin-shared-globals.client.d.ts +2 -0
- package/dist/runtime/plugin-shared-globals.client.js +20 -0
- package/dist/runtime/plugins/core.plugin.d.ts +12 -0
- package/dist/runtime/plugins/core.plugin.js +179 -0
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.d.ts +18 -0
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.js +51 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +11 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.js +16 -0
- package/dist/runtime/server/plugins/abracadabra-service.d.ts +2 -0
- package/dist/runtime/server/plugins/abracadabra-service.js +116 -0
- package/dist/runtime/server/runners/doc-tree-cache.d.ts +11 -0
- package/dist/runtime/server/runners/doc-tree-cache.js +65 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/docCache.d.ts +25 -0
- package/dist/runtime/server/utils/docCache.js +131 -0
- package/dist/runtime/server/utils/serverRunner.d.ts +28 -0
- package/dist/runtime/server/utils/serverRunner.js +58 -0
- package/dist/runtime/types.d.ts +444 -0
- package/dist/runtime/types.js +93 -0
- package/dist/runtime/utils/VoiceClient.d.ts +94 -0
- package/dist/runtime/utils/VoiceClient.js +599 -0
- package/dist/runtime/utils/avatarStyle.d.ts +15 -0
- package/dist/runtime/utils/avatarStyle.js +20 -0
- package/dist/runtime/utils/colorPalettes.d.ts +13 -0
- package/dist/runtime/utils/colorPalettes.js +49 -0
- package/dist/runtime/utils/docTypes.d.ts +129 -0
- package/dist/runtime/utils/docTypes.js +116 -0
- package/dist/runtime/utils/markdownToYjs.d.ts +23 -0
- package/dist/runtime/utils/markdownToYjs.js +440 -0
- package/dist/runtime/utils/metaFieldDefinitions.d.ts +7 -0
- package/dist/runtime/utils/metaFieldDefinitions.js +182 -0
- package/dist/runtime/utils/voiceErrors.d.ts +33 -0
- package/dist/runtime/utils/voiceErrors.js +54 -0
- package/dist/runtime/utils/yjsConvert.d.ts +14 -0
- package/dist/runtime/utils/yjsConvert.js +331 -0
- package/dist/types.d.mts +13 -0
- package/package.json +100 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { avatarBorderStyle } from "../../utils/avatarStyle";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
user: { type: Object, required: true },
|
|
5
|
+
size: { type: String, required: false, default: "sm" },
|
|
6
|
+
idle: { type: Boolean, required: false },
|
|
7
|
+
showStatus: { type: Boolean, required: false, default: true },
|
|
8
|
+
showTooltip: { type: Boolean, required: false, default: true },
|
|
9
|
+
showPopover: { type: Boolean, required: false, default: false },
|
|
10
|
+
currentDocId: { type: String, required: false }
|
|
11
|
+
});
|
|
12
|
+
const emit = defineEmits(["follow"]);
|
|
13
|
+
const appConfig = useAppConfig();
|
|
14
|
+
const neutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
|
|
15
|
+
const name = computed(() => props.user.user?.name || "Anonymous");
|
|
16
|
+
const color = computed(() => props.user.user?.color);
|
|
17
|
+
const avatarStyle = computed(
|
|
18
|
+
() => color.value ? avatarBorderStyle(color.value, neutral.value) : ""
|
|
19
|
+
);
|
|
20
|
+
const tooltipText = computed(() => {
|
|
21
|
+
if (props.idle) return `${name.value} \xB7 idle`;
|
|
22
|
+
return name.value;
|
|
23
|
+
});
|
|
24
|
+
const chipColor = computed(() => {
|
|
25
|
+
if (props.idle === void 0) return void 0;
|
|
26
|
+
return props.idle ? "warning" : "success";
|
|
27
|
+
});
|
|
28
|
+
const docContext = computed(() => {
|
|
29
|
+
if (!props.user.docId) return null;
|
|
30
|
+
if (props.currentDocId && props.user.docId === props.currentDocId) return "In this document";
|
|
31
|
+
return "In another document";
|
|
32
|
+
});
|
|
33
|
+
const popoverOpen = ref(false);
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<!-- Popover variant (click to open details) -->
|
|
38
|
+
<UPopover v-if="showPopover" v-model:open="popoverOpen">
|
|
39
|
+
<UTooltip v-if="showTooltip" :text="tooltipText" :delay-duration="600">
|
|
40
|
+
<UChip v-if="showStatus && chipColor !== void 0" :color="chipColor" position="top-right" size="sm">
|
|
41
|
+
<UAvatar :alt="name" :size="size" :style="avatarStyle" />
|
|
42
|
+
</UChip>
|
|
43
|
+
<UAvatar v-else :alt="name" :size="size" :style="avatarStyle" />
|
|
44
|
+
</UTooltip>
|
|
45
|
+
<UAvatar v-else :alt="name" :size="size" :style="avatarStyle" />
|
|
46
|
+
|
|
47
|
+
<template #content>
|
|
48
|
+
<div class="p-3 w-52 flex flex-col gap-3">
|
|
49
|
+
<div class="flex items-center gap-3">
|
|
50
|
+
<UAvatar :alt="name" size="md" :style="avatarStyle" />
|
|
51
|
+
<div class="flex-1 min-w-0">
|
|
52
|
+
<p class="text-sm font-semibold text-default truncate">{{ name }}</p>
|
|
53
|
+
<p v-if="docContext" class="text-xs text-muted truncate">{{ docContext }}</p>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
<USeparator />
|
|
57
|
+
<UButton
|
|
58
|
+
icon="i-lucide-navigation"
|
|
59
|
+
label="Follow"
|
|
60
|
+
size="sm"
|
|
61
|
+
color="neutral"
|
|
62
|
+
variant="outline"
|
|
63
|
+
block
|
|
64
|
+
@click="emit('follow', user);
|
|
65
|
+
popoverOpen = false"
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
</UPopover>
|
|
70
|
+
|
|
71
|
+
<!-- Tooltip-only variant -->
|
|
72
|
+
<UTooltip v-else-if="showTooltip" :text="tooltipText" :delay-duration="600">
|
|
73
|
+
<UChip v-if="showStatus && chipColor !== void 0" :color="chipColor" position="top-right" size="sm">
|
|
74
|
+
<UAvatar :alt="name" :size="size" :style="avatarStyle" />
|
|
75
|
+
</UChip>
|
|
76
|
+
<UAvatar v-else :alt="name" :size="size" :style="avatarStyle" />
|
|
77
|
+
</UTooltip>
|
|
78
|
+
|
|
79
|
+
<!-- Bare variant -->
|
|
80
|
+
<template v-else>
|
|
81
|
+
<UChip v-if="showStatus && chipColor !== void 0" :color="chipColor" position="top-right" size="sm">
|
|
82
|
+
<UAvatar :alt="name" :size="size" :style="avatarStyle" />
|
|
83
|
+
</UChip>
|
|
84
|
+
<UAvatar v-else :alt="name" :size="size" :style="avatarStyle" />
|
|
85
|
+
</template>
|
|
86
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
user: AwarenessUser;
|
|
4
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg';
|
|
5
|
+
/** Whether the peer is idle — drives chip color. Omit to hide status dot. */
|
|
6
|
+
idle?: boolean;
|
|
7
|
+
showStatus?: boolean;
|
|
8
|
+
showTooltip?: boolean;
|
|
9
|
+
/** Click opens a popover with user details + Follow button */
|
|
10
|
+
showPopover?: boolean;
|
|
11
|
+
/** Current viewer's docId — used to show "In this document" vs "Elsewhere" */
|
|
12
|
+
currentDocId?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
15
|
+
follow: (user: AwarenessUser) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onFollow?: ((user: AwarenessUser) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
size: "2xs" | "xs" | "sm" | "md" | "lg";
|
|
20
|
+
showStatus: boolean;
|
|
21
|
+
showTooltip: boolean;
|
|
22
|
+
showPopover: boolean;
|
|
23
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
fieldKey: { type: String, required: true }
|
|
6
|
+
});
|
|
7
|
+
const { hoverers, pressers, handlers } = useAAField(props.fieldKey);
|
|
8
|
+
const pressRingStyle = computed(() => {
|
|
9
|
+
if (!pressers.value.length) return {};
|
|
10
|
+
const color = pressers.value[0].user?.color;
|
|
11
|
+
if (!color) return {};
|
|
12
|
+
return { outline: `2px solid ${color}`, outlineOffset: "2px", borderRadius: "0.375rem" };
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<span class="relative inline-flex" v-on="handlers" :style="pressRingStyle">
|
|
18
|
+
<UButton v-bind="$attrs" />
|
|
19
|
+
<Transition name="aa-peer">
|
|
20
|
+
<span
|
|
21
|
+
v-if="hoverers.length"
|
|
22
|
+
class="absolute -top-2.5 right-0 flex -space-x-1 pointer-events-none z-10"
|
|
23
|
+
>
|
|
24
|
+
<AAvatar
|
|
25
|
+
v-for="p in hoverers.slice(0, 3)"
|
|
26
|
+
:key="p.clientId"
|
|
27
|
+
:user="p"
|
|
28
|
+
size="2xs"
|
|
29
|
+
:show-status="false"
|
|
30
|
+
:show-tooltip="true"
|
|
31
|
+
/>
|
|
32
|
+
</span>
|
|
33
|
+
</Transition>
|
|
34
|
+
</span>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.aa-peer-enter-active,.aa-peer-leave-active{transition:opacity .15s ease}.aa-peer-enter-from,.aa-peer-leave-to{opacity:0}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
user: AwarenessUser;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
user: { type: Object, required: true },
|
|
4
|
+
x: { type: Number, required: true },
|
|
5
|
+
y: { type: Number, required: true },
|
|
6
|
+
visible: { type: Boolean, required: false, default: true }
|
|
7
|
+
});
|
|
8
|
+
const name = computed(() => props.user.user?.name || "Anonymous");
|
|
9
|
+
const color = computed(() => props.user.user?.color || "#64748b");
|
|
10
|
+
const labelStyle = computed(() => ({
|
|
11
|
+
position: "absolute",
|
|
12
|
+
left: `${props.x}px`,
|
|
13
|
+
top: `${props.y}px`,
|
|
14
|
+
transform: "translate(-50%, calc(-100% - 10px))",
|
|
15
|
+
transition: "left 75ms linear, top 75ms linear",
|
|
16
|
+
pointerEvents: "none",
|
|
17
|
+
userSelect: "none",
|
|
18
|
+
zIndex: 50
|
|
19
|
+
}));
|
|
20
|
+
const pillStyle = computed(() => ({
|
|
21
|
+
background: color.value
|
|
22
|
+
}));
|
|
23
|
+
const triangleStyle = computed(() => ({
|
|
24
|
+
borderTopColor: color.value
|
|
25
|
+
}));
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div v-show="visible" :style="labelStyle" class="flex flex-col items-center">
|
|
30
|
+
<!-- Name pill -->
|
|
31
|
+
<span
|
|
32
|
+
class="flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium text-white whitespace-nowrap shadow-sm"
|
|
33
|
+
:style="pillStyle"
|
|
34
|
+
>
|
|
35
|
+
{{ name }}
|
|
36
|
+
</span>
|
|
37
|
+
<!-- Downward triangle pointer -->
|
|
38
|
+
<span
|
|
39
|
+
class="w-0 h-0"
|
|
40
|
+
style="border-left: 5px solid transparent; border-right: 5px solid transparent; border-top-width: 5px; border-top-style: solid;"
|
|
41
|
+
:style="triangleStyle"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
user: AwarenessUser;
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
docId: string;
|
|
3
|
+
max?: number;
|
|
4
|
+
size?: '2xs' | 'xs';
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
size: "2xs" | "xs";
|
|
8
|
+
max: number;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { avatarBorderStyle } from "../../utils/avatarStyle";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
docId: { type: String, required: true },
|
|
5
|
+
max: { type: Number, required: false, default: 3 },
|
|
6
|
+
size: { type: String, required: false, default: "2xs" }
|
|
7
|
+
});
|
|
8
|
+
const { peersInDoc } = useAwarenessPeers();
|
|
9
|
+
const appConfig = useAppConfig();
|
|
10
|
+
const neutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
|
|
11
|
+
const docId = computed(() => props.docId);
|
|
12
|
+
const peers = peersInDoc(docId);
|
|
13
|
+
const visible = computed(() => peers.value.slice(0, props.max));
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div v-show="peers.length > 0" class="flex items-center -space-x-1">
|
|
18
|
+
<UAvatar
|
|
19
|
+
v-for="peer in visible"
|
|
20
|
+
:key="peer.clientId"
|
|
21
|
+
:alt="peer.user?.name || ''"
|
|
22
|
+
:size="size"
|
|
23
|
+
:style="peer.user?.color ? avatarBorderStyle(peer.user.color, neutral) : ''"
|
|
24
|
+
class="ring-1 ring-bg"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
docId: string;
|
|
3
|
+
max?: number;
|
|
4
|
+
size?: '2xs' | 'xs';
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
7
|
+
size: "2xs" | "xs";
|
|
8
|
+
max: number;
|
|
9
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Filter to users viewing this doc. Omit to show all connected peers. */
|
|
4
|
+
docId?: string;
|
|
5
|
+
max?: number;
|
|
6
|
+
size?: '2xs' | 'xs' | 'sm';
|
|
7
|
+
/** Show name labels beside each avatar */
|
|
8
|
+
showNames?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
follow: (user: AwarenessUser) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onFollow?: ((user: AwarenessUser) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
size: "2xs" | "xs" | "sm";
|
|
16
|
+
max: number;
|
|
17
|
+
showNames: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { avatarBorderStyle } from "../../utils/avatarStyle";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
docId: { type: String, required: false },
|
|
5
|
+
max: { type: Number, required: false, default: 5 },
|
|
6
|
+
size: { type: String, required: false, default: "xs" },
|
|
7
|
+
showNames: { type: Boolean, required: false, default: false }
|
|
8
|
+
});
|
|
9
|
+
const emit = defineEmits(["follow"]);
|
|
10
|
+
const { peers, peersInDoc, isIdle } = useAwarenessPeers();
|
|
11
|
+
const appConfig = useAppConfig();
|
|
12
|
+
const neutral = computed(() => appConfig.ui?.colors?.neutral ?? "zinc");
|
|
13
|
+
const allPeers = computed(
|
|
14
|
+
() => props.docId ? peersInDoc(computed(() => props.docId)).value : peers.value
|
|
15
|
+
);
|
|
16
|
+
const visible = computed(() => allPeers.value.slice(0, props.max));
|
|
17
|
+
const hidden = computed(() => allPeers.value.slice(props.max));
|
|
18
|
+
const overflow = computed(() => hidden.value.length);
|
|
19
|
+
function avatarStyle(user) {
|
|
20
|
+
const c = user.user?.color;
|
|
21
|
+
return c ? avatarBorderStyle(c, neutral.value) : "";
|
|
22
|
+
}
|
|
23
|
+
const overflowOpen = ref(false);
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<div v-if="allPeers.length > 0" class="flex items-center">
|
|
28
|
+
<!-- Stacked avatars -->
|
|
29
|
+
<div class="flex items-center -space-x-2">
|
|
30
|
+
<UTooltip
|
|
31
|
+
v-for="peer in visible"
|
|
32
|
+
:key="peer.clientId"
|
|
33
|
+
:text="peer.user?.name || 'Anonymous'"
|
|
34
|
+
:delay-duration="600"
|
|
35
|
+
>
|
|
36
|
+
<UAvatar
|
|
37
|
+
:alt="peer.user?.name || 'Anonymous'"
|
|
38
|
+
:size="size"
|
|
39
|
+
:style="avatarStyle(peer)"
|
|
40
|
+
:class="isIdle(peer.clientId) ? 'opacity-50' : ''"
|
|
41
|
+
class="ring-2 ring-bg"
|
|
42
|
+
/>
|
|
43
|
+
</UTooltip>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- Name labels (expanded mode) -->
|
|
47
|
+
<div v-if="showNames && visible.length > 0" class="ml-2 flex items-center gap-2">
|
|
48
|
+
<span
|
|
49
|
+
v-for="peer in visible"
|
|
50
|
+
:key="peer.clientId"
|
|
51
|
+
class="text-xs text-muted"
|
|
52
|
+
:class="isIdle(peer.clientId) ? 'opacity-50' : ''"
|
|
53
|
+
>{{ peer.user?.name || "Anonymous" }}</span>
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<!-- Overflow badge + popover -->
|
|
57
|
+
<UPopover v-if="overflow > 0" v-model:open="overflowOpen" :content="{ side: 'bottom', align: 'start' }">
|
|
58
|
+
<UBadge
|
|
59
|
+
:label="`+${overflow}`"
|
|
60
|
+
color="neutral"
|
|
61
|
+
variant="soft"
|
|
62
|
+
class="ml-2 cursor-pointer select-none"
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<template #content>
|
|
66
|
+
<div class="p-2 w-44 flex flex-col gap-1">
|
|
67
|
+
<div
|
|
68
|
+
v-for="peer in hidden"
|
|
69
|
+
:key="peer.clientId"
|
|
70
|
+
class="flex items-center gap-2 px-1 py-1 rounded-md hover:bg-elevated/60 transition-colors"
|
|
71
|
+
>
|
|
72
|
+
<UAvatar
|
|
73
|
+
:alt="peer.user?.name || 'Anonymous'"
|
|
74
|
+
size="2xs"
|
|
75
|
+
:style="avatarStyle(peer)"
|
|
76
|
+
:class="isIdle(peer.clientId) ? 'opacity-50' : ''"
|
|
77
|
+
/>
|
|
78
|
+
<span class="text-xs text-default truncate flex-1">{{ peer.user?.name || "Anonymous" }}</span>
|
|
79
|
+
<UButton
|
|
80
|
+
icon="i-lucide-navigation"
|
|
81
|
+
size="xs"
|
|
82
|
+
color="neutral"
|
|
83
|
+
variant="ghost"
|
|
84
|
+
@click="emit('follow', peer);
|
|
85
|
+
overflowOpen = false"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</template>
|
|
90
|
+
</UPopover>
|
|
91
|
+
</div>
|
|
92
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Filter to users viewing this doc. Omit to show all connected peers. */
|
|
4
|
+
docId?: string;
|
|
5
|
+
max?: number;
|
|
6
|
+
size?: '2xs' | 'xs' | 'sm';
|
|
7
|
+
/** Show name labels beside each avatar */
|
|
8
|
+
showNames?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
follow: (user: AwarenessUser) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onFollow?: ((user: AwarenessUser) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
size: "2xs" | "xs" | "sm";
|
|
16
|
+
max: number;
|
|
17
|
+
showNames: boolean;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
fieldKey: { type: String, required: true }
|
|
6
|
+
});
|
|
7
|
+
const { hoverers, focusers, handlers } = useAAField(props.fieldKey);
|
|
8
|
+
const focusRingStyle = computed(() => {
|
|
9
|
+
if (focusers.value.length) {
|
|
10
|
+
const color = focusers.value[0].user?.color;
|
|
11
|
+
if (color) return { boxShadow: `0 0 0 2px ${color}`, borderRadius: "0.375rem" };
|
|
12
|
+
}
|
|
13
|
+
if (hoverers.value.length) {
|
|
14
|
+
const color = hoverers.value[0].user?.color;
|
|
15
|
+
if (color) return { boxShadow: `0 0 0 1px ${color}40`, borderRadius: "0.375rem" };
|
|
16
|
+
}
|
|
17
|
+
return {};
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="relative w-full" v-on="handlers" :style="focusRingStyle">
|
|
23
|
+
<UInput v-bind="$attrs" />
|
|
24
|
+
<Transition name="aa-peer">
|
|
25
|
+
<span
|
|
26
|
+
v-if="focusers.length"
|
|
27
|
+
class="absolute -top-2.5 right-0 flex -space-x-1 pointer-events-none z-10"
|
|
28
|
+
>
|
|
29
|
+
<AAvatar
|
|
30
|
+
v-for="p in focusers.slice(0, 2)"
|
|
31
|
+
:key="p.clientId"
|
|
32
|
+
:user="p"
|
|
33
|
+
size="2xs"
|
|
34
|
+
:show-status="false"
|
|
35
|
+
:show-tooltip="true"
|
|
36
|
+
/>
|
|
37
|
+
</span>
|
|
38
|
+
</Transition>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style scoped>
|
|
43
|
+
.aa-peer-enter-active,.aa-peer-leave-active{transition:opacity .15s ease}.aa-peer-enter-from,.aa-peer-leave-to{opacity:0}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
fieldKey: { type: String, required: true }
|
|
6
|
+
});
|
|
7
|
+
const { hoverers, focusers, onMouseenter, onMouseleave, onFocus, onBlur } = useAAField(props.fieldKey);
|
|
8
|
+
const focusRingStyle = computed(() => {
|
|
9
|
+
if (focusers.value.length) {
|
|
10
|
+
const color = focusers.value[0].user?.color;
|
|
11
|
+
if (color) return { boxShadow: `0 0 0 2px ${color}`, borderRadius: "0.375rem" };
|
|
12
|
+
}
|
|
13
|
+
if (hoverers.value.length) {
|
|
14
|
+
const color = hoverers.value[0].user?.color;
|
|
15
|
+
if (color) return { boxShadow: `0 0 0 1px ${color}40`, borderRadius: "0.375rem" };
|
|
16
|
+
}
|
|
17
|
+
return {};
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div
|
|
23
|
+
class="relative w-full"
|
|
24
|
+
:style="focusRingStyle"
|
|
25
|
+
@mouseenter="onMouseenter"
|
|
26
|
+
@mouseleave="onMouseleave"
|
|
27
|
+
@focus.capture="onFocus"
|
|
28
|
+
@blur.capture="onBlur"
|
|
29
|
+
>
|
|
30
|
+
<USelect v-bind="$attrs" />
|
|
31
|
+
<Transition name="aa-peer">
|
|
32
|
+
<span
|
|
33
|
+
v-if="focusers.length"
|
|
34
|
+
class="absolute -top-2.5 right-0 flex -space-x-1 pointer-events-none z-10"
|
|
35
|
+
>
|
|
36
|
+
<AAvatar
|
|
37
|
+
v-for="p in focusers.slice(0, 2)"
|
|
38
|
+
:key="p.clientId"
|
|
39
|
+
:user="p"
|
|
40
|
+
size="2xs"
|
|
41
|
+
:show-status="false"
|
|
42
|
+
:show-tooltip="true"
|
|
43
|
+
/>
|
|
44
|
+
</span>
|
|
45
|
+
</Transition>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<style scoped>
|
|
50
|
+
.aa-peer-enter-active,.aa-peer-leave-active{transition:opacity .15s ease}.aa-peer-enter-from,.aa-peer-leave-to{opacity:0}
|
|
51
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
fieldKey: { type: String, required: true }
|
|
6
|
+
});
|
|
7
|
+
const { hoverers, focusers, handlers } = useAAField(props.fieldKey);
|
|
8
|
+
const focusRingStyle = computed(() => {
|
|
9
|
+
if (focusers.value.length) {
|
|
10
|
+
const color = focusers.value[0].user?.color;
|
|
11
|
+
if (color) return { boxShadow: `0 0 0 2px ${color}`, borderRadius: "0.375rem" };
|
|
12
|
+
}
|
|
13
|
+
if (hoverers.value.length) {
|
|
14
|
+
const color = hoverers.value[0].user?.color;
|
|
15
|
+
if (color) return { boxShadow: `0 0 0 1px ${color}40`, borderRadius: "0.375rem" };
|
|
16
|
+
}
|
|
17
|
+
return {};
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="relative w-full" v-on="handlers" :style="focusRingStyle">
|
|
23
|
+
<UTextarea v-bind="$attrs" />
|
|
24
|
+
<Transition name="aa-peer">
|
|
25
|
+
<span
|
|
26
|
+
v-if="focusers.length"
|
|
27
|
+
class="absolute -top-2.5 right-0 flex -space-x-1 pointer-events-none z-10"
|
|
28
|
+
>
|
|
29
|
+
<AAvatar
|
|
30
|
+
v-for="p in focusers.slice(0, 2)"
|
|
31
|
+
:key="p.clientId"
|
|
32
|
+
:user="p"
|
|
33
|
+
size="2xs"
|
|
34
|
+
:show-status="false"
|
|
35
|
+
:show-tooltip="true"
|
|
36
|
+
/>
|
|
37
|
+
</span>
|
|
38
|
+
</Transition>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style scoped>
|
|
43
|
+
.aa-peer-enter-active,.aa-peer-leave-active{transition:opacity .15s ease}.aa-peer-enter-from,.aa-peer-leave-to{opacity:0}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Unique field key for awareness broadcasting. Convention: "{scope}:{id}" */
|
|
3
|
+
fieldKey: string;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AwarenessUser } from '../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** Filter to users in this document. Omit to show all connected peers. */
|
|
4
|
+
docId?: string;
|
|
5
|
+
showSelf?: boolean;
|
|
6
|
+
emptyLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
follow: (user: AwarenessUser) => any;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onFollow?: ((user: AwarenessUser) => any) | undefined;
|
|
12
|
+
}>, {
|
|
13
|
+
showSelf: boolean;
|
|
14
|
+
emptyLabel: string;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|