@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,434 @@
|
|
|
1
|
+
import { ref, computed, onMounted, onBeforeUnmount } from "vue";
|
|
2
|
+
const TIER_MILLENNIA = 5e-3;
|
|
3
|
+
const TIER_CENTURIES = 0.05;
|
|
4
|
+
const TIER_DECADES = 0.5;
|
|
5
|
+
const TIER_YEARS = 2;
|
|
6
|
+
const TIER_MONTHS = 10;
|
|
7
|
+
const TIER_WEEKS = 30;
|
|
8
|
+
const ZOOM_MIN = 5e-4;
|
|
9
|
+
const ZOOM_MAX = 120;
|
|
10
|
+
const ZOOM_WHEEL_FACTOR = 1.08;
|
|
11
|
+
const PAN_KEYBOARD_PX = 100;
|
|
12
|
+
const MS_PER_DAY = 24 * 60 * 60 * 1e3;
|
|
13
|
+
function toDateStr(d) {
|
|
14
|
+
const y = d.getFullYear();
|
|
15
|
+
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
16
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
17
|
+
if (y < 0) return `-${String(-y).padStart(6, "0")}-${m}-${day}`;
|
|
18
|
+
if (y > 9999) return `+${String(y).padStart(6, "0")}-${m}-${day}`;
|
|
19
|
+
return `${String(y).padStart(4, "0")}-${m}-${day}`;
|
|
20
|
+
}
|
|
21
|
+
function clamp(v, min, max) {
|
|
22
|
+
return Math.max(min, Math.min(max, v));
|
|
23
|
+
}
|
|
24
|
+
export function useTimelineView(options) {
|
|
25
|
+
const { containerRef, scrollContainerRef, storedPixelsPerDay, storedZoomLevel, storedCenterDate, entries: entriesRef, onViewChange } = options;
|
|
26
|
+
const pixelsPerDay = ref(14);
|
|
27
|
+
const centerMs = ref(Date.now());
|
|
28
|
+
const centerDate = computed(() => new Date(centerMs.value));
|
|
29
|
+
const containerWidth = ref(800);
|
|
30
|
+
const isMobile = ref(false);
|
|
31
|
+
function migrateZoom() {
|
|
32
|
+
if (storedPixelsPerDay?.value && storedPixelsPerDay.value > 0) {
|
|
33
|
+
pixelsPerDay.value = storedPixelsPerDay.value;
|
|
34
|
+
} else if (storedZoomLevel?.value) {
|
|
35
|
+
const map = { week: 40, month: 14, quarter: 4 };
|
|
36
|
+
pixelsPerDay.value = map[storedZoomLevel.value] ?? 14;
|
|
37
|
+
}
|
|
38
|
+
if (storedCenterDate?.value) {
|
|
39
|
+
const d = new Date(storedCenterDate.value);
|
|
40
|
+
if (!Number.isNaN(d.getTime())) centerMs.value = d.getTime();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function fitToContent() {
|
|
44
|
+
const items = entriesRef?.value;
|
|
45
|
+
if (!items || items.length === 0) return false;
|
|
46
|
+
let minDate = Infinity;
|
|
47
|
+
let maxDate = -Infinity;
|
|
48
|
+
let hasAnyDate = false;
|
|
49
|
+
for (const item of items) {
|
|
50
|
+
const start = item.meta?.dateStart;
|
|
51
|
+
const end = item.meta?.dateEnd;
|
|
52
|
+
if (start) {
|
|
53
|
+
const t = new Date(start).getTime();
|
|
54
|
+
if (!Number.isNaN(t)) {
|
|
55
|
+
minDate = Math.min(minDate, t);
|
|
56
|
+
maxDate = Math.max(maxDate, t);
|
|
57
|
+
hasAnyDate = true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
if (end) {
|
|
61
|
+
const t = new Date(end).getTime();
|
|
62
|
+
if (!Number.isNaN(t)) {
|
|
63
|
+
minDate = Math.min(minDate, t);
|
|
64
|
+
maxDate = Math.max(maxDate, t);
|
|
65
|
+
hasAnyDate = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (!hasAnyDate) return false;
|
|
70
|
+
const rangeDays = Math.max(7, (maxDate - minDate) / MS_PER_DAY);
|
|
71
|
+
const paddingDays = rangeDays * 0.1;
|
|
72
|
+
const totalDays = rangeDays + paddingDays * 2;
|
|
73
|
+
const width = containerWidth.value || 800;
|
|
74
|
+
const ppd = clamp(width / totalDays, ZOOM_MIN, ZOOM_MAX);
|
|
75
|
+
pixelsPerDay.value = ppd;
|
|
76
|
+
centerMs.value = (minDate + maxDate) / 2;
|
|
77
|
+
persistView();
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
let resizeObserver = null;
|
|
81
|
+
function measureContainer() {
|
|
82
|
+
const el = containerRef.value;
|
|
83
|
+
if (!el) return;
|
|
84
|
+
containerWidth.value = el.clientWidth;
|
|
85
|
+
isMobile.value = window.innerWidth < 640;
|
|
86
|
+
}
|
|
87
|
+
onMounted(() => {
|
|
88
|
+
migrateZoom();
|
|
89
|
+
measureContainer();
|
|
90
|
+
if (containerRef.value) {
|
|
91
|
+
resizeObserver = new ResizeObserver(measureContainer);
|
|
92
|
+
resizeObserver.observe(containerRef.value);
|
|
93
|
+
}
|
|
94
|
+
if (!storedCenterDate?.value && !storedPixelsPerDay?.value) {
|
|
95
|
+
if (!fitToContent()) {
|
|
96
|
+
centerMs.value = Date.now();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
onBeforeUnmount(() => {
|
|
101
|
+
if (persistTimer) clearTimeout(persistTimer);
|
|
102
|
+
if (followFrameId !== null) cancelAnimationFrame(followFrameId);
|
|
103
|
+
resizeObserver?.disconnect();
|
|
104
|
+
});
|
|
105
|
+
const visibleDays = computed(() => containerWidth.value / pixelsPerDay.value);
|
|
106
|
+
const visibleStartDate = computed(
|
|
107
|
+
() => new Date(centerMs.value - containerWidth.value / pixelsPerDay.value / 2 * MS_PER_DAY)
|
|
108
|
+
);
|
|
109
|
+
const visibleEndDate = computed(
|
|
110
|
+
() => new Date(centerMs.value + containerWidth.value / pixelsPerDay.value / 2 * MS_PER_DAY)
|
|
111
|
+
);
|
|
112
|
+
function dateToX(dateStr) {
|
|
113
|
+
const d = new Date(dateStr);
|
|
114
|
+
const diffDays = (d.getTime() - visibleStartDate.value.getTime()) / MS_PER_DAY;
|
|
115
|
+
return diffDays * pixelsPerDay.value;
|
|
116
|
+
}
|
|
117
|
+
function xToDate(px) {
|
|
118
|
+
const ms = visibleStartDate.value.getTime() + px / pixelsPerDay.value * MS_PER_DAY;
|
|
119
|
+
return new Date(ms);
|
|
120
|
+
}
|
|
121
|
+
function spanWidth(startStr, endStr) {
|
|
122
|
+
const s = new Date(startStr);
|
|
123
|
+
const e = new Date(endStr);
|
|
124
|
+
const days = Math.max(1, Math.ceil((e.getTime() - s.getTime()) / MS_PER_DAY));
|
|
125
|
+
return days * pixelsPerDay.value;
|
|
126
|
+
}
|
|
127
|
+
const todayOffset = computed(() => dateToX(toDateStr(/* @__PURE__ */ new Date())));
|
|
128
|
+
function panByPixels(dx) {
|
|
129
|
+
centerMs.value -= dx / pixelsPerDay.value * MS_PER_DAY;
|
|
130
|
+
persistView();
|
|
131
|
+
}
|
|
132
|
+
function navigateTo(date) {
|
|
133
|
+
centerMs.value = date.getTime();
|
|
134
|
+
persistView();
|
|
135
|
+
}
|
|
136
|
+
function goToday() {
|
|
137
|
+
centerMs.value = Date.now();
|
|
138
|
+
persistView();
|
|
139
|
+
}
|
|
140
|
+
function zoomAt(factor, anchorX) {
|
|
141
|
+
const oldPpd = pixelsPerDay.value;
|
|
142
|
+
const newPpd = clamp(oldPpd * factor, ZOOM_MIN, ZOOM_MAX);
|
|
143
|
+
if (anchorX !== void 0) {
|
|
144
|
+
const halfW = containerWidth.value / 2;
|
|
145
|
+
const anchorMs = centerMs.value + (anchorX - halfW) / oldPpd * MS_PER_DAY;
|
|
146
|
+
pixelsPerDay.value = newPpd;
|
|
147
|
+
centerMs.value = anchorMs - (anchorX - halfW) / newPpd * MS_PER_DAY;
|
|
148
|
+
} else {
|
|
149
|
+
pixelsPerDay.value = newPpd;
|
|
150
|
+
}
|
|
151
|
+
persistView();
|
|
152
|
+
}
|
|
153
|
+
function zoomIn(anchorX) {
|
|
154
|
+
zoomAt(ZOOM_WHEEL_FACTOR, anchorX);
|
|
155
|
+
}
|
|
156
|
+
function zoomOut(anchorX) {
|
|
157
|
+
zoomAt(1 / ZOOM_WHEEL_FACTOR, anchorX);
|
|
158
|
+
}
|
|
159
|
+
let persistTimer = null;
|
|
160
|
+
function persistView() {
|
|
161
|
+
if (persistTimer) clearTimeout(persistTimer);
|
|
162
|
+
persistTimer = setTimeout(() => {
|
|
163
|
+
onViewChange?.(pixelsPerDay.value, toDateStr(centerDate.value));
|
|
164
|
+
}, 400);
|
|
165
|
+
}
|
|
166
|
+
function setViewport(ppd, center) {
|
|
167
|
+
pixelsPerDay.value = clamp(ppd, ZOOM_MIN, ZOOM_MAX);
|
|
168
|
+
centerMs.value = center;
|
|
169
|
+
}
|
|
170
|
+
const FOLLOW_TAU = 120;
|
|
171
|
+
let followFrameId = null;
|
|
172
|
+
let followTargetPpd = null;
|
|
173
|
+
let followTargetCenter = null;
|
|
174
|
+
let followLastTime = null;
|
|
175
|
+
function runFollowLoop(now) {
|
|
176
|
+
if (followTargetPpd === null || followTargetCenter === null) {
|
|
177
|
+
followFrameId = null;
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const dt = followLastTime !== null ? Math.min(now - followLastTime, 64) : 16;
|
|
181
|
+
followLastTime = now;
|
|
182
|
+
const factor = 1 - Math.exp(-dt / FOLLOW_TAU);
|
|
183
|
+
const logCur = Math.log(pixelsPerDay.value);
|
|
184
|
+
const logTarget = Math.log(followTargetPpd);
|
|
185
|
+
pixelsPerDay.value = Math.exp(logCur + (logTarget - logCur) * factor);
|
|
186
|
+
centerMs.value = centerMs.value + (followTargetCenter - centerMs.value) * factor;
|
|
187
|
+
const pxDiff = Math.abs(followTargetCenter - centerMs.value) / MS_PER_DAY * pixelsPerDay.value;
|
|
188
|
+
const zoomDone = Math.abs(logTarget - Math.log(pixelsPerDay.value)) < 5e-4;
|
|
189
|
+
const panDone = pxDiff < 0.5;
|
|
190
|
+
if (zoomDone && panDone) {
|
|
191
|
+
pixelsPerDay.value = followTargetPpd;
|
|
192
|
+
centerMs.value = followTargetCenter;
|
|
193
|
+
followTargetPpd = null;
|
|
194
|
+
followTargetCenter = null;
|
|
195
|
+
followFrameId = null;
|
|
196
|
+
} else {
|
|
197
|
+
followFrameId = requestAnimationFrame(runFollowLoop);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function animateViewport(targetPpd, targetCenter) {
|
|
201
|
+
followTargetPpd = clamp(targetPpd, ZOOM_MIN, ZOOM_MAX);
|
|
202
|
+
followTargetCenter = targetCenter;
|
|
203
|
+
if (followFrameId === null) {
|
|
204
|
+
followLastTime = null;
|
|
205
|
+
followFrameId = requestAnimationFrame(runFollowLoop);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function onWheel(e) {
|
|
209
|
+
const rect = containerRef.value?.getBoundingClientRect();
|
|
210
|
+
const anchorX = rect ? e.clientX - rect.left : void 0;
|
|
211
|
+
if (e.deltaY > 0) zoomOut(anchorX);
|
|
212
|
+
else zoomIn(anchorX);
|
|
213
|
+
}
|
|
214
|
+
let pinchStartDist = 0;
|
|
215
|
+
let pinchStartPpd = 0;
|
|
216
|
+
let pinchStartCenterMs = 0;
|
|
217
|
+
function onTouchStart(e) {
|
|
218
|
+
if (e.touches.length === 2) {
|
|
219
|
+
const dx = e.touches[1].clientX - e.touches[0].clientX;
|
|
220
|
+
const dy = e.touches[1].clientY - e.touches[0].clientY;
|
|
221
|
+
pinchStartDist = Math.hypot(dx, dy);
|
|
222
|
+
pinchStartPpd = pixelsPerDay.value;
|
|
223
|
+
pinchStartCenterMs = centerMs.value;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
function onTouchMove(e) {
|
|
227
|
+
if (e.touches.length === 2 && pinchStartDist > 0) {
|
|
228
|
+
e.preventDefault();
|
|
229
|
+
const dx = e.touches[1].clientX - e.touches[0].clientX;
|
|
230
|
+
const dy = e.touches[1].clientY - e.touches[0].clientY;
|
|
231
|
+
const dist = Math.hypot(dx, dy);
|
|
232
|
+
const newPpd = clamp(pinchStartPpd * (dist / pinchStartDist), ZOOM_MIN, ZOOM_MAX);
|
|
233
|
+
const rect = containerRef.value?.getBoundingClientRect();
|
|
234
|
+
if (rect) {
|
|
235
|
+
const midX = (e.touches[0].clientX + e.touches[1].clientX) / 2 - rect.left;
|
|
236
|
+
const halfW = containerWidth.value / 2;
|
|
237
|
+
const anchorMsVal = pinchStartCenterMs + (midX - halfW) / pinchStartPpd * MS_PER_DAY;
|
|
238
|
+
pixelsPerDay.value = newPpd;
|
|
239
|
+
centerMs.value = anchorMsVal - (midX - halfW) / newPpd * MS_PER_DAY;
|
|
240
|
+
} else {
|
|
241
|
+
pixelsPerDay.value = newPpd;
|
|
242
|
+
}
|
|
243
|
+
persistView();
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
function onTouchEnd() {
|
|
247
|
+
pinchStartDist = 0;
|
|
248
|
+
}
|
|
249
|
+
let panStartX = 0;
|
|
250
|
+
let panStartY = 0;
|
|
251
|
+
let isPanning = false;
|
|
252
|
+
function onPanPointerDown(e) {
|
|
253
|
+
if (e.button !== 0) return;
|
|
254
|
+
const target = e.target;
|
|
255
|
+
if (target.closest("[data-bar-id], [data-milestone-id], [data-drag-id]")) return;
|
|
256
|
+
panStartX = e.clientX;
|
|
257
|
+
panStartY = e.clientY;
|
|
258
|
+
isPanning = true;
|
|
259
|
+
e.currentTarget?.setPointerCapture(e.pointerId);
|
|
260
|
+
}
|
|
261
|
+
function onPanPointerMove(e) {
|
|
262
|
+
if (!isPanning) return;
|
|
263
|
+
const dx = e.clientX - panStartX;
|
|
264
|
+
const dy = e.clientY - panStartY;
|
|
265
|
+
if (Math.abs(dx) > 2 || Math.abs(dy) > 2) {
|
|
266
|
+
if (Math.abs(dx) > 2) {
|
|
267
|
+
panByPixels(dx);
|
|
268
|
+
panStartX = e.clientX;
|
|
269
|
+
}
|
|
270
|
+
if (Math.abs(dy) > 2 && scrollContainerRef?.value) {
|
|
271
|
+
scrollContainerRef.value.scrollTop -= dy;
|
|
272
|
+
panStartY = e.clientY;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function onPanPointerUp(e) {
|
|
277
|
+
isPanning = false;
|
|
278
|
+
e.currentTarget?.releasePointerCapture(e.pointerId);
|
|
279
|
+
}
|
|
280
|
+
const axisLabels = computed(() => {
|
|
281
|
+
const ppd = pixelsPerDay.value;
|
|
282
|
+
const labels = [];
|
|
283
|
+
const start = visibleStartDate.value;
|
|
284
|
+
const end = visibleEndDate.value;
|
|
285
|
+
if (ppd < TIER_MILLENNIA) {
|
|
286
|
+
addYearTierLabels(labels, start, end, 1e3, "fine");
|
|
287
|
+
} else if (ppd < TIER_CENTURIES) {
|
|
288
|
+
addYearTierLabels(labels, start, end, 100, "fine");
|
|
289
|
+
addYearTierLabels(labels, start, end, 1e3, "coarse");
|
|
290
|
+
} else if (ppd < TIER_DECADES) {
|
|
291
|
+
addYearTierLabels(labels, start, end, 10, "fine");
|
|
292
|
+
addYearTierLabels(labels, start, end, 100, "coarse");
|
|
293
|
+
} else if (ppd < TIER_YEARS) {
|
|
294
|
+
addYearTierLabels(labels, start, end, 1, "fine");
|
|
295
|
+
addYearTierLabels(labels, start, end, 10, "coarse");
|
|
296
|
+
} else if (ppd < TIER_MONTHS) {
|
|
297
|
+
addMonthLabels(labels, start, end, "fine");
|
|
298
|
+
addYearTierLabels(labels, start, end, 1, "coarse");
|
|
299
|
+
} else if (ppd < TIER_WEEKS) {
|
|
300
|
+
addWeekLabels(labels, start, end, "fine");
|
|
301
|
+
addMonthLabels(labels, start, end, "coarse");
|
|
302
|
+
} else {
|
|
303
|
+
addDayLabels(labels, start, end, "fine");
|
|
304
|
+
addMonthLabels(labels, start, end, "coarse");
|
|
305
|
+
}
|
|
306
|
+
return labels;
|
|
307
|
+
});
|
|
308
|
+
function addYearTierLabels(labels, start, end, step, tier) {
|
|
309
|
+
const startYear = Math.floor(start.getFullYear() / step) * step;
|
|
310
|
+
const endYear = end.getFullYear();
|
|
311
|
+
for (let y = startYear; y <= endYear + step; y += step) {
|
|
312
|
+
const d = new Date(0, 0, 1);
|
|
313
|
+
d.setFullYear(y, 0, 1);
|
|
314
|
+
const offset = dateToX(toDateStr(d));
|
|
315
|
+
if (offset >= -200 && offset <= containerWidth.value + 200) {
|
|
316
|
+
labels.push({ label: String(y), offset, tier });
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function addMonthLabels(labels, start, end, tier) {
|
|
321
|
+
const loc = typeof navigator !== "undefined" ? navigator.language : "en-US";
|
|
322
|
+
const d = new Date(start.getFullYear(), start.getMonth(), 1);
|
|
323
|
+
while (d <= end) {
|
|
324
|
+
const offset = dateToX(toDateStr(d));
|
|
325
|
+
if (offset >= -200 && offset <= containerWidth.value + 200) {
|
|
326
|
+
const fmt = tier === "coarse" ? { month: "long", year: "numeric" } : { month: "short" };
|
|
327
|
+
labels.push({ label: d.toLocaleDateString(loc, fmt), offset, tier });
|
|
328
|
+
}
|
|
329
|
+
d.setMonth(d.getMonth() + 1);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function addWeekLabels(labels, start, end, tier) {
|
|
333
|
+
const d = new Date(start);
|
|
334
|
+
d.setDate(d.getDate() - (d.getDay() + 6) % 7);
|
|
335
|
+
while (d <= end) {
|
|
336
|
+
const offset = dateToX(toDateStr(d));
|
|
337
|
+
if (offset >= -200 && offset <= containerWidth.value + 200) {
|
|
338
|
+
labels.push({ label: `W${isoWeekNumber(d)}`, offset, tier });
|
|
339
|
+
}
|
|
340
|
+
d.setDate(d.getDate() + 7);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function addDayLabels(labels, start, end, tier) {
|
|
344
|
+
const loc = typeof navigator !== "undefined" ? navigator.language : "en-US";
|
|
345
|
+
const d = new Date(start);
|
|
346
|
+
while (d <= end) {
|
|
347
|
+
const offset = dateToX(toDateStr(d));
|
|
348
|
+
if (offset >= -200 && offset <= containerWidth.value + 200) {
|
|
349
|
+
labels.push({
|
|
350
|
+
label: d.toLocaleDateString(loc, { weekday: "short", day: "numeric" }),
|
|
351
|
+
offset,
|
|
352
|
+
tier
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
d.setDate(d.getDate() + 1);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
function isoWeekNumber(d) {
|
|
359
|
+
const date = new Date(d.getTime());
|
|
360
|
+
date.setHours(0, 0, 0, 0);
|
|
361
|
+
date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
|
|
362
|
+
const week1 = new Date(date.getFullYear(), 0, 4);
|
|
363
|
+
return 1 + Math.round(((date.getTime() - week1.getTime()) / 864e5 - 3 + (week1.getDay() + 6) % 7) / 7);
|
|
364
|
+
}
|
|
365
|
+
function isBarVisible(startStr, endStr) {
|
|
366
|
+
if (!startStr) return false;
|
|
367
|
+
const start = new Date(startStr);
|
|
368
|
+
const end = endStr ? new Date(endStr) : start;
|
|
369
|
+
return end >= visibleStartDate.value && start <= visibleEndDate.value;
|
|
370
|
+
}
|
|
371
|
+
function isMilestone(entry) {
|
|
372
|
+
return !entry.meta?.dateEnd || entry.meta.dateEnd === entry.meta.dateStart;
|
|
373
|
+
}
|
|
374
|
+
function onKeydown(e) {
|
|
375
|
+
if (e.target?.tagName === "INPUT" || e.target?.tagName === "TEXTAREA") return;
|
|
376
|
+
switch (e.key) {
|
|
377
|
+
case "ArrowLeft":
|
|
378
|
+
e.preventDefault();
|
|
379
|
+
panByPixels(PAN_KEYBOARD_PX);
|
|
380
|
+
break;
|
|
381
|
+
case "ArrowRight":
|
|
382
|
+
e.preventDefault();
|
|
383
|
+
panByPixels(-PAN_KEYBOARD_PX);
|
|
384
|
+
break;
|
|
385
|
+
case "+":
|
|
386
|
+
case "=":
|
|
387
|
+
e.preventDefault();
|
|
388
|
+
zoomIn();
|
|
389
|
+
break;
|
|
390
|
+
case "-":
|
|
391
|
+
e.preventDefault();
|
|
392
|
+
zoomOut();
|
|
393
|
+
break;
|
|
394
|
+
case "t":
|
|
395
|
+
e.preventDefault();
|
|
396
|
+
goToday();
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
pixelsPerDay,
|
|
402
|
+
centerDate,
|
|
403
|
+
containerWidth,
|
|
404
|
+
isMobile,
|
|
405
|
+
visibleDays,
|
|
406
|
+
visibleStartDate,
|
|
407
|
+
visibleEndDate,
|
|
408
|
+
todayOffset,
|
|
409
|
+
axisLabels,
|
|
410
|
+
dateToX,
|
|
411
|
+
xToDate,
|
|
412
|
+
spanWidth,
|
|
413
|
+
toDateStr,
|
|
414
|
+
panByPixels,
|
|
415
|
+
navigateTo,
|
|
416
|
+
goToday,
|
|
417
|
+
fitToContent,
|
|
418
|
+
zoomIn,
|
|
419
|
+
zoomOut,
|
|
420
|
+
zoomAt,
|
|
421
|
+
setViewport,
|
|
422
|
+
animateViewport,
|
|
423
|
+
onWheel,
|
|
424
|
+
onTouchStart,
|
|
425
|
+
onTouchMove,
|
|
426
|
+
onTouchEnd,
|
|
427
|
+
onPanPointerDown,
|
|
428
|
+
onPanPointerMove,
|
|
429
|
+
onPanPointerUp,
|
|
430
|
+
onKeydown,
|
|
431
|
+
isBarVisible,
|
|
432
|
+
isMilestone
|
|
433
|
+
};
|
|
434
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TiptapDragState {
|
|
2
|
+
html: string;
|
|
3
|
+
nodeType: string;
|
|
4
|
+
sourceDocId: string;
|
|
5
|
+
sourceDocLabel: string;
|
|
6
|
+
deleteFromSource: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useTiptapDragState(): import("vue").ShallowRef<TiptapDragState | null, TiptapDragState | null>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mobile-compatible drag & drop using pointer events.
|
|
3
|
+
* Works on both touch and mouse devices, replacing HTML5 DragEvent handlers.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* 1. Add `data-drag-id="itemId"` to every draggable element
|
|
7
|
+
* 2. Optionally add `data-drop-container="containerId"` for cross-container moves
|
|
8
|
+
* 3. Call `handlePointerDown(e, id)` on `@pointerdown` of draggable items
|
|
9
|
+
* 4. Read `dragId` / `dragOverId` / `dragOverContainer` for styling
|
|
10
|
+
* 5. Provide `onDrop` / `onMoveToContainer` callbacks for the actual data mutations
|
|
11
|
+
*/
|
|
12
|
+
export declare function useTouchDrag(opts: {
|
|
13
|
+
/** Called when an item is dropped on another item (reorder) */
|
|
14
|
+
onDrop?: (dragId: string, targetId: string) => void;
|
|
15
|
+
/** Called when an item is dropped on a container (cross-container move) */
|
|
16
|
+
onMoveToContainer?: (dragId: string, containerId: string, targetId: string | null) => void;
|
|
17
|
+
/** Called on every pointermove while over a container (for live previews) */
|
|
18
|
+
onMoveOverContainer?: (dragId: string, containerId: string, event: PointerEvent) => void;
|
|
19
|
+
/** Called when drag starts */
|
|
20
|
+
onDragStart?: (id: string) => void;
|
|
21
|
+
/** Called when drag ends (always, even if no drop) */
|
|
22
|
+
onDragEnd?: () => void;
|
|
23
|
+
/** Long-press delay in ms before touch drag activates (default: 200) */
|
|
24
|
+
longPressMs?: number;
|
|
25
|
+
/** Data attribute name for item IDs (default: 'data-drag-id') */
|
|
26
|
+
idAttr?: string;
|
|
27
|
+
/** Data attribute name for containers (default: 'data-drop-container') */
|
|
28
|
+
containerAttr?: string;
|
|
29
|
+
}): {
|
|
30
|
+
dragId: import("vue").Ref<string | null, string | null>;
|
|
31
|
+
dragOverId: import("vue").Ref<string | null, string | null>;
|
|
32
|
+
dragOverContainer: import("vue").Ref<string | null, string | null>;
|
|
33
|
+
isDragging: import("vue").Ref<boolean, boolean>;
|
|
34
|
+
handlePointerDown: (e: PointerEvent, id: string) => void;
|
|
35
|
+
cancel: () => void;
|
|
36
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { ref, onUnmounted } from "vue";
|
|
2
|
+
export function useTouchDrag(opts) {
|
|
3
|
+
const idAttr = opts.idAttr ?? "data-drag-id";
|
|
4
|
+
const containerAttr = opts.containerAttr ?? "data-drop-container";
|
|
5
|
+
const longPressMs = opts.longPressMs ?? 200;
|
|
6
|
+
const dragId = ref(null);
|
|
7
|
+
const dragOverId = ref(null);
|
|
8
|
+
const dragOverContainer = ref(null);
|
|
9
|
+
const isDragging = ref(false);
|
|
10
|
+
let startX = 0;
|
|
11
|
+
let startY = 0;
|
|
12
|
+
let delayTimer = null;
|
|
13
|
+
let ghostEl = null;
|
|
14
|
+
let sourceEl = null;
|
|
15
|
+
let pendingId = null;
|
|
16
|
+
let ghostOffsetX = 0;
|
|
17
|
+
let ghostOffsetY = 0;
|
|
18
|
+
let isTouch = false;
|
|
19
|
+
function createGhost(el, clientX, clientY) {
|
|
20
|
+
const rect = el.getBoundingClientRect();
|
|
21
|
+
ghostOffsetX = clientX - rect.left;
|
|
22
|
+
ghostOffsetY = clientY - rect.top;
|
|
23
|
+
const ghost = el.cloneNode(true);
|
|
24
|
+
ghost.style.cssText = `
|
|
25
|
+
position: fixed;
|
|
26
|
+
left: ${rect.left}px;
|
|
27
|
+
top: ${rect.top}px;
|
|
28
|
+
width: ${rect.width}px;
|
|
29
|
+
height: auto;
|
|
30
|
+
opacity: 0.85;
|
|
31
|
+
pointer-events: none;
|
|
32
|
+
z-index: 9999;
|
|
33
|
+
transition: none;
|
|
34
|
+
transform: scale(1.03);
|
|
35
|
+
box-shadow: 0 8px 24px rgba(0,0,0,0.18);
|
|
36
|
+
border-radius: 8px;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
`;
|
|
39
|
+
ghost.querySelectorAll("button, input, textarea, [data-state]").forEach((c) => c.remove());
|
|
40
|
+
document.body.appendChild(ghost);
|
|
41
|
+
return ghost;
|
|
42
|
+
}
|
|
43
|
+
function findTarget(x, y) {
|
|
44
|
+
if (ghostEl) ghostEl.style.display = "none";
|
|
45
|
+
const el = document.elementFromPoint(x, y);
|
|
46
|
+
if (ghostEl) ghostEl.style.display = "";
|
|
47
|
+
if (!el) return { id: null, container: null };
|
|
48
|
+
const dragTarget = el.closest?.(`[${idAttr}]`);
|
|
49
|
+
const containerTarget = el.closest?.(`[${containerAttr}]`);
|
|
50
|
+
return {
|
|
51
|
+
id: dragTarget?.getAttribute(idAttr) ?? null,
|
|
52
|
+
container: containerTarget?.getAttribute(containerAttr) ?? null
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function activateDrag(id, el, clientX, clientY) {
|
|
56
|
+
dragId.value = id;
|
|
57
|
+
isDragging.value = true;
|
|
58
|
+
ghostEl = createGhost(el, clientX, clientY);
|
|
59
|
+
el.style.opacity = "0.3";
|
|
60
|
+
sourceEl = el;
|
|
61
|
+
opts.onDragStart?.(id);
|
|
62
|
+
document.addEventListener("pointermove", onDocPointerMove, { passive: false });
|
|
63
|
+
document.addEventListener("pointerup", onDocPointerUp);
|
|
64
|
+
document.addEventListener("pointercancel", onDocPointerUp);
|
|
65
|
+
document.body.style.userSelect = "none";
|
|
66
|
+
document.body.style.webkitUserSelect = "none";
|
|
67
|
+
}
|
|
68
|
+
function handlePointerDown(e, id) {
|
|
69
|
+
if (e.button !== 0) return;
|
|
70
|
+
const target = e.target;
|
|
71
|
+
const interactiveAncestor = target.closest('input, textarea, button, a, [contenteditable], [role="button"]');
|
|
72
|
+
if (interactiveAncestor && interactiveAncestor !== e.currentTarget) return;
|
|
73
|
+
isTouch = e.pointerType === "touch";
|
|
74
|
+
pendingId = id;
|
|
75
|
+
startX = e.clientX;
|
|
76
|
+
startY = e.clientY;
|
|
77
|
+
sourceEl = e.currentTarget;
|
|
78
|
+
if (isTouch) {
|
|
79
|
+
delayTimer = setTimeout(() => {
|
|
80
|
+
if (!pendingId || !sourceEl) return;
|
|
81
|
+
activateDrag(pendingId, sourceEl, startX, startY);
|
|
82
|
+
if (navigator.vibrate) navigator.vibrate(30);
|
|
83
|
+
}, longPressMs);
|
|
84
|
+
document.addEventListener("pointermove", onEarlyMove, { passive: true });
|
|
85
|
+
document.addEventListener("pointerup", onEarlyUp);
|
|
86
|
+
} else {
|
|
87
|
+
document.addEventListener("pointermove", onMouseEarlyMove, { passive: false });
|
|
88
|
+
document.addEventListener("pointerup", onEarlyUp);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function onEarlyMove(e) {
|
|
92
|
+
if (isDragging.value) return;
|
|
93
|
+
const dx = Math.abs(e.clientX - startX);
|
|
94
|
+
const dy = Math.abs(e.clientY - startY);
|
|
95
|
+
if (dx > 8 || dy > 8) cancelPending();
|
|
96
|
+
}
|
|
97
|
+
function onMouseEarlyMove(e) {
|
|
98
|
+
if (isDragging.value) return;
|
|
99
|
+
const dx = Math.abs(e.clientX - startX);
|
|
100
|
+
const dy = Math.abs(e.clientY - startY);
|
|
101
|
+
if (dx > 4 || dy > 4) {
|
|
102
|
+
document.removeEventListener("pointermove", onMouseEarlyMove);
|
|
103
|
+
document.removeEventListener("pointerup", onEarlyUp);
|
|
104
|
+
if (pendingId && sourceEl) {
|
|
105
|
+
activateDrag(pendingId, sourceEl, e.clientX, e.clientY);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function onEarlyUp() {
|
|
110
|
+
cancelPending();
|
|
111
|
+
}
|
|
112
|
+
function cancelPending() {
|
|
113
|
+
if (delayTimer) {
|
|
114
|
+
clearTimeout(delayTimer);
|
|
115
|
+
delayTimer = null;
|
|
116
|
+
}
|
|
117
|
+
pendingId = null;
|
|
118
|
+
document.removeEventListener("pointermove", onEarlyMove);
|
|
119
|
+
document.removeEventListener("pointermove", onMouseEarlyMove);
|
|
120
|
+
document.removeEventListener("pointerup", onEarlyUp);
|
|
121
|
+
}
|
|
122
|
+
function onDocPointerMove(e) {
|
|
123
|
+
if (!isDragging.value || !ghostEl) return;
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
ghostEl.style.left = `${e.clientX - ghostOffsetX}px`;
|
|
126
|
+
ghostEl.style.top = `${e.clientY - ghostOffsetY}px`;
|
|
127
|
+
const { id, container } = findTarget(e.clientX, e.clientY);
|
|
128
|
+
dragOverId.value = id && id !== dragId.value ? id : null;
|
|
129
|
+
dragOverContainer.value = container;
|
|
130
|
+
if (container && dragId.value && opts.onMoveOverContainer) {
|
|
131
|
+
opts.onMoveOverContainer(dragId.value, container, e);
|
|
132
|
+
}
|
|
133
|
+
autoScroll(e.clientY);
|
|
134
|
+
}
|
|
135
|
+
function autoScroll(clientY) {
|
|
136
|
+
const threshold = 60;
|
|
137
|
+
const speed = 12;
|
|
138
|
+
if (clientY < threshold) {
|
|
139
|
+
window.scrollBy(0, -speed);
|
|
140
|
+
} else if (clientY > window.innerHeight - threshold) {
|
|
141
|
+
window.scrollBy(0, speed);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function onDocPointerUp() {
|
|
145
|
+
cancelPending();
|
|
146
|
+
document.removeEventListener("pointermove", onDocPointerMove);
|
|
147
|
+
document.removeEventListener("pointerup", onDocPointerUp);
|
|
148
|
+
document.removeEventListener("pointercancel", onDocPointerUp);
|
|
149
|
+
if (isDragging.value && dragId.value) {
|
|
150
|
+
const dId = dragId.value;
|
|
151
|
+
const overId = dragOverId.value;
|
|
152
|
+
const overContainer = dragOverContainer.value;
|
|
153
|
+
if (overId && overContainer && opts.onMoveToContainer) {
|
|
154
|
+
opts.onMoveToContainer(dId, overContainer, overId);
|
|
155
|
+
} else if (overId && opts.onDrop) {
|
|
156
|
+
opts.onDrop(dId, overId);
|
|
157
|
+
} else if (!overId && overContainer && opts.onMoveToContainer) {
|
|
158
|
+
opts.onMoveToContainer(dId, overContainer, null);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
cleanup();
|
|
162
|
+
opts.onDragEnd?.();
|
|
163
|
+
}
|
|
164
|
+
function cleanup() {
|
|
165
|
+
if (ghostEl) {
|
|
166
|
+
ghostEl.remove();
|
|
167
|
+
ghostEl = null;
|
|
168
|
+
}
|
|
169
|
+
if (sourceEl) {
|
|
170
|
+
sourceEl.style.opacity = "";
|
|
171
|
+
sourceEl = null;
|
|
172
|
+
}
|
|
173
|
+
dragId.value = null;
|
|
174
|
+
dragOverId.value = null;
|
|
175
|
+
dragOverContainer.value = null;
|
|
176
|
+
isDragging.value = false;
|
|
177
|
+
pendingId = null;
|
|
178
|
+
if (delayTimer) {
|
|
179
|
+
clearTimeout(delayTimer);
|
|
180
|
+
delayTimer = null;
|
|
181
|
+
}
|
|
182
|
+
document.body.style.userSelect = "";
|
|
183
|
+
document.body.style.webkitUserSelect = "";
|
|
184
|
+
}
|
|
185
|
+
onUnmounted(cleanup);
|
|
186
|
+
return {
|
|
187
|
+
dragId,
|
|
188
|
+
dragOverId,
|
|
189
|
+
dragOverContainer,
|
|
190
|
+
isDragging,
|
|
191
|
+
handlePointerDown,
|
|
192
|
+
cancel: cleanup
|
|
193
|
+
};
|
|
194
|
+
}
|