Skip to content

Commit

Permalink
Merge branch 'master' into ck/14734-enable-block-drag-and-drop-by-def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
niegowski committed Sep 26, 2023
2 parents 96e76c7 + 332d36a commit a089144
Show file tree
Hide file tree
Showing 158 changed files with 22,165 additions and 888 deletions.
36 changes: 36 additions & 0 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,31 @@ jobs:
name: Upload the coverage to Coveralls
command: npx coveralls -v < .out/combined_lcov.info

cke5_trigger_release_process:
machine: true
steps:
- community_verification_command
- checkout_command
- bootstrap_repository_command
- run:
name: Verify if CKEditor 5 is ready to release
command: |
#!/bin/bash
# Do not fail if the Node script ends with non-zero exit code.
set +e
node scripts/ci/is-ckeditor5-ready-to-release.js
EXIT_CODE=$( echo $? )
if [ ${EXIT_CODE} -eq 1 ];
then
circleci-agent step halt
fi
- run:
name: Trigger the Uber CI
command: node scripts/ci/trigger-ckeditor5-continuous-integration.js -r ckeditor/ckeditor5 -c $CIRCLE_SHA1 -b $CIRCLE_BRANCH

cke5_trigger_uber_ci:
machine: true
steps:
Expand Down Expand Up @@ -234,6 +259,17 @@ workflows:
branches:
only:
- master
- cke5_trigger_release_process:
requires:
- cke5_tests_framework
- cke5_tests_features
- cke5_validators
- cke5_manual
- release_prepare
filters:
branches:
only:
- release
- notify_ci_failure:
filters:
branches:
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ jobs:
repo-token: ${{ secrets.GH_BOT_TOKEN }}
stale-issue-label: status:stale
close-issue-label: resolution:expired
stale-issue-message: "There has been no activity on this issue for the past two years. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue."
stale-pr-message: "There has been no activity on this PR for the past two years. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the contribution, leave a comment or reaction under this PR."
close-issue-message: "We've closed your issue due to inactivity over the last two years. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it)."
close-pr-message: "We've closed your PR due to inactivity over the last two years. While time has passed, the core of your contribution might still be relevant. If you're able, consider reopening a similar PR."
days-before-stale: 730
stale-pr-label: status:stale
close-pr-label: resolution:expired
stale-issue-message: "There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue."
stale-pr-message: "There has been no activity on this PR for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the contribution, leave a comment or reaction under this PR."
close-issue-message: "We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it)."
close-pr-message: "We've closed your PR due to inactivity over the last year. While time has passed, the core of your contribution might still be relevant. If you're able, consider reopening a similar PR."
days-before-stale: 365
days-before-close: 30
exempt-issue-labels: support:1,support:2,support:3,domain:accessibility
exempt-pr-labels: support:1,support:2,support:3,domain:accessibility
ignore-reactions: false
operations-per-run: 300
operations-per-run: 1000
ascending: true
2 changes: 1 addition & 1 deletion docs/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Additionally, CKEditor&nbsp;5 offers the {@link features/restricted-editing rest

{@img assets/img/features-collaboration.png 800 CKEditor&nbsp;5 collaboration features.}

You can also easily track the progress and changes done in the content with the {@link features/revision-history revision history feature} {@icon @ckeditor/ckeditor5-revision-history/theme/icons/revision-history.svg Revision history}. This modern and robust document versioning tool lets you create named versions, compare changes, and restore previous document versions at ease, tracking all progress &mdash; also when multiple editors work together.
You can also easily track the progress and changes done in the content with the {@link features/revision-history revision history feature} {@icon @ckeditor/ckeditor5-core/theme/icons/history.svg Revision history}. This modern and robust document versioning tool lets you create named versions, compare changes, and restore previous document versions at ease, tracking all progress &mdash; also when multiple editors work together.

{@img assets/img/features-revision-history.png 800 CKEditor&nbsp;5 document versioning feature.}

Expand Down
4 changes: 2 additions & 2 deletions docs/installation/advanced/content-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ order: 30

# Content styles

Some of the {@link features/index core editor features} bring additional CSS to control the look of the content they produce. Take, for example, the {@link features/images-overview image feature} that needs special content styles to render images and their captions in the content. Or the {@link module:block-quote/blockquote~BlockQuote block quote} feature that displays quotes in italic with a subtle border on the side.
Some of the {@link features/index core editor features} bring additional CSS to control the look of the content they produce. Take, for example, the {@link features/images-overview image feature} that needs special content styles to render images and their captions in the content. Or the {@link module:block-quote/blockquote~BlockQuote block quote} feature that displays quotes in italics with a subtle border on the side.

{@img assets/img/builds-content-styles.png 823 Editor content styles.}

Expand Down Expand Up @@ -45,7 +45,7 @@ The content in the front–end of your application should now look the same as w

## The full list of content styles

Below there is a full list of content styles used by the editor features. You can copy it and use straight in your project. **Make sure to add the `ck-content` class to your content container for the styles to work** ([see above](#sharing-content-styles-between-frontend-and-backend)).
Below there is a full list of content styles used by the editor features. You can copy it and use it straight in your project. **Make sure to add the `ck-content` class to your content container for the styles to work** ([see above](#sharing-content-styles-between-frontend-and-backend)).

```css
{@exec ../scripts/docs/read-content-styles-file.js}
Expand Down
12 changes: 4 additions & 8 deletions docs/tutorials/crash-course/plugin-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,15 @@ modified_at: 2023-08-16

## Configuration convention

As we learned at the beginning of this tutorial, the editor accepts a configuration object that allows you to change its default behavior and appearance.
As we learned at the beginning of this tutorial, the editor accepts a configuration object that allows you to change its default behavior and appearance. The convention used in CKEditor 5 is to have a unique object key for each plugin to avoid conflicts and to make it obvious what each part of the configuration does.

For the purpose of this tutorial, we will add a single option to configure the keyboard shortcut for highlighting the selected text.

The convention used in CKEditor is to have a unique object key for each plugin, to avoid conflicts and make it obvious what each part of the configuration does.

Following this convention, we will add an optional `highlight` key to the configuration, which can contain a `keystroke` option:
In this tutorial, we will add a single option to the `highlight` plugin to configure its keyboard shortcut. This configuration will be included in an optional `highlight` key:

```js
const editor = await ClassicEditor.create( element, {
// Other options are omitted for readability - do not remove them.
highlight: {
keystroke: '...'

}
} );
```
Expand All @@ -39,7 +35,7 @@ editor.config.define( 'highlight', {
} );
```

The first parameter passed to the method is the name of the configuration object key, and the second is the defaults.
The first parameter passed to the method is the name of the configuration object key, and the second is the default values.

### Loading configuration option

Expand Down
1 change: 0 additions & 1 deletion docs/updating/update-to-39.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ category: update-guides
meta-title: Update to version 39.x | CKEditor 5 Documentation
menu-title: Update to v39.x
order: 85
modified_at: 2023-07-31
---

# Update to CKEditor&nbsp;5 v39.x
Expand Down
56 changes: 56 additions & 0 deletions docs/updating/update-to-40.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
category: update-guides
meta-title: Update to version 40.x | CKEditor 5 Documentation
menu-title: Update to v40.x
order: 84
modified_at: 2023-09-26
---

# Update to CKEditor&nbsp;5 v40.x

<info-box>
When updating your CKEditor&nbsp;5 installation, make sure **all the packages are the same version** to avoid errors.

For custom builds, you may try removing the `package-lock.json` or `yarn.lock` files (if applicable) and reinstalling all packages before rebuilding the editor. For best results, make sure you use the most recent package versions.
</info-box>

## Update to CKEditor&nbsp;5 v40.0.0

For the entire list of changes introduced in version 40.0.0, see the [release notes for CKEditor&nbsp;5 v40.0.0](https://github.com/ckeditor/ckeditor5/releases/tag/v40.0.0).

Listed below are the most important changes that require your attention when upgrading to CKEditor&nbsp;5 v40.0.0.

### Changes to the image feature

This release introduces changes connected with the image `width` and `height` attributes. These are now preserved while loading editor content. Images without their size specified will automatically gain natural image size on any interaction with the image within the editor. Due to this new behavior, the `width` and `height` attributes are now used to preserve the image's natural width and height and the model attribute name of a resized image is now changed to `resizedWidth`.

The `srcset` model attribute which provides parameters for responsive images, has been simplified. It is no longer an object `{ data: "...", width: "..." }`, but the value that was previously stored in the `data` part.

Last but not least, content styles have been updated with this release, which means you need to update them in your editor implementation to avoid any discrepancies. Please refer to the {@link installation/advanced/content-styles Content styles} guide to learn how to generate the stylesheet.

### New Balloon Block editor icon

We have changed the default {@link features/blocktoolbar Balloon Block editor toolbar} indicator icon from the pilcrow icon (``) to the braille pattern dots icon (``). The new icon better corresponds to the dual function of the indicator, which may be used to both invoke the balloon toolbar and to drag to content block around.

While `` is now a default, the icon can still be configured by the integrator, for example:
<!-- add this to balloon toolbar config guide-->
```js
blockToolbar: {
items: [
'bold',
'italic',
'link'
],
icon: 'pilcrow' // or SVG.
},
```

### A new default lists plugin coming

We currently maintain two list features: {@link features/lists List} and {@link features/document-lists DocumentList}. The list v1 feature was implemented in the early days of CKEditor 5. It supports “plain lists” &ndash; lists where `<li>` cannot contain block content (paragraphs, headings, tables, block images). It supports to-do lists, but it does not support extending list markup via the {@link features/general-html-support General HTML Support (GHS)} feature.

The list v2 (document list) feature was implemented in 2022 to add support for block content in list items. It supported extending list markup via GHS. It did not, however, support to-do lists. Since then we concentrated on bringing full list v1 functionality to this plugin. We are nearing the end of a long job of pairing these two plugins in their functions. You can follow the current state of works in the [Document list feature parity](https://github.com/ckeditor/ckeditor5/issues/14632) issue.

Considering this progress, the old lists feature will be replaced with the new document lists in one of the upcoming releases and it will be sunset at the beginning of 2024. The change will be seamless for the users, but there are significant changes between these plugins. We will update the information about this process as it unfolds.

See the [#14767](https://github.com/ckeditor/ckeditor5/issues/14767) issue for more details.
2 changes: 1 addition & 1 deletion packages/ckeditor5-ckbox/docs/features/ckbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ As a full-fledged file manager, CKBox also replaces the basic CKEditor&nbsp;5 im

With CKBox you no longer need to write server-side code to upload and scale images or manage uploaded files.

To find out more about CKBox, the brand-new file manager, visit the [CKBox website](https://ckeditor.com/ckbox/) and read the dedicated [CKBox documentation page](https://ckeditor.com/docs/ckbox/latest/guides/index.html).
To find out more about CKBox, the brand-new file manager and image editor, visit the [CKBox website](https://ckeditor.com/ckbox/) and read the dedicated [CKBox documentation page](https://ckeditor.com/docs/ckbox/latest/guides/index.html).

## Demo

Expand Down
3 changes: 2 additions & 1 deletion packages/ckeditor5-code-block/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
"@ckeditor/ckeditor5-clipboard": "39.0.2",
"@ckeditor/ckeditor5-core": "39.0.2",
"@ckeditor/ckeditor5-dev-utils": "^39.0.0",
"@ckeditor/ckeditor5-editor-classic": "39.0.2",
"@ckeditor/ckeditor5-engine": "39.0.2",
"@ckeditor/ckeditor5-enter": "39.0.2",
"@ckeditor/ckeditor5-editor-classic": "39.0.2",
"@ckeditor/ckeditor5-html-support": "39.0.2",
"@ckeditor/ckeditor5-image": "39.0.2",
"@ckeditor/ckeditor5-indent": "39.0.2",
"@ckeditor/ckeditor5-list": "39.0.2",
Expand Down
14 changes: 8 additions & 6 deletions packages/ckeditor5-code-block/src/codeblockediting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
type Element
} from 'ckeditor5/src/engine';

import type { DocumentListEditing } from '@ckeditor/ckeditor5-list';

import CodeBlockCommand from './codeblockcommand';
import IndentCodeBlockCommand from './indentcodeblockcommand';
import OutdentCodeBlockCommand from './outdentcodeblockcommand';
Expand Down Expand Up @@ -97,7 +99,8 @@ export default class CodeBlockEditing extends Plugin {
const schema = editor.model.schema;
const model = editor.model;
const view = editor.editing.view;
const isDocumentListEditingLoaded = editor.plugins.has( 'DocumentListEditing' );
const documentListEditing: DocumentListEditing | null = editor.plugins.has( 'DocumentListEditing' ) ?
editor.plugins.get( 'DocumentListEditing' ) : null;

const normalizedLanguagesDefs = getNormalizedAndLocalizedLanguageDefinitions( editor );

Expand Down Expand Up @@ -133,11 +136,10 @@ export default class CodeBlockEditing extends Plugin {
// Allow all list* attributes on `codeBlock` (integration with DocumentList).
// Disallow all attributes on $text inside `codeBlock`.
schema.addAttributeCheck( ( context, attributeName ) => {
const isDocumentListAttributeOnCodeBlock = context.endsWith( 'codeBlock' ) &&
attributeName.startsWith( 'list' ) &&
attributeName !== 'list';

if ( isDocumentListEditingLoaded && isDocumentListAttributeOnCodeBlock ) {
if (
context.endsWith( 'codeBlock' ) &&
documentListEditing && documentListEditing.getListAttributeNames().includes( attributeName )
) {
return true;
}

Expand Down
23 changes: 18 additions & 5 deletions packages/ckeditor5-code-block/tests/codeblock-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import GFMDataProcessor from '@ckeditor/ckeditor5-markdown-gfm/src/gfmdataproces
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import ImageInlineEditing from '@ckeditor/ckeditor5-image/src/image/imageinlineediting';
import DocumentListEditing from '@ckeditor/ckeditor5-list/src/documentlist/documentlistediting';
import DocumentListPropertiesEditing from '@ckeditor/ckeditor5-list/src/documentlistproperties/documentlistpropertiesediting';
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport';
import { setData, getData } from '@ckeditor/ckeditor5-engine/src/dev-utils/model';

import CodeBlockUI from '../src/codeblockui';
Expand Down Expand Up @@ -178,7 +180,14 @@ describe( 'CodeBlock - integration', () => {
beforeEach( async () => {
editor = await ClassicTestEditor
.create( '', {
plugins: [ CodeBlockEditing, DocumentListEditing, Enter, Paragraph ]
plugins: [
CodeBlockEditing, DocumentListEditing, DocumentListPropertiesEditing, Enter, Paragraph, GeneralHtmlSupport
],
htmlSupport: {
allow: [
{ name: /./, attributes: true, styles: true, classes: true }
]
}
} );

model = editor.model;
Expand All @@ -188,22 +197,26 @@ describe( 'CodeBlock - integration', () => {
await editor.destroy();
} );

it( 'should allow all attributes starting with list* in the schema', () => {
it( 'should allow all list attributes in the schema', () => {
setData( model, '<codeBlock language="plaintext">[]foo</codeBlock>' );

const codeBlock = model.document.getRoot().getChild( 0 );

expect( model.schema.checkAttribute( codeBlock, 'listItemId' ), 'listItemId' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'listType' ), 'listType' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'listStart' ), 'listStart' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'listFoo' ), 'listFoo' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'listStyle' ), 'listStyle' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'htmlLiAttributes' ), 'htmlLiAttributes' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'htmlUlAttributes' ), 'htmlUlAttributes' ).to.be.true;
expect( model.schema.checkAttribute( codeBlock, 'htmlOlAttributes' ), 'htmlOlAttributes' ).to.be.true;
} );

it( 'should disallow attributes that do not start with "list" in the schema but include the sequence', () => {
it( 'should disallow attributes that are not registered as list attributes', () => {
setData( model, '<codeBlock language="plaintext">[]foo</codeBlock>' );

const codeBlock = model.document.getRoot().getChild( 0 );

expect( model.schema.checkAttribute( codeBlock, 'listReversed' ), 'listReversed' ).to.be.false;
expect( model.schema.checkAttribute( codeBlock, 'listStart' ), 'listStart' ).to.be.false;
expect( model.schema.checkAttribute( codeBlock, 'list' ), 'list' ).to.be.false;
expect( model.schema.checkAttribute( codeBlock, 'fooList' ), 'fooList' ).to.be.false;
expect( model.schema.checkAttribute( codeBlock, 'alist' ), 'alist' ).to.be.false;
Expand Down
4 changes: 4 additions & 0 deletions packages/ckeditor5-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ import caption from './../theme/icons/caption.svg';
import check from './../theme/icons/check.svg';
import cog from './../theme/icons/cog.svg';
import eraser from './../theme/icons/eraser.svg';
import history from './../theme/icons/history.svg';
import lowVision from './../theme/icons/low-vision.svg';
import loupe from './../theme/icons/loupe.svg';
import image from './../theme/icons/image.svg';

import alignBottom from './../theme/icons/align-bottom.svg';
Expand Down Expand Up @@ -81,8 +83,10 @@ export const icons = {
check,
cog,
eraser,
history,
image,
lowVision,
loupe,
importExport,
paragraph,
plus,
Expand Down
1 change: 1 addition & 0 deletions packages/ckeditor5-core/theme/icons/history.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/ckeditor5-core/theme/icons/loupe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a089144

Please sign in to comment.