@vantageos/mosaic-blocks 0.4.9-alpha → 0.5.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/index.cjs +83 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +83 -2
- package/dist/index.d.ts +83 -2
- package/dist/index.js +84 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.
|
|
23
|
+
declare const version = "0.5.1-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -5383,4 +5383,85 @@ declare namespace MosaicUrlScraper {
|
|
|
5383
5383
|
var displayName: string;
|
|
5384
5384
|
}
|
|
5385
5385
|
|
|
5386
|
-
|
|
5386
|
+
/**
|
|
5387
|
+
* MosaicChatThread — presentational, auto-scrolling chat message stream
|
|
5388
|
+
*
|
|
5389
|
+
* Presentational atom. Renders a scrollable `role="log"` region that keeps
|
|
5390
|
+
* itself pinned to the bottom as new messages arrive — the standard "chat
|
|
5391
|
+
* thread" behaviour — and surfaces a "scroll to bottom" button once the
|
|
5392
|
+
* user has scrolled up away from the latest message. It does NOT render
|
|
5393
|
+
* chat messages itself: the host composes the actual message list via
|
|
5394
|
+
* `children` (developed in parallel as `MosaicChatMessage`). This keeps the
|
|
5395
|
+
* thread free of any dependency on a specific message shape.
|
|
5396
|
+
*
|
|
5397
|
+
* Local behaviour (no network/data involved, pure UI mechanics):
|
|
5398
|
+
* - Tracks "is the user at the bottom" via the native `scroll` event,
|
|
5399
|
+
* comparing `scrollHeight - scrollTop - clientHeight` against a small
|
|
5400
|
+
* pixel threshold (near-bottom counts as "at bottom").
|
|
5401
|
+
* - When `children` changes (a new message was appended) AND the user was
|
|
5402
|
+
* at the bottom, the container is scrolled to `scrollHeight` again —
|
|
5403
|
+
* the "stick to bottom" auto-anchor.
|
|
5404
|
+
* - When the user has scrolled up, new children arriving do NOT force a
|
|
5405
|
+
* scroll — the "scroll to bottom" button appears instead, and clicking
|
|
5406
|
+
* it scrolls back down and re-arms the auto-anchor.
|
|
5407
|
+
*
|
|
5408
|
+
* Pattern: MosaicUrlScraper.tsx (data-slot, inline cn, React 19 ref prop,
|
|
5409
|
+
* displayName, JSDoc, pure variants module). No icon library — uses a
|
|
5410
|
+
* plain "↓" glyph, matching the url-scraper convention (no lucide-react
|
|
5411
|
+
* runtime dependency).
|
|
5412
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
5413
|
+
* Design tokens: --border, --card, --foreground, --accent, --ring.
|
|
5414
|
+
* a11y: root uses `role="log"` (accessible live region for a message
|
|
5415
|
+
* stream) and native scrolling — no focus is trapped or stolen by the
|
|
5416
|
+
* auto-scroll; the "scroll to bottom" button carries a required,
|
|
5417
|
+
* host-supplied `aria-label`.
|
|
5418
|
+
* Bilingual: the only user-facing string, the scroll button's accessible
|
|
5419
|
+
* name, is a required prop (`scrollToBottomLabel`) — zero hardcoded copy,
|
|
5420
|
+
* zero default.
|
|
5421
|
+
*
|
|
5422
|
+
* Ported from any-debate-ai components/chat/conversation.tsx (rewritten
|
|
5423
|
+
* from scratch — no shared code, no license carried over, and no
|
|
5424
|
+
* `use-stick-to-bottom` runtime dependency): dropped the third-party
|
|
5425
|
+
* `StickToBottom` primitive and `ChatConversationContent` split (folded
|
|
5426
|
+
* into a single content wrapper, this library's presentational atoms don't
|
|
5427
|
+
* ship a separate provider/content/button trio when a single component
|
|
5428
|
+
* covers the same behaviour with plain scroll math), kept the scrollable
|
|
5429
|
+
* `role="log"` region + auto-anchor-to-bottom + "scroll to bottom" button
|
|
5430
|
+
* shape.
|
|
5431
|
+
*
|
|
5432
|
+
* @example
|
|
5433
|
+
* <MosaicChatThread scrollToBottomLabel="Revenir au dernier message">
|
|
5434
|
+
* {messages.map((m) => (
|
|
5435
|
+
* <MosaicChatMessage key={m.id} {...m} />
|
|
5436
|
+
* ))}
|
|
5437
|
+
* </MosaicChatThread>
|
|
5438
|
+
*/
|
|
5439
|
+
|
|
5440
|
+
interface MosaicChatThreadProps {
|
|
5441
|
+
/** The host-rendered message list (or any other scrollable content). */
|
|
5442
|
+
children: React.ReactNode;
|
|
5443
|
+
/**
|
|
5444
|
+
* Accessible name for the "scroll to bottom" button, shown only once the
|
|
5445
|
+
* user has scrolled away from the latest message. Required, no default —
|
|
5446
|
+
* this is host copy, not an English fallback.
|
|
5447
|
+
*/
|
|
5448
|
+
scrollToBottomLabel: string;
|
|
5449
|
+
/** Additional Tailwind classes on the root scrollable element. */
|
|
5450
|
+
className?: string;
|
|
5451
|
+
/** React 19 ref prop — forwarded to the root scrollable element. */
|
|
5452
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5453
|
+
}
|
|
5454
|
+
/**
|
|
5455
|
+
* MosaicChatThread — production auto-scrolling chat thread atom for
|
|
5456
|
+
* @vantageos/mosaic-blocks.
|
|
5457
|
+
*
|
|
5458
|
+
* Purely presentational: no data fetching, no message rendering, no
|
|
5459
|
+
* conversation state — the host owns the messages and passes them as
|
|
5460
|
+
* `children`; this component only owns the scroll mechanics.
|
|
5461
|
+
*/
|
|
5462
|
+
declare function MosaicChatThread({ children, scrollToBottomLabel, className, ref, }: MosaicChatThreadProps): React.JSX.Element;
|
|
5463
|
+
declare namespace MosaicChatThread {
|
|
5464
|
+
var displayName: string;
|
|
5465
|
+
}
|
|
5466
|
+
|
|
5467
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicChatThread, type MosaicChatThreadProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTablePagination, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDocumentUpload, type MosaicDocumentUploadFile, type MosaicDocumentUploadFileStatus, type MosaicDocumentUploadProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicKanbanBoard, type MosaicKanbanBoardProps, MosaicKanbanColumn, type MosaicKanbanColumnProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, MosaicMemoryCard, type MosaicMemoryCardProps, type MosaicMemoryData, type MosaicMemoryScope, type MosaicMemorySource, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, type MosaicStep, MosaicStepPipeline, type MosaicStepPipelineDotsProps, type MosaicStepPipelineProps, type MosaicStepPipelineSegmentsProps, type MosaicStepStatus, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, MosaicTooltipContent, type MosaicTooltipContentProps, type MosaicTooltipProps, MosaicTooltipProvider, type MosaicTooltipProviderProps, MosaicTooltipRoot, type MosaicTooltipRootProps, MosaicTooltipTrigger, type MosaicTooltipTriggerProps, MosaicUrlScraper, type MosaicUrlScraperContent, type MosaicUrlScraperProps, type MosaicUrlScraperState, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { Switch } from '@base-ui/react/switch';
|
|
|
20
20
|
export { Tooltip } from '@base-ui/react/tooltip';
|
|
21
21
|
import 'class-variance-authority/types';
|
|
22
22
|
|
|
23
|
-
declare const version = "0.
|
|
23
|
+
declare const version = "0.5.1-alpha";
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Placeholder component — infra scaffold only.
|
|
@@ -5383,4 +5383,85 @@ declare namespace MosaicUrlScraper {
|
|
|
5383
5383
|
var displayName: string;
|
|
5384
5384
|
}
|
|
5385
5385
|
|
|
5386
|
-
|
|
5386
|
+
/**
|
|
5387
|
+
* MosaicChatThread — presentational, auto-scrolling chat message stream
|
|
5388
|
+
*
|
|
5389
|
+
* Presentational atom. Renders a scrollable `role="log"` region that keeps
|
|
5390
|
+
* itself pinned to the bottom as new messages arrive — the standard "chat
|
|
5391
|
+
* thread" behaviour — and surfaces a "scroll to bottom" button once the
|
|
5392
|
+
* user has scrolled up away from the latest message. It does NOT render
|
|
5393
|
+
* chat messages itself: the host composes the actual message list via
|
|
5394
|
+
* `children` (developed in parallel as `MosaicChatMessage`). This keeps the
|
|
5395
|
+
* thread free of any dependency on a specific message shape.
|
|
5396
|
+
*
|
|
5397
|
+
* Local behaviour (no network/data involved, pure UI mechanics):
|
|
5398
|
+
* - Tracks "is the user at the bottom" via the native `scroll` event,
|
|
5399
|
+
* comparing `scrollHeight - scrollTop - clientHeight` against a small
|
|
5400
|
+
* pixel threshold (near-bottom counts as "at bottom").
|
|
5401
|
+
* - When `children` changes (a new message was appended) AND the user was
|
|
5402
|
+
* at the bottom, the container is scrolled to `scrollHeight` again —
|
|
5403
|
+
* the "stick to bottom" auto-anchor.
|
|
5404
|
+
* - When the user has scrolled up, new children arriving do NOT force a
|
|
5405
|
+
* scroll — the "scroll to bottom" button appears instead, and clicking
|
|
5406
|
+
* it scrolls back down and re-arms the auto-anchor.
|
|
5407
|
+
*
|
|
5408
|
+
* Pattern: MosaicUrlScraper.tsx (data-slot, inline cn, React 19 ref prop,
|
|
5409
|
+
* displayName, JSDoc, pure variants module). No icon library — uses a
|
|
5410
|
+
* plain "↓" glyph, matching the url-scraper convention (no lucide-react
|
|
5411
|
+
* runtime dependency).
|
|
5412
|
+
* No "use client" — prepend-use-client.mjs adds it to dist.
|
|
5413
|
+
* Design tokens: --border, --card, --foreground, --accent, --ring.
|
|
5414
|
+
* a11y: root uses `role="log"` (accessible live region for a message
|
|
5415
|
+
* stream) and native scrolling — no focus is trapped or stolen by the
|
|
5416
|
+
* auto-scroll; the "scroll to bottom" button carries a required,
|
|
5417
|
+
* host-supplied `aria-label`.
|
|
5418
|
+
* Bilingual: the only user-facing string, the scroll button's accessible
|
|
5419
|
+
* name, is a required prop (`scrollToBottomLabel`) — zero hardcoded copy,
|
|
5420
|
+
* zero default.
|
|
5421
|
+
*
|
|
5422
|
+
* Ported from any-debate-ai components/chat/conversation.tsx (rewritten
|
|
5423
|
+
* from scratch — no shared code, no license carried over, and no
|
|
5424
|
+
* `use-stick-to-bottom` runtime dependency): dropped the third-party
|
|
5425
|
+
* `StickToBottom` primitive and `ChatConversationContent` split (folded
|
|
5426
|
+
* into a single content wrapper, this library's presentational atoms don't
|
|
5427
|
+
* ship a separate provider/content/button trio when a single component
|
|
5428
|
+
* covers the same behaviour with plain scroll math), kept the scrollable
|
|
5429
|
+
* `role="log"` region + auto-anchor-to-bottom + "scroll to bottom" button
|
|
5430
|
+
* shape.
|
|
5431
|
+
*
|
|
5432
|
+
* @example
|
|
5433
|
+
* <MosaicChatThread scrollToBottomLabel="Revenir au dernier message">
|
|
5434
|
+
* {messages.map((m) => (
|
|
5435
|
+
* <MosaicChatMessage key={m.id} {...m} />
|
|
5436
|
+
* ))}
|
|
5437
|
+
* </MosaicChatThread>
|
|
5438
|
+
*/
|
|
5439
|
+
|
|
5440
|
+
interface MosaicChatThreadProps {
|
|
5441
|
+
/** The host-rendered message list (or any other scrollable content). */
|
|
5442
|
+
children: React.ReactNode;
|
|
5443
|
+
/**
|
|
5444
|
+
* Accessible name for the "scroll to bottom" button, shown only once the
|
|
5445
|
+
* user has scrolled away from the latest message. Required, no default —
|
|
5446
|
+
* this is host copy, not an English fallback.
|
|
5447
|
+
*/
|
|
5448
|
+
scrollToBottomLabel: string;
|
|
5449
|
+
/** Additional Tailwind classes on the root scrollable element. */
|
|
5450
|
+
className?: string;
|
|
5451
|
+
/** React 19 ref prop — forwarded to the root scrollable element. */
|
|
5452
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
5453
|
+
}
|
|
5454
|
+
/**
|
|
5455
|
+
* MosaicChatThread — production auto-scrolling chat thread atom for
|
|
5456
|
+
* @vantageos/mosaic-blocks.
|
|
5457
|
+
*
|
|
5458
|
+
* Purely presentational: no data fetching, no message rendering, no
|
|
5459
|
+
* conversation state — the host owns the messages and passes them as
|
|
5460
|
+
* `children`; this component only owns the scroll mechanics.
|
|
5461
|
+
*/
|
|
5462
|
+
declare function MosaicChatThread({ children, scrollToBottomLabel, className, ref, }: MosaicChatThreadProps): React.JSX.Element;
|
|
5463
|
+
declare namespace MosaicChatThread {
|
|
5464
|
+
var displayName: string;
|
|
5465
|
+
}
|
|
5466
|
+
|
|
5467
|
+
export { type Breakpoint, type DeviceContextValue, type Feature3ColItem, type FeatureItem, type FooterColumn, type FooterLink, type HeroCta, type LogoItem, MosaicAccordion, MosaicAccordionItem, type MosaicAccordionItemProps, MosaicAccordionPanel, type MosaicAccordionPanelProps, type MosaicAccordionProps, MosaicAccordionTrigger, type MosaicAccordionTriggerProps, type MosaicActionAccent, type MosaicActivity, MosaicActivityFeed, type MosaicActivityFeedProps, MosaicActivityItem, type MosaicActivityItemProps, type MosaicActivityStatus, MosaicAdaptiveGrid, type MosaicAdaptiveGridProps, MosaicAdaptiveModal, type MosaicAdaptiveModalProps, MosaicAdaptiveNavigation, type MosaicAdaptiveNavigationProps, MosaicAgentCard, type MosaicAgentCardProps, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, type MosaicAgentComposerMobileProps, type MosaicAgentComposerProps, type MosaicAgentData, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, type MosaicAgentListProps, type MosaicAgentPreset, MosaicAgentTeamPreview, type MosaicAgentTeamPreviewProps, MosaicAnimatedList, type MosaicAnimatedListProps, MosaicAppSidebar, type MosaicAppSidebarProps, MosaicAvatar, type MosaicAvatarProps, MosaicBadge, type MosaicBadgeProps, MosaicBlurredOrb, type MosaicBlurredOrbProps, type MosaicBreadcrumb, MosaicButton, type MosaicButtonProps, MosaicCard, MosaicCardContent, type MosaicCardContentProps, MosaicCardDescription, type MosaicCardDescriptionProps, MosaicCardFooter, type MosaicCardFooterProps, MosaicCardHeader, type MosaicCardHeaderProps, type MosaicCardProps, MosaicCardTitle, type MosaicCardTitleProps, MosaicChatThread, type MosaicChatThreadProps, MosaicCheckbox, type MosaicCheckboxProps, type MosaicClerkMembership, MosaicClerkOrgSwitcher, type MosaicClerkOrgSwitcherProps, type MosaicClerkOrganization, MosaicClerkWebhookHandler, type MosaicClerkWebhookHandlerOptions, MosaicCollapsible, MosaicCollapsiblePanel, type MosaicCollapsiblePanelProps, type MosaicCollapsibleProps, MosaicCollapsibleTrigger, type MosaicCollapsibleTriggerProps, MosaicCombobox, type MosaicComboboxItem, type MosaicComboboxProps, type MosaicComposerModel, type MosaicComposerModule, MosaicCounter, type MosaicCounterProps, MosaicCreateOrgDialog, type MosaicCreateOrgDialogProps, MosaicDashboardContent, type MosaicDashboardContentProps, MosaicDashboardHeader, type MosaicDashboardHeaderProps, MosaicDashboardLayout, type MosaicDashboardLayoutProps, type MosaicDashboardView, MosaicDataTable, type MosaicDataTableColumn, type MosaicDataTablePagination, type MosaicDataTableProps, MosaicDeleteConfirmationDialog, type MosaicDeleteConfirmationDialogProps, MosaicDeviceProvider, type MosaicDeviceProviderProps, MosaicDocumentUpload, type MosaicDocumentUploadFile, type MosaicDocumentUploadFileStatus, type MosaicDocumentUploadProps, MosaicDropdownMenu, type MosaicDropdownMenuItem, type MosaicDropdownMenuProps, MosaicEmptyState, type MosaicEmptyStateProps, MosaicFallingPattern, type MosaicFallingPatternProps, MosaicFeature3Col, type MosaicFeature3ColProps, MosaicFeatureCenteredMedia, type MosaicFeatureCenteredMediaProps, MosaicField, MosaicFieldControl, type MosaicFieldControlProps, MosaicFieldDescription, type MosaicFieldDescriptionProps, MosaicFieldError, type MosaicFieldErrorProps, MosaicFieldLabel, type MosaicFieldLabelProps, type MosaicFieldProps, MosaicFilterBar, type MosaicFilterBarProps, type MosaicFilterOption, MosaicFilterSidebar, type MosaicFilterSidebarProps, MosaicFooterSimple, type MosaicFooterSimpleProps, MosaicHeroSplit, type MosaicHeroSplitProps, MosaicInput, MosaicInputGroup, type MosaicInputGroupProps, type MosaicInputProps, MosaicIntegrationsBadge, type MosaicIntegrationsBadgeProps, MosaicInviteMemberDialog, type MosaicInviteMemberDialogProps, MosaicKanbanBoard, type MosaicKanbanBoardProps, MosaicKanbanColumn, type MosaicKanbanColumnProps, MosaicLogosGrid, type MosaicLogosGridProps, MosaicMainNav, type MosaicMainNavProps, type MosaicMarketplaceItem, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, type MosaicMarketplaceListProps, MosaicMemberList, type MosaicMemberListProps, MosaicMemoryCard, type MosaicMemoryCardProps, type MosaicMemoryData, type MosaicMemoryScope, type MosaicMemorySource, type MosaicMessage, MosaicMessageCard, type MosaicMessageCardProps, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, type MosaicMessageListProps, type MosaicMessageReactions, type MosaicMessageSender, type MosaicMessageSenderType, MosaicModuleCard, type MosaicModuleCardProps, type MosaicModuleData, MosaicModuleForm, type MosaicModuleFormField, type MosaicModuleFormProps, type MosaicModuleItem, MosaicModuleLibrary, type MosaicModuleLibraryProps, type MosaicModuleType, MosaicMultiOrgIndicator, type MosaicMultiOrgIndicatorProps, MosaicMultiTenantProvider, type MosaicMultiTenantProviderProps, type MosaicNavItem, MosaicNavbar, type MosaicNavbarProps, type MosaicNavigationItem, type MosaicOrg, type MosaicOrgInfo, type MosaicOrgMember, MosaicOrgPanel, type MosaicOrgPanelProps, type MosaicOrgPanelTab, MosaicOrgProfilePage, type MosaicOrgProfilePageProps, type MosaicOrgRole, MosaicOrgRoleBadge, type MosaicOrgRoleBadgeProps, type MosaicOrgStats, MosaicOrgSwitcher, type MosaicOrgSwitcherProps, type MosaicSelectItem as MosaicPrefSelectItem, type MosaicPreference, type MosaicPreferenceGroup, MosaicPreferencesPanel, type MosaicPreferencesPanelProps, MosaicPricingCard, type MosaicPricingCardProps, type MosaicProfileField, MosaicProfilePanel, type MosaicProfilePanelProps, MosaicProgress, type MosaicProgressProps, type MosaicQuickAction$1 as MosaicQuickAction, MosaicQuickActionCard, type MosaicQuickActionCardProps, MosaicQuickActionsMenu, type MosaicQuickAction as MosaicQuickActionsMenuItem, type MosaicQuickActionsMenuProps, type MosaicQuickAgent, MosaicQuickAgentSelector, type MosaicQuickAgentSelectorProps, MosaicQuickStartPanel, type MosaicQuickStartPanelProps, MosaicRadioGroup, MosaicRadioGroupItem, type MosaicRadioGroupItemProps, type MosaicRadioGroupProps, type MosaicScenario, MosaicScrollArea, type MosaicScrollAreaProps, MosaicSelect, type MosaicSelectItem$1 as MosaicSelectItem, type MosaicSelectProps, type MosaicSelectorCategory, type MosaicSelectorItem, MosaicSelectorModal, type MosaicSelectorModalProps, MosaicSeparator, type MosaicSeparatorProps, type MosaicSidebarFooterStatus, type MosaicSidebarNavItem, type MosaicSidebarQuickAction, type MosaicSidebarRecentItem, MosaicSignInLayout, type MosaicSignInLayoutProps, MosaicSignUpLayout, type MosaicSignUpLayoutProps, MosaicSkeleton, type MosaicSkeletonProps, MosaicSlider, type MosaicSliderProps, type MosaicStatItem, MosaicStatsGrid, type MosaicStatsGridProps, type MosaicStep, MosaicStepPipeline, type MosaicStepPipelineDotsProps, type MosaicStepPipelineProps, type MosaicStepPipelineSegmentsProps, type MosaicStepStatus, MosaicSwitch, type MosaicSwitchProps, MosaicTabs, MosaicTabsList, type MosaicTabsListProps, MosaicTabsPanel, type MosaicTabsPanelProps, type MosaicTabsProps, MosaicTabsTrigger, type MosaicTabsTriggerProps, type MosaicTemplate, type MosaicTemplateAgent, MosaicTemplateCard, type MosaicTemplateCardProps, MosaicTemplateGallery, type MosaicTemplateGalleryProps, type MosaicTemplateMetadata, MosaicTemplatePreview, type MosaicTemplatePreviewProps, MosaicTestimonialsGrid, type MosaicTestimonialsGridProps, MosaicTextarea, type MosaicTextareaProps, MosaicThemeProvider, type MosaicThemeProviderProps, MosaicThemeToggle, type MosaicThemeToggleProps, MosaicTooltip, MosaicTooltipContent, type MosaicTooltipContentProps, type MosaicTooltipProps, MosaicTooltipProvider, type MosaicTooltipProviderProps, MosaicTooltipRoot, type MosaicTooltipRootProps, MosaicTooltipTrigger, type MosaicTooltipTriggerProps, MosaicUrlScraper, type MosaicUrlScraperContent, type MosaicUrlScraperProps, type MosaicUrlScraperState, MosaicUserButton, type MosaicUserButtonProps, type MosaicWorkspaceContext, type NavCta, type NavLink, type OrbPosition, type Orientation, Placeholder, type PricingCta, type SocialLink, type StatItem, type TestimonialItem, type Theme, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import { Button } from '@base-ui/react/button';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
5
5
|
import * as React28 from 'react';
|
|
6
|
-
import { useState, useEffect, useRef, useId } from 'react';
|
|
6
|
+
import { useState, useEffect, useRef, useId, useLayoutEffect } from 'react';
|
|
7
7
|
import { Accordion } from '@base-ui/react/accordion';
|
|
8
8
|
export { Accordion } from '@base-ui/react/accordion';
|
|
9
9
|
import { Checkbox } from '@base-ui/react/checkbox';
|
|
@@ -27,7 +27,7 @@ import { Menu } from '@base-ui/react/menu';
|
|
|
27
27
|
import { AlertDialog } from '@base-ui/react/alert-dialog';
|
|
28
28
|
|
|
29
29
|
// src/version.ts
|
|
30
|
-
var version = "0.
|
|
30
|
+
var version = "0.5.1-alpha";
|
|
31
31
|
function Placeholder({ label = "mosaic-blocks placeholder" }) {
|
|
32
32
|
return /* @__PURE__ */ jsx("div", { "data-mosaic-block": "placeholder", children: label });
|
|
33
33
|
}
|
|
@@ -11460,7 +11460,88 @@ function MosaicUrlScraper(props) {
|
|
|
11460
11460
|
] });
|
|
11461
11461
|
}
|
|
11462
11462
|
MosaicUrlScraper.displayName = "MosaicUrlScraper";
|
|
11463
|
+
var chatThreadRootVariants = cva([
|
|
11464
|
+
"relative flex min-h-0 flex-1 flex-col overflow-y-auto"
|
|
11465
|
+
]);
|
|
11466
|
+
var chatThreadContentVariants = cva([
|
|
11467
|
+
"mx-auto flex w-full max-w-2xl flex-col gap-4 px-4 py-6 sm:px-6"
|
|
11468
|
+
]);
|
|
11469
|
+
var chatThreadScrollButtonVariants = cva([
|
|
11470
|
+
"absolute bottom-4 left-1/2 -translate-x-1/2 inline-flex size-9",
|
|
11471
|
+
"items-center justify-center rounded-full border border-border bg-card text-foreground shadow-sm",
|
|
11472
|
+
"transition-colors hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
11473
|
+
]);
|
|
11474
|
+
function cn73(...classes) {
|
|
11475
|
+
return classes.filter(Boolean).join(" ");
|
|
11476
|
+
}
|
|
11477
|
+
var BOTTOM_THRESHOLD_PX = 24;
|
|
11478
|
+
function isNearBottom(element) {
|
|
11479
|
+
return element.scrollHeight - element.scrollTop - element.clientHeight <= BOTTOM_THRESHOLD_PX;
|
|
11480
|
+
}
|
|
11481
|
+
function MosaicChatThread({
|
|
11482
|
+
children,
|
|
11483
|
+
scrollToBottomLabel,
|
|
11484
|
+
className,
|
|
11485
|
+
ref
|
|
11486
|
+
}) {
|
|
11487
|
+
const containerRef = useRef(null);
|
|
11488
|
+
const isAtBottomRef = useRef(true);
|
|
11489
|
+
const [isAtBottom, setIsAtBottom] = useState(true);
|
|
11490
|
+
function setRefs(node) {
|
|
11491
|
+
containerRef.current = node;
|
|
11492
|
+
if (typeof ref === "function") {
|
|
11493
|
+
ref(node);
|
|
11494
|
+
} else if (ref) {
|
|
11495
|
+
ref.current = node;
|
|
11496
|
+
}
|
|
11497
|
+
}
|
|
11498
|
+
function handleScroll(event) {
|
|
11499
|
+
const atBottom = isNearBottom(event.currentTarget);
|
|
11500
|
+
isAtBottomRef.current = atBottom;
|
|
11501
|
+
setIsAtBottom(atBottom);
|
|
11502
|
+
}
|
|
11503
|
+
function handleScrollToBottomClick() {
|
|
11504
|
+
const element = containerRef.current;
|
|
11505
|
+
if (!element) {
|
|
11506
|
+
return;
|
|
11507
|
+
}
|
|
11508
|
+
element.scrollTop = element.scrollHeight;
|
|
11509
|
+
isAtBottomRef.current = true;
|
|
11510
|
+
setIsAtBottom(true);
|
|
11511
|
+
}
|
|
11512
|
+
useLayoutEffect(() => {
|
|
11513
|
+
const element = containerRef.current;
|
|
11514
|
+
if (element && isAtBottomRef.current) {
|
|
11515
|
+
element.scrollTop = element.scrollHeight;
|
|
11516
|
+
}
|
|
11517
|
+
}, [children]);
|
|
11518
|
+
return /* @__PURE__ */ jsxs(
|
|
11519
|
+
"div",
|
|
11520
|
+
{
|
|
11521
|
+
ref: setRefs,
|
|
11522
|
+
"data-slot": "chat-thread",
|
|
11523
|
+
role: "log",
|
|
11524
|
+
onScroll: handleScroll,
|
|
11525
|
+
className: cn73(chatThreadRootVariants(), className),
|
|
11526
|
+
children: [
|
|
11527
|
+
/* @__PURE__ */ jsx("div", { "data-slot": "chat-thread-content", className: chatThreadContentVariants(), children }),
|
|
11528
|
+
!isAtBottom && /* @__PURE__ */ jsx(
|
|
11529
|
+
"button",
|
|
11530
|
+
{
|
|
11531
|
+
type: "button",
|
|
11532
|
+
"data-slot": "chat-thread-scroll-button",
|
|
11533
|
+
"aria-label": scrollToBottomLabel,
|
|
11534
|
+
onClick: handleScrollToBottomClick,
|
|
11535
|
+
className: chatThreadScrollButtonVariants(),
|
|
11536
|
+
children: /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u2193" })
|
|
11537
|
+
}
|
|
11538
|
+
)
|
|
11539
|
+
]
|
|
11540
|
+
}
|
|
11541
|
+
);
|
|
11542
|
+
}
|
|
11543
|
+
MosaicChatThread.displayName = "MosaicChatThread";
|
|
11463
11544
|
|
|
11464
|
-
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11545
|
+
export { MosaicAccordion, MosaicAccordionItem, MosaicAccordionPanel, MosaicAccordionTrigger, MosaicActivityFeed, MosaicActivityItem, MosaicAdaptiveGrid, MosaicAdaptiveModal, MosaicAdaptiveNavigation, MosaicAgentCard, MosaicAgentComposer, MosaicAgentComposerDesktop, MosaicAgentComposerMobile, MosaicAgentList, AgentListDesktop as MosaicAgentListDesktop, AgentListMobile as MosaicAgentListMobile, MosaicAgentTeamPreview, MosaicAnimatedList, MosaicAppSidebar, MosaicAvatar, MosaicBadge, MosaicBlurredOrb, MosaicButton, MosaicCard, MosaicCardContent, MosaicCardDescription, MosaicCardFooter, MosaicCardHeader, MosaicCardTitle, MosaicChatThread, MosaicCheckbox, MosaicClerkOrgSwitcher, MosaicClerkWebhookHandler, MosaicCollapsible, MosaicCollapsiblePanel, MosaicCollapsibleTrigger, MosaicCombobox, MosaicCounter, MosaicCreateOrgDialog, MosaicDashboardContent, MosaicDashboardHeader, MosaicDashboardLayout, MosaicDataTable, MosaicDeleteConfirmationDialog, MosaicDeviceProvider, MosaicDocumentUpload, MosaicDropdownMenu, MosaicEmptyState, MosaicFallingPattern, MosaicFeature3Col, MosaicFeatureCenteredMedia, MosaicField, MosaicFieldControl, MosaicFieldDescription, MosaicFieldError, MosaicFieldLabel, MosaicFilterBar, MosaicFilterSidebar, MosaicFooterSimple, MosaicHeroSplit, MosaicInput, MosaicInputGroup, MosaicIntegrationsBadge, MosaicInviteMemberDialog, MosaicKanbanBoard, MosaicKanbanColumn, MosaicLogosGrid, MosaicMainNav, MosaicMarketplaceList, MarketplaceListDesktop as MosaicMarketplaceListDesktop, MarketplaceListMobile as MosaicMarketplaceListMobile, MosaicMemberList, MosaicMemoryCard, MosaicMessageCard, MosaicMessageList, MessageListDesktop as MosaicMessageListDesktop, MessageListMobile as MosaicMessageListMobile, MosaicModuleCard, MosaicModuleForm, MosaicModuleLibrary, MosaicMultiOrgIndicator, MosaicMultiTenantProvider, MosaicNavbar, MosaicOrgPanel, MosaicOrgProfilePage, MosaicOrgRoleBadge, MosaicOrgSwitcher, MosaicPreferencesPanel, MosaicPricingCard, MosaicProfilePanel, MosaicProgress, MosaicQuickActionCard, MosaicQuickActionsMenu, MosaicQuickAgentSelector, MosaicQuickStartPanel, MosaicRadioGroup, MosaicRadioGroupItem, MosaicScrollArea, MosaicSelect, MosaicSelectorModal, MosaicSeparator, MosaicSignInLayout, MosaicSignUpLayout, MosaicSkeleton, MosaicSlider, MosaicStatsGrid, MosaicStepPipeline, MosaicSwitch, MosaicTabs, MosaicTabsList, MosaicTabsPanel, MosaicTabsTrigger, MosaicTemplateCard, MosaicTemplateGallery, MosaicTemplatePreview, MosaicTestimonialsGrid, MosaicTextarea, MosaicThemeProvider, MosaicThemeToggle, MosaicTooltip, MosaicTooltipContent, MosaicTooltipProvider, MosaicTooltipRoot, MosaicTooltipTrigger, MosaicUrlScraper, MosaicUserButton, Placeholder, badgeVariants, buttonVariants, skeletonVariants, useBreakpoint, useDevice, useMosaicWorkspace as useEffectiveWorkspaceId, useIsDesktop, useIsMobile, useIsTablet, useMediaQuery, useMosaicWorkspace, useOrientation, useViewport, version };
|
|
11465
11546
|
//# sourceMappingURL=index.js.map
|
|
11466
11547
|
//# sourceMappingURL=index.js.map
|