Skip to content

contentstack/marketplace-colorpicker-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Marketplace Color Picker App

License: MIT TypeScript React Playwright

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.

🎨 Features

  • 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

πŸ“‹ Prerequisites

  • Node.js (v16 or higher)
  • npm
  • Contentstack account (for marketplace deployment)

πŸš€ Quick Start

Installation

# Clone the repository
git clone https://github.com/contentstack/marketplace-colorpicker-app.git
cd marketplace-colorpicker-app

# Install dependencies
npm install

Development

# Start development server
npm start

# Run tests
npm test

# Run E2E tests
npm run test:chrome

Building for Production

# Build the application
npm run build

# The built files will be in the `dist` directory

πŸ—οΈ Project Structure

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...

πŸ§ͺ Testing

This project includes comprehensive testing:

Unit Tests

npm test                    # Run unit tests
npm run test:watch         # Run tests in watch mode

E2E Tests

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

Code Quality

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

πŸ”§ Configuration

Environment Variables

Create a .env file in the root directory:

REACT_APP_STACK_API_KEY=your_stack_api_key
REACT_APP_ENVIRONMENT=your_environment

App Configuration

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"
          }
        ]
      }
    ]
  }
}

πŸ› οΈ Development

Adding New Features

  1. Create feature branch from main
  2. Implement your changes
  3. Add tests for new functionality
  4. Update documentation
  5. Submit pull request

Code Style

This project uses:

  • ESLint for code linting
  • Prettier for code formatting
  • Husky for git hooks
  • lint-staged for pre-commit checks

Commit Convention

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

πŸ“¦ Deployment

Contentstack Marketplace

  1. Build the application: npm run build
  2. Package the dist directory
  3. Upload to Contentstack marketplace
  4. Install in your Contentstack stack

Local Development

For local development with Contentstack:

  1. Use Contentstack's local development tools
  2. Configure your stack API key
  3. Run npm start for development server

🀝 Contributing

We welcome contributions!

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Install dependencies
npm install

# Set up git hooks
npm run prepare

# Start development
npm start

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ by the Contentstack team

About

This is a modern, accessible color picker custom field app for the Contentstack.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 6