@ckeditor/ckeditor5-code-block
Advanced tools
Comparing version 21.0.0 to 22.0.0
{ | ||
"name": "@ckeditor/ckeditor5-code-block", | ||
"version": "21.0.0", | ||
"version": "22.0.0", | ||
"description": "Code Block feature for CKEditor 5.", | ||
@@ -13,18 +13,19 @@ "keywords": [ | ||
"dependencies": { | ||
"@ckeditor/ckeditor5-core": "^21.0.0", | ||
"@ckeditor/ckeditor5-enter": "^21.0.0", | ||
"@ckeditor/ckeditor5-ui": "^21.0.0", | ||
"@ckeditor/ckeditor5-utils": "^21.0.0", | ||
"@ckeditor/ckeditor5-core": "^22.0.0", | ||
"@ckeditor/ckeditor5-enter": "^22.0.0", | ||
"@ckeditor/ckeditor5-ui": "^22.0.0", | ||
"@ckeditor/ckeditor5-utils": "^22.0.0", | ||
"lodash-es": "^4.17.15" | ||
}, | ||
"devDependencies": { | ||
"@ckeditor/ckeditor5-alignment": "^21.0.0", | ||
"@ckeditor/ckeditor5-autoformat": "^21.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-engine": "^21.0.0", | ||
"@ckeditor/ckeditor5-indent": "^21.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^21.0.0", | ||
"@ckeditor/ckeditor5-undo": "^21.0.0" | ||
"@ckeditor/ckeditor5-alignment": "^22.0.0", | ||
"@ckeditor/ckeditor5-autoformat": "^22.0.0", | ||
"@ckeditor/ckeditor5-basic-styles": "^22.0.0", | ||
"@ckeditor/ckeditor5-block-quote": "^22.0.0", | ||
"@ckeditor/ckeditor5-editor-classic": "^22.0.0", | ||
"@ckeditor/ckeditor5-engine": "^22.0.0", | ||
"@ckeditor/ckeditor5-indent": "^22.0.0", | ||
"@ckeditor/ckeditor5-markdown-gfm": "^22.0.0", | ||
"@ckeditor/ckeditor5-paragraph": "^22.0.0", | ||
"@ckeditor/ckeditor5-undo": "^22.0.0" | ||
}, | ||
@@ -31,0 +32,0 @@ "engines": { |
@@ -196,46 +196,12 @@ /** | ||
// Let's see if the codeBlock can be inserted the current modelCursor. | ||
const splitResult = conversionApi.splitToAllowedParent( codeBlock, data.modelCursor ); | ||
// When there is no split result it means that we can't insert element to model tree, | ||
// so let's skip it. | ||
if ( !splitResult ) { | ||
// Let's try to insert code block. | ||
if ( !conversionApi.safeInsert( codeBlock, data.modelCursor ) ) { | ||
return; | ||
} | ||
// Insert element on allowed position. | ||
writer.insert( codeBlock, splitResult.position ); | ||
consumable.consume( viewItem, { name: true } ); | ||
consumable.consume( viewChild, { name: true } ); | ||
const parts = conversionApi.getSplitParts( codeBlock ); | ||
// Set conversion result range. | ||
data.modelRange = writer.createRange( | ||
conversionApi.writer.createPositionBefore( codeBlock ), | ||
conversionApi.writer.createPositionAfter( parts[ parts.length - 1 ] ) | ||
); | ||
// If we had to split parent to insert our element then we want to continue conversion inside | ||
// the split parent. | ||
// | ||
// before split: | ||
// | ||
// <allowed><notAllowed>[]</notAllowed></allowed> | ||
// | ||
// after split: | ||
// | ||
// <allowed> | ||
// <notAllowed></notAllowed> | ||
// <converted></converted> | ||
// <notAllowed>[]</notAllowed> | ||
// </allowed> | ||
if ( splitResult.cursorParent ) { | ||
data.modelCursor = writer.createPositionAt( splitResult.cursorParent, 0 ); | ||
} else { | ||
// Otherwise just continue after the inserted element. | ||
data.modelCursor = data.modelRange.end; | ||
} | ||
conversionApi.updateConversionResult( codeBlock, data ); | ||
}; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92738
48
10
1393
+ Added@ckeditor/ckeditor5-core@22.0.0(transitive)
+ Added@ckeditor/ckeditor5-engine@22.0.0(transitive)
+ Added@ckeditor/ckeditor5-enter@22.0.0(transitive)
+ Added@ckeditor/ckeditor5-ui@22.0.0(transitive)
+ Added@ckeditor/ckeditor5-utils@22.0.0(transitive)
- Removed@ckeditor/ckeditor5-core@21.0.0(transitive)
- Removed@ckeditor/ckeditor5-engine@21.0.0(transitive)
- Removed@ckeditor/ckeditor5-enter@21.0.0(transitive)
- Removed@ckeditor/ckeditor5-ui@21.0.0(transitive)
- Removed@ckeditor/ckeditor5-utils@21.0.0(transitive)