mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-05-01 01:05:00 +00:00
Email Phase 2 components had broken imports that required structural refactoring. Per the "no WIP" policy established in CLAUDE.md, incomplete implementations cannot remain in the codebase. Email components have been removed until Phase 2 can be completed as a full implementation. Changes: - Removed fakemui/react/components/email/ (22 incomplete components) - Updated CLAUDE.md to mark Phase 2 as POSTPONED, not in-progress - Added explicit "CRITICAL: No Work-In-Progress Code" policy section - Email components can only be re-added when fully implemented with correct imports - Phases 1,3-5 remain complete: DBAL, Redux, Hooks, API endpoints - Production build succeeds with `npm run build` Policy: - NO code with broken imports can remain in main branch - NO partial features documented as "in progress" - Features must be 100% complete or completely removed - Email Phase 2 requires full component architecture rebuild Status: - emailclient: DEPLOYMENT-READY (Phases 1,3-5 complete) - Next: Phases 6-8 (Workflow plugins, Backend service, Docker) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@metabuilder/hooks-core
Core React hooks for workflow UI applications built with Redux.
Key Feature: Service-independent hooks - use these with any Redux-compatible workflow implementation.
What's Included
Canvas Hooks
useCanvasZoom- Manage canvas zoom leveluseCanvasPan- Manage canvas pan/translationuseCanvasSelection- Manage selected items on canvasuseCanvasSettings- Manage grid, snap, and other canvas settingsuseCanvasGridUtils- Grid calculations and utilities
Editor Hooks
useEditor- Aggregated editor stateuseEditorZoom- Node editor zoom controluseEditorPan- Node editor pan controluseEditorNodes- Node selection and manipulationuseEditorEdges- Edge/connection selectionuseEditorSelection- General selection stateuseEditorClipboard- Copy/paste operationsuseEditorHistory- Undo/redo history
UI Hooks
useUI- Aggregated UI stateuseUIModals- Modal dialog stateuseUINotifications- Toast/notification managementuseUILoading- Global loading stateuseUITheme- Theme (light/dark) managementuseUISidebar- Sidebar visibility state
Utility Hooks
useCanvasVirtualization- Virtual scrolling for large canvasuseResponsiveSidebar- Responsive sidebar behaviorusePasswordValidation- Password strength validation
Installation
npm install @metabuilder/hooks-core react react-redux @metabuilder/redux-slices
Usage
import { useCanvasZoom, useEditorSelection, useUIModals } from '@metabuilder/hooks-core'
import { Provider } from 'react-redux'
import { store } from '@metabuilder/redux-slices' // Or your own store
function WorkflowEditor() {
const { zoom, zoomIn, zoomOut } = useCanvasZoom()
const { selectedNodeIds, selectNode } = useEditorSelection()
const { openModal } = useUIModals()
return (
<div>
<button onClick={zoomIn}>Zoom In ({zoom.toFixed(0)}%)</button>
<button onClick={zoomOut}>Zoom Out</button>
{/* Your editor UI */}
</div>
)
}
export default function App() {
return (
<Provider store={store}>
<WorkflowEditor />
</Provider>
)
}
Requirements
- React 18.0+
- Redux with workflow slices
- react-redux
Architecture
All hooks in this package:
- Are service-independent - no API calls, no database access
- Use Redux as source of truth - dispatch actions, select state
- Are framework-agnostic - work with any Redux setup
- Are type-safe - full TypeScript support
- Are composable - hooks are small and combine well
Future
These hooks will be extended with:
- Canvas operations (creation, deletion, layout)
- Workflow execution hooks
- Collaboration hooks (cursors, presence)
- Real-time sync hooks
Contributing
See main metabuilder repository for contribution guidelines.
License
MIT