├── .babelrc ├── .gitignore ├── .npmignore ├── dist ├── base.js ├── color.js ├── content.js └── index.js ├── package.json ├── src ├── base.js ├── color.js ├── content.js └── index.js ├── tea.yaml └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"] 3 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | static 2 | 3 | node_modules 4 | # Numerous always-ignore extensions 5 | *.diff 6 | *.err 7 | *.orig 8 | *.log* 9 | *.rej 10 | *.swo 11 | *.swp 12 | *.zip 13 | *.vi 14 | *~ 15 | *.sass-cache 16 | /example/server/temp/* 17 | lib 18 | 19 | # OS or Editor folders 20 | .DS_Store 21 | ._* 22 | Thumbs.db 23 | .cache 24 | .project 25 | .settings 26 | .tmproj 27 | *.esproj 28 | nbproject 29 | *.sublime-project 30 | *.sublime-workspace 31 | 32 | # Files 33 | 34 | # Komodo 35 | *.komodoproject 36 | .komodotools 37 | 38 | # Folders to ignore 39 | .hg 40 | .svn 41 | .CVS 42 | .idea 43 | git-m -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | static 2 | 3 | node_modules 4 | # Numerous always-ignore extensions 5 | *.diff 6 | *.err 7 | *.orig 8 | *.log* 9 | *.rej 10 | *.swo 11 | *.swp 12 | *.zip 13 | *.vi 14 | *~ 15 | *.sass-cache 16 | dist/sample 17 | sample 18 | example 19 | src 20 | 21 | # OS or Editor folders 22 | .DS_Store 23 | ._* 24 | Thumbs.db 25 | .cache 26 | .project 27 | .settings 28 | .tmproj 29 | *.esproj 30 | nbproject 31 | *.sublime-project 32 | *.sublime-workspace 33 | 34 | # Files 35 | 36 | # Komodo 37 | *.komodoproject 38 | .komodotools 39 | 40 | # Folders to ignore 41 | .hg 42 | .svn 43 | .CVS 44 | .idea 45 | git-m -------------------------------------------------------------------------------- /dist/base.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | var braftUniqueIndex = 0; 7 | 8 | var UniqueIndex = exports.UniqueIndex = function UniqueIndex() { 9 | return braftUniqueIndex += 1; 10 | }; -------------------------------------------------------------------------------- /dist/color.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | var _namedColors = { 7 | "aliceblue": "#f0f8ff", 8 | "antiquewhite": "#faebd7", 9 | "aqua": "#00ffff", 10 | "aquamarine": "#7fffd4", 11 | "azure": "#f0ffff", 12 | "beige": "#f5f5dc", 13 | "bisque": "#ffe4c4", 14 | "black": "#000000", 15 | "blanchedalmond": "#ffebcd", 16 | "blue": "#0000ff", 17 | "blueviolet": "#8a2be2", 18 | "brown": "#a52a2a", 19 | "burlywood": "#deb887", 20 | "cadetblue": "#5f9ea0", 21 | "chartreuse": "#7fff00", 22 | "chocolate": "#d2691e", 23 | "coral": "#ff7f50", 24 | "cornflowerblue": "#6495ed", 25 | "cornsilk": "#fff8dc", 26 | "crimson": "#dc143c", 27 | "cyan": "#00ffff", 28 | "darkblue": "#00008b", 29 | "darkcyan": "#008b8b", 30 | "darkgoldenrod": "#b8860b", 31 | "darkgray": "#a9a9a9", 32 | "darkgreen": "#006400", 33 | "darkkhaki": "#bdb76b", 34 | "darkmagenta": "#8b008b", 35 | "darkolivegreen": "#556b2f", 36 | "darkorange": "#ff8c00", 37 | "darkorchid": "#9932cc", 38 | "darkred": "#8b0000", 39 | "darksalmon": "#e9967a", 40 | "darkseagreen": "#8fbc8f", 41 | "darkslateblue": "#483d8b", 42 | "darkslategray": "#2f4f4f", 43 | "darkturquoise": "#00ced1", 44 | "darkviolet": "#9400d3", 45 | "deeppink": "#ff1493", 46 | "deepskyblue": "#00bfff", 47 | "dimgray": "#696969", 48 | "dodgerblue": "#1e90ff", 49 | "firebrick": "#b22222", 50 | "floralwhite": "#fffaf0", 51 | "forestgreen": "#228b22", 52 | "fuchsia": "#ff00ff", 53 | "gainsboro": "#dcdcdc", 54 | "ghostwhite": "#f8f8ff", 55 | "gold": "#ffd700", 56 | "goldenrod": "#daa520", 57 | "gray": "#808080", 58 | "green": "#008000", 59 | "greenyellow": "#adff2f", 60 | "honeydew": "#f0fff0", 61 | "hotpink": "#ff69b4", 62 | "indianred ": "#cd5c5c", 63 | "indigo": "#4b0082", 64 | "ivory": "#fffff0", 65 | "khaki": "#f0e68c", 66 | "lavender": "#e6e6fa", 67 | "lavenderblush": "#fff0f5", 68 | "lawngreen": "#7cfc00", 69 | "lemonchiffon": "#fffacd", 70 | "lightblue": "#add8e6", 71 | "lightcoral": "#f08080", 72 | "lightcyan": "#e0ffff", 73 | "lightgoldenrodyellow": "#fafad2", 74 | "lightgrey": "#d3d3d3", 75 | "lightgreen": "#90ee90", 76 | "lightpink": "#ffb6c1", 77 | "lightsalmon": "#ffa07a", 78 | "lightseagreen": "#20b2aa", 79 | "lightskyblue": "#87cefa", 80 | "lightslategray": "#778899", 81 | "lightsteelblue": "#b0c4de", 82 | "lightyellow": "#ffffe0", 83 | "lime": "#00ff00", 84 | "limegreen": "#32cd32", 85 | "linen": "#faf0e6", 86 | "magenta": "#ff00ff", 87 | "maroon": "#800000", 88 | "mediumaquamarine": "#66cdaa", 89 | "mediumblue": "#0000cd", 90 | "mediumorchid": "#ba55d3", 91 | "mediumpurple": "#9370d8", 92 | "mediumseagreen": "#3cb371", 93 | "mediumslateblue": "#7b68ee", 94 | "mediumspringgreen": "#00fa9a", 95 | "mediumturquoise": "#48d1cc", 96 | "mediumvioletred": "#c71585", 97 | "midnightblue": "#191970", 98 | "mintcream": "#f5fffa", 99 | "mistyrose": "#ffe4e1", 100 | "moccasin": "#ffe4b5", 101 | "navajowhite": "#ffdead", 102 | "navy": "#000080", 103 | "oldlace": "#fdf5e6", 104 | "olive": "#808000", 105 | "olivedrab": "#6b8e23", 106 | "orange": "#ffa500", 107 | "orangered": "#ff4500", 108 | "orchid": "#da70d6", 109 | "palegoldenrod": "#eee8aa", 110 | "palegreen": "#98fb98", 111 | "paleturquoise": "#afeeee", 112 | "palevioletred": "#d87093", 113 | "papayawhip": "#ffefd5", 114 | "peachpuff": "#ffdab9", 115 | "peru": "#cd853f", 116 | "pink": "#ffc0cb", 117 | "plum": "#dda0dd", 118 | "powderblue": "#b0e0e6", 119 | "purple": "#800080", 120 | "rebeccapurple": "#663399", 121 | "red": "#ff0000", 122 | "rosybrown": "#bc8f8f", 123 | "royalblue": "#4169e1", 124 | "saddlebrown": "#8b4513", 125 | "salmon": "#fa8072", 126 | "sandybrown": "#f4a460", 127 | "seagreen": "#2e8b57", 128 | "seashell": "#fff5ee", 129 | "sienna": "#a0522d", 130 | "silver": "#c0c0c0", 131 | "skyblue": "#87ceeb", 132 | "slateblue": "#6a5acd", 133 | "slategray": "#708090", 134 | "snow": "#fffafa", 135 | "springgreen": "#00ff7f", 136 | "steelblue": "#4682b4", 137 | "tan": "#d2b48c", 138 | "teal": "#008080", 139 | "thistle": "#d8bfd8", 140 | "tomato": "#ff6347", 141 | "turquoise": "#40e0d0", 142 | "violet": "#ee82ee", 143 | "wheat": "#f5deb3", 144 | "white": "#ffffff", 145 | "whitesmoke": "#f5f5f5", 146 | "yellow": "#ffff00", 147 | "yellowgreen": "#9acd32" 148 | }; 149 | 150 | var _getHexColor = function _getHexColor(color) { 151 | 152 | color = color.replace('color:', '').replace(';', '').replace(' ', ''); 153 | 154 | if (/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(color)) { 155 | return color; 156 | } else if (namedColors[color]) { 157 | return namedColors[color]; 158 | } else if (color.indexOf('rgb') === 0) { 159 | 160 | var rgbArray = color.split(','); 161 | var convertedColor = rgbArray.length < 3 ? null : '#' + [rgbArray[0], rgbArray[1], rgbArray[2]].map(function (x) { 162 | var hex = parseInt(x.replace(/\D/g, ''), 10).toString(16); 163 | return hex.length === 1 ? '0' + hex : hex; 164 | }).join(''); 165 | 166 | return (/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(convertedColor) ? convertedColor : null 167 | ); 168 | } else { 169 | return null; 170 | } 171 | }; 172 | 173 | var namedColors = exports.namedColors = _namedColors; 174 | var getHexColor = exports.getHexColor = _getHexColor; 175 | 176 | var detectColorsFromHTMLString = exports.detectColorsFromHTMLString = function detectColorsFromHTMLString(html) { 177 | return typeof html !== 'string' ? [] : (html.match(/color:[^;]{3,24};/g) || []).map(getHexColor).filter(function (color) { 178 | return color; 179 | }); 180 | }; 181 | 182 | var detectColorsFromDraftState = exports.detectColorsFromDraftState = function detectColorsFromDraftState(draftState) { 183 | 184 | var result = []; 185 | 186 | if (!draftState || !draftState.blocks || !draftState.blocks.length) { 187 | return result; 188 | } 189 | 190 | draftState.blocks.forEach(function (block) { 191 | if (block && block.inlineStyleRanges && block.inlineStyleRanges.length) { 192 | block.inlineStyleRanges.forEach(function (inlineStyle) { 193 | if (inlineStyle.style && inlineStyle.style.indexOf('COLOR-') >= 0) { 194 | result.push('#' + inlineStyle.style.split('COLOR-')[1]); 195 | } 196 | }); 197 | } 198 | }); 199 | 200 | return result.filter(function (color) { 201 | return color; 202 | }); 203 | }; -------------------------------------------------------------------------------- /dist/content.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.redo = exports.undo = exports.handleKeyCommand = exports.clear = exports.setMediaPosition = exports.removeMedia = exports.setMediaData = exports.insertMedias = exports.insertHorizontalLine = exports.insertAtomicBlock = exports.insertHTML = exports.insertText = exports.toggleSelectionLetterSpacing = exports.toggleSelectionFontFamily = exports.toggleSelectionLineHeight = exports.toggleSelectionFontSize = exports.toggleSelectionBackgroundColor = exports.toggleSelectionColor = exports.decreaseSelectionIndent = exports.increaseSelectionIndent = exports.toggleSelectionIndent = exports.toggleSelectionAlignment = exports.removeSelectionInlineStyles = exports.toggleSelectionInlineStyle = exports.selectionHasInlineStyle = exports.getSelectionInlineStyle = exports.toggleSelectionLink = exports.toggleSelectionEntity = exports.getSelectionEntityData = exports.getSelectionEntityType = exports.toggleSelectionBlockType = exports.getSelectionText = exports.getSelectionBlockType = exports.getSelectionBlockData = exports.setSelectionBlockData = exports.getSelectedBlocks = exports.updateEachCharacterOfSelection = exports.getSelectionBlock = exports.removeBlock = exports.selectNextBlock = exports.selectBlock = exports.selectionContainsStrictBlock = exports.selectionContainsBlockType = exports.isSelectionCollapsed = exports.createEditorState = exports.createEmptyEditorState = exports.isEditorState = exports.registerStrictBlockType = undefined; 7 | 8 | var _draftJs = require('draft-js'); 9 | 10 | var _draftjsUtils = require('draftjs-utils'); 11 | 12 | var _braftConvert = require('braft-convert'); 13 | 14 | var _immutable = require('immutable'); 15 | 16 | var _immutable2 = _interopRequireDefault(_immutable); 17 | 18 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 19 | 20 | var strictBlockTypes = ['atomic']; 21 | 22 | var registerStrictBlockType = exports.registerStrictBlockType = function registerStrictBlockType(blockType) { 23 | strictBlockTypes.indexOf(blockType) === -1 && strictBlockTypes.push(blockType); 24 | }; 25 | 26 | var isEditorState = exports.isEditorState = function isEditorState(editorState) { 27 | return editorState instanceof _draftJs.EditorState; 28 | }; 29 | 30 | var createEmptyEditorState = exports.createEmptyEditorState = function createEmptyEditorState(editorDecorators) { 31 | return _draftJs.EditorState.createEmpty(editorDecorators); 32 | }; 33 | 34 | var createEditorState = exports.createEditorState = function createEditorState(contentState, editorDecorators) { 35 | return _draftJs.EditorState.createWithContent(contentState, editorDecorators); 36 | }; 37 | 38 | var isSelectionCollapsed = exports.isSelectionCollapsed = function isSelectionCollapsed(editorState) { 39 | return editorState.getSelection().isCollapsed(); 40 | }; 41 | 42 | var selectionContainsBlockType = exports.selectionContainsBlockType = function selectionContainsBlockType(editorState, blockType) { 43 | return getSelectedBlocks(editorState).find(function (block) { 44 | return block.getType() === blockType; 45 | }); 46 | }; 47 | 48 | var selectionContainsStrictBlock = exports.selectionContainsStrictBlock = function selectionContainsStrictBlock(editorState) { 49 | return getSelectedBlocks(editorState).find(function (block) { 50 | return ~strictBlockTypes.indexOf(block.getType()); 51 | }); 52 | }; 53 | 54 | var selectBlock = exports.selectBlock = function selectBlock(editorState, block) { 55 | 56 | var blockKey = block.getKey(); 57 | 58 | return _draftJs.EditorState.forceSelection(editorState, new _draftJs.SelectionState({ 59 | anchorKey: blockKey, 60 | anchorOffset: 0, 61 | focusKey: blockKey, 62 | focusOffset: block.getLength() 63 | })); 64 | }; 65 | 66 | var selectNextBlock = exports.selectNextBlock = function selectNextBlock(editorState, block) { 67 | var nextBlock = editorState.getCurrentContent().getBlockAfter(block.getKey()); 68 | return nextBlock ? selectBlock(editorState, nextBlock) : editorState; 69 | }; 70 | 71 | var removeBlock = exports.removeBlock = function removeBlock(editorState, block) { 72 | var lastSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 73 | 74 | 75 | var nextContentState = void 0, 76 | nextEditorState = void 0; 77 | var blockKey = block.getKey(); 78 | 79 | nextContentState = _draftJs.Modifier.removeRange(editorState.getCurrentContent(), new _draftJs.SelectionState({ 80 | anchorKey: blockKey, 81 | anchorOffset: 0, 82 | focusKey: blockKey, 83 | focusOffset: block.getLength() 84 | }), 'backward'); 85 | 86 | nextContentState = _draftJs.Modifier.setBlockType(nextContentState, nextContentState.getSelectionAfter(), 'unstyled'); 87 | nextEditorState = _draftJs.EditorState.push(editorState, nextContentState, 'remove-range'); 88 | return _draftJs.EditorState.forceSelection(nextEditorState, lastSelection || nextContentState.getSelectionAfter()); 89 | }; 90 | 91 | var getSelectionBlock = exports.getSelectionBlock = function getSelectionBlock(editorState) { 92 | return editorState.getCurrentContent().getBlockForKey(editorState.getSelection().getAnchorKey()); 93 | }; 94 | 95 | var updateEachCharacterOfSelection = exports.updateEachCharacterOfSelection = function updateEachCharacterOfSelection(editorState, callback) { 96 | 97 | var selectionState = editorState.getSelection(); 98 | var contentState = editorState.getCurrentContent(); 99 | var contentBlocks = contentState.getBlockMap(); 100 | var selectedBlocks = getSelectedBlocks(editorState); 101 | 102 | if (selectedBlocks.length === 0) { 103 | return editorState; 104 | } 105 | 106 | var startKey = selectionState.getStartKey(); 107 | var startOffset = selectionState.getStartOffset(); 108 | var endKey = selectionState.getEndKey(); 109 | var endOffset = selectionState.getEndOffset(); 110 | 111 | var nextContentBlocks = contentBlocks.map(function (block) { 112 | 113 | if (selectedBlocks.indexOf(block) === -1) { 114 | return block; 115 | } 116 | 117 | var blockKey = block.getKey(); 118 | var charactersList = block.getCharacterList(); 119 | var nextCharactersList = null; 120 | 121 | if (blockKey === startKey && blockKey === endKey) { 122 | nextCharactersList = charactersList.map(function (character, index) { 123 | if (index >= startOffset && index < endOffset) { 124 | return callback(character); 125 | } 126 | return character; 127 | }); 128 | } else if (blockKey === startKey) { 129 | nextCharactersList = charactersList.map(function (character, index) { 130 | if (index >= startOffset) { 131 | return callback(character); 132 | } 133 | return character; 134 | }); 135 | } else if (blockKey === endKey) { 136 | nextCharactersList = charactersList.map(function (character, index) { 137 | if (index < endOffset) { 138 | return callback(character); 139 | } 140 | return character; 141 | }); 142 | } else { 143 | nextCharactersList = charactersList.map(function (character) { 144 | return callback(character); 145 | }); 146 | } 147 | 148 | return block.merge({ 149 | 'characterList': nextCharactersList 150 | }); 151 | }); 152 | 153 | return _draftJs.EditorState.push(editorState, contentState.merge({ 154 | blockMap: nextContentBlocks, 155 | selectionBefore: selectionState, 156 | selectionAfter: selectionState 157 | }), 'update-selection-character-list'); 158 | }; 159 | 160 | var getSelectedBlocks = exports.getSelectedBlocks = function getSelectedBlocks(editorState) { 161 | 162 | var selectionState = editorState.getSelection(); 163 | var contentState = editorState.getCurrentContent(); 164 | 165 | var startKey = selectionState.getStartKey(); 166 | var endKey = selectionState.getEndKey(); 167 | var isSameBlock = startKey === endKey; 168 | var startingBlock = contentState.getBlockForKey(startKey); 169 | var selectedBlocks = [startingBlock]; 170 | 171 | if (!isSameBlock) { 172 | var blockKey = startKey; 173 | 174 | while (blockKey !== endKey) { 175 | var nextBlock = contentState.getBlockAfter(blockKey); 176 | selectedBlocks.push(nextBlock); 177 | blockKey = nextBlock.getKey(); 178 | } 179 | } 180 | 181 | return selectedBlocks; 182 | }; 183 | 184 | var setSelectionBlockData = exports.setSelectionBlockData = function setSelectionBlockData(editorState, blockData, override) { 185 | 186 | var newBlockData = override ? blockData : Object.assign({}, getSelectionBlockData(editorState).toJS(), blockData); 187 | 188 | Object.keys(newBlockData).forEach(function (key) { 189 | if (newBlockData.hasOwnProperty(key) && newBlockData[key] === undefined) { 190 | delete newBlockData[key]; 191 | } 192 | }); 193 | 194 | return (0, _draftjsUtils.setBlockData)(editorState, newBlockData); 195 | }; 196 | 197 | var getSelectionBlockData = exports.getSelectionBlockData = function getSelectionBlockData(editorState, name) { 198 | var blockData = getSelectionBlock(editorState).getData(); 199 | return name ? blockData.get(name) : blockData; 200 | }; 201 | 202 | var getSelectionBlockType = exports.getSelectionBlockType = function getSelectionBlockType(editorState) { 203 | return getSelectionBlock(editorState).getType(); 204 | }; 205 | 206 | var getSelectionText = exports.getSelectionText = function getSelectionText(editorState) { 207 | 208 | var selectionState = editorState.getSelection(); 209 | var contentState = editorState.getCurrentContent(); 210 | 211 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 212 | return ''; 213 | } 214 | 215 | var anchorKey = selectionState.getAnchorKey(); 216 | var currentContentBlock = contentState.getBlockForKey(anchorKey); 217 | var start = selectionState.getStartOffset(); 218 | var end = selectionState.getEndOffset(); 219 | 220 | return currentContentBlock.getText().slice(start, end); 221 | }; 222 | 223 | var toggleSelectionBlockType = exports.toggleSelectionBlockType = function toggleSelectionBlockType(editorState, blockType) { 224 | 225 | if (selectionContainsStrictBlock(editorState)) { 226 | return editorState; 227 | } 228 | 229 | return _draftJs.RichUtils.toggleBlockType(editorState, blockType); 230 | }; 231 | 232 | var getSelectionEntityType = exports.getSelectionEntityType = function getSelectionEntityType(editorState) { 233 | 234 | var entityKey = (0, _draftjsUtils.getSelectionEntity)(editorState); 235 | 236 | if (entityKey) { 237 | var entity = editorState.getCurrentContent().getEntity(entityKey); 238 | return entity ? entity.get('type') : null; 239 | } 240 | 241 | return null; 242 | }; 243 | 244 | var getSelectionEntityData = exports.getSelectionEntityData = function getSelectionEntityData(editorState, type) { 245 | 246 | var entityKey = (0, _draftjsUtils.getSelectionEntity)(editorState); 247 | 248 | if (entityKey) { 249 | var entity = editorState.getCurrentContent().getEntity(entityKey); 250 | if (entity && entity.get('type') === type) { 251 | return entity.getData(); 252 | } else { 253 | return {}; 254 | } 255 | } else { 256 | return {}; 257 | } 258 | }; 259 | 260 | var toggleSelectionEntity = exports.toggleSelectionEntity = function toggleSelectionEntity(editorState, entity) { 261 | 262 | var contentState = editorState.getCurrentContent(); 263 | var selectionState = editorState.getSelection(); 264 | 265 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 266 | return editorState; 267 | } 268 | 269 | if (!entity || !entity.type || getSelectionEntityType(editorState) === entity.type) { 270 | return _draftJs.EditorState.push(editorState, _draftJs.Modifier.applyEntity(contentState, selectionState, null), 'apply-entity'); 271 | } 272 | 273 | try { 274 | 275 | var nextContentState = contentState.createEntity(entity.type, entity.mutability, entity.data); 276 | var entityKey = nextContentState.getLastCreatedEntityKey(); 277 | 278 | var nextEditorState = _draftJs.EditorState.set(editorState, { 279 | currentContent: nextContentState 280 | }); 281 | 282 | return _draftJs.EditorState.push(nextEditorState, _draftJs.Modifier.applyEntity(nextContentState, selectionState, entityKey), 'apply-entity'); 283 | } catch (error) { 284 | console.warn(error); 285 | return editorState; 286 | } 287 | }; 288 | 289 | var toggleSelectionLink = exports.toggleSelectionLink = function toggleSelectionLink(editorState, href, target) { 290 | 291 | var contentState = editorState.getCurrentContent(); 292 | var selectionState = editorState.getSelection(); 293 | 294 | var entityData = { href: href, target: target }; 295 | 296 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 297 | return editorState; 298 | } 299 | 300 | if (href === false) { 301 | return _draftJs.RichUtils.toggleLink(editorState, selectionState, null); 302 | } 303 | 304 | if (href === null) { 305 | delete entityData.href; 306 | } 307 | 308 | try { 309 | 310 | var nextContentState = contentState.createEntity('LINK', 'MUTABLE', entityData); 311 | var entityKey = nextContentState.getLastCreatedEntityKey(); 312 | 313 | var nextEditorState = _draftJs.EditorState.set(editorState, { 314 | currentContent: nextContentState 315 | }); 316 | 317 | nextEditorState = _draftJs.RichUtils.toggleLink(nextEditorState, selectionState, entityKey); 318 | nextEditorState = _draftJs.EditorState.forceSelection(nextEditorState, selectionState.merge({ 319 | anchorOffset: selectionState.getEndOffset(), 320 | focusOffset: selectionState.getEndOffset() 321 | })); 322 | 323 | nextEditorState = _draftJs.EditorState.push(nextEditorState, _draftJs.Modifier.insertText(nextEditorState.getCurrentContent(), nextEditorState.getSelection(), ''), 'insert-text'); 324 | 325 | return nextEditorState; 326 | } catch (error) { 327 | console.warn(error); 328 | return editorState; 329 | } 330 | }; 331 | 332 | var getSelectionInlineStyle = exports.getSelectionInlineStyle = function getSelectionInlineStyle(editorState) { 333 | return editorState.getCurrentInlineStyle(); 334 | }; 335 | 336 | var selectionHasInlineStyle = exports.selectionHasInlineStyle = function selectionHasInlineStyle(editorState, style) { 337 | return getSelectionInlineStyle(editorState).has(style.toUpperCase()); 338 | }; 339 | 340 | var toggleSelectionInlineStyle = exports.toggleSelectionInlineStyle = function toggleSelectionInlineStyle(editorState, style) { 341 | var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 342 | 343 | 344 | var nextEditorState = editorState; 345 | style = prefix + style.toUpperCase(); 346 | 347 | if (prefix) { 348 | 349 | nextEditorState = updateEachCharacterOfSelection(nextEditorState, function (characterMetadata) { 350 | 351 | return characterMetadata.toJS().style.reduce(function (characterMetadata, characterStyle) { 352 | if (characterStyle.indexOf(prefix) === 0 && style !== characterStyle) { 353 | return _draftJs.CharacterMetadata.removeStyle(characterMetadata, characterStyle); 354 | } else { 355 | return characterMetadata; 356 | } 357 | }, characterMetadata); 358 | }); 359 | } 360 | 361 | return _draftJs.RichUtils.toggleInlineStyle(nextEditorState, style); 362 | }; 363 | 364 | var removeSelectionInlineStyles = exports.removeSelectionInlineStyles = function removeSelectionInlineStyles(editorState) { 365 | 366 | return updateEachCharacterOfSelection(editorState, function (characterMetadata) { 367 | return characterMetadata.merge({ 368 | style: _immutable2.default.OrderedSet([]) 369 | }); 370 | }); 371 | }; 372 | 373 | var toggleSelectionAlignment = exports.toggleSelectionAlignment = function toggleSelectionAlignment(editorState, alignment) { 374 | return setSelectionBlockData(editorState, { 375 | textAlign: getSelectionBlockData(editorState, 'textAlign') !== alignment ? alignment : undefined 376 | }); 377 | }; 378 | 379 | var toggleSelectionIndent = exports.toggleSelectionIndent = function toggleSelectionIndent(editorState, textIndent) { 380 | var maxIndent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 6; 381 | 382 | return textIndent < 0 || textIndent > maxIndent || isNaN(textIndent) ? editorState : setSelectionBlockData(editorState, { 383 | textIndent: textIndent || undefined 384 | }); 385 | }; 386 | 387 | var increaseSelectionIndent = exports.increaseSelectionIndent = function increaseSelectionIndent(editorState) { 388 | var maxIndent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; 389 | 390 | var currentIndent = getSelectionBlockData(editorState, 'textIndent') || 0; 391 | return toggleSelectionIndent(editorState, currentIndent + 1, maxIndent); 392 | }; 393 | 394 | var decreaseSelectionIndent = exports.decreaseSelectionIndent = function decreaseSelectionIndent(editorState, maxIndent) { 395 | var currentIndent = getSelectionBlockData(editorState, 'textIndent') || 0; 396 | return toggleSelectionIndent(editorState, currentIndent - 1, maxIndent); 397 | }; 398 | 399 | var toggleSelectionColor = exports.toggleSelectionColor = function toggleSelectionColor(editorState, color) { 400 | return toggleSelectionInlineStyle(editorState, color.replace('#', ''), 'COLOR-'); 401 | }; 402 | 403 | var toggleSelectionBackgroundColor = exports.toggleSelectionBackgroundColor = function toggleSelectionBackgroundColor(editorState, color) { 404 | return toggleSelectionInlineStyle(editorState, color.replace('#', ''), 'BGCOLOR-'); 405 | }; 406 | 407 | var toggleSelectionFontSize = exports.toggleSelectionFontSize = function toggleSelectionFontSize(editorState, fontSize) { 408 | return toggleSelectionInlineStyle(editorState, fontSize, 'FONTSIZE-'); 409 | }; 410 | 411 | var toggleSelectionLineHeight = exports.toggleSelectionLineHeight = function toggleSelectionLineHeight(editorState, lineHeight) { 412 | return toggleSelectionInlineStyle(editorState, lineHeight, 'LINEHEIGHT-'); 413 | }; 414 | 415 | var toggleSelectionFontFamily = exports.toggleSelectionFontFamily = function toggleSelectionFontFamily(editorState, fontFamily) { 416 | return toggleSelectionInlineStyle(editorState, fontFamily, 'FONTFAMILY-'); 417 | }; 418 | 419 | var toggleSelectionLetterSpacing = exports.toggleSelectionLetterSpacing = function toggleSelectionLetterSpacing(editorState, letterSpacing) { 420 | return toggleSelectionInlineStyle(editorState, letterSpacing, 'LETTERSPACING-'); 421 | }; 422 | 423 | var insertText = exports.insertText = function insertText(editorState, text, inlineStyle, entity) { 424 | 425 | var selectionState = editorState.getSelection(); 426 | var currentSelectedBlockType = getSelectionBlockType(editorState); 427 | 428 | if (currentSelectedBlockType === 'atomic') { 429 | return editorState; 430 | } 431 | 432 | var entityKey = void 0; 433 | var contentState = editorState.getCurrentContent(); 434 | 435 | if (entity && entity.type) { 436 | contentState = contentState.createEntity(entity.type, entity.mutability || 'MUTABLE', entity.data || entityData); 437 | entityKey = contentState.getLastCreatedEntityKey(); 438 | } 439 | 440 | if (!selectionState.isCollapsed()) { 441 | return _draftJs.EditorState.push(editorState, _draftJs.Modifier.replaceText(contentState, selectionState, text, inlineStyle, entityKey), 'replace-text'); 442 | } else { 443 | return _draftJs.EditorState.push(editorState, _draftJs.Modifier.insertText(contentState, selectionState, text, inlineStyle, entityKey), 'insert-text'); 444 | } 445 | }; 446 | 447 | var insertHTML = exports.insertHTML = function insertHTML(editorState, htmlString, source) { 448 | 449 | if (!htmlString) { 450 | return editorState; 451 | } 452 | 453 | var selectionState = editorState.getSelection(); 454 | var contentState = editorState.getCurrentContent(); 455 | var options = editorState.convertOptions || {}; 456 | 457 | try { 458 | var _convertFromRaw = (0, _draftJs.convertFromRaw)((0, _braftConvert.convertHTMLToRaw)(htmlString, options, source)), 459 | blockMap = _convertFromRaw.blockMap; 460 | 461 | return _draftJs.EditorState.push(editorState, _draftJs.Modifier.replaceWithFragment(contentState, selectionState, blockMap), 'insert-fragment'); 462 | } catch (error) { 463 | console.warn(error); 464 | return editorState; 465 | } 466 | }; 467 | 468 | var insertAtomicBlock = exports.insertAtomicBlock = function insertAtomicBlock(editorState, type) { 469 | var immutable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; 470 | var data = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; 471 | 472 | 473 | if (selectionContainsStrictBlock(editorState)) { 474 | return insertAtomicBlock(selectNextBlock(editorState, getSelectionBlock(editorState)), type, immutable, data); 475 | } 476 | 477 | var selectionState = editorState.getSelection(); 478 | var contentState = editorState.getCurrentContent(); 479 | 480 | if (!selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 481 | return editorState; 482 | } 483 | 484 | var contentStateWithEntity = contentState.createEntity(type, immutable ? 'IMMUTABLE' : 'MUTABLE', data); 485 | var entityKey = contentStateWithEntity.getLastCreatedEntityKey(); 486 | var newEditorState = _draftJs.AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' '); 487 | 488 | return newEditorState; 489 | }; 490 | 491 | var insertHorizontalLine = exports.insertHorizontalLine = function insertHorizontalLine(editorState) { 492 | return insertAtomicBlock(editorState, 'HR'); 493 | }; 494 | 495 | var insertMedias = exports.insertMedias = function insertMedias(editorState) { 496 | var medias = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; 497 | 498 | 499 | if (!medias.length) { 500 | return editorState; 501 | } 502 | 503 | return medias.reduce(function (editorState, media) { 504 | var url = media.url, 505 | link = media.link, 506 | link_target = media.link_target, 507 | name = media.name, 508 | type = media.type, 509 | width = media.width, 510 | height = media.height, 511 | meta = media.meta; 512 | 513 | return insertAtomicBlock(editorState, type, true, { url: url, link: link, link_target: link_target, name: name, type: type, width: width, height: height, meta: meta }); 514 | }, editorState); 515 | }; 516 | 517 | var setMediaData = exports.setMediaData = function setMediaData(editorState, entityKey, data) { 518 | return _draftJs.EditorState.push(editorState, editorState.getCurrentContent().mergeEntityData(entityKey, data), 'change-block-data'); 519 | }; 520 | 521 | var removeMedia = exports.removeMedia = function removeMedia(editorState, mediaBlock) { 522 | return removeBlock(editorState, mediaBlock); 523 | }; 524 | 525 | var setMediaPosition = exports.setMediaPosition = function setMediaPosition(editorState, mediaBlock, position) { 526 | 527 | var newPosition = {}; 528 | var float = position.float, 529 | alignment = position.alignment; 530 | 531 | 532 | if (typeof float !== 'undefined') { 533 | newPosition.float = mediaBlock.getData().get('float') === float ? null : float; 534 | } 535 | 536 | if (typeof alignment !== 'undefined') { 537 | newPosition.alignment = mediaBlock.getData().get('alignment') === alignment ? null : alignment; 538 | } 539 | 540 | return setSelectionBlockData(selectBlock(editorState, mediaBlock), newPosition); 541 | }; 542 | 543 | var clear = exports.clear = function clear(editorState) { 544 | 545 | var contentState = editorState.getCurrentContent(); 546 | 547 | var firstBlock = contentState.getFirstBlock(); 548 | var lastBlock = contentState.getLastBlock(); 549 | 550 | var allSelected = new _draftJs.SelectionState({ 551 | anchorKey: firstBlock.getKey(), 552 | anchorOffset: 0, 553 | focusKey: lastBlock.getKey(), 554 | focusOffset: lastBlock.getLength(), 555 | hasFocus: true 556 | }); 557 | 558 | return _draftJs.RichUtils.toggleBlockType(_draftJs.EditorState.push(editorState, _draftJs.Modifier.removeRange(contentState, allSelected, 'backward'), 'remove-range'), 'unstyled'); 559 | }; 560 | 561 | var handleKeyCommand = exports.handleKeyCommand = function handleKeyCommand(editorState, command) { 562 | return _draftJs.RichUtils.handleKeyCommand(editorState, command); 563 | }; 564 | 565 | var undo = exports.undo = function undo(editorState) { 566 | return _draftJs.EditorState.undo(editorState); 567 | }; 568 | 569 | var redo = exports.redo = function redo(editorState) { 570 | return _draftJs.EditorState.redo(editorState); 571 | }; -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | Object.defineProperty(exports, "__esModule", { 4 | value: true 5 | }); 6 | exports.ColorUtils = exports.BaseUtils = exports.ContentUtils = undefined; 7 | 8 | var _content = require('./content'); 9 | 10 | var _ContentUtils = _interopRequireWildcard(_content); 11 | 12 | var _base = require('./base'); 13 | 14 | var _BaseUtils = _interopRequireWildcard(_base); 15 | 16 | var _color = require('./color'); 17 | 18 | var _ColorUtils = _interopRequireWildcard(_color); 19 | 20 | function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } 21 | 22 | var ContentUtils = exports.ContentUtils = _ContentUtils; 23 | var BaseUtils = exports.BaseUtils = _BaseUtils; 24 | var ColorUtils = exports.ColorUtils = _ColorUtils; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "braft-utils", 3 | "version": "3.0.12", 4 | "description": "Utils for Braft Editor", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "build": "rm -rf dist/ && BABEL_ENV=production ./node_modules/.bin/babel src --copy-files --extensions .es6,.es,.js,.jsx --out-dir dist", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "https://github.com/margox/braft-utils.git" 13 | }, 14 | "keywords": [ 15 | "braft", 16 | "editor", 17 | "utils" 18 | ], 19 | "author": "Margox", 20 | "license": "MIT", 21 | "peerDependencies": { 22 | "immutable": "~3.7.4", 23 | "braft-convert": "^2.1.4", 24 | "draft-js": "^0.10.5", 25 | "draftjs-utils": "^0.9.4" 26 | }, 27 | "devDependencies": { 28 | "babel-cli": "^6.26.0", 29 | "babel-core": "^6.26.3", 30 | "babel-preset-es2015": "^6.24.1" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/base.js: -------------------------------------------------------------------------------- 1 | let braftUniqueIndex = 0 2 | 3 | export const UniqueIndex = () => braftUniqueIndex += 1 -------------------------------------------------------------------------------- /src/color.js: -------------------------------------------------------------------------------- 1 | const _namedColors = { 2 | "aliceblue": "#f0f8ff", 3 | "antiquewhite": "#faebd7", 4 | "aqua": "#00ffff", 5 | "aquamarine": "#7fffd4", 6 | "azure": "#f0ffff", 7 | "beige": "#f5f5dc", 8 | "bisque": "#ffe4c4", 9 | "black": "#000000", 10 | "blanchedalmond": "#ffebcd", 11 | "blue": "#0000ff", 12 | "blueviolet": "#8a2be2", 13 | "brown": "#a52a2a", 14 | "burlywood": "#deb887", 15 | "cadetblue": "#5f9ea0", 16 | "chartreuse": "#7fff00", 17 | "chocolate": "#d2691e", 18 | "coral": "#ff7f50", 19 | "cornflowerblue": "#6495ed", 20 | "cornsilk": "#fff8dc", 21 | "crimson": "#dc143c", 22 | "cyan": "#00ffff", 23 | "darkblue": "#00008b", 24 | "darkcyan": "#008b8b", 25 | "darkgoldenrod": "#b8860b", 26 | "darkgray": "#a9a9a9", 27 | "darkgreen": "#006400", 28 | "darkkhaki": "#bdb76b", 29 | "darkmagenta": "#8b008b", 30 | "darkolivegreen": "#556b2f", 31 | "darkorange": "#ff8c00", 32 | "darkorchid": "#9932cc", 33 | "darkred": "#8b0000", 34 | "darksalmon": "#e9967a", 35 | "darkseagreen": "#8fbc8f", 36 | "darkslateblue": "#483d8b", 37 | "darkslategray": "#2f4f4f", 38 | "darkturquoise": "#00ced1", 39 | "darkviolet": "#9400d3", 40 | "deeppink": "#ff1493", 41 | "deepskyblue": "#00bfff", 42 | "dimgray": "#696969", 43 | "dodgerblue": "#1e90ff", 44 | "firebrick": "#b22222", 45 | "floralwhite": "#fffaf0", 46 | "forestgreen": "#228b22", 47 | "fuchsia": "#ff00ff", 48 | "gainsboro": "#dcdcdc", 49 | "ghostwhite": "#f8f8ff", 50 | "gold": "#ffd700", 51 | "goldenrod": "#daa520", 52 | "gray": "#808080", 53 | "green": "#008000", 54 | "greenyellow": "#adff2f", 55 | "honeydew": "#f0fff0", 56 | "hotpink": "#ff69b4", 57 | "indianred ": "#cd5c5c", 58 | "indigo": "#4b0082", 59 | "ivory": "#fffff0", 60 | "khaki": "#f0e68c", 61 | "lavender": "#e6e6fa", 62 | "lavenderblush": "#fff0f5", 63 | "lawngreen": "#7cfc00", 64 | "lemonchiffon": "#fffacd", 65 | "lightblue": "#add8e6", 66 | "lightcoral": "#f08080", 67 | "lightcyan": "#e0ffff", 68 | "lightgoldenrodyellow": "#fafad2", 69 | "lightgrey": "#d3d3d3", 70 | "lightgreen": "#90ee90", 71 | "lightpink": "#ffb6c1", 72 | "lightsalmon": "#ffa07a", 73 | "lightseagreen": "#20b2aa", 74 | "lightskyblue": "#87cefa", 75 | "lightslategray": "#778899", 76 | "lightsteelblue": "#b0c4de", 77 | "lightyellow": "#ffffe0", 78 | "lime": "#00ff00", 79 | "limegreen": "#32cd32", 80 | "linen": "#faf0e6", 81 | "magenta": "#ff00ff", 82 | "maroon": "#800000", 83 | "mediumaquamarine": "#66cdaa", 84 | "mediumblue": "#0000cd", 85 | "mediumorchid": "#ba55d3", 86 | "mediumpurple": "#9370d8", 87 | "mediumseagreen": "#3cb371", 88 | "mediumslateblue": "#7b68ee", 89 | "mediumspringgreen": "#00fa9a", 90 | "mediumturquoise": "#48d1cc", 91 | "mediumvioletred": "#c71585", 92 | "midnightblue": "#191970", 93 | "mintcream": "#f5fffa", 94 | "mistyrose": "#ffe4e1", 95 | "moccasin": "#ffe4b5", 96 | "navajowhite": "#ffdead", 97 | "navy": "#000080", 98 | "oldlace": "#fdf5e6", 99 | "olive": "#808000", 100 | "olivedrab": "#6b8e23", 101 | "orange": "#ffa500", 102 | "orangered": "#ff4500", 103 | "orchid": "#da70d6", 104 | "palegoldenrod": "#eee8aa", 105 | "palegreen": "#98fb98", 106 | "paleturquoise": "#afeeee", 107 | "palevioletred": "#d87093", 108 | "papayawhip": "#ffefd5", 109 | "peachpuff": "#ffdab9", 110 | "peru": "#cd853f", 111 | "pink": "#ffc0cb", 112 | "plum": "#dda0dd", 113 | "powderblue": "#b0e0e6", 114 | "purple": "#800080", 115 | "rebeccapurple": "#663399", 116 | "red": "#ff0000", 117 | "rosybrown": "#bc8f8f", 118 | "royalblue": "#4169e1", 119 | "saddlebrown": "#8b4513", 120 | "salmon": "#fa8072", 121 | "sandybrown": "#f4a460", 122 | "seagreen": "#2e8b57", 123 | "seashell": "#fff5ee", 124 | "sienna": "#a0522d", 125 | "silver": "#c0c0c0", 126 | "skyblue": "#87ceeb", 127 | "slateblue": "#6a5acd", 128 | "slategray": "#708090", 129 | "snow": "#fffafa", 130 | "springgreen": "#00ff7f", 131 | "steelblue": "#4682b4", 132 | "tan": "#d2b48c", 133 | "teal": "#008080", 134 | "thistle": "#d8bfd8", 135 | "tomato": "#ff6347", 136 | "turquoise": "#40e0d0", 137 | "violet": "#ee82ee", 138 | "wheat": "#f5deb3", 139 | "white": "#ffffff", 140 | "whitesmoke": "#f5f5f5", 141 | "yellow": "#ffff00", 142 | "yellowgreen": "#9acd32" 143 | } 144 | 145 | const _getHexColor = (color) => { 146 | 147 | color = color.replace('color:', '').replace(';', '').replace(' ', '') 148 | 149 | if (/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(color)) { 150 | return color 151 | } else if (namedColors[color]) { 152 | return namedColors[color] 153 | } else if (color.indexOf('rgb') === 0) { 154 | 155 | let rgbArray = color.split(',') 156 | let convertedColor = rgbArray.length < 3 ? null : '#' + [rgbArray[0], rgbArray[1], rgbArray[2]].map(x => { 157 | const hex = parseInt(x.replace(/\D/g, ''), 10).toString(16) 158 | return hex.length === 1 ? '0' + hex : hex 159 | }).join('') 160 | 161 | return /^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(convertedColor) ? convertedColor : null 162 | 163 | } else { 164 | return null 165 | } 166 | 167 | } 168 | 169 | export const namedColors = _namedColors 170 | export const getHexColor = _getHexColor 171 | 172 | export const detectColorsFromHTMLString = (html) => { 173 | return typeof html !== 'string' ? [] : (html.match(/color:[^;]{3,24};/g) || []).map(getHexColor).filter(color => color) 174 | } 175 | 176 | export const detectColorsFromDraftState = (draftState) => { 177 | 178 | let result = [] 179 | 180 | if (!draftState || !draftState.blocks || !draftState.blocks.length) { 181 | return result 182 | } 183 | 184 | draftState.blocks.forEach((block) => { 185 | if (block && block.inlineStyleRanges && block.inlineStyleRanges.length) { 186 | block.inlineStyleRanges.forEach((inlineStyle) => { 187 | if (inlineStyle.style && inlineStyle.style.indexOf('COLOR-') >= 0) { 188 | result.push('#' + inlineStyle.style.split('COLOR-')[1]) 189 | } 190 | }) 191 | } 192 | }) 193 | 194 | return result.filter(color => color) 195 | 196 | } -------------------------------------------------------------------------------- /src/content.js: -------------------------------------------------------------------------------- 1 | import { Modifier, EditorState, SelectionState, RichUtils, CharacterMetadata, AtomicBlockUtils, convertFromRaw } from 'draft-js' 2 | import { setBlockData, getSelectionEntity } from 'draftjs-utils' 3 | import { convertHTMLToRaw } from 'braft-convert' 4 | import Immutable from 'immutable' 5 | 6 | const strictBlockTypes = ['atomic'] 7 | 8 | export const registerStrictBlockType = (blockType) => { 9 | strictBlockTypes.indexOf(blockType) === -1 && strictBlockTypes.push(blockType) 10 | } 11 | 12 | export const isEditorState = (editorState) => { 13 | return editorState instanceof EditorState 14 | } 15 | 16 | export const createEmptyEditorState = (editorDecorators) => { 17 | return EditorState.createEmpty(editorDecorators) 18 | } 19 | 20 | export const createEditorState = (contentState, editorDecorators) => { 21 | return EditorState.createWithContent(contentState, editorDecorators) 22 | } 23 | 24 | export const isSelectionCollapsed = (editorState) => { 25 | return editorState.getSelection().isCollapsed() 26 | } 27 | 28 | export const selectionContainsBlockType = (editorState, blockType) => { 29 | return getSelectedBlocks(editorState).find(block => block.getType() === blockType) 30 | } 31 | 32 | export const selectionContainsStrictBlock = (editorState) => { 33 | return getSelectedBlocks(editorState).find(block => ~strictBlockTypes.indexOf(block.getType())) 34 | } 35 | 36 | export const selectBlock = (editorState, block) => { 37 | 38 | const blockKey = block.getKey() 39 | 40 | return EditorState.forceSelection(editorState, new SelectionState({ 41 | anchorKey: blockKey, 42 | anchorOffset: 0, 43 | focusKey: blockKey, 44 | focusOffset: block.getLength() 45 | })) 46 | 47 | } 48 | 49 | export const selectNextBlock = (editorState, block) => { 50 | const nextBlock = editorState.getCurrentContent().getBlockAfter(block.getKey()) 51 | return nextBlock ? selectBlock(editorState, nextBlock) : editorState 52 | } 53 | 54 | export const removeBlock = (editorState, block, lastSelection = null) => { 55 | 56 | let nextContentState, nextEditorState 57 | const blockKey = block.getKey() 58 | 59 | nextContentState = Modifier.removeRange(editorState.getCurrentContent(), new SelectionState({ 60 | anchorKey: blockKey, 61 | anchorOffset: 0, 62 | focusKey: blockKey, 63 | focusOffset: block.getLength() 64 | }), 'backward') 65 | 66 | nextContentState = Modifier.setBlockType(nextContentState, nextContentState.getSelectionAfter(), 'unstyled') 67 | nextEditorState = EditorState.push(editorState, nextContentState, 'remove-range') 68 | return EditorState.forceSelection(nextEditorState, lastSelection || nextContentState.getSelectionAfter()) 69 | 70 | } 71 | 72 | export const getSelectionBlock = (editorState) => { 73 | return editorState.getCurrentContent().getBlockForKey(editorState.getSelection().getAnchorKey()) 74 | } 75 | 76 | export const updateEachCharacterOfSelection = (editorState, callback) => { 77 | 78 | const selectionState = editorState.getSelection() 79 | const contentState = editorState.getCurrentContent() 80 | const contentBlocks = contentState.getBlockMap() 81 | const selectedBlocks = getSelectedBlocks(editorState) 82 | 83 | if (selectedBlocks.length === 0) { 84 | return editorState 85 | } 86 | 87 | const startKey = selectionState.getStartKey() 88 | const startOffset = selectionState.getStartOffset() 89 | const endKey = selectionState.getEndKey() 90 | const endOffset = selectionState.getEndOffset() 91 | 92 | const nextContentBlocks = contentBlocks.map((block) => { 93 | 94 | if (selectedBlocks.indexOf(block) === -1) { 95 | return block 96 | } 97 | 98 | const blockKey = block.getKey() 99 | const charactersList = block.getCharacterList() 100 | let nextCharactersList = null 101 | 102 | if (blockKey === startKey && blockKey === endKey) { 103 | nextCharactersList = charactersList.map((character, index) => { 104 | if (index >= startOffset && index < endOffset) { 105 | return callback(character) 106 | } 107 | return character 108 | }) 109 | } else if (blockKey === startKey) { 110 | nextCharactersList = charactersList.map((character, index) => { 111 | if (index >= startOffset) { 112 | return callback(character) 113 | } 114 | return character 115 | }) 116 | } else if (blockKey === endKey) { 117 | nextCharactersList = charactersList.map((character, index) => { 118 | if (index < endOffset) { 119 | return callback(character) 120 | } 121 | return character 122 | }) 123 | } else { 124 | nextCharactersList = charactersList.map((character) => { 125 | return callback(character) 126 | }) 127 | } 128 | 129 | return block.merge({ 130 | 'characterList': nextCharactersList 131 | }) 132 | 133 | }) 134 | 135 | return EditorState.push(editorState, contentState.merge({ 136 | blockMap: nextContentBlocks, 137 | selectionBefore: selectionState, 138 | selectionAfter: selectionState 139 | }), 'update-selection-character-list') 140 | 141 | } 142 | 143 | export const getSelectedBlocks = (editorState) => { 144 | 145 | const selectionState = editorState.getSelection() 146 | const contentState = editorState.getCurrentContent() 147 | 148 | const startKey = selectionState.getStartKey() 149 | const endKey = selectionState.getEndKey() 150 | const isSameBlock = startKey === endKey 151 | const startingBlock = contentState.getBlockForKey(startKey) 152 | const selectedBlocks = [startingBlock] 153 | 154 | if (!isSameBlock) { 155 | let blockKey = startKey 156 | 157 | while (blockKey !== endKey) { 158 | const nextBlock = contentState.getBlockAfter(blockKey) 159 | selectedBlocks.push(nextBlock) 160 | blockKey = nextBlock.getKey() 161 | } 162 | } 163 | 164 | return selectedBlocks 165 | 166 | } 167 | 168 | export const setSelectionBlockData = (editorState, blockData, override) => { 169 | 170 | let newBlockData = override ? blockData : Object.assign({}, getSelectionBlockData(editorState).toJS(), blockData) 171 | 172 | Object.keys(newBlockData).forEach(key => { 173 | if (newBlockData.hasOwnProperty(key) && newBlockData[key] === undefined) { 174 | delete newBlockData[key] 175 | } 176 | }) 177 | 178 | return setBlockData(editorState, newBlockData) 179 | 180 | } 181 | 182 | export const getSelectionBlockData = (editorState, name) => { 183 | const blockData = getSelectionBlock(editorState).getData() 184 | return name ? blockData.get(name) : blockData 185 | } 186 | 187 | export const getSelectionBlockType = (editorState) => { 188 | return getSelectionBlock(editorState).getType() 189 | } 190 | 191 | export const getSelectionText = (editorState) => { 192 | 193 | const selectionState = editorState.getSelection() 194 | const contentState = editorState.getCurrentContent() 195 | 196 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 197 | return '' 198 | } 199 | 200 | const anchorKey = selectionState.getAnchorKey() 201 | const currentContentBlock = contentState.getBlockForKey(anchorKey) 202 | const start = selectionState.getStartOffset() 203 | const end = selectionState.getEndOffset() 204 | 205 | return currentContentBlock.getText().slice(start, end) 206 | 207 | } 208 | 209 | export const toggleSelectionBlockType = (editorState, blockType) => { 210 | 211 | if (selectionContainsStrictBlock(editorState)) { 212 | return editorState 213 | } 214 | 215 | return RichUtils.toggleBlockType(editorState, blockType) 216 | 217 | } 218 | 219 | export const getSelectionEntityType = (editorState) => { 220 | 221 | const entityKey = getSelectionEntity(editorState) 222 | 223 | if (entityKey) { 224 | const entity = editorState.getCurrentContent().getEntity(entityKey) 225 | return entity ? entity.get('type') : null 226 | } 227 | 228 | return null 229 | 230 | } 231 | 232 | export const getSelectionEntityData = (editorState, type) => { 233 | 234 | const entityKey = getSelectionEntity(editorState) 235 | 236 | if (entityKey) { 237 | const entity = editorState.getCurrentContent().getEntity(entityKey) 238 | if (entity && entity.get('type') === type) { 239 | return entity.getData() 240 | } else { 241 | return {} 242 | } 243 | } else { 244 | return {} 245 | } 246 | 247 | } 248 | 249 | export const toggleSelectionEntity = (editorState, entity) => { 250 | 251 | const contentState = editorState.getCurrentContent() 252 | const selectionState = editorState.getSelection() 253 | 254 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 255 | return editorState 256 | } 257 | 258 | if (!entity || !entity.type || getSelectionEntityType(editorState) === entity.type) { 259 | return EditorState.push(editorState, Modifier.applyEntity(contentState, selectionState, null), 'apply-entity') 260 | } 261 | 262 | try { 263 | 264 | const nextContentState = contentState.createEntity(entity.type, entity.mutability, entity.data) 265 | const entityKey = nextContentState.getLastCreatedEntityKey() 266 | 267 | let nextEditorState = EditorState.set(editorState, { 268 | currentContent: nextContentState 269 | }) 270 | 271 | return EditorState.push(nextEditorState, Modifier.applyEntity(nextContentState, selectionState, entityKey), 'apply-entity') 272 | 273 | } catch (error) { 274 | console.warn(error) 275 | return editorState 276 | } 277 | 278 | } 279 | 280 | export const toggleSelectionLink = (editorState, href, target) => { 281 | 282 | const contentState = editorState.getCurrentContent() 283 | const selectionState = editorState.getSelection() 284 | 285 | let entityData = { href, target } 286 | 287 | if (selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 288 | return editorState 289 | } 290 | 291 | if (href === false) { 292 | return RichUtils.toggleLink(editorState, selectionState, null) 293 | } 294 | 295 | if (href === null) { 296 | delete entityData.href 297 | } 298 | 299 | try { 300 | 301 | const nextContentState = contentState.createEntity('LINK', 'MUTABLE', entityData) 302 | const entityKey = nextContentState.getLastCreatedEntityKey() 303 | 304 | let nextEditorState = EditorState.set(editorState, { 305 | currentContent: nextContentState 306 | }) 307 | 308 | nextEditorState = RichUtils.toggleLink(nextEditorState, selectionState, entityKey) 309 | nextEditorState = EditorState.forceSelection(nextEditorState, selectionState.merge({ 310 | anchorOffset: selectionState.getEndOffset(), 311 | focusOffset: selectionState.getEndOffset() 312 | })) 313 | 314 | nextEditorState = EditorState.push(nextEditorState, Modifier.insertText( 315 | nextEditorState.getCurrentContent(), nextEditorState.getSelection(), '' 316 | ), 'insert-text') 317 | 318 | return nextEditorState 319 | 320 | } catch (error) { 321 | console.warn(error) 322 | return editorState 323 | } 324 | 325 | } 326 | 327 | export const getSelectionInlineStyle = (editorState) => { 328 | return editorState.getCurrentInlineStyle() 329 | } 330 | 331 | export const selectionHasInlineStyle = (editorState, style) => { 332 | return getSelectionInlineStyle(editorState).has(style.toUpperCase()) 333 | } 334 | 335 | export const toggleSelectionInlineStyle = (editorState, style, prefix = '') => { 336 | 337 | let nextEditorState = editorState 338 | style = prefix + style.toUpperCase() 339 | 340 | if (prefix) { 341 | 342 | nextEditorState = updateEachCharacterOfSelection(nextEditorState, (characterMetadata) => { 343 | 344 | return characterMetadata.toJS().style.reduce((characterMetadata, characterStyle) => { 345 | if (characterStyle.indexOf(prefix) === 0 && style !== characterStyle) { 346 | return CharacterMetadata.removeStyle(characterMetadata, characterStyle) 347 | } else { 348 | return characterMetadata 349 | } 350 | }, characterMetadata) 351 | 352 | }) 353 | 354 | } 355 | 356 | return RichUtils.toggleInlineStyle(nextEditorState, style) 357 | 358 | } 359 | 360 | export const removeSelectionInlineStyles = (editorState) => { 361 | 362 | return updateEachCharacterOfSelection(editorState, (characterMetadata) => { 363 | return characterMetadata.merge({ 364 | style: Immutable.OrderedSet([]) 365 | }) 366 | }) 367 | 368 | } 369 | 370 | export const toggleSelectionAlignment = (editorState, alignment) => { 371 | return setSelectionBlockData(editorState, { 372 | textAlign: getSelectionBlockData(editorState, 'textAlign') !== alignment ? alignment : undefined 373 | }) 374 | } 375 | 376 | export const toggleSelectionIndent = (editorState, textIndent, maxIndent = 6) => { 377 | return textIndent < 0 || textIndent > maxIndent || isNaN(textIndent) ? editorState : setSelectionBlockData(editorState, { 378 | textIndent: textIndent || undefined 379 | }) 380 | } 381 | 382 | export const increaseSelectionIndent = (editorState, maxIndent = 6) => { 383 | const currentIndent = getSelectionBlockData(editorState, 'textIndent') || 0 384 | return toggleSelectionIndent(editorState, currentIndent + 1, maxIndent) 385 | } 386 | 387 | export const decreaseSelectionIndent = (editorState, maxIndent) => { 388 | const currentIndent = getSelectionBlockData(editorState, 'textIndent') || 0 389 | return toggleSelectionIndent(editorState, currentIndent - 1, maxIndent) 390 | } 391 | 392 | export const toggleSelectionColor = (editorState, color) => { 393 | return toggleSelectionInlineStyle(editorState, color.replace('#', ''), 'COLOR-') 394 | } 395 | 396 | export const toggleSelectionBackgroundColor = (editorState, color) => { 397 | return toggleSelectionInlineStyle(editorState, color.replace('#', ''), 'BGCOLOR-') 398 | } 399 | 400 | export const toggleSelectionFontSize = (editorState, fontSize) => { 401 | return toggleSelectionInlineStyle(editorState, fontSize, 'FONTSIZE-') 402 | } 403 | 404 | export const toggleSelectionLineHeight = (editorState, lineHeight) => { 405 | return toggleSelectionInlineStyle(editorState, lineHeight, 'LINEHEIGHT-') 406 | } 407 | 408 | export const toggleSelectionFontFamily = (editorState, fontFamily) => { 409 | return toggleSelectionInlineStyle(editorState, fontFamily, 'FONTFAMILY-') 410 | } 411 | 412 | export const toggleSelectionLetterSpacing = (editorState, letterSpacing) => { 413 | return toggleSelectionInlineStyle(editorState, letterSpacing, 'LETTERSPACING-') 414 | } 415 | 416 | export const insertText = (editorState, text, inlineStyle, entity) => { 417 | 418 | const selectionState = editorState.getSelection() 419 | const currentSelectedBlockType = getSelectionBlockType(editorState) 420 | 421 | if (currentSelectedBlockType === 'atomic') { 422 | return editorState 423 | } 424 | 425 | let entityKey 426 | let contentState = editorState.getCurrentContent() 427 | 428 | if (entity && entity.type) { 429 | contentState = contentState.createEntity(entity.type, entity.mutability || 'MUTABLE', entity.data || entityData) 430 | entityKey = contentState.getLastCreatedEntityKey() 431 | } 432 | 433 | if (!selectionState.isCollapsed()) { 434 | return EditorState.push(editorState, Modifier.replaceText(contentState, selectionState, text, inlineStyle, entityKey), 'replace-text') 435 | } else { 436 | return EditorState.push(editorState, Modifier.insertText(contentState, selectionState, text, inlineStyle, entityKey), 'insert-text') 437 | } 438 | 439 | } 440 | 441 | export const insertHTML = (editorState, htmlString, source) => { 442 | 443 | if (!htmlString) { 444 | return editorState 445 | } 446 | 447 | const selectionState = editorState.getSelection() 448 | const contentState = editorState.getCurrentContent() 449 | const options = editorState.convertOptions || {} 450 | 451 | try { 452 | 453 | const { blockMap } = convertFromRaw(convertHTMLToRaw(htmlString, options, source)) 454 | 455 | return EditorState.push(editorState, Modifier.replaceWithFragment( 456 | contentState, selectionState, blockMap 457 | ), 'insert-fragment') 458 | 459 | } catch (error) { 460 | console.warn(error) 461 | return editorState 462 | } 463 | 464 | } 465 | 466 | export const insertAtomicBlock = (editorState, type, immutable = true, data = {}) => { 467 | 468 | if (selectionContainsStrictBlock(editorState)) { 469 | return insertAtomicBlock(selectNextBlock(editorState, getSelectionBlock(editorState)), type, immutable, data) 470 | } 471 | 472 | const selectionState = editorState.getSelection() 473 | const contentState = editorState.getCurrentContent() 474 | 475 | if (!selectionState.isCollapsed() || getSelectionBlockType(editorState) === 'atomic') { 476 | return editorState 477 | } 478 | 479 | const contentStateWithEntity = contentState.createEntity(type, immutable ? 'IMMUTABLE' : 'MUTABLE', data) 480 | const entityKey = contentStateWithEntity.getLastCreatedEntityKey() 481 | const newEditorState = AtomicBlockUtils.insertAtomicBlock(editorState, entityKey, ' ') 482 | 483 | return newEditorState 484 | 485 | } 486 | 487 | export const insertHorizontalLine = (editorState) => { 488 | return insertAtomicBlock(editorState, 'HR') 489 | } 490 | 491 | export const insertMedias = (editorState, medias = []) => { 492 | 493 | if (!medias.length) { 494 | return editorState 495 | } 496 | 497 | return medias.reduce((editorState, media) => { 498 | const { url, link, link_target, name, type, width, height, meta } = media 499 | return insertAtomicBlock(editorState, type, true, { url, link, link_target, name, type, width, height, meta }) 500 | }, editorState) 501 | 502 | } 503 | 504 | export const setMediaData = (editorState, entityKey, data) => { 505 | return EditorState.push(editorState, editorState.getCurrentContent().mergeEntityData(entityKey, data), 'change-block-data') 506 | } 507 | 508 | export const removeMedia = (editorState, mediaBlock) => { 509 | return removeBlock(editorState, mediaBlock) 510 | } 511 | 512 | export const setMediaPosition = (editorState, mediaBlock, position) => { 513 | 514 | let newPosition = {} 515 | const { float, alignment } = position 516 | 517 | if (typeof float !== 'undefined') { 518 | newPosition.float = mediaBlock.getData().get('float') === float ? null : float 519 | } 520 | 521 | if (typeof alignment !== 'undefined') { 522 | newPosition.alignment = mediaBlock.getData().get('alignment') === alignment ? null : alignment 523 | } 524 | 525 | return setSelectionBlockData(selectBlock(editorState, mediaBlock), newPosition) 526 | 527 | } 528 | 529 | export const clear = (editorState) => { 530 | 531 | const contentState = editorState.getCurrentContent() 532 | 533 | const firstBlock = contentState.getFirstBlock() 534 | const lastBlock = contentState.getLastBlock() 535 | 536 | const allSelected = new SelectionState({ 537 | anchorKey: firstBlock.getKey(), 538 | anchorOffset: 0, 539 | focusKey: lastBlock.getKey(), 540 | focusOffset: lastBlock.getLength(), 541 | hasFocus: true 542 | }) 543 | 544 | return RichUtils.toggleBlockType(EditorState.push( 545 | editorState, 546 | Modifier.removeRange(contentState, allSelected, 'backward'), 547 | 'remove-range' 548 | ), 'unstyled') 549 | 550 | } 551 | 552 | export const handleKeyCommand = (editorState, command) => { 553 | return RichUtils.handleKeyCommand(editorState, command) 554 | } 555 | 556 | export const undo = (editorState) => { 557 | return EditorState.undo(editorState) 558 | } 559 | 560 | export const redo = (editorState) => { 561 | return EditorState.redo(editorState) 562 | } 563 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import * as _ContentUtils from './content' 2 | import * as _BaseUtils from './base' 3 | import * as _ColorUtils from './color' 4 | 5 | export const ContentUtils = _ContentUtils 6 | export const BaseUtils = _BaseUtils 7 | export const ColorUtils = _ColorUtils -------------------------------------------------------------------------------- /tea.yaml: -------------------------------------------------------------------------------- 1 | # https://tea.xyz/what-is-this-file 2 | --- 3 | version: 1.0.0 4 | codeOwners: 5 | - '0x9902a27e0697ECbE1D0b233F716AE56469B5F0d9' 6 | quorum: 1 7 | -------------------------------------------------------------------------------- /yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | abbrev@1: 6 | version "1.1.1" 7 | resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" 8 | 9 | ansi-regex@^2.0.0: 10 | version "2.1.1" 11 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" 12 | 13 | ansi-regex@^3.0.0: 14 | version "3.0.0" 15 | resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" 16 | 17 | ansi-styles@^2.2.1: 18 | version "2.2.1" 19 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" 20 | 21 | anymatch@^1.3.0: 22 | version "1.3.2" 23 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" 24 | dependencies: 25 | micromatch "^2.1.5" 26 | normalize-path "^2.0.0" 27 | 28 | aproba@^1.0.3: 29 | version "1.2.0" 30 | resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" 31 | 32 | are-we-there-yet@~1.1.2: 33 | version "1.1.5" 34 | resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" 35 | dependencies: 36 | delegates "^1.0.0" 37 | readable-stream "^2.0.6" 38 | 39 | arr-diff@^2.0.0: 40 | version "2.0.0" 41 | resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" 42 | dependencies: 43 | arr-flatten "^1.0.1" 44 | 45 | arr-flatten@^1.0.1: 46 | version "1.1.0" 47 | resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" 48 | 49 | array-unique@^0.2.1: 50 | version "0.2.1" 51 | resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" 52 | 53 | async-each@^1.0.0: 54 | version "1.0.1" 55 | resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" 56 | 57 | babel-cli@^6.26.0: 58 | version "6.26.0" 59 | resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" 60 | dependencies: 61 | babel-core "^6.26.0" 62 | babel-polyfill "^6.26.0" 63 | babel-register "^6.26.0" 64 | babel-runtime "^6.26.0" 65 | commander "^2.11.0" 66 | convert-source-map "^1.5.0" 67 | fs-readdir-recursive "^1.0.0" 68 | glob "^7.1.2" 69 | lodash "^4.17.4" 70 | output-file-sync "^1.1.2" 71 | path-is-absolute "^1.0.1" 72 | slash "^1.0.0" 73 | source-map "^0.5.6" 74 | v8flags "^2.1.1" 75 | optionalDependencies: 76 | chokidar "^1.6.1" 77 | 78 | babel-code-frame@^6.26.0: 79 | version "6.26.0" 80 | resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" 81 | dependencies: 82 | chalk "^1.1.3" 83 | esutils "^2.0.2" 84 | js-tokens "^3.0.2" 85 | 86 | babel-core@^6.26.0, babel-core@^6.26.3: 87 | version "6.26.3" 88 | resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" 89 | dependencies: 90 | babel-code-frame "^6.26.0" 91 | babel-generator "^6.26.0" 92 | babel-helpers "^6.24.1" 93 | babel-messages "^6.23.0" 94 | babel-register "^6.26.0" 95 | babel-runtime "^6.26.0" 96 | babel-template "^6.26.0" 97 | babel-traverse "^6.26.0" 98 | babel-types "^6.26.0" 99 | babylon "^6.18.0" 100 | convert-source-map "^1.5.1" 101 | debug "^2.6.9" 102 | json5 "^0.5.1" 103 | lodash "^4.17.4" 104 | minimatch "^3.0.4" 105 | path-is-absolute "^1.0.1" 106 | private "^0.1.8" 107 | slash "^1.0.0" 108 | source-map "^0.5.7" 109 | 110 | babel-generator@^6.26.0: 111 | version "6.26.1" 112 | resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" 113 | dependencies: 114 | babel-messages "^6.23.0" 115 | babel-runtime "^6.26.0" 116 | babel-types "^6.26.0" 117 | detect-indent "^4.0.0" 118 | jsesc "^1.3.0" 119 | lodash "^4.17.4" 120 | source-map "^0.5.7" 121 | trim-right "^1.0.1" 122 | 123 | babel-helper-call-delegate@^6.24.1: 124 | version "6.24.1" 125 | resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" 126 | dependencies: 127 | babel-helper-hoist-variables "^6.24.1" 128 | babel-runtime "^6.22.0" 129 | babel-traverse "^6.24.1" 130 | babel-types "^6.24.1" 131 | 132 | babel-helper-define-map@^6.24.1: 133 | version "6.26.0" 134 | resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" 135 | dependencies: 136 | babel-helper-function-name "^6.24.1" 137 | babel-runtime "^6.26.0" 138 | babel-types "^6.26.0" 139 | lodash "^4.17.4" 140 | 141 | babel-helper-function-name@^6.24.1: 142 | version "6.24.1" 143 | resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" 144 | dependencies: 145 | babel-helper-get-function-arity "^6.24.1" 146 | babel-runtime "^6.22.0" 147 | babel-template "^6.24.1" 148 | babel-traverse "^6.24.1" 149 | babel-types "^6.24.1" 150 | 151 | babel-helper-get-function-arity@^6.24.1: 152 | version "6.24.1" 153 | resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" 154 | dependencies: 155 | babel-runtime "^6.22.0" 156 | babel-types "^6.24.1" 157 | 158 | babel-helper-hoist-variables@^6.24.1: 159 | version "6.24.1" 160 | resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" 161 | dependencies: 162 | babel-runtime "^6.22.0" 163 | babel-types "^6.24.1" 164 | 165 | babel-helper-optimise-call-expression@^6.24.1: 166 | version "6.24.1" 167 | resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" 168 | dependencies: 169 | babel-runtime "^6.22.0" 170 | babel-types "^6.24.1" 171 | 172 | babel-helper-regex@^6.24.1: 173 | version "6.26.0" 174 | resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" 175 | dependencies: 176 | babel-runtime "^6.26.0" 177 | babel-types "^6.26.0" 178 | lodash "^4.17.4" 179 | 180 | babel-helper-replace-supers@^6.24.1: 181 | version "6.24.1" 182 | resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" 183 | dependencies: 184 | babel-helper-optimise-call-expression "^6.24.1" 185 | babel-messages "^6.23.0" 186 | babel-runtime "^6.22.0" 187 | babel-template "^6.24.1" 188 | babel-traverse "^6.24.1" 189 | babel-types "^6.24.1" 190 | 191 | babel-helpers@^6.24.1: 192 | version "6.24.1" 193 | resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" 194 | dependencies: 195 | babel-runtime "^6.22.0" 196 | babel-template "^6.24.1" 197 | 198 | babel-messages@^6.23.0: 199 | version "6.23.0" 200 | resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" 201 | dependencies: 202 | babel-runtime "^6.22.0" 203 | 204 | babel-plugin-check-es2015-constants@^6.22.0: 205 | version "6.22.0" 206 | resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" 207 | dependencies: 208 | babel-runtime "^6.22.0" 209 | 210 | babel-plugin-transform-es2015-arrow-functions@^6.22.0: 211 | version "6.22.0" 212 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" 213 | dependencies: 214 | babel-runtime "^6.22.0" 215 | 216 | babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: 217 | version "6.22.0" 218 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" 219 | dependencies: 220 | babel-runtime "^6.22.0" 221 | 222 | babel-plugin-transform-es2015-block-scoping@^6.24.1: 223 | version "6.26.0" 224 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" 225 | dependencies: 226 | babel-runtime "^6.26.0" 227 | babel-template "^6.26.0" 228 | babel-traverse "^6.26.0" 229 | babel-types "^6.26.0" 230 | lodash "^4.17.4" 231 | 232 | babel-plugin-transform-es2015-classes@^6.24.1: 233 | version "6.24.1" 234 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" 235 | dependencies: 236 | babel-helper-define-map "^6.24.1" 237 | babel-helper-function-name "^6.24.1" 238 | babel-helper-optimise-call-expression "^6.24.1" 239 | babel-helper-replace-supers "^6.24.1" 240 | babel-messages "^6.23.0" 241 | babel-runtime "^6.22.0" 242 | babel-template "^6.24.1" 243 | babel-traverse "^6.24.1" 244 | babel-types "^6.24.1" 245 | 246 | babel-plugin-transform-es2015-computed-properties@^6.24.1: 247 | version "6.24.1" 248 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" 249 | dependencies: 250 | babel-runtime "^6.22.0" 251 | babel-template "^6.24.1" 252 | 253 | babel-plugin-transform-es2015-destructuring@^6.22.0: 254 | version "6.23.0" 255 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" 256 | dependencies: 257 | babel-runtime "^6.22.0" 258 | 259 | babel-plugin-transform-es2015-duplicate-keys@^6.24.1: 260 | version "6.24.1" 261 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" 262 | dependencies: 263 | babel-runtime "^6.22.0" 264 | babel-types "^6.24.1" 265 | 266 | babel-plugin-transform-es2015-for-of@^6.22.0: 267 | version "6.23.0" 268 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" 269 | dependencies: 270 | babel-runtime "^6.22.0" 271 | 272 | babel-plugin-transform-es2015-function-name@^6.24.1: 273 | version "6.24.1" 274 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" 275 | dependencies: 276 | babel-helper-function-name "^6.24.1" 277 | babel-runtime "^6.22.0" 278 | babel-types "^6.24.1" 279 | 280 | babel-plugin-transform-es2015-literals@^6.22.0: 281 | version "6.22.0" 282 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" 283 | dependencies: 284 | babel-runtime "^6.22.0" 285 | 286 | babel-plugin-transform-es2015-modules-amd@^6.24.1: 287 | version "6.24.1" 288 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" 289 | dependencies: 290 | babel-plugin-transform-es2015-modules-commonjs "^6.24.1" 291 | babel-runtime "^6.22.0" 292 | babel-template "^6.24.1" 293 | 294 | babel-plugin-transform-es2015-modules-commonjs@^6.24.1: 295 | version "6.26.2" 296 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz#58a793863a9e7ca870bdc5a881117ffac27db6f3" 297 | dependencies: 298 | babel-plugin-transform-strict-mode "^6.24.1" 299 | babel-runtime "^6.26.0" 300 | babel-template "^6.26.0" 301 | babel-types "^6.26.0" 302 | 303 | babel-plugin-transform-es2015-modules-systemjs@^6.24.1: 304 | version "6.24.1" 305 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" 306 | dependencies: 307 | babel-helper-hoist-variables "^6.24.1" 308 | babel-runtime "^6.22.0" 309 | babel-template "^6.24.1" 310 | 311 | babel-plugin-transform-es2015-modules-umd@^6.24.1: 312 | version "6.24.1" 313 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" 314 | dependencies: 315 | babel-plugin-transform-es2015-modules-amd "^6.24.1" 316 | babel-runtime "^6.22.0" 317 | babel-template "^6.24.1" 318 | 319 | babel-plugin-transform-es2015-object-super@^6.24.1: 320 | version "6.24.1" 321 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" 322 | dependencies: 323 | babel-helper-replace-supers "^6.24.1" 324 | babel-runtime "^6.22.0" 325 | 326 | babel-plugin-transform-es2015-parameters@^6.24.1: 327 | version "6.24.1" 328 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" 329 | dependencies: 330 | babel-helper-call-delegate "^6.24.1" 331 | babel-helper-get-function-arity "^6.24.1" 332 | babel-runtime "^6.22.0" 333 | babel-template "^6.24.1" 334 | babel-traverse "^6.24.1" 335 | babel-types "^6.24.1" 336 | 337 | babel-plugin-transform-es2015-shorthand-properties@^6.24.1: 338 | version "6.24.1" 339 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" 340 | dependencies: 341 | babel-runtime "^6.22.0" 342 | babel-types "^6.24.1" 343 | 344 | babel-plugin-transform-es2015-spread@^6.22.0: 345 | version "6.22.0" 346 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" 347 | dependencies: 348 | babel-runtime "^6.22.0" 349 | 350 | babel-plugin-transform-es2015-sticky-regex@^6.24.1: 351 | version "6.24.1" 352 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" 353 | dependencies: 354 | babel-helper-regex "^6.24.1" 355 | babel-runtime "^6.22.0" 356 | babel-types "^6.24.1" 357 | 358 | babel-plugin-transform-es2015-template-literals@^6.22.0: 359 | version "6.22.0" 360 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" 361 | dependencies: 362 | babel-runtime "^6.22.0" 363 | 364 | babel-plugin-transform-es2015-typeof-symbol@^6.22.0: 365 | version "6.23.0" 366 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" 367 | dependencies: 368 | babel-runtime "^6.22.0" 369 | 370 | babel-plugin-transform-es2015-unicode-regex@^6.24.1: 371 | version "6.24.1" 372 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" 373 | dependencies: 374 | babel-helper-regex "^6.24.1" 375 | babel-runtime "^6.22.0" 376 | regexpu-core "^2.0.0" 377 | 378 | babel-plugin-transform-regenerator@^6.24.1: 379 | version "6.26.0" 380 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" 381 | dependencies: 382 | regenerator-transform "^0.10.0" 383 | 384 | babel-plugin-transform-strict-mode@^6.24.1: 385 | version "6.24.1" 386 | resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" 387 | dependencies: 388 | babel-runtime "^6.22.0" 389 | babel-types "^6.24.1" 390 | 391 | babel-polyfill@^6.26.0: 392 | version "6.26.0" 393 | resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" 394 | dependencies: 395 | babel-runtime "^6.26.0" 396 | core-js "^2.5.0" 397 | regenerator-runtime "^0.10.5" 398 | 399 | babel-preset-es2015@^6.24.1: 400 | version "6.24.1" 401 | resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" 402 | dependencies: 403 | babel-plugin-check-es2015-constants "^6.22.0" 404 | babel-plugin-transform-es2015-arrow-functions "^6.22.0" 405 | babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" 406 | babel-plugin-transform-es2015-block-scoping "^6.24.1" 407 | babel-plugin-transform-es2015-classes "^6.24.1" 408 | babel-plugin-transform-es2015-computed-properties "^6.24.1" 409 | babel-plugin-transform-es2015-destructuring "^6.22.0" 410 | babel-plugin-transform-es2015-duplicate-keys "^6.24.1" 411 | babel-plugin-transform-es2015-for-of "^6.22.0" 412 | babel-plugin-transform-es2015-function-name "^6.24.1" 413 | babel-plugin-transform-es2015-literals "^6.22.0" 414 | babel-plugin-transform-es2015-modules-amd "^6.24.1" 415 | babel-plugin-transform-es2015-modules-commonjs "^6.24.1" 416 | babel-plugin-transform-es2015-modules-systemjs "^6.24.1" 417 | babel-plugin-transform-es2015-modules-umd "^6.24.1" 418 | babel-plugin-transform-es2015-object-super "^6.24.1" 419 | babel-plugin-transform-es2015-parameters "^6.24.1" 420 | babel-plugin-transform-es2015-shorthand-properties "^6.24.1" 421 | babel-plugin-transform-es2015-spread "^6.22.0" 422 | babel-plugin-transform-es2015-sticky-regex "^6.24.1" 423 | babel-plugin-transform-es2015-template-literals "^6.22.0" 424 | babel-plugin-transform-es2015-typeof-symbol "^6.22.0" 425 | babel-plugin-transform-es2015-unicode-regex "^6.24.1" 426 | babel-plugin-transform-regenerator "^6.24.1" 427 | 428 | babel-register@^6.26.0: 429 | version "6.26.0" 430 | resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" 431 | dependencies: 432 | babel-core "^6.26.0" 433 | babel-runtime "^6.26.0" 434 | core-js "^2.5.0" 435 | home-or-tmp "^2.0.0" 436 | lodash "^4.17.4" 437 | mkdirp "^0.5.1" 438 | source-map-support "^0.4.15" 439 | 440 | babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: 441 | version "6.26.0" 442 | resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" 443 | dependencies: 444 | core-js "^2.4.0" 445 | regenerator-runtime "^0.11.0" 446 | 447 | babel-template@^6.24.1, babel-template@^6.26.0: 448 | version "6.26.0" 449 | resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" 450 | dependencies: 451 | babel-runtime "^6.26.0" 452 | babel-traverse "^6.26.0" 453 | babel-types "^6.26.0" 454 | babylon "^6.18.0" 455 | lodash "^4.17.4" 456 | 457 | babel-traverse@^6.24.1, babel-traverse@^6.26.0: 458 | version "6.26.0" 459 | resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" 460 | dependencies: 461 | babel-code-frame "^6.26.0" 462 | babel-messages "^6.23.0" 463 | babel-runtime "^6.26.0" 464 | babel-types "^6.26.0" 465 | babylon "^6.18.0" 466 | debug "^2.6.8" 467 | globals "^9.18.0" 468 | invariant "^2.2.2" 469 | lodash "^4.17.4" 470 | 471 | babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: 472 | version "6.26.0" 473 | resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" 474 | dependencies: 475 | babel-runtime "^6.26.0" 476 | esutils "^2.0.2" 477 | lodash "^4.17.4" 478 | to-fast-properties "^1.0.3" 479 | 480 | babylon@^6.18.0: 481 | version "6.18.0" 482 | resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" 483 | 484 | balanced-match@^1.0.0: 485 | version "1.0.0" 486 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 487 | 488 | binary-extensions@^1.0.0: 489 | version "1.11.0" 490 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.11.0.tgz#46aa1751fb6a2f93ee5e689bb1087d4b14c6c205" 491 | 492 | brace-expansion@^1.1.7: 493 | version "1.1.11" 494 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 495 | dependencies: 496 | balanced-match "^1.0.0" 497 | concat-map "0.0.1" 498 | 499 | braces@^1.8.2: 500 | version "1.8.5" 501 | resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" 502 | dependencies: 503 | expand-range "^1.8.1" 504 | preserve "^0.2.0" 505 | repeat-element "^1.1.2" 506 | 507 | chalk@^1.1.3: 508 | version "1.1.3" 509 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" 510 | dependencies: 511 | ansi-styles "^2.2.1" 512 | escape-string-regexp "^1.0.2" 513 | has-ansi "^2.0.0" 514 | strip-ansi "^3.0.0" 515 | supports-color "^2.0.0" 516 | 517 | chokidar@^1.6.1: 518 | version "1.7.0" 519 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" 520 | dependencies: 521 | anymatch "^1.3.0" 522 | async-each "^1.0.0" 523 | glob-parent "^2.0.0" 524 | inherits "^2.0.1" 525 | is-binary-path "^1.0.0" 526 | is-glob "^2.0.0" 527 | path-is-absolute "^1.0.0" 528 | readdirp "^2.0.0" 529 | optionalDependencies: 530 | fsevents "^1.0.0" 531 | 532 | chownr@^1.0.1: 533 | version "1.0.1" 534 | resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" 535 | 536 | code-point-at@^1.0.0: 537 | version "1.1.0" 538 | resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" 539 | 540 | commander@^2.11.0: 541 | version "2.15.1" 542 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f" 543 | 544 | concat-map@0.0.1: 545 | version "0.0.1" 546 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 547 | 548 | console-control-strings@^1.0.0, console-control-strings@~1.1.0: 549 | version "1.1.0" 550 | resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" 551 | 552 | convert-source-map@^1.5.0, convert-source-map@^1.5.1: 553 | version "1.5.1" 554 | resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" 555 | 556 | core-js@^2.4.0, core-js@^2.5.0: 557 | version "2.5.7" 558 | resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" 559 | 560 | core-util-is@~1.0.0: 561 | version "1.0.2" 562 | resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" 563 | 564 | debug@^2.1.2, debug@^2.6.8, debug@^2.6.9: 565 | version "2.6.9" 566 | resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" 567 | dependencies: 568 | ms "2.0.0" 569 | 570 | deep-extend@^0.6.0: 571 | version "0.6.0" 572 | resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" 573 | 574 | delegates@^1.0.0: 575 | version "1.0.0" 576 | resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" 577 | 578 | detect-indent@^4.0.0: 579 | version "4.0.0" 580 | resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" 581 | dependencies: 582 | repeating "^2.0.0" 583 | 584 | detect-libc@^1.0.2: 585 | version "1.0.3" 586 | resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" 587 | 588 | escape-string-regexp@^1.0.2: 589 | version "1.0.5" 590 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 591 | 592 | esutils@^2.0.2: 593 | version "2.0.2" 594 | resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" 595 | 596 | expand-brackets@^0.1.4: 597 | version "0.1.5" 598 | resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" 599 | dependencies: 600 | is-posix-bracket "^0.1.0" 601 | 602 | expand-range@^1.8.1: 603 | version "1.8.2" 604 | resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" 605 | dependencies: 606 | fill-range "^2.1.0" 607 | 608 | extglob@^0.3.1: 609 | version "0.3.2" 610 | resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" 611 | dependencies: 612 | is-extglob "^1.0.0" 613 | 614 | filename-regex@^2.0.0: 615 | version "2.0.1" 616 | resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" 617 | 618 | fill-range@^2.1.0: 619 | version "2.2.4" 620 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" 621 | dependencies: 622 | is-number "^2.1.0" 623 | isobject "^2.0.0" 624 | randomatic "^3.0.0" 625 | repeat-element "^1.1.2" 626 | repeat-string "^1.5.2" 627 | 628 | for-in@^1.0.1: 629 | version "1.0.2" 630 | resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" 631 | 632 | for-own@^0.1.4: 633 | version "0.1.5" 634 | resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" 635 | dependencies: 636 | for-in "^1.0.1" 637 | 638 | fs-minipass@^1.2.5: 639 | version "1.2.5" 640 | resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" 641 | dependencies: 642 | minipass "^2.2.1" 643 | 644 | fs-readdir-recursive@^1.0.0: 645 | version "1.1.0" 646 | resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" 647 | 648 | fs.realpath@^1.0.0: 649 | version "1.0.0" 650 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 651 | 652 | fsevents@^1.0.0: 653 | version "1.2.4" 654 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" 655 | dependencies: 656 | nan "^2.9.2" 657 | node-pre-gyp "^0.10.0" 658 | 659 | gauge@~2.7.3: 660 | version "2.7.4" 661 | resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" 662 | dependencies: 663 | aproba "^1.0.3" 664 | console-control-strings "^1.0.0" 665 | has-unicode "^2.0.0" 666 | object-assign "^4.1.0" 667 | signal-exit "^3.0.0" 668 | string-width "^1.0.1" 669 | strip-ansi "^3.0.1" 670 | wide-align "^1.1.0" 671 | 672 | glob-base@^0.3.0: 673 | version "0.3.0" 674 | resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" 675 | dependencies: 676 | glob-parent "^2.0.0" 677 | is-glob "^2.0.0" 678 | 679 | glob-parent@^2.0.0: 680 | version "2.0.0" 681 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" 682 | dependencies: 683 | is-glob "^2.0.0" 684 | 685 | glob@^7.0.5, glob@^7.1.2: 686 | version "7.1.2" 687 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" 688 | dependencies: 689 | fs.realpath "^1.0.0" 690 | inflight "^1.0.4" 691 | inherits "2" 692 | minimatch "^3.0.4" 693 | once "^1.3.0" 694 | path-is-absolute "^1.0.0" 695 | 696 | globals@^9.18.0: 697 | version "9.18.0" 698 | resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" 699 | 700 | graceful-fs@^4.1.2, graceful-fs@^4.1.4: 701 | version "4.1.11" 702 | resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" 703 | 704 | has-ansi@^2.0.0: 705 | version "2.0.0" 706 | resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" 707 | dependencies: 708 | ansi-regex "^2.0.0" 709 | 710 | has-unicode@^2.0.0: 711 | version "2.0.1" 712 | resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" 713 | 714 | home-or-tmp@^2.0.0: 715 | version "2.0.0" 716 | resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" 717 | dependencies: 718 | os-homedir "^1.0.0" 719 | os-tmpdir "^1.0.1" 720 | 721 | iconv-lite@^0.4.4: 722 | version "0.4.23" 723 | resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63" 724 | dependencies: 725 | safer-buffer ">= 2.1.2 < 3" 726 | 727 | ignore-walk@^3.0.1: 728 | version "3.0.1" 729 | resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" 730 | dependencies: 731 | minimatch "^3.0.4" 732 | 733 | inflight@^1.0.4: 734 | version "1.0.6" 735 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 736 | dependencies: 737 | once "^1.3.0" 738 | wrappy "1" 739 | 740 | inherits@2, inherits@^2.0.1, inherits@~2.0.3: 741 | version "2.0.3" 742 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" 743 | 744 | ini@~1.3.0: 745 | version "1.3.5" 746 | resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" 747 | 748 | invariant@^2.2.2: 749 | version "2.2.4" 750 | resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" 751 | dependencies: 752 | loose-envify "^1.0.0" 753 | 754 | is-binary-path@^1.0.0: 755 | version "1.0.1" 756 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" 757 | dependencies: 758 | binary-extensions "^1.0.0" 759 | 760 | is-buffer@^1.1.5: 761 | version "1.1.6" 762 | resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" 763 | 764 | is-dotfile@^1.0.0: 765 | version "1.0.3" 766 | resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" 767 | 768 | is-equal-shallow@^0.1.3: 769 | version "0.1.3" 770 | resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" 771 | dependencies: 772 | is-primitive "^2.0.0" 773 | 774 | is-extendable@^0.1.1: 775 | version "0.1.1" 776 | resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" 777 | 778 | is-extglob@^1.0.0: 779 | version "1.0.0" 780 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" 781 | 782 | is-finite@^1.0.0: 783 | version "1.0.2" 784 | resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" 785 | dependencies: 786 | number-is-nan "^1.0.0" 787 | 788 | is-fullwidth-code-point@^1.0.0: 789 | version "1.0.0" 790 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" 791 | dependencies: 792 | number-is-nan "^1.0.0" 793 | 794 | is-fullwidth-code-point@^2.0.0: 795 | version "2.0.0" 796 | resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" 797 | 798 | is-glob@^2.0.0, is-glob@^2.0.1: 799 | version "2.0.1" 800 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" 801 | dependencies: 802 | is-extglob "^1.0.0" 803 | 804 | is-number@^2.1.0: 805 | version "2.1.0" 806 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" 807 | dependencies: 808 | kind-of "^3.0.2" 809 | 810 | is-number@^4.0.0: 811 | version "4.0.0" 812 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" 813 | 814 | is-posix-bracket@^0.1.0: 815 | version "0.1.1" 816 | resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" 817 | 818 | is-primitive@^2.0.0: 819 | version "2.0.0" 820 | resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" 821 | 822 | isarray@1.0.0, isarray@~1.0.0: 823 | version "1.0.0" 824 | resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" 825 | 826 | isobject@^2.0.0: 827 | version "2.1.0" 828 | resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" 829 | dependencies: 830 | isarray "1.0.0" 831 | 832 | js-tokens@^3.0.0, js-tokens@^3.0.2: 833 | version "3.0.2" 834 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" 835 | 836 | jsesc@^1.3.0: 837 | version "1.3.0" 838 | resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" 839 | 840 | jsesc@~0.5.0: 841 | version "0.5.0" 842 | resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" 843 | 844 | json5@^0.5.1: 845 | version "0.5.1" 846 | resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" 847 | 848 | kind-of@^3.0.2: 849 | version "3.2.2" 850 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" 851 | dependencies: 852 | is-buffer "^1.1.5" 853 | 854 | kind-of@^6.0.0: 855 | version "6.0.2" 856 | resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" 857 | 858 | lodash@^4.17.4: 859 | version "4.17.10" 860 | resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" 861 | 862 | loose-envify@^1.0.0: 863 | version "1.3.1" 864 | resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" 865 | dependencies: 866 | js-tokens "^3.0.0" 867 | 868 | math-random@^1.0.1: 869 | version "1.0.1" 870 | resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" 871 | 872 | micromatch@^2.1.5: 873 | version "2.3.11" 874 | resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" 875 | dependencies: 876 | arr-diff "^2.0.0" 877 | array-unique "^0.2.1" 878 | braces "^1.8.2" 879 | expand-brackets "^0.1.4" 880 | extglob "^0.3.1" 881 | filename-regex "^2.0.0" 882 | is-extglob "^1.0.0" 883 | is-glob "^2.0.1" 884 | kind-of "^3.0.2" 885 | normalize-path "^2.0.1" 886 | object.omit "^2.0.0" 887 | parse-glob "^3.0.4" 888 | regex-cache "^0.4.2" 889 | 890 | minimatch@^3.0.2, minimatch@^3.0.4: 891 | version "3.0.4" 892 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 893 | dependencies: 894 | brace-expansion "^1.1.7" 895 | 896 | minimist@0.0.8: 897 | version "0.0.8" 898 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" 899 | 900 | minimist@^1.2.0: 901 | version "1.2.0" 902 | resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" 903 | 904 | minipass@^2.2.1, minipass@^2.3.3: 905 | version "2.3.3" 906 | resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.3.tgz#a7dcc8b7b833f5d368759cce544dccb55f50f233" 907 | dependencies: 908 | safe-buffer "^5.1.2" 909 | yallist "^3.0.0" 910 | 911 | minizlib@^1.1.0: 912 | version "1.1.0" 913 | resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.0.tgz#11e13658ce46bc3a70a267aac58359d1e0c29ceb" 914 | dependencies: 915 | minipass "^2.2.1" 916 | 917 | mkdirp@^0.5.0, mkdirp@^0.5.1: 918 | version "0.5.1" 919 | resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" 920 | dependencies: 921 | minimist "0.0.8" 922 | 923 | ms@2.0.0: 924 | version "2.0.0" 925 | resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" 926 | 927 | nan@^2.9.2: 928 | version "2.10.0" 929 | resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f" 930 | 931 | needle@^2.2.0: 932 | version "2.2.1" 933 | resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.1.tgz#b5e325bd3aae8c2678902fa296f729455d1d3a7d" 934 | dependencies: 935 | debug "^2.1.2" 936 | iconv-lite "^0.4.4" 937 | sax "^1.2.4" 938 | 939 | node-pre-gyp@^0.10.0: 940 | version "0.10.0" 941 | resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.0.tgz#6e4ef5bb5c5203c6552448828c852c40111aac46" 942 | dependencies: 943 | detect-libc "^1.0.2" 944 | mkdirp "^0.5.1" 945 | needle "^2.2.0" 946 | nopt "^4.0.1" 947 | npm-packlist "^1.1.6" 948 | npmlog "^4.0.2" 949 | rc "^1.1.7" 950 | rimraf "^2.6.1" 951 | semver "^5.3.0" 952 | tar "^4" 953 | 954 | nopt@^4.0.1: 955 | version "4.0.1" 956 | resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" 957 | dependencies: 958 | abbrev "1" 959 | osenv "^0.1.4" 960 | 961 | normalize-path@^2.0.0, normalize-path@^2.0.1: 962 | version "2.1.1" 963 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" 964 | dependencies: 965 | remove-trailing-separator "^1.0.1" 966 | 967 | npm-bundled@^1.0.1: 968 | version "1.0.3" 969 | resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.3.tgz#7e71703d973af3370a9591bafe3a63aca0be2308" 970 | 971 | npm-packlist@^1.1.6: 972 | version "1.1.10" 973 | resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.1.10.tgz#1039db9e985727e464df066f4cf0ab6ef85c398a" 974 | dependencies: 975 | ignore-walk "^3.0.1" 976 | npm-bundled "^1.0.1" 977 | 978 | npmlog@^4.0.2: 979 | version "4.1.2" 980 | resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" 981 | dependencies: 982 | are-we-there-yet "~1.1.2" 983 | console-control-strings "~1.1.0" 984 | gauge "~2.7.3" 985 | set-blocking "~2.0.0" 986 | 987 | number-is-nan@^1.0.0: 988 | version "1.0.1" 989 | resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" 990 | 991 | object-assign@^4.1.0: 992 | version "4.1.1" 993 | resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" 994 | 995 | object.omit@^2.0.0: 996 | version "2.0.1" 997 | resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" 998 | dependencies: 999 | for-own "^0.1.4" 1000 | is-extendable "^0.1.1" 1001 | 1002 | once@^1.3.0: 1003 | version "1.4.0" 1004 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 1005 | dependencies: 1006 | wrappy "1" 1007 | 1008 | os-homedir@^1.0.0: 1009 | version "1.0.2" 1010 | resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" 1011 | 1012 | os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: 1013 | version "1.0.2" 1014 | resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" 1015 | 1016 | osenv@^0.1.4: 1017 | version "0.1.5" 1018 | resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" 1019 | dependencies: 1020 | os-homedir "^1.0.0" 1021 | os-tmpdir "^1.0.0" 1022 | 1023 | output-file-sync@^1.1.2: 1024 | version "1.1.2" 1025 | resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" 1026 | dependencies: 1027 | graceful-fs "^4.1.4" 1028 | mkdirp "^0.5.1" 1029 | object-assign "^4.1.0" 1030 | 1031 | parse-glob@^3.0.4: 1032 | version "3.0.4" 1033 | resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" 1034 | dependencies: 1035 | glob-base "^0.3.0" 1036 | is-dotfile "^1.0.0" 1037 | is-extglob "^1.0.0" 1038 | is-glob "^2.0.0" 1039 | 1040 | path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: 1041 | version "1.0.1" 1042 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 1043 | 1044 | preserve@^0.2.0: 1045 | version "0.2.0" 1046 | resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" 1047 | 1048 | private@^0.1.6, private@^0.1.8: 1049 | version "0.1.8" 1050 | resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" 1051 | 1052 | process-nextick-args@~2.0.0: 1053 | version "2.0.0" 1054 | resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" 1055 | 1056 | randomatic@^3.0.0: 1057 | version "3.0.0" 1058 | resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.0.0.tgz#d35490030eb4f7578de292ce6dfb04a91a128923" 1059 | dependencies: 1060 | is-number "^4.0.0" 1061 | kind-of "^6.0.0" 1062 | math-random "^1.0.1" 1063 | 1064 | rc@^1.1.7: 1065 | version "1.2.8" 1066 | resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" 1067 | dependencies: 1068 | deep-extend "^0.6.0" 1069 | ini "~1.3.0" 1070 | minimist "^1.2.0" 1071 | strip-json-comments "~2.0.1" 1072 | 1073 | readable-stream@^2.0.2, readable-stream@^2.0.6: 1074 | version "2.3.6" 1075 | resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" 1076 | dependencies: 1077 | core-util-is "~1.0.0" 1078 | inherits "~2.0.3" 1079 | isarray "~1.0.0" 1080 | process-nextick-args "~2.0.0" 1081 | safe-buffer "~5.1.1" 1082 | string_decoder "~1.1.1" 1083 | util-deprecate "~1.0.1" 1084 | 1085 | readdirp@^2.0.0: 1086 | version "2.1.0" 1087 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" 1088 | dependencies: 1089 | graceful-fs "^4.1.2" 1090 | minimatch "^3.0.2" 1091 | readable-stream "^2.0.2" 1092 | set-immediate-shim "^1.0.1" 1093 | 1094 | regenerate@^1.2.1: 1095 | version "1.4.0" 1096 | resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" 1097 | 1098 | regenerator-runtime@^0.10.5: 1099 | version "0.10.5" 1100 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" 1101 | 1102 | regenerator-runtime@^0.11.0: 1103 | version "0.11.1" 1104 | resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" 1105 | 1106 | regenerator-transform@^0.10.0: 1107 | version "0.10.1" 1108 | resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" 1109 | dependencies: 1110 | babel-runtime "^6.18.0" 1111 | babel-types "^6.19.0" 1112 | private "^0.1.6" 1113 | 1114 | regex-cache@^0.4.2: 1115 | version "0.4.4" 1116 | resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" 1117 | dependencies: 1118 | is-equal-shallow "^0.1.3" 1119 | 1120 | regexpu-core@^2.0.0: 1121 | version "2.0.0" 1122 | resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" 1123 | dependencies: 1124 | regenerate "^1.2.1" 1125 | regjsgen "^0.2.0" 1126 | regjsparser "^0.1.4" 1127 | 1128 | regjsgen@^0.2.0: 1129 | version "0.2.0" 1130 | resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" 1131 | 1132 | regjsparser@^0.1.4: 1133 | version "0.1.5" 1134 | resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" 1135 | dependencies: 1136 | jsesc "~0.5.0" 1137 | 1138 | remove-trailing-separator@^1.0.1: 1139 | version "1.1.0" 1140 | resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" 1141 | 1142 | repeat-element@^1.1.2: 1143 | version "1.1.2" 1144 | resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" 1145 | 1146 | repeat-string@^1.5.2: 1147 | version "1.6.1" 1148 | resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" 1149 | 1150 | repeating@^2.0.0: 1151 | version "2.0.1" 1152 | resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" 1153 | dependencies: 1154 | is-finite "^1.0.0" 1155 | 1156 | rimraf@^2.6.1: 1157 | version "2.6.2" 1158 | resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" 1159 | dependencies: 1160 | glob "^7.0.5" 1161 | 1162 | safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: 1163 | version "5.1.2" 1164 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" 1165 | 1166 | "safer-buffer@>= 2.1.2 < 3": 1167 | version "2.1.2" 1168 | resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" 1169 | 1170 | sax@^1.2.4: 1171 | version "1.2.4" 1172 | resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" 1173 | 1174 | semver@^5.3.0: 1175 | version "5.5.0" 1176 | resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" 1177 | 1178 | set-blocking@~2.0.0: 1179 | version "2.0.0" 1180 | resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" 1181 | 1182 | set-immediate-shim@^1.0.1: 1183 | version "1.0.1" 1184 | resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" 1185 | 1186 | signal-exit@^3.0.0: 1187 | version "3.0.2" 1188 | resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" 1189 | 1190 | slash@^1.0.0: 1191 | version "1.0.0" 1192 | resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" 1193 | 1194 | source-map-support@^0.4.15: 1195 | version "0.4.18" 1196 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" 1197 | dependencies: 1198 | source-map "^0.5.6" 1199 | 1200 | source-map@^0.5.6, source-map@^0.5.7: 1201 | version "0.5.7" 1202 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" 1203 | 1204 | string-width@^1.0.1: 1205 | version "1.0.2" 1206 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" 1207 | dependencies: 1208 | code-point-at "^1.0.0" 1209 | is-fullwidth-code-point "^1.0.0" 1210 | strip-ansi "^3.0.0" 1211 | 1212 | "string-width@^1.0.2 || 2": 1213 | version "2.1.1" 1214 | resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" 1215 | dependencies: 1216 | is-fullwidth-code-point "^2.0.0" 1217 | strip-ansi "^4.0.0" 1218 | 1219 | string_decoder@~1.1.1: 1220 | version "1.1.1" 1221 | resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" 1222 | dependencies: 1223 | safe-buffer "~5.1.0" 1224 | 1225 | strip-ansi@^3.0.0, strip-ansi@^3.0.1: 1226 | version "3.0.1" 1227 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" 1228 | dependencies: 1229 | ansi-regex "^2.0.0" 1230 | 1231 | strip-ansi@^4.0.0: 1232 | version "4.0.0" 1233 | resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" 1234 | dependencies: 1235 | ansi-regex "^3.0.0" 1236 | 1237 | strip-json-comments@~2.0.1: 1238 | version "2.0.1" 1239 | resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" 1240 | 1241 | supports-color@^2.0.0: 1242 | version "2.0.0" 1243 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" 1244 | 1245 | tar@^4: 1246 | version "4.4.4" 1247 | resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.4.tgz#ec8409fae9f665a4355cc3b4087d0820232bb8cd" 1248 | dependencies: 1249 | chownr "^1.0.1" 1250 | fs-minipass "^1.2.5" 1251 | minipass "^2.3.3" 1252 | minizlib "^1.1.0" 1253 | mkdirp "^0.5.0" 1254 | safe-buffer "^5.1.2" 1255 | yallist "^3.0.2" 1256 | 1257 | to-fast-properties@^1.0.3: 1258 | version "1.0.3" 1259 | resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" 1260 | 1261 | trim-right@^1.0.1: 1262 | version "1.0.1" 1263 | resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" 1264 | 1265 | user-home@^1.1.1: 1266 | version "1.1.1" 1267 | resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" 1268 | 1269 | util-deprecate@~1.0.1: 1270 | version "1.0.2" 1271 | resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" 1272 | 1273 | v8flags@^2.1.1: 1274 | version "2.1.1" 1275 | resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" 1276 | dependencies: 1277 | user-home "^1.1.1" 1278 | 1279 | wide-align@^1.1.0: 1280 | version "1.1.3" 1281 | resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" 1282 | dependencies: 1283 | string-width "^1.0.2 || 2" 1284 | 1285 | wrappy@1: 1286 | version "1.0.2" 1287 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 1288 | 1289 | yallist@^3.0.0, yallist@^3.0.2: 1290 | version "3.0.2" 1291 | resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" 1292 | --------------------------------------------------------------------------------