Socket
Socket
Sign inDemoInstall

@ckeditor/ckeditor5-typing

Package Overview
Dependencies
Maintainers
1
Versions
621
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ckeditor/ckeditor5-typing - npm Package Compare versions

Comparing version 31.1.0 to 32.0.0

4

LICENSE.md

@@ -5,3 +5,3 @@ Software License Agreement

**CKEditor 5 typing feature** – https://github.com/ckeditor/ckeditor5-typing <br>
Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved.

@@ -18,2 +18,2 @@ Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).

**CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
**CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
{
"name": "@ckeditor/ckeditor5-typing",
"version": "31.1.0",
"version": "32.0.0",
"description": "Typing feature for CKEditor 5.",

@@ -15,23 +15,23 @@ "keywords": [

"dependencies": {
"@ckeditor/ckeditor5-core": "^31.1.0",
"@ckeditor/ckeditor5-engine": "^31.1.0",
"@ckeditor/ckeditor5-utils": "^31.1.0",
"@ckeditor/ckeditor5-core": "^32.0.0",
"@ckeditor/ckeditor5-engine": "^32.0.0",
"@ckeditor/ckeditor5-utils": "^32.0.0",
"lodash-es": "^4.17.15"
},
"devDependencies": {
"@ckeditor/ckeditor5-basic-styles": "^31.1.0",
"@ckeditor/ckeditor5-block-quote": "^31.1.0",
"@ckeditor/ckeditor5-editor-classic": "^31.1.0",
"@ckeditor/ckeditor5-enter": "^31.1.0",
"@ckeditor/ckeditor5-essentials": "^31.1.0",
"@ckeditor/ckeditor5-heading": "^31.1.0",
"@ckeditor/ckeditor5-image": "^31.1.0",
"@ckeditor/ckeditor5-link": "^31.1.0",
"@ckeditor/ckeditor5-list": "^31.1.0",
"@ckeditor/ckeditor5-paragraph": "^31.1.0",
"@ckeditor/ckeditor5-undo": "^31.1.0",
"@ckeditor/ckeditor5-code-block": "^31.1.0"
"@ckeditor/ckeditor5-basic-styles": "^32.0.0",
"@ckeditor/ckeditor5-block-quote": "^32.0.0",
"@ckeditor/ckeditor5-editor-classic": "^32.0.0",
"@ckeditor/ckeditor5-enter": "^32.0.0",
"@ckeditor/ckeditor5-essentials": "^32.0.0",
"@ckeditor/ckeditor5-heading": "^32.0.0",
"@ckeditor/ckeditor5-image": "^32.0.0",
"@ckeditor/ckeditor5-link": "^32.0.0",
"@ckeditor/ckeditor5-list": "^32.0.0",
"@ckeditor/ckeditor5-paragraph": "^32.0.0",
"@ckeditor/ckeditor5-undo": "^32.0.0",
"@ckeditor/ckeditor5-code-block": "^32.0.0"
},
"engines": {
"node": ">=12.0.0",
"node": ">=14.0.0",
"npm": ">=5.7.1"

@@ -38,0 +38,0 @@ },

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -43,25 +43,2 @@ */

}
/**
* Checks batch if it is a result of user input - e.g. typing.
*
* const input = editor.plugins.get( 'Input' );
*
* editor.model.document.on( 'change:data', ( evt, batch ) => {
* if ( input.isInput( batch ) ) {
* console.log( 'The user typed something...' );
* }
* } );
*
* **Note:** This method checks if the batch was created using {@link module:typing/inputcommand~InputCommand 'input'}
* command as typing changes coming from user input are inserted to the document using that command.
*
* @param {module:engine/model/batch~Batch} batch A batch to check.
* @returns {Boolean}
*/
isInput( batch ) {
const inputCommand = this.editor.commands.get( 'input' );
return inputCommand._batches.has( batch );
}
}
/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -38,11 +38,2 @@ */

this._buffer = new ChangeBuffer( editor.model, undoStepSize );
/**
* Stores batches created by the input command. The batches are used to differentiate input batches from other batches using
* {@link module:typing/input~Input#isInput} method.
*
* @type {WeakSet<module:engine/model/batch~Batch>}
* @protected
*/
this._batches = new WeakSet();
}

@@ -93,5 +84,2 @@

// Store the batch as an 'input' batch for the Input.isInput( batch ) check.
this._batches.add( this._buffer.batch );
model.deleteContent( selection );

@@ -98,0 +86,0 @@

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -127,3 +127,2 @@ */

const model = editor.model;
const inputPlugin = editor.plugins.get( 'Input' );
const deletePlugin = editor.plugins.get( 'Delete' );

@@ -144,3 +143,3 @@ const normalizedTransformations = normalizeTransformations( editor.config.get( 'typing.transformations' ) );

const watcherCallback = ( evt, data ) => {
if ( !inputPlugin.isInput( data.batch ) ) {
if ( !data.batch.isTyping ) {
return;

@@ -254,4 +253,5 @@ }

return expandGroupsAndRemoveDuplicates( configured )
.filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group
.filter( isNotRemoved ) // Filter out 'remove' transformations as they might be set in group.
.map( transformation => TRANSFORMATIONS[ transformation ] || transformation )
.filter( transformation => typeof transformation === 'object' ) // Filter out transformations set as string that has not been found.
.map( transformation => ( {

@@ -258,0 +258,0 @@ from: normalizeFrom( transformation.from ),

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -120,3 +120,3 @@ */

this.listenTo( document, 'change:data', ( evt, batch ) => {
if ( batch.type == 'transparent' ) {
if ( batch.isUndo || !batch.isLocal ) {
return;

@@ -123,0 +123,0 @@ }

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -73,6 +73,6 @@ */

// The reason why the buffer needs to be flushed whenever a new batch appears is that the changes added afterwards
// should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
// should be added to a new batch. For instance, when the user types, then inserts an image, and then types again,
// the characters typed after inserting the image should be added to a different batch than the characters typed before.
this._changeCallback = ( evt, batch ) => {
if ( batch.type != 'transparent' && batch !== this._batch ) {
if ( batch.isLocal && batch.isUndoable && batch !== this._batch ) {
this._reset( true );

@@ -121,3 +121,3 @@ }

if ( !this._batch ) {
this._batch = this.model.createBatch();
this._batch = this.model.createBatch( { isTyping: true } );
}

@@ -124,0 +124,0 @@

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -124,3 +124,2 @@ */

const batch = buffer.batch;
inputCommand._batches.add( batch );

@@ -127,0 +126,0 @@ model.enqueueChange( batch, () => {

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

/**
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
* @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license

@@ -4,0 +4,0 @@ */

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc