mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-27 07:14:56 +00:00
Comprehensive in-app documentation system with interactive guides, full-text search, and contextual help: **Type System** (`src/types/documentation.ts`): - DocumentationIndex: Complete documentation structure with metadata - DocPage: Individual documentation pages with versioning - DocContentBlock: Flexible content types (text, code, list, table, video, callout, step, etc.) - DocCategory: Organized by category (getting-started, canvas, workflows, settings, shortcuts, etc.) - HelpState: Redux state management for help modal **JSON-Backed Content** (`src/data/documentation.json`): - 14 comprehensive documentation pages - 6 major documentation sections with hierarchical organization - Estimated read times and difficulty levels (beginner/intermediate/advanced) - Keywords for search optimization - Related pages for navigation **Service Layer** (`src/services/documentationService.ts`): - Full-text search with keyword matching - Category-based filtering and page grouping - Navigation tree building for sidebar - Breadcrumb generation - Statistics (word count, read time, etc.) - Related pages suggestion - History tracking **State Management** (`src/store/slices/documentationSlice.ts`): - Open/close modal state - Current page/category tracking - Search query and results management - Navigation history (last 20 pages) - Page navigation actions **Components**: - HelpModal.tsx: Main documentation modal with split pane (nav + content) - DocNavigation.tsx: Collapsible section tree with page list - DocContentRenderer.tsx: Flexible content renderer supporting 9 block types - HelpButton.tsx: Reusable help button component **Hook** (`src/hooks/useDocumentation.ts`): - useDocumentation: Complete documentation system integration - State selectors, navigation, search, and action dispatchers - Memoized derived state (navigation tree, breadcrumbs, related pages) **Accessibility**: - Full WCAG 2.1 AA compliance with ARIA roles and labels - Keyboard navigation (Tab, Escape) - Search results with live regions - Screen reader support with semantic HTML **Features**: - 14 documentation pages covering all major features - Full-text search with 2+ character minimum - Breadcrumb navigation - Related pages links - Collapsible section tree - Read time estimates - Difficulty levels - History back button - Material-UI components - Responsive design Documentation covers: - Getting Started (Welcome, Workspace Basics, First Workflow) - Canvas Guide (Canvas Intro, Drag/Drop, Zoom/Pan, Shortcuts) - Workflows (Basics, Nodes, Execution) - Settings (Workspace, Canvas, Notifications) - Keyboard Shortcuts (Canvas, Editor) - Help & Support (FAQ, Troubleshooting) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
326 lines
5.2 KiB
SCSS
326 lines
5.2 KiB
SCSS
/**
|
|
* Help Components Styles
|
|
*/
|
|
|
|
.helpModal {
|
|
.header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 16px;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
|
|
.title {
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.closeButton {
|
|
cursor: pointer;
|
|
font-size: 24px;
|
|
color: #666;
|
|
background: none;
|
|
border: none;
|
|
padding: 4px;
|
|
|
|
&:hover {
|
|
color: #333;
|
|
}
|
|
}
|
|
}
|
|
|
|
.container {
|
|
display: flex;
|
|
height: 600px;
|
|
gap: 0;
|
|
}
|
|
|
|
.sidebar {
|
|
flex: 0 0 250px;
|
|
border-right: 1px solid #e0e0e0;
|
|
overflow-y: auto;
|
|
padding: 16px;
|
|
|
|
.section {
|
|
margin-bottom: 16px;
|
|
|
|
.sectionHeader {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 8px 0;
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
color: #1976d2;
|
|
border: none;
|
|
background: none;
|
|
width: 100%;
|
|
text-align: left;
|
|
|
|
&:hover {
|
|
opacity: 0.8;
|
|
}
|
|
}
|
|
|
|
.icon {
|
|
margin-right: 8px;
|
|
font-size: 16px;
|
|
}
|
|
|
|
.pages {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 8px 0 0 0;
|
|
margin-left: 12px;
|
|
|
|
.pageItem {
|
|
padding: 8px 8px;
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
transition: background-color 0.2s;
|
|
|
|
&:hover {
|
|
background-color: #f5f5f5;
|
|
}
|
|
|
|
&.active {
|
|
background-color: #e3f2fd;
|
|
border-left: 3px solid #1976d2;
|
|
padding-left: 5px;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.content {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
|
|
.searchBar {
|
|
padding: 12px 16px;
|
|
border-bottom: 1px solid #e0e0e0;
|
|
display: flex;
|
|
gap: 8px;
|
|
|
|
input {
|
|
flex: 1;
|
|
padding: 8px 12px;
|
|
border: 1px solid #d0d0d0;
|
|
border-radius: 4px;
|
|
font-size: 14px;
|
|
|
|
&:focus {
|
|
outline: none;
|
|
border-color: #1976d2;
|
|
box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.1);
|
|
}
|
|
}
|
|
|
|
button {
|
|
padding: 8px 16px;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
|
|
.contentArea {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 16px;
|
|
|
|
.emptyState {
|
|
color: #999;
|
|
text-align: center;
|
|
padding: 40px 20px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.footer {
|
|
padding: 12px 16px;
|
|
border-top: 1px solid #e0e0e0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
|
|
button {
|
|
padding: 8px 16px;
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
|
|
&:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Content rendering
|
|
.contentBlock {
|
|
margin-bottom: 16px;
|
|
|
|
h1,
|
|
h2,
|
|
h3,
|
|
h4,
|
|
h5,
|
|
h6 {
|
|
margin-top: 16px;
|
|
margin-bottom: 8px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 24px;
|
|
}
|
|
|
|
h2 {
|
|
font-size: 20px;
|
|
}
|
|
|
|
h3 {
|
|
font-size: 18px;
|
|
}
|
|
|
|
p {
|
|
line-height: 1.6;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
ul,
|
|
ol {
|
|
margin-left: 20px;
|
|
margin-bottom: 12px;
|
|
|
|
li {
|
|
margin-bottom: 6px;
|
|
}
|
|
}
|
|
|
|
.codeBlock {
|
|
background-color: #f5f5f5;
|
|
border: 1px solid #ddd;
|
|
border-radius: 4px;
|
|
padding: 12px;
|
|
overflow-x: auto;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 13px;
|
|
line-height: 1.4;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.step {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-bottom: 12px;
|
|
padding: 12px;
|
|
background-color: #f9f9f9;
|
|
border-left: 3px solid #2196f3;
|
|
border-radius: 4px;
|
|
|
|
.stepIcon {
|
|
min-width: 32px;
|
|
font-size: 18px;
|
|
text-align: center;
|
|
}
|
|
|
|
.stepContent {
|
|
flex: 1;
|
|
}
|
|
}
|
|
|
|
.callout {
|
|
padding: 12px;
|
|
border-left: 4px solid;
|
|
border-radius: 4px;
|
|
margin-bottom: 16px;
|
|
|
|
&.info {
|
|
background-color: #e3f2fd;
|
|
border-color: #2196f3;
|
|
}
|
|
|
|
&.warning {
|
|
background-color: #fff3e0;
|
|
border-color: #ff9800;
|
|
}
|
|
|
|
&.error {
|
|
background-color: #ffebee;
|
|
border-color: #f44336;
|
|
}
|
|
|
|
&.success {
|
|
background-color: #e8f5e9;
|
|
border-color: #4caf50;
|
|
}
|
|
}
|
|
|
|
.table {
|
|
width: 100%;
|
|
border-collapse: collapse;
|
|
margin-bottom: 16px;
|
|
border: 1px solid #ddd;
|
|
|
|
th {
|
|
background-color: #f5f5f5;
|
|
padding: 8px;
|
|
text-align: left;
|
|
font-weight: 600;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
td {
|
|
padding: 8px;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
tr:hover {
|
|
background-color: #f9f9f9;
|
|
}
|
|
}
|
|
}
|
|
|
|
.navigation {
|
|
.sections {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
|
|
.section {
|
|
margin-bottom: 12px;
|
|
|
|
.sectionTitle {
|
|
font-weight: 600;
|
|
color: #1976d2;
|
|
padding: 8px 0;
|
|
}
|
|
|
|
.pages {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 8px 0 0 16px;
|
|
|
|
.page {
|
|
padding: 6px 8px;
|
|
cursor: pointer;
|
|
border-radius: 4px;
|
|
transition: background-color 0.2s;
|
|
|
|
&:hover {
|
|
background-color: #f0f0f0;
|
|
}
|
|
|
|
&.active {
|
|
background-color: #e3f2fd;
|
|
font-weight: 500;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|