Skip to content

Releases: microsoft/roosterjs

RoosterJs 9.7.0

01 Jul 18:30
288231d
Compare
Choose a tag to compare

Feature Improvements

  • To make possible to disable the Tab Key handling, the option handleTabKey was added in the EditPlugin to turn off the plugin handling. (#2730 #2729)

What's Changed

Full Changelog: v9.6.0...v9.7.0

RoosterJs 9.6.0

14 Jun 18:54
739441d
Compare
Choose a tag to compare

What's Changed

RoosterJs 9.5.0

10 Jun 18:34
a681123
Compare
Choose a tag to compare

Breaking change notification

When upgrade to 9.5.0, you may see build time failure that complains some object is readonly. This is expected.

From 9.5.0, the API formatContentModel will give you a readonly content model. To modify it, you need to call mutateBlock
to the blocks that you want to modify. For example:

const block = model.blocks[0]; // Assume we have a block here

block.format.direction = 'ltr'; // Error: Cannot modify readonly properties

const mutableBlock = mutateBlock(block);

mutableBlock.format.direction = 'ltr'; // OK

Similary, if you want to modify a segment under a block, you can do any of below:

function test1(para: ReadonlyContentModelParagraph) {
  para.segments[0].format.fontSize = '10pt'; // Error, segments[0] is readonly
  
  const mutableBlock = mutateBlock(para); // Once convert to mutable object, all its segments are also mutable now
  
  mutableBlock.segments[0].format.fontSize = '10pt'; // OK
}

function test2(para: ReadonlyContentModelParagraph, segment: ReadonlyContentModelSegment) {
  mutateSegment(para, segment, (mutablePara, mutableSegment) => {
    mutableSegment.format.fontSize = '10pt'; // OK
  }
}

With API mutateSegment, it allows you convert a segment to be mutable without re-retrieving it from the paragraph.
Note that this API only work when thet given segment is actually a direct child of the given paragraph, otherwise
the callback will not be called.

There are some other functions that can also convert result to be mutable by adding a parameter, for example

const segments = getSelectedSegments(model, false /*includingFormatHolder*/, true /*mutate*/);

The 3rd parameter "true" makes the return value mutable. This parameter is also supported by the following functions:

  • getSelectedSegmentsAndParagraphs
  • getSelectedSegments
  • getSelectedParagraphs

Please note that when convert a block to be mutable, it will lose its cached DOM element. So next time when rewrite to DOM tree,
it will need to be regenerated. So to improve performance (this need to turn on an experimental feature "PersistCache" for now),
try not convert object to be mutable until you really need to.

To enable the experimental feature to improve cache, do

const editor = new Editor(div, {
   ...
   experimentalFeatures: ['PersistCache']
});

Bug fix

  • Fix cut table issue (#2659)
  • Fix paste narrow content issue (#2661)
  • Fix scroll issue when press SHIFT+TAB in table (#2654)
  • Table edit back fixes (#2664, #2678)
  • Fix auto format trigger event (#2684)

Improvement

  • Readonly types improvement (#2649, #2650, #2651)
  • Fix line height issue when paste from Word (#2677)
  • Port ImageEdit plugin (#2670, #2561)
  • Merge Link & Image Format when using MergeModel (#2681)
  • Provide our own implementation of scrollCaretIntoView (#2685)
  • Let Content Model handle ENTER key (#2610)
  • Allow customization of color key generation (#2682)
  • Skip same format from LI (#2683)

Engineering improvement

  • Fix test issue in TableEditPlugin (#2675)
  • Add readme file for roosterjs-editor-adapter package (#2674)
  • Delete legacy packages (#2660)

RoosterJs 9.4.0

28 May 19:32
10c1d9d
Compare
Choose a tag to compare

Bug fix

  • Do not apply Table selection if table is not editable (#2628)
  • Fix #2633 scrollCaretIntoView causes unexpected scroll (#2634)
  • Fix cursor jump issue when applying Gboard suggestions (#2638)
  • Auto link for link preview (#2653)
  • Fix Table first column (#2652)

Improvement

  • Added tableCellSelectionBackgroundColor option (#2640)
  • Add dark color handling for table and image selection (#2647)
  • Content Model cache improvement (#2629, #2641, #2642, #2643, #2648)
  • Optimise content model table fetching for Table Edit Plugins (#2656)
  • Fix normalisation and First Column issues (#2657)

RoosterJs 9.3.0

10 May 18:58
1822d18
Compare
Choose a tag to compare

New features

  • Move table (#2624, #2599)
  • Allow customization when convert from content model to plain text (#2605)

Improvement

  • ImageEdit: keep wrapper SPAN for image selection (#2609)
  • Updated watermark property access modifier to protected (#2614)
  • Move Content Model type files into contentModel folder (#2602)
  • Add undo snapshot when mouse down if there is new content after last undo snapshot (#2604)
  • Scroll caret into view when call formatContentModel (#2617)
  • Do not allow getting connected model (#2615)
  • Updated isModelEmptyFast to consider changed indentation as not empty string (#2625)

Bug fix

  • Hide watermark when input with IME (#2611)
  • Fix the link hint still exists after deleting the picture with the link (#2600)

Engineering improvement

  • Allow debug test cases in Firefox (#2620)

RoosterJs 9.2.0

30 Apr 16:18
b71ce2f
Compare
Choose a tag to compare

Bug fix

  • Fix the cursor jump issue after deleting an Entity on Android (#2577)
  • Fix on webkit-based applications, the selection will become empty after copy, and focus will cause the window to scroll to the top (#2571)
  • Preserve reverted selection info in Content Model (#2580)
  • Fix empty text in markdown plugin (#2582)
  • Allow Shift+Delete to Cut (#2585)
  • Fix #2584: Safari context menu event causes selection to be expanded (#2584)
  • Fix #2575 Entity delimiter cursor moving (#2581)

Improvement

  • Port PickerPlugin to new editor (#2569)
  • Port AnnouncePlugin step 1 (#2589, #2591, #2592)
  • Port Custom Replace Plugin (#2594)
  • Port Auto fraction and ordinals (#2595)
  • Use percentage for max-width of newly inserted image (#2579)
  • Improve AutoFormatPlugin (#2583)
  • Trigger AutoLink (#2598)
  • Select image after inserting it (#2593)
  • Allow hotkey Ctrl-Shift-Z on Windows (#2607)

New feature

RoosterJs 9.1.0

15 Apr 17:37
fb71360
Compare
Choose a tag to compare

Improvement

  • Port MarkDown plugin (#2527, #2563)
  • Port TAB key feature for table (#2536, #2529)
  • Improve backspace on list (#2555)
  • Image selection improvement (#2556, #2557, #2554)
  • Port Hyperlink plugin (#2560)
  • Export formatTextSegmentBeforeSelectionMarker (#2565)

Bug fix

  • Fix bug in AutoFormatPlugin about auto list (#2549)
  • Fix selection issue on void element (#2551)
  • Prevent ScrollTop to be lost when the focus is done to the editor (#2564)
  • Fix extra empty line generated when get plain text (#2566)
  • Fix #2500 Hyperlink misses color (#2570)

Engineering improvement

  • Set default format in demo site (#2559)
  • Clean Demo Site: Remove ContentEdit Plugin (#2562)

RoosterJs 9.0.0

01 Apr 19:42
36a86bc
Compare
Choose a tag to compare

Start from RoosterJs 9.0.0, the editor is built based on a middle layer called "Content Model". All formatting behavior will happen on top of this middle layer, directly DOM operation will be avoided as much as possible.

For more information about migrating to 9.0.0, please see here

Content Model Editor improvement

  • Enabled Content Model cache by default (#2498)
  • Port plugin: WatermarkPlugin (#2503, #2546)
  • Port plugin: TableCellSelection (#2506)
  • Port plugin: ContentEdit
    • Handle Enter key (#2497)
    • Do not prevent Shift+ Tab behavior (#2514)
    • Unlist after backspace (#2535)
    • Undo Auto link by backspace (#2522)
    • Disable auto format features by default to avoid conflict with old plugins (#2541)
  • fix convertGlobalCssToInlineCss() to process pseudo-classes correctly (#2493)
  • Add setLogicalRoot API (#2492)
  • Fix paste issue for repaste (#2516)
  • Fix bug for auto complete (#2517, #2520)
  • Remove a redundant parameter from domToContentModel (#2521)
  • Do not update the segment format if it have a value when pasting from excel (#2532)
  • Fix format button does not work in Safari when WatermarkPlugin is enabled (#2530)
  • Fix exportContent to return the complete editor content even with custom logical root (#2531)
  • Allow passing in sanitizing options when create Content Model from HTML (#2543)
  • Leverage DOMInsertPoint, remove posContainer/offset (#2538)
  • Allow insert entity to a specified position without changing selection (#2537)
  • Remove parameter "reduced" from editor.getContentModelCopy (#2539)
  • Set isSelected to false for formatHolder of list item (#2540)
  • Fix a bug with cached model (#2547)

Code organization

  • Move public type definitions into roosterjs-content-model-type package (#2502)
  • Reorganize core API and core Plugin files (#2501)
  • Move non-core files from roosterjs-content-model-core to roosterjs-content-model-dom (#2518)

Roosterjs-react improvement

  • Added iconProp for ContextMenuItem (#2526)

Engineering improvement

  • Import model document into demo site (#2509)
  • Add tabs to demo site and PresetPlugin (#2511)
  • Add eslint rule to disallow default export (#2515)
  • Prepare publish roosterjs v9 (#2490)
  • Fix builddoc script to correctly build document for content model (#2544)
  • Fix demo site js error in side pane (#2545)
  • Auto bump
    • Bump follow-redirects from 1.15.4 to 1.15.6 (#2512)
    • Bump express from 4.18.2 to 4.19.2 (#2542)

RoosterJs Content Model 0.28.0 and RoosterJs 8.61.0

18 Mar 21:10
c7c1259
Compare
Choose a tag to compare

Create a standalone editor on top of Content Model

  • Reorganize source code (#2464)
  • Add quote feature to Content Model editor (#2461)
  • Add shortcut for arrow keys (#2470)
  • Add function normalizeRect(#2482)
  • Add AutoLink feature (#2479, #2485)
  • Clean up core API (#2481)

Improvements

  • Support "("+trigger character in PickerPlugin (#2478)
  • Merge BlockFormat when merging the first paragraph (#2477)
  • Remove LinkHeight limitation when pasting from Word (#2483)
  • Respect "shouldPersist" from EntityOperationEvent
  • Export content without selection (#2491)
  • Fix TableEditPlugin anchorContainerSelector query (#2499)
  • Add check for selected segments and paragraphs (#2476)
  • Watermark plugin allows update watermark text (#2507)

Other improvement

RoosterJs Content Model 0.27.0

04 Mar 22:15
7daf1ba
Compare
Choose a tag to compare

New features from old editor

  • Handle enter on expanded range (#2420)
  • Handle tab key for paragraph (#2436)
  • Port Table edit plugin (#2358)
  • Port ShortcutPlugin (#2427)

Improvement

  • Remove list margins attributes (#2425)
  • Outdent indented empty paragraph when pressing Backspace (#2429)
  • Support adding options for exportContent (#2443)
  • Set RootFontSize to SanitizingContext (#2445)
  • Split contentDiv into physicalRoot and logicalRoot (#2441)
  • Take snapshot before paste (#2440)
  • Improve Entity State related API (#2444)
  • Add option to configure the default paste type (#2457)
  • Remove Bg Color from block on Merge Paste (#2458)

Bug fix

  • Fix selection on context menu after image selection click (#2423)
  • Fix insertNode: Do not reselect if updateCursor is false (#2431)
  • Fix #2435: AttributeSanitizers are not applied to the child elements (#2442)
  • Fix dispose plugin issus in EditorAdapter (#2452)
  • Fix #2202: Delete first entity causes second entity to be reloaded in Content Model editor (#2450)
  • Fix bugs related to default format and decorator format (#2459)

Code clean up

  • Rename StandaloneEditor to Editor (#2416)