@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,754 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
import { cn } from "../utils.js";
|
|
4
|
+
|
|
5
|
+
export type DataGridSelectionMode = "none" | "single" | "multiple";
|
|
6
|
+
|
|
7
|
+
export type DataGridDirection = "up" | "down" | "left" | "right";
|
|
8
|
+
|
|
9
|
+
export interface DataGridActiveCell {
|
|
10
|
+
rowId: string;
|
|
11
|
+
columnId: string;
|
|
12
|
+
editing: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface DataGridColumn<Row, Value = unknown> {
|
|
16
|
+
id: string;
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
width?: number;
|
|
19
|
+
minWidth?: number;
|
|
20
|
+
maxWidth?: number;
|
|
21
|
+
resizable?: boolean;
|
|
22
|
+
editable?: boolean | ((row: Row) => boolean);
|
|
23
|
+
getValue?: (row: Row) => Value;
|
|
24
|
+
renderCell?: (context: DataGridCellContext<Row, Value>) => React.ReactNode;
|
|
25
|
+
renderEditor?: (
|
|
26
|
+
context: DataGridEditorContext<Row, Value>,
|
|
27
|
+
) => React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface DataGridCellContext<Row, Value = unknown> {
|
|
31
|
+
row: Row;
|
|
32
|
+
rowIndex: number;
|
|
33
|
+
column: DataGridColumn<Row, Value>;
|
|
34
|
+
value: Value | undefined;
|
|
35
|
+
active: boolean;
|
|
36
|
+
editing: boolean;
|
|
37
|
+
editable: boolean;
|
|
38
|
+
startEditing: () => void;
|
|
39
|
+
commit: (value: Value) => void;
|
|
40
|
+
cancel: () => void;
|
|
41
|
+
move: (direction: DataGridDirection) => void;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface DataGridEditorContext<
|
|
45
|
+
Row,
|
|
46
|
+
Value = unknown,
|
|
47
|
+
> extends DataGridCellContext<Row, Value> {
|
|
48
|
+
onCommit: (value: Value) => void;
|
|
49
|
+
onCancel: () => void;
|
|
50
|
+
onMove: (direction: DataGridDirection) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface DataGridCommitContext<Row> {
|
|
54
|
+
row: Row;
|
|
55
|
+
rowIndex: number;
|
|
56
|
+
column: DataGridColumn<Row>;
|
|
57
|
+
previousValue: unknown;
|
|
58
|
+
value: unknown;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface DataGridSlotContext<Row> {
|
|
62
|
+
rows: readonly Row[];
|
|
63
|
+
columns: readonly DataGridColumn<Row>[];
|
|
64
|
+
columnWidths: Readonly<Record<string, number>>;
|
|
65
|
+
gridTemplateColumns: string;
|
|
66
|
+
selection: DataGridSelectionMode;
|
|
67
|
+
selectedRowIds: ReadonlySet<string>;
|
|
68
|
+
getRowId: (row: Row, rowIndex: number) => string;
|
|
69
|
+
setActiveCell: (cell: DataGridActiveCell | null) => void;
|
|
70
|
+
toggleRowSelection: (rowId: string) => void;
|
|
71
|
+
resizeColumn: (columnId: string, width: number) => void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface DataGridRowContext<Row> extends DataGridSlotContext<Row> {
|
|
75
|
+
row: Row;
|
|
76
|
+
rowIndex: number;
|
|
77
|
+
rowId: string;
|
|
78
|
+
selected: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type DataGridScrollContainerProps = Omit<
|
|
82
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
83
|
+
"children"
|
|
84
|
+
> &
|
|
85
|
+
Record<`data-${string}`, string | undefined>;
|
|
86
|
+
|
|
87
|
+
export interface DataGridProps<Row> extends Omit<
|
|
88
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
89
|
+
"children"
|
|
90
|
+
> {
|
|
91
|
+
rows: readonly Row[];
|
|
92
|
+
columns: readonly DataGridColumn<Row>[];
|
|
93
|
+
getRowId: (row: Row, rowIndex: number) => string;
|
|
94
|
+
columnWidths?: Readonly<Record<string, number>>;
|
|
95
|
+
onColumnWidthsChange?: (columnWidths: Record<string, number>) => void;
|
|
96
|
+
selection?: DataGridSelectionMode;
|
|
97
|
+
selectedRowIds?: ReadonlySet<string>;
|
|
98
|
+
onSelectedRowIdsChange?: (rowIds: ReadonlySet<string>) => void;
|
|
99
|
+
activeCell?: DataGridActiveCell | null;
|
|
100
|
+
onActiveCellChange?: (cell: DataGridActiveCell | null) => void;
|
|
101
|
+
onCellCommit?: (context: DataGridCommitContext<Row>) => void;
|
|
102
|
+
renderHeader?: (context: DataGridSlotContext<Row>) => React.ReactNode;
|
|
103
|
+
renderBody?: (context: DataGridSlotContext<Row>) => React.ReactNode;
|
|
104
|
+
renderRow?: (context: DataGridRowContext<Row>) => React.ReactNode;
|
|
105
|
+
renderFooter?: (context: DataGridSlotContext<Row>) => React.ReactNode;
|
|
106
|
+
emptyState?: React.ReactNode;
|
|
107
|
+
loading?: boolean;
|
|
108
|
+
loadingRowCount?: number;
|
|
109
|
+
contentClassName?: string;
|
|
110
|
+
rowClassName?: string | ((row: Row, rowIndex: number) => string);
|
|
111
|
+
scrollContainerProps?: DataGridScrollContainerProps;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const DEFAULT_COLUMN_WIDTH = 160;
|
|
115
|
+
const DEFAULT_MIN_COLUMN_WIDTH = 96;
|
|
116
|
+
const DEFAULT_MAX_COLUMN_WIDTH = 640;
|
|
117
|
+
const SELECTION_COLUMN_WIDTH = 40;
|
|
118
|
+
|
|
119
|
+
function columnWidth<Row>(
|
|
120
|
+
column: DataGridColumn<Row>,
|
|
121
|
+
requestedWidth: number | undefined,
|
|
122
|
+
) {
|
|
123
|
+
const fallback = column.width ?? DEFAULT_COLUMN_WIDTH;
|
|
124
|
+
const width =
|
|
125
|
+
requestedWidth !== undefined && Number.isFinite(requestedWidth)
|
|
126
|
+
? requestedWidth
|
|
127
|
+
: fallback;
|
|
128
|
+
const minWidth = column.minWidth ?? DEFAULT_MIN_COLUMN_WIDTH;
|
|
129
|
+
const maxWidth = Math.max(
|
|
130
|
+
minWidth,
|
|
131
|
+
column.maxWidth ?? DEFAULT_MAX_COLUMN_WIDTH,
|
|
132
|
+
);
|
|
133
|
+
return Math.min(maxWidth, Math.max(minWidth, Math.round(width)));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function clampDataGridColumnWidth<Row>(
|
|
137
|
+
width: number,
|
|
138
|
+
column: DataGridColumn<Row>,
|
|
139
|
+
) {
|
|
140
|
+
return columnWidth(column, width);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function dataGridColumnTemplate<Row>(
|
|
144
|
+
columns: readonly DataGridColumn<Row>[],
|
|
145
|
+
columnWidths: Readonly<Record<string, number>> = {},
|
|
146
|
+
selection: DataGridSelectionMode = "none",
|
|
147
|
+
) {
|
|
148
|
+
const selectionTemplate =
|
|
149
|
+
selection === "none" ? [] : [`${SELECTION_COLUMN_WIDTH}px`];
|
|
150
|
+
return [
|
|
151
|
+
...selectionTemplate,
|
|
152
|
+
...columns.map(
|
|
153
|
+
(column) => `${columnWidth(column, columnWidths[column.id])}px`,
|
|
154
|
+
),
|
|
155
|
+
].join(" ");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function isColumnEditable<Row>(column: DataGridColumn<Row>, row: Row) {
|
|
159
|
+
if (!column.renderEditor) return false;
|
|
160
|
+
return typeof column.editable === "function"
|
|
161
|
+
? column.editable(row)
|
|
162
|
+
: column.editable !== false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function defaultCellText(value: unknown) {
|
|
166
|
+
return value == null ? "" : String(value);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function loadingRows<Row>({
|
|
170
|
+
count,
|
|
171
|
+
columns,
|
|
172
|
+
gridTemplateColumns,
|
|
173
|
+
selection,
|
|
174
|
+
}: {
|
|
175
|
+
count: number;
|
|
176
|
+
columns: readonly DataGridColumn<Row>[];
|
|
177
|
+
gridTemplateColumns: string;
|
|
178
|
+
selection: DataGridSelectionMode;
|
|
179
|
+
}) {
|
|
180
|
+
return Array.from({ length: count }, (_, rowIndex) => (
|
|
181
|
+
<div
|
|
182
|
+
key={`loading-${rowIndex}`}
|
|
183
|
+
role="row"
|
|
184
|
+
aria-hidden="true"
|
|
185
|
+
className="grid min-h-10 border-b border-border/30"
|
|
186
|
+
style={{ gridTemplateColumns }}
|
|
187
|
+
>
|
|
188
|
+
{selection !== "none" ? <div role="gridcell" /> : null}
|
|
189
|
+
{columns.map((column) => (
|
|
190
|
+
<div key={column.id} role="gridcell" className="p-2">
|
|
191
|
+
<div className="h-4 w-2/3 animate-pulse rounded bg-muted" />
|
|
192
|
+
</div>
|
|
193
|
+
))}
|
|
194
|
+
</div>
|
|
195
|
+
));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function DataGridHeader<Row>({
|
|
199
|
+
columns,
|
|
200
|
+
gridTemplateColumns,
|
|
201
|
+
selection,
|
|
202
|
+
rows,
|
|
203
|
+
getRowId,
|
|
204
|
+
selectedRowIds,
|
|
205
|
+
onToggleAll,
|
|
206
|
+
onStartResize,
|
|
207
|
+
}: {
|
|
208
|
+
columns: readonly DataGridColumn<Row>[];
|
|
209
|
+
gridTemplateColumns: string;
|
|
210
|
+
selection: DataGridSelectionMode;
|
|
211
|
+
rows: readonly Row[];
|
|
212
|
+
getRowId: (row: Row, rowIndex: number) => string;
|
|
213
|
+
selectedRowIds: ReadonlySet<string>;
|
|
214
|
+
onToggleAll: () => void;
|
|
215
|
+
onStartResize: (
|
|
216
|
+
event: React.PointerEvent<HTMLButtonElement>,
|
|
217
|
+
column: DataGridColumn<Row>,
|
|
218
|
+
) => void;
|
|
219
|
+
}) {
|
|
220
|
+
const allSelected =
|
|
221
|
+
rows.length > 0 &&
|
|
222
|
+
rows.every((row, rowIndex) => selectedRowIds.has(getRowId(row, rowIndex)));
|
|
223
|
+
|
|
224
|
+
return (
|
|
225
|
+
<div
|
|
226
|
+
role="row"
|
|
227
|
+
className="grid border-y border-border/35 text-xs font-medium text-muted-foreground/80"
|
|
228
|
+
style={{ gridTemplateColumns }}
|
|
229
|
+
>
|
|
230
|
+
{selection !== "none" ? (
|
|
231
|
+
<div
|
|
232
|
+
role="columnheader"
|
|
233
|
+
className="flex h-9 items-center justify-center border-r border-border/30"
|
|
234
|
+
>
|
|
235
|
+
{selection === "multiple" ? (
|
|
236
|
+
<input
|
|
237
|
+
type="checkbox"
|
|
238
|
+
aria-label="Select all rows"
|
|
239
|
+
checked={allSelected}
|
|
240
|
+
onChange={onToggleAll}
|
|
241
|
+
/>
|
|
242
|
+
) : null}
|
|
243
|
+
</div>
|
|
244
|
+
) : null}
|
|
245
|
+
{columns.map((column) => (
|
|
246
|
+
<div
|
|
247
|
+
key={column.id}
|
|
248
|
+
role="columnheader"
|
|
249
|
+
data-data-grid-column-id={column.id}
|
|
250
|
+
className="group relative flex h-9 min-w-0 items-center gap-1 border-r border-border/30 px-2 last:border-r-0"
|
|
251
|
+
>
|
|
252
|
+
<span className="min-w-0 truncate">{column.label ?? column.id}</span>
|
|
253
|
+
{column.resizable === false ? null : (
|
|
254
|
+
<button
|
|
255
|
+
type="button"
|
|
256
|
+
aria-label={`Resize ${column.id} column`}
|
|
257
|
+
className="absolute inset-y-0 right-0 z-10 w-2 cursor-col-resize opacity-0 transition-opacity hover:opacity-100 focus-visible:opacity-100"
|
|
258
|
+
onPointerDown={(event) => onStartResize(event, column)}
|
|
259
|
+
/>
|
|
260
|
+
)}
|
|
261
|
+
</div>
|
|
262
|
+
))}
|
|
263
|
+
</div>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function DataGridDefaultRow<Row>({
|
|
268
|
+
row,
|
|
269
|
+
rowIndex,
|
|
270
|
+
rowId,
|
|
271
|
+
columns,
|
|
272
|
+
gridTemplateColumns,
|
|
273
|
+
selection,
|
|
274
|
+
selected,
|
|
275
|
+
rowClassName,
|
|
276
|
+
activeCell,
|
|
277
|
+
setActiveCell,
|
|
278
|
+
toggleRowSelection,
|
|
279
|
+
moveActiveCell,
|
|
280
|
+
commitCell,
|
|
281
|
+
}: {
|
|
282
|
+
row: Row;
|
|
283
|
+
rowIndex: number;
|
|
284
|
+
rowId: string;
|
|
285
|
+
columns: readonly DataGridColumn<Row>[];
|
|
286
|
+
gridTemplateColumns: string;
|
|
287
|
+
selection: DataGridSelectionMode;
|
|
288
|
+
selected: boolean;
|
|
289
|
+
rowClassName?: string;
|
|
290
|
+
activeCell: DataGridActiveCell | null;
|
|
291
|
+
setActiveCell: (cell: DataGridActiveCell | null) => void;
|
|
292
|
+
toggleRowSelection: (rowId: string) => void;
|
|
293
|
+
moveActiveCell: (
|
|
294
|
+
rowIndex: number,
|
|
295
|
+
columnIndex: number,
|
|
296
|
+
direction: DataGridDirection,
|
|
297
|
+
) => void;
|
|
298
|
+
commitCell: (
|
|
299
|
+
row: Row,
|
|
300
|
+
rowIndex: number,
|
|
301
|
+
column: DataGridColumn<Row>,
|
|
302
|
+
value: unknown,
|
|
303
|
+
) => void;
|
|
304
|
+
}) {
|
|
305
|
+
return (
|
|
306
|
+
<div
|
|
307
|
+
role="row"
|
|
308
|
+
data-data-grid-row-id={rowId}
|
|
309
|
+
aria-selected={selected || undefined}
|
|
310
|
+
className={cn(
|
|
311
|
+
"grid min-h-10 border-b border-border/30 text-sm",
|
|
312
|
+
rowClassName,
|
|
313
|
+
selected && "bg-muted/35",
|
|
314
|
+
)}
|
|
315
|
+
style={{ gridTemplateColumns }}
|
|
316
|
+
>
|
|
317
|
+
{selection !== "none" ? (
|
|
318
|
+
<div
|
|
319
|
+
role="gridcell"
|
|
320
|
+
className="flex items-center justify-center border-r border-border/30"
|
|
321
|
+
>
|
|
322
|
+
<input
|
|
323
|
+
type={selection === "single" ? "radio" : "checkbox"}
|
|
324
|
+
name={selection === "single" ? "data-grid-selection" : undefined}
|
|
325
|
+
aria-label={`Select row ${rowId}`}
|
|
326
|
+
checked={selected}
|
|
327
|
+
onChange={() => toggleRowSelection(rowId)}
|
|
328
|
+
/>
|
|
329
|
+
</div>
|
|
330
|
+
) : null}
|
|
331
|
+
{columns.map((column, columnIndex) => {
|
|
332
|
+
const value = column.getValue?.(row);
|
|
333
|
+
const active =
|
|
334
|
+
activeCell?.rowId === rowId && activeCell.columnId === column.id;
|
|
335
|
+
const editing = active && activeCell.editing;
|
|
336
|
+
const editable = isColumnEditable(column, row);
|
|
337
|
+
const startEditing = () => {
|
|
338
|
+
if (editable) {
|
|
339
|
+
setActiveCell({ rowId, columnId: column.id, editing: true });
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
const cancel = () => {
|
|
343
|
+
setActiveCell({ rowId, columnId: column.id, editing: false });
|
|
344
|
+
};
|
|
345
|
+
const commit = (nextValue: unknown) => {
|
|
346
|
+
commitCell(row, rowIndex, column, nextValue);
|
|
347
|
+
setActiveCell({ rowId, columnId: column.id, editing: false });
|
|
348
|
+
};
|
|
349
|
+
const move = (direction: DataGridDirection) => {
|
|
350
|
+
moveActiveCell(rowIndex, columnIndex, direction);
|
|
351
|
+
};
|
|
352
|
+
const context = {
|
|
353
|
+
row,
|
|
354
|
+
rowIndex,
|
|
355
|
+
column,
|
|
356
|
+
value,
|
|
357
|
+
active,
|
|
358
|
+
editing,
|
|
359
|
+
editable,
|
|
360
|
+
startEditing,
|
|
361
|
+
commit,
|
|
362
|
+
cancel,
|
|
363
|
+
move,
|
|
364
|
+
} satisfies DataGridCellContext<Row>;
|
|
365
|
+
|
|
366
|
+
return (
|
|
367
|
+
<div
|
|
368
|
+
key={column.id}
|
|
369
|
+
role="gridcell"
|
|
370
|
+
data-data-grid-cell="true"
|
|
371
|
+
data-data-grid-row-id={rowId}
|
|
372
|
+
data-data-grid-column-id={column.id}
|
|
373
|
+
tabIndex={active ? 0 : -1}
|
|
374
|
+
className={cn(
|
|
375
|
+
"min-w-0 border-r border-border/30 px-2 py-2 outline-none last:border-r-0",
|
|
376
|
+
active && "bg-accent/50 ring-1 ring-inset ring-ring",
|
|
377
|
+
)}
|
|
378
|
+
onClick={() =>
|
|
379
|
+
setActiveCell({ rowId, columnId: column.id, editing: false })
|
|
380
|
+
}
|
|
381
|
+
onDoubleClick={startEditing}
|
|
382
|
+
onKeyDown={(event) => {
|
|
383
|
+
if (editing) {
|
|
384
|
+
if (event.key === "Escape") {
|
|
385
|
+
event.preventDefault();
|
|
386
|
+
cancel();
|
|
387
|
+
}
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (event.key === "Enter" || event.key === "F2") {
|
|
391
|
+
if (editable) {
|
|
392
|
+
event.preventDefault();
|
|
393
|
+
startEditing();
|
|
394
|
+
}
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
const direction = {
|
|
398
|
+
ArrowUp: "up",
|
|
399
|
+
ArrowDown: "down",
|
|
400
|
+
ArrowLeft: "left",
|
|
401
|
+
ArrowRight: "right",
|
|
402
|
+
Tab: event.shiftKey ? "left" : "right",
|
|
403
|
+
}[event.key] as DataGridDirection | undefined;
|
|
404
|
+
if (direction) {
|
|
405
|
+
event.preventDefault();
|
|
406
|
+
move(direction);
|
|
407
|
+
}
|
|
408
|
+
}}
|
|
409
|
+
onPointerDown={(event) => {
|
|
410
|
+
if (event.button === 0) event.currentTarget.focus();
|
|
411
|
+
}}
|
|
412
|
+
>
|
|
413
|
+
{editing && column.renderEditor
|
|
414
|
+
? column.renderEditor({
|
|
415
|
+
...context,
|
|
416
|
+
onCommit: (nextValue) => commit(nextValue),
|
|
417
|
+
onCancel: cancel,
|
|
418
|
+
onMove: move,
|
|
419
|
+
})
|
|
420
|
+
: column.renderCell
|
|
421
|
+
? column.renderCell(context)
|
|
422
|
+
: defaultCellText(value)}
|
|
423
|
+
</div>
|
|
424
|
+
);
|
|
425
|
+
})}
|
|
426
|
+
</div>
|
|
427
|
+
);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export function DataGrid<Row>({
|
|
431
|
+
rows,
|
|
432
|
+
columns,
|
|
433
|
+
getRowId,
|
|
434
|
+
columnWidths,
|
|
435
|
+
onColumnWidthsChange,
|
|
436
|
+
selection = "none",
|
|
437
|
+
selectedRowIds,
|
|
438
|
+
onSelectedRowIdsChange,
|
|
439
|
+
activeCell,
|
|
440
|
+
onActiveCellChange,
|
|
441
|
+
onCellCommit,
|
|
442
|
+
renderHeader,
|
|
443
|
+
renderBody,
|
|
444
|
+
renderRow,
|
|
445
|
+
renderFooter,
|
|
446
|
+
emptyState,
|
|
447
|
+
loading = false,
|
|
448
|
+
loadingRowCount = 4,
|
|
449
|
+
contentClassName,
|
|
450
|
+
rowClassName,
|
|
451
|
+
scrollContainerProps,
|
|
452
|
+
className,
|
|
453
|
+
...gridProps
|
|
454
|
+
}: DataGridProps<Row>) {
|
|
455
|
+
const gridRef = React.useRef<HTMLDivElement>(null);
|
|
456
|
+
const hasMountedActiveCellRef = React.useRef(false);
|
|
457
|
+
const [internalColumnWidths, setInternalColumnWidths] = React.useState<
|
|
458
|
+
Record<string, number>
|
|
459
|
+
>({});
|
|
460
|
+
const [internalSelectedRowIds, setInternalSelectedRowIds] = React.useState<
|
|
461
|
+
ReadonlySet<string>
|
|
462
|
+
>(() => new Set());
|
|
463
|
+
const [internalActiveCell, setInternalActiveCell] =
|
|
464
|
+
React.useState<DataGridActiveCell | null>(() =>
|
|
465
|
+
rows.length > 0 && columns.length > 0
|
|
466
|
+
? {
|
|
467
|
+
rowId: getRowId(rows[0], 0),
|
|
468
|
+
columnId: columns[0].id,
|
|
469
|
+
editing: false,
|
|
470
|
+
}
|
|
471
|
+
: null,
|
|
472
|
+
);
|
|
473
|
+
|
|
474
|
+
const resolvedColumnWidths = columnWidths ?? internalColumnWidths;
|
|
475
|
+
const resolvedSelectedRowIds = selectedRowIds ?? internalSelectedRowIds;
|
|
476
|
+
const resolvedActiveCell =
|
|
477
|
+
activeCell === undefined ? internalActiveCell : activeCell;
|
|
478
|
+
const gridTemplateColumns = dataGridColumnTemplate(
|
|
479
|
+
columns,
|
|
480
|
+
resolvedColumnWidths,
|
|
481
|
+
selection,
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
const setActive = React.useCallback(
|
|
485
|
+
(cell: DataGridActiveCell | null) => {
|
|
486
|
+
if (activeCell === undefined) setInternalActiveCell(cell);
|
|
487
|
+
onActiveCellChange?.(cell);
|
|
488
|
+
},
|
|
489
|
+
[activeCell, onActiveCellChange],
|
|
490
|
+
);
|
|
491
|
+
|
|
492
|
+
React.useEffect(() => {
|
|
493
|
+
if (!resolvedActiveCell) return;
|
|
494
|
+
const hasRow = rows.some(
|
|
495
|
+
(row, rowIndex) => getRowId(row, rowIndex) === resolvedActiveCell.rowId,
|
|
496
|
+
);
|
|
497
|
+
const hasColumn = columns.some(
|
|
498
|
+
(column) => column.id === resolvedActiveCell.columnId,
|
|
499
|
+
);
|
|
500
|
+
if (!hasRow || !hasColumn) setActive(null);
|
|
501
|
+
}, [columns, getRowId, rows, resolvedActiveCell, setActive]);
|
|
502
|
+
|
|
503
|
+
React.useEffect(() => {
|
|
504
|
+
if (activeCell !== undefined || resolvedActiveCell) return;
|
|
505
|
+
if (rows.length === 0 || columns.length === 0) return;
|
|
506
|
+
setActive({
|
|
507
|
+
rowId: getRowId(rows[0], 0),
|
|
508
|
+
columnId: columns[0].id,
|
|
509
|
+
editing: false,
|
|
510
|
+
});
|
|
511
|
+
}, [activeCell, columns, getRowId, resolvedActiveCell, rows, setActive]);
|
|
512
|
+
|
|
513
|
+
React.useEffect(() => {
|
|
514
|
+
if (!resolvedActiveCell || resolvedActiveCell.editing) return;
|
|
515
|
+
if (!hasMountedActiveCellRef.current) {
|
|
516
|
+
hasMountedActiveCellRef.current = true;
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const cells = gridRef.current?.querySelectorAll<HTMLElement>(
|
|
520
|
+
"[data-data-grid-cell='true']",
|
|
521
|
+
);
|
|
522
|
+
const target = Array.from(cells ?? []).find(
|
|
523
|
+
(cell) =>
|
|
524
|
+
cell.dataset.dataGridRowId === resolvedActiveCell.rowId &&
|
|
525
|
+
cell.dataset.dataGridColumnId === resolvedActiveCell.columnId,
|
|
526
|
+
);
|
|
527
|
+
target?.focus();
|
|
528
|
+
}, [resolvedActiveCell]);
|
|
529
|
+
|
|
530
|
+
const setColumnWidth = React.useCallback(
|
|
531
|
+
(columnId: string, width: number) => {
|
|
532
|
+
const column = columns.find((candidate) => candidate.id === columnId);
|
|
533
|
+
if (!column) return;
|
|
534
|
+
const nextWidths = {
|
|
535
|
+
...resolvedColumnWidths,
|
|
536
|
+
[columnId]: clampDataGridColumnWidth(width, column),
|
|
537
|
+
};
|
|
538
|
+
if (columnWidths === undefined) setInternalColumnWidths(nextWidths);
|
|
539
|
+
onColumnWidthsChange?.(nextWidths);
|
|
540
|
+
},
|
|
541
|
+
[columnWidths, columns, onColumnWidthsChange, resolvedColumnWidths],
|
|
542
|
+
);
|
|
543
|
+
|
|
544
|
+
const startResize = React.useCallback(
|
|
545
|
+
(
|
|
546
|
+
event: React.PointerEvent<HTMLButtonElement>,
|
|
547
|
+
column: DataGridColumn<Row>,
|
|
548
|
+
) => {
|
|
549
|
+
event.preventDefault();
|
|
550
|
+
event.stopPropagation();
|
|
551
|
+
const startX = event.clientX;
|
|
552
|
+
const startWidth = columnWidth(column, resolvedColumnWidths[column.id]);
|
|
553
|
+
const handleMove = (moveEvent: PointerEvent) => {
|
|
554
|
+
setColumnWidth(column.id, startWidth + moveEvent.clientX - startX);
|
|
555
|
+
};
|
|
556
|
+
const handleUp = () => {
|
|
557
|
+
document.removeEventListener("pointermove", handleMove);
|
|
558
|
+
document.removeEventListener("pointerup", handleUp);
|
|
559
|
+
};
|
|
560
|
+
document.addEventListener("pointermove", handleMove);
|
|
561
|
+
document.addEventListener("pointerup", handleUp, { once: true });
|
|
562
|
+
},
|
|
563
|
+
[resolvedColumnWidths, setColumnWidth],
|
|
564
|
+
);
|
|
565
|
+
|
|
566
|
+
const setSelected = React.useCallback(
|
|
567
|
+
(nextRowIds: ReadonlySet<string>) => {
|
|
568
|
+
if (selectedRowIds === undefined) setInternalSelectedRowIds(nextRowIds);
|
|
569
|
+
onSelectedRowIdsChange?.(nextRowIds);
|
|
570
|
+
},
|
|
571
|
+
[onSelectedRowIdsChange, selectedRowIds],
|
|
572
|
+
);
|
|
573
|
+
|
|
574
|
+
const toggleRowSelection = React.useCallback(
|
|
575
|
+
(rowId: string) => {
|
|
576
|
+
if (selection === "none") return;
|
|
577
|
+
const next = new Set(resolvedSelectedRowIds);
|
|
578
|
+
if (selection === "single") {
|
|
579
|
+
if (next.has(rowId)) next.clear();
|
|
580
|
+
else {
|
|
581
|
+
next.clear();
|
|
582
|
+
next.add(rowId);
|
|
583
|
+
}
|
|
584
|
+
} else if (next.has(rowId)) next.delete(rowId);
|
|
585
|
+
else next.add(rowId);
|
|
586
|
+
setSelected(next);
|
|
587
|
+
},
|
|
588
|
+
[resolvedSelectedRowIds, selection, setSelected],
|
|
589
|
+
);
|
|
590
|
+
|
|
591
|
+
const toggleAllRows = React.useCallback(() => {
|
|
592
|
+
if (selection !== "multiple") return;
|
|
593
|
+
const allSelected =
|
|
594
|
+
rows.length > 0 &&
|
|
595
|
+
rows.every((row, rowIndex) =>
|
|
596
|
+
resolvedSelectedRowIds.has(getRowId(row, rowIndex)),
|
|
597
|
+
);
|
|
598
|
+
setSelected(
|
|
599
|
+
allSelected
|
|
600
|
+
? new Set()
|
|
601
|
+
: new Set(rows.map((row, rowIndex) => getRowId(row, rowIndex))),
|
|
602
|
+
);
|
|
603
|
+
}, [getRowId, resolvedSelectedRowIds, rows, selection, setSelected]);
|
|
604
|
+
|
|
605
|
+
const moveActiveCell = React.useCallback(
|
|
606
|
+
(rowIndex: number, columnIndex: number, direction: DataGridDirection) => {
|
|
607
|
+
if (rows.length === 0 || columns.length === 0) return;
|
|
608
|
+
let nextRowIndex = rowIndex;
|
|
609
|
+
let nextColumnIndex = columnIndex;
|
|
610
|
+
if (direction === "up") nextRowIndex = Math.max(0, rowIndex - 1);
|
|
611
|
+
if (direction === "down") {
|
|
612
|
+
nextRowIndex = Math.min(rows.length - 1, rowIndex + 1);
|
|
613
|
+
}
|
|
614
|
+
if (direction === "left") {
|
|
615
|
+
if (columnIndex > 0) nextColumnIndex = columnIndex - 1;
|
|
616
|
+
else if (rowIndex > 0) {
|
|
617
|
+
nextRowIndex = rowIndex - 1;
|
|
618
|
+
nextColumnIndex = columns.length - 1;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
if (direction === "right") {
|
|
622
|
+
if (columnIndex < columns.length - 1) nextColumnIndex = columnIndex + 1;
|
|
623
|
+
else if (rowIndex < rows.length - 1) {
|
|
624
|
+
nextRowIndex = rowIndex + 1;
|
|
625
|
+
nextColumnIndex = 0;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
setActive({
|
|
629
|
+
rowId: getRowId(rows[nextRowIndex], nextRowIndex),
|
|
630
|
+
columnId: columns[nextColumnIndex].id,
|
|
631
|
+
editing: false,
|
|
632
|
+
});
|
|
633
|
+
},
|
|
634
|
+
[columns, getRowId, rows, setActive],
|
|
635
|
+
);
|
|
636
|
+
|
|
637
|
+
const commitCell = React.useCallback(
|
|
638
|
+
(
|
|
639
|
+
row: Row,
|
|
640
|
+
rowIndex: number,
|
|
641
|
+
column: DataGridColumn<Row>,
|
|
642
|
+
value: unknown,
|
|
643
|
+
) => {
|
|
644
|
+
onCellCommit?.({
|
|
645
|
+
row,
|
|
646
|
+
rowIndex,
|
|
647
|
+
column,
|
|
648
|
+
previousValue: column.getValue?.(row),
|
|
649
|
+
value,
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
[onCellCommit],
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
const slotContext: DataGridSlotContext<Row> = {
|
|
656
|
+
rows,
|
|
657
|
+
columns,
|
|
658
|
+
columnWidths: resolvedColumnWidths,
|
|
659
|
+
gridTemplateColumns,
|
|
660
|
+
selection,
|
|
661
|
+
selectedRowIds: resolvedSelectedRowIds,
|
|
662
|
+
getRowId,
|
|
663
|
+
setActiveCell: setActive,
|
|
664
|
+
toggleRowSelection,
|
|
665
|
+
resizeColumn: setColumnWidth,
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
const { className: scrollClassName, ...restScrollContainerProps } =
|
|
669
|
+
scrollContainerProps ?? {};
|
|
670
|
+
const loadingCount = Number.isFinite(loadingRowCount)
|
|
671
|
+
? Math.max(1, Math.floor(loadingRowCount))
|
|
672
|
+
: 1;
|
|
673
|
+
|
|
674
|
+
return (
|
|
675
|
+
<div
|
|
676
|
+
{...gridProps}
|
|
677
|
+
ref={gridRef}
|
|
678
|
+
role={gridProps.role ?? "grid"}
|
|
679
|
+
className={cn("w-full min-w-0", className)}
|
|
680
|
+
aria-busy={loading || undefined}
|
|
681
|
+
>
|
|
682
|
+
<div
|
|
683
|
+
{...restScrollContainerProps}
|
|
684
|
+
data-data-grid-scroll-container="true"
|
|
685
|
+
className={cn(
|
|
686
|
+
"w-full min-w-0 max-w-full overflow-x-auto overscroll-x-contain",
|
|
687
|
+
scrollClassName,
|
|
688
|
+
)}
|
|
689
|
+
>
|
|
690
|
+
<div className={cn("w-max min-w-full", contentClassName)}>
|
|
691
|
+
{renderHeader ? (
|
|
692
|
+
renderHeader(slotContext)
|
|
693
|
+
) : (
|
|
694
|
+
<DataGridHeader
|
|
695
|
+
columns={columns}
|
|
696
|
+
gridTemplateColumns={gridTemplateColumns}
|
|
697
|
+
selection={selection}
|
|
698
|
+
rows={rows}
|
|
699
|
+
getRowId={getRowId}
|
|
700
|
+
selectedRowIds={resolvedSelectedRowIds}
|
|
701
|
+
onToggleAll={toggleAllRows}
|
|
702
|
+
onStartResize={startResize}
|
|
703
|
+
/>
|
|
704
|
+
)}
|
|
705
|
+
{renderBody
|
|
706
|
+
? renderBody(slotContext)
|
|
707
|
+
: loading
|
|
708
|
+
? loadingRows({
|
|
709
|
+
count: loadingCount,
|
|
710
|
+
columns,
|
|
711
|
+
gridTemplateColumns,
|
|
712
|
+
selection,
|
|
713
|
+
})
|
|
714
|
+
: rows.length > 0
|
|
715
|
+
? rows.map((row, rowIndex) => {
|
|
716
|
+
const rowId = getRowId(row, rowIndex);
|
|
717
|
+
const rowContext: DataGridRowContext<Row> = {
|
|
718
|
+
...slotContext,
|
|
719
|
+
row,
|
|
720
|
+
rowIndex,
|
|
721
|
+
rowId,
|
|
722
|
+
selected: resolvedSelectedRowIds.has(rowId),
|
|
723
|
+
};
|
|
724
|
+
if (renderRow) return renderRow(rowContext);
|
|
725
|
+
return (
|
|
726
|
+
<DataGridDefaultRow
|
|
727
|
+
key={rowId}
|
|
728
|
+
row={row}
|
|
729
|
+
rowIndex={rowIndex}
|
|
730
|
+
rowId={rowId}
|
|
731
|
+
columns={columns}
|
|
732
|
+
gridTemplateColumns={gridTemplateColumns}
|
|
733
|
+
selection={selection}
|
|
734
|
+
selected={rowContext.selected}
|
|
735
|
+
rowClassName={
|
|
736
|
+
typeof rowClassName === "function"
|
|
737
|
+
? rowClassName(row, rowIndex)
|
|
738
|
+
: rowClassName
|
|
739
|
+
}
|
|
740
|
+
activeCell={resolvedActiveCell}
|
|
741
|
+
setActiveCell={setActive}
|
|
742
|
+
toggleRowSelection={toggleRowSelection}
|
|
743
|
+
moveActiveCell={moveActiveCell}
|
|
744
|
+
commitCell={commitCell}
|
|
745
|
+
/>
|
|
746
|
+
);
|
|
747
|
+
})
|
|
748
|
+
: emptyState}
|
|
749
|
+
{renderFooter ? renderFooter(slotContext) : null}
|
|
750
|
+
</div>
|
|
751
|
+
</div>
|
|
752
|
+
</div>
|
|
753
|
+
);
|
|
754
|
+
}
|