@flanksource/clicky-ui 0.3.60 → 0.3.62
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/NOTICE.md +4 -0
- package/dist/chat.cjs +7 -1
- package/dist/chat.js +4 -2
- package/dist/comments/AnnotationSurface.cjs +317 -0
- package/dist/comments/AnnotationSurface.cjs.map +1 -0
- package/dist/comments/AnnotationSurface.d.ts +19 -0
- package/dist/comments/AnnotationSurface.d.ts.map +1 -0
- package/dist/comments/AnnotationSurface.js +317 -0
- package/dist/comments/AnnotationSurface.js.map +1 -0
- package/dist/comments/CapturePin.cjs +26 -0
- package/dist/comments/CapturePin.cjs.map +1 -0
- package/dist/comments/CapturePin.d.ts +12 -0
- package/dist/comments/CapturePin.d.ts.map +1 -0
- package/dist/comments/CapturePin.js +26 -0
- package/dist/comments/CapturePin.js.map +1 -0
- package/dist/comments/CommentAuthor.cjs +17 -3
- package/dist/comments/CommentAuthor.cjs.map +1 -1
- package/dist/comments/CommentAuthor.d.ts +3 -0
- package/dist/comments/CommentAuthor.d.ts.map +1 -1
- package/dist/comments/CommentAuthor.js +18 -5
- package/dist/comments/CommentAuthor.js.map +1 -1
- package/dist/comments/CommentCard.cjs +98 -52
- package/dist/comments/CommentCard.cjs.map +1 -1
- package/dist/comments/CommentCard.d.ts +3 -0
- package/dist/comments/CommentCard.d.ts.map +1 -1
- package/dist/comments/CommentCard.js +100 -54
- package/dist/comments/CommentCard.js.map +1 -1
- package/dist/comments/CommentCardParts.cjs +76 -0
- package/dist/comments/CommentCardParts.cjs.map +1 -1
- package/dist/comments/CommentCardParts.d.ts.map +1 -1
- package/dist/comments/CommentCardParts.js +76 -0
- package/dist/comments/CommentCardParts.js.map +1 -1
- package/dist/comments/CommentComposer.cjs +71 -34
- package/dist/comments/CommentComposer.cjs.map +1 -1
- package/dist/comments/CommentComposer.d.ts +2 -1
- package/dist/comments/CommentComposer.d.ts.map +1 -1
- package/dist/comments/CommentComposer.js +72 -35
- package/dist/comments/CommentComposer.js.map +1 -1
- package/dist/comments/CommentDraftCard.cjs +68 -0
- package/dist/comments/CommentDraftCard.cjs.map +1 -0
- package/dist/comments/CommentDraftCard.d.ts +7 -0
- package/dist/comments/CommentDraftCard.d.ts.map +1 -0
- package/dist/comments/CommentDraftCard.js +68 -0
- package/dist/comments/CommentDraftCard.js.map +1 -0
- package/dist/comments/CommentDraftPopover.cjs +60 -0
- package/dist/comments/CommentDraftPopover.cjs.map +1 -0
- package/dist/comments/CommentDraftPopover.d.ts +6 -0
- package/dist/comments/CommentDraftPopover.d.ts.map +1 -0
- package/dist/comments/CommentDraftPopover.js +60 -0
- package/dist/comments/CommentDraftPopover.js.map +1 -0
- package/dist/comments/CommentEditor.cjs +350 -0
- package/dist/comments/CommentEditor.cjs.map +1 -0
- package/dist/comments/CommentEditor.d.ts +10 -0
- package/dist/comments/CommentEditor.d.ts.map +1 -0
- package/dist/comments/CommentEditor.js +350 -0
- package/dist/comments/CommentEditor.js.map +1 -0
- package/dist/comments/CommentMarkdown.cjs +28 -13
- package/dist/comments/CommentMarkdown.cjs.map +1 -1
- package/dist/comments/CommentMarkdown.d.ts +4 -1
- package/dist/comments/CommentMarkdown.d.ts.map +1 -1
- package/dist/comments/CommentMarkdown.js +28 -13
- package/dist/comments/CommentMarkdown.js.map +1 -1
- package/dist/comments/CommentPersistenceBoundary.cjs +55 -0
- package/dist/comments/CommentPersistenceBoundary.cjs.map +1 -0
- package/dist/comments/CommentPersistenceBoundary.d.ts +6 -0
- package/dist/comments/CommentPersistenceBoundary.d.ts.map +1 -0
- package/dist/comments/CommentPersistenceBoundary.js +55 -0
- package/dist/comments/CommentPersistenceBoundary.js.map +1 -0
- package/dist/comments/CommentPreview.cjs +45 -0
- package/dist/comments/CommentPreview.cjs.map +1 -0
- package/dist/comments/CommentPreview.d.ts +7 -0
- package/dist/comments/CommentPreview.d.ts.map +1 -0
- package/dist/comments/CommentPreview.js +45 -0
- package/dist/comments/CommentPreview.js.map +1 -0
- package/dist/comments/CommentProvider.cjs +34 -9
- package/dist/comments/CommentProvider.cjs.map +1 -1
- package/dist/comments/CommentProvider.d.ts +3 -1
- package/dist/comments/CommentProvider.d.ts.map +1 -1
- package/dist/comments/CommentProvider.js +34 -9
- package/dist/comments/CommentProvider.js.map +1 -1
- package/dist/comments/CommentRail.cjs +83 -0
- package/dist/comments/CommentRail.cjs.map +1 -0
- package/dist/comments/CommentRail.d.ts +18 -0
- package/dist/comments/CommentRail.d.ts.map +1 -0
- package/dist/comments/CommentRail.js +83 -0
- package/dist/comments/CommentRail.js.map +1 -0
- package/dist/comments/CommentReplyInput.cjs +73 -0
- package/dist/comments/CommentReplyInput.cjs.map +1 -0
- package/dist/comments/CommentReplyInput.d.ts +9 -0
- package/dist/comments/CommentReplyInput.d.ts.map +1 -0
- package/dist/comments/CommentReplyInput.js +73 -0
- package/dist/comments/CommentReplyInput.js.map +1 -0
- package/dist/comments/CommentSidePanel.cjs +22 -6
- package/dist/comments/CommentSidePanel.cjs.map +1 -1
- package/dist/comments/CommentSidePanel.d.ts +4 -1
- package/dist/comments/CommentSidePanel.d.ts.map +1 -1
- package/dist/comments/CommentSidePanel.js +22 -6
- package/dist/comments/CommentSidePanel.js.map +1 -1
- package/dist/comments/CommentThread.cjs +4 -1
- package/dist/comments/CommentThread.cjs.map +1 -1
- package/dist/comments/CommentThread.d.ts +3 -2
- package/dist/comments/CommentThread.d.ts.map +1 -1
- package/dist/comments/CommentThread.js +4 -1
- package/dist/comments/CommentThread.js.map +1 -1
- package/dist/comments/CommentThreadList.cjs +55 -86
- package/dist/comments/CommentThreadList.cjs.map +1 -1
- package/dist/comments/CommentThreadList.d.ts +4 -3
- package/dist/comments/CommentThreadList.d.ts.map +1 -1
- package/dist/comments/CommentThreadList.js +56 -87
- package/dist/comments/CommentThreadList.js.map +1 -1
- package/dist/comments/ElementOutline.cjs +20 -0
- package/dist/comments/ElementOutline.cjs.map +1 -0
- package/dist/comments/ElementOutline.d.ts +6 -0
- package/dist/comments/ElementOutline.d.ts.map +1 -0
- package/dist/comments/ElementOutline.js +20 -0
- package/dist/comments/ElementOutline.js.map +1 -0
- package/dist/comments/VocabularyChip.cjs +50 -0
- package/dist/comments/VocabularyChip.cjs.map +1 -0
- package/dist/comments/VocabularyChip.d.ts +6 -0
- package/dist/comments/VocabularyChip.d.ts.map +1 -0
- package/dist/comments/VocabularyChip.js +50 -0
- package/dist/comments/VocabularyChip.js.map +1 -0
- package/dist/comments/VocabularyPreview.cjs +15 -0
- package/dist/comments/VocabularyPreview.cjs.map +1 -0
- package/dist/comments/VocabularyPreview.d.ts +7 -0
- package/dist/comments/VocabularyPreview.d.ts.map +1 -0
- package/dist/comments/VocabularyPreview.js +15 -0
- package/dist/comments/VocabularyPreview.js.map +1 -0
- package/dist/comments/agent-delivery.cjs +23 -0
- package/dist/comments/agent-delivery.cjs.map +1 -0
- package/dist/comments/agent-delivery.d.ts +15 -0
- package/dist/comments/agent-delivery.d.ts.map +1 -0
- package/dist/comments/agent-delivery.js +22 -0
- package/dist/comments/agent-delivery.js.map +1 -0
- package/dist/comments/anchoring/CommentAnchorBridge.cjs +36 -0
- package/dist/comments/anchoring/CommentAnchorBridge.cjs.map +1 -0
- package/dist/comments/anchoring/CommentAnchorBridge.d.ts +8 -0
- package/dist/comments/anchoring/CommentAnchorBridge.d.ts.map +1 -0
- package/dist/comments/anchoring/CommentAnchorBridge.js +36 -0
- package/dist/comments/anchoring/CommentAnchorBridge.js.map +1 -0
- package/dist/comments/anchoring/dom-anchor.cjs +402 -0
- package/dist/comments/anchoring/dom-anchor.cjs.map +1 -0
- package/dist/comments/anchoring/dom-anchor.d.ts +82 -0
- package/dist/comments/anchoring/dom-anchor.d.ts.map +1 -0
- package/dist/comments/anchoring/dom-anchor.js +384 -0
- package/dist/comments/anchoring/dom-anchor.js.map +1 -0
- package/dist/comments/anchoring/index.d.ts +6 -0
- package/dist/comments/anchoring/index.d.ts.map +1 -0
- package/dist/comments/anchoring/markdown-anchor.cjs +188 -0
- package/dist/comments/anchoring/markdown-anchor.cjs.map +1 -0
- package/dist/comments/anchoring/markdown-anchor.d.ts +37 -0
- package/dist/comments/anchoring/markdown-anchor.d.ts.map +1 -0
- package/dist/comments/anchoring/markdown-anchor.js +181 -0
- package/dist/comments/anchoring/markdown-anchor.js.map +1 -0
- package/dist/comments/anchoring/model.cjs +11 -0
- package/dist/comments/anchoring/model.cjs.map +1 -0
- package/dist/comments/anchoring/model.d.ts +30 -0
- package/dist/comments/anchoring/model.d.ts.map +1 -0
- package/dist/comments/anchoring/model.js +8 -0
- package/dist/comments/anchoring/model.js.map +1 -0
- package/dist/comments/anchoring/patch-anchor.cjs +86 -0
- package/dist/comments/anchoring/patch-anchor.cjs.map +1 -0
- package/dist/comments/anchoring/patch-anchor.d.ts +26 -0
- package/dist/comments/anchoring/patch-anchor.d.ts.map +1 -0
- package/dist/comments/anchoring/patch-anchor.js +80 -0
- package/dist/comments/anchoring/patch-anchor.js.map +1 -0
- package/dist/comments/annotation-screenshot.cjs +191 -0
- package/dist/comments/annotation-screenshot.cjs.map +1 -0
- package/dist/comments/annotation-screenshot.d.ts +16 -0
- package/dist/comments/annotation-screenshot.d.ts.map +1 -0
- package/dist/comments/annotation-screenshot.js +189 -0
- package/dist/comments/annotation-screenshot.js.map +1 -0
- package/dist/comments/annotation-types.d.ts +36 -0
- package/dist/comments/annotation-types.d.ts.map +1 -0
- package/dist/comments/comment-context.cjs.map +1 -1
- package/dist/comments/comment-context.d.ts +1 -1
- package/dist/comments/comment-context.d.ts.map +1 -1
- package/dist/comments/comment-context.js.map +1 -1
- package/dist/comments/comment-detail.d.ts +14 -0
- package/dist/comments/comment-detail.d.ts.map +1 -0
- package/dist/comments/comment-persistence.cjs +102 -0
- package/dist/comments/comment-persistence.cjs.map +1 -0
- package/dist/comments/comment-persistence.d.ts +29 -0
- package/dist/comments/comment-persistence.d.ts.map +1 -0
- package/dist/comments/comment-persistence.js +99 -0
- package/dist/comments/comment-persistence.js.map +1 -0
- package/dist/comments/comment-types.cjs.map +1 -1
- package/dist/comments/comment-types.d.ts +18 -0
- package/dist/comments/comment-types.d.ts.map +1 -1
- package/dist/comments/comment-types.js.map +1 -1
- package/dist/comments/comment-utils.cjs +3 -1
- package/dist/comments/comment-utils.cjs.map +1 -1
- package/dist/comments/comment-utils.d.ts.map +1 -1
- package/dist/comments/comment-utils.js +3 -1
- package/dist/comments/comment-utils.js.map +1 -1
- package/dist/comments/comment-vocabulary.cjs +38 -0
- package/dist/comments/comment-vocabulary.cjs.map +1 -0
- package/dist/comments/comment-vocabulary.d.ts +33 -0
- package/dist/comments/comment-vocabulary.d.ts.map +1 -0
- package/dist/comments/comment-vocabulary.js +34 -0
- package/dist/comments/comment-vocabulary.js.map +1 -0
- package/dist/comments/element-picker.cjs +47 -0
- package/dist/comments/element-picker.cjs.map +1 -0
- package/dist/comments/element-picker.d.ts +28 -0
- package/dist/comments/element-picker.d.ts.map +1 -0
- package/dist/comments/element-picker.js +46 -0
- package/dist/comments/element-picker.js.map +1 -0
- package/dist/comments/use-comment-rail-width.cjs +28 -0
- package/dist/comments/use-comment-rail-width.cjs.map +1 -0
- package/dist/comments/use-comment-rail-width.d.ts +2 -0
- package/dist/comments/use-comment-rail-width.d.ts.map +1 -0
- package/dist/comments/use-comment-rail-width.js +28 -0
- package/dist/comments/use-comment-rail-width.js.map +1 -0
- package/dist/comments/vocabulary-capture.cjs +47 -0
- package/dist/comments/vocabulary-capture.cjs.map +1 -0
- package/dist/comments/vocabulary-capture.d.ts +10 -0
- package/dist/comments/vocabulary-capture.d.ts.map +1 -0
- package/dist/comments/vocabulary-capture.js +47 -0
- package/dist/comments/vocabulary-capture.js.map +1 -0
- package/dist/comments.cjs +87 -6
- package/dist/comments.d.ts +18 -1
- package/dist/comments.d.ts.map +1 -1
- package/dist/comments.js +26 -7
- package/dist/components/DateField.d.ts +1 -1
- package/dist/components/DatePicker.d.ts +1 -1
- package/dist/components/DateTimePicker.d.ts +1 -1
- package/dist/components/SplitButton.cjs +2 -2
- package/dist/components/SplitButton.cjs.map +1 -1
- package/dist/components/SplitButton.js +2 -2
- package/dist/components/SplitButton.js.map +1 -1
- package/dist/components/mdx-editor-callout-model.d.ts +1 -1
- package/dist/components/mdx-editor-field-plugins.cjs +11 -2
- package/dist/components/mdx-editor-field-plugins.cjs.map +1 -1
- package/dist/components/mdx-editor-field-plugins.d.ts.map +1 -1
- package/dist/components/mdx-editor-field-plugins.js +11 -2
- package/dist/components/mdx-editor-field-plugins.js.map +1 -1
- package/dist/components/mdx-editor-options.d.ts +7 -0
- package/dist/components/mdx-editor-options.d.ts.map +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.d.ts +1 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +2 -1
- package/dist/data/ImagePreview.cjs +42 -0
- package/dist/data/ImagePreview.cjs.map +1 -0
- package/dist/data/ImagePreview.d.ts +13 -0
- package/dist/data/ImagePreview.d.ts.map +1 -0
- package/dist/data/ImagePreview.js +42 -0
- package/dist/data/ImagePreview.js.map +1 -0
- package/dist/data/Markdown.cjs +31 -2
- package/dist/data/Markdown.cjs.map +1 -1
- package/dist/data/Markdown.d.ts +3 -1
- package/dist/data/Markdown.d.ts.map +1 -1
- package/dist/data/Markdown.js +31 -2
- package/dist/data/Markdown.js.map +1 -1
- package/dist/data/MarkdownEditor.model.d.ts +1 -1
- package/dist/data/Tree.cjs +17 -9
- package/dist/data/Tree.cjs.map +1 -1
- package/dist/data/Tree.d.ts +5 -1
- package/dist/data/Tree.d.ts.map +1 -1
- package/dist/data/Tree.js +17 -9
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/TreeNode.cjs +32 -9
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts +5 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +32 -9
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/ai/RuntimeModePicker.cjs +1 -1
- package/dist/data/ai/RuntimeModePicker.js +1 -1
- package/dist/data/ai/SessionInspector.summary.cjs +1 -1
- package/dist/data/ai/SessionInspector.summary.js +1 -1
- package/dist/data/ai/SpecRuntimeEditor/ModelSection.cjs +1 -1
- package/dist/data/ai/SpecRuntimeEditor/ModelSection.js +1 -1
- package/dist/data/chat/AgentIdentity.cjs +56 -0
- package/dist/data/chat/AgentIdentity.cjs.map +1 -0
- package/dist/data/chat/AgentIdentity.d.ts +17 -0
- package/dist/data/chat/AgentIdentity.d.ts.map +1 -0
- package/dist/data/chat/AgentIdentity.js +55 -0
- package/dist/data/chat/AgentIdentity.js.map +1 -0
- package/dist/data/chat/Chat.cjs +1 -1
- package/dist/data/chat/Chat.js +1 -1
- package/dist/data/chat/ContextMeter.bar.cjs +2 -2
- package/dist/data/chat/ContextMeter.bar.js +2 -2
- package/dist/data/chat/ContextMeter.model.cjs +41 -13
- package/dist/data/chat/ContextMeter.model.cjs.map +1 -1
- package/dist/data/chat/ContextMeter.model.d.ts +2 -0
- package/dist/data/chat/ContextMeter.model.d.ts.map +1 -1
- package/dist/data/chat/ContextMeter.model.js +41 -14
- package/dist/data/chat/ContextMeter.model.js.map +1 -1
- package/dist/data/chat/ModelSelector.cjs +1 -1
- package/dist/data/chat/ModelSelector.js +1 -1
- package/dist/data/chat/agent-identity-context.cjs +5 -0
- package/dist/data/chat/agent-identity-context.cjs.map +1 -0
- package/dist/data/chat/agent-identity-context.d.ts +7 -0
- package/dist/data/chat/agent-identity-context.d.ts.map +1 -0
- package/dist/data/chat/agent-identity-context.js +6 -0
- package/dist/data/chat/agent-identity-context.js.map +1 -0
- package/dist/data/chat/index.d.ts +3 -0
- package/dist/data/chat/index.d.ts.map +1 -1
- package/dist/data/diagnostics/ActionError.cjs +26 -0
- package/dist/data/diagnostics/ActionError.cjs.map +1 -0
- package/dist/data/diagnostics/ActionError.d.ts +10 -0
- package/dist/data/diagnostics/ActionError.d.ts.map +1 -0
- package/dist/data/diagnostics/ActionError.js +26 -0
- package/dist/data/diagnostics/ActionError.js.map +1 -0
- package/dist/data/diagnostics/error-diagnostics.cjs +7 -0
- package/dist/data/diagnostics/error-diagnostics.cjs.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.d.ts.map +1 -1
- package/dist/data/diagnostics/error-diagnostics.js +7 -0
- package/dist/data/diagnostics/error-diagnostics.js.map +1 -1
- package/dist/data/markdown-urls.cjs +14 -0
- package/dist/data/markdown-urls.cjs.map +1 -0
- package/dist/data/markdown-urls.d.ts +9 -0
- package/dist/data/markdown-urls.d.ts.map +1 -0
- package/dist/data/markdown-urls.js +14 -0
- package/dist/data/markdown-urls.js.map +1 -0
- package/dist/data/runtime/RuntimeBar.model.cjs +1 -1
- package/dist/data/runtime/RuntimeBar.model.js +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +10 -0
- package/dist/data.d.ts +2 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +5 -1
- package/dist/file-findings/AnnotatedCode.cjs +44 -3
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +7 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +44 -3
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs +188 -82
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +87 -14
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js +189 -83
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/FolderFindings.cjs +144 -0
- package/dist/file-findings/FolderFindings.cjs.map +1 -0
- package/dist/file-findings/FolderFindings.d.ts +39 -0
- package/dist/file-findings/FolderFindings.d.ts.map +1 -0
- package/dist/file-findings/FolderFindings.js +144 -0
- package/dist/file-findings/FolderFindings.js.map +1 -0
- package/dist/file-findings/NodeActions.cjs +50 -0
- package/dist/file-findings/NodeActions.cjs.map +1 -0
- package/dist/file-findings/NodeActions.d.ts +15 -0
- package/dist/file-findings/NodeActions.d.ts.map +1 -0
- package/dist/file-findings/NodeActions.js +50 -0
- package/dist/file-findings/NodeActions.js.map +1 -0
- package/dist/file-findings/SeverityCounts.cjs +22 -0
- package/dist/file-findings/SeverityCounts.cjs.map +1 -0
- package/dist/file-findings/SeverityCounts.d.ts +6 -0
- package/dist/file-findings/SeverityCounts.d.ts.map +1 -0
- package/dist/file-findings/SeverityCounts.js +22 -0
- package/dist/file-findings/SeverityCounts.js.map +1 -0
- package/dist/file-findings/adapters.cjs +43 -16
- package/dist/file-findings/adapters.cjs.map +1 -1
- package/dist/file-findings/adapters.d.ts +8 -7
- package/dist/file-findings/adapters.d.ts.map +1 -1
- package/dist/file-findings/adapters.js +43 -16
- package/dist/file-findings/adapters.js.map +1 -1
- package/dist/file-findings/file-review/CommentDraft.cjs +10 -43
- package/dist/file-findings/file-review/CommentDraft.cjs.map +1 -1
- package/dist/file-findings/file-review/CommentDraft.d.ts +4 -2
- package/dist/file-findings/file-review/CommentDraft.d.ts.map +1 -1
- package/dist/file-findings/file-review/CommentDraft.js +11 -44
- package/dist/file-findings/file-review/CommentDraft.js.map +1 -1
- package/dist/file-findings/file-review/EditThreads.cjs +85 -0
- package/dist/file-findings/file-review/EditThreads.cjs.map +1 -0
- package/dist/file-findings/file-review/EditThreads.d.ts +40 -0
- package/dist/file-findings/file-review/EditThreads.d.ts.map +1 -0
- package/dist/file-findings/file-review/EditThreads.js +85 -0
- package/dist/file-findings/file-review/EditThreads.js.map +1 -0
- package/dist/file-findings/file-review/FileReview.cjs +559 -54
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +67 -9
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +562 -57
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/file-findings/file-review/FileThreads.cjs +96 -0
- package/dist/file-findings/file-review/FileThreads.cjs.map +1 -0
- package/dist/file-findings/file-review/FileThreads.d.ts +50 -0
- package/dist/file-findings/file-review/FileThreads.d.ts.map +1 -0
- package/dist/file-findings/file-review/FileThreads.js +94 -0
- package/dist/file-findings/file-review/FileThreads.js.map +1 -0
- package/dist/file-findings/file-review/InlineThread.cjs +2 -1
- package/dist/file-findings/file-review/InlineThread.cjs.map +1 -1
- package/dist/file-findings/file-review/InlineThread.d.ts +9 -2
- package/dist/file-findings/file-review/InlineThread.d.ts.map +1 -1
- package/dist/file-findings/file-review/InlineThread.js +2 -1
- package/dist/file-findings/file-review/InlineThread.js.map +1 -1
- package/dist/file-findings/file-review/ProblemsList.cjs +67 -56
- package/dist/file-findings/file-review/ProblemsList.cjs.map +1 -1
- package/dist/file-findings/file-review/ProblemsList.d.ts +7 -0
- package/dist/file-findings/file-review/ProblemsList.d.ts.map +1 -1
- package/dist/file-findings/file-review/ProblemsList.js +68 -58
- package/dist/file-findings/file-review/ProblemsList.js.map +1 -1
- package/dist/file-findings/file-review/SourceView.cjs +2 -1
- package/dist/file-findings/file-review/SourceView.cjs.map +1 -1
- package/dist/file-findings/file-review/SourceView.js +3 -2
- package/dist/file-findings/file-review/SourceView.js.map +1 -1
- package/dist/file-findings/file-review/geometry.cjs +36 -7
- package/dist/file-findings/file-review/geometry.cjs.map +1 -1
- package/dist/file-findings/file-review/geometry.d.ts +9 -3
- package/dist/file-findings/file-review/geometry.d.ts.map +1 -1
- package/dist/file-findings/file-review/geometry.js +36 -7
- package/dist/file-findings/file-review/geometry.js.map +1 -1
- package/dist/file-findings/file-review/hooks.cjs +36 -3
- package/dist/file-findings/file-review/hooks.cjs.map +1 -1
- package/dist/file-findings/file-review/hooks.d.ts +15 -1
- package/dist/file-findings/file-review/hooks.d.ts.map +1 -1
- package/dist/file-findings/file-review/hooks.js +37 -5
- package/dist/file-findings/file-review/hooks.js.map +1 -1
- package/dist/file-findings/file-review/patch-comments.cjs +65 -0
- package/dist/file-findings/file-review/patch-comments.cjs.map +1 -0
- package/dist/file-findings/file-review/patch-comments.d.ts +29 -0
- package/dist/file-findings/file-review/patch-comments.d.ts.map +1 -0
- package/dist/file-findings/file-review/patch-comments.js +60 -0
- package/dist/file-findings/file-review/patch-comments.js.map +1 -0
- package/dist/file-findings/file-review/post-actions.cjs +33 -0
- package/dist/file-findings/file-review/post-actions.cjs.map +1 -0
- package/dist/file-findings/file-review/post-actions.d.ts +20 -0
- package/dist/file-findings/file-review/post-actions.d.ts.map +1 -0
- package/dist/file-findings/file-review/post-actions.js +30 -0
- package/dist/file-findings/file-review/post-actions.js.map +1 -0
- package/dist/file-findings/file-review/problem-filters.cjs +6 -0
- package/dist/file-findings/file-review/problem-filters.cjs.map +1 -1
- package/dist/file-findings/file-review/problem-filters.d.ts +2 -0
- package/dist/file-findings/file-review/problem-filters.d.ts.map +1 -1
- package/dist/file-findings/file-review/problem-filters.js +6 -1
- package/dist/file-findings/file-review/problem-filters.js.map +1 -1
- package/dist/file-findings/file-review/selection-lines.cjs +47 -0
- package/dist/file-findings/file-review/selection-lines.cjs.map +1 -0
- package/dist/file-findings/file-review/selection-lines.d.ts +19 -0
- package/dist/file-findings/file-review/selection-lines.d.ts.map +1 -0
- package/dist/file-findings/file-review/selection-lines.js +46 -0
- package/dist/file-findings/file-review/selection-lines.js.map +1 -0
- package/dist/file-findings/file-review/views.cjs +16 -0
- package/dist/file-findings/file-review/views.cjs.map +1 -0
- package/dist/file-findings/file-review/views.d.ts +8 -0
- package/dist/file-findings/file-review/views.d.ts.map +1 -0
- package/dist/file-findings/file-review/views.js +14 -0
- package/dist/file-findings/file-review/views.js.map +1 -0
- package/dist/file-findings/file-urls.cjs +60 -0
- package/dist/file-findings/file-urls.cjs.map +1 -0
- package/dist/file-findings/file-urls.d.ts +20 -0
- package/dist/file-findings/file-urls.d.ts.map +1 -0
- package/dist/file-findings/file-urls.js +57 -0
- package/dist/file-findings/file-urls.js.map +1 -0
- package/dist/file-findings/types.cjs +5 -0
- package/dist/file-findings/types.cjs.map +1 -1
- package/dist/file-findings/types.d.ts +8 -2
- package/dist/file-findings/types.d.ts.map +1 -1
- package/dist/file-findings/types.js +5 -1
- package/dist/file-findings/types.js.map +1 -1
- package/dist/file-findings.cjs +24 -0
- package/dist/file-findings.d.ts +9 -4
- package/dist/file-findings.d.ts.map +1 -1
- package/dist/file-findings.js +8 -3
- package/dist/icons/components/UiChecks.cjs +51 -0
- package/dist/icons/components/UiChecks.cjs.map +1 -0
- package/dist/icons/components/UiChecks.d.ts +15 -0
- package/dist/icons/components/UiChecks.d.ts.map +1 -0
- package/dist/icons/components/UiChecks.js +48 -0
- package/dist/icons/components/UiChecks.js.map +1 -0
- package/dist/icons/components/UiPaperPlaneRight.cjs +51 -0
- package/dist/icons/components/UiPaperPlaneRight.cjs.map +1 -0
- package/dist/icons/components/UiPaperPlaneRight.d.ts +15 -0
- package/dist/icons/components/UiPaperPlaneRight.d.ts.map +1 -0
- package/dist/icons/components/UiPaperPlaneRight.js +48 -0
- package/dist/icons/components/UiPaperPlaneRight.js.map +1 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/registry.cjs +4 -0
- package/dist/icons/registry.cjs.map +1 -1
- package/dist/icons/registry.d.ts.map +1 -1
- package/dist/icons/registry.js +4 -0
- package/dist/icons/registry.js.map +1 -1
- package/dist/icons.cjs +6 -0
- package/dist/icons.js +3 -1
- package/dist/index.cjs +99 -6
- package/dist/index.js +31 -7
- package/dist/layout/ResizeHandle.cjs +58 -0
- package/dist/layout/ResizeHandle.cjs.map +1 -0
- package/dist/layout/ResizeHandle.d.ts +13 -0
- package/dist/layout/ResizeHandle.d.ts.map +1 -0
- package/dist/layout/ResizeHandle.js +58 -0
- package/dist/layout/ResizeHandle.js.map +1 -0
- package/dist/monaco/DocumentEditor.cjs +275 -0
- package/dist/monaco/DocumentEditor.cjs.map +1 -0
- package/dist/monaco/DocumentEditor.d.ts +60 -0
- package/dist/monaco/DocumentEditor.d.ts.map +1 -0
- package/dist/monaco/DocumentEditor.js +273 -0
- package/dist/monaco/DocumentEditor.js.map +1 -0
- package/dist/monaco/document-source.cjs +122 -0
- package/dist/monaco/document-source.cjs.map +1 -0
- package/dist/monaco/document-source.d.ts +19 -0
- package/dist/monaco/document-source.d.ts.map +1 -0
- package/dist/monaco/document-source.js +120 -0
- package/dist/monaco/document-source.js.map +1 -0
- package/dist/monaco/source-comments.cjs +34 -0
- package/dist/monaco/source-comments.cjs.map +1 -0
- package/dist/monaco/source-comments.d.ts +19 -0
- package/dist/monaco/source-comments.d.ts.map +1 -0
- package/dist/monaco/source-comments.js +34 -0
- package/dist/monaco/source-comments.js.map +1 -0
- package/dist/monaco.cjs +6 -0
- package/dist/monaco.d.ts +2 -0
- package/dist/monaco.d.ts.map +1 -1
- package/dist/monaco.js +3 -1
- package/dist/styles.css +1 -1
- package/package.json +14 -1
package/dist/comments.cjs
CHANGED
|
@@ -2,57 +2,132 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
2
2
|
const require_comment_types = require("./comments/comment-types.cjs");
|
|
3
3
|
const require_comment_utils = require("./comments/comment-utils.cjs");
|
|
4
4
|
const require_comment_stage = require("./lib/comment-stage.cjs");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const require_comment_context = require("./comments/comment-context.cjs");
|
|
6
|
+
const require_CommentProvider = require("./comments/CommentProvider.cjs");
|
|
7
|
+
const require_use_comment_rail_width = require("./comments/use-comment-rail-width.cjs");
|
|
8
|
+
const require_CommentRail = require("./comments/CommentRail.cjs");
|
|
9
|
+
const require_comment_vocabulary = require("./comments/comment-vocabulary.cjs");
|
|
10
|
+
const require_CommentEditor = require("./comments/CommentEditor.cjs");
|
|
11
|
+
const require_CommentComposer = require("./comments/CommentComposer.cjs");
|
|
12
|
+
const require_agent_delivery = require("./comments/agent-delivery.cjs");
|
|
7
13
|
const require_CommentAuthor = require("./comments/CommentAuthor.cjs");
|
|
8
|
-
const
|
|
14
|
+
const require_CommentMarkdown = require("./comments/CommentMarkdown.cjs");
|
|
15
|
+
const require_comment_assign = require("./comments/comment-assign.cjs");
|
|
9
16
|
const require_CommentCard = require("./comments/CommentCard.cjs");
|
|
10
|
-
const require_CommentComposer = require("./comments/CommentComposer.cjs");
|
|
11
17
|
const require_CommentThreadList = require("./comments/CommentThreadList.cjs");
|
|
12
18
|
const require_CommentThread = require("./comments/CommentThread.cjs");
|
|
13
|
-
const require_comment_context = require("./comments/comment-context.cjs");
|
|
14
|
-
const require_CommentProvider = require("./comments/CommentProvider.cjs");
|
|
15
19
|
const require_CommentSidePanel = require("./comments/CommentSidePanel.cjs");
|
|
20
|
+
const require_CommentDraftCard = require("./comments/CommentDraftCard.cjs");
|
|
21
|
+
const require_CommentDraftPopover = require("./comments/CommentDraftPopover.cjs");
|
|
22
|
+
const require_CapturePin = require("./comments/CapturePin.cjs");
|
|
23
|
+
const require_ElementOutline = require("./comments/ElementOutline.cjs");
|
|
24
|
+
const require_element_picker = require("./comments/element-picker.cjs");
|
|
25
|
+
const require_model = require("./comments/anchoring/model.cjs");
|
|
26
|
+
const require_markdown_anchor = require("./comments/anchoring/markdown-anchor.cjs");
|
|
27
|
+
const require_dom_anchor = require("./comments/anchoring/dom-anchor.cjs");
|
|
28
|
+
const require_annotation_screenshot = require("./comments/annotation-screenshot.cjs");
|
|
29
|
+
const require_AnnotationSurface = require("./comments/AnnotationSurface.cjs");
|
|
30
|
+
const require_patch_anchor = require("./comments/anchoring/patch-anchor.cjs");
|
|
31
|
+
const require_CommentAnchorBridge = require("./comments/anchoring/CommentAnchorBridge.cjs");
|
|
32
|
+
const require_VocabularyPreview = require("./comments/VocabularyPreview.cjs");
|
|
33
|
+
const require_vocabulary_capture = require("./comments/vocabulary-capture.cjs");
|
|
34
|
+
const require_MentionTextarea = require("./comments/MentionTextarea.cjs");
|
|
16
35
|
const require_GroupedComments = require("./comments/GroupedComments.cjs");
|
|
17
36
|
const require_CommentFilterBar = require("./comments/CommentFilterBar.cjs");
|
|
18
37
|
const require_CommentProgress = require("./comments/CommentProgress.cjs");
|
|
38
|
+
exports.AnnotationSurface = require_AnnotationSurface.AnnotationSurface;
|
|
39
|
+
exports.COMMENT_ELEMENT_HTML_LIMIT = require_model.COMMENT_ELEMENT_HTML_LIMIT;
|
|
40
|
+
exports.COMMENT_ELEMENT_HTML_TRUNCATION = require_model.COMMENT_ELEMENT_HTML_TRUNCATION;
|
|
41
|
+
exports.COMMENT_LOCATOR_SELECTOR_LIMIT = require_model.COMMENT_LOCATOR_SELECTOR_LIMIT;
|
|
42
|
+
exports.COMMENT_LOCATOR_TEXT_LIMIT = require_model.COMMENT_LOCATOR_TEXT_LIMIT;
|
|
43
|
+
exports.CapturePin = require_CapturePin.CapturePin;
|
|
44
|
+
exports.CommentAnchorBridge = require_CommentAnchorBridge.CommentAnchorBridge;
|
|
19
45
|
exports.CommentAuthorAvatar = require_CommentAuthor.CommentAuthorAvatar;
|
|
46
|
+
exports.CommentAuthorName = require_CommentAuthor.CommentAuthorName;
|
|
20
47
|
exports.CommentCard = require_CommentCard.CommentCard;
|
|
21
48
|
exports.CommentComposer = require_CommentComposer.CommentComposer;
|
|
49
|
+
exports.CommentDraftCard = require_CommentDraftCard.CommentDraftCard;
|
|
50
|
+
exports.CommentDraftPopover = require_CommentDraftPopover.CommentDraftPopover;
|
|
51
|
+
exports.CommentEditor = require_CommentEditor.CommentEditor;
|
|
22
52
|
exports.CommentFilterBar = require_CommentFilterBar.CommentFilterBar;
|
|
23
53
|
exports.CommentMarkdown = require_CommentMarkdown.CommentMarkdown;
|
|
24
54
|
exports.CommentProgress = require_CommentProgress.CommentProgress;
|
|
25
55
|
exports.CommentProvider = require_CommentProvider.CommentProvider;
|
|
56
|
+
exports.CommentRail = require_CommentRail.CommentRail;
|
|
26
57
|
exports.CommentSidePanel = require_CommentSidePanel.CommentSidePanel;
|
|
27
58
|
exports.CommentThread = require_CommentThread.CommentThread;
|
|
28
59
|
exports.CommentThreadList = require_CommentThreadList.CommentThreadList;
|
|
29
60
|
exports.DEFAULT_CHECKLIST_CYCLE = require_comment_types.DEFAULT_CHECKLIST_CYCLE;
|
|
30
61
|
exports.DEFAULT_COMMENT_STATUSES = require_comment_types.DEFAULT_COMMENT_STATUSES;
|
|
31
62
|
exports.DOCUMENT_ANCHOR = require_comment_types.DOCUMENT_ANCHOR;
|
|
63
|
+
exports.ELEMENT_PREFIX = require_dom_anchor.ELEMENT_PREFIX;
|
|
64
|
+
exports.ElementOutline = require_ElementOutline.ElementOutline;
|
|
32
65
|
exports.GroupedComments = require_GroupedComments.GroupedComments;
|
|
66
|
+
exports.MARKDOWN_ROOT = require_markdown_anchor.MARKDOWN_ROOT;
|
|
67
|
+
exports.MARKDOWN_SIMILARITY_THRESHOLD = require_markdown_anchor.MARKDOWN_SIMILARITY_THRESHOLD;
|
|
33
68
|
exports.MentionTextarea = require_MentionTextarea.MentionTextarea;
|
|
69
|
+
exports.PATCH_PREFIX = require_patch_anchor.PATCH_PREFIX;
|
|
70
|
+
exports.VOCABULARY_PREVIEW_ATTRIBUTE = require_comment_vocabulary.VOCABULARY_PREVIEW_ATTRIBUTE;
|
|
71
|
+
exports.VocabularyPreview = require_VocabularyPreview.VocabularyPreview;
|
|
72
|
+
exports.agentDeliveryStage = require_agent_delivery.agentDeliveryStage;
|
|
73
|
+
exports.agentGlyph = require_agent_delivery.agentGlyph;
|
|
34
74
|
exports.applyCommentFilters = require_comment_utils.applyCommentFilters;
|
|
35
75
|
exports.assignTargetItems = require_comment_assign.assignTargetItems;
|
|
36
76
|
exports.assignmentMenuItems = require_comment_assign.assignmentMenuItems;
|
|
37
77
|
exports.authorDisplayName = require_comment_utils.authorDisplayName;
|
|
78
|
+
exports.boxWithin = require_dom_anchor.boxWithin;
|
|
38
79
|
exports.buildReplyMap = require_comment_utils.buildReplyMap;
|
|
39
80
|
exports.buildThreadListHandlers = require_comment_utils.buildThreadListHandlers;
|
|
81
|
+
exports.captureLocators = require_dom_anchor.captureLocators;
|
|
82
|
+
exports.capturePatch = require_patch_anchor.capturePatch;
|
|
83
|
+
exports.captureScreenshot = require_annotation_screenshot.captureScreenshot;
|
|
84
|
+
exports.captureVocabularyPreviews = require_vocabulary_capture.captureVocabularyPreviews;
|
|
85
|
+
exports.commentAnchor = require_dom_anchor.commentAnchor;
|
|
40
86
|
exports.commentCountForPrefix = require_comment_utils.commentCountForPrefix;
|
|
87
|
+
exports.commentTarget = require_dom_anchor.commentTarget;
|
|
88
|
+
exports.cssPath = require_dom_anchor.cssPath;
|
|
41
89
|
exports.defaultStatusValue = require_comment_utils.defaultStatusValue;
|
|
42
90
|
exports.deriveAnchorCounts = require_comment_utils.deriveAnchorCounts;
|
|
43
91
|
exports.deriveAnchorMeta = require_comment_utils.deriveAnchorMeta;
|
|
92
|
+
exports.describeElement = require_dom_anchor.describeElement;
|
|
93
|
+
exports.describeMarkdown = require_markdown_anchor.describeMarkdown;
|
|
94
|
+
exports.describePatch = require_patch_anchor.describePatch;
|
|
44
95
|
exports.dottedAnchorResolver = require_comment_context.dottedAnchorResolver;
|
|
96
|
+
exports.elementAnchor = require_dom_anchor.elementAnchor;
|
|
97
|
+
exports.elementBoxWithin = require_dom_anchor.elementBoxWithin;
|
|
98
|
+
exports.elementLabel = require_element_picker.elementLabel;
|
|
45
99
|
exports.emptyCommentFilters = require_comment_utils.emptyCommentFilters;
|
|
46
100
|
exports.exactAnchorResolver = require_comment_context.exactAnchorResolver;
|
|
47
101
|
exports.getRoots = require_comment_utils.getRoots;
|
|
48
102
|
exports.groupByFacet = require_comment_utils.groupByFacet;
|
|
49
103
|
exports.hasActiveFilters = require_comment_utils.hasActiveFilters;
|
|
104
|
+
exports.isElementAnchor = require_dom_anchor.isElementAnchor;
|
|
105
|
+
exports.isGeneratedId = require_dom_anchor.isGeneratedId;
|
|
106
|
+
exports.isPatchAnchor = require_patch_anchor.isPatchAnchor;
|
|
50
107
|
exports.isUnresolved = require_comment_utils.isUnresolved;
|
|
108
|
+
exports.legacyLocators = require_dom_anchor.legacyLocators;
|
|
109
|
+
exports.markdownAnchor = require_markdown_anchor.markdownAnchor;
|
|
110
|
+
exports.markdownLocator = require_markdown_anchor.markdownLocator;
|
|
111
|
+
exports.markdownTarget = require_markdown_anchor.markdownTarget;
|
|
51
112
|
exports.matchMentionsInBody = require_comment_utils.matchMentionsInBody;
|
|
113
|
+
exports.matchPatch = require_patch_anchor.matchPatch;
|
|
114
|
+
exports.nearestHeading = require_dom_anchor.nearestHeading;
|
|
52
115
|
exports.nextChecklistStatus = require_comment_utils.nextChecklistStatus;
|
|
116
|
+
exports.overlayLabel = require_dom_anchor.overlayLabel;
|
|
117
|
+
exports.parseElementAnchor = require_dom_anchor.parseElementAnchor;
|
|
118
|
+
exports.parseMarkdownAnchor = require_markdown_anchor.parseMarkdownAnchor;
|
|
119
|
+
exports.parsePatchAnchor = require_patch_anchor.parsePatchAnchor;
|
|
120
|
+
exports.patchAnchor = require_patch_anchor.patchAnchor;
|
|
121
|
+
exports.releaseScreenshotCapture = require_annotation_screenshot.releaseScreenshotCapture;
|
|
122
|
+
exports.resolveAnchor = require_dom_anchor.resolveAnchor;
|
|
123
|
+
exports.resolveComment = require_dom_anchor.resolveComment;
|
|
53
124
|
exports.resolveCommentStage = require_comment_stage.resolveCommentStage;
|
|
125
|
+
exports.resolveElementAnchor = require_dom_anchor.resolveElementAnchor;
|
|
54
126
|
exports.resolveFacetOption = require_comment_utils.resolveFacetOption;
|
|
127
|
+
exports.resolveLocator = require_dom_anchor.resolveLocator;
|
|
128
|
+
exports.resolveMarkdown = require_markdown_anchor.resolveMarkdown;
|
|
55
129
|
exports.resolveStatusConfig = require_comment_utils.resolveStatusConfig;
|
|
130
|
+
exports.screenshotCaptureSupported = require_annotation_screenshot.screenshotCaptureSupported;
|
|
56
131
|
exports.selectAnchorThreads = require_comment_utils.selectAnchorThreads;
|
|
57
132
|
exports.selectCommentThreadsByStage = require_comment_stage.selectCommentThreadsByStage;
|
|
58
133
|
exports.selectUnresolvedThreads = require_comment_utils.selectUnresolvedThreads;
|
|
@@ -65,3 +140,9 @@ exports.useCommentAnchorActionsOptional = require_comment_context.useCommentAnch
|
|
|
65
140
|
exports.useCommentAnchorOptional = require_comment_context.useCommentAnchorOptional;
|
|
66
141
|
exports.useCommentContext = require_comment_context.useCommentContext;
|
|
67
142
|
exports.useCommentContextOptional = require_comment_context.useCommentContextOptional;
|
|
143
|
+
exports.useCommentRailWidth = require_use_comment_rail_width.useCommentRailWidth;
|
|
144
|
+
exports.useElementPicker = require_element_picker.useElementPicker;
|
|
145
|
+
exports.vocabularyAnchor = require_comment_vocabulary.vocabularyAnchor;
|
|
146
|
+
exports.vocabularyChoices = require_comment_vocabulary.vocabularyChoices;
|
|
147
|
+
exports.vocabularyHref = require_comment_vocabulary.vocabularyHref;
|
|
148
|
+
exports.vocabularyReferences = require_comment_vocabulary.vocabularyReferences;
|
package/dist/comments.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
export * from './comments/comment-types.js';
|
|
2
|
+
export { AnnotationSurface, type AnnotationSurfaceProps } from './comments/AnnotationSurface.js';
|
|
3
|
+
export type { AnnotationCapture, PatchAnchor, CommentScreenshotCapture, CommentScreenshotUnavailableReason, } from './comments/annotation-types.js';
|
|
4
|
+
export { captureScreenshot, releaseScreenshotCapture, screenshotCaptureSupported, type HostViewportRect, type ScreenshotTarget, } from './comments/annotation-screenshot.js';
|
|
5
|
+
export { ElementOutline } from './comments/ElementOutline.js';
|
|
6
|
+
export { elementLabel, useElementPicker, type ElementPicker, type ElementPickerOptions, } from './comments/element-picker.js';
|
|
7
|
+
export { CapturePin, type CapturePinProps } from './comments/CapturePin.js';
|
|
8
|
+
export * from './comments/anchoring/index.js';
|
|
9
|
+
export type { CommentDetailOptions, CommentDetailTab } from './comments/comment-detail.js';
|
|
10
|
+
export { CommentRail, type CommentRailProps } from './comments/CommentRail.js';
|
|
11
|
+
export { useCommentRailWidth } from './comments/use-comment-rail-width.js';
|
|
12
|
+
export { CommentDraftPopover, type CommentDraftPopoverProps } from './comments/CommentDraftPopover.js';
|
|
13
|
+
export { CommentDraftCard, type CommentDraftCardProps } from './comments/CommentDraftCard.js';
|
|
14
|
+
export * from './comments/comment-vocabulary.js';
|
|
15
|
+
export { VocabularyPreview } from './comments/VocabularyPreview.js';
|
|
16
|
+
export { captureVocabularyPreviews, type VocabularyPreviewImage } from './comments/vocabulary-capture.js';
|
|
17
|
+
export { CommentEditor } from './comments/CommentEditor.js';
|
|
2
18
|
export * from './comments/comment-utils.js';
|
|
19
|
+
export * from './comments/agent-delivery.js';
|
|
3
20
|
export { assignTargetItems, assignmentMenuItems, type CommentActionRunner, type CommentAssignmentOptions, } from './comments/comment-assign.js';
|
|
4
21
|
export { resolveCommentStage, selectCommentThreadsByStage, statusForCommentStage, } from './lib/comment-stage.js';
|
|
5
22
|
export { CommentMarkdown, type CommentMarkdownProps, } from './comments/CommentMarkdown.js';
|
|
6
|
-
export { CommentAuthorAvatar, type CommentAuthorAvatarProps, } from './comments/CommentAuthor.js';
|
|
23
|
+
export { CommentAuthorAvatar, CommentAuthorName, type CommentAuthorAvatarProps, } from './comments/CommentAuthor.js';
|
|
7
24
|
export { MentionTextarea, type MentionTextareaProps, } from './comments/MentionTextarea.js';
|
|
8
25
|
export { CommentCard, type CommentCardProps } from './comments/CommentCard.js';
|
|
9
26
|
export { CommentComposer, type CommentComposerProps, } from './comments/CommentComposer.js';
|
package/dist/comments.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../src/comments.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OA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eAAe,EACf,KAAK,oBAAoB,GAC1B,MAAM,4BAA4B,CAAC"}
|
package/dist/comments.js
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import { DEFAULT_CHECKLIST_CYCLE, DEFAULT_COMMENT_STATUSES, DOCUMENT_ANCHOR } from "./comments/comment-types.js";
|
|
2
2
|
import { applyCommentFilters, authorDisplayName, buildReplyMap, buildThreadListHandlers, commentCountForPrefix, defaultStatusValue, deriveAnchorCounts, deriveAnchorMeta, emptyCommentFilters, getRoots, groupByFacet, hasActiveFilters, isUnresolved, matchMentionsInBody, nextChecklistStatus, resolveFacetOption, resolveStatusConfig, selectAnchorThreads, selectUnresolvedThreads, sortReplies, toneToBadgeTone, truncatePlain } from "./comments/comment-utils.js";
|
|
3
3
|
import { resolveCommentStage, selectCommentThreadsByStage, statusForCommentStage } from "./lib/comment-stage.js";
|
|
4
|
-
import {
|
|
4
|
+
import { dottedAnchorResolver, exactAnchorResolver, strictAnchorResolver, useCommentAnchorActionsOptional, useCommentAnchorOptional, useCommentContext, useCommentContextOptional } from "./comments/comment-context.js";
|
|
5
|
+
import { CommentProvider } from "./comments/CommentProvider.js";
|
|
6
|
+
import { useCommentRailWidth } from "./comments/use-comment-rail-width.js";
|
|
7
|
+
import { CommentRail } from "./comments/CommentRail.js";
|
|
8
|
+
import { VOCABULARY_PREVIEW_ATTRIBUTE, vocabularyAnchor, vocabularyChoices, vocabularyHref, vocabularyReferences } from "./comments/comment-vocabulary.js";
|
|
9
|
+
import { CommentEditor } from "./comments/CommentEditor.js";
|
|
10
|
+
import { CommentComposer } from "./comments/CommentComposer.js";
|
|
11
|
+
import { agentDeliveryStage, agentGlyph } from "./comments/agent-delivery.js";
|
|
12
|
+
import { CommentAuthorAvatar, CommentAuthorName } from "./comments/CommentAuthor.js";
|
|
5
13
|
import { CommentMarkdown } from "./comments/CommentMarkdown.js";
|
|
6
|
-
import {
|
|
7
|
-
import { MentionTextarea } from "./comments/MentionTextarea.js";
|
|
14
|
+
import { assignTargetItems, assignmentMenuItems } from "./comments/comment-assign.js";
|
|
8
15
|
import { CommentCard } from "./comments/CommentCard.js";
|
|
9
|
-
import { CommentComposer } from "./comments/CommentComposer.js";
|
|
10
16
|
import { CommentThreadList } from "./comments/CommentThreadList.js";
|
|
11
17
|
import { CommentThread } from "./comments/CommentThread.js";
|
|
12
|
-
import { dottedAnchorResolver, exactAnchorResolver, strictAnchorResolver, useCommentAnchorActionsOptional, useCommentAnchorOptional, useCommentContext, useCommentContextOptional } from "./comments/comment-context.js";
|
|
13
|
-
import { CommentProvider } from "./comments/CommentProvider.js";
|
|
14
18
|
import { CommentSidePanel } from "./comments/CommentSidePanel.js";
|
|
19
|
+
import { CommentDraftCard } from "./comments/CommentDraftCard.js";
|
|
20
|
+
import { CommentDraftPopover } from "./comments/CommentDraftPopover.js";
|
|
21
|
+
import { CapturePin } from "./comments/CapturePin.js";
|
|
22
|
+
import { ElementOutline } from "./comments/ElementOutline.js";
|
|
23
|
+
import { elementLabel, useElementPicker } from "./comments/element-picker.js";
|
|
24
|
+
import { COMMENT_ELEMENT_HTML_LIMIT, COMMENT_ELEMENT_HTML_TRUNCATION, COMMENT_LOCATOR_SELECTOR_LIMIT, COMMENT_LOCATOR_TEXT_LIMIT } from "./comments/anchoring/model.js";
|
|
25
|
+
import { MARKDOWN_ROOT, MARKDOWN_SIMILARITY_THRESHOLD, describeMarkdown, markdownAnchor, markdownLocator, markdownTarget, parseMarkdownAnchor, resolveMarkdown } from "./comments/anchoring/markdown-anchor.js";
|
|
26
|
+
import { ELEMENT_PREFIX, boxWithin, captureLocators, commentAnchor, commentTarget, cssPath, describeElement, elementAnchor, elementBoxWithin, isElementAnchor, isGeneratedId, legacyLocators, nearestHeading, overlayLabel, parseElementAnchor, resolveAnchor, resolveComment, resolveElementAnchor, resolveLocator } from "./comments/anchoring/dom-anchor.js";
|
|
27
|
+
import { captureScreenshot, releaseScreenshotCapture, screenshotCaptureSupported } from "./comments/annotation-screenshot.js";
|
|
28
|
+
import { AnnotationSurface } from "./comments/AnnotationSurface.js";
|
|
29
|
+
import { PATCH_PREFIX, capturePatch, describePatch, isPatchAnchor, matchPatch, parsePatchAnchor, patchAnchor } from "./comments/anchoring/patch-anchor.js";
|
|
30
|
+
import { CommentAnchorBridge } from "./comments/anchoring/CommentAnchorBridge.js";
|
|
31
|
+
import { VocabularyPreview } from "./comments/VocabularyPreview.js";
|
|
32
|
+
import { captureVocabularyPreviews } from "./comments/vocabulary-capture.js";
|
|
33
|
+
import { MentionTextarea } from "./comments/MentionTextarea.js";
|
|
15
34
|
import { GroupedComments } from "./comments/GroupedComments.js";
|
|
16
35
|
import { CommentFilterBar } from "./comments/CommentFilterBar.js";
|
|
17
36
|
import { CommentProgress } from "./comments/CommentProgress.js";
|
|
18
|
-
export { CommentAuthorAvatar, CommentCard, CommentComposer, CommentFilterBar, CommentMarkdown, CommentProgress, CommentProvider, CommentSidePanel, CommentThread, CommentThreadList, DEFAULT_CHECKLIST_CYCLE, DEFAULT_COMMENT_STATUSES, DOCUMENT_ANCHOR, GroupedComments, MentionTextarea, applyCommentFilters, assignTargetItems, assignmentMenuItems, authorDisplayName, buildReplyMap, buildThreadListHandlers, commentCountForPrefix, defaultStatusValue, deriveAnchorCounts, deriveAnchorMeta, dottedAnchorResolver, emptyCommentFilters, exactAnchorResolver, getRoots, groupByFacet, hasActiveFilters, isUnresolved, matchMentionsInBody, nextChecklistStatus, resolveCommentStage, resolveFacetOption, resolveStatusConfig, selectAnchorThreads, selectCommentThreadsByStage, selectUnresolvedThreads, sortReplies, statusForCommentStage, strictAnchorResolver, toneToBadgeTone, truncatePlain, useCommentAnchorActionsOptional, useCommentAnchorOptional, useCommentContext, useCommentContextOptional };
|
|
37
|
+
export { AnnotationSurface, COMMENT_ELEMENT_HTML_LIMIT, COMMENT_ELEMENT_HTML_TRUNCATION, COMMENT_LOCATOR_SELECTOR_LIMIT, COMMENT_LOCATOR_TEXT_LIMIT, CapturePin, CommentAnchorBridge, CommentAuthorAvatar, CommentAuthorName, CommentCard, CommentComposer, CommentDraftCard, CommentDraftPopover, CommentEditor, CommentFilterBar, CommentMarkdown, CommentProgress, CommentProvider, CommentRail, CommentSidePanel, CommentThread, CommentThreadList, DEFAULT_CHECKLIST_CYCLE, DEFAULT_COMMENT_STATUSES, DOCUMENT_ANCHOR, ELEMENT_PREFIX, ElementOutline, GroupedComments, MARKDOWN_ROOT, MARKDOWN_SIMILARITY_THRESHOLD, MentionTextarea, PATCH_PREFIX, VOCABULARY_PREVIEW_ATTRIBUTE, VocabularyPreview, agentDeliveryStage, agentGlyph, applyCommentFilters, assignTargetItems, assignmentMenuItems, authorDisplayName, boxWithin, buildReplyMap, buildThreadListHandlers, captureLocators, capturePatch, captureScreenshot, captureVocabularyPreviews, commentAnchor, commentCountForPrefix, commentTarget, cssPath, defaultStatusValue, deriveAnchorCounts, deriveAnchorMeta, describeElement, describeMarkdown, describePatch, dottedAnchorResolver, elementAnchor, elementBoxWithin, elementLabel, emptyCommentFilters, exactAnchorResolver, getRoots, groupByFacet, hasActiveFilters, isElementAnchor, isGeneratedId, isPatchAnchor, isUnresolved, legacyLocators, markdownAnchor, markdownLocator, markdownTarget, matchMentionsInBody, matchPatch, nearestHeading, nextChecklistStatus, overlayLabel, parseElementAnchor, parseMarkdownAnchor, parsePatchAnchor, patchAnchor, releaseScreenshotCapture, resolveAnchor, resolveComment, resolveCommentStage, resolveElementAnchor, resolveFacetOption, resolveLocator, resolveMarkdown, resolveStatusConfig, screenshotCaptureSupported, selectAnchorThreads, selectCommentThreadsByStage, selectUnresolvedThreads, sortReplies, statusForCommentStage, strictAnchorResolver, toneToBadgeTone, truncatePlain, useCommentAnchorActionsOptional, useCommentAnchorOptional, useCommentContext, useCommentContextOptional, useCommentRailWidth, useElementPicker, vocabularyAnchor, vocabularyChoices, vocabularyHref, vocabularyReferences };
|
|
@@ -20,7 +20,7 @@ export type DateFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
20
20
|
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
21
21
|
prefix?: ReactNode;
|
|
22
22
|
};
|
|
23
|
-
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "
|
|
23
|
+
export declare const DateField: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & {
|
|
24
24
|
/** Selects native date input or date-time input behavior. */
|
|
25
25
|
mode?: DateFieldMode;
|
|
26
26
|
/** ISO date or datetime-local string shown in the input. */
|
|
@@ -11,7 +11,7 @@ export type DatePickerProps = Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
11
11
|
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
12
12
|
prefix?: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "
|
|
14
|
+
export declare const DatePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & {
|
|
15
15
|
value?: string;
|
|
16
16
|
onChange?: (value: string) => void;
|
|
17
17
|
className?: string;
|
|
@@ -11,7 +11,7 @@ export type DateTimePickerProps = Omit<InputHTMLAttributes<HTMLInputElement>, "t
|
|
|
11
11
|
/** Leading in-field adornment, rendered at the left edge of the input. */
|
|
12
12
|
prefix?: ReactNode;
|
|
13
13
|
};
|
|
14
|
-
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "
|
|
14
|
+
export declare const DateTimePicker: import('react').ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "prefix" | "type" | "value" | "onChange"> & {
|
|
15
15
|
value?: string;
|
|
16
16
|
onChange?: (value: string) => void;
|
|
17
17
|
className?: string;
|
|
@@ -16,7 +16,7 @@ function SplitButton({ label, onClick, items, icon, variant = "default", size =
|
|
|
16
16
|
disabled: disabled || primaryDisabled,
|
|
17
17
|
onClick,
|
|
18
18
|
className,
|
|
19
|
-
children: [icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
19
|
+
children: [!loading && icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
20
20
|
});
|
|
21
21
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
22
22
|
className: require_utils.cn("inline-flex items-stretch", className),
|
|
@@ -27,7 +27,7 @@ function SplitButton({ label, onClick, items, icon, variant = "default", size =
|
|
|
27
27
|
disabled: disabled || primaryDisabled,
|
|
28
28
|
onClick,
|
|
29
29
|
className: "rounded-r-none",
|
|
30
|
-
children: [icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
30
|
+
children: [!loading && icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Icon.Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
31
31
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DropdownMenu.DropdownMenu, {
|
|
32
32
|
items,
|
|
33
33
|
align,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.cjs","names":["useState","Button","Icon","cn","DropdownMenu","UiChevronUp","UiChevronDown"],"sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { Icon, type StaticIconComponent } from \"../data/Icon\";\nimport { UiChevronDown, UiChevronUp } from \"../icons\";\nimport { DropdownMenu, type DropdownMenuItem } from \"../overlay/DropdownMenu\";\n\nexport type SplitButtonProps = {\n /** Content of the primary action button. */\n label: ReactNode;\n /** Primary action handler. */\n onClick: () => void;\n /** Secondary actions listed in the dropdown menu. */\n items: DropdownMenuItem[];\n /** Icon shown before the primary label. */\n icon?: string | StaticIconComponent;\n /** Variant forwarded to both halves. */\n variant?: ButtonProps[\"variant\"];\n /** Size forwarded to both halves. */\n size?: ButtonProps[\"size\"];\n /** Show a spinner and disable the primary half while pending. */\n loading?: boolean;\n /** Disable both halves. */\n disabled?: boolean;\n /**\n * Disable only the primary action, leaving the menu reachable — for when the\n * default action does not apply but the secondary ones still do.\n */\n primaryDisabled?: boolean;\n /** Horizontal alignment of the menu relative to the trigger. */\n align?: \"left\" | \"right\";\n /** Browser tooltip / accessible label for the chevron trigger. */\n title?: string;\n /** Classes applied to the wrapper. */\n className?: string;\n /** Classes applied to the floating menu. */\n menuClassName?: string;\n};\n\nexport function SplitButton({\n label,\n onClick,\n items,\n icon,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled = false,\n primaryDisabled = false,\n align = \"right\",\n title,\n className,\n menuClassName,\n}: SplitButtonProps) {\n const [open, setOpen] = useState(false);\n\n if (items.length === 0) {\n return (\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className={className}\n >\n {icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n );\n }\n\n return (\n <div className={cn(\"inline-flex items-stretch\", className)}>\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className=\"rounded-r-none\"\n >\n {icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n <DropdownMenu\n items={items}\n align={align}\n className=\"items-stretch\"\n {...(menuClassName ? { menuClassName } : {})}\n onOpenChange={setOpen}\n trigger={\n <Button\n variant={variant}\n size={size === \"default\" ? \"icon\" : size}\n disabled={disabled}\n title={title}\n aria-label={title ?? \"Open menu\"}\n className={cn(\n \"h-auto self-stretch rounded-l-none border-l border-l-current/25 px-2\",\n size !== \"icon\" && \"w-8\",\n )}\n >\n <Icon icon={open ? UiChevronUp : UiChevronDown} />\n </Button>\n }\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgB,YAAY,EAC1B,OACA,SACA,OACA,MACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,WAAW,OACX,kBAAkB,OAClB,QAAQ,SACR,OACA,WACA,iBACmB;CACnB,MAAM,CAAC,MAAM,YAAA,GAAWA,MAAAA,SAAAA,CAAS,KAAK;CAEtC,IAAI,MAAM,WAAW,GACnB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAACC,eAAAA,QAAD;EACW;EACH;EACG;EACT,UAAU,YAAY;EACb;EACE;EANb,UAAA,CAQG,QAAQ,iBAAA,GAAA,kBAAA,IAAA,CAACC,aAAAA,MAAD,EAAM,GAAK,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAK,CAAA,
|
|
1
|
+
{"version":3,"file":"SplitButton.cjs","names":["useState","Button","Icon","cn","DropdownMenu","UiChevronUp","UiChevronDown"],"sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { Icon, type StaticIconComponent } from \"../data/Icon\";\nimport { UiChevronDown, UiChevronUp } from \"../icons\";\nimport { DropdownMenu, type DropdownMenuItem } from \"../overlay/DropdownMenu\";\n\nexport type SplitButtonProps = {\n /** Content of the primary action button. */\n label: ReactNode;\n /** Primary action handler. */\n onClick: () => void;\n /** Secondary actions listed in the dropdown menu. */\n items: DropdownMenuItem[];\n /** Icon shown before the primary label. */\n icon?: string | StaticIconComponent;\n /** Variant forwarded to both halves. */\n variant?: ButtonProps[\"variant\"];\n /** Size forwarded to both halves. */\n size?: ButtonProps[\"size\"];\n /** Show a spinner and disable the primary half while pending. */\n loading?: boolean;\n /** Disable both halves. */\n disabled?: boolean;\n /**\n * Disable only the primary action, leaving the menu reachable — for when the\n * default action does not apply but the secondary ones still do.\n */\n primaryDisabled?: boolean;\n /** Horizontal alignment of the menu relative to the trigger. */\n align?: \"left\" | \"right\";\n /** Browser tooltip / accessible label for the chevron trigger. */\n title?: string;\n /** Classes applied to the wrapper. */\n className?: string;\n /** Classes applied to the floating menu. */\n menuClassName?: string;\n};\n\nexport function SplitButton({\n label,\n onClick,\n items,\n icon,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled = false,\n primaryDisabled = false,\n align = \"right\",\n title,\n className,\n menuClassName,\n}: SplitButtonProps) {\n const [open, setOpen] = useState(false);\n\n if (items.length === 0) {\n return (\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className={className}\n >\n {!loading && icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n );\n }\n\n return (\n <div className={cn(\"inline-flex items-stretch\", className)}>\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className=\"rounded-r-none\"\n >\n {!loading && icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n <DropdownMenu\n items={items}\n align={align}\n className=\"items-stretch\"\n {...(menuClassName ? { menuClassName } : {})}\n onOpenChange={setOpen}\n trigger={\n <Button\n variant={variant}\n size={size === \"default\" ? \"icon\" : size}\n disabled={disabled}\n title={title}\n aria-label={title ?? \"Open menu\"}\n className={cn(\n \"h-auto self-stretch rounded-l-none border-l border-l-current/25 px-2\",\n size !== \"icon\" && \"w-8\",\n )}\n >\n <Icon icon={open ? UiChevronUp : UiChevronDown} />\n </Button>\n }\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgB,YAAY,EAC1B,OACA,SACA,OACA,MACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,WAAW,OACX,kBAAkB,OAClB,QAAQ,SACR,OACA,WACA,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({ label, onClick, items, icon, variant = "default", size =
|
|
|
16
16
|
disabled: disabled || primaryDisabled,
|
|
17
17
|
onClick,
|
|
18
18
|
className,
|
|
19
|
-
children: [icon && /* @__PURE__ */ jsx(Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
19
|
+
children: [!loading && icon && /* @__PURE__ */ jsx(Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
20
20
|
});
|
|
21
21
|
return /* @__PURE__ */ jsxs("div", {
|
|
22
22
|
className: cn("inline-flex items-stretch", className),
|
|
@@ -27,7 +27,7 @@ function SplitButton({ label, onClick, items, icon, variant = "default", size =
|
|
|
27
27
|
disabled: disabled || primaryDisabled,
|
|
28
28
|
onClick,
|
|
29
29
|
className: "rounded-r-none",
|
|
30
|
-
children: [icon && /* @__PURE__ */ jsx(Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
30
|
+
children: [!loading && icon && /* @__PURE__ */ jsx(Icon, { ...typeof icon === "string" ? { name: icon } : { icon } }), label]
|
|
31
31
|
}), /* @__PURE__ */ jsx(DropdownMenu, {
|
|
32
32
|
items,
|
|
33
33
|
align,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SplitButton.js","names":[],"sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { Icon, type StaticIconComponent } from \"../data/Icon\";\nimport { UiChevronDown, UiChevronUp } from \"../icons\";\nimport { DropdownMenu, type DropdownMenuItem } from \"../overlay/DropdownMenu\";\n\nexport type SplitButtonProps = {\n /** Content of the primary action button. */\n label: ReactNode;\n /** Primary action handler. */\n onClick: () => void;\n /** Secondary actions listed in the dropdown menu. */\n items: DropdownMenuItem[];\n /** Icon shown before the primary label. */\n icon?: string | StaticIconComponent;\n /** Variant forwarded to both halves. */\n variant?: ButtonProps[\"variant\"];\n /** Size forwarded to both halves. */\n size?: ButtonProps[\"size\"];\n /** Show a spinner and disable the primary half while pending. */\n loading?: boolean;\n /** Disable both halves. */\n disabled?: boolean;\n /**\n * Disable only the primary action, leaving the menu reachable — for when the\n * default action does not apply but the secondary ones still do.\n */\n primaryDisabled?: boolean;\n /** Horizontal alignment of the menu relative to the trigger. */\n align?: \"left\" | \"right\";\n /** Browser tooltip / accessible label for the chevron trigger. */\n title?: string;\n /** Classes applied to the wrapper. */\n className?: string;\n /** Classes applied to the floating menu. */\n menuClassName?: string;\n};\n\nexport function SplitButton({\n label,\n onClick,\n items,\n icon,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled = false,\n primaryDisabled = false,\n align = \"right\",\n title,\n className,\n menuClassName,\n}: SplitButtonProps) {\n const [open, setOpen] = useState(false);\n\n if (items.length === 0) {\n return (\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className={className}\n >\n {icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n );\n }\n\n return (\n <div className={cn(\"inline-flex items-stretch\", className)}>\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className=\"rounded-r-none\"\n >\n {icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n <DropdownMenu\n items={items}\n align={align}\n className=\"items-stretch\"\n {...(menuClassName ? { menuClassName } : {})}\n onOpenChange={setOpen}\n trigger={\n <Button\n variant={variant}\n size={size === \"default\" ? \"icon\" : size}\n disabled={disabled}\n title={title}\n aria-label={title ?? \"Open menu\"}\n className={cn(\n \"h-auto self-stretch rounded-l-none border-l border-l-current/25 px-2\",\n size !== \"icon\" && \"w-8\",\n )}\n >\n <Icon icon={open ? UiChevronUp : UiChevronDown} />\n </Button>\n }\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgB,YAAY,EAC1B,OACA,SACA,OACA,MACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,WAAW,OACX,kBAAkB,OAClB,QAAQ,SACR,OACA,WACA,iBACmB;CACnB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAEtC,IAAI,MAAM,WAAW,GACnB,OACE,qBAAC,QAAD;EACW;EACH;EACG;EACT,UAAU,YAAY;EACb;EACE;EANb,UAAA,CAQG,QAAQ,oBAAC,MAAD,EAAM,GAAK,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAK,CAAA,
|
|
1
|
+
{"version":3,"file":"SplitButton.js","names":[],"sources":["../../src/components/SplitButton.tsx"],"sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { cn } from \"../lib/utils\";\nimport { Button, type ButtonProps } from \"./button\";\nimport { Icon, type StaticIconComponent } from \"../data/Icon\";\nimport { UiChevronDown, UiChevronUp } from \"../icons\";\nimport { DropdownMenu, type DropdownMenuItem } from \"../overlay/DropdownMenu\";\n\nexport type SplitButtonProps = {\n /** Content of the primary action button. */\n label: ReactNode;\n /** Primary action handler. */\n onClick: () => void;\n /** Secondary actions listed in the dropdown menu. */\n items: DropdownMenuItem[];\n /** Icon shown before the primary label. */\n icon?: string | StaticIconComponent;\n /** Variant forwarded to both halves. */\n variant?: ButtonProps[\"variant\"];\n /** Size forwarded to both halves. */\n size?: ButtonProps[\"size\"];\n /** Show a spinner and disable the primary half while pending. */\n loading?: boolean;\n /** Disable both halves. */\n disabled?: boolean;\n /**\n * Disable only the primary action, leaving the menu reachable — for when the\n * default action does not apply but the secondary ones still do.\n */\n primaryDisabled?: boolean;\n /** Horizontal alignment of the menu relative to the trigger. */\n align?: \"left\" | \"right\";\n /** Browser tooltip / accessible label for the chevron trigger. */\n title?: string;\n /** Classes applied to the wrapper. */\n className?: string;\n /** Classes applied to the floating menu. */\n menuClassName?: string;\n};\n\nexport function SplitButton({\n label,\n onClick,\n items,\n icon,\n variant = \"default\",\n size = \"default\",\n loading = false,\n disabled = false,\n primaryDisabled = false,\n align = \"right\",\n title,\n className,\n menuClassName,\n}: SplitButtonProps) {\n const [open, setOpen] = useState(false);\n\n if (items.length === 0) {\n return (\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className={className}\n >\n {!loading && icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n );\n }\n\n return (\n <div className={cn(\"inline-flex items-stretch\", className)}>\n <Button\n variant={variant}\n size={size}\n loading={loading}\n disabled={disabled || primaryDisabled}\n onClick={onClick}\n className=\"rounded-r-none\"\n >\n {!loading && icon && <Icon {...(typeof icon === \"string\" ? { name: icon } : { icon })} />}\n {label}\n </Button>\n <DropdownMenu\n items={items}\n align={align}\n className=\"items-stretch\"\n {...(menuClassName ? { menuClassName } : {})}\n onOpenChange={setOpen}\n trigger={\n <Button\n variant={variant}\n size={size === \"default\" ? \"icon\" : size}\n disabled={disabled}\n title={title}\n aria-label={title ?? \"Open menu\"}\n className={cn(\n \"h-auto self-stretch rounded-l-none border-l border-l-current/25 px-2\",\n size !== \"icon\" && \"w-8\",\n )}\n >\n <Icon icon={open ? UiChevronUp : UiChevronDown} />\n </Button>\n }\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuCA,SAAgB,YAAY,EAC1B,OACA,SACA,OACA,MACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,WAAW,OACX,kBAAkB,OAClB,QAAQ,SACR,OACA,WACA,iBACmB;CACnB,MAAM,CAAC,MAAM,WAAW,SAAS,KAAK;CAEtC,IAAI,MAAM,WAAW,GACnB,OACE,qBAAC,QAAD;EACW;EACH;EACG;EACT,UAAU,YAAY;EACb;EACE;EANb,UAAA,CAQG,CAAC,WAAW,QAAQ,oBAAC,MAAD,EAAM,GAAK,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAK,CAAA,GACvF,KACK;;CAIZ,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,6BAA6B,SAAS;EAAzD,UAAA,CACE,qBAAC,QAAD;GACW;GACH;GACG;GACT,UAAU,YAAY;GACb;GACT,WAAU;GANZ,UAAA,CAQG,CAAC,WAAW,QAAQ,oBAAC,MAAD,EAAM,GAAK,OAAO,SAAS,WAAW,EAAE,MAAM,KAAK,IAAI,EAAE,KAAK,EAAK,CAAA,GACvF,KACK;EACR,CAAA,GAAA,oBAAC,cAAD;GACS;GACA;GACP,WAAU;GACV,GAAK,gBAAgB,EAAE,cAAc,IAAI,CAAC;GAC1C,cAAc;GACd,SACE,oBAAC,QAAD;IACW;IACT,MAAM,SAAS,YAAY,SAAS;IAC1B;IACH;IACP,cAAY,SAAS;IACrB,WAAW,GACT,wEACA,SAAS,UAAU,KACrB;IAEA,UAAA,oBAAC,MAAD,EAAM,MAAM,OAAO,cAAc,cAAgB,CAAA;GAC3C,CAAA;EAEX,CAAA,CACE;;AAET"}
|
|
@@ -4,7 +4,7 @@ export declare const CALLOUT_ATTRIBUTES: readonly ["variant", "icon", "title", "
|
|
|
4
4
|
export type CalloutAttribute = (typeof CALLOUT_ATTRIBUTES)[number];
|
|
5
5
|
/** The descriptor `props` list, matching {@link CALLOUT_ATTRIBUTES}. */
|
|
6
6
|
export declare const CALLOUT_JSX_PROPS: {
|
|
7
|
-
name: "
|
|
7
|
+
name: "source" | "label" | "badge" | "title" | "icon" | "variant" | "emphasis";
|
|
8
8
|
type: "string";
|
|
9
9
|
}[];
|
|
10
10
|
/** The choices each enumerated attribute offers, for the node editor's selects. */
|
|
@@ -58,13 +58,22 @@ function codeBlockEditorDescriptors(mdx, descriptors) {
|
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* The registered JSX blocks: the built-in callout when `callouts` is on, plus
|
|
61
|
-
* whatever the consumer registers
|
|
62
|
-
* keeps a single descriptor list —
|
|
61
|
+
* whatever the consumer registers, plus a `*` catch-all under `mdxSyntax`.
|
|
62
|
+
* They share one `jsxPlugin` because MDXEditor keeps a single descriptor list —
|
|
63
|
+
* a second call would replace the first. MDXEditor matches by name before
|
|
64
|
+
* falling back to `*`, so the catch-all never shadows a registered block.
|
|
63
65
|
*/
|
|
64
66
|
function jsxComponentDescriptors(mdx, options) {
|
|
65
67
|
const descriptors = [];
|
|
66
68
|
if (isEnabled(options.callouts, false)) descriptors.push(require_mdx_editor_callout.calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));
|
|
67
69
|
if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);
|
|
70
|
+
if (options.mdxSyntax) descriptors.push({
|
|
71
|
+
name: "*",
|
|
72
|
+
kind: "flow",
|
|
73
|
+
props: [],
|
|
74
|
+
hasChildren: true,
|
|
75
|
+
Editor: mdx.GenericJsxEditor
|
|
76
|
+
});
|
|
68
77
|
return descriptors;
|
|
69
78
|
}
|
|
70
79
|
function createMdxEditorPlugins(mdx, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-editor-field-plugins.cjs","names":["createElement","MdxEditorToolbar","calloutJsxDescriptor"],"sources":["../../src/components/mdx-editor-field-plugins.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport { calloutJsxDescriptor } from \"./mdx-editor-callout\";\nimport type {\n MdxEditorCodeBlockEditorDescriptor,\n MdxEditorDiffModeOptions,\n MdxEditorJsxComponentDescriptor,\n MdxEditorPluginOptions,\n} from \"./mdx-editor-options\";\nimport { MdxEditorToolbar } from \"./MdxEditorToolbar\";\n\ntype MdxEditorModule = typeof import(\"@mdxeditor/editor\");\ntype RealmPlugin = ReturnType<MdxEditorModule[\"headingsPlugin\"]>;\n\nconst DEFAULT_CODE_BLOCK_LANGUAGES: Record<string, string> = {\n bash: \"Bash\",\n css: \"CSS\",\n go: \"Go\",\n html: \"HTML\",\n javascript: \"JavaScript\",\n js: \"JavaScript\",\n json: \"JSON\",\n jsx: \"JSX\",\n markdown: \"Markdown\",\n python: \"Python\",\n shell: \"Shell\",\n sql: \"SQL\",\n ts: \"TypeScript\",\n tsx: \"TSX\",\n typescript: \"TypeScript\",\n yaml: \"YAML\",\n};\n\nfunction isEnabled<T extends object>(value: boolean | T | undefined, defaultValue = true): boolean {\n return value === undefined ? defaultValue : value !== false;\n}\n\nfunction optionObject<T extends object>(value: boolean | T | undefined): T | undefined {\n return typeof value === \"object\" && value !== null ? value : undefined;\n}\n\nfunction diffModeOptions(diffMode: MdxEditorPluginOptions[\"diffMode\"]): MdxEditorDiffModeOptions | undefined {\n if (!diffMode) return undefined;\n if (diffMode === true) return {};\n if (typeof diffMode === \"string\") return { viewMode: diffMode };\n return diffMode;\n}\n\nfunction createToolbar(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n return () => createElement(MdxEditorToolbar, { mdx, options });\n}\n\nfunction codeBlockEditorDescriptors(\n mdx: MdxEditorModule,\n descriptors: readonly MdxEditorCodeBlockEditorDescriptor[] | undefined,\n) {\n if (!descriptors?.length) return undefined;\n\n return descriptors.map((descriptor) => ({\n priority: descriptor.priority,\n match: descriptor.match,\n Editor: (props: {\n code: string;\n language: string;\n meta: string;\n nodeKey: string;\n focusEmitter: {\n subscribe: (callback: () => void) => void;\n };\n }) => {\n const context = mdx.useCodeBlockEditorContext();\n return createElement(descriptor.Editor, {\n ...props,\n context: {\n setCode: context.setCode,\n setLanguage: context.setLanguage,\n setMeta: context.setMeta,\n },\n });\n },\n }));\n}\n\n/**\n * The registered JSX blocks: the built-in callout when `callouts` is on, plus\n * whatever the consumer registers. They share one `jsxPlugin` because MDXEditor\n * keeps a single descriptor list — a second call would replace the first.\n */\nfunction jsxComponentDescriptors(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n const descriptors: MdxEditorJsxComponentDescriptor[] = [];\n if (isEnabled(options.callouts, false)) {\n descriptors.push(calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));\n }\n if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);\n return descriptors;\n}\n\nexport function createMdxEditorPlugins(\n mdx: MdxEditorModule,\n options: MdxEditorPluginOptions = {},\n): RealmPlugin[] {\n const plugins: RealmPlugin[] = [];\n if (isEnabled(options.toolbar)) {\n const toolbar = optionObject(options.toolbar);\n plugins.push(\n mdx.toolbarPlugin({\n toolbarContents: createToolbar(mdx, options),\n ...(toolbar?.className ? { toolbarClassName: toolbar.className } : {}),\n ...(toolbar?.position ? { toolbarPosition: toolbar.position } : {}),\n }),\n );\n }\n if (isEnabled(options.headings)) {\n const headings = optionObject(options.headings);\n plugins.push(mdx.headingsPlugin(headings));\n }\n if (isEnabled(options.lists)) plugins.push(mdx.listsPlugin());\n if (isEnabled(options.quote)) plugins.push(mdx.quotePlugin());\n if (isEnabled(options.links)) {\n const links = optionObject(options.links);\n plugins.push(\n mdx.linkPlugin(links?.disableAutoLink !== undefined ? { disableAutoLink: links.disableAutoLink } : undefined),\n mdx.linkDialogPlugin({\n ...(links?.linkAutocompleteSuggestions ? { linkAutocompleteSuggestions: links.linkAutocompleteSuggestions } : {}),\n ...(links?.showLinkTitleField !== undefined ? { showLinkTitleField: links.showLinkTitleField } : {}),\n }),\n );\n }\n if (isEnabled(options.tables)) plugins.push(mdx.tablePlugin());\n if (isEnabled(options.thematicBreak)) plugins.push(mdx.thematicBreakPlugin());\n if (isEnabled(options.codeBlocks)) {\n const codeBlocks = optionObject(options.codeBlocks);\n const codeBlockPluginOptions: Parameters<MdxEditorModule[\"codeBlockPlugin\"]>[0] = {\n defaultCodeBlockLanguage: codeBlocks?.defaultLanguage ?? \"txt\",\n };\n const descriptors = codeBlockEditorDescriptors(\n mdx,\n codeBlocks?.editorDescriptors,\n );\n if (descriptors) {\n codeBlockPluginOptions.codeBlockEditorDescriptors = descriptors;\n }\n plugins.push(mdx.codeBlockPlugin(codeBlockPluginOptions));\n if (isEnabled(options.codeMirror)) {\n const codeMirror = optionObject(options.codeMirror);\n plugins.push(\n mdx.codeMirrorPlugin({\n codeBlockLanguages: codeMirror?.languages ?? DEFAULT_CODE_BLOCK_LANGUAGES,\n ...(codeMirror?.autoLoadLanguageSupport !== undefined\n ? { autoLoadLanguageSupport: codeMirror.autoLoadLanguageSupport }\n : {}),\n }),\n );\n }\n }\n const jsxDescriptors = jsxComponentDescriptors(mdx, options);\n if (jsxDescriptors.length) {\n plugins.push(mdx.jsxPlugin({ jsxComponentDescriptors: jsxDescriptors as never }));\n }\n if (isEnabled(options.frontmatter)) plugins.push(mdx.frontmatterPlugin());\n if (isEnabled(options.admonitions)) {\n const admonitions = optionObject(options.admonitions);\n plugins.push(\n mdx.directivesPlugin({\n directiveDescriptors: [mdx.AdmonitionDirectiveDescriptor],\n escapeUnknownTextDirectives: admonitions?.escapeUnknownTextDirectives ?? true,\n }),\n );\n }\n if (isEnabled(options.images)) {\n const images = optionObject(options.images);\n plugins.push(\n mdx.imagePlugin({\n ...(images?.imageUploadHandler ? { imageUploadHandler: images.imageUploadHandler } : {}),\n ...(images?.imageAutocompleteSuggestions ? { imageAutocompleteSuggestions: images.imageAutocompleteSuggestions } : {}),\n ...(images?.imagePreviewHandler ? { imagePreviewHandler: images.imagePreviewHandler } : {}),\n ...(images?.disableImageResize !== undefined ? { disableImageResize: images.disableImageResize } : {}),\n ...(images?.disableImageSettingsButton !== undefined\n ? { disableImageSettingsButton: images.disableImageSettingsButton }\n : {}),\n ...(images?.allowSetImageDimensions !== undefined ? { allowSetImageDimensions: images.allowSetImageDimensions } : {}),\n }),\n );\n }\n if (options.diffMode) {\n const diff = diffModeOptions(options.diffMode);\n plugins.push(\n mdx.diffSourcePlugin({\n ...(diff?.viewMode ? { viewMode: diff.viewMode } : {}),\n ...(diff?.diffMarkdown !== undefined ? { diffMarkdown: diff.diffMarkdown } : {}),\n ...(diff?.readOnlyDiff !== undefined ? { readOnlyDiff: diff.readOnlyDiff } : {}),\n }),\n );\n }\n if (isEnabled(options.markdownShortcuts)) plugins.push(mdx.markdownShortcutPlugin());\n if (options.plugins?.length) plugins.push(...(options.plugins as RealmPlugin[]));\n return plugins;\n}\n"],"mappings":";;;;AAaA,IAA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O,mBAAmB,IAAI,CAAC;GACpG,GAAI,QAAQ,+BAA+B,KAAA,IACvC,EAAE,4BAA4B,OAAO,2BAA2B,IAChE,CAAC;GACL,GAAI,QAAQ,4BAA4B,KAAA,IAAY,EAAE,yBAAyB,OAAO,wBAAwB,IAAI,CAAC;EACrH,CAAC,CACH;CACF;CACA,IAAI,QAAQ,UAAU;EACpB,MAAM,OAAO,gBAAgB,QAAQ,QAAQ;EAC7C,QAAQ,KACN,IAAI,iBAAiB;GACnB,GAAI,MAAM,WAAW,EAAE,UAAU,KAAK,SAAS,IAAI,CAAC;GACpD,GAAI,MAAM,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;GAC9E,GAAI,MAAM,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;EAChF,CAAC,CACH;CACF;CACA,IAAI,UAAU,QAAQ,iBAAiB,GAAG,QAAQ,KAAK,IAAI,uBAAuB,CAAC;CACnF,IAAI,QAAQ,SAAS,QAAQ,QAAQ,KAAK,GAAI,QAAQ,OAAyB;CAC/E,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"mdx-editor-field-plugins.cjs","names":["createElement","MdxEditorToolbar","calloutJsxDescriptor"],"sources":["../../src/components/mdx-editor-field-plugins.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport { calloutJsxDescriptor } from \"./mdx-editor-callout\";\nimport type {\n MdxEditorCodeBlockEditorDescriptor,\n MdxEditorDiffModeOptions,\n MdxEditorJsxComponentDescriptor,\n MdxEditorPluginOptions,\n} from \"./mdx-editor-options\";\nimport { MdxEditorToolbar } from \"./MdxEditorToolbar\";\n\ntype MdxEditorModule = typeof import(\"@mdxeditor/editor\");\ntype RealmPlugin = ReturnType<MdxEditorModule[\"headingsPlugin\"]>;\n\nconst DEFAULT_CODE_BLOCK_LANGUAGES: Record<string, string> = {\n bash: \"Bash\",\n css: \"CSS\",\n go: \"Go\",\n html: \"HTML\",\n javascript: \"JavaScript\",\n js: \"JavaScript\",\n json: \"JSON\",\n jsx: \"JSX\",\n markdown: \"Markdown\",\n python: \"Python\",\n shell: \"Shell\",\n sql: \"SQL\",\n ts: \"TypeScript\",\n tsx: \"TSX\",\n typescript: \"TypeScript\",\n yaml: \"YAML\",\n};\n\nfunction isEnabled<T extends object>(value: boolean | T | undefined, defaultValue = true): boolean {\n return value === undefined ? defaultValue : value !== false;\n}\n\nfunction optionObject<T extends object>(value: boolean | T | undefined): T | undefined {\n return typeof value === \"object\" && value !== null ? value : undefined;\n}\n\nfunction diffModeOptions(diffMode: MdxEditorPluginOptions[\"diffMode\"]): MdxEditorDiffModeOptions | undefined {\n if (!diffMode) return undefined;\n if (diffMode === true) return {};\n if (typeof diffMode === \"string\") return { viewMode: diffMode };\n return diffMode;\n}\n\nfunction createToolbar(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n return () => createElement(MdxEditorToolbar, { mdx, options });\n}\n\nfunction codeBlockEditorDescriptors(\n mdx: MdxEditorModule,\n descriptors: readonly MdxEditorCodeBlockEditorDescriptor[] | undefined,\n) {\n if (!descriptors?.length) return undefined;\n\n return descriptors.map((descriptor) => ({\n priority: descriptor.priority,\n match: descriptor.match,\n Editor: (props: {\n code: string;\n language: string;\n meta: string;\n nodeKey: string;\n focusEmitter: {\n subscribe: (callback: () => void) => void;\n };\n }) => {\n const context = mdx.useCodeBlockEditorContext();\n return createElement(descriptor.Editor, {\n ...props,\n context: {\n setCode: context.setCode,\n setLanguage: context.setLanguage,\n setMeta: context.setMeta,\n },\n });\n },\n }));\n}\n\n/**\n * The registered JSX blocks: the built-in callout when `callouts` is on, plus\n * whatever the consumer registers, plus a `*` catch-all under `mdxSyntax`.\n * They share one `jsxPlugin` because MDXEditor keeps a single descriptor list —\n * a second call would replace the first. MDXEditor matches by name before\n * falling back to `*`, so the catch-all never shadows a registered block.\n */\nfunction jsxComponentDescriptors(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n const descriptors: MdxEditorJsxComponentDescriptor[] = [];\n if (isEnabled(options.callouts, false)) {\n descriptors.push(calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));\n }\n if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);\n if (options.mdxSyntax) {\n descriptors.push({\n name: \"*\",\n kind: \"flow\",\n props: [],\n hasChildren: true,\n Editor: mdx.GenericJsxEditor as MdxEditorJsxComponentDescriptor[\"Editor\"],\n });\n }\n return descriptors;\n}\n\nexport function createMdxEditorPlugins(\n mdx: MdxEditorModule,\n options: MdxEditorPluginOptions = {},\n): RealmPlugin[] {\n const plugins: RealmPlugin[] = [];\n if (isEnabled(options.toolbar)) {\n const toolbar = optionObject(options.toolbar);\n plugins.push(\n mdx.toolbarPlugin({\n toolbarContents: createToolbar(mdx, options),\n ...(toolbar?.className ? { toolbarClassName: toolbar.className } : {}),\n ...(toolbar?.position ? { toolbarPosition: toolbar.position } : {}),\n }),\n );\n }\n if (isEnabled(options.headings)) {\n const headings = optionObject(options.headings);\n plugins.push(mdx.headingsPlugin(headings));\n }\n if (isEnabled(options.lists)) plugins.push(mdx.listsPlugin());\n if (isEnabled(options.quote)) plugins.push(mdx.quotePlugin());\n if (isEnabled(options.links)) {\n const links = optionObject(options.links);\n plugins.push(\n mdx.linkPlugin(links?.disableAutoLink !== undefined ? { disableAutoLink: links.disableAutoLink } : undefined),\n mdx.linkDialogPlugin({\n ...(links?.linkAutocompleteSuggestions ? { linkAutocompleteSuggestions: links.linkAutocompleteSuggestions } : {}),\n ...(links?.showLinkTitleField !== undefined ? { showLinkTitleField: links.showLinkTitleField } : {}),\n }),\n );\n }\n if (isEnabled(options.tables)) plugins.push(mdx.tablePlugin());\n if (isEnabled(options.thematicBreak)) plugins.push(mdx.thematicBreakPlugin());\n if (isEnabled(options.codeBlocks)) {\n const codeBlocks = optionObject(options.codeBlocks);\n const codeBlockPluginOptions: Parameters<MdxEditorModule[\"codeBlockPlugin\"]>[0] = {\n defaultCodeBlockLanguage: codeBlocks?.defaultLanguage ?? \"txt\",\n };\n const descriptors = codeBlockEditorDescriptors(\n mdx,\n codeBlocks?.editorDescriptors,\n );\n if (descriptors) {\n codeBlockPluginOptions.codeBlockEditorDescriptors = descriptors;\n }\n plugins.push(mdx.codeBlockPlugin(codeBlockPluginOptions));\n if (isEnabled(options.codeMirror)) {\n const codeMirror = optionObject(options.codeMirror);\n plugins.push(\n mdx.codeMirrorPlugin({\n codeBlockLanguages: codeMirror?.languages ?? DEFAULT_CODE_BLOCK_LANGUAGES,\n ...(codeMirror?.autoLoadLanguageSupport !== undefined\n ? { autoLoadLanguageSupport: codeMirror.autoLoadLanguageSupport }\n : {}),\n }),\n );\n }\n }\n const jsxDescriptors = jsxComponentDescriptors(mdx, options);\n if (jsxDescriptors.length) {\n plugins.push(mdx.jsxPlugin({ jsxComponentDescriptors: jsxDescriptors as never }));\n }\n if (isEnabled(options.frontmatter)) plugins.push(mdx.frontmatterPlugin());\n if (isEnabled(options.admonitions)) {\n const admonitions = optionObject(options.admonitions);\n plugins.push(\n mdx.directivesPlugin({\n directiveDescriptors: [mdx.AdmonitionDirectiveDescriptor],\n escapeUnknownTextDirectives: admonitions?.escapeUnknownTextDirectives ?? true,\n }),\n );\n }\n if (isEnabled(options.images)) {\n const images = optionObject(options.images);\n plugins.push(\n mdx.imagePlugin({\n ...(images?.imageUploadHandler ? { imageUploadHandler: images.imageUploadHandler } : {}),\n ...(images?.imageAutocompleteSuggestions ? { imageAutocompleteSuggestions: images.imageAutocompleteSuggestions } : {}),\n ...(images?.imagePreviewHandler ? { imagePreviewHandler: images.imagePreviewHandler } : {}),\n ...(images?.disableImageResize !== undefined ? { disableImageResize: images.disableImageResize } : {}),\n ...(images?.disableImageSettingsButton !== undefined\n ? { disableImageSettingsButton: images.disableImageSettingsButton }\n : {}),\n ...(images?.allowSetImageDimensions !== undefined ? { allowSetImageDimensions: images.allowSetImageDimensions } : {}),\n }),\n );\n }\n if (options.diffMode) {\n const diff = diffModeOptions(options.diffMode);\n plugins.push(\n mdx.diffSourcePlugin({\n ...(diff?.viewMode ? { viewMode: diff.viewMode } : {}),\n ...(diff?.diffMarkdown !== undefined ? { diffMarkdown: diff.diffMarkdown } : {}),\n ...(diff?.readOnlyDiff !== undefined ? { readOnlyDiff: diff.readOnlyDiff } : {}),\n }),\n );\n }\n if (isEnabled(options.markdownShortcuts)) plugins.push(mdx.markdownShortcutPlugin());\n if (options.plugins?.length) plugins.push(...(options.plugins as RealmPlugin[]));\n return plugins;\n}\n"],"mappings":";;;;AAaA,IAAM,+BAAuD;CAC3D,MAAM;CACN,KAAK;CACL,IAAI;CACJ,MAAM;CACN,YAAY;CACZ,IAAI;CACJ,MAAM;CACN,KAAK;CACL,UAAU;CACV,QAAQ;CACR,OAAO;CACP,KAAK;CACL,IAAI;CACJ,KAAK;CACL,YAAY;CACZ,MAAM;AACR;AAEA,SAAS,UAA4B,OAAgC,eAAe,MAAe;CACjG,OAAO,UAAU,KAAA,IAAY,eAAe,UAAU;AACxD;AAEA,SAAS,aAA+B,OAA+C;CACrF,OAAO,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,KAAA;AAC/D;AAEA,SAAS,gBAAgB,UAAoF;CAC3G,IAAI,CAAC,UAAU,OAAO,KAAA;CACtB,IAAI,aAAa,MAAM,OAAO,CAAC;CAC/B,IAAI,OAAO,aAAa,UAAU,OAAO,EAAE,UAAU,SAAS;CAC9D,OAAO;AACT;AAEA,SAAS,cAAc,KAAsB,SAAiC;CAC5E,cAAA,GAAaA,MAAAA,cAAAA,CAAcC,yBAAAA,kBAAkB;EAAE;EAAK;CAAQ,CAAC;AAC/D;AAEA,SAAS,2BACP,KACA,aACA;CACA,IAAI,CAAC,aAAa,QAAQ,OAAO,KAAA;CAEjC,OAAO,YAAY,KAAK,gBAAgB;EACtC,UAAU,WAAW;EACrB,OAAO,WAAW;EAClB,SAAS,UAQH;GACJ,MAAM,UAAU,IAAI,0BAA0B;GAC9C,QAAA,GAAOD,MAAAA,cAAAA,CAAc,W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editor-field-plugins.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,KAAK,eAAe,GAAG,cAAc,mBAAmB,CAAC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"mdx-editor-field-plugins.d.ts","sourceRoot":"","sources":["../../src/components/mdx-editor-field-plugins.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAIV,sBAAsB,EACvB,MAAM,sBAAsB,CAAC;AAG9B,KAAK,eAAe,GAAG,cAAc,mBAAmB,CAAC,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC;AAgGjE,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,eAAe,EACpB,OAAO,GAAE,sBAA2B,GACnC,WAAW,EAAE,CAiGf"}
|
|
@@ -58,13 +58,22 @@ function codeBlockEditorDescriptors(mdx, descriptors) {
|
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* The registered JSX blocks: the built-in callout when `callouts` is on, plus
|
|
61
|
-
* whatever the consumer registers
|
|
62
|
-
* keeps a single descriptor list —
|
|
61
|
+
* whatever the consumer registers, plus a `*` catch-all under `mdxSyntax`.
|
|
62
|
+
* They share one `jsxPlugin` because MDXEditor keeps a single descriptor list —
|
|
63
|
+
* a second call would replace the first. MDXEditor matches by name before
|
|
64
|
+
* falling back to `*`, so the catch-all never shadows a registered block.
|
|
63
65
|
*/
|
|
64
66
|
function jsxComponentDescriptors(mdx, options) {
|
|
65
67
|
const descriptors = [];
|
|
66
68
|
if (isEnabled(options.callouts, false)) descriptors.push(calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));
|
|
67
69
|
if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);
|
|
70
|
+
if (options.mdxSyntax) descriptors.push({
|
|
71
|
+
name: "*",
|
|
72
|
+
kind: "flow",
|
|
73
|
+
props: [],
|
|
74
|
+
hasChildren: true,
|
|
75
|
+
Editor: mdx.GenericJsxEditor
|
|
76
|
+
});
|
|
68
77
|
return descriptors;
|
|
69
78
|
}
|
|
70
79
|
function createMdxEditorPlugins(mdx, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-editor-field-plugins.js","names":[],"sources":["../../src/components/mdx-editor-field-plugins.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport { calloutJsxDescriptor } from \"./mdx-editor-callout\";\nimport type {\n MdxEditorCodeBlockEditorDescriptor,\n MdxEditorDiffModeOptions,\n MdxEditorJsxComponentDescriptor,\n MdxEditorPluginOptions,\n} from \"./mdx-editor-options\";\nimport { MdxEditorToolbar } from \"./MdxEditorToolbar\";\n\ntype MdxEditorModule = typeof import(\"@mdxeditor/editor\");\ntype RealmPlugin = ReturnType<MdxEditorModule[\"headingsPlugin\"]>;\n\nconst DEFAULT_CODE_BLOCK_LANGUAGES: Record<string, string> = {\n bash: \"Bash\",\n css: \"CSS\",\n go: \"Go\",\n html: \"HTML\",\n javascript: \"JavaScript\",\n js: \"JavaScript\",\n json: \"JSON\",\n jsx: \"JSX\",\n markdown: \"Markdown\",\n python: \"Python\",\n shell: \"Shell\",\n sql: \"SQL\",\n ts: \"TypeScript\",\n tsx: \"TSX\",\n typescript: \"TypeScript\",\n yaml: \"YAML\",\n};\n\nfunction isEnabled<T extends object>(value: boolean | T | undefined, defaultValue = true): boolean {\n return value === undefined ? defaultValue : value !== false;\n}\n\nfunction optionObject<T extends object>(value: boolean | T | undefined): T | undefined {\n return typeof value === \"object\" && value !== null ? value : undefined;\n}\n\nfunction diffModeOptions(diffMode: MdxEditorPluginOptions[\"diffMode\"]): MdxEditorDiffModeOptions | undefined {\n if (!diffMode) return undefined;\n if (diffMode === true) return {};\n if (typeof diffMode === \"string\") return { viewMode: diffMode };\n return diffMode;\n}\n\nfunction createToolbar(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n return () => createElement(MdxEditorToolbar, { mdx, options });\n}\n\nfunction codeBlockEditorDescriptors(\n mdx: MdxEditorModule,\n descriptors: readonly MdxEditorCodeBlockEditorDescriptor[] | undefined,\n) {\n if (!descriptors?.length) return undefined;\n\n return descriptors.map((descriptor) => ({\n priority: descriptor.priority,\n match: descriptor.match,\n Editor: (props: {\n code: string;\n language: string;\n meta: string;\n nodeKey: string;\n focusEmitter: {\n subscribe: (callback: () => void) => void;\n };\n }) => {\n const context = mdx.useCodeBlockEditorContext();\n return createElement(descriptor.Editor, {\n ...props,\n context: {\n setCode: context.setCode,\n setLanguage: context.setLanguage,\n setMeta: context.setMeta,\n },\n });\n },\n }));\n}\n\n/**\n * The registered JSX blocks: the built-in callout when `callouts` is on, plus\n * whatever the consumer registers. They share one `jsxPlugin` because MDXEditor\n * keeps a single descriptor list — a second call would replace the first.\n */\nfunction jsxComponentDescriptors(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n const descriptors: MdxEditorJsxComponentDescriptor[] = [];\n if (isEnabled(options.callouts, false)) {\n descriptors.push(calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));\n }\n if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);\n return descriptors;\n}\n\nexport function createMdxEditorPlugins(\n mdx: MdxEditorModule,\n options: MdxEditorPluginOptions = {},\n): RealmPlugin[] {\n const plugins: RealmPlugin[] = [];\n if (isEnabled(options.toolbar)) {\n const toolbar = optionObject(options.toolbar);\n plugins.push(\n mdx.toolbarPlugin({\n toolbarContents: createToolbar(mdx, options),\n ...(toolbar?.className ? { toolbarClassName: toolbar.className } : {}),\n ...(toolbar?.position ? { toolbarPosition: toolbar.position } : {}),\n }),\n );\n }\n if (isEnabled(options.headings)) {\n const headings = optionObject(options.headings);\n plugins.push(mdx.headingsPlugin(headings));\n }\n if (isEnabled(options.lists)) plugins.push(mdx.listsPlugin());\n if (isEnabled(options.quote)) plugins.push(mdx.quotePlugin());\n if (isEnabled(options.links)) {\n const links = optionObject(options.links);\n plugins.push(\n mdx.linkPlugin(links?.disableAutoLink !== undefined ? { disableAutoLink: links.disableAutoLink } : undefined),\n mdx.linkDialogPlugin({\n ...(links?.linkAutocompleteSuggestions ? { linkAutocompleteSuggestions: links.linkAutocompleteSuggestions } : {}),\n ...(links?.showLinkTitleField !== undefined ? { showLinkTitleField: links.showLinkTitleField } : {}),\n }),\n );\n }\n if (isEnabled(options.tables)) plugins.push(mdx.tablePlugin());\n if (isEnabled(options.thematicBreak)) plugins.push(mdx.thematicBreakPlugin());\n if (isEnabled(options.codeBlocks)) {\n const codeBlocks = optionObject(options.codeBlocks);\n const codeBlockPluginOptions: Parameters<MdxEditorModule[\"codeBlockPlugin\"]>[0] = {\n defaultCodeBlockLanguage: codeBlocks?.defaultLanguage ?? \"txt\",\n };\n const descriptors = codeBlockEditorDescriptors(\n mdx,\n codeBlocks?.editorDescriptors,\n );\n if (descriptors) {\n codeBlockPluginOptions.codeBlockEditorDescriptors = descriptors;\n }\n plugins.push(mdx.codeBlockPlugin(codeBlockPluginOptions));\n if (isEnabled(options.codeMirror)) {\n const codeMirror = optionObject(options.codeMirror);\n plugins.push(\n mdx.codeMirrorPlugin({\n codeBlockLanguages: codeMirror?.languages ?? DEFAULT_CODE_BLOCK_LANGUAGES,\n ...(codeMirror?.autoLoadLanguageSupport !== undefined\n ? { autoLoadLanguageSupport: codeMirror.autoLoadLanguageSupport }\n : {}),\n }),\n );\n }\n }\n const jsxDescriptors = jsxComponentDescriptors(mdx, options);\n if (jsxDescriptors.length) {\n plugins.push(mdx.jsxPlugin({ jsxComponentDescriptors: jsxDescriptors as never }));\n }\n if (isEnabled(options.frontmatter)) plugins.push(mdx.frontmatterPlugin());\n if (isEnabled(options.admonitions)) {\n const admonitions = optionObject(options.admonitions);\n plugins.push(\n mdx.directivesPlugin({\n directiveDescriptors: [mdx.AdmonitionDirectiveDescriptor],\n escapeUnknownTextDirectives: admonitions?.escapeUnknownTextDirectives ?? true,\n }),\n );\n }\n if (isEnabled(options.images)) {\n const images = optionObject(options.images);\n plugins.push(\n mdx.imagePlugin({\n ...(images?.imageUploadHandler ? { imageUploadHandler: images.imageUploadHandler } : {}),\n ...(images?.imageAutocompleteSuggestions ? { imageAutocompleteSuggestions: images.imageAutocompleteSuggestions } : {}),\n ...(images?.imagePreviewHandler ? { imagePreviewHandler: images.imagePreviewHandler } : {}),\n ...(images?.disableImageResize !== undefined ? { disableImageResize: images.disableImageResize } : {}),\n ...(images?.disableImageSettingsButton !== undefined\n ? { disableImageSettingsButton: images.disableImageSettingsButton }\n : {}),\n ...(images?.allowSetImageDimensions !== undefined ? { allowSetImageDimensions: images.allowSetImageDimensions } : {}),\n }),\n );\n }\n if (options.diffMode) {\n const diff = diffModeOptions(options.diffMode);\n plugins.push(\n mdx.diffSourcePlugin({\n ...(diff?.viewMode ? { viewMode: diff.viewMode } : {}),\n ...(diff?.diffMarkdown !== undefined ? { diffMarkdown: diff.diffMarkdown } : {}),\n ...(diff?.readOnlyDiff !== undefined ? { readOnlyDiff: diff.readOnlyDiff } : {}),\n }),\n );\n }\n if (isEnabled(options.markdownShortcuts)) plugins.push(mdx.markdownShortcutPlugin());\n if (options.plugins?.length) plugins.push(...(options.plugins as RealmPlugin[]));\n return plugins;\n}\n"],"mappings":";;;;AAaA,IAAM,+BAAuD;CAC3D,MAAM;CACN,KAAK;CACL,IAAI;CACJ,MAAM;CACN,YAAY;CACZ,IAAI;CACJ,MAAM;CACN,KAAK;CACL,UAAU;CACV,QAAQ;CACR,OAAO;CACP,KAAK;CACL,IAAI;CACJ,KAAK;CACL,YAAY;CACZ,MAAM;AACR;AAEA,SAAS,UAA4B,OAAgC,eAAe,MAAe;CACjG,OAAO,UAAU,KAAA,IAAY,eAAe,UAAU;AACxD;AAEA,SAAS,aAA+B,OAA+C;CACrF,OAAO,OAAO,UAAU,YAAY,UAAU,OAAO,QAAQ,KAAA;AAC/D;AAEA,SAAS,gB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MAAM,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;EAChF,CAAC,CACH;CACF;CACA,IAAI,UAAU,QAAQ,iBAAiB,GAAG,QAAQ,KAAK,IAAI,uBAAuB,CAAC;CACnF,IAAI,QAAQ,SAAS,QAAQ,QAAQ,KAAK,GAAI,QAAQ,OAAyB;CAC/E,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"mdx-editor-field-plugins.js","names":[],"sources":["../../src/components/mdx-editor-field-plugins.tsx"],"sourcesContent":["import { createElement } from \"react\";\nimport { calloutJsxDescriptor } from \"./mdx-editor-callout\";\nimport type {\n MdxEditorCodeBlockEditorDescriptor,\n MdxEditorDiffModeOptions,\n MdxEditorJsxComponentDescriptor,\n MdxEditorPluginOptions,\n} from \"./mdx-editor-options\";\nimport { MdxEditorToolbar } from \"./MdxEditorToolbar\";\n\ntype MdxEditorModule = typeof import(\"@mdxeditor/editor\");\ntype RealmPlugin = ReturnType<MdxEditorModule[\"headingsPlugin\"]>;\n\nconst DEFAULT_CODE_BLOCK_LANGUAGES: Record<string, string> = {\n bash: \"Bash\",\n css: \"CSS\",\n go: \"Go\",\n html: \"HTML\",\n javascript: \"JavaScript\",\n js: \"JavaScript\",\n json: \"JSON\",\n jsx: \"JSX\",\n markdown: \"Markdown\",\n python: \"Python\",\n shell: \"Shell\",\n sql: \"SQL\",\n ts: \"TypeScript\",\n tsx: \"TSX\",\n typescript: \"TypeScript\",\n yaml: \"YAML\",\n};\n\nfunction isEnabled<T extends object>(value: boolean | T | undefined, defaultValue = true): boolean {\n return value === undefined ? defaultValue : value !== false;\n}\n\nfunction optionObject<T extends object>(value: boolean | T | undefined): T | undefined {\n return typeof value === \"object\" && value !== null ? value : undefined;\n}\n\nfunction diffModeOptions(diffMode: MdxEditorPluginOptions[\"diffMode\"]): MdxEditorDiffModeOptions | undefined {\n if (!diffMode) return undefined;\n if (diffMode === true) return {};\n if (typeof diffMode === \"string\") return { viewMode: diffMode };\n return diffMode;\n}\n\nfunction createToolbar(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n return () => createElement(MdxEditorToolbar, { mdx, options });\n}\n\nfunction codeBlockEditorDescriptors(\n mdx: MdxEditorModule,\n descriptors: readonly MdxEditorCodeBlockEditorDescriptor[] | undefined,\n) {\n if (!descriptors?.length) return undefined;\n\n return descriptors.map((descriptor) => ({\n priority: descriptor.priority,\n match: descriptor.match,\n Editor: (props: {\n code: string;\n language: string;\n meta: string;\n nodeKey: string;\n focusEmitter: {\n subscribe: (callback: () => void) => void;\n };\n }) => {\n const context = mdx.useCodeBlockEditorContext();\n return createElement(descriptor.Editor, {\n ...props,\n context: {\n setCode: context.setCode,\n setLanguage: context.setLanguage,\n setMeta: context.setMeta,\n },\n });\n },\n }));\n}\n\n/**\n * The registered JSX blocks: the built-in callout when `callouts` is on, plus\n * whatever the consumer registers, plus a `*` catch-all under `mdxSyntax`.\n * They share one `jsxPlugin` because MDXEditor keeps a single descriptor list —\n * a second call would replace the first. MDXEditor matches by name before\n * falling back to `*`, so the catch-all never shadows a registered block.\n */\nfunction jsxComponentDescriptors(mdx: MdxEditorModule, options: MdxEditorPluginOptions) {\n const descriptors: MdxEditorJsxComponentDescriptor[] = [];\n if (isEnabled(options.callouts, false)) {\n descriptors.push(calloutJsxDescriptor(mdx, optionObject(options.callouts) ?? {}));\n }\n if (options.jsxComponents?.length) descriptors.push(...options.jsxComponents);\n if (options.mdxSyntax) {\n descriptors.push({\n name: \"*\",\n kind: \"flow\",\n props: [],\n hasChildren: true,\n Editor: mdx.GenericJsxEditor as MdxEditorJsxComponentDescriptor[\"Editor\"],\n });\n }\n return descriptors;\n}\n\nexport function createMdxEditorPlugins(\n mdx: MdxEditorModule,\n options: MdxEditorPluginOptions = {},\n): RealmPlugin[] {\n const plugins: RealmPlugin[] = [];\n if (isEnabled(options.toolbar)) {\n const toolbar = optionObject(options.toolbar);\n plugins.push(\n mdx.toolbarPlugin({\n toolbarContents: createToolbar(mdx, options),\n ...(toolbar?.className ? { toolbarClassName: toolbar.className } : {}),\n ...(toolbar?.position ? { toolbarPosition: toolbar.position } : {}),\n }),\n );\n }\n if (isEnabled(options.headings)) {\n const headings = optionObject(options.headings);\n plugins.push(mdx.headingsPlugin(headings));\n }\n if (isEnabled(options.lists)) plugins.push(mdx.listsPlugin());\n if (isEnabled(options.quote)) plugins.push(mdx.quotePlugin());\n if (isEnabled(options.links)) {\n const links = optionObject(options.links);\n plugins.push(\n mdx.linkPlugin(links?.disableAutoLink !== undefined ? { disableAutoLink: links.disableAutoLink } : undefined),\n mdx.linkDialogPlugin({\n ...(links?.linkAutocompleteSuggestions ? { linkAutocompleteSuggestions: links.linkAutocompleteSuggestions } : {}),\n ...(links?.showLinkTitleField !== undefined ? { showLinkTitleField: links.showLinkTitleField } : {}),\n }),\n );\n }\n if (isEnabled(options.tables)) plugins.push(mdx.tablePlugin());\n if (isEnabled(options.thematicBreak)) plugins.push(mdx.thematicBreakPlugin());\n if (isEnabled(options.codeBlocks)) {\n const codeBlocks = optionObject(options.codeBlocks);\n const codeBlockPluginOptions: Parameters<MdxEditorModule[\"codeBlockPlugin\"]>[0] = {\n defaultCodeBlockLanguage: codeBlocks?.defaultLanguage ?? \"txt\",\n };\n const descriptors = codeBlockEditorDescriptors(\n mdx,\n codeBlocks?.editorDescriptors,\n );\n if (descriptors) {\n codeBlockPluginOptions.codeBlockEditorDescriptors = descriptors;\n }\n plugins.push(mdx.codeBlockPlugin(codeBlockPluginOptions));\n if (isEnabled(options.codeMirror)) {\n const codeMirror = optionObject(options.codeMirror);\n plugins.push(\n mdx.codeMirrorPlugin({\n codeBlockLanguages: codeMirror?.languages ?? DEFAULT_CODE_BLOCK_LANGUAGES,\n ...(codeMirror?.autoLoadLanguageSupport !== undefined\n ? { autoLoadLanguageSupport: codeMirror.autoLoadLanguageSupport }\n : {}),\n }),\n );\n }\n }\n const jsxDescriptors = jsxComponentDescriptors(mdx, options);\n if (jsxDescriptors.length) {\n plugins.push(mdx.jsxPlugin({ jsxComponentDescriptors: jsxDescriptors as never }));\n }\n if (isEnabled(options.frontmatter)) plugins.push(mdx.frontmatterPlugin());\n if (isEnabled(options.admonitions)) {\n const admonitions = optionObject(options.admonitions);\n plugins.push(\n mdx.directivesPlugin({\n directiveDescriptors: [mdx.AdmonitionDirectiveDescriptor],\n escapeUnknownTextDirectives: admonitions?.escapeUnknownTextDirectives ?? true,\n }),\n );\n }\n if (isEnabled(options.images)) {\n const images = optionObject(options.images);\n plugins.push(\n mdx.imagePlugin({\n ...(images?.imageUploadHandler ? { imageUploadHandler: images.imageUploadHandler } : {}),\n ...(images?.imageAutocompleteSuggestions ? { imageAutocompleteSuggestions: images.imageAutocompleteSuggestions } : {}),\n ...(images?.imagePreviewHandler ? { imagePreviewHandler: images.imagePreviewHandler } : {}),\n ...(images?.disableImageResize !== undefined ? { disableImageResize: images.disableImageResize } : {}),\n ...(images?.disableImageSettingsButton !== undefined\n ? { disableImageSettingsButton: images.disableImageSettingsButton }\n : {}),\n ...(images?.allowSetImageDimensions !== undefined ? { allowSetImageDimensions: images.allowSetImageDimensions } : {}),\n }),\n );\n }\n if (options.diffMode) {\n const diff = diffModeOptions(options.diffMode);\n plugins.push(\n mdx.diffSourcePlugin({\n ...(diff?.viewMode ? { viewMode: diff.viewMode } : {}),\n ...(diff?.diffMarkdown !== undefined ? { diffMarkdown: diff.diffMarkdown } : {}),\n ...(diff?.readOnlyDiff !== undefined ? { readOnlyDiff: diff.readOnlyDiff } : {}),\n }),\n );\n }\n if (isEnabled(options.markdownShortcuts)) plugins.push(mdx.markdownShortcutPlugin());\n if (options.plugins?.length) plugins.push(...(options.plugins as RealmPlugin[]));\n return plugins;\n}\n"],"mappings":";;;;AAaA,IAAM,+BAAuD;CAC3D,MAAM;CACN,KAAK;CACL,IAAI;CACJ,MAAM;CACN,YAAY;CACZ,IAAI;CACJ,MAAM;CACN,KAAK;CACL,UAAU;CACV,QAAQ;CACR,OAAO;CACP,KAAK;CACL,IAAI;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L,GAAI,QAAQ,4BAA4B,KAAA,IAAY,EAAE,yBAAyB,OAAO,wBAAwB,IAAI,CAAC;EACrH,CAAC,CACH;CACF;CACA,IAAI,QAAQ,UAAU;EACpB,MAAM,OAAO,gBAAgB,QAAQ,QAAQ;EAC7C,QAAQ,KACN,IAAI,iBAAiB;GACnB,GAAI,MAAM,WAAW,EAAE,UAAU,KAAK,SAAS,IAAI,CAAC;GACpD,GAAI,MAAM,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;GAC9E,GAAI,MAAM,iBAAiB,KAAA,IAAY,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;EAChF,CAAC,CACH;CACF;CACA,IAAI,UAAU,QAAQ,iBAAiB,GAAG,QAAQ,KAAK,IAAI,uBAAuB,CAAC;CACnF,IAAI,QAAQ,SAAS,QAAQ,QAAQ,KAAK,GAAI,QAAQ,OAAyB;CAC/E,OAAO;AACT"}
|
|
@@ -156,6 +156,13 @@ export interface MdxEditorPluginOptions {
|
|
|
156
156
|
* consuming application. Combined with `callouts` into one `jsxPlugin`.
|
|
157
157
|
*/
|
|
158
158
|
jsxComponents?: readonly MdxEditorJsxComponentDescriptor[];
|
|
159
|
+
/**
|
|
160
|
+
* Parse the value as MDX: a JSX block with no registered descriptor loads in
|
|
161
|
+
* the generic JSX editor, keeping its attributes and children, instead of
|
|
162
|
+
* failing the import. Off by default, since MDX rejects HTML comments and
|
|
163
|
+
* stray tags that plain markdown allows.
|
|
164
|
+
*/
|
|
165
|
+
mdxSyntax?: boolean;
|
|
159
166
|
images?: boolean | MdxEditorImageOptions;
|
|
160
167
|
markdownShortcuts?: boolean;
|
|
161
168
|
diffMode?: boolean | MdxEditorViewMode | MdxEditorDiffModeOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx-editor-options.d.ts","sourceRoot":"","sources":["../../src/components/mdx-editor-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,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