@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,965 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless canvas interaction primitives shared by visual editors.
|
|
3
|
+
*
|
|
4
|
+
* This module deliberately knows nothing about React, DOM elements, or how an
|
|
5
|
+
* application persists objects. An app supplies its object adapter and turns
|
|
6
|
+
* the returned semantic commands into its own mutations.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_CANVAS_DRAG_THRESHOLD = 3;
|
|
10
|
+
export const DEFAULT_CANVAS_NUDGE = 1;
|
|
11
|
+
export const DEFAULT_CANVAS_ACCELERATED_NUDGE = 10;
|
|
12
|
+
export const DEFAULT_CANVAS_MIN_SIZE = 24;
|
|
13
|
+
|
|
14
|
+
export type CanvasTextActivation = "single-click" | "double-click";
|
|
15
|
+
export type CanvasEscapeBehavior =
|
|
16
|
+
| "select-object"
|
|
17
|
+
| "clear-selection"
|
|
18
|
+
| "cancel-edit";
|
|
19
|
+
export type CanvasDuplicateModifier = "alt" | "meta" | "ctrl" | "none";
|
|
20
|
+
export type CanvasResizeHandle =
|
|
21
|
+
| "nw"
|
|
22
|
+
| "n"
|
|
23
|
+
| "ne"
|
|
24
|
+
| "w"
|
|
25
|
+
| "e"
|
|
26
|
+
| "sw"
|
|
27
|
+
| "s"
|
|
28
|
+
| "se";
|
|
29
|
+
|
|
30
|
+
export interface CanvasPoint {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface CanvasRect extends CanvasPoint {
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface CanvasViewport {
|
|
41
|
+
left: number;
|
|
42
|
+
top: number;
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface CanvasSize {
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface CanvasModifiers {
|
|
53
|
+
altKey?: boolean;
|
|
54
|
+
ctrlKey?: boolean;
|
|
55
|
+
metaKey?: boolean;
|
|
56
|
+
shiftKey?: boolean;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CanvasTextEditPolicy {
|
|
60
|
+
activation?: CanvasTextActivation;
|
|
61
|
+
escapeBehavior?: CanvasEscapeBehavior;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CanvasDragPolicy {
|
|
65
|
+
threshold?: number;
|
|
66
|
+
duplicateModifier?: CanvasDuplicateModifier;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface CanvasNudgePolicy {
|
|
70
|
+
amount?: number;
|
|
71
|
+
acceleratedAmount?: number;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** The interaction surface an app can durably support. */
|
|
75
|
+
export interface CanvasInteractionCapabilities {
|
|
76
|
+
selection: boolean;
|
|
77
|
+
multiSelection: boolean;
|
|
78
|
+
move: boolean;
|
|
79
|
+
resize: boolean;
|
|
80
|
+
textEditing: boolean;
|
|
81
|
+
nudge: boolean;
|
|
82
|
+
duplicate: boolean;
|
|
83
|
+
clipboard: boolean;
|
|
84
|
+
delete: boolean;
|
|
85
|
+
arrange: boolean;
|
|
86
|
+
snapping: boolean;
|
|
87
|
+
alignment: boolean;
|
|
88
|
+
distribution: boolean;
|
|
89
|
+
grouping: boolean;
|
|
90
|
+
rotation: boolean;
|
|
91
|
+
marquee: boolean;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const DEFAULT_CANVAS_INTERACTION_CAPABILITIES: CanvasInteractionCapabilities =
|
|
95
|
+
{
|
|
96
|
+
selection: true,
|
|
97
|
+
multiSelection: false,
|
|
98
|
+
move: true,
|
|
99
|
+
resize: true,
|
|
100
|
+
textEditing: true,
|
|
101
|
+
nudge: true,
|
|
102
|
+
duplicate: true,
|
|
103
|
+
clipboard: true,
|
|
104
|
+
delete: true,
|
|
105
|
+
arrange: true,
|
|
106
|
+
snapping: false,
|
|
107
|
+
alignment: false,
|
|
108
|
+
distribution: false,
|
|
109
|
+
grouping: false,
|
|
110
|
+
rotation: false,
|
|
111
|
+
marquee: false,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export interface CanvasInteractionConfig {
|
|
115
|
+
capabilities?: Partial<CanvasInteractionCapabilities>;
|
|
116
|
+
textEditing?: CanvasTextEditPolicy;
|
|
117
|
+
drag?: CanvasDragPolicy;
|
|
118
|
+
nudge?: CanvasNudgePolicy;
|
|
119
|
+
minSize?: number;
|
|
120
|
+
shortcuts?: readonly CanvasShortcut[];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** The only persistence seam required by the shared interaction core. */
|
|
124
|
+
export interface CanvasInteractionAdapter<TObjectId = string> {
|
|
125
|
+
readonly capabilities: CanvasInteractionCapabilities;
|
|
126
|
+
dispatch(command: CanvasCommand<TObjectId>): CanvasCommandDispatchResult;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export type CanvasCommandDispatchResult =
|
|
130
|
+
| { handled: true }
|
|
131
|
+
| {
|
|
132
|
+
handled: false;
|
|
133
|
+
reason: "no-adapter" | "unsupported" | "unhandled";
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export type CanvasCommandId =
|
|
137
|
+
| "select-all"
|
|
138
|
+
| "undo"
|
|
139
|
+
| "redo"
|
|
140
|
+
| "copy"
|
|
141
|
+
| "cut"
|
|
142
|
+
| "paste"
|
|
143
|
+
| "duplicate"
|
|
144
|
+
| "delete"
|
|
145
|
+
| "nudge"
|
|
146
|
+
| "arrange-front"
|
|
147
|
+
| "arrange-back"
|
|
148
|
+
| "bring-forward"
|
|
149
|
+
| "bring-to-front"
|
|
150
|
+
| "send-backward"
|
|
151
|
+
| "send-to-back"
|
|
152
|
+
| "align-left"
|
|
153
|
+
| "align-center"
|
|
154
|
+
| "align-right"
|
|
155
|
+
| "align-top"
|
|
156
|
+
| "align-middle"
|
|
157
|
+
| "align-bottom"
|
|
158
|
+
| "distribute-horizontal"
|
|
159
|
+
| "distribute-vertical"
|
|
160
|
+
| "group"
|
|
161
|
+
| "ungroup"
|
|
162
|
+
| "frame-selection"
|
|
163
|
+
| "escape"
|
|
164
|
+
| "enter"
|
|
165
|
+
| "nudge-left"
|
|
166
|
+
| "nudge-right"
|
|
167
|
+
| "nudge-up"
|
|
168
|
+
| "nudge-down";
|
|
169
|
+
|
|
170
|
+
export interface CanvasCommand<TObjectId = string> {
|
|
171
|
+
id: CanvasCommandId;
|
|
172
|
+
objectIds?: readonly TObjectId[];
|
|
173
|
+
delta?: CanvasPoint;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type CanvasShortcutModifier =
|
|
177
|
+
| "primary"
|
|
178
|
+
| "shift"
|
|
179
|
+
| "alt"
|
|
180
|
+
| "ctrl"
|
|
181
|
+
| "meta";
|
|
182
|
+
|
|
183
|
+
export interface CanvasShortcut {
|
|
184
|
+
command: CanvasCommandId;
|
|
185
|
+
key: string;
|
|
186
|
+
/**
|
|
187
|
+
* Optional physical key identity for shifted punctuation. `KeyboardEvent.key`
|
|
188
|
+
* changes `]` to `}` under Shift, while `KeyboardEvent.code` stays stable.
|
|
189
|
+
*/
|
|
190
|
+
code?: string;
|
|
191
|
+
modifiers?: readonly CanvasShortcutModifier[];
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface CanvasShortcutInput extends CanvasModifiers {
|
|
195
|
+
key: string;
|
|
196
|
+
code?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface CanvasShortcutRegistry {
|
|
200
|
+
readonly shortcuts: readonly CanvasShortcut[];
|
|
201
|
+
resolve(input: CanvasShortcutInput): CanvasCommandId | null;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface CanvasTextActivationInput {
|
|
205
|
+
clickCount: number;
|
|
206
|
+
textEditable: boolean;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type CanvasTextActivationResult = "edit" | "select";
|
|
210
|
+
|
|
211
|
+
export interface CanvasEscapeInput<TObjectId = string> {
|
|
212
|
+
editingObjectId: TObjectId | null;
|
|
213
|
+
selectedObjectIds?: readonly TObjectId[];
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export type CanvasEscapeResult<TObjectId = string> =
|
|
217
|
+
| {
|
|
218
|
+
action: "select-object";
|
|
219
|
+
editingObjectId: null;
|
|
220
|
+
selectedObjectIds: readonly TObjectId[];
|
|
221
|
+
}
|
|
222
|
+
| {
|
|
223
|
+
action: "cancel-edit";
|
|
224
|
+
editingObjectId: null;
|
|
225
|
+
selectedObjectIds: readonly TObjectId[];
|
|
226
|
+
}
|
|
227
|
+
| {
|
|
228
|
+
action: "clear-selection";
|
|
229
|
+
editingObjectId: null;
|
|
230
|
+
selectedObjectIds: readonly TObjectId[];
|
|
231
|
+
}
|
|
232
|
+
| {
|
|
233
|
+
action: "none";
|
|
234
|
+
editingObjectId: null;
|
|
235
|
+
selectedObjectIds: readonly TObjectId[];
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export interface CanvasResizeInput extends CanvasModifiers {
|
|
239
|
+
handle: CanvasResizeHandle;
|
|
240
|
+
delta: CanvasPoint;
|
|
241
|
+
preserveAspectRatio?: boolean;
|
|
242
|
+
minWidth?: number;
|
|
243
|
+
minHeight?: number;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export interface CanvasNudgeInput extends CanvasModifiers {
|
|
247
|
+
key: string;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface CanvasNudgeResult {
|
|
251
|
+
command: Extract<
|
|
252
|
+
CanvasCommandId,
|
|
253
|
+
"nudge-left" | "nudge-right" | "nudge-up" | "nudge-down"
|
|
254
|
+
>;
|
|
255
|
+
delta: CanvasPoint;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/** A pointer expressed in browser client coordinates. */
|
|
259
|
+
export interface CanvasGesturePointer extends CanvasPoint, CanvasModifiers {}
|
|
260
|
+
|
|
261
|
+
export type CanvasGestureKind = "move" | "resize";
|
|
262
|
+
export type CanvasGesturePhase = "idle" | "pending" | "active";
|
|
263
|
+
|
|
264
|
+
export interface CanvasGestureBase<TObjectId = string> {
|
|
265
|
+
readonly kind: CanvasGestureKind;
|
|
266
|
+
readonly objectIds: readonly TObjectId[];
|
|
267
|
+
/** Pointer location when the gesture began, in browser client coordinates. */
|
|
268
|
+
readonly startPointer: CanvasGesturePointer;
|
|
269
|
+
readonly pointer: CanvasGesturePointer;
|
|
270
|
+
readonly clientDelta: CanvasPoint;
|
|
271
|
+
readonly canvasDelta: CanvasPoint;
|
|
272
|
+
/** Whether this gesture should create copies as part of its one final commit. */
|
|
273
|
+
readonly duplicate: boolean;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export interface CanvasMoveGesture<
|
|
277
|
+
TObjectId = string,
|
|
278
|
+
> extends CanvasGestureBase<TObjectId> {
|
|
279
|
+
readonly kind: "move";
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface CanvasResizeGesture<
|
|
283
|
+
TObjectId = string,
|
|
284
|
+
> extends CanvasGestureBase<TObjectId> {
|
|
285
|
+
readonly kind: "resize";
|
|
286
|
+
readonly handle: CanvasResizeHandle;
|
|
287
|
+
readonly startRect: CanvasRect;
|
|
288
|
+
readonly rect: CanvasRect;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export type CanvasGesture<TObjectId = string> =
|
|
292
|
+
| CanvasMoveGesture<TObjectId>
|
|
293
|
+
| CanvasResizeGesture<TObjectId>;
|
|
294
|
+
|
|
295
|
+
export interface CanvasMoveGestureStart<TObjectId = string> {
|
|
296
|
+
readonly kind: "move";
|
|
297
|
+
readonly objectIds: readonly TObjectId[];
|
|
298
|
+
readonly pointer: CanvasGesturePointer;
|
|
299
|
+
readonly viewport: CanvasViewport;
|
|
300
|
+
readonly canvas: CanvasSize;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface CanvasResizeGestureStart<TObjectId = string> {
|
|
304
|
+
readonly kind: "resize";
|
|
305
|
+
readonly objectIds: readonly TObjectId[];
|
|
306
|
+
readonly pointer: CanvasGesturePointer;
|
|
307
|
+
readonly viewport: CanvasViewport;
|
|
308
|
+
readonly canvas: CanvasSize;
|
|
309
|
+
readonly handle: CanvasResizeHandle;
|
|
310
|
+
readonly rect: CanvasRect;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
export type CanvasGestureStart<TObjectId = string> =
|
|
314
|
+
| CanvasMoveGestureStart<TObjectId>
|
|
315
|
+
| CanvasResizeGestureStart<TObjectId>;
|
|
316
|
+
|
|
317
|
+
/** Typed result returned by host preview, commit, and cancel callbacks. */
|
|
318
|
+
export type CanvasGestureAdapterResult =
|
|
319
|
+
| { handled: true }
|
|
320
|
+
| { handled: false; reason: "unsupported" | "unhandled" };
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Persistence-neutral callbacks for a single object gesture. Previews are
|
|
324
|
+
* transient; `commit` is invoked at most once after an active gesture ends.
|
|
325
|
+
*/
|
|
326
|
+
export interface CanvasGestureAdapter<TObjectId = string> {
|
|
327
|
+
preview?(gesture: CanvasGesture<TObjectId>): CanvasGestureAdapterResult;
|
|
328
|
+
commit(gesture: CanvasGesture<TObjectId>): CanvasGestureAdapterResult;
|
|
329
|
+
cancel?(gesture: CanvasGesture<TObjectId>): CanvasGestureAdapterResult;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface CanvasGestureControllerConfig<
|
|
333
|
+
TObjectId = string,
|
|
334
|
+
> extends CanvasInteractionConfig {
|
|
335
|
+
adapter: CanvasGestureAdapter<TObjectId>;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export interface CanvasGestureState<TObjectId = string> {
|
|
339
|
+
readonly phase: CanvasGesturePhase;
|
|
340
|
+
readonly gesture: CanvasGesture<TObjectId> | null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export type CanvasGestureBeginResult<TObjectId = string> =
|
|
344
|
+
| { accepted: true; state: CanvasGestureState<TObjectId> }
|
|
345
|
+
| {
|
|
346
|
+
accepted: false;
|
|
347
|
+
reason: "unsupported" | "already-active" | "invalid-resize";
|
|
348
|
+
state: CanvasGestureState<TObjectId>;
|
|
349
|
+
};
|
|
350
|
+
|
|
351
|
+
export type CanvasGestureUpdateResult<TObjectId = string> =
|
|
352
|
+
| { phase: "idle"; state: CanvasGestureState<TObjectId> }
|
|
353
|
+
| { phase: "pending"; state: CanvasGestureState<TObjectId> }
|
|
354
|
+
| {
|
|
355
|
+
phase: "active";
|
|
356
|
+
gesture: CanvasGesture<TObjectId>;
|
|
357
|
+
preview: CanvasGestureAdapterResult | null;
|
|
358
|
+
state: CanvasGestureState<TObjectId>;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export type CanvasGestureEndResult<TObjectId = string> =
|
|
362
|
+
| {
|
|
363
|
+
committed: true;
|
|
364
|
+
gesture: CanvasGesture<TObjectId>;
|
|
365
|
+
result: CanvasGestureAdapterResult;
|
|
366
|
+
state: CanvasGestureState<TObjectId>;
|
|
367
|
+
}
|
|
368
|
+
| {
|
|
369
|
+
committed: false;
|
|
370
|
+
reason: "idle" | "below-threshold" | "unsupported";
|
|
371
|
+
state: CanvasGestureState<TObjectId>;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export type CanvasGestureCancelResult<TObjectId = string> =
|
|
375
|
+
| {
|
|
376
|
+
cancelled: true;
|
|
377
|
+
gesture: CanvasGesture<TObjectId>;
|
|
378
|
+
result: CanvasGestureAdapterResult | null;
|
|
379
|
+
state: CanvasGestureState<TObjectId>;
|
|
380
|
+
}
|
|
381
|
+
| { cancelled: false; reason: "idle"; state: CanvasGestureState<TObjectId> };
|
|
382
|
+
|
|
383
|
+
export const DEFAULT_CANVAS_SHORTCUTS: readonly CanvasShortcut[] = [
|
|
384
|
+
{ command: "select-all", key: "a", modifiers: ["primary"] },
|
|
385
|
+
{ command: "undo", key: "z", modifiers: ["primary"] },
|
|
386
|
+
{ command: "redo", key: "z", modifiers: ["primary", "shift"] },
|
|
387
|
+
{ command: "copy", key: "c", modifiers: ["primary"] },
|
|
388
|
+
{ command: "cut", key: "x", modifiers: ["primary"] },
|
|
389
|
+
{ command: "paste", key: "v", modifiers: ["primary"] },
|
|
390
|
+
{ command: "duplicate", key: "d", modifiers: ["primary"] },
|
|
391
|
+
{ command: "delete", key: "Backspace" },
|
|
392
|
+
{ command: "delete", key: "Delete" },
|
|
393
|
+
{
|
|
394
|
+
command: "arrange-front",
|
|
395
|
+
key: "]",
|
|
396
|
+
code: "BracketRight",
|
|
397
|
+
modifiers: ["primary", "shift"],
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
command: "arrange-back",
|
|
401
|
+
key: "[",
|
|
402
|
+
code: "BracketLeft",
|
|
403
|
+
modifiers: ["primary", "shift"],
|
|
404
|
+
},
|
|
405
|
+
];
|
|
406
|
+
|
|
407
|
+
function primaryModifierIsPressed(modifiers: CanvasModifiers): boolean {
|
|
408
|
+
return Boolean(modifiers.metaKey || modifiers.ctrlKey);
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function hasShortcutModifier(
|
|
412
|
+
modifier: CanvasShortcutModifier,
|
|
413
|
+
input: CanvasShortcutInput,
|
|
414
|
+
): boolean {
|
|
415
|
+
switch (modifier) {
|
|
416
|
+
case "primary":
|
|
417
|
+
return primaryModifierIsPressed(input);
|
|
418
|
+
case "shift":
|
|
419
|
+
return Boolean(input.shiftKey);
|
|
420
|
+
case "alt":
|
|
421
|
+
return Boolean(input.altKey);
|
|
422
|
+
case "ctrl":
|
|
423
|
+
return Boolean(input.ctrlKey);
|
|
424
|
+
case "meta":
|
|
425
|
+
return Boolean(input.metaKey);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
function hasOnlyShortcutModifiers(
|
|
430
|
+
shortcut: CanvasShortcut,
|
|
431
|
+
input: CanvasShortcutInput,
|
|
432
|
+
): boolean {
|
|
433
|
+
const modifiers = new Set(shortcut.modifiers ?? []);
|
|
434
|
+
const expectedPrimary = modifiers.has("primary");
|
|
435
|
+
const expectedCtrl = modifiers.has("ctrl") || expectedPrimary;
|
|
436
|
+
const expectedMeta = modifiers.has("meta") || expectedPrimary;
|
|
437
|
+
|
|
438
|
+
return (
|
|
439
|
+
Boolean(input.shiftKey) === modifiers.has("shift") &&
|
|
440
|
+
Boolean(input.altKey) === modifiers.has("alt") &&
|
|
441
|
+
(!input.ctrlKey || expectedCtrl) &&
|
|
442
|
+
(!input.metaKey || expectedMeta) &&
|
|
443
|
+
(!expectedPrimary || primaryModifierIsPressed(input))
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/** Resolves click-to-edit without attaching event listeners. */
|
|
448
|
+
export function resolveCanvasTextActivation(
|
|
449
|
+
input: CanvasTextActivationInput,
|
|
450
|
+
policy: CanvasTextEditPolicy = {},
|
|
451
|
+
): CanvasTextActivationResult {
|
|
452
|
+
if (!input.textEditable) return "select";
|
|
453
|
+
const activation = policy.activation ?? "double-click";
|
|
454
|
+
return input.clickCount >= (activation === "single-click" ? 1 : 2)
|
|
455
|
+
? "edit"
|
|
456
|
+
: "select";
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Escape has one explicit owner: editing wins over any box-selection state.
|
|
461
|
+
* The host applies this result before handing Escape to generic UI dismissal.
|
|
462
|
+
*/
|
|
463
|
+
export function resolveCanvasEscape<TObjectId>(
|
|
464
|
+
input: CanvasEscapeInput<TObjectId>,
|
|
465
|
+
policy: CanvasTextEditPolicy = {},
|
|
466
|
+
): CanvasEscapeResult<TObjectId> {
|
|
467
|
+
const selectedObjectIds = input.selectedObjectIds ?? [];
|
|
468
|
+
if (input.editingObjectId === null) {
|
|
469
|
+
return { action: "none", editingObjectId: null, selectedObjectIds };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if ((policy.escapeBehavior ?? "select-object") === "cancel-edit") {
|
|
473
|
+
return { action: "cancel-edit", editingObjectId: null, selectedObjectIds };
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
if ((policy.escapeBehavior ?? "select-object") === "clear-selection") {
|
|
477
|
+
return {
|
|
478
|
+
action: "clear-selection",
|
|
479
|
+
editingObjectId: null,
|
|
480
|
+
selectedObjectIds: [],
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return {
|
|
485
|
+
action: "select-object",
|
|
486
|
+
editingObjectId: null,
|
|
487
|
+
selectedObjectIds: [input.editingObjectId],
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/** Converts a browser client point into unscaled canvas coordinates. */
|
|
492
|
+
export function clientPointToCanvasPoint(
|
|
493
|
+
point: CanvasPoint,
|
|
494
|
+
viewport: CanvasViewport,
|
|
495
|
+
canvas: CanvasSize,
|
|
496
|
+
): CanvasPoint {
|
|
497
|
+
if (viewport.width <= 0 || viewport.height <= 0) return { x: 0, y: 0 };
|
|
498
|
+
return {
|
|
499
|
+
x: ((point.x - viewport.left) / viewport.width) * canvas.width,
|
|
500
|
+
y: ((point.y - viewport.top) / viewport.height) * canvas.height,
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/** Converts a client-space drag delta to the canvas's unscaled coordinate space. */
|
|
505
|
+
export function clientDeltaToCanvasDelta(
|
|
506
|
+
delta: CanvasPoint,
|
|
507
|
+
viewport: CanvasViewport,
|
|
508
|
+
canvas: CanvasSize,
|
|
509
|
+
): CanvasPoint {
|
|
510
|
+
if (viewport.width <= 0 || viewport.height <= 0) return { x: 0, y: 0 };
|
|
511
|
+
return {
|
|
512
|
+
x: (delta.x / viewport.width) * canvas.width,
|
|
513
|
+
y: (delta.y / viewport.height) * canvas.height,
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** Whether the client pointer crossed the intentional-drag threshold. */
|
|
518
|
+
export function hasCrossedCanvasDragThreshold(
|
|
519
|
+
start: CanvasPoint,
|
|
520
|
+
current: CanvasPoint,
|
|
521
|
+
threshold = DEFAULT_CANVAS_DRAG_THRESHOLD,
|
|
522
|
+
): boolean {
|
|
523
|
+
const dx = current.x - start.x;
|
|
524
|
+
const dy = current.y - start.y;
|
|
525
|
+
return dx * dx + dy * dy >= threshold * threshold;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/** Locks a drag to its dominant axis, used for Shift-drag. */
|
|
529
|
+
export function constrainCanvasDragDelta(
|
|
530
|
+
delta: CanvasPoint,
|
|
531
|
+
lockAxis = false,
|
|
532
|
+
): CanvasPoint {
|
|
533
|
+
if (!lockAxis) return delta;
|
|
534
|
+
return Math.abs(delta.x) >= Math.abs(delta.y)
|
|
535
|
+
? { x: delta.x, y: 0 }
|
|
536
|
+
: { x: 0, y: delta.y };
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/**
|
|
540
|
+
* Resizes against the opposite edge, or from the center with Alt. Shift
|
|
541
|
+
* preserves aspect ratio on every handle; derived dimensions are centered.
|
|
542
|
+
*/
|
|
543
|
+
export function resizeCanvasRect(
|
|
544
|
+
start: CanvasRect,
|
|
545
|
+
input: CanvasResizeInput,
|
|
546
|
+
): CanvasRect {
|
|
547
|
+
const fromWest =
|
|
548
|
+
input.handle === "nw" || input.handle === "w" || input.handle === "sw";
|
|
549
|
+
const fromEast =
|
|
550
|
+
input.handle === "ne" || input.handle === "e" || input.handle === "se";
|
|
551
|
+
const fromNorth =
|
|
552
|
+
input.handle === "nw" || input.handle === "n" || input.handle === "ne";
|
|
553
|
+
const fromSouth =
|
|
554
|
+
input.handle === "sw" || input.handle === "s" || input.handle === "se";
|
|
555
|
+
const resizesHorizontally = fromWest || fromEast;
|
|
556
|
+
const resizesVertically = fromNorth || fromSouth;
|
|
557
|
+
const resizeFromCenter = Boolean(input.altKey);
|
|
558
|
+
let width =
|
|
559
|
+
start.width +
|
|
560
|
+
(fromWest ? -input.delta.x : fromEast ? input.delta.x : 0) *
|
|
561
|
+
(resizeFromCenter ? 2 : 1);
|
|
562
|
+
let height =
|
|
563
|
+
start.height +
|
|
564
|
+
(fromNorth ? -input.delta.y : fromSouth ? input.delta.y : 0) *
|
|
565
|
+
(resizeFromCenter ? 2 : 1);
|
|
566
|
+
|
|
567
|
+
const minWidth = input.minWidth ?? DEFAULT_CANVAS_MIN_SIZE;
|
|
568
|
+
const minHeight = input.minHeight ?? DEFAULT_CANVAS_MIN_SIZE;
|
|
569
|
+
const preserveAspectRatio =
|
|
570
|
+
Boolean(input.preserveAspectRatio) && start.width > 0 && start.height > 0;
|
|
571
|
+
const widthChange = Math.abs(width - start.width);
|
|
572
|
+
const heightChange = Math.abs(height - start.height);
|
|
573
|
+
const derivesHeight =
|
|
574
|
+
preserveAspectRatio && resizesHorizontally && !resizesVertically;
|
|
575
|
+
const derivesWidth =
|
|
576
|
+
preserveAspectRatio && resizesVertically && !resizesHorizontally;
|
|
577
|
+
|
|
578
|
+
if (derivesHeight) {
|
|
579
|
+
height = width / (start.width / start.height);
|
|
580
|
+
} else if (derivesWidth) {
|
|
581
|
+
width = height * (start.width / start.height);
|
|
582
|
+
} else if (preserveAspectRatio && resizesHorizontally && resizesVertically) {
|
|
583
|
+
if (widthChange >= heightChange) {
|
|
584
|
+
height = width / (start.width / start.height);
|
|
585
|
+
} else {
|
|
586
|
+
width = height * (start.width / start.height);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
const widthBelowMinimum = width < minWidth;
|
|
591
|
+
const heightBelowMinimum = height < minHeight;
|
|
592
|
+
width = Math.max(minWidth, width);
|
|
593
|
+
height = Math.max(minHeight, height);
|
|
594
|
+
if (preserveAspectRatio) {
|
|
595
|
+
if (widthBelowMinimum && !heightBelowMinimum) {
|
|
596
|
+
height = Math.max(minHeight, width / (start.width / start.height));
|
|
597
|
+
} else if (heightBelowMinimum && !widthBelowMinimum) {
|
|
598
|
+
width = Math.max(minWidth, height * (start.width / start.height));
|
|
599
|
+
} else if (widthBelowMinimum && heightBelowMinimum) {
|
|
600
|
+
width = Math.max(minWidth, minHeight * (start.width / start.height));
|
|
601
|
+
height = width / (start.width / start.height);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
const centerDerivedHeight = derivesHeight && !resizeFromCenter;
|
|
605
|
+
const centerDerivedWidth = derivesWidth && !resizeFromCenter;
|
|
606
|
+
return {
|
|
607
|
+
x:
|
|
608
|
+
resizeFromCenter || centerDerivedWidth
|
|
609
|
+
? start.x + (start.width - width) / 2
|
|
610
|
+
: fromWest
|
|
611
|
+
? start.x + start.width - width
|
|
612
|
+
: start.x,
|
|
613
|
+
y:
|
|
614
|
+
resizeFromCenter || centerDerivedHeight
|
|
615
|
+
? start.y + (start.height - height) / 2
|
|
616
|
+
: fromNorth
|
|
617
|
+
? start.y + start.height - height
|
|
618
|
+
: start.y,
|
|
619
|
+
width,
|
|
620
|
+
height,
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/** Whether this drag gesture should duplicate selected objects before moving. */
|
|
625
|
+
export function shouldDuplicateCanvasDrag(
|
|
626
|
+
modifiers: CanvasModifiers,
|
|
627
|
+
duplicateModifier: CanvasDuplicateModifier = "alt",
|
|
628
|
+
): boolean {
|
|
629
|
+
switch (duplicateModifier) {
|
|
630
|
+
case "alt":
|
|
631
|
+
return Boolean(modifiers.altKey);
|
|
632
|
+
case "meta":
|
|
633
|
+
return Boolean(modifiers.metaKey);
|
|
634
|
+
case "ctrl":
|
|
635
|
+
return Boolean(modifiers.ctrlKey);
|
|
636
|
+
case "none":
|
|
637
|
+
return false;
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/** Resolves standard arrow-key movement, including Shift's accelerated nudge. */
|
|
642
|
+
export function resolveCanvasNudge(
|
|
643
|
+
input: CanvasNudgeInput,
|
|
644
|
+
policy: CanvasNudgePolicy = {},
|
|
645
|
+
): CanvasNudgeResult | null {
|
|
646
|
+
const amount = input.shiftKey
|
|
647
|
+
? (policy.acceleratedAmount ?? DEFAULT_CANVAS_ACCELERATED_NUDGE)
|
|
648
|
+
: (policy.amount ?? DEFAULT_CANVAS_NUDGE);
|
|
649
|
+
switch (input.key) {
|
|
650
|
+
case "ArrowLeft":
|
|
651
|
+
return { command: "nudge-left", delta: { x: -amount, y: 0 } };
|
|
652
|
+
case "ArrowRight":
|
|
653
|
+
return { command: "nudge-right", delta: { x: amount, y: 0 } };
|
|
654
|
+
case "ArrowUp":
|
|
655
|
+
return { command: "nudge-up", delta: { x: 0, y: -amount } };
|
|
656
|
+
case "ArrowDown":
|
|
657
|
+
return { command: "nudge-down", delta: { x: 0, y: amount } };
|
|
658
|
+
default:
|
|
659
|
+
return null;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/** Looks up a semantic command without referring to platform-specific events. */
|
|
664
|
+
export function resolveCanvasShortcut(
|
|
665
|
+
input: CanvasShortcutInput,
|
|
666
|
+
shortcuts: readonly CanvasShortcut[] = DEFAULT_CANVAS_SHORTCUTS,
|
|
667
|
+
): CanvasCommandId | null {
|
|
668
|
+
const normalizedKey = input.key.toLowerCase();
|
|
669
|
+
const shortcut = shortcuts.find(
|
|
670
|
+
(candidate) =>
|
|
671
|
+
(candidate.key.toLowerCase() === normalizedKey ||
|
|
672
|
+
(candidate.code !== undefined && candidate.code === input.code)) &&
|
|
673
|
+
(candidate.modifiers ?? []).every((modifier) =>
|
|
674
|
+
hasShortcutModifier(modifier, input),
|
|
675
|
+
) &&
|
|
676
|
+
hasOnlyShortcutModifiers(candidate, input),
|
|
677
|
+
);
|
|
678
|
+
return shortcut?.command ?? null;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/** Creates a reusable, immutable shortcut lookup for one editor policy. */
|
|
682
|
+
export function createCanvasShortcutRegistry(
|
|
683
|
+
shortcuts: readonly CanvasShortcut[] = DEFAULT_CANVAS_SHORTCUTS,
|
|
684
|
+
): CanvasShortcutRegistry {
|
|
685
|
+
return {
|
|
686
|
+
shortcuts,
|
|
687
|
+
resolve: (input) => resolveCanvasShortcut(input, shortcuts),
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Creates an app-configured pure interaction core. `dispatch` is optional so
|
|
693
|
+
* hosts can either use the helpers directly or receive semantic commands via
|
|
694
|
+
* their adapter without the Toolkit owning any state.
|
|
695
|
+
*/
|
|
696
|
+
export function createCanvasInteractionCore<TObjectId = string>(
|
|
697
|
+
config: CanvasInteractionConfig = {},
|
|
698
|
+
adapter?: CanvasInteractionAdapter<TObjectId>,
|
|
699
|
+
) {
|
|
700
|
+
const textEditing = config.textEditing ?? {};
|
|
701
|
+
const capabilities: CanvasInteractionCapabilities = {
|
|
702
|
+
...DEFAULT_CANVAS_INTERACTION_CAPABILITIES,
|
|
703
|
+
...adapter?.capabilities,
|
|
704
|
+
...config.capabilities,
|
|
705
|
+
};
|
|
706
|
+
const drag = config.drag ?? {};
|
|
707
|
+
const nudge = config.nudge ?? {};
|
|
708
|
+
const shortcuts = createCanvasShortcutRegistry(config.shortcuts);
|
|
709
|
+
|
|
710
|
+
const supportsCommand = (command: CanvasCommand<TObjectId>): boolean => {
|
|
711
|
+
switch (command.id) {
|
|
712
|
+
case "copy":
|
|
713
|
+
case "cut":
|
|
714
|
+
case "paste":
|
|
715
|
+
return capabilities.clipboard;
|
|
716
|
+
case "duplicate":
|
|
717
|
+
return capabilities.duplicate;
|
|
718
|
+
case "delete":
|
|
719
|
+
return capabilities.delete;
|
|
720
|
+
case "nudge":
|
|
721
|
+
case "nudge-left":
|
|
722
|
+
case "nudge-right":
|
|
723
|
+
case "nudge-up":
|
|
724
|
+
case "nudge-down":
|
|
725
|
+
return capabilities.nudge;
|
|
726
|
+
case "arrange-front":
|
|
727
|
+
case "arrange-back":
|
|
728
|
+
case "bring-forward":
|
|
729
|
+
case "bring-to-front":
|
|
730
|
+
case "send-backward":
|
|
731
|
+
case "send-to-back":
|
|
732
|
+
return capabilities.arrange;
|
|
733
|
+
case "align-left":
|
|
734
|
+
case "align-center":
|
|
735
|
+
case "align-right":
|
|
736
|
+
case "align-top":
|
|
737
|
+
case "align-middle":
|
|
738
|
+
case "align-bottom":
|
|
739
|
+
return capabilities.alignment;
|
|
740
|
+
case "distribute-horizontal":
|
|
741
|
+
case "distribute-vertical":
|
|
742
|
+
return capabilities.distribution;
|
|
743
|
+
case "group":
|
|
744
|
+
case "ungroup":
|
|
745
|
+
return capabilities.grouping;
|
|
746
|
+
case "frame-selection":
|
|
747
|
+
return capabilities.selection;
|
|
748
|
+
default:
|
|
749
|
+
return true;
|
|
750
|
+
}
|
|
751
|
+
};
|
|
752
|
+
|
|
753
|
+
return {
|
|
754
|
+
capabilities,
|
|
755
|
+
textActivation: (input: CanvasTextActivationInput) =>
|
|
756
|
+
capabilities.textEditing
|
|
757
|
+
? resolveCanvasTextActivation(input, textEditing)
|
|
758
|
+
: "select",
|
|
759
|
+
escape: (input: CanvasEscapeInput<TObjectId>) =>
|
|
760
|
+
resolveCanvasEscape(input, textEditing),
|
|
761
|
+
clientPointToCanvas: (
|
|
762
|
+
point: CanvasPoint,
|
|
763
|
+
viewport: CanvasViewport,
|
|
764
|
+
canvas: CanvasSize,
|
|
765
|
+
) => clientPointToCanvasPoint(point, viewport, canvas),
|
|
766
|
+
clientDeltaToCanvas: (
|
|
767
|
+
delta: CanvasPoint,
|
|
768
|
+
viewport: CanvasViewport,
|
|
769
|
+
canvas: CanvasSize,
|
|
770
|
+
) => clientDeltaToCanvasDelta(delta, viewport, canvas),
|
|
771
|
+
hasCrossedDragThreshold: (start: CanvasPoint, current: CanvasPoint) =>
|
|
772
|
+
hasCrossedCanvasDragThreshold(start, current, drag.threshold),
|
|
773
|
+
constrainDrag: (delta: CanvasPoint, modifiers: CanvasModifiers = {}) =>
|
|
774
|
+
constrainCanvasDragDelta(delta, Boolean(modifiers.shiftKey)),
|
|
775
|
+
resize: (start: CanvasRect, input: CanvasResizeInput) =>
|
|
776
|
+
resizeCanvasRect(start, {
|
|
777
|
+
...input,
|
|
778
|
+
minWidth: input.minWidth ?? config.minSize,
|
|
779
|
+
minHeight: input.minHeight ?? config.minSize,
|
|
780
|
+
}),
|
|
781
|
+
shouldDuplicateDrag: (modifiers: CanvasModifiers) =>
|
|
782
|
+
capabilities.duplicate &&
|
|
783
|
+
shouldDuplicateCanvasDrag(modifiers, drag.duplicateModifier),
|
|
784
|
+
nudge: (input: CanvasNudgeInput) =>
|
|
785
|
+
capabilities.nudge ? resolveCanvasNudge(input, nudge) : null,
|
|
786
|
+
shortcut: (input: CanvasShortcutInput) => shortcuts.resolve(input),
|
|
787
|
+
dispatch: (command: CanvasCommand<TObjectId>) => {
|
|
788
|
+
if (!adapter) return { handled: false, reason: "no-adapter" } as const;
|
|
789
|
+
if (!supportsCommand(command)) {
|
|
790
|
+
return { handled: false, reason: "unsupported" } as const;
|
|
791
|
+
}
|
|
792
|
+
return adapter.dispatch(command);
|
|
793
|
+
},
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Creates a small state machine for one pointer gesture at a time. It keeps
|
|
799
|
+
* browser coordinates at its boundary, while every emitted preview and commit
|
|
800
|
+
* is in stable canvas coordinates. Hosts own rendering and persistence.
|
|
801
|
+
*/
|
|
802
|
+
export function createCanvasGestureController<TObjectId = string>(
|
|
803
|
+
config: CanvasGestureControllerConfig<TObjectId>,
|
|
804
|
+
) {
|
|
805
|
+
const core = createCanvasInteractionCore(config);
|
|
806
|
+
let start: CanvasGestureStart<TObjectId> | null = null;
|
|
807
|
+
let activeGesture: CanvasGesture<TObjectId> | null = null;
|
|
808
|
+
|
|
809
|
+
const state = (): CanvasGestureState<TObjectId> => ({
|
|
810
|
+
phase: activeGesture ? "active" : start ? "pending" : "idle",
|
|
811
|
+
gesture: activeGesture,
|
|
812
|
+
});
|
|
813
|
+
|
|
814
|
+
const canStart = (kind: CanvasGestureKind) =>
|
|
815
|
+
kind === "move" ? core.capabilities.move : core.capabilities.resize;
|
|
816
|
+
|
|
817
|
+
const buildGesture = (
|
|
818
|
+
gestureStart: CanvasGestureStart<TObjectId>,
|
|
819
|
+
pointer: CanvasGesturePointer,
|
|
820
|
+
): CanvasGesture<TObjectId> => {
|
|
821
|
+
const clientDelta = {
|
|
822
|
+
x: pointer.x - gestureStart.pointer.x,
|
|
823
|
+
y: pointer.y - gestureStart.pointer.y,
|
|
824
|
+
};
|
|
825
|
+
const convertedDelta = clientDeltaToCanvasDelta(
|
|
826
|
+
clientDelta,
|
|
827
|
+
gestureStart.viewport,
|
|
828
|
+
gestureStart.canvas,
|
|
829
|
+
);
|
|
830
|
+
const duplicate =
|
|
831
|
+
gestureStart.kind === "move" && core.capabilities.duplicate
|
|
832
|
+
? core.shouldDuplicateDrag(gestureStart.pointer) &&
|
|
833
|
+
core.shouldDuplicateDrag(pointer)
|
|
834
|
+
: false;
|
|
835
|
+
|
|
836
|
+
if (gestureStart.kind === "move") {
|
|
837
|
+
return {
|
|
838
|
+
kind: "move",
|
|
839
|
+
objectIds: gestureStart.objectIds,
|
|
840
|
+
startPointer: gestureStart.pointer,
|
|
841
|
+
pointer,
|
|
842
|
+
clientDelta,
|
|
843
|
+
canvasDelta: core.constrainDrag(convertedDelta, pointer),
|
|
844
|
+
duplicate,
|
|
845
|
+
};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
return {
|
|
849
|
+
kind: "resize",
|
|
850
|
+
objectIds: gestureStart.objectIds,
|
|
851
|
+
startPointer: gestureStart.pointer,
|
|
852
|
+
pointer,
|
|
853
|
+
clientDelta,
|
|
854
|
+
canvasDelta: convertedDelta,
|
|
855
|
+
duplicate: false,
|
|
856
|
+
handle: gestureStart.handle,
|
|
857
|
+
startRect: gestureStart.rect,
|
|
858
|
+
rect: core.resize(gestureStart.rect, {
|
|
859
|
+
handle: gestureStart.handle,
|
|
860
|
+
delta: convertedDelta,
|
|
861
|
+
altKey: pointer.altKey,
|
|
862
|
+
preserveAspectRatio: Boolean(pointer.shiftKey),
|
|
863
|
+
}),
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
|
|
867
|
+
const preview = (
|
|
868
|
+
gesture: CanvasGesture<TObjectId>,
|
|
869
|
+
): CanvasGestureUpdateResult<TObjectId> => {
|
|
870
|
+
activeGesture = gesture;
|
|
871
|
+
return {
|
|
872
|
+
phase: "active",
|
|
873
|
+
gesture,
|
|
874
|
+
preview: config.adapter.preview?.(gesture) ?? null,
|
|
875
|
+
state: state(),
|
|
876
|
+
};
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
const update = (
|
|
880
|
+
pointer: CanvasGesturePointer,
|
|
881
|
+
): CanvasGestureUpdateResult<TObjectId> => {
|
|
882
|
+
if (!start) return { phase: "idle", state: state() };
|
|
883
|
+
if (!activeGesture) {
|
|
884
|
+
const crossedThreshold = core.hasCrossedDragThreshold(
|
|
885
|
+
start.pointer,
|
|
886
|
+
pointer,
|
|
887
|
+
);
|
|
888
|
+
if (!crossedThreshold) return { phase: "pending", state: state() };
|
|
889
|
+
}
|
|
890
|
+
return preview(buildGesture(start, pointer));
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
const hasSamePointerState = (
|
|
894
|
+
first: CanvasGesturePointer,
|
|
895
|
+
second: CanvasGesturePointer,
|
|
896
|
+
) =>
|
|
897
|
+
first.x === second.x &&
|
|
898
|
+
first.y === second.y &&
|
|
899
|
+
Boolean(first.altKey) === Boolean(second.altKey) &&
|
|
900
|
+
Boolean(first.ctrlKey) === Boolean(second.ctrlKey) &&
|
|
901
|
+
Boolean(first.metaKey) === Boolean(second.metaKey) &&
|
|
902
|
+
Boolean(first.shiftKey) === Boolean(second.shiftKey);
|
|
903
|
+
|
|
904
|
+
return {
|
|
905
|
+
capabilities: core.capabilities,
|
|
906
|
+
getState: state,
|
|
907
|
+
pointerDown: (
|
|
908
|
+
gestureStart: CanvasGestureStart<TObjectId>,
|
|
909
|
+
): CanvasGestureBeginResult<TObjectId> => {
|
|
910
|
+
if (start) {
|
|
911
|
+
return { accepted: false, reason: "already-active", state: state() };
|
|
912
|
+
}
|
|
913
|
+
if (!canStart(gestureStart.kind)) {
|
|
914
|
+
return { accepted: false, reason: "unsupported", state: state() };
|
|
915
|
+
}
|
|
916
|
+
if (
|
|
917
|
+
gestureStart.kind === "resize" &&
|
|
918
|
+
(gestureStart.rect.width <= 0 || gestureStart.rect.height <= 0)
|
|
919
|
+
) {
|
|
920
|
+
return { accepted: false, reason: "invalid-resize", state: state() };
|
|
921
|
+
}
|
|
922
|
+
start = gestureStart;
|
|
923
|
+
return { accepted: true, state: state() };
|
|
924
|
+
},
|
|
925
|
+
pointerMove: update,
|
|
926
|
+
pointerUp: (
|
|
927
|
+
pointer: CanvasGesturePointer,
|
|
928
|
+
): CanvasGestureEndResult<TObjectId> => {
|
|
929
|
+
const shouldUpdate =
|
|
930
|
+
activeGesture === null ||
|
|
931
|
+
!hasSamePointerState(activeGesture.pointer, pointer);
|
|
932
|
+
const beforeEnd = shouldUpdate
|
|
933
|
+
? update(pointer)
|
|
934
|
+
: ({ phase: "active", state: state() } as const);
|
|
935
|
+
const gesture = activeGesture;
|
|
936
|
+
start = null;
|
|
937
|
+
activeGesture = null;
|
|
938
|
+
if (!gesture) {
|
|
939
|
+
return {
|
|
940
|
+
committed: false,
|
|
941
|
+
reason: beforeEnd.phase === "idle" ? "idle" : "below-threshold",
|
|
942
|
+
state: state(),
|
|
943
|
+
};
|
|
944
|
+
}
|
|
945
|
+
return {
|
|
946
|
+
committed: true,
|
|
947
|
+
gesture,
|
|
948
|
+
result: config.adapter.commit(gesture),
|
|
949
|
+
state: state(),
|
|
950
|
+
};
|
|
951
|
+
},
|
|
952
|
+
cancel: (): CanvasGestureCancelResult<TObjectId> => {
|
|
953
|
+
const gesture = activeGesture;
|
|
954
|
+
start = null;
|
|
955
|
+
activeGesture = null;
|
|
956
|
+
if (!gesture) return { cancelled: false, reason: "idle", state: state() };
|
|
957
|
+
return {
|
|
958
|
+
cancelled: true,
|
|
959
|
+
gesture,
|
|
960
|
+
result: config.adapter.cancel?.(gesture) ?? null,
|
|
961
|
+
state: state(),
|
|
962
|
+
};
|
|
963
|
+
},
|
|
964
|
+
};
|
|
965
|
+
}
|