@abraca/nuxt 0.3.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 +26 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +51 -8
- package/dist/runtime/components/AAccountSwitcherModal.d.vue.ts +10 -0
- package/dist/runtime/components/AAccountSwitcherModal.vue +158 -0
- package/dist/runtime/components/AAccountSwitcherModal.vue.d.ts +10 -0
- package/dist/runtime/components/AClaimAccountModal.d.vue.ts +10 -0
- package/dist/runtime/components/AClaimAccountModal.vue +230 -0
- package/dist/runtime/components/AClaimAccountModal.vue.d.ts +10 -0
- package/dist/runtime/components/ACollaborationUsers.vue +1 -0
- package/dist/runtime/components/AColorPicker.vue +4 -2
- package/dist/runtime/components/ACommandPalette.vue +4 -2
- package/dist/runtime/components/AConnectServerModal.d.vue.ts +12 -0
- package/dist/runtime/components/AConnectServerModal.vue +200 -0
- package/dist/runtime/components/AConnectServerModal.vue.d.ts +12 -0
- package/dist/runtime/components/AConnectionStatus.vue +1 -0
- package/dist/runtime/components/ADocPickModal.d.vue.ts +13 -0
- package/dist/runtime/components/ADocPickModal.vue +71 -0
- package/dist/runtime/components/ADocPickModal.vue.d.ts +13 -0
- package/dist/runtime/components/ADocRenderer.d.vue.ts +1 -1
- package/dist/runtime/components/ADocRenderer.vue +6 -0
- package/dist/runtime/components/ADocRenderer.vue.d.ts +1 -1
- package/dist/runtime/components/ADocTypeSelect.vue +4 -3
- package/dist/runtime/components/ADocumentTree.d.vue.ts +3 -3
- package/dist/runtime/components/ADocumentTree.vue +118 -10
- package/dist/runtime/components/ADocumentTree.vue.d.ts +3 -3
- package/dist/runtime/components/AEditor.d.vue.ts +4 -4
- package/dist/runtime/components/AEditor.vue +16 -1
- package/dist/runtime/components/AEditor.vue.d.ts +4 -4
- package/dist/runtime/components/AFloatingWindow.d.vue.ts +54 -2
- package/dist/runtime/components/AFloatingWindow.vue +15 -14
- package/dist/runtime/components/AFloatingWindow.vue.d.ts +54 -2
- package/dist/runtime/components/AIconPicker.vue +2 -0
- package/dist/runtime/components/AInviteRedeemModal.d.vue.ts +10 -0
- package/dist/runtime/components/AInviteRedeemModal.vue +122 -0
- package/dist/runtime/components/AInviteRedeemModal.vue.d.ts +10 -0
- package/dist/runtime/components/ANodePanel.vue +10 -2
- package/dist/runtime/components/ANotifications.vue +3 -1
- package/dist/runtime/components/APermissionGuard.vue +1 -0
- package/dist/runtime/components/APresence.vue +1 -0
- package/dist/runtime/components/AProvider.d.vue.ts +0 -1
- package/dist/runtime/components/AProvider.vue +17 -4
- package/dist/runtime/components/AProvider.vue.d.ts +0 -1
- package/dist/runtime/components/ARoleBadge.vue +1 -0
- package/dist/runtime/components/ASpaceFormModal.d.vue.ts +16 -0
- package/dist/runtime/components/ASpaceFormModal.vue +182 -0
- package/dist/runtime/components/ASpaceFormModal.vue.d.ts +16 -0
- package/dist/runtime/components/AVoiceBar.vue +3 -1
- package/dist/runtime/components/AVoiceTile.vue +1 -0
- package/dist/runtime/components/AWindowLayer.vue +1 -0
- package/dist/runtime/components/aware/AArea.d.vue.ts +1 -1
- package/dist/runtime/components/aware/AArea.vue +2 -1
- package/dist/runtime/components/aware/AArea.vue.d.ts +1 -1
- package/dist/runtime/components/aware/AAvatar.vue +2 -0
- package/dist/runtime/components/aware/AButton.vue +2 -1
- package/dist/runtime/components/aware/ACursorLabel.vue +1 -0
- package/dist/runtime/components/aware/ADocBadge.vue +2 -0
- package/dist/runtime/components/aware/AFacepile.vue +2 -0
- package/dist/runtime/components/aware/AInput.vue +3 -2
- package/dist/runtime/components/aware/ASelect.vue +3 -2
- package/dist/runtime/components/aware/ATextarea.vue +3 -2
- package/dist/runtime/components/aware/AUserList.vue +2 -0
- package/dist/runtime/components/chat/AChatAgentStatus.d.vue.ts +15 -0
- package/dist/runtime/components/chat/AChatAgentStatus.vue +95 -0
- package/dist/runtime/components/chat/AChatAgentStatus.vue.d.ts +15 -0
- package/dist/runtime/components/chat/AChatDocLink.d.vue.ts +18 -0
- package/dist/runtime/components/chat/AChatDocLink.vue +29 -0
- package/dist/runtime/components/chat/AChatDocLink.vue.d.ts +18 -0
- package/dist/runtime/components/chat/AChatDocQuote.d.vue.ts +26 -0
- package/dist/runtime/components/chat/AChatDocQuote.vue +47 -0
- package/dist/runtime/components/chat/AChatDocQuote.vue.d.ts +26 -0
- package/dist/runtime/components/chat/AChatInput.d.vue.ts +45 -0
- package/dist/runtime/components/chat/AChatInput.vue +219 -0
- package/dist/runtime/components/chat/AChatInput.vue.d.ts +45 -0
- package/dist/runtime/components/chat/AChatList.d.vue.ts +59 -0
- package/dist/runtime/components/chat/AChatList.vue +184 -0
- package/dist/runtime/components/chat/AChatList.vue.d.ts +59 -0
- package/dist/runtime/components/chat/AChatMemberList.d.vue.ts +24 -0
- package/dist/runtime/components/chat/AChatMemberList.vue +97 -0
- package/dist/runtime/components/chat/AChatMemberList.vue.d.ts +24 -0
- package/dist/runtime/components/chat/AChatMessages.d.vue.ts +31 -0
- package/dist/runtime/components/chat/AChatMessages.vue +161 -0
- package/dist/runtime/components/chat/AChatMessages.vue.d.ts +31 -0
- package/dist/runtime/components/chat/AChatPanel.d.vue.ts +84 -0
- package/dist/runtime/components/chat/AChatPanel.vue +89 -0
- package/dist/runtime/components/chat/AChatPanel.vue.d.ts +84 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.d.vue.ts +11 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.vue +58 -0
- package/dist/runtime/components/chat/AChatTypingIndicator.vue.d.ts +11 -0
- package/dist/runtime/components/editor/AColorPalettePopover.d.vue.ts +23 -0
- package/dist/runtime/components/editor/AColorPalettePopover.vue +71 -0
- package/dist/runtime/components/editor/AColorPalettePopover.vue.d.ts +23 -0
- package/dist/runtime/components/editor/ADocLinkPopover.d.vue.ts +7 -0
- package/dist/runtime/components/editor/ADocLinkPopover.vue +74 -0
- package/dist/runtime/components/editor/ADocLinkPopover.vue.d.ts +7 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.d.vue.ts +10 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.vue +353 -0
- package/dist/runtime/components/editor/AFileAudioPlayer.vue.d.ts +10 -0
- package/dist/runtime/components/editor/AFileGlbViewer.d.vue.ts +13 -0
- package/dist/runtime/components/editor/AFileGlbViewer.vue +187 -0
- package/dist/runtime/components/editor/AFileGlbViewer.vue.d.ts +13 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.d.vue.ts +7 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.vue +62 -0
- package/dist/runtime/components/editor/AFileVideoPlayer.vue.d.ts +7 -0
- package/dist/runtime/components/editor/ALinkPopover.d.vue.ts +8 -0
- package/dist/runtime/components/editor/ALinkPopover.vue +149 -0
- package/dist/runtime/components/editor/ALinkPopover.vue.d.ts +8 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.d.vue.ts +28 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.vue +232 -0
- package/dist/runtime/components/editor/ALocationPickerPopover.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.d.vue.ts +2 -0
- package/dist/runtime/components/renderers/ACalendarRenderer.vue +207 -327
- package/dist/runtime/components/renderers/ACalendarRenderer.vue.d.ts +2 -0
- package/dist/runtime/components/renderers/ACallRenderer.vue +3 -0
- package/dist/runtime/components/renderers/AChecklistRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ADashboardRenderer.vue +14 -12
- package/dist/runtime/components/renderers/AGalleryRenderer.vue +120 -12
- package/dist/runtime/components/renderers/AGraphRenderer.vue +5 -2
- package/dist/runtime/components/renderers/AKanbanRenderer.vue +21 -5
- package/dist/runtime/components/renderers/AMapRenderer.vue +2 -0
- package/dist/runtime/components/renderers/AMediaRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue +224 -0
- package/dist/runtime/components/renderers/AMediaRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/AOutlineRenderer.vue +1 -0
- package/dist/runtime/components/renderers/ASpatialRenderer.d.vue.ts +19 -0
- package/dist/runtime/components/renderers/ASpatialRenderer.vue +436 -0
- package/dist/runtime/components/renderers/ASpatialRenderer.vue.d.ts +19 -0
- package/dist/runtime/components/renderers/ATableRenderer.vue +65 -45
- package/dist/runtime/components/renderers/ATimelineRenderer.vue +282 -260
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.d.vue.ts +41 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue +109 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayCell.vue.d.ts +41 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.d.vue.ts +49 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue +152 -0
- package/dist/runtime/components/renderers/calendar/ACalendarDayView.vue.d.ts +49 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.d.vue.ts +39 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue +101 -0
- package/dist/runtime/components/renderers/calendar/ACalendarEventChip.vue.d.ts +39 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.d.vue.ts +43 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue +87 -0
- package/dist/runtime/components/renderers/calendar/ACalendarMonthView.vue.d.ts +43 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.d.vue.ts +38 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue +206 -0
- package/dist/runtime/components/renderers/calendar/ACalendarToolbar.vue.d.ts +38 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.d.vue.ts +28 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.vue +33 -0
- package/dist/runtime/components/renderers/calendar/ACalendarUnscheduled.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.d.vue.ts +50 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue +188 -0
- package/dist/runtime/components/renderers/calendar/ACalendarWeekView.vue.d.ts +50 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.d.vue.ts +25 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.vue +115 -0
- package/dist/runtime/components/renderers/media/MediaPlaylist.vue.d.ts +25 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.d.vue.ts +21 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.vue +61 -0
- package/dist/runtime/components/renderers/media/MediaSyncBar.vue.d.ts +21 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.d.vue.ts +22 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.vue +98 -0
- package/dist/runtime/components/renderers/media/MediaTransportBar.vue.d.ts +22 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.d.vue.ts +20 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue +26 -0
- package/dist/runtime/components/renderers/spatial/SpatialGround.vue.d.ts +20 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue +257 -0
- package/dist/runtime/components/renderers/spatial/SpatialObject.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue +18 -0
- package/dist/runtime/components/renderers/spatial/SpatialSceneBridge.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.d.vue.ts +8 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue +53 -0
- package/dist/runtime/components/renderers/spatial/SpatialUserAvatar.vue.d.ts +8 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.d.vue.ts +25 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue +129 -0
- package/dist/runtime/components/renderers/table/ATableColumnHeader.vue.d.ts +25 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.d.vue.ts +21 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.vue +370 -0
- package/dist/runtime/components/renderers/table/ATableFlatMode.vue.d.ts +21 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.d.vue.ts +22 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.vue +106 -0
- package/dist/runtime/components/renderers/table/ATableToolbar.vue.d.ts +22 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.d.vue.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.vue +54 -0
- package/dist/runtime/components/renderers/table/cells/ATableCell.vue.d.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue +67 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellColor.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.vue +91 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellDate.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.d.vue.ts +6 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.vue +30 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMembers.vue.d.ts +6 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.vue +76 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellMultiSelect.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.d.vue.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.vue +54 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellNumber.vue.d.ts +17 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.vue +35 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellRating.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.d.vue.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.vue +111 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSelect.vue.d.ts +18 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.d.vue.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.vue +35 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellSlider.vue.d.ts +16 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.vue +92 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellTags.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.vue +44 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellText.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.d.vue.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.vue +31 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellToggle.vue.d.ts +14 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.d.vue.ts +15 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.vue +63 -0
- package/dist/runtime/components/renderers/table/cells/ATableCellUrl.vue.d.ts +15 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.d.vue.ts +9 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.vue +53 -0
- package/dist/runtime/components/renderers/timeline/ATimelineAxis.vue.d.ts +9 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.d.vue.ts +26 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue +59 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBar.vue.d.ts +26 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.d.vue.ts +28 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue +109 -0
- package/dist/runtime/components/renderers/timeline/ATimelineBarArea.vue.d.ts +28 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.d.vue.ts +43 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue +168 -0
- package/dist/runtime/components/renderers/timeline/ATimelineLabelPanel.vue.d.ts +43 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.d.vue.ts +24 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue +46 -0
- package/dist/runtime/components/renderers/timeline/ATimelineMilestone.vue.d.ts +24 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.d.vue.ts +34 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue +193 -0
- package/dist/runtime/components/renderers/timeline/ATimelineToolbar.vue.d.ts +34 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.vue +159 -0
- package/dist/runtime/components/settings/ASettingsAdminPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.vue +146 -0
- package/dist/runtime/components/settings/ASettingsConnectionPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.vue +157 -0
- package/dist/runtime/components/settings/ASettingsInvitesPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.vue +134 -0
- package/dist/runtime/components/settings/ASettingsMembersPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsModal.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsModal.vue +176 -0
- package/dist/runtime/components/settings/ASettingsModal.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.vue +170 -0
- package/dist/runtime/components/settings/ASettingsOfflinePanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.vue +96 -0
- package/dist/runtime/components/settings/ASettingsPluginsPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.vue +223 -0
- package/dist/runtime/components/settings/ASettingsProfilePanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.vue +312 -0
- package/dist/runtime/components/settings/ASettingsSecurityPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.vue +195 -0
- package/dist/runtime/components/settings/ASettingsSpacesPanel.vue.d.ts +3 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.d.vue.ts +3 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.vue +135 -0
- package/dist/runtime/components/settings/ASettingsTrashPanel.vue.d.ts +3 -0
- package/dist/runtime/components/shell/AChildContextMenu.d.vue.ts +30 -0
- package/dist/runtime/components/shell/AChildContextMenu.vue +48 -0
- package/dist/runtime/components/shell/AChildContextMenu.vue.d.ts +30 -0
- package/dist/runtime/components/shell/ACursorOverlay.d.vue.ts +11 -0
- package/dist/runtime/components/shell/ACursorOverlay.vue +55 -0
- package/dist/runtime/components/shell/ACursorOverlay.vue.d.ts +11 -0
- package/dist/runtime/components/shell/ADocDragGhost.d.vue.ts +3 -0
- package/dist/runtime/components/shell/ADocDragGhost.vue +58 -0
- package/dist/runtime/components/shell/ADocDragGhost.vue.d.ts +3 -0
- package/dist/runtime/components/shell/ADocPanelSettings.d.vue.ts +111 -0
- package/dist/runtime/components/shell/ADocPanelSettings.vue +621 -0
- package/dist/runtime/components/shell/ADocPanelSettings.vue.d.ts +111 -0
- package/dist/runtime/components/shell/AFavoritesList.d.vue.ts +27 -0
- package/dist/runtime/components/shell/AFavoritesList.vue +83 -0
- package/dist/runtime/components/shell/AFavoritesList.vue.d.ts +27 -0
- package/dist/runtime/components/shell/ANodeContextMenu.d.vue.ts +17 -0
- package/dist/runtime/components/shell/ANodeContextMenu.vue +14 -0
- package/dist/runtime/components/shell/ANodeContextMenu.vue.d.ts +17 -0
- package/dist/runtime/components/shell/ASidebar.d.vue.ts +54 -0
- package/dist/runtime/components/shell/ASidebar.vue +92 -0
- package/dist/runtime/components/shell/ASidebar.vue.d.ts +54 -0
- package/dist/runtime/components/shell/ASidebarToggle.d.vue.ts +7 -0
- package/dist/runtime/components/shell/ASidebarToggle.vue +23 -0
- package/dist/runtime/components/shell/ASidebarToggle.vue.d.ts +7 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.d.vue.ts +32 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.vue +63 -0
- package/dist/runtime/components/shell/ASpaceSwitcher.vue.d.ts +32 -0
- package/dist/runtime/components/shell/ASyncStatus.d.vue.ts +25 -0
- package/dist/runtime/components/shell/ASyncStatus.vue +96 -0
- package/dist/runtime/components/shell/ASyncStatus.vue.d.ts +25 -0
- package/dist/runtime/components/shell/AUserMenu.d.vue.ts +28 -0
- package/dist/runtime/components/shell/AUserMenu.vue +79 -0
- package/dist/runtime/components/shell/AUserMenu.vue.d.ts +28 -0
- package/dist/runtime/components/shell/AUserProfilePopover.d.vue.ts +54 -0
- package/dist/runtime/components/shell/AUserProfilePopover.vue +176 -0
- package/dist/runtime/components/shell/AUserProfilePopover.vue.d.ts +54 -0
- package/dist/runtime/components/shell/AWelcomeScreen.d.vue.ts +96 -0
- package/dist/runtime/components/shell/AWelcomeScreen.vue +422 -0
- package/dist/runtime/components/shell/AWelcomeScreen.vue.d.ts +96 -0
- package/dist/runtime/composables/useAAField.js +2 -0
- package/dist/runtime/composables/useAbraLocale.js +1 -0
- package/dist/runtime/composables/useAbracadabra.js +1 -0
- package/dist/runtime/composables/useAbracadabraAuth.d.ts +3 -4
- package/dist/runtime/composables/useAbracadabraAuth.js +4 -0
- package/dist/runtime/composables/useAwareness.js +1 -0
- package/dist/runtime/composables/useAwarenessPeers.js +1 -0
- package/dist/runtime/composables/useBackgroundSync.d.ts +5 -0
- package/dist/runtime/composables/useBackgroundSync.js +24 -3
- package/dist/runtime/composables/useCalendarView.d.ts +86 -0
- package/dist/runtime/composables/useCalendarView.js +316 -0
- package/dist/runtime/composables/useChat.d.ts +2 -1
- package/dist/runtime/composables/useChat.js +17 -10
- package/dist/runtime/composables/useChatUsers.js +1 -0
- package/dist/runtime/composables/useChildTree.d.ts +4 -2
- package/dist/runtime/composables/useChildTree.js +31 -21
- package/dist/runtime/composables/useCommandPalette.js +16 -17
- package/dist/runtime/composables/useConnectionStatus.d.ts +1 -1
- package/dist/runtime/composables/useConnectionStatus.js +1 -1
- package/dist/runtime/composables/useCrossWindowSync.d.ts +11 -0
- package/dist/runtime/composables/useCrossWindowSync.js +38 -0
- package/dist/runtime/composables/useDashboard.js +17 -9
- package/dist/runtime/composables/useDevicePairing.js +2 -0
- package/dist/runtime/composables/useDocDragBus.d.ts +28 -0
- package/dist/runtime/composables/useDocDragBus.js +22 -0
- package/dist/runtime/composables/useDocDropZone.d.ts +51 -0
- package/dist/runtime/composables/useDocDropZone.js +84 -0
- package/dist/runtime/composables/useDocExport.js +2 -0
- package/dist/runtime/composables/useDocImport.js +1 -0
- package/dist/runtime/composables/useDocLabels.d.ts +22 -0
- package/dist/runtime/composables/useDocLabels.js +11 -0
- package/dist/runtime/composables/useDocLinkPick.d.ts +18 -0
- package/dist/runtime/composables/useDocLinkPick.js +22 -0
- package/dist/runtime/composables/useDocSeo.js +3 -2
- package/dist/runtime/composables/useDocSlugs.js +3 -0
- package/dist/runtime/composables/useDocTree.d.ts +1 -0
- package/dist/runtime/composables/useDocTree.js +6 -2
- package/dist/runtime/composables/useEditor.js +1 -0
- package/dist/runtime/composables/useEditorDragHandle.js +2 -0
- package/dist/runtime/composables/useEditorEmojis.d.ts +22 -0
- package/dist/runtime/composables/useEditorEmojis.js +57 -0
- package/dist/runtime/composables/useEditorMentions.d.ts +10 -3
- package/dist/runtime/composables/useEditorMentions.js +31 -3
- package/dist/runtime/composables/useEditorSuggestions.d.ts +2 -2
- package/dist/runtime/composables/useEditorSuggestions.js +27 -19
- package/dist/runtime/composables/useEditorToolbar.d.ts +1 -1
- package/dist/runtime/composables/useEditorToolbar.js +3 -0
- package/dist/runtime/composables/useFavorites.d.ts +13 -0
- package/dist/runtime/composables/useFavorites.js +42 -0
- package/dist/runtime/composables/useFileIndex.js +2 -0
- package/dist/runtime/composables/useFileTransfer.js +13 -1
- package/dist/runtime/composables/useFollowUser.js +2 -0
- package/dist/runtime/composables/useIdentityDoc.d.ts +89 -0
- package/dist/runtime/composables/useIdentityDoc.js +349 -0
- package/dist/runtime/composables/useInstalledPlugins.d.ts +31 -0
- package/dist/runtime/composables/useInstalledPlugins.js +58 -0
- package/dist/runtime/composables/useInvites.js +1 -0
- package/dist/runtime/composables/useJoinLink.d.ts +25 -0
- package/dist/runtime/composables/useJoinLink.js +58 -0
- package/dist/runtime/composables/useMediaExtractor.d.ts +31 -0
- package/dist/runtime/composables/useMediaExtractor.js +46 -0
- package/dist/runtime/composables/useMediaPlayback.d.ts +43 -0
- package/dist/runtime/composables/useMediaPlayback.js +465 -0
- package/dist/runtime/composables/useNodeContextMenu.d.ts +26 -0
- package/dist/runtime/composables/useNodeContextMenu.js +99 -0
- package/dist/runtime/composables/useNodePanel.d.ts +7 -1
- package/dist/runtime/composables/useNodePanel.js +45 -8
- package/dist/runtime/composables/useNodePanelFollow.d.ts +2 -0
- package/dist/runtime/composables/useNodePanelFollow.js +37 -0
- package/dist/runtime/composables/useNotifications.d.ts +1 -0
- package/dist/runtime/composables/useNotifications.js +7 -2
- package/dist/runtime/composables/usePluginRegistry.js +1 -0
- package/dist/runtime/composables/useRendererBase.d.ts +16 -1
- package/dist/runtime/composables/useRendererBase.js +10 -1
- package/dist/runtime/composables/useSearchIndex.js +2 -0
- package/dist/runtime/composables/useSettingsModal.d.ts +18 -0
- package/dist/runtime/composables/useSettingsModal.js +30 -0
- package/dist/runtime/composables/useSlideoverSwipe.d.ts +39 -0
- package/dist/runtime/composables/useSlideoverSwipe.js +48 -0
- package/dist/runtime/composables/useSlugRoute.js +2 -0
- package/dist/runtime/composables/useSpaces.js +2 -0
- package/dist/runtime/composables/useSpatialCamera.d.ts +16 -0
- package/dist/runtime/composables/useSpatialCamera.js +175 -0
- package/dist/runtime/composables/useSpatialDrag.d.ts +14 -0
- package/dist/runtime/composables/useSpatialDrag.js +137 -0
- package/dist/runtime/composables/useTableView.d.ts +29 -0
- package/dist/runtime/composables/useTableView.js +184 -0
- package/dist/runtime/composables/useTimelineView.d.ts +55 -0
- package/dist/runtime/composables/useTimelineView.js +434 -0
- package/dist/runtime/composables/useTiptapDragState.d.ts +8 -0
- package/dist/runtime/composables/useTiptapDragState.js +5 -0
- package/dist/runtime/composables/useTouchDrag.d.ts +2 -0
- package/dist/runtime/composables/useTouchDrag.js +3 -0
- package/dist/runtime/composables/useTrash.d.ts +4 -0
- package/dist/runtime/composables/useTrash.js +6 -3
- package/dist/runtime/composables/useTreeUndoManager.d.ts +22 -0
- package/dist/runtime/composables/useTreeUndoManager.js +45 -0
- package/dist/runtime/composables/useUndoRedo.d.ts +37 -0
- package/dist/runtime/composables/useUndoRedo.js +115 -0
- package/dist/runtime/composables/useVoice.js +2 -0
- package/dist/runtime/composables/useWebRTC.js +2 -0
- package/dist/runtime/composables/useWindowManager.d.ts +2 -0
- package/dist/runtime/composables/useWindowManager.js +63 -1
- package/dist/runtime/extensions/code-preview.d.ts +2 -0
- package/dist/runtime/extensions/code-preview.js +17 -0
- package/dist/runtime/extensions/code-tree.d.ts +2 -0
- package/dist/runtime/extensions/code-tree.js +33 -0
- package/dist/runtime/extensions/doc-embed.d.ts +12 -0
- package/dist/runtime/extensions/doc-embed.js +63 -0
- package/dist/runtime/extensions/doc-link-drop.d.ts +3 -0
- package/dist/runtime/extensions/doc-link-drop.js +63 -0
- package/dist/runtime/extensions/document-header.js +1 -1
- package/dist/runtime/extensions/field.d.ts +3 -0
- package/dist/runtime/extensions/field.js +53 -0
- package/dist/runtime/extensions/mention-drop.d.ts +8 -0
- package/dist/runtime/extensions/mention-drop.js +47 -0
- package/dist/runtime/extensions/meta-field.js +2 -0
- package/dist/runtime/extensions/selection-drag.d.ts +13 -0
- package/dist/runtime/extensions/selection-drag.js +126 -0
- package/dist/runtime/extensions/views/AccordionItemView.vue +1 -0
- package/dist/runtime/extensions/views/BadgeView.vue +1 -0
- package/dist/runtime/extensions/views/CardView.vue +1 -0
- package/dist/runtime/extensions/views/CodeCollapseView.vue +1 -0
- package/dist/runtime/extensions/views/CodeGroupView.vue +1 -0
- package/dist/runtime/extensions/views/CodePreviewView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodePreviewView.vue +48 -0
- package/dist/runtime/extensions/views/CodePreviewView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CodeTreeView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/CodeTreeView.vue +88 -0
- package/dist/runtime/extensions/views/CodeTreeView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/CollapsibleView.vue +1 -0
- package/dist/runtime/extensions/views/DocEmbedView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/DocEmbedView.vue +198 -0
- package/dist/runtime/extensions/views/DocEmbedView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FieldGroupView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FieldGroupView.vue +25 -0
- package/dist/runtime/extensions/views/FieldGroupView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FieldView.d.vue.ts +4 -0
- package/dist/runtime/extensions/views/FieldView.vue +53 -0
- package/dist/runtime/extensions/views/FieldView.vue.d.ts +4 -0
- package/dist/runtime/extensions/views/FileNodeView.vue +2 -0
- package/dist/runtime/extensions/views/KbdView.vue +1 -0
- package/dist/runtime/extensions/views/MetaFieldView.vue +68 -2
- package/dist/runtime/extensions/views/ProseIconView.vue +1 -0
- package/dist/runtime/extensions/views/StepsView.vue +1 -0
- package/dist/runtime/extensions/views/TabsView.vue +1 -0
- package/dist/runtime/locale.d.ts +65 -0
- package/dist/runtime/locale.js +67 -2
- package/dist/runtime/middleware/abracadabra-auth.d.ts +1 -10
- package/dist/runtime/middleware/abracadabra-auth.js +2 -0
- package/dist/runtime/plugin-abracadabra.client.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.client.js +99 -53
- package/dist/runtime/plugin-abracadabra.server.d.ts +1 -1
- package/dist/runtime/plugin-abracadabra.server.js +2 -0
- package/dist/runtime/plugin-shared-globals.client.d.ts +1 -1
- package/dist/runtime/plugin-shared-globals.client.js +1 -0
- package/dist/runtime/plugins/core.plugin.js +40 -4
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.d.ts +19 -17
- package/dist/runtime/server/api/_abracadabra/render/[docId].get.js +4 -0
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.d.ts +11 -1
- package/dist/runtime/server/api/_abracadabra/resolve/[...slug].get.js +1 -0
- package/dist/runtime/server/api/_abracadabra/slugs.get.js +1 -0
- package/dist/runtime/server/api/_abracadabra/spaces.get.d.ts +1 -10
- package/dist/runtime/server/api/_abracadabra/spaces.get.js +3 -0
- package/dist/runtime/server/plugins/abracadabra-service.js +24 -12
- package/dist/runtime/server/utils/docCache.d.ts +8 -6
- package/dist/runtime/server/utils/docCache.js +3 -3
- package/dist/runtime/server/utils/serverPluginLoader.d.ts +20 -0
- package/dist/runtime/server/utils/serverPluginLoader.js +42 -0
- package/dist/runtime/server/utils/serverRunner.d.ts +11 -2
- package/dist/runtime/server/utils/serverRunner.js +21 -10
- package/dist/runtime/server/utils/spaceManager.d.ts +25 -0
- package/dist/runtime/server/utils/spaceManager.js +188 -0
- package/dist/runtime/types.d.ts +128 -30
- package/dist/runtime/types.js +17 -17
- package/dist/runtime/utils/chatContent.d.ts +41 -0
- package/dist/runtime/utils/chatContent.js +65 -0
- package/dist/runtime/utils/colorPalettes.js +12 -6
- package/dist/runtime/utils/coverCache.d.ts +12 -0
- package/dist/runtime/utils/coverCache.js +14 -0
- package/dist/runtime/utils/docReferenceEdges.d.ts +26 -0
- package/dist/runtime/utils/docReferenceEdges.js +122 -0
- package/dist/runtime/utils/docTypes.d.ts +6 -1
- package/dist/runtime/utils/duplicateDocContent.d.ts +19 -0
- package/dist/runtime/utils/duplicateDocContent.js +68 -0
- package/dist/runtime/utils/extractFileMetadata.d.ts +13 -0
- package/dist/runtime/utils/extractFileMetadata.js +94 -0
- package/dist/runtime/utils/getMetaColor.d.ts +6 -0
- package/dist/runtime/utils/getMetaColor.js +12 -0
- package/dist/runtime/utils/htmlToYjs.d.ts +19 -0
- package/dist/runtime/utils/htmlToYjs.js +235 -0
- package/dist/runtime/utils/markdownToYjs.js +3 -3
- package/dist/runtime/utils/metaFieldDefinitions.js +9 -0
- package/dist/runtime/utils/notificationRenderers.d.ts +13 -0
- package/dist/runtime/utils/notificationRenderers.js +41 -0
- package/dist/runtime/utils/sdkRef.d.ts +12 -2
- package/dist/types.d.mts +12 -0
- package/package.json +26 -27
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { ref, computed, watch, onUnmounted } from "vue";
|
|
2
|
+
import * as Y from "yjs";
|
|
3
|
+
const DOC_LINK_RE = /^\/doc\/([\w-]+)/;
|
|
4
|
+
export function scanDocReferences(fragment) {
|
|
5
|
+
const refs = [];
|
|
6
|
+
function walk(el) {
|
|
7
|
+
for (const child of el.toArray()) {
|
|
8
|
+
if (child instanceof Y.XmlText) {
|
|
9
|
+
for (const delta of child.toDelta()) {
|
|
10
|
+
const href = delta.attributes?.link?.href;
|
|
11
|
+
if (href) {
|
|
12
|
+
const m = DOC_LINK_RE.exec(href);
|
|
13
|
+
if (m) refs.push(m[1]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
} else if (child instanceof Y.XmlElement) {
|
|
17
|
+
if (child.nodeName === "docEmbed") {
|
|
18
|
+
const docId = child.getAttribute("docId");
|
|
19
|
+
if (docId) refs.push(docId);
|
|
20
|
+
}
|
|
21
|
+
walk(child);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
walk(fragment);
|
|
26
|
+
return refs;
|
|
27
|
+
}
|
|
28
|
+
export function useDocReferenceEdges(childProviderRef, allEntries) {
|
|
29
|
+
const refMap = ref(/* @__PURE__ */ new Map());
|
|
30
|
+
const observers = /* @__PURE__ */ new Map();
|
|
31
|
+
const loaded = /* @__PURE__ */ new Set();
|
|
32
|
+
const debounceTimers = /* @__PURE__ */ new Map();
|
|
33
|
+
let destroyed = false;
|
|
34
|
+
function scanAndStore(docId, fragment) {
|
|
35
|
+
const refs = scanDocReferences(fragment);
|
|
36
|
+
const prev = refMap.value.get(docId);
|
|
37
|
+
if (!prev || prev.length !== refs.length || prev.some((r, i) => r !== refs[i])) {
|
|
38
|
+
const next = new Map(refMap.value);
|
|
39
|
+
next.set(docId, refs);
|
|
40
|
+
refMap.value = next;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function observeFragment(docId, fragment) {
|
|
44
|
+
const handler = () => {
|
|
45
|
+
const existing = debounceTimers.get(docId);
|
|
46
|
+
if (existing) clearTimeout(existing);
|
|
47
|
+
debounceTimers.set(docId, setTimeout(() => {
|
|
48
|
+
debounceTimers.delete(docId);
|
|
49
|
+
if (!destroyed) scanAndStore(docId, fragment);
|
|
50
|
+
}, 500));
|
|
51
|
+
};
|
|
52
|
+
fragment.observeDeep(handler);
|
|
53
|
+
observers.set(docId, () => fragment.unobserveDeep(handler));
|
|
54
|
+
}
|
|
55
|
+
async function loadBatch(ids) {
|
|
56
|
+
const provider = childProviderRef.value;
|
|
57
|
+
if (!provider) return;
|
|
58
|
+
for (let i = 0; i < ids.length; i += 5) {
|
|
59
|
+
if (destroyed) return;
|
|
60
|
+
const batch = ids.slice(i, i + 5);
|
|
61
|
+
await Promise.all(batch.map(async (id) => {
|
|
62
|
+
if (loaded.has(id) || destroyed) return;
|
|
63
|
+
loaded.add(id);
|
|
64
|
+
try {
|
|
65
|
+
const childProv = await provider.loadChild(id);
|
|
66
|
+
if (destroyed) return;
|
|
67
|
+
const doc = childProv.document;
|
|
68
|
+
const fragment = doc.getXmlFragment("default");
|
|
69
|
+
scanAndStore(id, fragment);
|
|
70
|
+
observeFragment(id, fragment);
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
if (i + 5 < ids.length) {
|
|
75
|
+
await new Promise((r) => setTimeout(r, 0));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
watch(allEntries, (entries) => {
|
|
80
|
+
const entryIds = new Set(entries.map((e) => e.id));
|
|
81
|
+
for (const [id, cleanup] of observers) {
|
|
82
|
+
if (!entryIds.has(id)) {
|
|
83
|
+
cleanup();
|
|
84
|
+
observers.delete(id);
|
|
85
|
+
loaded.delete(id);
|
|
86
|
+
const timer = debounceTimers.get(id);
|
|
87
|
+
if (timer) {
|
|
88
|
+
clearTimeout(timer);
|
|
89
|
+
debounceTimers.delete(id);
|
|
90
|
+
}
|
|
91
|
+
if (refMap.value.has(id)) {
|
|
92
|
+
const next = new Map(refMap.value);
|
|
93
|
+
next.delete(id);
|
|
94
|
+
refMap.value = next;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const toLoad = entries.map((e) => e.id).filter((id) => !loaded.has(id));
|
|
99
|
+
if (toLoad.length > 0) loadBatch(toLoad);
|
|
100
|
+
}, { immediate: true });
|
|
101
|
+
onUnmounted(() => {
|
|
102
|
+
destroyed = true;
|
|
103
|
+
for (const cleanup of observers.values()) cleanup();
|
|
104
|
+
observers.clear();
|
|
105
|
+
for (const timer of debounceTimers.values()) clearTimeout(timer);
|
|
106
|
+
debounceTimers.clear();
|
|
107
|
+
});
|
|
108
|
+
const edges = computed(() => {
|
|
109
|
+
const entryIds = new Set(allEntries.value.map((e) => e.id));
|
|
110
|
+
const result = [];
|
|
111
|
+
for (const [sourceId, targetIds] of refMap.value) {
|
|
112
|
+
if (!entryIds.has(sourceId)) continue;
|
|
113
|
+
for (const targetId of targetIds) {
|
|
114
|
+
if (entryIds.has(targetId) && targetId !== sourceId) {
|
|
115
|
+
result.push({ source: sourceId, target: targetId });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
});
|
|
121
|
+
return edges;
|
|
122
|
+
}
|
|
@@ -120,7 +120,12 @@ export interface IconField {
|
|
|
120
120
|
options: string[];
|
|
121
121
|
label?: string;
|
|
122
122
|
}
|
|
123
|
-
export
|
|
123
|
+
export interface MembersField {
|
|
124
|
+
type: 'members';
|
|
125
|
+
key: string;
|
|
126
|
+
label?: string;
|
|
127
|
+
}
|
|
128
|
+
export type MetaField = DatetimeRangeField | DateRangeField | TimeRangeField | DatetimeField | DateField | TimeField | SliderField | ColorPresetField | ColorPickerField | LocationField | IconField | TextareaField | NumberField | ToggleField | SelectField | MultiSelectField | UrlField | RatingField | TagsField | MembersField;
|
|
124
129
|
export interface DocTypeDefinition {
|
|
125
130
|
key: string;
|
|
126
131
|
label: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface DupEntry {
|
|
2
|
+
label: string;
|
|
3
|
+
parentId: string | null;
|
|
4
|
+
order: number;
|
|
5
|
+
type?: string;
|
|
6
|
+
meta?: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Deep-duplicate a document and all its descendants.
|
|
10
|
+
*
|
|
11
|
+
* @param provider The provider whose `loadChild` can reach every doc being copied.
|
|
12
|
+
* @param sourceId ID of the root document to duplicate.
|
|
13
|
+
* @param treeData Snapshot of the flat tree map (all entries).
|
|
14
|
+
* @param setEntry Callback to write a new entry into the CRDT map.
|
|
15
|
+
* @returns The new ID assigned to the duplicated root document.
|
|
16
|
+
*/
|
|
17
|
+
export declare function duplicateDocTree(provider: any, sourceId: string, treeData: Record<string, DupEntry>, setEntry: (id: string, entry: DupEntry) => void): Promise<string>;
|
|
18
|
+
/** Single-doc content copy. */
|
|
19
|
+
export declare const duplicateDocContent: (parentProvider: any, sourceId: string, destId: string) => Promise<void>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import * as Y from "yjs";
|
|
2
|
+
async function copyYDoc(parentProvider, sourceId, destId) {
|
|
3
|
+
const srcProv = await parentProvider.loadChild(sourceId);
|
|
4
|
+
if (!srcProv.isSynced) {
|
|
5
|
+
await new Promise((resolve) => {
|
|
6
|
+
const done = () => {
|
|
7
|
+
srcProv.off("synced", done);
|
|
8
|
+
resolve();
|
|
9
|
+
};
|
|
10
|
+
srcProv.on("synced", done);
|
|
11
|
+
setTimeout(resolve, 6e3);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const state = Y.encodeStateAsUpdate(srcProv.document);
|
|
15
|
+
const dstProv = await parentProvider.loadChild(destId);
|
|
16
|
+
if (!dstProv.isSynced) {
|
|
17
|
+
await new Promise((resolve) => {
|
|
18
|
+
const done = () => {
|
|
19
|
+
dstProv.off("synced", done);
|
|
20
|
+
resolve();
|
|
21
|
+
};
|
|
22
|
+
dstProv.on("synced", done);
|
|
23
|
+
setTimeout(resolve, 6e3);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
Y.applyUpdate(dstProv.document, state);
|
|
27
|
+
}
|
|
28
|
+
export async function duplicateDocTree(provider, sourceId, treeData, setEntry) {
|
|
29
|
+
const sourceEntry = treeData[sourceId];
|
|
30
|
+
if (!sourceEntry) return sourceId;
|
|
31
|
+
const allIds = [];
|
|
32
|
+
const queue = [sourceId];
|
|
33
|
+
while (queue.length) {
|
|
34
|
+
const current = queue.shift();
|
|
35
|
+
allIds.push(current);
|
|
36
|
+
for (const [id, entry] of Object.entries(treeData)) {
|
|
37
|
+
if (entry.parentId === current) queue.push(id);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const idMap = /* @__PURE__ */ new Map();
|
|
41
|
+
for (const id of allIds) idMap.set(id, crypto.randomUUID());
|
|
42
|
+
const newRootId = idMap.get(sourceId);
|
|
43
|
+
for (const id of allIds) {
|
|
44
|
+
const entry = treeData[id];
|
|
45
|
+
if (!entry) continue;
|
|
46
|
+
const newId = idMap.get(id);
|
|
47
|
+
const isRoot = id === sourceId;
|
|
48
|
+
const newParentId = isRoot ? entry.parentId : idMap.get(entry.parentId) ?? entry.parentId;
|
|
49
|
+
setEntry(newId, {
|
|
50
|
+
...entry,
|
|
51
|
+
label: isRoot ? `${entry.label || "Untitled"} (copy)` : entry.label,
|
|
52
|
+
parentId: newParentId,
|
|
53
|
+
order: isRoot ? Date.now() : entry.order
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
await Promise.all(
|
|
57
|
+
allIds.map(async (id) => {
|
|
58
|
+
const newId = idMap.get(id);
|
|
59
|
+
try {
|
|
60
|
+
await copyYDoc(provider, id, newId);
|
|
61
|
+
} catch (e) {
|
|
62
|
+
console.warn(`duplicateDocTree: failed to copy YDoc ${id} \u2192 ${newId}:`, e);
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
);
|
|
66
|
+
return newRootId;
|
|
67
|
+
}
|
|
68
|
+
export const duplicateDocContent = (parentProvider, sourceId, destId) => copyYDoc(parentProvider, sourceId, destId);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extracts metadata from image/audio/video files.
|
|
3
|
+
* EXIF for images (GPS, camera info), ID3/Vorbis for audio, dimensions for video.
|
|
4
|
+
* All peer dependencies (exifr, music-metadata) are optional — gracefully degrades.
|
|
5
|
+
*
|
|
6
|
+
* Ported from cou-sh/app/utils/extractFileMetadata.ts
|
|
7
|
+
*/
|
|
8
|
+
import type { DocPageMeta } from '../types.js';
|
|
9
|
+
interface ExtractedMeta extends Partial<DocPageMeta> {
|
|
10
|
+
_extractedTitle?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function extractFileMetadata(file: File): Promise<ExtractedMeta>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export async function extractFileMetadata(file) {
|
|
2
|
+
const mt = file.type || "";
|
|
3
|
+
if (mt.startsWith("image/")) return extractImageMeta(file);
|
|
4
|
+
if (mt.startsWith("audio/")) return extractAudioMeta(file);
|
|
5
|
+
if (mt.startsWith("video/")) return extractVideoMeta(file);
|
|
6
|
+
return {};
|
|
7
|
+
}
|
|
8
|
+
async function extractImageMeta(file) {
|
|
9
|
+
const meta = {};
|
|
10
|
+
try {
|
|
11
|
+
const exifrModule = await import("exifr");
|
|
12
|
+
const exifr = exifrModule.default || exifrModule;
|
|
13
|
+
const exif = await exifr.parse(file, { gps: true, tiff: true, exif: true, ifd0: true });
|
|
14
|
+
if (exif) {
|
|
15
|
+
if (exif.latitude != null && exif.longitude != null) {
|
|
16
|
+
meta.geoLat = exif.latitude;
|
|
17
|
+
meta.geoLng = exif.longitude;
|
|
18
|
+
}
|
|
19
|
+
if (exif.DateTimeOriginal instanceof Date) {
|
|
20
|
+
meta.dateTaken = exif.DateTimeOriginal.toISOString();
|
|
21
|
+
}
|
|
22
|
+
const make = exif.Make?.trim();
|
|
23
|
+
const model = exif.Model?.trim();
|
|
24
|
+
if (make && model) meta.mediaCamera = model.startsWith(make) ? model : `${make} ${model}`;
|
|
25
|
+
else if (model) meta.mediaCamera = model;
|
|
26
|
+
if (exif.LensModel) meta.mediaLens = exif.LensModel;
|
|
27
|
+
if (exif.ISO != null) meta.mediaIso = exif.ISO;
|
|
28
|
+
if (exif.FocalLength != null) meta.mediaFocalLength = exif.FocalLength;
|
|
29
|
+
if (exif.FNumber != null) meta.mediaAperture = exif.FNumber;
|
|
30
|
+
if (exif.ExposureTime != null) {
|
|
31
|
+
meta.mediaShutterSpeed = exif.ExposureTime < 1 ? `1/${Math.round(1 / exif.ExposureTime)}` : `${exif.ExposureTime}s`;
|
|
32
|
+
}
|
|
33
|
+
if (exif.Artist) meta.mediaArtist = exif.Artist;
|
|
34
|
+
if (exif.ImageWidth) meta.mediaWidth = exif.ImageWidth;
|
|
35
|
+
if (exif.ImageHeight) meta.mediaHeight = exif.ImageHeight;
|
|
36
|
+
}
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
if (!meta.mediaWidth || !meta.mediaHeight) {
|
|
40
|
+
try {
|
|
41
|
+
const bmp = await createImageBitmap(file);
|
|
42
|
+
meta.mediaWidth = bmp.width;
|
|
43
|
+
meta.mediaHeight = bmp.height;
|
|
44
|
+
bmp.close();
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return meta;
|
|
49
|
+
}
|
|
50
|
+
async function extractAudioMeta(file) {
|
|
51
|
+
const meta = {};
|
|
52
|
+
try {
|
|
53
|
+
const { parseBlob } = await import("music-metadata");
|
|
54
|
+
const mm = await Promise.race([
|
|
55
|
+
parseBlob(file),
|
|
56
|
+
new Promise(
|
|
57
|
+
(_, reject) => setTimeout(() => reject(new Error("Audio metadata timeout")), 5e3)
|
|
58
|
+
)
|
|
59
|
+
]);
|
|
60
|
+
if (mm.common.title) meta._extractedTitle = mm.common.title;
|
|
61
|
+
if (mm.common.artist) meta.mediaArtist = mm.common.artist;
|
|
62
|
+
if (mm.common.album) meta.mediaAlbum = mm.common.album;
|
|
63
|
+
if (mm.common.year) meta.mediaYear = mm.common.year;
|
|
64
|
+
if (mm.common.genre?.length) meta.mediaGenre = mm.common.genre[0];
|
|
65
|
+
if (mm.format.duration) meta.mediaDuration = Math.round(mm.format.duration);
|
|
66
|
+
} catch {
|
|
67
|
+
}
|
|
68
|
+
return meta;
|
|
69
|
+
}
|
|
70
|
+
async function extractVideoMeta(file) {
|
|
71
|
+
const meta = {};
|
|
72
|
+
try {
|
|
73
|
+
const url = URL.createObjectURL(file);
|
|
74
|
+
try {
|
|
75
|
+
const video = document.createElement("video");
|
|
76
|
+
video.preload = "metadata";
|
|
77
|
+
video.src = url;
|
|
78
|
+
await new Promise((resolve, reject) => {
|
|
79
|
+
video.onloadedmetadata = () => resolve();
|
|
80
|
+
video.onerror = () => reject(new Error("Failed to load video metadata"));
|
|
81
|
+
setTimeout(() => resolve(), 5e3);
|
|
82
|
+
});
|
|
83
|
+
if (video.duration && Number.isFinite(video.duration)) {
|
|
84
|
+
meta.mediaDuration = Math.round(video.duration);
|
|
85
|
+
}
|
|
86
|
+
if (video.videoWidth) meta.mediaWidth = video.videoWidth;
|
|
87
|
+
if (video.videoHeight) meta.mediaHeight = video.videoHeight;
|
|
88
|
+
} finally {
|
|
89
|
+
URL.revokeObjectURL(url);
|
|
90
|
+
}
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
return meta;
|
|
94
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DocPageMeta } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts a color string from document metadata.
|
|
4
|
+
* Checks `meta.color` first, then scans user-defined color fields.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getMetaColor(meta: DocPageMeta | undefined): string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getMetaColor(meta) {
|
|
2
|
+
if (!meta) return void 0;
|
|
3
|
+
if (typeof meta.color === "string" && meta.color) return meta.color;
|
|
4
|
+
const userColorField = meta._metaFields?.find(
|
|
5
|
+
(f) => (f.type === "colorPreset" || f.type === "colorPicker") && f.key
|
|
6
|
+
);
|
|
7
|
+
if (userColorField?.key) {
|
|
8
|
+
const val = meta[userColorField.key];
|
|
9
|
+
if (typeof val === "string" && val) return val;
|
|
10
|
+
}
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML → Y.js converter.
|
|
3
|
+
*
|
|
4
|
+
* Uses DOMParser to parse HTML, then walks the DOM tree and writes
|
|
5
|
+
* TipTap-compatible Y.XmlElement nodes into the fragment.
|
|
6
|
+
*
|
|
7
|
+
* Ported from cou-sh/app/utils/htmlToYjs.ts.
|
|
8
|
+
*/
|
|
9
|
+
import * as Y from 'yjs';
|
|
10
|
+
/**
|
|
11
|
+
* Parses an HTML string and writes the result into a Y.XmlFragment that
|
|
12
|
+
* TipTap's Collaboration extension can read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function populateYDocFromHtml(fragment: Y.XmlFragment, html: string, fallbackTitle?: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Appends blocks from an HTML string to an existing Y.XmlFragment.
|
|
17
|
+
* Does NOT insert documentHeader/documentMeta.
|
|
18
|
+
*/
|
|
19
|
+
export declare function appendHtmlToFragment(fragment: Y.XmlFragment, html: string): void;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import * as Y from "yjs";
|
|
2
|
+
function langFromClass(el) {
|
|
3
|
+
for (const cls of el.classList) {
|
|
4
|
+
if (cls.startsWith("language-")) return cls.slice(9);
|
|
5
|
+
}
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
function mergeMarks(stack) {
|
|
9
|
+
const merged = {};
|
|
10
|
+
for (const m of stack) {
|
|
11
|
+
if (m.bold) merged.bold = true;
|
|
12
|
+
if (m.italic) merged.italic = true;
|
|
13
|
+
if (m.code) merged.code = true;
|
|
14
|
+
if (m.strike) merged.strike = true;
|
|
15
|
+
if (m.link) merged.link = m.link;
|
|
16
|
+
}
|
|
17
|
+
return merged;
|
|
18
|
+
}
|
|
19
|
+
function collectInlineRuns(node, markStack) {
|
|
20
|
+
const runs = [];
|
|
21
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
22
|
+
const text = node.textContent ?? "";
|
|
23
|
+
if (text) runs.push({ text, marks: mergeMarks(markStack) });
|
|
24
|
+
return runs;
|
|
25
|
+
}
|
|
26
|
+
if (node.nodeType !== Node.ELEMENT_NODE) return runs;
|
|
27
|
+
const el = node;
|
|
28
|
+
const tag = el.tagName.toLowerCase();
|
|
29
|
+
const newMarks = {};
|
|
30
|
+
if (tag === "strong" || tag === "b") newMarks.bold = true;
|
|
31
|
+
if (tag === "em" || tag === "i") newMarks.italic = true;
|
|
32
|
+
if (tag === "code") newMarks.code = true;
|
|
33
|
+
if (tag === "s" || tag === "del" || tag === "strike") newMarks.strike = true;
|
|
34
|
+
if (tag === "a") {
|
|
35
|
+
const href = el.getAttribute("href");
|
|
36
|
+
if (href) newMarks.link = { href };
|
|
37
|
+
}
|
|
38
|
+
const nextStack = Object.keys(newMarks).length ? [...markStack, newMarks] : markStack;
|
|
39
|
+
for (const child of el.childNodes) {
|
|
40
|
+
runs.push(...collectInlineRuns(child, nextStack));
|
|
41
|
+
}
|
|
42
|
+
return runs;
|
|
43
|
+
}
|
|
44
|
+
function fillInlineRuns(paraEl, runs) {
|
|
45
|
+
if (!runs.length) return;
|
|
46
|
+
const xtNodes = runs.map(() => new Y.XmlText());
|
|
47
|
+
paraEl.insert(0, xtNodes);
|
|
48
|
+
runs.forEach((run, i) => {
|
|
49
|
+
const attrs = {};
|
|
50
|
+
if (run.marks.bold) attrs.bold = true;
|
|
51
|
+
if (run.marks.italic) attrs.italic = true;
|
|
52
|
+
if (run.marks.code) attrs.code = true;
|
|
53
|
+
if (run.marks.strike) attrs.strike = true;
|
|
54
|
+
if (run.marks.link) attrs.link = run.marks.link;
|
|
55
|
+
if (Object.keys(attrs).length) {
|
|
56
|
+
xtNodes[i].insert(0, run.text, attrs);
|
|
57
|
+
} else {
|
|
58
|
+
xtNodes[i].insert(0, run.text);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function convertBlockElement(el, container) {
|
|
63
|
+
const tag = el.tagName.toLowerCase();
|
|
64
|
+
if (tag === "div" && el.getAttribute("data-type") === "file-block") {
|
|
65
|
+
const fileBlockEl = new Y.XmlElement("fileBlock");
|
|
66
|
+
container.insert(container.length, [fileBlockEl]);
|
|
67
|
+
const uploadId = el.getAttribute("uploadid") ?? "";
|
|
68
|
+
const docId = el.getAttribute("docid") ?? "";
|
|
69
|
+
const filename = el.getAttribute("filename") ?? "";
|
|
70
|
+
const mimeType = el.getAttribute("mimetype") ?? "";
|
|
71
|
+
if (uploadId) fileBlockEl.setAttribute("uploadId", uploadId);
|
|
72
|
+
if (docId) fileBlockEl.setAttribute("docId", docId);
|
|
73
|
+
if (filename) fileBlockEl.setAttribute("filename", filename);
|
|
74
|
+
if (mimeType) fileBlockEl.setAttribute("mimeType", mimeType);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const headingMatch = tag.match(/^h([1-6])$/);
|
|
78
|
+
if (headingMatch) {
|
|
79
|
+
const level = Number.parseInt(headingMatch[1]);
|
|
80
|
+
const headingEl = new Y.XmlElement("heading");
|
|
81
|
+
container.insert(container.length, [headingEl]);
|
|
82
|
+
headingEl.setAttribute("level", level);
|
|
83
|
+
fillInlineRuns(headingEl, collectInlineRuns(el, []));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (tag === "p") {
|
|
87
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
88
|
+
container.insert(container.length, [paraEl]);
|
|
89
|
+
fillInlineRuns(paraEl, collectInlineRuns(el, []));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (tag === "hr") {
|
|
93
|
+
const hrEl = new Y.XmlElement("horizontalRule");
|
|
94
|
+
container.insert(container.length, [hrEl]);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (tag === "pre") {
|
|
98
|
+
const codeEl = el.querySelector("code");
|
|
99
|
+
const codeBlock = new Y.XmlElement("codeBlock");
|
|
100
|
+
container.insert(container.length, [codeBlock]);
|
|
101
|
+
const lang = codeEl ? langFromClass(codeEl) : "";
|
|
102
|
+
if (lang) codeBlock.setAttribute("language", lang);
|
|
103
|
+
const xt = new Y.XmlText();
|
|
104
|
+
codeBlock.insert(0, [xt]);
|
|
105
|
+
xt.insert(0, (codeEl ?? el).textContent ?? "");
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (tag === "blockquote") {
|
|
109
|
+
const bqEl = new Y.XmlElement("blockquote");
|
|
110
|
+
container.insert(container.length, [bqEl]);
|
|
111
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
112
|
+
bqEl.insert(0, [paraEl]);
|
|
113
|
+
fillInlineRuns(paraEl, collectInlineRuns(el, []));
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (tag === "ul" || tag === "ol") {
|
|
117
|
+
const items = Array.from(el.querySelectorAll(":scope > li"));
|
|
118
|
+
const hasCheckbox = items.some((li) => li.querySelector('input[type="checkbox"]'));
|
|
119
|
+
if (hasCheckbox) {
|
|
120
|
+
const taskListEl = new Y.XmlElement("taskList");
|
|
121
|
+
container.insert(container.length, [taskListEl]);
|
|
122
|
+
const taskItemEls = items.map(() => new Y.XmlElement("taskItem"));
|
|
123
|
+
taskListEl.insert(0, taskItemEls);
|
|
124
|
+
items.forEach((li, i) => {
|
|
125
|
+
const checkbox = li.querySelector('input[type="checkbox"]');
|
|
126
|
+
const checked = checkbox?.checked ?? false;
|
|
127
|
+
taskItemEls[i].setAttribute("checked", checked);
|
|
128
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
129
|
+
taskItemEls[i].insert(0, [paraEl]);
|
|
130
|
+
const clone = li.cloneNode(true);
|
|
131
|
+
clone.querySelector("input")?.remove();
|
|
132
|
+
fillInlineRuns(paraEl, collectInlineRuns(clone, []));
|
|
133
|
+
});
|
|
134
|
+
} else {
|
|
135
|
+
const listType = tag === "ul" ? "bulletList" : "orderedList";
|
|
136
|
+
const listEl = new Y.XmlElement(listType);
|
|
137
|
+
container.insert(container.length, [listEl]);
|
|
138
|
+
const listItemEls = items.map(() => new Y.XmlElement("listItem"));
|
|
139
|
+
listEl.insert(0, listItemEls);
|
|
140
|
+
items.forEach((li, i) => {
|
|
141
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
142
|
+
listItemEls[i].insert(0, [paraEl]);
|
|
143
|
+
fillInlineRuns(paraEl, collectInlineRuns(li, []));
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (tag === "table") {
|
|
149
|
+
const tableEl = new Y.XmlElement("table");
|
|
150
|
+
container.insert(container.length, [tableEl]);
|
|
151
|
+
const rows = Array.from(el.querySelectorAll("tr"));
|
|
152
|
+
const rowEls = rows.map(() => new Y.XmlElement("tableRow"));
|
|
153
|
+
tableEl.insert(0, rowEls);
|
|
154
|
+
rows.forEach((row, ri) => {
|
|
155
|
+
const cells = Array.from(row.querySelectorAll("th, td"));
|
|
156
|
+
const isHeader = cells.some((c) => c.tagName.toLowerCase() === "th");
|
|
157
|
+
const cellType = isHeader ? "tableHeader" : "tableCell";
|
|
158
|
+
const cellEls = cells.map(() => new Y.XmlElement(cellType));
|
|
159
|
+
rowEls[ri].insert(0, cellEls);
|
|
160
|
+
cells.forEach((cell, ci) => {
|
|
161
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
162
|
+
cellEls[ci].insert(0, [paraEl]);
|
|
163
|
+
fillInlineRuns(paraEl, collectInlineRuns(cell, []));
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const text = (el.textContent ?? "").trim();
|
|
169
|
+
if (text) {
|
|
170
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
171
|
+
container.insert(container.length, [paraEl]);
|
|
172
|
+
fillInlineRuns(paraEl, collectInlineRuns(el, []));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const BLOCK_TAGS = /* @__PURE__ */ new Set([
|
|
176
|
+
"p",
|
|
177
|
+
"h1",
|
|
178
|
+
"h2",
|
|
179
|
+
"h3",
|
|
180
|
+
"h4",
|
|
181
|
+
"h5",
|
|
182
|
+
"h6",
|
|
183
|
+
"ul",
|
|
184
|
+
"ol",
|
|
185
|
+
"pre",
|
|
186
|
+
"blockquote",
|
|
187
|
+
"table",
|
|
188
|
+
"hr",
|
|
189
|
+
"div",
|
|
190
|
+
"section",
|
|
191
|
+
"article",
|
|
192
|
+
"header",
|
|
193
|
+
"footer",
|
|
194
|
+
"main",
|
|
195
|
+
"aside"
|
|
196
|
+
]);
|
|
197
|
+
export function populateYDocFromHtml(fragment, html, fallbackTitle = "Untitled") {
|
|
198
|
+
const ydoc = fragment.doc;
|
|
199
|
+
if (!ydoc) return;
|
|
200
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
201
|
+
let title = doc.title?.trim() || fallbackTitle;
|
|
202
|
+
const firstH1 = doc.body.querySelector("h1");
|
|
203
|
+
if (firstH1) title = firstH1.textContent?.trim() || title;
|
|
204
|
+
ydoc.transact(() => {
|
|
205
|
+
const headerEl = new Y.XmlElement("documentHeader");
|
|
206
|
+
const metaEl = new Y.XmlElement("documentMeta");
|
|
207
|
+
fragment.insert(0, [headerEl, metaEl]);
|
|
208
|
+
const headerXt = new Y.XmlText();
|
|
209
|
+
headerEl.insert(0, [headerXt]);
|
|
210
|
+
headerXt.insert(0, title);
|
|
211
|
+
let hasContent = false;
|
|
212
|
+
for (const child of doc.body.children) {
|
|
213
|
+
const tag = child.tagName.toLowerCase();
|
|
214
|
+
if (!BLOCK_TAGS.has(tag)) continue;
|
|
215
|
+
if (tag === "h1" && child === firstH1) continue;
|
|
216
|
+
convertBlockElement(child, fragment);
|
|
217
|
+
hasContent = true;
|
|
218
|
+
}
|
|
219
|
+
if (!hasContent) {
|
|
220
|
+
const paraEl = new Y.XmlElement("paragraph");
|
|
221
|
+
fragment.insert(fragment.length, [paraEl]);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
export function appendHtmlToFragment(fragment, html) {
|
|
226
|
+
const ydoc = fragment.doc;
|
|
227
|
+
if (!ydoc) return;
|
|
228
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
229
|
+
ydoc.transact(() => {
|
|
230
|
+
for (const child of doc.body.children) {
|
|
231
|
+
if (BLOCK_TAGS.has(child.tagName.toLowerCase()))
|
|
232
|
+
convertBlockElement(child, fragment);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
@@ -179,7 +179,7 @@ function parseBlocks(markdown) {
|
|
|
179
179
|
let i = 0;
|
|
180
180
|
while (i < lines.length) {
|
|
181
181
|
const line = lines[i];
|
|
182
|
-
const fenceBlockMatch = line.match(/^(`{3,})(
|
|
182
|
+
const fenceBlockMatch = line.match(/^(`{3,})([^`]*)$/);
|
|
183
183
|
if (fenceBlockMatch) {
|
|
184
184
|
const fence = fenceBlockMatch[1];
|
|
185
185
|
const lang = fenceBlockMatch[2].trim().replace(/\{[^}]*\}$/, "").replace(/\s*\[.*\]$/, "").trim();
|
|
@@ -237,7 +237,7 @@ function parseBlocks(markdown) {
|
|
|
237
237
|
}
|
|
238
238
|
continue;
|
|
239
239
|
}
|
|
240
|
-
const MDC_OPEN = /^\s
|
|
240
|
+
const MDC_OPEN = /^\s*:{2,}\w[\w-]*(?:\{[^}]*\})?\s*$/;
|
|
241
241
|
if (MDC_OPEN.test(line)) {
|
|
242
242
|
const colons = line.match(/^\s*(:+)/)?.[1]?.length ?? 2;
|
|
243
243
|
i++;
|
|
@@ -286,7 +286,7 @@ function parseBlocks(markdown) {
|
|
|
286
286
|
continue;
|
|
287
287
|
}
|
|
288
288
|
const paraLines = [];
|
|
289
|
-
while (i < lines.length && lines[i].trim() !== "" && !/^(
|
|
289
|
+
while (i < lines.length && lines[i].trim() !== "" && !/^(?:#{1,6}\s|[-*+]\s|\d+\.\s|>|`{3,}|\s*\||[-*_]{3,}\s*$|\s*:{2,}\w)/.test(lines[i])) {
|
|
290
290
|
paraLines.push(lines[i]);
|
|
291
291
|
i++;
|
|
292
292
|
}
|
|
@@ -178,5 +178,14 @@ export const META_FIELD_DEFINITIONS = [
|
|
|
178
178
|
const t = Date.now();
|
|
179
179
|
return { fieldType: "icon", fieldLabel: "Icon", userDefined: true, metaKey: `_icon_${t}` };
|
|
180
180
|
}
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: "Members",
|
|
184
|
+
icon: "i-lucide-users",
|
|
185
|
+
kind: "metaFieldMembers",
|
|
186
|
+
buildAttrs: () => {
|
|
187
|
+
const t = Date.now();
|
|
188
|
+
return { fieldType: "members", fieldLabel: "Members", userDefined: true, metaKey: `_members_${t}` };
|
|
189
|
+
}
|
|
181
190
|
}
|
|
182
191
|
];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification rendering utilities.
|
|
3
|
+
*
|
|
4
|
+
* Converts notification payloads into VNodes for toast descriptions,
|
|
5
|
+
* handling doc-quote, doc-link, and rich text with @mentions and URLs.
|
|
6
|
+
*
|
|
7
|
+
* Ported from cou-sh/app/utils/notificationRenderers.ts.
|
|
8
|
+
*/
|
|
9
|
+
import { type VNode } from 'vue';
|
|
10
|
+
/**
|
|
11
|
+
* Render a rich notification description as a VNode for toast `description` fields.
|
|
12
|
+
*/
|
|
13
|
+
export declare function renderNotificationDescription(body: string): VNode | string;
|