Skip to content

Conversation

@BryanValverdeU
Copy link
Contributor

Bump Rooster to 9.31.0

haven2world and others added 10 commits June 11, 2025 07:56
* draft

* temp

* update ff

* update

* test

* update
* fix: avoid "undefined" before paragraphs content

* fix: set "image" as the default alt value instead of "undefined"

---------

Co-authored-by: Francois Dursus <fdursus@veson.com>
* Enhance splitParagraph function to allow preservation of implicit paragraphs after split

* Fix preserveImplicitParagraph flag in handleEnterOnParagraph to false

* Update packages/roosterjs-content-model-plugins/lib/edit/utils/splitParagraph.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add beforeLogicalRootChanged event handling and related tests

* Rename event type from 'beforeLogicalRootChanged' to 'beforeLogicalRootChange' across relevant files

* Update packages/roosterjs-content-model-types/lib/event/LogicalRootChangedEvent.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* dsiable isComposing check for Android

* add test

---------

Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com>
* Allow plugins to store custom state in undo snapshots

* Type fixes

* Move to using object instead array
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR bumps Rooster to version 9.31.0 and adds a new plugin hook for supplying extra snapshot state during undo/redo operations.

  • Introduce additionalState on Snapshot and related event interfaces
  • Add BeforeAddUndoSnapshotEvent and emit it in addUndoSnapshot
  • Update snapshot manager, core API, tests, and demo UI to handle additionalState

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
versions.json Bump "main" from 9.30.0 to 9.31.0
packages/roosterjs-content-model-types/lib/parameter/Snapshot.ts Add additionalState to Snapshot interface
packages/roosterjs-content-model-types/lib/index.ts Export new BeforeAddUndoSnapshotEvent
packages/roosterjs-content-model-types/lib/event/PluginEventType.ts Add 'beforeAddUndoSnapshot' to event type union
packages/roosterjs-content-model-types/lib/event/PluginEvent.ts Include BeforeAddUndoSnapshotEvent in PluginEvent union
packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts Add additionalState to ContentChangedEvent
packages/roosterjs-content-model-types/lib/event/BeforeAddUndoSnapshotEvent.ts New event interface for before-add snapshot
packages/roosterjs-content-model-core/test/.../SnapshotsManagerImplTest.ts Tests for additionalState behavior in snapshot manager
packages/roosterjs-content-model-core/test/.../restoreUndoSnapshotTest.ts Tests for restoring snapshots with additionalState
packages/roosterjs-content-model-core/test/.../addUndoSnapshotTest.ts Tests for emitting and applying additionalState
packages/roosterjs-content-model-core/lib/corePlugin/undo/SnapshotsManagerImpl.ts Extend comparison logic to include additionalState
packages/roosterjs-content-model-core/lib/coreApi/addUndoSnapshot/addUndoSnapshot.ts Trigger new beforeAddUndoSnapshot event before snapshot
packages/roosterjs-content-model-core/lib/coreApi/restoreUndoSnapshot/restoreUndoSnapshot.ts Include additionalState when triggering contentChanged
demo/scripts/.../SnapshotPane.tsx Update UI to show and edit additionalState
Comments suppressed due to low confidence (1)

packages/roosterjs-content-model-types/lib/parameter/Snapshot.ts:77

  • [nitpick] Consider broadening the type of additionalState from mapping to only string values to allow plugins to store richer data (e.g. Record<string, any> or unknown), improving flexibility of the plugin API.
    additionalState?: { [key: string]: string };

@BryanValverdeU BryanValverdeU merged commit b415cf1 into release Jun 30, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants