Skip to content

Commit

Permalink
Merge pull request #2897 from microsoft/u/juliaroldi/hot-fix-9.15.1
Browse files Browse the repository at this point in the history
[Hot fix] Roosterjs Plugins 9.15.1
  • Loading branch information
juliaroldi authored Dec 2, 2024
2 parents 78c9b01 + e5d0af7 commit 6044f40
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import type {
import type { ImageEditOptions } from '../types/ImageEditOptions';
import type { ImageHtmlOptions } from '../types/ImageHtmlOptions';

const IMAGE_EDIT_SHADOW_ROOT = 'ImageEditShadowRoot';

/**
* @internal
*/
Expand Down Expand Up @@ -69,6 +71,7 @@ const createShadowSpan = (wrapper: HTMLElement, imageSpan: HTMLSpanElement) => {
const shadowRoot = imageSpan.attachShadow({
mode: 'open',
});
imageSpan.id = IMAGE_EDIT_SHADOW_ROOT;
wrapper.style.verticalAlign = 'bottom';
shadowRoot.appendChild(wrapper);
return imageSpan;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,13 @@ describe('createImageWrapper', () => {
const editor = initEditor('editor_test');
function runTest(
image: HTMLImageElement,
imageSpan: HTMLSpanElement,
options: ImageEditOptions,
editInfo: ImageMetadataFormat,
htmlOptions: ImageHtmlOptions,
operation: ImageEditOperation[],
expectResult: WrapperElements
) {
const result = createImageWrapper(
editor,
image,

options,
editInfo,
htmlOptions,
operation
);
const result = createImageWrapper(editor, image, options, editInfo, htmlOptions, operation);
expect(JSON.stringify(result)).toEqual(JSON.stringify(expectResult));
}

Expand Down Expand Up @@ -69,7 +60,7 @@ describe('createImageWrapper', () => {
const shadowSpan = createShadowSpan(wrapper);
const imageClone = cloneImage(image, editInfo);

runTest(image, imageSpan, options, editInfo, htmlOptions, ['resize'], {
runTest(image, options, editInfo, htmlOptions, ['resize'], {
wrapper,
shadowSpan,
imageClone,
Expand Down Expand Up @@ -116,7 +107,7 @@ describe('createImageWrapper', () => {
const shadowSpan = createShadowSpan(wrapper);
const imageClone = cloneImage(image, editInfo);

runTest(image, imageSpan, options, editInfo, htmlOptions, ['rotate'], {
runTest(image, options, editInfo, htmlOptions, ['rotate'], {
wrapper: wrapper,
shadowSpan: shadowSpan,
imageClone: imageClone,
Expand Down Expand Up @@ -171,7 +162,7 @@ describe('createImageWrapper', () => {
const shadowSpan = createShadowSpan(wrapper);
const imageClone = cloneImage(image, editInfo);

runTest(image, imageSpan, options, editInfo, htmlOptions, ['crop'], {
runTest(image, options, editInfo, htmlOptions, ['crop'], {
wrapper,
shadowSpan,
imageClone,
Expand Down Expand Up @@ -202,6 +193,7 @@ const createShadowSpan = (wrapper: HTMLSpanElement) => {
const shadowRoot = span.attachShadow({
mode: 'open',
});
span.id = 'IMAGE_EDIT_SHADOW_ROOT';
wrapper.style.verticalAlign = 'bottom';
shadowRoot.append(wrapper);
return span;
Expand Down
4 changes: 3 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"react": "9.0.0",
"main": "9.15.0",
"legacyAdapter": "8.62.3",
"overrides": {}
"overrides": {
"roosterjs-content-model-plugins": "9.15.1"
}
}

0 comments on commit 6044f40

Please sign in to comment.