All Projects → PlatziDev → pulse-editor

PlatziDev / pulse-editor

Licence: MIT License
Tha Platzi Flavored Markdown extensible and customizable editor.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pulse-editor

pulse
A Platzi Flavored Markdown desktop editor
Stars: ✭ 22 (-66.67%)
Mutual labels:  platzi, pulse, pulse-editor
comet
A minimal and robust BEM-style CSS toolkit.
Stars: ✭ 18 (-72.73%)
Mutual labels:  extensible, customizable
vscode-react-javascript-snippets
Extension for React/Javascript snippets with search supporting ES7+ and babel features
Stars: ✭ 782 (+1084.85%)
Mutual labels:  react-components, customizable
react-carousel-3d
3D carousal component in react
Stars: ✭ 129 (+95.45%)
Mutual labels:  react-components
customizable-django-profiler
Customizable cProfileMiddleware for Django
Stars: ✭ 28 (-57.58%)
Mutual labels:  customizable
web-unicorn-challenge
💚🦄 Reto para el Curso Profesional de Desarrollo Web en Platzi
Stars: ✭ 16 (-75.76%)
Mutual labels:  platzi
netflix landing-page
The Netflix.com landing page built via React 16 and Styled-Components. Build deployed via Surge.sh for preview.
Stars: ✭ 39 (-40.91%)
Mutual labels:  react-components
react-components
React components library.
Stars: ✭ 27 (-59.09%)
Mutual labels:  react-components
ml-stack-nav
Customizable, responsive, accessible, easy-to-use multi-level stack navigation menu with slide effect.
Stars: ✭ 20 (-69.7%)
Mutual labels:  customizable
react-remark
React component and hook to use remark to render markdown
Stars: ✭ 81 (+22.73%)
Mutual labels:  react-components
snappify
A generator of Jest snapshot-based tests for React components written with TypeScript 📸
Stars: ✭ 64 (-3.03%)
Mutual labels:  react-components
smores-react
🍭 Marshmallow React components
Stars: ✭ 34 (-48.48%)
Mutual labels:  react-components
react-sample-projects
The goal of this project is to provide a set of simple samples, providing and step by step guide to start working with React.
Stars: ✭ 30 (-54.55%)
Mutual labels:  react-components
Obsidian-Harmonic
Harmonic is a minimal and highly customizable theme for Obsidian.md
Stars: ✭ 33 (-50%)
Mutual labels:  customizable
sarif-web-component
A React-based component for viewing SARIF files.
Stars: ✭ 39 (-40.91%)
Mutual labels:  react-components
react-awesome-reveal
React components to add reveal animations using the Intersection Observer API and CSS Animations.
Stars: ✭ 564 (+754.55%)
Mutual labels:  react-components
Fable.SemanticUI
React.SeamanticUI to Fable bindings
Stars: ✭ 15 (-77.27%)
Mutual labels:  react-components
flytekit
Extensible Python SDK for developing Flyte tasks and workflows. Simple to get started and learn and highly extensible.
Stars: ✭ 82 (+24.24%)
Mutual labels:  extensible
dash-flexbox-grid
Wrapper around react-flexbox-grid for Plotly Dash
Stars: ✭ 19 (-71.21%)
Mutual labels:  react-components
Notas recolectadas
Un repositorio para recolectar el aprendizaje y compartirlo.
Stars: ✭ 51 (-22.73%)
Mutual labels:  platzi

Pulse Editor

A React markdown editor, extensible and fully customizable

Installation

To install this editor just run:

yarn add pulse-editor

Or with npm:

npm i -S pulse-editor

Usage example

import React, { Component } from 'react'
import { Editor, ButtonBar, ButtonGroup, Field, Preview, EmojiBar } from 'pulse-editor'
import {
  Base,
  Bold,
  Italic,
  Underline,
  Code,
  Link,
  Image,
  OrderedList,
  UnorderedList,
  Quote,
  Heading,
  Youtube,
} from 'pulse-editor/buttons'

class MyEditor extends Component {
  handleChange = ({ selected, selection, markdown, html, native }) => {
    console.group('Editor special change event')
    console.log('With this event you can get the `selected` text.')
    console.log('Along with the `selection` position inside the full value.')
    console.log('Of course, you also get the original `markdown` and the parsed `html`.')
    console.log('And since the changes are also triggered from a button click, text input, etc.')
    console.log('You will also get the `native` DOM event.')
    console.groupEnd('Editor special change event')
  }

  handleDrop = event => {
    console.group('Editor custom (drop) event')
    console.log('The editor is extensible!')
    console.log('This event is not actually used by the editor.')
    console.log('But you can use it to extend the editor features.')
    console.log('And create your own custom editor on top of this one.')
    console.groupEnd('Editor custom (drop) event')
  }

  handleSubmit = event => {
    event.preventDefault()
    console.group('Form submit')
    console.log('Because the editor is just a textarea at the end of the day.')
    console.log('You can wrap it in a HTML `<form>` tag and use it as part of a common form')
    console.log('If you submit it, the editor field name it\'s `value`.')
    console.log('That name can be customized if you set it as a prop of the `Field` component.')
    console.groupEnd('Form submit')
  }

  setRef = editor => {
    console.group('Editor ref')
    console.log('We can also get the editor instance ref.');
    console.log('This can allow us to call editor methods to update the internal value.');
    console.log('That way we can extend our editor.');
    console.log('And implement features like Drag&Drop of images.');
    console.groupEnd('Editor ref')
    this.editor = editor;
  }

  render() {
    return (
      <form onSubmit={this.handleSubmit}>
        <Editor
          name="main-editor"
          defaultValue="**Initial _editor_ value**"
          onChange={this.handleChange}
          onDrop={this.handleDrop}
          editorRef={this.setRef}
        >
          <ButtonBar>
            <ButtonGroup>
              <Bold><strong>B</strong></Bold>
              <Italic><em>I</em></Italic>
              <Underline>U</Underline>
            </ButtonGroup>

            <ButtonGroup>
              <Code>Insert code</Code>
              <Link>Link</Link>
              <Image>Image</Image>
            </ButtonGroup>

            <ButtonGroup>
              <OrderedList>OL</OrderedList>
              <UnorderedList>UL</UnorderedList>
              <Quote>Q</Quote>
              <Heading>H</Heading>
              <Youtube>Y</Youtube>
            </ButtonGroup>
          </ButtonBar>

          {/* you can use any DOM element or event custom components */}
          <div>
            <Preview />
            {/* you can force an initial height for the field if it's server rendered */}
            <Field style={{ height: '39px' }} />
          </div>

          <EmojiBar />
        </Editor>
        <button type="submit">Send form</button>
      </form>
    )
  }
}

export default MyEditor

Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].