Skip to content

Commit 2a7d015

Browse files
authored
Merge pull request #571 from ckeditor/ck/567
Fix: data prop is no longer unavailable in Next.js related integrations. Closes #567 Other: Remove prop-types from dependencies of package.
2 parents 39603fa + 32197ad commit 2a7d015

File tree

5 files changed

+38
-86
lines changed

5 files changed

+38
-86
lines changed

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,19 @@
2828
"./package.json": "./package.json"
2929
},
3030
"dependencies": {
31-
"prop-types": "^15.7.2",
3231
"@ckeditor/ckeditor5-integrations-common": "^2.2.2"
3332
},
3433
"peerDependencies": {
3534
"ckeditor5": ">=42.0.0 || ^0.0.0-nightly",
3635
"react": "^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0"
3736
},
3837
"devDependencies": {
39-
"@testing-library/jest-dom": "^6.4.8",
4038
"@ckeditor/ckeditor5-dev-bump-year": "^44.0.0",
4139
"@ckeditor/ckeditor5-dev-ci": "^44.0.0",
4240
"@ckeditor/ckeditor5-dev-release-tools": "^44.0.0",
4341
"@ckeditor/ckeditor5-dev-utils": "^44.0.0",
4442
"@testing-library/dom": "^10.3.1",
43+
"@testing-library/jest-dom": "^6.4.8",
4544
"@testing-library/react": "^16.0.0",
4645
"@types/react": "^18.0.0",
4746
"@types/react-dom": "^18.0.0",
@@ -59,6 +58,7 @@
5958
"lint-staged": "^10.2.11",
6059
"listr2": "^6.5.0",
6160
"minimist": "^1.2.5",
61+
"prop-types": "^15.8.1",
6262
"react": "^18.0.0",
6363
"react-dom": "^18.0.0",
6464
"react16": "npm:react@^16.0.0",
@@ -67,8 +67,8 @@
6767
"react17-dom": "npm:react-dom@^17.0.0",
6868
"react18": "npm:react@^18.0.0",
6969
"react18-dom": "npm:react-dom@^18.0.0",
70-
"react19": "npm:[email protected]-beta-26f2496093-20240514",
71-
"react19-dom": "npm:[email protected]-beta-26f2496093-20240514",
70+
"react19": "npm:[email protected]",
71+
"react19-dom": "npm:[email protected]",
7272
"semver": "^7.0.0",
7373
"typescript": "^5.0.0",
7474
"vite": "^5.3.1",

src/ckeditor.tsx

+4-18
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/* globals window */
77

88
import React from 'react';
9-
import PropTypes, { type InferProps, type Validator } from 'prop-types';
109

1110
import type {
1211
EventInfo,
@@ -430,28 +429,12 @@ export default class CKEditor<TEditor extends Editor> extends React.Component<Pr
430429
}
431430

432431
public static override contextType = ContextWatchdogContext;
433-
434-
// Properties definition.
435-
public static propTypes = {
436-
editor: PropTypes.func.isRequired as unknown as Validator<{ create( ...args: any ): Promise<any> }>,
437-
data: PropTypes.string,
438-
config: PropTypes.object,
439-
disableWatchdog: PropTypes.bool,
440-
watchdogConfig: PropTypes.object,
441-
onChange: PropTypes.func,
442-
onReady: PropTypes.func,
443-
onFocus: PropTypes.func,
444-
onBlur: PropTypes.func,
445-
onError: PropTypes.func,
446-
disabled: PropTypes.bool,
447-
id: PropTypes.any
448-
};
449432
}
450433

