Closed godai78 closed 2 weeks ago
The recent documentation update offers a detailed guide on integrating the CKEditor 5 component into React applications, emphasizing the use of a multi-root editor hook tailored for React. This update aims to assist developers in efficiently managing multiple text editing instances within their projects.
File Path | Change Summary |
---|---|
docs/.../react-multiroot.md |
Added documentation for integrating CKEditor 5 with React, focusing on the multi-root editor hook. |
docs/installation/integrations/react-multiroot.md (61)
Near line 20: Possible spelling mistake found. Context: ...re}. The easiest way to use multi-root CKEditor 5 in your React application is by using... --- Near line 32: Possible spelling mistake found. Context: ... with TypeScript support. Install the [CKEditor 5 WYSIWYG editor package for React](htt... --- Near line 38: Possible spelling mistake found. Context: ...ckeditor5-build-multi-root ``` Use the `useMultiRootEditor` hook inside your project: ```tsx // A... --- Near line 81: Possible spelling mistake found. Context: ...fault App; ``` ## Hook properties The `useMultiRootEditor` hook supports the following properties... --- Near line 83: Possible spelling mistake found. Context: ... * `editor: MultiRootEditor` (required) – The {@link module:editor-multi-root/mu... --- Near line 83: Possible spelling mistake found. Context: ...sh; The {@link module:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} cons... --- Near line 83: Possible spelling mistake found. Context: ...odule:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} constructor to use. ... --- Near line 83: Possible spelling mistake found. Context: ...ti-root/multirooteditor~MultiRootEditor `MultiRootEditor`} constructor to use. * `data: Object` ... --- Near line 84: Possible spelling mistake found. Context: ...`} constructor to use. * `data: Object` – The initial data for the created edito... --- Near line 85: Possible spelling mistake found. Context: ...ata} guide. * `rootsAttributes: Object` – The initial roots attributes for the c... --- Near line 86: Possible spelling mistake found. Context: ... the created editor. * `config: Object` – The editor configuration. See the {@li... --- Near line 86: Possible typo: you repeated a word Context: ...the {@link installation/getting-started/configuration Configuration} guide. * `disabled: Boolean` – T... --- Near line 87: Possible spelling mistake found. Context: ...iguration} guide. * `disabled: Boolean` – The {@link module:editor-multi-root/mu... --- Near line 87: Possible spelling mistake found. Context: ...sh; The {@link module:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} is b... --- Near line 87: Possible spelling mistake found. Context: ...odule:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} is being switched to... --- Near line 87: Possible spelling mistake found. Context: ...ti-root/multirooteditor~MultiRootEditor `MultiRootEditor`} is being switched to read-only mode i... --- Near line 88: Possible spelling mistake found. Context: ...to `true`. * `disableWatchdog: Boolean` – If set to `true`, {@link features/watc... --- Near line 89: Possible spelling mistake found. Context: ...ult. * `watchdogConfig: WatchdogConfig` – {@link module:watchdog/watchdog~Watchd... --- Near line 89: Possible spelling mistake found. Context: ...– {@link module:watchdog/watchdog~WatchdogConfig Configuration object} for the [watchdog... --- Near line 90: Possible spelling mistake found. Context: ...chdog.html). * `isLayoutReady: Boolean` – A property that delays the editor crea... --- Near line 90: Possible spelling mistake found. Context: ...or when sets to `true`. Useful when the CKEditor 5 annotations or a presence list are us... --- Near line 91: Possible spelling mistake found. Context: .... * `disableTwoWayDataBinding: Boolean` – Allows disabling the two-way data bind... --- Near line 92: Possible spelling mistake found. Context: ...value is `false`. * `onReady: Function` – It is called when the editor is ready ... --- Near line 92: Possible spelling mistake found. Context: ... with a {@link module:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} inst... --- Near line 92: Possible spelling mistake found. Context: ...odule:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} instance. This callb... --- Near line 92: Possible spelling mistake found. Context: ...ti-root/multirooteditor~MultiRootEditor `MultiRootEditor`} instance. This callback is also calle... --- Near line 92: Possible spelling mistake found. Context: ... This callback is also called after the reinitialization of the component if an error occurred. ... --- Near line 93: Possible spelling mistake found. Context: ... error occurred. * `onChange: Function` – It is called when the editor data has ... --- Near line 94: Possible spelling mistake found. Context: ...ange:data`} event. * `onBlur: Function` – It is called when the editor was blurr... --- Near line 95: Possible spelling mistake found. Context: ...ent#blur`} event. * `onFocus: Function` – It is called when the editor was focus... --- Near line 96: Possible spelling mistake found. Context: ...nt#focus`} event. * `onError: Function` – It is called when the editor has crash... --- Near line 96: Possible typo: you repeated a whitespace Context: ...e error instance and the error details. Error details is an object that contains... --- Near line 98: Possible spelling mistake found. Context: ... * `phase: 'initialization'|'runtime'` – Informs when the error has occurred (d... --- Near line 99: Possible spelling mistake found. Context: ...ation). * `willEditorRestart: Boolean` – When `true`, it means that the editor ... --- Near line 101: Possible spelling mistake found. Context: ...rt itself. The editor event callbacks (`onChange`, `onBlur`, `onFocus`) receive two argu... --- Near line 101: Possible spelling mistake found. Context: ...The editor event callbacks (`onChange`, `onBlur`, `onFocus`) receive two arguments: 1.... --- Near line 101: Possible spelling mistake found. Context: ... event callbacks (`onChange`, `onBlur`, `onFocus`) receive two arguments: 1. An {@link ... --- Near line 103: Possible spelling mistake found. Context: ...o arguments: 1. An {@link module:utils/eventinfo~EventInfo `EventInfo`} object. 2. An {@... --- Near line 103: Possible spelling mistake found. Context: ...s: 1. An {@link module:utils/eventinfo~EventInfo `EventInfo`} object. 2. An {@link modul... --- Near line 103: Possible spelling mistake found. Context: ...{@link module:utils/eventinfo~EventInfo `EventInfo`} object. 2. An {@link module:editor-mu... --- Near line 104: Possible spelling mistake found. Context: .... 2. An {@link module:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} inst... --- Near line 104: Possible spelling mistake found. Context: ...odule:editor-multi-root/multirooteditor~MultiRootEditor `MultiRootEditor`} instance. ## Hook v... --- Near line 104: Possible spelling mistake found. Context: ...ti-root/multirooteditor~MultiRootEditor `MultiRootEditor`} instance. ## Hook values The `useMu... --- Near line 108: Possible spelling mistake found. Context: ...Editor`} instance. ## Hook values The `useMultiRootEditor` hook returns the following values: * ... --- Near line 110: Possible spelling mistake found. Context: ...turns the following values: * `editor` – The instance of created editor. * `too... --- Near line 111: Possible spelling mistake found. Context: ...e of created editor. * `toolbarElement` – `ReactElement` that contains the toolb... --- Near line 111: Possible spelling mistake found. Context: ...ated editor. * `toolbarElement` – `ReactElement` that contains the toolbar. It could be... --- Near line 112: Possible spelling mistake found. Context: ...n the application. * `editableElements` – An array of `ReactElements` that descr... --- Near line 112: Possible spelling mistake found. Context: ... `editableElements` – An array of `ReactElements` that describes the editor's roots. Thi... --- Near line 113: Possible spelling mistake found. Context: ...ing root or adding a new root. * `data` – The current state of the editor's data... --- Near line 113: Possible spelling mistake found. Context: ...disabled two-way binding by passing the `disableTwoWayDataBinding` property. * `setData` – The func... --- Near line 114: Possible spelling mistake found. Context: ...woWayDataBinding` property. * `setData` – The function used for updating the edi... --- Near line 115: Possible spelling mistake found. Context: ...ating the editor's data. * `attributes` – The current state of the editor's attr... --- Near line 115: Possible spelling mistake found. Context: ...disabled two-way binding by passing the `disableTwoWayDataBinding` property. * `setAttributes` – Th... --- Near line 116: Possible spelling mistake found. Context: ...ataBinding` property. * `setAttributes` – The function used for updating the edi... --- Near line 120: Possible spelling mistake found. Context: ...'s attributes. ## Context feature The `useMultiRootEditor` hook also supports the {@link features... --- Near line 126: Possible spelling mistake found. Context: ...lied in the `data` object returned from `useMultiEditorHook`. Additionally, if you want to change o... --- Near line 126: Possible spelling mistake found. Context: ... data in the editor, you can simply use `setData` method provided by the hook. It works ... --- Near line 126: Possible spelling mistake found. Context: ...orks the same way in case of attributes – the hook provides the `attributes` obj... --- Near line 126: Possible spelling mistake found. Context: ...rovides the `attributes` object and the `setAttributes` method to update them. It ensures that... --- Near line 126: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing. Context: ... to update them. It ensures that if you want to use or save the state of the editor, th...
@DawidKossowski, @Witoso - let's decide whether we want it in a subfolder (like it is now) or side-by-side rather (like the Vue guides are). Before we merge it and add some more redirs :)
When it comes to Vue integration, the sections are side-by-side because they concern different versions of Vue. In the case of React integration, we still refer to the same version but utilize different editor types and approaches. That's why I believe the subfolder is clearer.
Suggested merge commit message (convention)
Docs: React multi-root guide.
Additional information
For example – encountered issues, assumptions you had to make, other affected tickets, etc.
Summary by CodeRabbit