@agent-native/toolkit 0.0.0-beta-20260819143124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -0
- package/agent-native.eject.json +588 -0
- package/dist/app-shell/header-actions.d.ts +18 -0
- package/dist/app-shell/header-actions.d.ts.map +1 -0
- package/dist/app-shell/header-actions.js +52 -0
- package/dist/app-shell/header-actions.js.map +1 -0
- package/dist/app-shell/index.d.ts +3 -0
- package/dist/app-shell/index.d.ts.map +1 -0
- package/dist/app-shell/index.js +3 -0
- package/dist/app-shell/index.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts +14 -0
- package/dist/app-shell/sidebar-footer-actions.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.js +10 -0
- package/dist/app-shell/sidebar-footer-actions.js.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts +2 -0
- package/dist/app-shell/sidebar-footer-actions.spec.d.ts.map +1 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js +43 -0
- package/dist/app-shell/sidebar-footer-actions.spec.js.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts +68 -0
- package/dist/canvas-annotations/CanvasCommentPins.d.ts.map +1 -0
- package/dist/canvas-annotations/CanvasCommentPins.js +513 -0
- package/dist/canvas-annotations/CanvasCommentPins.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts +108 -0
- package/dist/canvas-annotations/DrawOverlay.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.js +746 -0
- package/dist/canvas-annotations/DrawOverlay.js.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts +2 -0
- package/dist/canvas-annotations/DrawOverlay.spec.d.ts.map +1 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js +111 -0
- package/dist/canvas-annotations/DrawOverlay.spec.js.map +1 -0
- package/dist/canvas-annotations/index.d.ts +4 -0
- package/dist/canvas-annotations/index.d.ts.map +1 -0
- package/dist/canvas-annotations/index.js +3 -0
- package/dist/canvas-annotations/index.js.map +1 -0
- package/dist/canvas-annotations/types.d.ts +8 -0
- package/dist/canvas-annotations/types.d.ts.map +1 -0
- package/dist/canvas-annotations/types.js +2 -0
- package/dist/canvas-annotations/types.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts +334 -0
- package/dist/canvas-interactions/canvas-interactions.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.js +486 -0
- package/dist/canvas-interactions/canvas-interactions.js.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts +2 -0
- package/dist/canvas-interactions/canvas-interactions.spec.d.ts.map +1 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js +593 -0
- package/dist/canvas-interactions/canvas-interactions.spec.js.map +1 -0
- package/dist/canvas-interactions/index.d.ts +2 -0
- package/dist/canvas-interactions/index.d.ts.map +1 -0
- package/dist/canvas-interactions/index.js +2 -0
- package/dist/canvas-interactions/index.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.d.ts +103 -0
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.js +102 -0
- package/dist/chat-history/ChatHistoryList.js.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryList.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryList.spec.js +293 -0
- package/dist/chat-history/ChatHistoryList.spec.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.d.ts +33 -0
- package/dist/chat-history/ChatHistoryRail.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.js +35 -0
- package/dist/chat-history/ChatHistoryRail.js.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts +2 -0
- package/dist/chat-history/ChatHistoryRail.spec.d.ts.map +1 -0
- package/dist/chat-history/ChatHistoryRail.spec.js +157 -0
- package/dist/chat-history/ChatHistoryRail.spec.js.map +1 -0
- package/dist/chat-history/index.d.ts +4 -0
- package/dist/chat-history/index.d.ts.map +1 -0
- package/dist/chat-history/index.js +4 -0
- package/dist/chat-history/index.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts +26 -0
- package/dist/chat-history/useChatHistoryRailController.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.js +36 -0
- package/dist/chat-history/useChatHistoryRailController.js.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts +2 -0
- package/dist/chat-history/useChatHistoryRailController.spec.d.ts.map +1 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js +101 -0
- package/dist/chat-history/useChatHistoryRailController.spec.js.map +1 -0
- package/dist/chat-history.css +469 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts +12 -0
- package/dist/collab-ui/AgentPresenceChip.d.ts.map +1 -0
- package/dist/collab-ui/AgentPresenceChip.js +42 -0
- package/dist/collab-ui/AgentPresenceChip.js.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts +46 -0
- package/dist/collab-ui/LiveCursorOverlay.d.ts.map +1 -0
- package/dist/collab-ui/LiveCursorOverlay.js +125 -0
- package/dist/collab-ui/LiveCursorOverlay.js.map +1 -0
- package/dist/collab-ui/PresenceBar.d.ts +30 -0
- package/dist/collab-ui/PresenceBar.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.js +172 -0
- package/dist/collab-ui/PresenceBar.js.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts +2 -0
- package/dist/collab-ui/PresenceBar.spec.d.ts.map +1 -0
- package/dist/collab-ui/PresenceBar.spec.js +30 -0
- package/dist/collab-ui/PresenceBar.spec.js.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts +46 -0
- package/dist/collab-ui/RecentEditHighlights.d.ts.map +1 -0
- package/dist/collab-ui/RecentEditHighlights.js +154 -0
- package/dist/collab-ui/RecentEditHighlights.js.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts +53 -0
- package/dist/collab-ui/RemoteSelectionRings.d.ts.map +1 -0
- package/dist/collab-ui/RemoteSelectionRings.js +130 -0
- package/dist/collab-ui/RemoteSelectionRings.js.map +1 -0
- package/dist/collab-ui/agent-identity.d.ts +9 -0
- package/dist/collab-ui/agent-identity.d.ts.map +1 -0
- package/dist/collab-ui/agent-identity.js +9 -0
- package/dist/collab-ui/agent-identity.js.map +1 -0
- package/dist/collab-ui/index.d.ts +9 -0
- package/dist/collab-ui/index.d.ts.map +1 -0
- package/dist/collab-ui/index.js +9 -0
- package/dist/collab-ui/index.js.map +1 -0
- package/dist/collab-ui/lead-client.d.ts +3 -0
- package/dist/collab-ui/lead-client.d.ts.map +1 -0
- package/dist/collab-ui/lead-client.js +29 -0
- package/dist/collab-ui/lead-client.js.map +1 -0
- package/dist/collab-ui/types.d.ts +48 -0
- package/dist/collab-ui/types.d.ts.map +1 -0
- package/dist/collab-ui/types.js +52 -0
- package/dist/collab-ui/types.js.map +1 -0
- package/dist/collab-ui/types.spec.d.ts +2 -0
- package/dist/collab-ui/types.spec.d.ts.map +1 -0
- package/dist/collab-ui/types.spec.js +15 -0
- package/dist/collab-ui/types.spec.js.map +1 -0
- package/dist/composer/AgentComposerFrame.d.ts +19 -0
- package/dist/composer/AgentComposerFrame.d.ts.map +1 -0
- package/dist/composer/AgentComposerFrame.js +17 -0
- package/dist/composer/AgentComposerFrame.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.d.ts +30 -0
- package/dist/composer/ComposerPlusMenu.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.js +635 -0
- package/dist/composer/ComposerPlusMenu.js.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts +2 -0
- package/dist/composer/ComposerPlusMenu.spec.d.ts.map +1 -0
- package/dist/composer/ComposerPlusMenu.spec.js +12 -0
- package/dist/composer/ComposerPlusMenu.spec.js.map +1 -0
- package/dist/composer/MentionPopover.d.ts +29 -0
- package/dist/composer/MentionPopover.d.ts.map +1 -0
- package/dist/composer/MentionPopover.js +221 -0
- package/dist/composer/MentionPopover.js.map +1 -0
- package/dist/composer/PastedTextChip.d.ts +9 -0
- package/dist/composer/PastedTextChip.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.js +71 -0
- package/dist/composer/PastedTextChip.js.map +1 -0
- package/dist/composer/PastedTextChip.spec.d.ts +2 -0
- package/dist/composer/PastedTextChip.spec.d.ts.map +1 -0
- package/dist/composer/PastedTextChip.spec.js +42 -0
- package/dist/composer/PastedTextChip.spec.js.map +1 -0
- package/dist/composer/PromptComposer.d.ts +151 -0
- package/dist/composer/PromptComposer.d.ts.map +1 -0
- package/dist/composer/PromptComposer.js +322 -0
- package/dist/composer/PromptComposer.js.map +1 -0
- package/dist/composer/PromptComposer.spec.d.ts +2 -0
- package/dist/composer/PromptComposer.spec.d.ts.map +1 -0
- package/dist/composer/PromptComposer.spec.js +87 -0
- package/dist/composer/PromptComposer.spec.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.d.ts +108 -0
- package/dist/composer/RealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.js +312 -0
- package/dist/composer/RealtimeVoiceMode.js.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/RealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/RealtimeVoiceMode.spec.js +540 -0
- package/dist/composer/RealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/TiptapComposer.d.ts +288 -0
- package/dist/composer/TiptapComposer.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.js +2233 -0
- package/dist/composer/TiptapComposer.js.map +1 -0
- package/dist/composer/TiptapComposer.spec.d.ts +2 -0
- package/dist/composer/TiptapComposer.spec.d.ts.map +1 -0
- package/dist/composer/TiptapComposer.spec.js +415 -0
- package/dist/composer/TiptapComposer.spec.js.map +1 -0
- package/dist/composer/VoiceButton.d.ts +27 -0
- package/dist/composer/VoiceButton.d.ts.map +1 -0
- package/dist/composer/VoiceButton.js +151 -0
- package/dist/composer/VoiceButton.js.map +1 -0
- package/dist/composer/VoiceButton.spec.d.ts +2 -0
- package/dist/composer/VoiceButton.spec.d.ts.map +1 -0
- package/dist/composer/VoiceButton.spec.js +27 -0
- package/dist/composer/VoiceButton.spec.js.map +1 -0
- package/dist/composer/asset-picker-url.d.ts +16 -0
- package/dist/composer/asset-picker-url.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.js +64 -0
- package/dist/composer/asset-picker-url.js.map +1 -0
- package/dist/composer/asset-picker-url.spec.d.ts +2 -0
- package/dist/composer/asset-picker-url.spec.d.ts.map +1 -0
- package/dist/composer/asset-picker-url.spec.js +23 -0
- package/dist/composer/asset-picker-url.spec.js.map +1 -0
- package/dist/composer/attachment-accept.d.ts +9 -0
- package/dist/composer/attachment-accept.d.ts.map +1 -0
- package/dist/composer/attachment-accept.js +69 -0
- package/dist/composer/attachment-accept.js.map +1 -0
- package/dist/composer/attachment-accept.spec.d.ts +2 -0
- package/dist/composer/attachment-accept.spec.d.ts.map +1 -0
- package/dist/composer/attachment-accept.spec.js +24 -0
- package/dist/composer/attachment-accept.spec.js.map +1 -0
- package/dist/composer/draft-key.d.ts +2 -0
- package/dist/composer/draft-key.d.ts.map +1 -0
- package/dist/composer/draft-key.js +8 -0
- package/dist/composer/draft-key.js.map +1 -0
- package/dist/composer/draft-key.spec.d.ts +2 -0
- package/dist/composer/draft-key.spec.d.ts.map +1 -0
- package/dist/composer/draft-key.spec.js +13 -0
- package/dist/composer/draft-key.spec.js.map +1 -0
- package/dist/composer/extensions/FileReference.d.ts +3 -0
- package/dist/composer/extensions/FileReference.d.ts.map +1 -0
- package/dist/composer/extensions/FileReference.js +36 -0
- package/dist/composer/extensions/FileReference.js.map +1 -0
- package/dist/composer/extensions/MentionReference.d.ts +3 -0
- package/dist/composer/extensions/MentionReference.d.ts.map +1 -0
- package/dist/composer/extensions/MentionReference.js +66 -0
- package/dist/composer/extensions/MentionReference.js.map +1 -0
- package/dist/composer/extensions/SkillReference.d.ts +3 -0
- package/dist/composer/extensions/SkillReference.d.ts.map +1 -0
- package/dist/composer/extensions/SkillReference.js +40 -0
- package/dist/composer/extensions/SkillReference.js.map +1 -0
- package/dist/composer/index.d.ts +16 -0
- package/dist/composer/index.d.ts.map +1 -0
- package/dist/composer/index.js +14 -0
- package/dist/composer/index.js.map +1 -0
- package/dist/composer/model-selection.d.ts +12 -0
- package/dist/composer/model-selection.d.ts.map +1 -0
- package/dist/composer/model-selection.js +31 -0
- package/dist/composer/model-selection.js.map +1 -0
- package/dist/composer/model-selection.spec.d.ts +2 -0
- package/dist/composer/model-selection.spec.d.ts.map +1 -0
- package/dist/composer/model-selection.spec.js +38 -0
- package/dist/composer/model-selection.spec.js.map +1 -0
- package/dist/composer/pasted-text.d.ts +31 -0
- package/dist/composer/pasted-text.d.ts.map +1 -0
- package/dist/composer/pasted-text.js +130 -0
- package/dist/composer/pasted-text.js.map +1 -0
- package/dist/composer/pasted-text.spec.d.ts +2 -0
- package/dist/composer/pasted-text.spec.d.ts.map +1 -0
- package/dist/composer/pasted-text.spec.js +107 -0
- package/dist/composer/pasted-text.spec.js.map +1 -0
- package/dist/composer/prompt-attachments.d.ts +18 -0
- package/dist/composer/prompt-attachments.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.js +65 -0
- package/dist/composer/prompt-attachments.js.map +1 -0
- package/dist/composer/prompt-attachments.spec.d.ts +2 -0
- package/dist/composer/prompt-attachments.spec.d.ts.map +1 -0
- package/dist/composer/prompt-attachments.spec.js +63 -0
- package/dist/composer/prompt-attachments.spec.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.d.ts +14 -0
- package/dist/composer/realtime-voice-audio-level.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.js +48 -0
- package/dist/composer/realtime-voice-audio-level.js.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-audio-level.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-audio-level.spec.js +32 -0
- package/dist/composer/realtime-voice-audio-level.spec.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.d.ts +26 -0
- package/dist/composer/realtime-voice-transcript.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.js +103 -0
- package/dist/composer/realtime-voice-transcript.js.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts +2 -0
- package/dist/composer/realtime-voice-transcript.spec.d.ts.map +1 -0
- package/dist/composer/realtime-voice-transcript.spec.js +76 -0
- package/dist/composer/realtime-voice-transcript.spec.js.map +1 -0
- package/dist/composer/runtime-adapters.d.ts +169 -0
- package/dist/composer/runtime-adapters.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.js +141 -0
- package/dist/composer/runtime-adapters.js.map +1 -0
- package/dist/composer/runtime-adapters.spec.d.ts +2 -0
- package/dist/composer/runtime-adapters.spec.d.ts.map +1 -0
- package/dist/composer/runtime-adapters.spec.js +69 -0
- package/dist/composer/runtime-adapters.spec.js.map +1 -0
- package/dist/composer/types.d.ts +60 -0
- package/dist/composer/types.d.ts.map +1 -0
- package/dist/composer/types.js +2 -0
- package/dist/composer/types.js.map +1 -0
- package/dist/composer/use-file-search.d.ts +6 -0
- package/dist/composer/use-file-search.d.ts.map +1 -0
- package/dist/composer/use-file-search.js +53 -0
- package/dist/composer/use-file-search.js.map +1 -0
- package/dist/composer/use-mention-search.d.ts +6 -0
- package/dist/composer/use-mention-search.d.ts.map +1 -0
- package/dist/composer/use-mention-search.js +75 -0
- package/dist/composer/use-mention-search.js.map +1 -0
- package/dist/composer/use-skills.d.ts +7 -0
- package/dist/composer/use-skills.d.ts.map +1 -0
- package/dist/composer/use-skills.js +40 -0
- package/dist/composer/use-skills.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts +189 -0
- package/dist/composer/useRealtimeVoiceMode.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.js +1899 -0
- package/dist/composer/useRealtimeVoiceMode.js.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts +2 -0
- package/dist/composer/useRealtimeVoiceMode.spec.d.ts.map +1 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js +716 -0
- package/dist/composer/useRealtimeVoiceMode.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.browser.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.browser.spec.js +220 -0
- package/dist/composer/useVoiceDictation.browser.spec.js.map +1 -0
- package/dist/composer/useVoiceDictation.d.ts +58 -0
- package/dist/composer/useVoiceDictation.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.js +1058 -0
- package/dist/composer/useVoiceDictation.js.map +1 -0
- package/dist/composer/useVoiceDictation.spec.d.ts +2 -0
- package/dist/composer/useVoiceDictation.spec.d.ts.map +1 -0
- package/dist/composer/useVoiceDictation.spec.js +32 -0
- package/dist/composer/useVoiceDictation.spec.js.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts +7 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.d.ts.map +1 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js +84 -0
- package/dist/conformance/__fixtures__/css-in-js-adapter.js.map +1 -0
- package/dist/conformance/conformance.spec.d.ts +2 -0
- package/dist/conformance/conformance.spec.d.ts.map +1 -0
- package/dist/conformance/conformance.spec.js +87 -0
- package/dist/conformance/conformance.spec.js.map +1 -0
- package/dist/conformance/index.d.ts +4 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +4 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/conformance/runner.d.ts +12 -0
- package/dist/conformance/runner.d.ts.map +1 -0
- package/dist/conformance/runner.js +515 -0
- package/dist/conformance/runner.js.map +1 -0
- package/dist/conformance/types.d.ts +26 -0
- package/dist/conformance/types.d.ts.map +1 -0
- package/dist/conformance/types.js +13 -0
- package/dist/conformance/types.js.map +1 -0
- package/dist/conformance/version.d.ts +6 -0
- package/dist/conformance/version.d.ts.map +1 -0
- package/dist/conformance/version.js +14 -0
- package/dist/conformance/version.js.map +1 -0
- package/dist/context-ui/ContextMeter.d.ts +11 -0
- package/dist/context-ui/ContextMeter.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.js +40 -0
- package/dist/context-ui/ContextMeter.js.map +1 -0
- package/dist/context-ui/ContextMeter.spec.d.ts +2 -0
- package/dist/context-ui/ContextMeter.spec.d.ts.map +1 -0
- package/dist/context-ui/ContextMeter.spec.js +52 -0
- package/dist/context-ui/ContextMeter.spec.js.map +1 -0
- package/dist/context-ui/ContextSegmentRow.d.ts +16 -0
- package/dist/context-ui/ContextSegmentRow.d.ts.map +1 -0
- package/dist/context-ui/ContextSegmentRow.js +92 -0
- package/dist/context-ui/ContextSegmentRow.js.map +1 -0
- package/dist/context-ui/ContextTreemap.d.ts +8 -0
- package/dist/context-ui/ContextTreemap.d.ts.map +1 -0
- package/dist/context-ui/ContextTreemap.js +58 -0
- package/dist/context-ui/ContextTreemap.js.map +1 -0
- package/dist/context-ui/ContextXRayPanel.d.ts +14 -0
- package/dist/context-ui/ContextXRayPanel.d.ts.map +1 -0
- package/dist/context-ui/ContextXRayPanel.js +209 -0
- package/dist/context-ui/ContextXRayPanel.js.map +1 -0
- package/dist/context-ui/format.d.ts +6 -0
- package/dist/context-ui/format.d.ts.map +1 -0
- package/dist/context-ui/format.js +58 -0
- package/dist/context-ui/format.js.map +1 -0
- package/dist/context-ui/index.d.ts +7 -0
- package/dist/context-ui/index.d.ts.map +1 -0
- package/dist/context-ui/index.js +6 -0
- package/dist/context-ui/index.js.map +1 -0
- package/dist/context-ui/types.d.ts +41 -0
- package/dist/context-ui/types.d.ts.map +1 -0
- package/dist/context-ui/types.js +8 -0
- package/dist/context-ui/types.js.map +1 -0
- package/dist/dashboard/DataTable.d.ts +20 -0
- package/dist/dashboard/DataTable.d.ts.map +1 -0
- package/dist/dashboard/DataTable.js +87 -0
- package/dist/dashboard/DataTable.js.map +1 -0
- package/dist/dashboard/DateRangePicker.d.ts +15 -0
- package/dist/dashboard/DateRangePicker.d.ts.map +1 -0
- package/dist/dashboard/DateRangePicker.js +15 -0
- package/dist/dashboard/DateRangePicker.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.d.ts +57 -0
- package/dist/dashboard/GenericChartPanel.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.js +119 -0
- package/dist/dashboard/GenericChartPanel.js.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts +2 -0
- package/dist/dashboard/GenericChartPanel.spec.d.ts.map +1 -0
- package/dist/dashboard/GenericChartPanel.spec.js +41 -0
- package/dist/dashboard/GenericChartPanel.spec.js.map +1 -0
- package/dist/dashboard/MetricCard.d.ts +14 -0
- package/dist/dashboard/MetricCard.d.ts.map +1 -0
- package/dist/dashboard/MetricCard.js +10 -0
- package/dist/dashboard/MetricCard.js.map +1 -0
- package/dist/dashboard/StatsCard.d.ts +16 -0
- package/dist/dashboard/StatsCard.d.ts.map +1 -0
- package/dist/dashboard/StatsCard.js +8 -0
- package/dist/dashboard/StatsCard.js.map +1 -0
- package/dist/dashboard/dashboard-layout.d.ts +49 -0
- package/dist/dashboard/dashboard-layout.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.js +231 -0
- package/dist/dashboard/dashboard-layout.js.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts +2 -0
- package/dist/dashboard/dashboard-layout.spec.d.ts.map +1 -0
- package/dist/dashboard/dashboard-layout.spec.js +52 -0
- package/dist/dashboard/dashboard-layout.spec.js.map +1 -0
- package/dist/dashboard/index.d.ts +7 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +7 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/data-grid/DataGrid.d.ts +92 -0
- package/dist/data-grid/DataGrid.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.js +315 -0
- package/dist/data-grid/DataGrid.js.map +1 -0
- package/dist/data-grid/DataGrid.spec.d.ts +2 -0
- package/dist/data-grid/DataGrid.spec.d.ts.map +1 -0
- package/dist/data-grid/DataGrid.spec.js +134 -0
- package/dist/data-grid/DataGrid.spec.js.map +1 -0
- package/dist/data-grid/index.d.ts +2 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/design-system/components.d.ts +58 -0
- package/dist/design-system/components.d.ts.map +1 -0
- package/dist/design-system/components.js +88 -0
- package/dist/design-system/components.js.map +1 -0
- package/dist/design-system/context.d.ts +11 -0
- package/dist/design-system/context.d.ts.map +1 -0
- package/dist/design-system/context.js +17 -0
- package/dist/design-system/context.js.map +1 -0
- package/dist/design-system/default-adapter.d.ts +3 -0
- package/dist/design-system/default-adapter.d.ts.map +1 -0
- package/dist/design-system/default-adapter.js +172 -0
- package/dist/design-system/default-adapter.js.map +1 -0
- package/dist/design-system/default-adapter.spec.d.ts +2 -0
- package/dist/design-system/default-adapter.spec.d.ts.map +1 -0
- package/dist/design-system/default-adapter.spec.js +108 -0
- package/dist/design-system/default-adapter.spec.js.map +1 -0
- package/dist/design-system/definition.d.ts +9 -0
- package/dist/design-system/definition.d.ts.map +1 -0
- package/dist/design-system/definition.js +4 -0
- package/dist/design-system/definition.js.map +1 -0
- package/dist/design-system/design-system.spec.d.ts +2 -0
- package/dist/design-system/design-system.spec.d.ts.map +1 -0
- package/dist/design-system/design-system.spec.js +208 -0
- package/dist/design-system/design-system.spec.js.map +1 -0
- package/dist/design-system/error-boundary.d.ts +18 -0
- package/dist/design-system/error-boundary.d.ts.map +1 -0
- package/dist/design-system/error-boundary.js +16 -0
- package/dist/design-system/error-boundary.js.map +1 -0
- package/dist/design-system/index.d.ts +8 -0
- package/dist/design-system/index.d.ts.map +1 -0
- package/dist/design-system/index.js +8 -0
- package/dist/design-system/index.js.map +1 -0
- package/dist/design-system/theme.d.ts +30 -0
- package/dist/design-system/theme.d.ts.map +1 -0
- package/dist/design-system/theme.js +95 -0
- package/dist/design-system/theme.js.map +1 -0
- package/dist/design-system/theme.spec.d.ts +2 -0
- package/dist/design-system/theme.spec.d.ts.map +1 -0
- package/dist/design-system/theme.spec.js +43 -0
- package/dist/design-system/theme.spec.js.map +1 -0
- package/dist/design-system/types.d.ts +292 -0
- package/dist/design-system/types.d.ts.map +1 -0
- package/dist/design-system/types.js +2 -0
- package/dist/design-system/types.js.map +1 -0
- package/dist/design-tweaks/index.d.ts +2 -0
- package/dist/design-tweaks/index.d.ts.map +1 -0
- package/dist/design-tweaks/index.js +2 -0
- package/dist/design-tweaks/index.js.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts +61 -0
- package/dist/design-tweaks/scrub-input-utils.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input-utils.js +235 -0
- package/dist/design-tweaks/scrub-input-utils.js.map +1 -0
- package/dist/design-tweaks/scrub-input.d.ts +70 -0
- package/dist/design-tweaks/scrub-input.d.ts.map +1 -0
- package/dist/design-tweaks/scrub-input.js +319 -0
- package/dist/design-tweaks/scrub-input.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.d.ts +90 -0
- package/dist/design-tweaks/visual-style-controls.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.js +423 -0
- package/dist/design-tweaks/visual-style-controls.js.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts +2 -0
- package/dist/design-tweaks/visual-style-controls.spec.d.ts.map +1 -0
- package/dist/design-tweaks/visual-style-controls.spec.js +84 -0
- package/dist/design-tweaks/visual-style-controls.spec.js.map +1 -0
- package/dist/editor/BubbleToolbar.d.ts +37 -0
- package/dist/editor/BubbleToolbar.d.ts.map +1 -0
- package/dist/editor/BubbleToolbar.js +171 -0
- package/dist/editor/BubbleToolbar.js.map +1 -0
- package/dist/editor/CodeBlockNode.d.ts +49 -0
- package/dist/editor/CodeBlockNode.d.ts.map +1 -0
- package/dist/editor/CodeBlockNode.js +127 -0
- package/dist/editor/CodeBlockNode.js.map +1 -0
- package/dist/editor/DragHandle.d.ts +103 -0
- package/dist/editor/DragHandle.d.ts.map +1 -0
- package/dist/editor/DragHandle.js +1101 -0
- package/dist/editor/DragHandle.js.map +1 -0
- package/dist/editor/DragHandle.spec.d.ts +2 -0
- package/dist/editor/DragHandle.spec.d.ts.map +1 -0
- package/dist/editor/DragHandle.spec.js +495 -0
- package/dist/editor/DragHandle.spec.js.map +1 -0
- package/dist/editor/ImageExtension.d.ts +63 -0
- package/dist/editor/ImageExtension.d.ts.map +1 -0
- package/dist/editor/ImageExtension.js +243 -0
- package/dist/editor/ImageExtension.js.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts +2 -0
- package/dist/editor/ImageExtension.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js +103 -0
- package/dist/editor/ImageExtension.roundtrip.spec.js.map +1 -0
- package/dist/editor/RegistryBlockContext.d.ts +68 -0
- package/dist/editor/RegistryBlockContext.d.ts.map +1 -0
- package/dist/editor/RegistryBlockContext.js +10 -0
- package/dist/editor/RegistryBlockContext.js.map +1 -0
- package/dist/editor/RegistryBlockNode.d.ts +66 -0
- package/dist/editor/RegistryBlockNode.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.js +406 -0
- package/dist/editor/RegistryBlockNode.js.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts +2 -0
- package/dist/editor/RegistryBlockNode.spec.d.ts.map +1 -0
- package/dist/editor/RegistryBlockNode.spec.js +215 -0
- package/dist/editor/RegistryBlockNode.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js +65 -0
- package/dist/editor/RichMarkdownEditor.collab.spec.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.d.ts +52 -0
- package/dist/editor/RichMarkdownEditor.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.js +38 -0
- package/dist/editor/RichMarkdownEditor.js.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts +2 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.d.ts.map +1 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js +186 -0
- package/dist/editor/RichMarkdownEditor.roundtrip.spec.js.map +1 -0
- package/dist/editor/RunId.d.ts +28 -0
- package/dist/editor/RunId.d.ts.map +1 -0
- package/dist/editor/RunId.js +60 -0
- package/dist/editor/RunId.js.map +1 -0
- package/dist/editor/SharedRichEditor.d.ts +112 -0
- package/dist/editor/SharedRichEditor.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.js +159 -0
- package/dist/editor/SharedRichEditor.js.map +1 -0
- package/dist/editor/SharedRichEditor.spec.d.ts +2 -0
- package/dist/editor/SharedRichEditor.spec.d.ts.map +1 -0
- package/dist/editor/SharedRichEditor.spec.js +63 -0
- package/dist/editor/SharedRichEditor.spec.js.map +1 -0
- package/dist/editor/SlashCommandMenu.d.ts +59 -0
- package/dist/editor/SlashCommandMenu.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.js +279 -0
- package/dist/editor/SlashCommandMenu.js.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts +2 -0
- package/dist/editor/SlashCommandMenu.spec.d.ts.map +1 -0
- package/dist/editor/SlashCommandMenu.spec.js +67 -0
- package/dist/editor/SlashCommandMenu.spec.js.map +1 -0
- package/dist/editor/disableHistory.spec.d.ts +2 -0
- package/dist/editor/disableHistory.spec.d.ts.map +1 -0
- package/dist/editor/disableHistory.spec.js +73 -0
- package/dist/editor/disableHistory.spec.js.map +1 -0
- package/dist/editor/extensions.d.ts +178 -0
- package/dist/editor/extensions.d.ts.map +1 -0
- package/dist/editor/extensions.js +264 -0
- package/dist/editor/extensions.js.map +1 -0
- package/dist/editor/gfmDoc.d.ts +24 -0
- package/dist/editor/gfmDoc.d.ts.map +1 -0
- package/dist/editor/gfmDoc.js +83 -0
- package/dist/editor/gfmDoc.js.map +1 -0
- package/dist/editor/gfmDoc.spec.d.ts +2 -0
- package/dist/editor/gfmDoc.spec.d.ts.map +1 -0
- package/dist/editor/gfmDoc.spec.js +194 -0
- package/dist/editor/gfmDoc.spec.js.map +1 -0
- package/dist/editor/index.d.ts +16 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +15 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/registrySlashCommands.d.ts +68 -0
- package/dist/editor/registrySlashCommands.d.ts.map +1 -0
- package/dist/editor/registrySlashCommands.js +51 -0
- package/dist/editor/registrySlashCommands.js.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts +2 -0
- package/dist/editor/structuralReorderUndo.spec.d.ts.map +1 -0
- package/dist/editor/structuralReorderUndo.spec.js +120 -0
- package/dist/editor/structuralReorderUndo.spec.js.map +1 -0
- package/dist/editor/surgical-apply.d.ts +66 -0
- package/dist/editor/surgical-apply.d.ts.map +1 -0
- package/dist/editor/surgical-apply.js +147 -0
- package/dist/editor/surgical-apply.js.map +1 -0
- package/dist/editor/surgical-apply.spec.d.ts +2 -0
- package/dist/editor/surgical-apply.spec.d.ts.map +1 -0
- package/dist/editor/surgical-apply.spec.js +257 -0
- package/dist/editor/surgical-apply.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js +641 -0
- package/dist/editor/useCollabReconcile.concurrent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.d.ts +117 -0
- package/dist/editor/useCollabReconcile.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts +2 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.d.ts.map +1 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js +248 -0
- package/dist/editor/useCollabReconcile.idempotent.spec.js.map +1 -0
- package/dist/editor/useCollabReconcile.js +521 -0
- package/dist/editor/useCollabReconcile.js.map +1 -0
- package/dist/editor.css +587 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +127 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/onboarding/index.d.ts +2 -0
- package/dist/onboarding/index.d.ts.map +1 -0
- package/dist/onboarding/index.js +2 -0
- package/dist/onboarding/index.js.map +1 -0
- package/dist/provider.d.ts +15 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +60 -0
- package/dist/provider.js.map +1 -0
- package/dist/sharing/SharePrimitives.d.ts +42 -0
- package/dist/sharing/SharePrimitives.d.ts.map +1 -0
- package/dist/sharing/SharePrimitives.js +53 -0
- package/dist/sharing/SharePrimitives.js.map +1 -0
- package/dist/sharing/VisibilityBadge.d.ts +11 -0
- package/dist/sharing/VisibilityBadge.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.js +19 -0
- package/dist/sharing/VisibilityBadge.js.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts +2 -0
- package/dist/sharing/VisibilityBadge.spec.d.ts.map +1 -0
- package/dist/sharing/VisibilityBadge.spec.js +60 -0
- package/dist/sharing/VisibilityBadge.spec.js.map +1 -0
- package/dist/sharing/index.d.ts +3 -0
- package/dist/sharing/index.d.ts.map +1 -0
- package/dist/sharing/index.js +3 -0
- package/dist/sharing/index.js.map +1 -0
- package/dist/styles.css +232 -0
- package/dist/ui/accordion.d.ts +8 -0
- package/dist/ui/accordion.d.ts.map +1 -0
- package/dist/ui/accordion.js +14 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert-dialog.d.ts +21 -0
- package/dist/ui/alert-dialog.d.ts.map +1 -0
- package/dist/ui/alert-dialog.js +27 -0
- package/dist/ui/alert-dialog.js.map +1 -0
- package/dist/ui/alert.d.ts +9 -0
- package/dist/ui/alert.d.ts.map +1 -0
- package/dist/ui/alert.js +23 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/aspect-ratio.d.ts +4 -0
- package/dist/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/ui/aspect-ratio.js +4 -0
- package/dist/ui/aspect-ratio.js.map +1 -0
- package/dist/ui/avatar.d.ts +7 -0
- package/dist/ui/avatar.d.ts.map +1 -0
- package/dist/ui/avatar.js +12 -0
- package/dist/ui/avatar.js.map +1 -0
- package/dist/ui/badge.d.ts +10 -0
- package/dist/ui/badge.d.ts.map +1 -0
- package/dist/ui/badge.js +21 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/breadcrumb.d.ts +20 -0
- package/dist/ui/breadcrumb.d.ts.map +1 -0
- package/dist/ui/breadcrumb.js +24 -0
- package/dist/ui/breadcrumb.js.map +1 -0
- package/dist/ui/button.d.ts +18 -0
- package/dist/ui/button.d.ts.map +1 -0
- package/dist/ui/button.js +67 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/calendar.d.ts +9 -0
- package/dist/ui/calendar.d.ts.map +1 -0
- package/dist/ui/calendar.js +74 -0
- package/dist/ui/calendar.js.map +1 -0
- package/dist/ui/card.d.ts +9 -0
- package/dist/ui/card.d.ts.map +1 -0
- package/dist/ui/card.js +17 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/carousel.d.ts +19 -0
- package/dist/ui/carousel.d.ts.map +1 -0
- package/dist/ui/carousel.js +99 -0
- package/dist/ui/carousel.js.map +1 -0
- package/dist/ui/chart.d.ts +80 -0
- package/dist/ui/chart.d.ts.map +1 -0
- package/dist/ui/chart.js +131 -0
- package/dist/ui/chart.js.map +1 -0
- package/dist/ui/checkbox.d.ts +5 -0
- package/dist/ui/checkbox.d.ts.map +1 -0
- package/dist/ui/checkbox.js +9 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/collapsible.d.ts +6 -0
- package/dist/ui/collapsible.d.ts.map +1 -0
- package/dist/ui/collapsible.js +6 -0
- package/dist/ui/collapsible.js.map +1 -0
- package/dist/ui/command.d.ts +85 -0
- package/dist/ui/command.d.ts.map +1 -0
- package/dist/ui/command.js +29 -0
- package/dist/ui/command.js.map +1 -0
- package/dist/ui/command.spec.d.ts +2 -0
- package/dist/ui/command.spec.d.ts.map +1 -0
- package/dist/ui/command.spec.js +29 -0
- package/dist/ui/command.spec.js.map +1 -0
- package/dist/ui/context-menu.d.ts +28 -0
- package/dist/ui/context-menu.d.ts.map +1 -0
- package/dist/ui/context-menu.js +34 -0
- package/dist/ui/context-menu.js.map +1 -0
- package/dist/ui/date-picker.d.ts +10 -0
- package/dist/ui/date-picker.d.ts.map +1 -0
- package/dist/ui/date-picker.js +20 -0
- package/dist/ui/date-picker.js.map +1 -0
- package/dist/ui/dialog.d.ts +32 -0
- package/dist/ui/dialog.d.ts.map +1 -0
- package/dist/ui/dialog.js +26 -0
- package/dist/ui/dialog.js.map +1 -0
- package/dist/ui/dialog.spec.d.ts +2 -0
- package/dist/ui/dialog.spec.d.ts.map +1 -0
- package/dist/ui/dialog.spec.js +21 -0
- package/dist/ui/dialog.spec.js.map +1 -0
- package/dist/ui/drawer.d.ts +35 -0
- package/dist/ui/drawer.d.ts.map +1 -0
- package/dist/ui/drawer.js +25 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown-menu.d.ts +32 -0
- package/dist/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/ui/dropdown-menu.js +42 -0
- package/dist/ui/dropdown-menu.js.map +1 -0
- package/dist/ui/form.d.ts +26 -0
- package/dist/ui/form.d.ts.map +1 -0
- package/dist/ui/form.js +63 -0
- package/dist/ui/form.js.map +1 -0
- package/dist/ui/hover-card.d.ts +7 -0
- package/dist/ui/hover-card.d.ts.map +1 -0
- package/dist/ui/hover-card.js +10 -0
- package/dist/ui/hover-card.js.map +1 -0
- package/dist/ui/index.d.ts +53 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +53 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/input-otp.d.ts +35 -0
- package/dist/ui/input-otp.d.ts.map +1 -0
- package/dist/ui/input-otp.js +19 -0
- package/dist/ui/input-otp.js.map +1 -0
- package/dist/ui/input.d.ts +4 -0
- package/dist/ui/input.d.ts.map +1 -0
- package/dist/ui/input.js +9 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/label.d.ts +6 -0
- package/dist/ui/label.d.ts.map +1 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -0
- package/dist/ui/logo.d.ts +7 -0
- package/dist/ui/logo.d.ts.map +1 -0
- package/dist/ui/logo.js +10 -0
- package/dist/ui/logo.js.map +1 -0
- package/dist/ui/menubar.d.ts +29 -0
- package/dist/ui/menubar.d.ts.map +1 -0
- package/dist/ui/menubar.js +36 -0
- package/dist/ui/menubar.js.map +1 -0
- package/dist/ui/navigation-menu.d.ts +13 -0
- package/dist/ui/navigation-menu.d.ts.map +1 -0
- package/dist/ui/navigation-menu.js +25 -0
- package/dist/ui/navigation-menu.js.map +1 -0
- package/dist/ui/pagination.d.ts +29 -0
- package/dist/ui/pagination.d.ts.map +1 -0
- package/dist/ui/pagination.js +24 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/popover.d.ts +11 -0
- package/dist/ui/popover.d.ts.map +1 -0
- package/dist/ui/popover.js +16 -0
- package/dist/ui/popover.js.map +1 -0
- package/dist/ui/progress.d.ts +5 -0
- package/dist/ui/progress.d.ts.map +1 -0
- package/dist/ui/progress.js +8 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +15 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/resizable.d.ts +8 -0
- package/dist/ui/resizable.d.ts.map +1 -0
- package/dist/ui/resizable.js +9 -0
- package/dist/ui/resizable.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +6 -0
- package/dist/ui/scroll-area.d.ts.map +1 -0
- package/dist/ui/scroll-area.js +12 -0
- package/dist/ui/scroll-area.js.map +1 -0
- package/dist/ui/select.d.ts +16 -0
- package/dist/ui/select.d.ts.map +1 -0
- package/dist/ui/select.js +27 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/separator.d.ts +5 -0
- package/dist/ui/separator.d.ts.map +1 -0
- package/dist/ui/separator.js +8 -0
- package/dist/ui/separator.js.map +1 -0
- package/dist/ui/sheet.d.ts +29 -0
- package/dist/ui/sheet.d.ts.map +1 -0
- package/dist/ui/sheet.js +37 -0
- package/dist/ui/sheet.js.map +1 -0
- package/dist/ui/sidebar.d.ts +71 -0
- package/dist/ui/sidebar.d.ts.map +1 -0
- package/dist/ui/sidebar.js +230 -0
- package/dist/ui/sidebar.js.map +1 -0
- package/dist/ui/skeleton.d.ts +3 -0
- package/dist/ui/skeleton.d.ts.map +1 -0
- package/dist/ui/skeleton.js +7 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +5 -0
- package/dist/ui/slider.d.ts.map +1 -0
- package/dist/ui/slider.js +8 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/sonner.d.ts +5 -0
- package/dist/ui/sonner.d.ts.map +1 -0
- package/dist/ui/sonner.js +25 -0
- package/dist/ui/sonner.js.map +1 -0
- package/dist/ui/spinner.d.ts +3 -0
- package/dist/ui/spinner.d.ts.map +1 -0
- package/dist/ui/spinner.js +7 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/ui/switch.js +8 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/table.d.ts +11 -0
- package/dist/ui/table.d.ts.map +1 -0
- package/dist/ui/table.js +21 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.d.ts +8 -0
- package/dist/ui/tabs.d.ts.map +1 -0
- package/dist/ui/tabs.js +13 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/textarea.d.ts +6 -0
- package/dist/ui/textarea.d.ts.map +1 -0
- package/dist/ui/textarea.js +9 -0
- package/dist/ui/textarea.js.map +1 -0
- package/dist/ui/toast.d.ts +16 -0
- package/dist/ui/toast.d.ts.map +1 -0
- package/dist/ui/toast.js +34 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toaster.d.ts +2 -0
- package/dist/ui/toaster.d.ts.map +1 -0
- package/dist/ui/toaster.js +10 -0
- package/dist/ui/toaster.js.map +1 -0
- package/dist/ui/toggle-group.d.ts +13 -0
- package/dist/ui/toggle-group.d.ts.map +1 -0
- package/dist/ui/toggle-group.js +21 -0
- package/dist/ui/toggle-group.js.map +1 -0
- package/dist/ui/toggle.d.ts +13 -0
- package/dist/ui/toggle.d.ts.map +1 -0
- package/dist/ui/toggle.js +26 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.d.ts +11 -0
- package/dist/ui/tooltip.d.ts.map +1 -0
- package/dist/ui/tooltip.js +18 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/ui/use-toast.d.ts +3 -0
- package/dist/ui/use-toast.d.ts.map +1 -0
- package/dist/ui/use-toast.js +3 -0
- package/dist/ui/use-toast.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/migration-manifest.json +4 -0
- package/package.json +369 -0
- package/src/app-shell/header-actions.tsx +84 -0
- package/src/app-shell/index.ts +2 -0
- package/src/app-shell/sidebar-footer-actions.spec.tsx +81 -0
- package/src/app-shell/sidebar-footer-actions.tsx +45 -0
- package/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
- package/src/canvas-annotations/DrawOverlay.spec.tsx +145 -0
- package/src/canvas-annotations/DrawOverlay.tsx +1233 -0
- package/src/canvas-annotations/index.ts +15 -0
- package/src/canvas-annotations/types.ts +14 -0
- package/src/canvas-interactions/canvas-interactions.spec.ts +765 -0
- package/src/canvas-interactions/canvas-interactions.ts +965 -0
- package/src/canvas-interactions/index.ts +67 -0
- package/src/chat-history/ChatHistoryList.spec.tsx +485 -0
- package/src/chat-history/ChatHistoryList.tsx +481 -0
- package/src/chat-history/ChatHistoryRail.spec.tsx +312 -0
- package/src/chat-history/ChatHistoryRail.tsx +150 -0
- package/src/chat-history/index.ts +21 -0
- package/src/chat-history/useChatHistoryRailController.spec.tsx +131 -0
- package/src/chat-history/useChatHistoryRailController.ts +76 -0
- package/src/chat-history.css +469 -0
- package/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/src/collab-ui/PresenceBar.spec.tsx +44 -0
- package/src/collab-ui/PresenceBar.tsx +373 -0
- package/src/collab-ui/RecentEditHighlights.tsx +239 -0
- package/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/src/collab-ui/agent-identity.ts +16 -0
- package/src/collab-ui/index.ts +39 -0
- package/src/collab-ui/lead-client.ts +32 -0
- package/src/collab-ui/types.spec.ts +18 -0
- package/src/collab-ui/types.ts +96 -0
- package/src/composer/AgentComposerFrame.tsx +62 -0
- package/src/composer/ComposerPlusMenu.spec.ts +14 -0
- package/src/composer/ComposerPlusMenu.tsx +1266 -0
- package/src/composer/MentionPopover.tsx +483 -0
- package/src/composer/PastedTextChip.spec.tsx +58 -0
- package/src/composer/PastedTextChip.tsx +178 -0
- package/src/composer/PromptComposer.spec.ts +110 -0
- package/src/composer/PromptComposer.tsx +796 -0
- package/src/composer/RealtimeVoiceMode.spec.tsx +998 -0
- package/src/composer/RealtimeVoiceMode.tsx +1019 -0
- package/src/composer/TiptapComposer.spec.ts +592 -0
- package/src/composer/TiptapComposer.tsx +3746 -0
- package/src/composer/VoiceButton.spec.ts +49 -0
- package/src/composer/VoiceButton.tsx +329 -0
- package/src/composer/asset-picker-url.spec.ts +56 -0
- package/src/composer/asset-picker-url.ts +80 -0
- package/src/composer/attachment-accept.spec.ts +32 -0
- package/src/composer/attachment-accept.ts +75 -0
- package/src/composer/draft-key.spec.ts +19 -0
- package/src/composer/draft-key.ts +7 -0
- package/src/composer/extensions/FileReference.tsx +55 -0
- package/src/composer/extensions/MentionReference.tsx +93 -0
- package/src/composer/extensions/SkillReference.tsx +56 -0
- package/src/composer/index.ts +86 -0
- package/src/composer/model-selection.spec.ts +45 -0
- package/src/composer/model-selection.ts +51 -0
- package/src/composer/pasted-text.spec.ts +162 -0
- package/src/composer/pasted-text.ts +160 -0
- package/src/composer/prompt-attachments.spec.ts +80 -0
- package/src/composer/prompt-attachments.ts +93 -0
- package/src/composer/realtime-voice-audio-level.spec.ts +47 -0
- package/src/composer/realtime-voice-audio-level.ts +65 -0
- package/src/composer/realtime-voice-transcript.spec.ts +95 -0
- package/src/composer/realtime-voice-transcript.ts +134 -0
- package/src/composer/runtime-adapters.spec.tsx +102 -0
- package/src/composer/runtime-adapters.tsx +364 -0
- package/src/composer/types.ts +66 -0
- package/src/composer/use-file-search.ts +64 -0
- package/src/composer/use-mention-search.ts +90 -0
- package/src/composer/use-skills.ts +45 -0
- package/src/composer/useRealtimeVoiceMode.spec.ts +952 -0
- package/src/composer/useRealtimeVoiceMode.tsx +2388 -0
- package/src/composer/useVoiceDictation.browser.spec.tsx +265 -0
- package/src/composer/useVoiceDictation.spec.ts +45 -0
- package/src/composer/useVoiceDictation.ts +1256 -0
- package/src/conformance/__fixtures__/css-in-js-adapter.tsx +401 -0
- package/src/conformance/conformance.spec.tsx +143 -0
- package/src/conformance/index.ts +3 -0
- package/src/conformance/runner.tsx +862 -0
- package/src/conformance/types.ts +45 -0
- package/src/conformance/version.ts +22 -0
- package/src/context-ui/ContextMeter.spec.tsx +73 -0
- package/src/context-ui/ContextMeter.tsx +131 -0
- package/src/context-ui/ContextSegmentRow.tsx +273 -0
- package/src/context-ui/ContextTreemap.tsx +131 -0
- package/src/context-ui/ContextXRayPanel.tsx +491 -0
- package/src/context-ui/format.ts +42 -0
- package/src/context-ui/index.ts +15 -0
- package/src/context-ui/types.ts +57 -0
- package/src/dashboard/DataTable.tsx +273 -0
- package/src/dashboard/DateRangePicker.tsx +57 -0
- package/src/dashboard/GenericChartPanel.spec.tsx +53 -0
- package/src/dashboard/GenericChartPanel.tsx +461 -0
- package/src/dashboard/MetricCard.tsx +54 -0
- package/src/dashboard/StatsCard.tsx +49 -0
- package/src/dashboard/dashboard-layout.spec.ts +79 -0
- package/src/dashboard/dashboard-layout.ts +329 -0
- package/src/dashboard/index.ts +6 -0
- package/src/data-grid/DataGrid.spec.tsx +243 -0
- package/src/data-grid/DataGrid.tsx +754 -0
- package/src/data-grid/index.ts +15 -0
- package/src/design-system/components.tsx +196 -0
- package/src/design-system/context.tsx +31 -0
- package/src/design-system/default-adapter.spec.tsx +158 -0
- package/src/design-system/default-adapter.tsx +923 -0
- package/src/design-system/definition.ts +14 -0
- package/src/design-system/design-system.spec.tsx +356 -0
- package/src/design-system/error-boundary.tsx +37 -0
- package/src/design-system/index.ts +7 -0
- package/src/design-system/theme.spec.ts +61 -0
- package/src/design-system/theme.ts +145 -0
- package/src/design-system/types.ts +367 -0
- package/src/design-tweaks/index.ts +1 -0
- package/src/design-tweaks/scrub-input-utils.ts +311 -0
- package/src/design-tweaks/scrub-input.tsx +525 -0
- package/src/design-tweaks/visual-style-controls.spec.tsx +172 -0
- package/src/design-tweaks/visual-style-controls.tsx +1043 -0
- package/src/editor/BubbleToolbar.tsx +253 -0
- package/src/editor/CodeBlockNode.tsx +254 -0
- package/src/editor/DragHandle.spec.ts +694 -0
- package/src/editor/DragHandle.ts +1491 -0
- package/src/editor/ImageExtension.roundtrip.spec.ts +117 -0
- package/src/editor/ImageExtension.ts +306 -0
- package/src/editor/RegistryBlockContext.tsx +107 -0
- package/src/editor/RegistryBlockNode.spec.ts +279 -0
- package/src/editor/RegistryBlockNode.tsx +652 -0
- package/src/editor/RichMarkdownEditor.collab.spec.ts +79 -0
- package/src/editor/RichMarkdownEditor.roundtrip.spec.ts +226 -0
- package/src/editor/RichMarkdownEditor.tsx +81 -0
- package/src/editor/RunId.ts +61 -0
- package/src/editor/SharedRichEditor.spec.tsx +82 -0
- package/src/editor/SharedRichEditor.tsx +353 -0
- package/src/editor/SlashCommandMenu.spec.ts +90 -0
- package/src/editor/SlashCommandMenu.tsx +396 -0
- package/src/editor/disableHistory.spec.ts +85 -0
- package/src/editor/extensions.ts +454 -0
- package/src/editor/gfmDoc.spec.ts +230 -0
- package/src/editor/gfmDoc.ts +92 -0
- package/src/editor/index.ts +96 -0
- package/src/editor/registrySlashCommands.ts +131 -0
- package/src/editor/structuralReorderUndo.spec.ts +144 -0
- package/src/editor/surgical-apply.spec.ts +279 -0
- package/src/editor/surgical-apply.ts +192 -0
- package/src/editor/useCollabReconcile.concurrent.spec.ts +781 -0
- package/src/editor/useCollabReconcile.idempotent.spec.ts +324 -0
- package/src/editor/useCollabReconcile.ts +684 -0
- package/src/editor.css +587 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/use-mobile.tsx +21 -0
- package/src/hooks/use-toast.ts +188 -0
- package/src/index.ts +10 -0
- package/src/onboarding/index.ts +1 -0
- package/src/provider.tsx +148 -0
- package/src/sharing/SharePrimitives.tsx +224 -0
- package/src/sharing/VisibilityBadge.spec.ts +96 -0
- package/src/sharing/VisibilityBadge.tsx +37 -0
- package/src/sharing/index.ts +16 -0
- package/src/styles.css +232 -0
- package/src/ui/accordion.tsx +56 -0
- package/src/ui/alert-dialog.tsx +141 -0
- package/src/ui/alert.tsx +59 -0
- package/src/ui/aspect-ratio.tsx +5 -0
- package/src/ui/avatar.tsx +48 -0
- package/src/ui/badge.tsx +37 -0
- package/src/ui/breadcrumb.tsx +115 -0
- package/src/ui/button.tsx +167 -0
- package/src/ui/calendar.tsx +214 -0
- package/src/ui/card.tsx +86 -0
- package/src/ui/carousel.tsx +260 -0
- package/src/ui/chart.tsx +375 -0
- package/src/ui/checkbox.tsx +28 -0
- package/src/ui/collapsible.tsx +9 -0
- package/src/ui/command.spec.tsx +51 -0
- package/src/ui/command.tsx +174 -0
- package/src/ui/context-menu.tsx +202 -0
- package/src/ui/date-picker.tsx +67 -0
- package/src/ui/dialog.spec.tsx +43 -0
- package/src/ui/dialog.tsx +171 -0
- package/src/ui/drawer.tsx +126 -0
- package/src/ui/dropdown-menu.tsx +222 -0
- package/src/ui/form.tsx +177 -0
- package/src/ui/hover-card.tsx +27 -0
- package/src/ui/index.ts +52 -0
- package/src/ui/input-otp.tsx +69 -0
- package/src/ui/input.tsx +22 -0
- package/src/ui/label.tsx +24 -0
- package/src/ui/logo.tsx +36 -0
- package/src/ui/menubar.tsx +235 -0
- package/src/ui/navigation-menu.tsx +128 -0
- package/src/ui/pagination.tsx +121 -0
- package/src/ui/popover.tsx +58 -0
- package/src/ui/progress.tsx +27 -0
- package/src/ui/radio-group.tsx +42 -0
- package/src/ui/resizable.tsx +43 -0
- package/src/ui/scroll-area.tsx +46 -0
- package/src/ui/select.tsx +162 -0
- package/src/ui/separator.tsx +29 -0
- package/src/ui/sheet.tsx +160 -0
- package/src/ui/sidebar.tsx +776 -0
- package/src/ui/skeleton.tsx +18 -0
- package/src/ui/slider.tsx +26 -0
- package/src/ui/sonner.tsx +58 -0
- package/src/ui/spinner.tsx +17 -0
- package/src/ui/switch.tsx +27 -0
- package/src/ui/table.tsx +110 -0
- package/src/ui/tabs.tsx +53 -0
- package/src/ui/textarea.tsx +23 -0
- package/src/ui/toast.tsx +127 -0
- package/src/ui/toaster.tsx +33 -0
- package/src/ui/toggle-group.tsx +59 -0
- package/src/ui/toggle.tsx +43 -0
- package/src/ui/tooltip.tsx +57 -0
- package/src/ui/use-toast.ts +3 -0
- package/src/utils.ts +8 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
import { Editor as CoreEditor } from "@tiptap/core";
|
|
3
|
+
import { useEditor } from "@tiptap/react";
|
|
4
|
+
import React, { act } from "react";
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
|
+
import { Awareness } from "y-protocols/awareness";
|
|
8
|
+
import * as Y from "yjs";
|
|
9
|
+
import { createRichMarkdownExtensions } from "./RichMarkdownEditor.js";
|
|
10
|
+
import { useCollabReconcile, getEditorMarkdown } from "./useCollabReconcile.js";
|
|
11
|
+
/**
|
|
12
|
+
* Concurrent-edit / lost-update coverage for the reconcile hook (non-collab
|
|
13
|
+
* controlled-value path — the same guards run there, and it's deterministic
|
|
14
|
+
* without a live Yjs peer). The idempotent spec covers the escalation loop;
|
|
15
|
+
* these cover the OTHER lost-update hazards the hook guards against:
|
|
16
|
+
*
|
|
17
|
+
* - A deliberate revert-to-a-previous-value AFTER a local edit must still land
|
|
18
|
+
* (it must not be swallowed as "our own echo").
|
|
19
|
+
* - registerEmitted must refuse to persist an empty doc in collab mode (so a
|
|
20
|
+
* pre-seed empty editor never writes "" over real stored content).
|
|
21
|
+
*
|
|
22
|
+
* NOTE: the "stale poll arrives WHILE the user is actively typing" guard is
|
|
23
|
+
* gated on `editor.isFocused`, which is always false under happy-dom (no real
|
|
24
|
+
* DOM focus). That path is verified in the browser E2E pass instead.
|
|
25
|
+
*/
|
|
26
|
+
let container;
|
|
27
|
+
let root;
|
|
28
|
+
beforeEach(() => {
|
|
29
|
+
globalThis.IS_REACT_ACT_ENVIRONMENT = true;
|
|
30
|
+
container = document.createElement("div");
|
|
31
|
+
document.body.appendChild(container);
|
|
32
|
+
root = createRoot(container);
|
|
33
|
+
});
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
act(() => root.unmount());
|
|
36
|
+
vi.useRealTimers();
|
|
37
|
+
container.remove();
|
|
38
|
+
});
|
|
39
|
+
function makeHarness() {
|
|
40
|
+
const captured = { editor: null, emitted: [], setContentCalls: 0 };
|
|
41
|
+
function Harness({ value, contentUpdatedAt, editorOwnedFocus = false, }) {
|
|
42
|
+
const guardsRef = React.useRef(null);
|
|
43
|
+
const editor = useEditor({
|
|
44
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
45
|
+
content: value,
|
|
46
|
+
onUpdate: ({ editor, transaction }) => {
|
|
47
|
+
const guards = guardsRef.current;
|
|
48
|
+
if (!guards || guards.shouldIgnoreUpdate(transaction))
|
|
49
|
+
return;
|
|
50
|
+
const markdown = getEditorMarkdown(editor);
|
|
51
|
+
if (!guards.registerEmitted(markdown))
|
|
52
|
+
return;
|
|
53
|
+
captured.emitted.push(markdown);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
captured.editor = editor;
|
|
57
|
+
const guards = useCollabReconcile({
|
|
58
|
+
editor,
|
|
59
|
+
value,
|
|
60
|
+
contentUpdatedAt,
|
|
61
|
+
editable: true,
|
|
62
|
+
isEditorFocused: () => editorOwnedFocus,
|
|
63
|
+
getMarkdown: getEditorMarkdown,
|
|
64
|
+
setContent: (ed, v, options) => {
|
|
65
|
+
captured.setContentCalls += 1;
|
|
66
|
+
if (options.addToHistory === false) {
|
|
67
|
+
ed.chain()
|
|
68
|
+
.command(({ tr }) => {
|
|
69
|
+
tr.setMeta("addToHistory", false);
|
|
70
|
+
return true;
|
|
71
|
+
})
|
|
72
|
+
.setContent(v, { emitUpdate: options.emitUpdate })
|
|
73
|
+
.run();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
ed.commands.setContent(v);
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
guardsRef.current = guards;
|
|
80
|
+
captured.registerEmitted = guards.registerEmitted;
|
|
81
|
+
return React.createElement("div", null);
|
|
82
|
+
}
|
|
83
|
+
return { captured, Harness };
|
|
84
|
+
}
|
|
85
|
+
function makeCollabSeedHarness(initialContent = "") {
|
|
86
|
+
const captured = { editor: null, emitted: [], setContentCalls: 0 };
|
|
87
|
+
function Harness({ collabSynced, fragmentLength }) {
|
|
88
|
+
const guardsRef = React.useRef(null);
|
|
89
|
+
const fragmentLengthRef = React.useRef(fragmentLength);
|
|
90
|
+
fragmentLengthRef.current = fragmentLength;
|
|
91
|
+
const fakeYdoc = React.useMemo(() => ({
|
|
92
|
+
clientID: 1,
|
|
93
|
+
getXmlFragment: () => ({ length: fragmentLengthRef.current }),
|
|
94
|
+
}), []);
|
|
95
|
+
const editor = useEditor({
|
|
96
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
97
|
+
content: initialContent,
|
|
98
|
+
onUpdate: ({ editor, transaction }) => {
|
|
99
|
+
const guards = guardsRef.current;
|
|
100
|
+
if (!guards || guards.shouldIgnoreUpdate(transaction))
|
|
101
|
+
return;
|
|
102
|
+
const markdown = getEditorMarkdown(editor);
|
|
103
|
+
if (!guards.registerEmitted(markdown))
|
|
104
|
+
return;
|
|
105
|
+
captured.emitted.push(markdown);
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
captured.editor = editor;
|
|
109
|
+
const guards = useCollabReconcile({
|
|
110
|
+
editor,
|
|
111
|
+
ydoc: fakeYdoc,
|
|
112
|
+
collabSynced,
|
|
113
|
+
value: "seeded content",
|
|
114
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
115
|
+
editable: true,
|
|
116
|
+
getMarkdown: getEditorMarkdown,
|
|
117
|
+
setContent: (ed, v) => {
|
|
118
|
+
captured.setContentCalls += 1;
|
|
119
|
+
ed.commands.setContent(v);
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
guardsRef.current = guards;
|
|
123
|
+
return React.createElement("div", null);
|
|
124
|
+
}
|
|
125
|
+
return { captured, Harness };
|
|
126
|
+
}
|
|
127
|
+
async function flush() {
|
|
128
|
+
await act(async () => {
|
|
129
|
+
await Promise.resolve();
|
|
130
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
131
|
+
await Promise.resolve();
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function render(root, Harness, props) {
|
|
135
|
+
act(() => {
|
|
136
|
+
root.render(React.createElement(Harness, props));
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
describe("useCollabReconcile — concurrent edit / lost-update guards", () => {
|
|
140
|
+
it("persists the first local edit after a synced empty collaborative document", async () => {
|
|
141
|
+
const captured = {
|
|
142
|
+
editor: null,
|
|
143
|
+
emitted: [],
|
|
144
|
+
setContentCalls: 0,
|
|
145
|
+
};
|
|
146
|
+
function EmptyDocumentHarness() {
|
|
147
|
+
const guardsRef = React.useRef(null);
|
|
148
|
+
const insertedRef = React.useRef(false);
|
|
149
|
+
const ydoc = React.useMemo(() => new Y.Doc(), []);
|
|
150
|
+
const editor = useEditor({
|
|
151
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm", ydoc }),
|
|
152
|
+
onUpdate: ({ editor, transaction }) => {
|
|
153
|
+
const guards = guardsRef.current;
|
|
154
|
+
if (!guards || guards.shouldIgnoreUpdate(transaction))
|
|
155
|
+
return;
|
|
156
|
+
const markdown = getEditorMarkdown(editor);
|
|
157
|
+
if (!guards.registerEmitted(markdown))
|
|
158
|
+
return;
|
|
159
|
+
captured.emitted.push(markdown);
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
captured.editor = editor;
|
|
163
|
+
guardsRef.current = useCollabReconcile({
|
|
164
|
+
editor,
|
|
165
|
+
ydoc,
|
|
166
|
+
collabSynced: true,
|
|
167
|
+
value: "",
|
|
168
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
169
|
+
editable: true,
|
|
170
|
+
getMarkdown: getEditorMarkdown,
|
|
171
|
+
});
|
|
172
|
+
React.useLayoutEffect(() => {
|
|
173
|
+
if (!editor || insertedRef.current)
|
|
174
|
+
return;
|
|
175
|
+
insertedRef.current = true;
|
|
176
|
+
editor.view.dispatch(editor.state.tr
|
|
177
|
+
.insertText("First persisted edit")
|
|
178
|
+
.setMeta("uiEvent", "input"));
|
|
179
|
+
}, [editor]);
|
|
180
|
+
return React.createElement("div", null);
|
|
181
|
+
}
|
|
182
|
+
act(() => root.render(React.createElement(EmptyDocumentHarness)));
|
|
183
|
+
await flush();
|
|
184
|
+
expect(captured.emitted).toContain("First persisted edit");
|
|
185
|
+
});
|
|
186
|
+
it("does not seed until initial collab sync has completed", async () => {
|
|
187
|
+
const { captured, Harness } = makeCollabSeedHarness();
|
|
188
|
+
act(() => {
|
|
189
|
+
root.render(React.createElement(Harness, {
|
|
190
|
+
collabSynced: false,
|
|
191
|
+
fragmentLength: 0,
|
|
192
|
+
}));
|
|
193
|
+
});
|
|
194
|
+
await flush();
|
|
195
|
+
expect(captured.setContentCalls).toBe(0);
|
|
196
|
+
act(() => {
|
|
197
|
+
root.render(React.createElement(Harness, {
|
|
198
|
+
collabSynced: true,
|
|
199
|
+
fragmentLength: 0,
|
|
200
|
+
}));
|
|
201
|
+
});
|
|
202
|
+
await flush();
|
|
203
|
+
expect(captured.setContentCalls).toBe(1);
|
|
204
|
+
expect(getEditorMarkdown(captured.editor)).toBe("seeded content");
|
|
205
|
+
});
|
|
206
|
+
it("does not seed after initial collab sync reveals existing canonical content", async () => {
|
|
207
|
+
const { captured, Harness } = makeCollabSeedHarness("seeded content");
|
|
208
|
+
act(() => {
|
|
209
|
+
root.render(React.createElement(Harness, {
|
|
210
|
+
collabSynced: false,
|
|
211
|
+
fragmentLength: 0,
|
|
212
|
+
}));
|
|
213
|
+
});
|
|
214
|
+
await flush();
|
|
215
|
+
act(() => {
|
|
216
|
+
root.render(React.createElement(Harness, {
|
|
217
|
+
collabSynced: true,
|
|
218
|
+
fragmentLength: 1,
|
|
219
|
+
}));
|
|
220
|
+
});
|
|
221
|
+
await flush();
|
|
222
|
+
expect(captured.setContentCalls).toBe(0);
|
|
223
|
+
expect(getEditorMarkdown(captured.editor)).toBe("seeded content");
|
|
224
|
+
});
|
|
225
|
+
it("applies a deliberate REVERT to a previously-applied value after a local edit (not swallowed as echo)", async () => {
|
|
226
|
+
// Regression for the revert-safety carve-out: the doc-equivalence echo
|
|
227
|
+
// guards (value === lastAppliedValueRef) only fire when the editor is
|
|
228
|
+
// UNCHANGED since the last apply. If the user has since edited, an external
|
|
229
|
+
// snapshot equal to a previously-applied value is a REAL revert (e.g. the
|
|
230
|
+
// agent restored an earlier version) and must land, not be skipped.
|
|
231
|
+
const { captured, Harness } = makeHarness();
|
|
232
|
+
// 1. Agent applies V1.
|
|
233
|
+
render(root, Harness, {
|
|
234
|
+
value: "# V1 content",
|
|
235
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
236
|
+
});
|
|
237
|
+
await flush();
|
|
238
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# V1 content");
|
|
239
|
+
// 2. Agent applies V2 (newer). Now lastApplied tracks V2.
|
|
240
|
+
render(root, Harness, {
|
|
241
|
+
value: "# V2 content",
|
|
242
|
+
contentUpdatedAt: "2024-01-01T00:00:02.000Z",
|
|
243
|
+
});
|
|
244
|
+
await flush();
|
|
245
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# V2 content");
|
|
246
|
+
// 3. The agent REVERTS back to the V1 content with a NEWER timestamp (a
|
|
247
|
+
// genuine "undo my last change" external edit). Even though "# V1 content"
|
|
248
|
+
// was applied before, it must re-apply — the newer timestamp makes it a real
|
|
249
|
+
// external change, and the editor currently shows V2 (not V1).
|
|
250
|
+
render(root, Harness, {
|
|
251
|
+
value: "# V1 content",
|
|
252
|
+
contentUpdatedAt: "2024-01-01T00:00:03.000Z",
|
|
253
|
+
});
|
|
254
|
+
await flush();
|
|
255
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# V1 content");
|
|
256
|
+
});
|
|
257
|
+
it("applies a newer authoritative revert that matches a prior mount-time emission", async () => {
|
|
258
|
+
const { captured, Harness } = makeHarness();
|
|
259
|
+
render(root, Harness, {
|
|
260
|
+
value: "# V1 content",
|
|
261
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
262
|
+
});
|
|
263
|
+
await flush();
|
|
264
|
+
render(root, Harness, {
|
|
265
|
+
value: "# V2 content",
|
|
266
|
+
contentUpdatedAt: "2024-01-01T00:00:02.000Z",
|
|
267
|
+
});
|
|
268
|
+
await flush();
|
|
269
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# V2 content");
|
|
270
|
+
// A collab mount/schema-normalization transaction can emit the old V1
|
|
271
|
+
// bytes even though the authoritative apply has already moved the editor
|
|
272
|
+
// to V2. Record that echo without focusing/typing in the editor.
|
|
273
|
+
expect(captured.registerEmitted?.("# V1 content")).toBe(true);
|
|
274
|
+
render(root, Harness, {
|
|
275
|
+
value: "# V1 content",
|
|
276
|
+
contentUpdatedAt: "2024-01-01T00:00:03.000Z",
|
|
277
|
+
});
|
|
278
|
+
await flush();
|
|
279
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# V1 content");
|
|
280
|
+
});
|
|
281
|
+
it("ignores local-looking editor updates until collaborative seeding completes", async () => {
|
|
282
|
+
const results = [];
|
|
283
|
+
function Probe() {
|
|
284
|
+
const editor = useEditor({
|
|
285
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
286
|
+
content: "",
|
|
287
|
+
});
|
|
288
|
+
const fakeYdoc = { clientID: 1, getXmlFragment: () => ({ length: 0 }) };
|
|
289
|
+
const guards = useCollabReconcile({
|
|
290
|
+
editor,
|
|
291
|
+
ydoc: fakeYdoc,
|
|
292
|
+
collabSynced: false,
|
|
293
|
+
value: "authoritative content",
|
|
294
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
295
|
+
editable: true,
|
|
296
|
+
});
|
|
297
|
+
if (editor && results.length === 0) {
|
|
298
|
+
results.push(guards.shouldIgnoreUpdate(editor.state.tr));
|
|
299
|
+
}
|
|
300
|
+
return React.createElement("div", null);
|
|
301
|
+
}
|
|
302
|
+
act(() => root.render(React.createElement(Probe)));
|
|
303
|
+
await flush();
|
|
304
|
+
expect(results).toEqual([true]);
|
|
305
|
+
});
|
|
306
|
+
it("allows the first user edit after an authoritative empty doc finishes loading", async () => {
|
|
307
|
+
let shouldIgnoreUpdate = null;
|
|
308
|
+
let editor = null;
|
|
309
|
+
function Probe() {
|
|
310
|
+
editor = useEditor({
|
|
311
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
312
|
+
content: "",
|
|
313
|
+
});
|
|
314
|
+
const fakeYdoc = { clientID: 1, getXmlFragment: () => ({ length: 0 }) };
|
|
315
|
+
const guards = useCollabReconcile({
|
|
316
|
+
editor,
|
|
317
|
+
ydoc: fakeYdoc,
|
|
318
|
+
collabSynced: true,
|
|
319
|
+
value: "",
|
|
320
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
321
|
+
editable: true,
|
|
322
|
+
});
|
|
323
|
+
shouldIgnoreUpdate = guards.shouldIgnoreUpdate;
|
|
324
|
+
return React.createElement("div", null);
|
|
325
|
+
}
|
|
326
|
+
act(() => root.render(React.createElement(Probe)));
|
|
327
|
+
expect(editor).not.toBeNull();
|
|
328
|
+
expect(shouldIgnoreUpdate).not.toBeNull();
|
|
329
|
+
expect(shouldIgnoreUpdate(editor.state.tr)).toBe(false);
|
|
330
|
+
});
|
|
331
|
+
it("refuses to persist an empty doc in collab mode (registerEmitted guard)", async () => {
|
|
332
|
+
// Directly exercise the guard contract: in collab mode an empty markdown
|
|
333
|
+
// string must not be registered/persisted (would clobber stored content
|
|
334
|
+
// before the shared Y.Doc seeds).
|
|
335
|
+
const results = [];
|
|
336
|
+
function Probe() {
|
|
337
|
+
const editor = useEditor({
|
|
338
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
339
|
+
content: "",
|
|
340
|
+
});
|
|
341
|
+
const fakeYdoc = { clientID: 1, getXmlFragment: () => ({ length: 0 }) };
|
|
342
|
+
const guards = useCollabReconcile({
|
|
343
|
+
editor,
|
|
344
|
+
ydoc: fakeYdoc,
|
|
345
|
+
value: "seeded content",
|
|
346
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
347
|
+
editable: true,
|
|
348
|
+
});
|
|
349
|
+
if (editor && results.length === 0) {
|
|
350
|
+
results.push(guards.registerEmitted(" ")); // whitespace-only → empty
|
|
351
|
+
results.push(guards.registerEmitted("real text")); // non-empty
|
|
352
|
+
}
|
|
353
|
+
return React.createElement("div", null);
|
|
354
|
+
}
|
|
355
|
+
act(() => root.render(React.createElement(Probe)));
|
|
356
|
+
await flush();
|
|
357
|
+
expect(results[0]).toBe(false); // empty in collab mode → refused
|
|
358
|
+
expect(results[1]).toBe(true); // real content → accepted
|
|
359
|
+
});
|
|
360
|
+
it("defers collab seed setContent to a cancellable timer task", async () => {
|
|
361
|
+
const setContentValues = [];
|
|
362
|
+
function Probe({ value }) {
|
|
363
|
+
const editor = useEditor({
|
|
364
|
+
extensions: createRichMarkdownExtensions({ dialect: "gfm" }),
|
|
365
|
+
content: "",
|
|
366
|
+
});
|
|
367
|
+
const fakeYdoc = { clientID: 1, getXmlFragment: () => ({ length: 0 }) };
|
|
368
|
+
useCollabReconcile({
|
|
369
|
+
editor,
|
|
370
|
+
ydoc: fakeYdoc,
|
|
371
|
+
value,
|
|
372
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
373
|
+
editable: true,
|
|
374
|
+
setContent: (ed, v) => {
|
|
375
|
+
setContentValues.push(v);
|
|
376
|
+
ed.commands.setContent(v);
|
|
377
|
+
},
|
|
378
|
+
});
|
|
379
|
+
return React.createElement("div", null);
|
|
380
|
+
}
|
|
381
|
+
act(() => root.render(React.createElement(Probe, { value: "first seed" })));
|
|
382
|
+
expect(setContentValues).toEqual([]);
|
|
383
|
+
act(() => root.render(React.createElement(Probe, { value: "second seed" })));
|
|
384
|
+
expect(setContentValues).toEqual([]);
|
|
385
|
+
await flush();
|
|
386
|
+
expect(setContentValues).toEqual(["second seed"]);
|
|
387
|
+
});
|
|
388
|
+
it("does not seed beside persisted Y.Doc content projected during initial sync", async () => {
|
|
389
|
+
const persistedYdoc = new Y.Doc();
|
|
390
|
+
const persistedEditor = new CoreEditor({
|
|
391
|
+
extensions: createRichMarkdownExtensions({
|
|
392
|
+
dialect: "gfm",
|
|
393
|
+
ydoc: persistedYdoc,
|
|
394
|
+
}),
|
|
395
|
+
});
|
|
396
|
+
persistedEditor.commands.setContent("persisted collab body");
|
|
397
|
+
const persistedUpdate = Y.encodeStateAsUpdate(persistedYdoc);
|
|
398
|
+
persistedEditor.destroy();
|
|
399
|
+
persistedYdoc.destroy();
|
|
400
|
+
const liveYdoc = new Y.Doc();
|
|
401
|
+
const setContentValues = [];
|
|
402
|
+
let capturedEditor = null;
|
|
403
|
+
function Probe({ collabSynced }) {
|
|
404
|
+
const editor = useEditor({
|
|
405
|
+
extensions: createRichMarkdownExtensions({
|
|
406
|
+
dialect: "gfm",
|
|
407
|
+
ydoc: liveYdoc,
|
|
408
|
+
}),
|
|
409
|
+
});
|
|
410
|
+
capturedEditor = editor;
|
|
411
|
+
useCollabReconcile({
|
|
412
|
+
editor,
|
|
413
|
+
ydoc: liveYdoc,
|
|
414
|
+
collabSynced,
|
|
415
|
+
value: "persisted collab body",
|
|
416
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
417
|
+
editable: true,
|
|
418
|
+
setContent: (_editor, nextValue) => {
|
|
419
|
+
setContentValues.push(nextValue);
|
|
420
|
+
},
|
|
421
|
+
});
|
|
422
|
+
return React.createElement("div", null);
|
|
423
|
+
}
|
|
424
|
+
act(() => root.render(React.createElement(Probe, { collabSynced: false })));
|
|
425
|
+
act(() => Y.applyUpdate(liveYdoc, persistedUpdate, "remote"));
|
|
426
|
+
act(() => root.render(React.createElement(Probe, { collabSynced: true })));
|
|
427
|
+
await flush();
|
|
428
|
+
expect(getEditorMarkdown(capturedEditor)).toBe("persisted collab body");
|
|
429
|
+
expect(setContentValues).toEqual([]);
|
|
430
|
+
expect(getEditorMarkdown(capturedEditor).match(/persisted collab body/g)).toHaveLength(1);
|
|
431
|
+
liveYdoc.destroy();
|
|
432
|
+
});
|
|
433
|
+
it("adopts a nonempty synced Y.Doc instead of reconciling an empty SQL snapshot", async () => {
|
|
434
|
+
vi.useFakeTimers();
|
|
435
|
+
const persistedYdoc = new Y.Doc();
|
|
436
|
+
const persistedEditor = new CoreEditor({
|
|
437
|
+
extensions: createRichMarkdownExtensions({
|
|
438
|
+
dialect: "gfm",
|
|
439
|
+
ydoc: persistedYdoc,
|
|
440
|
+
}),
|
|
441
|
+
});
|
|
442
|
+
persistedEditor.commands.setContent("live collaborator body");
|
|
443
|
+
const liveYdoc = new Y.Doc();
|
|
444
|
+
Y.applyUpdate(liveYdoc, Y.encodeStateAsUpdate(persistedYdoc), "remote");
|
|
445
|
+
persistedEditor.destroy();
|
|
446
|
+
persistedYdoc.destroy();
|
|
447
|
+
const awareness = new Awareness(liveYdoc);
|
|
448
|
+
const setContentValues = [];
|
|
449
|
+
let capturedEditor = null;
|
|
450
|
+
function Probe() {
|
|
451
|
+
const editor = useEditor({
|
|
452
|
+
extensions: createRichMarkdownExtensions({
|
|
453
|
+
dialect: "gfm",
|
|
454
|
+
ydoc: liveYdoc,
|
|
455
|
+
}),
|
|
456
|
+
});
|
|
457
|
+
capturedEditor = editor;
|
|
458
|
+
useCollabReconcile({
|
|
459
|
+
editor,
|
|
460
|
+
ydoc: liveYdoc,
|
|
461
|
+
awareness,
|
|
462
|
+
collabSynced: true,
|
|
463
|
+
value: "",
|
|
464
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
465
|
+
editable: true,
|
|
466
|
+
setContent: (_editor, nextValue) => {
|
|
467
|
+
setContentValues.push(nextValue);
|
|
468
|
+
},
|
|
469
|
+
});
|
|
470
|
+
return React.createElement("div", null);
|
|
471
|
+
}
|
|
472
|
+
act(() => root.render(React.createElement(Probe)));
|
|
473
|
+
await act(async () => vi.advanceTimersByTimeAsync(0));
|
|
474
|
+
// The document state can finish syncing before the first awareness poll.
|
|
475
|
+
// Publish the active peer after mount to cover that real transport order.
|
|
476
|
+
act(() => {
|
|
477
|
+
awareness.getStates().set(4_294_967_295, {
|
|
478
|
+
user: { name: "Active peer" },
|
|
479
|
+
visible: true,
|
|
480
|
+
});
|
|
481
|
+
awareness.emit("change", [
|
|
482
|
+
{ added: [4_294_967_295], updated: [], removed: [] },
|
|
483
|
+
"remote",
|
|
484
|
+
]);
|
|
485
|
+
});
|
|
486
|
+
await act(async () => vi.advanceTimersByTimeAsync(2500));
|
|
487
|
+
expect(getEditorMarkdown(capturedEditor)).toBe("live collaborator body");
|
|
488
|
+
expect(setContentValues).toEqual([]);
|
|
489
|
+
vi.useRealTimers();
|
|
490
|
+
awareness.destroy();
|
|
491
|
+
liveYdoc.destroy();
|
|
492
|
+
});
|
|
493
|
+
it("lets canonical empty SQL clear stale persisted Y.Doc content with no active peer", async () => {
|
|
494
|
+
const persistedYdoc = new Y.Doc();
|
|
495
|
+
const persistedEditor = new CoreEditor({
|
|
496
|
+
extensions: createRichMarkdownExtensions({
|
|
497
|
+
dialect: "gfm",
|
|
498
|
+
ydoc: persistedYdoc,
|
|
499
|
+
}),
|
|
500
|
+
});
|
|
501
|
+
persistedEditor.commands.setContent("stale persisted body");
|
|
502
|
+
const liveYdoc = new Y.Doc();
|
|
503
|
+
Y.applyUpdate(liveYdoc, Y.encodeStateAsUpdate(persistedYdoc), "remote");
|
|
504
|
+
persistedEditor.destroy();
|
|
505
|
+
persistedYdoc.destroy();
|
|
506
|
+
const setContentValues = [];
|
|
507
|
+
let capturedEditor = null;
|
|
508
|
+
const awareness = new Awareness(liveYdoc);
|
|
509
|
+
function Probe() {
|
|
510
|
+
const editor = useEditor({
|
|
511
|
+
extensions: createRichMarkdownExtensions({
|
|
512
|
+
dialect: "gfm",
|
|
513
|
+
ydoc: liveYdoc,
|
|
514
|
+
}),
|
|
515
|
+
});
|
|
516
|
+
capturedEditor = editor;
|
|
517
|
+
useCollabReconcile({
|
|
518
|
+
editor,
|
|
519
|
+
ydoc: liveYdoc,
|
|
520
|
+
awareness,
|
|
521
|
+
collabSynced: true,
|
|
522
|
+
value: "",
|
|
523
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
524
|
+
editable: true,
|
|
525
|
+
setContent: (editorToClear, nextValue) => {
|
|
526
|
+
setContentValues.push(nextValue);
|
|
527
|
+
editorToClear.commands.setContent(nextValue);
|
|
528
|
+
},
|
|
529
|
+
});
|
|
530
|
+
return React.createElement("div", null);
|
|
531
|
+
}
|
|
532
|
+
vi.useFakeTimers();
|
|
533
|
+
act(() => root.render(React.createElement(Probe)));
|
|
534
|
+
await act(async () => vi.advanceTimersByTimeAsync(2499));
|
|
535
|
+
expect(setContentValues).toEqual([]);
|
|
536
|
+
await act(async () => vi.advanceTimersByTimeAsync(51));
|
|
537
|
+
expect(setContentValues).toContain("");
|
|
538
|
+
expect(getEditorMarkdown(capturedEditor)).toBe("");
|
|
539
|
+
vi.useRealTimers();
|
|
540
|
+
awareness.destroy();
|
|
541
|
+
liveYdoc.destroy();
|
|
542
|
+
});
|
|
543
|
+
it("preserves and permits a first local edit during the awareness settle window", async () => {
|
|
544
|
+
const persistedYdoc = new Y.Doc();
|
|
545
|
+
const persistedEditor = new CoreEditor({
|
|
546
|
+
extensions: createRichMarkdownExtensions({
|
|
547
|
+
dialect: "gfm",
|
|
548
|
+
ydoc: persistedYdoc,
|
|
549
|
+
}),
|
|
550
|
+
});
|
|
551
|
+
persistedEditor.commands.setContent("stale persisted body");
|
|
552
|
+
const liveYdoc = new Y.Doc();
|
|
553
|
+
Y.applyUpdate(liveYdoc, Y.encodeStateAsUpdate(persistedYdoc), "remote");
|
|
554
|
+
persistedEditor.destroy();
|
|
555
|
+
persistedYdoc.destroy();
|
|
556
|
+
const awareness = new Awareness(liveYdoc);
|
|
557
|
+
let capturedEditor = null;
|
|
558
|
+
let guards = null;
|
|
559
|
+
const setContentValues = [];
|
|
560
|
+
function Probe() {
|
|
561
|
+
const editor = useEditor({
|
|
562
|
+
extensions: createRichMarkdownExtensions({
|
|
563
|
+
dialect: "gfm",
|
|
564
|
+
ydoc: liveYdoc,
|
|
565
|
+
}),
|
|
566
|
+
});
|
|
567
|
+
capturedEditor = editor;
|
|
568
|
+
guards = useCollabReconcile({
|
|
569
|
+
editor,
|
|
570
|
+
ydoc: liveYdoc,
|
|
571
|
+
awareness,
|
|
572
|
+
collabSynced: true,
|
|
573
|
+
value: "",
|
|
574
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
575
|
+
editable: true,
|
|
576
|
+
setContent: (editorToSet, nextValue) => {
|
|
577
|
+
setContentValues.push(nextValue);
|
|
578
|
+
editorToSet.commands.setContent(nextValue);
|
|
579
|
+
},
|
|
580
|
+
});
|
|
581
|
+
return React.createElement("div", null);
|
|
582
|
+
}
|
|
583
|
+
vi.useFakeTimers();
|
|
584
|
+
act(() => root.render(React.createElement(Probe)));
|
|
585
|
+
await act(async () => vi.advanceTimersByTimeAsync(0));
|
|
586
|
+
expect(guards).not.toBeNull();
|
|
587
|
+
expect(capturedEditor).not.toBeNull();
|
|
588
|
+
expect(guards.shouldIgnoreUpdate(capturedEditor.state.tr)).toBe(false);
|
|
589
|
+
expect(guards.registerEmitted("first local edit")).toBe(true);
|
|
590
|
+
act(() => capturedEditor.commands.setContent("first local edit"));
|
|
591
|
+
await act(async () => vi.advanceTimersByTimeAsync(2500));
|
|
592
|
+
expect(getEditorMarkdown(capturedEditor)).toBe("first local edit");
|
|
593
|
+
expect(setContentValues).toEqual([]);
|
|
594
|
+
vi.useRealTimers();
|
|
595
|
+
awareness.destroy();
|
|
596
|
+
liveYdoc.destroy();
|
|
597
|
+
});
|
|
598
|
+
it("applies a genuinely newer external value once the user is no longer focused", async () => {
|
|
599
|
+
const { captured, Harness } = makeHarness();
|
|
600
|
+
render(root, Harness, {
|
|
601
|
+
value: "# Doc",
|
|
602
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
603
|
+
});
|
|
604
|
+
await flush();
|
|
605
|
+
// Blur the editor so the typing/focus guard does not defer.
|
|
606
|
+
act(() => captured.editor.commands.blur());
|
|
607
|
+
render(root, Harness, {
|
|
608
|
+
value: "# Doc updated by agent",
|
|
609
|
+
contentUpdatedAt: "2024-01-01T00:00:05.000Z",
|
|
610
|
+
});
|
|
611
|
+
await flush();
|
|
612
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# Doc updated by agent");
|
|
613
|
+
});
|
|
614
|
+
it("does not reapply a partial save echo while an external editor control owns focus", async () => {
|
|
615
|
+
const { captured, Harness } = makeHarness();
|
|
616
|
+
render(root, Harness, {
|
|
617
|
+
value: "# abcdef",
|
|
618
|
+
contentUpdatedAt: "2024-01-01T00:00:01.000Z",
|
|
619
|
+
editorOwnedFocus: true,
|
|
620
|
+
});
|
|
621
|
+
await flush();
|
|
622
|
+
act(() => captured.editor.commands.setContent("# abcde"));
|
|
623
|
+
act(() => captured.editor.commands.setContent("# ab"));
|
|
624
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# ab");
|
|
625
|
+
render(root, Harness, {
|
|
626
|
+
value: "# abcde",
|
|
627
|
+
contentUpdatedAt: "2024-01-01T00:00:02.000Z",
|
|
628
|
+
editorOwnedFocus: true,
|
|
629
|
+
});
|
|
630
|
+
await flush();
|
|
631
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# ab");
|
|
632
|
+
render(root, Harness, {
|
|
633
|
+
value: "# updated externally",
|
|
634
|
+
contentUpdatedAt: "2024-01-01T00:00:03.000Z",
|
|
635
|
+
editorOwnedFocus: false,
|
|
636
|
+
});
|
|
637
|
+
await flush();
|
|
638
|
+
expect(getEditorMarkdown(captured.editor)).toBe("# updated externally");
|
|
639
|
+
});
|
|
640
|
+
});
|
|
641
|
+
//# sourceMappingURL=useCollabReconcile.concurrent.spec.js.map
|