@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,1030 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed, watch, nextTick, onMounted, onBeforeUnmount } from "vue";
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
4
|
+
import { useRafFn, useEventListener } from "@vueuse/core";
|
|
5
|
+
import { useRendererBase } from "../../composables/useRendererBase";
|
|
6
|
+
import { useNodePanel } from "../../composables/useNodePanel";
|
|
7
|
+
import { DEFAULT_LOCALE } from "../../locale";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
docId: { type: String, required: true },
|
|
10
|
+
childProvider: { type: null, required: true },
|
|
11
|
+
docLabel: { type: String, required: true },
|
|
12
|
+
pageTypes: { type: Array, required: false },
|
|
13
|
+
labels: { type: Object, required: false },
|
|
14
|
+
editable: { type: Boolean, required: false, default: true }
|
|
15
|
+
});
|
|
16
|
+
const config = useRuntimeConfig();
|
|
17
|
+
const locale = computed(() => ({
|
|
18
|
+
...DEFAULT_LOCALE.renderers.graph,
|
|
19
|
+
...config.public?.abracadabra?.locale?.renderers?.graph ?? {},
|
|
20
|
+
...props.labels ?? {}
|
|
21
|
+
}));
|
|
22
|
+
const { tree, childDoc, childProviderRef, cursors, states, setLocalState, connectedUsers } = useRendererBase(props);
|
|
23
|
+
const {
|
|
24
|
+
openNodeId,
|
|
25
|
+
openNodeLabel,
|
|
26
|
+
openNodeProvider,
|
|
27
|
+
openNode,
|
|
28
|
+
closePanel
|
|
29
|
+
} = useNodePanel(childProviderRef);
|
|
30
|
+
const d3 = ref(null);
|
|
31
|
+
const d3Error = ref(false);
|
|
32
|
+
onMounted(async () => {
|
|
33
|
+
try {
|
|
34
|
+
d3.value = await import("d3-force");
|
|
35
|
+
} catch {
|
|
36
|
+
d3Error.value = true;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
watch(childDoc, (doc) => {
|
|
40
|
+
if (!doc) return;
|
|
41
|
+
const legacyMap = doc.getMap("graph-positions");
|
|
42
|
+
legacyMap.forEach((val, id) => {
|
|
43
|
+
const entry = tree.treeMap.get(id);
|
|
44
|
+
if (entry && entry.meta?.graphX === void 0) {
|
|
45
|
+
tree.updateMeta(id, {
|
|
46
|
+
graphX: val.x ?? 0,
|
|
47
|
+
graphY: val.y ?? 0,
|
|
48
|
+
graphPinned: val.pinned ?? false
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}, { immediate: true });
|
|
53
|
+
function getGraphPos(id) {
|
|
54
|
+
const entry = tree.entries.value.find((e) => e.id === id);
|
|
55
|
+
if (entry?.meta?.graphX !== void 0 && entry?.meta?.graphY !== void 0) {
|
|
56
|
+
return {
|
|
57
|
+
x: entry.meta.graphX,
|
|
58
|
+
y: entry.meta.graphY,
|
|
59
|
+
pinned: entry.meta.graphPinned ?? false
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return void 0;
|
|
63
|
+
}
|
|
64
|
+
const svgRef = ref(null);
|
|
65
|
+
const vb = ref({ x: -500, y: -350, w: 1e3, h: 700 });
|
|
66
|
+
const targetVb = ref({ x: -500, y: -350, w: 1e3, h: 700 });
|
|
67
|
+
let zoomRafId = null;
|
|
68
|
+
function animateZoom() {
|
|
69
|
+
const f = 0.15;
|
|
70
|
+
const nw = vb.value.w + (targetVb.value.w - vb.value.w) * f;
|
|
71
|
+
const nh = vb.value.h + (targetVb.value.h - vb.value.h) * f;
|
|
72
|
+
const nx = vb.value.x + (targetVb.value.x - vb.value.x) * f;
|
|
73
|
+
const ny = vb.value.y + (targetVb.value.y - vb.value.y) * f;
|
|
74
|
+
if (Math.abs(nw - targetVb.value.w) < 0.5) {
|
|
75
|
+
vb.value = { ...targetVb.value };
|
|
76
|
+
zoomRafId = null;
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
vb.value = { x: nx, y: ny, w: nw, h: nh };
|
|
80
|
+
zoomRafId = requestAnimationFrame(animateZoom);
|
|
81
|
+
}
|
|
82
|
+
function svgCoord(clientX, clientY) {
|
|
83
|
+
if (!svgRef.value) return { x: 0, y: 0 };
|
|
84
|
+
const rect = svgRef.value.getBoundingClientRect();
|
|
85
|
+
return {
|
|
86
|
+
x: (clientX - rect.left) / rect.width * vb.value.w + vb.value.x,
|
|
87
|
+
y: (clientY - rect.top) / rect.height * vb.value.h + vb.value.y
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function onWheel(e) {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
const sensitivity = e.ctrlKey ? 8e-3 : 25e-4;
|
|
93
|
+
const delta = Math.sign(e.deltaY) * Math.min(Math.abs(e.deltaY), 100);
|
|
94
|
+
const scale = 1 + delta * sensitivity;
|
|
95
|
+
const rect = svgRef.value.getBoundingClientRect();
|
|
96
|
+
const tv = targetVb.value;
|
|
97
|
+
const px = (e.clientX - rect.left) / rect.width * tv.w + tv.x;
|
|
98
|
+
const py = (e.clientY - rect.top) / rect.height * tv.h + tv.y;
|
|
99
|
+
targetVb.value = {
|
|
100
|
+
x: px - (px - tv.x) * scale,
|
|
101
|
+
y: py - (py - tv.y) * scale,
|
|
102
|
+
w: Math.max(100, Math.min(8e3, tv.w * scale)),
|
|
103
|
+
h: Math.max(100, Math.min(8e3, tv.h * scale))
|
|
104
|
+
};
|
|
105
|
+
if (!zoomRafId) zoomRafId = requestAnimationFrame(animateZoom);
|
|
106
|
+
}
|
|
107
|
+
const activePointers = /* @__PURE__ */ new Map();
|
|
108
|
+
let isPinching = false;
|
|
109
|
+
let pinchStart = null;
|
|
110
|
+
const isPanning = ref(false);
|
|
111
|
+
const panStart = ref({ ex: 0, ey: 0, vx: 0, vy: 0 });
|
|
112
|
+
function onSvgPointerDown(e) {
|
|
113
|
+
if (e.pointerType === "mouse" && e.button !== 0) return;
|
|
114
|
+
activePointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
115
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
116
|
+
if (activePointers.size === 1) {
|
|
117
|
+
isPanning.value = true;
|
|
118
|
+
isPinching = false;
|
|
119
|
+
panStart.value = { ex: e.clientX, ey: e.clientY, vx: targetVb.value.x, vy: targetVb.value.y };
|
|
120
|
+
} else if (activePointers.size === 2) {
|
|
121
|
+
isPanning.value = false;
|
|
122
|
+
isPinching = true;
|
|
123
|
+
const pts = [...activePointers.values()];
|
|
124
|
+
const dist = Math.hypot(pts[1].x - pts[0].x, pts[1].y - pts[0].y);
|
|
125
|
+
pinchStart = {
|
|
126
|
+
dist: Math.max(dist, 1),
|
|
127
|
+
vb: { ...vb.value },
|
|
128
|
+
mid: { x: (pts[0].x + pts[1].x) / 2, y: (pts[0].y + pts[1].y) / 2 }
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function onSvgPointerMove(e) {
|
|
133
|
+
if (!activePointers.has(e.pointerId)) return;
|
|
134
|
+
activePointers.set(e.pointerId, { x: e.clientX, y: e.clientY });
|
|
135
|
+
if (!draggingId.value && activePointers.size === 1) {
|
|
136
|
+
setLocalState({ pos: svgCoord(e.clientX, e.clientY) });
|
|
137
|
+
}
|
|
138
|
+
if (isPinching && activePointers.size >= 2 && pinchStart) {
|
|
139
|
+
const pts = [...activePointers.values()];
|
|
140
|
+
const currentDist = Math.max(Math.hypot(pts[1].x - pts[0].x, pts[1].y - pts[0].y), 1);
|
|
141
|
+
const scale = currentDist / pinchStart.dist;
|
|
142
|
+
const newW = Math.max(100, Math.min(8e3, pinchStart.vb.w / scale));
|
|
143
|
+
const newH = Math.max(100, Math.min(8e3, pinchStart.vb.h / scale));
|
|
144
|
+
const rect2 = svgRef.value.getBoundingClientRect();
|
|
145
|
+
const startMidSvgX = (pinchStart.mid.x - rect2.left) / rect2.width * pinchStart.vb.w + pinchStart.vb.x;
|
|
146
|
+
const startMidSvgY = (pinchStart.mid.y - rect2.top) / rect2.height * pinchStart.vb.h + pinchStart.vb.y;
|
|
147
|
+
const curMidX = (pts[0].x + pts[1].x) / 2;
|
|
148
|
+
const curMidY = (pts[0].y + pts[1].y) / 2;
|
|
149
|
+
const newX = startMidSvgX - (curMidX - rect2.left) / rect2.width * newW;
|
|
150
|
+
const newY = startMidSvgY - (curMidY - rect2.top) / rect2.height * newH;
|
|
151
|
+
vb.value = { x: newX, y: newY, w: newW, h: newH };
|
|
152
|
+
targetVb.value = { ...vb.value };
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (!isPanning.value || activePointers.size !== 1) return;
|
|
156
|
+
const rect = svgRef.value.getBoundingClientRect();
|
|
157
|
+
const sx = vb.value.w / rect.width;
|
|
158
|
+
const sy = vb.value.h / rect.height;
|
|
159
|
+
const nx = panStart.value.vx - (e.clientX - panStart.value.ex) * sx;
|
|
160
|
+
const ny = panStart.value.vy - (e.clientY - panStart.value.ey) * sy;
|
|
161
|
+
vb.value = { ...vb.value, x: nx, y: ny };
|
|
162
|
+
targetVb.value = { ...targetVb.value, x: nx, y: ny };
|
|
163
|
+
}
|
|
164
|
+
function onSvgPointerUp(e) {
|
|
165
|
+
activePointers.delete(e.pointerId);
|
|
166
|
+
if (activePointers.size === 0) {
|
|
167
|
+
isPanning.value = false;
|
|
168
|
+
isPinching = false;
|
|
169
|
+
pinchStart = null;
|
|
170
|
+
} else if (activePointers.size === 1 && isPinching) {
|
|
171
|
+
isPinching = false;
|
|
172
|
+
pinchStart = null;
|
|
173
|
+
const _entry = [...activePointers.entries()][0];
|
|
174
|
+
if (!_entry) return;
|
|
175
|
+
const [, pt] = _entry;
|
|
176
|
+
isPanning.value = true;
|
|
177
|
+
panStart.value = { ex: pt.x, ey: pt.y, vx: vb.value.x, vy: vb.value.y };
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function onSvgPointerLeave(e) {
|
|
181
|
+
activePointers.delete(e.pointerId);
|
|
182
|
+
if (activePointers.size === 0) {
|
|
183
|
+
isPanning.value = false;
|
|
184
|
+
isPinching = false;
|
|
185
|
+
pinchStart = null;
|
|
186
|
+
setLocalState({ pos: null });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
function fitView() {
|
|
190
|
+
if (simNodes.value.length === 0) return;
|
|
191
|
+
const xs = simNodes.value.map((n) => n.x);
|
|
192
|
+
const ys = simNodes.value.map((n) => n.y);
|
|
193
|
+
const minX = Math.min(...xs);
|
|
194
|
+
const maxX = Math.max(...xs);
|
|
195
|
+
const minY = Math.min(...ys);
|
|
196
|
+
const maxY = Math.max(...ys);
|
|
197
|
+
const cx = (minX + maxX) / 2;
|
|
198
|
+
const cy = (minY + maxY) / 2;
|
|
199
|
+
const pad = 120;
|
|
200
|
+
let w = Math.max(300, maxX - minX + pad * 2);
|
|
201
|
+
let h = Math.max(300, maxY - minY + pad * 2);
|
|
202
|
+
const rect = svgRef.value?.getBoundingClientRect();
|
|
203
|
+
if (rect && rect.width > 0 && rect.height > 0) {
|
|
204
|
+
const aspect = rect.width / rect.height;
|
|
205
|
+
if (w / h < aspect) w = h * aspect;
|
|
206
|
+
else h = w / aspect;
|
|
207
|
+
}
|
|
208
|
+
vb.value = { x: cx - w / 2, y: cy - h / 2, w, h };
|
|
209
|
+
targetVb.value = { ...vb.value };
|
|
210
|
+
}
|
|
211
|
+
function resetView() {
|
|
212
|
+
fitView();
|
|
213
|
+
}
|
|
214
|
+
function zoomIn() {
|
|
215
|
+
targetVb.value.w = Math.max(100, targetVb.value.w * 0.77);
|
|
216
|
+
targetVb.value.h = Math.max(100, targetVb.value.h * 0.77);
|
|
217
|
+
if (!zoomRafId) zoomRafId = requestAnimationFrame(animateZoom);
|
|
218
|
+
}
|
|
219
|
+
function zoomOut() {
|
|
220
|
+
targetVb.value.w = Math.min(8e3, targetVb.value.w * 1.3);
|
|
221
|
+
targetVb.value.h = Math.min(8e3, targetVb.value.h * 1.3);
|
|
222
|
+
if (!zoomRafId) zoomRafId = requestAnimationFrame(animateZoom);
|
|
223
|
+
}
|
|
224
|
+
const viewBoxStr = computed(
|
|
225
|
+
() => `${vb.value.x} ${vb.value.y} ${vb.value.w} ${vb.value.h}`
|
|
226
|
+
);
|
|
227
|
+
const labelScale = computed(() => {
|
|
228
|
+
const w = svgRef.value?.clientWidth ?? 1e3;
|
|
229
|
+
return vb.value.w / w;
|
|
230
|
+
});
|
|
231
|
+
const labelOpacity = computed(() => {
|
|
232
|
+
const pxPerUnit = (svgRef.value?.clientWidth ?? 1e3) / vb.value.w;
|
|
233
|
+
const apparentR = 16 * pxPerUnit;
|
|
234
|
+
return Math.max(0, Math.min(1, (apparentR - 8) / 8));
|
|
235
|
+
});
|
|
236
|
+
const simNodes = ref([]);
|
|
237
|
+
const renderTick = ref(0);
|
|
238
|
+
let sim = null;
|
|
239
|
+
const renderedNodes = computed(() => {
|
|
240
|
+
void renderTick.value;
|
|
241
|
+
return simNodes.value.map((n) => ({ ...n }));
|
|
242
|
+
});
|
|
243
|
+
const renderedLinks = computed(() => {
|
|
244
|
+
void renderTick.value;
|
|
245
|
+
if (!sim || !d3.value) return [];
|
|
246
|
+
const linkForce = sim.force("link");
|
|
247
|
+
if (!linkForce) return [];
|
|
248
|
+
return linkForce.links().filter((l) => l.source?.x !== void 0 && l.target?.x !== void 0);
|
|
249
|
+
});
|
|
250
|
+
let savePosTimer = null;
|
|
251
|
+
function savePositionsDebounced() {
|
|
252
|
+
if (savePosTimer) clearTimeout(savePosTimer);
|
|
253
|
+
savePosTimer = setTimeout(() => {
|
|
254
|
+
savePosTimer = null;
|
|
255
|
+
for (const node of simNodes.value) {
|
|
256
|
+
if (remoteDragByNode.value.has(node.id)) continue;
|
|
257
|
+
if (draggingId.value === node.id) continue;
|
|
258
|
+
const existing = getGraphPos(node.id);
|
|
259
|
+
const pinned = existing?.pinned ?? false;
|
|
260
|
+
if (existing && Math.abs(existing.x - node.x) < 1 && Math.abs(existing.y - node.y) < 1 && existing.pinned === pinned) continue;
|
|
261
|
+
tree.updateMeta(node.id, { graphX: node.x, graphY: node.y, graphPinned: pinned });
|
|
262
|
+
}
|
|
263
|
+
}, 500);
|
|
264
|
+
}
|
|
265
|
+
const { pause: pauseSim, resume: resumeSim } = useRafFn(() => {
|
|
266
|
+
if (!sim || sim.alpha() < sim.alphaMin()) {
|
|
267
|
+
pauseSim();
|
|
268
|
+
if (simNodes.value.length > 0) savePositionsDebounced();
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
sim.tick();
|
|
272
|
+
for (const [nodeId, drag] of remoteDragByNode.value) {
|
|
273
|
+
const n = simNodes.value.find((nd) => nd.id === nodeId);
|
|
274
|
+
if (n) {
|
|
275
|
+
n.fx = drag.x;
|
|
276
|
+
n.fy = drag.y;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
renderTick.value++;
|
|
280
|
+
}, { immediate: false });
|
|
281
|
+
function restartSim() {
|
|
282
|
+
if (!sim) return;
|
|
283
|
+
sim.alpha(Math.max(sim.alpha(), 0.12));
|
|
284
|
+
resumeSim();
|
|
285
|
+
}
|
|
286
|
+
function nodeRadius(n) {
|
|
287
|
+
return Math.max(12, Math.min(36, 12 + n.neighborCount * 3.5));
|
|
288
|
+
}
|
|
289
|
+
function seedPos(id) {
|
|
290
|
+
let h = 0;
|
|
291
|
+
for (const c of id) h = Math.imul(31, h) + c.charCodeAt(0) | 0;
|
|
292
|
+
const angle = (h >>> 0) / 4294967295 * 2 * Math.PI;
|
|
293
|
+
const r = 40 + (Math.imul(h, 1664525) >>> 0) / 4294967295 * 100;
|
|
294
|
+
return { x: Math.cos(angle) * r, y: Math.sin(angle) * r };
|
|
295
|
+
}
|
|
296
|
+
const allEntries = computed(() => {
|
|
297
|
+
const result = [];
|
|
298
|
+
function collect(parentId) {
|
|
299
|
+
for (const e of tree.childrenOf(parentId)) {
|
|
300
|
+
result.push(e);
|
|
301
|
+
collect(e.id);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
collect(null);
|
|
305
|
+
return result;
|
|
306
|
+
});
|
|
307
|
+
const allEdges = computed(() => {
|
|
308
|
+
const nodeIds = new Set(allEntries.value.map((e) => e.id));
|
|
309
|
+
return allEntries.value.filter((e) => e.parentId !== null && nodeIds.has(e.parentId)).map((e) => ({ source: e.parentId, target: e.id }));
|
|
310
|
+
});
|
|
311
|
+
const graphKey = computed(() => {
|
|
312
|
+
const ids = [...allEntries.value].map((e) => e.id).sort().join(",");
|
|
313
|
+
const edges = [...allEdges.value].map((e) => `${e.source}>${e.target}`).sort().join(",");
|
|
314
|
+
return ids + "|" + edges;
|
|
315
|
+
});
|
|
316
|
+
function buildSimulation(oldPos = /* @__PURE__ */ new Map()) {
|
|
317
|
+
if (!d3.value) return;
|
|
318
|
+
const { forceSimulation, forceManyBody, forceCollide, forceLink, forceX, forceY } = d3.value;
|
|
319
|
+
const entries = allEntries.value;
|
|
320
|
+
const nodes = entries.map((entry) => {
|
|
321
|
+
const saved = getGraphPos(entry.id);
|
|
322
|
+
const old = oldPos.get(entry.id);
|
|
323
|
+
const seed = seedPos(entry.id);
|
|
324
|
+
const incoming = allEdges.value.filter((e) => e.target === entry.id).length;
|
|
325
|
+
const outgoing = allEdges.value.filter((e) => e.source === entry.id).length;
|
|
326
|
+
return {
|
|
327
|
+
id: entry.id,
|
|
328
|
+
label: entry.label,
|
|
329
|
+
type: entry.type,
|
|
330
|
+
color: entry.meta?.color,
|
|
331
|
+
icon: entry.meta?.icon,
|
|
332
|
+
childCount: tree.childrenOf(entry.id).length,
|
|
333
|
+
neighborCount: incoming + outgoing,
|
|
334
|
+
x: saved?.x ?? old?.x ?? seed.x,
|
|
335
|
+
y: saved?.y ?? old?.y ?? seed.y,
|
|
336
|
+
vx: 0,
|
|
337
|
+
vy: 0,
|
|
338
|
+
fx: saved?.pinned ? saved.x : null,
|
|
339
|
+
fy: saved?.pinned ? saved.y : null
|
|
340
|
+
};
|
|
341
|
+
});
|
|
342
|
+
const nodeIds = new Set(nodes.map((n) => n.id));
|
|
343
|
+
const edges = allEdges.value.filter((e) => nodeIds.has(e.source) && nodeIds.has(e.target)).map((e) => ({ source: e.source, target: e.target }));
|
|
344
|
+
pauseSim();
|
|
345
|
+
sim?.stop();
|
|
346
|
+
sim = forceSimulation(nodes).force("charge", forceManyBody().strength(-120)).force("x", forceX(0).strength(0.06)).force("y", forceY(0).strength(0.06)).force("link", forceLink(edges).id((dd) => dd.id).distance(80).strength(0.5)).force("collide", forceCollide().radius((n) => nodeRadius(n) + 6).strength(0.85)).alphaDecay(0.025).velocityDecay(0.55).stop();
|
|
347
|
+
simNodes.value = nodes;
|
|
348
|
+
const hasUnpositioned = nodes.some((n) => !getGraphPos(n.id) && !oldPos.has(n.id));
|
|
349
|
+
if (hasUnpositioned) {
|
|
350
|
+
resumeSim();
|
|
351
|
+
} else {
|
|
352
|
+
renderTick.value++;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
let hasFitOnce = false;
|
|
356
|
+
watch(graphKey, () => {
|
|
357
|
+
const oldPos = new Map(simNodes.value.map((n) => [n.id, { x: n.x, y: n.y }]));
|
|
358
|
+
buildSimulation(oldPos);
|
|
359
|
+
if (!hasFitOnce && simNodes.value.length > 0) {
|
|
360
|
+
hasFitOnce = true;
|
|
361
|
+
nextTick(fitView);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
watch(allEntries, () => {
|
|
365
|
+
let changed = false;
|
|
366
|
+
for (const node of simNodes.value) {
|
|
367
|
+
const entry = allEntries.value.find((e) => e.id === node.id);
|
|
368
|
+
if (entry && (entry.label !== node.label || entry.type !== node.type || entry.meta?.color !== node.color || entry.meta?.icon !== node.icon)) {
|
|
369
|
+
node.label = entry.label;
|
|
370
|
+
node.type = entry.type;
|
|
371
|
+
node.color = entry.meta?.color;
|
|
372
|
+
node.icon = entry.meta?.icon;
|
|
373
|
+
changed = true;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (changed) renderTick.value++;
|
|
377
|
+
});
|
|
378
|
+
watch(childDoc, (doc) => {
|
|
379
|
+
if (doc && d3.value) {
|
|
380
|
+
hasFitOnce = false;
|
|
381
|
+
buildSimulation();
|
|
382
|
+
if (simNodes.value.length > 0) {
|
|
383
|
+
hasFitOnce = true;
|
|
384
|
+
nextTick(fitView);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}, { immediate: true });
|
|
388
|
+
watch(d3, (val) => {
|
|
389
|
+
if (val && childDoc.value) {
|
|
390
|
+
hasFitOnce = false;
|
|
391
|
+
buildSimulation();
|
|
392
|
+
if (simNodes.value.length > 0) {
|
|
393
|
+
hasFitOnce = true;
|
|
394
|
+
nextTick(fitView);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
watch(tree.entries, () => {
|
|
399
|
+
for (const node of simNodes.value) {
|
|
400
|
+
const s = getGraphPos(node.id);
|
|
401
|
+
if (s?.pinned && draggingId.value !== node.id) {
|
|
402
|
+
node.fx = s.x;
|
|
403
|
+
node.fy = s.y;
|
|
404
|
+
} else if (!s?.pinned && draggingId.value !== node.id && !remoteDragByNode.value.has(node.id)) {
|
|
405
|
+
node.fx = null;
|
|
406
|
+
node.fy = null;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
onBeforeUnmount(() => {
|
|
411
|
+
pauseSim();
|
|
412
|
+
sim?.stop();
|
|
413
|
+
if (savePosTimer) clearTimeout(savePosTimer);
|
|
414
|
+
if (zoomRafId) cancelAnimationFrame(zoomRafId);
|
|
415
|
+
setLocalState({ "pos": null, "graph:dragging": null, "graph:selection": [] });
|
|
416
|
+
});
|
|
417
|
+
const draggingId = ref(null);
|
|
418
|
+
const dragStart = ref({ ex: 0, ey: 0 });
|
|
419
|
+
const wasDragged = ref(false);
|
|
420
|
+
function onNodePointerDown(e, id) {
|
|
421
|
+
if (!props.editable) return;
|
|
422
|
+
e.stopPropagation();
|
|
423
|
+
const node = simNodes.value.find((n) => n.id === id);
|
|
424
|
+
if (!node) return;
|
|
425
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
426
|
+
draggingId.value = id;
|
|
427
|
+
wasDragged.value = false;
|
|
428
|
+
dragStart.value = { ex: e.clientX, ey: e.clientY };
|
|
429
|
+
node.fx = node.x;
|
|
430
|
+
node.fy = node.y;
|
|
431
|
+
restartSim();
|
|
432
|
+
setLocalState({ "graph:dragging": { nodeId: id, x: node.x, y: node.y } });
|
|
433
|
+
}
|
|
434
|
+
function onNodePointerMove(e, id) {
|
|
435
|
+
if (draggingId.value !== id) return;
|
|
436
|
+
const dist = Math.hypot(e.clientX - dragStart.value.ex, e.clientY - dragStart.value.ey);
|
|
437
|
+
if (dist > 4) wasDragged.value = true;
|
|
438
|
+
const p = svgCoord(e.clientX, e.clientY);
|
|
439
|
+
const node = simNodes.value.find((n) => n.id === id);
|
|
440
|
+
if (node) {
|
|
441
|
+
node.fx = p.x;
|
|
442
|
+
node.fy = p.y;
|
|
443
|
+
renderTick.value++;
|
|
444
|
+
setLocalState({ "graph:dragging": { nodeId: id, x: p.x, y: p.y } });
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
function onNodePointerUp(_e, id) {
|
|
448
|
+
onDragEnd(id);
|
|
449
|
+
}
|
|
450
|
+
function onDragEnd(id) {
|
|
451
|
+
const node = simNodes.value.find((n) => n.id === id);
|
|
452
|
+
if (node) {
|
|
453
|
+
const isPinned = getGraphPos(id)?.pinned ?? false;
|
|
454
|
+
tree.updateMeta(id, { graphX: node.x, graphY: node.y, graphPinned: isPinned });
|
|
455
|
+
if (!isPinned) {
|
|
456
|
+
node.fx = null;
|
|
457
|
+
node.fy = null;
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
setLocalState({ "graph:dragging": null });
|
|
461
|
+
draggingId.value = null;
|
|
462
|
+
restartSim();
|
|
463
|
+
}
|
|
464
|
+
const selectedNodeId = ref(null);
|
|
465
|
+
function selectNode(id) {
|
|
466
|
+
selectedNodeId.value = id;
|
|
467
|
+
setLocalState({ "graph:selection": id ? [id] : [] });
|
|
468
|
+
}
|
|
469
|
+
function onSvgClick() {
|
|
470
|
+
selectNode(null);
|
|
471
|
+
}
|
|
472
|
+
function onNodeClick(e, id, label) {
|
|
473
|
+
e.stopPropagation();
|
|
474
|
+
if (wasDragged.value) return;
|
|
475
|
+
selectNode(id);
|
|
476
|
+
openNode(id, label);
|
|
477
|
+
}
|
|
478
|
+
function onSvgDblClick(e) {
|
|
479
|
+
if (!props.editable) return;
|
|
480
|
+
if (e.target.closest("[data-node]")) return;
|
|
481
|
+
const p = svgCoord(e.clientX, e.clientY);
|
|
482
|
+
const id = tree.createChild(null, locale.value.untitled);
|
|
483
|
+
tree.updateMeta(id, { graphX: p.x, graphY: p.y, graphPinned: true });
|
|
484
|
+
}
|
|
485
|
+
function onNodeDblClick(e, id, label) {
|
|
486
|
+
if (!props.editable) return;
|
|
487
|
+
e.stopPropagation();
|
|
488
|
+
editId.value = id;
|
|
489
|
+
editValue.value = label;
|
|
490
|
+
}
|
|
491
|
+
const editId = ref(null);
|
|
492
|
+
const editValue = ref("");
|
|
493
|
+
function commitEdit() {
|
|
494
|
+
if (!props.editable) return;
|
|
495
|
+
if (editId.value && editValue.value.trim()) {
|
|
496
|
+
tree.renameEntry(editId.value, editValue.value.trim());
|
|
497
|
+
}
|
|
498
|
+
editId.value = null;
|
|
499
|
+
}
|
|
500
|
+
function addNodeAtCenter() {
|
|
501
|
+
if (!props.editable) return;
|
|
502
|
+
const id = tree.createChild(null, locale.value.untitled);
|
|
503
|
+
tree.updateMeta(id, { graphX: 0, graphY: 0, graphPinned: false });
|
|
504
|
+
}
|
|
505
|
+
const ctxNode = ref(null);
|
|
506
|
+
const ctxCanvas = ref(null);
|
|
507
|
+
const ctxPos = ref({ x: 0, y: 0 });
|
|
508
|
+
const showCtx = ref(false);
|
|
509
|
+
function onNodeContextMenu(e, id, label) {
|
|
510
|
+
if (!props.editable) return;
|
|
511
|
+
e.preventDefault();
|
|
512
|
+
e.stopPropagation();
|
|
513
|
+
ctxNode.value = { id, label };
|
|
514
|
+
ctxCanvas.value = null;
|
|
515
|
+
ctxPos.value = { x: e.clientX, y: e.clientY };
|
|
516
|
+
showCtx.value = true;
|
|
517
|
+
}
|
|
518
|
+
function onSvgContextMenu(e) {
|
|
519
|
+
if (!props.editable) return;
|
|
520
|
+
e.preventDefault();
|
|
521
|
+
ctxNode.value = null;
|
|
522
|
+
ctxCanvas.value = svgCoord(e.clientX, e.clientY);
|
|
523
|
+
ctxPos.value = { x: e.clientX, y: e.clientY };
|
|
524
|
+
showCtx.value = true;
|
|
525
|
+
}
|
|
526
|
+
useEventListener(window, "pointerdown", () => {
|
|
527
|
+
showCtx.value = false;
|
|
528
|
+
});
|
|
529
|
+
const ctxItems = computed(() => {
|
|
530
|
+
if (ctxNode.value) {
|
|
531
|
+
const isPinned = getGraphPos(ctxNode.value.id)?.pinned;
|
|
532
|
+
return [
|
|
533
|
+
[
|
|
534
|
+
{
|
|
535
|
+
label: "Open",
|
|
536
|
+
icon: "i-lucide-external-link",
|
|
537
|
+
onSelect: () => openNode(ctxNode.value.id, ctxNode.value.label)
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
label: "Rename",
|
|
541
|
+
icon: "i-lucide-pencil",
|
|
542
|
+
onSelect: () => {
|
|
543
|
+
editId.value = ctxNode.value.id;
|
|
544
|
+
editValue.value = ctxNode.value.label;
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
label: isPinned ? locale.value.unpin : locale.value.pin,
|
|
549
|
+
icon: isPinned ? "i-lucide-pin-off" : "i-lucide-pin",
|
|
550
|
+
onSelect: () => togglePin(ctxNode.value.id)
|
|
551
|
+
}
|
|
552
|
+
],
|
|
553
|
+
[
|
|
554
|
+
{
|
|
555
|
+
label: "Delete",
|
|
556
|
+
icon: "i-lucide-trash-2",
|
|
557
|
+
color: "error",
|
|
558
|
+
onSelect: () => tree.deleteEntry(ctxNode.value.id)
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
];
|
|
562
|
+
}
|
|
563
|
+
if (ctxCanvas.value) {
|
|
564
|
+
return [[
|
|
565
|
+
{
|
|
566
|
+
label: locale.value.addNode,
|
|
567
|
+
icon: "i-lucide-plus-circle",
|
|
568
|
+
onSelect: () => {
|
|
569
|
+
const id = tree.createChild(null, locale.value.untitled);
|
|
570
|
+
tree.updateMeta(id, { graphX: ctxCanvas.value.x, graphY: ctxCanvas.value.y, graphPinned: true });
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
]];
|
|
574
|
+
}
|
|
575
|
+
return [];
|
|
576
|
+
});
|
|
577
|
+
function togglePin(id) {
|
|
578
|
+
if (!props.editable) return;
|
|
579
|
+
const node = simNodes.value.find((n) => n.id === id);
|
|
580
|
+
if (!node) return;
|
|
581
|
+
const isPinned = getGraphPos(id)?.pinned;
|
|
582
|
+
tree.updateMeta(id, { graphX: node.x, graphY: node.y, graphPinned: !isPinned });
|
|
583
|
+
node.fx = isPinned ? null : node.x;
|
|
584
|
+
node.fy = isPinned ? null : node.y;
|
|
585
|
+
if (isPinned) restartSim();
|
|
586
|
+
}
|
|
587
|
+
const remoteDragByNode = computed(() => {
|
|
588
|
+
const myId = childProviderRef.value?.awareness?.clientID;
|
|
589
|
+
const map = /* @__PURE__ */ new Map();
|
|
590
|
+
for (const s of states.value) {
|
|
591
|
+
if (s.clientId === myId || !s["graph:dragging"]) continue;
|
|
592
|
+
const nid = s["graph:dragging"].nodeId;
|
|
593
|
+
if (!map.has(nid)) {
|
|
594
|
+
map.set(nid, {
|
|
595
|
+
x: s["graph:dragging"].x,
|
|
596
|
+
y: s["graph:dragging"].y,
|
|
597
|
+
color: s.user?.color ?? "#888"
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
return map;
|
|
602
|
+
});
|
|
603
|
+
const remoteSelections = computed(() => {
|
|
604
|
+
const myId = childProviderRef.value?.awareness?.clientID;
|
|
605
|
+
const map = /* @__PURE__ */ new Map();
|
|
606
|
+
for (const s of states.value) {
|
|
607
|
+
if (s.clientId === myId) continue;
|
|
608
|
+
for (const nid of s["graph:selection"] ?? []) {
|
|
609
|
+
if (!map.has(nid)) map.set(nid, []);
|
|
610
|
+
map.get(nid).push({ color: s.user?.color ?? "#888", name: s.user?.name ?? "Anon" });
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return map;
|
|
614
|
+
});
|
|
615
|
+
const TYPE_COLORS = {
|
|
616
|
+
doc: "var(--color-blue-500)",
|
|
617
|
+
kanban: "var(--color-violet-500)",
|
|
618
|
+
gallery: "var(--color-pink-500)",
|
|
619
|
+
table: "var(--color-teal-500)",
|
|
620
|
+
outline: "var(--color-slate-500)",
|
|
621
|
+
timeline: "var(--color-amber-500)",
|
|
622
|
+
calendar: "var(--color-red-500)",
|
|
623
|
+
map: "var(--color-emerald-500)",
|
|
624
|
+
graph: "var(--color-indigo-500)",
|
|
625
|
+
dashboard: "var(--color-orange-500)",
|
|
626
|
+
checklist: "var(--color-green-500)"
|
|
627
|
+
};
|
|
628
|
+
function nodeColor(n) {
|
|
629
|
+
if (n.color) return n.color;
|
|
630
|
+
return TYPE_COLORS[n.type ?? "doc"] ?? "var(--ui-color-neutral-500)";
|
|
631
|
+
}
|
|
632
|
+
const DOC_TYPE_INITIALS = {
|
|
633
|
+
doc: "D",
|
|
634
|
+
kanban: "K",
|
|
635
|
+
gallery: "G",
|
|
636
|
+
table: "T",
|
|
637
|
+
outline: "O",
|
|
638
|
+
timeline: "TL",
|
|
639
|
+
calendar: "C",
|
|
640
|
+
map: "MP",
|
|
641
|
+
graph: "GR",
|
|
642
|
+
dashboard: "DK",
|
|
643
|
+
call: "CA",
|
|
644
|
+
checklist: "CL"
|
|
645
|
+
};
|
|
646
|
+
function docTypeInitial(type) {
|
|
647
|
+
return DOC_TYPE_INITIALS[type ?? "doc"] ?? "?";
|
|
648
|
+
}
|
|
649
|
+
defineExpose({ connectedUsers });
|
|
650
|
+
</script>
|
|
651
|
+
|
|
652
|
+
<template>
|
|
653
|
+
<div class="flex-1 min-h-0 relative overflow-hidden bg-(--ui-bg-elevated)">
|
|
654
|
+
<!-- d3-force not installed fallback -->
|
|
655
|
+
<div
|
|
656
|
+
v-if="d3Error"
|
|
657
|
+
class="flex flex-col items-center justify-center h-full gap-3 text-center"
|
|
658
|
+
>
|
|
659
|
+
<UIcon
|
|
660
|
+
name="i-lucide-git-fork"
|
|
661
|
+
class="size-10 text-(--ui-text-dimmed)"
|
|
662
|
+
/>
|
|
663
|
+
<p class="text-sm text-(--ui-text-muted)">
|
|
664
|
+
Graph renderer requires <code>d3-force</code>
|
|
665
|
+
</p>
|
|
666
|
+
<p class="text-xs text-(--ui-text-dimmed)">
|
|
667
|
+
Install it with: <code>pnpm add d3-force</code>
|
|
668
|
+
</p>
|
|
669
|
+
</div>
|
|
670
|
+
|
|
671
|
+
<template v-else-if="d3">
|
|
672
|
+
<!-- Toolbar -->
|
|
673
|
+
<div class="absolute top-3 left-3 z-10 flex gap-1">
|
|
674
|
+
<UButton
|
|
675
|
+
v-if="editable"
|
|
676
|
+
icon="i-lucide-plus"
|
|
677
|
+
size="xs"
|
|
678
|
+
variant="soft"
|
|
679
|
+
color="neutral"
|
|
680
|
+
:label="locale.addNode"
|
|
681
|
+
@click="addNodeAtCenter"
|
|
682
|
+
/>
|
|
683
|
+
<UTooltip
|
|
684
|
+
text="Zoom out"
|
|
685
|
+
:content="{ side: 'bottom' }"
|
|
686
|
+
>
|
|
687
|
+
<UButton
|
|
688
|
+
icon="i-lucide-minus"
|
|
689
|
+
size="xs"
|
|
690
|
+
variant="soft"
|
|
691
|
+
color="neutral"
|
|
692
|
+
@click="zoomOut"
|
|
693
|
+
/>
|
|
694
|
+
</UTooltip>
|
|
695
|
+
<UTooltip
|
|
696
|
+
text="Zoom in"
|
|
697
|
+
:content="{ side: 'bottom' }"
|
|
698
|
+
>
|
|
699
|
+
<UButton
|
|
700
|
+
icon="i-lucide-zoom-in"
|
|
701
|
+
size="xs"
|
|
702
|
+
variant="soft"
|
|
703
|
+
color="neutral"
|
|
704
|
+
@click="zoomIn"
|
|
705
|
+
/>
|
|
706
|
+
</UTooltip>
|
|
707
|
+
<UTooltip
|
|
708
|
+
text="Fit view"
|
|
709
|
+
:content="{ side: 'bottom' }"
|
|
710
|
+
>
|
|
711
|
+
<UButton
|
|
712
|
+
icon="i-lucide-focus"
|
|
713
|
+
size="xs"
|
|
714
|
+
variant="soft"
|
|
715
|
+
color="neutral"
|
|
716
|
+
@click="resetView"
|
|
717
|
+
/>
|
|
718
|
+
</UTooltip>
|
|
719
|
+
<UButton
|
|
720
|
+
icon="i-lucide-wind"
|
|
721
|
+
size="xs"
|
|
722
|
+
variant="soft"
|
|
723
|
+
color="neutral"
|
|
724
|
+
label="Shake"
|
|
725
|
+
@click="restartSim"
|
|
726
|
+
/>
|
|
727
|
+
</div>
|
|
728
|
+
|
|
729
|
+
<!-- Empty state -->
|
|
730
|
+
<div
|
|
731
|
+
v-if="renderedNodes.length === 0"
|
|
732
|
+
class="flex flex-col items-center justify-center h-full gap-3 text-center"
|
|
733
|
+
>
|
|
734
|
+
<UIcon
|
|
735
|
+
name="i-lucide-git-fork"
|
|
736
|
+
class="size-10 text-(--ui-text-dimmed)"
|
|
737
|
+
/>
|
|
738
|
+
<p class="text-sm text-(--ui-text-muted)">
|
|
739
|
+
{{ locale.empty }}
|
|
740
|
+
</p>
|
|
741
|
+
<UButton
|
|
742
|
+
v-if="editable"
|
|
743
|
+
icon="i-lucide-plus"
|
|
744
|
+
:label="locale.addNode"
|
|
745
|
+
size="sm"
|
|
746
|
+
@click="addNodeAtCenter"
|
|
747
|
+
/>
|
|
748
|
+
</div>
|
|
749
|
+
|
|
750
|
+
<svg
|
|
751
|
+
v-else
|
|
752
|
+
ref="svgRef"
|
|
753
|
+
class="w-full h-full select-none"
|
|
754
|
+
:class="isPanning ? 'cursor-grabbing' : 'cursor-default'"
|
|
755
|
+
style="touch-action: none"
|
|
756
|
+
:viewBox="viewBoxStr"
|
|
757
|
+
@wheel.prevent="onWheel"
|
|
758
|
+
@pointerdown="onSvgPointerDown"
|
|
759
|
+
@pointermove="onSvgPointerMove"
|
|
760
|
+
@pointerup="onSvgPointerUp"
|
|
761
|
+
@pointerleave="onSvgPointerLeave"
|
|
762
|
+
@click="onSvgClick"
|
|
763
|
+
@dblclick="onSvgDblClick"
|
|
764
|
+
@contextmenu.prevent="onSvgContextMenu"
|
|
765
|
+
>
|
|
766
|
+
<defs>
|
|
767
|
+
<pattern
|
|
768
|
+
id="gdots"
|
|
769
|
+
width="30"
|
|
770
|
+
height="30"
|
|
771
|
+
patternUnits="userSpaceOnUse"
|
|
772
|
+
>
|
|
773
|
+
<circle
|
|
774
|
+
cx="15"
|
|
775
|
+
cy="15"
|
|
776
|
+
r="0.8"
|
|
777
|
+
fill="var(--ui-border)"
|
|
778
|
+
opacity="0.5"
|
|
779
|
+
/>
|
|
780
|
+
</pattern>
|
|
781
|
+
<filter
|
|
782
|
+
id="glow"
|
|
783
|
+
x="-50%"
|
|
784
|
+
y="-50%"
|
|
785
|
+
width="200%"
|
|
786
|
+
height="200%"
|
|
787
|
+
>
|
|
788
|
+
<feGaussianBlur
|
|
789
|
+
stdDeviation="4"
|
|
790
|
+
result="blur"
|
|
791
|
+
/>
|
|
792
|
+
<feMerge>
|
|
793
|
+
<feMergeNode in="blur" />
|
|
794
|
+
<feMergeNode in="SourceGraphic" />
|
|
795
|
+
</feMerge>
|
|
796
|
+
</filter>
|
|
797
|
+
</defs>
|
|
798
|
+
|
|
799
|
+
<!-- Background dots -->
|
|
800
|
+
<rect
|
|
801
|
+
x="-5000"
|
|
802
|
+
y="-5000"
|
|
803
|
+
width="10000"
|
|
804
|
+
height="10000"
|
|
805
|
+
fill="url(#gdots)"
|
|
806
|
+
/>
|
|
807
|
+
|
|
808
|
+
<!-- Edges layer -->
|
|
809
|
+
<g>
|
|
810
|
+
<line
|
|
811
|
+
v-for="(link, i) in renderedLinks"
|
|
812
|
+
:key="i"
|
|
813
|
+
:x1="link.source.x"
|
|
814
|
+
:y1="link.source.y"
|
|
815
|
+
:x2="link.target.x"
|
|
816
|
+
:y2="link.target.y"
|
|
817
|
+
stroke="var(--ui-border)"
|
|
818
|
+
stroke-width="1.2"
|
|
819
|
+
opacity="0.6"
|
|
820
|
+
/>
|
|
821
|
+
</g>
|
|
822
|
+
|
|
823
|
+
<!-- Nodes layer -->
|
|
824
|
+
<g
|
|
825
|
+
v-for="node in renderedNodes"
|
|
826
|
+
:key="node.id"
|
|
827
|
+
data-node
|
|
828
|
+
:transform="`translate(${node.x}, ${node.y})`"
|
|
829
|
+
style="cursor: grab"
|
|
830
|
+
@pointerdown.stop="onNodePointerDown($event, node.id)"
|
|
831
|
+
@pointermove.stop="onNodePointerMove($event, node.id)"
|
|
832
|
+
@pointerup.stop="onNodePointerUp($event, node.id)"
|
|
833
|
+
@click.stop="onNodeClick($event, node.id, node.label)"
|
|
834
|
+
@dblclick.stop="onNodeDblClick($event, node.id, node.label)"
|
|
835
|
+
@contextmenu.stop.prevent="onNodeContextMenu($event, node.id, node.label)"
|
|
836
|
+
>
|
|
837
|
+
<!-- Remote selection halos -->
|
|
838
|
+
<circle
|
|
839
|
+
v-for="(sel, si) in remoteSelections.get(node.id) ?? []"
|
|
840
|
+
:key="sel.color + si"
|
|
841
|
+
:r="nodeRadius(node) + 9 + si * 5"
|
|
842
|
+
fill="none"
|
|
843
|
+
:stroke="sel.color"
|
|
844
|
+
stroke-width="1.5"
|
|
845
|
+
opacity="0.4"
|
|
846
|
+
/>
|
|
847
|
+
|
|
848
|
+
<!-- Local selection glow -->
|
|
849
|
+
<circle
|
|
850
|
+
v-if="selectedNodeId === node.id"
|
|
851
|
+
:r="nodeRadius(node) + 7"
|
|
852
|
+
fill="none"
|
|
853
|
+
stroke="var(--ui-primary)"
|
|
854
|
+
stroke-width="2.5"
|
|
855
|
+
filter="url(#glow)"
|
|
856
|
+
opacity="0.9"
|
|
857
|
+
/>
|
|
858
|
+
|
|
859
|
+
<!-- Remote drag ring -->
|
|
860
|
+
<circle
|
|
861
|
+
v-if="remoteDragByNode.get(node.id)"
|
|
862
|
+
:r="nodeRadius(node) + 3"
|
|
863
|
+
fill="none"
|
|
864
|
+
:stroke="remoteDragByNode.get(node.id).color"
|
|
865
|
+
stroke-width="2"
|
|
866
|
+
stroke-dasharray="5 3"
|
|
867
|
+
opacity="0.8"
|
|
868
|
+
/>
|
|
869
|
+
|
|
870
|
+
<!-- Main circle -->
|
|
871
|
+
<circle
|
|
872
|
+
:r="nodeRadius(node)"
|
|
873
|
+
:fill="nodeColor(node)"
|
|
874
|
+
stroke="color-mix(in srgb, var(--ui-bg) 20%, var(--ui-border))"
|
|
875
|
+
stroke-width="1"
|
|
876
|
+
/>
|
|
877
|
+
|
|
878
|
+
<!-- Pinned indicator -->
|
|
879
|
+
<circle
|
|
880
|
+
v-if="getGraphPos(node.id)?.pinned"
|
|
881
|
+
:cx="nodeRadius(node) - 5"
|
|
882
|
+
:cy="-(nodeRadius(node) - 5)"
|
|
883
|
+
r="4"
|
|
884
|
+
fill="var(--ui-bg-muted)"
|
|
885
|
+
stroke="var(--ui-text-muted)"
|
|
886
|
+
stroke-width="1"
|
|
887
|
+
/>
|
|
888
|
+
|
|
889
|
+
<!-- Custom icon -->
|
|
890
|
+
<foreignObject
|
|
891
|
+
v-if="node.icon"
|
|
892
|
+
:x="-nodeRadius(node) * 0.45"
|
|
893
|
+
:y="-nodeRadius(node) * 0.45"
|
|
894
|
+
:width="nodeRadius(node) * 0.9"
|
|
895
|
+
:height="nodeRadius(node) * 0.9"
|
|
896
|
+
style="pointer-events: none; overflow: visible"
|
|
897
|
+
>
|
|
898
|
+
<div
|
|
899
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
900
|
+
style="width: 100%; height: 100%; display: flex; align-items: center; justify-content: center"
|
|
901
|
+
>
|
|
902
|
+
<UIcon
|
|
903
|
+
:name="`i-lucide-${node.icon}`"
|
|
904
|
+
style="color: white; opacity: 0.9; width: 100%; height: 100%"
|
|
905
|
+
/>
|
|
906
|
+
</div>
|
|
907
|
+
</foreignObject>
|
|
908
|
+
|
|
909
|
+
<!-- Fallback: doc-type initial -->
|
|
910
|
+
<text
|
|
911
|
+
v-else
|
|
912
|
+
text-anchor="middle"
|
|
913
|
+
dominant-baseline="central"
|
|
914
|
+
:font-size="nodeRadius(node) * 0.5"
|
|
915
|
+
fill="white"
|
|
916
|
+
opacity="0.9"
|
|
917
|
+
style="pointer-events: none; user-select: none"
|
|
918
|
+
>
|
|
919
|
+
{{ docTypeInitial(node.type) }}
|
|
920
|
+
</text>
|
|
921
|
+
|
|
922
|
+
<!-- Node label -->
|
|
923
|
+
<text
|
|
924
|
+
v-if="editId !== node.id"
|
|
925
|
+
:y="nodeRadius(node) + 14 * labelScale"
|
|
926
|
+
text-anchor="middle"
|
|
927
|
+
:font-size="11 * labelScale"
|
|
928
|
+
:opacity="labelOpacity"
|
|
929
|
+
fill="var(--ui-text)"
|
|
930
|
+
style="pointer-events: none; user-select: none"
|
|
931
|
+
>
|
|
932
|
+
{{ node.label.length > 20 ? node.label.slice(0, 20) + "\u2026" : node.label }}
|
|
933
|
+
</text>
|
|
934
|
+
|
|
935
|
+
<!-- Inline rename input -->
|
|
936
|
+
<foreignObject
|
|
937
|
+
v-if="editId === node.id"
|
|
938
|
+
:x="-(nodeRadius(node) + 28)"
|
|
939
|
+
:y="nodeRadius(node) + 4"
|
|
940
|
+
:width="(nodeRadius(node) + 28) * 2"
|
|
941
|
+
height="20"
|
|
942
|
+
>
|
|
943
|
+
<input
|
|
944
|
+
class="w-full bg-transparent text-center text-xs outline-none"
|
|
945
|
+
style="color: var(--ui-text-highlighted)"
|
|
946
|
+
:value="editValue"
|
|
947
|
+
autofocus
|
|
948
|
+
@input="editValue = $event.target.value"
|
|
949
|
+
@blur="commitEdit"
|
|
950
|
+
@keydown.enter="commitEdit"
|
|
951
|
+
@keydown.escape="editId = null"
|
|
952
|
+
@pointerdown.stop
|
|
953
|
+
>
|
|
954
|
+
</foreignObject>
|
|
955
|
+
</g>
|
|
956
|
+
|
|
957
|
+
<!-- Cursors layer -->
|
|
958
|
+
<g style="pointer-events: none">
|
|
959
|
+
<g
|
|
960
|
+
v-for="c in cursors"
|
|
961
|
+
:key="c.clientId"
|
|
962
|
+
:transform="`translate(${c.x}, ${c.y})`"
|
|
963
|
+
>
|
|
964
|
+
<circle
|
|
965
|
+
r="5"
|
|
966
|
+
:fill="c.state?.user?.color || 'var(--ui-color-neutral-400)'"
|
|
967
|
+
opacity="0.85"
|
|
968
|
+
/>
|
|
969
|
+
<text
|
|
970
|
+
x="8"
|
|
971
|
+
y="4"
|
|
972
|
+
:font-size="10 * labelScale"
|
|
973
|
+
:fill="c.state?.user?.color || 'var(--ui-color-neutral-400)'"
|
|
974
|
+
style="user-select: none"
|
|
975
|
+
>
|
|
976
|
+
{{ c.state?.user?.name || "Anon" }}
|
|
977
|
+
</text>
|
|
978
|
+
</g>
|
|
979
|
+
</g>
|
|
980
|
+
</svg>
|
|
981
|
+
|
|
982
|
+
<!-- Hint -->
|
|
983
|
+
<p class="absolute bottom-3 right-3 text-[10px] text-(--ui-text-muted) select-none pointer-events-none">
|
|
984
|
+
Drag to reposition · Right-click to pin/create · Scroll to zoom · Click to open · Dbl-click canvas to create
|
|
985
|
+
</p>
|
|
986
|
+
|
|
987
|
+
<!-- Context menu -->
|
|
988
|
+
<Teleport to="body">
|
|
989
|
+
<div
|
|
990
|
+
v-if="showCtx && ctxItems.length"
|
|
991
|
+
class="fixed z-50 min-w-40 bg-(--ui-bg) border border-(--ui-border) rounded-lg shadow-xl py-1 text-sm"
|
|
992
|
+
:style="{ left: ctxPos.x + 'px', top: ctxPos.y + 'px' }"
|
|
993
|
+
>
|
|
994
|
+
<template
|
|
995
|
+
v-for="(group, gi) in ctxItems"
|
|
996
|
+
:key="gi"
|
|
997
|
+
>
|
|
998
|
+
<div
|
|
999
|
+
v-if="gi > 0"
|
|
1000
|
+
class="my-1 border-t border-(--ui-border)"
|
|
1001
|
+
/>
|
|
1002
|
+
<button
|
|
1003
|
+
v-for="item in group"
|
|
1004
|
+
:key="item.label"
|
|
1005
|
+
class="w-full flex items-center gap-2 px-3 py-1.5 hover:bg-(--ui-bg-elevated) text-left cursor-default"
|
|
1006
|
+
:class="item.color === 'error' ? 'text-(--ui-color-error-500)' : 'text-(--ui-text)'"
|
|
1007
|
+
@pointerdown.stop
|
|
1008
|
+
@click="item.onSelect();
|
|
1009
|
+
showCtx = false"
|
|
1010
|
+
>
|
|
1011
|
+
<UIcon
|
|
1012
|
+
:name="item.icon"
|
|
1013
|
+
class="size-3.5 shrink-0 opacity-70"
|
|
1014
|
+
/>
|
|
1015
|
+
{{ item.label }}
|
|
1016
|
+
</button>
|
|
1017
|
+
</template>
|
|
1018
|
+
</div>
|
|
1019
|
+
</Teleport>
|
|
1020
|
+
</template>
|
|
1021
|
+
|
|
1022
|
+
<!-- Node panel -->
|
|
1023
|
+
<ANodePanel
|
|
1024
|
+
:node-id="openNodeId"
|
|
1025
|
+
:node-label="openNodeLabel"
|
|
1026
|
+
:child-provider="openNodeProvider"
|
|
1027
|
+
@close="closePanel"
|
|
1028
|
+
/>
|
|
1029
|
+
</div>
|
|
1030
|
+
</template>
|