Skip to content

Commit f6b7a13

Browse files
authored
INT-3324: Move tinymce to an optional peer dependency (#544)
* INT-3324: tinymce is now an optional peer dependency * INT-3324: Swap all imports of tinymce to `import type` * INT-3324: Upgraded dependencies to latest * INT-3324: Added changelog entries * INT-3324: Bump major version
1 parent d919ad8 commit f6b7a13

File tree

7 files changed

+2617
-3463
lines changed

7 files changed

+2617
-3463
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
### Fixed
10+
- Updated dependencies. #INT-3324
11+
12+
### Changed
13+
- Moved tinymce dependency to peerDependencies, as well as making it optional. #INT-3324
14+
915
## 5.1.0 - 2024-06-11
1016

1117
### Added

package.json

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,56 @@
2626
"author": "Ephox Corporation DBA Tiny Technologies, Inc.",
2727
"license": "MIT",
2828
"dependencies": {
29-
"prop-types": "^15.6.2",
30-
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
29+
"prop-types": "^15.6.2"
3130
},
3231
"peerDependencies": {
3332
"react": "^18.0.0 || ^17.0.1 || ^16.7.0",
34-
"react-dom": "^18.0.0 || ^17.0.1 || ^16.7.0"
33+
"react-dom": "^18.0.0 || ^17.0.1 || ^16.7.0",
34+
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
35+
},
36+
"peerDependenciesMeta": {
37+
"tinymce": {
38+
"optional": true
39+
}
3540
},
3641
"devDependencies": {
37-
"@babel/core": "^7.23.3",
38-
"@babel/preset-env": "^7.23.3",
39-
"@babel/preset-react": "^7.23.3",
40-
"@babel/preset-typescript": "^7.23.3",
42+
"@babel/core": "^7.24.9",
43+
"@babel/preset-env": "^7.24.8",
44+
"@babel/preset-react": "^7.24.7",
45+
"@babel/preset-typescript": "^7.24.7",
4146
"@ephox/agar": "^8.0.0-alpha.0",
4247
"@ephox/bedrock-client": "^14.1.1",
43-
"@ephox/bedrock-server": "^14.1.3",
48+
"@ephox/bedrock-server": "^14.1.4",
4449
"@ephox/katamari": "^9.1.5",
4550
"@ephox/mcagar": "^9.0.0-alpha.0",
4651
"@ephox/sand": "^6.0.9",
4752
"@ephox/sugar": "^9.2.1",
48-
"@storybook/addon-essentials": "^8.0.2",
49-
"@storybook/addon-interactions": "^8.0.2",
50-
"@storybook/addon-links": "^8.0.2",
51-
"@storybook/blocks": "^8.0.2",
52-
"@storybook/react": "^8.0.2",
53-
"@storybook/react-vite": "^8.0.2",
53+
"@storybook/addon-essentials": "^8.2.4",
54+
"@storybook/addon-interactions": "^8.2.4",
55+
"@storybook/addon-links": "^8.2.4",
56+
"@storybook/blocks": "^8.2.4",
57+
"@storybook/react": "^8.2.4",
58+
"@storybook/react-vite": "^8.2.4",
5459
"@tinymce/beehive-flow": "^0.19.0",
5560
"@tinymce/eslint-plugin": "^2.3.1",
5661
"@tinymce/miniature": "^6.0.0",
57-
"@types/node": "^20.9.0",
58-
"@types/prop-types": "^15.7.10",
59-
"@types/react": "^18.2.37",
60-
"@types/react-dom": "^18.2.15",
62+
"@types/node": "^20.14.10",
63+
"@types/prop-types": "^15.7.12",
64+
"@types/react": "^18.3.3",
65+
"@types/react-dom": "^18.3.0",
6166
"gh-pages": "^6.1.0",
62-
"react": "^18.2.0",
63-
"react-dom": "^18.2.0",
64-
"rimraf": "^5.0.5",
65-
"storybook": "^8.0.2",
67+
"react": "^18.3.1",
68+
"react-dom": "^18.3.1",
69+
"rimraf": "^6.0.1",
70+
"storybook": "^8.2.4",
71+
"tinymce": "^7.2.1",
6672
"tinymce-4": "npm:tinymce@^4",
6773
"tinymce-5": "npm:tinymce@^5",
6874
"tinymce-6": "npm:tinymce@^6",
6975
"tinymce-7": "npm:tinymce@^7",
70-
"typescript": "~5.4.3",
71-
"vite": "^5.2.2"
76+
"typescript": "~5.5.3",
77+
"vite": "^5.3.3"
7278
},
73-
"version": "5.1.2-rc",
79+
"version": "6.0.0-rc",
7480
"name": "@tinymce/tinymce-react"
7581
}

src/main/ts/Events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Editor as TinyMCEEditor, EditorEvent, Events } from 'tinymce';
1+
import type { Editor as TinyMCEEditor, EditorEvent, Events } from 'tinymce';
22

33
export type EventHandler<A> = (a: EditorEvent<A>, editor: TinyMCEEditor) => unknown;
44

src/main/ts/TinyMCE.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TinyMCE as TinyMCEGlobal } from 'tinymce';
1+
import type { TinyMCE as TinyMCEGlobal } from 'tinymce';
22

33
const getTinymce = (view: Window): TinyMCEGlobal | null => {
44
const global = view as any;

src/main/ts/Utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { eventPropTypes, IEventPropTypes } from './components/EditorPropTypes';
22
import { IAllProps } from './components/Editor';
3-
import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
3+
import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
44

55
export const isFunction = (x: unknown): x is Function => typeof x === 'function';
66

src/main/ts/components/Editor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ScriptItem, ScriptLoader } from '../ScriptLoader2';
44
import { getTinymce } from '../TinyMCE';
55
import { isFunction, isTextareaOrInput, mergePlugins, uuid, configHandlers, isBeforeInputEventAvailable, isInDoc, setMode } from '../Utils';
66
import { EditorPropTypes, IEditorPropTypes } from './EditorPropTypes';
7-
import { Bookmark, Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';
7+
import type { Bookmark, Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';
88

99
type OmitStringIndexSignature<T> = { [K in keyof T as string extends K ? never : K]: T[K] };
1010

0 commit comments

Comments
 (0)