8
0
Pārlūkot izejas kodu

Merge branch 'master' into i/7704

Paweł Kwaśnik 5 gadi atpakaļ
vecāks
revīzija
808066bf04

+ 1 - 1
CHANGELOG.md

@@ -18,7 +18,7 @@ Other than that, we focused on bug fixes and stability improvements. Some highli
 
 Please note that there are some **major breaking changes**. Be sure to review them before upgrading.
 
-<!-- TODO: Add a link to the blog post. -->
+Read more in the blog post: https://ckeditor.com/blog/CKEditor-5-v23.0.0-with-pagination-feature-list-styles-and-improved-image-upload/
 
 ### Collaboration features
 

+ 0 - 1
package.json

@@ -100,7 +100,6 @@
     "http-server": "^0.12.3",
     "husky": "^4.2.5",
     "lint-staged": "^10.2.6",
-    "marked": "^1.1.1",
     "mini-css-extract-plugin": "^0.9.0",
     "minimatch": "^3.0.4",
     "mkdirp": "^1.0.4",

+ 1 - 1
packages/ckeditor5-ckfinder/docs/features/ckfinder.md

@@ -37,7 +37,7 @@ This feature can be used in the rich-text editor in two different ways:
 
 ### Image upload only
 
-This demo shows the integration where the file manager's server connector handles [the image upload](#configuring-the-full-integration) only:
+This demo shows the integration where the file manager's server connector handles [the image upload](#configuring-the-image-upload-only) only:
 
 * Paste the image directly into the rich-text editor content and it will be automatically uploaded using the server-side connector.
 * Use the "Insert image" button in the toolbar to insert an image.

+ 2 - 15
packages/ckeditor5-engine/src/view/observer/fakeselectionobserver.js

@@ -9,7 +9,7 @@
 
 import Observer from './observer';
 import ViewSelection from '../selection';
