diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e808a6..02e483d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Changed +- Moved tinymce dependency to be a optional peer dependency. #INT-3324 + ## 6.0.0 - 2024-06-05 ### Added diff --git a/package.json b/package.json index a0122d6..c7ddbe6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tinymce/tinymce-vue", - "version": "6.0.2-rc", + "version": "7.0.2-rc", "description": "Official TinyMCE Vue 3 Component", "private": false, "repository": { @@ -33,8 +33,14 @@ "LICENSE.txt" ], "peerDependencies": { + "tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1", "vue": "^3.0.0" }, + "peerDependenciesMeta": { + "tinymce": { + "optional": true + } + }, "devDependencies": { "@babel/core": "^7.20.2", "@ephox/agar": "^8.0.1", @@ -69,6 +75,7 @@ "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-typescript2": "^0.34.1", "rollup-plugin-uglify": "^6.0.0", + "tinymce": "^7", "tinymce-4": "npm:tinymce@^4", "tinymce-5": "npm:tinymce@^5", "tinymce-6": "npm:tinymce@^6", @@ -84,8 +91,5 @@ "vue-router": "^4.3.2", "vue-template-compiler": "^2.7.16", "webpack": "^5.75.0" - }, - "dependencies": { - "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 bdf88f2..90f17b0 100644 --- a/src/main/ts/Utils.ts +++ b/src/main/ts/Utils.ts @@ -8,7 +8,7 @@ import { Ref, watch, SetupContext } from 'vue'; import { IPropTypes } from './components/EditorPropTypes'; -import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce'; +import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce'; const validEvents = [ 'onActivate', diff --git a/src/main/ts/components/Editor.ts b/src/main/ts/components/Editor.ts index 2fc4a0a..f5709a0 100644 --- a/src/main/ts/components/Editor.ts +++ b/src/main/ts/components/Editor.ts @@ -11,7 +11,7 @@ import { getTinymce } from '../TinyMCE'; import { isTextarea, mergePlugins, uuid, isNullOrUndefined, initEditor } from '../Utils'; import { editorProps, IPropTypes } from './EditorPropTypes'; import { h, defineComponent, onMounted, ref, Ref, toRefs, nextTick, watch, onBeforeUnmount, onActivated, onDeactivated } from 'vue'; -import { Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce'; +import type { Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce'; type EditorOptions = Parameters[0]; diff --git a/src/main/ts/components/EditorPropTypes.ts b/src/main/ts/components/EditorPropTypes.ts index 1f24175..12aa88f 100644 --- a/src/main/ts/components/EditorPropTypes.ts +++ b/src/main/ts/components/EditorPropTypes.ts @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * */ -import { TinyMCE } from 'tinymce'; +import type { TinyMCE } from 'tinymce'; type EditorOptions = Parameters[0]; diff --git a/src/stories/Editor.stories.tsx b/src/stories/Editor.stories.tsx index f82eb7f..8c0ab12 100644 --- a/src/stories/Editor.stories.tsx +++ b/src/stories/Editor.stories.tsx @@ -3,7 +3,7 @@ import { onBeforeMount, ref } from 'vue'; import { ScriptLoader } from '../main/ts/ScriptLoader'; import { Editor } from '../main/ts/components/Editor'; -import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce'; +import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce'; const apiKey = 'qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc'; const content = ` diff --git a/yarn.lock b/yarn.lock index 0839772..f9ab7c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -15341,10 +15341,10 @@ tiny-emitter@^2.0.0: resolved "https://registry.npmjs.org/tinymce/-/tinymce-7.0.1.tgz" integrity sha512-0a7DJnhniBx2psRuKcVQ9g4hujN6PAR4fPS0NSF1T1luH1RBDZVVEn2pGND6Ly+AW1lUm/cHOHjsasqBelMhbw== -"tinymce@^7.0.0 || ^6.0.0 || ^5.5.1": - version "7.1.1" - resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.1.1.tgz#63cd62c0288bdbddb854b3565387c8d7dec14be4" - integrity sha512-QQJKsEiM+jUfrlxNivuVUiv1jsHv4a27rub4oqajtsYQ4mFukN3hkWQrZnzVNtnPOIUsOGU2Ycem0DnEU/JKcA== +tinymce@^7: + version "7.2.1" + resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.2.1.tgz#9b4f6b5a0fa647e2953c174ac69aa47483683332" + integrity sha512-ADd1cvdIuq6NWyii0ZOZRuu+9sHIdQfcRNWBcBps2K8vy7OjlRkX6iw7zz1WlL9kY4z4L1DvIP+xOrVX/46aHA== tmp@^0.2.1: version "0.2.1"