Code Monkey home page Code Monkey logo

draft-wysiwyg's People

Contributors

akiran avatar jamesbillinger avatar marcelometal avatar remko avatar vnovick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

draft-wysiwyg's Issues

Can’t moving focus from an image to an adjacent image using up/down arrow.

Here is a gif for it, the key press sequence is: down, down, up, up.

gif


I think part of the reason is draft-js-focus-plugin:L43..L45, in which the activeBlock is undefined and the condition in if will always be false.

But I suspect by setting the selectionState focus to the block-focus still won't make it focused, because the block-focus doesn't handle the update of the selectionState. Meanwhile I think neither handling the update of selectionState nor setting focus directly from another block-focus would be an easy solution here, what's your idea?

Thanks, and also thanks for your project!

decorator is not defined

I'm trying to call AddBlock with asJson = true, but I'm getting an error:
Uncaugh ReferenceError: decorator is not defined

This is my code (relevant lines):

import {AddBlock, RemoveBlock} from 'draft-wysiwyg/lib/draft-utils';

this.change(AddBlock(editorState,this.refs.draft.state.value.getSelection(), 'image', {url:imagePath}, true));

It looks to me like the following lines in add-block.js are to blame.


    if (!editorState) {
        editorState = _draftJs.EditorState.createEmpty(decorator);
    }
    // If json -> convert to editorstate
    else if (asJson) {
            editorState = _draftJs.EditorState.push(_draftJs.EditorState.createEmpty(decorator), _draftJs.ContentState.createFromBlockArray(convertFromRaw(editorState)));
        }

Maybe this is not a fully developed feature...or maybe I'm doing something wrong. Let me know if thoughts.

By the way, I used to do the conversion to JSON myself, but I started getting errors following a recent upgrade. I will see if I can get that fixed as well so that I don't have to rely on asJson.

Abandoned. Use this instead.

I'm sure you came here because it was the first thing on google you saw when searching for a draft.js wysiwyg editor.

What you will soon discover is that this project is abandoned, with no documentation, and the author also did not commit the source code used in the demo you also likely saw (running on a free tier heroku server).

Go here instead for a draft.js wysiwyg editior

Compatibility with draft-js-mention-plugin and draft-js-emoji-plugin

Hi, I'm wondering if draft-wysiwyg is compatible with draft-js-mention-plugin and draft-js-emoji-plugin. With draft-js-emoji-plugin and draft-js-mention-plugin, we have to import the component for displaying suggestions using the instances of those plugin:

const emojiPlugin = createEmojiPlugin();
const { EmojiSuggestions } = emojiPlugin;
const mentionPlugin = createMentionPlugin();
const { MentionSuggestions } = mentionPlugin;

Can anyone point me to the right direction of how insert it properly to the createPlugins() function? Thanks.

Not sure how to use

Hello!

First, congrats for this awesome job. It is the best editor I've seen, and it is exactly what I'm looking for (:

I installed, imported and tried to use without success. What are the required props?

Here is my code:

import RichEditor from 'draft-wysiwyg'
import {RichUtils} from 'draft-js';

constructor(props){
    super(props);
    this.state = {
        textoState: '',
    }
 }

  handleChangeTexto = (text) => {
    this.setState({textoState: text});
  }

render(){
  return(
    <RichEditor
              onChange={data=>this.handleChangeTexto(data)}
              value={''}
              cleanupTypes="*"
              sidebar={0}/>
  )
}

What am I missing? =(

Example source code.

Hi, I used your editor back when version was 0.0.26. Now, using the same code I used back then does not work. Would it be possible for you to post the example source code (if it's up to date with the current version of the editor) to check out what exactly changed?

How to change real image dnd ?

This draft-wysiwyg is awesome.
I have some issues.
When drag image to editor, image upload to server and render base64 on client.
screen shot 2016-10-22 at 10 20 37 am
But i want to change to real image src?
How to change it?
Thanks you. ^_^

Unable to initialize contents from storage

This is a cool editor if the heroku app example is to be believed.

However, it doesn't work. I can't get it to render document contents from my store. I've tried replicating what you have in your example, and I've tried using other people's examples. After a couple of days, I think what I really need is for someone to update the documentation and clearly indicate

  1. What sort of type needs to go into the value props. Neither the example, nor the source is using PropType validation so all I have are best guesses, which is clearly not good enough.
  2. How to get from whatever you're storing in your DB, in very clear terms, to what the Wysiwyg editor component expects.

I cannot adequately express how disheartening it is to run across an impressive library like this only to run into an inability to use it because of documentation problems.

Please address this or give me some help.

Thanks very much for your time.

Usage

Excuse me , how can i use this awesome plugin in my project,thank you

Build fail - draft-wysiwyg\example\browser.js Unexpected token (7:2)

C:\dev\projects\draft.js\node_modules\draft-wysiwyg>npm run build:example

> [email protected] build:example C:\dev\projects\draft.js\node_modules\draft-wysiwyg
> gulp build

(node:20008) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[13:03:30] Using gulpfile C:\dev\projects\draft.js\node_modules\draft-wysiwyg\gulpfile.js
[13:03:30] Starting 'build'...
[13:03:31] [webpack:build-dev] Hash: 4bed3731292b2b3ad3d5
Version: webpack 1.13.2
Time: 158ms
     Asset       Size  Chunks             Chunk Names
    app.js  632 bytes       0  [emitted]  app
app.js.map   95 bytes       0  [emitted]  app
chunk    {0} app.js, app.js.map (app) 28 bytes [rendered]
    [0] multi app 28 bytes {0} [built] [1 error]

ERROR in ./example/browser.js
Module parse failed: C:\dev\projects\draft.js\node_modules\draft-wysiwyg\example\browser.js Unexpected token (7:2)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (7:2)
    at Parser.pp$4.raise (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:2221:15)
    at Parser.pp.unexpected (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:603:10)
    at Parser.pp$3.parseExprAtom (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1822:12)
    at Parser.pp$3.parseExprSubscripts (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1715:21)
    at Parser.pp$3.parseMaybeUnary (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1692:19)
    at Parser.pp$3.parseExprOps (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1637:21)
    at Parser.pp$3.parseMaybeConditional (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1620:21)
    at Parser.pp$3.parseMaybeAssign (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1597:21)
    at Parser.pp$3.parseExprList (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:2165:22)
    at Parser.pp$3.parseSubscripts (C:\dev\projects\draft.js\node_modules\draft-wysiwyg\node_modules\webpack\node_modules\acorn\dist\acorn.js:1741:35)
 @ multi app
[13:03:33] Finished 'build' after 2.41 s

C:\dev\projects\draft.js\node_modules\draft-wysiwyg>npm -v
3.10.3

C:\dev\projects\draft.js\node_modules\draft-wysiwyg>node -v
v6.4.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.