@abraca/nuxt 0.2.0 → 1.5.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/dist/module.d.mts +72 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +139 -3
- package/dist/runtime/assets/editor.css +1 -0
- package/dist/runtime/components/AAccountSwitcherModal.d.vue.ts +10 -0
- package/dist/runtime/components/AAccountSwitcherModal.vue +158 -0
- package/dist/runtime/components/AAccountSwitcherModal.vue.d.ts +10 -0
- package/dist/runtime/components/AClaimAccountModal.d.vue.ts +10 -0
- package/dist/runtime/components/AClaimAccountModal.vue +230 -0
- package/dist/runtime/components/AClaimAccountModal.vue.d.ts +10 -0
- package/dist/runtime/components/ACollaborationUsers.vue +1 -0
- package/dist/runtime/components/AColorPicker.vue +4 -2
- package/dist/runtime/components/ACommandPalette.vue +8 -3
- package/dist/runtime/components/AConnectServerModal.d.vue.ts +12 -0
- package/dist/runtime/components/AConnectServerModal.vue +200 -0
- package/dist/runtime/components/AConnectServerModal.vue.d.ts +12 -0
- package/dist/runtime/components/AConnectionStatus.vue +1 -0
- package/dist/runtime/components/ADocPickModal.d.vue.ts +13 -0
- package/dist/runtime/components/ADocPickModal.vue +71 -0
- package/dist/runtime/components/ADocPickModal.vue.d.ts +13 -0
- package/dist/runtime/components/ADocRenderer.d.vue.ts +29 -0
- package/dist/runtime/components/ADocRenderer.vue +105 -0
- package/dist/runtime/components/ADocRenderer.vue.d.ts +29 -0
- package/dist/runtime/components/ADocTypeSelect.vue +8 -4
- package/dist/runtime/components/ADocumentTree.d.vue.ts +3 -3
- package/dist/runtime/components/ADocumentTree.vue +196 -29
- package/dist/runtime/components/ADocumentTree.vue.d.ts +3 -3
- package/dist/runtime/components/AEditor.d.vue.ts +9 -4
- package/dist/runtime/components/AEditor.vue +118 -8
- package/dist/runtime/components/AEditor.vue.d.ts +9 -4
- package/dist/runtime/components/AFloatingWindow.d.vue.ts +54 -2
- package/dist/runtime/components/AFloatingWindow.vue +15 -14
- package/dist/runtime/components/AFloatingWindow.vue.d.ts +54 -2
- package/dist/runtime/components/AIconPicker.vue +10 -2
- package/dist/runtime/components/AInviteRedeemModal.d.vue.ts +10 -0
- package/dist/runtime/components/AInviteRedeemModal.vue +122 -0
- package/dist/runtime/components/AInviteRedeemModal.vue.d.ts +10 -0
- package/dist/runtime/components/ANodePanel.vue +109 -62
- package/dist/runtime/components/ANotifications.vue +37 -8
- package/dist/runtime/components/APermissionGuard.vue +4 -1
- package/dist/runtime/components/APresence.vue +15 -3
- package/dist/runtime/components/AProvider.d.vue.ts +0 -1
- package/dist/runtime/components/AProvider.vue +24 -5
- package/dist/runtime/components/AProvider.vue.d.ts +0 -1
- package/dist/runtime/components/ARoleBadge.vue +1 -0
- package/dist/runtime/components/ASpaceFormModal.d.vue.ts +16 -0
- package/dist/runtime/components/ASpaceFormModal.vue +182 -0
- package/dist/runtime/components/ASpaceFormModal.vue.d.ts +16 -0
- package/dist/runtime/components/AVoiceBar.vue +60 -16
- package/dist/runtime/components/AVoiceTile.vue +5 -1
- package/dist/runtime/components/AWindowLayer.vue +1 -0
- package/dist/runtime/components/aware/AArea.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AArea.vue +3 -2
- package/dist/runtime/components/aware/AArea.vue.d.ts +1 -1
- package/dist/runtime/components/aware/AAvatar.vue +87 -16
- package/dist/runtime/components/aware/AButton.vue +7 -2
- package/dist/runtime/components/aware/ACursorLabel.vue +6 -1
- package/dist/runtime/components/aware/ADocBadge.vue +6 -1
- package/dist/runtime/components/aware/AFacepile.vue +15 -3
- package/dist/runtime/components/aware/AInput.vue +8 -3
- package/dist/runtime/components/aware/ASelect.vue +3 -2
- package/dist/runtime/components/aware/ATextarea.vue +8 -3
- package/dist/runtime/components/aware/AUserList.vue +10 -2
- package/dist/runtime/components/chat/AChatAgentStatus.d.vue.ts +15 -0
- package/dist/runtime/components/chat/AChatAgentStatus.vue +95 -0
- package/dist/runtime/components/chat/AChatAgentStatus.vue.d.ts +15 -0
- package/dist/runtime/components/chat/AChatDocLink.d.vue.ts +18 -0
- package/dist/runtime/components/chat/AChatDocLink.vue +29 -0
- package/dist/runtime/components/chat/AChatDocLink.vue.d.ts +18 -0
- package/dist/runtime/components/chat/AChatDocQuote.d.vue.ts +26 -0
- package/dist/runtime/components/chat/AChatDocQuote.vue +47 -0
- package/dist/runtime/components/chat/AChatDocQuote.vue.d.ts +26 -0
- package/dist/runtime/components/chat/AChatInput.d.vue.ts +45 -0
- package/dist/runtime/components/chat/AChatInput.vue +219 -0
- package/dist/runtime/components/chat/AChatInput.vue.d.ts +45 -0
- package/dist/runtime/components/chat/AChatList.d.vue.ts +59 -0
- package/dist/runtime/components/chat/AChatList.vue +184 -0
- package/dist/runtime/components/chat/AChatList.vue.d.ts +59 -0
- package/dist/runtime/components/chat/AChatMemberList.d.vue.ts +24 -0
- package/dist/runtime/components/chat/AChatMemberList.vue +97 -0
- package/dist/runtime/components/chat/AChatMemberList.vue.d.ts +24 -0
- package/dist/runtime/components/chat/AChatMessages.d.vue.ts +31 -0
- package/dist/runtime/components/chat/AChatMessages.vue +161 -0
- package/dist/runtime/components/chat/AChatMessages.vue.d.ts +31 -0
- package/dist/runtime/components/chat/AChatPanel.d.vue.ts +84 -0
- package/dist/runtime/components/chat/AChatPanel.vue +89 -0
- package/dist/runtime/components/chat/AChatPanel.vue.d.ts +84 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.d.vue.ts +11 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.vue +58 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.vue.d.ts +11 -0
- package/dist/runtime/components/editor/AColorPalettePopover.d.vue.ts +23 -0
- package/dist/runtime/components/editor/AColorPalettePopover.vue +71 -0
- package/dist/runtime/components/editor/AColorPalettePopover.vue.d.ts +23 -0
- package/dist/runtime/components/editor/ADocLinkPopover.d.vue.ts +7 -0
- package/dist/runtime/components/editor/ADocLinkPopover.vue +74 -0
- package/dist/runtime/components/editor/ADocLinkPopover.vue.d.ts +7 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.d.vue.ts +10 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.vue +353 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.vue.d.ts +10 -0
- package/dist/runtime/components/editor/AFileGlbViewer.d.vue.ts +13 -0
- package/dist/runtime/components/editor/AFileGlbViewer.vue +187 -0
- package/dist/runtime/components/editor/AFileGlbViewer.vue.d.ts +13 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.d.vue.ts +7 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.vue +62 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.vue.d.ts +7 -0
- package/dist/runtime/components/editor/ALinkPopover.d.vue.ts +8 -0
- package/dist/runtime/components/editor/ALinkPopover.vue +149 -0
- package/dist/runtime/components/editor/ALinkPopover.vue.d.ts +8 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.d.vue.ts +28 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.vue +232 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.d.vue.ts +14 -1
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +279 -125
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +14 -1
- package/dist/runtime/components/renderers/ACallRenderer.d.vue.ts +13 -0
- package/dist/runtime/components/renderers/ACallRenderer.vue +172 -0
- package/dist/runtime/components/renderers/ACallRenderer.vue.d.ts +13 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue +582 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.vue +1374 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/AGalleryCoverImage.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryCoverImage.vue +60 -0
- package/dist/runtime/components/renderers/AGalleryCoverImage.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/AGalleryRenderer.d.vue.ts +12 -1
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +327 -53
- package/dist/runtime/components/renderers/AGalleryRenderer.vue.d.ts +12 -1
- package/dist/runtime/components/renderers/AGraphRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/AGraphRenderer.vue +1030 -0
- package/dist/runtime/components/renderers/AGraphRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/AKanbanRenderer.d.vue.ts +13 -1
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +490 -140
- package/dist/runtime/components/renderers/AKanbanRenderer.vue.d.ts +13 -1
- package/dist/runtime/components/renderers/AMapRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/AMapRenderer.vue +1624 -0
- package/dist/runtime/components/renderers/AMapRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/AMediaRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue +224 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.d.vue.ts +12 -1
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +295 -134
- package/dist/runtime/components/renderers/AOutlineRenderer.vue.d.ts +12 -1
- package/dist/runtime/components/renderers/ASpatialRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/ASpatialRenderer.vue +436 -0
- package/dist/runtime/components/renderers/ASpatialRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/ATableRenderer.d.vue.ts +12 -1
- package/dist/runtime/components/renderers/ATableRenderer.vue +459 -147
- package/dist/runtime/components/renderers/ATableRenderer.vue.d.ts +12 -1
- package/dist/runtime/components/renderers/ATimelineRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +468 -0
- package/dist/runtime/components/renderers/ATimelineRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.d.vue.ts +41 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue +109 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue.d.ts +41 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.d.vue.ts +49 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue +152 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue.d.ts +49 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.d.vue.ts +39 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue +101 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue.d.ts +39 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.d.vue.ts +43 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue +87 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue.d.ts +43 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +38 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue +206 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +38 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.d.vue.ts +28 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.vue +33 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.d.vue.ts +50 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue +188 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue.d.ts +50 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.d.vue.ts +25 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.vue +115 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.vue.d.ts +25 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.d.vue.ts +21 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.vue +61 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.vue.d.ts +21 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +22 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.vue +98 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +22 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.d.vue.ts +20 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue +26 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue.d.ts +20 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue +257 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue +18 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue +53 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.d.vue.ts +25 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue +129 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue.d.ts +25 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.d.vue.ts +21 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.vue +370 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.vue.d.ts +21 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.d.vue.ts +22 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.vue +106 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.vue.d.ts +22 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.d.vue.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.vue +54 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.vue.d.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue +67 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.vue +91 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.vue +30 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.vue +76 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.vue +54 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.vue +35 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.d.vue.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.vue +111 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.vue.d.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.vue +35 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.vue +92 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.vue +44 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.vue +31 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.vue +63 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.vue +53 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.d.vue.ts +26 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue +59 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue.d.ts +26 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.d.vue.ts +28 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue +109 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.d.vue.ts +43 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue +168 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue.d.ts +43 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.d.vue.ts +24 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue +46 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue.d.ts +24 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.d.vue.ts +34 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue +193 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue.d.ts +34 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.vue +159 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.vue +146 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.vue +157 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.vue +134 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsModal.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsModal.vue +176 -0
- package/dist/runtime/components/settings/ASettingsModal.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.vue +170 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.vue +96 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.vue +223 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.vue +312 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.vue +195 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.vue +135 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.vue.d.ts +3 -0
- package/dist/runtime/components/shell/AChildContextMenu.d.vue.ts +30 -0
- package/dist/runtime/components/shell/AChildContextMenu.vue +48 -0
- package/dist/runtime/components/shell/AChildContextMenu.vue.d.ts +30 -0
- package/dist/runtime/components/shell/ACursorOverlay.d.vue.ts +11 -0
- package/dist/runtime/components/shell/ACursorOverlay.vue +55 -0
- package/dist/runtime/components/shell/ACursorOverlay.vue.d.ts +11 -0
- package/dist/runtime/components/shell/ADocDragGhost.d.vue.ts +3 -0
- package/dist/runtime/components/shell/ADocDragGhost.vue +58 -0
- package/dist/runtime/components/shell/ADocDragGhost.vue.d.ts +3 -0
- package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +111 -0
- package/dist/runtime/components/shell/ADocPanelSettings.vue +621 -0
- package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +111 -0
- package/dist/runtime/components/shell/AFavoritesList.d.vue.ts +27 -0
- package/dist/runtime/components/shell/AFavoritesList.vue +83 -0
- package/dist/runtime/components/shell/AFavoritesList.vue.d.ts +27 -0
- package/dist/runtime/components/shell/ANodeContextMenu.d.vue.ts +17 -0
- package/dist/runtime/components/shell/ANodeContextMenu.vue +14 -0
- package/dist/runtime/components/shell/ANodeContextMenu.vue.d.ts +17 -0
- package/dist/runtime/components/shell/ASidebar.d.vue.ts +54 -0
- package/dist/runtime/components/shell/ASidebar.vue +92 -0
- package/dist/runtime/components/shell/ASidebar.vue.d.ts +54 -0
- package/dist/runtime/components/shell/ASidebarToggle.d.vue.ts +7 -0
- package/dist/runtime/components/shell/ASidebarToggle.vue +23 -0
- package/dist/runtime/components/shell/ASidebarToggle.vue.d.ts +7 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.d.vue.ts +32 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.vue +63 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.vue.d.ts +32 -0
- package/dist/runtime/components/shell/ASyncStatus.d.vue.ts +25 -0
- package/dist/runtime/components/shell/ASyncStatus.vue +96 -0
- package/dist/runtime/components/shell/ASyncStatus.vue.d.ts +25 -0
- package/dist/runtime/components/shell/AUserMenu.d.vue.ts +28 -0
- package/dist/runtime/components/shell/AUserMenu.vue +79 -0
- package/dist/runtime/components/shell/AUserMenu.vue.d.ts +28 -0
- package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +54 -0
- package/dist/runtime/components/shell/AUserProfilePopover.vue +176 -0
- package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +54 -0
- package/dist/runtime/components/shell/AWelcomeScreen.d.vue.ts +96 -0
- package/dist/runtime/components/shell/AWelcomeScreen.vue +422 -0
- package/dist/runtime/components/shell/AWelcomeScreen.vue.d.ts +96 -0
- package/dist/runtime/composables/useAAField.js +2 -0
- package/dist/runtime/composables/useAbraLocale.js +1 -0
- package/dist/runtime/composables/useAbracadabra.js +1 -0
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +3 -4
- package/dist/runtime/composables/useAbracadabraAuth.js +4 -0
- package/dist/runtime/composables/useAwareness.js +6 -0
- package/dist/runtime/composables/useAwarenessPeers.js +1 -0
- package/dist/runtime/composables/useBackgroundSync.d.ts +5 -0
- package/dist/runtime/composables/useBackgroundSync.js +24 -3
- package/dist/runtime/composables/useBroadcastSync.d.ts +18 -0
- package/dist/runtime/composables/useBroadcastSync.js +26 -0
- package/dist/runtime/composables/useCalendarView.d.ts +86 -0
- package/dist/runtime/composables/useCalendarView.js +316 -0
- package/dist/runtime/composables/useChat.d.ts +2 -1
- package/dist/runtime/composables/useChat.js +21 -12
- package/dist/runtime/composables/useChatUsers.js +3 -1
- package/dist/runtime/composables/useChildTree.d.ts +4 -2
- package/dist/runtime/composables/useChildTree.js +31 -21
- package/dist/runtime/composables/useCommandPalette.js +77 -19
- package/dist/runtime/composables/useConnectionStatus.d.ts +1 -1
- package/dist/runtime/composables/useConnectionStatus.js +8 -1
- package/dist/runtime/composables/useCrossWindowSync.d.ts +11 -0
- package/dist/runtime/composables/useCrossWindowSync.js +38 -0
- package/dist/runtime/composables/useDashboard.js +17 -9
- package/dist/runtime/composables/useDevicePairing.d.ts +58 -0
- package/dist/runtime/composables/useDevicePairing.js +110 -0
- package/dist/runtime/composables/useDocDragBus.d.ts +28 -0
- package/dist/runtime/composables/useDocDragBus.js +22 -0
- package/dist/runtime/composables/useDocDropZone.d.ts +51 -0
- package/dist/runtime/composables/useDocDropZone.js +84 -0
- package/dist/runtime/composables/useDocExport.d.ts +5 -0
- package/dist/runtime/composables/useDocExport.js +4 -2
- package/dist/runtime/composables/useDocImport.js +5 -3
- package/dist/runtime/composables/useDocLabels.d.ts +22 -0
- package/dist/runtime/composables/useDocLabels.js +11 -0
- package/dist/runtime/composables/useDocLinkPick.d.ts +18 -0
- package/dist/runtime/composables/useDocLinkPick.js +22 -0
- package/dist/runtime/composables/useDocSeo.d.ts +20 -0
- package/dist/runtime/composables/useDocSeo.js +45 -0
- package/dist/runtime/composables/useDocSlugs.d.ts +7 -0
- package/dist/runtime/composables/useDocSlugs.js +23 -0
- package/dist/runtime/composables/useDocTree.d.ts +35 -0
- package/dist/runtime/composables/useDocTree.js +39 -0
- package/dist/runtime/composables/useEditor.js +1 -0
- package/dist/runtime/composables/useEditorDragHandle.js +4 -1
- package/dist/runtime/composables/useEditorEmojis.d.ts +22 -0
- package/dist/runtime/composables/useEditorEmojis.js +57 -0
- package/dist/runtime/composables/useEditorMentions.d.ts +10 -3
- package/dist/runtime/composables/useEditorMentions.js +35 -5
- package/dist/runtime/composables/useEditorSuggestions.d.ts +2 -1
- package/dist/runtime/composables/useEditorSuggestions.js +36 -21
- package/dist/runtime/composables/useEditorToolbar.d.ts +1 -1
- package/dist/runtime/composables/useEditorToolbar.js +5 -1
- package/dist/runtime/composables/useFavorites.d.ts +13 -0
- package/dist/runtime/composables/useFavorites.js +42 -0
- package/dist/runtime/composables/useFileIndex.js +4 -1
- package/dist/runtime/composables/useFileTransfer.d.ts +112 -0
- package/dist/runtime/composables/useFileTransfer.js +183 -0
- package/dist/runtime/composables/useFollowUser.js +4 -1
- package/dist/runtime/composables/useIdentityDoc.d.ts +89 -0
- package/dist/runtime/composables/useIdentityDoc.js +349 -0
- package/dist/runtime/composables/useInstalledPlugins.d.ts +31 -0
- package/dist/runtime/composables/useInstalledPlugins.js +58 -0
- package/dist/runtime/composables/useInvites.d.ts +56 -0
- package/dist/runtime/composables/useInvites.js +78 -0
- package/dist/runtime/composables/useJoinLink.d.ts +25 -0
- package/dist/runtime/composables/useJoinLink.js +58 -0
- package/dist/runtime/composables/useMediaExtractor.d.ts +31 -0
- package/dist/runtime/composables/useMediaExtractor.js +46 -0
- package/dist/runtime/composables/useMediaPlayback.d.ts +43 -0
- package/dist/runtime/composables/useMediaPlayback.js +465 -0
- package/dist/runtime/composables/useNodeContextMenu.d.ts +26 -0
- package/dist/runtime/composables/useNodeContextMenu.js +99 -0
- package/dist/runtime/composables/useNodePanel.d.ts +20 -0
- package/dist/runtime/composables/useNodePanel.js +89 -0
- package/dist/runtime/composables/useNodePanelFollow.d.ts +2 -0
- package/dist/runtime/composables/useNodePanelFollow.js +37 -0
- package/dist/runtime/composables/useNotifications.d.ts +1 -0
- package/dist/runtime/composables/useNotifications.js +9 -2
- package/dist/runtime/composables/usePasskeyAccounts.js +4 -2
- package/dist/runtime/composables/usePluginRegistry.js +1 -0
- package/dist/runtime/composables/useRendererBase.d.ts +16 -1
- package/dist/runtime/composables/useRendererBase.js +10 -1
- package/dist/runtime/composables/useSearchIndex.d.ts +1 -0
- package/dist/runtime/composables/useSearchIndex.js +15 -5
- package/dist/runtime/composables/useServerInfo.d.ts +31 -0
- package/dist/runtime/composables/useServerInfo.js +80 -0
- package/dist/runtime/composables/useSettingsModal.d.ts +18 -0
- package/dist/runtime/composables/useSettingsModal.js +30 -0
- package/dist/runtime/composables/useSlideoverSwipe.d.ts +39 -0
- package/dist/runtime/composables/useSlideoverSwipe.js +48 -0
- package/dist/runtime/composables/useSlugRoute.d.ts +6 -0
- package/dist/runtime/composables/useSlugRoute.js +21 -0
- package/dist/runtime/composables/useSpaces.d.ts +37 -0
- package/dist/runtime/composables/useSpaces.js +85 -0
- package/dist/runtime/composables/useSpatialCamera.d.ts +16 -0
- package/dist/runtime/composables/useSpatialCamera.js +175 -0
- package/dist/runtime/composables/useSpatialDrag.d.ts +14 -0
- package/dist/runtime/composables/useSpatialDrag.js +137 -0
- package/dist/runtime/composables/useTableView.d.ts +29 -0
- package/dist/runtime/composables/useTableView.js +184 -0
- package/dist/runtime/composables/useTimelineView.d.ts +55 -0
- package/dist/runtime/composables/useTimelineView.js +434 -0
- package/dist/runtime/composables/useTiptapDragState.d.ts +8 -0
- package/dist/runtime/composables/useTiptapDragState.js +5 -0
- package/dist/runtime/composables/useTouchDrag.d.ts +36 -0
- package/dist/runtime/composables/useTouchDrag.js +194 -0
- package/dist/runtime/composables/useTrash.d.ts +5 -1
- package/dist/runtime/composables/useTrash.js +12 -6
- package/dist/runtime/composables/useTreeUndoManager.d.ts +22 -0
- package/dist/runtime/composables/useTreeUndoManager.js +45 -0
- package/dist/runtime/composables/useUndoRedo.d.ts +37 -0
- package/dist/runtime/composables/useUndoRedo.js +115 -0
- package/dist/runtime/composables/useVoice.js +2 -0
- package/dist/runtime/composables/useWebRTC.d.ts +50 -0
- package/dist/runtime/composables/useWebRTC.js +179 -0
- package/dist/runtime/composables/useWindowManager.d.ts +2 -0
- package/dist/runtime/composables/useWindowManager.js +63 -1
- package/dist/runtime/extensions/code-preview.d.ts +2 -0
- package/dist/runtime/extensions/code-preview.js +17 -0
- package/dist/runtime/extensions/code-tree.d.ts +2 -0
- package/dist/runtime/extensions/code-tree.js +33 -0
- package/dist/runtime/extensions/doc-embed.d.ts +12 -0
- package/dist/runtime/extensions/doc-embed.js +63 -0
- package/dist/runtime/extensions/doc-link-drop.d.ts +3 -0
- package/dist/runtime/extensions/doc-link-drop.js +63 -0
- package/dist/runtime/extensions/document-header.js +1 -1
- package/dist/runtime/extensions/field.d.ts +3 -0
- package/dist/runtime/extensions/field.js +53 -0
- package/dist/runtime/extensions/mention-drop.d.ts +8 -0
- package/dist/runtime/extensions/mention-drop.js +47 -0
- package/dist/runtime/extensions/meta-field.d.ts +4 -1
- package/dist/runtime/extensions/meta-field.js +2 -0
- package/dist/runtime/extensions/selection-drag.d.ts +13 -0
- package/dist/runtime/extensions/selection-drag.js +126 -0
- package/dist/runtime/extensions/steps.js +1 -1
- package/dist/runtime/extensions/views/AccordionItemView.vue +14 -3
- package/dist/runtime/extensions/views/AccordionView.vue +4 -1
- package/dist/runtime/extensions/views/BadgeView.vue +12 -2
- package/dist/runtime/extensions/views/CalloutView.vue +4 -1
- package/dist/runtime/extensions/views/CardGroupView.vue +4 -1
- package/dist/runtime/extensions/views/CardView.vue +18 -3
- package/dist/runtime/extensions/views/CodeCollapseView.vue +1 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue +5 -1
- package/dist/runtime/extensions/views/CodePreviewView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodePreviewView.vue +48 -0
- package/dist/runtime/extensions/views/CodePreviewView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeTreeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeTreeView.vue +88 -0
- package/dist/runtime/extensions/views/CodeTreeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue +9 -2
- package/dist/runtime/extensions/views/DocEmbedView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/DocEmbedView.vue +198 -0
- package/dist/runtime/extensions/views/DocEmbedView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FieldGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FieldGroupView.vue +25 -0
- package/dist/runtime/extensions/views/FieldGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FieldView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FieldView.vue +53 -0
- package/dist/runtime/extensions/views/FieldView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.vue +34 -8
- package/dist/runtime/extensions/views/KbdView.vue +9 -2
- package/dist/runtime/extensions/views/MetaFieldView.vue +276 -48
- package/dist/runtime/extensions/views/ProseIconView.vue +9 -2
- package/dist/runtime/extensions/views/StepsView.vue +1 -0
- package/dist/runtime/extensions/views/TabsView.vue +18 -4
- package/dist/runtime/locale.d.ts +136 -0
- package/dist/runtime/locale.js +137 -1
- package/dist/runtime/middleware/abracadabra-auth.d.ts +1 -10
- package/dist/runtime/middleware/abracadabra-auth.js +2 -0
- package/dist/runtime/plugin-abracadabra.client.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.client.js +127 -55
- package/dist/runtime/plugin-abracadabra.server.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.server.js +4 -0
- package/dist/runtime/plugin-shared-globals.client.d.ts +1 -1
- package/dist/runtime/plugin-shared-globals.client.js +1 -0
- package/dist/runtime/plugins/core.plugin.js +40 -4
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.d.ts +19 -17
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.js +33 -4
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.d.ts +12 -0
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.js +44 -0
- package/dist/runtime/server/api/_abracadabra/slugs.get.d.ts +2 -0
- package/dist/runtime/server/api/_abracadabra/slugs.get.js +8 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +1 -10
- package/dist/runtime/server/api/_abracadabra/spaces.get.js +3 -0
- package/dist/runtime/server/plugins/abracadabra-service.js +29 -12
- package/dist/runtime/server/runners/doc-tree-cache.js +4 -0
- package/dist/runtime/server/utils/docCache.d.ts +8 -6
- package/dist/runtime/server/utils/docCache.js +3 -3
- package/dist/runtime/server/utils/serverPluginLoader.d.ts +20 -0
- package/dist/runtime/server/utils/serverPluginLoader.js +42 -0
- package/dist/runtime/server/utils/serverRunner.d.ts +11 -2
- package/dist/runtime/server/utils/serverRunner.js +21 -10
- package/dist/runtime/server/utils/slugMap.d.ts +32 -0
- package/dist/runtime/server/utils/slugMap.js +58 -0
- package/dist/runtime/server/utils/spaceManager.d.ts +25 -0
- package/dist/runtime/server/utils/spaceManager.js +188 -0
- package/dist/runtime/types.d.ts +129 -30
- package/dist/runtime/types.js +17 -17
- package/dist/runtime/utils/chatContent.d.ts +41 -0
- package/dist/runtime/utils/chatContent.js +65 -0
- package/dist/runtime/utils/colorPalettes.js +12 -6
- package/dist/runtime/utils/coverCache.d.ts +12 -0
- package/dist/runtime/utils/coverCache.js +14 -0
- package/dist/runtime/utils/docReferenceEdges.d.ts +26 -0
- package/dist/runtime/utils/docReferenceEdges.js +122 -0
- package/dist/runtime/utils/docTypes.d.ts +34 -1
- package/dist/runtime/utils/docTypes.js +129 -1
- package/dist/runtime/utils/duplicateDocContent.d.ts +19 -0
- package/dist/runtime/utils/duplicateDocContent.js +68 -0
- package/dist/runtime/utils/extractFileMetadata.d.ts +13 -0
- package/dist/runtime/utils/extractFileMetadata.js +94 -0
- package/dist/runtime/utils/getMetaColor.d.ts +6 -0
- package/dist/runtime/utils/getMetaColor.js +12 -0
- package/dist/runtime/utils/htmlToYjs.d.ts +19 -0
- package/dist/runtime/utils/htmlToYjs.js +235 -0
- package/dist/runtime/utils/markdownToYjs.js +5 -5
- package/dist/runtime/utils/metaFieldDefinitions.js +9 -0
- package/dist/runtime/utils/notificationRenderers.d.ts +13 -0
- package/dist/runtime/utils/notificationRenderers.js +41 -0
- package/dist/runtime/utils/sdkRef.d.ts +12 -0
- package/dist/runtime/utils/sdkRef.js +7 -0
- package/dist/runtime/utils/slugify.d.ts +40 -0
- package/dist/runtime/utils/slugify.js +36 -0
- package/dist/types.d.mts +18 -0
- package/package.json +44 -32
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { useSyncedMap } from "./useYDoc.js";
|
|
3
|
-
|
|
3
|
+
import { isDescendantInMap } from "../utils/docDragDrop.js";
|
|
4
|
+
export function useChildTree(rootDoc, parentDocId, options) {
|
|
4
5
|
const treeMap = useSyncedMap(rootDoc, "doc-tree");
|
|
5
6
|
const trashMap = useSyncedMap(rootDoc, "doc-trash");
|
|
6
|
-
const entries = computed(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const entries = computed(() => {
|
|
8
|
+
const result = [];
|
|
9
|
+
for (const [id, v] of Object.entries(treeMap.data)) {
|
|
10
|
+
if (id === parentDocId && options?.isSpaceRoot) continue;
|
|
11
|
+
let pid = v.parentId ?? null;
|
|
12
|
+
if (options?.isSpaceRoot && pid === null) pid = parentDocId;
|
|
13
|
+
result.push({
|
|
14
|
+
id,
|
|
15
|
+
label: v.label || "Untitled",
|
|
16
|
+
parentId: pid,
|
|
17
|
+
order: v.order ?? 0,
|
|
18
|
+
type: v.type,
|
|
19
|
+
meta: v.meta,
|
|
20
|
+
createdAt: v.createdAt,
|
|
21
|
+
updatedAt: v.updatedAt
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
});
|
|
18
26
|
function childrenOf(parentId) {
|
|
19
27
|
const target = parentId === null ? parentDocId : parentId;
|
|
20
28
|
return entries.value.filter((e) => e.parentId === target).sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
@@ -45,14 +53,16 @@ export function useChildTree(rootDoc, parentDocId) {
|
|
|
45
53
|
}
|
|
46
54
|
function moveEntry(id, newParentId, newOrder) {
|
|
47
55
|
const entry = treeMap.get(id);
|
|
48
|
-
if (entry)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
if (!entry) return;
|
|
57
|
+
const resolvedParent = newParentId === null ? parentDocId : newParentId;
|
|
58
|
+
if (resolvedParent === id) return;
|
|
59
|
+
if (isDescendantInMap(treeMap.data, id, resolvedParent)) return;
|
|
60
|
+
treeMap.set(id, {
|
|
61
|
+
...entry,
|
|
62
|
+
parentId: resolvedParent,
|
|
63
|
+
order: newOrder,
|
|
64
|
+
updatedAt: Date.now()
|
|
65
|
+
});
|
|
56
66
|
}
|
|
57
67
|
function deleteEntry(id) {
|
|
58
68
|
const doc = rootDoc.value;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ref, watch } from "vue";
|
|
2
2
|
import { useLocalStorage } from "@vueuse/core";
|
|
3
|
+
import { useAbracadabra, usePluginRegistry, useDocSlugs, navigateTo } from "#imports";
|
|
3
4
|
const isOpen = ref(false);
|
|
4
5
|
const searchTerm = ref("");
|
|
5
6
|
export function useCommandPalette() {
|
|
6
7
|
const { doc, isReady, provider } = useAbracadabra();
|
|
7
8
|
const registry = usePluginRegistry();
|
|
9
|
+
const { getDocUrl } = useDocSlugs();
|
|
8
10
|
const recentDocIds = useLocalStorage("abra_recent_docs", []);
|
|
9
11
|
function open(term = "") {
|
|
10
12
|
searchTerm.value = term;
|
|
@@ -43,7 +45,7 @@ export function useCommandPalette() {
|
|
|
43
45
|
suffix: entry.type,
|
|
44
46
|
onClick: () => {
|
|
45
47
|
trackRecentDoc(id);
|
|
46
|
-
navigateTo(
|
|
48
|
+
navigateTo(getDocUrl(id));
|
|
47
49
|
close();
|
|
48
50
|
}
|
|
49
51
|
});
|
|
@@ -52,30 +54,86 @@ export function useCommandPalette() {
|
|
|
52
54
|
if (sorted.length > 0) {
|
|
53
55
|
result.push({ id: "docs", label: q ? "Documents" : "Recent", items: sorted });
|
|
54
56
|
}
|
|
55
|
-
} catch {
|
|
57
|
+
} catch (e) {
|
|
58
|
+
if (import.meta.dev) console.warn("[abracadabra] command palette: failed to scan document tree:", e);
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
{
|
|
62
|
+
const actionItems = [
|
|
63
|
+
{
|
|
64
|
+
id: "action:new-doc",
|
|
65
|
+
label: "New Document",
|
|
66
|
+
icon: "i-lucide-file-plus",
|
|
67
|
+
shortcut: ["meta", "N"],
|
|
68
|
+
onClick: () => {
|
|
69
|
+
if (!doc.value || !isReady.value) return;
|
|
70
|
+
const id = crypto.randomUUID();
|
|
71
|
+
doc.value.getMap("doc-tree").set(id, { label: "Untitled", parentId: null, order: Date.now(), type: "doc" });
|
|
72
|
+
navigateTo(getDocUrl(id));
|
|
73
|
+
close();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "action:home",
|
|
78
|
+
label: "Go to Home",
|
|
79
|
+
icon: "i-lucide-home",
|
|
80
|
+
onClick: () => {
|
|
81
|
+
navigateTo("/app");
|
|
82
|
+
close();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "action:chat",
|
|
87
|
+
label: "Go to Chat",
|
|
88
|
+
icon: "i-lucide-message-circle",
|
|
89
|
+
onClick: () => {
|
|
90
|
+
navigateTo("/chat");
|
|
91
|
+
close();
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "action:inbox",
|
|
96
|
+
label: "Go to Inbox",
|
|
97
|
+
icon: "i-lucide-inbox",
|
|
98
|
+
onClick: () => {
|
|
99
|
+
navigateTo("/inbox");
|
|
100
|
+
close();
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: "action:settings",
|
|
105
|
+
label: "Go to Settings",
|
|
106
|
+
icon: "i-lucide-settings",
|
|
68
107
|
onClick: () => {
|
|
69
|
-
|
|
108
|
+
navigateTo("/settings");
|
|
70
109
|
close();
|
|
71
|
-
}
|
|
72
|
-
disabled: item.disabled
|
|
73
|
-
}));
|
|
74
|
-
if (filtered.length > 0) {
|
|
75
|
-
result.push({ id: group.id ?? "plugin", label: group.label, items: filtered });
|
|
110
|
+
}
|
|
76
111
|
}
|
|
112
|
+
].filter((item) => !q || item.label.toLowerCase().includes(q));
|
|
113
|
+
if (actionItems.length > 0) {
|
|
114
|
+
result.push({ id: "actions", label: "Actions", items: actionItems });
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const ctx = { doc, provider, abracadabra: useAbracadabra(), searchTerm: searchTerm.value };
|
|
119
|
+
const pluginItems = await registry.getAllCommandPaletteItems(ctx);
|
|
120
|
+
const filtered = pluginItems.filter((item) => !q || item.label?.toLowerCase().includes(q)).map((item) => ({
|
|
121
|
+
id: item.id ?? `plugin:${item.label}`,
|
|
122
|
+
label: item.label,
|
|
123
|
+
icon: item.icon,
|
|
124
|
+
suffix: item.suffix,
|
|
125
|
+
shortcut: item.shortcut,
|
|
126
|
+
onClick: () => {
|
|
127
|
+
item.handler?.(ctx);
|
|
128
|
+
close();
|
|
129
|
+
},
|
|
130
|
+
disabled: item.disabled
|
|
131
|
+
}));
|
|
132
|
+
if (filtered.length > 0) {
|
|
133
|
+
result.push({ id: "plugin", label: "Plugins", items: filtered });
|
|
77
134
|
}
|
|
78
|
-
} catch {
|
|
135
|
+
} catch (e) {
|
|
136
|
+
if (import.meta.dev) console.warn("[abracadabra] command palette: failed to load plugin commands:", e);
|
|
79
137
|
}
|
|
80
138
|
groups.value = result;
|
|
81
139
|
}
|
|
@@ -15,7 +15,7 @@ type ConnectionStatusValue = 'disconnected' | 'connecting' | 'connected' | 'offl
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function useConnectionStatus(status?: MaybeRef<ConnectionStatusValue | string | undefined>, synced?: MaybeRef<boolean | undefined>): {
|
|
17
17
|
label: import("vue").ComputedRef<string>;
|
|
18
|
-
color: import("vue").ComputedRef<"
|
|
18
|
+
color: import("vue").ComputedRef<"error" | "success" | "warning">;
|
|
19
19
|
icon: import("vue").ComputedRef<"i-lucide-cloud-check" | "i-lucide-cloud" | "i-lucide-cloud-off">;
|
|
20
20
|
};
|
|
21
21
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computed, ref, toValue, watch } from "vue";
|
|
2
|
+
import { tryOnScopeDispose } from "@vueuse/core";
|
|
2
3
|
import { useAbraLocale } from "./useAbraLocale.js";
|
|
3
4
|
import { useAbracadabra } from "./useAbracadabra.js";
|
|
4
5
|
export function useConnectionStatus(status, synced) {
|
|
@@ -8,7 +9,7 @@ export function useConnectionStatus(status, synced) {
|
|
|
8
9
|
if (status !== void 0) return toValue(status) ?? "disconnected";
|
|
9
10
|
return abra.status?.value ?? "disconnected";
|
|
10
11
|
});
|
|
11
|
-
const
|
|
12
|
+
const _resolvedSynced = computed(() => {
|
|
12
13
|
if (synced !== void 0) return toValue(synced) ?? false;
|
|
13
14
|
const isSynced = abra.synced?.value ?? false;
|
|
14
15
|
if (isSynced) return true;
|
|
@@ -40,6 +41,12 @@ export function useConnectionStatus(status, synced) {
|
|
|
40
41
|
stableStatus.value = next;
|
|
41
42
|
}
|
|
42
43
|
}, { immediate: true });
|
|
44
|
+
tryOnScopeDispose(() => {
|
|
45
|
+
if (offlineTimer) {
|
|
46
|
+
clearTimeout(offlineTimer);
|
|
47
|
+
offlineTimer = null;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
43
50
|
const label = computed(() => {
|
|
44
51
|
const s = stableStatus.value;
|
|
45
52
|
if (s === "connected") return locale.connected;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Syncs a Y.Doc across multiple browser tabs that have the same
|
|
3
|
+
* document open. Uses BroadcastChannel so that document updates
|
|
4
|
+
* propagate instantly between same-origin windows without waiting
|
|
5
|
+
* for the server round-trip.
|
|
6
|
+
*
|
|
7
|
+
* Ported from cou-sh/app/composables/useCrossWindowSync.ts.
|
|
8
|
+
*/
|
|
9
|
+
import { type Ref } from 'vue';
|
|
10
|
+
import * as Y from 'yjs';
|
|
11
|
+
export declare function useCrossWindowSync(doc: Ref<Y.Doc | null>, docId: Ref<string>): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { watch, onUnmounted } from "vue";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
const CHANNEL_PREFIX = "abra:doc-sync:";
|
|
4
|
+
export function useCrossWindowSync(doc, docId) {
|
|
5
|
+
if (typeof window === "undefined") return;
|
|
6
|
+
let cleanup = null;
|
|
7
|
+
watch([doc, docId], ([currentDoc, currentDocId]) => {
|
|
8
|
+
cleanup?.();
|
|
9
|
+
cleanup = null;
|
|
10
|
+
if (!currentDoc || !currentDocId) return;
|
|
11
|
+
cleanup = setupBroadcastSync(currentDoc, currentDocId);
|
|
12
|
+
}, { immediate: true });
|
|
13
|
+
onUnmounted(() => {
|
|
14
|
+
cleanup?.();
|
|
15
|
+
cleanup = null;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function setupBroadcastSync(doc, docId) {
|
|
19
|
+
const channel = new BroadcastChannel(`${CHANNEL_PREFIX}${docId}`);
|
|
20
|
+
let applying = false;
|
|
21
|
+
const onUpdate = (update, origin) => {
|
|
22
|
+
if (origin === "cross-window" || applying) return;
|
|
23
|
+
channel.postMessage(update);
|
|
24
|
+
};
|
|
25
|
+
channel.onmessage = (event) => {
|
|
26
|
+
applying = true;
|
|
27
|
+
try {
|
|
28
|
+
Y.applyUpdate(doc, new Uint8Array(event.data), "cross-window");
|
|
29
|
+
} finally {
|
|
30
|
+
applying = false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
doc.on("update", onUpdate);
|
|
34
|
+
return () => {
|
|
35
|
+
doc.off("update", onUpdate);
|
|
36
|
+
channel.close();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { ref, watch } from "vue";
|
|
2
2
|
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
import { useRoute } from "#imports";
|
|
4
|
+
import { useCommandPalette } from "./useCommandPalette.js";
|
|
3
5
|
const _useDashboard = () => {
|
|
4
6
|
const route = useRoute();
|
|
5
7
|
const { toggle } = useCommandPalette();
|
|
6
8
|
const isNotificationsOpen = ref(false);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
import("#imports").then((mod) => {
|
|
10
|
+
const ds = mod.defineShortcuts;
|
|
11
|
+
if (ds) {
|
|
12
|
+
ds({
|
|
13
|
+
meta_f: () => {
|
|
14
|
+
toggle();
|
|
15
|
+
},
|
|
16
|
+
meta_n: () => {
|
|
17
|
+
toggle();
|
|
18
|
+
},
|
|
19
|
+
n: () => {
|
|
20
|
+
isNotificationsOpen.value = !isNotificationsOpen.value;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
16
23
|
}
|
|
24
|
+
}).catch(() => {
|
|
17
25
|
});
|
|
18
26
|
watch(() => route.fullPath, () => {
|
|
19
27
|
isNotificationsOpen.value = false;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useDevicePairing
|
|
3
|
+
*
|
|
4
|
+
* Wraps ManualSignaling from @abraca/dabra for serverless device-to-device
|
|
5
|
+
* WebRTC pairing via blob exchange (QR code, copy-paste, NFC, etc.).
|
|
6
|
+
*
|
|
7
|
+
* Standalone composable — not auto-managed by the plugin. Users create and
|
|
8
|
+
* cancel pairings explicitly.
|
|
9
|
+
*
|
|
10
|
+
* Usage:
|
|
11
|
+
* const { createOffer, acceptOffer, acceptAnswer, cancelPairing, offerBlob, pairingStatus } = useDevicePairing()
|
|
12
|
+
*
|
|
13
|
+
* // Initiator flow:
|
|
14
|
+
* const blob = await createOffer() // show QR / copy
|
|
15
|
+
* await acceptAnswer(answerBlob) // complete connection
|
|
16
|
+
*
|
|
17
|
+
* // Responder flow:
|
|
18
|
+
* const answer = await acceptOffer(offerBlob) // show QR / copy
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Initiator: create an offer blob to share with the other device.
|
|
22
|
+
* Returns the offer blob (also available as offerBlob ref).
|
|
23
|
+
*/
|
|
24
|
+
declare function createOffer(): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* Responder: accept an offer blob from the initiator.
|
|
27
|
+
* Returns the answer blob to share back with the initiator.
|
|
28
|
+
*/
|
|
29
|
+
declare function acceptOffer(blob: any): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Initiator: accept the answer blob from the responder to complete the connection.
|
|
32
|
+
*/
|
|
33
|
+
declare function acceptAnswer(blob: any): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Cancel the current pairing attempt and clean up resources.
|
|
36
|
+
*/
|
|
37
|
+
declare function cancelPairing(): void;
|
|
38
|
+
export declare function useDevicePairing(): {
|
|
39
|
+
/** Current role in the pairing flow. */
|
|
40
|
+
pairingRole: import("vue").Ref<"idle" | "initiator" | "responder", "idle" | "initiator" | "responder">;
|
|
41
|
+
/** Current status of the pairing attempt. */
|
|
42
|
+
pairingStatus: import("vue").Ref<"idle" | "connected" | "error" | "waiting-for-answer" | "waiting-for-offer", "idle" | "connected" | "error" | "waiting-for-answer" | "waiting-for-offer">;
|
|
43
|
+
/** The offer blob to display/share (initiator side). */
|
|
44
|
+
offerBlob: import("vue").ShallowRef<any, any>;
|
|
45
|
+
/** The answer blob to display/share (responder side). */
|
|
46
|
+
answerBlob: import("vue").ShallowRef<any, any>;
|
|
47
|
+
/** Error message if pairing failed. */
|
|
48
|
+
pairingError: import("vue").Ref<string | null, string | null>;
|
|
49
|
+
/** Initiator: create an offer blob. */
|
|
50
|
+
createOffer: typeof createOffer;
|
|
51
|
+
/** Responder: accept an offer blob and return the answer blob. */
|
|
52
|
+
acceptOffer: typeof acceptOffer;
|
|
53
|
+
/** Initiator: accept the answer blob to complete the connection. */
|
|
54
|
+
acceptAnswer: typeof acceptAnswer;
|
|
55
|
+
/** Cancel the current pairing attempt. */
|
|
56
|
+
cancelPairing: typeof cancelPairing;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ref, shallowRef } from "vue";
|
|
2
|
+
import { getSdkModule } from "../utils/sdkRef.js";
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
4
|
+
import { useAbracadabra } from "./useAbracadabra.js";
|
|
5
|
+
const pairingRole = ref("idle");
|
|
6
|
+
const pairingStatus = ref("idle");
|
|
7
|
+
const offerBlob = shallowRef(null);
|
|
8
|
+
const answerBlob = shallowRef(null);
|
|
9
|
+
const pairingError = ref(null);
|
|
10
|
+
let _manualSignaling = null;
|
|
11
|
+
async function _resolveIceServers() {
|
|
12
|
+
const config = useRuntimeConfig();
|
|
13
|
+
const webrtcConfig = config.public.abracadabra?.webrtc ?? {};
|
|
14
|
+
if (webrtcConfig.iceServers) return webrtcConfig.iceServers;
|
|
15
|
+
try {
|
|
16
|
+
const { client } = useAbracadabra();
|
|
17
|
+
if (client.value?.getIceServers) {
|
|
18
|
+
return await client.value.getIceServers();
|
|
19
|
+
}
|
|
20
|
+
} catch (e) {
|
|
21
|
+
if (import.meta.dev) console.debug("[abracadabra] pairing: failed to fetch ICE servers from server:", e);
|
|
22
|
+
}
|
|
23
|
+
return [{ urls: "stun:stun.l.google.com:19302" }];
|
|
24
|
+
}
|
|
25
|
+
async function createOffer() {
|
|
26
|
+
cancelPairing();
|
|
27
|
+
const sdk = getSdkModule();
|
|
28
|
+
if (!sdk?.ManualSignaling) throw new Error("SDK not loaded \u2014 cannot create pairing");
|
|
29
|
+
const { ManualSignaling } = sdk;
|
|
30
|
+
const iceServers = await _resolveIceServers();
|
|
31
|
+
_manualSignaling = new ManualSignaling(iceServers);
|
|
32
|
+
pairingRole.value = "initiator";
|
|
33
|
+
pairingStatus.value = "waiting-for-answer";
|
|
34
|
+
pairingError.value = null;
|
|
35
|
+
try {
|
|
36
|
+
const blob = await _manualSignaling.createOfferBlob();
|
|
37
|
+
offerBlob.value = blob;
|
|
38
|
+
return blob;
|
|
39
|
+
} catch (e) {
|
|
40
|
+
pairingError.value = e.message;
|
|
41
|
+
pairingStatus.value = "error";
|
|
42
|
+
throw e;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async function acceptOffer(blob) {
|
|
46
|
+
cancelPairing();
|
|
47
|
+
const sdk = getSdkModule();
|
|
48
|
+
if (!sdk?.ManualSignaling) throw new Error("SDK not loaded \u2014 cannot create pairing");
|
|
49
|
+
const { ManualSignaling } = sdk;
|
|
50
|
+
const iceServers = await _resolveIceServers();
|
|
51
|
+
_manualSignaling = new ManualSignaling(iceServers);
|
|
52
|
+
pairingRole.value = "responder";
|
|
53
|
+
pairingError.value = null;
|
|
54
|
+
try {
|
|
55
|
+
const answer = await _manualSignaling.acceptOffer(blob);
|
|
56
|
+
answerBlob.value = answer;
|
|
57
|
+
pairingStatus.value = "connected";
|
|
58
|
+
return answer;
|
|
59
|
+
} catch (e) {
|
|
60
|
+
pairingError.value = e.message;
|
|
61
|
+
pairingStatus.value = "error";
|
|
62
|
+
throw e;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function acceptAnswer(blob) {
|
|
66
|
+
if (!_manualSignaling) {
|
|
67
|
+
throw new Error("No active pairing \u2014 call createOffer() first");
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
await _manualSignaling.acceptAnswer(blob);
|
|
71
|
+
pairingStatus.value = "connected";
|
|
72
|
+
} catch (e) {
|
|
73
|
+
pairingError.value = e.message;
|
|
74
|
+
pairingStatus.value = "error";
|
|
75
|
+
throw e;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function cancelPairing() {
|
|
79
|
+
if (_manualSignaling) {
|
|
80
|
+
_manualSignaling.destroy?.();
|
|
81
|
+
_manualSignaling = null;
|
|
82
|
+
}
|
|
83
|
+
pairingRole.value = "idle";
|
|
84
|
+
pairingStatus.value = "idle";
|
|
85
|
+
offerBlob.value = null;
|
|
86
|
+
answerBlob.value = null;
|
|
87
|
+
pairingError.value = null;
|
|
88
|
+
}
|
|
89
|
+
export function useDevicePairing() {
|
|
90
|
+
return {
|
|
91
|
+
/** Current role in the pairing flow. */
|
|
92
|
+
pairingRole,
|
|
93
|
+
/** Current status of the pairing attempt. */
|
|
94
|
+
pairingStatus,
|
|
95
|
+
/** The offer blob to display/share (initiator side). */
|
|
96
|
+
offerBlob,
|
|
97
|
+
/** The answer blob to display/share (responder side). */
|
|
98
|
+
answerBlob,
|
|
99
|
+
/** Error message if pairing failed. */
|
|
100
|
+
pairingError,
|
|
101
|
+
/** Initiator: create an offer blob. */
|
|
102
|
+
createOffer,
|
|
103
|
+
/** Responder: accept an offer blob and return the answer blob. */
|
|
104
|
+
acceptOffer,
|
|
105
|
+
/** Initiator: accept the answer blob to complete the connection. */
|
|
106
|
+
acceptAnswer,
|
|
107
|
+
/** Cancel the current pairing attempt. */
|
|
108
|
+
cancelPairing
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface DocDragState {
|
|
2
|
+
/** The doc IDs being dragged (supports multi-select) */
|
|
3
|
+
docIds: string[];
|
|
4
|
+
/** Labels for ghost rendering */
|
|
5
|
+
labels: string[];
|
|
6
|
+
/** Lucide icon class names for ghost rendering (parallel to labels) */
|
|
7
|
+
icons?: string[];
|
|
8
|
+
/** Which system originated this drag */
|
|
9
|
+
source: 'tree' | 'subpagelist' | 'renderer';
|
|
10
|
+
/** The docId of the renderer/parent that started the drag */
|
|
11
|
+
sourceDocId?: string;
|
|
12
|
+
/** Current pointer position for ghost rendering and hit-testing */
|
|
13
|
+
pointer: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
declare function startDrag(state: DocDragState): void;
|
|
19
|
+
declare function updatePointer(x: number, y: number): void;
|
|
20
|
+
declare function endDrag(): void;
|
|
21
|
+
export declare function useDocDragBus(): {
|
|
22
|
+
dragState: import("vue").ShallowRef<DocDragState | null, DocDragState | null>;
|
|
23
|
+
isDragging: import("vue").ComputedRef<boolean>;
|
|
24
|
+
startDrag: typeof startDrag;
|
|
25
|
+
updatePointer: typeof updatePointer;
|
|
26
|
+
endDrag: typeof endDrag;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { shallowRef, computed } from "vue";
|
|
2
|
+
const dragState = shallowRef(null);
|
|
3
|
+
const isDragging = computed(() => dragState.value !== null);
|
|
4
|
+
function startDrag(state) {
|
|
5
|
+
dragState.value = state;
|
|
6
|
+
}
|
|
7
|
+
function updatePointer(x, y) {
|
|
8
|
+
if (!dragState.value) return;
|
|
9
|
+
dragState.value = { ...dragState.value, pointer: { x, y } };
|
|
10
|
+
}
|
|
11
|
+
function endDrag() {
|
|
12
|
+
dragState.value = null;
|
|
13
|
+
}
|
|
14
|
+
export function useDocDragBus() {
|
|
15
|
+
return {
|
|
16
|
+
dragState,
|
|
17
|
+
isDragging,
|
|
18
|
+
startDrag,
|
|
19
|
+
updatePointer,
|
|
20
|
+
endDrag
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { TreeEntry } from './useChildTree.js';
|
|
3
|
+
export interface DropZone {
|
|
4
|
+
/** The doc ID that will become the new parent */
|
|
5
|
+
parentDocId: string;
|
|
6
|
+
/** Target item ID for ordering relative to (null = append) */
|
|
7
|
+
targetItemId?: string | null;
|
|
8
|
+
/** Position relative to target */
|
|
9
|
+
position?: 'before' | 'inside' | 'after';
|
|
10
|
+
/** Computed fractional order for the drop */
|
|
11
|
+
order: number;
|
|
12
|
+
/** Renderer-specific metadata to apply after reparenting */
|
|
13
|
+
dropMeta?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useDocDropZone(opts: {
|
|
16
|
+
parentDocId: string | Ref<string>;
|
|
17
|
+
tree: {
|
|
18
|
+
moveEntry: (id: string, newParentId: string | null, newOrder: number) => void;
|
|
19
|
+
updateMeta: (id: string, patch: Record<string, unknown>) => void;
|
|
20
|
+
childrenOf: (parentId: string | null) => TreeEntry[];
|
|
21
|
+
};
|
|
22
|
+
resolveDropPosition?: (pointer: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
}, el: HTMLElement) => DropZone | null;
|
|
26
|
+
onDocDropped?: (docIds: string[], zone: DropZone) => void;
|
|
27
|
+
}): {
|
|
28
|
+
containerRef: Ref<HTMLElement | null, HTMLElement | null>;
|
|
29
|
+
isDropTarget: import("vue").ComputedRef<boolean>;
|
|
30
|
+
dropIndicator: Ref<{
|
|
31
|
+
parentDocId: string;
|
|
32
|
+
targetItemId?: string | null
|
|
33
|
+
/** Position relative to target */
|
|
34
|
+
| undefined;
|
|
35
|
+
position?: "before" | "inside" | "after"
|
|
36
|
+
/** Computed fractional order for the drop */
|
|
37
|
+
| undefined;
|
|
38
|
+
order: number;
|
|
39
|
+
dropMeta?: Record<string, unknown> | undefined;
|
|
40
|
+
} | null, DropZone | {
|
|
41
|
+
parentDocId: string;
|
|
42
|
+
targetItemId?: string | null
|
|
43
|
+
/** Position relative to target */
|
|
44
|
+
| undefined;
|
|
45
|
+
position?: "before" | "inside" | "after"
|
|
46
|
+
/** Computed fractional order for the drop */
|
|
47
|
+
| undefined;
|
|
48
|
+
order: number;
|
|
49
|
+
dropMeta?: Record<string, unknown> | undefined;
|
|
50
|
+
} | null>;
|
|
51
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ref, computed, watch, onUnmounted } from "vue";
|
|
2
|
+
import { useDocDragBus } from "./useDocDragBus.js";
|
|
3
|
+
export function useDocDropZone(opts) {
|
|
4
|
+
const containerRef = ref(null);
|
|
5
|
+
const bus = useDocDragBus();
|
|
6
|
+
const dropIndicator = ref(null);
|
|
7
|
+
const isDropTarget = computed(() => bus.isDragging.value);
|
|
8
|
+
const parentDocId = computed(
|
|
9
|
+
() => typeof opts.parentDocId === "string" ? opts.parentDocId : opts.parentDocId.value
|
|
10
|
+
);
|
|
11
|
+
let rafId = null;
|
|
12
|
+
function onPointerMoveOverZone() {
|
|
13
|
+
if (!bus.dragState.value || !containerRef.value) {
|
|
14
|
+
dropIndicator.value = null;
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const { pointer } = bus.dragState.value;
|
|
18
|
+
const rect = containerRef.value.getBoundingClientRect();
|
|
19
|
+
if (pointer.x < rect.left || pointer.x > rect.right || pointer.y < rect.top || pointer.y > rect.bottom) {
|
|
20
|
+
dropIndicator.value = null;
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (opts.resolveDropPosition) {
|
|
24
|
+
dropIndicator.value = opts.resolveDropPosition(pointer, containerRef.value);
|
|
25
|
+
} else {
|
|
26
|
+
dropIndicator.value = {
|
|
27
|
+
parentDocId: parentDocId.value,
|
|
28
|
+
order: Date.now()
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const stopWatch = watch(
|
|
33
|
+
() => bus.dragState.value?.pointer,
|
|
34
|
+
() => {
|
|
35
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
36
|
+
rafId = requestAnimationFrame(onPointerMoveOverZone);
|
|
37
|
+
},
|
|
38
|
+
{ flush: "sync" }
|
|
39
|
+
);
|
|
40
|
+
function onPointerUp() {
|
|
41
|
+
if (!bus.dragState.value || !dropIndicator.value) return;
|
|
42
|
+
const { docIds } = bus.dragState.value;
|
|
43
|
+
const zone = dropIndicator.value;
|
|
44
|
+
for (let i = 0; i < docIds.length; i++) {
|
|
45
|
+
const docId = docIds[i];
|
|
46
|
+
opts.tree.moveEntry(docId, zone.parentDocId, zone.order + i);
|
|
47
|
+
if (zone.dropMeta) {
|
|
48
|
+
opts.tree.updateMeta(docId, zone.dropMeta);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
opts.onDocDropped?.(docIds, zone);
|
|
52
|
+
dropIndicator.value = null;
|
|
53
|
+
bus.endDrag();
|
|
54
|
+
}
|
|
55
|
+
function onDocumentPointerUp(e) {
|
|
56
|
+
if (!bus.isDragging.value || !containerRef.value) return;
|
|
57
|
+
const rect = containerRef.value.getBoundingClientRect();
|
|
58
|
+
if (e.clientX >= rect.left && e.clientX <= rect.right && e.clientY >= rect.top && e.clientY <= rect.bottom) {
|
|
59
|
+
onPointerUp();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const stopDragWatch = watch(
|
|
63
|
+
() => bus.isDragging.value,
|
|
64
|
+
(dragging) => {
|
|
65
|
+
if (dragging) {
|
|
66
|
+
document.addEventListener("pointerup", onDocumentPointerUp);
|
|
67
|
+
} else {
|
|
68
|
+
document.removeEventListener("pointerup", onDocumentPointerUp);
|
|
69
|
+
dropIndicator.value = null;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
onUnmounted(() => {
|
|
74
|
+
stopWatch();
|
|
75
|
+
stopDragWatch();
|
|
76
|
+
if (rafId !== null) cancelAnimationFrame(rafId);
|
|
77
|
+
document.removeEventListener("pointerup", onDocumentPointerUp);
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
containerRef,
|
|
81
|
+
isDropTarget,
|
|
82
|
+
dropIndicator
|
|
83
|
+
};
|
|
84
|
+
}
|