Giter VIP home page Giter VIP logo

carbon's People

Contributors

mkhatib avatar rashahussein avatar saada avatar saadshahd 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  avatar  avatar  avatar

carbon's Issues

Writing English should switch the paragraph to be LTR in RTL mode

In RTL mode, if user starts typing LTR-language, should we switch that paragraph to LTR.

Currently, for example, all code blocks are LTR regardless of the mode.

This also applies to the other situation where we have the editor in LTR mode and the user wrote an RTL paragraph - should that switch the paragraph to RTL.

Load content from Html

Hi,

Congrats for this nice tool.
I'm trying it to see if it can replace an old Wysiwyg editor in a CMS.

The thing is at this time, contents are store in the database as HTML.

In the editor description you say "It is built on top of an internal model for an article that clients can translate to and from JSON and HTML".

But I was not able to find a way to load HTML content.
Is this option already available ?
Or can you advice a way to do such a thing ?

Thanks for your answer.

Regards.

Weird behavior

I faced a weird behavior when hit the Shift+Enter to get down by one line, and I lost the whole paragraph. Also the one line down is not supported so far ?

Adding links

The inline-formatting toolbar should allow users to add links.

Strange Input when writing/editing

Sometimes the cursor gets a mind of it's own and jump back or forth , tested on the demo site using ios 9.2 .

Also if i put cursor on word and select a replacement from the virtual keyboard , sometimes the words get jumbled

Create Photo Collages When User Upload Multiple Photos

When uploading multiple photos we'd like to insert a collage layout(s) that split the images in a nice way. Similar to what Medium.com does.

The main idea is that when the user selects multiple photos, we need to create multiple layouts. One way to go about this is by creating multiple row layouts to insert three (or more) images per row with the same height. We don't have a row layout but we can create one. flexbox might be useful here but I don't think it's necessary just limiting the height of the image would do nicely I believe.

screen_shot_2016-01-20_at_8 22 52_pm

Lists Deletion is Buggy

When having multiple lists with multiple items in a long document, try to select all and delete. This needs further investigation.

Keyboard Shortcuts for Formatting

Ctrl/Cmd+B ▶️ bold
Ctrl/Cmd+i ▶️ italic
Ctrl/Cmd+k ▶️ link
Ctrl/Cmd+Alt+1/2 ▶️ h1/h2
Ctrl/Cmd+Alt+0 ▶️ un-header (p)

Video Component

Similar to Figure component, we need a video component for HTML5 videos.

After introducing this, this would allow us also to allow uploading videos and inserting the VideoComponent for them - And will also enable us to build +velfie/+vlog for quick video selfie recording 🐼

Preserve Formats of List Items when Pasting

Pasting seems to strips out the formatting of list items. For example, if you copy the following list and paste it into a Carbon editor, it will remove the bold and italic.

  • Hello World
  • Goodbye Now

This can be handled inside Editor.processPastedContent method.

Inserting Lists

Ordered and unordered lists, whether through syntactic analysis and replacement (typing "1." followed by space at the beginning of the line would trigger an ordered list) or through formatting bar.

EmbeddedComponent Loading Placeholder

While the embedded components are being loaded, we need to present a nice placeholder in place of the component that takes the same size. We need a way to listen to render finished events and hide that placeholder and show the rendered embed.

Implement Article.trim()

This would remove blank paragraphs components at the start and the end of the article. For example calling it on an article that has something like the following:

<p></p>
<p>   </p>
<p>Hello</p>
<p>&nbsp;</sp>
<p></p>

Would result in the following:

<p>Hello</p>

Any Links Embed Card

We need a way to paste a mnshar's specific article url to get it embedded.
like https://www.manshar.com/articles/0000 then got a frame for it like youtube's or other's component's ones.

Formatting Toolbar

The formatting toolbar need to trigger on selecting text with mouse or keyboard selections. This needs to support basic formatting, bold, italic, link, quote, h1, h2 and code.

Firefox compatibility

There are many issues many other browsers than chrome.
I had many issues recently while I am using Firefox but this is the worst.
I wrote an article in a simple text editor then I copied it to manshar :
this picture

هناك عدة مشاكل مع المتصفحات ما عدا كروم.
منذ فترة بدأت استعمال فيرفوكس وواجهتني عدة مشاكل ولكن كانت هذه هي الأسوأ:
this picture

Inserting Images using URL or Upload

Allow inserting Images using URL (by detecting a pasted image link and by formatting bar) and upload by formatting bar or by a separate side-toolbar.

Handle Enter inside figcaption of a staged component

Repro:

  • Have a figure as the last component in the document
  • Type something in its caption
  • Hit Enter
  • Observe that instead of creating a new single-column layout it and inserting the paragraph in it
  • It inserts the paragraph inside the staged layout which should never happen.

Missing instructions on installing json-tree?

So I tried running git submodule init and then grunt serve. The demo ran fine but I can't see the json-tree generated on the right-hand side at all.
Not sure what I'm doing wrong.
Thanks

Required Components

This allows clients to require the user to enter specific input, for example requiring the article to have a title (h1 Paragraph) and a subtitle (h2 Paragraph) and an image. This would prevent the user from deleting these required components and show a simple error message when the user tries to delete them.

Selecting a non-text component and copying doesn't work

When selecting a single non-text component (figure, embed) copying and pasting doesn't work.

Not sure what would copying a selected figure means, does it copy the source of the figure or does it copy to dom tree of it.

Support for Code Blocks & same-paragraph multi-line text

Currently we have no way for users to write a large block of code. The current support is limited to single-line code and paragraphs. There isn't a way to insert a \n or <br> characters to allow smaller line height.

