Skip to content

Commit db5da2b

Browse files
committed
fix(deps): update ckeditor to 45 (unified package)
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
1 parent 3c78131 commit db5da2b

File tree

10 files changed

+9526
-13031
lines changed

10 files changed

+9526
-13031
lines changed

package-lock.json

Lines changed: 9472 additions & 12959 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,6 @@
1515
"test:unit:watch": "jest --watch src/tests/unit"
1616
},
1717
"dependencies": {
18-
"@ckeditor/ckeditor5-alignment": "44.3.0",
19-
"@ckeditor/ckeditor5-basic-styles": "44.3.0",
20-
"@ckeditor/ckeditor5-block-quote": "44.3.0",
21-
"@ckeditor/ckeditor5-build-decoupled-document": "44.3.0",
22-
"@ckeditor/ckeditor5-core": "44.3.0",
23-
"@ckeditor/ckeditor5-dev-utils": "43.0.1",
24-
"@ckeditor/ckeditor5-dev-webpack-plugin": "~31.1.13",
25-
"@ckeditor/ckeditor5-editor-balloon": "44.3.0",
26-
"@ckeditor/ckeditor5-editor-decoupled": "44.3.0",
27-
"@ckeditor/ckeditor5-essentials": "44.3.0",
28-
"@ckeditor/ckeditor5-font": "44.3.0",
29-
"@ckeditor/ckeditor5-heading": "44.3.0",
30-
"@ckeditor/ckeditor5-image": "44.3.0",
31-
"@ckeditor/ckeditor5-link": "44.3.0",
32-
"@ckeditor/ckeditor5-list": "44.3.0",
33-
"@ckeditor/ckeditor5-mention": "44.3.0",
34-
"@ckeditor/ckeditor5-paragraph": "44.3.0",
35-
"@ckeditor/ckeditor5-remove-format": "44.3.0",
36-
"@ckeditor/ckeditor5-theme-lark": "44.3.0",
37-
"@ckeditor/ckeditor5-ui": "44.3.0",
38-
"@ckeditor/ckeditor5-upload": "44.3.0",
3918
"@ckeditor/ckeditor5-vue2": "^3.0.1",
4019
"@iframe-resizer/child": "^5.4.6",
4120
"@iframe-resizer/parent": "^5.4.6",
@@ -58,6 +37,7 @@
5837
"@riophae/vue-treeselect": "^0.4.0",
5938
"@vue/babel-preset-app": "^5.0.8",
6039
"address-rfc2822": "^2.2.3",
40+
"ckeditor5": "^45.0.0",
6141
"color-convert": "^2.0.1",
6242
"core-js": "^3.41.0",
6343
"debounce-promise": "^3.1.2",

src/ckeditor/mail/MailPlugin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin.js'
7-
import { Paragraph } from '@ckeditor/ckeditor5-paragraph'
6+
import { Plugin, Paragraph } from 'ckeditor5'
87

98
export default class Mail extends Plugin {
109

src/ckeditor/quote/QuotePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-or-later
44
*/
55

6-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin.js'
6+
import { Plugin } from 'ckeditor5'
77

88
export default class Quote extends Plugin {
99

src/ckeditor/signature/InsertSignatureCommand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-only
44
*/
55

6-
import Command from '@ckeditor/ckeditor5-core/src/command.js'
6+
import { Command } from 'ckeditor5'
77

88
export const TRIGGER_CHANGE_ALIAS = 'change_alias'
99
export const TRIGGER_EDITOR_READY = 'editor_ready'

src/ckeditor/signature/SignaturePlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-only
44
*/
55

6-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin.js'
6+
import { Plugin } from 'ckeditor5'
77
import InsertSignatureCommand from './InsertSignatureCommand.js'
88

99
export default class Signature extends Plugin {

src/ckeditor/smartpicker/InsertItemCommand.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-only
44
*/
55

6-
import Command from '@ckeditor/ckeditor5-core/src/command.js'
6+
import { Command } from 'ckeditor5'
77
export default class InsertItemCommand extends Command {
88

99
/**

src/ckeditor/smartpicker/PickerPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* SPDX-License-Identifier: AGPL-3.0-only
44
*/
55

6-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin.js'
6+
import { Plugin } from 'ckeditor5'
77
import InsertItemCommand from './InsertItemCommand.js'
88
export default class PickerPlugin extends Plugin {
99

src/components/TextEditor.vue

Lines changed: 47 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
</template>
1919

2020
<script>
21-
import CKEditor from '@ckeditor/ckeditor5-vue2'
22-
import AlignmentPlugin from '@ckeditor/ckeditor5-alignment/src/alignment.js'
21+
/*
2322
import { Mention } from '@ckeditor/ckeditor5-mention'
23+
import AlignmentPlugin from '@ckeditor/ckeditor5-alignment/src/alignment.js'
2424
import Editor from '@ckeditor/ckeditor5-editor-decoupled/src/decouplededitor.js'
2525
import EssentialsPlugin from '@ckeditor/ckeditor5-essentials/src/essentials.js'
2626
import BlockQuotePlugin from '@ckeditor/ckeditor5-block-quote/src/blockquote.js'
@@ -33,14 +33,39 @@ import LinkPlugin from '@ckeditor/ckeditor5-link/src/link.js'
3333
import ListPlugin from '@ckeditor/ckeditor5-list/src/list.js'
3434
import ListProperties from '@ckeditor/ckeditor5-list/src/listproperties.js'
3535
import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat.js'
36-
import SignaturePlugin from '../ckeditor/signature/SignaturePlugin.js'
3736
import StrikethroughPlugin from '@ckeditor/ckeditor5-basic-styles/src/strikethrough.js'
38-
import QuotePlugin from '../ckeditor/quote/QuotePlugin.js'
3937
import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter.js'
4038
import ImagePlugin from '@ckeditor/ckeditor5-image/src/image.js'
4139
import ImageResizePlugin from '@ckeditor/ckeditor5-image/src/imageresize.js'
4240
import ImageUploadPlugin from '@ckeditor/ckeditor5-image/src/imageupload.js'
4341
import { DropdownView } from '@ckeditor/ckeditor5-ui'
42+
*/
43+
44+
import CKEditor from '@ckeditor/ckeditor5-vue2'
45+
import {
46+
Mention,
47+
Alignment,
48+
DecoupledEditor,
49+
Essentials,
50+
BlockQuote,
51+
Bold,
52+
Font,
53+
Paragraph,
54+
Heading,
55+
Italic,
56+
Link,
57+
List,
58+
LegacyListProperties,
59+
RemoveFormat,
60+
Strikethrough,
61+
Image,
62+
ImageResize,
63+
ImageUpload,
64+
DropdownView,
65+
Base64UploadAdapter,
66+
} from 'ckeditor5'
67+
import SignaturePlugin from '../ckeditor/signature/SignaturePlugin.js'
68+
import QuotePlugin from '../ckeditor/quote/QuotePlugin.js'
4469
import MailPlugin from '../ckeditor/mail/MailPlugin.js'
4570
import { searchProvider, getLinkWithPicker } from '@nextcloud/vue/components/NcRichText'
4671
import { getLanguage } from '@nextcloud/l10n'
@@ -49,6 +74,8 @@ import PickerPlugin from '../ckeditor/smartpicker/PickerPlugin.js'
4974
import { autoCompleteByName } from '../service/ContactIntegrationService.js'
5075
import { emojiSearch, emojiAddRecent } from '@nextcloud/vue'
5176

77+
import 'ckeditor5/ckeditor5.css'
78+
5279
export default {
5380
name: 'TextEditor',
5481
components: {
@@ -82,32 +109,32 @@ export default {
82109
},
83110
data() {
84111
const plugins = [
85-
EssentialsPlugin,
86-
ParagraphPlugin,
112+
Essentials,
113+
Paragraph,
87114
SignaturePlugin,
88115
QuotePlugin,
89116
PickerPlugin,
90117
Mention,
91-
LinkPlugin,
118+
Link,
92119
]
93120
const toolbar = ['undo', 'redo']
94121

95122
if (this.html) {
96123
plugins.push(...[
97-
HeadingPlugin,
98-
AlignmentPlugin,
99-
BoldPlugin,
100-
ItalicPlugin,
101-
BlockQuotePlugin,
102-
ListPlugin,
103-
ListProperties,
104-
FontPlugin,
124+
Heading,
125+
Alignment,
126+
Bold,
127+
Italic,
128+
BlockQuote,
129+
List,
130+
LegacyListProperties,
131+
Font,
105132
RemoveFormat,
106-
StrikethroughPlugin,
107-
ImagePlugin,
108-
ImageUploadPlugin,
133+
Strikethrough,
134+
Image,
135+
ImageUpload,
109136
Base64UploadAdapter,
110-
ImageResizePlugin,
137+
ImageResize,
111138
MailPlugin,
112139
])
113140
toolbar.unshift(...[
@@ -134,7 +161,7 @@ export default {
134161
emojiTribute: null,
135162
textSmiles: [],
136163
ready: false,
137-
editor: Editor,
164+
editor: DecoupledEditor,
138165
config: {
139166
licenseKey: 'GPL',
140167
placeholder: this.placeholder,

webpack.common.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
const path = require('path')
66
const webpack = require('webpack')
7-
const CKEditorWebpackPlugin = require('@ckeditor/ckeditor5-dev-webpack-plugin')
8-
const { styles } = require('@ckeditor/ckeditor5-dev-utils')
97
const { VueLoaderPlugin } = require('vue-loader')
108
const BabelLoaderExcludeNodeModulesExcept = require('babel-loader-exclude-node-modules-except')
119
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
@@ -14,19 +12,7 @@ const { IgnorePlugin } = require('webpack')
1412
const appName = 'mail'
1513
const appVersion = require('./package.json').version
1614

17-
function getPostCssConfig(ckEditorOpts) {
18-
// CKEditor is not compatbile with postcss@8 and postcss-loader@4 despite stating so.
19-
// Adapted from https://github.com/ckeditor/ckeditor5/issues/8112#issuecomment-960579351
20-
const { plugins, ...rest } = styles.getPostCssConfig(ckEditorOpts);
21-
return { postcssOptions: { plugins }, ...rest };
22-
};
23-
2415
const plugins = [
25-
// CKEditor needs its own plugin to be built using webpack.
26-
new CKEditorWebpackPlugin({
27-
// See https://ckeditor.com/docs/ckeditor5/latest/features/ui-language.html
28-
language: 'en',
29-
}),
3016
new VueLoaderPlugin(),
3117

3218
// Make sure we auto-inject node polyfills on demand
@@ -110,16 +96,6 @@ module.exports = {
11096
test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
11197
loader: 'raw-loader',
11298
},
113-
{
114-
test: /ckeditor5-[^/\\]+[/\\].+\.css$/,
115-
loader: 'postcss-loader',
116-
options: getPostCssConfig({
117-
themeImporter: {
118-
themePath: require.resolve('@ckeditor/ckeditor5-theme-lark'),
119-
},
120-
minify: true,
121-
}),
122-
},
12399
],
124100
},
125101
plugins,

0 commit comments

Comments
 (0)