Skip to content

Commit c20af5d

Browse files
authored
IBX-9916: Upgrade frontend dependencies (#229)
1 parent 6d04149 commit c20af5d

File tree

73 files changed

+190
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+190
-212
lines changed

src/bundle/Resources/encore/ibexa.webpack.custom.config.js

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const Encore = require('@symfony/webpack-encore');
22
const path = require('path');
3-
const { styles } = require(path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor/ckeditor5-dev-utils'));
43
const ibexaConfigManager = require(path.resolve('./ibexa.webpack.config.manager.js'));
54
const configManagers = require(path.resolve('./var/encore/ibexa.richtext.config.manager.js'));
65

@@ -9,11 +8,15 @@ Encore.setOutputPath('public/assets/richtext/build').setPublicPath('/assets/rich
98

109
Encore.addEntry('ibexa-richtext-onlineeditor-js', [path.resolve(__dirname, '../public/js/CKEditor/core/base-ckeditor.js')]).addStyleEntry(
1110
'ibexa-richtext-onlineeditor-css',
12-
[path.resolve(__dirname, '../public/scss/ckeditor.scss')],
11+
[
12+
path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5/dist/ckeditor5.css'),
13+
path.resolve(__dirname, '../public/scss/ckeditor.scss'),
14+
],
1315
);
1416

1517
Encore.addAliases({
1618
'@ckeditor': path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor'),
19+
ckeditor5: path.resolve('./public/bundles/ibexaadminuiassets/vendors/ckeditor5'),
1720
'@fieldtype-richtext': path.resolve('./vendor/ibexa/fieldtype-richtext'),
1821
'@ibexa-admin-ui': path.resolve('./vendor/ibexa/admin-ui'),
1922
});
@@ -25,43 +28,6 @@ customConfig.name = 'richtext';
2528
customConfig.module.rules[4].oneOf[1].use[1].options.url = false;
2629
customConfig.module.rules[1].oneOf[1].use[1].options.url = false;
2730

28-
customConfig.module.rules.push({
29-
test: /ckeditor5-[^/\\]+[/\\]theme[/\\]icons[/\\][^/\\]+\.svg$/,
30-
use: ['raw-loader'],
31-
});
32-
33-
customConfig.module.rules.push({
34-
test: /ckeditor5-[^/\\]+[/\\]theme[/\\].+\.css$/,
35-
use: [
36-
{
37-
loader: 'style-loader',
38-
options: {
39-
injectType: 'singletonStyleTag',
40-
attributes: {
41-
'data-cke': true,
42-
},
43-
},
44-
},
45-
'css-loader',
46-
{
47-
loader: 'postcss-loader',
48-
options: {
49-
postcssOptions: styles.getPostCssConfig({
50-
themeImporter: {
51-
themePath: require.resolve(
52-
path.resolve('./public/bundles/ibexaadminuiassets/vendors/@ckeditor/ckeditor5-theme-lark'),
53-
),
54-
},
55-
minify: true,
56-
}),
57-
},
58-
},
59-
],
60-
});
61-
62-
customConfig.module.rules[1] = {};
63-
customConfig.module.rules[2] = {};
64-
6531
configManagers.forEach((configManagerPath) => {
6632
const configManager = require(path.resolve(configManagerPath));
6733

src/bundle/Resources/public/js/CKEditor/anchor/anchor-editing.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2-
import Widget from '@ckeditor/ckeditor5-widget/src/widget';
1+
import { Plugin, Widget } from 'ckeditor5';
32

43
class IbexaAnchorEditing extends Plugin {
54
static get requires() {
@@ -70,13 +69,21 @@ class IbexaAnchorEditing extends Plugin {
7069
});
7170

7271
this.editor.conversion.for('upcast').add((dispatcher) => {
73-
dispatcher.on('element:li', (event, data, conversionApi) => {
74-
const listParent = data.viewItem.parent;
75-
const listItem = data.modelRange.start.nodeAfter ?? data.modelRange.end.nodeBefore;
72+
const anchorUpcastConverter = (event, data, conversionApi) => {
73+
if (!data.modelRange) {
74+
Object.assign(data, conversionApi.convertChildren(data.viewItem, data.modelCursor));
75+
}
76+
77+
const listParent = data.viewItem;
7678
const id = listParent.getAttribute('id');
7779

78-
conversionApi.writer.setAttribute('anchor', id, listItem);
79-
});
80+
for (const listItem of data.modelRange.getItems({ shallow: true })) {
81+
conversionApi.writer.setAttribute('anchor', id, listItem);
82+
}
83+
};
84+
85+
dispatcher.on('element:ul', anchorUpcastConverter);
86+
dispatcher.on('element:ol', anchorUpcastConverter);
8087
});
8188
}
8289

src/bundle/Resources/public/js/CKEditor/anchor/anchor-ui.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2-
import clickOutsideHandler from '@ckeditor/ckeditor5-ui/src/bindings/clickoutsidehandler';
1+
import { Plugin, clickOutsideHandler } from 'ckeditor5';
32

43
import IbexaAnchorFormView from './ui/anchor-form-view';
54
import IbexaButtonView from '../common/button-view/button-view';

src/bundle/Resources/public/js/CKEditor/anchor/anchor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
1+
import { Plugin } from 'ckeditor5';
22

33
import IbexaAnchorUI from './anchor-ui';
44
import IbexaAnchorEditing from './anchor-editing';

src/bundle/Resources/public/js/CKEditor/anchor/ui/anchor-form-view.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import View from '@ckeditor/ckeditor5-ui/src/view';
2-
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
3-
import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview';
4-
import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils';
1+
import { View, ButtonView, LabeledFieldView, createLabeledInputText } from 'ckeditor5';
52

63
class IbexaLinkFormView extends View {
74
constructor(props) {

src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-command.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Command from '@ckeditor/ckeditor5-core/src/command';
1+
import { Command } from 'ckeditor5';
22

33
class IbexaBlockAlignmentCommand extends Command {
44
refresh() {

src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-editing.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2-
import Widget from '@ckeditor/ckeditor5-widget/src/widget';
1+
import { Plugin, Widget } from 'ckeditor5';
32

43
import IbexaBlockAlignmentCommand from './block-alignment-command';
54

src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment-ui.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
2-
import ClickObserver from '@ckeditor/ckeditor5-engine/src/view/observer/clickobserver';
1+
import { Plugin, ClickObserver } from 'ckeditor5';
32

43
import IbexaButtonView from '../common/button-view/button-view';
54

src/bundle/Resources/public/js/CKEditor/block-alignment/block-alignment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
1+
import { Plugin } from 'ckeditor5';
22

33
import IbexaBlockAlignmentUI from './block-alignment-ui';
44
import IbexaBlockAlignmentEditing from './block-alignment-editing';
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ButtonView from '@ckeditor/ckeditor5-ui/src/button/buttonview';
1+
import { ButtonView } from 'ckeditor5';
22

33
import IbexaIconView from '../icon-view/icon-view';
44

@@ -7,5 +7,7 @@ export default class IbexaButtonView extends ButtonView {
77
super(locale);
88

99
this.iconView = new IbexaIconView();
10+
11+
this.iconView.bind('content').to(this, 'icon');
1012
}
1113
}

0 commit comments

Comments
 (0)