Skip to content

Commit

Permalink
Merge branch 'master' into ck/16311-core-2
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Aug 14, 2024
2 parents 468a21f + 5c870eb commit fde7326
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ If you are familiar with our previous, discontinued product and would like to sw

## CKEditor 5 framework integrations

Do you to use a framework? Native integrations with the most popular libraries will save you time and effort. There are five official integrations so far:
Do you want to use a framework? Native integrations with the most popular libraries will save you time and effort. There are five official integrations so far:

* {@link getting-started/integrations/angular Integrate CKEditor 5 with Angular}
* {@link getting-started/integrations/react Integrate CKEditor 5 with React}
Expand Down
13 changes: 13 additions & 0 deletions docs/getting-started/integrations/angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,19 @@ export class AppComponent {

For advanced usage see the {@link getting-started/setup/ui-language Setting the UI language} guide.

<info-box warning>
There is a known issue related to the localization in Angular 17. Read more in the [known issues section](#known-issues) below.
</info-box>

## Known issues

The `moduleResolution` option of the TypeScript configuration determines the algorithm for finding and resolving modules from `node_modules`. In Angular 17, the option is set to `node` by default. This option prevents type declaration for editor translations from being correctly loaded. To fix it, you have several options:

* You can set the `moduleResolution` option to `bundler`. It is the recommended setting in TypeScript 5.0+ for applications that use a bundler. And it is a recommended way of fixing this problem. You can check other solutions below for lower TypeScript versions.
* You can tell the TypeScript compiler to suppress the problem using the `// @ts-expect-error` comment above the imported translations.
* You can update Angular to version 18, where the `moduleResolution` option is set to `bundler` by default.
* You can import translations directly from our CDN, like: `import ‘https://cdn.ckeditor.com/ckeditor5/{@var ckeditor5-version}/translations/es.umd.js’;`. This way, the editor will load the translations automatically, so you do not need to pass them manually into the config.

## Contributing and reporting issues

The source code of the CKEditor&nbsp;5 rich text editor component for Angular is available on GitHub in [https://github.com/ckeditor/ckeditor5-angular](https://github.com/ckeditor/ckeditor5-angular).
8 changes: 4 additions & 4 deletions docs/getting-started/integrations/react.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function App() {
Bold, Essentials, Italic, Mention, Paragraph, SlashCommand, Undo
],
licenseKey: '<YOUR_LICENSE_KEY>',
mention: {
mention: {
// Mention configuration
},
initialData: '<p>Hello from CKEditor 5 in React!</p>',
Expand Down Expand Up @@ -169,7 +169,7 @@ The `CKEditorContext` component supports the following properties:
* `config` &ndash; The CKEditor&nbsp;5 context configuration.
* `isLayoutReady` &ndash; A property that delays the context creation when set to `false`. It creates the context and the editor children once it is `true` or unset. Useful when the CKEditor&nbsp;5 annotations or a presence list are used.
* `id` &ndash; The context ID. When this property changes, the component restarts the context with its editor and reinitializes it based on the current configuration.
* `onReady` &ndash; A function called when the context is ready and all editors inside were initialized with the `context` instance. This callback is also called after the reinitialization of the component if an error has occurred.
* `onReady` &ndash; A function called when the context is initialized but before the editors in the tree are set up. After this function is executed, you can track additions and removals in the context tree using the `context.editors.on('change', () => {})` method.
* `onError` &ndash; A function called when the context has crashed during the initialization or during the runtime. It receives two arguments: the error instance and the error details. Error details is an object that contains two properties:
* `{String} phase`: `'initialization'|'runtime'` &ndash; Informs when the error has occurred (during the editor or context initialization, or after the initialization).
* `{Boolean} willContextRestart` &ndash; When `true`, it means that the context component will restart itself.
Expand All @@ -194,7 +194,7 @@ import 'ckeditor5/ckeditor5.css';
function App() {
const editorToolbarRef = useRef( null );
const [ isMounted, setMounted ] = useState( false );

useEffect( () => {
setMounted( true );

Expand All @@ -216,7 +216,7 @@ function App() {
toolbar: [ 'undo', 'redo', '|', 'bold', 'italic' ]
} }
onReady={ ( editor ) => {
if ( editorToolbarRef.current ) {
if ( editorToolbarRef.current ) {
editorToolbarRef.current.appendChild( editor.ui.view.toolbar.element );
}
}}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"table": "^6.8.1",
"terser-webpack-plugin": "^4.2.3",
"typescript": "5.0.4",
"umberto": "^4.2.4",
"umberto": "^4.2.6",
"upath": "^2.0.0",
"wait-on": "^6.0.1",
"webpack": "^5.58.1"
Expand Down

0 comments on commit fde7326

Please sign in to comment.