Socket
Socket
Sign inDemoInstall

@ckeditor/ckeditor5-typing

Package Overview
Dependencies
Maintainers
1
Versions
620
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 20.0.0 to 21.0.0

src/twostepcaretmovement.js

32

package.json
{
"name": "@ckeditor/ckeditor5-typing",
"version": "20.0.0",
"version": "21.0.0",
"description": "Typing feature for CKEditor 5.",

@@ -13,20 +13,20 @@ "keywords": [

"dependencies": {
"@ckeditor/ckeditor5-core": "^20.0.0",
"@ckeditor/ckeditor5-engine": "^20.0.0",
"@ckeditor/ckeditor5-utils": "^20.0.0",
"@ckeditor/ckeditor5-core": "^21.0.0",
"@ckeditor/ckeditor5-engine": "^21.0.0",
"@ckeditor/ckeditor5-utils": "^21.0.0",
"lodash-es": "^4.17.15"
},
"devDependencies": {
"@ckeditor/ckeditor5-basic-styles": "^20.0.0",
"@ckeditor/ckeditor5-block-quote": "^20.0.0",
"@ckeditor/ckeditor5-editor-classic": "^20.0.0",
"@ckeditor/ckeditor5-enter": "^20.0.0",
"@ckeditor/ckeditor5-essentials": "^20.0.0",
"@ckeditor/ckeditor5-heading": "^20.0.0",
"@ckeditor/ckeditor5-image": "^20.0.0",
"@ckeditor/ckeditor5-link": "^20.0.0",
"@ckeditor/ckeditor5-list": "^20.0.0",
"@ckeditor/ckeditor5-paragraph": "^20.0.0",
"@ckeditor/ckeditor5-undo": "^20.0.0",
"@ckeditor/ckeditor5-code-block": "^20.0.0"
"@ckeditor/ckeditor5-basic-styles": "^21.0.0",
"@ckeditor/ckeditor5-block-quote": "^21.0.0",
"@ckeditor/ckeditor5-editor-classic": "^21.0.0",
"@ckeditor/ckeditor5-enter": "^21.0.0",
"@ckeditor/ckeditor5-essentials": "^21.0.0",
"@ckeditor/ckeditor5-heading": "^21.0.0",
"@ckeditor/ckeditor5-image": "^21.0.0",
"@ckeditor/ckeditor5-link": "^21.0.0",
"@ckeditor/ckeditor5-list": "^21.0.0",
"@ckeditor/ckeditor5-paragraph": "^21.0.0",
"@ckeditor/ckeditor5-undo": "^21.0.0",
"@ckeditor/ckeditor5-code-block": "^21.0.0"
},

@@ -33,0 +33,0 @@ "engines": {

@@ -46,3 +46,3 @@ /**

* @private
* @member {typing.ChangeBuffer} #buffer
* @type {module:typing/utils/changebuffer~ChangeBuffer}
*/

@@ -49,0 +49,0 @@ this._buffer = new ChangeBuffer( editor.model, editor.config.get( 'typing.undoStep' ) );

@@ -50,3 +50,3 @@ /**

* editor.model.document.on( 'change:data', ( evt, batch ) => {
* if ( input.isTyping( batch ) ) {
* if ( input.isInput( batch ) ) {
* console.log( 'The user typed something...' );

@@ -53,0 +53,0 @@ * }

@@ -92,2 +92,5 @@ /**

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

@@ -108,7 +111,4 @@

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

@@ -106,3 +106,3 @@ /**

// Disable plugin when selection is inside a code block.
this.isEnabled = !modelSelection.anchor.parent.is( 'codeBlock' );
this.isEnabled = !modelSelection.anchor.parent.is( 'element', 'codeBlock' );
} );

@@ -109,0 +109,0 @@

@@ -41,3 +41,3 @@ /**

// Trim text to a last occurrence of an inline element and update range start.
if ( !( node.is( 'text' ) || node.is( 'textProxy' ) ) ) {
if ( !( node.is( '$text' ) || node.is( '$textProxy' ) ) ) {
start = model.createPositionAfter( node );

@@ -44,0 +44,0 @@

@@ -135,3 +135,6 @@ /**

if ( lastDomChild && lastDomChild.is( 'softBreak' ) && lastCurrentChild && !lastCurrentChild.is( 'softBreak' ) ) {
const isLastDomChildSoftBreak = lastDomChild && lastDomChild.is( 'element', 'softBreak' );
const isLastCurrentChildSoftBreak = lastCurrentChild && !lastCurrentChild.is( 'element', 'softBreak' );
if ( isLastDomChildSoftBreak && isLastCurrentChildSoftBreak ) {
modelFromDomChildren.pop();

@@ -151,4 +154,4 @@ }

// By inserting a character we keep all the real texts on their indexes.
const newText = modelFromDomChildren.map( item => item.is( 'text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
const oldText = currentModelChildren.map( item => item.is( 'text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
const newText = modelFromDomChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );
const oldText = currentModelChildren.map( item => item.is( '$text' ) ? item.data : '@' ).join( '' ).replace( /\u00A0/g, ' ' );

@@ -155,0 +158,0 @@ // Do nothing if mutations created same text.

@@ -113,3 +113,6 @@ /**

model.enqueueChange( buffer.batch, () => {
const batch = buffer.batch;
inputCommand._batches.add( batch );
model.enqueueChange( batch, () => {
model.deleteContent( model.document.selection );

@@ -116,0 +119,0 @@ } );

@@ -63,3 +63,3 @@ /**

// Which is text.
if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( 'text' ) ) ) {
if ( !( !!change.values[ 0 ] && change.values[ 0 ].is( '$text' ) ) ) {
return;

@@ -81,3 +81,3 @@ }

export function compareChildNodes( oldChild, newChild ) {
if ( !!oldChild && oldChild.is( 'text' ) && !!newChild && newChild.is( 'text' ) ) {
if ( !!oldChild && oldChild.is( '$text' ) && !!newChild && newChild.is( '$text' ) ) {
return oldChild.data === newChild.data;

@@ -84,0 +84,0 @@ } else {

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