Skip to content

RoosterJs 8.41.0

Compare
Choose a tag to compare
@JiuqingSong JiuqingSong released this 27 Jan 18:54
· 1984 commits to release since this release
878aab5

New features

  • Variable based dark color (Experimentail feature: VariableBasedDarkColor) (#1531)
    Implement dark mode using variable-based CSS color. To use this feature, enable experimental feature VariableBasedDarkColor and check all your function calls to setColor() and applyFormat() of roosterjs then add parameter darkColorHandler to them.
  • Support isCodeBlock in FormatState (#1533)
  • Support canMergeTableCell in FormatState (#1526)

Improvement

  • Do image editing on top of shadow DOM (#1520)

Bug fix

  • remove new max-width for new inline image (#1527)

Engineering improvement

  • Load fluent ui from cdnjs for demo site (#1525)

Interface change

  • New Experimental feature
    • VariableBasedDarkColor: Use variable-based dark mode solution rather than dataset-based solution. When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat if you need them work for dark mode
  • New parameter of API applyFormat, setColor
    • darkColorHandler: A color handler for dark mode for new variable-based dark mode solution
  • New interface DarkColorHandler
    • registerColor(lightModeColor: string, isDarkMode: boolean, darkModeColor?: string): string;
      Given a light mode color value and an optional dark mode color value, register this color so that editor can handle it, then return the CSS color value for current color mode.
    • reset(): void;
      Reset known color record, clean up registered color variables.
    • parseColorValue(color: string | null | undefined): ColorKeyAndValue;
      Parse an existing color value, if it is in variable-based color format, extract color key, light color and query related dark color if any.
  • New member of interface EditorCore
    • darkColorHandler: Dark model handler for the editor, used for variable-based solution. If keep it null, editor will still use original dataset-based dark mode solution.
  • New method or IEditor and Editor
    • getDarkColorHandler: Get a dark color handler for variable-based dark mode solution. Need to enable experimental feature VariableBasedDarkColor
  • New member of interface ElementBasedFormatState
    • isCodeBlock: Whether the text is in Code block
    • canMergeTableCell: Whether we can execute table cell merge operation