devextreme-quill
Advanced tools
Comparing version 1.6.3 to 1.6.4
@@ -12,2 +12,3 @@ import cloneDeep from 'lodash.clonedeep'; | ||
import removeClass from '../utils/remove_class'; | ||
import isDefined from '../utils/is_defined'; | ||
@@ -247,3 +248,5 @@ const ASCII = /^[ -~]*$/; | ||
if (!change || !isEqual(oldDelta.compose(change), this.delta)) { | ||
change = oldDelta.diff(this.delta, selectionInfo); | ||
if (!this.deltaContainsRetain(oldDelta)) { | ||
change = oldDelta.diff(this.delta, selectionInfo); | ||
} | ||
} | ||
@@ -253,2 +256,7 @@ } | ||
} | ||
// T1200561 | ||
deltaContainsRetain(delta) { | ||
return delta.ops.some((op) => isDefined(op.retain)); | ||
} | ||
} | ||
@@ -255,0 +263,0 @@ |
@@ -76,2 +76,3 @@ import Delta from 'quill-delta'; | ||
this.tableBlots = options.tableBlots ?? []; | ||
this.multilineParagraph = false; | ||
CLIPBOARD_CONFIG.concat(this.options.matchers).forEach( | ||
@@ -133,2 +134,3 @@ ([selector, matcher]) => { | ||
nodeMatches, | ||
this.multilineParagraph, | ||
); | ||
@@ -387,3 +389,3 @@ // Remove trailing newline | ||
function traverse(scroll, node, elementMatchers, textMatchers, nodeMatches) { | ||
function traverse(scroll, node, elementMatchers, textMatchers, nodeMatches, multilineParagraph) { | ||
// Post-order | ||
@@ -396,3 +398,3 @@ if (node.nodeType === node.TEXT_NODE) { | ||
if (node.nodeType === node.ELEMENT_NODE) { | ||
return Array.from(node.childNodes || []).reduce((delta, childNode) => { | ||
return Array.from(node.childNodes || []).reduce((delta, childNode, idx, allNodes) => { | ||
let childrenDelta = traverse( | ||
@@ -404,4 +406,11 @@ scroll, | ||
nodeMatches, | ||
multilineParagraph, | ||
); | ||
const nextNode = idx < allNodes.length - 1 && allNodes[idx + 1]; | ||
const isNextNodeList = nextNode | ||
&& nextNode.nodeType === node.ELEMENT_NODE | ||
&& ['ul', 'ol'].indexOf(nextNode.tagName.toLowerCase()) > -1; | ||
if (childNode.nodeType === node.ELEMENT_NODE) { | ||
multilineParagraph = childNode.tagName.toLowerCase() === 'br'; | ||
childrenDelta = elementMatchers.reduce((reducedDelta, matcher) => { | ||
@@ -417,3 +426,10 @@ return matcher(childNode, reducedDelta, scroll); | ||
} | ||
return delta.concat(childrenDelta); | ||
const newDelta = delta.concat(childrenDelta); | ||
if (multilineParagraph && isNextNodeList) { | ||
newDelta.insert('\n'); | ||
} | ||
return newDelta; | ||
}, new Delta()); | ||
@@ -420,0 +436,0 @@ } |
@@ -7,3 +7,3 @@ import Delta from 'quill-delta'; | ||
function breakMatcher(node) { | ||
if (!node.nextSibling && !node.previousSibling) { | ||
if (!(node.nextSibling || node.previousSibling)) { | ||
return new Delta().insert('\n'); | ||
@@ -10,0 +10,0 @@ } |
{ | ||
"name": "devextreme-quill", | ||
"version": "1.6.3", | ||
"version": "1.6.4", | ||
"description": "Core of the DevExtreme HtmlEditor", | ||
@@ -31,3 +31,3 @@ "author": "Developer Express Inc.", | ||
"dependencies": { | ||
"core-js": "^3.33.3", | ||
"core-js": "^3.34.0", | ||
"eventemitter3": "^4.0.7", | ||
@@ -34,0 +34,0 @@ "lodash.clonedeep": "^4.5.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
2062989
41664
Updatedcore-js@^3.34.0