Skip to content

Commit

Permalink
upd 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nshenderov committed Jan 12, 2023
1 parent c9b0a58 commit 5a49553
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
53 changes: 47 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,61 @@ yarn build
```

> 💡 `sizes` and `loading` attributes for image can be set in source mode.
> If you use default upload provider and you want prefix img url with api path you need to add `baseURL` in `api.js` file `(config/api.js)`

## <a id="configuration"></a>⚙️ Configuration
CKEditor config should be defined in `config.editor` field in `plugins.js` file.

> ⚠️ Regex patterns and callback functions (/.*/ /^(p|h[2-4])$/' | match => {..} etc) are not allowed in plugins.js config
>According to [this PR](https://github.com/nshenderov/strapi-plugin-ckeditor/pull/54), you can create ckeditor.js file in your /config directory and define editor's config in there. This way you can specify all regex patterns, functions, and so on. (plugin's config still should be placed in plugins.js)
<details>
<summary>(spoiler) <b>Example of /config/ckeditor.js:</b> </summary>

```js
globalThis.ckEditorConfig = {
toolbar: {
items: [ ]
},
mediaEmbed: {
previewsInData: true,

providers: [
{
name: 'youtube',
url: [
/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,
/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,
/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,
/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/
],
html: match => {
const id = match[1];

return (`<iframe
src="https://www.youtube-nocookie.com/embed/${id}"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen />
`);
}
},
]
}
}
```

</details>


**⚠️ `plugins.js` not `plugin.js` ⚠️**

**`plugins.js` file should be placed in `config` folder.**

**💡`fullscreen mode` and `source mode` not supported with `balloon` and `block` toolbars.**
**💡`fullscreen mode` and `source mode` are not supported with `balloon` and `block` toolbars.**

Learn more about configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).
Learn more about editor's configuration from [official documentation](https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/configuration.html).

<details>
<summary>(spoiler) <b>Built in plugins:</b> </summary>
Expand Down Expand Up @@ -340,7 +382,6 @@ module.exports = () => {
]
},
// https://ckeditor.com/docs/ckeditor5/latest/features/general-html-support.html
// Regular expressions (/.*/ /^(p|h[2-4])$/' etc) for htmlSupport does not allowed in this config
htmlSupport: {
allow: [
{
Expand Down Expand Up @@ -943,9 +984,9 @@ module.exports = styles;
## <a id="requirements"></a>⚠️ Requirements
Strapi **v4.1.8+**

Node **14 - 16**
Node **>=14.19.1 <=18.x.x**

Tested on **v4.1.8 - 4.3.4**
Tested on **v4.1.8 - 4.5.6**

## <a id="thanks"></a>👍 This build includes some useful plugins based on these repos so thanks to them:
https://github.com/Roslovets-Inc/strapi-plugin-ckeditor5
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@_sh/strapi-plugin-ckeditor",
"version": "1.1.2",
"version": "1.1.3",
"description": "Replaces the default Strapi WYSIWYG editor with a customized buil of CKEditor 5 packed with useful plugins.",
"private": false,
"keywords": [
Expand Down

0 comments on commit 5a49553

Please sign in to comment.