npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@teamimpact/veda-content-editor

v0.1.0

Published

A content editor component for VEDA projects.

Downloads

21

Readme

VEDA Content Editor

A powerful MDX editor component for React applications, built specifically for NASA's VEDA (Visualization, Exploration, and Data Analysis) project. This editor provides rich-text editing capabilities with support for custom components like interactive maps and charts.

Features

  • 📝 Rich MDX Editing: Full-featured markdown and MDX editing with live preview
  • 🗺️ Interactive Map Component: Embed and configure maps with various datasets and layers
  • 📊 Chart Component: Create and customize data visualizations
  • 🎨 WYSIWYG Interface: User-friendly interface with toolbar controls
  • 📱 Responsive Design: Works seamlessly across different screen sizes
  • 🔍 Source Mode: View generated MDX source (read-only to prevent data loss)
  • 🎯 Custom Components: Support for NASA VEDA-specific components

Installation

npm install @teamimpact/veda-content-editor

or

yarn add @teamimpact/veda-content-editor

Usage

Basic Setup

import { VEDAContentEditor } from '@teamimpact/veda-content-editor';
import '@teamimpact/veda-content-editor/style.css';

function App() {
  const handleChange = (content) => {
    console.log('Content updated:', content);
  };

  const vedaConfig = {
    envMapboxToken: 'your-mapbox-token',
    envApiStacEndpoint: 'your-stac-endpoint',
    envApiRasterEndpoint: 'your-raster-endpoint',
  };

  return (
    <VEDAContentEditor
      initialContent="# Welcome to VEDA Editor"
      onChange={handleChange}
      vedaConfig={vedaConfig}
    />
  );
}

Full Example with All Props

import { VEDAContentEditor } from '@teamimpact/veda-content-editor';
import '@teamimpact/veda-content-editor/style.css';

function App() {
  const initialContent = `
# My Document

This is a **VEDA** content editor with support for:

- Rich text formatting
- Custom components
- Interactive maps
- Data visualizations
  `;

  const datasets = [
    {
      id: 'dataset-1',
      name: 'Sample Dataset',
      layers: [
        { id: 'layer-1', name: 'Layer 1' },
        { id: 'layer-2', name: 'Layer 2' }
      ]
    }
  ];

  const vedaConfig = {
    envMapboxToken: process.env.REACT_APP_MAPBOX_TOKEN,
    envApiStacEndpoint: process.env.REACT_APP_STAC_ENDPOINT,
    envApiRasterEndpoint: process.env.REACT_APP_RASTER_ENDPOINT,
  };

  return (
    <div style={{ width: '100%', height: '100vh' }}>
      <VEDAContentEditor
        initialContent={initialContent}
        onChange={(content) => console.log(content)}
        placeholder="Start typing..."
        className="my-custom-class"
        allAvailableDatasets={datasets}
        vedaConfig={vedaConfig}
      />
    </div>
  );
}

Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | initialContent | string | No | Initial MDX content to display in the editor | | onChange | (content: string) => void | No | Callback function triggered when content changes | | placeholder | string | No | Placeholder text when editor is empty | | className | string | No | Additional CSS classes for the editor container | | allAvailableDatasets | Array<Dataset> | No | Available datasets for map components | | vedaConfig | VedaConfig | Yes | Configuration object with API endpoints and tokens |

VedaConfig Object

interface VedaConfig {
  envMapboxToken: string;      // Mapbox API token for map rendering
  envApiStacEndpoint: string;  // STAC API endpoint
  envApiRasterEndpoint: string; // Raster API endpoint
}

Custom Components

Map Component

The editor supports embedding interactive maps with the following features:

  • Dataset and layer selection
  • Zoom and center controls
  • Date/time selection for temporal data
  • Comparison mode for viewing changes over time
  • Attribution and captions

Chart Component

Create data visualizations with:

  • Line charts
  • Time series data
  • Custom color schemes
  • Axis labels and formatting
  • Data highlighting

Toolbar Features

  • Text Formatting: Bold, italic, underline, strikethrough
  • Headings: H1-H6 support
  • Lists: Ordered and unordered lists
  • Code: Inline code and code blocks
  • Links: Create and edit hyperlinks
  • Images: Insert and manage images
  • Tables: Create and edit tables
  • Custom Components: Insert maps and charts via toolbar buttons
  • Source Mode: View generated MDX (read-only)

Environment Variables

When using this package, ensure your application provides the following environment variables:

VITE_MAPBOX_TOKEN=your-mapbox-token
VITE_API_STAC_ENDPOINT=your-stac-endpoint
VITE_API_RASTER_ENDPOINT=your-raster-endpoint

Or pass them directly through the vedaConfig prop.

Styling

The editor comes with default styles. Import the CSS file:

import 'veda-content-editor/style.css';

Full Width Layout

To make the editor take full viewport width and height:

<div style={{ width: '100%', height: '100vh' }}>
  <VEDAContentEditor {...props} />
</div>

Known Issues

  • Source Mode: Currently read-only to prevent loss of custom components when editing raw MDX
  • Custom Components: Must be inserted using toolbar buttons; manual MDX editing of custom components is not supported

Development

Building from Source

# Clone the repository
git clone https://github.com/ajinkyakulkarni/veda-content-editor.git
cd veda-content-editor

# Install dependencies
npm install

# Build the package
npm run build:lib

# Run in development mode
npm run dev

Testing Locally

To test the package locally in another project:

# In the veda-content-editor directory
npm link

# In your test project
npm link veda-content-editor

Recent Updates

Version 0.1.18

  • Fixed environment variable loading issues
  • Resolved duplicate context provider problems
  • Simplified UI by removing unnecessary tabs
  • Fixed input styling issues (black textbox problem)
  • Fixed React hooks errors when collapsing editors
  • Made source view read-only to prevent component loss
  • Added full-width support
  • Improved overall stability and performance

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Support

For issues and questions, please open an issue on GitHub.

Credits

Built for NASA's VEDA project by the development team.