0.1.15 • Published 4 years ago

slidtor v0.1.15

Weekly downloads
4
License
MIT
Repository
-
Last release
4 years ago

Slidtor

This is a project to make text editor using Slate.

This project was bootstrapped with Create React App.

Usage

yarn add slidtor

import React from "react";
import Slidtor from "slidtor";
import "slidtor/build/index.css";

const initialValue = [
  {
    children: [
      {
        text: "In addition to block nodes, you can create inline nodes, like "
      },
      {
        type: "link",
        url: "https://en.wikipedia.org/wiki/Hypertext",
        children: [{ text: "hyperlinks" }]
      },
      {
        text: "!"
      }
    ]
  },
  {
    children: [
      {
        text:
          "This example shows hyperlinks in action. It features two ways to add links. You can either add a link via the toolbar icon above, or if you want in on a little secret, copy a URL to your keyboard and paste it while a range of text is selected."
      }
    ]
  }
];

const tools = [
  ["bold", "italic", "underline", "strikethrough"],
  ["numberedlist", "bulletedlist"],
  ["h1", "h2", "h3"],
  ["blockquote", "code"],
  ["link", "image", "embed"]
];

export default function App() {
  const onValueChange = value => {
    console.log(value);
  };

  return (
    <div className="App">
      <Slidtor value={initialValue} tools={tools} onChange={onValueChange} />
    </div>
  );
}

Available Scripts

In the project directory, you can run:

yarn start

Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

0.1.15

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.8

4 years ago

0.1.9

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago