scribe-editor
Advanced tools
Comparing version 1.4.2 to 1.4.4
@@ -5,3 +5,3 @@ { | ||
"lodash-amd": "3.5.0", | ||
"immutable" : "3.6.2" | ||
"immutable" : "3.7.3" | ||
}, | ||
@@ -8,0 +8,0 @@ "devDependencies": { |
@@ -0,1 +1,9 @@ | ||
# 1.4.4 | ||
Replaces some of the use of Lodash contains with Immutable data structures and `includes`. | ||
# 1.4.3 | ||
Changes the require alias so that the Immutable import path is simplified. | ||
# 1.4.2 | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "scribe-editor", | ||
"version": "1.4.2", | ||
"version": "1.4.4", | ||
"main": "src/scribe.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -20,3 +20,3 @@ /* | ||
'lodash-amd': '../bower_components/lodash-amd', | ||
'immutable': '../bower_components/immutable' | ||
'immutable': '../bower_components/immutable/dist/immutable' | ||
} | ||
@@ -23,0 +23,0 @@ }); |
@@ -1,12 +0,12 @@ | ||
define(['lodash-amd/modern/collection/contains'], function (contains) { | ||
define(['immutable'], function (Immutable) { | ||
'use strict'; | ||
var blockElementNames = ['ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'CANVAS', 'DD', | ||
var blockElementNames = Immutable.Set.of('ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'CANVAS', 'DD', | ||
'DIV', 'FIELDSET', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'FORM', 'H1', | ||
'H2', 'H3', 'H4', 'H5', 'H6', 'HEADER', 'HGROUP', 'HR', 'LI', | ||
'NOSCRIPT', 'OL', 'OUTPUT', 'P', 'PRE', 'SECTION', 'TABLE', 'TD', | ||
'TH', 'TFOOT', 'UL', 'VIDEO']; | ||
'TH', 'TFOOT', 'UL', 'VIDEO'); | ||
function isBlockElement(node) { | ||
return contains(blockElementNames, node.nodeName); | ||
return blockElementNames.includes(node.nodeName); | ||
} | ||
@@ -13,0 +13,0 @@ |
@@ -1,3 +0,2 @@ | ||
define(['lodash-amd/modern/array/pull', | ||
'immutable/dist/immutable'], function (pull, Immutable) { | ||
define(['immutable'], function (Immutable) { | ||
@@ -4,0 +3,0 @@ 'use strict'; |
define([ | ||
'lodash-amd/modern/collection/contains', | ||
'../../dom-observer', | ||
'../../api/children' | ||
], function ( | ||
contains, | ||
observeDomChanges, | ||
@@ -189,3 +187,3 @@ children | ||
if (contains(event.clipboardData.types, 'text/html')) { | ||
if (event.clipboardData.types.contains('text/html')) { | ||
@@ -192,0 +190,0 @@ scribe.insertHTML(event.clipboardData.getData('text/html')); |
define([ | ||
'immutable/dist/immutable' | ||
'immutable' | ||
], function (Immutable) { | ||
@@ -4,0 +4,0 @@ |
define([ | ||
'../../../../element', | ||
'lodash-amd/modern/collection/contains' | ||
'immutable' | ||
], function ( | ||
element, | ||
contains | ||
Immutable | ||
) { | ||
@@ -18,3 +18,3 @@ | ||
// http://www.w3.org/TR/html-markup/syntax.html#syntax-elements | ||
var html5VoidElements = ['AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR']; | ||
var html5VoidElements = Immutable.Set.of('AREA', 'BASE', 'BR', 'COL', 'COMMAND', 'EMBED', 'HR', 'IMG', 'INPUT', 'KEYGEN', 'LINK', 'META', 'PARAM', 'SOURCE', 'TRACK', 'WBR'); | ||
@@ -57,3 +57,3 @@ function parentHasNoTextContent(element, node) { | ||
node.textContent.trim() === '' && | ||
!contains(html5VoidElements, node.nodeName)) { | ||
!html5VoidElements.includes(node.nodeName)) { | ||
node.appendChild(document.createElement('br')); | ||
@@ -60,0 +60,0 @@ } else if (node.children.length > 0) { |
@@ -13,3 +13,3 @@ define([ | ||
'./node', | ||
'immutable/dist/immutable', | ||
'immutable', | ||
'./config' | ||
@@ -16,0 +16,0 @@ ], function ( |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
199560
4127