A modern, accessible color picker custom field extension for Contentstack marketplace apps. This React-based application provides an intuitive color selection interface that integrates seamlessly with Contentstack's content management system.
- Interactive Color Picker: Built with
react-color
for smooth color selection - Accessibility: Full keyboard navigation and screen reader support
- TypeScript: Fully typed for better development experience
- Responsive Design: Works across different screen sizes
- Testing: Comprehensive test suite with Playwright for E2E testing
- Modern UI: Clean, professional interface using Contentstack's Venus components
- Node.js (v16 or higher)
- npm
- Contentstack account (for marketplace deployment)
# Clone the repository
git clone https://github.com/contentstack/marketplace-colorpicker-app.git
cd marketplace-colorpicker-app
# Install dependencies
npm install
# Start development server
npm start
# Run tests
npm test
# Run E2E tests
npm run test:chrome
# Build the application
npm run build
# The built files will be in the `dist` directory
marketplace-colorpicker-app/
βββ src/
β βββ components/ # Reusable React components
β βββ containers/ # Main app containers
β β βββ App/ # Main app component
β β βββ CustomField/ # Color picker custom field
β β βββ 404/ # 404 error page
β βββ common/
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom React hooks
β β βββ locales/ # Internationalization
β β βββ providers/ # Context providers
β β βββ types/ # TypeScript type definitions
β β βββ utils/ # Utility functions
β βββ assets/ # Static assets
βββ e2e/ # End-to-end tests
βββ public/ # Public assets
βββ config files...
This project includes comprehensive testing:
npm test # Run unit tests
npm run test:watch # Run tests in watch mode
npm run test:chrome # Run E2E tests in Chrome
npm run test:firefox # Run E2E tests in Firefox
npm run test:safari # Run E2E tests in Safari
npm run lint # Run ESLint
npm run lint:fix # Fix linting issues
npm run typecheck # TypeScript type checking
npm run format # Format code with Prettier
Create a .env
file in the root directory:
REACT_APP_STACK_API_KEY=your_stack_api_key
REACT_APP_ENVIRONMENT=your_environment
The app configuration is defined in update-app-info.json
:
{
"name": "Colour Picker",
"target_type": "stack",
"ui_location": {
"locations": [
{
"type": "cs.cm.stack.custom_field",
"meta": [
{
"signed": true,
"path": "/custom-field",
"data_type": "json"
}
]
}
]
}
}
- Create feature branch from
main
- Implement your changes
- Add tests for new functionality
- Update documentation
- Submit pull request
This project uses:
- ESLint for code linting
- Prettier for code formatting
- Husky for git hooks
- lint-staged for pre-commit checks
This project follows Conventional Commits:
feat: add new color picker feature
fix: resolve color picker accessibility issue
docs: update README with new features
test: add unit tests for color validation
- Build the application:
npm run build
- Package the
dist
directory - Upload to Contentstack marketplace
- Install in your Contentstack stack
For local development with Contentstack:
- Use Contentstack's local development tools
- Configure your stack API key
- Run
npm start
for development server
We welcome contributions!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'feat: add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
# Install dependencies
npm install
# Set up git hooks
npm run prepare
# Start development
npm start
This project is licensed under the MIT License - see the LICENSE file for details.
- Contentstack for the marketplace platform
- React Color for the color picker component
- Venus Components for the UI components
- Issues: GitHub Issues
- Documentation: Contentstack Developer Hub
- Community: Contentstack Community
Made with β€οΈ by the Contentstack team