Skip to content

RoosterJs 8.49.0 and RoosterJs Content Model 0.8.0

Compare
Choose a tag to compare
@JiuqingSong JiuqingSong released this 05 Jun 19:08
· 1592 commits to release since this release
6b6210e

New feature

  • Undo with entity (#1791)
  • Allow picture shadows to set a custom margin around image (#1853)

Code clean up

  • Remove the support of ShadowDOM entity (#1841)

Bug fix

  • Clicking on images brings different spacing (#1846)
  • Fix #1322: Copying some table structure transform the table to single line text (#1843)
  • Use default format for empty line below entity (#1858)

Content Model

  • Add Size Format Handler to tables (#1838)
  • Remove Table temp elements from Word Online (#1842)
  • Improve link and heading behavior (#1812)
  • Fix bug: Inline entity got removed then added back (repeatly) when keep writing back using Content Model (#1848)
  • Maintain selection on empty line (#1814)
  • Fix #1802 Default format is not applied when type in a not-empty line (#1805)
  • Fix list bug when pasting from Word Online (#1855)
  • Make paste with content model a public api instead of a Editor Class member (#1852)
  • Fix #1839: Fix toggleBold on heading text (#1845)
  • Fix bug when pasting from Outlook Win 32 to Rooster (#1857)

Engineering improvement

  • Make roosterjs work with nodejs 17+ (#1849, #1851)
  • mprove test running performance, show correct callstack (#1854)

Interface change

  • New extracted API for copy/paste
    • handleImagePaste: Handles the content when using the Image Paste Option
    • handleTextPaste: handle the content when using the text only option
    • retrieveMetadataFromClipboard: Retrieves the metadata from the content inside of the clipboard
    • sanitizePasteContent: Sanitize the content from the pasted content
    • getPasteType: Get the paste type that will be used corresponding to the configuration
  • New function/interfaces for the "Undo with Entity" feature:
    • New extracted API for extract snapshot metadata
      • extractContentMetadata: Extract content metadata from DOM tree
    • New property of interface EntityPluginState
      • entityMap: Entities cached for undo snapshot
    • New enum value of enum EntityOperation
      • UpdateEntityState: Notify plugins that a new entity state need to be updated to an entity. This is normally happened when user undo/redo the content with an entity snapshot added by a plugin that handles entity
    • New property of interface EntityOperationEventData
      • state: For EntityOperation.UpdateEntityState, we use this object to pass the new entity state to plugin. For other operation types, it is not used.
      • shouldPersist: For EntityOperation.NewEntity, plugin can set this property to true then the entity will be persisted. A persisted entity won't be touched during undo/redo, unless it does not exist after undo/redo. For other operation types, this value will be ignored.
    • New property of interface ContentChangedData
      • getEntityState: Get entity states related to the snapshot. If it returns entity states, each state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState when undo/redo to this snapshot
    • New property of interface Snapshot
      • entityStates: Entity states related to this undo snapshots. When undo/redo to this snapshot, each entity state will trigger an EntityOperation event with operation = EntityOperation.UpdateEntityState
    • New interface
      • EntityState: State for an entity. This is used for storing entity undo snapshot
      • KnownEntityItem: Represents all info of a known entity, including its DOM element, whether it is deleted and if it can be persisted