slate-hyperscript
Advanced tools
Comparing version 0.5.16 to 0.5.17
@@ -279,2 +279,3 @@ (function (global, factory) { | ||
var nodes = createChildren(children, { key: attributes.key }); | ||
nodes[0].__decorations = (nodes[0].__decorations || []).concat([{ | ||
@@ -333,2 +334,3 @@ anchorOffset: 0, | ||
})); | ||
// store or combine partial decorations (keyed with anchor / focus) | ||
@@ -340,5 +342,7 @@ text.__decorations.filter(function (d) { | ||
decorations.push(partialDecorations[partial._key].combine(partial.withKey(text.key))); | ||
delete partialDecorations[partial._key]; | ||
return; | ||
} | ||
partialDecorations[partial._key] = partial.withKey(text.key); | ||
@@ -467,2 +471,3 @@ }); | ||
var isLast = index === children.length - 1; | ||
// If the child is a non-text node, push the current node and the new child | ||
@@ -474,4 +479,7 @@ // onto the array, then creating a new node for future selection tracking. | ||
} | ||
array.push(child); | ||
node = isLast ? null : slate.Text.create({ leaves: [{ text: '', marks: options.marks }] }); | ||
length = 0; | ||
@@ -510,2 +518,3 @@ } | ||
if (__focus != null) node.__focus = __focus + length; | ||
if (__decorations != null) { | ||
@@ -512,0 +521,0 @@ node.__decorations = (node.__decorations || []).concat(__decorations.map(function (d) { |
@@ -160,2 +160,3 @@ import isEmpty from 'is-empty'; | ||
var nodes = createChildren(children, { key: attributes.key }); | ||
nodes[0].__decorations = (nodes[0].__decorations || []).concat([{ | ||
@@ -214,2 +215,3 @@ anchorOffset: 0, | ||
})); | ||
// store or combine partial decorations (keyed with anchor / focus) | ||
@@ -221,5 +223,7 @@ text.__decorations.filter(function (d) { | ||
decorations.push(partialDecorations[partial._key].combine(partial.withKey(text.key))); | ||
delete partialDecorations[partial._key]; | ||
return; | ||
} | ||
partialDecorations[partial._key] = partial.withKey(text.key); | ||
@@ -348,2 +352,3 @@ }); | ||
var isLast = index === children.length - 1; | ||
// If the child is a non-text node, push the current node and the new child | ||
@@ -355,4 +360,7 @@ // onto the array, then creating a new node for future selection tracking. | ||
} | ||
array.push(child); | ||
node = isLast ? null : Text.create({ leaves: [{ text: '', marks: options.marks }] }); | ||
length = 0; | ||
@@ -391,2 +399,3 @@ } | ||
if (__focus != null) node.__focus = __focus + length; | ||
if (__decorations != null) { | ||
@@ -393,0 +402,0 @@ node.__decorations = (node.__decorations || []).concat(__decorations.map(function (d) { |
@@ -166,2 +166,3 @@ 'use strict'; | ||
var nodes = createChildren(children, { key: attributes.key }); | ||
nodes[0].__decorations = (nodes[0].__decorations || []).concat([{ | ||
@@ -220,2 +221,3 @@ anchorOffset: 0, | ||
})); | ||
// store or combine partial decorations (keyed with anchor / focus) | ||
@@ -227,5 +229,7 @@ text.__decorations.filter(function (d) { | ||
decorations.push(partialDecorations[partial._key].combine(partial.withKey(text.key))); | ||
delete partialDecorations[partial._key]; | ||
return; | ||
} | ||
partialDecorations[partial._key] = partial.withKey(text.key); | ||
@@ -354,2 +358,3 @@ }); | ||
var isLast = index === children.length - 1; | ||
// If the child is a non-text node, push the current node and the new child | ||
@@ -361,4 +366,7 @@ // onto the array, then creating a new node for future selection tracking. | ||
} | ||
array.push(child); | ||
node = isLast ? null : slate.Text.create({ leaves: [{ text: '', marks: options.marks }] }); | ||
length = 0; | ||
@@ -397,2 +405,3 @@ } | ||
if (__focus != null) node.__focus = __focus + length; | ||
if (__decorations != null) { | ||
@@ -399,0 +408,0 @@ node.__decorations = (node.__decorations || []).concat(__decorations.map(function (d) { |
{ | ||
"name": "slate-hyperscript", | ||
"description": "A hyperscript helper for creating Slate documents.", | ||
"version": "0.5.16", | ||
"version": "0.5.17", | ||
"license": "MIT", | ||
@@ -25,3 +25,3 @@ "repository": "git://github.com/ianstormtaylor/slate.git", | ||
"mocha": "^2.5.3", | ||
"slate": "^0.34.1" | ||
"slate": "^0.34.2" | ||
}, | ||
@@ -28,0 +28,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
105813