Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
}
},
"devDependencies": {
"@babel/core": "^7.24.9",
"@babel/preset-env": "^7.24.8",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@ephox/agar": "^8.0.0-alpha.0",
"@ephox/bedrock-client": "^14.1.1",
"@ephox/bedrock-server": "^14.1.4",
"@babel/core": "^7.26.9",
"@babel/preset-env": "^7.26.9",
"@babel/preset-react": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@ephox/agar": "^8.0.1",
"@ephox/bedrock-client": "^15.0.0",
"@ephox/bedrock-server": "^15.0.3-alpha.0",
"@ephox/katamari": "^9.1.5",
"@ephox/mcagar": "^9.0.0-alpha.0",
"@ephox/sand": "^6.0.9",
Expand All @@ -57,24 +57,24 @@
"@storybook/react": "^8.2.4",
"@storybook/react-vite": "^8.2.4",
"@tinymce/beehive-flow": "^0.19.0",
"@tinymce/eslint-plugin": "^2.3.1",
"@tinymce/eslint-plugin": "^2.4.0",
"@tinymce/miniature": "^6.0.0",
"@types/node": "^20.14.10",
"@types/node": "^22.13.10",
"@types/prop-types": "^15.7.12",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"gh-pages": "^6.1.0",
"gh-pages": "^6.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rimraf": "^6.0.1",
"storybook": "^8.2.4",
"tinymce": "^7.2.1",
"tinymce": "^7.7.1",
"tinymce-4": "npm:tinymce@^4",
"tinymce-5": "npm:tinymce@^5",
"tinymce-6": "npm:tinymce@^6",
"tinymce-7": "npm:tinymce@^7",
"typescript": "~5.5.3",
"vite": "^5.3.3"
"typescript": "~5.8.2",
"vite": "^6.2.1"
},
"version": "6.0.1-rc",
"name": "@tinymce/tinymce-react"
Expand Down
9 changes: 5 additions & 4 deletions src/main/ts/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class Editor extends React.Component<IAllProps> {
// getBookmark throws exceptions when the editor has not been focused
// possibly only in inline mode but I'm not taking chances
cursor = localEditor.selection.getBookmark(3);
} catch (e) { /* ignore */ }
} catch (_e) { /* ignore */ }
}
const valueCursor = this.valueCursor;
localEditor.setContent(this.props.value as string);
Expand All @@ -201,7 +201,7 @@ export class Editor extends React.Component<IAllProps> {
localEditor.selection.moveToBookmark(bookmark);
this.valueCursor = bookmark;
break;
} catch (e) { /* ignore */ }
} catch (_e) { /* ignore */ }
}
}
}
Expand Down Expand Up @@ -361,7 +361,7 @@ export class Editor extends React.Component<IAllProps> {
if (this.valueCursor && (!this.inline || editor.hasFocus())) {
try {
editor.selection.moveToBookmark(this.valueCursor);
} catch (e) { /* ignore */ }
} catch (_e) { /* ignore */ }
}
});
}
Expand All @@ -375,7 +375,7 @@ export class Editor extends React.Component<IAllProps> {
// getBookmark throws exceptions when the editor has not been focused
// possibly only in inline mode but I'm not taking chances
this.valueCursor = this.editor.selection.getBookmark(3);
} catch (e) { /* ignore */ }
} catch (_e) { /* ignore */ }
}
}
};
Expand Down Expand Up @@ -498,6 +498,7 @@ export class Editor extends React.Component<IAllProps> {
target.value = this.getInitialValue();
}

// eslint-disable-next-line @typescript-eslint/no-floating-promises
tinymce.init(finalInit);
};
}
3 changes: 2 additions & 1 deletion src/test/ts/alien/Loader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Fun, Optional } from '@ephox/katamari';
import { SugarElement, SugarNode } from '@ephox/sugar';
import { Remove, SugarElement, SugarNode } from '@ephox/sugar';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Editor, IAllProps, IProps, Version } from '../../../main/ts/components/Editor';
Expand Down Expand Up @@ -72,6 +72,7 @@ export const render = async (props: Partial<IAllProps> = {}, container: HTMLElem

const remove = () => {
ReactDOM.unmountComponentAtNode(container);
Remove.remove(SugarElement.fromDom(container));
};

return {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ts/browser/EditorInitTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ describe('EditorInitTest', () => {
it('Value prop should propagate changes to editor', async () => {
using ctx = await render({ value: '<p>Initial Value</p>' });
TinyAssertions.assertContent(ctx.editor, '<p>Initial Value</p>');
ctx.reRender({ ...defaultProps, value: '<p>New Value</p>' });
await ctx.reRender({ ...defaultProps, value: '<p>New Value</p>' });
TinyAssertions.assertContent(ctx.editor, '<p>New Value</p>');
});

it('Disabled prop should disable editor', async () => {
using ctx = await render();
Assertions.assertEq('Should be design mode', true, '4' === version ? !ctx.editor.readonly : ctx.editor.mode.get() === 'design');
ctx.reRender({ ...defaultProps, disabled: true });
await ctx.reRender({ ...defaultProps, disabled: true });
Assertions.assertEq('Should be readonly mode', true, '4' === version ? ctx.editor.readonly : ctx.editor.mode.get() === 'readonly');
});

Expand Down
Loading