@abraca/nuxt 0.3.0 → 1.6.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 +26 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +51 -8
- 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 +4 -2
- 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 +1 -1
- package/dist/runtime/components/ADocRenderer.vue +6 -0
- package/dist/runtime/components/ADocRenderer.vue.d.ts +1 -1
- package/dist/runtime/components/ADocTypeSelect.vue +4 -3
- package/dist/runtime/components/ADocumentTree.d.vue.ts +3 -3
- package/dist/runtime/components/ADocumentTree.vue +118 -10
- package/dist/runtime/components/ADocumentTree.vue.d.ts +3 -3
- package/dist/runtime/components/AEditor.d.vue.ts +4 -4
- package/dist/runtime/components/AEditor.vue +16 -1
- package/dist/runtime/components/AEditor.vue.d.ts +4 -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 +2 -0
- 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 +10 -2
- package/dist/runtime/components/ANotifications.vue +3 -1
- package/dist/runtime/components/APermissionGuard.vue +1 -0
- package/dist/runtime/components/APresence.vue +1 -0
- package/dist/runtime/components/AProvider.d.vue.ts +0 -1
- package/dist/runtime/components/AProvider.vue +17 -4
- 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 +3 -1
- package/dist/runtime/components/AVoiceTile.vue +1 -0
- 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 +2 -1
- package/dist/runtime/components/aware/AArea.vue.d.ts +1 -1
- package/dist/runtime/components/aware/AAvatar.vue +2 -0
- package/dist/runtime/components/aware/AButton.vue +2 -1
- package/dist/runtime/components/aware/ACursorLabel.vue +1 -0
- package/dist/runtime/components/aware/ADocBadge.vue +2 -0
- package/dist/runtime/components/aware/AFacepile.vue +2 -0
- package/dist/runtime/components/aware/AInput.vue +3 -2
- package/dist/runtime/components/aware/ASelect.vue +3 -2
- package/dist/runtime/components/aware/ATextarea.vue +3 -2
- package/dist/runtime/components/aware/AUserList.vue +2 -0
- 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 +2 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +207 -327
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +2 -0
- package/dist/runtime/components/renderers/ACallRenderer.vue +3 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.vue +14 -12
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +120 -12
- package/dist/runtime/components/renderers/AGraphRenderer.vue +5 -2
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +21 -5
- package/dist/runtime/components/renderers/AMapRenderer.vue +2 -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.vue +1 -0
- 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.vue +65 -45
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +282 -260
- 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 +1 -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/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 +17 -10
- package/dist/runtime/composables/useChatUsers.js +1 -0
- package/dist/runtime/composables/useChildTree.d.ts +4 -2
- package/dist/runtime/composables/useChildTree.js +31 -21
- package/dist/runtime/composables/useCommandPalette.js +16 -17
- package/dist/runtime/composables/useConnectionStatus.d.ts +1 -1
- package/dist/runtime/composables/useConnectionStatus.js +1 -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.js +2 -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.js +2 -0
- package/dist/runtime/composables/useDocImport.js +1 -0
- 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.js +3 -2
- package/dist/runtime/composables/useDocSlugs.js +3 -0
- package/dist/runtime/composables/useDocTree.d.ts +1 -0
- package/dist/runtime/composables/useDocTree.js +6 -2
- package/dist/runtime/composables/useEditor.js +1 -0
- package/dist/runtime/composables/useEditorDragHandle.js +2 -0
- 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 +31 -3
- package/dist/runtime/composables/useEditorSuggestions.d.ts +2 -2
- package/dist/runtime/composables/useEditorSuggestions.js +27 -19
- package/dist/runtime/composables/useEditorToolbar.d.ts +1 -1
- package/dist/runtime/composables/useEditorToolbar.js +3 -0
- package/dist/runtime/composables/useFavorites.d.ts +13 -0
- package/dist/runtime/composables/useFavorites.js +42 -0
- package/dist/runtime/composables/useFileIndex.js +2 -0
- package/dist/runtime/composables/useFileTransfer.js +13 -1
- package/dist/runtime/composables/useFollowUser.js +2 -0
- 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.js +1 -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 +7 -1
- package/dist/runtime/composables/useNodePanel.js +45 -8
- 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 +7 -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.js +2 -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.js +2 -0
- package/dist/runtime/composables/useSpaces.js +2 -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 +2 -0
- package/dist/runtime/composables/useTouchDrag.js +3 -0
- package/dist/runtime/composables/useTrash.d.ts +4 -0
- package/dist/runtime/composables/useTrash.js +6 -3
- 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.js +2 -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.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/views/AccordionItemView.vue +1 -0
- package/dist/runtime/extensions/views/BadgeView.vue +1 -0
- package/dist/runtime/extensions/views/CardView.vue +1 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue +1 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue +1 -0
- 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 +1 -0
- 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 +2 -0
- package/dist/runtime/extensions/views/KbdView.vue +1 -0
- package/dist/runtime/extensions/views/MetaFieldView.vue +68 -2
- package/dist/runtime/extensions/views/ProseIconView.vue +1 -0
- package/dist/runtime/extensions/views/StepsView.vue +1 -0
- package/dist/runtime/extensions/views/TabsView.vue +1 -0
- package/dist/runtime/locale.d.ts +65 -0
- package/dist/runtime/locale.js +67 -2
- 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 +99 -53
- package/dist/runtime/plugin-abracadabra.server.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.server.js +2 -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 +4 -0
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.d.ts +11 -1
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.js +1 -0
- package/dist/runtime/server/api/_abracadabra/slugs.get.js +1 -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 +24 -12
- 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/spaceManager.d.ts +25 -0
- package/dist/runtime/server/utils/spaceManager.js +188 -0
- package/dist/runtime/types.d.ts +128 -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 +6 -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 +3 -3
- 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 -2
- package/dist/types.d.mts +12 -0
- package/package.json +26 -27
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { watch, nextTick, onBeforeUnmount } from "vue";
|
|
2
|
+
export function useNodePanelFollow(openNodeId, openNodeLabel, openNode, closePanel, followingUser, states, setLocalState) {
|
|
3
|
+
let syncingFromFollow = false;
|
|
4
|
+
let lastAppliedT = 0;
|
|
5
|
+
watch(openNodeId, (nodeId) => {
|
|
6
|
+
if (syncingFromFollow || followingUser()) return;
|
|
7
|
+
setLocalState({
|
|
8
|
+
nodePanel: {
|
|
9
|
+
nodeId: nodeId ?? null,
|
|
10
|
+
label: nodeId ? openNodeLabel.value : null,
|
|
11
|
+
t: Date.now()
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
watch([followingUser, states], () => {
|
|
16
|
+
const key = followingUser();
|
|
17
|
+
if (!key) return;
|
|
18
|
+
const state = states.value.find((s) => s.user?.publicKey === key);
|
|
19
|
+
const panel = state?.nodePanel;
|
|
20
|
+
if (!panel || panel.t <= lastAppliedT) return;
|
|
21
|
+
lastAppliedT = panel.t;
|
|
22
|
+
syncingFromFollow = true;
|
|
23
|
+
if (panel.nodeId) {
|
|
24
|
+
openNode(panel.nodeId, panel.label ?? "");
|
|
25
|
+
} else {
|
|
26
|
+
closePanel();
|
|
27
|
+
}
|
|
28
|
+
nextTick(() => {
|
|
29
|
+
syncingFromFollow = false;
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
onBeforeUnmount(() => {
|
|
33
|
+
if (!syncingFromFollow) {
|
|
34
|
+
setLocalState({ nodePanel: { nodeId: null, label: null, t: Date.now() } });
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -74,6 +74,7 @@ export declare function useNotifications(): {
|
|
|
74
74
|
read: boolean;
|
|
75
75
|
createdAt: number;
|
|
76
76
|
}[]>;
|
|
77
|
+
lastError: import("vue").Ref<string | null, string | null>;
|
|
77
78
|
fetchNotifications: typeof fetchNotifications;
|
|
78
79
|
markRead: typeof markRead;
|
|
79
80
|
markAllRead: typeof markAllRead;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ref, computed } from "vue";
|
|
2
|
+
import { useAbracadabra } from "./useAbracadabra.js";
|
|
2
3
|
const notifications = ref([]);
|
|
4
|
+
const lastError = ref(null);
|
|
3
5
|
let _publicKeyB64 = ref("");
|
|
4
6
|
let pendingToasts = [];
|
|
5
7
|
let toastFlushTimer = null;
|
|
@@ -40,6 +42,7 @@ export function _handleStatelessNotification(payload) {
|
|
|
40
42
|
try {
|
|
41
43
|
const data = JSON.parse(payload);
|
|
42
44
|
if (!data.type?.startsWith("notify:")) return;
|
|
45
|
+
lastError.value = null;
|
|
43
46
|
switch (data.type) {
|
|
44
47
|
case "notify:history": {
|
|
45
48
|
const incoming = (data.notifications || []).map(parseNotification);
|
|
@@ -72,7 +75,8 @@ export function _handleStatelessNotification(payload) {
|
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
} catch (e) {
|
|
75
|
-
|
|
78
|
+
lastError.value = e instanceof Error ? e.message : String(e);
|
|
79
|
+
console.error("[abracadabra] notifications: failed to handle stateless message:", e);
|
|
76
80
|
}
|
|
77
81
|
}
|
|
78
82
|
function _scheduleToast(notif) {
|
|
@@ -119,7 +123,7 @@ function _flushToasts() {
|
|
|
119
123
|
});
|
|
120
124
|
}
|
|
121
125
|
}).catch((e) => {
|
|
122
|
-
|
|
126
|
+
console.error("[abracadabra] notifications: toast display failed:", e);
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
129
|
function fetchNotifications(opts) {
|
|
@@ -165,6 +169,7 @@ export function useNotifications() {
|
|
|
165
169
|
notifications,
|
|
166
170
|
unreadCount,
|
|
167
171
|
unreadNotifications,
|
|
172
|
+
lastError,
|
|
168
173
|
fetchNotifications,
|
|
169
174
|
markRead,
|
|
170
175
|
markAllRead,
|
|
@@ -21,7 +21,7 @@ export interface RendererBaseProps {
|
|
|
21
21
|
export declare function useRendererBase(props: RendererBaseProps): {
|
|
22
22
|
childProviderRef: ShallowRef<any, any>;
|
|
23
23
|
childDoc: ShallowRef<Y.Doc | null, Y.Doc | null>;
|
|
24
|
-
rootDoc:
|
|
24
|
+
rootDoc: ShallowRef<Y.Doc>;
|
|
25
25
|
cursors: import("vue").Ref<{
|
|
26
26
|
clientId: number;
|
|
27
27
|
x: number;
|
|
@@ -183,4 +183,19 @@ export declare function useRendererBase(props: RendererBaseProps): {
|
|
|
183
183
|
avatar: string | undefined;
|
|
184
184
|
publicKey: any;
|
|
185
185
|
}[]>;
|
|
186
|
+
containerRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
187
|
+
isDropTarget: import("vue").ComputedRef<boolean>;
|
|
188
|
+
dropIndicator: import("vue").Ref<{
|
|
189
|
+
parentDocId: string;
|
|
190
|
+
targetItemId?: string | null | undefined;
|
|
191
|
+
position?: "before" | "inside" | "after" | undefined;
|
|
192
|
+
order: number;
|
|
193
|
+
dropMeta?: Record<string, unknown> | undefined;
|
|
194
|
+
} | null, import("./useDocDropZone.js").DropZone | {
|
|
195
|
+
parentDocId: string;
|
|
196
|
+
targetItemId?: string | null | undefined;
|
|
197
|
+
position?: "before" | "inside" | "after" | undefined;
|
|
198
|
+
order: number;
|
|
199
|
+
dropMeta?: Record<string, unknown> | undefined;
|
|
200
|
+
} | null>;
|
|
186
201
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { shallowRef, computed, watch, watchEffect } from "vue";
|
|
2
2
|
import { useSmoothedCursors } from "./useYDoc.js";
|
|
3
3
|
import { useChildTree } from "./useChildTree.js";
|
|
4
|
+
import { useDocDropZone } from "./useDocDropZone.js";
|
|
5
|
+
import { useAbracadabra } from "./useAbracadabra.js";
|
|
4
6
|
export function useRendererBase(props) {
|
|
5
7
|
const { doc: rootDoc, userName, userColor, publicKeyB64 } = useAbracadabra();
|
|
6
8
|
const childProviderRef = shallowRef(null);
|
|
@@ -24,6 +26,10 @@ export function useRendererBase(props) {
|
|
|
24
26
|
}
|
|
25
27
|
});
|
|
26
28
|
const tree = useChildTree(rootDoc, props.docId);
|
|
29
|
+
const { containerRef, isDropTarget, dropIndicator } = useDocDropZone({
|
|
30
|
+
parentDocId: props.docId,
|
|
31
|
+
tree
|
|
32
|
+
});
|
|
27
33
|
const connectedUsers = computed(
|
|
28
34
|
() => states.value.map((s) => ({
|
|
29
35
|
clientId: s.clientId,
|
|
@@ -41,6 +47,9 @@ export function useRendererBase(props) {
|
|
|
41
47
|
states,
|
|
42
48
|
setLocalState,
|
|
43
49
|
tree,
|
|
44
|
-
connectedUsers
|
|
50
|
+
connectedUsers,
|
|
51
|
+
containerRef,
|
|
52
|
+
isDropTarget,
|
|
53
|
+
dropIndicator
|
|
45
54
|
};
|
|
46
55
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ref, computed, watch } from "vue";
|
|
2
2
|
import * as Y from "yjs";
|
|
3
|
+
import { useAbracadabra } from "./useAbracadabra.js";
|
|
4
|
+
import { useBackgroundSync } from "./useBackgroundSync.js";
|
|
3
5
|
let _searchIndex = null;
|
|
4
6
|
const _indexedVersions = /* @__PURE__ */ new Map();
|
|
5
7
|
const _isReady = ref(false);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useSettingsModal
|
|
3
|
+
*
|
|
4
|
+
* Global state for the settings modal — controls which tab is active
|
|
5
|
+
* and whether the modal is open. Used by the ASettingsModal component
|
|
6
|
+
* and any code that needs to open settings programmatically (sidebar,
|
|
7
|
+
* command palette, keyboard shortcuts, etc.).
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* const { isOpen, activeTab, openSettings, closeSettings } = useSettingsModal()
|
|
11
|
+
*/
|
|
12
|
+
export type SettingsTab = 'profile' | 'connection' | 'spaces' | 'security' | 'invites' | 'members' | 'trash' | 'offline' | 'plugins' | 'admin';
|
|
13
|
+
export declare function useSettingsModal(): {
|
|
14
|
+
isOpen: import("vue").WritableComputedRef<boolean, boolean>;
|
|
15
|
+
activeTab: import("vue").WritableComputedRef<SettingsTab, SettingsTab>;
|
|
16
|
+
openSettings: (tab?: SettingsTab) => void;
|
|
17
|
+
closeSettings: () => void;
|
|
18
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ref, computed } from "vue";
|
|
2
|
+
const _isOpen = ref(false);
|
|
3
|
+
const _activeTab = ref("profile");
|
|
4
|
+
export function useSettingsModal() {
|
|
5
|
+
const isOpen = computed({
|
|
6
|
+
get: () => _isOpen.value,
|
|
7
|
+
set: (v) => {
|
|
8
|
+
_isOpen.value = v;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const activeTab = computed({
|
|
12
|
+
get: () => _activeTab.value,
|
|
13
|
+
set: (v) => {
|
|
14
|
+
_activeTab.value = v;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
function openSettings(tab) {
|
|
18
|
+
if (tab) _activeTab.value = tab;
|
|
19
|
+
_isOpen.value = true;
|
|
20
|
+
}
|
|
21
|
+
function closeSettings() {
|
|
22
|
+
_isOpen.value = false;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
isOpen,
|
|
26
|
+
activeTab,
|
|
27
|
+
openSettings,
|
|
28
|
+
closeSettings
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slideover registry + swipe-to-close composable.
|
|
3
|
+
*
|
|
4
|
+
* `useSlideoverRegistry()` is a shared singleton that tracks all open
|
|
5
|
+
* slideovers. `useSlideoverSwipe()` auto-registers a slideover component
|
|
6
|
+
* with the registry when it opens, and unregisters when it closes.
|
|
7
|
+
*
|
|
8
|
+
* Ported from cou-sh/app/composables/useSlideoverSwipe.ts.
|
|
9
|
+
*/
|
|
10
|
+
import { type Ref } from 'vue';
|
|
11
|
+
interface SlideoverEntry {
|
|
12
|
+
id: string;
|
|
13
|
+
side: 'left' | 'right';
|
|
14
|
+
close: () => void;
|
|
15
|
+
priority: number;
|
|
16
|
+
}
|
|
17
|
+
export declare const useSlideoverRegistry: () => {
|
|
18
|
+
stack: Ref<{
|
|
19
|
+
id: string;
|
|
20
|
+
side: "left" | "right";
|
|
21
|
+
close: () => void;
|
|
22
|
+
priority: number;
|
|
23
|
+
}[], SlideoverEntry[] | {
|
|
24
|
+
id: string;
|
|
25
|
+
side: "left" | "right";
|
|
26
|
+
close: () => void;
|
|
27
|
+
priority: number;
|
|
28
|
+
}[]>;
|
|
29
|
+
register: (entry: SlideoverEntry) => void;
|
|
30
|
+
unregister: (id: string) => void;
|
|
31
|
+
closeTop: (side?: "left" | "right") => boolean;
|
|
32
|
+
hasOpen: (side?: "left" | "right") => boolean;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Auto-register a slideover with the swipe registry.
|
|
36
|
+
* Call this inside any component that uses USlideover.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useSlideoverSwipe(id: string | (() => string), open: Ref<boolean>, side?: 'left' | 'right'): void;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ref, watch, onBeforeUnmount } from "vue";
|
|
2
|
+
import { createSharedComposable } from "@vueuse/core";
|
|
3
|
+
const _useSlideoverRegistry = () => {
|
|
4
|
+
const stack = ref([]);
|
|
5
|
+
function register(entry) {
|
|
6
|
+
const idx = stack.value.findIndex((e) => e.id === entry.id);
|
|
7
|
+
if (idx >= 0) stack.value.splice(idx, 1);
|
|
8
|
+
stack.value.push(entry);
|
|
9
|
+
}
|
|
10
|
+
function unregister(id) {
|
|
11
|
+
const idx = stack.value.findIndex((e) => e.id === id);
|
|
12
|
+
if (idx >= 0) stack.value.splice(idx, 1);
|
|
13
|
+
}
|
|
14
|
+
function closeTop(side) {
|
|
15
|
+
const filtered = side ? stack.value.filter((e) => e.side === side) : stack.value;
|
|
16
|
+
if (filtered.length === 0) return false;
|
|
17
|
+
const top = filtered.reduce((a, b) => a.priority > b.priority ? a : b);
|
|
18
|
+
top.close();
|
|
19
|
+
unregister(top.id);
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
function hasOpen(side) {
|
|
23
|
+
if (!side) return stack.value.length > 0;
|
|
24
|
+
return stack.value.some((e) => e.side === side);
|
|
25
|
+
}
|
|
26
|
+
return { stack, register, unregister, closeTop, hasOpen };
|
|
27
|
+
};
|
|
28
|
+
export const useSlideoverRegistry = createSharedComposable(_useSlideoverRegistry);
|
|
29
|
+
export function useSlideoverSwipe(id, open, side = "right") {
|
|
30
|
+
if (typeof window === "undefined") return;
|
|
31
|
+
const registry = useSlideoverRegistry();
|
|
32
|
+
const resolveId = typeof id === "function" ? id : () => id;
|
|
33
|
+
watch(open, (isOpen) => {
|
|
34
|
+
if (isOpen) {
|
|
35
|
+
registry.register({
|
|
36
|
+
id: resolveId(),
|
|
37
|
+
side,
|
|
38
|
+
close: () => {
|
|
39
|
+
open.value = false;
|
|
40
|
+
},
|
|
41
|
+
priority: Date.now()
|
|
42
|
+
});
|
|
43
|
+
} else {
|
|
44
|
+
registry.unregister(resolveId());
|
|
45
|
+
}
|
|
46
|
+
}, { immediate: true });
|
|
47
|
+
onBeforeUnmount(() => registry.unregister(resolveId()));
|
|
48
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { isUUID } from "../utils/slugify.js";
|
|
3
|
+
import { useRoute } from "#imports";
|
|
4
|
+
import { useDocSlugs } from "./useDocSlugs.js";
|
|
3
5
|
export function useSlugRoute() {
|
|
4
6
|
const route = useRoute();
|
|
5
7
|
const { getDocId, slugMap } = useDocSlugs();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare function useSpatialCamera(setLocalState: (state: Record<string, unknown>) => void, isFollowing?: () => boolean): {
|
|
2
|
+
cameraRef: import("vue").Ref<any, any>;
|
|
3
|
+
cameraPosition: import("vue").ComputedRef<[number, number, number]>;
|
|
4
|
+
cameraTarget: import("vue").ComputedRef<[number, number, number]>;
|
|
5
|
+
controlMode: import("vue").Ref<"orbit" | "fly", "orbit" | "fly">;
|
|
6
|
+
azimuth: import("vue").Ref<number, number>;
|
|
7
|
+
elevation: import("vue").Ref<number, number>;
|
|
8
|
+
distance: import("vue").Ref<number, number>;
|
|
9
|
+
focusOn: (worldPos: [number, number, number]) => void;
|
|
10
|
+
broadcastCamera: () => void;
|
|
11
|
+
applyCameraState: (position: [number, number, number], target: [number, number, number]) => void;
|
|
12
|
+
onCanvasPointerDown: (ev: PointerEvent) => void;
|
|
13
|
+
onCanvasPointerMove: (ev: PointerEvent) => void;
|
|
14
|
+
onCanvasPointerUp: () => void;
|
|
15
|
+
onCanvasWheel: (ev: WheelEvent) => void;
|
|
16
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { ref, computed, onMounted, onBeforeUnmount } from "vue";
|
|
2
|
+
export function useSpatialCamera(setLocalState, isFollowing = () => false) {
|
|
3
|
+
const azimuth = ref(Math.PI / 4);
|
|
4
|
+
const elevation = ref(Math.PI / 6);
|
|
5
|
+
const distance = ref(12);
|
|
6
|
+
const targetX = ref(0);
|
|
7
|
+
const targetY = ref(0);
|
|
8
|
+
const targetZ = ref(0);
|
|
9
|
+
const controlMode = ref("orbit");
|
|
10
|
+
const isDragging = ref(false);
|
|
11
|
+
const dragButton = ref(0);
|
|
12
|
+
let lastPX = 0;
|
|
13
|
+
let lastPY = 0;
|
|
14
|
+
let focusAnim = null;
|
|
15
|
+
const keysDown = /* @__PURE__ */ new Set();
|
|
16
|
+
const cameraPosition = computed(() => {
|
|
17
|
+
const el = Math.max(0.05, Math.min(Math.PI / 2 - 0.05, elevation.value));
|
|
18
|
+
const x = targetX.value + distance.value * Math.cos(el) * Math.sin(azimuth.value);
|
|
19
|
+
const y = targetY.value + distance.value * Math.sin(el);
|
|
20
|
+
const z = targetZ.value + distance.value * Math.cos(el) * Math.cos(azimuth.value);
|
|
21
|
+
return [x, y, z];
|
|
22
|
+
});
|
|
23
|
+
const cameraTarget = computed(() => [
|
|
24
|
+
targetX.value,
|
|
25
|
+
targetY.value,
|
|
26
|
+
targetZ.value
|
|
27
|
+
]);
|
|
28
|
+
const cameraRef = ref(null);
|
|
29
|
+
function onCanvasPointerDown(ev) {
|
|
30
|
+
isDragging.value = true;
|
|
31
|
+
dragButton.value = ev.button;
|
|
32
|
+
lastPX = ev.clientX;
|
|
33
|
+
lastPY = ev.clientY;
|
|
34
|
+
}
|
|
35
|
+
function onCanvasPointerMove(ev) {
|
|
36
|
+
if (!isDragging.value) return;
|
|
37
|
+
const dx = ev.clientX - lastPX;
|
|
38
|
+
const dy = ev.clientY - lastPY;
|
|
39
|
+
lastPX = ev.clientX;
|
|
40
|
+
lastPY = ev.clientY;
|
|
41
|
+
if (dragButton.value === 0 && !ev.shiftKey) {
|
|
42
|
+
azimuth.value -= dx * 5e-3;
|
|
43
|
+
elevation.value += dy * 5e-3;
|
|
44
|
+
elevation.value = Math.max(0.05, Math.min(Math.PI / 2 - 0.05, elevation.value));
|
|
45
|
+
} else {
|
|
46
|
+
const panSpeed = 5e-3 * distance.value;
|
|
47
|
+
const sinA = Math.sin(azimuth.value);
|
|
48
|
+
const cosA = Math.cos(azimuth.value);
|
|
49
|
+
targetX.value += -cosA * dx * panSpeed;
|
|
50
|
+
targetZ.value += sinA * dx * panSpeed;
|
|
51
|
+
targetY.value += dy * panSpeed;
|
|
52
|
+
}
|
|
53
|
+
broadcastCamera();
|
|
54
|
+
}
|
|
55
|
+
function onCanvasPointerUp() {
|
|
56
|
+
isDragging.value = false;
|
|
57
|
+
broadcastCamera();
|
|
58
|
+
}
|
|
59
|
+
function onCanvasWheel(ev) {
|
|
60
|
+
ev.preventDefault();
|
|
61
|
+
distance.value *= 1 + ev.deltaY * 1e-3;
|
|
62
|
+
distance.value = Math.max(1, Math.min(200, distance.value));
|
|
63
|
+
broadcastCamera();
|
|
64
|
+
}
|
|
65
|
+
function focusOn(worldPos) {
|
|
66
|
+
focusAnim = {
|
|
67
|
+
start: performance.now(),
|
|
68
|
+
fromX: targetX.value,
|
|
69
|
+
fromY: targetY.value,
|
|
70
|
+
fromZ: targetZ.value,
|
|
71
|
+
toX: worldPos[0],
|
|
72
|
+
toY: worldPos[1],
|
|
73
|
+
toZ: worldPos[2]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function onKeyDown(ev) {
|
|
77
|
+
if (controlMode.value !== "fly") return;
|
|
78
|
+
keysDown.add(ev.key.toLowerCase());
|
|
79
|
+
}
|
|
80
|
+
function onKeyUp(ev) {
|
|
81
|
+
keysDown.delete(ev.key.toLowerCase());
|
|
82
|
+
}
|
|
83
|
+
let rafId = 0;
|
|
84
|
+
function tick() {
|
|
85
|
+
rafId = requestAnimationFrame(tick);
|
|
86
|
+
if (focusAnim) {
|
|
87
|
+
const t = Math.min(1, (performance.now() - focusAnim.start) / 500);
|
|
88
|
+
const ease = t * (2 - t);
|
|
89
|
+
targetX.value = focusAnim.fromX + (focusAnim.toX - focusAnim.fromX) * ease;
|
|
90
|
+
targetY.value = focusAnim.fromY + (focusAnim.toY - focusAnim.fromY) * ease;
|
|
91
|
+
targetZ.value = focusAnim.fromZ + (focusAnim.toZ - focusAnim.fromZ) * ease;
|
|
92
|
+
if (t >= 1) focusAnim = null;
|
|
93
|
+
broadcastCamera();
|
|
94
|
+
}
|
|
95
|
+
if (controlMode.value === "fly") {
|
|
96
|
+
const speed = 0.15;
|
|
97
|
+
const sinA = Math.sin(azimuth.value);
|
|
98
|
+
const cosA = Math.cos(azimuth.value);
|
|
99
|
+
if (keysDown.has("w")) {
|
|
100
|
+
targetX.value -= sinA * speed;
|
|
101
|
+
targetZ.value -= cosA * speed;
|
|
102
|
+
}
|
|
103
|
+
if (keysDown.has("s")) {
|
|
104
|
+
targetX.value += sinA * speed;
|
|
105
|
+
targetZ.value += cosA * speed;
|
|
106
|
+
}
|
|
107
|
+
if (keysDown.has("a")) {
|
|
108
|
+
targetX.value -= cosA * speed;
|
|
109
|
+
targetZ.value += sinA * speed;
|
|
110
|
+
}
|
|
111
|
+
if (keysDown.has("d")) {
|
|
112
|
+
targetX.value += cosA * speed;
|
|
113
|
+
targetZ.value -= sinA * speed;
|
|
114
|
+
}
|
|
115
|
+
if (keysDown.has(" ")) targetY.value += speed;
|
|
116
|
+
if (keysDown.has("shift")) targetY.value -= speed;
|
|
117
|
+
if (keysDown.size > 0) broadcastCamera();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
let lastBroadcast = 0;
|
|
121
|
+
function broadcastCamera() {
|
|
122
|
+
if (isFollowing()) return;
|
|
123
|
+
const now = Date.now();
|
|
124
|
+
if (now - lastBroadcast < 80) return;
|
|
125
|
+
lastBroadcast = now;
|
|
126
|
+
setLocalState({
|
|
127
|
+
spatial: {
|
|
128
|
+
camera: {
|
|
129
|
+
position: cameraPosition.value,
|
|
130
|
+
target: cameraTarget.value,
|
|
131
|
+
timestamp: now
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
function applyCameraState(position, target) {
|
|
137
|
+
targetX.value = target[0];
|
|
138
|
+
targetY.value = target[1];
|
|
139
|
+
targetZ.value = target[2];
|
|
140
|
+
const dx = position[0] - target[0];
|
|
141
|
+
const dy = position[1] - target[1];
|
|
142
|
+
const dz = position[2] - target[2];
|
|
143
|
+
distance.value = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
144
|
+
if (distance.value > 1e-3) {
|
|
145
|
+
elevation.value = Math.asin(dy / distance.value);
|
|
146
|
+
azimuth.value = Math.atan2(dx, dz);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
onMounted(() => {
|
|
150
|
+
rafId = requestAnimationFrame(tick);
|
|
151
|
+
window.addEventListener("keydown", onKeyDown);
|
|
152
|
+
window.addEventListener("keyup", onKeyUp);
|
|
153
|
+
});
|
|
154
|
+
onBeforeUnmount(() => {
|
|
155
|
+
cancelAnimationFrame(rafId);
|
|
156
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
157
|
+
window.removeEventListener("keyup", onKeyUp);
|
|
158
|
+
});
|
|
159
|
+
return {
|
|
160
|
+
cameraRef,
|
|
161
|
+
cameraPosition,
|
|
162
|
+
cameraTarget,
|
|
163
|
+
controlMode,
|
|
164
|
+
azimuth,
|
|
165
|
+
elevation,
|
|
166
|
+
distance,
|
|
167
|
+
focusOn,
|
|
168
|
+
broadcastCamera,
|
|
169
|
+
applyCameraState,
|
|
170
|
+
onCanvasPointerDown,
|
|
171
|
+
onCanvasPointerMove,
|
|
172
|
+
onCanvasPointerUp,
|
|
173
|
+
onCanvasWheel
|
|
174
|
+
};
|
|
175
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { TreeEntry } from '../types.js';
|
|
3
|
+
export declare function useSpatialDrag(tree: {
|
|
4
|
+
entries: Ref<TreeEntry[]>;
|
|
5
|
+
updateMeta: (id: string, meta: Record<string, unknown>) => void;
|
|
6
|
+
}, selectedIds: Ref<Set<string>>, _cameraRef: Ref<any>, setLocalState: (state: Record<string, unknown>) => void, sceneSettings: {
|
|
7
|
+
data: Record<string, unknown>;
|
|
8
|
+
}): {
|
|
9
|
+
draggingId: Ref<string | null, string | null>;
|
|
10
|
+
bindScene: (canvas: HTMLCanvasElement, sceneObj: any, cameraObj: any) => void;
|
|
11
|
+
onPointerDown: (ev: PointerEvent) => string | null;
|
|
12
|
+
onPointerMove: (ev: PointerEvent) => void;
|
|
13
|
+
onPointerUp: (_ev: PointerEvent) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
2
|
+
export function useSpatialDrag(tree, selectedIds, _cameraRef, setLocalState, sceneSettings) {
|
|
3
|
+
const draggingId = ref(null);
|
|
4
|
+
let canvasEl = null;
|
|
5
|
+
let scene = null;
|
|
6
|
+
let camera = null;
|
|
7
|
+
let isDragging = false;
|
|
8
|
+
let dragStartWorldX = 0;
|
|
9
|
+
let dragStartWorldZ = 0;
|
|
10
|
+
const dragEntryStartPositions = /* @__PURE__ */ new Map();
|
|
11
|
+
const keysDown = /* @__PURE__ */ new Set();
|
|
12
|
+
function onKeyDown(ev) {
|
|
13
|
+
keysDown.add(ev.key.toLowerCase());
|
|
14
|
+
}
|
|
15
|
+
function onKeyUp(ev) {
|
|
16
|
+
keysDown.delete(ev.key.toLowerCase());
|
|
17
|
+
}
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
window.addEventListener("keydown", onKeyDown);
|
|
20
|
+
window.addEventListener("keyup", onKeyUp);
|
|
21
|
+
});
|
|
22
|
+
onBeforeUnmount(() => {
|
|
23
|
+
window.removeEventListener("keydown", onKeyDown);
|
|
24
|
+
window.removeEventListener("keyup", onKeyUp);
|
|
25
|
+
});
|
|
26
|
+
function bindScene(canvas, sceneObj, cameraObj) {
|
|
27
|
+
canvasEl = canvas;
|
|
28
|
+
scene = sceneObj;
|
|
29
|
+
camera = cameraObj;
|
|
30
|
+
}
|
|
31
|
+
function raycastEntryId(ev) {
|
|
32
|
+
if (!canvasEl || !scene || !camera) return null;
|
|
33
|
+
try {
|
|
34
|
+
const THREE = globalThis.__ABRACA_SHARED__?.three;
|
|
35
|
+
if (!THREE) return null;
|
|
36
|
+
const rect = canvasEl.getBoundingClientRect();
|
|
37
|
+
const pointer = new THREE.Vector2(
|
|
38
|
+
(ev.clientX - rect.left) / rect.width * 2 - 1,
|
|
39
|
+
-((ev.clientY - rect.top) / rect.height) * 2 + 1
|
|
40
|
+
);
|
|
41
|
+
const raycaster = new THREE.Raycaster();
|
|
42
|
+
raycaster.setFromCamera(pointer, camera);
|
|
43
|
+
const intersects = raycaster.intersectObjects(scene.children, true);
|
|
44
|
+
for (const hit of intersects) {
|
|
45
|
+
let obj = hit.object;
|
|
46
|
+
while (obj) {
|
|
47
|
+
if (obj.userData?.entryId) return obj.userData.entryId;
|
|
48
|
+
obj = obj.parent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function getGroundIntersection(ev) {
|
|
56
|
+
if (!canvasEl || !camera) return null;
|
|
57
|
+
try {
|
|
58
|
+
const THREE = globalThis.__ABRACA_SHARED__?.three;
|
|
59
|
+
if (!THREE) return null;
|
|
60
|
+
const rect = canvasEl.getBoundingClientRect();
|
|
61
|
+
const pointer = new THREE.Vector2(
|
|
62
|
+
(ev.clientX - rect.left) / rect.width * 2 - 1,
|
|
63
|
+
-((ev.clientY - rect.top) / rect.height) * 2 + 1
|
|
64
|
+
);
|
|
65
|
+
const raycaster = new THREE.Raycaster();
|
|
66
|
+
raycaster.setFromCamera(pointer, camera);
|
|
67
|
+
const plane = new THREE.Plane(new THREE.Vector3(0, 1, 0), 0);
|
|
68
|
+
const target = new THREE.Vector3();
|
|
69
|
+
const hit = raycaster.ray.intersectPlane(plane, target);
|
|
70
|
+
return hit ? { x: target.x, z: target.z } : null;
|
|
71
|
+
} catch {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function onPointerDown(ev) {
|
|
76
|
+
if (ev.button !== 0) return null;
|
|
77
|
+
const hitId = raycastEntryId(ev);
|
|
78
|
+
if (!hitId) return null;
|
|
79
|
+
isDragging = true;
|
|
80
|
+
draggingId.value = hitId;
|
|
81
|
+
dragEntryStartPositions.clear();
|
|
82
|
+
const worldPos = getGroundIntersection(ev);
|
|
83
|
+
if (worldPos) {
|
|
84
|
+
dragStartWorldX = worldPos.x;
|
|
85
|
+
dragStartWorldZ = worldPos.z;
|
|
86
|
+
}
|
|
87
|
+
setLocalState({ spatial: { dragging: hitId } });
|
|
88
|
+
return hitId;
|
|
89
|
+
}
|
|
90
|
+
function onPointerMove(ev) {
|
|
91
|
+
if (!isDragging || !draggingId.value) return;
|
|
92
|
+
if (dragEntryStartPositions.size === 0) {
|
|
93
|
+
for (const id of selectedIds.value) {
|
|
94
|
+
const entry = tree.entries.value.find((e) => e.id === id);
|
|
95
|
+
if (entry) {
|
|
96
|
+
dragEntryStartPositions.set(id, {
|
|
97
|
+
x: entry.meta?.spX ?? 0,
|
|
98
|
+
y: entry.meta?.spY ?? 0,
|
|
99
|
+
z: entry.meta?.spZ ?? 0
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const worldPos = getGroundIntersection(ev);
|
|
105
|
+
if (!worldPos) return;
|
|
106
|
+
let dx = worldPos.x - dragStartWorldX;
|
|
107
|
+
const dy = 0;
|
|
108
|
+
let dz = worldPos.z - dragStartWorldZ;
|
|
109
|
+
if (keysDown.has("x")) {
|
|
110
|
+
dz = 0;
|
|
111
|
+
}
|
|
112
|
+
if (keysDown.has("z")) {
|
|
113
|
+
dx = 0;
|
|
114
|
+
}
|
|
115
|
+
const snapSize = sceneSettings.data.snapSize || 0;
|
|
116
|
+
const snap = (v) => snapSize > 0 ? Math.round(v / snapSize) * snapSize : v;
|
|
117
|
+
for (const [id, start] of dragEntryStartPositions) {
|
|
118
|
+
const newX = snap(start.x + dx);
|
|
119
|
+
const newY = snap(start.y + dy);
|
|
120
|
+
const newZ = snap(start.z + dz);
|
|
121
|
+
tree.updateMeta(id, { spX: newX, spY: newY, spZ: newZ });
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function onPointerUp(_ev) {
|
|
125
|
+
isDragging = false;
|
|
126
|
+
draggingId.value = null;
|
|
127
|
+
dragEntryStartPositions.clear();
|
|
128
|
+
setLocalState({ spatial: { dragging: null } });
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
draggingId,
|
|
132
|
+
bindScene,
|
|
133
|
+
onPointerDown,
|
|
134
|
+
onPointerMove,
|
|
135
|
+
onPointerUp
|
|
136
|
+
};
|
|
137
|
+
}
|