@abraca/nuxt 1.8.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist/module.d.mts +4 -3
- package/dist/module.json +1 -1
- package/dist/module.mjs +50 -4
- package/dist/runtime/components/ADocumentTree.vue +1 -1
- package/dist/runtime/components/AEditor.d.vue.ts +26 -1
- package/dist/runtime/components/AEditor.vue +153 -4
- package/dist/runtime/components/AEditor.vue.d.ts +26 -1
- package/dist/runtime/components/AIdentityModal.d.vue.ts +46 -0
- package/dist/runtime/components/AIdentityModal.vue +157 -0
- package/dist/runtime/components/AIdentityModal.vue.d.ts +46 -0
- package/dist/runtime/components/AMnemonicLoginModal.d.vue.ts +35 -0
- package/dist/runtime/components/AMnemonicLoginModal.vue +173 -0
- package/dist/runtime/components/AMnemonicLoginModal.vue.d.ts +35 -0
- package/dist/runtime/components/ANodePanel.d.vue.ts +29 -2
- package/dist/runtime/components/ANodePanel.vue +148 -27
- package/dist/runtime/components/ANodePanel.vue.d.ts +29 -2
- package/dist/runtime/components/ANodePanelHeader.d.vue.ts +64 -0
- package/dist/runtime/components/ANodePanelHeader.vue +105 -0
- package/dist/runtime/components/ANodePanelHeader.vue.d.ts +64 -0
- package/dist/runtime/components/ANodeSettingsPanel.d.vue.ts +49 -0
- package/dist/runtime/components/ANodeSettingsPanel.vue +59 -0
- package/dist/runtime/components/ANodeSettingsPanel.vue.d.ts +49 -0
- package/dist/runtime/components/ANotificationBell.d.vue.ts +26 -0
- package/dist/runtime/components/ANotificationBell.vue +55 -0
- package/dist/runtime/components/ANotificationBell.vue.d.ts +26 -0
- package/dist/runtime/components/AOfflineSync.d.vue.ts +11 -0
- package/dist/runtime/components/AOfflineSync.vue +217 -0
- package/dist/runtime/components/AOfflineSync.vue.d.ts +11 -0
- package/dist/runtime/components/ARecoveryPhraseDisplay.d.vue.ts +26 -0
- package/dist/runtime/components/ARecoveryPhraseDisplay.vue +94 -0
- package/dist/runtime/components/ARecoveryPhraseDisplay.vue.d.ts +26 -0
- package/dist/runtime/components/AServerInfoModal.d.vue.ts +43 -0
- package/dist/runtime/components/AServerInfoModal.vue +150 -0
- package/dist/runtime/components/AServerInfoModal.vue.d.ts +43 -0
- package/dist/runtime/components/ASpaceFormModal.vue +1 -1
- package/dist/runtime/components/aware/AAccordion.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AAccordion.vue +107 -0
- package/dist/runtime/components/aware/AAccordion.vue.d.ts +25 -0
- package/dist/runtime/components/aware/AArea.vue +24 -11
- package/dist/runtime/components/aware/AAvatar.d.vue.ts +6 -0
- package/dist/runtime/components/aware/AAvatar.vue +33 -3
- package/dist/runtime/components/aware/AAvatar.vue.d.ts +6 -0
- package/dist/runtime/components/aware/AAvatarGroup.d.vue.ts +10 -0
- package/dist/runtime/components/aware/AAvatarGroup.vue +30 -0
- package/dist/runtime/components/aware/AAvatarGroup.vue.d.ts +10 -0
- package/dist/runtime/components/aware/AButton.d.vue.ts +4 -2
- package/dist/runtime/components/aware/AButton.vue +46 -14
- package/dist/runtime/components/aware/AButton.vue.d.ts +4 -2
- package/dist/runtime/components/aware/ACalendar.d.vue.ts +17 -0
- package/dist/runtime/components/aware/ACalendar.vue +145 -0
- package/dist/runtime/components/aware/ACalendar.vue.d.ts +17 -0
- package/dist/runtime/components/aware/ACarousel.d.vue.ts +25 -0
- package/dist/runtime/components/aware/ACarousel.vue +39 -0
- package/dist/runtime/components/aware/ACarousel.vue.d.ts +25 -0
- package/dist/runtime/components/aware/ACheckbox.d.vue.ts +11 -0
- package/dist/runtime/components/aware/ACheckbox.vue +74 -0
- package/dist/runtime/components/aware/ACheckbox.vue.d.ts +11 -0
- package/dist/runtime/components/aware/ACheckboxGroup.d.vue.ts +27 -0
- package/dist/runtime/components/aware/ACheckboxGroup.vue +79 -0
- package/dist/runtime/components/aware/ACheckboxGroup.vue.d.ts +27 -0
- package/dist/runtime/components/aware/ACollapsible.d.vue.ts +25 -0
- package/dist/runtime/components/aware/ACollapsible.vue +45 -0
- package/dist/runtime/components/aware/ACollapsible.vue.d.ts +25 -0
- package/dist/runtime/components/aware/AColorPicker.d.vue.ts +15 -0
- package/dist/runtime/components/aware/AColorPicker.vue +48 -0
- package/dist/runtime/components/aware/AColorPicker.vue.d.ts +15 -0
- package/dist/runtime/components/aware/ACommandPalette.d.vue.ts +33 -0
- package/dist/runtime/components/aware/ACommandPalette.vue +123 -0
- package/dist/runtime/components/aware/ACommandPalette.vue.d.ts +33 -0
- package/dist/runtime/components/aware/AContextMenu.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AContextMenu.vue +63 -0
- package/dist/runtime/components/aware/AContextMenu.vue.d.ts +25 -0
- package/dist/runtime/components/aware/ADrawer.d.vue.ts +25 -0
- package/dist/runtime/components/aware/ADrawer.vue +57 -0
- package/dist/runtime/components/aware/ADrawer.vue.d.ts +25 -0
- package/dist/runtime/components/aware/ADropdownMenu.d.vue.ts +25 -0
- package/dist/runtime/components/aware/ADropdownMenu.vue +63 -0
- package/dist/runtime/components/aware/ADropdownMenu.vue.d.ts +25 -0
- package/dist/runtime/components/aware/AFileUpload.d.vue.ts +27 -0
- package/dist/runtime/components/aware/AFileUpload.vue +67 -0
- package/dist/runtime/components/aware/AFileUpload.vue.d.ts +27 -0
- package/dist/runtime/components/aware/AFollowBar.d.vue.ts +21 -0
- package/dist/runtime/components/aware/AFollowBar.vue +62 -0
- package/dist/runtime/components/aware/AFollowBar.vue.d.ts +21 -0
- package/dist/runtime/components/aware/AFollowScroll.d.vue.ts +7 -0
- package/dist/runtime/components/aware/AFollowScroll.vue +17 -0
- package/dist/runtime/components/aware/AFollowScroll.vue.d.ts +7 -0
- package/dist/runtime/components/aware/AFormSync.d.vue.ts +21 -0
- package/dist/runtime/components/aware/AFormSync.vue +52 -0
- package/dist/runtime/components/aware/AFormSync.vue.d.ts +21 -0
- package/dist/runtime/components/aware/AGlobalFocusLayer.d.vue.ts +3 -0
- package/dist/runtime/components/aware/AGlobalFocusLayer.vue +90 -0
- package/dist/runtime/components/aware/AGlobalFocusLayer.vue.d.ts +3 -0
- package/dist/runtime/components/aware/AHoverItem.d.vue.ts +27 -0
- package/dist/runtime/components/aware/AHoverItem.vue +124 -0
- package/dist/runtime/components/aware/AHoverItem.vue.d.ts +27 -0
- package/dist/runtime/components/aware/AInput.d.vue.ts +12 -2
- package/dist/runtime/components/aware/AInput.vue +72 -19
- package/dist/runtime/components/aware/AInput.vue.d.ts +12 -2
- package/dist/runtime/components/aware/AInputMenu.d.vue.ts +17 -0
- package/dist/runtime/components/aware/AInputMenu.vue +138 -0
- package/dist/runtime/components/aware/AInputMenu.vue.d.ts +17 -0
- package/dist/runtime/components/aware/AInputNumber.d.vue.ts +15 -0
- package/dist/runtime/components/aware/AInputNumber.vue +67 -0
- package/dist/runtime/components/aware/AInputNumber.vue.d.ts +15 -0
- package/dist/runtime/components/aware/AInputTags.d.vue.ts +15 -0
- package/dist/runtime/components/aware/AInputTags.vue +67 -0
- package/dist/runtime/components/aware/AInputTags.vue.d.ts +15 -0
- package/dist/runtime/components/aware/AKeyHint.d.vue.ts +3 -0
- package/dist/runtime/components/aware/AKeyHint.vue +23 -0
- package/dist/runtime/components/aware/AKeyHint.vue.d.ts +3 -0
- package/dist/runtime/components/aware/AMedia.d.vue.ts +19 -0
- package/dist/runtime/components/aware/AMedia.vue +85 -0
- package/dist/runtime/components/aware/AMedia.vue.d.ts +19 -0
- package/dist/runtime/components/aware/AModal.d.vue.ts +33 -0
- package/dist/runtime/components/aware/AModal.vue +110 -0
- package/dist/runtime/components/aware/AModal.vue.d.ts +33 -0
- package/dist/runtime/components/aware/ANavigationMenu.d.vue.ts +25 -0
- package/dist/runtime/components/aware/ANavigationMenu.vue +82 -0
- package/dist/runtime/components/aware/ANavigationMenu.vue.d.ts +25 -0
- package/dist/runtime/components/aware/APagination.d.vue.ts +13 -0
- package/dist/runtime/components/aware/APagination.vue +53 -0
- package/dist/runtime/components/aware/APagination.vue.d.ts +13 -0
- package/dist/runtime/components/aware/APeerCaretLayer.d.vue.ts +10 -0
- package/dist/runtime/components/aware/APeerCaretLayer.vue +133 -0
- package/dist/runtime/components/aware/APeerCaretLayer.vue.d.ts +10 -0
- package/dist/runtime/components/aware/APinInput.d.vue.ts +15 -0
- package/dist/runtime/components/aware/APinInput.vue +48 -0
- package/dist/runtime/components/aware/APinInput.vue.d.ts +15 -0
- package/dist/runtime/components/aware/APopover.d.vue.ts +25 -0
- package/dist/runtime/components/aware/APopover.vue +57 -0
- package/dist/runtime/components/aware/APopover.vue.d.ts +25 -0
- package/dist/runtime/components/aware/APresenceBlobs.d.vue.ts +3 -0
- package/dist/runtime/components/aware/APresenceBlobs.vue +69 -0
- package/dist/runtime/components/aware/APresenceBlobs.vue.d.ts +3 -0
- package/dist/runtime/components/aware/APresenceCursors.d.vue.ts +20 -0
- package/dist/runtime/components/aware/APresenceCursors.vue +47 -0
- package/dist/runtime/components/aware/APresenceCursors.vue.d.ts +20 -0
- package/dist/runtime/components/aware/ARadioGroup.d.vue.ts +27 -0
- package/dist/runtime/components/aware/ARadioGroup.vue +86 -0
- package/dist/runtime/components/aware/ARadioGroup.vue.d.ts +27 -0
- package/dist/runtime/components/aware/AScroll.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AScroll.vue +87 -0
- package/dist/runtime/components/aware/AScroll.vue.d.ts +25 -0
- package/dist/runtime/components/aware/ASelect.d.vue.ts +12 -2
- package/dist/runtime/components/aware/ASelect.vue +146 -22
- package/dist/runtime/components/aware/ASelect.vue.d.ts +12 -2
- package/dist/runtime/components/aware/ASelectMenu.d.vue.ts +17 -0
- package/dist/runtime/components/aware/ASelectMenu.vue +139 -0
- package/dist/runtime/components/aware/ASelectMenu.vue.d.ts +17 -0
- package/dist/runtime/components/aware/ASlideover.d.vue.ts +33 -0
- package/dist/runtime/components/aware/ASlideover.vue +110 -0
- package/dist/runtime/components/aware/ASlideover.vue.d.ts +33 -0
- package/dist/runtime/components/aware/ASlider.d.vue.ts +19 -0
- package/dist/runtime/components/aware/ASlider.vue +77 -0
- package/dist/runtime/components/aware/ASlider.vue.d.ts +19 -0
- package/dist/runtime/components/aware/AStepper.d.vue.ts +25 -0
- package/dist/runtime/components/aware/AStepper.vue +82 -0
- package/dist/runtime/components/aware/AStepper.vue.d.ts +25 -0
- package/dist/runtime/components/aware/ASwitch.d.vue.ts +11 -0
- package/dist/runtime/components/aware/ASwitch.vue +75 -0
- package/dist/runtime/components/aware/ASwitch.vue.d.ts +11 -0
- package/dist/runtime/components/aware/ATable.d.vue.ts +23 -0
- package/dist/runtime/components/aware/ATable.vue +97 -0
- package/dist/runtime/components/aware/ATable.vue.d.ts +23 -0
- package/dist/runtime/components/aware/ATabs.d.vue.ts +27 -0
- package/dist/runtime/components/aware/ATabs.vue +128 -0
- package/dist/runtime/components/aware/ATabs.vue.d.ts +27 -0
- package/dist/runtime/components/aware/ATextarea.d.vue.ts +12 -2
- package/dist/runtime/components/aware/ATextarea.vue +72 -19
- package/dist/runtime/components/aware/ATextarea.vue.d.ts +12 -2
- package/dist/runtime/components/aware/AToggleGroup.d.vue.ts +27 -0
- package/dist/runtime/components/aware/AToggleGroup.vue +79 -0
- package/dist/runtime/components/aware/AToggleGroup.vue.d.ts +27 -0
- package/dist/runtime/components/aware/ATree.d.vue.ts +27 -0
- package/dist/runtime/components/aware/ATree.vue +111 -0
- package/dist/runtime/components/aware/ATree.vue.d.ts +27 -0
- package/dist/runtime/components/chat/AChatPanel.d.vue.ts +6 -6
- package/dist/runtime/components/chat/AChatPanel.vue.d.ts +6 -6
- package/dist/runtime/components/chat/ANodeChatPanel.d.vue.ts +42 -0
- package/dist/runtime/components/chat/ANodeChatPanel.vue +53 -0
- package/dist/runtime/components/chat/ANodeChatPanel.vue.d.ts +42 -0
- package/dist/runtime/components/docs/ADocsNavigation.d.vue.ts +155 -0
- package/dist/runtime/components/docs/ADocsNavigation.vue +154 -0
- package/dist/runtime/components/docs/ADocsNavigation.vue.d.ts +155 -0
- package/dist/runtime/components/docs/ADocsSearch.d.vue.ts +249 -0
- package/dist/runtime/components/docs/ADocsSearch.vue +187 -0
- package/dist/runtime/components/docs/ADocsSearch.vue.d.ts +249 -0
- package/dist/runtime/components/docs/ADocsSearchButton.d.vue.ts +253 -0
- package/dist/runtime/components/docs/ADocsSearchButton.vue +99 -0
- package/dist/runtime/components/docs/ADocsSearchButton.vue.d.ts +253 -0
- package/dist/runtime/components/docs/ADocsSurround.d.vue.ts +56 -0
- package/dist/runtime/components/docs/ADocsSurround.vue +68 -0
- package/dist/runtime/components/docs/ADocsSurround.vue.d.ts +56 -0
- package/dist/runtime/components/docs/ADocsToc.d.vue.ts +117 -0
- package/dist/runtime/components/docs/ADocsToc.vue +194 -0
- package/dist/runtime/components/docs/ADocsToc.vue.d.ts +117 -0
- package/dist/runtime/components/editor/ADocLinkPopover.vue +1 -5
- package/dist/runtime/components/editor/AEditorRedoButton.d.vue.ts +26 -0
- package/dist/runtime/components/editor/AEditorRedoButton.vue +38 -0
- package/dist/runtime/components/editor/AEditorRedoButton.vue.d.ts +26 -0
- package/dist/runtime/components/editor/AEditorUndoButton.d.vue.ts +26 -0
- package/dist/runtime/components/editor/AEditorUndoButton.vue +38 -0
- package/dist/runtime/components/editor/AEditorUndoButton.vue.d.ts +26 -0
- package/dist/runtime/components/editor/AIconPickerPopover.d.vue.ts +24 -0
- package/dist/runtime/components/editor/AIconPickerPopover.vue +113 -0
- package/dist/runtime/components/editor/AIconPickerPopover.vue.d.ts +24 -0
- package/dist/runtime/components/editor/ANodeInlineLabel.d.vue.ts +24 -0
- package/dist/runtime/components/editor/ANodeInlineLabel.vue +101 -0
- package/dist/runtime/components/editor/ANodeInlineLabel.vue.d.ts +24 -0
- package/dist/runtime/components/renderers/ADocLoadError.d.vue.ts +3 -0
- package/dist/runtime/components/renderers/ADocLoadError.vue +11 -0
- package/dist/runtime/components/renderers/ADocLoadError.vue.d.ts +3 -0
- package/dist/runtime/components/renderers/ADocLoadingSkeleton.d.vue.ts +3 -0
- package/dist/runtime/components/renderers/ADocLoadingSkeleton.vue +5 -0
- package/dist/runtime/components/renderers/ADocLoadingSkeleton.vue.d.ts +3 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue +1 -1
- package/dist/runtime/components/renderers/AOverviewRenderer.d.vue.ts +22 -0
- package/dist/runtime/components/renderers/AOverviewRenderer.vue +1041 -0
- package/dist/runtime/components/renderers/AOverviewRenderer.vue.d.ts +22 -0
- package/dist/runtime/components/renderers/AProseRenderer.d.vue.ts +23 -0
- package/dist/runtime/components/renderers/AProseRenderer.vue +31 -0
- package/dist/runtime/components/renderers/AProseRenderer.vue.d.ts +23 -0
- package/dist/runtime/components/renderers/ASheetsRenderer.client.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/ASheetsRenderer.client.vue +865 -0
- package/dist/runtime/components/renderers/ASheetsRenderer.client.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue +45 -15
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue +93 -20
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue +31 -2
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +4 -4
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +4 -4
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue +94 -21
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +2 -2
- package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +2 -2
- package/dist/runtime/components/renderers/sheets/ASheetsCell.d.vue.ts +45 -0
- package/dist/runtime/components/renderers/sheets/ASheetsCell.vue +123 -0
- package/dist/runtime/components/renderers/sheets/ASheetsCell.vue.d.ts +45 -0
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.d.vue.ts +111 -0
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue +737 -0
- package/dist/runtime/components/renderers/sheets/ASheetsGrid.vue.d.ts +111 -0
- package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.d.vue.ts +26 -0
- package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue +100 -0
- package/dist/runtime/components/renderers/sheets/ASheetsMobileActionBar.vue.d.ts +26 -0
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.d.vue.ts +48 -0
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue +243 -0
- package/dist/runtime/components/renderers/sheets/ASheetsToolbar.vue.d.ts +48 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.d.vue.ts +1 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue +13 -32
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue.d.ts +1 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue +34 -4
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue +14 -3
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.d.vue.ts +13 -1
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue +114 -47
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue.d.ts +13 -1
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.d.vue.ts +4 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue +21 -4
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue.d.ts +4 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.d.vue.ts +2 -2
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue.d.ts +2 -2
- package/dist/runtime/components/settings/ASettingsSpacesPanel.vue +7 -25
- package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +34 -4
- package/dist/runtime/components/shell/ADocPanelSettings.vue +289 -2
- package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +34 -4
- package/dist/runtime/components/shell/ASyncStatus.d.vue.ts +1 -1
- package/dist/runtime/components/shell/ASyncStatus.vue.d.ts +1 -1
- package/dist/runtime/components/shell/AUserMenu.d.vue.ts +2 -2
- package/dist/runtime/components/shell/AUserMenu.vue.d.ts +2 -2
- package/dist/runtime/components/shell/AWelcomeScreen.d.vue.ts +1 -1
- package/dist/runtime/components/shell/AWelcomeScreen.vue.d.ts +1 -1
- package/dist/runtime/composables/useAACaret.d.ts +29 -0
- package/dist/runtime/composables/useAACaret.js +64 -0
- package/dist/runtime/composables/useAAEphemeral.d.ts +32 -0
- package/dist/runtime/composables/useAAEphemeral.js +33 -0
- package/dist/runtime/composables/useAAField.d.ts +10 -2
- package/dist/runtime/composables/useAAField.js +31 -2
- package/dist/runtime/composables/useAAFieldValue.d.ts +26 -0
- package/dist/runtime/composables/useAAFieldValue.js +32 -0
- package/dist/runtime/composables/useAAFocus.d.ts +68 -0
- package/dist/runtime/composables/useAAFocus.js +174 -0
- package/dist/runtime/composables/useAAFollowAnchor.d.ts +25 -0
- package/dist/runtime/composables/useAAFollowAnchor.js +69 -0
- package/dist/runtime/composables/useAAFollowPeer.d.ts +29 -0
- package/dist/runtime/composables/useAAFollowPeer.js +75 -0
- package/dist/runtime/composables/useAAKey.d.ts +22 -0
- package/dist/runtime/composables/useAAKey.js +24 -0
- package/dist/runtime/composables/useAAPointer.d.ts +30 -0
- package/dist/runtime/composables/useAAPointer.js +53 -0
- package/dist/runtime/composables/useAAUIState.d.ts +29 -0
- package/dist/runtime/composables/useAAUIState.js +28 -0
- package/dist/runtime/composables/useAAViewport.d.ts +22 -0
- package/dist/runtime/composables/useAAViewport.js +50 -0
- package/dist/runtime/composables/useAbraAdmin.d.ts +54 -0
- package/dist/runtime/composables/useAbraAdmin.js +115 -0
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +8 -0
- package/dist/runtime/composables/useAbracadabraAuth.js +8 -0
- package/dist/runtime/composables/useAggregatedPresence.d.ts +23 -0
- package/dist/runtime/composables/useAggregatedPresence.js +140 -0
- package/dist/runtime/composables/useChat.d.ts +16 -2
- package/dist/runtime/composables/useChat.js +257 -66
- package/dist/runtime/composables/useChatUsers.d.ts +2 -0
- package/dist/runtime/composables/useChatUsers.js +2 -1
- package/dist/runtime/composables/useDocLookup.d.ts +4 -0
- package/dist/runtime/composables/useDocLookup.js +25 -0
- package/dist/runtime/composables/useDocSnapshots.d.ts +79 -0
- package/dist/runtime/composables/useDocSnapshots.js +234 -0
- package/dist/runtime/composables/useDocsSearch.d.ts +24 -0
- package/dist/runtime/composables/useDocsSearch.js +34 -0
- package/dist/runtime/composables/useEditorDragHandle.d.ts +7 -0
- package/dist/runtime/composables/useEditorDragHandle.js +19 -1
- package/dist/runtime/composables/useEditorSuggestions.js +26 -1
- package/dist/runtime/composables/useEditorToolbar.js +9 -1
- package/dist/runtime/composables/useEmailVerification.d.ts +33 -0
- package/dist/runtime/composables/useEmailVerification.js +58 -0
- package/dist/runtime/composables/useIdentityDoc.js +0 -3
- package/dist/runtime/composables/useItemPresence.d.ts +47 -0
- package/dist/runtime/composables/useItemPresence.js +73 -0
- package/dist/runtime/composables/useResizableWidth.d.ts +24 -0
- package/dist/runtime/composables/useResizableWidth.js +87 -0
- package/dist/runtime/composables/useServerInfo.d.ts +17 -2
- package/dist/runtime/composables/useServerInfo.js +30 -6
- package/dist/runtime/composables/useServerSearch.d.ts +36 -0
- package/dist/runtime/composables/useServerSearch.js +91 -0
- package/dist/runtime/composables/useServerTrash.d.ts +67 -0
- package/dist/runtime/composables/useServerTrash.js +128 -0
- package/dist/runtime/composables/useSheetsClipboard.d.ts +42 -0
- package/dist/runtime/composables/useSheetsClipboard.js +109 -0
- package/dist/runtime/composables/useSheetsFormulas.d.ts +38 -0
- package/dist/runtime/composables/useSheetsFormulas.js +725 -0
- package/dist/runtime/composables/useSheetsSelection.d.ts +68 -0
- package/dist/runtime/composables/useSheetsSelection.js +390 -0
- package/dist/runtime/composables/useSheetsView.d.ts +31 -0
- package/dist/runtime/composables/useSheetsView.js +77 -0
- package/dist/runtime/composables/useSpaceConnections.d.ts +43 -0
- package/dist/runtime/composables/useSpaceConnections.js +72 -0
- package/dist/runtime/composables/useSpaces.d.ts +1 -3
- package/dist/runtime/composables/useSpaces.js +2 -5
- package/dist/runtime/composables/useTiptapHistory.d.ts +22 -0
- package/dist/runtime/composables/useTiptapHistory.js +12 -0
- package/dist/runtime/composables/useTreeExpansion.d.ts +28 -0
- package/dist/runtime/composables/useTreeExpansion.js +94 -0
- package/dist/runtime/composables/useYDoc.js +12 -1
- package/dist/runtime/extensions/button.d.ts +3 -0
- package/dist/runtime/extensions/button.js +62 -0
- package/dist/runtime/extensions/color-swatch.d.ts +2 -0
- package/dist/runtime/extensions/color-swatch.js +34 -0
- package/dist/runtime/extensions/diff.d.ts +2 -0
- package/dist/runtime/extensions/diff.js +40 -0
- package/dist/runtime/extensions/divider.d.ts +2 -0
- package/dist/runtime/extensions/divider.js +33 -0
- package/dist/runtime/extensions/doc-embed.js +2 -1
- package/dist/runtime/extensions/doc-link-drop.js +4 -4
- package/dist/runtime/extensions/doc-link.d.ts +12 -0
- package/dist/runtime/extensions/doc-link.js +60 -0
- package/dist/runtime/extensions/embed.d.ts +2 -0
- package/dist/runtime/extensions/embed.js +40 -0
- package/dist/runtime/extensions/figure.d.ts +2 -0
- package/dist/runtime/extensions/figure.js +49 -0
- package/dist/runtime/extensions/math.d.ts +15 -0
- package/dist/runtime/extensions/math.js +66 -0
- package/dist/runtime/extensions/progress.d.ts +2 -0
- package/dist/runtime/extensions/progress.js +43 -0
- package/dist/runtime/extensions/quote.d.ts +2 -0
- package/dist/runtime/extensions/quote.js +39 -0
- package/dist/runtime/extensions/spoiler.d.ts +2 -0
- package/dist/runtime/extensions/spoiler.js +36 -0
- package/dist/runtime/extensions/stat.d.ts +3 -0
- package/dist/runtime/extensions/stat.js +58 -0
- package/dist/runtime/extensions/video.d.ts +2 -0
- package/dist/runtime/extensions/video.js +40 -0
- package/dist/runtime/extensions/views/ButtonGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ButtonGroupView.vue +25 -0
- package/dist/runtime/extensions/views/ButtonGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/ButtonView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ButtonView.vue +171 -0
- package/dist/runtime/extensions/views/ButtonView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/ColorSwatchView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ColorSwatchView.vue +134 -0
- package/dist/runtime/extensions/views/ColorSwatchView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/DiffView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/DiffView.vue +163 -0
- package/dist/runtime/extensions/views/DiffView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/DividerView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/DividerView.vue +40 -0
- package/dist/runtime/extensions/views/DividerView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/DocEmbedView.vue +18 -3
- package/dist/runtime/extensions/views/DocLinkView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/DocLinkView.vue +71 -0
- package/dist/runtime/extensions/views/DocLinkView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/EmbedView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/EmbedView.vue +166 -0
- package/dist/runtime/extensions/views/EmbedView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FigureView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FigureView.vue +122 -0
- package/dist/runtime/extensions/views/FigureView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.vue +21 -24
- package/dist/runtime/extensions/views/MathBlockView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/MathBlockView.vue +151 -0
- package/dist/runtime/extensions/views/MathBlockView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/MathInlineView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/MathInlineView.vue +149 -0
- package/dist/runtime/extensions/views/MathInlineView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/MetaFieldView.vue +1129 -550
- package/dist/runtime/extensions/views/ProgressView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/ProgressView.vue +156 -0
- package/dist/runtime/extensions/views/ProgressView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/QuoteView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/QuoteView.vue +128 -0
- package/dist/runtime/extensions/views/QuoteView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/SpoilerView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/SpoilerView.vue +62 -0
- package/dist/runtime/extensions/views/SpoilerView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/StatGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/StatGroupView.vue +25 -0
- package/dist/runtime/extensions/views/StatGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/StatView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/StatView.vue +89 -0
- package/dist/runtime/extensions/views/StatView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/VideoView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/VideoView.vue +190 -0
- package/dist/runtime/extensions/views/VideoView.vue.d.ts +4 -0
- package/dist/runtime/locale.d.ts +133 -0
- package/dist/runtime/locale.js +121 -2
- package/dist/runtime/plugin-abracadabra.client.js +251 -38
- package/dist/runtime/plugin-abracadabra.server.js +0 -1
- package/dist/runtime/plugins/core.plugin.js +76 -4
- package/dist/runtime/server/plugins/abracadabra-service.js +4 -2
- package/dist/runtime/server/utils/rpcHandler.d.ts +74 -0
- package/dist/runtime/server/utils/rpcHandler.js +74 -0
- package/dist/runtime/server/utils/spaceManager.js +10 -9
- package/dist/runtime/theme/content/_shared.d.ts +6 -0
- package/dist/runtime/theme/content/_shared.js +6 -0
- package/dist/runtime/theme/content/content-navigation.d.ts +120 -0
- package/dist/runtime/theme/content/content-navigation.js +155 -0
- package/dist/runtime/theme/content/content-search-button.d.ts +16 -0
- package/dist/runtime/theme/content/content-search-button.js +15 -0
- package/dist/runtime/theme/content/content-search.d.ts +24 -0
- package/dist/runtime/theme/content/content-search.js +23 -0
- package/dist/runtime/theme/content/content-surround.d.ts +22 -0
- package/dist/runtime/theme/content/content-surround.js +23 -0
- package/dist/runtime/theme/content/content-toc.d.ts +84 -0
- package/dist/runtime/theme/content/content-toc.js +94 -0
- package/dist/runtime/theme/content/index.d.ts +5 -0
- package/dist/runtime/theme/content/index.js +5 -0
- package/dist/runtime/types.d.ts +63 -10
- package/dist/runtime/utils/awareRingStyle.d.ts +22 -0
- package/dist/runtime/utils/awareRingStyle.js +16 -0
- package/dist/runtime/utils/caretCoordinates.d.ts +41 -0
- package/dist/runtime/utils/caretCoordinates.js +126 -0
- package/dist/runtime/utils/content.d.ts +19 -0
- package/dist/runtime/utils/content.js +23 -0
- package/dist/runtime/utils/docReferenceEdges.js +1 -1
- package/dist/runtime/utils/docTypes.js +44 -13
- package/dist/runtime/utils/domPath.d.ts +42 -0
- package/dist/runtime/utils/domPath.js +89 -0
- package/dist/runtime/utils/loadKatex.d.ts +1 -0
- package/dist/runtime/utils/loadKatex.js +29 -0
- package/dist/runtime/utils/lucideIcons.d.ts +16 -0
- package/dist/runtime/utils/lucideIcons.js +451 -0
- package/dist/runtime/utils/time.d.ts +15 -0
- package/dist/runtime/utils/time.js +5 -0
- package/dist/types.d.mts +4 -0
- package/package.json +38 -20
|
@@ -136,16 +136,26 @@ async function fetchServerInfo(baseUrl) {
|
|
|
136
136
|
}
|
|
137
137
|
return {};
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
function spaceMetaFromDoc(doc) {
|
|
140
|
+
return {
|
|
141
|
+
id: doc.id,
|
|
142
|
+
name: doc.label ?? "",
|
|
143
|
+
description: doc.description ?? null,
|
|
144
|
+
visibility: doc.public_access === "observer" ? "public" : "private",
|
|
145
|
+
owner_id: doc.owner_id ?? null,
|
|
146
|
+
public_access: doc.public_access ?? null
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
async function fetchSpacesInfo(baseUrl, token) {
|
|
140
150
|
try {
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
const
|
|
148
|
-
return { spaces
|
|
151
|
+
const headers = {};
|
|
152
|
+
if (token) headers.Authorization = `Bearer ${token}`;
|
|
153
|
+
const res = await fetch(`${baseUrl}/docs?root=true`, { headers });
|
|
154
|
+
if (!res.ok) return null;
|
|
155
|
+
const data = await res.json();
|
|
156
|
+
const docs = Array.isArray(data) ? data : data.documents ?? [];
|
|
157
|
+
const spaces = docs.filter((d) => d.kind === "space").map(spaceMetaFromDoc);
|
|
158
|
+
return { spaces };
|
|
149
159
|
} catch {
|
|
150
160
|
return null;
|
|
151
161
|
}
|
|
@@ -228,6 +238,23 @@ export default defineNuxtPlugin({
|
|
|
228
238
|
const userColor = ref("hsl(217, 70%, 75%)");
|
|
229
239
|
const userColorName = ref("blue");
|
|
230
240
|
const userNeutralColorName = ref("zinc");
|
|
241
|
+
const userStatusIcon = ref(localStorage.getItem("abracadabra_status_icon") ?? "");
|
|
242
|
+
const userStatusText = ref(localStorage.getItem("abracadabra_status_text") ?? "");
|
|
243
|
+
const userStatusAsAvatar = ref(localStorage.getItem("abracadabra_status_as_avatar") === "1");
|
|
244
|
+
watch([status, synced], ([s, sy]) => {
|
|
245
|
+
try {
|
|
246
|
+
const ready = s === "connected" && sy;
|
|
247
|
+
window.__abracaReady = ready ? Date.now() : false;
|
|
248
|
+
} catch {
|
|
249
|
+
}
|
|
250
|
+
}, { immediate: true });
|
|
251
|
+
watch(unsyncedChanges, (n) => {
|
|
252
|
+
try {
|
|
253
|
+
;
|
|
254
|
+
window.__abracaUnsynced = n;
|
|
255
|
+
} catch {
|
|
256
|
+
}
|
|
257
|
+
}, { immediate: true });
|
|
231
258
|
const currentServerUrl = ref(defaultUrl);
|
|
232
259
|
const savedServers = ref([]);
|
|
233
260
|
let _serversLoaded = false;
|
|
@@ -275,12 +302,10 @@ export default defineNuxtPlugin({
|
|
|
275
302
|
}
|
|
276
303
|
const entry = { url, label };
|
|
277
304
|
const [info, spacesInfo] = await Promise.all([fetchServerInfo(url), fetchSpacesInfo(url)]);
|
|
278
|
-
if (info.
|
|
305
|
+
if (info.root_doc_id) entry.entryDocId = info.root_doc_id;
|
|
279
306
|
if (info.name) entry.label = info.name;
|
|
280
307
|
if (spacesInfo) {
|
|
281
|
-
entry.spacesEnabled = true;
|
|
282
308
|
entry.cachedSpaces = spacesInfo.spaces;
|
|
283
|
-
if (spacesInfo.hubDocId) entry.hubDocId = spacesInfo.hubDocId;
|
|
284
309
|
}
|
|
285
310
|
savedServers.value = [...savedServers.value, entry];
|
|
286
311
|
persistServers();
|
|
@@ -293,42 +318,59 @@ export default defineNuxtPlugin({
|
|
|
293
318
|
const currentServerSpaces = computed(
|
|
294
319
|
() => savedServers.value.find((s) => s.url === currentServerUrl.value)?.cachedSpaces ?? []
|
|
295
320
|
);
|
|
296
|
-
const currentServerSpacesEnabled = computed(
|
|
297
|
-
() => savedServers.value.find((s) => s.url === currentServerUrl.value)?.spacesEnabled ?? false
|
|
298
|
-
);
|
|
299
321
|
async function refreshSpaces() {
|
|
300
322
|
const url = currentServerUrl.value;
|
|
301
323
|
if (!url) return;
|
|
302
|
-
|
|
324
|
+
let spaces = null;
|
|
325
|
+
if (client.value) {
|
|
326
|
+
try {
|
|
327
|
+
const docs = await client.value.listSpaces();
|
|
328
|
+
spaces = docs.map(spaceMetaFromDoc);
|
|
329
|
+
} catch (e) {
|
|
330
|
+
if (import.meta.dev) console.warn("[abracadabra] refreshSpaces: client.listSpaces failed", e);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if (spaces === null) {
|
|
334
|
+
const spacesInfo = await fetchSpacesInfo(url);
|
|
335
|
+
spaces = spacesInfo?.spaces ?? null;
|
|
336
|
+
}
|
|
337
|
+
if (spaces === null) return;
|
|
303
338
|
const idx = savedServers.value.findIndex((s) => s.url === url);
|
|
304
339
|
if (idx !== -1) {
|
|
305
|
-
|
|
306
|
-
savedServers.value[idx] = { ...savedServers.value[idx], spacesEnabled: true, cachedSpaces: spacesInfo.spaces, hubDocId: spacesInfo.hubDocId ?? savedServers.value[idx].hubDocId };
|
|
307
|
-
}
|
|
340
|
+
savedServers.value[idx] = { ...savedServers.value[idx], cachedSpaces: spaces };
|
|
308
341
|
persistServers();
|
|
309
342
|
}
|
|
310
343
|
}
|
|
311
344
|
async function createSpace(opts) {
|
|
312
345
|
if (!client.value) throw new Error("Not connected");
|
|
313
|
-
const
|
|
346
|
+
const doc2 = await client.value.createSpace(opts);
|
|
314
347
|
await refreshSpaces();
|
|
315
|
-
return
|
|
348
|
+
return spaceMetaFromDoc(doc2);
|
|
316
349
|
}
|
|
317
350
|
async function updateSpace(id, opts) {
|
|
318
351
|
if (!client.value) throw new Error("Not connected");
|
|
319
|
-
|
|
352
|
+
await client.value.updateSpace(id, opts);
|
|
320
353
|
await refreshSpaces();
|
|
321
|
-
return result;
|
|
322
354
|
}
|
|
323
355
|
async function deleteSpace(id) {
|
|
324
356
|
if (!client.value) throw new Error("Not connected");
|
|
325
357
|
await client.value.deleteSpace(id);
|
|
326
358
|
await refreshSpaces();
|
|
327
359
|
}
|
|
360
|
+
function publishAwarenessUser() {
|
|
361
|
+
const payload = {
|
|
362
|
+
name: userName.value,
|
|
363
|
+
color: userColor.value,
|
|
364
|
+
publicKey: publicKeyB64.value
|
|
365
|
+
};
|
|
366
|
+
if (userStatusIcon.value) payload.statusIcon = userStatusIcon.value;
|
|
367
|
+
if (userStatusText.value) payload.statusText = userStatusText.value;
|
|
368
|
+
provider.value?.setAwarenessField("user", payload);
|
|
369
|
+
}
|
|
328
370
|
function setUserName(name) {
|
|
329
371
|
userName.value = name;
|
|
330
372
|
localStorage.setItem("abracadabra_username", name);
|
|
331
|
-
|
|
373
|
+
publishAwarenessUser();
|
|
332
374
|
client.value?.updateMe({ displayName: name }).catch(() => {
|
|
333
375
|
});
|
|
334
376
|
}
|
|
@@ -340,7 +382,7 @@ export default defineNuxtPlugin({
|
|
|
340
382
|
localStorage.setItem("abracadabra_usercolor", colorName);
|
|
341
383
|
const appConfig = useAppConfig();
|
|
342
384
|
if (appConfig.ui?.colors) appConfig.ui.colors.primary = toNuxtUIPrimary(colorName);
|
|
343
|
-
|
|
385
|
+
publishAwarenessUser();
|
|
344
386
|
}
|
|
345
387
|
function setNeutralColor(colorName) {
|
|
346
388
|
userNeutralColorName.value = colorName;
|
|
@@ -348,6 +390,25 @@ export default defineNuxtPlugin({
|
|
|
348
390
|
const appConfig = useAppConfig();
|
|
349
391
|
if (appConfig.ui?.colors) appConfig.ui.colors.neutral = toNuxtUINeutral(colorName);
|
|
350
392
|
}
|
|
393
|
+
function setUserStatusIcon(icon) {
|
|
394
|
+
const normalized = icon.replace(/^i-lucide-/, "");
|
|
395
|
+
userStatusIcon.value = normalized;
|
|
396
|
+
if (normalized) localStorage.setItem("abracadabra_status_icon", normalized);
|
|
397
|
+
else localStorage.removeItem("abracadabra_status_icon");
|
|
398
|
+
publishAwarenessUser();
|
|
399
|
+
}
|
|
400
|
+
function setUserStatusText(text) {
|
|
401
|
+
const trimmed = (text ?? "").slice(0, 80);
|
|
402
|
+
userStatusText.value = trimmed;
|
|
403
|
+
if (trimmed) localStorage.setItem("abracadabra_status_text", trimmed);
|
|
404
|
+
else localStorage.removeItem("abracadabra_status_text");
|
|
405
|
+
publishAwarenessUser();
|
|
406
|
+
}
|
|
407
|
+
function setUserStatusAsAvatar(enabled) {
|
|
408
|
+
userStatusAsAvatar.value = enabled;
|
|
409
|
+
if (enabled) localStorage.setItem("abracadabra_status_as_avatar", "1");
|
|
410
|
+
else localStorage.removeItem("abracadabra_status_as_avatar");
|
|
411
|
+
}
|
|
351
412
|
function setRequirePasskey(enabled) {
|
|
352
413
|
requirePasskeyOnLogin.value = enabled;
|
|
353
414
|
localStorage.setItem(REQUIRE_PASSKEY_KEY, enabled ? "1" : "0");
|
|
@@ -505,6 +566,67 @@ export default defineNuxtPlugin({
|
|
|
505
566
|
localStorage.removeItem(PUBKEY_KEY);
|
|
506
567
|
window.location.reload();
|
|
507
568
|
}
|
|
569
|
+
async function logoutServer() {
|
|
570
|
+
addLog("Revoking session on server...", "auth");
|
|
571
|
+
if (client.value) {
|
|
572
|
+
try {
|
|
573
|
+
await client.value.logoutServer();
|
|
574
|
+
} catch (e) {
|
|
575
|
+
if (import.meta.dev) console.warn("[abracadabra] logoutServer failed", e);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
await logout();
|
|
579
|
+
}
|
|
580
|
+
async function logoutAll() {
|
|
581
|
+
addLog("Revoking all sessions for user...", "auth");
|
|
582
|
+
if (client.value) {
|
|
583
|
+
try {
|
|
584
|
+
await client.value.logoutAll();
|
|
585
|
+
} catch (e) {
|
|
586
|
+
if (import.meta.dev) console.warn("[abracadabra] logoutAll failed", e);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
await logout();
|
|
590
|
+
}
|
|
591
|
+
async function requestPasswordReset(opts) {
|
|
592
|
+
if (!client.value) throw new Error("Not connected");
|
|
593
|
+
await client.value.requestPasswordReset(opts);
|
|
594
|
+
addLog("Password reset email requested", "auth");
|
|
595
|
+
}
|
|
596
|
+
async function loginWithPassword(opts) {
|
|
597
|
+
if (!client.value) throw new Error("Not connected");
|
|
598
|
+
await client.value.login(opts);
|
|
599
|
+
addLog(`Logged in as ${opts.username}`, "auth");
|
|
600
|
+
if (_wsp) {
|
|
601
|
+
_wsp.disconnect();
|
|
602
|
+
setTimeout(() => _wsp?.connect(), 300);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
async function registerWithPassword(opts) {
|
|
606
|
+
if (!client.value) throw new Error("Not connected");
|
|
607
|
+
await client.value.register(opts);
|
|
608
|
+
await client.value.login({ username: opts.username, password: opts.password });
|
|
609
|
+
addLog(`Registered + logged in as ${opts.username}`, "auth");
|
|
610
|
+
if (_wsp) {
|
|
611
|
+
_wsp.disconnect();
|
|
612
|
+
setTimeout(() => _wsp?.connect(), 300);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
async function confirmPasswordReset(opts) {
|
|
616
|
+
if (!client.value) throw new Error("Not connected");
|
|
617
|
+
await client.value.confirmPasswordReset(opts);
|
|
618
|
+
addLog("Password reset confirmed", "auth");
|
|
619
|
+
}
|
|
620
|
+
async function changePassword(opts) {
|
|
621
|
+
if (!client.value) throw new Error("Not connected");
|
|
622
|
+
await client.value.changePassword(opts);
|
|
623
|
+
addLog("Password changed", "auth");
|
|
624
|
+
}
|
|
625
|
+
async function setPassword(newPassword) {
|
|
626
|
+
if (!client.value) throw new Error("Not connected");
|
|
627
|
+
await client.value.setPassword(newPassword);
|
|
628
|
+
addLog("Password set", "auth");
|
|
629
|
+
}
|
|
508
630
|
async function redeemInvite(code) {
|
|
509
631
|
if (!client.value) throw new Error("Not connected");
|
|
510
632
|
await client.value.redeemInvite(code);
|
|
@@ -592,7 +714,9 @@ export default defineNuxtPlugin({
|
|
|
592
714
|
]);
|
|
593
715
|
setSdkModule(sdkModule);
|
|
594
716
|
const { AbracadabraClient, AbracadabraProvider, AbracadabraWS, CryptoIdentityKeystore } = sdkModule;
|
|
595
|
-
|
|
717
|
+
const edEtc = ed.etc;
|
|
718
|
+
edEtc.sha512Sync = (...m) => sha512(edEtc.concatBytes(...m));
|
|
719
|
+
edEtc.sha512Async = (...m) => Promise.resolve(edEtc.sha512Sync(...m));
|
|
596
720
|
const ks = new CryptoIdentityKeystore();
|
|
597
721
|
keystore.value = ks;
|
|
598
722
|
let privKey = null;
|
|
@@ -618,7 +742,7 @@ export default defineNuxtPlugin({
|
|
|
618
742
|
privKey = fromBase64Url(storedPrivKey);
|
|
619
743
|
addLog("Using guest identity (soft key)", "auth");
|
|
620
744
|
} else {
|
|
621
|
-
privKey = ed.utils.
|
|
745
|
+
privKey = ed.utils.randomPrivateKey();
|
|
622
746
|
localStorage.setItem("abracadabra_privkey", toBase64Url(privKey));
|
|
623
747
|
addLog("Created new guest identity (soft key)", "auth");
|
|
624
748
|
}
|
|
@@ -663,7 +787,28 @@ export default defineNuxtPlugin({
|
|
|
663
787
|
const _client = new AbracadabraClient({ url: serverUrl, persistAuth, storageKey: authStorageKey });
|
|
664
788
|
client.value = _client;
|
|
665
789
|
addLog(`Server: ${serverUrl}`, "connection");
|
|
666
|
-
|
|
790
|
+
let useExistingToken = _client.isTokenValid();
|
|
791
|
+
if (useExistingToken) {
|
|
792
|
+
try {
|
|
793
|
+
await _client.getMe();
|
|
794
|
+
} catch (e) {
|
|
795
|
+
const status2 = e?.status ?? 0;
|
|
796
|
+
if (status2 === 401) {
|
|
797
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
798
|
+
addLog(`Persisted JWT no longer valid on ${serverUrl} (${msg.slice(0, 80)}) \u2014 re-registering`, "auth");
|
|
799
|
+
try {
|
|
800
|
+
localStorage.removeItem(authStorageKey);
|
|
801
|
+
} catch {
|
|
802
|
+
}
|
|
803
|
+
;
|
|
804
|
+
_client.token = null;
|
|
805
|
+
useExistingToken = false;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (useExistingToken && identityState.value === "claimed") {
|
|
810
|
+
addLog("Resumed session from persisted token", "auth");
|
|
811
|
+
} else if (useExistingToken) {
|
|
667
812
|
addLog("Resumed session from persisted token", "auth");
|
|
668
813
|
} else if (identityState.value === "claimed" && !requirePasskeyOnLogin.value) {
|
|
669
814
|
identityState.value = "needsReauth";
|
|
@@ -694,18 +839,20 @@ export default defineNuxtPlugin({
|
|
|
694
839
|
}
|
|
695
840
|
_client.updateMe({ displayName: userName.value }).catch(() => {
|
|
696
841
|
});
|
|
697
|
-
const [info,
|
|
842
|
+
const [info, spaceDocs] = await Promise.all([
|
|
698
843
|
fetchServerInfo(serverUrl),
|
|
699
|
-
|
|
844
|
+
_client.listSpaces().catch((e) => {
|
|
845
|
+
if (import.meta.dev) console.warn("[abracadabra] init: client.listSpaces failed", e);
|
|
846
|
+
return null;
|
|
847
|
+
})
|
|
700
848
|
]);
|
|
849
|
+
const spacesInfo = spaceDocs ? { spaces: spaceDocs.map(spaceMetaFromDoc) } : null;
|
|
701
850
|
const idx = savedServers.value.findIndex((s) => s.url === serverUrl);
|
|
702
851
|
if (idx >= 0) {
|
|
703
852
|
const updates = {};
|
|
704
853
|
if (info.name && info.name !== savedServers.value[idx].label) updates.label = info.name;
|
|
705
854
|
if (spacesInfo) {
|
|
706
|
-
updates.spacesEnabled = true;
|
|
707
855
|
updates.cachedSpaces = spacesInfo.spaces;
|
|
708
|
-
if (spacesInfo.hubDocId) updates.hubDocId = spacesInfo.hubDocId;
|
|
709
856
|
}
|
|
710
857
|
if (Object.keys(updates).length) {
|
|
711
858
|
savedServers.value[idx] = { ...savedServers.value[idx], ...updates };
|
|
@@ -713,9 +860,9 @@ export default defineNuxtPlugin({
|
|
|
713
860
|
}
|
|
714
861
|
}
|
|
715
862
|
const server = savedServers.value.find((s) => s.url === serverUrl);
|
|
716
|
-
const docId = configEntryDocId ?? server?.
|
|
863
|
+
const docId = configEntryDocId ?? server?.entryDocId ?? server?.cachedSpaces?.[0]?.id ?? spacesInfo?.spaces?.[0]?.id ?? void 0;
|
|
717
864
|
if (!docId) {
|
|
718
|
-
connectionError.value = "No entry document found. Configure entryDocId or ensure the server has spaces
|
|
865
|
+
connectionError.value = "No entry document found. Configure entryDocId or ensure the server has spaces.";
|
|
719
866
|
addLog("No entry document \u2014 cannot connect", "system");
|
|
720
867
|
try {
|
|
721
868
|
const imports = await import("#imports");
|
|
@@ -872,12 +1019,38 @@ export default defineNuxtPlugin({
|
|
|
872
1019
|
}
|
|
873
1020
|
}
|
|
874
1021
|
});
|
|
875
|
-
|
|
1022
|
+
{
|
|
1023
|
+
const initial = {
|
|
1024
|
+
name: userName.value,
|
|
1025
|
+
color: userColor.value,
|
|
1026
|
+
publicKey: publicKeyB64.value
|
|
1027
|
+
};
|
|
1028
|
+
if (userStatusIcon.value) initial.statusIcon = userStatusIcon.value;
|
|
1029
|
+
if (userStatusText.value) initial.statusText = userStatusText.value;
|
|
1030
|
+
_provider.setAwarenessField("user", initial);
|
|
1031
|
+
}
|
|
876
1032
|
_provider.on("unsyncedChanges", ({ number }) => {
|
|
877
1033
|
unsyncedChanges.value = number;
|
|
878
1034
|
});
|
|
879
1035
|
_provider.attach();
|
|
880
1036
|
provider.value = _provider;
|
|
1037
|
+
try {
|
|
1038
|
+
const onPointerLeave = (e) => {
|
|
1039
|
+
if (e.relatedTarget !== null) return;
|
|
1040
|
+
try {
|
|
1041
|
+
_provider.awareness?.setLocalStateField("hover", null);
|
|
1042
|
+
} catch {
|
|
1043
|
+
}
|
|
1044
|
+
};
|
|
1045
|
+
document.addEventListener("pointerleave", onPointerLeave);
|
|
1046
|
+
window.addEventListener("beforeunload", () => {
|
|
1047
|
+
try {
|
|
1048
|
+
_provider.awareness?.setLocalState(null);
|
|
1049
|
+
} catch {
|
|
1050
|
+
}
|
|
1051
|
+
});
|
|
1052
|
+
} catch {
|
|
1053
|
+
}
|
|
881
1054
|
try {
|
|
882
1055
|
const { FileBlobStore } = await import("@abraca/dabra");
|
|
883
1056
|
const blobStore = new FileBlobStore(serverUrl, _client);
|
|
@@ -895,9 +1068,16 @@ export default defineNuxtPlugin({
|
|
|
895
1068
|
isReady.value = true;
|
|
896
1069
|
}, () => null);
|
|
897
1070
|
watch(
|
|
898
|
-
[userName, userColor, publicKeyB64],
|
|
1071
|
+
[userName, userColor, publicKeyB64, userStatusIcon, userStatusText],
|
|
899
1072
|
() => {
|
|
900
|
-
|
|
1073
|
+
const payload = {
|
|
1074
|
+
name: userName.value,
|
|
1075
|
+
color: userColor.value,
|
|
1076
|
+
publicKey: publicKeyB64.value
|
|
1077
|
+
};
|
|
1078
|
+
if (userStatusIcon.value) payload.statusIcon = userStatusIcon.value;
|
|
1079
|
+
if (userStatusText.value) payload.statusText = userStatusText.value;
|
|
1080
|
+
_provider.setAwarenessField("user", payload);
|
|
901
1081
|
},
|
|
902
1082
|
{ immediate: true }
|
|
903
1083
|
);
|
|
@@ -922,6 +1102,9 @@ export default defineNuxtPlugin({
|
|
|
922
1102
|
userColorName,
|
|
923
1103
|
userNeutralColorName,
|
|
924
1104
|
userCount,
|
|
1105
|
+
userStatusIcon,
|
|
1106
|
+
userStatusText,
|
|
1107
|
+
userStatusAsAvatar,
|
|
925
1108
|
publicKeyB64,
|
|
926
1109
|
connectionError,
|
|
927
1110
|
identityState,
|
|
@@ -935,7 +1118,6 @@ export default defineNuxtPlugin({
|
|
|
935
1118
|
currentServerUrl,
|
|
936
1119
|
savedServers,
|
|
937
1120
|
currentServerSpaces,
|
|
938
|
-
currentServerSpacesEnabled,
|
|
939
1121
|
pendingInviteCode,
|
|
940
1122
|
registry,
|
|
941
1123
|
addLog,
|
|
@@ -943,10 +1125,21 @@ export default defineNuxtPlugin({
|
|
|
943
1125
|
setUserColor,
|
|
944
1126
|
setNeutralColor,
|
|
945
1127
|
setRequirePasskey,
|
|
1128
|
+
setUserStatusIcon,
|
|
1129
|
+
setUserStatusText,
|
|
1130
|
+
setUserStatusAsAvatar,
|
|
946
1131
|
claimAccount,
|
|
947
1132
|
loginWithHardware,
|
|
1133
|
+
loginWithPassword,
|
|
1134
|
+
registerWithPassword,
|
|
948
1135
|
logout,
|
|
949
1136
|
reconnect,
|
|
1137
|
+
logoutServer,
|
|
1138
|
+
logoutAll,
|
|
1139
|
+
requestPasswordReset,
|
|
1140
|
+
confirmPasswordReset,
|
|
1141
|
+
changePassword,
|
|
1142
|
+
setPassword,
|
|
950
1143
|
addServer,
|
|
951
1144
|
removeServer,
|
|
952
1145
|
switchServer,
|
|
@@ -969,6 +1162,26 @@ export default defineNuxtPlugin({
|
|
|
969
1162
|
watch(abra.status, (s) => console.log("[abracadabra] status \u2192", s));
|
|
970
1163
|
watch(abra.synced, (s) => console.log("[abracadabra] synced \u2192", s));
|
|
971
1164
|
}
|
|
1165
|
+
function _kickConnection() {
|
|
1166
|
+
if (!_wsp) return;
|
|
1167
|
+
if (identityState.value === "connectionBlocked") {
|
|
1168
|
+
unblockConnection();
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
if (status.value === "disconnected") {
|
|
1172
|
+
authFailureCount = 0;
|
|
1173
|
+
connectionError.value = null;
|
|
1174
|
+
try {
|
|
1175
|
+
_wsp.connect();
|
|
1176
|
+
} catch {
|
|
1177
|
+
}
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
window.addEventListener("focus", _kickConnection);
|
|
1181
|
+
window.addEventListener("online", _kickConnection);
|
|
1182
|
+
document.addEventListener("visibilitychange", () => {
|
|
1183
|
+
if (document.visibilityState === "visible") _kickConnection();
|
|
1184
|
+
});
|
|
972
1185
|
loadServers();
|
|
973
1186
|
const storedServer = localStorage.getItem(CURRENT_SERVER_KEY);
|
|
974
1187
|
const initialUrl = storedServer && savedServers.value.some((s) => s.url === storedServer) ? storedServer : currentServerUrl.value || savedServers.value[0]?.url || defaultUrl;
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import { DOC_TYPES } from "../utils/docTypes.js";
|
|
2
|
+
import { useRuntimeConfig } from "#imports";
|
|
3
|
+
const OPTIONAL_BUILTIN_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
4
|
+
"divider",
|
|
5
|
+
"quote",
|
|
6
|
+
"figure",
|
|
7
|
+
"embed",
|
|
8
|
+
"video",
|
|
9
|
+
"stat",
|
|
10
|
+
"statGroup",
|
|
11
|
+
"button",
|
|
12
|
+
"buttonGroup",
|
|
13
|
+
"progress",
|
|
14
|
+
"spoiler",
|
|
15
|
+
"colorSwatch",
|
|
16
|
+
"mathBlock",
|
|
17
|
+
"mathInline",
|
|
18
|
+
"diff"
|
|
19
|
+
]);
|
|
2
20
|
async function loadClientExtensions() {
|
|
3
21
|
const [
|
|
4
22
|
{ default: TaskList },
|
|
@@ -35,12 +53,25 @@ async function loadClientExtensions() {
|
|
|
35
53
|
{ FileBlock },
|
|
36
54
|
{ MetaField },
|
|
37
55
|
{ DocEmbed },
|
|
56
|
+
{ DocLink },
|
|
38
57
|
{ DocLinkDrop },
|
|
39
58
|
{ MentionDrop },
|
|
40
59
|
{ SelectionDrag },
|
|
41
60
|
{ Field, FieldGroup },
|
|
42
61
|
{ CodePreview },
|
|
43
|
-
{ CodeTree }
|
|
62
|
+
{ CodeTree },
|
|
63
|
+
{ Divider },
|
|
64
|
+
{ Quote },
|
|
65
|
+
{ Figure },
|
|
66
|
+
{ Embed },
|
|
67
|
+
{ Video },
|
|
68
|
+
{ Stat, StatGroup },
|
|
69
|
+
{ Button, ButtonGroup },
|
|
70
|
+
{ Progress },
|
|
71
|
+
{ Spoiler },
|
|
72
|
+
{ ColorSwatch },
|
|
73
|
+
{ MathBlock, MathInline },
|
|
74
|
+
{ Diff }
|
|
44
75
|
] = await Promise.all([
|
|
45
76
|
import("@tiptap/extension-task-list"),
|
|
46
77
|
import("@tiptap/extension-task-item"),
|
|
@@ -76,12 +107,25 @@ async function loadClientExtensions() {
|
|
|
76
107
|
import("../extensions/file-block.js"),
|
|
77
108
|
import("../extensions/meta-field.js"),
|
|
78
109
|
import("../extensions/doc-embed.js"),
|
|
110
|
+
import("../extensions/doc-link.js"),
|
|
79
111
|
import("../extensions/doc-link-drop.js"),
|
|
80
112
|
import("../extensions/mention-drop.js"),
|
|
81
113
|
import("../extensions/selection-drag.js"),
|
|
82
114
|
import("../extensions/field.js"),
|
|
83
115
|
import("../extensions/code-preview.js"),
|
|
84
|
-
import("../extensions/code-tree.js")
|
|
116
|
+
import("../extensions/code-tree.js"),
|
|
117
|
+
import("../extensions/divider.js"),
|
|
118
|
+
import("../extensions/quote.js"),
|
|
119
|
+
import("../extensions/figure.js"),
|
|
120
|
+
import("../extensions/embed.js"),
|
|
121
|
+
import("../extensions/video.js"),
|
|
122
|
+
import("../extensions/stat.js"),
|
|
123
|
+
import("../extensions/button.js"),
|
|
124
|
+
import("../extensions/progress.js"),
|
|
125
|
+
import("../extensions/spoiler.js"),
|
|
126
|
+
import("../extensions/color-swatch.js"),
|
|
127
|
+
import("../extensions/math.js"),
|
|
128
|
+
import("../extensions/diff.js")
|
|
85
129
|
]);
|
|
86
130
|
const lowlight = createLowlight(common);
|
|
87
131
|
const extensions = [
|
|
@@ -129,6 +173,7 @@ async function loadClientExtensions() {
|
|
|
129
173
|
MetaField,
|
|
130
174
|
// Document embeds & linking
|
|
131
175
|
DocEmbed,
|
|
176
|
+
DocLink,
|
|
132
177
|
DocLinkDrop,
|
|
133
178
|
MentionDrop,
|
|
134
179
|
SelectionDrag,
|
|
@@ -137,7 +182,23 @@ async function loadClientExtensions() {
|
|
|
137
182
|
FieldGroup,
|
|
138
183
|
// Advanced code blocks
|
|
139
184
|
CodePreview,
|
|
140
|
-
CodeTree
|
|
185
|
+
CodeTree,
|
|
186
|
+
// Visual blocks
|
|
187
|
+
Divider,
|
|
188
|
+
Quote,
|
|
189
|
+
Figure,
|
|
190
|
+
Embed,
|
|
191
|
+
Video,
|
|
192
|
+
Stat,
|
|
193
|
+
StatGroup,
|
|
194
|
+
Button,
|
|
195
|
+
ButtonGroup,
|
|
196
|
+
Progress,
|
|
197
|
+
Spoiler,
|
|
198
|
+
ColorSwatch,
|
|
199
|
+
MathBlock,
|
|
200
|
+
MathInline,
|
|
201
|
+
Diff
|
|
141
202
|
];
|
|
142
203
|
try {
|
|
143
204
|
const emojiPkg = "@tiptap/extension-emoji";
|
|
@@ -207,7 +268,18 @@ export const corePlugin = {
|
|
|
207
268
|
])
|
|
208
269
|
),
|
|
209
270
|
extensions() {
|
|
210
|
-
|
|
271
|
+
if (!_cachedClient) return [];
|
|
272
|
+
let disabled = [];
|
|
273
|
+
try {
|
|
274
|
+
disabled = useRuntimeConfig().public?.abracadabra?.disabledBuiltins ?? [];
|
|
275
|
+
} catch {
|
|
276
|
+
}
|
|
277
|
+
if (!disabled.length) return _cachedClient;
|
|
278
|
+
return _cachedClient.filter((ext) => {
|
|
279
|
+
const name = ext?.name;
|
|
280
|
+
if (!name || !OPTIONAL_BUILTIN_EXTENSIONS.has(name)) return true;
|
|
281
|
+
return !disabled.includes(name);
|
|
282
|
+
});
|
|
211
283
|
},
|
|
212
284
|
serverExtensions() {
|
|
213
285
|
if (_cachedServer) return _cachedServer;
|
|
@@ -42,7 +42,9 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
42
42
|
import("@noble/hashes/sha512"),
|
|
43
43
|
import("yjs")
|
|
44
44
|
]);
|
|
45
|
-
|
|
45
|
+
const edEtc = ed.etc;
|
|
46
|
+
edEtc.sha512Sync = (...m) => sha512(edEtc.concatBytes(...m));
|
|
47
|
+
edEtc.sha512Async = (...m) => Promise.resolve(edEtc.sha512Sync(...m));
|
|
46
48
|
const privKey = fromBase64Url(privKeyB64);
|
|
47
49
|
const client = new AbracadabraClient({
|
|
48
50
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Nuxt runtime config augmentation not resolved in Nitro
|
|
@@ -68,7 +70,7 @@ export default defineNitroPlugin(async (nitroApp) => {
|
|
|
68
70
|
if (!rootDocId) {
|
|
69
71
|
try {
|
|
70
72
|
const info = await $fetch(`${config.public?.abracadabra?.url}/info`);
|
|
71
|
-
rootDocId = info?.
|
|
73
|
+
rootDocId = info?.root_doc_id ?? "";
|
|
72
74
|
} catch {
|
|
73
75
|
}
|
|
74
76
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-side RPC v1 handler registry for `@abraca/nuxt`.
|
|
3
|
+
*
|
|
4
|
+
* Wraps `provider.rpc.handle(...)` from `@abraca/dabra` with a Nuxt-flavoured
|
|
5
|
+
* shape: schema validation (Zod-compatible — anything with `.parse()`),
|
|
6
|
+
* structured logging, and lifecycle hooks. Handlers register against the
|
|
7
|
+
* service provider's root-doc subscription, which is where service-role
|
|
8
|
+
* runners advertise capabilities.
|
|
9
|
+
*
|
|
10
|
+
* Usage from a Nitro plugin:
|
|
11
|
+
*
|
|
12
|
+
* export default defineNitroPlugin((nitroApp) => {
|
|
13
|
+
* nitroApp.hooks.hook('abracadabra:before-runners', () => {
|
|
14
|
+
* registerServerPlugin({
|
|
15
|
+
* name: 'my-plugin',
|
|
16
|
+
* serverRunners: [
|
|
17
|
+
* defineRpcRunner({
|
|
18
|
+
* handlers: [
|
|
19
|
+
* defineRpcHandler({
|
|
20
|
+
* method: 'ai.summarize@1',
|
|
21
|
+
* schema: z.object({ docId: z.string() }),
|
|
22
|
+
* async handler(args, ctx) {
|
|
23
|
+
* return await summarize(args.docId)
|
|
24
|
+
* },
|
|
25
|
+
* }),
|
|
26
|
+
* ],
|
|
27
|
+
* }),
|
|
28
|
+
* ],
|
|
29
|
+
* })
|
|
30
|
+
* })
|
|
31
|
+
* })
|
|
32
|
+
*/
|
|
33
|
+
import type { RpcHandlerContext } from '@abraca/dabra';
|
|
34
|
+
import { RpcError as RpcErrorClass } from '@abraca/dabra';
|
|
35
|
+
import type { ServerRunnerDefinition, ServerRunnerContext } from '../../types.js';
|
|
36
|
+
/** Anything with a `.parse(value): T` method — Zod, Valibot, ArkType, … */
|
|
37
|
+
export interface RpcSchema<T> {
|
|
38
|
+
parse(value: unknown): T;
|
|
39
|
+
}
|
|
40
|
+
export interface RpcHandlerDefinition<TArgs = unknown, TResult = unknown> {
|
|
41
|
+
/** Method name. Convention: `<namespace>.<verb>@<version>`, e.g. `ai.summarize@1`. */
|
|
42
|
+
method: string;
|
|
43
|
+
/** Optional schema for `args`. Validation failure → `SCHEMA` error result. */
|
|
44
|
+
schema?: RpcSchema<TArgs>;
|
|
45
|
+
/**
|
|
46
|
+
* The actual handler. Throw an `RpcError` for typed failures; any other
|
|
47
|
+
* thrown value becomes `INTERNAL`. Returning an async generator turns each
|
|
48
|
+
* `yield` into a `rpc:progress` frame; the generator's return value is the
|
|
49
|
+
* final result.
|
|
50
|
+
*/
|
|
51
|
+
handler: (args: TArgs, ctx: RpcHandlerContext) => TResult | Promise<TResult> | AsyncGenerator<unknown, TResult, void>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Define a single RPC handler. The return value is consumed by
|
|
55
|
+
* `defineRpcRunner({ handlers })`.
|
|
56
|
+
*/
|
|
57
|
+
export declare function defineRpcHandler<TArgs, TResult>(def: RpcHandlerDefinition<TArgs, TResult>): RpcHandlerDefinition<TArgs, TResult>;
|
|
58
|
+
export interface RpcRunnerOptions {
|
|
59
|
+
/** Optional unique runner name (defaults to `abracadabra:rpc`). */
|
|
60
|
+
name?: string;
|
|
61
|
+
handlers: RpcHandlerDefinition<any, any>[];
|
|
62
|
+
/** Called once before any handler is registered. */
|
|
63
|
+
onStart?: (ctx: ServerRunnerContext) => void | Promise<void>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Define a server runner that wires every handler to the root provider's
|
|
67
|
+
* RPC client and unregisters them on shutdown.
|
|
68
|
+
*
|
|
69
|
+
* Returns a `ServerRunnerDefinition` you can list under
|
|
70
|
+
* `AbracadabraPlugin.serverRunners`.
|
|
71
|
+
*/
|
|
72
|
+
export declare function defineRpcRunner(options: RpcRunnerOptions): ServerRunnerDefinition;
|
|
73
|
+
export { RpcErrorClass as RpcError };
|
|
74
|
+
export type { RpcHandler, RpcHandlerContext } from '@abraca/dabra';
|