dante2-editor 0.2.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/.babelrc +20 -0
  3. data/.eslint +13 -0
  4. data/.gitignore +15 -0
  5. data/README.md +5 -1
  6. data/dante2.gemspec +2 -4
  7. data/{app → demo}/assets/index.html +2 -2
  8. data/{app → demo}/assets/license.html +1 -1
  9. data/{app → demo}/assets/options.html +1 -5
  10. data/{app → demo}/assets/store.json +0 -0
  11. data/demo/data/poc.js +9 -0
  12. data/demo/demo.js +9 -0
  13. data/demo/initialize.js +7 -0
  14. data/{app → demo}/styles/layout/layout.scss +0 -0
  15. data/{app → demo}/styles/layout/normalize.css +0 -0
  16. data/{app → demo}/styles/layout/scaffold.scss +0 -0
  17. data/{app → demo}/styles/layout/tooltips.scss +0 -0
  18. data/dist/Dante2.js +2995 -0
  19. data/dist/Dante2.min.js +3 -0
  20. data/dist/Dante2.min.js.map +1 -0
  21. data/dist/DanteStyles.css +2 -0
  22. data/dist/DanteStyles.css.map +1 -0
  23. data/dist/DanteStyles.js +102 -0
  24. data/dist/DanteStyles.min.js +2 -0
  25. data/dist/DanteStyles.min.js.map +1 -0
  26. data/dist/dante-vendors.js +48316 -0
  27. data/dist/dante-vendors.min.js +29 -0
  28. data/dist/dante-vendors.min.js.map +1 -0
  29. data/{app/styles/fonts/dante → dist/fonts}/dante.eot +0 -0
  30. data/{app/styles/fonts/dante → dist/fonts}/dante.svg +0 -0
  31. data/{app/styles/fonts/dante → dist/fonts}/dante.ttf +0 -0
  32. data/{app/styles/fonts/dante → dist/fonts}/dante.woff +0 -0
  33. data/{app/styles/fonts/dante → dist/fonts}/fontello.eot +0 -0
  34. data/{app/styles/fonts/dante → dist/fonts}/fontello.svg +0 -0
  35. data/{app/styles/fonts/dante → dist/fonts}/fontello.ttf +0 -0
  36. data/{app/styles/fonts/dante → dist/fonts}/fontello.woff +0 -0
  37. data/docs/app.css +430 -1
  38. data/docs/app.css.map +1 -1
  39. data/docs/app.js +62 -2
  40. data/docs/app.js.map +1 -1
  41. data/docs/dante-vendors.js +49513 -22
  42. data/docs/dante-vendors.js.map +1 -1
  43. data/docs/dante.css +1602 -1
  44. data/docs/dante.css.map +1 -1
  45. data/docs/dante.js +3310 -3
  46. data/docs/dante.js.map +1 -1
  47. data/docs/doc.html +3 -7
  48. data/docs/index.html +4 -4
  49. data/docs/license.html +3 -3
  50. data/docs/options.html +53 -0
  51. data/package.json +47 -17
  52. data/rb_lib/dante2-editor/rails.rb +15 -0
  53. data/{lib → rb_lib}/dante2-editor/version.rb +1 -1
  54. data/{lib → rb_lib}/dante2-editor.rb +0 -0
  55. data/src/components/blocks/embed.js +126 -0
  56. data/src/components/blocks/image.js +377 -0
  57. data/src/components/blocks/placeholder.js +68 -0
  58. data/src/components/blocks/video.js +80 -0
  59. data/src/components/dante.js +291 -0
  60. data/src/components/dante_editor.js +928 -0
  61. data/src/components/debug.js +104 -0
  62. data/src/components/decorators/link.js +64 -0
  63. data/src/components/popovers/addButton.js +318 -0
  64. data/src/components/popovers/image.js +188 -0
  65. data/src/components/popovers/link.js +107 -0
  66. data/src/components/popovers/toolTip.js +402 -0
  67. data/{app/utils/logger.coffee → src/components/wrapper.js} +0 -0
  68. data/{app → src}/images/dante/media-loading-placeholder.png +0 -0
  69. data/{app → src}/images/site/dante-demo.png +0 -0
  70. data/{app → src}/images/site/dante-editor-logo.png +0 -0
  71. data/{app → src}/images/site/github-logo.png +0 -0
  72. data/src/index.js +9 -0
  73. data/{app → src}/model/index.js +0 -0
  74. data/src/style.js +3 -0
  75. data/{app → src}/styles/dante/_animations.scss +0 -0
  76. data/{app → src}/styles/dante/_caption.scss +0 -0
  77. data/{app → src}/styles/dante/_debug.scss +0 -0
  78. data/{app → src}/styles/dante/_fonts.scss +0 -0
  79. data/{app → src}/styles/dante/_graf.scss +0 -0
  80. data/{app → src}/styles/dante/_icons.scss +0 -0
  81. data/{app → src}/styles/dante/_media.scss +0 -0
  82. data/{app → src}/styles/dante/_menu.scss +0 -0
  83. data/{app → src}/styles/dante/_needsorder.scss +0 -0
  84. data/{app → src}/styles/dante/_popover.scss +0 -0
  85. data/{app → src}/styles/dante/_post.scss +0 -0
  86. data/{app → src}/styles/dante/_scaffold.scss +0 -0
  87. data/{app → src}/styles/dante/_tooltip.scss +0 -0
  88. data/{app → src}/styles/dante/_utilities.scss +0 -0
  89. data/{app → src}/styles/dante/_variables.scss +0 -0
  90. data/{app → src}/styles/dante/blame.scss +0 -0
  91. data/{app → src}/styles/dante.scss +0 -0
  92. data/{app → src}/styles/draft.css +0 -0
  93. data/src/styles/fonts/dante/dante.eot +0 -0
  94. data/src/styles/fonts/dante/dante.svg +18 -0
  95. data/src/styles/fonts/dante/dante.ttf +0 -0
  96. data/src/styles/fonts/dante/dante.woff +0 -0
  97. data/src/styles/fonts/dante/fontello.eot +0 -0
  98. data/src/styles/fonts/dante/fontello.svg +36 -0
  99. data/src/styles/fonts/dante/fontello.ttf +0 -0
  100. data/src/styles/fonts/dante/fontello.woff +0 -0
  101. data/src/utils/find_entities.js +17 -0
  102. data/src/utils/html2content.js +127 -0
  103. data/src/utils/save_content.js +80 -0
  104. data/{app → src}/utils/selection.js +0 -0
  105. data/tools/.eslintrc +9 -0
  106. data/tools/amd/README.md +7 -0
  107. data/tools/amd/bower.json +19 -0
  108. data/tools/amd/build.js +36 -0
  109. data/tools/build-cli.js +46 -0
  110. data/tools/build.js +30 -0
  111. data/tools/buildBabel.js +32 -0
  112. data/tools/constants.js +10 -0
  113. data/tools/dist/build.js +13 -0
  114. data/tools/docs/build.js +12 -0
  115. data/tools/es/build.js +27 -0
  116. data/tools/exec.js +50 -0
  117. data/tools/fs-utils.js +35 -0
  118. data/tools/lib/build.js +14 -0
  119. data/tools/promisify.js +14 -0
  120. data/webpack/base.config.js +89 -0
  121. data/webpack/docs.config.js +147 -0
  122. data/webpack/webpack.config.js +78 -0
  123. data/webpack.config-doc.js +5 -0
  124. data/webpack.config.js +3 -147
  125. data/yarn.lock +973 -718
  126. metadata +108 -64
  127. data/app/components/App.cjsx +0 -1083
  128. data/app/components/blocks/embed.cjsx +0 -109
  129. data/app/components/blocks/image.cjsx +0 -316
  130. data/app/components/blocks/placeholder.cjsx +0 -60
  131. data/app/components/blocks/video.cjsx +0 -75
  132. data/app/components/debug.cjsx +0 -96
  133. data/app/components/decorators/link.cjsx +0 -61
  134. data/app/components/popovers/addButton.cjsx +0 -247
  135. data/app/components/popovers/image.cjsx +0 -160
  136. data/app/components/popovers/link.cjsx +0 -87
  137. data/app/components/popovers/toolTip.cjsx +0 -326
  138. data/app/data/poc.js +0 -15
  139. data/app/demo.js +0 -7
  140. data/app/initialize.js +0 -4
  141. data/app/utils/find_entities.coffee +0 -20
  142. data/app/utils/html2content.coffee +0 -120
  143. data/app/utils/save_content.coffee +0 -63
  144. data/lib/dante2-editor/rails.rb +0 -16
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///Dante2.min.js","webpack:///./src/index.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}","webpack:///./src/model/index.js","webpack:///./src/utils/selection.js","webpack:///./src/components/dante_editor.js?cf48","webpack:///./src/components/dante.js?178c","webpack:///./src/components/blocks/embed.js","webpack:///./src/components/blocks/image.js","webpack:///./src/components/blocks/placeholder.js","webpack:///./src/components/blocks/video.js","webpack:///./src/components/debug.js","webpack:///./src/components/decorators/link.js","webpack:///./src/components/popovers/addButton.js","webpack:///./src/components/popovers/image.js","webpack:///./src/components/popovers/link.js","webpack:///./src/components/popovers/toolTip.js","webpack:///./src/utils/find_entities.js","webpack:///./src/utils/html2content.js","webpack:///./src/utils/save_content.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_5__","__WEBPACK_EXTERNAL_MODULE_9__","webpackJsonpDante2","0","__webpack_require__","_interopRequireDefault","obj","__esModule","default","_dante","_dante2","_dante_editor","_dante_editor2","Dante","DanteEditor","5","9","24","addNewBlockAt","updateTextOfBlock","updateDataOfBlock","resetBlockWithType","addNewBlock","getCurrentBlock","getNode","getDefaultBlockData","undefined","_immutable","_draftJs","blockType","initialData","arguments","length","window","t","getSelection","document","selection","createRange","text","editorState","selectionState","contentState","getCurrentContent","block","getBlockForKey","getStartKey","newType","isCollapsed","key","blockMap","getBlockMap","currentBlock","getLength","getType","newBlock","merge","type","data","newContentState","set","selectionAfter","EditorState","push","get","newText","console","log","getText","substr","anchorOffset","focusOffset","newData","getKey","pivotBlockKey","newBlockType","content","blocksBefore","toSeq","takeUntil","v","blocksAfter","skipUntil","rest","newBlockKey","genKey","ContentBlock","characterList","getCharacterList","slice","depth","Map","newBlockMap","concat","toOrderedMap","newContent","selectionBefore","anchorKey","focusKey","isBackward","78","getSelectionRect","selected","_rect","getRangeAt","getBoundingClientRect","rect","top","getClientRects","anchorNode","isEmptyline","getSelectedBlockNode","rangeCount","node","startContainer","getAttribute","parentNode","137","global","call","227","228","_classCallCheck2","_classCallCheck3","_possibleConstructorReturn2","_possibleConstructorReturn3","_inherits2","_inherits3","_react","_react2","_reactDom","_axios","_axios2","_index","EmbedBlock","_React$Component","props","_this","updateData","bind","dataForUpdate","componentDidMount","state","embed_data","defaultData","error","prototype","existing_data","getData","toJS","_props","_props$blockProps","blockProps","getEditorState","setEditorState","_this2","endpoint","provisory_text","method","url","then","result","setState","response","error_message","classForImage","images","picture","render","createElement","target","className","href","style","backgroundImage","title","description","provider_url","Component","229","_assign","_assign2","ImageBlock","blockPropsSrc","defaultUrl","defaultAspectRatio","replaceImg","startLoader","stopLoader","handleUpload","aspectRatio","updateDataSelection","handleGrafFigureSelectImg","getUploadUrl","uploadFile","uploadCompleted","updateProgressBar","placeHolderEnabled","placeholderText","handleFocus","config","file","loading","loading_progress","enabled","caption","defaultPlaceholder","direction","width","height","aspect_ratio","src","URL","createObjectURL","image_caption_placeholder","ratio","getAspectRatio","w","h","maxWidth","maxHeight","fill_ratio","forceUpload","img","Image","refs","image_tag","self","includes","onload","addLock","newselection","forceSelection","e","preventDefault","coords","getBase64Image","canvas","ctx","getContext","drawImage","dataURL","toDataURL","formatData","formData","FormData","formName","upload_formName","append","upload_url","getUploadHeaders","upload_headers","_this3","handleUp","headers","onUploadProgress","removeLock","upload_callback","upload_error_callback","json_response","n","json","complete","lengthComputable","loaded","total","_this4","setTimeout","ref","suppressContentEditableWarning","onClick","paddingBottom","Loader","toggle","progress","onMouseDown","EditorBlock","editable","_React$Component2","apply","Math","round","230","PlaceholderBlock","placeholderFromProps","defaultText","classForDefault","placeholder","231","VideoBlock","thumbnail_url","tabIndex","dangerouslySetInnerHTML","__html","html","232","_stringify","_stringify2","Debug","handleToggleReadOnly","handleTestEmitAndDecode","handleTestEmitTEXT","testEmitAndDecode","testEmitTEXT","logState","toggleDisplay","open","output","display","editor","toggleEditable","raw_as_json","emitSerializedOutput","decodeEditorContent","getTextFromEditor","raw","d","locks","read_only","233","Link","_validateLink","_checkProtocol","_showPopLinkOver","_hidePopLinkOver","isHover","pattern","RegExp","test","str","alert","showPopLinkOver","link","hidePopLinkOver","Entity","entityKey","onMouseOver","onMouseOut","children","234","_reactDom2","_selection","DanteInlineTooltip","show","hide","_toggleScaled","scale","collapse","componentWillReceiveProps","clickOnFileUpload","handlePlaceholder","insertImage","handleFileInput","widgets","clickHandler","relocate","position","left","scaled","b","setPosition","ev","newProps","activeClass","isActive","scaledClass","scaledWidth","fileInput","click","input","opts","widget_options","insert_block","options","onChange","fileList","files","request_block","find","o","icon","insertion","getItems","filter","displayOnInlineTooltip","isDescendant","parent","child","nativeSelection","selectionBoundary","findDOMNode","scrollY","scrollX","data-action","map","item","i","InlineTooltipItem","multiple","_len","args","Array","_key","235","DanteImagePopover","handleClick","buttons","parentBoundary","el","image_popover","padd","offsetWidth","getStyle","setDirection","DanteImagePopoverItem","236","DanteAnchorPopover","dante_popover","visibility","handleOnMouseOver","handleOnMouseOut","237","DanteTooltip","_clickInlineHandler","_clickBlockHandler","displayLinkMode","displayActiveMenu","_enableLinkMode","_disableLinkMode","handleInputEnter","confirmLink","inlineItems","blockItems","getDefaultValue","getVisibleSelectionRect","link_mode","RichUtils","toggleInlineStyle","configTooltip","selectionElements","indexOf","dante_menu","toggleBlockType","hideMenu","which","urlValue","currentTarget","value","create","toggleLink","getPosition","pos","block_types","dante_menu_input","selectedEntity","findEntityRanges","character","getEntity","start","end","selStart","getAnchorOffset","selEnd","getFocusOffset","getIsBackward","_this5","id","onKeyPress","defaultValue","DanteTooltipItem","currentStyle","getCurrentInlineStyle","DanteTooltipLink","enableLinkMode","_this6","activeClassInline","activeClassBlock","has","label","_React$Component3","_len2","_key2","_this7","promptForLink","238","findEntities","entityType","instance","contentBlock","callback","res","mergeData","239","compose","getBlockSpecForElement","imgElement","contentType","imgSrc","wrapBlockSpec","blockSpec","tempEl","innerText","replaceElement","oldEl","newEl","HTMLElement","upEl","getUpEl","insertBefore","tagName","elementToBlockSpecElement","imgReplacer","customHTML2Content","HTML","blockRn","tempDoc","DOMParser","parseFromString","querySelectorAll","forEach","body","innerHTML","contentBlocks","convertFromHTML","getSafeBodyFromHTML","JSON","parse","ContentState","createFromBlockArray","240","_immutable2","SaveBehavior","getLocks","editorContent","handleStore","store","data_storage","clearTimeout","timeout","checkforStore","interval","blocks","join","getUrl","getMethod","isChanged","is","fromJS","xhr","before_handler","editor_content","text_content","success_handler","failure_handler"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,SAAAA,QAAA,cACA,kBAAAC,gBAAAC,IACAD,QAAA,qBAAAJ,GACA,gBAAAC,SACAA,QAAA,OAAAD,EAAAG,QAAA,SAAAA,QAAA,cAEAJ,EAAA,OAAAC,EAAAD,EAAA,MAAAA,EAAA,WACCO,KAAA,SAAAC,EAA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exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Dante2\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"Dante2\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_9__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-dom\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-dom\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Dante2\"] = factory(require(\"react\"), require(\"react-dom\"));\n\telse\n\t\troot[\"Dante2\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_9__) {\nreturn webpackJsonpDante2([1],{\n\n/***/ 0:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _dante = __webpack_require__(227);\n\t\n\tvar _dante2 = _interopRequireDefault(_dante);\n\t\n\tvar _dante_editor = __webpack_require__(137);\n\t\n\tvar _dante_editor2 = _interopRequireDefault(_dante_editor);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tmodule.exports = {\n\t Dante: _dante2['default'],\n\t DanteEditor: _dante_editor2['default']\n\t};\n\n/***/ },\n\n/***/ 5:\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n/***/ },\n\n/***/ 9:\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_9__;\n\n/***/ },\n\n/***/ 24:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\texports.addNewBlockAt = exports.updateTextOfBlock = exports.updateDataOfBlock = exports.resetBlockWithType = exports.addNewBlock = exports.getCurrentBlock = exports.getNode = exports.getDefaultBlockData = undefined;\n\t\n\tvar _immutable = __webpack_require__(46);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\t/*\n\tUsed from [react-rte](https://github.com/brijeshb42/medium-draft)\n\tby [brijeshb42](https://github.com/brijeshb42/medium-draft)\n\t*/\n\t\n\t/*\n\tReturns default block-level metadata for various block type. Empty object otherwise.\n\t*/\n\tvar getDefaultBlockData = exports.getDefaultBlockData = function getDefaultBlockData(blockType) {\n\t var initialData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\n\t switch (blockType) {\n\t //case Block.TODO: return { checked: false };\n\t default:\n\t return initialData;\n\t }\n\t};\n\t\n\tvar getNode = exports.getNode = function getNode() {\n\t var root = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window;\n\t\n\t var t = null;\n\t if (root.getSelection) {\n\t t = root.getSelection();\n\t } else if (root.document.getSelection) {\n\t t = root.document.getSelection();\n\t } else if (root.document.selection) {\n\t t = root.document.selection.createRange().text;\n\t }\n\t return t;\n\t};\n\t\n\t/*\n\tGet currentBlock in the editorState.\n\t*/\n\tvar getCurrentBlock = exports.getCurrentBlock = function getCurrentBlock(editorState) {\n\t var selectionState = editorState.getSelection();\n\t var contentState = editorState.getCurrentContent();\n\t var block = contentState.getBlockForKey(selectionState.getStartKey());\n\t return block;\n\t};\n\t\n\t/*\n\tAdds a new block (currently replaces an empty block) at the current cursor position\n\tof the given `newType`.\n\t*/\n\tvar addNewBlock = exports.addNewBlock = function addNewBlock(editorState) {\n\t var newType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"unstyled\";\n\t var initialData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var selectionState = editorState.getSelection();\n\t if (!selectionState.isCollapsed()) {\n\t return editorState;\n\t }\n\t var contentState = editorState.getCurrentContent();\n\t var key = selectionState.getStartKey();\n\t var blockMap = contentState.getBlockMap();\n\t var currentBlock = getCurrentBlock(editorState);\n\t if (!currentBlock) {\n\t return editorState;\n\t }\n\t if (currentBlock.getLength() === 0) {\n\t if (currentBlock.getType() === newType) {\n\t return editorState;\n\t }\n\t var newBlock = currentBlock.merge({\n\t type: newType,\n\t data: getDefaultBlockData(newType, initialData)\n\t });\n\t var newContentState = contentState.merge({\n\t blockMap: blockMap.set(key, newBlock),\n\t selectionAfter: selectionState\n\t });\n\t return _draftJs.EditorState.push(editorState, newContentState, 'change-block-type');\n\t }\n\t return editorState;\n\t};\n\t\n\t/*\n\tChanges the block type of the current block.\n\t*/\n\tvar resetBlockWithType = exports.resetBlockWithType = function resetBlockWithType(editorState) {\n\t var newType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"unstyled\";\n\t var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t\n\t var contentState = editorState.getCurrentContent();\n\t var selectionState = editorState.getSelection();\n\t var key = selectionState.getStartKey();\n\t var blockMap = contentState.getBlockMap();\n\t var block = blockMap.get(key);\n\t\n\t var newText = '';\n\t console.log(\"DATA FOR PLACEHOLDER!\", data);\n\t var text = block.getText();\n\t if (block.getLength() >= 2) {\n\t newText = text.substr(1);\n\t }\n\t\n\t /*if(data.text){\n\t newText = data.text\n\t }*/\n\t\n\t //let newText = data.text\n\t\n\t var newBlock = block.merge({\n\t text: newText,\n\t type: newType,\n\t data: getDefaultBlockData(newType, data)\n\t });\n\t var newContentState = contentState.merge({\n\t blockMap: blockMap.set(key, newBlock),\n\t selectionAfter: selectionState.merge({\n\t anchorOffset: 0,\n\t focusOffset: 0\n\t })\n\t });\n\t return _draftJs.EditorState.push(editorState, newContentState, 'change-block-type');\n\t};\n\t\n\t/*\n\tUpdate block-level metadata of the given `block` to the `newData`/\n\t*/\n\tvar updateDataOfBlock = exports.updateDataOfBlock = function updateDataOfBlock(editorState, block, newData) {\n\t var contentState = editorState.getCurrentContent();\n\t var newBlock = block.merge({\n\t data: newData\n\t });\n\t var newContentState = contentState.merge({\n\t blockMap: contentState.getBlockMap().set(block.getKey(), newBlock)\n\t });\n\t return _draftJs.EditorState.push(editorState, newContentState, 'change-block-type');\n\t // return editorState;\n\t};\n\t\n\tvar updateTextOfBlock = exports.updateTextOfBlock = function updateTextOfBlock(editorState, block, text) {\n\t var contentState = editorState.getCurrentContent();\n\t var newBlock = block.merge({\n\t text: text\n\t });\n\t var newContentState = contentState.merge({\n\t blockMap: contentState.getBlockMap().set(block.getKey(), newBlock)\n\t });\n\t\n\t return _draftJs.EditorState.push(editorState, newContentState, 'change-block-type');\n\t // return editorState;\n\t};\n\t\n\t// const BEFORE = -1;\n\t// const AFTER = 1;\n\t\n\t/*\n\tUsed from [react-rte](https://github.com/sstur/react-rte/blob/master/src/lib/insertBlockAfter.js)\n\tby [sstur](https://github.com/sstur)\n\t*/\n\tvar addNewBlockAt = exports.addNewBlockAt = function addNewBlockAt(editorState, pivotBlockKey) {\n\t var newBlockType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"unstyled\";\n\t var initialData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\t\n\t var content = editorState.getCurrentContent();\n\t var blockMap = content.getBlockMap();\n\t var block = blockMap.get(pivotBlockKey);\n\t var blocksBefore = blockMap.toSeq().takeUntil(function (v) {\n\t return v === block;\n\t });\n\t var blocksAfter = blockMap.toSeq().skipUntil(function (v) {\n\t return v === block;\n\t }).rest();\n\t var newBlockKey = (0, _draftJs.genKey)();\n\t\n\t var newBlock = new _draftJs.ContentBlock({\n\t key: newBlockKey,\n\t type: newBlockType,\n\t text: '',\n\t characterList: block.getCharacterList().slice(0, 0),\n\t depth: 0,\n\t data: (0, _immutable.Map)(getDefaultBlockData(newBlockType, initialData))\n\t });\n\t\n\t var newBlockMap = blocksBefore.concat([[pivotBlockKey, block], [newBlockKey, newBlock]], blocksAfter).toOrderedMap();\n\t\n\t var selection = editorState.getSelection();\n\t\n\t var newContent = content.merge({\n\t blockMap: newBlockMap,\n\t selectionBefore: selection,\n\t selectionAfter: selection.merge({\n\t anchorKey: newBlockKey,\n\t anchorOffset: 0,\n\t focusKey: newBlockKey,\n\t focusOffset: 0,\n\t isBackward: false\n\t })\n\t });\n\t return _draftJs.EditorState.push(editorState, newContent, 'split-block');\n\t};\n\n/***/ },\n\n/***/ 78:\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t/*\n\tReturns the `boundingClientRect` of the passed selection.\n\t*/\n\tvar getSelectionRect = exports.getSelectionRect = function getSelectionRect(selected) {\n\t var _rect = selected.getRangeAt(0).getBoundingClientRect();\n\t // selected.getRangeAt(0).getBoundingClientRect()\n\t var rect = _rect && _rect.top ? _rect : selected.getRangeAt(0).getClientRects()[0];\n\t if (!rect) {\n\t if (selected.anchorNode && selected.anchorNode.getBoundingClientRect) {\n\t rect = selected.anchorNode.getBoundingClientRect();\n\t rect.isEmptyline = true;\n\t } else {\n\t return null;\n\t }\n\t }\n\t return rect;\n\t};\n\t\n\t/*\n\tReturns the native selection node.\n\t*/\n\tvar getSelection = exports.getSelection = function getSelection(root) {\n\t var t = null;\n\t if (root.getSelection) {\n\t t = root.getSelection();\n\t } else if (root.document.getSelection) {\n\t t = root.document.getSelection();\n\t } else if (root.document.selection) {\n\t t = root.document.selection.createRange().text;\n\t }\n\t return t;\n\t};\n\t\n\t/*\n\tRecursively finds the DOM Element of the block where the cursor is currently present.\n\tIf not found, returns null.\n\t*/\n\tvar getSelectedBlockNode = exports.getSelectedBlockNode = function getSelectedBlockNode(root) {\n\t var selection = root.getSelection();\n\t if (selection.rangeCount === 0) {\n\t return null;\n\t }\n\t var node = selection.getRangeAt(0).startContainer;\n\t // console.log(node);\n\t do {\n\t if (node.getAttribute && node.getAttribute('data-block') === 'true') {\n\t return node;\n\t }\n\t node = node.parentNode;\n\t // console.log(node);\n\t } while (node !== null);\n\t return null;\n\t};\n\n/***/ },\n\n/***/ 137:\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tmodule.exports = global[\"DanteEditor\"] = __webpack_require__(242);\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n\n/***/ 227:\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\"use strict\";\n\t\n\tmodule.exports = global[\"Dante\"] = __webpack_require__(241);\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n\n/***/ 228:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _axios = __webpack_require__(61);\n\t\n\tvar _axios2 = _interopRequireDefault(_axios);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar EmbedBlock = function (_React$Component) {\n\t (0, _inherits3['default'])(EmbedBlock, _React$Component);\n\t\n\t function EmbedBlock(props) {\n\t (0, _classCallCheck3['default'])(this, EmbedBlock);\n\t\n\t //api_key = \"86c28a410a104c8bb58848733c82f840\"\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.updateData = _this.updateData.bind(_this);\n\t _this.dataForUpdate = _this.dataForUpdate.bind(_this);\n\t _this.componentDidMount = _this.componentDidMount.bind(_this);\n\t _this.state = {\n\t embed_data: _this.defaultData(),\n\t error: \"\"\n\t };\n\t return _this;\n\t }\n\t\n\t EmbedBlock.prototype.defaultData = function defaultData() {\n\t var existing_data = this.props.block.getData().toJS();\n\t return existing_data.embed_data || {};\n\t };\n\t\n\t // will update block state\n\t\n\t\n\t EmbedBlock.prototype.updateData = function updateData() {\n\t var _props = this.props,\n\t block = _props.block,\n\t blockProps = _props.blockProps;\n\t var _props$blockProps = this.props.blockProps,\n\t getEditorState = _props$blockProps.getEditorState,\n\t setEditorState = _props$blockProps.setEditorState;\n\t\n\t var data = block.getData();\n\t var newData = data.merge(this.state);\n\t return setEditorState((0, _index.updateDataOfBlock)(getEditorState(), block, newData));\n\t };\n\t\n\t EmbedBlock.prototype.dataForUpdate = function dataForUpdate() {\n\t\n\t return this.props.blockProps.data.toJS();\n\t };\n\t\n\t EmbedBlock.prototype.componentDidMount = function componentDidMount() {\n\t var _this2 = this;\n\t\n\t if (!this.props.blockProps.data) {\n\t return;\n\t }\n\t\n\t // ensure data isnt already loaded\n\t // unless @dataForUpdate().endpoint or @dataForUpdate().provisory_text\n\t\n\t if (!this.dataForUpdate().endpoint && !this.dataForUpdate().provisory_text) {\n\t //debugger\n\t return;\n\t }\n\t\n\t return (0, _axios2['default'])({\n\t method: 'get',\n\t url: '' + this.dataForUpdate().endpoint + this.dataForUpdate().provisory_text + '&scheme=https'\n\t }).then(function (result) {\n\t\n\t return _this2.setState({ embed_data: result.data } //JSON.parse(data.responseText)\n\t , _this2.updateData);\n\t })['catch'](function (error) {\n\t\n\t _this2.setState({\n\t error: error.response.data.error_message });\n\t return console.log(\"TODO: error\");\n\t });\n\t };\n\t\n\t EmbedBlock.prototype.classForImage = function classForImage() {\n\t if (this.state.embed_data.images) {\n\t return \"\";\n\t } else {\n\t return \"mixtapeImage--empty u-ignoreBlock\";\n\t }\n\t };\n\t //if @state.embed_data.thumbnail_url then \"\" else \"mixtapeImage--empty u-ignoreBlock\"\n\t\n\t EmbedBlock.prototype.picture = function picture() {\n\t if (this.state.embed_data.images && this.state.embed_data.images.length > 0) {\n\t return this.state.embed_data.images[0].url;\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t EmbedBlock.prototype.render = function render() {\n\t //block = @.props\n\t //foo = @.props.blockProps\n\t //data = Entity.get(block.block.getEntityAt(0)).getData()\n\t console.log(\"ERROR\", this.state.error);\n\t return _react2['default'].createElement(\n\t 'span',\n\t null,\n\t this.picture() ? _react2['default'].createElement('a', {\n\t target: '_blank',\n\t className: 'js-mixtapeImage mixtapeImage ' + this.classForImage(),\n\t href: this.state.embed_data.url,\n\t style: { backgroundImage: 'url(\\'' + this.picture() + '\\')' }\n\t }) : undefined,\n\t this.state.error ? _react2['default'].createElement(\n\t 'h2',\n\t null,\n\t this.state.error\n\t ) : undefined,\n\t _react2['default'].createElement(\n\t 'a',\n\t {\n\t className: 'markup--anchor markup--mixtapeEmbed-anchor',\n\t target: '_blank',\n\t href: this.state.embed_data.url\n\t },\n\t _react2['default'].createElement(\n\t 'strong',\n\t { className: 'markup--strong markup--mixtapeEmbed-strong' },\n\t this.state.embed_data.title\n\t ),\n\t _react2['default'].createElement(\n\t 'em',\n\t { className: 'markup--em markup--mixtapeEmbed-em' },\n\t this.state.embed_data.description\n\t )\n\t ),\n\t this.state.embed_data.provider_url\n\t );\n\t };\n\t\n\t return EmbedBlock;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = EmbedBlock;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 229:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _assign = __webpack_require__(80);\n\t\n\tvar _assign2 = _interopRequireDefault(_assign);\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _axios = __webpack_require__(61);\n\t\n\tvar _axios2 = _interopRequireDefault(_axios);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar ImageBlock = function (_React$Component) {\n\t (0, _inherits3['default'])(ImageBlock, _React$Component);\n\t\n\t function ImageBlock(props) {\n\t (0, _classCallCheck3['default'])(this, ImageBlock);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.blockPropsSrc = _this.blockPropsSrc.bind(_this);\n\t _this.defaultUrl = _this.defaultUrl.bind(_this);\n\t _this.defaultAspectRatio = _this.defaultAspectRatio.bind(_this);\n\t _this.updateData = _this.updateData.bind(_this);\n\t _this.replaceImg = _this.replaceImg.bind(_this);\n\t _this.startLoader = _this.startLoader.bind(_this);\n\t _this.stopLoader = _this.stopLoader.bind(_this);\n\t _this.handleUpload = _this.handleUpload.bind(_this);\n\t _this.aspectRatio = _this.aspectRatio.bind(_this);\n\t _this.updateDataSelection = _this.updateDataSelection.bind(_this);\n\t _this.handleGrafFigureSelectImg = _this.handleGrafFigureSelectImg.bind(_this);\n\t _this.getUploadUrl = _this.getUploadUrl.bind(_this);\n\t _this.uploadFile = _this.uploadFile.bind(_this);\n\t _this.uploadCompleted = _this.uploadCompleted.bind(_this);\n\t _this.updateProgressBar = _this.updateProgressBar.bind(_this);\n\t _this.placeHolderEnabled = _this.placeHolderEnabled.bind(_this);\n\t _this.placeholderText = _this.placeholderText.bind(_this);\n\t _this.handleFocus = _this.handleFocus.bind(_this);\n\t _this.render = _this.render.bind(_this);\n\t var existing_data = _this.props.block.getData().toJS();\n\t\n\t _this.config = _this.props.blockProps.config;\n\t _this.file = _this.props.blockProps.data.get('file');\n\t _this.state = {\n\t loading: false,\n\t selected: false,\n\t loading_progress: 0,\n\t enabled: false,\n\t caption: _this.defaultPlaceholder(),\n\t direction: existing_data.direction || \"center\",\n\t width: 0,\n\t height: 0,\n\t file: null,\n\t url: _this.blockPropsSrc() || _this.defaultUrl(existing_data),\n\t aspect_ratio: _this.defaultAspectRatio(existing_data)\n\t };\n\t return _this;\n\t }\n\t\n\t ImageBlock.prototype.blockPropsSrc = function blockPropsSrc() {\n\t // console.log @.props.blockProps.data.src\n\t return this.props.blockProps.data.src;\n\t };\n\t /*\n\t debugger\n\t block = @.props\n\t entity = block.block.getEntityAt(0)\n\t if entity\n\t data = Entity.get(entity).getData().src\n\t else\n\t null\n\t */\n\t\n\t ImageBlock.prototype.defaultUrl = function defaultUrl(data) {\n\t if (data.url) {\n\t return data.url;\n\t }\n\t\n\t if (data.url) {\n\t if (data.file) {\n\t return URL.createObjectURL(data.file);\n\t } else {\n\t return data.url;\n\t }\n\t } else {\n\t return this.props.blockProps.data.src;\n\t }\n\t };\n\t\n\t ImageBlock.prototype.defaultPlaceholder = function defaultPlaceholder() {\n\t return this.props.blockProps.config.image_caption_placeholder;\n\t };\n\t\n\t ImageBlock.prototype.defaultAspectRatio = function defaultAspectRatio(data) {\n\t if (data.aspect_ratio) {\n\t return {\n\t width: data.aspect_ratio['width'],\n\t height: data.aspect_ratio['height'],\n\t ratio: data.aspect_ratio['ratio']\n\t };\n\t } else {\n\t return {\n\t width: 0,\n\t height: 0,\n\t ratio: 100\n\t };\n\t }\n\t };\n\t\n\t ImageBlock.prototype.getAspectRatio = function getAspectRatio(w, h) {\n\t var maxWidth = 1000;\n\t var maxHeight = 1000;\n\t var ratio = 0;\n\t var width = w; // Current image width\n\t var height = h; // Current image height\n\t\n\t // Check if the current width is larger than the max\n\t if (width > maxWidth) {\n\t ratio = maxWidth / width; // get ratio for scaling image\n\t height = height * ratio; // Reset height to match scaled image\n\t width = width * ratio; // Reset width to match scaled image\n\t\n\t // Check if current height is larger than max\n\t } else if (height > maxHeight) {\n\t ratio = maxHeight / height; // get ratio for scaling image\n\t width = width * ratio; // Reset width to match scaled image\n\t height = height * ratio; // Reset height to match scaled image\n\t }\n\t\n\t var fill_ratio = height / width * 100;\n\t var result = { width: width, height: height, ratio: fill_ratio };\n\t // console.log result\n\t return result;\n\t };\n\t\n\t // will update block state\n\t\n\t\n\t ImageBlock.prototype.updateData = function updateData() {\n\t var blockProps = this.props.blockProps;\n\t var block = this.props.block;\n\t var getEditorState = this.props.blockProps.getEditorState;\n\t var setEditorState = this.props.blockProps.setEditorState;\n\t\n\t var data = block.getData();\n\t var newData = data.merge(this.state).merge({ forceUpload: false });\n\t return setEditorState((0, _index.updateDataOfBlock)(getEditorState(), block, newData));\n\t };\n\t\n\t ImageBlock.prototype.replaceImg = function replaceImg() {\n\t var _this2 = this;\n\t\n\t this.img = new Image();\n\t this.img.src = this.refs.image_tag.src;\n\t this.setState({\n\t url: this.img.src });\n\t var self = this;\n\t // exit only when not blob and not forceUload\n\t if (!this.img.src.includes(\"blob:\") && !this.props.block.data.get(\"forceUpload\")) {\n\t return;\n\t }\n\t return this.img.onload = function () {\n\t _this2.setState({\n\t width: _this2.img.width,\n\t height: _this2.img.height,\n\t aspect_ratio: self.getAspectRatio(_this2.img.width, _this2.img.height)\n\t });\n\t\n\t return _this2.handleUpload();\n\t };\n\t };\n\t\n\t ImageBlock.prototype.startLoader = function startLoader() {\n\t return this.setState({\n\t loading: true });\n\t };\n\t\n\t ImageBlock.prototype.stopLoader = function stopLoader() {\n\t return this.setState({\n\t loading: false });\n\t };\n\t\n\t ImageBlock.prototype.handleUpload = function handleUpload() {\n\t this.startLoader();\n\t this.props.blockProps.addLock();\n\t this.updateData();\n\t return this.uploadFile();\n\t };\n\t\n\t ImageBlock.prototype.componentDidMount = function componentDidMount() {\n\t return this.replaceImg();\n\t };\n\t\n\t ImageBlock.prototype.aspectRatio = function aspectRatio() {\n\t return {\n\t maxWidth: '' + this.state.aspect_ratio.width,\n\t maxHeight: '' + this.state.aspect_ratio.height,\n\t ratio: '' + this.state.aspect_ratio.height\n\t };\n\t };\n\t\n\t ImageBlock.prototype.updateDataSelection = function updateDataSelection() {\n\t var _props$blockProps = this.props.blockProps,\n\t getEditorState = _props$blockProps.getEditorState,\n\t setEditorState = _props$blockProps.setEditorState;\n\t\n\t var newselection = getEditorState().getSelection().merge({\n\t anchorKey: this.props.block.getKey(),\n\t focusKey: this.props.block.getKey()\n\t });\n\t\n\t return setEditorState(_draftJs.EditorState.forceSelection(getEditorState(), newselection));\n\t };\n\t\n\t ImageBlock.prototype.handleGrafFigureSelectImg = function handleGrafFigureSelectImg(e) {\n\t e.preventDefault();\n\t return this.setState({ selected: true }, this.updateDataSelection);\n\t };\n\t\n\t //main_editor.onChange(main_editor.state.editorState)\n\t\n\t ImageBlock.prototype.coords = function coords() {\n\t return {\n\t maxWidth: this.state.aspect_ratio.width + 'px',\n\t maxHeight: this.state.aspect_ratio.height + 'px'\n\t };\n\t };\n\t\n\t ImageBlock.prototype.getBase64Image = function getBase64Image(img) {\n\t var canvas = document.createElement(\"canvas\");\n\t canvas.width = img.width;\n\t canvas.height = img.height;\n\t var ctx = canvas.getContext(\"2d\");\n\t ctx.drawImage(img, 0, 0);\n\t var dataURL = canvas.toDataURL(\"image/png\");\n\t\n\t return dataURL;\n\t };\n\t\n\t ImageBlock.prototype.formatData = function formatData() {\n\t var formData = new FormData();\n\t if (this.file) {\n\t var formName = this.config.upload_formName || 'file';\n\t\n\t formData.append(formName, this.file);\n\t return formData;\n\t } else {\n\t formData.append('url', this.props.blockProps.data.get(\"url\"));\n\t return formData;\n\t }\n\t };\n\t\n\t ImageBlock.prototype.getUploadUrl = function getUploadUrl() {\n\t var url = this.config.upload_url;\n\t if (typeof url === \"function\") {\n\t return url();\n\t } else {\n\t return url;\n\t }\n\t };\n\t\n\t ImageBlock.prototype.getUploadHeaders = function getUploadHeaders() {\n\t return this.config.upload_headers || {};\n\t };\n\t\n\t ImageBlock.prototype.uploadFile = function uploadFile() {\n\t var _this3 = this;\n\t\n\t var handleUp = void 0;\n\t (0, _axios2['default'])({\n\t method: 'post',\n\t url: this.getUploadUrl(),\n\t headers: this.getUploadHeaders(),\n\t data: this.formatData(),\n\t onUploadProgress: function onUploadProgress(e) {\n\t return _this3.updateProgressBar(e);\n\t }\n\t }).then(function (result) {\n\t _this3.uploadCompleted(result.data);\n\t _this3.props.blockProps.removeLock();\n\t _this3.stopLoader();\n\t _this3.file = null;\n\t\n\t if (_this3.config.upload_callback) {\n\t return _this3.config.upload_callback(result, _this3);\n\t }\n\t })['catch'](function (error) {\n\t _this3.props.blockProps.removeLock();\n\t _this3.stopLoader();\n\t\n\t console.log('ERROR: got error uploading file ' + error);\n\t if (_this3.config.upload_error_callback) {\n\t return _this3.config.upload_error_callback(error, _this3);\n\t }\n\t });\n\t\n\t return handleUp = function handleUp(json_response) {\n\t return _this3.uploadCompleted(json_response, n);\n\t };\n\t };\n\t\n\t ImageBlock.prototype.uploadCompleted = function uploadCompleted(json) {\n\t return this.setState({ url: json.url }, this.updateData);\n\t };\n\t\n\t ImageBlock.prototype.updateProgressBar = function updateProgressBar(e) {\n\t var complete = this.state.loading_progress;\n\t if (e.lengthComputable) {\n\t complete = e.loaded / e.total * 100;\n\t complete = complete != null ? complete : { complete: 0 };\n\t this.setState({\n\t loading_progress: complete });\n\t return console.log('complete: ' + complete);\n\t }\n\t };\n\t\n\t ImageBlock.prototype.placeHolderEnabled = function placeHolderEnabled() {\n\t return this.state.enabled || this.props.block.getText();\n\t };\n\t\n\t ImageBlock.prototype.placeholderText = function placeholderText() {\n\t if (this.placeHolderEnabled()) {\n\t return \"\";\n\t }\n\t return \"Write caption for image (optional)\";\n\t };\n\t\n\t ImageBlock.prototype.handleFocus = function handleFocus(e) {\n\t var _this4 = this;\n\t\n\t // console.log \"focus on placeholder\"\n\t return setTimeout(function () {\n\t return _this4.setState({\n\t enabled: true });\n\t }, 0);\n\t };\n\t\n\t ImageBlock.prototype.render = function render() {\n\t\n\t return _react2['default'].createElement(\n\t 'div',\n\t { ref: 'image_tag2', suppressContentEditableWarning: true },\n\t _react2['default'].createElement(\n\t 'div',\n\t { className: 'aspectRatioPlaceholder is-locked',\n\t style: this.coords(),\n\t onClick: this.handleGrafFigureSelectImg },\n\t _react2['default'].createElement('div', { style: { paddingBottom: this.state.aspect_ratio.ratio + '%' },\n\t className: 'aspect-ratio-fill' }),\n\t _react2['default'].createElement('img', { src: this.state.url,\n\t ref: 'image_tag',\n\t height: this.state.aspect_ratio.height,\n\t width: this.state.aspect_ratio.width,\n\t className: 'graf-image' }),\n\t _react2['default'].createElement(Loader, { toggle: this.state.loading,\n\t progress: this.state.loading_progress })\n\t ),\n\t _react2['default'].createElement(\n\t 'figcaption',\n\t { className: 'imageCaption', onMouseDown: this.handleFocus },\n\t !this.state.enabled ? _react2['default'].createElement(\n\t 'span',\n\t { className: 'danteDefaultPlaceholder' },\n\t this.placeholderText()\n\t ) : undefined,\n\t _react2['default'].createElement(_draftJs.EditorBlock, (0, _assign2['default'])({}, this.props, {\n\t \"editable\": true, \"className\": \"imageCaption\" }))\n\t )\n\t );\n\t };\n\t\n\t return ImageBlock;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = ImageBlock;\n\t\n\tvar Loader = function (_React$Component2) {\n\t (0, _inherits3['default'])(Loader, _React$Component2);\n\t\n\t function Loader() {\n\t (0, _classCallCheck3['default'])(this, Loader);\n\t return (0, _possibleConstructorReturn3['default'])(this, _React$Component2.apply(this, arguments));\n\t }\n\t\n\t Loader.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'div',\n\t null,\n\t this.props.toggle ? _react2['default'].createElement(\n\t 'div',\n\t { className: 'image-upoader-loader' },\n\t _react2['default'].createElement(\n\t 'p',\n\t null,\n\t this.props.progress === 100 ? \"processing image...\" : _react2['default'].createElement(\n\t 'span',\n\t null,\n\t _react2['default'].createElement(\n\t 'span',\n\t null,\n\t 'loading'\n\t ),\n\t ' ',\n\t Math.round(this.props.progress)\n\t )\n\t )\n\t ) : undefined\n\t );\n\t };\n\t\n\t return Loader;\n\t}(_react2['default'].Component);\n\t\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 230:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _assign = __webpack_require__(80);\n\t\n\tvar _assign2 = _interopRequireDefault(_assign);\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar PlaceholderBlock = function (_React$Component) {\n\t (0, _inherits3['default'])(PlaceholderBlock, _React$Component);\n\t\n\t function PlaceholderBlock(props) {\n\t (0, _classCallCheck3['default'])(this, PlaceholderBlock);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.placeholderText = _this.placeholderText.bind(_this);\n\t _this.placeholderFromProps = _this.placeholderFromProps.bind(_this);\n\t _this.defaultText = _this.defaultText.bind(_this);\n\t _this.handleFocus = _this.handleFocus.bind(_this);\n\t _this.classForDefault = _this.classForDefault.bind(_this);\n\t _this.state = {\n\t enabled: false,\n\t data: _this.props.blockProps.data.toJS()\n\t };\n\t return _this;\n\t }\n\t\n\t PlaceholderBlock.prototype.placeholderText = function placeholderText() {\n\t if (this.state.enabled) {\n\t return \"\";\n\t }\n\t return this.props.blockProps.data.toJS().placeholder || this.placeholderFromProps() || this.defaultText();\n\t };\n\t //if @.props.blockProps.data then @.props.blockProps.data.placeholder else @defaultText()\n\t\n\t\n\t PlaceholderBlock.prototype.placeholderFromProps = function placeholderFromProps() {\n\t return this.props.block.toJS().placeholder;\n\t };\n\t\n\t PlaceholderBlock.prototype.defaultText = function defaultText() {\n\t return \"write something \";\n\t };\n\t\n\t PlaceholderBlock.prototype.componentDidMount = function componentDidMount() {};\n\t\n\t PlaceholderBlock.prototype.handleFocus = function handleFocus(e) {\n\t var _this2 = this;\n\t\n\t // console.log \"focus on placeholder\"\n\t return setTimeout(function () {\n\t return _this2.setState({\n\t enabled: true });\n\t }, 0);\n\t };\n\t\n\t PlaceholderBlock.prototype.classForDefault = function classForDefault() {\n\t if (!this.state.enabled) {\n\t return \"defaultValue defaultValue--root\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t PlaceholderBlock.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'span',\n\t { className: this.classForDefault(), onMouseDown: this.handleFocus },\n\t this.placeholderText(),\n\t _react2['default'].createElement(_draftJs.EditorBlock, (0, _assign2['default'])({}, this.props, {\n\t \"className\": \"imageCaption\",\n\t \"placeholder\": \"escrive alalal\"\n\t }))\n\t );\n\t };\n\t\n\t return PlaceholderBlock;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = PlaceholderBlock;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 231:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _assign = __webpack_require__(80);\n\t\n\tvar _assign2 = _interopRequireDefault(_assign);\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tvar _axios = __webpack_require__(61);\n\t\n\tvar _axios2 = _interopRequireDefault(_axios);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar VideoBlock = function (_React$Component) {\n\t (0, _inherits3['default'])(VideoBlock, _React$Component);\n\t\n\t function VideoBlock(props) {\n\t (0, _classCallCheck3['default'])(this, VideoBlock);\n\t\n\t //api_key = \"86c28a410a104c8bb58848733c82f840\"\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.updateData = _this.updateData.bind(_this);\n\t _this.dataForUpdate = _this.dataForUpdate.bind(_this);\n\t _this.state = { embed_data: _this.defaultData() };\n\t return _this;\n\t }\n\t\n\t VideoBlock.prototype.defaultData = function defaultData() {\n\t var existing_data = this.props.block.getData().toJS();\n\t return existing_data.embed_data || {};\n\t };\n\t\n\t // will update block state\n\t\n\t\n\t VideoBlock.prototype.updateData = function updateData() {\n\t var _props = this.props,\n\t block = _props.block,\n\t blockProps = _props.blockProps;\n\t var _props$blockProps = this.props.blockProps,\n\t getEditorState = _props$blockProps.getEditorState,\n\t setEditorState = _props$blockProps.setEditorState;\n\t\n\t var data = block.getData();\n\t var newData = data.merge(this.state);\n\t return setEditorState((0, _index.updateDataOfBlock)(getEditorState(), block, newData));\n\t };\n\t\n\t VideoBlock.prototype.dataForUpdate = function dataForUpdate() {\n\t return this.props.blockProps.data.toJS();\n\t };\n\t\n\t VideoBlock.prototype.componentDidMount = function componentDidMount() {\n\t var _this2 = this;\n\t\n\t if (!this.props.blockProps.data) {\n\t return;\n\t }\n\t // ensure data isnt already loaded\n\t if (!this.dataForUpdate().endpoint && !this.dataForUpdate().provisory_text) {\n\t return;\n\t }\n\t\n\t return (0, _axios2['default'])({\n\t method: 'get',\n\t url: '' + this.dataForUpdate().endpoint + this.dataForUpdate().provisory_text + '&scheme=https'\n\t }).then(function (result) {\n\t return _this2.setState({ embed_data: result.data } //JSON.parse(data.responseText)\n\t , _this2.updateData);\n\t })['catch'](function (error) {\n\t return console.log(\"TODO: error\");\n\t });\n\t };\n\t\n\t VideoBlock.prototype.classForImage = function classForImage() {\n\t if (this.state.embed_data.thumbnail_url) {\n\t return \"\";\n\t } else {\n\t return \"mixtapeImage--empty u-ignoreBlock\";\n\t }\n\t };\n\t\n\t VideoBlock.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'figure',\n\t { className: 'graf--figure graf--iframe graf--first', tabIndex: '0' },\n\t _react2['default'].createElement('div', { className: 'iframeContainer',\n\t dangerouslySetInnerHTML: { __html: this.state.embed_data.html } }),\n\t _react2['default'].createElement(\n\t 'figcaption',\n\t { className: 'imageCaption' },\n\t _react2['default'].createElement(_draftJs.EditorBlock, (0, _assign2['default'])({}, this.props, { \"className\": \"imageCaption\" }))\n\t )\n\t );\n\t };\n\t\n\t return VideoBlock;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = VideoBlock;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 232:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t\n\tvar _stringify = __webpack_require__(79);\n\t\n\tvar _stringify2 = _interopRequireDefault(_stringify);\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar Debug = function (_React$Component) {\n\t (0, _inherits3[\"default\"])(Debug, _React$Component);\n\t\n\t function Debug() {\n\t (0, _classCallCheck3[\"default\"])(this, Debug);\n\t\n\t var _this = (0, _possibleConstructorReturn3[\"default\"])(this, _React$Component.call(this));\n\t\n\t _this.handleToggleReadOnly = _this.handleToggleReadOnly.bind(_this);\n\t _this.handleTestEmitAndDecode = _this.handleTestEmitAndDecode.bind(_this);\n\t _this.handleTestEmitTEXT = _this.handleTestEmitTEXT.bind(_this);\n\t _this.testEmitAndDecode = _this.testEmitAndDecode.bind(_this);\n\t _this.testEmitTEXT = _this.testEmitTEXT.bind(_this);\n\t _this.logState = _this.logState.bind(_this);\n\t _this.toggleDisplay = _this.toggleDisplay.bind(_this);\n\t _this.open = _this.open.bind(_this);\n\t _this.render = _this.render.bind(_this);\n\t _this.state = {\n\t output: \"\",\n\t display: \"none\"\n\t };\n\t return _this;\n\t }\n\t\n\t Debug.prototype.handleToggleReadOnly = function handleToggleReadOnly(e) {\n\t e.preventDefault();\n\t this.props.editor.toggleEditable();\n\t return false;\n\t };\n\t\n\t Debug.prototype.handleTestEmitAndDecode = function handleTestEmitAndDecode(e) {\n\t e.preventDefault();\n\t return this.testEmitAndDecode();\n\t };\n\t\n\t Debug.prototype.handleTestEmitTEXT = function handleTestEmitTEXT(e) {\n\t e.preventDefault();\n\t return this.testEmitTEXT();\n\t };\n\t\n\t Debug.prototype.testEmitAndDecode = function testEmitAndDecode(e) {\n\t var raw_as_json = this.props.editor.emitSerializedOutput();\n\t this.props.editor.setState({\n\t editorState: this.props.editor.decodeEditorContent(raw_as_json) }, this.logState((0, _stringify2[\"default\"])(raw_as_json)));\n\t return false;\n\t };\n\t\n\t Debug.prototype.testEmitTEXT = function testEmitTEXT() {\n\t var text = this.props.editor.getTextFromEditor();\n\t return this.logState(text);\n\t };\n\t\n\t Debug.prototype.logState = function logState(raw) {\n\t return this.setState({ output: raw }, this.open);\n\t };\n\t\n\t Debug.prototype.toggleDisplay = function toggleDisplay(e) {\n\t e.preventDefault();\n\t var d = this.state.display === \"block\" ? \"none\" : this.state.display;\n\t return this.setState({\n\t display: d });\n\t };\n\t\n\t Debug.prototype.open = function open() {\n\t return this.setState({\n\t display: \"block\" });\n\t };\n\t\n\t Debug.prototype.render = function render() {\n\t return _react2[\"default\"].createElement(\n\t \"div\",\n\t null,\n\t _react2[\"default\"].createElement(\n\t \"div\",\n\t { className: \"debugControls\" },\n\t _react2[\"default\"].createElement(\n\t \"ul\",\n\t null,\n\t _react2[\"default\"].createElement(\n\t \"li\",\n\t null,\n\t \" LOCKS: \",\n\t this.props.editor.state.locks,\n\t \" \"\n\t ),\n\t _react2[\"default\"].createElement(\n\t \"li\",\n\t null,\n\t _react2[\"default\"].createElement(\n\t \"a\",\n\t { href: \"#\", onClick: this.handleToggleReadOnly },\n\t \"EDITABLE: \",\n\t this.props.editor.state.read_only ? 'NO' : 'YES'\n\t )\n\t ),\n\t _react2[\"default\"].createElement(\n\t \"li\",\n\t null,\n\t _react2[\"default\"].createElement(\n\t \"a\",\n\t { href: \"#\", onClick: this.handleTestEmitTEXT },\n\t \"EDITOR TEXT\"\n\t )\n\t ),\n\t _react2[\"default\"].createElement(\n\t \"li\",\n\t null,\n\t _react2[\"default\"].createElement(\n\t \"a\",\n\t { href: \"#\", onClick: this.handleTestEmitAndDecode },\n\t \"EDITOR STATE\"\n\t )\n\t )\n\t )\n\t ),\n\t _react2[\"default\"].createElement(\n\t \"div\",\n\t { className: \"debugZone\", style: { display: this.state.display } },\n\t _react2[\"default\"].createElement(\"a\", { href: \"#\", className: \"dante-debug-close close\", onClick: this.toggleDisplay }),\n\t _react2[\"default\"].createElement(\n\t \"div\",\n\t { className: \"debugOutput\" },\n\t _react2[\"default\"].createElement(\n\t \"h2\",\n\t null,\n\t \"EDITOR OUTPUT\"\n\t ),\n\t this.state.output.length > 0 ? _react2[\"default\"].createElement(\n\t \"pre\",\n\t null,\n\t this.state.output\n\t ) : undefined\n\t )\n\t )\n\t );\n\t };\n\t\n\t return Debug;\n\t}(_react2[\"default\"].Component);\n\t\n\texports[\"default\"] = Debug;\n\tmodule.exports = exports[\"default\"];\n\n/***/ },\n\n/***/ 233:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar Link = function (_React$Component) {\n\t (0, _inherits3['default'])(Link, _React$Component);\n\t\n\t function Link(props) {\n\t (0, _classCallCheck3['default'])(this, Link);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this._validateLink = _this._validateLink.bind(_this);\n\t _this._checkProtocol = _this._checkProtocol.bind(_this);\n\t _this._showPopLinkOver = _this._showPopLinkOver.bind(_this);\n\t _this._hidePopLinkOver = _this._hidePopLinkOver.bind(_this);\n\t _this.isHover = false;\n\t return _this;\n\t }\n\t\n\t Link.prototype._validateLink = function _validateLink() {\n\t var pattern = new RegExp('^(https?:\\/\\/)?' + // protocol\n\t '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name\n\t '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address\n\t '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path\n\t '(\\?[&a-z\\d%_.~+=-]*)?' + // query string\n\t '(\\#[-a-z\\d_]*)?$', 'i'); // fragment locater\n\t if (!pattern.test(str)) {\n\t alert(\"Please enter a valid URL.\");\n\t return false;\n\t } else {\n\t return true;\n\t }\n\t };\n\t\n\t Link.prototype._checkProtocol = function _checkProtocol() {\n\t return console.log(\"xcvd\");\n\t };\n\t\n\t Link.prototype._showPopLinkOver = function _showPopLinkOver(e) {\n\t if (!this.data.showPopLinkOver) {\n\t return;\n\t }\n\t return this.data.showPopLinkOver(this.refs.link);\n\t };\n\t\n\t Link.prototype._hidePopLinkOver = function _hidePopLinkOver(e) {\n\t if (!this.data.hidePopLinkOver) {\n\t return;\n\t }\n\t return this.data.hidePopLinkOver();\n\t };\n\t\n\t Link.prototype.render = function render() {\n\t this.data = _draftJs.Entity.get(this.props.entityKey).getData();\n\t\n\t return _react2['default'].createElement(\n\t 'a',\n\t {\n\t ref: 'link',\n\t href: this.data.url,\n\t className: 'markup--anchor',\n\t onMouseOver: this._showPopLinkOver,\n\t onMouseOut: this._hidePopLinkOver\n\t },\n\t this.props.children\n\t );\n\t };\n\t\n\t return Link;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = Link;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 234:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tvar _selection = __webpack_require__(78);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar DanteInlineTooltip = function (_React$Component) {\n\t (0, _inherits3['default'])(DanteInlineTooltip, _React$Component);\n\t\n\t function DanteInlineTooltip(props) {\n\t (0, _classCallCheck3['default'])(this, DanteInlineTooltip);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.display = _this.display.bind(_this);\n\t _this.show = _this.show.bind(_this);\n\t _this.hide = _this.hide.bind(_this);\n\t _this._toggleScaled = _this._toggleScaled.bind(_this);\n\t _this.scale = _this.scale.bind(_this);\n\t _this.collapse = _this.collapse.bind(_this);\n\t _this.componentWillReceiveProps = _this.componentWillReceiveProps.bind(_this);\n\t _this.clickOnFileUpload = _this.clickOnFileUpload.bind(_this);\n\t _this.handlePlaceholder = _this.handlePlaceholder.bind(_this);\n\t _this.insertImage = _this.insertImage.bind(_this);\n\t _this.handleFileInput = _this.handleFileInput.bind(_this);\n\t _this.widgets = _this.widgets.bind(_this);\n\t _this.clickHandler = _this.clickHandler.bind(_this);\n\t _this.relocate = _this.relocate.bind(_this);\n\t _this.state = {\n\t position: { top: 0, left: 0 },\n\t show: false,\n\t scaled: false\n\t };\n\t return _this;\n\t }\n\t\n\t DanteInlineTooltip.prototype.display = function display(b) {\n\t if (b) {\n\t return this.show();\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.show = function show() {\n\t return this.setState({\n\t show: true });\n\t };\n\t\n\t DanteInlineTooltip.prototype.hide = function hide() {\n\t return this.setState({\n\t show: false });\n\t };\n\t\n\t DanteInlineTooltip.prototype.setPosition = function setPosition(coords) {\n\t return this.setState({\n\t position: coords });\n\t };\n\t\n\t DanteInlineTooltip.prototype._toggleScaled = function _toggleScaled(ev) {\n\t if (this.state.scaled) {\n\t return this.collapse();\n\t } else {\n\t return this.scale();\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.scale = function scale() {\n\t return this.setState({\n\t scaled: true });\n\t };\n\t\n\t DanteInlineTooltip.prototype.collapse = function collapse() {\n\t return this.setState({\n\t scaled: false });\n\t };\n\t\n\t DanteInlineTooltip.prototype.componentWillReceiveProps = function componentWillReceiveProps(newProps) {\n\t return this.collapse();\n\t };\n\t\n\t DanteInlineTooltip.prototype.activeClass = function activeClass() {\n\t //if @props.show then \"is-active\" else \"\"\n\t if (this.isActive()) {\n\t return \"is-active\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.isActive = function isActive() {\n\t return this.state.show;\n\t };\n\t\n\t DanteInlineTooltip.prototype.scaledClass = function scaledClass() {\n\t if (this.state.scaled) {\n\t return \"is-scaled\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.scaledWidth = function scaledWidth() {\n\t if (this.state.scaled) {\n\t return \"124\";\n\t } else {\n\t return \"0\";\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.clickOnFileUpload = function clickOnFileUpload() {\n\t this.refs.fileInput.click();\n\t this.collapse();\n\t return this.hide();\n\t };\n\t\n\t DanteInlineTooltip.prototype.handlePlaceholder = function handlePlaceholder(input) {\n\t var opts = {\n\t type: input.widget_options.insert_block,\n\t placeholder: input.options.placeholder,\n\t endpoint: input.options.endpoint\n\t };\n\t\n\t return this.props.onChange((0, _index.resetBlockWithType)(this.props.editorState, 'placeholder', opts));\n\t };\n\t\n\t DanteInlineTooltip.prototype.insertImage = function insertImage(file) {\n\t var opts = {\n\t url: URL.createObjectURL(file),\n\t file: file\n\t };\n\t\n\t return this.props.onChange((0, _index.addNewBlock)(this.props.editorState, 'image', opts));\n\t };\n\t\n\t DanteInlineTooltip.prototype.handleFileInput = function handleFileInput(e) {\n\t var fileList = e.target.files;\n\t // TODO: support multiple file uploads\n\t /*\n\t Object.keys(fileList).forEach (o)=>\n\t @.insertImage(fileList[0])\n\t */\n\t return this.insertImage(fileList[0]);\n\t };\n\t\n\t DanteInlineTooltip.prototype.widgets = function widgets() {\n\t return this.props.editor.widgets;\n\t };\n\t\n\t DanteInlineTooltip.prototype.clickHandler = function clickHandler(e, type) {\n\t var request_block = this.widgets().find(function (o) {\n\t return o.icon === type;\n\t });\n\t\n\t switch (request_block.widget_options.insertion) {\n\t case \"upload\":\n\t return this.clickOnFileUpload(e, request_block);\n\t case \"placeholder\":\n\t return this.handlePlaceholder(request_block);\n\t default:\n\t return console.log('WRONG TYPE FOR ' + request_block.widget_options.insertion);\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.getItems = function getItems() {\n\t return this.widgets().filter(function (o) {\n\t return o.widget_options.displayOnInlineTooltip;\n\t });\n\t };\n\t\n\t DanteInlineTooltip.prototype.isDescendant = function isDescendant(parent, child) {\n\t var node = child.parentNode;\n\t while (node !== null) {\n\t if (node === parent) {\n\t return true;\n\t }\n\t node = node.parentNode;\n\t }\n\t return false;\n\t };\n\t\n\t DanteInlineTooltip.prototype.relocate = function relocate() {\n\t var editorState = this.props.editorState;\n\t\n\t\n\t if (editorState.getSelection().isCollapsed()) {\n\t\n\t var currentBlock = (0, _index.getCurrentBlock)(editorState);\n\t var blockType = currentBlock.getType();\n\t\n\t var contentState = editorState.getCurrentContent();\n\t var selectionState = editorState.getSelection();\n\t\n\t var block = contentState.getBlockForKey(selectionState.anchorKey);\n\t\n\t var nativeSelection = (0, _selection.getSelection)(window);\n\t if (!nativeSelection.rangeCount) {\n\t return;\n\t }\n\t\n\t var node = (0, _index.getNode)();\n\t\n\t var selectionBoundary = (0, _selection.getSelectionRect)(nativeSelection);\n\t var coords = selectionBoundary; //utils.getSelectionDimensions(node)\n\t\n\t var parent = _reactDom2['default'].findDOMNode(this.props.editor);\n\t var parentBoundary = parent.getBoundingClientRect();\n\t\n\t // hide if selected node is not in editor\n\t // debugger\n\t //console.log @isDescendant(parent, nativeSelection.anchorNode)\n\t\n\t if (!this.isDescendant(parent, nativeSelection.anchorNode)) {\n\t this.hide();\n\t return;\n\t }\n\t\n\t // checkeamos si esta vacio\n\t this.display(block.getText().length === 0 && blockType === \"unstyled\");\n\t return this.setPosition({\n\t top: coords.top + window.scrollY,\n\t left: coords.left + window.scrollX - 60\n\t });\n\t\n\t /*\n\t @refs.image_popover.display(blockType is \"image\")\n\t if blockType is \"image\"\n\t selectionBoundary = node.anchorNode.parentNode.parentNode.parentNode.getBoundingClientRect()\n\t *el = document.querySelector(\"#dante_image_popover\")\n\t el = @refs.image_popover.refs.image_popover\n\t padd = el.offsetWidth / 2\n\t @refs.image_popover.setPosition\n\t top: selectionBoundary.top - parentBoundary.top + 60\n\t left: selectionBoundary.left + (selectionBoundary.width / 2) - padd\n\t *@setState\n\t * image_popover_position:\n\t * top: selectionBoundary.top - parentBoundary.top + 60\n\t * left: selectionBoundary.left + (selectionBoundary.width / 2) - padd\n\t *\n\t */\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteInlineTooltip.prototype.render = function render() {\n\t var _this2 = this;\n\t\n\t return _react2['default'].createElement(\n\t 'div',\n\t {\n\t className: 'inlineTooltip ' + this.activeClass() + ' ' + this.scaledClass(),\n\t style: this.state.position\n\t },\n\t _react2['default'].createElement(\n\t 'button',\n\t {\n\t className: 'inlineTooltip-button control',\n\t title: 'Close Menu',\n\t 'data-action': 'inline-menu',\n\t onClick: this._toggleScaled\n\t },\n\t _react2['default'].createElement('span', { className: 'tooltip-icon dante-icon-plus' })\n\t ),\n\t _react2['default'].createElement(\n\t 'div',\n\t {\n\t className: 'inlineTooltip-menu',\n\t style: { width: this.scaledWidth() + 'px' }\n\t },\n\t this.getItems().map(function (item, i) {\n\t return _react2['default'].createElement(InlineTooltipItem, {\n\t item: item,\n\t key: i,\n\t clickHandler: _this2.clickHandler\n\t });\n\t }),\n\t _react2['default'].createElement('input', {\n\t type: 'file',\n\t style: { display: 'none' },\n\t ref: 'fileInput',\n\t multiple: 'multiple',\n\t onChange: this.handleFileInput\n\t })\n\t )\n\t );\n\t };\n\t\n\t return DanteInlineTooltip;\n\t}(_react2['default'].Component);\n\t\n\tvar InlineTooltipItem = function (_React$Component2) {\n\t (0, _inherits3['default'])(InlineTooltipItem, _React$Component2);\n\t\n\t function InlineTooltipItem() {\n\t (0, _classCallCheck3['default'])(this, InlineTooltipItem);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this3 = (0, _possibleConstructorReturn3['default'])(this, _React$Component2.call.apply(_React$Component2, [this].concat(args)));\n\t\n\t _this3.clickHandler = _this3.clickHandler.bind(_this3);\n\t return _this3;\n\t }\n\t\n\t InlineTooltipItem.prototype.clickHandler = function clickHandler(e) {\n\t e.preventDefault();\n\t return this.props.clickHandler(e, this.props.item.icon);\n\t };\n\t\n\t InlineTooltipItem.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'button',\n\t {\n\t className: 'inlineTooltip-button scale',\n\t title: this.props.title,\n\t onMouseDown: this.clickHandler\n\t },\n\t _react2['default'].createElement('span', { className: 'tooltip-icon dante-icon-' + this.props.item.icon })\n\t );\n\t };\n\t\n\t return InlineTooltipItem;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = DanteInlineTooltip;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 235:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _selection = __webpack_require__(78);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar DanteImagePopover = function (_React$Component) {\n\t (0, _inherits3['default'])(DanteImagePopover, _React$Component);\n\t\n\t function DanteImagePopover(props) {\n\t (0, _classCallCheck3['default'])(this, DanteImagePopover);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.display = _this.display.bind(_this);\n\t _this.show = _this.show.bind(_this);\n\t _this.hide = _this.hide.bind(_this);\n\t _this._toggleScaled = _this._toggleScaled.bind(_this);\n\t _this.scale = _this.scale.bind(_this);\n\t _this.collapse = _this.collapse.bind(_this);\n\t _this.relocate = _this.relocate.bind(_this);\n\t _this.componentWillReceiveProps = _this.componentWillReceiveProps.bind(_this);\n\t _this.handleClick = _this.handleClick.bind(_this);\n\t _this.state = {\n\t position: {\n\t top: 0,\n\t left: 0\n\t },\n\t show: false,\n\t scaled: false,\n\t buttons: [{ type: \"left\" }, { type: \"center\" }, { type: \"fill\" }, { type: \"wide\" }]\n\t };\n\t return _this;\n\t }\n\t\n\t DanteImagePopover.prototype.display = function display(b) {\n\t if (b) {\n\t return this.show();\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteImagePopover.prototype.show = function show() {\n\t return this.setState({\n\t show: true });\n\t };\n\t\n\t DanteImagePopover.prototype.hide = function hide() {\n\t return this.setState({\n\t show: false });\n\t };\n\t\n\t DanteImagePopover.prototype.setPosition = function setPosition(coords) {\n\t return this.setState({\n\t position: coords });\n\t };\n\t\n\t DanteImagePopover.prototype._toggleScaled = function _toggleScaled(ev) {\n\t if (this.state.scaled) {\n\t return this.collapse();\n\t } else {\n\t return this.scale();\n\t }\n\t };\n\t\n\t DanteImagePopover.prototype.scale = function scale() {\n\t return this.setState({\n\t scaled: true });\n\t };\n\t\n\t DanteImagePopover.prototype.collapse = function collapse() {\n\t return this.setState({\n\t scaled: false });\n\t };\n\t\n\t DanteImagePopover.prototype.relocate = function relocate() {\n\t var editorState = this.props.editorState;\n\t\n\t\n\t if (editorState.getSelection().isCollapsed()) {\n\t\n\t var currentBlock = (0, _index.getCurrentBlock)(editorState);\n\t var blockType = currentBlock.getType();\n\t\n\t var contentState = editorState.getCurrentContent();\n\t var selectionState = editorState.getSelection();\n\t\n\t var block = contentState.getBlockForKey(selectionState.anchorKey);\n\t\n\t var nativeSelection = (0, _selection.getSelection)(window);\n\t if (!nativeSelection.rangeCount) {\n\t return;\n\t }\n\t\n\t var node = (0, _index.getNode)();\n\t\n\t var selectionBoundary = (0, _selection.getSelectionRect)(nativeSelection);\n\t var coords = selectionBoundary;\n\t\n\t var parent = _reactDom2['default'].findDOMNode(this.props.editor);\n\t var parentBoundary = parent.getBoundingClientRect();\n\t\n\t this.display(blockType === \"image\");\n\t\n\t if (blockType === \"image\") {\n\t selectionBoundary = node.anchorNode.parentNode.parentNode.parentNode.getBoundingClientRect();\n\t var el = this.refs.image_popover;\n\t var padd = el.offsetWidth / 2;\n\t return this.setPosition({\n\t top: selectionBoundary.top - parentBoundary.top + 60,\n\t left: selectionBoundary.left + selectionBoundary.width / 2 - padd\n\t });\n\t }\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteImagePopover.prototype.componentWillReceiveProps = function componentWillReceiveProps(newProps) {\n\t return this.collapse();\n\t };\n\t\n\t DanteImagePopover.prototype.getStyle = function getStyle() {\n\t if (!this.state.position) {\n\t return {};\n\t }\n\t };\n\t\n\t DanteImagePopover.prototype.handleClick = function handleClick(item) {\n\t return this.props.editor.setDirection(item.type);\n\t };\n\t\n\t DanteImagePopover.prototype.render = function render() {\n\t var _this2 = this;\n\t\n\t return _react2['default'].createElement(\n\t 'div',\n\t {\n\t ref: 'image_popover',\n\t className: 'dante-popover popover--Aligntooltip popover--top popover--animated ' + (this.state.show ? 'is-active' : undefined),\n\t style: { top: this.state.position.top,\n\t left: this.state.position.left }\n\t },\n\t _react2['default'].createElement(\n\t 'div',\n\t { className: 'popover-inner' },\n\t _react2['default'].createElement(\n\t 'ul',\n\t { className: 'dante-menu-buttons' },\n\t this.state.buttons.map(function (item, i) {\n\t return _react2['default'].createElement(DanteImagePopoverItem, {\n\t item: item,\n\t handleClick: _this2.handleClick,\n\t key: i\n\t });\n\t })\n\t )\n\t ),\n\t _react2['default'].createElement('div', { className: 'popover-arrow' })\n\t );\n\t };\n\t\n\t return DanteImagePopover;\n\t}(_react2['default'].Component);\n\t\n\tvar DanteImagePopoverItem = function (_React$Component2) {\n\t (0, _inherits3['default'])(DanteImagePopoverItem, _React$Component2);\n\t\n\t function DanteImagePopoverItem() {\n\t (0, _classCallCheck3['default'])(this, DanteImagePopoverItem);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this3 = (0, _possibleConstructorReturn3['default'])(this, _React$Component2.call.apply(_React$Component2, [this].concat(args)));\n\t\n\t _this3.handleClick = _this3.handleClick.bind(_this3);\n\t _this3.render = _this3.render.bind(_this3);\n\t return _this3;\n\t }\n\t\n\t DanteImagePopoverItem.prototype.handleClick = function handleClick(e) {\n\t e.preventDefault();\n\t return this.props.handleClick(this.props.item);\n\t };\n\t\n\t DanteImagePopoverItem.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'li',\n\t {\n\t className: 'dante-menu-button align-' + this.props.item.type,\n\t onMouseDown: this.handleClick },\n\t _react2['default'].createElement('span', { className: 'tooltip-icon dante-icon-image-' + this.props.item.type })\n\t );\n\t };\n\t\n\t return DanteImagePopoverItem;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = DanteImagePopover;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 236:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar DanteAnchorPopover = function (_React$Component) {\n\t (0, _inherits3['default'])(DanteAnchorPopover, _React$Component);\n\t\n\t function DanteAnchorPopover(props) {\n\t (0, _classCallCheck3['default'])(this, DanteAnchorPopover);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this.display = _this.display.bind(_this);\n\t _this.show = _this.show.bind(_this);\n\t _this.hide = _this.hide.bind(_this);\n\t _this.relocate = _this.relocate.bind(_this);\n\t _this.render = _this.render.bind(_this);\n\t _this.state = {\n\t position: {\n\t top: 0,\n\t left: 0\n\t },\n\t show: false,\n\t url: \"\"\n\t };\n\t return _this;\n\t }\n\t\n\t DanteAnchorPopover.prototype.display = function display(b) {\n\t if (b) {\n\t return this.show();\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteAnchorPopover.prototype.show = function show() {\n\t return this.setState({\n\t show: true });\n\t };\n\t\n\t DanteAnchorPopover.prototype.hide = function hide() {\n\t return this.setState({\n\t show: false });\n\t };\n\t\n\t DanteAnchorPopover.prototype.setPosition = function setPosition(coords) {\n\t return this.setState({\n\t position: coords });\n\t };\n\t\n\t DanteAnchorPopover.prototype.relocate = function relocate(node) {\n\t if (node == null) {\n\t node = null;\n\t }\n\t if (!node) {\n\t return;\n\t }\n\t\n\t var editorState = this.props.editorState;\n\t\n\t var currentBlock = (0, _index.getCurrentBlock)(editorState);\n\t var blockType = currentBlock.getType();\n\t\n\t var contentState = editorState.getCurrentContent();\n\t var selectionState = editorState.getSelection();\n\t\n\t var selectionBoundary = node.getBoundingClientRect();\n\t var coords = selectionBoundary;\n\t\n\t var el = this.refs.dante_popover;\n\t var padd = el.offsetWidth / 2;\n\t\n\t var parent = _reactDom2['default'].findDOMNode(this.props.editor);\n\t var parentBoundary = parent.getBoundingClientRect();\n\t\n\t return {\n\t top: selectionBoundary.top - parentBoundary.top + 160,\n\t left: selectionBoundary.left + selectionBoundary.width / 2 - padd\n\t };\n\t };\n\t\n\t DanteAnchorPopover.prototype.render = function render() {\n\t var position = this.state.position;\n\t\n\t var style = {\n\t left: position.left,\n\t top: position.top,\n\t visibility: '' + (this.state.show ? 'visible' : 'hidden')\n\t };\n\t return _react2['default'].createElement(\n\t 'div',\n\t {\n\t ref: 'dante_popover',\n\t className: 'dante-popover popover--tooltip popover--Linktooltip popover--bottom is-active',\n\t style: style,\n\t onMouseOver: this.props.handleOnMouseOver,\n\t onMouseOut: this.props.handleOnMouseOut\n\t },\n\t _react2['default'].createElement(\n\t 'div',\n\t { className: 'popover-inner' },\n\t _react2['default'].createElement(\n\t 'a',\n\t { href: this.props.url, target: '_blank' },\n\t this.state.url\n\t )\n\t ),\n\t _react2['default'].createElement('div', { className: 'popover-arrow' })\n\t );\n\t };\n\t\n\t return DanteAnchorPopover;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = DanteAnchorPopover;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 237:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _possibleConstructorReturn2 = __webpack_require__(18);\n\t\n\tvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\t\n\tvar _inherits2 = __webpack_require__(17);\n\t\n\tvar _inherits3 = _interopRequireDefault(_inherits2);\n\t\n\tvar _react = __webpack_require__(5);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(9);\n\t\n\tvar _reactDom2 = _interopRequireDefault(_reactDom);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _selection = __webpack_require__(78);\n\t\n\tvar _index = __webpack_require__(24);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\tvar DanteTooltip = function (_React$Component) {\n\t (0, _inherits3['default'])(DanteTooltip, _React$Component);\n\t\n\t function DanteTooltip(props) {\n\t (0, _classCallCheck3['default'])(this, DanteTooltip);\n\t\n\t var _this = (0, _possibleConstructorReturn3['default'])(this, _React$Component.call(this, props));\n\t\n\t _this._clickInlineHandler = _this._clickInlineHandler.bind(_this);\n\t _this.display = _this.display.bind(_this);\n\t _this.show = _this.show.bind(_this);\n\t _this.hide = _this.hide.bind(_this);\n\t _this.relocate = _this.relocate.bind(_this);\n\t _this._clickBlockHandler = _this._clickBlockHandler.bind(_this);\n\t _this.displayLinkMode = _this.displayLinkMode.bind(_this);\n\t _this.displayActiveMenu = _this.displayActiveMenu.bind(_this);\n\t _this._enableLinkMode = _this._enableLinkMode.bind(_this);\n\t _this._disableLinkMode = _this._disableLinkMode.bind(_this);\n\t _this.handleInputEnter = _this.handleInputEnter.bind(_this);\n\t _this.confirmLink = _this.confirmLink.bind(_this);\n\t _this.inlineItems = _this.inlineItems.bind(_this);\n\t _this.blockItems = _this.blockItems.bind(_this);\n\t _this.getDefaultValue = _this.getDefaultValue.bind(_this);\n\t _this.getVisibleSelectionRect = _draftJs.getVisibleSelectionRect;\n\t _this.state = {\n\t link_mode: false,\n\t show: false,\n\t position: {}\n\t };\n\t return _this;\n\t }\n\t\n\t DanteTooltip.prototype._clickInlineHandler = function _clickInlineHandler(ev, style) {\n\t var _this2 = this;\n\t\n\t ev.preventDefault();\n\t\n\t this.props.onChange(_draftJs.RichUtils.toggleInlineStyle(this.props.editorState, style));\n\t\n\t return setTimeout(function () {\n\t return _this2.relocate();\n\t }, 0);\n\t };\n\t\n\t DanteTooltip.prototype.display = function display(b) {\n\t if (b) {\n\t return this.show();\n\t } else {\n\t return this.hide();\n\t }\n\t };\n\t\n\t DanteTooltip.prototype.show = function show() {\n\t return this.setState({\n\t show: true });\n\t };\n\t\n\t DanteTooltip.prototype.hide = function hide() {\n\t return this.setState({\n\t link_mode: false,\n\t show: false\n\t });\n\t };\n\t\n\t DanteTooltip.prototype.setPosition = function setPosition(coords) {\n\t return this.setState({\n\t position: coords });\n\t };\n\t\n\t DanteTooltip.prototype.isDescendant = function isDescendant(parent, child) {\n\t var node = child.parentNode;\n\t while (node !== null) {\n\t if (node === parent) {\n\t return true;\n\t }\n\t node = node.parentNode;\n\t }\n\t return false;\n\t };\n\t\n\t DanteTooltip.prototype.relocate = function relocate() {\n\t\n\t var currentBlock = (0, _index.getCurrentBlock)(this.props.editorState);\n\t var blockType = currentBlock.getType();\n\t // display tooltip only for unstyled\n\t\n\t if (this.props.configTooltip.selectionElements.indexOf(blockType) < 0) {\n\t this.hide();\n\t return;\n\t }\n\t\n\t if (this.state.link_mode) {\n\t return;\n\t }\n\t if (!this.state.show) {\n\t return;\n\t }\n\t\n\t var el = this.refs.dante_menu;\n\t var padd = el.offsetWidth / 2;\n\t\n\t var nativeSelection = (0, _selection.getSelection)(window);\n\t if (!nativeSelection.rangeCount) {\n\t return;\n\t }\n\t\n\t var selectionBoundary = (0, _selection.getSelectionRect)(nativeSelection);\n\t\n\t var parent = _reactDom2['default'].findDOMNode(this.props.editor);\n\t var parentBoundary = parent.getBoundingClientRect();\n\t\n\t // hide if selected node is not in editor\n\t if (!this.isDescendant(parent, nativeSelection.anchorNode)) {\n\t this.hide();\n\t return;\n\t }\n\t\n\t var top = selectionBoundary.top - parentBoundary.top - -90 - 5;\n\t var left = selectionBoundary.left + selectionBoundary.width / 2 - padd;\n\t\n\t if (!top || !left) {\n\t return;\n\t }\n\t\n\t // console.log \"SET SHOW FOR TOOLTIP INSERT MENU\"\n\t return this.setState({\n\t show: true,\n\t position: {\n\t left: left,\n\t top: top\n\t }\n\t });\n\t };\n\t\n\t DanteTooltip.prototype._clickBlockHandler = function _clickBlockHandler(ev, style) {\n\t var _this3 = this;\n\t\n\t ev.preventDefault();\n\t\n\t this.props.onChange(_draftJs.RichUtils.toggleBlockType(this.props.editorState, style));\n\t\n\t return setTimeout(function () {\n\t return _this3.relocate();\n\t }, 0);\n\t };\n\t\n\t DanteTooltip.prototype.displayLinkMode = function displayLinkMode() {\n\t if (this.state.link_mode) {\n\t return \"dante-menu--linkmode\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t DanteTooltip.prototype.displayActiveMenu = function displayActiveMenu() {\n\t if (this.state.show) {\n\t return \"dante-menu--active\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t DanteTooltip.prototype._enableLinkMode = function _enableLinkMode(ev) {\n\t ev.preventDefault();\n\t return this.setState({\n\t link_mode: true });\n\t };\n\t\n\t DanteTooltip.prototype._disableLinkMode = function _disableLinkMode(ev) {\n\t ev.preventDefault();\n\t return this.setState({\n\t link_mode: false,\n\t url: \"\"\n\t });\n\t };\n\t\n\t DanteTooltip.prototype.hideMenu = function hideMenu() {\n\t return this.hide();\n\t };\n\t\n\t DanteTooltip.prototype.handleInputEnter = function handleInputEnter(e) {\n\t if (e.which === 13) {\n\t return this.confirmLink(e);\n\t }\n\t };\n\t\n\t DanteTooltip.prototype.confirmLink = function confirmLink(e) {\n\t e.preventDefault();\n\t var editorState = this.props.editorState;\n\t\n\t var urlValue = e.currentTarget.value;\n\t var contentState = editorState.getCurrentContent();\n\t var selection = editorState.getSelection();\n\t\n\t var opts = {\n\t url: urlValue,\n\t showPopLinkOver: this.props.showPopLinkOver,\n\t hidePopLinkOver: this.props.hidePopLinkOver\n\t };\n\t\n\t var entityKey = _draftJs.Entity.create('LINK', 'MUTABLE', opts);\n\t\n\t if (selection.isCollapsed()) {\n\t console.log(\"COLLAPSED SKIPPING LINK\");\n\t return;\n\t }\n\t\n\t this.props.onChange(_draftJs.RichUtils.toggleLink(editorState, selection, entityKey));\n\t\n\t return this._disableLinkMode(e);\n\t };\n\t\n\t DanteTooltip.prototype.getPosition = function getPosition() {\n\t var pos = this.state.position;\n\t return pos;\n\t };\n\t\n\t DanteTooltip.prototype.inlineItems = function inlineItems() {\n\t return this.props.widget_options.block_types.filter(function (o) {\n\t return o.type === \"inline\";\n\t });\n\t };\n\t\n\t DanteTooltip.prototype.blockItems = function blockItems() {\n\t return this.props.widget_options.block_types.filter(function (o) {\n\t return o.type === \"block\";\n\t });\n\t };\n\t\n\t DanteTooltip.prototype.getDefaultValue = function getDefaultValue() {\n\t var _this4 = this;\n\t\n\t if (this.refs.dante_menu_input) {\n\t this.refs.dante_menu_input.value = \"\";\n\t }\n\t\n\t var currentBlock = (0, _index.getCurrentBlock)(this.props.editorState);\n\t var blockType = currentBlock.getType();\n\t var selection = this.props.editor.state.editorState.getSelection();\n\t var selectedEntity = null;\n\t var defaultUrl = null;\n\t return currentBlock.findEntityRanges(function (character) {\n\t var entityKey = character.getEntity();\n\t selectedEntity = entityKey;\n\t return entityKey !== null && _draftJs.Entity.get(entityKey).getType() === 'LINK';\n\t }, function (start, end) {\n\t var selStart = selection.getAnchorOffset();\n\t var selEnd = selection.getFocusOffset();\n\t if (selection.getIsBackward()) {\n\t selStart = selection.getFocusOffset();\n\t selEnd = selection.getAnchorOffset();\n\t }\n\t\n\t if (start === selStart && end === selEnd) {\n\t defaultUrl = _draftJs.Entity.get(selectedEntity).getData().url;\n\t return _this4.refs.dante_menu_input.value = defaultUrl;\n\t }\n\t });\n\t };\n\t\n\t DanteTooltip.prototype.render = function render() {\n\t var _this5 = this;\n\t\n\t return _react2['default'].createElement(\n\t 'div',\n\t {\n\t id: 'dante-menu',\n\t ref: 'dante_menu',\n\t className: 'dante-menu ' + this.displayActiveMenu() + ' ' + this.displayLinkMode(),\n\t style: this.getPosition()\n\t },\n\t _react2['default'].createElement(\n\t 'div',\n\t { className: 'dante-menu-linkinput' },\n\t _react2['default'].createElement('input', {\n\t className: 'dante-menu-input',\n\t ref: 'dante_menu_input',\n\t placeholder: 'Paste or type a link',\n\t onKeyPress: this.handleInputEnter,\n\t defaultValue: this.getDefaultValue()\n\t }),\n\t _react2['default'].createElement('div', { className: 'dante-menu-button', onMouseDown: this._disableLinkMode })\n\t ),\n\t _react2['default'].createElement(\n\t 'ul',\n\t { className: 'dante-menu-buttons' },\n\t this.blockItems().map(function (item, i) {\n\t return _react2['default'].createElement(DanteTooltipItem, {\n\t key: i,\n\t item: item,\n\t handleClick: _this5._clickBlockHandler,\n\t editorState: _this5.props.editorState,\n\t type: 'block',\n\t currentStyle: _this5.props.editorState.getCurrentInlineStyle\n\t });\n\t }),\n\t _react2['default'].createElement(DanteTooltipLink, {\n\t editorState: this.props.editorState,\n\t enableLinkMode: this._enableLinkMode\n\t }),\n\t this.inlineItems().map(function (item, i) {\n\t return _react2['default'].createElement(DanteTooltipItem, {\n\t key: i,\n\t item: item,\n\t type: 'inline',\n\t editorState: _this5.props.editorState,\n\t handleClick: _this5._clickInlineHandler\n\t });\n\t })\n\t )\n\t );\n\t };\n\t\n\t return DanteTooltip;\n\t}(_react2['default'].Component);\n\t\n\tvar DanteTooltipItem = function (_React$Component2) {\n\t (0, _inherits3['default'])(DanteTooltipItem, _React$Component2);\n\t\n\t function DanteTooltipItem() {\n\t (0, _classCallCheck3['default'])(this, DanteTooltipItem);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t var _this6 = (0, _possibleConstructorReturn3['default'])(this, _React$Component2.call.apply(_React$Component2, [this].concat(args)));\n\t\n\t _this6.handleClick = _this6.handleClick.bind(_this6);\n\t _this6.activeClass = _this6.activeClass.bind(_this6);\n\t _this6.isActive = _this6.isActive.bind(_this6);\n\t _this6.activeClassInline = _this6.activeClassInline.bind(_this6);\n\t _this6.activeClassBlock = _this6.activeClassBlock.bind(_this6);\n\t _this6.render = _this6.render.bind(_this6);\n\t return _this6;\n\t }\n\t\n\t DanteTooltipItem.prototype.handleClick = function handleClick(ev) {\n\t return this.props.handleClick(ev, this.props.item.style);\n\t };\n\t\n\t DanteTooltipItem.prototype.activeClass = function activeClass() {\n\t if (this.isActive()) {\n\t return \"active\";\n\t } else {\n\t return \"\";\n\t }\n\t };\n\t\n\t DanteTooltipItem.prototype.isActive = function isActive() {\n\t if (this.props.type === \"block\") {\n\t return this.activeClassBlock();\n\t } else {\n\t return this.activeClassInline();\n\t }\n\t };\n\t\n\t DanteTooltipItem.prototype.activeClassInline = function activeClassInline() {\n\t if (!this.props.editorState) {\n\t return;\n\t }\n\t //console.log @props.item\n\t return this.props.editorState.getCurrentInlineStyle().has(this.props.item.style);\n\t };\n\t\n\t DanteTooltipItem.prototype.activeClassBlock = function activeClassBlock() {\n\t //console.log \"EDITOR STATE\", @props.editorState\n\t if (!this.props.editorState) {\n\t return;\n\t }\n\t var selection = this.props.editorState.getSelection();\n\t var blockType = this.props.editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();\n\t return this.props.item.style === blockType;\n\t };\n\t\n\t DanteTooltipItem.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'li',\n\t { className: 'dante-menu-button ' + this.activeClass(), onMouseDown: this.handleClick },\n\t _react2['default'].createElement('i', { className: 'dante-icon dante-icon-' + this.props.item.label, 'data-action': 'bold' })\n\t );\n\t };\n\t\n\t return DanteTooltipItem;\n\t}(_react2['default'].Component);\n\t\n\tvar DanteTooltipLink = function (_React$Component3) {\n\t (0, _inherits3['default'])(DanteTooltipLink, _React$Component3);\n\t\n\t function DanteTooltipLink() {\n\t (0, _classCallCheck3['default'])(this, DanteTooltipLink);\n\t\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n\t args[_key2] = arguments[_key2];\n\t }\n\t\n\t var _this7 = (0, _possibleConstructorReturn3['default'])(this, _React$Component3.call.apply(_React$Component3, [this].concat(args)));\n\t\n\t _this7.promptForLink = _this7.promptForLink.bind(_this7);\n\t return _this7;\n\t }\n\t\n\t DanteTooltipLink.prototype.promptForLink = function promptForLink(ev) {\n\t var selection = this.props.editorState.getSelection();\n\t if (!selection.isCollapsed()) {\n\t return this.props.enableLinkMode(ev);\n\t }\n\t };\n\t\n\t DanteTooltipLink.prototype.render = function render() {\n\t return _react2['default'].createElement(\n\t 'li',\n\t { className: 'dante-menu-button', onMouseDown: this.promptForLink },\n\t _react2['default'].createElement(\n\t 'i',\n\t { className: 'dante-icon icon-createlink', 'data-action': 'createlink' },\n\t 'link'\n\t )\n\t );\n\t };\n\t\n\t return DanteTooltipLink;\n\t}(_react2['default'].Component);\n\t\n\texports['default'] = DanteTooltip;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 238:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\t//TODO: what the f*ck is happening here? ;-;\n\tvar findEntities = function findEntities(entityType, instance, contentBlock, callback) {\n\t return contentBlock.findEntityRanges(function (_this) {\n\t return function (character) {\n\t var entityKey, opts, res;\n\t entityKey = character.getEntity();\n\t return res = entityKey !== null && _draftJs.Entity.get(entityKey).getType() === entityType, res ? (opts = {\n\t showPopLinkOver: instance.showPopLinkOver,\n\t hidePopLinkOver: instance.hidePopLinkOver\n\t }, _draftJs.Entity.mergeData(entityKey, opts)) : void 0, res;\n\t };\n\t }(undefined), callback);\n\t};\n\t\n\texports['default'] = findEntities;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 239:\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\texports.__esModule = true;\n\t\n\tvar _stringify = __webpack_require__(79);\n\t\n\tvar _stringify2 = _interopRequireDefault(_stringify);\n\t\n\tvar _draftJs = __webpack_require__(10);\n\t\n\tvar _immutable = __webpack_require__(46);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\t\n\t// { compose\n\t// } = require('underscore')\n\t\n\t// underscore compose function\n\tvar compose = function compose() {\n\t var args = arguments;\n\t var start = args.length - 1;\n\t return function () {\n\t var i = start;\n\t var result = args[start].apply(this, arguments);\n\t while (i--) {\n\t result = args[i].call(this, result);\n\t }\n\t return result;\n\t };\n\t};\n\t\n\t// from https://gist.github.com/N1kto/6702e1c2d89a33a15a032c234fc4c34e\n\t\n\t/*\n\t * Helpers\n\t */\n\t\n\t// Prepares img meta data object based on img attributes\n\tvar getBlockSpecForElement = function getBlockSpecForElement(imgElement) {\n\t return {\n\t contentType: 'image',\n\t imgSrc: imgElement.getAttribute('src')\n\t };\n\t};\n\t\n\t// Wraps meta data in HTML element which is 'understandable' by Draft, I used <blockquote />.\n\tvar wrapBlockSpec = function wrapBlockSpec(blockSpec) {\n\t if (blockSpec === null) {\n\t return null;\n\t }\n\t\n\t var tempEl = document.createElement('blockquote');\n\t // stringify meta data and insert it as text content of temp HTML element. We will later extract\n\t // and parse it.\n\t tempEl.innerText = (0, _stringify2['default'])(blockSpec);\n\t return tempEl;\n\t};\n\t\n\t// Replaces <img> element with our temp element\n\tvar replaceElement = function replaceElement(oldEl, newEl) {\n\t if (!(newEl instanceof HTMLElement)) {\n\t return;\n\t }\n\t\n\t var upEl = getUpEl(oldEl);\n\t //parentNode = oldEl.parentNode\n\t //return parentNode.replaceChild(newEl, oldEl)\n\t return upEl.parentNode.insertBefore(newEl, upEl);\n\t};\n\t\n\tvar getUpEl = function getUpEl(el) {\n\t var original_el = el;\n\t while (el.parentNode) {\n\t if (el.parentNode.tagName !== 'BODY') {\n\t el = el.parentNode;\n\t }\n\t if (el.parentNode.tagName === 'BODY') {\n\t return el;\n\t }\n\t }\n\t};\n\t\n\tvar elementToBlockSpecElement = compose(wrapBlockSpec, getBlockSpecForElement);\n\t\n\tvar imgReplacer = function imgReplacer(imgElement) {\n\t return replaceElement(imgElement, elementToBlockSpecElement(imgElement));\n\t};\n\t\n\t/*\n\t * Main function\n\t */\n\t\n\t// takes HTML string and returns DraftJS ContentState\n\tvar customHTML2Content = function customHTML2Content(HTML, blockRn) {\n\t var tempDoc = new DOMParser().parseFromString(HTML, 'text/html');\n\t // replace all <img /> with <blockquote /> elements\n\t\n\t var a = tempDoc.querySelectorAll('img').forEach(function (item) {\n\t return imgReplacer(item);\n\t });\n\t\n\t // use DraftJS converter to do initial conversion. I don't provide DOMBuilder and\n\t // blockRenderMap arguments here since it should fall back to its default ones, which are fine\n\t console.log(tempDoc.body.innerHTML);\n\t var contentBlocks = (0, _draftJs.convertFromHTML)(tempDoc.body.innerHTML, _draftJs.getSafeBodyFromHTML, blockRn);\n\t\n\t // now replace <blockquote /> ContentBlocks with 'atomic' ones\n\t contentBlocks = contentBlocks.map(function (block) {\n\t var newBlock = void 0;\n\t console.log(\"CHECK BLOCK\", block.getType());\n\t if (block.getType() !== 'blockquote') {\n\t return block;\n\t }\n\t\n\t var json = \"\";\n\t try {\n\t json = JSON.parse(block.getText());\n\t } catch (error) {\n\t return block;\n\t }\n\t\n\t return newBlock = block.merge({\n\t type: \"image\",\n\t text: \"\",\n\t data: {\n\t url: json.imgSrc,\n\t forceUpload: true\n\t }\n\t });\n\t });\n\t\n\t tempDoc = null;\n\t return _draftJs.ContentState.createFromBlockArray(contentBlocks);\n\t};\n\t\n\texports['default'] = customHTML2Content;\n\tmodule.exports = exports['default'];\n\n/***/ },\n\n/***/ 240:\n/***/ function(module, exports, __webpack_require__) {\n\n\t\"use strict\";\n\t\n\texports.__esModule = true;\n\t\n\tvar _stringify = __webpack_require__(79);\n\t\n\tvar _stringify2 = _interopRequireDefault(_stringify);\n\t\n\tvar _classCallCheck2 = __webpack_require__(14);\n\t\n\tvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\t\n\tvar _axios = __webpack_require__(61);\n\t\n\tvar _axios2 = _interopRequireDefault(_axios);\n\t\n\tvar _immutable = __webpack_require__(46);\n\t\n\tvar _immutable2 = _interopRequireDefault(_immutable);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\n\t\n\tvar SaveBehavior = function () {\n\t function SaveBehavior(options) {\n\t (0, _classCallCheck3[\"default\"])(this, SaveBehavior);\n\t\n\t this.getLocks = options.getLocks;\n\t this.config = options.config;\n\t this.editorContent = options.editorContent;\n\t this.editorState = options.editorState;\n\t }\n\t\n\t SaveBehavior.prototype.handleStore = function handleStore(ev) {\n\t return this.store();\n\t };\n\t\n\t SaveBehavior.prototype.store = function store(content) {\n\t var _this = this;\n\t\n\t if (!this.config.data_storage.url) {\n\t return;\n\t }\n\t if (this.getLocks() > 0) {\n\t return;\n\t }\n\t\n\t clearTimeout(this.timeout);\n\t\n\t return this.timeout = setTimeout(function () {\n\t return _this.checkforStore(content);\n\t }, this.config.data_storage.interval);\n\t };\n\t\n\t SaveBehavior.prototype.getTextFromEditor = function getTextFromEditor(content) {\n\t return content.blocks.map(function (o) {\n\t return o.text;\n\t }).join(\"\\n\");\n\t };\n\t\n\t SaveBehavior.prototype.getUrl = function getUrl() {\n\t var url = this.config.data_storage.url;\n\t\n\t if (typeof url === \"function\") {\n\t return url();\n\t } else {\n\t return url;\n\t }\n\t };\n\t\n\t SaveBehavior.prototype.getMethod = function getMethod() {\n\t var method = this.config.data_storage.method;\n\t\n\t if (typeof method === \"function\") {\n\t return method();\n\t } else {\n\t return method;\n\t }\n\t };\n\t\n\t SaveBehavior.prototype.checkforStore = function checkforStore(content) {\n\t var _this2 = this;\n\t\n\t // ENTER DATA STORE\n\t var isChanged = !_immutable2[\"default\"].is(_immutable2[\"default\"].fromJS(this.editorContent), _immutable2[\"default\"].fromJS(content));\n\t // console.log(\"CONTENT CHANGED:\", isChanged)\n\t\n\t if (!isChanged) {\n\t return;\n\t }\n\t\n\t if (this.config.xhr.before_handler) {\n\t this.config.xhr.before_handler();\n\t }\n\t // console.log \"SAVING TO: #{@getMethod()} #{@getUrl()}\"\n\t\n\t return (0, _axios2[\"default\"])({\n\t method: this.getMethod(),\n\t url: this.getUrl(),\n\t data: {\n\t editor_content: (0, _stringify2[\"default\"])(content),\n\t text_content: this.getTextFromEditor(content)\n\t }\n\t }).then(function (result) {\n\t // console.log \"STORING CONTENT\", result\n\t if (_this2.config.data_storage.success_handler) {\n\t _this2.config.data_storage.success_handler(result);\n\t }\n\t if (_this2.config.xhr.success_handler) {\n\t return _this2.config.xhr.success_handler(result);\n\t }\n\t })[\"catch\"](function (error) {\n\t // console.log(\"ERROR: got error saving content at #{@config.data_storage.url} - #{error}\")\n\t if (_this2.config.xhr.failure_handler) {\n\t return _this2.config.xhr.failure_handler(error);\n\t }\n\t });\n\t };\n\t\n\t return SaveBehavior;\n\t}();\n\t\n\texports[\"default\"] = SaveBehavior;\n\tmodule.exports = exports[\"default\"];\n\n/***/ }\n\n})\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** Dante2.min.js\n **/","\nimport Dante from './components/dante'\nimport DanteEditor from './components/dante_editor'\n\n\nmodule.exports = {\n Dante, \n DanteEditor\n}\n\n\n/** WEBPACK FOOTER **\n ** ./src/index.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_5__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n ** module id = 5\n ** module chunks = 1\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_9__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external {\"root\":\"ReactDOM\",\"commonjs2\":\"react-dom\",\"commonjs\":\"react-dom\",\"amd\":\"react-dom\"}\n ** module id = 9\n ** module chunks = 1\n **/","import { Map } from 'immutable';\n\n\n\nimport { EditorState, ContentBlock, genKey } from 'draft-js';\n\n\n/*\nUsed from [react-rte](https://github.com/brijeshb42/medium-draft)\nby [brijeshb42](https://github.com/brijeshb42/medium-draft)\n*/\n\n/*\nReturns default block-level metadata for various block type. Empty object otherwise.\n*/\nexport const getDefaultBlockData = (blockType, initialData = {}) => {\n switch (blockType) {\n //case Block.TODO: return { checked: false };\n default: return initialData;\n }\n};\n\nexport const getNode = (root=window) => {\n let t = null\n if (root.getSelection){\n t = root.getSelection()\n } else if (root.document.getSelection){\n t = root.document.getSelection()\n } else if (root.document.selection){\n t = root.document.selection.createRange().text\n }\n return t\n}\n\n/*\nGet currentBlock in the editorState.\n*/\nexport const getCurrentBlock = (editorState) => {\n const selectionState = editorState.getSelection();\n const contentState = editorState.getCurrentContent();\n const block = contentState.getBlockForKey(selectionState.getStartKey());\n return block;\n};\n\n/*\nAdds a new block (currently replaces an empty block) at the current cursor position\nof the given `newType`.\n*/\nexport const addNewBlock = (editorState, newType = \"unstyled\", initialData = {}) => {\n const selectionState = editorState.getSelection();\n if (!selectionState.isCollapsed()) {\n return editorState;\n }\n const contentState = editorState.getCurrentContent();\n const key = selectionState.getStartKey();\n const blockMap = contentState.getBlockMap();\n const currentBlock = getCurrentBlock(editorState);\n if (!currentBlock) {\n return editorState;\n }\n if (currentBlock.getLength() === 0) {\n if (currentBlock.getType() === newType) {\n return editorState;\n }\n const newBlock = currentBlock.merge({\n type: newType,\n data: getDefaultBlockData(newType, initialData),\n });\n const newContentState = contentState.merge({\n blockMap: blockMap.set(key, newBlock),\n selectionAfter: selectionState,\n });\n return EditorState.push(editorState, newContentState, 'change-block-type');\n }\n return editorState;\n};\n\n\n/*\nChanges the block type of the current block.\n*/\nexport const resetBlockWithType = (editorState, newType = \"unstyled\", data={}) => {\n const contentState = editorState.getCurrentContent();\n const selectionState = editorState.getSelection();\n const key = selectionState.getStartKey();\n const blockMap = contentState.getBlockMap();\n const block = blockMap.get(key);\n\n let newText = '';\n console.log( \"DATA FOR PLACEHOLDER!\", data)\n const text = block.getText();\n if (block.getLength() >= 2) {\n newText = text.substr(1);\n }\n\n /*if(data.text){\n newText = data.text\n }*/\n\n //let newText = data.text\n\n const newBlock = block.merge({\n text: newText,\n type: newType,\n data: getDefaultBlockData(newType, data),\n });\n const newContentState = contentState.merge({\n blockMap: blockMap.set(key, newBlock),\n selectionAfter: selectionState.merge({\n anchorOffset: 0,\n focusOffset: 0,\n }),\n });\n return EditorState.push(editorState, newContentState, 'change-block-type');\n};\n\n\n/*\nUpdate block-level metadata of the given `block` to the `newData`/\n*/\nexport const updateDataOfBlock = (editorState, block, newData) => {\n const contentState = editorState.getCurrentContent();\n const newBlock = block.merge({\n data: newData,\n });\n const newContentState = contentState.merge({\n blockMap: contentState.getBlockMap().set(block.getKey(), newBlock),\n });\n return EditorState.push(editorState, newContentState, 'change-block-type');\n // return editorState;\n};\n\nexport const updateTextOfBlock = (editorState, block, text) => {\n const contentState = editorState.getCurrentContent();\n const newBlock = block.merge({\n text: text,\n });\n const newContentState = contentState.merge({\n blockMap: contentState.getBlockMap().set(block.getKey(), newBlock),\n });\n\n return EditorState.push(editorState, newContentState, 'change-block-type');\n // return editorState;\n};\n\n// const BEFORE = -1;\n// const AFTER = 1;\n\n/*\nUsed from [react-rte](https://github.com/sstur/react-rte/blob/master/src/lib/insertBlockAfter.js)\nby [sstur](https://github.com/sstur)\n*/\nexport const addNewBlockAt = (\n editorState,\n pivotBlockKey,\n newBlockType = \"unstyled\",\n initialData = {}\n ) => {\n const content = editorState.getCurrentContent();\n const blockMap = content.getBlockMap();\n const block = blockMap.get(pivotBlockKey);\n const blocksBefore = blockMap.toSeq().takeUntil((v) => (v === block));\n const blocksAfter = blockMap.toSeq().skipUntil((v) => (v === block)).rest();\n const newBlockKey = genKey();\n\n const newBlock = new ContentBlock({\n key: newBlockKey,\n type: newBlockType,\n text: '',\n characterList: block.getCharacterList().slice(0, 0),\n depth: 0,\n data: Map(getDefaultBlockData(newBlockType, initialData)),\n });\n\n const newBlockMap = blocksBefore.concat(\n [[pivotBlockKey, block], [newBlockKey, newBlock]],\n blocksAfter\n ).toOrderedMap();\n\n const selection = editorState.getSelection();\n\n const newContent = content.merge({\n blockMap: newBlockMap,\n selectionBefore: selection,\n selectionAfter: selection.merge({\n anchorKey: newBlockKey,\n anchorOffset: 0,\n focusKey: newBlockKey,\n focusOffset: 0,\n isBackward: false,\n }),\n });\n return EditorState.push(editorState, newContent, 'split-block');\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/model/index.js\n **/","/*\nReturns the `boundingClientRect` of the passed selection.\n*/\nexport const getSelectionRect = (selected) => {\n const _rect = selected.getRangeAt(0).getBoundingClientRect();\n // selected.getRangeAt(0).getBoundingClientRect()\n let rect = _rect && _rect.top ? _rect : selected.getRangeAt(0).getClientRects()[0];\n if (!rect) {\n if (selected.anchorNode && selected.anchorNode.getBoundingClientRect) {\n rect = selected.anchorNode.getBoundingClientRect();\n rect.isEmptyline = true;\n } else {\n return null;\n }\n }\n return rect;\n};\n\n/*\nReturns the native selection node.\n*/\nexport const getSelection = (root) => {\n let t = null;\n if (root.getSelection) {\n t = root.getSelection();\n } else if (root.document.getSelection) {\n t = root.document.getSelection();\n } else if (root.document.selection) {\n t = root.document.selection.createRange().text;\n }\n return t;\n};\n\n/*\nRecursively finds the DOM Element of the block where the cursor is currently present.\nIf not found, returns null.\n*/\nexport const getSelectedBlockNode = (root) => {\n const selection = root.getSelection();\n if (selection.rangeCount === 0) {\n return null;\n }\n let node = selection.getRangeAt(0).startContainer;\n // console.log(node);\n do {\n if (node.getAttribute && node.getAttribute('data-block') === 'true') {\n return node;\n }\n node = node.parentNode;\n // console.log(node);\n } while (node !== null);\n return null;\n};\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/selection.js\n **/","module.exports = global[\"DanteEditor\"] = require(\"-!/Users/michelson/Documents/brunch-apps/dante2/node_modules/babel-loader/lib/index.js?presets[]=es2015!/Users/michelson/Documents/brunch-apps/dante2/src/components/dante_editor.js\");\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/dante_editor.js\n **/","module.exports = global[\"Dante\"] = require(\"-!/Users/michelson/Documents/brunch-apps/dante2/node_modules/babel-loader/lib/index.js?presets[]=es2015!/Users/michelson/Documents/brunch-apps/dante2/src/components/dante.js\");\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/dante.js\n **/","\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { Entity, RichUtils, AtomicBlockUtils, EditorBlock } from 'draft-js'\n\nimport axios from \"axios\"\n\nimport { updateDataOfBlock } from '../../model/index.js'\n\nexport default class EmbedBlock extends React.Component {\n constructor(props) {\n super(props)\n //api_key = \"86c28a410a104c8bb58848733c82f840\"\n\n this.updateData = this.updateData.bind(this)\n this.dataForUpdate = this.dataForUpdate.bind(this)\n this.componentDidMount = this.componentDidMount.bind(this)\n this.state = {\n embed_data: this.defaultData(),\n error: \"\"\n }\n }\n\n defaultData() {\n const existing_data = this.props.block.getData().toJS()\n return existing_data.embed_data || {}\n }\n\n // will update block state\n updateData() {\n const { block, blockProps } = this.props\n const { getEditorState, setEditorState } = this.props.blockProps\n const data = block.getData()\n const newData = data.merge(this.state)\n return setEditorState(updateDataOfBlock(getEditorState(), block, newData))\n }\n\n dataForUpdate() {\n\n return this.props.blockProps.data.toJS()\n }\n\n componentDidMount() {\n\n if (!this.props.blockProps.data) {\n return\n }\n\n // ensure data isnt already loaded\n // unless @dataForUpdate().endpoint or @dataForUpdate().provisory_text\n\n if (!this.dataForUpdate().endpoint && !this.dataForUpdate().provisory_text) {\n //debugger\n return\n }\n\n return axios({\n method: 'get',\n url: `${ this.dataForUpdate().endpoint }${ this.dataForUpdate().provisory_text }&scheme=https`\n }).then(result => {\n\n return this.setState({ embed_data: result.data } //JSON.parse(data.responseText)\n , this.updateData)\n }).catch(error => {\n\n this.setState({\n error: error.response.data.error_message })\n return console.log(\"TODO: error\")\n })\n }\n\n classForImage() {\n if (this.state.embed_data.images) {\n return \"\"\n } else {\n return \"mixtapeImage--empty u-ignoreBlock\"\n }\n }\n //if @state.embed_data.thumbnail_url then \"\" else \"mixtapeImage--empty u-ignoreBlock\"\n\n picture() {\n if (this.state.embed_data.images && this.state.embed_data.images.length > 0) {\n return this.state.embed_data.images[0].url\n } else {\n return \"\"\n }\n }\n\n render() {\n //block = @.props\n //foo = @.props.blockProps\n //data = Entity.get(block.block.getEntityAt(0)).getData()\n console.log(\"ERROR\", this.state.error)\n return (\n <span>\n { this.picture()\n ? <a\n target='_blank'\n className={ `js-mixtapeImage mixtapeImage ${ this.classForImage() }` }\n href={ this.state.embed_data.url }\n style={ { backgroundImage: `url('${ this.picture() }')` } }\n />\n : undefined\n }\n { this.state.error ? \n <h2>{ this.state.error }</h2>\n : undefined\n }\n <a\n className='markup--anchor markup--mixtapeEmbed-anchor'\n target='_blank'\n href={ this.state.embed_data.url }\n >\n <strong className='markup--strong markup--mixtapeEmbed-strong'>\n { this.state.embed_data.title }\n </strong>\n <em className='markup--em markup--mixtapeEmbed-em'>\n { this.state.embed_data.description }\n </em>\n </a>{ this.state.embed_data.provider_url }\n </span>\n )\n }\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/blocks/embed.js\n **/","import React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport {\n Entity, \n RichUtils, \n AtomicBlockUtils, \n EditorBlock, \n EditorState } from 'draft-js'\n\nimport axios from \"axios\"\n\nimport { updateDataOfBlock } from '../../model/index.js'\n\nexport default class ImageBlock extends React.Component {\n\n constructor(props) {\n super(props)\n\n this.blockPropsSrc = this.blockPropsSrc.bind(this)\n this.defaultUrl = this.defaultUrl.bind(this)\n this.defaultAspectRatio = this.defaultAspectRatio.bind(this)\n this.updateData = this.updateData.bind(this)\n this.replaceImg = this.replaceImg.bind(this)\n this.startLoader = this.startLoader.bind(this)\n this.stopLoader = this.stopLoader.bind(this)\n this.handleUpload = this.handleUpload.bind(this)\n this.aspectRatio = this.aspectRatio.bind(this)\n this.updateDataSelection = this.updateDataSelection.bind(this)\n this.handleGrafFigureSelectImg = this.handleGrafFigureSelectImg.bind(this)\n this.getUploadUrl = this.getUploadUrl.bind(this)\n this.uploadFile = this.uploadFile.bind(this)\n this.uploadCompleted = this.uploadCompleted.bind(this)\n this.updateProgressBar = this.updateProgressBar.bind(this)\n this.placeHolderEnabled = this.placeHolderEnabled.bind(this)\n this.placeholderText = this.placeholderText.bind(this)\n this.handleFocus = this.handleFocus.bind(this)\n this.render = this.render.bind(this)\n let existing_data = this.props.block.getData().toJS()\n\n this.config = this.props.blockProps.config\n this.file = this.props.blockProps.data.get('file')\n this.state = {\n loading: false,\n selected: false,\n loading_progress: 0,\n enabled: false,\n caption: this.defaultPlaceholder(),\n direction: existing_data.direction || \"center\",\n width: 0,\n height: 0,\n file: null,\n url: this.blockPropsSrc() || this.defaultUrl(existing_data),\n aspect_ratio: this.defaultAspectRatio(existing_data)\n }\n }\n\n blockPropsSrc() {\n // console.log @.props.blockProps.data.src\n return this.props.blockProps.data.src\n }\n /*\n debugger\n block = @.props\n entity = block.block.getEntityAt(0)\n if entity\n data = Entity.get(entity).getData().src\n else\n null\n */\n\n defaultUrl(data) {\n if (data.url) {\n return data.url\n }\n\n if (data.url) {\n if (data.file) {\n return URL.createObjectURL(data.file)\n } else {\n return data.url\n }\n } else {\n return this.props.blockProps.data.src\n }\n }\n\n defaultPlaceholder() {\n return this.props.blockProps.config.image_caption_placeholder\n }\n\n defaultAspectRatio(data) {\n if (data.aspect_ratio) {\n return {\n width: data.aspect_ratio['width'],\n height: data.aspect_ratio['height'],\n ratio: data.aspect_ratio['ratio']\n }\n } else {\n return {\n width: 0,\n height: 0,\n ratio: 100\n }\n }\n }\n\n getAspectRatio(w, h) {\n let maxWidth = 1000\n let maxHeight = 1000\n let ratio = 0\n let width = w // Current image width\n let height = h // Current image height\n\n // Check if the current width is larger than the max\n if (width > maxWidth) {\n ratio = maxWidth / width // get ratio for scaling image\n height = height * ratio // Reset height to match scaled image\n width = width * ratio // Reset width to match scaled image\n\n // Check if current height is larger than max\n } else if (height > maxHeight) {\n ratio = maxHeight / height // get ratio for scaling image\n width = width * ratio // Reset width to match scaled image\n height = height * ratio // Reset height to match scaled image\n }\n\n let fill_ratio = height / width * 100\n let result = { width, height, ratio: fill_ratio }\n // console.log result\n return result\n }\n\n // will update block state\n updateData() {\n let { blockProps } = this.props\n let { block } = this.props\n let { getEditorState } = this.props.blockProps\n let { setEditorState } = this.props.blockProps\n let data = block.getData()\n let newData = data.merge(this.state).merge({ forceUpload: false })\n return setEditorState(updateDataOfBlock(getEditorState(), block, newData))\n }\n\n replaceImg() {\n this.img = new Image()\n this.img.src = this.refs.image_tag.src\n this.setState({\n url: this.img.src })\n let self = this\n // exit only when not blob and not forceUload\n if (!this.img.src.includes(\"blob:\") && !this.props.block.data.get(\"forceUpload\")) {\n return\n }\n return this.img.onload = () => {\n this.setState({\n width: this.img.width,\n height: this.img.height,\n aspect_ratio: self.getAspectRatio(this.img.width, this.img.height)\n })\n\n return this.handleUpload()\n }\n }\n\n startLoader() {\n return this.setState({\n loading: true })\n }\n\n stopLoader() {\n return this.setState({\n loading: false })\n }\n\n handleUpload() {\n this.startLoader()\n this.props.blockProps.addLock()\n this.updateData()\n return this.uploadFile()\n }\n\n componentDidMount() {\n return this.replaceImg()\n }\n\n aspectRatio() {\n return {\n maxWidth: `${ this.state.aspect_ratio.width }`,\n maxHeight: `${ this.state.aspect_ratio.height }`,\n ratio: `${ this.state.aspect_ratio.height }`\n }\n }\n\n updateDataSelection() {\n const { getEditorState, setEditorState } = this.props.blockProps\n const newselection = getEditorState().getSelection().merge({\n anchorKey: this.props.block.getKey(),\n focusKey: this.props.block.getKey()\n })\n\n return setEditorState(EditorState.forceSelection(getEditorState(), newselection))\n }\n\n handleGrafFigureSelectImg(e) {\n e.preventDefault()\n return this.setState({ selected: true }, this.updateDataSelection)\n }\n\n //main_editor.onChange(main_editor.state.editorState)\n\n coords() {\n return {\n maxWidth: `${ this.state.aspect_ratio.width }px`,\n maxHeight: `${ this.state.aspect_ratio.height }px`\n }\n }\n\n getBase64Image(img) {\n let canvas = document.createElement(\"canvas\")\n canvas.width = img.width\n canvas.height = img.height\n let ctx = canvas.getContext(\"2d\")\n ctx.drawImage(img, 0, 0)\n let dataURL = canvas.toDataURL(\"image/png\")\n\n return dataURL\n }\n\n formatData() {\n let formData = new FormData()\n if (this.file) {\n let formName = this.config.upload_formName || 'file'\n\n formData.append(formName, this.file)\n return formData\n } else {\n formData.append('url', this.props.blockProps.data.get(\"url\"))\n return formData\n }\n }\n\n getUploadUrl() {\n let url = this.config.upload_url\n if (typeof url === \"function\") {\n return url()\n } else {\n return url\n }\n }\n\n getUploadHeaders() {\n return this.config.upload_headers || {}\n }\n\n uploadFile() {\n let handleUp\n axios({\n method: 'post',\n url: this.getUploadUrl(),\n headers: this.getUploadHeaders(),\n data: this.formatData(),\n onUploadProgress: e => {\n return this.updateProgressBar(e)\n }\n }).then(result => {\n this.uploadCompleted(result.data)\n this.props.blockProps.removeLock()\n this.stopLoader()\n this.file = null\n\n if (this.config.upload_callback) {\n return this.config.upload_callback(result, this)\n }\n }).catch(error => {\n this.props.blockProps.removeLock()\n this.stopLoader()\n\n console.log(`ERROR: got error uploading file ${ error }`)\n if (this.config.upload_error_callback) {\n return this.config.upload_error_callback(error, this)\n }\n })\n\n return handleUp = json_response => {\n return this.uploadCompleted(json_response, n)\n }\n }\n\n uploadCompleted(json) {\n return this.setState({ url: json.url }, this.updateData)\n }\n\n updateProgressBar(e) {\n let complete = this.state.loading_progress\n if (e.lengthComputable) {\n complete = e.loaded / e.total * 100\n complete = complete != null ? complete : { complete: 0 }\n this.setState({\n loading_progress: complete })\n return console.log(`complete: ${ complete }`)\n }\n }\n\n placeHolderEnabled() {\n return this.state.enabled || this.props.block.getText()\n }\n\n placeholderText() {\n if (this.placeHolderEnabled()) {\n return \"\"\n }\n return \"Write caption for image (optional)\"\n }\n\n handleFocus(e) {\n // console.log \"focus on placeholder\"\n return setTimeout(() => {\n return this.setState({\n enabled: true })\n }, 0)\n }\n\n render() {\n\n return (\n <div ref=\"image_tag2\" suppressContentEditableWarning={true}>\n <div className=\"aspectRatioPlaceholder is-locked\" \n style={this.coords()} \n onClick={this.handleGrafFigureSelectImg}>\n <div style={{ paddingBottom: `${ this.state.aspect_ratio.ratio }%` }} \n className='aspect-ratio-fill' />\n <img src={this.state.url} \n ref=\"image_tag\" \n height={this.state.aspect_ratio.height} \n width={this.state.aspect_ratio.width} \n className='graf-image' />\n <Loader toggle={this.state.loading} \n progress={this.state.loading_progress} />\n </div>\n <figcaption className='imageCaption' onMouseDown={this.handleFocus}>\n { !this.state.enabled ? \n <span className=\"danteDefaultPlaceholder\">\n {this.placeholderText()}\n </span> : undefined}\n <EditorBlock {...Object.assign({}, this.props, { \n \"editable\": true, \"className\": \"imageCaption\" })\n } />\n </figcaption>\n </div>\n )\n }\n}\n\nclass Loader extends React.Component {\n\n render() {\n return (\n <div>\n { this.props.toggle\n ? <div className=\"image-upoader-loader\">\n <p>\n { this.props.progress === 100\n ? \"processing image...\"\n : <span>\n <span>loading</span> { Math.round( this.props.progress ) }\n </span>\n }\n </p>\n </div>\n : undefined\n }\n </div>\n )\n }\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/blocks/image.js\n **/","\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { Entity, RichUtils, AtomicBlockUtils, EditorBlock } from 'draft-js'\n\nexport default class PlaceholderBlock extends React.Component {\n constructor(props) {\n super(props)\n this.placeholderText = this.placeholderText.bind(this)\n this.placeholderFromProps = this.placeholderFromProps.bind(this)\n this.defaultText = this.defaultText.bind(this)\n this.handleFocus = this.handleFocus.bind(this)\n this.classForDefault = this.classForDefault.bind(this)\n this.state = {\n enabled: false,\n data: this.props.blockProps.data.toJS()\n }\n }\n\n placeholderText() {\n if (this.state.enabled) {\n return \"\"\n }\n return this.props.blockProps.data.toJS().placeholder || this.placeholderFromProps() || this.defaultText()\n }\n //if @.props.blockProps.data then @.props.blockProps.data.placeholder else @defaultText()\n\n\n placeholderFromProps() {\n return this.props.block.toJS().placeholder\n }\n\n defaultText() {\n return \"write something \"\n }\n\n componentDidMount() {}\n\n handleFocus(e) {\n // console.log \"focus on placeholder\"\n return setTimeout(() => {\n return this.setState({\n enabled: true })\n }, 0)\n }\n\n classForDefault() {\n if (!this.state.enabled) {\n return \"defaultValue defaultValue--root\"\n } else {\n return \"\"\n }\n }\n\n render() {\n return (\n <span className={this.classForDefault()} onMouseDown={this.handleFocus}>\n {this.placeholderText()}\n <EditorBlock {...Object.assign({}, this.props, {\n \"className\": \"imageCaption\",\n \"placeholder\": \"escrive alalal\"\n })} />\n </span>\n )\n }\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/blocks/placeholder.js\n **/","\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { Entity, RichUtils, AtomicBlockUtils, EditorBlock } from 'draft-js'\n\nimport { updateDataOfBlock } from '../../model/index.js'\n\nimport axios from \"axios\"\n\nexport default class VideoBlock extends React.Component {\n constructor(props) {\n super(props)\n //api_key = \"86c28a410a104c8bb58848733c82f840\"\n\n this.updateData = this.updateData.bind(this)\n this.dataForUpdate = this.dataForUpdate.bind(this)\n this.state = { embed_data: this.defaultData() }\n }\n\n defaultData() {\n let existing_data = this.props.block.getData().toJS()\n return existing_data.embed_data || {}\n }\n\n // will update block state\n updateData() {\n const { block, blockProps } = this.props\n const { getEditorState, setEditorState } = this.props.blockProps\n const data = block.getData()\n const newData = data.merge(this.state)\n return setEditorState(updateDataOfBlock(getEditorState(), block, newData))\n }\n\n dataForUpdate() {\n return this.props.blockProps.data.toJS()\n }\n\n componentDidMount() {\n\n if (!this.props.blockProps.data) {\n return\n }\n // ensure data isnt already loaded\n if (!this.dataForUpdate().endpoint && !this.dataForUpdate().provisory_text) {\n return\n }\n\n return axios({\n method: 'get',\n url: `${ this.dataForUpdate().endpoint }${ this.dataForUpdate().provisory_text }&scheme=https`\n }).then(result => {\n return this.setState({ embed_data: result.data } //JSON.parse(data.responseText)\n , this.updateData)\n }).catch(error => {\n return console.log(\"TODO: error\")\n })\n }\n\n classForImage() {\n if (this.state.embed_data.thumbnail_url) {\n return \"\"\n } else {\n return \"mixtapeImage--empty u-ignoreBlock\"\n }\n }\n\n render() {\n return (\n <figure className='graf--figure graf--iframe graf--first' tabIndex='0'>\n <div className='iframeContainer' \n dangerouslySetInnerHTML={ { __html: this.state.embed_data.html } } />\n <figcaption className='imageCaption'>\n <EditorBlock {...Object.assign({}, this.props, { \"className\": \"imageCaption\" })} />\n </figcaption>\n </figure>\n )\n }\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/blocks/video.js\n **/","import React from 'react'\n\nclass Debug extends React.Component {\n\n constructor() {\n super()\n\n this.handleToggleReadOnly = this.handleToggleReadOnly.bind(this)\n this.handleTestEmitAndDecode = this.handleTestEmitAndDecode.bind(this)\n this.handleTestEmitTEXT = this.handleTestEmitTEXT.bind(this)\n this.testEmitAndDecode = this.testEmitAndDecode.bind(this)\n this.testEmitTEXT = this.testEmitTEXT.bind(this)\n this.logState = this.logState.bind(this)\n this.toggleDisplay = this.toggleDisplay.bind(this)\n this.open = this.open.bind(this)\n this.render = this.render.bind(this)\n this.state = {\n output: \"\",\n display: \"none\"\n }\n }\n\n handleToggleReadOnly(e) {\n e.preventDefault()\n this.props.editor.toggleEditable()\n return false\n }\n\n handleTestEmitAndDecode(e) {\n e.preventDefault()\n return this.testEmitAndDecode()\n }\n\n handleTestEmitTEXT(e) {\n e.preventDefault()\n return this.testEmitTEXT()\n }\n\n testEmitAndDecode(e) {\n const raw_as_json = this.props.editor.emitSerializedOutput()\n this.props.editor.setState({ \n editorState: this.props.editor.decodeEditorContent(raw_as_json) }, \n this.logState(JSON.stringify(raw_as_json)))\n return false\n }\n\n testEmitTEXT() {\n const text = this.props.editor.getTextFromEditor()\n return this.logState(text)\n }\n\n logState(raw) {\n return this.setState({ output: raw }, this.open)\n }\n\n toggleDisplay(e) {\n e.preventDefault()\n const d = this.state.display === \"block\" ? \"none\" : this.state.display\n return this.setState({\n display: d })\n }\n\n open() {\n return this.setState({\n display: \"block\" })\n }\n\n render() {\n return (\n <div>\n <div className=\"debugControls\">\n <ul>\n <li> LOCKS: { this.props.editor.state.locks } </li>\n <li>\n <a href=\"#\" onClick={ this.handleToggleReadOnly }>\n EDITABLE: { this.props.editor.state.read_only ? 'NO' : 'YES' }\n </a>\n </li>\n <li>\n <a href=\"#\" onClick={ this.handleTestEmitTEXT }>EDITOR TEXT</a>\n </li>\n <li>\n <a href=\"#\" onClick={ this.handleTestEmitAndDecode }>EDITOR STATE</a>\n </li>\n </ul>\n </div>\n <div className=\"debugZone\" style={ { display: this.state.display } }>\n <a href=\"#\" className=\"dante-debug-close close\" onClick={ this.toggleDisplay } />\n <div className=\"debugOutput\">\n <h2>EDITOR OUTPUT</h2>\n {\n this.state.output.length > 0\n ? <pre>{ this.state.output }</pre>\n : undefined\n }\n </div>\n </div>\n </div>\n )\n }\n}\n\nexport default Debug\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/debug.js\n **/","import React from 'react'\nimport { Entity } from 'draft-js'\n\nexport default class Link extends React.Component {\n\n constructor(props) {\n super(props)\n this._validateLink = this._validateLink.bind(this)\n this._checkProtocol = this._checkProtocol.bind(this)\n this._showPopLinkOver = this._showPopLinkOver.bind(this)\n this._hidePopLinkOver = this._hidePopLinkOver.bind(this)\n this.isHover = false\n }\n\n _validateLink() {\n const pattern = new RegExp('^(https?:\\/\\/)?' + // protocol\n '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|' + // domain name\n '((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address\n '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' + // port and path\n '(\\?[&a-z\\d%_.~+=-]*)?' + // query string\n '(\\#[-a-z\\d_]*)?$', 'i') // fragment locater\n if (!pattern.test(str)) {\n alert(\"Please enter a valid URL.\")\n return false\n } else {\n return true\n }\n }\n\n _checkProtocol() {\n return console.log(\"xcvd\")\n }\n\n _showPopLinkOver(e) {\n if (!this.data.showPopLinkOver) {\n return\n }\n return this.data.showPopLinkOver(this.refs.link)\n }\n\n _hidePopLinkOver(e) {\n if (!this.data.hidePopLinkOver) {\n return\n }\n return this.data.hidePopLinkOver()\n }\n\n render() {\n this.data = Entity.get(this.props.entityKey).getData()\n\n return (\n <a\n ref=\"link\"\n href={ this.data.url }\n className=\"markup--anchor\"\n onMouseOver={ this._showPopLinkOver }\n onMouseOut={ this._hidePopLinkOver }\n >\n { this.props.children }\n </a>\n )\n }\n}\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/decorators/link.js\n **/","import React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { \n Entity, \n RichUtils, \n AtomicBlockUtils, \n EditorState \n } from 'draft-js'\n\nimport { \n addNewBlock, \n resetBlockWithType, \n updateDataOfBlock, \n getCurrentBlock, \n getNode } from '../../model/index.js'\n\nimport { getSelectionRect, getSelection } from \"../../utils/selection.js\"\n\nclass DanteInlineTooltip extends React.Component {\n\n constructor(props) {\n super(props)\n\n this.display = this.display.bind(this)\n this.show = this.show.bind(this)\n this.hide = this.hide.bind(this)\n this._toggleScaled = this._toggleScaled.bind(this)\n this.scale = this.scale.bind(this)\n this.collapse = this.collapse.bind(this)\n this.componentWillReceiveProps = this.componentWillReceiveProps.bind(this)\n this.clickOnFileUpload = this.clickOnFileUpload.bind(this)\n this.handlePlaceholder = this.handlePlaceholder.bind(this)\n this.insertImage = this.insertImage.bind(this)\n this.handleFileInput = this.handleFileInput.bind(this)\n this.widgets = this.widgets.bind(this)\n this.clickHandler = this.clickHandler.bind(this)\n this.relocate = this.relocate.bind(this)\n this.state = {\n position: { top: 0, left: 0 },\n show: false,\n scaled: false\n }\n }\n\n display(b) {\n if (b) {\n return this.show()\n } else {\n return this.hide()\n }\n }\n\n show() {\n return this.setState({\n show: true })\n }\n\n hide() {\n return this.setState({\n show: false })\n }\n\n setPosition(coords) {\n return this.setState({\n position: coords })\n }\n\n _toggleScaled(ev) {\n if (this.state.scaled) {\n return this.collapse()\n } else {\n return this.scale()\n }\n }\n\n scale() {\n return this.setState({\n scaled: true })\n }\n\n collapse() {\n return this.setState({\n scaled: false })\n }\n\n componentWillReceiveProps(newProps) {\n return this.collapse()\n }\n\n activeClass() {\n //if @props.show then \"is-active\" else \"\"\n if (this.isActive()) {\n return \"is-active\"\n } else {\n return \"\"\n }\n }\n\n isActive() {\n return this.state.show\n }\n\n scaledClass() {\n if (this.state.scaled) {\n return \"is-scaled\"\n } else {\n return \"\"\n }\n }\n\n scaledWidth() {\n if (this.state.scaled) {\n return \"124\"\n } else {\n return \"0\"\n }\n }\n\n clickOnFileUpload() {\n this.refs.fileInput.click()\n this.collapse()\n return this.hide()\n }\n\n handlePlaceholder(input) {\n let opts = {\n type: input.widget_options.insert_block,\n placeholder: input.options.placeholder,\n endpoint: input.options.endpoint\n }\n\n return this.props.onChange(resetBlockWithType(this.props.editorState, 'placeholder', opts))\n }\n\n insertImage(file) {\n let opts = {\n url: URL.createObjectURL(file),\n file\n }\n\n return this.props.onChange(addNewBlock(this.props.editorState, 'image', opts))\n }\n\n handleFileInput(e) {\n let fileList = e.target.files\n // TODO: support multiple file uploads\n /*\n Object.keys(fileList).forEach (o)=>\n @.insertImage(fileList[0])\n */\n return this.insertImage(fileList[0])\n }\n\n widgets() {\n return this.props.editor.widgets\n }\n\n clickHandler(e, type) {\n let request_block = this.widgets().find(o => o.icon === type)\n\n switch (request_block.widget_options.insertion) {\n case \"upload\":\n return this.clickOnFileUpload(e, request_block)\n case \"placeholder\":\n return this.handlePlaceholder(request_block)\n default:\n return console.log(`WRONG TYPE FOR ${ request_block.widget_options.insertion }`)\n }\n }\n\n getItems() {\n return this.widgets().filter(o => {\n return o.widget_options.displayOnInlineTooltip\n })\n }\n\n isDescendant(parent, child) {\n let node = child.parentNode\n while (node !== null) {\n if (node === parent) {\n return true\n }\n node = node.parentNode\n }\n return false\n }\n\n relocate() {\n let { editorState } = this.props\n\n if (editorState.getSelection().isCollapsed()) {\n\n let currentBlock = getCurrentBlock(editorState)\n let blockType = currentBlock.getType()\n\n let contentState = editorState.getCurrentContent()\n let selectionState = editorState.getSelection()\n\n let block = contentState.getBlockForKey(selectionState.anchorKey)\n\n let nativeSelection = getSelection(window)\n if (!nativeSelection.rangeCount) {\n return\n }\n\n let node = getNode()\n\n let selectionBoundary = getSelectionRect(nativeSelection)\n let coords = selectionBoundary //utils.getSelectionDimensions(node)\n\n let parent = ReactDOM.findDOMNode(this.props.editor)\n let parentBoundary = parent.getBoundingClientRect()\n\n // hide if selected node is not in editor\n // debugger\n //console.log @isDescendant(parent, nativeSelection.anchorNode)\n\n if (!this.isDescendant(parent, nativeSelection.anchorNode)) {\n this.hide()\n return\n }\n\n // checkeamos si esta vacio\n this.display(block.getText().length === 0 && blockType === \"unstyled\")\n return this.setPosition({\n top: coords.top + window.scrollY,\n left: coords.left + window.scrollX - 60\n })\n\n /*\n @refs.image_popover.display(blockType is \"image\")\n if blockType is \"image\"\n selectionBoundary = node.anchorNode.parentNode.parentNode.parentNode.getBoundingClientRect()\n *el = document.querySelector(\"#dante_image_popover\")\n el = @refs.image_popover.refs.image_popover\n padd = el.offsetWidth / 2\n @refs.image_popover.setPosition\n top: selectionBoundary.top - parentBoundary.top + 60\n left: selectionBoundary.left + (selectionBoundary.width / 2) - padd\n\n *@setState\n * image_popover_position:\n * top: selectionBoundary.top - parentBoundary.top + 60\n * left: selectionBoundary.left + (selectionBoundary.width / 2) - padd\n *\n */\n } else {\n return this.hide()\n }\n }\n\n render() {\n return (\n <div\n className={ `inlineTooltip ${ this.activeClass() } ${ this.scaledClass() }` }\n style={ this.state.position }\n >\n <button\n className=\"inlineTooltip-button control\"\n title=\"Close Menu\"\n data-action=\"inline-menu\"\n onClick={ this._toggleScaled }\n >\n <span className=\"tooltip-icon dante-icon-plus\" />\n </button>\n <div\n className=\"inlineTooltip-menu\"\n style={ { width: `${ this.scaledWidth() }px` } }\n >\n { this.getItems().map( (item, i) => {\n return <InlineTooltipItem\n item={ item }\n key={ i }\n clickHandler={ this.clickHandler }\n />\n })\n }\n <input\n type=\"file\"\n style={ { display: 'none' } }\n ref=\"fileInput\"\n multiple=\"multiple\"\n onChange={ this.handleFileInput }\n />\n </div>\n </div>\n )\n }\n}\n\nclass InlineTooltipItem extends React.Component {\n\n constructor(...args) {\n super(...args)\n this.clickHandler = this.clickHandler.bind(this)\n }\n\n clickHandler(e) {\n e.preventDefault()\n return this.props.clickHandler(e, this.props.item.icon)\n }\n\n render() {\n return (\n <button\n className=\"inlineTooltip-button scale\"\n title={ this.props.title }\n onMouseDown={ this.clickHandler }\n >\n <span className={ `tooltip-icon dante-icon-${ this.props.item.icon }` } />\n </button>\n )\n }\n}\n\nexport default DanteInlineTooltip\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/popovers/addButton.js\n **/","\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { Entity, RichUtils, AtomicBlockUtils, EditorState } from 'draft-js'\n\nimport { getSelectionRect, getSelection } from \"../../utils/selection.js\"\n\nimport { getCurrentBlock, getNode } from '../../model/index.js'\n\nclass DanteImagePopover extends React.Component {\n\n constructor(props) {\n super(props)\n\n this.display = this.display.bind(this)\n this.show = this.show.bind(this)\n this.hide = this.hide.bind(this)\n this._toggleScaled = this._toggleScaled.bind(this)\n this.scale = this.scale.bind(this)\n this.collapse = this.collapse.bind(this)\n this.relocate = this.relocate.bind(this)\n this.componentWillReceiveProps = this.componentWillReceiveProps.bind(this)\n this.handleClick = this.handleClick.bind(this)\n this.state = {\n position: {\n top: 0,\n left: 0\n },\n show: false,\n scaled: false,\n buttons: [{ type: \"left\" }, \n { type: \"center\"}, \n { type: \"fill\" }, \n { type: \"wide\" }]\n }\n }\n\n display(b) {\n if (b) {\n return this.show()\n } else {\n return this.hide()\n }\n }\n\n show() {\n return this.setState({\n show: true })\n }\n\n hide() {\n return this.setState({\n show: false })\n }\n\n setPosition(coords) {\n return this.setState({\n position: coords })\n }\n\n _toggleScaled(ev) {\n if (this.state.scaled) {\n return this.collapse()\n } else {\n return this.scale()\n }\n }\n\n scale() {\n return this.setState({\n scaled: true })\n }\n\n collapse() {\n return this.setState({\n scaled: false })\n }\n\n relocate() {\n let { editorState } = this.props\n\n if (editorState.getSelection().isCollapsed()) {\n\n let currentBlock = getCurrentBlock(editorState)\n let blockType = currentBlock.getType()\n\n let contentState = editorState.getCurrentContent()\n let selectionState = editorState.getSelection()\n\n let block = contentState.getBlockForKey(selectionState.anchorKey)\n\n let nativeSelection = getSelection(window)\n if (!nativeSelection.rangeCount) {\n return\n }\n\n let node = getNode()\n\n let selectionBoundary = getSelectionRect(nativeSelection)\n let coords = selectionBoundary\n\n let parent = ReactDOM.findDOMNode(this.props.editor)\n let parentBoundary = parent.getBoundingClientRect()\n\n this.display(blockType === \"image\")\n\n if (blockType === \"image\") {\n selectionBoundary = node.anchorNode.parentNode.parentNode\n .parentNode.getBoundingClientRect()\n let el = this.refs.image_popover\n let padd = el.offsetWidth / 2\n return this.setPosition({\n top: selectionBoundary.top - parentBoundary.top + 60,\n left: selectionBoundary.left + selectionBoundary.width / 2 - padd\n })\n }\n } else {\n return this.hide()\n }\n }\n\n componentWillReceiveProps(newProps) {\n return this.collapse()\n }\n\n getStyle() {\n if (!this.state.position) {\n return {}\n }\n }\n\n handleClick(item) {\n return this.props.editor.setDirection(item.type)\n }\n\n render() {\n return (\n <div\n ref=\"image_popover\"\n className={ `dante-popover popover--Aligntooltip popover--top popover--animated ${ this.state.show ? 'is-active' : undefined }` }\n style={ \n { top: this.state.position.top,\n left: this.state.position.left }\n }\n >\n <div className='popover-inner'>\n <ul className='dante-menu-buttons'>\n { this.state.buttons.map( (item, i) => {\n return <DanteImagePopoverItem\n item={ item }\n handleClick={ this.handleClick }\n key={ i }\n />\n })\n }\n </ul>\n </div>\n <div className='popover-arrow' />\n </div>\n )\n }\n}\n\nclass DanteImagePopoverItem extends React.Component {\n\n constructor(...args) {\n super(...args)\n this.handleClick = this.handleClick.bind(this)\n this.render = this.render.bind(this)\n }\n\n handleClick(e) {\n e.preventDefault()\n return this.props.handleClick(this.props.item)\n }\n\n render() {\n return <li \n className={`dante-menu-button align-${ this.props.item.type }`} \n onMouseDown={this.handleClick}>\n <span className={`tooltip-icon dante-icon-image-${ this.props.item.type }`} />\n </li>\n }\n}\n\nexport default DanteImagePopover\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/popovers/image.js\n **/","\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { getCurrentBlock } from '../../model/index.js'\n\nclass DanteAnchorPopover extends React.Component {\n\n constructor(props) {\n\n super(props)\n this.display = this.display.bind(this)\n this.show = this.show.bind(this)\n this.hide = this.hide.bind(this)\n this.relocate = this.relocate.bind(this)\n this.render = this.render.bind(this)\n this.state = {\n position: {\n top: 0,\n left: 0\n },\n show: false,\n url: \"\"\n }\n }\n\n display(b) {\n if (b) {\n return this.show()\n } else {\n return this.hide()\n }\n }\n\n show() {\n return this.setState({\n show: true })\n }\n\n hide() {\n return this.setState({\n show: false })\n }\n\n setPosition(coords) {\n return this.setState({\n position: coords })\n }\n\n relocate(node) {\n if (node == null) {\n node = null\n }\n if (!node) {\n return\n }\n\n let { editorState } = this.props\n let currentBlock = getCurrentBlock(editorState)\n let blockType = currentBlock.getType()\n\n let contentState = editorState.getCurrentContent()\n let selectionState = editorState.getSelection()\n\n let selectionBoundary = node.getBoundingClientRect()\n let coords = selectionBoundary\n\n let el = this.refs.dante_popover\n let padd = el.offsetWidth / 2\n\n let parent = ReactDOM.findDOMNode(this.props.editor)\n let parentBoundary = parent.getBoundingClientRect()\n\n return {\n top: selectionBoundary.top - parentBoundary.top + 160,\n left: selectionBoundary.left + selectionBoundary.width / 2 - padd\n }\n }\n\n render() {\n let { position } = this.state\n let style = {\n left: position.left,\n top: position.top,\n visibility: `${ this.state.show ? 'visible' : 'hidden' }`\n }\n return (\n <div\n ref=\"dante_popover\"\n className='dante-popover popover--tooltip popover--Linktooltip popover--bottom is-active'\n style={ style }\n onMouseOver={ this.props.handleOnMouseOver }\n onMouseOut={ this.props.handleOnMouseOut }\n >\n <div className='popover-inner'>\n <a href={ this.props.url } target='_blank'>\n { this.state.url }\n </a>\n </div>\n <div className='popover-arrow' />\n </div>\n )\n }\n}\n\nexport default DanteAnchorPopover\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/popovers/link.js\n **/","import React from 'react'\nimport ReactDOM from 'react-dom'\n\nimport { \n convertToRaw, \n CompositeDecorator, \n getVisibleSelectionRect, \n getDefaultKeyBinding, \n getSelectionOffsetKeyForNode, \n KeyBindingUtil, \n ContentState, \n Editor, \n EditorState, \n Entity, \n RichUtils } from 'draft-js'\n\nimport { getSelectionRect, getSelection } from \"../../utils/selection.js\"\n\nimport { getCurrentBlock } from '../../model/index.js'\n\nclass DanteTooltip extends React.Component {\n\n constructor(props) {\n super(props)\n this._clickInlineHandler = this._clickInlineHandler.bind(this)\n this.display = this.display.bind(this)\n this.show = this.show.bind(this)\n this.hide = this.hide.bind(this)\n this.relocate = this.relocate.bind(this)\n this._clickBlockHandler = this._clickBlockHandler.bind(this)\n this.displayLinkMode = this.displayLinkMode.bind(this)\n this.displayActiveMenu = this.displayActiveMenu.bind(this)\n this._enableLinkMode = this._enableLinkMode.bind(this)\n this._disableLinkMode = this._disableLinkMode.bind(this)\n this.handleInputEnter = this.handleInputEnter.bind(this)\n this.confirmLink = this.confirmLink.bind(this)\n this.inlineItems = this.inlineItems.bind(this)\n this.blockItems = this.blockItems.bind(this)\n this.getDefaultValue = this.getDefaultValue.bind(this)\n this.getVisibleSelectionRect = getVisibleSelectionRect\n this.state = {\n link_mode: false,\n show: false,\n position: {}\n }\n }\n\n _clickInlineHandler(ev, style) {\n ev.preventDefault()\n\n this.props.onChange(RichUtils.toggleInlineStyle(this.props.editorState, style))\n\n return setTimeout(() => {\n return this.relocate()\n }, 0)\n }\n\n display(b) {\n if (b) {\n return this.show()\n } else {\n return this.hide()\n }\n }\n\n show() {\n return this.setState({\n show: true })\n }\n\n hide() {\n return this.setState({\n link_mode: false,\n show: false\n })\n }\n\n setPosition(coords) {\n return this.setState({\n position: coords })\n }\n\n isDescendant(parent, child) {\n let node = child.parentNode\n while (node !== null) {\n if (node === parent) {\n return true\n }\n node = node.parentNode\n }\n return false\n }\n\n relocate() {\n\n let currentBlock = getCurrentBlock(this.props.editorState)\n let blockType = currentBlock.getType()\n // display tooltip only for unstyled\n\n if (this.props.configTooltip.selectionElements.indexOf(blockType) < 0) {\n this.hide()\n return\n }\n\n if (this.state.link_mode) {\n return\n }\n if (!this.state.show) {\n return\n }\n\n let el = this.refs.dante_menu\n let padd = el.offsetWidth / 2\n\n let nativeSelection = getSelection(window)\n if (!nativeSelection.rangeCount) {\n return\n }\n\n let selectionBoundary = getSelectionRect(nativeSelection)\n\n let parent = ReactDOM.findDOMNode(this.props.editor)\n let parentBoundary = parent.getBoundingClientRect()\n\n // hide if selected node is not in editor\n if (!this.isDescendant(parent, nativeSelection.anchorNode)) {\n this.hide()\n return\n }\n\n let top = selectionBoundary.top - parentBoundary.top - -90 - 5\n let left = selectionBoundary.left + selectionBoundary.width / 2 - padd\n\n if (!top || !left) {\n return\n }\n\n // console.log \"SET SHOW FOR TOOLTIP INSERT MENU\"\n return this.setState({\n show: true,\n position: {\n left,\n top\n }\n })\n }\n\n _clickBlockHandler(ev, style) {\n ev.preventDefault()\n\n this.props.onChange(RichUtils.toggleBlockType(this.props.editorState, style))\n\n return setTimeout(() => {\n return this.relocate()\n }, 0)\n }\n\n displayLinkMode() {\n if (this.state.link_mode) {\n return \"dante-menu--linkmode\"\n } else {\n return \"\"\n }\n }\n\n displayActiveMenu() {\n if (this.state.show) {\n return \"dante-menu--active\"\n } else {\n return \"\"\n }\n }\n\n _enableLinkMode(ev) {\n ev.preventDefault()\n return this.setState({\n link_mode: true })\n }\n\n _disableLinkMode(ev) {\n ev.preventDefault()\n return this.setState({\n link_mode: false,\n url: \"\"\n })\n }\n\n hideMenu() {\n return this.hide()\n }\n\n handleInputEnter(e) {\n if (e.which === 13) {\n return this.confirmLink(e)\n }\n }\n\n confirmLink(e) {\n e.preventDefault()\n let { editorState } = this.props\n let urlValue = e.currentTarget.value\n let contentState = editorState.getCurrentContent()\n let selection = editorState.getSelection()\n\n let opts = {\n url: urlValue,\n showPopLinkOver: this.props.showPopLinkOver,\n hidePopLinkOver: this.props.hidePopLinkOver\n }\n\n let entityKey = Entity.create('LINK', 'MUTABLE', opts)\n\n if (selection.isCollapsed()) {\n console.log(\"COLLAPSED SKIPPING LINK\")\n return\n }\n\n this.props.onChange(RichUtils.toggleLink(editorState, selection, entityKey))\n\n return this._disableLinkMode(e)\n }\n\n getPosition() {\n let pos = this.state.position\n return pos\n }\n\n inlineItems() {\n return this.props.widget_options.block_types.filter(o => {\n return o.type === \"inline\"\n })\n }\n\n blockItems() {\n return this.props.widget_options.block_types.filter(o => {\n return o.type === \"block\"\n })\n }\n\n getDefaultValue() {\n if (this.refs.dante_menu_input) {\n this.refs.dante_menu_input.value = \"\"\n }\n\n let currentBlock = getCurrentBlock(this.props.editorState)\n let blockType = currentBlock.getType()\n let selection = this.props.editor.state.editorState.getSelection()\n let selectedEntity = null\n let defaultUrl = null\n return currentBlock.findEntityRanges(character => {\n let entityKey = character.getEntity()\n selectedEntity = entityKey\n return entityKey !== null && Entity.get(entityKey).getType() === 'LINK'\n }, (start, end) => {\n let selStart = selection.getAnchorOffset()\n let selEnd = selection.getFocusOffset()\n if (selection.getIsBackward()) {\n selStart = selection.getFocusOffset()\n selEnd = selection.getAnchorOffset()\n }\n\n if (start === selStart && end === selEnd) {\n defaultUrl = Entity.get(selectedEntity).getData().url\n return this.refs.dante_menu_input.value = defaultUrl\n }\n })\n }\n\n render() {\n return (\n <div\n id=\"dante-menu\"\n ref=\"dante_menu\"\n className={ `dante-menu ${ this.displayActiveMenu() } ${ this.displayLinkMode() }` }\n style={ this.getPosition() }\n >\n <div className=\"dante-menu-linkinput\">\n <input\n className=\"dante-menu-input\"\n ref=\"dante_menu_input\"\n placeholder=\"Paste or type a link\"\n onKeyPress={ this.handleInputEnter }\n defaultValue={ this.getDefaultValue() }\n />\n <div className=\"dante-menu-button\" onMouseDown={ this._disableLinkMode } />\n </div>\n <ul className=\"dante-menu-buttons\">\n { this.blockItems().map( (item, i) => {\n return <DanteTooltipItem\n key={ i }\n item={ item }\n handleClick={ this._clickBlockHandler }\n editorState={ this.props.editorState }\n type=\"block\"\n currentStyle={ this.props.editorState.getCurrentInlineStyle }\n />\n })\n }\n <DanteTooltipLink\n editorState={ this.props.editorState }\n enableLinkMode={ this._enableLinkMode }\n />\n { this.inlineItems().map( (item, i) => {\n return <DanteTooltipItem\n key={ i }\n item={ item }\n type=\"inline\"\n editorState={ this.props.editorState }\n handleClick={ this._clickInlineHandler }\n />\n })\n }\n </ul>\n </div>\n )\n }\n}\n\nclass DanteTooltipItem extends React.Component {\n\n constructor(...args) {\n super(...args)\n this.handleClick = this.handleClick.bind(this)\n this.activeClass = this.activeClass.bind(this)\n this.isActive = this.isActive.bind(this)\n this.activeClassInline = this.activeClassInline.bind(this)\n this.activeClassBlock = this.activeClassBlock.bind(this)\n this.render = this.render.bind(this)\n }\n\n handleClick(ev) {\n return this.props.handleClick(ev, this.props.item.style)\n }\n\n activeClass() {\n if (this.isActive()) {\n return \"active\"\n } else {\n return \"\"\n }\n }\n\n isActive() {\n if (this.props.type === \"block\") {\n return this.activeClassBlock()\n } else {\n return this.activeClassInline()\n }\n }\n\n activeClassInline() {\n if (!this.props.editorState) {\n return\n }\n //console.log @props.item\n return this.props.editorState.getCurrentInlineStyle().has(this.props.item.style)\n }\n\n activeClassBlock() {\n //console.log \"EDITOR STATE\", @props.editorState\n if (!this.props.editorState) {\n return\n }\n let selection = this.props.editorState.getSelection()\n let blockType = this.props.editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType()\n return this.props.item.style === blockType\n }\n\n render() {\n return (\n <li className={ `dante-menu-button ${ this.activeClass() }` } onMouseDown={ this.handleClick }>\n <i className={ `dante-icon dante-icon-${ this.props.item.label }` } data-action=\"bold\" />\n </li>\n )\n }\n}\n\nclass DanteTooltipLink extends React.Component {\n\n constructor(...args) {\n super(...args)\n this.promptForLink = this.promptForLink.bind(this)\n }\n\n promptForLink(ev) {\n let selection = this.props.editorState.getSelection()\n if (!selection.isCollapsed()) {\n return this.props.enableLinkMode(ev)\n }\n }\n\n render() {\n return (\n <li className=\"dante-menu-button\" onMouseDown={ this.promptForLink }>\n <i className=\"dante-icon icon-createlink\" data-action=\"createlink\">link</i>\n </li>\n )\n }\n}\n\nexport default DanteTooltip\n\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/components/popovers/toolTip.js\n **/","import { Entity } from 'draft-js'\n\n//TODO: what the f*ck is happening here? ;-;\nconst findEntities = (entityType, instance, contentBlock, callback) => {\n return contentBlock.findEntityRanges((function(_this) {\n return function(character) {\n var entityKey, opts, res\n entityKey = character.getEntity()\n return (res = entityKey !== null && Entity.get(entityKey).getType() === entityType, res ? (opts = {\n showPopLinkOver: instance.showPopLinkOver,\n hidePopLinkOver: instance.hidePopLinkOver\n }, Entity.mergeData(entityKey, opts)) : void 0, res)\n }\n })(this), callback)\n}\n\nexport default findEntities\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/find_entities.js\n **/","import { ContentState, genKey, Entity, CharacterMetadata, ContentBlock, convertFromHTML, getSafeBodyFromHTML } from 'draft-js'\n\nimport { List, OrderedSet, Repeat, fromJS } from 'immutable'\n\n\n// { compose\n// } = require('underscore')\n\n// underscore compose function\nlet compose = function() {\n let args = arguments\n let start = args.length - 1\n return function() {\n let i = start\n let result = args[start].apply(this, arguments)\n while (i--) {\n result = args[i].call(this, result)\n }\n return result\n }\n}\n\n// from https://gist.github.com/N1kto/6702e1c2d89a33a15a032c234fc4c34e\n\n/*\n * Helpers\n */\n\n// Prepares img meta data object based on img attributes\nlet getBlockSpecForElement = imgElement=> {\n return {\n contentType: 'image',\n imgSrc: imgElement.getAttribute('src')\n }\n}\n\n// Wraps meta data in HTML element which is 'understandable' by Draft, I used <blockquote />.\nlet wrapBlockSpec = blockSpec=> {\n if (blockSpec === null) {\n return null\n }\n\n let tempEl = document.createElement('blockquote')\n // stringify meta data and insert it as text content of temp HTML element. We will later extract\n // and parse it.\n tempEl.innerText = JSON.stringify(blockSpec)\n return tempEl\n}\n\n// Replaces <img> element with our temp element\nlet replaceElement = (oldEl, newEl)=> {\n if (!(newEl instanceof HTMLElement)) {\n return\n }\n\n let upEl = getUpEl(oldEl)\n //parentNode = oldEl.parentNode\n //return parentNode.replaceChild(newEl, oldEl)\n return upEl.parentNode.insertBefore(newEl, upEl)\n}\n\nvar getUpEl = el=> {\n let original_el = el\n while (el.parentNode) {\n if (el.parentNode.tagName !== 'BODY') {\n el = el.parentNode\n }\n if (el.parentNode.tagName === 'BODY') { return el }\n }\n}\n\nlet elementToBlockSpecElement = compose(wrapBlockSpec, getBlockSpecForElement)\n\nlet imgReplacer = imgElement=> {\n return replaceElement(imgElement, elementToBlockSpecElement(imgElement))\n}\n\n/*\n * Main function\n */\n\n// takes HTML string and returns DraftJS ContentState\nlet customHTML2Content = function(HTML, blockRn){\n let tempDoc = new DOMParser().parseFromString(HTML, 'text/html')\n // replace all <img /> with <blockquote /> elements\n\n let a = tempDoc.querySelectorAll('img').forEach( item=> imgReplacer(item))\n\n // use DraftJS converter to do initial conversion. I don't provide DOMBuilder and\n // blockRenderMap arguments here since it should fall back to its default ones, which are fine\n console.log(tempDoc.body.innerHTML)\n let contentBlocks = convertFromHTML(tempDoc.body.innerHTML,\n getSafeBodyFromHTML,\n blockRn\n )\n\n // now replace <blockquote /> ContentBlocks with 'atomic' ones\n contentBlocks = contentBlocks.map(function(block){\n let newBlock\n console.log(\"CHECK BLOCK\", block.getType())\n if (block.getType() !== 'blockquote') {\n return block\n }\n\n let json = \"\"\n try {\n json = JSON.parse(block.getText())\n } catch (error) {\n return block\n }\n\n return newBlock = block.merge({\n type: \"image\",\n text: \"\",\n data: {\n url: json.imgSrc,\n forceUpload: true\n }\n })\n })\n\n tempDoc = null\n return ContentState.createFromBlockArray(contentBlocks)\n}\n\n\nexport default customHTML2Content\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/html2content.js\n **/","import axios from \"axios\"\nimport Immutable from 'immutable'\n\nclass SaveBehavior {\n constructor(options) {\n this.getLocks = options.getLocks\n this.config = options.config\n this.editorContent = options.editorContent\n this.editorState = options.editorState\n }\n\n handleStore(ev){\n return this.store()\n }\n\n store(content){\n if (!this.config.data_storage.url) { return }\n if (this.getLocks() > 0) { return }\n\n clearTimeout(this.timeout)\n\n return this.timeout = setTimeout(() => {\n return this.checkforStore(content)\n }\n , this.config.data_storage.interval)\n }\n\n getTextFromEditor(content){\n return content.blocks.map(o=> {\n return o.text\n }\n )\n .join(\"\\n\")\n }\n\n getUrl() {\n let { url } = this.config.data_storage\n if (typeof(url) === \"function\") { return url() } else { return url }\n }\n\n getMethod() {\n let { method } = this.config.data_storage\n if (typeof(method) === \"function\") { return method() } else { return method }\n }\n\n\n checkforStore(content){\n // ENTER DATA STORE\n let isChanged = !Immutable.is(Immutable.fromJS(this.editorContent), Immutable.fromJS(content))\n // console.log(\"CONTENT CHANGED:\", isChanged)\n\n if (!isChanged) { return }\n\n if (this.config.xhr.before_handler) { this.config.xhr.before_handler() }\n // console.log \"SAVING TO: #{@getMethod()} #{@getUrl()}\"\n\n return axios({\n method: this.getMethod(),\n url: this.getUrl(),\n data: {\n editor_content: JSON.stringify(content),\n text_content: this.getTextFromEditor(content)\n }\n })\n .then(result=> {\n // console.log \"STORING CONTENT\", result\n if (this.config.data_storage.success_handler) { this.config.data_storage.success_handler(result) }\n if (this.config.xhr.success_handler) { return this.config.xhr.success_handler(result) }\n }\n )\n .catch(error=> {\n // console.log(\"ERROR: got error saving content at #{@config.data_storage.url} - #{error}\")\n if (this.config.xhr.failure_handler) { return this.config.xhr.failure_handler(error) }\n }\n )\n }\n}\n\n\nexport default SaveBehavior\n\n\n\n/** WEBPACK FOOTER **\n ** ./src/utils/save_content.js\n **/"],"sourceRoot":""}