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:
+3
-1
@@ -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,
|
||||
});
|
||||
});
|
||||
|
||||
+4
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user