-import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
+import { keyCodes, isArrowKeyCode } from '@ckeditor/ckeditor5-utils/src/keyboard';
 import { debounce } from 'lodash-es';
 
 /**
@@ -49,7 +49,7 @@ export default class FakeSelectionObserver extends Observer {
 		document.on( 'keydown', ( eventInfo, data ) => {
 			const selection = document.selection;
 
-			if ( selection.isFake && _isArrowKeyCode( data.keyCode ) && this.isEnabled ) {
+			if ( selection.isFake && isArrowKeyCode( data.keyCode ) && this.isEnabled ) {
 				// Prevents default key down handling - no selection change will occur.
 				data.preventDefault();
 
@@ -110,16 +110,3 @@ export default class FakeSelectionObserver extends Observer {
 		this._fireSelectionChangeDoneDebounced( data );
 	}
 }
-
-// Checks if one of the arrow keys is pressed.
-//
-// @private
-// @param {Number} keyCode
-// @returns {Boolean}
-function _isArrowKeyCode( keyCode ) {
-	return keyCode == keyCodes.arrowright ||
-		keyCode == keyCodes.arrowleft ||
-		keyCode == keyCodes.arrowup ||
-		keyCode == keyCodes.arrowdown;
-}
-

+ 1 - 1
packages/ckeditor5-ui/src/editableui/inline/inlineeditableuiview.js

@@ -47,7 +47,7 @@ export default class InlineEditableUIView extends EditableUIView {
 		editingView.change( writer => {
 			const viewRoot = editingView.document.getRoot( this.name );
 
-			writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', [ this.name ] ), viewRoot );
+			writer.setAttribute( 'aria-label', t( 'Rich Text Editor, %0', this.name ), viewRoot );
 		} );
 	}
 }

+ 5 - 5
packages/ckeditor5-utils/tests/locale.js

@@ -157,9 +157,9 @@ describe( 'Locale', () => {
 		it( 'should translate a message supporting plural forms', () => {
 			const t = locale.t;
 
-			expect( t( { string: 'bar', plural: '%0 bars' }, [ 1 ] ), 1 ).to.equal( 'bar_pl_0' );
-			expect( t( { string: 'bar', plural: '%0 bars' }, [ 2 ] ), 2 ).to.equal( '2 bar_pl_1' );
-			expect( t( { string: 'bar', plural: '%0 bars' }, [ 5 ] ), 3 ).to.equal( '5 bar_pl_2' );
+			expect( t( { string: 'bar', plural: '%0 bars' }, 1 ), 1 ).to.equal( 'bar_pl_0' );
+			expect( t( { string: 'bar', plural: '%0 bars' }, 2 ), 2 ).to.equal( '2 bar_pl_1' );
+			expect( t( { string: 'bar', plural: '%0 bars' }, 5 ), 3 ).to.equal( '5 bar_pl_2' );
 		} );
 
 		it( 'should translate a message supporting plural forms with a message id if it was passed', () => {
@@ -181,13 +181,13 @@ describe( 'Locale', () => {
 		it( 'should interpolate a message with provided values', () => {
 			const t = locale.t;
 
-			expect( t( '%0 - %0', [ 'foo' ] ) ).to.equal( 'foo - foo' );
+			expect( t( '%0 - %0', 'foo' ) ).to.equal( 'foo - foo' );
 			expect( t( '%1 - %0 - %2', [ 'a', 'b', 'c' ] ) ).to.equal( 'b - a - c' );
 
 			// Those test make sure that if %0 is really to be used, then it's going to work.
 			// It'd be a super rare case if one would need to use %0 and at the same time interpolate something.
 			expect( t( '%1 - %0 - %2' ) ).to.equal( '%1 - %0 - %2' );
-			expect( t( '%1 - %0 - %2', [ 'a' ] ) ).to.equal( '%1 - a - %2' );
+			expect( t( '%1 - %0 - %2', 'a' ) ).to.equal( '%1 - a - %2' );
 		} );
 
 		it( 'should interpolate a message with a provided value (shorthand version)', () => {

+ 2 - 2
packages/ckeditor5-word-count/src/wordcount.js

@@ -203,7 +203,7 @@ export default class WordCount extends Plugin {
 
 			if ( displayWords || displayWords === undefined ) {
 				this.bind( '_wordsLabel' ).to( this, 'words', words => {
-					return t( 'Words: %0', [ words ] );
+					return t( 'Words: %0', words );
 				} );
 
 				children.push( {
@@ -221,7 +221,7 @@ export default class WordCount extends Plugin {
 
 			if ( displayCharacters || displayCharacters === undefined ) {
 				this.bind( '_charactersLabel' ).to( this, 'characters', words => {
-					return t( 'Characters: %0', [ words ] );
+					return t( 'Characters: %0', words );
 				} );
 
 				children.push( {

+ 23 - 1
scripts/docs/snippetadapter.js

@@ -14,6 +14,7 @@ const CKEditorWebpackPlugin = require( '@ckeditor/ckeditor5-dev-webpack-plugin'
 const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
 const TerserPlugin = require( 'terser-webpack-plugin' );
 const ProgressBarPlugin = require( 'progress-bar-webpack-plugin' );
+const glob = require( 'glob' );
 
 const DEFAULT_LANGUAGE = 'en';
 const MULTI_LANGUAGE = 'multi-language';
@@ -393,7 +394,10 @@ function getWebpackConfig( snippets, config ) {
 		// Configure the paths so building CKEditor 5 snippets work even if the script
 		// is triggered from a directory outside ckeditor5 (e.g. multi-project case).
 		resolve: {
-			modules: getModuleResolvePaths()
+			modules: [
+				...getPackageDependenciesPaths(),
+				...getModuleResolvePaths()
+			]
 		},
 
 		resolveLoader: {
@@ -472,6 +476,24 @@ function getModuleResolvePaths() {
 }
 
 /**
+ * Returns an array that contains paths to packages' dependencies.
+ * The snippet adapter should use packages' dependencies instead of the documentation builder dependencies.
+ *
+ * See #7916.
+ *
+ * @returns {Array.<String>}
+ */
+function getPackageDependenciesPaths() {
+	const globOptions = {
+		cwd: path.resolve( __dirname, '..', '..' ),
+		absolute: true
+	};
+
+	return glob.sync( 'packages/*/node_modules', globOptions )
+		.concat( glob.sync( 'external/*/packages/*/node_modules', globOptions ) );
+}
+
+/**
  * Reads the snippet's configuration.
  *
  * @param {String} snippetSourcePath An absolute path to the file.