As mentioned in #42. One suggestion from @RashaHussein to implement this is to add a class for special paragraphs to treat them as "lines", for example one can have the following to signify that these shouldn't be padded as the normal paragraphs:

<p class="nomargin">Line 1</p>
<p class="nomargin">Line 2</p>
<p class="nomargin">Line 3</p>

Of course one could add some logic to handle \n or <br> instead, this requires some more thoughts and discussion on which way to go.

As for code blocks, we could aim to achieve something similar to Lists, where the UL element would have a special class like .code-block and the LIs representing lines of codes. Using a similar logic (or the same - logic) as Lists also could give us the tab-to-indent logic for both code and normal lists.

<ul class="code-block">
  <li>def sayHello(name):
  <li>    print 'Hello, ', name
</ul>

Instant Photos Filters

Allow the users to select pre-defined filters (instagram-like) to apply on photos.

There are multiple ways one can accomplish this, one by just sticking with CSS properties that allow us to do that, the other is by more advanced methods with some canvas manipulations. I think we should start with experimenting with pre-defined filters with classnames.

See:

Fix Broken Tests

After npm install, I ran into this issue

$ grunt test
Running "browserify:tests" (browserify) task
>> Bundle build/editor.spec.js created.

Running "jshint:dist" (jshint) task
>> 9 files lint free.

Running "jshint:test" (jshint) task
>> 7 files lint free.

Running "karma:continous" (karma) task
INFO [karma]: Karma v0.12.37 server started at http://localhost:8080/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: Connected on socket 4nCswkj99XcDPqfMO15e with id 4897509
PhantomJS 1.9.8 (Mac OS X 0.0.0) Article should return the json model FAILED
    Expected Object({ sections: [ Object({ paragraphs: [ Object({ name: '12', text: '', paragraphType: 'p', formats: [  ] }) ] }) ] }) to equal Object({ sections: [ Object({ paragraphs: [ Object({ text: '', name: '12', paragraphType: 'p' }) ] }) ] }).
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3669
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor should initialize listeners on initilaization FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3805
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should handle Enter key FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3828
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should handle backspace key FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3884
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should handle delete key FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3925
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should remove selected text when backspace FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3966
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should remove selected text when typing character FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4000
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should not remove selected text when non-changing key FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4033
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handleKeyDownEvent should undo/redo FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4066
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.handlePaste should call processPastedContent FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4093
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.processPastedContent should generate single operation for inline content FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4107
PhantomJS 1.9.8 (Mac OS X 0.0.0) Editor Editor.processPastedContent should generate proper operations when pasting multi-line FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.handleKeyDownEvent.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:2108
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:367
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4121
PhantomJS 1.9.8 (Mac OS X 0.0.0) Paragraph should return the json model FAILED
    Expected Object({ name: '1234', text: 'hello', paragraphType: 'p', formats: [  ] }) to equal Object({ name: '1234', text: 'hello', paragraphType: 'p' }).
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4205
PhantomJS 1.9.8 (Mac OS X 0.0.0) Section should return a json model FAILED
    Expected Object({ paragraphs: [ Object({ name: '12', text: '', paragraphType: 'p', formats: [  ] }), Object({ name: '23', text: 'Hello p1', paragraphType: 'p', formats: [  ] }) ] }) to equal Object({ paragraphs: [ Object({ text: '', name: '12', paragraphType: 'p' }), Object({ text: 'Hello p1', name: '23', paragraphType: 'p' }) ] }).
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4283
PhantomJS 1.9.8 (Mac OS X 0.0.0) Selection should initialize event listeners FAILED
    TypeError: 'undefined' is not a function (evaluating 'this.updateSelectionFromWindow.bind(this)')
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:3348
        at /Users/saada/HackHackHack/Projects/manshar/editor/build/editor.spec.js:4349
PhantomJS 1.9.8 (Mac OS X 0.0.0): Executed 42 of 42 (15 FAILED) (0.026 secs / 0.014 secs)
Warning: Task "karma:continous" failed. Use --force to continue.

Aborted due to warnings.

Is there a special way to setup PhantomJS?

Embedding YouTube Videos

The editor should allow the insertion of youtube videos and playlists through side-toolbar or through detecting pasted YouTube link.

Delete key is broken

For some weird reason it actually inserts a character now instead of deleting.

Pasting a big chunk of Code

Automatically detect the pasted content is code and format it accordingly (regardless if the copied content is already formatted or not).

This is blocked by #59

Implement an API to check in-progress attachments

This API would be something like editor.getAttachments(optIncludeFinished) and returns the list of attachments objects that are still being processed (uploaded or otherwise). If the optIncludeFinished parameter is passed true, it should return all attachments that has been added to the editor.

More thinking needs to go into this and how we handle attachments in general.

Handle Cut Events

Currently, we don't handle cut events at all, falling back to the browser handling which breaks the model representation of the article.

Process Pasting Embedded Videos/Embeds

When users copy a large block of text with a YouTube embed for example the embed is stripped out and not processed.

Typically we need to get the embed source and create an EmbeddedComponent for them. One challenge might be is that I am not sure oembed endpoints would return the correct results when using the embed src. Usually the normal link and the embed source are different, for example:

Embedly oembed endpoints seem to catch both type of URLs for YouTube.

Refactor Text Input Handling

Input handler is being called on every input event which causes the typing experience to lag and have some delays.

The idea is to debounce the handler and write better logic to understand what was deleted or inserted to run specific operations insertChars and deleteChars instead of updateComponent.

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.