@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,60 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Y.Doc ID to load as a child document */
|
|
3
|
+
docId: string;
|
|
4
|
+
/** Current document label from the doc-tree — used for header↔label sync */
|
|
5
|
+
docLabel?: string;
|
|
6
|
+
/** Content type: 'json' | 'html' | 'markdown'. Default: 'json' */
|
|
7
|
+
contentType?: 'json' | 'html' | 'markdown';
|
|
8
|
+
/** Whether the editor is editable. Default: true */
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
/** Placeholder text shown in empty documents */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Whether to show the bubble toolbar (appears on text selection). Set false to use slot. */
|
|
13
|
+
showToolbar?: boolean;
|
|
14
|
+
/** Whether to show the slash command suggestion menu. Set false to use slot. */
|
|
15
|
+
showSuggestionMenu?: boolean;
|
|
16
|
+
/** Whether to show the drag handle (plus + grip buttons). Set false to use slot. */
|
|
17
|
+
showDragHandle?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
modelValue?: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
+
declare var __VLS_18: {
|
|
24
|
+
editor: any;
|
|
25
|
+
connectedUsers: {
|
|
26
|
+
name: string;
|
|
27
|
+
color: string;
|
|
28
|
+
publicKey?: string | undefined;
|
|
29
|
+
docId?: string | undefined;
|
|
30
|
+
}[];
|
|
31
|
+
ready: boolean;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Slots = {} & {
|
|
34
|
+
default?: (props: typeof __VLS_18) => any;
|
|
35
|
+
};
|
|
36
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:modelValue": (value: any) => any;
|
|
38
|
+
rename: (label: string) => any;
|
|
39
|
+
ready: () => any;
|
|
40
|
+
update: (content: any) => any;
|
|
41
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
42
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
43
|
+
onRename?: ((label: string) => any) | undefined;
|
|
44
|
+
onReady?: (() => any) | undefined;
|
|
45
|
+
onUpdate?: ((content: any) => any) | undefined;
|
|
46
|
+
}>, {
|
|
47
|
+
contentType: "json" | "html" | "markdown";
|
|
48
|
+
editable: boolean;
|
|
49
|
+
showToolbar: boolean;
|
|
50
|
+
showSuggestionMenu: boolean;
|
|
51
|
+
showDragHandle: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
54
|
+
declare const _default: typeof __VLS_export;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shallowRef, ref, watch, computed, nextTick } from "vue";
|
|
3
|
+
import { useEditor } from "../composables/useEditor";
|
|
4
|
+
import { useEditorToolbar } from "../composables/useEditorToolbar";
|
|
5
|
+
import { useEditorSuggestions } from "../composables/useEditorSuggestions";
|
|
6
|
+
import { useEditorDragHandle } from "../composables/useEditorDragHandle";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
docId: { type: String, required: true },
|
|
9
|
+
docLabel: { type: String, required: false },
|
|
10
|
+
contentType: { type: String, required: false, default: "json" },
|
|
11
|
+
editable: { type: Boolean, required: false, default: true },
|
|
12
|
+
placeholder: { type: String, required: false },
|
|
13
|
+
showToolbar: { type: Boolean, required: false, default: true },
|
|
14
|
+
showSuggestionMenu: { type: Boolean, required: false, default: true },
|
|
15
|
+
showDragHandle: { type: Boolean, required: false, default: true }
|
|
16
|
+
});
|
|
17
|
+
const emit = defineEmits(["ready", "update", "rename"]);
|
|
18
|
+
const model = defineModel({ type: null });
|
|
19
|
+
const { provider, registry } = useNuxtApp().$abracadabra;
|
|
20
|
+
const childProvider = shallowRef(null);
|
|
21
|
+
watch(provider, async (prov) => {
|
|
22
|
+
if (!prov || !props.docId) return;
|
|
23
|
+
try {
|
|
24
|
+
childProvider.value = await prov.loadChild(props.docId);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error("[AEditor] Failed to load child provider:", e);
|
|
27
|
+
}
|
|
28
|
+
}, { immediate: true });
|
|
29
|
+
const { extensions, connectedUsers, ready } = useEditor({
|
|
30
|
+
childProvider,
|
|
31
|
+
docId: props.docId
|
|
32
|
+
});
|
|
33
|
+
watch(ready, (val) => {
|
|
34
|
+
if (val) emit("ready");
|
|
35
|
+
});
|
|
36
|
+
const editorRef = ref(null);
|
|
37
|
+
const currentEditor = shallowRef(null);
|
|
38
|
+
const { items: toolbarItems } = useEditorToolbar({ docId: props.docId });
|
|
39
|
+
const { items: suggestionItems } = useEditorSuggestions({ docId: props.docId });
|
|
40
|
+
const dragHandle = useEditorDragHandle();
|
|
41
|
+
const _syncingFromDocLabel = ref(false);
|
|
42
|
+
const _lastEmittedHeader = ref("");
|
|
43
|
+
watch(model, (val) => {
|
|
44
|
+
if (_syncingFromDocLabel.value) return;
|
|
45
|
+
if (!val || typeof val !== "object" || !val.content?.length) return;
|
|
46
|
+
const headerNode = val.content[0];
|
|
47
|
+
if (headerNode?.type !== "documentHeader") return;
|
|
48
|
+
const text = (headerNode.content ?? []).map((n) => n.text ?? "").join("");
|
|
49
|
+
if (text !== _lastEmittedHeader.value) {
|
|
50
|
+
_lastEmittedHeader.value = text;
|
|
51
|
+
emit("rename", text || "Untitled");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
watch(() => props.docLabel, (newLabel) => {
|
|
55
|
+
if (!newLabel || _syncingFromDocLabel.value) return;
|
|
56
|
+
const editor = editorRef.value?.editor;
|
|
57
|
+
if (!editor) return;
|
|
58
|
+
const first = editor.state.doc.firstChild;
|
|
59
|
+
if (!first || first.type.name !== "documentHeader") return;
|
|
60
|
+
if (first.textContent === newLabel) return;
|
|
61
|
+
_syncingFromDocLabel.value = true;
|
|
62
|
+
const { tr, schema } = editor.state;
|
|
63
|
+
const to = 1 + first.content.size;
|
|
64
|
+
if (newLabel) {
|
|
65
|
+
tr.replaceWith(1, to, schema.text(newLabel));
|
|
66
|
+
} else {
|
|
67
|
+
tr.delete(1, to);
|
|
68
|
+
}
|
|
69
|
+
editor.view.dispatch(tr);
|
|
70
|
+
nextTick(() => {
|
|
71
|
+
_syncingFromDocLabel.value = false;
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const mentionItems = computed(
|
|
75
|
+
() => registry.getAllMentionProviders().flatMap((p) => p.label ? [p] : [])
|
|
76
|
+
);
|
|
77
|
+
function onPlusClick(e, onClick) {
|
|
78
|
+
e.stopPropagation();
|
|
79
|
+
onClick();
|
|
80
|
+
const editor = editorRef.value?.editor;
|
|
81
|
+
if (!editor) return;
|
|
82
|
+
editor.chain().focus().insertContent("/").run();
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<template>
|
|
87
|
+
<ClientOnly>
|
|
88
|
+
<!-- Loading skeleton while extensions and child provider are loading -->
|
|
89
|
+
<div v-if="!extensions.length" class="p-6 space-y-3">
|
|
90
|
+
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
91
|
+
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
92
|
+
<div class="h-4 w-3/4 animate-pulse rounded bg-elevated" />
|
|
93
|
+
<div class="h-4 w-5/6 animate-pulse rounded bg-elevated" />
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<UEditor
|
|
97
|
+
v-else
|
|
98
|
+
ref="editorRef"
|
|
99
|
+
v-model="model"
|
|
100
|
+
:content-type="contentType"
|
|
101
|
+
:editable="editable"
|
|
102
|
+
:extensions="extensions"
|
|
103
|
+
:starter-kit="{ undoRedo: false, codeBlock: false, document: false }"
|
|
104
|
+
:placeholder="placeholder"
|
|
105
|
+
v-slot="{ editor }"
|
|
106
|
+
@update:model-value="emit('update', $event)"
|
|
107
|
+
>
|
|
108
|
+
<!-- Default slot: app can override entire editor content -->
|
|
109
|
+
<slot :editor="editor" :connected-users="connectedUsers" :ready="ready">
|
|
110
|
+
<!-- ── Bubble toolbar (appears when text is selected) ─────────────── -->
|
|
111
|
+
<UEditorToolbar
|
|
112
|
+
v-if="showToolbar"
|
|
113
|
+
:editor="editor"
|
|
114
|
+
:items="toolbarItems"
|
|
115
|
+
layout="bubble"
|
|
116
|
+
:should-show="({ view, state }) => view.hasFocus() && !state.selection.empty"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<!-- ── Slash command menu ──────────────────────────────────────────── -->
|
|
120
|
+
<UEditorSuggestionMenu
|
|
121
|
+
v-if="showSuggestionMenu"
|
|
122
|
+
:editor="editor"
|
|
123
|
+
:items="suggestionItems"
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
<!-- ── Drag handle — plus button + grip dropdown ───────────────────── -->
|
|
127
|
+
<UEditorDragHandle
|
|
128
|
+
v-if="showDragHandle"
|
|
129
|
+
:editor="editor"
|
|
130
|
+
v-slot="{ ui, onClick }"
|
|
131
|
+
@node-change="dragHandle.onNodeChange"
|
|
132
|
+
>
|
|
133
|
+
<!-- Plus: insert block via slash menu -->
|
|
134
|
+
<UButton
|
|
135
|
+
icon="i-lucide-plus"
|
|
136
|
+
color="neutral"
|
|
137
|
+
variant="ghost"
|
|
138
|
+
size="sm"
|
|
139
|
+
:class="ui.handle()"
|
|
140
|
+
@click="(e) => onPlusClick(e, onClick)"
|
|
141
|
+
/>
|
|
142
|
+
|
|
143
|
+
<!-- Grip: block context menu -->
|
|
144
|
+
<UDropdownMenu
|
|
145
|
+
v-slot="{ open }"
|
|
146
|
+
:modal="false"
|
|
147
|
+
:items="dragHandle.getItems(editor)"
|
|
148
|
+
:content="{ side: 'left' }"
|
|
149
|
+
:ui="{ content: 'w-48', label: 'text-xs' }"
|
|
150
|
+
@update:open="(v) => editor.chain().setMeta('lockDragHandle', v).run()"
|
|
151
|
+
>
|
|
152
|
+
<UButton
|
|
153
|
+
color="neutral"
|
|
154
|
+
variant="ghost"
|
|
155
|
+
:active-variant="'soft'"
|
|
156
|
+
size="sm"
|
|
157
|
+
icon="i-lucide-grip-vertical"
|
|
158
|
+
:active="open"
|
|
159
|
+
:class="ui.handle()"
|
|
160
|
+
/>
|
|
161
|
+
</UDropdownMenu>
|
|
162
|
+
</UEditorDragHandle>
|
|
163
|
+
</slot>
|
|
164
|
+
</UEditor>
|
|
165
|
+
|
|
166
|
+
<template #fallback>
|
|
167
|
+
<div class="p-6 space-y-3">
|
|
168
|
+
<div class="h-8 w-64 animate-pulse rounded bg-elevated" />
|
|
169
|
+
<div class="h-4 w-full animate-pulse rounded bg-elevated" />
|
|
170
|
+
<div class="h-4 w-3/4 animate-pulse rounded bg-elevated" />
|
|
171
|
+
</div>
|
|
172
|
+
</template>
|
|
173
|
+
</ClientOnly>
|
|
174
|
+
</template>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** Y.Doc ID to load as a child document */
|
|
3
|
+
docId: string;
|
|
4
|
+
/** Current document label from the doc-tree — used for header↔label sync */
|
|
5
|
+
docLabel?: string;
|
|
6
|
+
/** Content type: 'json' | 'html' | 'markdown'. Default: 'json' */
|
|
7
|
+
contentType?: 'json' | 'html' | 'markdown';
|
|
8
|
+
/** Whether the editor is editable. Default: true */
|
|
9
|
+
editable?: boolean;
|
|
10
|
+
/** Placeholder text shown in empty documents */
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Whether to show the bubble toolbar (appears on text selection). Set false to use slot. */
|
|
13
|
+
showToolbar?: boolean;
|
|
14
|
+
/** Whether to show the slash command suggestion menu. Set false to use slot. */
|
|
15
|
+
showSuggestionMenu?: boolean;
|
|
16
|
+
/** Whether to show the drag handle (plus + grip buttons). Set false to use slot. */
|
|
17
|
+
showDragHandle?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_ModelProps = {
|
|
20
|
+
modelValue?: any;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
23
|
+
declare var __VLS_18: {
|
|
24
|
+
editor: any;
|
|
25
|
+
connectedUsers: {
|
|
26
|
+
name: string;
|
|
27
|
+
color: string;
|
|
28
|
+
publicKey?: string | undefined;
|
|
29
|
+
docId?: string | undefined;
|
|
30
|
+
}[];
|
|
31
|
+
ready: boolean;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Slots = {} & {
|
|
34
|
+
default?: (props: typeof __VLS_18) => any;
|
|
35
|
+
};
|
|
36
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:modelValue": (value: any) => any;
|
|
38
|
+
rename: (label: string) => any;
|
|
39
|
+
ready: () => any;
|
|
40
|
+
update: (content: any) => any;
|
|
41
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
42
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
43
|
+
onRename?: ((label: string) => any) | undefined;
|
|
44
|
+
onReady?: (() => any) | undefined;
|
|
45
|
+
onUpdate?: ((content: any) => any) | undefined;
|
|
46
|
+
}>, {
|
|
47
|
+
contentType: "json" | "html" | "markdown";
|
|
48
|
+
editable: boolean;
|
|
49
|
+
showToolbar: boolean;
|
|
50
|
+
showSuggestionMenu: boolean;
|
|
51
|
+
showDragHandle: boolean;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
53
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
54
|
+
declare const _default: typeof __VLS_export;
|
|
55
|
+
export default _default;
|
|
56
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
57
|
+
new (): {
|
|
58
|
+
$slots: S;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
windowId: string;
|
|
4
|
+
labels?: Partial<AbracadabraLocale['floatingWindow']>;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_6: {
|
|
7
|
+
window: any;
|
|
8
|
+
}, __VLS_29: {
|
|
9
|
+
window: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
'header-extra'?: (props: typeof __VLS_6) => any;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: typeof __VLS_29) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: 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>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, watch } from "vue";
|
|
3
|
+
import { useAbraLocale } from "../composables/useAbraLocale";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
windowId: { type: String, required: true },
|
|
6
|
+
labels: { type: Object, required: false }
|
|
7
|
+
});
|
|
8
|
+
const locale = useAbraLocale("floatingWindow", props.labels);
|
|
9
|
+
const SNAP_THRESHOLD = 20;
|
|
10
|
+
const MIN_WIDTH = 280;
|
|
11
|
+
const MIN_HEIGHT = 180;
|
|
12
|
+
const {
|
|
13
|
+
windows,
|
|
14
|
+
closeWindow,
|
|
15
|
+
focusWindow,
|
|
16
|
+
minimizeWindow,
|
|
17
|
+
restoreWindow,
|
|
18
|
+
toggleMaximize,
|
|
19
|
+
moveWindow,
|
|
20
|
+
resizeWindow
|
|
21
|
+
} = useWindowManager();
|
|
22
|
+
const win = computed(() => windows.value.get(props.windowId));
|
|
23
|
+
const isAnimatingOut = ref(false);
|
|
24
|
+
const animStyle = ref({});
|
|
25
|
+
watch(() => win.value?.minimized, (minimized, wasMinimized) => {
|
|
26
|
+
if (minimized && !wasMinimized) {
|
|
27
|
+
const w = win.value;
|
|
28
|
+
if (!w) return;
|
|
29
|
+
const target = w.minimizeTarget;
|
|
30
|
+
if (target) {
|
|
31
|
+
animStyle.value = {
|
|
32
|
+
left: `${target.x}px`,
|
|
33
|
+
top: `${target.y}px`,
|
|
34
|
+
width: "40px",
|
|
35
|
+
height: "40px",
|
|
36
|
+
opacity: "0",
|
|
37
|
+
transition: "all 0.25s ease"
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
} else if (!minimized && wasMinimized) {
|
|
41
|
+
animStyle.value = {};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
let dragStart = null;
|
|
45
|
+
let wasMaximized = false;
|
|
46
|
+
function onHeaderPointerDown(e) {
|
|
47
|
+
if (e.target.closest("[data-no-drag]")) return;
|
|
48
|
+
const w = win.value;
|
|
49
|
+
if (!w || w.minimized) return;
|
|
50
|
+
focusWindow(props.windowId);
|
|
51
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
52
|
+
wasMaximized = w.maximized;
|
|
53
|
+
dragStart = { mx: e.clientX, my: e.clientY, wx: w.x, wy: w.y };
|
|
54
|
+
}
|
|
55
|
+
function onHeaderPointerMove(e) {
|
|
56
|
+
if (!dragStart) return;
|
|
57
|
+
const w = win.value;
|
|
58
|
+
if (!w) return;
|
|
59
|
+
if (wasMaximized && w.maximized) {
|
|
60
|
+
const dx = Math.abs(e.clientX - dragStart.mx);
|
|
61
|
+
const dy = Math.abs(e.clientY - dragStart.my);
|
|
62
|
+
if (dx < 5 && dy < 5) return;
|
|
63
|
+
toggleMaximize(props.windowId);
|
|
64
|
+
dragStart.wx = e.clientX - (w.width ?? 600) * 0.5;
|
|
65
|
+
dragStart.wy = dragStart.my - 20;
|
|
66
|
+
wasMaximized = false;
|
|
67
|
+
}
|
|
68
|
+
let nx = dragStart.wx + (e.clientX - dragStart.mx);
|
|
69
|
+
let ny = dragStart.wy + (e.clientY - dragStart.my);
|
|
70
|
+
const vw = window.innerWidth;
|
|
71
|
+
const vh = window.innerHeight;
|
|
72
|
+
const ww = w.width ?? 600;
|
|
73
|
+
const wh = w.height ?? 400;
|
|
74
|
+
if (Math.abs(nx) < SNAP_THRESHOLD) nx = 0;
|
|
75
|
+
if (Math.abs(ny) < SNAP_THRESHOLD) ny = 0;
|
|
76
|
+
if (Math.abs(nx + ww - vw) < SNAP_THRESHOLD) nx = vw - ww;
|
|
77
|
+
if (Math.abs(ny + wh - vh) < SNAP_THRESHOLD) ny = vh - wh;
|
|
78
|
+
moveWindow(props.windowId, nx, ny);
|
|
79
|
+
}
|
|
80
|
+
function onHeaderPointerUp() {
|
|
81
|
+
dragStart = null;
|
|
82
|
+
}
|
|
83
|
+
let resizeDir = null;
|
|
84
|
+
let resizeStart = null;
|
|
85
|
+
function onResizePointerDown(e, dir) {
|
|
86
|
+
const w = win.value;
|
|
87
|
+
if (!w || w.maximized) return;
|
|
88
|
+
e.preventDefault();
|
|
89
|
+
focusWindow(props.windowId);
|
|
90
|
+
e.target.setPointerCapture(e.pointerId);
|
|
91
|
+
resizeDir = dir;
|
|
92
|
+
resizeStart = { mx: e.clientX, my: e.clientY, wx: w.x, wy: w.y, ww: w.width ?? 600, wh: w.height ?? 400 };
|
|
93
|
+
}
|
|
94
|
+
function onResizePointerMove(e) {
|
|
95
|
+
if (!resizeDir || !resizeStart) return;
|
|
96
|
+
const dx = e.clientX - resizeStart.mx;
|
|
97
|
+
const dy = e.clientY - resizeStart.my;
|
|
98
|
+
let { wx, wy, ww, wh } = resizeStart;
|
|
99
|
+
if (resizeDir.includes("e")) ww = Math.max(MIN_WIDTH, ww + dx);
|
|
100
|
+
if (resizeDir.includes("s")) wh = Math.max(MIN_HEIGHT, wh + dy);
|
|
101
|
+
if (resizeDir.includes("w")) {
|
|
102
|
+
const nw = Math.max(MIN_WIDTH, ww - dx);
|
|
103
|
+
wx = wx + ww - nw;
|
|
104
|
+
ww = nw;
|
|
105
|
+
}
|
|
106
|
+
if (resizeDir.includes("n")) {
|
|
107
|
+
const nh = Math.max(MIN_HEIGHT, wh - dy);
|
|
108
|
+
wy = wy + wh - nh;
|
|
109
|
+
wh = nh;
|
|
110
|
+
}
|
|
111
|
+
moveWindow(props.windowId, wx, wy);
|
|
112
|
+
resizeWindow(props.windowId, ww, wh);
|
|
113
|
+
}
|
|
114
|
+
function onResizePointerUp() {
|
|
115
|
+
resizeDir = null;
|
|
116
|
+
resizeStart = null;
|
|
117
|
+
}
|
|
118
|
+
const resizeCursors = {
|
|
119
|
+
n: "ns-resize",
|
|
120
|
+
s: "ns-resize",
|
|
121
|
+
e: "ew-resize",
|
|
122
|
+
w: "ew-resize",
|
|
123
|
+
ne: "nesw-resize",
|
|
124
|
+
sw: "nesw-resize",
|
|
125
|
+
nw: "nwse-resize",
|
|
126
|
+
se: "nwse-resize"
|
|
127
|
+
};
|
|
128
|
+
const resizeDirs = ["n", "ne", "e", "se", "s", "sw", "w", "nw"];
|
|
129
|
+
const resizeEdgeClass = {
|
|
130
|
+
n: "absolute top-0 left-2 right-2 h-1",
|
|
131
|
+
s: "absolute bottom-0 left-2 right-2 h-1",
|
|
132
|
+
e: "absolute top-2 right-0 bottom-2 w-1",
|
|
133
|
+
w: "absolute top-2 left-0 bottom-2 w-1",
|
|
134
|
+
ne: "absolute top-0 right-0 w-3 h-3",
|
|
135
|
+
nw: "absolute top-0 left-0 w-3 h-3",
|
|
136
|
+
se: "absolute bottom-0 right-0 w-3 h-3",
|
|
137
|
+
sw: "absolute bottom-0 left-0 w-3 h-3"
|
|
138
|
+
};
|
|
139
|
+
const windowStyle = computed(() => {
|
|
140
|
+
const w = win.value;
|
|
141
|
+
if (!w) return {};
|
|
142
|
+
if (w.minimized) return animStyle.value;
|
|
143
|
+
if (w.maximized) return { left: "0", top: "0", width: "100vw", height: "100vh", zIndex: String(w.zIndex) };
|
|
144
|
+
return {
|
|
145
|
+
left: `${w.x}px`,
|
|
146
|
+
top: `${w.y}px`,
|
|
147
|
+
width: `${w.width ?? 600}px`,
|
|
148
|
+
height: `${w.height ?? 400}px`,
|
|
149
|
+
zIndex: String(w.zIndex),
|
|
150
|
+
...animStyle.value
|
|
151
|
+
};
|
|
152
|
+
});
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<template>
|
|
156
|
+
<div
|
|
157
|
+
v-if="win && !win.minimized"
|
|
158
|
+
:style="windowStyle"
|
|
159
|
+
class="absolute pointer-events-auto flex flex-col bg-elevated border border-muted rounded-xl shadow-xl overflow-hidden backdrop-blur-sm"
|
|
160
|
+
@pointerdown="focusWindow(windowId)"
|
|
161
|
+
>
|
|
162
|
+
<!-- Resize handles -->
|
|
163
|
+
<template v-if="!win.maximized">
|
|
164
|
+
<div
|
|
165
|
+
v-for="dir in resizeDirs"
|
|
166
|
+
:key="dir"
|
|
167
|
+
:class="resizeEdgeClass[dir]"
|
|
168
|
+
:style="{ cursor: resizeCursors[dir] }"
|
|
169
|
+
class="z-10"
|
|
170
|
+
@pointerdown.stop="onResizePointerDown($event, dir)"
|
|
171
|
+
@pointermove="onResizePointerMove"
|
|
172
|
+
@pointerup="onResizePointerUp"
|
|
173
|
+
/>
|
|
174
|
+
</template>
|
|
175
|
+
|
|
176
|
+
<!-- Header -->
|
|
177
|
+
<div
|
|
178
|
+
class="flex items-center gap-2 px-3 py-2 border-b border-muted select-none bg-muted/30"
|
|
179
|
+
:style="{ cursor: win.maximized ? 'default' : 'grab' }"
|
|
180
|
+
@pointerdown="onHeaderPointerDown"
|
|
181
|
+
@pointermove="onHeaderPointerMove"
|
|
182
|
+
@pointerup="onHeaderPointerUp"
|
|
183
|
+
>
|
|
184
|
+
<UIcon
|
|
185
|
+
v-if="win.icon"
|
|
186
|
+
:name="win.icon"
|
|
187
|
+
class="size-4 text-muted flex-shrink-0"
|
|
188
|
+
/>
|
|
189
|
+
<span class="flex-1 text-sm font-medium text-default truncate">{{ win.title }}</span>
|
|
190
|
+
|
|
191
|
+
<slot
|
|
192
|
+
name="header-extra"
|
|
193
|
+
:window="win"
|
|
194
|
+
/>
|
|
195
|
+
|
|
196
|
+
<div
|
|
197
|
+
class="flex items-center gap-0.5"
|
|
198
|
+
data-no-drag
|
|
199
|
+
>
|
|
200
|
+
<UButton
|
|
201
|
+
icon="i-lucide-minus"
|
|
202
|
+
color="neutral"
|
|
203
|
+
variant="ghost"
|
|
204
|
+
size="xs"
|
|
205
|
+
:aria-label="locale.minimize"
|
|
206
|
+
@click.stop="minimizeWindow(windowId)"
|
|
207
|
+
/>
|
|
208
|
+
<UButton
|
|
209
|
+
:icon="win.maximized ? 'i-lucide-minimize-2' : 'i-lucide-maximize-2'"
|
|
210
|
+
color="neutral"
|
|
211
|
+
variant="ghost"
|
|
212
|
+
size="xs"
|
|
213
|
+
:aria-label="win.maximized ? locale.restore : locale.maximize"
|
|
214
|
+
@click.stop="toggleMaximize(windowId)"
|
|
215
|
+
/>
|
|
216
|
+
<UButton
|
|
217
|
+
icon="i-lucide-x"
|
|
218
|
+
color="neutral"
|
|
219
|
+
variant="ghost"
|
|
220
|
+
size="xs"
|
|
221
|
+
:aria-label="locale.close"
|
|
222
|
+
@click.stop="closeWindow(windowId)"
|
|
223
|
+
/>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
|
|
227
|
+
<!-- Content -->
|
|
228
|
+
<div class="flex-1 min-h-0 overflow-auto">
|
|
229
|
+
<slot :window="win" />
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
windowId: string;
|
|
4
|
+
labels?: Partial<AbracadabraLocale['floatingWindow']>;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_6: {
|
|
7
|
+
window: any;
|
|
8
|
+
}, __VLS_29: {
|
|
9
|
+
window: any;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
'header-extra'?: (props: typeof __VLS_6) => any;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: typeof __VLS_29) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: 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>;
|
|
17
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
|
+
declare const _default: typeof __VLS_export;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AbracadabraLocale } from '../locale.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
labels?: Partial<AbracadabraLocale['iconPicker']>;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
9
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
10
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|