From 6a6a95e4459ba42ed05ffc7d75533211b9d7ac8d Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Mon, 15 Apr 2024 20:43:20 +0100 Subject: [PATCH 1/8] INT-3302: Update tinymce to version 7 --- package.json | 3 ++- src/main/ts/Utils.ts | 7 ++++++- src/main/ts/components/Editor.ts | 2 +- src/main/ts/components/EditorPropTypes.ts | 2 ++ src/stories/Editor.stories.tsx | 6 +++--- src/test/ts/browser/InitTest.ts | 7 ++++--- src/test/ts/browser/LoadTinyTest.ts | 25 +++++++++++++++++++---- yarn.lock | 8 ++++---- 8 files changed, 43 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 0ac2061..4c5e79b 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "tinymce-4": "npm:tinymce@^4", "tinymce-5": "npm:tinymce@^5", "tinymce-6": "npm:tinymce@^6", + "tinymce-7": "npm:tinymce@^7", "ts-loader": "^9.4.1", "ts-node": "^10.9.1", "tsconfig-paths-webpack-plugin": "^3.5.2", @@ -84,6 +85,6 @@ "webpack": "^5.75.0" }, "dependencies": { - "tinymce": "^6.0.0 || ^5.5.1" + "tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1" } } diff --git a/src/main/ts/Utils.ts b/src/main/ts/Utils.ts index 4a52955..bdf88f2 100644 --- a/src/main/ts/Utils.ts +++ b/src/main/ts/Utils.ts @@ -24,6 +24,10 @@ const validEvents = [ 'onClearUndos', 'onClick', 'onContextMenu', + 'onCommentChange', + 'onCompositionEnd', + 'onCompositionStart', + 'onCompositionUpdate', 'onCopy', 'onCut', 'onDblclick', @@ -42,6 +46,7 @@ const validEvents = [ 'onGetContent', 'onHide', 'onInit', + 'onInput', 'onKeyDown', 'onKeyPress', 'onKeyUp', @@ -159,4 +164,4 @@ export { isTextarea, mergePlugins, isNullOrUndefined -}; \ No newline at end of file +}; diff --git a/src/main/ts/components/Editor.ts b/src/main/ts/components/Editor.ts index 2f494e3..2fc4a0a 100644 --- a/src/main/ts/components/Editor.ts +++ b/src/main/ts/components/Editor.ts @@ -91,7 +91,7 @@ export const Editor = defineComponent({ if (getTinymce() !== null) { initWrapper(); } else if (element.value && element.value.ownerDocument) { - const channel = props.cloudChannel ? props.cloudChannel : '6'; + const channel = props.cloudChannel ? props.cloudChannel : '7'; const apiKey = props.apiKey ? props.apiKey : 'no-api-key'; const scriptSrc: string = isNullOrUndefined(props.tinymceScriptSrc) ? `https://cdn.tiny.cloud/1/${apiKey}/tinymce/${channel}/tinymce.min.js` : diff --git a/src/main/ts/components/EditorPropTypes.ts b/src/main/ts/components/EditorPropTypes.ts index 10a8f03..1f24175 100644 --- a/src/main/ts/components/EditorPropTypes.ts +++ b/src/main/ts/components/EditorPropTypes.ts @@ -13,6 +13,7 @@ export type CopyProps = { [P in keyof T]: any }; export interface IPropTypes { apiKey: string; + licenseKey: string; cloudChannel: string; id: string; init: EditorOptions & { selector?: undefined; target?: undefined }; @@ -30,6 +31,7 @@ export interface IPropTypes { export const editorProps: CopyProps = { apiKey: String, + licenseKey: String, cloudChannel: String, id: String, init: Object, diff --git a/src/stories/Editor.stories.tsx b/src/stories/Editor.stories.tsx index 43f6d64..7f5094b 100644 --- a/src/stories/Editor.stories.tsx +++ b/src/stories/Editor.stories.tsx @@ -52,8 +52,8 @@ export default { table: { defaultValue: {summary: '5'} }, - defaultValue: ['5'], - options: ['5', '5-dev', '5-testing', '6-dev', '6-testing', '6-stable'], + defaultValue: ['7'], + options: ['5', '5-dev', '5-testing', '6-dev', '6-testing', '6-stable', '7-dev', '7-testing', '7-stable'], control: { type: 'select'} }, conf: { @@ -182,4 +182,4 @@ export const Disable: Story = (args) => ({ v-model="content" /> ` -}); \ No newline at end of file +}); diff --git a/src/test/ts/browser/InitTest.ts b/src/test/ts/browser/InitTest.ts index 962b1eb..0be6788 100644 --- a/src/test/ts/browser/InitTest.ts +++ b/src/test/ts/browser/InitTest.ts @@ -10,7 +10,7 @@ UnitTest.asynctest('InitTest', (success, failure) => { Keyboard.keystroke(Keys.space(), {}, SugarElement.fromDom(context.editor.getBody()) as SugarElement); }); - const sTestVersion = (version: '4' | '5' | '6') => VersionLoader.sWithVersion( + const sTestVersion = (version: '4' | '5' | '6' | '7') => VersionLoader.sWithVersion( version, GeneralSteps.sequence([ Logger.t('Should be able to setup editor', Chain.asStep({}, [ @@ -77,6 +77,7 @@ UnitTest.asynctest('InitTest', (success, failure) => { Pipeline.async({}, [ sTestVersion('4'), sTestVersion('5'), - sTestVersion('6') + sTestVersion('6'), + sTestVersion('7'), ], success, failure); -}); \ No newline at end of file +}); diff --git a/src/test/ts/browser/LoadTinyTest.ts b/src/test/ts/browser/LoadTinyTest.ts index 183dd55..9c077d4 100644 --- a/src/test/ts/browser/LoadTinyTest.ts +++ b/src/test/ts/browser/LoadTinyTest.ts @@ -24,7 +24,7 @@ UnitTest.asynctest('LoadTinyTest', (success, failure) => { Arr.each(elements, Remove.remove); }); - const cAssertTinymceVersion = (version: '4' | '5' | '6') => Chain.op(() => { + const cAssertTinymceVersion = (version: '4' | '5' | '6' | '7') => Chain.op(() => { Assertions.assertEq(`Loaded version of TinyMCE should be ${version}`, version, Global.tinymce.majorVersion); }); @@ -67,14 +67,31 @@ UnitTest.asynctest('LoadTinyTest', (success, failure) => { + `), + cAssertTinymceVersion('7'), + Chain.op(() => { + Assertions.assertEq( + 'TinyMCE should have been loaded from Cloud', + 'https://cdn.tiny.cloud/1/a-fake-api-key/tinymce/7', + Global.tinymce.baseURI.source + ); + }), + cRemove, + cDeleteTinymce, + cRender({}, ` + `), cAssertTinymceVersion('6'), Chain.op(() => { Assertions.assertEq( 'TinyMCE should have been loaded from Cloud', - 'https://cdn.tiny.cloud/1/a-fake-api-key/tinymce/6-dev', + 'https://cdn.tiny.cloud/1/a-fake-api-key/tinymce/6', Global.tinymce.baseURI.source ); }), @@ -99,4 +116,4 @@ UnitTest.asynctest('LoadTinyTest', (success, failure) => { cDeleteTinymce ]), ], success, failure); -}); \ No newline at end of file +}); diff --git a/yarn.lock b/yarn.lock index d9e062c..ea3250d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13742,10 +13742,10 @@ tiny-emitter@^2.0.0: resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.0.0.tgz#44945e4c12ea90d08aedf357304c24269a164e54" integrity sha512-y4b5OhxScZiFovTgEFzI+2zEDSMfbJSQ4hfcYPg9HXvudxvDIHjc3fF73m0Sys5h8YtpWPG1fT9iJsjSnwuo2A== -"tinymce@^6.0.0 || ^5.5.1": - version "6.3.1" - resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-6.3.1.tgz#cc5cf2b9f702d429cf5d1d21ed62245d768bfc4f" - integrity sha512-+oCwXuTxAdJXVJ0130OxQz0JDNsqg3deuzgeUo8X5Vb27EzCJgXwO5eWvCxvkxpQo4oiHMVlM4tUIpTUHufHGQ== +"tinymce-7@npm:tinymce@^7", "tinymce@^7.0.0 || ^6.0.0 || ^5.5.1": + version "7.0.1" + resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.0.1.tgz#743f4003027a13497654a5ce5ca74793815386f7" + integrity sha512-0a7DJnhniBx2psRuKcVQ9g4hujN6PAR4fPS0NSF1T1luH1RBDZVVEn2pGND6Ly+AW1lUm/cHOHjsasqBelMhbw== tmp@^0.2.1: version "0.2.1" From 598f50884db6a53dcc5e3535ea3d99f6b0796459 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Mon, 15 Apr 2024 20:55:46 +0100 Subject: [PATCH 2/8] INT-3302: remove 6-dev channel as it no longer exists --- src/stories/Editor.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stories/Editor.stories.tsx b/src/stories/Editor.stories.tsx index 7f5094b..f82eb7f 100644 --- a/src/stories/Editor.stories.tsx +++ b/src/stories/Editor.stories.tsx @@ -53,7 +53,7 @@ export default { defaultValue: {summary: '5'} }, defaultValue: ['7'], - options: ['5', '5-dev', '5-testing', '6-dev', '6-testing', '6-stable', '7-dev', '7-testing', '7-stable'], + options: ['5', '5-dev', '5-testing', '6-testing', '6-stable', '7-dev', '7-testing', '7-stable'], control: { type: 'select'} }, conf: { From 903e2d99e5fdc4c5dd765bd1ceb53cc82f431aa0 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Tue, 16 Apr 2024 09:06:27 +0100 Subject: [PATCH 3/8] INT-3302: Remove unnecessary empty line --- src/test/ts/browser/LoadTinyTest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/ts/browser/LoadTinyTest.ts b/src/test/ts/browser/LoadTinyTest.ts index ef7cc62..8ef4aa0 100644 --- a/src/test/ts/browser/LoadTinyTest.ts +++ b/src/test/ts/browser/LoadTinyTest.ts @@ -101,7 +101,6 @@ UnitTest.asynctest('LoadTinyTest', (success, failure) => { Chain.op(() => { Assertions.assertEq( 'TinyMCE should have been loaded from Cloud', - 'https://cdn.tiny.cloud/1/a-fake-api-key/tinymce/6-stable', Global.tinymce.baseURI.source ); From a6459a25c8d2bc8b10321aedc1331719df41eebf Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Tue, 16 Apr 2024 10:27:42 +0100 Subject: [PATCH 4/8] INT-3302: Update README links to point to version 7 of the docs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5a7c9e4..e4b7284 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This package is a thin wrapper around [TinyMCE](https://github.com/tinymce/tinymce) to make it easier to use in a Vue application. -* If you need detailed documentation on TinyMCE, see: [TinyMCE Documentation](https://www.tiny.cloud/docs/tinymce/6/). -* For the TinyMCE Vue Quick Start, see: [TinyMCE Documentation - Vue Integration](https://www.tiny.cloud/docs/tinymce/6/vue-cloud). -* For the TinyMCE Vue Technical Reference, see: [TinyMCE Documentation - TinyMCE Vue Technical Reference](https://www.tiny.cloud/docs/tinymce/6/vue-ref). +* If you need detailed documentation on TinyMCE, see: [TinyMCE Documentation](https://www.tiny.cloud/docs/tinymce/7/). +* For the TinyMCE Vue Quick Start, see: [TinyMCE Documentation - Vue Integration](https://www.tiny.cloud/docs/tinymce/7/vue-cloud). +* For the TinyMCE Vue Technical Reference, see: [TinyMCE Documentation - TinyMCE Vue Technical Reference](https://www.tiny.cloud/docs/tinymce/7/vue-ref). ### Support From 5d4a1ecd748f1a137a4371461cf388aa1e896f91 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Tue, 16 Apr 2024 10:28:42 +0100 Subject: [PATCH 5/8] INT-3302: Update package version to 6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 083bf05..b3c830a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tinymce/tinymce-vue", - "version": "5.1.2-rc", + "version": "6.0.0-rc", "description": "Official TinyMCE Vue 3 Component", "private": false, "repository": { From ba9f8edde2ce16db9b469e4304bb605e06f3e74f Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Thu, 18 Apr 2024 07:08:24 +0100 Subject: [PATCH 6/8] INT-3302: Add changelog item --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79d7709..894c6ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +- Default cloud channel to '7' +- Add missing events: `onInput`, `onCommentChange`, `onCompositionEnd`, `onCompositionStart`, `onCompositionUpdate` ## 5.1.0 - 2023-04-05 From 44735fcc1398c450a2f836a9d1bc0f8a3c734b52 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Tue, 23 Apr 2024 09:02:49 +0100 Subject: [PATCH 7/8] INT-3302: fix changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 894c6ae..3fcacf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased + +### Changed - Default cloud channel to '7' + +### Added - Add missing events: `onInput`, `onCommentChange`, `onCompositionEnd`, `onCompositionStart`, `onCompositionUpdate` ## 5.1.0 - 2023-04-05 From 7f9e0fe0e066397eb0bf820267e7ea46f4d18ec4 Mon Sep 17 00:00:00 2001 From: Hamza Benkhaldoun Date: Tue, 23 Apr 2024 11:15:16 +0100 Subject: [PATCH 8/8] INT-3302: fix changelog entry order --- CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fcacf2..5a2548c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,12 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased -### Changed -- Default cloud channel to '7' - ### Added - Add missing events: `onInput`, `onCommentChange`, `onCompositionEnd`, `onCompositionStart`, `onCompositionUpdate` +### Changed +- Default cloud channel to '7' + ## 5.1.0 - 2023-04-05 ### Added