@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,31 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useAbraLocale } from "../composables/useAbraLocale";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
open: { type: Boolean, required: false },
|
|
5
|
+
placeholder: { type: String, required: false },
|
|
6
|
+
labels: { type: Object, required: false }
|
|
7
|
+
});
|
|
8
|
+
const locale = useAbraLocale("commandPalette", props.labels);
|
|
9
|
+
const emit = defineEmits(["update:open"]);
|
|
10
|
+
const { isOpen, searchTerm, groups, toggle, close } = useCommandPalette();
|
|
11
|
+
watch(() => props.open, (v) => {
|
|
12
|
+
if (v !== void 0) isOpen.value = v;
|
|
13
|
+
});
|
|
14
|
+
watch(isOpen, (v) => emit("update:open", v));
|
|
15
|
+
defineShortcuts({ meta_k: toggle });
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<ClientOnly>
|
|
20
|
+
<UModal v-model:open="isOpen" :ui="{ content: 'p-0' }">
|
|
21
|
+
<template #content>
|
|
22
|
+
<UCommandPalette
|
|
23
|
+
v-model="searchTerm"
|
|
24
|
+
:groups="groups"
|
|
25
|
+
:placeholder="placeholder ?? locale.placeholder"
|
|
26
|
+
@update:model-value="searchTerm = $event"
|
|
27
|
+
/>
|
|
28
|
+
</template>
|
|
29
|
+
</UModal>
|
|
30
|
+
</ClientOnly>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
labels?: Partial<AbracadabraLocale['commandPalette']>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:open": (value: boolean) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type ConnectionStatusValue = 'disconnected' | 'connecting' | 'connected' | 'offline';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
status?: ConnectionStatusValue | string;
|
|
5
|
+
synced?: boolean;
|
|
6
|
+
variant?: 'badge' | 'chip' | 'dot';
|
|
7
|
+
labels?: Partial<AbracadabraLocale['connectionStatus']>;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
variant: "badge" | "chip" | "dot";
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useConnectionStatus } from "../composables/useConnectionStatus";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
status: { type: String, required: false },
|
|
5
|
+
synced: { type: Boolean, required: false },
|
|
6
|
+
variant: { type: String, required: false, default: "badge" },
|
|
7
|
+
labels: { type: Object, required: false }
|
|
8
|
+
});
|
|
9
|
+
const { label, color, icon } = useConnectionStatus(
|
|
10
|
+
props.status !== void 0 ? computed(() => props.status) : void 0,
|
|
11
|
+
props.synced !== void 0 ? computed(() => props.synced) : void 0
|
|
12
|
+
);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<!-- Badge variant: shows icon + text -->
|
|
17
|
+
<UBadge
|
|
18
|
+
v-if="variant === 'badge'"
|
|
19
|
+
:color="color"
|
|
20
|
+
:icon="icon"
|
|
21
|
+
variant="soft"
|
|
22
|
+
size="sm"
|
|
23
|
+
>
|
|
24
|
+
{{ label }}
|
|
25
|
+
</UBadge>
|
|
26
|
+
|
|
27
|
+
<!-- Chip variant: icon chip with tooltip -->
|
|
28
|
+
<UTooltip
|
|
29
|
+
v-else-if="variant === 'chip'"
|
|
30
|
+
:text="label"
|
|
31
|
+
>
|
|
32
|
+
<UChip
|
|
33
|
+
:color="color"
|
|
34
|
+
:icon="icon"
|
|
35
|
+
size="sm"
|
|
36
|
+
/>
|
|
37
|
+
</UTooltip>
|
|
38
|
+
|
|
39
|
+
<!-- Dot variant: small dot with tooltip -->
|
|
40
|
+
<UTooltip
|
|
41
|
+
v-else
|
|
42
|
+
:text="label"
|
|
43
|
+
>
|
|
44
|
+
<UChip
|
|
45
|
+
:color="color"
|
|
46
|
+
size="xs"
|
|
47
|
+
standalone
|
|
48
|
+
/>
|
|
49
|
+
</UTooltip>
|
|
50
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type ConnectionStatusValue = 'disconnected' | 'connecting' | 'connected' | 'offline';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
status?: ConnectionStatusValue | string;
|
|
5
|
+
synced?: boolean;
|
|
6
|
+
variant?: 'badge' | 'chip' | 'dot';
|
|
7
|
+
labels?: Partial<AbracadabraLocale['connectionStatus']>;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
variant: "badge" | "chip" | "dot";
|
|
11
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: string) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { getAvailableDocTypes } from "../utils/docTypes";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
modelValue: { type: String, required: true }
|
|
5
|
+
});
|
|
6
|
+
const emit = defineEmits(["update:modelValue"]);
|
|
7
|
+
const types = getAvailableDocTypes();
|
|
8
|
+
const items = computed(
|
|
9
|
+
() => types.map((t) => ({
|
|
10
|
+
label: t.label,
|
|
11
|
+
icon: t.icon,
|
|
12
|
+
value: t.type,
|
|
13
|
+
onSelect: () => emit("update:modelValue", t.type)
|
|
14
|
+
}))
|
|
15
|
+
);
|
|
16
|
+
const current = computed(() => types.find((t) => t.type === props.modelValue));
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<UDropdownMenu :items="items">
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
class="flex items-center gap-2 h-8 px-2 rounded-md border border-default hover:bg-elevated/60 transition-colors w-full"
|
|
24
|
+
>
|
|
25
|
+
<UIcon
|
|
26
|
+
v-if="current?.icon"
|
|
27
|
+
:name="current.icon"
|
|
28
|
+
class="size-4 text-muted shrink-0"
|
|
29
|
+
/>
|
|
30
|
+
<span class="text-sm flex-1 text-left truncate">{{ current?.label ?? modelValue }}</span>
|
|
31
|
+
<UIcon name="i-lucide-chevron-down" class="size-3 text-muted shrink-0" />
|
|
32
|
+
</button>
|
|
33
|
+
</UDropdownMenu>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (value: string) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
showTrash?: boolean;
|
|
4
|
+
allowFileDrop?: boolean;
|
|
5
|
+
draggable?: boolean;
|
|
6
|
+
selectedId?: string | null;
|
|
7
|
+
labels?: Partial<AbracadabraLocale['documentTree']>;
|
|
8
|
+
};
|
|
9
|
+
interface FlatItem {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
depth: number;
|
|
15
|
+
parentId: string | null;
|
|
16
|
+
order: number;
|
|
17
|
+
isExpanded: boolean;
|
|
18
|
+
hasChildren: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare var __VLS_1: {}, __VLS_20: {
|
|
21
|
+
entry: FlatItem;
|
|
22
|
+
depth: number;
|
|
23
|
+
isExpanded: boolean;
|
|
24
|
+
}, __VLS_42: {}, __VLS_85: {};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
header?: (props: typeof __VLS_1) => any;
|
|
27
|
+
} & {
|
|
28
|
+
item?: (props: typeof __VLS_20) => any;
|
|
29
|
+
} & {
|
|
30
|
+
empty?: (props: typeof __VLS_42) => any;
|
|
31
|
+
} & {
|
|
32
|
+
footer?: (props: typeof __VLS_85) => any;
|
|
33
|
+
};
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
|
+
select: (docId: string) => any;
|
|
36
|
+
create: (parentId: string | null) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
|
+
onSelect?: ((docId: string) => any) | undefined;
|
|
39
|
+
onCreate?: ((parentId: string | null) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
draggable: boolean;
|
|
42
|
+
showTrash: boolean;
|
|
43
|
+
allowFileDrop: boolean;
|
|
44
|
+
selectedId: string | null;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, shallowRef } from "vue";
|
|
3
|
+
import { useSyncedMap } from "../composables/useYDoc";
|
|
4
|
+
import { useDocImport } from "../composables/useDocImport";
|
|
5
|
+
import { useTrash } from "../composables/useTrash";
|
|
6
|
+
import { resolveDocType } from "../utils/docTypes";
|
|
7
|
+
import { useAbraLocale } from "../composables/useAbraLocale";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
showTrash: { type: Boolean, required: false, default: true },
|
|
10
|
+
allowFileDrop: { type: Boolean, required: false, default: true },
|
|
11
|
+
draggable: { type: Boolean, required: false, default: true },
|
|
12
|
+
selectedId: { type: [String, null], required: false, default: null },
|
|
13
|
+
labels: { type: Object, required: false }
|
|
14
|
+
});
|
|
15
|
+
const emit = defineEmits(["select", "create"]);
|
|
16
|
+
const locale = computed(() => useAbraLocale("documentTree", props.labels));
|
|
17
|
+
const { doc, registry } = useAbracadabra();
|
|
18
|
+
const rootDoc = doc;
|
|
19
|
+
const treeMap = useSyncedMap(rootDoc, "doc-tree");
|
|
20
|
+
const { trashedItems, restoreFromTrash, permanentlyDelete, emptyTrash } = useTrash();
|
|
21
|
+
const {
|
|
22
|
+
externalDragActive,
|
|
23
|
+
onDragEnter,
|
|
24
|
+
onDragLeave,
|
|
25
|
+
onDragOver,
|
|
26
|
+
onFileDrop
|
|
27
|
+
} = useDocImport();
|
|
28
|
+
const expandedIds = ref(/* @__PURE__ */ new Set());
|
|
29
|
+
const renamingId = ref(null);
|
|
30
|
+
const renameValue = ref("");
|
|
31
|
+
const allEntries = computed(
|
|
32
|
+
() => Object.entries(treeMap.data).map(([id, v]) => ({
|
|
33
|
+
id,
|
|
34
|
+
label: v.label || locale.value.untitled,
|
|
35
|
+
parentId: v.parentId,
|
|
36
|
+
order: v.order ?? 0,
|
|
37
|
+
type: v.type,
|
|
38
|
+
meta: v.meta
|
|
39
|
+
}))
|
|
40
|
+
);
|
|
41
|
+
function childrenOf(parentId) {
|
|
42
|
+
return allEntries.value.filter((e) => e.parentId === parentId).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
43
|
+
}
|
|
44
|
+
function hasChildren(id) {
|
|
45
|
+
return allEntries.value.some((e) => e.parentId === id);
|
|
46
|
+
}
|
|
47
|
+
function buildFlat(parentId, depth) {
|
|
48
|
+
const result = [];
|
|
49
|
+
for (const entry of childrenOf(parentId)) {
|
|
50
|
+
const expanded = expandedIds.value.has(entry.id);
|
|
51
|
+
result.push({
|
|
52
|
+
id: entry.id,
|
|
53
|
+
label: entry.label,
|
|
54
|
+
type: entry.type,
|
|
55
|
+
meta: entry.meta,
|
|
56
|
+
depth,
|
|
57
|
+
parentId: entry.parentId,
|
|
58
|
+
order: entry.order,
|
|
59
|
+
isExpanded: expanded,
|
|
60
|
+
hasChildren: hasChildren(entry.id)
|
|
61
|
+
});
|
|
62
|
+
if (expanded) {
|
|
63
|
+
result.push(...buildFlat(entry.id, depth + 1));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
const flatItems = computed(() => buildFlat(null, 0));
|
|
69
|
+
function toggleExpand(id) {
|
|
70
|
+
const next = new Set(expandedIds.value);
|
|
71
|
+
if (next.has(id)) next.delete(id);
|
|
72
|
+
else next.add(id);
|
|
73
|
+
expandedIds.value = next;
|
|
74
|
+
}
|
|
75
|
+
function startRename(id, label) {
|
|
76
|
+
renamingId.value = id;
|
|
77
|
+
renameValue.value = label;
|
|
78
|
+
nextTick(() => {
|
|
79
|
+
const input = document.getElementById(`rename-${id}`);
|
|
80
|
+
input?.select();
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function commitRename(id) {
|
|
84
|
+
const trimmed = renameValue.value.trim();
|
|
85
|
+
if (trimmed && trimmed !== treeMap.get(id)?.label) {
|
|
86
|
+
const entry = treeMap.get(id);
|
|
87
|
+
if (entry) treeMap.set(id, { ...entry, label: trimmed, updatedAt: Date.now() });
|
|
88
|
+
}
|
|
89
|
+
renamingId.value = null;
|
|
90
|
+
}
|
|
91
|
+
const DOC_DRAG_MIME = "application/x-abracadabra-doc";
|
|
92
|
+
const draggingId = ref(null);
|
|
93
|
+
const dragOverId = ref(null);
|
|
94
|
+
function onItemDragStart(e, id) {
|
|
95
|
+
if (!props.draggable) return;
|
|
96
|
+
draggingId.value = id;
|
|
97
|
+
e.dataTransfer?.setData(DOC_DRAG_MIME, id);
|
|
98
|
+
}
|
|
99
|
+
function onItemDragOver(e, id) {
|
|
100
|
+
if (!props.draggable || !draggingId.value) return;
|
|
101
|
+
e.preventDefault();
|
|
102
|
+
dragOverId.value = id;
|
|
103
|
+
}
|
|
104
|
+
function onItemDrop(e, targetId) {
|
|
105
|
+
e.preventDefault();
|
|
106
|
+
dragOverId.value = null;
|
|
107
|
+
const srcId = e.dataTransfer?.getData(DOC_DRAG_MIME) || draggingId.value;
|
|
108
|
+
draggingId.value = null;
|
|
109
|
+
if (!srcId || srcId === targetId) return;
|
|
110
|
+
const targetEntry = treeMap.get(targetId);
|
|
111
|
+
if (!targetEntry) return;
|
|
112
|
+
const srcEntry = treeMap.get(srcId);
|
|
113
|
+
if (!srcEntry) return;
|
|
114
|
+
treeMap.set(srcId, {
|
|
115
|
+
...srcEntry,
|
|
116
|
+
parentId: targetEntry.parentId,
|
|
117
|
+
order: (targetEntry.order ?? 0) - 0.5,
|
|
118
|
+
updatedAt: Date.now()
|
|
119
|
+
});
|
|
120
|
+
expandedIds.value = new Set(expandedIds.value);
|
|
121
|
+
}
|
|
122
|
+
function onItemDragEnd() {
|
|
123
|
+
draggingId.value = null;
|
|
124
|
+
dragOverId.value = null;
|
|
125
|
+
}
|
|
126
|
+
function getContextItems(item) {
|
|
127
|
+
return [
|
|
128
|
+
[
|
|
129
|
+
{
|
|
130
|
+
label: locale.value.rename,
|
|
131
|
+
icon: "i-lucide-pencil",
|
|
132
|
+
onSelect: () => startRename(item.id, item.label)
|
|
133
|
+
}
|
|
134
|
+
],
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
label: locale.value.newChild,
|
|
138
|
+
icon: "i-lucide-file-plus",
|
|
139
|
+
onSelect: () => emit("create", item.id)
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
[
|
|
143
|
+
{
|
|
144
|
+
label: locale.value.moveToTrash,
|
|
145
|
+
icon: "i-lucide-trash",
|
|
146
|
+
color: "error",
|
|
147
|
+
onSelect: () => {
|
|
148
|
+
const entry = treeMap.get(item.id);
|
|
149
|
+
if (!entry) return;
|
|
150
|
+
const { moveToTrash } = useTrash();
|
|
151
|
+
moveToTrash(item.id);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
const showTrashExpanded = ref(false);
|
|
158
|
+
</script>
|
|
159
|
+
|
|
160
|
+
<template>
|
|
161
|
+
<div
|
|
162
|
+
class="flex flex-col h-full overflow-hidden"
|
|
163
|
+
:class="externalDragActive ? 'ring-2 ring-primary ring-inset' : ''"
|
|
164
|
+
@dragenter="allowFileDrop ? onDragEnter($event) : void 0"
|
|
165
|
+
@dragleave="allowFileDrop ? onDragLeave($event) : void 0"
|
|
166
|
+
@dragover="allowFileDrop ? onDragOver($event) : void 0"
|
|
167
|
+
@drop="allowFileDrop ? onFileDrop($event) : void 0"
|
|
168
|
+
>
|
|
169
|
+
<!-- Header slot -->
|
|
170
|
+
<slot name="header" />
|
|
171
|
+
|
|
172
|
+
<!-- File drop overlay -->
|
|
173
|
+
<div
|
|
174
|
+
v-if="externalDragActive"
|
|
175
|
+
class="absolute inset-0 z-10 bg-primary/10 flex items-center justify-center pointer-events-none rounded-lg"
|
|
176
|
+
>
|
|
177
|
+
<div class="text-center">
|
|
178
|
+
<UIcon name="i-lucide-upload" class="size-8 text-primary mb-2" />
|
|
179
|
+
<p class="text-sm text-primary font-medium">{{ locale.dropFilesHere }}</p>
|
|
180
|
+
</div>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<!-- Tree items -->
|
|
184
|
+
<div class="flex-1 overflow-y-auto py-1">
|
|
185
|
+
<template v-if="flatItems.length">
|
|
186
|
+
<div
|
|
187
|
+
v-for="item in flatItems"
|
|
188
|
+
:key="item.id"
|
|
189
|
+
:style="{ paddingLeft: `${item.depth * 16 + 8}px` }"
|
|
190
|
+
:draggable="draggable"
|
|
191
|
+
:class="[
|
|
192
|
+
'group flex items-center gap-1.5 pr-2 py-0.5 rounded-md cursor-pointer text-sm select-none',
|
|
193
|
+
selectedId === item.id ? 'bg-primary/10 text-primary' : 'hover:bg-muted text-default',
|
|
194
|
+
dragOverId === item.id ? 'bg-primary/20' : ''
|
|
195
|
+
]"
|
|
196
|
+
@click="emit('select', item.id)"
|
|
197
|
+
@dblclick="startRename(item.id, item.label)"
|
|
198
|
+
@dragstart="onItemDragStart($event, item.id)"
|
|
199
|
+
@dragover="onItemDragOver($event, item.id)"
|
|
200
|
+
@drop="onItemDrop($event, item.id)"
|
|
201
|
+
@dragend="onItemDragEnd"
|
|
202
|
+
>
|
|
203
|
+
<!-- Expand toggle -->
|
|
204
|
+
<UButton
|
|
205
|
+
:icon="item.isExpanded ? 'i-lucide-chevron-down' : 'i-lucide-chevron-right'"
|
|
206
|
+
variant="ghost"
|
|
207
|
+
color="neutral"
|
|
208
|
+
size="xs"
|
|
209
|
+
:class="item.hasChildren ? 'opacity-100' : 'opacity-0 pointer-events-none'"
|
|
210
|
+
@click.stop="toggleExpand(item.id)"
|
|
211
|
+
/>
|
|
212
|
+
|
|
213
|
+
<!-- Doc icon: custom meta.icon > doc type default -->
|
|
214
|
+
<UIcon
|
|
215
|
+
:name="item.meta?.icon ?? resolveDocType(item.type, registry).icon"
|
|
216
|
+
class="size-3.5 flex-shrink-0"
|
|
217
|
+
:style="item.meta?.color ? `color: ${item.meta.color}` : ''"
|
|
218
|
+
:class="item.meta?.color ? '' : 'text-muted'"
|
|
219
|
+
/>
|
|
220
|
+
<!-- Color dot (shown only if color set but no custom icon) -->
|
|
221
|
+
<span
|
|
222
|
+
v-if="item.meta?.color && !item.meta?.icon"
|
|
223
|
+
class="size-1.5 rounded-full shrink-0 -ml-1"
|
|
224
|
+
:style="`background: ${item.meta.color}`"
|
|
225
|
+
/>
|
|
226
|
+
|
|
227
|
+
<!-- Slot override or default label -->
|
|
228
|
+
<slot
|
|
229
|
+
name="item"
|
|
230
|
+
:entry="item"
|
|
231
|
+
:depth="item.depth"
|
|
232
|
+
:is-expanded="item.isExpanded"
|
|
233
|
+
>
|
|
234
|
+
<template v-if="renamingId === item.id">
|
|
235
|
+
<input
|
|
236
|
+
:id="`rename-${item.id}`"
|
|
237
|
+
v-model="renameValue"
|
|
238
|
+
class="flex-1 min-w-0 bg-transparent border-none outline-none text-sm"
|
|
239
|
+
@blur="commitRename(item.id)"
|
|
240
|
+
@keydown.enter.stop="commitRename(item.id)"
|
|
241
|
+
@keydown.escape.stop="renamingId = null"
|
|
242
|
+
@click.stop
|
|
243
|
+
>
|
|
244
|
+
</template>
|
|
245
|
+
<span
|
|
246
|
+
v-else
|
|
247
|
+
class="flex-1 min-w-0 truncate"
|
|
248
|
+
>{{ item.label }}</span>
|
|
249
|
+
</slot>
|
|
250
|
+
|
|
251
|
+
<!-- Context menu -->
|
|
252
|
+
<UDropdownMenu
|
|
253
|
+
:items="getContextItems(item)"
|
|
254
|
+
:content="{ align: 'end' }"
|
|
255
|
+
>
|
|
256
|
+
<UButton
|
|
257
|
+
icon="i-lucide-ellipsis"
|
|
258
|
+
variant="ghost"
|
|
259
|
+
color="neutral"
|
|
260
|
+
size="xs"
|
|
261
|
+
class="opacity-0 group-hover:opacity-100 flex-shrink-0"
|
|
262
|
+
@click.stop
|
|
263
|
+
/>
|
|
264
|
+
</UDropdownMenu>
|
|
265
|
+
</div>
|
|
266
|
+
</template>
|
|
267
|
+
|
|
268
|
+
<!-- New doc button -->
|
|
269
|
+
<div class="px-2 py-1">
|
|
270
|
+
<UButton
|
|
271
|
+
icon="i-lucide-plus"
|
|
272
|
+
variant="ghost"
|
|
273
|
+
color="neutral"
|
|
274
|
+
size="xs"
|
|
275
|
+
:label="locale.newDocument"
|
|
276
|
+
class="w-full justify-start text-muted"
|
|
277
|
+
@click="emit('create', null)"
|
|
278
|
+
/>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<!-- Empty state -->
|
|
282
|
+
<div
|
|
283
|
+
v-if="!flatItems.length"
|
|
284
|
+
class="px-4 py-8 text-center"
|
|
285
|
+
>
|
|
286
|
+
<slot name="empty">
|
|
287
|
+
<p class="text-sm text-muted">{{ locale.noDocuments }}</p>
|
|
288
|
+
</slot>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<!-- Trash section -->
|
|
292
|
+
<template v-if="showTrash && trashedItems.length">
|
|
293
|
+
<USeparator class="my-2" />
|
|
294
|
+
<div
|
|
295
|
+
class="flex items-center gap-1 px-2 py-1 cursor-pointer text-muted hover:text-default"
|
|
296
|
+
@click="showTrashExpanded = !showTrashExpanded"
|
|
297
|
+
>
|
|
298
|
+
<UIcon name="i-lucide-trash" class="size-4" />
|
|
299
|
+
<span class="text-xs font-medium flex-1">{{ locale.trash }} ({{ trashedItems.length }})</span>
|
|
300
|
+
<UIcon
|
|
301
|
+
:name="showTrashExpanded ? 'i-lucide-chevron-down' : 'i-lucide-chevron-right'"
|
|
302
|
+
class="size-3"
|
|
303
|
+
/>
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
<template v-if="showTrashExpanded">
|
|
307
|
+
<div
|
|
308
|
+
v-for="item in trashedItems"
|
|
309
|
+
:key="item.id"
|
|
310
|
+
class="group flex items-center gap-1.5 pl-4 pr-2 py-0.5 text-sm text-muted"
|
|
311
|
+
>
|
|
312
|
+
<UIcon name="i-lucide-file-text" class="size-4 flex-shrink-0" />
|
|
313
|
+
<span class="flex-1 min-w-0 truncate">{{ item.label }}</span>
|
|
314
|
+
<UButton
|
|
315
|
+
icon="i-lucide-rotate-ccw"
|
|
316
|
+
variant="ghost"
|
|
317
|
+
color="neutral"
|
|
318
|
+
size="xs"
|
|
319
|
+
class="opacity-0 group-hover:opacity-100"
|
|
320
|
+
@click="restoreFromTrash(item.id)"
|
|
321
|
+
/>
|
|
322
|
+
<UButton
|
|
323
|
+
icon="i-lucide-trash-2"
|
|
324
|
+
variant="ghost"
|
|
325
|
+
color="error"
|
|
326
|
+
size="xs"
|
|
327
|
+
class="opacity-0 group-hover:opacity-100"
|
|
328
|
+
@click="permanentlyDelete(item.id)"
|
|
329
|
+
/>
|
|
330
|
+
</div>
|
|
331
|
+
|
|
332
|
+
<div class="px-2 py-1">
|
|
333
|
+
<UButton
|
|
334
|
+
icon="i-lucide-trash-2"
|
|
335
|
+
variant="ghost"
|
|
336
|
+
color="error"
|
|
337
|
+
size="xs"
|
|
338
|
+
:label="locale.emptyTrash"
|
|
339
|
+
class="w-full justify-start"
|
|
340
|
+
@click="emptyTrash()"
|
|
341
|
+
/>
|
|
342
|
+
</div>
|
|
343
|
+
</template>
|
|
344
|
+
</template>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<!-- Footer slot -->
|
|
348
|
+
<slot name="footer" />
|
|
349
|
+
</div>
|
|
350
|
+
</template>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
showTrash?: boolean;
|
|
4
|
+
allowFileDrop?: boolean;
|
|
5
|
+
draggable?: boolean;
|
|
6
|
+
selectedId?: string | null;
|
|
7
|
+
labels?: Partial<AbracadabraLocale['documentTree']>;
|
|
8
|
+
};
|
|
9
|
+
interface FlatItem {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
type?: string;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
depth: number;
|
|
15
|
+
parentId: string | null;
|
|
16
|
+
order: number;
|
|
17
|
+
isExpanded: boolean;
|
|
18
|
+
hasChildren: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare var __VLS_1: {}, __VLS_20: {
|
|
21
|
+
entry: FlatItem;
|
|
22
|
+
depth: number;
|
|
23
|
+
isExpanded: boolean;
|
|
24
|
+
}, __VLS_42: {}, __VLS_85: {};
|
|
25
|
+
type __VLS_Slots = {} & {
|
|
26
|
+
header?: (props: typeof __VLS_1) => any;
|
|
27
|
+
} & {
|
|
28
|
+
item?: (props: typeof __VLS_20) => any;
|
|
29
|
+
} & {
|
|
30
|
+
empty?: (props: typeof __VLS_42) => any;
|
|
31
|
+
} & {
|
|
32
|
+
footer?: (props: typeof __VLS_85) => any;
|
|
33
|
+
};
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
|
+
select: (docId: string) => any;
|
|
36
|
+
create: (parentId: string | null) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
38
|
+
onSelect?: ((docId: string) => any) | undefined;
|
|
39
|
+
onCreate?: ((parentId: string | null) => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
draggable: boolean;
|
|
42
|
+
showTrash: boolean;
|
|
43
|
+
allowFileDrop: boolean;
|
|
44
|
+
selectedId: string | null;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|