editor.js icon indicating copy to clipboard operation
editor.js copied to clipboard

Multiple

Open kamalkech opened this issue 1 year ago • 0 comments

Question

i found multiple element (button +) image

In file constant i put list tools :

import Embed from '@editorjs/embed'
import Table from '@editorjs/table'
import List from '@editorjs/list'
import Warning from '@editorjs/warning'
import Code from '@editorjs/code'
import LinkTool from '@editorjs/link'
import Image from '@editorjs/image'
import Raw from '@editorjs/raw'
import Header from '@editorjs/header'
import Quote from '@editorjs/quote'
import Marker from '@editorjs/marker'
import CheckList from '@editorjs/checklist'
import Delimiter from '@editorjs/delimiter'
import InlineCode from '@editorjs/inline-code'
import SimpleImage from '@editorjs/simple-image'

export const EDITOR_JS_TOOLS = {
  embed: Embed,
  table: Table,
  marker: Marker,
  list: List,
  warning: Warning,
  code: Code,
  linkTool: LinkTool,
  image: Image,
  raw: Raw,
  header: Header,
  quote: Quote,
  checklist: CheckList,
  delimiter: Delimiter,
  inlineCode: InlineCode,
  simpleImage: SimpleImage,
}

In file editor component

import React, { useEffect } from 'react'
import EditorJS from '@editorjs/editorjs'
import { EDITOR_JS_TOOLS } from './constants'

const Index = () => {
  useEffect(() => {
    new EditorJS({
      holder: 'editor',
      tools: EDITOR_JS_TOOLS,
    })
  }, [])

  return <div id='editor'></div>
}

export default Index

in page i put this

const Editor = dynamic(import('../components/editor'), { ssr: false })

const Home: NextPage = () => {
  return <Editor />
}

export default Home

kamalkech avatar Aug 29 '22 23:08 kamalkech