@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
|
|
2
|
+
docId: string;
|
|
3
|
+
slug: string;
|
|
4
|
+
html: string;
|
|
5
|
+
title: any;
|
|
6
|
+
type: any;
|
|
7
|
+
meta: any;
|
|
8
|
+
description: any;
|
|
9
|
+
ogImage: any;
|
|
10
|
+
source: "none" | "crdt-cache";
|
|
11
|
+
}>>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineEventHandler, getRouterParam, createError } from "h3";
|
|
2
|
+
import { getDocIdFromSlug } from "../../../utils/slugMap.js";
|
|
3
|
+
import { getCachedHTML, getCachedJSON } from "../../../utils/docCache.js";
|
|
4
|
+
function extractFirstParagraph(html) {
|
|
5
|
+
if (!html) return "";
|
|
6
|
+
const pMatch = html.match(/<p[^>]*>(.*?)<\/p>/is);
|
|
7
|
+
const raw = pMatch?.[1] ?? html;
|
|
8
|
+
const text = raw.replace(/<[^>]+>/g, "").replace(/&[a-z]+;/gi, " ").trim();
|
|
9
|
+
if (!text) return "";
|
|
10
|
+
return text.length > 160 ? text.slice(0, 157) + "..." : text;
|
|
11
|
+
}
|
|
12
|
+
function extractFirstImage(html) {
|
|
13
|
+
if (!html) return "";
|
|
14
|
+
const match = html.match(/<img[^>]+src=["']([^"']+)["']/i);
|
|
15
|
+
return match?.[1] ?? "";
|
|
16
|
+
}
|
|
17
|
+
export default defineEventHandler(async (event) => {
|
|
18
|
+
const slugParam = getRouterParam(event, "slug");
|
|
19
|
+
if (!slugParam) {
|
|
20
|
+
throw createError({ statusCode: 400, message: "slug is required" });
|
|
21
|
+
}
|
|
22
|
+
const slug = slugParam;
|
|
23
|
+
const docId = getDocIdFromSlug(slug);
|
|
24
|
+
if (!docId) {
|
|
25
|
+
throw createError({ statusCode: 404, message: `Document not found for slug: ${slug}` });
|
|
26
|
+
}
|
|
27
|
+
const [cachedHtml, cachedJson] = await Promise.all([
|
|
28
|
+
getCachedHTML(docId),
|
|
29
|
+
getCachedJSON(docId)
|
|
30
|
+
]);
|
|
31
|
+
const html = cachedHtml ?? "";
|
|
32
|
+
const treeEntry = cachedJson?.["doc-tree"]?.[docId] ?? {};
|
|
33
|
+
return {
|
|
34
|
+
docId,
|
|
35
|
+
slug,
|
|
36
|
+
html,
|
|
37
|
+
title: treeEntry.label ?? "",
|
|
38
|
+
type: treeEntry.type ?? "doc",
|
|
39
|
+
meta: treeEntry.meta ?? {},
|
|
40
|
+
description: treeEntry.meta?.note ?? treeEntry.meta?.description ?? extractFirstParagraph(html),
|
|
41
|
+
ogImage: treeEntry.meta?.coverImage ?? extractFirstImage(html),
|
|
42
|
+
source: cachedHtml !== null ? "crdt-cache" : "none"
|
|
43
|
+
};
|
|
44
|
+
});
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* GET /api/_abracadabra/spaces
|
|
3
|
-
*
|
|
4
|
-
* Proxies the Abracadabra REST space list endpoint.
|
|
5
|
-
* Enables app devs to server-side render space navigation.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* const { data } = await useFetch('/api/_abracadabra/spaces')
|
|
9
|
-
*/
|
|
10
|
-
declare const _default: any;
|
|
1
|
+
declare const _default: import("h3").EventHandler<Omit<import("h3").EventHandlerRequest, "body">, Promise<never[] | unknown[]>>;
|
|
11
2
|
export default _default;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createError, getHeader } from "h3";
|
|
2
|
+
import { defineCachedEventHandler } from "nitropack/runtime";
|
|
3
|
+
import { useRuntimeConfig } from "nitropack/runtime/config";
|
|
1
4
|
export default defineCachedEventHandler(async (event) => {
|
|
2
5
|
const config = useRuntimeConfig();
|
|
3
6
|
const baseUrl = config.public?.abracadabra?.url;
|
|
@@ -4,6 +4,7 @@ import { useStorage } from "nitropack/runtime/storage";
|
|
|
4
4
|
import { registerServerPlugin, bootRunners, shutdownAllRunners } from "../utils/serverRunner.js";
|
|
5
5
|
import { createDocCacheAPI } from "../utils/docCache.js";
|
|
6
6
|
import { docTreeCacheRunner } from "../runners/doc-tree-cache.js";
|
|
7
|
+
import { initSlugMap, loadPersistedSlugMap } from "../utils/slugMap.js";
|
|
7
8
|
function fromBase64Url(str) {
|
|
8
9
|
const b = atob(str.replace(/-/g, "+").replace(/_/g, "/").padEnd(str.length + (4 - str.length % 4) % 4, "="));
|
|
9
10
|
const a = new Uint8Array(b.length);
|
|
@@ -18,6 +19,9 @@ function toBase64Url(bytes) {
|
|
|
18
19
|
export default defineNitroPlugin(async (nitroApp) => {
|
|
19
20
|
const config = useRuntimeConfig();
|
|
20
21
|
const abraConfig = config.abracadabra;
|
|
22
|
+
const storage = useStorage();
|
|
23
|
+
initSlugMap(storage);
|
|
24
|
+
await loadPersistedSlugMap();
|
|
21
25
|
const pubKeyB64 = abraConfig?.servicePublicKey ?? "";
|
|
22
26
|
const privKeyB64 = abraConfig?.servicePrivateKey ?? "";
|
|
23
27
|
const rootDocIdOverride = abraConfig?.serviceRootDocId ?? "";
|
|
@@ -28,20 +32,20 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
28
32
|
let wsp = null;
|
|
29
33
|
try {
|
|
30
34
|
const [
|
|
31
|
-
{ AbracadabraClient, AbracadabraProvider,
|
|
35
|
+
{ AbracadabraClient, AbracadabraProvider, AbracadabraWS },
|
|
32
36
|
ed,
|
|
33
37
|
{ sha512 },
|
|
34
38
|
Y
|
|
35
39
|
] = await Promise.all([
|
|
36
40
|
import("@abraca/dabra"),
|
|
37
41
|
import("@noble/ed25519"),
|
|
38
|
-
import("@noble/hashes/
|
|
42
|
+
import("@noble/hashes/sha512"),
|
|
39
43
|
import("yjs")
|
|
40
44
|
]);
|
|
41
|
-
ed.
|
|
42
|
-
ed.etc.sha512Sync = (m) => sha512(m);
|
|
45
|
+
ed.hashes.sha512 = (m) => sha512(m);
|
|
43
46
|
const privKey = fromBase64Url(privKeyB64);
|
|
44
47
|
const client = new AbracadabraClient({
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Nuxt runtime config augmentation not resolved in Nitro
|
|
45
49
|
url: config.public?.abracadabra?.url,
|
|
46
50
|
persistAuth: false
|
|
47
51
|
});
|
|
@@ -51,14 +55,14 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
51
55
|
});
|
|
52
56
|
console.log("[abracadabra-service] Authenticated as service role");
|
|
53
57
|
const wsUrl = client.wsUrl;
|
|
54
|
-
wsp = new
|
|
58
|
+
wsp = new AbracadabraWS({
|
|
55
59
|
url: wsUrl,
|
|
56
60
|
delay: 1e3,
|
|
57
61
|
minDelay: 1e3,
|
|
58
62
|
maxDelay: 3e4,
|
|
59
63
|
factor: 2,
|
|
60
64
|
jitter: true,
|
|
61
|
-
maxAttempts:
|
|
65
|
+
maxAttempts: 50
|
|
62
66
|
});
|
|
63
67
|
let rootDocId = rootDocIdOverride;
|
|
64
68
|
if (!rootDocId) {
|
|
@@ -79,21 +83,34 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
79
83
|
document: rootDoc,
|
|
80
84
|
name: rootDocId,
|
|
81
85
|
websocketProvider: wsp,
|
|
82
|
-
disableOfflineStore: true
|
|
86
|
+
disableOfflineStore: true,
|
|
87
|
+
cryptoIdentity: { publicKey: pubKeyB64 },
|
|
88
|
+
signChallenge: async (challenge) => {
|
|
89
|
+
const sig = await ed.sign(fromBase64Url(challenge), privKey);
|
|
90
|
+
return toBase64Url(sig);
|
|
91
|
+
}
|
|
83
92
|
});
|
|
84
|
-
rootProvider.attach
|
|
93
|
+
rootProvider.attach();
|
|
85
94
|
await Promise.race([
|
|
86
|
-
new Promise((resolve) =>
|
|
95
|
+
new Promise((resolve) => {
|
|
96
|
+
const handler = ({ state }) => {
|
|
97
|
+
if (state) {
|
|
98
|
+
rootProvider.off("synced", handler);
|
|
99
|
+
resolve();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
rootProvider.on("synced", handler);
|
|
103
|
+
}),
|
|
87
104
|
new Promise((_, reject) => setTimeout(() => reject(new Error("sync timeout")), 3e4))
|
|
88
105
|
]);
|
|
89
106
|
console.log("[abracadabra-service] Root doc synced");
|
|
90
|
-
const
|
|
107
|
+
const storage2 = useStorage();
|
|
91
108
|
const ctx = {
|
|
92
109
|
client,
|
|
93
110
|
wsp,
|
|
94
111
|
rootDoc,
|
|
95
112
|
rootProvider,
|
|
96
|
-
storage,
|
|
113
|
+
storage: storage2,
|
|
97
114
|
docCache: createDocCacheAPI(rootDoc)
|
|
98
115
|
};
|
|
99
116
|
const publicConfig = config.public?.abracadabra;
|
|
@@ -113,7 +130,7 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
113
130
|
console.log("[abracadabra-service] Shutdown complete");
|
|
114
131
|
});
|
|
115
132
|
} catch (err) {
|
|
116
|
-
console.error("[abracadabra-service] Failed to initialize:", err
|
|
133
|
+
console.error("[abracadabra-service] Failed to initialize:", err instanceof Error ? err.message : err);
|
|
117
134
|
wsp?.destroy?.();
|
|
118
135
|
}
|
|
119
136
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { initDocCache, observeDoc, unobserveDoc } from "../utils/docCache.js";
|
|
2
2
|
import { getServerPlugins } from "../utils/serverRunner.js";
|
|
3
|
+
import { initSlugMap, rebuildSlugMapSync, rebuildSlugMap } from "../utils/slugMap.js";
|
|
3
4
|
export const docTreeCacheRunner = {
|
|
4
5
|
name: "abracadabra:doc-tree-cache",
|
|
5
6
|
async start(ctx) {
|
|
@@ -9,6 +10,7 @@ export const docTreeCacheRunner = {
|
|
|
9
10
|
const pendingDocs = /* @__PURE__ */ new Set();
|
|
10
11
|
const serverExts = getServerPlugins().flatMap((p) => p.serverExtensions?.() ?? []);
|
|
11
12
|
initDocCache(storage, serverExts);
|
|
13
|
+
initSlugMap(storage);
|
|
12
14
|
async function trackDoc(docId) {
|
|
13
15
|
if (loadedDocs.has(docId) || pendingDocs.has(docId)) return;
|
|
14
16
|
pendingDocs.add(docId);
|
|
@@ -42,6 +44,7 @@ export const docTreeCacheRunner = {
|
|
|
42
44
|
treeMap.forEach((_val, docId) => {
|
|
43
45
|
trackDoc(docId);
|
|
44
46
|
});
|
|
47
|
+
rebuildSlugMapSync(treeMap);
|
|
45
48
|
const observer = (event) => {
|
|
46
49
|
event.keysChanged.forEach((docId) => {
|
|
47
50
|
if (treeMap.has(docId)) {
|
|
@@ -52,6 +55,7 @@ export const docTreeCacheRunner = {
|
|
|
52
55
|
console.log(`[abracadabra:doc-tree-cache] Untracked: ${docId}`);
|
|
53
56
|
}
|
|
54
57
|
});
|
|
58
|
+
rebuildSlugMap(treeMap);
|
|
55
59
|
};
|
|
56
60
|
treeMap.observe(observer);
|
|
57
61
|
return () => {
|
|
@@ -6,20 +6,22 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Used by the built-in doc-tree-cache server runner and by the SSR render route.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { AnyExtension } from '@tiptap/core';
|
|
10
|
+
import type * as Y from 'yjs';
|
|
11
|
+
import type { DocCacheAPI, NitroStorage } from '../../../runtime/types.js';
|
|
10
12
|
/**
|
|
11
13
|
* Initialize the cache with a Nitro storage handle and optional extra extensions.
|
|
12
14
|
* Must be called before observeDoc().
|
|
13
15
|
*/
|
|
14
|
-
export declare function initDocCache(storage:
|
|
16
|
+
export declare function initDocCache(storage: NitroStorage, extraExtensions?: AnyExtension[]): void;
|
|
15
17
|
export declare function getCachedHTML(docId: string): Promise<string | null>;
|
|
16
|
-
export declare function getCachedJSON(docId: string): Promise<
|
|
17
|
-
export declare function invalidateDoc(docId: string, ydoc?:
|
|
18
|
+
export declare function getCachedJSON(docId: string): Promise<Record<string, unknown> | null>;
|
|
19
|
+
export declare function invalidateDoc(docId: string, ydoc?: Y.Doc): Promise<void>;
|
|
18
20
|
/**
|
|
19
21
|
* Start observing a Y.Doc for changes with debounced re-rendering.
|
|
20
22
|
* Renders immediately on first observe.
|
|
21
23
|
*/
|
|
22
|
-
export declare function observeDoc(docId: string, ydoc:
|
|
24
|
+
export declare function observeDoc(docId: string, ydoc: Y.Doc): void;
|
|
23
25
|
export declare function unobserveDoc(docId: string): void;
|
|
24
26
|
/** Build the DocCacheAPI object for the ServerRunnerContext. */
|
|
25
|
-
export declare function createDocCacheAPI(rootDoc:
|
|
27
|
+
export declare function createDocCacheAPI(rootDoc: Y.Doc): DocCacheAPI;
|
|
@@ -18,7 +18,7 @@ async function renderDocToHTML(ydoc) {
|
|
|
18
18
|
return generateHTML(json, [StarterKit, ..._extensions]);
|
|
19
19
|
} catch (e) {
|
|
20
20
|
console.warn("[abracadabra:doc-cache] HTML render failed:", e);
|
|
21
|
-
return
|
|
21
|
+
return null;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
async function renderDocToJSON(ydoc) {
|
|
@@ -61,8 +61,8 @@ export async function invalidateDoc(docId, ydoc) {
|
|
|
61
61
|
renderDocToJSON(doc)
|
|
62
62
|
]);
|
|
63
63
|
await Promise.all([
|
|
64
|
-
_storage.setItem(htmlKey(docId), html),
|
|
65
|
-
_storage.setItem(jsonKey(docId), json)
|
|
64
|
+
html !== null ? _storage.setItem(htmlKey(docId), html) : Promise.resolve(),
|
|
65
|
+
json !== null ? _storage.setItem(jsonKey(docId), json) : Promise.resolve()
|
|
66
66
|
]);
|
|
67
67
|
}
|
|
68
68
|
export function observeDoc(docId, ydoc) {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic server plugin loader.
|
|
3
|
+
*
|
|
4
|
+
* Loads AbracadabraPlugin modules from ESM URLs at runtime.
|
|
5
|
+
* Appends `.server.js` to the base URL, fetches the module text,
|
|
6
|
+
* and imports it via a data: URL (stable in Node 22+).
|
|
7
|
+
*
|
|
8
|
+
* Ported from cou-sh/server/utils/serverPluginLoader.ts.
|
|
9
|
+
*/
|
|
10
|
+
import type { AbracadabraPlugin } from '../../types.js';
|
|
11
|
+
/**
|
|
12
|
+
* Load a server plugin from an ESM URL.
|
|
13
|
+
* Appends `.server.js` to the base URL, fetches the module text,
|
|
14
|
+
* and imports it via a data: URL (stable in Node 22+).
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadServerPlugin(baseUrl: string): Promise<AbracadabraPlugin>;
|
|
17
|
+
/** Clear the entire module cache (e.g. for reloading updated plugins). */
|
|
18
|
+
export declare function clearPluginCache(): void;
|
|
19
|
+
/** Evict a single URL from the cache. */
|
|
20
|
+
export declare function evictPlugin(baseUrl: string): void;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const _moduleCache = /* @__PURE__ */ new Map();
|
|
2
|
+
const _allowlist = (() => {
|
|
3
|
+
const raw = process.env.ABRA_PLUGIN_ALLOWLIST;
|
|
4
|
+
if (!raw) return [];
|
|
5
|
+
return raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
6
|
+
})();
|
|
7
|
+
export async function loadServerPlugin(baseUrl) {
|
|
8
|
+
const url = `${baseUrl}.server.js`;
|
|
9
|
+
const cached = _moduleCache.get(url);
|
|
10
|
+
if (cached) return cached;
|
|
11
|
+
if (_allowlist.length > 0 && !_allowlist.some((prefix) => url.startsWith(prefix))) {
|
|
12
|
+
throw new Error(`[plugin-loader] URL not in allowlist: ${url}`);
|
|
13
|
+
}
|
|
14
|
+
console.log(`[plugin-loader] Fetching: ${url}`);
|
|
15
|
+
const response = await fetch(url);
|
|
16
|
+
if (!response.ok) {
|
|
17
|
+
throw new Error(`[plugin-loader] HTTP ${response.status} fetching ${url}`);
|
|
18
|
+
}
|
|
19
|
+
const code = await response.text();
|
|
20
|
+
const encoded = Buffer.from(code).toString("base64");
|
|
21
|
+
const dataUrl = `data:text/javascript;base64,${encoded}`;
|
|
22
|
+
const mod = await import(
|
|
23
|
+
/* @vite-ignore */
|
|
24
|
+
dataUrl
|
|
25
|
+
);
|
|
26
|
+
const plugin = mod.default ?? mod;
|
|
27
|
+
if (!plugin?.name) {
|
|
28
|
+
throw new Error(`[plugin-loader] Module at ${url} does not export a valid AbracadabraPlugin (missing name)`);
|
|
29
|
+
}
|
|
30
|
+
if (!plugin.serverRunners?.length) {
|
|
31
|
+
console.warn(`[plugin-loader] Plugin "${plugin.name}" from ${url} has no serverRunners`);
|
|
32
|
+
}
|
|
33
|
+
_moduleCache.set(url, plugin);
|
|
34
|
+
console.log(`[plugin-loader] Loaded plugin: ${plugin.name}${plugin.version ? ` v${plugin.version}` : ""}`);
|
|
35
|
+
return plugin;
|
|
36
|
+
}
|
|
37
|
+
export function clearPluginCache() {
|
|
38
|
+
_moduleCache.clear();
|
|
39
|
+
}
|
|
40
|
+
export function evictPlugin(baseUrl) {
|
|
41
|
+
_moduleCache.delete(`${baseUrl}.server.js`);
|
|
42
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* })
|
|
13
13
|
* })
|
|
14
14
|
*/
|
|
15
|
-
import type { AbracadabraPlugin, ServerRunnerContext } from '../../types.js';
|
|
15
|
+
import type { AbracadabraPlugin, ServerRunnerDefinition, ServerRunnerContext } from '../../types.js';
|
|
16
16
|
/**
|
|
17
17
|
* Register a plugin that may declare serverRunners.
|
|
18
18
|
* Must be called before bootRunners() (e.g. inside the 'abracadabra:before-runners' hook).
|
|
@@ -22,7 +22,16 @@ export declare function registerServerPlugin(plugin: AbracadabraPlugin): void;
|
|
|
22
22
|
export declare function getServerPlugins(): readonly AbracadabraPlugin[];
|
|
23
23
|
/** Boot all runners from all registered plugins. Called once after auth + sync. */
|
|
24
24
|
export declare function bootRunners(ctx: ServerRunnerContext): Promise<void>;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Start a single runner. Optionally namespace-prefix the key for per-space isolation.
|
|
27
|
+
* When namespace is provided, the runner key becomes `${namespace}:${def.name}`.
|
|
28
|
+
*/
|
|
29
|
+
export declare function startRunner(def: ServerRunnerDefinition, ctx?: ServerRunnerContext, namespace?: string): Promise<void>;
|
|
30
|
+
/** Stop a single runner by its full key and remove it from the registry. */
|
|
26
31
|
export declare function stopRunner(name: string): Promise<void>;
|
|
32
|
+
/** Stop all runners whose key starts with the given prefix (for space teardown). */
|
|
33
|
+
export declare function stopRunnersWithPrefix(prefix: string): Promise<void>;
|
|
34
|
+
/** Get all running runner keys. */
|
|
35
|
+
export declare function getRunnerKeys(): string[];
|
|
27
36
|
/** Shutdown all runners gracefully. Called on server close. */
|
|
28
37
|
export declare function shutdownAllRunners(): Promise<void>;
|
|
@@ -15,27 +15,29 @@ export async function bootRunners(ctx) {
|
|
|
15
15
|
_serverCtx = ctx;
|
|
16
16
|
for (const plugin of _plugins) {
|
|
17
17
|
for (const def of plugin.serverRunners ?? []) {
|
|
18
|
-
await
|
|
18
|
+
await startRunner(def, ctx);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
async function
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
export async function startRunner(def, ctx, namespace) {
|
|
23
|
+
const key = namespace ? `${namespace}:${def.name}` : def.name;
|
|
24
|
+
if (_runners.has(key)) {
|
|
25
|
+
console.warn(`[abracadabra-service] Runner "${key}" already running`);
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
const runCtx = ctx ?? _serverCtx;
|
|
29
|
+
if (!runCtx) {
|
|
28
30
|
throw new Error("[abracadabra-service] Server context not initialized");
|
|
29
31
|
}
|
|
30
32
|
const state = { definition: def, cleanup: void 0, running: false };
|
|
31
|
-
_runners.set(
|
|
33
|
+
_runners.set(key, state);
|
|
32
34
|
try {
|
|
33
|
-
console.log(`[abracadabra-service] Starting runner: ${
|
|
34
|
-
state.cleanup = await def.start(
|
|
35
|
+
console.log(`[abracadabra-service] Starting runner: ${key}`);
|
|
36
|
+
state.cleanup = await def.start(runCtx);
|
|
35
37
|
state.running = true;
|
|
36
38
|
} catch (err) {
|
|
37
|
-
console.error(`[abracadabra-service] Runner "${
|
|
38
|
-
_runners.delete(
|
|
39
|
+
console.error(`[abracadabra-service] Runner "${key}" failed to start:`, err);
|
|
40
|
+
_runners.delete(key);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
export async function stopRunner(name) {
|
|
@@ -49,6 +51,15 @@ export async function stopRunner(name) {
|
|
|
49
51
|
_runners.delete(name);
|
|
50
52
|
console.log(`[abracadabra-service] Stopped runner: ${name}`);
|
|
51
53
|
}
|
|
54
|
+
export async function stopRunnersWithPrefix(prefix) {
|
|
55
|
+
const keys = [..._runners.keys()].filter((k) => k.startsWith(prefix));
|
|
56
|
+
for (const key of keys) {
|
|
57
|
+
await stopRunner(key);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export function getRunnerKeys() {
|
|
61
|
+
return [..._runners.keys()];
|
|
62
|
+
}
|
|
52
63
|
export async function shutdownAllRunners() {
|
|
53
64
|
for (const [name] of _runners) {
|
|
54
65
|
await stopRunner(name);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side slug map singleton.
|
|
3
|
+
*
|
|
4
|
+
* Maintains bidirectional slug↔docId maps, persists them to Nitro storage,
|
|
5
|
+
* and loads them on startup so slug routes work even before CRDT sync.
|
|
6
|
+
*/
|
|
7
|
+
import { type SlugMap } from '../../utils/slugify.js';
|
|
8
|
+
/**
|
|
9
|
+
* Initialize slug map with a Nitro storage handle.
|
|
10
|
+
* Call early in the service plugin lifecycle.
|
|
11
|
+
*/
|
|
12
|
+
export declare function initSlugMap(storage: any): void;
|
|
13
|
+
/**
|
|
14
|
+
* Load persisted slug map from storage.
|
|
15
|
+
* Call on startup before CRDT connects so slug routes work immediately.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadPersistedSlugMap(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Rebuild the slug map from a Y.Map tree (debounced).
|
|
20
|
+
* Called by the doc-tree-cache runner when the tree changes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function rebuildSlugMap(treeMap: any): void;
|
|
23
|
+
/**
|
|
24
|
+
* Rebuild immediately (used for initial load).
|
|
25
|
+
*/
|
|
26
|
+
export declare function rebuildSlugMapSync(treeMap: any): void;
|
|
27
|
+
/** Resolve a slug path to a docId. Returns null if not found. */
|
|
28
|
+
export declare function getDocIdFromSlug(slug: string): string | null;
|
|
29
|
+
/** Get the slug for a docId. Returns null if not found. */
|
|
30
|
+
export declare function getSlugFromDocId(docId: string): string | null;
|
|
31
|
+
/** Get the full current slug map (for the slugs API endpoint). */
|
|
32
|
+
export declare function getSlugMapData(): SlugMap;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { buildSlugMap } from "../../utils/slugify.js";
|
|
2
|
+
let _slugMap = { slugToId: {}, idToSlug: {} };
|
|
3
|
+
let _storage = null;
|
|
4
|
+
let _rebuildTimer = null;
|
|
5
|
+
const SLUG_STORAGE_KEY = "doc-cache:slug-map";
|
|
6
|
+
const REBUILD_DEBOUNCE_MS = 2e3;
|
|
7
|
+
export function initSlugMap(storage) {
|
|
8
|
+
_storage = storage;
|
|
9
|
+
}
|
|
10
|
+
export async function loadPersistedSlugMap() {
|
|
11
|
+
if (!_storage) return;
|
|
12
|
+
try {
|
|
13
|
+
const stored = await _storage.getItem(SLUG_STORAGE_KEY);
|
|
14
|
+
if (stored && typeof stored === "object" && stored.slugToId && stored.idToSlug) {
|
|
15
|
+
_slugMap = stored;
|
|
16
|
+
console.log(`[abracadabra:slug-map] Loaded ${Object.keys(_slugMap.slugToId).length} slugs from cache`);
|
|
17
|
+
}
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.warn("[abracadabra:slug-map] Failed to load persisted slug map:", e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function rebuildSlugMap(treeMap) {
|
|
23
|
+
if (_rebuildTimer) clearTimeout(_rebuildTimer);
|
|
24
|
+
_rebuildTimer = setTimeout(() => {
|
|
25
|
+
_rebuildTimer = null;
|
|
26
|
+
rebuildSlugMapSync(treeMap);
|
|
27
|
+
}, REBUILD_DEBOUNCE_MS);
|
|
28
|
+
}
|
|
29
|
+
export function rebuildSlugMapSync(treeMap) {
|
|
30
|
+
try {
|
|
31
|
+
const raw = treeMap.toJSON();
|
|
32
|
+
const entries = Object.entries(raw).map(([id, entry]) => ({
|
|
33
|
+
id,
|
|
34
|
+
label: entry.label ?? "",
|
|
35
|
+
parentId: entry.parentId ?? null,
|
|
36
|
+
order: entry.order ?? 0,
|
|
37
|
+
trashed: entry.trashed ?? false
|
|
38
|
+
}));
|
|
39
|
+
_slugMap = buildSlugMap(entries);
|
|
40
|
+
if (_storage) {
|
|
41
|
+
_storage.setItem(SLUG_STORAGE_KEY, _slugMap).catch((e) => {
|
|
42
|
+
console.warn("[abracadabra:slug-map] Failed to persist:", e);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
console.log(`[abracadabra:slug-map] Rebuilt: ${Object.keys(_slugMap.slugToId).length} slugs`);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
console.warn("[abracadabra:slug-map] Rebuild failed:", e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
export function getDocIdFromSlug(slug) {
|
|
51
|
+
return _slugMap.slugToId[slug] ?? null;
|
|
52
|
+
}
|
|
53
|
+
export function getSlugFromDocId(docId) {
|
|
54
|
+
return _slugMap.idToSlug[docId] ?? null;
|
|
55
|
+
}
|
|
56
|
+
export function getSlugMapData() {
|
|
57
|
+
return _slugMap;
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-space lifecycle manager.
|
|
3
|
+
*
|
|
4
|
+
* Discovers spaces from the Abracadabra server, connects to each one,
|
|
5
|
+
* starts per-space doc-tree-cache runners, and observes the space-plugins
|
|
6
|
+
* Y.Map for dynamic plugin loading/unloading.
|
|
7
|
+
*
|
|
8
|
+
* Ported from cou-sh/server/utils/spaceManager.ts.
|
|
9
|
+
*/
|
|
10
|
+
import type { AbracadabraClient, AbracadabraWS } from '@abraca/dabra';
|
|
11
|
+
import type { NitroStorage } from '../../types.js';
|
|
12
|
+
interface BaseCtx {
|
|
13
|
+
client: AbracadabraClient;
|
|
14
|
+
wsp: AbracadabraWS;
|
|
15
|
+
storage: NitroStorage;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Initialize the space manager. Discovers spaces and starts polling.
|
|
19
|
+
*/
|
|
20
|
+
export declare function initSpaceManager(baseCtx: BaseCtx): Promise<void>;
|
|
21
|
+
/** Shutdown all spaces and stop polling. */
|
|
22
|
+
export declare function shutdownSpaceManager(): Promise<void>;
|
|
23
|
+
/** Get all connected space IDs. */
|
|
24
|
+
export declare function getConnectedSpaces(): string[];
|
|
25
|
+
export {};
|