Skip to content

Commit 9bbe91a

Browse files
JiuqingSonghaven2worldDurssBryanValverdeUjuliaroldi
authored
Bump version to 9.36.0 (#3143)
* Fix toggling format issue at composition stage for CJK (#3064) * draft * temp * update ff * update * test * update * Avoid "undefined" in HTML to Markdown generated content (#3069) * 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> * Add focus handling in formatTableWithContentModel and its tests (#3072) * format applier (#3073) * Keep implicit paragraph when pressing Enter at the start of it. (#3075) * 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 (#3077) * 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> * Disable isComposing check in DOM event propagation for Android (#3076) * dsiable isComposing check for Android * add test --------- Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> * Allow plugins to store state in snapshot (#3079) * Allow plugins to store custom state in undo snapshots * Type fixes * Move to using object instead array * Fix #3080 (#3084) * Add auto direction to setDirection (#3082) * Initial commit * Pending changes exported from your codespace * fix code and tests * Address comments --------- Co-authored-by: wisaulni <wisaulni@microsoft.com> Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> * Ensure image is loaded before creating image wrapper (#3090) * Enhance image loading handling in ImageEditPlugin to support resizing and editing of images not fully loaded * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * test (#3092) * Fix #3085 (#3095) Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com> * Adjust the image wrapper to stay inline (#3093) Use text-bottom instead of bottom for vertical-align to prevent the image to rotate below the text line. Also add some 5px in margin bottom to compensate for the height of the bottom handles. * Fix 309357 (#3097) * Fix 309357 * improve * improve * improve * Update packages/roosterjs-content-model-types/lib/context/ModelToDomOption.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/roosterjs-content-model-types/lib/context/ModelToDomSettings.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix build --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> * Fix #3063 (#3096) * Fix #3087 Delete paragraph styles when there is nothing else to be deleted (#3094) * Fix #3087 * Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update packages/roosterjs-content-model-plugins/lib/edit/deleteSteps/deleteParagraphStyle.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove karma changes (#3102) * karma * change * Adjust Block Indentation (#3099) When inserting a list or table in an indented segment, add the indentation to the block. * Process non-visible elements (#3089) New parameter processNonVisibleElements has been added to the DomToModelSettings and DomToModelOptions, allowing optional processing of non-visible elements. * Fix runtime color for dark mode (#3101) * Fix runtime color for dark mode * add test * fix build * table rtl (#3103) The style direction: RTL does move the table to the right, so use justifySelf:flex-end. * image-handles (#3104) When rotating an image, the resize handles direction must be updated according to the rotation angle. * Fix superscript rule (#3106) * Fix 380860 (#3107) * Support 'HTMLFast' mode when get HTML (#3109) * Support 'HTMLFast' mode when get HTML * fix build and comment * Bump tmp from 0.2.1 to 0.2.4 (#3114) Bumps [tmp](https://github.com/raszi/node-tmp) from 0.2.1 to 0.2.4. - [Changelog](https://github.com/raszi/node-tmp/blob/master/CHANGELOG.md) - [Commits](raszi/node-tmp@v0.2.1...v0.2.4) --- updated-dependencies: - dependency-name: tmp dependency-version: 0.2.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiuqing Song <jisong@microsoft.com> * Fix #3110 (#3113) * Add logical root plugin and related presets; enhance event handling with capture option * Update packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update demo/scripts/controlsV2/sidePane/presets/PresetPane.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Add markdown support for strikethrough * Fix test * Try fix unstable test (#3118) * add support for nested style markdowns * move let to const * update * Support DL,DT,DD in content model (#3120) * Support DL,DT,DD in content model * improve * fix build * fix test * Add an experimental feature for 'HTMLFast' when export html (#3121) * Add an experimental feature for 'HTMLFast' when export html * fix build * Fix 276282 (#3125) * Fix #3112 Delete empty block group when need (#3124) * Fix #3112 * improve * fix comments * update * remove console log * fix regression * update * Do not add undo snapshot from ImageEdit plugin if image is not changed (#3127) * Fix 377316: Skip undo snapshot when start to edit image * improve * fix comment * Support different options for empty line mode in mark down (#3128) * Support different options for empty line mode in mark down * Fix build * fix test * fix test * Fix auto link (#3129) When the text segment already has link, do not create the link again. * Graduate option "disableCache" (#3132) * Graduate option "disableCache" * Improve * Improve handleParagraph function (#3130) * Remove console.log added accidentally in test code (#3134) * Toggle blockquote in Format Container (#3126) FormatContainer can be used to other elements other than blockquotes. When toggling blockquote in format containers that are not blockquotes, search for the selected elements inside the container and only apply blockquote to theses selected elements. * Fix auto-capitalization for iOS (#3131) * Fix auto-capitalization for iOS by allowing browser to handle first character deletion * Address comments * Fix ut * remove ipod * lint code * Fix RTL for Image Selection (#3136) * image rtl * imageEdit * Revert "Improve handleParagraph function (#3130)" (#3137) This reverts commit 9f8abbf. * 9.36.0 * Apply suggestion from @Copilot remove duplicated line Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Haowen Chen <haowchen@microsoft.com> Co-authored-by: François Dursus <francois.dursus@gmail.com> Co-authored-by: Francois Dursus <fdursus@veson.com> Co-authored-by: Bryan Valverde U <bvalverde@microsoft.com> Co-authored-by: Julia Roldi <87443959+juliaroldi@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Rain-Zheng <67583056+Rain-Zheng@users.noreply.github.com> Co-authored-by: florian-msft <87671048+florian-msft@users.noreply.github.com> Co-authored-by: wisaulni <186232390+wisaulni@users.noreply.github.com> Co-authored-by: wisaulni <wisaulni@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Francis Meng <xiameng@microsoft.com> Co-authored-by: Francis Meng <meng.francis@gmail.com> Co-authored-by: Zander Wang <xiaozwan@outlook.com>
1 parent f51e00f commit 9bbe91a

File tree

12 files changed

+135
-39
lines changed

12 files changed

+135
-39
lines changed

packages/roosterjs-content-model-core/lib/editor/core/createEditorCore.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function createEditorEnvironment(
7171
modelToDomSettings: createModelToDomSettings(options),
7272
isMac: appVersion.indexOf('Mac') != -1,
7373
isAndroid: /android/i.test(userAgent),
74+
isIOS: /iPad|iPhone/.test(userAgent),
7475
isSafari:
7576
userAgent.indexOf('Safari') >= 0 &&
7677
userAgent.indexOf('Chrome') < 0 &&

packages/roosterjs-content-model-core/test/editor/core/createEditorCoreTest.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ describe('createEditorCore', () => {
8585
environment: {
8686
isMac: false,
8787
isAndroid: false,
88+
isIOS: false,
8889
isSafari: false,
8990
isMobileOrTablet: false,
9091
domToModelSettings: mockedDomToModelSettings,
@@ -218,6 +219,7 @@ describe('createEditorCore', () => {
218219
environment: {
219220
isMac: false,
220221
isAndroid: true,
222+
isIOS: false,
221223
isSafari: false,
222224
isMobileOrTablet: true,
223225
domToModelSettings: mockedDomToModelSettings,
@@ -252,6 +254,7 @@ describe('createEditorCore', () => {
252254
environment: {
253255
isMac: false,
254256
isAndroid: true,
257+
isIOS: false,
255258
isSafari: false,
256259
isMobileOrTablet: true,
257260
domToModelSettings: mockedDomToModelSettings,
@@ -286,6 +289,7 @@ describe('createEditorCore', () => {
286289
environment: {
287290
isMac: true,
288291
isAndroid: false,
292+
isIOS: false,
289293
isSafari: false,
290294
isMobileOrTablet: false,
291295
domToModelSettings: mockedDomToModelSettings,
@@ -320,6 +324,7 @@ describe('createEditorCore', () => {
320324
environment: {
321325
isMac: false,
322326
isAndroid: false,
327+
isIOS: false,
323328
isSafari: true,
324329
isMobileOrTablet: false,
325330
domToModelSettings: mockedDomToModelSettings,
@@ -354,6 +359,7 @@ describe('createEditorCore', () => {
354359
environment: {
355360
isMac: false,
356361
isAndroid: false,
362+
isIOS: false,
357363
isSafari: false,
358364
isMobileOrTablet: false,
359365
domToModelSettings: mockedDomToModelSettings,
@@ -368,4 +374,40 @@ describe('createEditorCore', () => {
368374
undefined
369375
);
370376
});
377+
378+
it('iOS iPhone Safari', () => {
379+
const mockedDiv = {
380+
ownerDocument: {
381+
defaultView: {
382+
navigator: {
383+
userAgent:
384+
'Mozilla/5.0 (iPhone; CPU iPhone OS 18_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
385+
},
386+
},
387+
},
388+
attributes: {
389+
a: 'b',
390+
},
391+
} as any;
392+
const mockedOptions = {} as any;
393+
394+
runTest(mockedDiv, mockedOptions, {
395+
environment: {
396+
isMac: false,
397+
isAndroid: false,
398+
isIOS: true,
399+
isSafari: false,
400+
isMobileOrTablet: true,
401+
domToModelSettings: mockedDomToModelSettings,
402+
modelToDomSettings: mockedModelToDomSettings,
403+
},
404+
});
405+
406+
expect(DarkColorHandlerImpl.createDarkColorHandler).toHaveBeenCalledWith(
407+
mockedDiv,
408+
getDarkColorFallback,
409+
undefined,
410+
undefined
411+
);
412+
});
371413
});

packages/roosterjs-content-model-plugins/lib/edit/keyboardDelete.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@ export function keyboardDelete(
4141
let handled = false;
4242
const selection = editor.getDOMSelection();
4343

44-
if (shouldDeleteWithContentModel(selection, rawEvent, handleExpandedSelection)) {
44+
if (
45+
shouldDeleteWithContentModel(
46+
selection,
47+
rawEvent,
48+
handleExpandedSelection,
49+
editor.getEnvironment().isIOS ?? false
50+
)
51+
) {
4552
editor.formatContentModel(
4653
(model, context) => {
4754
const result = deleteSelection(
@@ -92,7 +99,8 @@ function getDeleteSteps(rawEvent: KeyboardEvent, isMac: boolean): (DeleteSelecti
9299
function shouldDeleteWithContentModel(
93100
selection: DOMSelection | null,
94101
rawEvent: KeyboardEvent,
95-
handleExpandedSelection: boolean
102+
handleExpandedSelection: boolean,
103+
isIOS: boolean
96104
) {
97105
if (!selection) {
98106
return false; // Nothing to delete
@@ -121,16 +129,20 @@ function shouldDeleteWithContentModel(
121129
return !(
122130
isNodeOfType(startContainer, 'TEXT_NODE') &&
123131
!isModifierKey(rawEvent) &&
124-
(canDeleteBefore(rawEvent, startContainer, startOffset) ||
132+
(canDeleteBefore(rawEvent, startContainer, startOffset, isIOS) ||
125133
canDeleteAfter(rawEvent, startContainer, startOffset))
126134
);
127135
}
128136
}
129137

130-
function canDeleteBefore(rawEvent: KeyboardEvent, text: Text, offset: number) {
131-
if (rawEvent.key != 'Backspace' || offset <= 1) {
138+
function canDeleteBefore(rawEvent: KeyboardEvent, text: Text, offset: number, isIOS: boolean) {
139+
if (rawEvent.key != 'Backspace') {
132140
return false;
133141
}
142+
if (offset <= 1) {
143+
// For iOS, allow browser to handle deletion of first character on iOS to preserve auto-capitalization
144+
return offset === 1 && isIOS;
145+
}
134146

135147
const length = text.nodeValue?.length ?? 0;
136148

packages/roosterjs-content-model-plugins/lib/imageEdit/ImageEditPlugin.ts

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
344344
) {
345345
let editingImageModel: ContentModelImage | undefined;
346346
const selection = editor.getDOMSelection();
347+
let isRTL: boolean = false;
347348

348349
editor.formatContentModel(
349350
(model, context) => {
@@ -426,6 +427,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
426427
this.isCropMode = isCropMode;
427428
mutateSegment(editingImage.paragraph, editingImage.image, image => {
428429
editingImageModel = image;
430+
isRTL = editingImage.paragraph.format.direction == 'rtl';
429431
this.imageEditInfo = updateImageEditInfo(image, selection.image);
430432
image.format.imageState = 'isEditing';
431433
});
@@ -447,9 +449,9 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
447449
isElementOfType(node, 'img')
448450
) {
449451
if (isCropMode) {
450-
this.startCropMode(editor, node);
452+
this.startCropMode(editor, node, isRTL);
451453
} else {
452-
this.startRotateAndResize(editor, node);
454+
this.startRotateAndResize(editor, node, isRTL);
453455
}
454456
}
455457
},
@@ -541,7 +543,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
541543
editor.setEditorStyle(IMAGE_EDIT_CLASS_CARET, `caret-color: transparent;`);
542544
}
543545

544-
public startRotateAndResize(editor: IEditor, image: HTMLImageElement) {
546+
public startRotateAndResize(editor: IEditor, image: HTMLImageElement, isRTL: boolean) {
545547
if (this.imageEditInfo) {
546548
this.startEditing(editor, image, ['resize', 'rotate']);
547549
if (this.selectedImage && this.imageEditInfo && this.wrapper && this.clonedImage) {
@@ -566,7 +568,9 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
566568
this.selectedImage,
567569
this.clonedImage,
568570
this.wrapper,
569-
this.resizers
571+
this.resizers,
572+
undefined /* croppers */,
573+
isRTL
570574
);
571575
this.wasImageResized = true;
572576
}
@@ -592,7 +596,10 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
592596
this.options,
593597
this.selectedImage,
594598
this.clonedImage,
595-
this.wrapper
599+
this.wrapper,
600+
undefined /* resizers */,
601+
undefined /* croppers */,
602+
isRTL
596603
);
597604
this.updateRotateHandleState(
598605
editor,
@@ -619,7 +626,9 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
619626
this.selectedImage,
620627
this.clonedImage,
621628
this.wrapper,
622-
this.resizers
629+
this.resizers,
630+
undefined /* croppers */,
631+
isRTL
623632
);
624633

625634
this.updateRotateHandleState(
@@ -684,7 +693,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
684693
return canRegenerateImage(image);
685694
}
686695

687-
private startCropMode(editor: IEditor, image: HTMLImageElement) {
696+
private startCropMode(editor: IEditor, image: HTMLImageElement, isRTL: boolean) {
688697
if (this.imageEditInfo) {
689698
this.startEditing(editor, image, ['crop']);
690699
if (this.imageEditInfo && this.selectedImage && this.wrapper && this.clonedImage) {
@@ -708,8 +717,9 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
708717
this.selectedImage,
709718
this.clonedImage,
710719
this.wrapper,
711-
undefined,
712-
this.croppers
720+
undefined /* resizers */,
721+
this.croppers,
722+
isRTL
713723
);
714724
this.isCropMode = true;
715725
}
@@ -724,8 +734,9 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
724734
this.selectedImage,
725735
this.clonedImage,
726736
this.wrapper,
727-
undefined,
728-
this.croppers
737+
undefined /* resizers */,
738+
this.croppers,
739+
isRTL
729740
);
730741
}
731742
}

packages/roosterjs-content-model-plugins/lib/imageEdit/utils/imageEditUtils.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,6 @@ export function checkIfImageWasResized(image: HTMLImageElement): boolean {
107107
}
108108
}
109109

110-
/**
111-
* @internal
112-
*/
113-
export function isRTL(image: HTMLImageElement): boolean {
114-
return window.getComputedStyle(image).direction === 'rtl';
115-
}
116-
117110
function isFixedNumberValue(value: string | number) {
118111
const numberValue = typeof value === 'string' ? parseInt(value) : value;
119112
return !isNaN(numberValue);

packages/roosterjs-content-model-plugins/lib/imageEdit/utils/updateWrapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type { ImageMetadataFormat } from 'roosterjs-content-model-types';
1010
import {
1111
getPx,
1212
isASmallImage,
13-
isRTL,
1413
setFlipped,
1514
setSize,
1615
setWrapperSizeDimensions,
@@ -26,7 +25,8 @@ export function updateWrapper(
2625
clonedImage: HTMLImageElement,
2726
wrapper: HTMLSpanElement,
2827
resizers?: HTMLDivElement[],
29-
croppers?: HTMLDivElement[]
28+
croppers?: HTMLDivElement[],
29+
isRTL?: boolean
3030
) {
3131
const {
3232
angleRad,
@@ -70,7 +70,7 @@ export function updateWrapper(
7070

7171
// Update the text-alignment to avoid the image to overflow if the parent element have align center or right
7272
// or if the direction is Right To Left
73-
if (isRTL(clonedImage)) {
73+
if (isRTL) {
7474
wrapper.style.textAlign = 'right';
7575
if (!croppers) {
7676
clonedImage.style.left = getPx(cropLeftPx);

packages/roosterjs-content-model-plugins/test/edit/keyboardDeleteTest.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,7 @@ describe('keyboardDelete', () => {
536536
type: 'range',
537537
range: { collapsed: false },
538538
}),
539+
getEnvironment: () => ({}),
539540
} as any) as IEditor;
540541
const event = {
541542
which: Delete,
@@ -559,6 +560,7 @@ describe('keyboardDelete', () => {
559560
type: 'range',
560561
range: { collapsed: false },
561562
}),
563+
getEnvironment: () => ({}),
562564
} as any;
563565
const which = Backspace;
564566
const event = {
@@ -589,6 +591,7 @@ describe('keyboardDelete', () => {
589591
const editor = {
590592
formatContentModel: formatWithContentModelSpy,
591593
getDOMSelection: () => range,
594+
getEnvironment: () => ({}),
592595
} as any;
593596

594597
keyboardDelete(editor, rawEvent);
@@ -611,6 +614,7 @@ describe('keyboardDelete', () => {
611614
const editor = {
612615
formatContentModel: formatWithContentModelSpy,
613616
getDOMSelection: () => range,
617+
getEnvironment: () => ({}),
614618
} as any;
615619

616620
keyboardDelete(editor, rawEvent);
@@ -636,6 +640,7 @@ describe('keyboardDelete', () => {
636640
const editor = {
637641
formatContentModel: formatWithContentModelSpy,
638642
getDOMSelection: () => range,
643+
getEnvironment: () => ({}),
639644
} as any;
640645

641646
keyboardDelete(editor, rawEvent, false /* handleExpandedSelectionOnDelete */);
@@ -659,6 +664,7 @@ describe('keyboardDelete', () => {
659664
const editor = {
660665
formatContentModel: formatWithContentModelSpy,
661666
getDOMSelection: () => range,
667+
getEnvironment: () => ({}),
662668
} as any;
663669

664670
keyboardDelete(editor, rawEvent);
@@ -682,6 +688,7 @@ describe('keyboardDelete', () => {
682688
const editor = {
683689
formatContentModel: formatWithContentModelSpy,
684690
getDOMSelection: () => range,
691+
getEnvironment: () => ({}),
685692
} as any;
686693

687694
keyboardDelete(editor, rawEvent);
@@ -707,6 +714,7 @@ describe('keyboardDelete', () => {
707714
const editor = {
708715
formatContentModel: formatWithContentModelSpy,
709716
getDOMSelection: () => range,
717+
getEnvironment: () => ({}),
710718
} as any;
711719

712720
keyboardDelete(editor, rawEvent, false /* handleExpandedSelectionOnDelete */);
@@ -740,6 +748,7 @@ describe('keyboardDelete', () => {
740748
const editor = {
741749
formatContentModel: formatWithContentModelSpy,
742750
getDOMSelection: () => range,
751+
getEnvironment: () => ({}),
743752
} as any;
744753

745754
keyboardDelete(editor, rawEvent, false /* handleExpandedSelectionOnDelete */);

packages/roosterjs-content-model-plugins/test/imageEdit/ImageEditPluginTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ describe('ImageEditPlugin - applyFormatWithContentModel', () => {
920920
getAttribute: () => 'test',
921921
};
922922
plugin.setEditingInfo(mockImageWithWidth);
923-
plugin.startRotateAndResize(editor, mockedImage);
923+
plugin.startRotateAndResize(editor, mockedImage, false);
924924
plugin.setIsEditing(isEditing);
925925
plugin.applyFormatWithContentModel(editor, isCropMode, shouldSelectImage, isApiOperation);
926926
const newModel = editor.getContentModelCopy('disconnected');

packages/roosterjs-content-model-plugins/test/imageEdit/utils/imageEditUtilsTest.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
checkIfImageWasResized,
44
getPx,
55
isASmallImage,
6-
isRTL,
76
rotateCoordinate,
87
setFlipped,
98
setSize,
@@ -105,12 +104,4 @@ describe('imageEditUtils', () => {
105104
expect(result).toBeFalsy();
106105
});
107106
});
108-
109-
describe('isRTL', () => {
110-
it(' not isRTL', () => {
111-
const image = document.createElement('img');
112-
const result = isRTL(image);
113-
expect(result).toBeFalsy();
114-
});
115-
});
116107
});

0 commit comments

Comments
 (0)