@sero-ai/ui 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +397 -384
- package/.turbo/turbo-test.log +18 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/components/ai-elements/agent.cjs +6 -6
- package/dist/components/ai-elements/agent.js +6 -6
- package/dist/components/ai-elements/artifact.cjs +2 -2
- package/dist/components/ai-elements/artifact.js +2 -2
- package/dist/components/ai-elements/attachments.cjs +2 -2
- package/dist/components/ai-elements/attachments.js +2 -2
- package/dist/components/ai-elements/chain-of-thought.cjs +2 -2
- package/dist/components/ai-elements/chain-of-thought.js +2 -2
- package/dist/components/ai-elements/code-block.cjs +7 -5
- package/dist/components/ai-elements/code-block.d.cts +2 -1
- package/dist/components/ai-elements/code-block.d.ts +2 -1
- package/dist/components/ai-elements/code-block.js +7 -5
- package/dist/components/ai-elements/commit.cjs +2 -2
- package/dist/components/ai-elements/commit.js +2 -2
- package/dist/components/ai-elements/confirmation.cjs +1 -1
- package/dist/components/ai-elements/confirmation.js +1 -1
- package/dist/components/ai-elements/conversation.cjs +2 -2
- package/dist/components/ai-elements/conversation.js +2 -2
- package/dist/components/ai-elements/environment-variables.cjs +3 -3
- package/dist/components/ai-elements/environment-variables.js +3 -3
- package/dist/components/ai-elements/file-tree.cjs +1 -1
- package/dist/components/ai-elements/file-tree.js +1 -1
- package/dist/components/ai-elements/inline-citation.cjs +3 -3
- package/dist/components/ai-elements/inline-citation.js +3 -3
- package/dist/components/ai-elements/jsx-preview.cjs +1 -1
- package/dist/components/ai-elements/jsx-preview.js +1 -1
- package/dist/components/ai-elements/message.cjs +1 -1
- package/dist/components/ai-elements/message.js +1 -1
- package/dist/components/ai-elements/package-info.cjs +4 -4
- package/dist/components/ai-elements/package-info.js +4 -4
- package/dist/components/ai-elements/prompt-input-context.cjs +2 -3
- package/dist/components/ai-elements/prompt-input-context.js +2 -3
- package/dist/components/ai-elements/queue.cjs +2 -2
- package/dist/components/ai-elements/queue.js +2 -2
- package/dist/components/ai-elements/reasoning.cjs +2 -2
- package/dist/components/ai-elements/reasoning.js +2 -2
- package/dist/components/ai-elements/sandbox.cjs +3 -3
- package/dist/components/ai-elements/sandbox.js +3 -3
- package/dist/components/ai-elements/schema-display.cjs +12 -12
- package/dist/components/ai-elements/schema-display.js +12 -12
- package/dist/components/ai-elements/speech-input.cjs +18 -2
- package/dist/components/ai-elements/speech-input.js +16 -0
- package/dist/components/ai-elements/stack-trace.cjs +1 -1
- package/dist/components/ai-elements/stack-trace.js +1 -1
- package/dist/components/ai-elements/task.cjs +3 -3
- package/dist/components/ai-elements/task.js +3 -3
- package/dist/components/ai-elements/terminal.cjs +2 -2
- package/dist/components/ai-elements/terminal.js +2 -2
- package/dist/components/ai-elements/test-results.cjs +4 -4
- package/dist/components/ai-elements/test-results.js +4 -4
- package/dist/components/ai-elements/tool.cjs +4 -4
- package/dist/components/ai-elements/tool.js +4 -4
- package/dist/components/ai-elements/transcription.cjs +1 -1
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/web-preview.cjs +2 -2
- package/dist/components/ai-elements/web-preview.js +2 -2
- package/dist/components/context-editor/CapabilitySection.cjs +2 -2
- package/dist/components/context-editor/CapabilitySection.js +2 -2
- package/dist/components/context-editor/ContextEditor.cjs +2 -2
- package/dist/components/context-editor/ContextEditor.js +2 -2
- package/dist/components/context-editor/PresetBar.cjs +3 -3
- package/dist/components/context-editor/PresetBar.js +3 -3
- package/dist/components/context-editor/SystemPromptSection.cjs +4 -4
- package/dist/components/context-editor/SystemPromptSection.js +4 -4
- package/dist/components/context-editor/parts.cjs +6 -6
- package/dist/components/context-editor/parts.js +6 -6
- package/dist/components/dashboard/activity-list.cjs +2 -2
- package/dist/components/dashboard/activity-list.js +2 -2
- package/dist/components/dashboard/empty-state.cjs +1 -1
- package/dist/components/dashboard/empty-state.js +1 -1
- package/dist/components/dashboard/item-list.cjs +2 -2
- package/dist/components/dashboard/item-list.js +2 -2
- package/dist/components/dashboard/layout.cjs +1 -1
- package/dist/components/dashboard/layout.js +1 -1
- package/dist/components/dashboard/metric.cjs +1 -1
- package/dist/components/dashboard/metric.js +1 -1
- package/dist/components/dashboard/stale-indicator.cjs +1 -1
- package/dist/components/dashboard/stale-indicator.js +1 -1
- package/dist/components/dashboard/typography.cjs +4 -4
- package/dist/components/dashboard/typography.d.cts +1 -1
- package/dist/components/dashboard/typography.d.ts +1 -1
- package/dist/components/dashboard/typography.js +4 -4
- package/dist/components/model-selection/available-model-picker.cjs +6 -6
- package/dist/components/model-selection/available-model-picker.js +6 -6
- package/dist/components/model-selection/thinking-level-picker.cjs +1 -1
- package/dist/components/model-selection/thinking-level-picker.js +1 -1
- package/dist/components/model-selection/thinking-picker.cjs +70 -0
- package/dist/components/model-selection/thinking-picker.d.cts +12 -0
- package/dist/components/model-selection/thinking-picker.d.ts +12 -0
- package/dist/components/model-selection/thinking-picker.js +70 -0
- package/dist/components/ui/accordion.cjs +2 -2
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/alert-dialog.cjs +4 -2
- package/dist/components/ui/alert-dialog.js +4 -2
- package/dist/components/ui/alert.cjs +2 -2
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/avatar.cjs +2 -2
- package/dist/components/ui/avatar.js +2 -2
- package/dist/components/ui/breadcrumb.cjs +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button-group.cjs +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.cjs +2 -2
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/card.cjs +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.cjs +3 -2
- package/dist/components/ui/carousel.js +2 -1
- package/dist/components/ui/chart.cjs +36 -27
- package/dist/components/ui/chart.d.cts +21 -17
- package/dist/components/ui/chart.d.ts +21 -17
- package/dist/components/ui/chart.js +30 -21
- package/dist/components/ui/combobox.cjs +7 -5
- package/dist/components/ui/combobox.js +7 -5
- package/dist/components/ui/command.cjs +3 -3
- package/dist/components/ui/command.js +3 -3
- package/dist/components/ui/context-menu.cjs +10 -7
- package/dist/components/ui/context-menu.js +10 -7
- package/dist/components/ui/dialog.cjs +4 -2
- package/dist/components/ui/dialog.js +4 -2
- package/dist/components/ui/drawer.cjs +4 -2
- package/dist/components/ui/drawer.js +4 -2
- package/dist/components/ui/dropdown-menu.cjs +10 -7
- package/dist/components/ui/dropdown-menu.js +10 -7
- package/dist/components/ui/empty.cjs +2 -2
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/field.cjs +5 -5
- package/dist/components/ui/field.js +5 -5
- package/dist/components/ui/form.cjs +2 -2
- package/dist/components/ui/form.d.cts +1 -1
- package/dist/components/ui/form.d.ts +1 -1
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/hover-card.cjs +3 -1
- package/dist/components/ui/hover-card.js +3 -1
- package/dist/components/ui/input-group.cjs +3 -3
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-otp.cjs +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/item.cjs +3 -3
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/label.cjs +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.cjs +9 -7
- package/dist/components/ui/menubar.js +9 -7
- package/dist/components/ui/native-select.cjs +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.cjs +2 -2
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/plugin-safety-disclaimer.cjs +1 -1
- package/dist/components/ui/plugin-safety-disclaimer.js +1 -1
- package/dist/components/ui/popover.cjs +4 -2
- package/dist/components/ui/popover.js +4 -2
- package/dist/components/ui/select.cjs +5 -3
- package/dist/components/ui/select.js +5 -3
- package/dist/components/ui/sheet.cjs +4 -2
- package/dist/components/ui/sheet.js +4 -2
- package/dist/components/ui/sidebar.cjs +5 -5
- package/dist/components/ui/sidebar.js +5 -5
- package/dist/components/ui/table.cjs +2 -2
- package/dist/components/ui/table.js +2 -2
- package/dist/components/ui/tabs.cjs +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.cjs +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/toggle.cjs +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/tooltip.cjs +3 -1
- package/dist/components/ui/tooltip.js +3 -1
- package/dist/index.cjs +5 -56
- package/dist/index.d.cts +2 -65
- package/dist/index.d.ts +2 -65
- package/dist/index.js +5 -56
- package/dist/plugin-style-scope-context.cjs +10 -0
- package/dist/plugin-style-scope-context.d.cts +13 -0
- package/dist/plugin-style-scope-context.d.ts +13 -0
- package/dist/plugin-style-scope-context.js +10 -0
- package/dist/plugin-style-scope.cjs +25 -0
- package/dist/plugin-style-scope.d.cts +11 -0
- package/dist/plugin-style-scope.d.ts +11 -0
- package/dist/plugin-style-scope.js +25 -0
- package/dist/reference.cjs +71 -98
- package/dist/reference.js +71 -98
- package/dist/styles/ai-elements.css +2 -0
- package/dist/styles/context-editor.css +2 -0
- package/dist/styles/globals.css +22 -3
- package/dist/styles/model-selection.css +2 -0
- package/dist/styles/plugin-theme.css +80 -0
- package/dist/styles/plugin.css +17 -2
- package/package.json +32 -19
- package/scripts/smoke-dist.mjs +104 -2
- package/src/components/ai-elements/agent.tsx +6 -6
- package/src/components/ai-elements/artifact.tsx +2 -2
- package/src/components/ai-elements/attachments.tsx +2 -2
- package/src/components/ai-elements/chain-of-thought.tsx +2 -2
- package/src/components/ai-elements/code-block.tsx +6 -3
- package/src/components/ai-elements/commit.tsx +2 -2
- package/src/components/ai-elements/confirmation.tsx +1 -1
- package/src/components/ai-elements/conversation.tsx +2 -2
- package/src/components/ai-elements/environment-variables.tsx +3 -3
- package/src/components/ai-elements/file-tree.tsx +1 -1
- package/src/components/ai-elements/inline-citation.tsx +3 -3
- package/src/components/ai-elements/jsx-preview.tsx +1 -1
- package/src/components/ai-elements/message.tsx +1 -1
- package/src/components/ai-elements/package-info.tsx +4 -4
- package/src/components/ai-elements/prompt-input-context.tsx +3 -2
- package/src/components/ai-elements/queue.tsx +2 -2
- package/src/components/ai-elements/reasoning.tsx +2 -2
- package/src/components/ai-elements/sandbox.tsx +3 -3
- package/src/components/ai-elements/schema-display.tsx +12 -12
- package/src/components/ai-elements/speech-input.tsx +17 -0
- package/src/components/ai-elements/stack-trace.tsx +1 -1
- package/src/components/ai-elements/task.tsx +3 -3
- package/src/components/ai-elements/terminal.tsx +2 -2
- package/src/components/ai-elements/test-results.tsx +4 -4
- package/src/components/ai-elements/tool.tsx +4 -4
- package/src/components/ai-elements/transcription.tsx +1 -1
- package/src/components/ai-elements/web-preview.tsx +2 -2
- package/src/components/context-editor/CapabilitySection.tsx +2 -2
- package/src/components/context-editor/ContextEditor.tsx +2 -2
- package/src/components/context-editor/PresetBar.tsx +3 -3
- package/src/components/context-editor/SystemPromptSection.tsx +4 -4
- package/src/components/context-editor/parts.tsx +6 -6
- package/src/components/dashboard/activity-list.tsx +2 -2
- package/src/components/dashboard/empty-state.tsx +1 -1
- package/src/components/dashboard/item-list.tsx +2 -2
- package/src/components/dashboard/layout.tsx +1 -1
- package/src/components/dashboard/metric.tsx +1 -1
- package/src/components/dashboard/stale-indicator.tsx +1 -1
- package/src/components/dashboard/typography.tsx +5 -5
- package/src/components/model-selection/available-model-picker.tsx +7 -7
- package/src/components/model-selection/thinking-level-picker.tsx +1 -1
- package/src/components/model-selection/thinking-picker.tsx +90 -0
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/alert-dialog.tsx +4 -2
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +2 -2
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/button-group.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/calendar.tsx +3 -3
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/carousel.tsx +2 -1
- package/src/components/ui/chart.tsx +54 -36
- package/src/components/ui/combobox.tsx +7 -5
- package/src/components/ui/command.tsx +3 -3
- package/src/components/ui/context-menu.tsx +10 -7
- package/src/components/ui/dialog.tsx +4 -2
- package/src/components/ui/drawer.tsx +4 -2
- package/src/components/ui/dropdown-menu.tsx +10 -7
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/field.tsx +5 -5
- package/src/components/ui/form.tsx +2 -2
- package/src/components/ui/hover-card.tsx +3 -1
- package/src/components/ui/input-group.tsx +3 -3
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -7
- package/src/components/ui/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +2 -2
- package/src/components/ui/plugin-safety-disclaimer.tsx +1 -1
- package/src/components/ui/popover.tsx +4 -2
- package/src/components/ui/select.tsx +5 -3
- package/src/components/ui/sheet.tsx +4 -2
- package/src/components/ui/sidebar.tsx +5 -5
- package/src/components/ui/table.tsx +2 -2
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -1
- package/src/index.ts +6 -63
- package/src/plugin-style-scope-context.ts +21 -0
- package/src/plugin-style-scope.test.tsx +38 -0
- package/src/plugin-style-scope.tsx +35 -0
- package/src/styles/ai-elements.css +2 -0
- package/src/styles/context-editor.css +2 -0
- package/src/styles/globals.css +22 -3
- package/src/styles/model-selection.css +2 -0
- package/src/styles/plugin-theme.css +80 -0
- package/src/styles/plugin.css +17 -2
package/dist/index.d.ts
CHANGED
|
@@ -61,58 +61,6 @@ export { ToggleGroup, ToggleGroupItem } from './components/ui/toggle-group.js';
|
|
|
61
61
|
export { Toggle, toggleVariants } from './components/ui/toggle.js';
|
|
62
62
|
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './components/ui/tooltip.js';
|
|
63
63
|
export { Tree, TreeDragLine, TreeItem, TreeItemLabel } from './components/ui/tree.js';
|
|
64
|
-
export { Agent, AgentContent, AgentContentProps, AgentHeader, AgentHeaderProps, AgentInstructions, AgentInstructionsProps, AgentOutput, AgentOutputProps, AgentProps, AgentTool, AgentToolProps, AgentTools, AgentToolsProps } from './components/ai-elements/agent.js';
|
|
65
|
-
export { Artifact, ArtifactAction, ArtifactActionProps, ArtifactActions, ArtifactActionsProps, ArtifactClose, ArtifactCloseProps, ArtifactContent, ArtifactContentProps, ArtifactDescription, ArtifactDescriptionProps, ArtifactHeader, ArtifactHeaderProps, ArtifactProps, ArtifactTitle, ArtifactTitleProps } from './components/ai-elements/artifact.js';
|
|
66
|
-
export { Attachment, AttachmentData, AttachmentEmpty, AttachmentEmptyProps, AttachmentHoverCard, AttachmentHoverCardContent, AttachmentHoverCardContentProps, AttachmentHoverCardProps, AttachmentHoverCardTrigger, AttachmentHoverCardTriggerProps, AttachmentInfo, AttachmentInfoProps, AttachmentMediaCategory, AttachmentPreview, AttachmentPreviewProps, AttachmentProps, AttachmentRemove, AttachmentRemoveProps, AttachmentVariant, Attachments, AttachmentsProps, getAttachmentLabel, getMediaCategory, useAttachmentContext, useAttachmentsContext } from './components/ai-elements/attachments.js';
|
|
67
|
-
export { AudioPlayer, AudioPlayerControlBar, AudioPlayerControlBarProps, AudioPlayerDurationDisplay, AudioPlayerDurationDisplayProps, AudioPlayerElement, AudioPlayerElementProps, AudioPlayerMuteButton, AudioPlayerMuteButtonProps, AudioPlayerPlayButton, AudioPlayerPlayButtonProps, AudioPlayerProps, AudioPlayerSeekBackwardButton, AudioPlayerSeekBackwardButtonProps, AudioPlayerSeekForwardButton, AudioPlayerSeekForwardButtonProps, AudioPlayerTimeDisplay, AudioPlayerTimeDisplayProps, AudioPlayerTimeRange, AudioPlayerTimeRangeProps, AudioPlayerVolumeRange, AudioPlayerVolumeRangeProps } from './components/ai-elements/audio-player.js';
|
|
68
|
-
export { Canvas } from './components/ai-elements/canvas.js';
|
|
69
|
-
export { ChainOfThought, ChainOfThoughtContent, ChainOfThoughtContentProps, ChainOfThoughtHeader, ChainOfThoughtHeaderProps, ChainOfThoughtImage, ChainOfThoughtImageProps, ChainOfThoughtProps, ChainOfThoughtSearchResult, ChainOfThoughtSearchResultProps, ChainOfThoughtSearchResults, ChainOfThoughtSearchResultsProps, ChainOfThoughtStep, ChainOfThoughtStepProps } from './components/ai-elements/chain-of-thought.js';
|
|
70
|
-
export { Checkpoint, CheckpointIcon, CheckpointIconProps, CheckpointProps, CheckpointTrigger, CheckpointTriggerProps } from './components/ai-elements/checkpoint.js';
|
|
71
|
-
export { CodeBlock, CodeBlockActions, CodeBlockContainer, CodeBlockContent, CodeBlockCopyButton, CodeBlockCopyButtonProps, CodeBlockFilename, CodeBlockHeader, CodeBlockLanguageSelector, CodeBlockLanguageSelectorContent, CodeBlockLanguageSelectorContentProps, CodeBlockLanguageSelectorItem, CodeBlockLanguageSelectorItemProps, CodeBlockLanguageSelectorProps, CodeBlockLanguageSelectorTrigger, CodeBlockLanguageSelectorTriggerProps, CodeBlockLanguageSelectorValue, CodeBlockLanguageSelectorValueProps, CodeBlockTitle, highlightCode } from './components/ai-elements/code-block.js';
|
|
72
|
-
export { Commit, CommitActions, CommitActionsProps, CommitAuthor, CommitAuthorAvatar, CommitAuthorAvatarProps, CommitAuthorProps, CommitContent, CommitContentProps, CommitCopyButton, CommitCopyButtonProps, CommitFile, CommitFileAdditions, CommitFileAdditionsProps, CommitFileChanges, CommitFileChangesProps, CommitFileDeletions, CommitFileDeletionsProps, CommitFileIcon, CommitFileIconProps, CommitFileInfo, CommitFileInfoProps, CommitFilePath, CommitFilePathProps, CommitFileProps, CommitFileStatus, CommitFileStatusProps, CommitFiles, CommitFilesProps, CommitHash, CommitHashProps, CommitHeader, CommitHeaderProps, CommitInfo, CommitInfoProps, CommitMessage, CommitMessageProps, CommitMetadata, CommitMetadataProps, CommitProps, CommitSeparator, CommitSeparatorProps, CommitTimestamp, CommitTimestampProps } from './components/ai-elements/commit.js';
|
|
73
|
-
export { Confirmation, ConfirmationAccepted, ConfirmationAcceptedProps, ConfirmationAction, ConfirmationActionProps, ConfirmationActions, ConfirmationActionsProps, ConfirmationProps, ConfirmationRejected, ConfirmationRejectedProps, ConfirmationRequest, ConfirmationRequestProps, ConfirmationTitle, ConfirmationTitleProps } from './components/ai-elements/confirmation.js';
|
|
74
|
-
export { Connection } from './components/ai-elements/connection.js';
|
|
75
|
-
export { Context, ContextCacheUsage, ContextCacheUsageProps, ContextContent, ContextContentBody, ContextContentBodyProps, ContextContentFooter, ContextContentFooterProps, ContextContentHeader, ContextContentHeaderProps, ContextContentProps, ContextInputUsage, ContextInputUsageProps, ContextOutputUsage, ContextOutputUsageProps, ContextProps, ContextReasoningUsage, ContextReasoningUsageProps, ContextTrigger, ContextTriggerProps } from './components/ai-elements/context.js';
|
|
76
|
-
export { Controls, ControlsProps } from './components/ai-elements/controls.js';
|
|
77
|
-
export { Conversation, ConversationContent, ConversationContentProps, ConversationDownload, ConversationDownloadProps, ConversationEmptyState, ConversationEmptyStateProps, ConversationMessage, ConversationProps, ConversationScrollButton, ConversationScrollButtonProps, messagesToMarkdown } from './components/ai-elements/conversation.js';
|
|
78
|
-
export { Edge } from './components/ai-elements/edge.js';
|
|
79
|
-
export { EnvironmentVariable, EnvironmentVariableCopyButton, EnvironmentVariableCopyButtonProps, EnvironmentVariableGroup, EnvironmentVariableGroupProps, EnvironmentVariableName, EnvironmentVariableNameProps, EnvironmentVariableProps, EnvironmentVariableRequired, EnvironmentVariableRequiredProps, EnvironmentVariableValue, EnvironmentVariableValueProps, EnvironmentVariables, EnvironmentVariablesContent, EnvironmentVariablesContentProps, EnvironmentVariablesHeader, EnvironmentVariablesHeaderProps, EnvironmentVariablesProps, EnvironmentVariablesTitle, EnvironmentVariablesTitleProps, EnvironmentVariablesToggle, EnvironmentVariablesToggleProps } from './components/ai-elements/environment-variables.js';
|
|
80
|
-
export { FileTree, FileTreeActions, FileTreeActionsProps, FileTreeFile, FileTreeFileProps, FileTreeFolder, FileTreeFolderProps, FileTreeIcon, FileTreeIconProps, FileTreeName, FileTreeNameProps, FileTreeProps } from './components/ai-elements/file-tree.js';
|
|
81
|
-
export { Image, ImageProps } from './components/ai-elements/image.js';
|
|
82
|
-
export { InlineCitation, InlineCitationCard, InlineCitationCardBody, InlineCitationCardBodyProps, InlineCitationCardProps, InlineCitationCardTrigger, InlineCitationCardTriggerProps, InlineCitationCarousel, InlineCitationCarouselContent, InlineCitationCarouselContentProps, InlineCitationCarouselHeader, InlineCitationCarouselHeaderProps, InlineCitationCarouselIndex, InlineCitationCarouselIndexProps, InlineCitationCarouselItem, InlineCitationCarouselItemProps, InlineCitationCarouselNext, InlineCitationCarouselNextProps, InlineCitationCarouselPrev, InlineCitationCarouselPrevProps, InlineCitationCarouselProps, InlineCitationProps, InlineCitationQuote, InlineCitationQuoteProps, InlineCitationSource, InlineCitationSourceProps, InlineCitationText, InlineCitationTextProps } from './components/ai-elements/inline-citation.js';
|
|
83
|
-
export { JSXPreview, JSXPreviewContent, JSXPreviewContentProps, JSXPreviewError, JSXPreviewErrorProps, JSXPreviewProps, useJSXPreview } from './components/ai-elements/jsx-preview.js';
|
|
84
|
-
export { Message, MessageAction, MessageActionProps, MessageActions, MessageActionsProps, MessageBranch, MessageBranchContent, MessageBranchContentProps, MessageBranchNext, MessageBranchNextProps, MessageBranchPage, MessageBranchPageProps, MessageBranchPrevious, MessageBranchPreviousProps, MessageBranchProps, MessageBranchSelector, MessageBranchSelectorProps, MessageContent, MessageContentProps, MessageProps, MessageResponse, MessageResponseProps, MessageToolbar, MessageToolbarProps } from './components/ai-elements/message.js';
|
|
85
|
-
export { MicSelector, MicSelectorContent, MicSelectorContentProps, MicSelectorEmpty, MicSelectorEmptyProps, MicSelectorInput, MicSelectorInputProps, MicSelectorItem, MicSelectorItemProps, MicSelectorLabel, MicSelectorLabelProps, MicSelectorList, MicSelectorListProps, MicSelectorProps, MicSelectorTrigger, MicSelectorTriggerProps, MicSelectorValue, MicSelectorValueProps, useAudioDevices } from './components/ai-elements/mic-selector.js';
|
|
86
|
-
export { ModelSelector, ModelSelectorContent, ModelSelectorContentProps, ModelSelectorDialog, ModelSelectorDialogProps, ModelSelectorEmpty, ModelSelectorEmptyProps, ModelSelectorGroup, ModelSelectorGroupProps, ModelSelectorInput, ModelSelectorInputProps, ModelSelectorItem, ModelSelectorItemProps, ModelSelectorList, ModelSelectorListProps, ModelSelectorLogo, ModelSelectorLogoGroup, ModelSelectorLogoGroupProps, ModelSelectorLogoProps, ModelSelectorName, ModelSelectorNameProps, ModelSelectorProps, ModelSelectorSeparator, ModelSelectorSeparatorProps, ModelSelectorShortcut, ModelSelectorShortcutProps, ModelSelectorTrigger, ModelSelectorTriggerProps } from './components/ai-elements/model-selector.js';
|
|
87
|
-
export { Node, NodeAction, NodeActionProps, NodeContent, NodeContentProps, NodeDescription, NodeDescriptionProps, NodeFooter, NodeFooterProps, NodeHeader, NodeHeaderProps, NodeProps, NodeTitle, NodeTitleProps } from './components/ai-elements/node.js';
|
|
88
|
-
export { OpenIn, OpenInChatGPT, OpenInChatGPTProps, OpenInClaude, OpenInClaudeProps, OpenInContent, OpenInContentProps, OpenInCursor, OpenInCursorProps, OpenInItem, OpenInItemProps, OpenInLabel, OpenInLabelProps, OpenInProps, OpenInScira, OpenInSciraProps, OpenInSeparator, OpenInSeparatorProps, OpenInT3, OpenInT3Props, OpenInTrigger, OpenInTriggerProps, OpenInv0, OpenInv0Props } from './components/ai-elements/open-in-chat.js';
|
|
89
|
-
export { PackageInfo, PackageInfoChangeType, PackageInfoChangeTypeProps, PackageInfoContent, PackageInfoContentProps, PackageInfoDependencies, PackageInfoDependenciesProps, PackageInfoDependency, PackageInfoDependencyProps, PackageInfoDescription, PackageInfoDescriptionProps, PackageInfoHeader, PackageInfoHeaderProps, PackageInfoName, PackageInfoNameProps, PackageInfoProps, PackageInfoVersion, PackageInfoVersionProps } from './components/ai-elements/package-info.js';
|
|
90
|
-
export { Panel } from './components/ai-elements/panel.js';
|
|
91
|
-
export { Persona, PersonaState } from './components/ai-elements/persona.js';
|
|
92
|
-
export { Plan, PlanAction, PlanActionProps, PlanContent, PlanContentProps, PlanDescription, PlanDescriptionProps, PlanFooter, PlanFooterProps, PlanHeader, PlanHeaderProps, PlanProps, PlanTitle, PlanTitleProps, PlanTrigger, PlanTriggerProps } from './components/ai-elements/plan.js';
|
|
93
|
-
export { AttachmentsContext, LocalAttachmentsContext, LocalReferencedSourcesContext, PromptInputActionAddAttachments, PromptInputActionAddAttachmentsProps, PromptInputControllerProps, PromptInputProvider, PromptInputProviderProps, ReferencedSourcesContext, TextInputContext, useOptionalPromptInputController, usePromptInputAttachments, usePromptInputController, usePromptInputReferencedSources, useProviderAttachments } from './components/ai-elements/prompt-input-context.js';
|
|
94
|
-
export { PromptInputActionMenu, PromptInputActionMenuContent, PromptInputActionMenuContentProps, PromptInputActionMenuItem, PromptInputActionMenuItemProps, PromptInputActionMenuProps, PromptInputActionMenuTrigger, PromptInputActionMenuTriggerProps, PromptInputBody, PromptInputBodyProps, PromptInputButton, PromptInputButtonProps, PromptInputButtonTooltip, PromptInputCommand, PromptInputCommandEmpty, PromptInputCommandEmptyProps, PromptInputCommandGroup, PromptInputCommandGroupProps, PromptInputCommandInput, PromptInputCommandInputProps, PromptInputCommandItem, PromptInputCommandItemProps, PromptInputCommandList, PromptInputCommandListProps, PromptInputCommandProps, PromptInputCommandSeparator, PromptInputCommandSeparatorProps, PromptInputFooter, PromptInputFooterProps, PromptInputHeader, PromptInputHeaderProps, PromptInputHoverCard, PromptInputHoverCardContent, PromptInputHoverCardContentProps, PromptInputHoverCardProps, PromptInputHoverCardTrigger, PromptInputHoverCardTriggerProps, PromptInputSelect, PromptInputSelectContent, PromptInputSelectContentProps, PromptInputSelectItem, PromptInputSelectItemProps, PromptInputSelectProps, PromptInputSelectTrigger, PromptInputSelectTriggerProps, PromptInputSelectValue, PromptInputSelectValueProps, PromptInputSubmit, PromptInputSubmitProps, PromptInputTab, PromptInputTabBody, PromptInputTabBodyProps, PromptInputTabItem, PromptInputTabItemProps, PromptInputTabLabel, PromptInputTabLabelProps, PromptInputTabProps, PromptInputTabsList, PromptInputTabsListProps, PromptInputTools, PromptInputToolsProps } from './components/ai-elements/prompt-input-elements.js';
|
|
95
|
-
export { PromptInputTextarea, PromptInputTextareaProps } from './components/ai-elements/prompt-input-textarea.js';
|
|
96
|
-
export { PromptInput, PromptInputMessage, PromptInputProps } from './components/ai-elements/prompt-input.js';
|
|
97
|
-
export { Queue, QueueItem, QueueItemAction, QueueItemActionProps, QueueItemActions, QueueItemActionsProps, QueueItemAttachment, QueueItemAttachmentProps, QueueItemContent, QueueItemContentProps, QueueItemDescription, QueueItemDescriptionProps, QueueItemFile, QueueItemFileProps, QueueItemImage, QueueItemImageProps, QueueItemIndicator, QueueItemIndicatorProps, QueueItemProps, QueueList, QueueListProps, QueueMessage, QueueMessagePart, QueueProps, QueueSection, QueueSectionContent, QueueSectionContentProps, QueueSectionLabel, QueueSectionLabelProps, QueueSectionProps, QueueSectionTrigger, QueueSectionTriggerProps, QueueTodo } from './components/ai-elements/queue.js';
|
|
98
|
-
export { Reasoning, ReasoningContent, ReasoningContentProps, ReasoningProps, ReasoningTrigger, ReasoningTriggerProps, useReasoning } from './components/ai-elements/reasoning.js';
|
|
99
|
-
export { Sandbox, SandboxContent, SandboxContentProps, SandboxHeader, SandboxHeaderProps, SandboxRootProps, SandboxTabContent, SandboxTabContentProps, SandboxTabs, SandboxTabsBar, SandboxTabsBarProps, SandboxTabsList, SandboxTabsListProps, SandboxTabsProps, SandboxTabsTrigger, SandboxTabsTriggerProps } from './components/ai-elements/sandbox.js';
|
|
100
|
-
export { SchemaDisplay, SchemaDisplayBody, SchemaDisplayBodyProps, SchemaDisplayContent, SchemaDisplayContentProps, SchemaDisplayDescription, SchemaDisplayDescriptionProps, SchemaDisplayExample, SchemaDisplayExampleProps, SchemaDisplayHeader, SchemaDisplayHeaderProps, SchemaDisplayMethod, SchemaDisplayMethodProps, SchemaDisplayParameter, SchemaDisplayParameterProps, SchemaDisplayParameters, SchemaDisplayParametersProps, SchemaDisplayPath, SchemaDisplayPathProps, SchemaDisplayProperty, SchemaDisplayPropertyProps, SchemaDisplayProps, SchemaDisplayRequest, SchemaDisplayRequestProps, SchemaDisplayResponse, SchemaDisplayResponseProps } from './components/ai-elements/schema-display.js';
|
|
101
|
-
export { Shimmer, TextShimmerProps } from './components/ai-elements/shimmer.js';
|
|
102
|
-
export { Snippet, SnippetAddon, SnippetAddonProps, SnippetCopyButton, SnippetCopyButtonProps, SnippetInput, SnippetInputProps, SnippetProps, SnippetText, SnippetTextProps } from './components/ai-elements/snippet.js';
|
|
103
|
-
export { Source, SourceProps, Sources, SourcesContent, SourcesContentProps, SourcesProps, SourcesTrigger, SourcesTriggerProps } from './components/ai-elements/sources.js';
|
|
104
|
-
export { SpeechInput, SpeechInputProps } from './components/ai-elements/speech-input.js';
|
|
105
|
-
export { StackTrace, StackTraceActions, StackTraceActionsProps, StackTraceContent, StackTraceContentProps, StackTraceCopyButton, StackTraceCopyButtonProps, StackTraceError, StackTraceErrorMessage, StackTraceErrorMessageProps, StackTraceErrorProps, StackTraceErrorType, StackTraceErrorTypeProps, StackTraceExpandButton, StackTraceExpandButtonProps, StackTraceFrames, StackTraceFramesProps, StackTraceHeader, StackTraceHeaderProps, StackTraceProps } from './components/ai-elements/stack-trace.js';
|
|
106
|
-
export { Suggestion, SuggestionProps, Suggestions, SuggestionsProps } from './components/ai-elements/suggestion.js';
|
|
107
|
-
export { Task, TaskContent, TaskContentProps, TaskItem, TaskItemFile, TaskItemFileProps, TaskItemProps, TaskProps, TaskTrigger, TaskTriggerProps } from './components/ai-elements/task.js';
|
|
108
|
-
export { Terminal, TerminalActions, TerminalActionsProps, TerminalClearButton, TerminalClearButtonProps, TerminalContent, TerminalContentProps, TerminalCopyButton, TerminalCopyButtonProps, TerminalHeader, TerminalHeaderProps, TerminalProps, TerminalStatus, TerminalStatusProps, TerminalTitle, TerminalTitleProps } from './components/ai-elements/terminal.js';
|
|
109
|
-
export { Test, TestDuration, TestDurationProps, TestError, TestErrorMessage, TestErrorMessageProps, TestErrorProps, TestErrorStack, TestErrorStackProps, TestName, TestNameProps, TestProps, TestResults, TestResultsContent, TestResultsContentProps, TestResultsDuration, TestResultsDurationProps, TestResultsHeader, TestResultsHeaderProps, TestResultsProgress, TestResultsProgressProps, TestResultsProps, TestResultsSummary, TestResultsSummaryProps, TestStatus, TestStatusProps, TestSuite, TestSuiteContent, TestSuiteContentProps, TestSuiteName, TestSuiteNameProps, TestSuiteProps, TestSuiteStats, TestSuiteStatsProps } from './components/ai-elements/test-results.js';
|
|
110
|
-
export { Tool, ToolContent, ToolContentProps, ToolHeader, ToolHeaderProps, ToolInput, ToolInputProps, ToolOutput, ToolOutputProps, ToolPart, ToolProps, getStatusBadge } from './components/ai-elements/tool.js';
|
|
111
|
-
export { Toolbar } from './components/ai-elements/toolbar.js';
|
|
112
|
-
export { Transcription, TranscriptionProps, TranscriptionSegment, TranscriptionSegmentProps } from './components/ai-elements/transcription.js';
|
|
113
|
-
export { VoiceSelectorAccent, VoiceSelectorAccentProps, VoiceSelectorAccentValue } from './components/ai-elements/voice-selector-accent.js';
|
|
114
|
-
export { VoiceSelector, VoiceSelectorAge, VoiceSelectorAgeProps, VoiceSelectorAttributes, VoiceSelectorAttributesProps, VoiceSelectorBullet, VoiceSelectorBulletProps, VoiceSelectorContent, VoiceSelectorContentProps, VoiceSelectorDescription, VoiceSelectorDescriptionProps, VoiceSelectorDialog, VoiceSelectorDialogProps, VoiceSelectorEmpty, VoiceSelectorEmptyProps, VoiceSelectorGender, VoiceSelectorGenderProps, VoiceSelectorGroup, VoiceSelectorGroupProps, VoiceSelectorInput, VoiceSelectorInputProps, VoiceSelectorItem, VoiceSelectorItemProps, VoiceSelectorList, VoiceSelectorListProps, VoiceSelectorName, VoiceSelectorNameProps, VoiceSelectorPreview, VoiceSelectorPreviewProps, VoiceSelectorProps, VoiceSelectorSeparator, VoiceSelectorSeparatorProps, VoiceSelectorShortcut, VoiceSelectorShortcutProps, VoiceSelectorTrigger, VoiceSelectorTriggerProps, useVoiceSelector } from './components/ai-elements/voice-selector.js';
|
|
115
|
-
export { WebPreview, WebPreviewBody, WebPreviewBodyProps, WebPreviewConsole, WebPreviewConsoleProps, WebPreviewContextValue, WebPreviewNavigation, WebPreviewNavigationButton, WebPreviewNavigationButtonProps, WebPreviewNavigationProps, WebPreviewProps, WebPreviewUrl, WebPreviewUrlProps } from './components/ai-elements/web-preview.js';
|
|
116
64
|
export { Tone, toneColor, toneDot, toneLabel, tonePill } from './components/dashboard/tone.js';
|
|
117
65
|
export { Gap, gapClass } from './components/dashboard/spacing.js';
|
|
118
66
|
export { Divider, DividerProps, Grid, GridProps, Inline, InlineProps, Section, SectionProps, Stack, StackProps, WidgetContent, WidgetContentProps } from './components/dashboard/layout.js';
|
|
@@ -129,9 +77,8 @@ export { EmptyState, EmptyStateProps } from './components/dashboard/empty-state.
|
|
|
129
77
|
export { ActivitySkeleton, ListSkeleton, MetricSkeleton, SkeletonPatternProps } from './components/dashboard/skeletons.js';
|
|
130
78
|
export { IconButton, IconButtonProps } from './components/dashboard/icon-button.js';
|
|
131
79
|
export { DashboardComponentCatalogEntry } from './components/dashboard/catalog.js';
|
|
132
|
-
export {
|
|
133
|
-
export {
|
|
134
|
-
export { ThinkingLevelPicker } from './components/model-selection/thinking-level-picker.js';
|
|
80
|
+
export { PluginStyleScope, PluginStyleScopeProps } from './plugin-style-scope.js';
|
|
81
|
+
export { usePluginPortalContainer } from './plugin-style-scope-context.js';
|
|
135
82
|
import 'clsx';
|
|
136
83
|
import 'react/jsx-runtime';
|
|
137
84
|
import 'react';
|
|
@@ -149,13 +96,3 @@ import 'input-otp';
|
|
|
149
96
|
import 'react-resizable-panels';
|
|
150
97
|
import 'sonner';
|
|
151
98
|
import '@headless-tree/core';
|
|
152
|
-
import 'ai';
|
|
153
|
-
import 'lucide-react';
|
|
154
|
-
import 'media-chrome/react';
|
|
155
|
-
import '@xyflow/react';
|
|
156
|
-
import 'shiki';
|
|
157
|
-
import 'use-stick-to-bottom';
|
|
158
|
-
import 'react-jsx-parser';
|
|
159
|
-
import 'streamdown';
|
|
160
|
-
import '@rive-app/react-webgl2';
|
|
161
|
-
import '@sero-ai/common';
|
package/dist/index.js
CHANGED
|
@@ -60,63 +60,12 @@ export * from "./components/ui/toggle-group";
|
|
|
60
60
|
export * from "./components/ui/toggle";
|
|
61
61
|
export * from "./components/ui/tooltip";
|
|
62
62
|
export * from "./components/ui/tree";
|
|
63
|
-
export * from "./components/ai-elements/agent";
|
|
64
|
-
export * from "./components/ai-elements/artifact";
|
|
65
|
-
export * from "./components/ai-elements/attachments";
|
|
66
|
-
export * from "./components/ai-elements/audio-player";
|
|
67
|
-
export * from "./components/ai-elements/canvas";
|
|
68
|
-
export * from "./components/ai-elements/chain-of-thought";
|
|
69
|
-
export * from "./components/ai-elements/checkpoint";
|
|
70
|
-
export * from "./components/ai-elements/code-block";
|
|
71
|
-
export * from "./components/ai-elements/commit";
|
|
72
|
-
export * from "./components/ai-elements/confirmation";
|
|
73
|
-
export * from "./components/ai-elements/connection";
|
|
74
|
-
export * from "./components/ai-elements/context";
|
|
75
|
-
export * from "./components/ai-elements/controls";
|
|
76
|
-
export * from "./components/ai-elements/conversation";
|
|
77
|
-
export * from "./components/ai-elements/edge";
|
|
78
|
-
export * from "./components/ai-elements/environment-variables";
|
|
79
|
-
export * from "./components/ai-elements/file-tree";
|
|
80
|
-
export * from "./components/ai-elements/image";
|
|
81
|
-
export * from "./components/ai-elements/inline-citation";
|
|
82
|
-
export * from "./components/ai-elements/jsx-preview";
|
|
83
|
-
export * from "./components/ai-elements/message";
|
|
84
|
-
export * from "./components/ai-elements/mic-selector";
|
|
85
|
-
export * from "./components/ai-elements/model-selector";
|
|
86
|
-
export * from "./components/ai-elements/node";
|
|
87
|
-
export * from "./components/ai-elements/open-in-chat";
|
|
88
|
-
export * from "./components/ai-elements/package-info";
|
|
89
|
-
export * from "./components/ai-elements/panel";
|
|
90
|
-
export * from "./components/ai-elements/persona";
|
|
91
|
-
export * from "./components/ai-elements/plan";
|
|
92
|
-
export * from "./components/ai-elements/prompt-input-context";
|
|
93
|
-
export * from "./components/ai-elements/prompt-input-elements";
|
|
94
|
-
export * from "./components/ai-elements/prompt-input-textarea";
|
|
95
|
-
export * from "./components/ai-elements/prompt-input";
|
|
96
|
-
export * from "./components/ai-elements/queue";
|
|
97
|
-
export * from "./components/ai-elements/reasoning";
|
|
98
|
-
export * from "./components/ai-elements/sandbox";
|
|
99
|
-
export * from "./components/ai-elements/schema-display";
|
|
100
|
-
export * from "./components/ai-elements/shimmer";
|
|
101
|
-
export * from "./components/ai-elements/snippet";
|
|
102
|
-
export * from "./components/ai-elements/sources";
|
|
103
|
-
export * from "./components/ai-elements/speech-input";
|
|
104
|
-
export * from "./components/ai-elements/stack-trace";
|
|
105
|
-
export * from "./components/ai-elements/suggestion";
|
|
106
|
-
export * from "./components/ai-elements/task";
|
|
107
|
-
export * from "./components/ai-elements/terminal";
|
|
108
|
-
export * from "./components/ai-elements/test-results";
|
|
109
|
-
export * from "./components/ai-elements/tool";
|
|
110
|
-
export * from "./components/ai-elements/toolbar";
|
|
111
|
-
export * from "./components/ai-elements/transcription";
|
|
112
|
-
export * from "./components/ai-elements/voice-selector-accent";
|
|
113
|
-
export * from "./components/ai-elements/voice-selector";
|
|
114
|
-
export * from "./components/ai-elements/web-preview";
|
|
115
63
|
export * from "./components/dashboard";
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
export * from "./components/model-selection/thinking-level-picker";
|
|
64
|
+
import { PluginStyleScope } from "./plugin-style-scope";
|
|
65
|
+
import { usePluginPortalContainer } from "./plugin-style-scope-context";
|
|
119
66
|
export {
|
|
67
|
+
PluginStyleScope,
|
|
120
68
|
cn,
|
|
121
|
-
useIsMobile
|
|
69
|
+
useIsMobile,
|
|
70
|
+
usePluginPortalContainer
|
|
122
71
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _react = require('react');
|
|
2
|
+
const PluginStyleScopeContext = _nullishCoalesce(globalThis.__sero_plugin_style_scope_context__, () => ( _react.createContext.call(void 0, null)));
|
|
3
|
+
globalThis.__sero_plugin_style_scope_context__ = PluginStyleScopeContext;
|
|
4
|
+
function usePluginPortalContainer() {
|
|
5
|
+
return _nullishCoalesce(_optionalChain([_react.useContext.call(void 0, PluginStyleScopeContext), 'optionalAccess', _ => _.portalContainer]), () => ( void 0));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.PluginStyleScopeContext = PluginStyleScopeContext; exports.usePluginPortalContainer = usePluginPortalContainer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PluginStyleScopeValue {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
portalContainer: HTMLDivElement | null;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
var __sero_plugin_style_scope_context__: Context<PluginStyleScopeValue | null> | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare const PluginStyleScopeContext: Context<PluginStyleScopeValue | null>;
|
|
11
|
+
declare function usePluginPortalContainer(): HTMLElement | undefined;
|
|
12
|
+
|
|
13
|
+
export { PluginStyleScopeContext, type PluginStyleScopeValue, usePluginPortalContainer };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Context } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PluginStyleScopeValue {
|
|
4
|
+
pluginId: string;
|
|
5
|
+
portalContainer: HTMLDivElement | null;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
var __sero_plugin_style_scope_context__: Context<PluginStyleScopeValue | null> | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare const PluginStyleScopeContext: Context<PluginStyleScopeValue | null>;
|
|
11
|
+
declare function usePluginPortalContainer(): HTMLElement | undefined;
|
|
12
|
+
|
|
13
|
+
export { PluginStyleScopeContext, type PluginStyleScopeValue, usePluginPortalContainer };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
const PluginStyleScopeContext = globalThis.__sero_plugin_style_scope_context__ ?? createContext(null);
|
|
3
|
+
globalThis.__sero_plugin_style_scope_context__ = PluginStyleScopeContext;
|
|
4
|
+
function usePluginPortalContainer() {
|
|
5
|
+
return useContext(PluginStyleScopeContext)?.portalContainer ?? void 0;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
PluginStyleScopeContext,
|
|
9
|
+
usePluginPortalContainer
|
|
10
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _jsxruntime = require('react/jsx-runtime');
|
|
2
|
+
var _react = require('react');
|
|
3
|
+
var _pluginstylescopecontext = require('./plugin-style-scope-context');
|
|
4
|
+
function PluginStyleScope({ children, pluginId, surfaceId }) {
|
|
5
|
+
const portalContainer = _react.useMemo.call(void 0, () => {
|
|
6
|
+
if (typeof document === "undefined") return null;
|
|
7
|
+
const container = document.createElement("div");
|
|
8
|
+
container.dataset.seroPlugin = pluginId;
|
|
9
|
+
container.dataset.seroPluginPortals = surfaceId;
|
|
10
|
+
return container;
|
|
11
|
+
}, [pluginId, surfaceId]);
|
|
12
|
+
_react.useInsertionEffect.call(void 0, () => {
|
|
13
|
+
if (!portalContainer) return void 0;
|
|
14
|
+
document.body.append(portalContainer);
|
|
15
|
+
return () => portalContainer.remove();
|
|
16
|
+
}, [portalContainer]);
|
|
17
|
+
const value = _react.useMemo.call(void 0,
|
|
18
|
+
() => ({ pluginId, portalContainer }),
|
|
19
|
+
[pluginId, portalContainer]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _pluginstylescopecontext.PluginStyleScopeContext.Provider, { value, children });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.PluginStyleScope = PluginStyleScope;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PluginStyleScopeProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
pluginId: string;
|
|
7
|
+
surfaceId: string;
|
|
8
|
+
}
|
|
9
|
+
declare function PluginStyleScope({ children, pluginId, surfaceId }: PluginStyleScopeProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { PluginStyleScope, type PluginStyleScopeProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface PluginStyleScopeProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
pluginId: string;
|
|
7
|
+
surfaceId: string;
|
|
8
|
+
}
|
|
9
|
+
declare function PluginStyleScope({ children, pluginId, surfaceId }: PluginStyleScopeProps): react_jsx_runtime.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { PluginStyleScope, type PluginStyleScopeProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useInsertionEffect, useMemo } from "react";
|
|
3
|
+
import { PluginStyleScopeContext } from "./plugin-style-scope-context";
|
|
4
|
+
function PluginStyleScope({ children, pluginId, surfaceId }) {
|
|
5
|
+
const portalContainer = useMemo(() => {
|
|
6
|
+
if (typeof document === "undefined") return null;
|
|
7
|
+
const container = document.createElement("div");
|
|
8
|
+
container.dataset.seroPlugin = pluginId;
|
|
9
|
+
container.dataset.seroPluginPortals = surfaceId;
|
|
10
|
+
return container;
|
|
11
|
+
}, [pluginId, surfaceId]);
|
|
12
|
+
useInsertionEffect(() => {
|
|
13
|
+
if (!portalContainer) return void 0;
|
|
14
|
+
document.body.append(portalContainer);
|
|
15
|
+
return () => portalContainer.remove();
|
|
16
|
+
}, [portalContainer]);
|
|
17
|
+
const value = useMemo(
|
|
18
|
+
() => ({ pluginId, portalContainer }),
|
|
19
|
+
[pluginId, portalContainer]
|
|
20
|
+
);
|
|
21
|
+
return /* @__PURE__ */ jsx(PluginStyleScopeContext.Provider, { value, children });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
PluginStyleScope
|
|
25
|
+
};
|