451434
/**
452435
* TODO this is type space definition for props, the CKEditor.propTypes is a run-time props validation that should match.
453436
*/
454-
export interface Props<TEditor extends Editor> extends InferProps<typeof CKEditor.propTypes> {
437+
export interface Props<TEditor extends Editor> {
455438
editor: {
456439
create( ...args: any ): Promise<TEditor>;
457440
EditorWatchdog: typeof EditorWatchdog;
@@ -467,6 +450,9 @@ export interface Props<TEditor extends Editor> extends InferProps<typeof CKEdito
467450
onChange?: ( event: EventInfo, editor: TEditor ) => void;
468451
onFocus?: ( event: EventInfo, editor: TEditor ) => void;
469452
onBlur?: ( event: EventInfo, editor: TEditor ) => void;
453+
data?: string;
454+
disabled?: boolean;
455+
id?: any;
470456
}
471457

472458
interface ErrorDetails {

src/useMultiRootEditor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import React, {
77
forwardRef, useState, useEffect, useRef, useContext, useCallback, memo,
8-
type Dispatch, type SetStateAction, type RefObject
8+
type Dispatch, type SetStateAction, type RefObject, type JSX
99
} from 'react';
1010

1111
import { overwriteArray, overwriteObject, uniq } from '@ckeditor/ckeditor5-integrations-common';

vite.config.ts

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export default defineConfig( {
4141
output: {
4242
globals: {
4343
'react': 'React',
44-
'prop-types': 'PropTypes',
4544
'@ckeditor/ckeditor5-integrations-common': 'CKEDITOR_INTEGRATIONS_COMMON'
4645
}
4746
}

yarn.lock

+29-62
Original file line numberDiff line numberDiff line change
@@ -2952,21 +2952,19 @@
29522952
integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==
29532953

29542954
"@types/prop-types@*":
2955-
version "15.7.13"
2956-
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.13.tgz#2af91918ee12d9d32914feb13f5326658461b451"
2957-
integrity sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==
2955+
version "15.7.14"
2956+
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.14.tgz#1433419d73b2a7ebfc6918dcefd2ec0d5cd698f2"
2957+
integrity sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==
29582958

29592959
"@types/react-dom@^18.0.0":
2960-
version "18.3.0"
2961-
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.0.tgz#0cbc818755d87066ab6ca74fbedb2547d74a82b0"
2962-
integrity sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==
2963-
dependencies:
2964-
"@types/react" "*"
2960+
version "18.3.5"
2961+
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.3.5.tgz#45f9f87398c5dcea085b715c58ddcf1faf65f716"
2962+
integrity sha512-P4t6saawp+b/dFrUr2cvkVsfvPguwsxtH6dNIYRllMsefqFzkZk5UIjzyDOv5g1dXIPdG4Sp1yCR4Z6RCUsG/Q==
29652963

2966-
"@types/react@*", "@types/react@^18.0.0":
2967-
version "18.3.10"
2968-
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.10.tgz#6edc26dc22ff8c9c226d3c7bf8357b013c842219"
2969-
integrity sha512-02sAAlBnP39JgXwkAq3PeU9DVaaGpZyF3MGcC0MKgQVkZor5IiiDAipVaxQHtDJAmO4GIy/rVBy/LzVj76Cyqg==
2964+
"@types/react@^18.0.0":
2965+
version "18.3.18"
2966+
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.18.tgz#9b382c4cd32e13e463f97df07c2ee3bbcd26904b"
2967+
integrity sha512-t4yC+vtgnkYjNSKlFx1jkAhH8LgTo2N/7Qvi83kdEaUtMDiwpbLAktKDaAMlRcJ5eSxZkH74eEGt1ky31d7kfQ==
29702968
dependencies:
29712969
"@types/prop-types" "*"
29722970
csstype "^3.0.2"
@@ -7492,7 +7490,7 @@ [email protected], progress@^2.0.0:
74927490
resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8"
74937491
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==
74947492

7495-
prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1:
7493+
prop-types@^15.6.2, prop-types@^15.8.1:
74967494
version "15.8.1"
74977495
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
74987496
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -7618,7 +7616,7 @@ raw-loader@^4.0.1:
76187616
loader-utils "^2.0.0"
76197617
schema-utils "^3.0.0"
76207618

7621-
react-dom@^18.0.0:
7619+
react-dom@^18.0.0, "react18-dom@npm:react-dom@^18.0.0":
76227620
version "18.3.1"
76237621
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
76247622
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
@@ -7677,39 +7675,24 @@ react-refresh@^0.14.2:
76777675
loose-envify "^1.1.0"
76787676
object-assign "^4.1.1"
76797677

7680-
"react18-dom@npm:react-dom@^18.0.0":
7681-
version "18.3.1"
7682-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
7683-
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
7684-
dependencies:
7685-
loose-envify "^1.1.0"
7686-
scheduler "^0.23.2"
7687-
7688-
"react18@npm:react@^18.0.0":
7678+
"react18@npm:react@^18.0.0", react@^18.0.0:
76897679
version "18.3.1"
76907680
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
76917681
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
76927682
dependencies:
76937683
loose-envify "^1.1.0"
76947684

7695-
"react19-dom@npm:[email protected]-beta-26f2496093-20240514":
7696-
version "19.0.0-beta-26f2496093-20240514"
7697-
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0-beta-26f2496093-20240514.tgz#5fe4e829db8d379303057f539900a61ed6ca2615"
7698-
integrity sha512-UvQ+K1l3DFQ34LDgfFSNuUGi9EC+yfE9tS6MdpNTd5fx7qC7KLfepfC/KpxWMQZ7JfE3axD4ZO6H4cBSpAZpqw==
7685+
"react19-dom@npm:[email protected]":
7686+
version "19.0.0"
7687+
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0.tgz#43446f1f01c65a4cd7f7588083e686a6726cfb57"
7688+
integrity sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==
76997689
dependencies:
7700-
scheduler "0.25.0-beta-26f2496093-20240514"
7690+
scheduler "^0.25.0"
77017691

7702-
"react19@npm:[email protected]":
7703-
version "19.0.0-beta-26f2496093-20240514"
7704-
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0-beta-26f2496093-20240514.tgz#3a0d63746b3f9ebd461a0731191bd08047fb1dbb"
7705-
integrity sha512-ZsU/WjNZ6GfzMWsq2DcGjElpV9it8JmETHm9mAJuOJNhuJcWJxt8ltCJabONFRpDFq1A/DP0d0KFj9CTJVM4VA==
7706-
7707-
react@^18.0.0:
7708-
version "18.3.1"
7709-
resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"
7710-
integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==
7711-
dependencies:
7712-
loose-envify "^1.1.0"
7692+
"react19@npm:[email protected]":
7693+
version "19.0.0"
7694+
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0.tgz#6e1969251b9f108870aa4bff37a0ce9ddfaaabdd"
7695+
integrity sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==
77137696

77147697
read-cache@^1.0.0:
77157698
version "1.0.0"
@@ -8042,11 +8025,6 @@ safe-regex-test@^1.0.3:
80428025
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
80438026
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
80448027

8045-
8046-
version "0.25.0-beta-26f2496093-20240514"
8047-
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0-beta-26f2496093-20240514.tgz#a3bc0ff694ec6de7a78c1e48e1f8f4a8555bd77d"
8048-
integrity sha512-vDwOytLHFnA3SW2B1lNcbO+/qKVyLCX+KLpm+tRGNDsXpyxzRgkIaYGWmX+S70AJGchUHCtuqQ50GFeFgDbXUw==
8049-
80508028
scheduler@^0.19.1:
80518029
version "0.19.1"
80528030
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
@@ -8070,6 +8048,11 @@ scheduler@^0.23.2:
80708048
dependencies:
80718049
loose-envify "^1.1.0"
80728050

8051+
scheduler@^0.25.0:
8052+
version "0.25.0"
8053+
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015"
8054+
integrity sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==
8055+
80738056
schema-utils@^3.0.0, schema-utils@^3.1.1:
80748057
version "3.3.0"
80758058
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe"
@@ -8465,7 +8448,7 @@ stringify-object@^3.3.0:
84658448
is-obj "^1.0.1"
84668449
is-regexp "^1.0.0"
84678450

8468-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
8451+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
84698452
version "6.0.1"
84708453
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
84718454
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -8479,13 +8462,6 @@ strip-ansi@^5.2.0:
84798462
dependencies:
84808463
ansi-regex "^4.1.0"
84818464

8482-
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
8483-
version "6.0.1"
8484-
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
8485-
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
8486-
dependencies:
8487-
ansi-regex "^5.0.1"
8488-
84898465
strip-ansi@^7.0.1, strip-ansi@^7.1.0:
84908466
version "7.1.0"
84918467
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
@@ -9238,16 +9214,7 @@ workerpool@^6.5.1:
92389214
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544"
92399215
integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==
92409216

9241-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
9242-
version "7.0.0"
9243-
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
9244-
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
9245-
dependencies:
9246-
ansi-styles "^4.0.0"
9247-
string-width "^4.1.0"
9248-
strip-ansi "^6.0.0"
9249-
9250-
[email protected], wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
9217+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", [email protected], wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
92519218
version "7.0.0"
92529219
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
92539220
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)