@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,72 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
docId: { type: String, required: false },
|
|
4
|
+
showSelf: { type: Boolean, required: false, default: false },
|
|
5
|
+
emptyLabel: { type: String, required: false, default: "No one else is here" }
|
|
6
|
+
});
|
|
7
|
+
const emit = defineEmits(["follow"]);
|
|
8
|
+
const { peers, peersInDoc, isIdle } = useAwarenessPeers();
|
|
9
|
+
const displayed = computed(
|
|
10
|
+
() => props.docId ? peersInDoc(computed(() => props.docId)).value : peers.value
|
|
11
|
+
);
|
|
12
|
+
function docContext(user) {
|
|
13
|
+
if (!user.docId) return "";
|
|
14
|
+
if (props.docId && user.docId === props.docId) return "In this document";
|
|
15
|
+
return "In another document";
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="flex flex-col">
|
|
21
|
+
<!-- Empty state -->
|
|
22
|
+
<p v-if="displayed.length === 0" class="text-sm text-muted text-center py-4">
|
|
23
|
+
{{ emptyLabel }}
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<template v-else>
|
|
27
|
+
<div
|
|
28
|
+
v-for="(peer, i) in displayed"
|
|
29
|
+
:key="peer.clientId"
|
|
30
|
+
>
|
|
31
|
+
<USeparator v-if="i > 0" />
|
|
32
|
+
<div class="flex items-center gap-3 py-2 px-1">
|
|
33
|
+
<!-- Avatar (no tooltip/status here — list provides the context) -->
|
|
34
|
+
<AAvatar
|
|
35
|
+
:user="peer"
|
|
36
|
+
size="xs"
|
|
37
|
+
:idle="isIdle(peer.clientId)"
|
|
38
|
+
:show-tooltip="false"
|
|
39
|
+
:show-status="false"
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<!-- Name + doc context -->
|
|
43
|
+
<div class="flex-1 min-w-0">
|
|
44
|
+
<p class="text-sm font-medium text-default truncate">
|
|
45
|
+
{{ peer.user?.name || "Anonymous" }}
|
|
46
|
+
</p>
|
|
47
|
+
<p v-if="docContext(peer)" class="text-xs text-muted truncate">
|
|
48
|
+
{{ docContext(peer) }}
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<!-- Status badge -->
|
|
53
|
+
<UBadge
|
|
54
|
+
:label="isIdle(peer.clientId) ? 'idle' : 'active'"
|
|
55
|
+
:color="isIdle(peer.clientId) ? 'neutral' : 'success'"
|
|
56
|
+
variant="subtle"
|
|
57
|
+
size="xs"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<!-- Follow button -->
|
|
61
|
+
<UButton
|
|
62
|
+
icon="i-lucide-navigation"
|
|
63
|
+
size="xs"
|
|
64
|
+
color="neutral"
|
|
65
|
+
variant="ghost"
|
|
66
|
+
@click="emit('follow', peer)"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -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;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['calendar']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useRendererBase } from "../../composables/useRendererBase";
|
|
4
|
+
import { DEFAULT_LOCALE } from "../../locale";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
docId: { type: String, required: true },
|
|
7
|
+
childProvider: { type: null, required: true },
|
|
8
|
+
docLabel: { type: String, required: true },
|
|
9
|
+
pageTypes: { type: Array, required: false },
|
|
10
|
+
labels: { type: Object, required: false }
|
|
11
|
+
});
|
|
12
|
+
const config = useRuntimeConfig();
|
|
13
|
+
const locale = computed(() => ({
|
|
14
|
+
...DEFAULT_LOCALE.renderers.calendar,
|
|
15
|
+
...config.public?.abracadabra?.locale?.renderers?.calendar ?? {},
|
|
16
|
+
...props.labels ?? {}
|
|
17
|
+
}));
|
|
18
|
+
const { tree } = useRendererBase(props);
|
|
19
|
+
const today = /* @__PURE__ */ new Date();
|
|
20
|
+
const viewYear = ref(today.getFullYear());
|
|
21
|
+
const viewMonth = ref(today.getMonth());
|
|
22
|
+
const monthName = computed(
|
|
23
|
+
() => new Date(viewYear.value, viewMonth.value, 1).toLocaleString("default", { month: "long", year: "numeric" })
|
|
24
|
+
);
|
|
25
|
+
function prevMonth() {
|
|
26
|
+
if (viewMonth.value === 0) {
|
|
27
|
+
viewMonth.value = 11;
|
|
28
|
+
viewYear.value--;
|
|
29
|
+
} else viewMonth.value--;
|
|
30
|
+
}
|
|
31
|
+
function nextMonth() {
|
|
32
|
+
if (viewMonth.value === 11) {
|
|
33
|
+
viewMonth.value = 0;
|
|
34
|
+
viewYear.value++;
|
|
35
|
+
} else viewMonth.value++;
|
|
36
|
+
}
|
|
37
|
+
const events = computed(() => tree.childrenOf(null));
|
|
38
|
+
function eventsOnDay(year, month, day) {
|
|
39
|
+
const dayStr = `${year}-${String(month + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
|
40
|
+
return events.value.filter((e) => {
|
|
41
|
+
const start = e.meta?.datetimeStart ?? e.meta?.dateStart;
|
|
42
|
+
if (!start) return false;
|
|
43
|
+
return start.startsWith(dayStr);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const calendarDays = computed(
|
|
47
|
+
() => {
|
|
48
|
+
const firstDay = new Date(viewYear.value, viewMonth.value, 1).getDay();
|
|
49
|
+
const daysInMonth = new Date(viewYear.value, viewMonth.value + 1, 0).getDate();
|
|
50
|
+
const days = [];
|
|
51
|
+
for (let i = 0; i < firstDay; i++) days.push({ day: null });
|
|
52
|
+
for (let d = 1; d <= daysInMonth; d++) days.push({ day: d });
|
|
53
|
+
return days;
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
function isToday(day) {
|
|
57
|
+
return day === today.getDate() && viewMonth.value === today.getMonth() && viewYear.value === today.getFullYear();
|
|
58
|
+
}
|
|
59
|
+
function addEvent(day) {
|
|
60
|
+
const dateStr = `${viewYear.value}-${String(viewMonth.value + 1).padStart(2, "0")}-${String(day).padStart(2, "0")}T09:00`;
|
|
61
|
+
const id = tree.createChild(null, locale.value.newEvent);
|
|
62
|
+
const entry = tree.treeMap.get(id);
|
|
63
|
+
if (entry) {
|
|
64
|
+
tree.treeMap.set(id, {
|
|
65
|
+
...entry,
|
|
66
|
+
meta: { datetimeStart: dateStr, datetimeEnd: dateStr },
|
|
67
|
+
updatedAt: Date.now()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
72
|
+
</script>
|
|
73
|
+
|
|
74
|
+
<template>
|
|
75
|
+
<div class="p-4 max-w-3xl">
|
|
76
|
+
<!-- Navigation -->
|
|
77
|
+
<div class="flex items-center gap-4 mb-4">
|
|
78
|
+
<UButton
|
|
79
|
+
icon="i-lucide-chevron-left"
|
|
80
|
+
variant="ghost"
|
|
81
|
+
color="neutral"
|
|
82
|
+
@click="prevMonth"
|
|
83
|
+
/>
|
|
84
|
+
<h2 class="text-lg font-semibold flex-1 text-center">{{ monthName }}</h2>
|
|
85
|
+
<UButton
|
|
86
|
+
icon="i-lucide-chevron-right"
|
|
87
|
+
variant="ghost"
|
|
88
|
+
color="neutral"
|
|
89
|
+
@click="nextMonth"
|
|
90
|
+
/>
|
|
91
|
+
<UButton
|
|
92
|
+
icon="i-lucide-today"
|
|
93
|
+
variant="soft"
|
|
94
|
+
color="neutral"
|
|
95
|
+
size="sm"
|
|
96
|
+
:label="locale.today"
|
|
97
|
+
@click="() => {
|
|
98
|
+
viewYear = today.getFullYear();
|
|
99
|
+
viewMonth = today.getMonth();
|
|
100
|
+
}"
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
<!-- Day headers -->
|
|
105
|
+
<div class="grid grid-cols-7 gap-px mb-1">
|
|
106
|
+
<div
|
|
107
|
+
v-for="name in dayNames"
|
|
108
|
+
:key="name"
|
|
109
|
+
class="text-center text-xs font-medium text-muted py-1"
|
|
110
|
+
>
|
|
111
|
+
{{ name }}
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<!-- Calendar grid -->
|
|
116
|
+
<div class="grid grid-cols-7 gap-px bg-muted rounded-lg overflow-hidden">
|
|
117
|
+
<div
|
|
118
|
+
v-for="(cell, idx) in calendarDays"
|
|
119
|
+
:key="idx"
|
|
120
|
+
class="bg-elevated min-h-[80px] p-1 text-sm"
|
|
121
|
+
:class="cell.day && isToday(cell.day) ? 'bg-primary/5' : ''"
|
|
122
|
+
>
|
|
123
|
+
<template v-if="cell.day !== null">
|
|
124
|
+
<div
|
|
125
|
+
class="flex items-center justify-between"
|
|
126
|
+
>
|
|
127
|
+
<span
|
|
128
|
+
class="text-xs font-medium"
|
|
129
|
+
:class="isToday(cell.day) ? 'text-primary font-bold' : 'text-muted'"
|
|
130
|
+
>{{ cell.day }}</span>
|
|
131
|
+
<UButton
|
|
132
|
+
icon="i-lucide-plus"
|
|
133
|
+
variant="ghost"
|
|
134
|
+
color="neutral"
|
|
135
|
+
size="xs"
|
|
136
|
+
class="opacity-0 hover:opacity-100 h-4 w-4"
|
|
137
|
+
@click="addEvent(cell.day)"
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="space-y-0.5 mt-0.5">
|
|
141
|
+
<div
|
|
142
|
+
v-for="ev in eventsOnDay(viewYear, viewMonth, cell.day)"
|
|
143
|
+
:key="ev.id"
|
|
144
|
+
class="text-xs px-1 py-0.5 rounded truncate"
|
|
145
|
+
:style="ev.meta?.color ? { backgroundColor: ev.meta.color + '33', color: ev.meta.color } : { backgroundColor: 'var(--color-primary-100)', color: 'var(--color-primary-700)' }"
|
|
146
|
+
>
|
|
147
|
+
{{ ev.label }}
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
</template>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['calendar']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['gallery']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useRendererBase } from "../../composables/useRendererBase";
|
|
4
|
+
import { DEFAULT_LOCALE } from "../../locale";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
docId: { type: String, required: true },
|
|
7
|
+
childProvider: { type: null, required: true },
|
|
8
|
+
docLabel: { type: String, required: true },
|
|
9
|
+
pageTypes: { type: Array, required: false },
|
|
10
|
+
labels: { type: Object, required: false }
|
|
11
|
+
});
|
|
12
|
+
const config = useRuntimeConfig();
|
|
13
|
+
const locale = computed(() => ({
|
|
14
|
+
...DEFAULT_LOCALE.renderers.gallery,
|
|
15
|
+
...config.public?.abracadabra?.locale?.renderers?.gallery ?? {},
|
|
16
|
+
...props.labels ?? {}
|
|
17
|
+
}));
|
|
18
|
+
const { tree } = useRendererBase(props);
|
|
19
|
+
const { client } = useAbracadabra();
|
|
20
|
+
const items = computed(() => tree.childrenOf(null).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)));
|
|
21
|
+
function addItem() {
|
|
22
|
+
tree.createChild(null, locale.value.untitled);
|
|
23
|
+
}
|
|
24
|
+
async function getCoverUrl(item) {
|
|
25
|
+
if (!item.meta?.coverUploadId || !item.meta?.coverDocId) return null;
|
|
26
|
+
const { getBlobUrl } = useFileBlobStore();
|
|
27
|
+
try {
|
|
28
|
+
return await getBlobUrl(item.meta.coverDocId, item.meta.coverUploadId);
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const colorMap = computed(() => {
|
|
34
|
+
const result = {};
|
|
35
|
+
for (const item of items.value) {
|
|
36
|
+
if (item.meta?.color) result[item.id] = item.meta.color;
|
|
37
|
+
else result[item.id] = null;
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div class="p-4">
|
|
45
|
+
<div class="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4">
|
|
46
|
+
<div
|
|
47
|
+
v-for="item in items"
|
|
48
|
+
:key="item.id"
|
|
49
|
+
class="group bg-elevated border border-muted rounded-lg overflow-hidden hover:shadow-md transition-shadow cursor-pointer"
|
|
50
|
+
>
|
|
51
|
+
<!-- Cover -->
|
|
52
|
+
<div
|
|
53
|
+
class="h-32 bg-muted flex items-center justify-center"
|
|
54
|
+
:style="item.meta?.color ? { backgroundColor: item.meta.color } : {}"
|
|
55
|
+
>
|
|
56
|
+
<UIcon name="i-lucide-image" class="size-8 text-muted/50" />
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<!-- Label -->
|
|
60
|
+
<div class="p-2">
|
|
61
|
+
<p class="text-sm font-medium truncate">{{ item.label }}</p>
|
|
62
|
+
<div
|
|
63
|
+
v-if="item.meta?.tags?.length"
|
|
64
|
+
class="flex flex-wrap gap-1 mt-1"
|
|
65
|
+
>
|
|
66
|
+
<UBadge
|
|
67
|
+
v-for="tag in item.meta.tags"
|
|
68
|
+
:key="tag"
|
|
69
|
+
variant="soft"
|
|
70
|
+
size="xs"
|
|
71
|
+
>{{ tag }}</UBadge>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- Add item tile -->
|
|
77
|
+
<div
|
|
78
|
+
class="h-[168px] border-2 border-dashed border-muted rounded-lg flex items-center justify-center cursor-pointer hover:border-primary transition-colors"
|
|
79
|
+
@click="addItem"
|
|
80
|
+
>
|
|
81
|
+
<div class="text-center text-muted">
|
|
82
|
+
<UIcon name="i-lucide-plus" class="size-6 mb-1" />
|
|
83
|
+
<p class="text-xs">{{ locale.addItem }}</p>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['gallery']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['kanban']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useRendererBase } from "../../composables/useRendererBase";
|
|
4
|
+
import { DEFAULT_LOCALE } from "../../locale";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
docId: { type: String, required: true },
|
|
7
|
+
childProvider: { type: null, required: true },
|
|
8
|
+
docLabel: { type: String, required: true },
|
|
9
|
+
pageTypes: { type: Array, required: false },
|
|
10
|
+
labels: { type: Object, required: false }
|
|
11
|
+
});
|
|
12
|
+
const config = useRuntimeConfig();
|
|
13
|
+
const locale = computed(() => ({
|
|
14
|
+
...DEFAULT_LOCALE.renderers.kanban,
|
|
15
|
+
...config.public?.abracadabra?.locale?.renderers?.kanban ?? {},
|
|
16
|
+
...props.labels ?? {}
|
|
17
|
+
}));
|
|
18
|
+
const { tree, childDoc } = useRendererBase(props);
|
|
19
|
+
const columns = computed(() => tree.childrenOf(null).sort((a, b) => (a.order ?? 0) - (b.order ?? 0)));
|
|
20
|
+
function cardsOf(colId) {
|
|
21
|
+
return tree.childrenOf(colId).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
22
|
+
}
|
|
23
|
+
const CARD_MIME = "application/x-abracadabra-card";
|
|
24
|
+
const COL_MIME = "application/x-abracadabra-col";
|
|
25
|
+
const draggingCardId = ref(null);
|
|
26
|
+
const draggingColId = ref(null);
|
|
27
|
+
const dragOverColId = ref(null);
|
|
28
|
+
const dragOverCardId = ref(null);
|
|
29
|
+
function onColDragStart(e, colId) {
|
|
30
|
+
draggingColId.value = colId;
|
|
31
|
+
e.dataTransfer?.setData(COL_MIME, colId);
|
|
32
|
+
}
|
|
33
|
+
function onColDragOver(e, colId) {
|
|
34
|
+
if (!draggingColId.value) return;
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
dragOverColId.value = colId;
|
|
37
|
+
}
|
|
38
|
+
function onColDrop(e, targetColId) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
const srcId = e.dataTransfer?.getData(COL_MIME) || draggingColId.value;
|
|
41
|
+
draggingColId.value = null;
|
|
42
|
+
dragOverColId.value = null;
|
|
43
|
+
if (!srcId || srcId === targetColId) return;
|
|
44
|
+
const targetCol = columns.value.find((c) => c.id === targetColId);
|
|
45
|
+
if (!targetCol) return;
|
|
46
|
+
const srcEntry = tree.treeMap.get(srcId);
|
|
47
|
+
if (!srcEntry) return;
|
|
48
|
+
tree.treeMap.set(srcId, { ...srcEntry, order: (targetCol.order ?? 0) - 0.5, updatedAt: Date.now() });
|
|
49
|
+
}
|
|
50
|
+
function onCardDragStart(e, cardId) {
|
|
51
|
+
draggingCardId.value = cardId;
|
|
52
|
+
e.dataTransfer?.setData(CARD_MIME, cardId);
|
|
53
|
+
e.stopPropagation();
|
|
54
|
+
}
|
|
55
|
+
function onCardDragOver(e, cardId) {
|
|
56
|
+
if (!draggingCardId.value) return;
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
dragOverCardId.value = cardId;
|
|
60
|
+
}
|
|
61
|
+
function onCardDropOnCard(e, targetCardId) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
e.stopPropagation();
|
|
64
|
+
const srcId = e.dataTransfer?.getData(CARD_MIME) || draggingCardId.value;
|
|
65
|
+
draggingCardId.value = null;
|
|
66
|
+
dragOverCardId.value = null;
|
|
67
|
+
if (!srcId || srcId === targetCardId) return;
|
|
68
|
+
const targetEntry = tree.treeMap.get(targetCardId);
|
|
69
|
+
const srcEntry = tree.treeMap.get(srcId);
|
|
70
|
+
if (!targetEntry || !srcEntry) return;
|
|
71
|
+
tree.treeMap.set(srcId, {
|
|
72
|
+
...srcEntry,
|
|
73
|
+
parentId: targetEntry.parentId,
|
|
74
|
+
order: (targetEntry.order ?? 0) - 0.5,
|
|
75
|
+
updatedAt: Date.now()
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function onCardDropOnColumn(e, colId) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
const srcId = e.dataTransfer?.getData(CARD_MIME) || draggingCardId.value;
|
|
81
|
+
draggingCardId.value = null;
|
|
82
|
+
dragOverCardId.value = null;
|
|
83
|
+
dragOverColId.value = null;
|
|
84
|
+
if (!srcId) return;
|
|
85
|
+
const srcEntry = tree.treeMap.get(srcId);
|
|
86
|
+
if (!srcEntry) return;
|
|
87
|
+
const existingCards = cardsOf(colId);
|
|
88
|
+
const maxOrder = existingCards.length ? Math.max(...existingCards.map((c) => c.order ?? 0)) : 0;
|
|
89
|
+
tree.treeMap.set(srcId, {
|
|
90
|
+
...srcEntry,
|
|
91
|
+
parentId: colId,
|
|
92
|
+
order: maxOrder + 1,
|
|
93
|
+
updatedAt: Date.now()
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function addColumn() {
|
|
97
|
+
tree.createChild(null, `${locale.value.newColumn} ${columns.value.length + 1}`);
|
|
98
|
+
}
|
|
99
|
+
function addCard(colId) {
|
|
100
|
+
tree.createChild(colId, locale.value.newCard);
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<template>
|
|
105
|
+
<div class="flex gap-4 p-4 overflow-x-auto h-full items-start">
|
|
106
|
+
<!-- Columns -->
|
|
107
|
+
<div
|
|
108
|
+
v-for="col in columns"
|
|
109
|
+
:key="col.id"
|
|
110
|
+
class="flex-shrink-0 w-64 bg-muted/50 rounded-lg p-2 flex flex-col gap-2 min-h-[200px]"
|
|
111
|
+
:class="dragOverColId === col.id ? 'ring-2 ring-primary' : ''"
|
|
112
|
+
draggable="true"
|
|
113
|
+
@dragstart="onColDragStart($event, col.id)"
|
|
114
|
+
@dragover="onColDragOver($event, col.id)"
|
|
115
|
+
@drop="onCardDropOnColumn($event, col.id)"
|
|
116
|
+
@dragleave="dragOverColId = null"
|
|
117
|
+
>
|
|
118
|
+
<!-- Column header -->
|
|
119
|
+
<div class="flex items-center gap-2 px-1">
|
|
120
|
+
<span class="font-medium text-sm flex-1 truncate">{{ col.label }}</span>
|
|
121
|
+
<UBadge
|
|
122
|
+
variant="soft"
|
|
123
|
+
size="xs"
|
|
124
|
+
>{{ cardsOf(col.id).length }}</UBadge>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- Cards -->
|
|
128
|
+
<div class="flex flex-col gap-1.5">
|
|
129
|
+
<div
|
|
130
|
+
v-for="card in cardsOf(col.id)"
|
|
131
|
+
:key="card.id"
|
|
132
|
+
class="bg-elevated border border-muted rounded-md p-2.5 text-sm cursor-grab active:cursor-grabbing select-none"
|
|
133
|
+
:class="dragOverCardId === card.id ? 'ring-2 ring-primary' : ''"
|
|
134
|
+
:style="card.meta?.color ? { borderLeftColor: card.meta.color, borderLeftWidth: '3px' } : {}"
|
|
135
|
+
draggable="true"
|
|
136
|
+
@dragstart="onCardDragStart($event, card.id)"
|
|
137
|
+
@dragover="onCardDragOver($event, card.id)"
|
|
138
|
+
@drop="onCardDropOnCard($event, card.id)"
|
|
139
|
+
>
|
|
140
|
+
<p class="font-medium">{{ card.label }}</p>
|
|
141
|
+
<div
|
|
142
|
+
v-if="card.meta?.tags?.length"
|
|
143
|
+
class="flex flex-wrap gap-1 mt-1"
|
|
144
|
+
>
|
|
145
|
+
<UBadge
|
|
146
|
+
v-for="tag in card.meta.tags"
|
|
147
|
+
:key="tag"
|
|
148
|
+
variant="soft"
|
|
149
|
+
size="xs"
|
|
150
|
+
>{{ tag }}</UBadge>
|
|
151
|
+
</div>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<!-- Add card button -->
|
|
156
|
+
<UButton
|
|
157
|
+
icon="i-lucide-plus"
|
|
158
|
+
variant="ghost"
|
|
159
|
+
color="neutral"
|
|
160
|
+
size="xs"
|
|
161
|
+
:label="locale.newCard"
|
|
162
|
+
class="w-full justify-start mt-auto"
|
|
163
|
+
@click="addCard(col.id)"
|
|
164
|
+
/>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<!-- Add column button -->
|
|
168
|
+
<div class="flex-shrink-0">
|
|
169
|
+
<UButton
|
|
170
|
+
icon="i-lucide-plus"
|
|
171
|
+
variant="soft"
|
|
172
|
+
color="neutral"
|
|
173
|
+
size="sm"
|
|
174
|
+
:label="locale.addColumn"
|
|
175
|
+
@click="addColumn"
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['kanban']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RendererBaseProps } from '../../composables/useRendererBase.js';
|
|
2
|
+
import type { AbracadabraLocale } from '../../locale.js';
|
|
3
|
+
type __VLS_Props = RendererBaseProps & {
|
|
4
|
+
labels?: Partial<AbracadabraLocale['renderers']['outline']>;
|
|
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<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|