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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed
- Editor initialization failure error handling. #INT-3366

## 2.3.1 - 2025-08-11

### Fixed
Expand Down
35 changes: 35 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// eslint.config.js
import { defineConfig } from "eslint/config";
import tinymceEslintPlugin from "@tinymce/eslint-plugin";

export default defineConfig([
{
plugins: {
"@tinymce": tinymceEslintPlugin
},
extends: [
"@tinymce/standard"
],
languageOptions: {
parserOptions: {
sourceType: "module",
project: [
"./tsconfig.json"
]
},
},
rules: {
"no-underscore-dangle": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@tinymce/prefer-fun": "off",
"@typescript-eslint/member-ordering": "off",
"quote-props": [
2,
"consistent-as-needed",
{
keywords: false
}
]
}
}
]);
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"description": "Official TinyMCE Web Component",
"version": "2.3.2-rc",
"name": "@tinymce/tinymce-webcomponent",
"repository": {
"url": "https://github.com/tinymce/tinymce-webcomponent"
},
Expand All @@ -24,33 +26,32 @@
"license": "MIT",
"devDependencies": {
"@ephox/agar": "^8.0.1",
"@ephox/bedrock-client": "^14.1.1",
"@ephox/bedrock-server": "^14.1.4",
"@ephox/bedrock-client": "^15.0.0",
"@ephox/bedrock-server": "^15.0.0",
"@ephox/katamari": "^9.1.5",
"@ephox/sugar": "^9.2.1",
"@ephox/swag": "^4.6.0",
"@tinymce/beehive-flow": "^0.19.0",
"@tinymce/eslint-plugin": "^2.2.1",
"@tinymce/eslint-plugin": "^3.0.0",
"@types/esm": "^3.2.0",
"@types/express": "^5.0.0",
"@types/node": "^22.7.7",
"@typescript-eslint/eslint-plugin": "^5.48.2",
"@typescript-eslint/parser": "^5.48.2",
"eslint": "^8.32.0",
"@types/node": "^24.5.2",
"@typescript-eslint/eslint-plugin": "^8.44.0",
"@typescript-eslint/parser": "^8.44.0",
"eslint": "^9.36.0",
"eslint-config-eslint": "^13.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-prefer-arrow": "^1.2.3",
"esm": "^3.2.25",
"express": "^4.18.2",
"express": "^5.1.0",
"rollup": "^4.24.0",
"tinymce": "^8.0.0",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"typescript": "~5.6.3",
"typescript": "~5.9.2",
"webpack": "^5.75.0"
},
"dependencies": {
"@tinymce/miniature": "^6.0.0"
},
"version": "2.3.2-rc",
"name": "@tinymce/tinymce-webcomponent"
}
}
3 changes: 3 additions & 0 deletions src/demo/ts/Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ const page = (editor1Value: string, editor2Value: string, editor3Value: string,
const tinyPath = path.normalize(path.join(__dirname, '..', '..', '..', 'node_modules', 'tinymce'));
const distPath = path.normalize(path.join(__dirname, '..', '..', '..', 'dist'));

/* eslint-disable-next-line no-console */
console.log('Serving /tinymce from: ' + tinyPath);
/* eslint-disable-next-line no-console */
console.log('Serving /dist from: ' + distPath);

app.use('/tinymce', express.static(tinyPath));
Expand All @@ -89,4 +91,5 @@ app.post('/', (request, response) => {
response.send(page(request.body.editor1 as string, request.body.editor2 as string, request.body.editor3 as string, request.body.editor4 as string));
});

/* eslint-disable-next-line no-console */
app.listen(3000, () => console.log('http://localhost:3000/'));
10 changes: 6 additions & 4 deletions src/main/ts/component/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const lookup = <T extends Record<string, unknown>, K extends keyof T>(values: T)

const parseGlobal = Resolve.resolve;
const parseString = Fun.identity;
const parseFalseOrString = lookup({ 'false': false as const });
const parseBooleanOrString = lookup({ 'true': true, 'false': false });
const parseFalseOrString = lookup({ false: false });
const parseBooleanOrString = lookup({ true: true, false: false });
const parseNumberOrString = (value: string) => /^\d+$/.test(value) ? Number.parseInt(value, 10) : value;

const configAttributes: Record<string, (v: string) => unknown> = {
Expand Down Expand Up @@ -279,7 +279,10 @@ class TinyMceEditor extends HTMLElement {
}
};
// use target
this._getTinymce().init(conf);
this._getTinymce().init(conf).catch((err) => {
/* eslint-disable-next-line no-console */
console.error('TinyMCE init failed', err);
});
}

private _getTinymceSrc(): string {
Expand Down Expand Up @@ -451,4 +454,3 @@ class TinyMceEditor extends HTMLElement {
export default () => {
window.customElements.define('tinymce-editor', TinyMceEditor);
};

5 changes: 4 additions & 1 deletion src/test/ts/browser/LoadTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ UnitTest.asynctest('LoadTest', (success, failure) => {
seenInit = true;
};
}),
Step.sync(() => makeTinymceElement({ setup: 'customElementTinymceSetup', 'on-init': 'customElementTinymceInit' }, '<p>Hello world</p>')),
Step.sync(() => makeTinymceElement({
'setup': 'customElementTinymceSetup',
'on-init': 'customElementTinymceInit'
}, '<p>Hello world</p>')),
Waiter.sTryUntilPredicate('Waiting for editor setup', () => seenSetup),
Waiter.sTryUntilPredicate('Waiting for editor init', () => seenInit),
Step.sync(() => {
Expand Down
Loading