@hiyve/react-collaboration - Chat, Polls, Q&A, and File Manager components for Hiyve SDK
Remarks
Provides five feature areas:
Chat — real-time chat panel
Polls — polling with creation, voting, and results
Q&A — question and answer panel with voting
File Manager — file browsing, viewing, and management
Session Common — shared session lifecycle components
Constants that share the same name across polls and Q&A are exported with
domain prefixes to avoid conflicts (e.g. pollsDATA_MESSAGE_TYPES /
qaDATA_MESSAGE_TYPES). See the README for the full mapping.
@hiyve/react-collaboration
Chat, polls, Q&A, and file management components for Hiyve.
Full chat interface with message list, input, and avatars
ChatMessageList
Scrollable message list with auto-scroll, avatars, and timestamps. Can be used standalone or composed inside ChatPanel/ChatHub
ChatInput
Message input with send button, character limit, and validation. Can be used standalone or composed inside ChatPanel/ChatHub
Chat Hub
Component
Description
ChatHub
Multi-channel chat layout with channel sidebar and message area. Responsive: side-by-side on desktop, stacked on mobile
ChatChannelList
Searchable, groupable list of chat channels with unread badges and online indicators
Polls
Component
Description
PollsWindow
Complete polling interface with creation, voting, and results
ActivePoll
Displays a single active poll for voting
PollCreator
Form for creating new polls
PollEditor
Form for editing existing polls
PollHeader
Header for an individual poll
PollHistory
List of past polls
PollOption
Single poll option with vote count and percentage
PollResultsViewer
Detailed results view for a completed poll
SimplePollResults
Compact results summary
PollsSession
Manages poll session lifecycle with room storage
PollsSessionViewer
Read-only viewer for previously saved poll sessions
PollsWindowHeader
Header for the polls window
Q&A
Component
Description
QAPanel
Complete Q&A interface with questions, answers, and voting
AnswerSection
Displays answers for a question
QuestionInput
Input form for submitting questions
QuestionItem
Single question with vote count and answer toggle
QuestionList
Sorted, filterable list of questions
QAPanelHeader
Header for the Q&A panel
QASession
Manages Q&A session lifecycle with room storage
QASessionViewer
Read-only viewer for previously saved Q&A sessions
File Manager
Component
Description
FileManager
Full file browser with upload, download, folders, and sharing
FileViewer
Preview and playback for files (audio, video, images, documents)
MediaFileViewer
Enhanced media player for audio/video with waveform, playback controls, and region support. Requires @hiyve/react-media-player
FileIcon
File type icon with customizable icon and color maps
FileManagerToolbar
Toolbar with search, view toggle, upload, and custom actions
FileManagerFilterChips
Horizontal filter chip bar for filtering files by resource type
FileScopeSelector
Toggle between Private files and Public files scopes. Rendered automatically by FileManager when the caller has both roles; see Public Files
FileTableView
Table/list layout view for rendering files and folders as rows
FileCardView
Card/grid layout view for rendering files and folders as cards
RoomSummaryViewer
Displays room summary data (participants, recordings, files)
FileListSkeleton
Loading skeleton for the file list
FileCacheProvider
Provides a shared file tree cache to child components
CreateFolderDialog
Dialog for creating new folders
RenameFileDialog
Dialog for renaming files
DeleteConfirmDialog
Confirmation dialog for file deletion
FileSharingDialog
Dialog for configuring file sharing
FileSessionHost
Unified host that opens any file in its registered editor (modal or inline). Replaces the per-package *Session components from react-notes, react-clips, react-assignments, and react-whiteboard
File Session Host
FileSessionHost is the unified host for opening a file in the right editor. Pair it with editors from @hiyve/react-notes, @hiyve/react-clips, @hiyve/react-assignments, and @hiyve/react-whiteboard to host them inside a sidebar tab or as a fullscreen modal.
FileManager supports a public file pool alongside the user's own private files — a read-only library many users can browse and copy from. Pass scopesAvailable, activeScope, onScopeChange, publicFiles, and onCopyPublicToPrivate to enable it.
Access is gated by two roles on the user's identity profile:
Role
Gates
private-files
Whether the user sees the Private files scope (their own files).
public-files
Whether the user sees the Public files scope and can copy from it.
When both roles are present, FileManager renders a scope selector at the top. When only one is available, the selector is hidden and that scope is shown. When neither is set, an empty state is shown.
In the public-files scope the FileManager hides destructive actions (delete, rename, share, move, upload, create folder). When the user copies or drags a public file, your onCopyPublicToPrivate callback is invoked and the file is added to the user's private library; the original is untouched.
return ( <FileManager scopesAvailable={scopesAvailable} activeScope={activeScope} onScopeChange={setActiveScope} publicFiles={publicFiles} onCopyPublicToPrivate={handleCopyPublicToPrivate} // …other props as normal /> ); }
Related components
Component
Description
FileScopeSelector
Toggle-group rendered by FileManager when two scopes are available. Usable standalone.
FileScopeSelector Props
Prop
Type
Default
Description
scopes
FileScope[]
—
Available scopes. Component renders nothing when length ≤ 1.
value
FileScope
—
Currently-selected scope.
onChange
(scope: FileScope) => void
—
Fired when the user picks a different scope.
labels
Partial<Record<FileScope, string>>
—
Override default labels (Private files, Public files).
disabled
boolean
false
Disable the selector (e.g. while refreshing).
Room Analysis Viewer
Component
Description
RoomAnalysisViewer
Renders a room-analysis report with optional video sync, regions, and timeline markers.
RoomAnalysisViewerProps accepts analysisData, optional videoUrl, recordingId, region/marker props, currentUserId, and an sx override. Use it inside a FileViewer overlay or as a standalone display when surfacing post-meeting analytics.
File Comments
FileCommentsPanel displays a controlled list of comments with an inline composer. Pair it with any file-viewer surface (or your own host) by feeding comments and wiring onAddComment.
Cache primitives (getCachedThumb, setCachedThumb, hasCachedThumb, clearCachedThumb, clearThumbnailCache, queueThumbnailTask) and low-level URL helpers (generateImageThumbnailFromUrl, generateVideoThumbnailFromUrl) are exported for advanced integrations. Built-ins: imageThumbnailGenerator, videoThumbnailGenerator, textPreviewThumbnailGenerator, placeholderThumbnailGenerator.
The text-preview built-in renders a content-first tile for document-style files. Resource types with a known saved shape get a structured preview — poll and Q&A session files show their question list with a count label, titled rich-text documents (notes, assignments) show the title and body text plus a due-date label when present, and summary/analysis files show the overview text. Other JSON documents fall back to a readable-text excerpt that filters out ids, timestamps, and other machine noise.
Theme color builders
Use these factories to derive defaulted color objects from a MUI Theme:
Factory
Component
buildChatPanelColors(theme, tokens?)
ChatPanel, ChatMessageList, ChatInput
buildChatChannelListColors(theme, tokens?)
ChatChannelList (and ChatHub)
buildAgentColors(theme, tokens?)
Agent avatar / message styling for AI surfaces
All three accept an optional ThemeColorTokens argument to override individual tokens before defaults are applied.
Session Common
Component
Description
SessionEmptyState
Empty state display for session-based features
SessionHeader
Shared header for session panels (notes, polls, Q&A)
Predicates
Function
Description
isEditableFile(file)
true when the file's resourceType has a registered editor (assignment, note, etc.).
Called when a link in a message is clicked. Call event.preventDefault() and navigate yourself to keep the link in-app (e.g. same-origin links in an installed PWA, which browsers open in an in-app browser sheet). Without it, links open in a new tab
sx
SxProps<Theme>
—
MUI sx styling prop
ChatMessageList Props
Prop
Type
Default
Description
messages
ChatMessage[]
—
Array of messages to display
localUserId
string
—
The local user's ID (for distinguishing own messages)
showTimestamps
boolean
true
Show timestamps on messages
showAvatars
boolean
true
Show avatars for messages
colors
Partial<ChatPanelColors>
—
Custom color values
styles
Partial<ChatPanelStyles>
—
Custom style values
labels
Partial<ChatPanelLabels>
—
Custom text labels
renderProps
ChatPanelRenderProps
—
Render props for advanced customization
onError
(error: Error) => void
—
Called when an error occurs (e.g., timestamp formatting)
Manages local poll state (create, vote, end, delete)
usePollSync
Synchronizes polls across participants in real-time
usePollPersistence
Saves and loads poll sessions to/from room storage
usePollListener
Listens for incoming poll updates from other participants
Q&A
Hook
Description
useQAState
Manages local Q&A state (post, answer, vote, delete)
useQASync
Synchronizes Q&A across participants in real-time
useQAPersistence
Saves and loads Q&A sessions to/from room storage
useQAListener
Listens for incoming Q&A updates from other participants
useQASessionState
Manages Q&A session lifecycle state
File Manager
Hook
Description
useFileCache
Accesses the shared file tree cache (requires FileCacheProvider)
useFileCacheSafe
Same as useFileCache but returns null outside FileCacheProvider
useFileNavigation
Manages folder navigation with breadcrumb history
useFileOperations
Provides upload, download, rename, delete, and folder operations
useFileDragDrop
Handles drag-and-drop file uploads
useFileDialogs
Manages open/close state for file dialogs
useFileSelection
Tracks selected files with multi-select support
useFileAnnotations
Provides timeline markers and regions for annotated media files
useResolveRecordingUrl
Resolves a recording file id to a playable URL
useThumbnail
Resolves a thumbnail object URL for a file (cache first, then generators). Work is gated on the visible option — off-screen items do nothing, and leaving the viewport aborts in-flight generation
useInView
Live viewport visibility for a ref — reports both entering and leaving, so pending work can be cancelled for off-screen items
Generic session lifecycle hook with start, open, and close actions. Tracks active state, session data, and associated file ID
useFileSessionLoader
Fetches and parses a saved session file, with loading state and error handling. Requires FileCacheProvider
Utilities
Polls
Export
Description
generatePollId
Creates a unique poll identifier
generateOptionId
Creates a unique poll option identifier
generateResponseId
Creates a unique text response identifier
generateVoteMessageId
Creates a unique vote message identifier
createYesNoOptions
Creates pre-built Yes/No poll options
createRatingOptions
Creates a 1-5 rating scale poll
createDefaultPoll
Creates a poll object with default settings
defaultPollSettings
Default poll configuration values
defaultPollResults
Empty poll results object
getOptionVoteCount
Returns the vote count for a poll option
calculateVotePercentage
Calculates vote percentage for a poll option
getTotalVotes
Returns total votes across all options
getTotalVoters
Returns total unique voters
hasUserVoted
Checks whether a user has voted on a poll
getTimeRemaining
Calculates remaining time for a timed poll
formatRelativeTime
Formats a timestamp as relative time ("2m ago")
calculateServerTimeOffset
Calculates clock offset between client and server
Q&A
Export
Description
generateQuestionId
Creates a unique question identifier
generateAnswerId
Creates a unique answer identifier
defaultFormatTimestamp
Default timestamp formatter for Q&A messages
File Manager
Export
Description
formatFileName
Formats a file name for display
formatFileDate
Formats a file date for display
truncateFileName
Truncates long file names with ellipsis
getFileType
Determines file type from name or MIME type
getFileExtension
Extracts file extension from a file name
getResourceTypeFromContentType
Maps a MIME type or extension to a ResourceType
isFolder / isFile
Type guards for file system items
File Reference Utilities
Utilities for discovering file references when sharing files that link to other files (e.g., a clip composition referencing audio clips). Built-in extractors handle clip-composition and assignment resource types.
Export
Description
registerFileReferenceExtractor
Register a custom extractor for a resource type. Returns a cleanup function
hasFileReferences
Check whether a resource type has a registered extractor
extractFileReferences
Extract referenced file IDs from parsed file content
Some constant names are shared across the polls and Q&A domains. They are exported with domain prefixes to avoid conflicts:
Polls Export
Q&A Export
pollsDATA_MESSAGE_TYPES
qaDATA_MESSAGE_TYPES
pollsTIMING
qaTIMING
pollsSORT_MODES
qaSORT_MODES
pollsFILE_STORAGE
qaFILE_STORAGE
POLL_CONFIG
QA_CONFIG
Advanced: Data Message Types
These constants are available for consumers building custom poll or Q&A integrations outside of the provided components (e.g., custom UIs that send and receive poll/Q&A data messages directly).
Constant
Purpose
pollsDATA_MESSAGE_TYPES
Message type identifiers for poll lifecycle events (create, start, end, vote, share results, state sync)
pollsTIMING
Timing configuration for poll operations (debounce intervals, sync delays)
pollsFILE_STORAGE
File storage keys and paths used when persisting poll sessions
pollsSORT_MODES
Available sort modes for ordering polls
qaDATA_MESSAGE_TYPES
Message type identifiers for Q&A lifecycle events (post question, answer, vote, delete, state sync)
qaTIMING
Timing configuration for Q&A operations (debounce intervals, sync delays)
qaFILE_STORAGE
File storage keys and paths used when persisting Q&A sessions
qaSORT_MODES
Available sort modes for ordering questions
File Reference Utilities
Utilities for discovering and resolving file references when files link to other files (e.g., a clip composition referencing audio clips). Built-in extractors handle clip-composition and assignment resource types. Register custom extractors for additional resource types.
Export
Purpose
registerFileReferenceExtractor(type, fn)
Register a custom extractor for a resource type. Returns a cleanup function
hasFileReferences(type)
Check whether a resource type has a registered extractor
extractFileReferences(type, content)
Extract referenced file IDs from parsed file content
Key Types
Type
Description
ChatMessage
Chat message data (id, userId, userName, content, timestamp, isSystem, isLocal)
@hiyve/react-collaboration - Chat, Polls, Q&A, and File Manager components for Hiyve SDK
Remarks
Provides five feature areas:
Constants that share the same name across polls and Q&A are exported with domain prefixes to avoid conflicts (e.g.
pollsDATA_MESSAGE_TYPES/qaDATA_MESSAGE_TYPES). See the README for the full mapping.