Coder Social home page Coder Social logo

roosterjs's People

Contributors

adjective-object avatar andres-ct98 avatar bryanvalverdeu avatar cyanzhong avatar dependabot[bot] avatar florian-msft avatar flyingbee2012 avatar francismengms avatar francismengx avatar gm-al avatar haven2world avatar ianeli1 avatar jingweixiong avatar jiuqingsong avatar juliaroldi avatar jvillalobos avatar kenotron avatar lego6245 avatar lufedi avatar marcinkiewicz avatar melvsparks avatar premnirmal avatar rain-zheng avatar redmondbowang avatar romanisa avatar shaipetel avatar stephenark30 avatar titrongt avatar tshibley avatar vhuseinova-msft 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

roosterjs's Issues

Support AMD module

We should consider supporting AMD module when compile and publish.
One solution is to have different lib folders, such as
lib
lib-amd
...

RoosterJS: Editor only has list or table, content is not inserted properly for inserting at begin or end

RoosterJS base its insertion on object model.
For inserting at begin, it finds first block and insert content before it.
For inserting at end, it finds last block and insert content after it.

The current object model in RoosterJS has the block concept which essentially represents a parsing boundary, and is not equipped with Table or List. A List item or a table cell is a block, but beyond that (list or table), object model does not know.

So when you insert at end, and the end happens to be a table cell. The content will be inserted after the cell, but before the closing TR/Table.

A possible fix, as I discussed with Jia is to introduce a ContentBlock concept to representing block larger than block we have, i.e. TR, Table, List. BlockElement cannot be nested, but ContentBlock can be nested. For inserting at end and end is a table cell, we should go from a block element, and find topest Content Block and insert after.

Regards,
Nick Huang

Image Resize Plugin isn't compatible with touch + pen

Describe the bug
Touch + pen isn't supported when trying to resize image, page just pans
Also, drag target/red blocks are really small for touch

Device Information

  • OS: Windows 10 RS3
  • Browser Edge and Chrome

Additional context
Pen seems to be working for RS2

Circular dependency in roosterjs-editor-dom

We are trying to import roosterjs-react into our product and in process, have a step that ensures that the plugin being imported has no circular dependencies.
Unfortunately, importing roosterjs-editor-dom is causing this step to fail due to the following circular dependency:

Circular dependency in modules.
Attempting to add
roosterjs-editor-dom\lib\blockElements\NodeBlockElement.js

Dependencies:

  • roosterjs-editor-dom\lib\domWalker\getInlineElement.js
  • roosterjs-editor-dom\lib\domWalker\getBlockElement.js
  • roosterjs-editor-dom\lib\blockElements\NodeBlockElement.js

Do you think we can have a single dist file or are there any other ways to address this?

AltGr is treated as CTRL in Polski in Edge

Describe the bug
AltGr+Z should input ż, but not trigger Undo

To Reproduce

  1. Switch language to Polski
  2. Press AltGr (right Alt) + Z

Expected behavior
Type "ż"

Device Information

  • Browser Edge

Undo should allow empty snapshot

There is a check in undo code:
if (snapshot) ...

This check will fail when snapshot is an empty string. We should allow empty string as snapshot.

Highlighting without selection

In office apps, when you use highlighting without any selection, then click on highlight will initiate the highlight and will highlight everything I select until I release the cursor. that is not the experience i see in the new rich text contro

Issue with BIU

Describe the bug
Sometimes Ctrl+I can't cancel italic style, similar with B,U

To Reproduce
Steps to reproduce the behavior:
(1) Type something
(2) Press 'ctrl+i'
(3) Continue typing, now in italics, and finish a word without hitting space
(4) Press 'ctrl+i'
(5) Hit space, and continue typing

Expected behavior
Not italic anymore

Device Information

  • OS: Windows 10
  • Browser Chrome 69, Edge 17.17134

Consider smart merging list elements

User may accidentally create multiple list element without other content between them, such as
[ul] content [/ul]
[ul]
[ul]
content...
[/ul]
[/ul]

The render result looks good but the actual HTML structure is wrong here. We should merge the two top-level [ul] tag into single one.

Style of numbers in number list is different with main text

Describe the bug
Style of numbers in number list is different with main text

To Reproduce
Steps to reproduce the behavior:

  1. Change font size to some larger ones, type something
  2. Go to a new line, type "1." and a space, then it becomes a number list
  3. Type something
    Then you will see "1." is smaller than the text

Expected behavior
the number "1." should have the same font size with text

how to modify enter tag with p?

Describe the bug
Why is enter tag div instead of P?
To Reproduce

Expected behavior
enter tag is p

Screenshots

Device Information
all

Additional context
how to modify enter tag with p?

Undo Selection Marker logic prevents certain content from be replaced

To Reproduce
Steps to reproduce the behavior:

  1. Initialize the editor with this content:

<div>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</div><ol><li>BBBBBBB BBBBBBB BBB BB BBBBBBBBBB BB BBBBBBB BBB BB BBBBBBBBBBB (2d)<ul><li>a</li><li>CCCCCCCCC CCCC: CCCC CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCoCCCCCC</li></ul></li></ol><ol><li>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (5d)</li><li>UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU. (3d)</li><li>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</li></ol>

  1. Open the sample site in Edge and select the first line (e.g. double click it), or the last line
  2. Press a key on the keyboard like 'a', text isn't replaced

Expected behavior
Text should be replaced

(sometimes it works, most times it doesn't)

Investigation so far
It looks like if you're trying add or remove elements (in this case the SPAN marker) under keypress event, there is a race condition which prevents your text from being replaced.

I've also made an attempt to fix the issue by using attribute only markers--adding them to the node's parent attribute list (this includes the node's index). There's at least one problem with this solution: the node's parent could be the contenteditable div itself, but the original issue is fixed.

A different attempt involved clearing the current selection and setting it back after calling remove markers, but that doesn't work (the selection range was created from scratch too).

Important: when I was investigating, I had to comment the code in ShowFormatState and ShowCursorPosition sample plugins as they also modify elements on the page to locate the source of the issue.

Device Information

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]: Edge
  • Version [e.g. 22] 42.17134.1

Additional context
Add any other context about the problem here.

When toggle header on header elements, selection is lost

When toggle header on existing header elements, we will unwrap the header elements first, this cause the selection to be lost, thus only the line where cursor is located (most likely the last line in original selection) gets toggled.

insertNode inserts text into the watermark placeholder span

Using the following code snippet:

        this.editor.addUndoSnapshot();
        let contentElement = this.createNodeFromContent(content); // creates a <span> with the contents
        this.editor.insertNode(contentElement, {
            position: ContentPosition.Begin,
            updateCursor: true,
            replaceSelection: false,
            insertOnNewLine: false,
        });
        this.editor.triggerContentChangedEvent('Source');

If the editor has a watermark placeholder, the content is inserted into the span containing the watermark. The content is then removed when the watermark is removed from the triggerContentChangedEvent call.

with redux

How to combine Redux, for example, multiple editor instances, to save a history to reudx, and use redux-undo to undo/redo

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.