Add Module Composer API (#33284)

* Spec composer API

* Add composer api implementation

* Tests

* Copyright

* update sigs

* cleanup

* a snap

* cleanup

* linting

* Tidy up

* Adjust
This commit is contained in:
Will Hunt
2026-04-27 10:33:20 +00:00
committed by GitHub
parent cb6c141580
commit 2ea0c4106b
14 changed files with 817 additions and 558 deletions
@@ -283,8 +283,10 @@ describe("EditWysiwygComposer", () => {
// It adds the composerType fields where the value refers if the composer is in editing or not
// The listeners in the RTE ignore the message if the composerType is missing in the payload
const dispatcherRef = defaultDispatcher.register((payload: ActionPayload) => {
const insertPayload = payload as ComposerInsertPayload;
defaultDispatcher.dispatch<ComposerInsertPayload>({
...(payload as ComposerInsertPayload),
...insertPayload,
timelineRenderingType: insertPayload.timelineRenderingType!,
composerType: ComposerType.Edit,
});
});
@@ -48,11 +48,13 @@ describe("SendWysiwygComposer", () => {
const registerId = defaultDispatcher.register((payload) => {
switch (payload.action) {
case Action.ComposerInsert: {
if (payload.composerType) break;
const insertPayload = payload as ComposerInsertPayload;
if (insertPayload.composerType) break;
// re-dispatch to the correct composer
defaultDispatcher.dispatch<ComposerInsertPayload>({
...(payload as ComposerInsertPayload),
...insertPayload,
timelineRenderingType: insertPayload.timelineRenderingType!,
composerType: ComposerType.Send,
});
break;