draft-extend
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("Immutable"),require("Draft"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","Immutable","Draft","ReactDOM"],t):"object"==typeof exports?exports.DraftExtend=t(require("React"),require("Immutable"),require("Draft"),require("ReactDOM")):e.DraftExtend=t(e.React,e.Immutable,e.Draft,e.ReactDOM)}(this,function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.compose=t.pluginUtils=t.createPlugin=t.KeyCommandController=t.Toolbar=t.Editor=void 0;var o=n(10),a=r(o),i=n(12),s=r(i),u=n(5),l=r(u),d=n(13),c=r(d),f=n(14),p=r(f),y=n(7),h=r(y);t.Editor=a.default,t.Toolbar=s.default,t.KeyCommandController=l.default,t.createPlugin=c.default,t.pluginUtils=p.default,t.compose=h.default},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(1),o=n(18);if("undefined"==typeof r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var a=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,a)},function(e,n){e.exports=t},function(e,t,n){e.exports=n(22)()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(9),p=r(f),y=n(3),h=n(6),m={addKeyCommandListener:l.default.func,removeKeyCommandListener:l.default.func,handleKeyCommand:l.default.func},v=function(e){return(0,c.default)({displayName:"KeyCommandController("+e.displayName+")",propTypes:a({editorState:l.default.object,onChange:l.default.func,keyCommandListeners:l.default.arrayOf(l.default.func)},m),getDefaultProps:function(){return{keyCommandListeners:[]}},componentWillMount:function(){this.keyCommandOverrides=(0,y.List)(this.props.keyCommandListeners),this.keyCommandListeners=(0,y.List)()},componentDidMount:function(){var e=this,t=Object.keys(m),n=t.filter(function(t){return void 0!==e.props[t]}),r=0===n.length,o=n.length===t.length;(0,p.default)(r||o,"KeyCommandController: A KeyCommandController is receiving only some props ("+n.join(", ")+") necessary to defer to a parent key command controller."),o&&this.props.keyCommandListeners.forEach(function(t){e.props.addKeyCommandListener(t)})},componentWillUnmount:function(){var e=this;this.props.removeKeyCommandListener&&this.props.keyCommandListeners.forEach(function(t){e.props.removeKeyCommandListener(t)})},addKeyCommandListener:function e(t){var e=this.props.addKeyCommandListener;return e?void e(t):void(this.keyCommandListeners=this.keyCommandListeners.unshift(t))},removeKeyCommandListener:function e(t){var e=this.props.removeKeyCommandListener;return e?void e(t):void(this.keyCommandListeners=this.keyCommandListeners.filterNot(function(e){return e===t}))},handleKeyCommand:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.props,o=r.editorState,a=r.onChange,e=r.handleKeyCommand;if(e)return e(t,n);var i=this.keyCommandListeners.concat(this.keyCommandOverrides).reduce(function(e,r){var o=e.state,i=e.hasChanged;if(i===!0)return{state:o,hasChanged:i};var s=r(o,t,n),u=s instanceof h.EditorState;return s===!0||u&&s!==o?u?(a(s),{state:s,hasChanged:!0}):{state:o,hasChanged:!0}:{state:o,hasChanged:i}},{state:o,hasChanged:!1});return i.hasChanged},focus:function(){this.refs.editor.focus()},blur:function(){this.refs.editor.blur()},render:function(){var t=this.props,n=t.editorState,r=t.onChange,i=(t.keyCommandListeners,o(t,["editorState","onChange","keyCommandListeners"]));return s.default.createElement(e,a({},i,{ref:"editor",editorState:n,onChange:r,addKeyCommandListener:this.addKeyCommandListener,removeKeyCommandListener:this.removeKeyCommandListener,handleKeyCommand:this.handleKeyCommand}))}})};t.default=v},function(e,t){e.exports=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){if(0===t.length)return arguments.length<=0?void 0:arguments[0];var e=t[t.length-1],n=t.slice(0,-1);return n.reduceRight(function(e,t){return t(e)},e.apply(void 0,arguments))}}},function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,u){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,r,a,i,s,u],c=0;l=new Error(t.replace(/%s/g,function(){return d[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,s],d=0;u=new Error(t.replace(/%s/g,function(){return l[d++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(6),p=n(5),y=r(p),h=n(11),m=r(h),v={className:l.default.string,editorState:l.default.object,onChange:l.default.func,decorators:l.default.array,baseDecorator:l.default.func,styleMap:l.default.object,styleFn:l.default.func,buttons:l.default.array,overlays:l.default.array,blockRendererFn:l.default.func,blockStyleFn:l.default.func,keyBindingFn:l.default.func,addKeyCommandListener:l.default.func.isRequired,removeKeyCommandListener:l.default.func.isRequired,handleReturn:l.default.func,onEscape:l.default.func,onTab:l.default.func,onUpArrow:l.default.func,onDownArrow:l.default.func,readOnly:l.default.bool,showButtons:l.default.bool,renderTray:l.default.func},g=(0,c.default)({displayName:"EditorWrapper",propTypes:v,childContextTypes:{getEditorState:l.default.func,getReadOnly:l.default.func,setReadOnly:l.default.func,onChange:l.default.func,focus:l.default.func,blur:l.default.func},getDefaultProps:function(){return{className:"",editorState:f.EditorState.createEmpty(),onChange:function(){},decorators:[],baseDecorator:f.CompositeDecorator,styleMap:{},styleFn:function(){},buttons:[],overlays:[],blockRendererFn:function(){},blockStyleFn:function(){},keyBindingFn:function(){},readOnly:!1,showButtons:!0}},getInitialState:function(){var e=this.props.baseDecorator,t=new e(this.props.decorators);return{decorator:t,readOnly:!1}},getChildContext:function(){return{getEditorState:this.getDecoratedState,getReadOnly:this.getReadOnly,setReadOnly:this.setReadOnly,onChange:this.props.onChange,focus:this.focus,blur:this.blur}},componentWillReceiveProps:function(e){if(e.decorators.length===this.state.decorator._decorators.length){var t=this.state.decorator._decorators.every(function(t,n){return t===e.decorators[n]});if(t)return}this.setState({decorator:new e.baseDecorator(e.decorators)})},keyBindingFn:function(e){var t=this.props.keyBindingFn(e);return t?t:(0,f.getDefaultKeyBinding)(e)},handleReturn:function(e,t){return this.props.handleReturn&&this.props.handleReturn(e,t)||this.props.handleKeyCommand("return",e)},onEscape:function(e){return this.props.onEscape&&this.props.onEscape(e)||this.props.handleKeyCommand("escape",e)},onTab:function(e){return this.props.onTab&&this.props.onTab(e)||this.props.handleKeyCommand("tab",e)},onUpArrow:function(e){return this.props.onUpArrow&&this.props.onUpArrow(e)||this.props.handleKeyCommand("up-arrow",e)},onDownArrow:function(e){return this.props.onDownArrow&&this.props.onDownArrow(e)||this.props.handleKeyCommand("down-arrow",e)},focus:function(){this.refs.editor.focus()},blur:function(){this.refs.editor.blur()},getOtherProps:function(){var e=this,t=Object.keys(this.props),n=Object.keys(v),r=t.filter(function(e){return n.indexOf(e)===-1});return r.reduce(function(t,n){return t[n]=e.props[n],t},{})},getReadOnly:function(){return this.state.readOnly||this.props.readOnly},setReadOnly:function(e){this.setState({readOnly:e})},getDecoratedState:function(){var e=this.props.editorState,t=this.state.decorator,n=e.getDecorator();return n&&n._decorators===t._decorators?e:f.EditorState.set(e,{decorator:t})},renderTray:function e(){var e=this.props.renderTray;return"function"!=typeof e?null:e()},renderPluginButtons:function(){var e=this,t=this.props,n=t.onChange,r=t.addKeyCommandListener,o=t.removeKeyCommandListener,i=t.showButtons;if(i===!1)return null;var u=this.getDecoratedState();return this.props.buttons.map(function(t,i){return s.default.createElement(t,a({},e.getOtherProps(),{key:"button-"+i,attachedToEditor:!0,editorState:u,onChange:n,addKeyCommandListener:r,removeKeyCommandListener:o}))})},renderOverlays:function(){var e=this,t=this.props,n=t.onChange,r=t.addKeyCommandListener,o=t.removeKeyCommandListener,i=this.getDecoratedState();return this.props.overlays.map(function(t,u){return s.default.createElement(m.default,{key:u},s.default.createElement(t,a({},e.getOtherProps(),{editorState:i,onChange:n,addKeyCommandListener:r,removeKeyCommandListener:o})))})},render:function(){var e=this.props,t=e.styleMap,n=e.styleFn,r=e.blockRendererFn,i=e.blockStyleFn,u=e.onChange,l=e.handleKeyCommand,d=o(e,["styleMap","styleFn","blockRendererFn","blockStyleFn","onChange","handleKeyCommand"]),c=this.getDecoratedState(),p="draft-extend "+this.props.className,y=this.getReadOnly();return s.default.createElement("div",{className:p},s.default.createElement("div",{className:"draft-extend-editor"},s.default.createElement(f.Editor,a({},d,{ref:"editor",editorState:c,readOnly:y,onChange:u,blockStyleFn:i,blockRendererFn:r,customStyleMap:t,customStyleFn:n,handleKeyCommand:l,keyBindingFn:this.keyBindingFn,handleReturn:this.handleReturn,onEscape:this.onEscape,onTab:this.onTab,onUpArrow:this.onUpArrow,onDownArrow:this.onDownArrow})),s.default.createElement("div",{className:"draft-extend-tray"},this.renderTray()),s.default.createElement("div",{className:"draft-extend-controls"},this.renderPluginButtons()),s.default.createElement("div",{className:"draft-extend-overlays"},this.renderOverlays())))}});t.default=(0,y.default)(g)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=r(o),i=n(24),s=r(i),u=n(2),l=r(u);t.default=(0,l.default)({displayName:"OverlayWrapper",getInitialState:function(){var e=document.createElement("div");return document.body.appendChild(e),{node:e}},componentDidMount:function(){this.renderOverlay()},componentDidUpdate:function(){this.renderOverlay()},componentWillUnmount:function(){s.default.unmountComponentAtNode(this.state.node)},renderOverlay:function(){var e=a.default.Children.only(this.props.children);s.default.render(e,this.state.node)},render:function(){return null}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(5),p=r(f),y=(0,c.default)({displayName:"Toolbar",propTypes:{editorState:l.default.object,onChange:l.default.func,buttons:l.default.array,addKeyCommandListener:l.default.func.isRequired,removeKeyCommandListener:l.default.func.isRequired},childContextTypes:{getEditorState:l.default.func,onChange:l.default.func},getChildContext:function(){return{getEditorState:this.getEditorState,onChange:this.props.onChange}},getEditorState:function(){return this.props.editorState},renderButtons:function(){var e=this.props,t=e.editorState,n=e.onChange,r=e.buttons,i=e.addKeyCommandListener,u=e.removeKeyCommandListener,l=o(e,["editorState","onChange","buttons","addKeyCommandListener","removeKeyCommandListener"]);return r.map(function(e,r){return s.default.createElement(e,a({},l,{key:"button-"+r,editorState:t,onChange:n,addKeyCommandListener:i,removeKeyCommandListener:u}))})},render:function(){return s.default.createElement("ul",{className:"draft-extend-controls"},this.renderButtons())}});t.default=(0,p.default)(y)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),i=r(a),s=n(4),u=r(s),l=n(2),d=r(l),c=n(3),f=n(16),p=r(f),y=n(7),h=r(y),m=n(15),v=r(m),g=n(17),b=r(g),C=function(){},E=[],O={},_=function(e){return function(){return e.apply(void 0,arguments)}};_.__isMiddleware=!0;var M=(0,p.default)(h.default),S=(0,p.default)(v.default),T=(0,p.default)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object.assign.apply(Object,[{}].concat(t))}),k=(0,p.default)(function(e,t){return e.concat(t)}),w=(0,p.default)(function(e){return Array.isArray(e)?e:[e]}),D=(0,p.default)(function(e){return function(t,n){return e(t,n,(0,c.OrderedSet)())}}),R=(0,p.default)(b.default),x=function e(t){var n=t.displayName,r=void 0===n?"Plugin":n,a=t.decorators,s=void 0===a?E:a,l=t.buttons,c=void 0===l?E:l,f=t.overlays,p=void 0===f?E:f,y=t.styleMap,h=void 0===y?O:y,m=t.styleFn,v=void 0===m?C:m,g=t.blockRendererFn,b=void 0===g?C:g,x=t.blockStyleFn,L=void 0===x?C:x,N=t.keyBindingFn,j=void 0===N?C:N,F=t.keyCommandListener,P=void 0===F?C:F,A=t.htmlToStyle,K=void 0===A?_:A,I=t.htmlToBlock,B=void 0===I?_:I,Y=t.htmlToEntity,U=void 0===Y?_:Y,q=t.textToEntity,W=void 0===q?_:q,H=t.styleToHTML,G=void 0===H?_:H,V=t.blockToHTML,z=void 0===V?_:V,Z=t.entityToHTML,J=void 0===Z?_:Z;return function(t){return s=w(s),c=w(c),p=w(p),t.prototype&&t.prototype.isReactComponent?(0,d.default)({displayName:r,propTypes:{styleMap:u.default.object,styleFn:u.default.func,decorators:u.default.array,buttons:u.default.array,overlays:u.default.array,blockRendererFn:u.default.func,blockStyleFn:u.default.func,keyBindingFn:u.default.func,keyCommandListeners:u.default.arrayOf(u.default.func)},getDefaultProps:function(){return{styleMap:O,styleFn:C,decorators:E,buttons:E,overlays:E,blockRendererFn:C,blockStyleFn:C,keyBindingFn:C,keyCommandListeners:E}},focus:function(){this.refs.child.focus&&this.refs.child.focus()},blur:function(){this.refs.child.blur&&this.refs.child.blur()},render:function(){var e=T(this.props.styleMap,h),n=S(this.props.styleFn,v),r=k(this.props.decorators,s),a=k(this.props.buttons,c),u=k(this.props.overlays,p),l=S(b,this.props.blockRendererFn),d=S(L,this.props.blockStyleFn),f=S(j,this.props.keyBindingFn),y=k(this.props.keyCommandListeners,w(P));return i.default.createElement(t,o({},this.props,{ref:"child",styleMap:e,styleFn:n,decorators:r,buttons:a,overlays:u,blockRendererFn:l,blockStyleFn:d,keyBindingFn:f,keyCommandListeners:y}))}}):function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];if(1===r.length&&("string"==typeof r[0]||r[0].hasOwnProperty("_map")&&null!=r[0].getBlockMap))return t({htmlToStyle:K,htmlToBlock:B,htmlToEntity:U,textToEntity:W,styleToHTML:G,blockToHTML:z,entityToHTML:J}).apply(void 0,r);var a=r[0],i=M(R(D(K)),R(a.htmlToStyle));i.__isMiddleware=!0;var s=M(R(B),R(a.htmlToBlock));s.__isMiddleware=!0;var u=M(R(U),R(a.htmlToEntity));u.__isMiddleware=!0;var l=M(R(W),R(a.textToEntity));l.__isMiddleware=!0;var d=M(R(G),R(a.styleToHTML));d.__isMiddleware=!0;var c=M(R(z),R(a.blockToHTML));c.__isMiddleware=!0;var f=M(R(J),R(a.entityToHTML));return f.__isMiddleware=!0,e({htmlToStyle:i,htmlToBlock:s,htmlToEntity:u,textToEntity:l,styleToHTML:d,blockToHTML:c,entityToHTML:f})(t)}}};t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),a=n(3),i=n(9),s=r(i),u=function(e){return e.replace(/[a-z][A-Z]/g,function(e){return e[0]+"-"+e[1].toLowerCase()})},l=function(e){var t=e.getCurrentContent().getBlockForKey(e.getSelection().getStartKey());if(t)return t.getEntityAt(e.getSelection().getStartOffset())};t.default={camelCaseToHyphen:u,styleObjectToString:function(e){return Object.keys(e).map(function(t){return u(t)+": "+e[t]+";"}).join(" ").replace(/"/g,'\\"')},entityStrategy:function(e){return function(t,n,r){t.findEntityRanges(function(t){var n=t.getEntity();if(null===n)return!1;var a=r&&r.getEntity?r.getEntity(n):o.Entity.get(n);return a&&a.getType()===e},n)}},getEntitySelection:function(e,t){var n=[];return e.getCurrentContent().getBlocksAsArray().forEach(function(e){e.findEntityRanges(function(e){return e.getEntity()===t},function(t,r){n.push(o.SelectionState.createEmpty(e.getKey()).merge({anchorOffset:t,focusOffset:r,isBackward:!1,hasFocus:!0}))})}),(0,s.default)(1===n.length,"getEntitySelection: More than one range with the same entityKey. Please use unique entity instances"),n[0]},insertBlockAtCursor:function(e,t){var n=e.getCurrentContent(),r=e.getSelection(),i=o.Modifier.removeRange(n,r,"backward"),s=i.getSelectionAfter(),u=o.Modifier.splitBlock(i,s),l=u.getSelectionAfter(),d=o.Modifier.setBlockType(u,l,t.getType()),c=[t,new o.ContentBlock({key:(0,o.genKey)(),type:"unstyled",text:"",characterList:(0,a.List)()})],f=o.BlockMapBuilder.createFromArray(c),p=o.Modifier.replaceWithFragment(d,l,f),y=p.merge({selectionBefore:r,selectionAfter:p.getSelectionAfter().set("hasFocus",!0)});return o.EditorState.push(e,y,"insert-fragment")},getSelectedInlineStyles:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getBlockMap().skipUntil(function(e,n){return n===t.getStartKey()}).takeUntil(function(e,r){return n.getKeyBefore(r)===t.getEndKey()});return r.reduce(function(e,n){var r=n.getKey(),o=0,a=n.getLength()-1;r===t.getStartKey()&&(o=t.getStartOffset()),r===t.getEndKey()&&(a=t.getEndOffset());for(var i=o;i<=a;i++)e=e.union(n.getInlineStyleAt(i));return e},(0,a.Set)())},matchAll:function(e,t){for(var n=[],r=t.exec(e);null!==r;)n.push(r.concat([r.index])),r=t.exec(e);return n},getActiveEntity:l,isEntityActive:function(e,t){var n=l(e),r=e.getCurrentContent();if(n){var a=r.getEntity?r.getEntity(n):o.Entity.get(n);return a&&a.type===t}return!1}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(){var n=e.apply(void 0,arguments);return null===n||void 0===n?t.apply(void 0,arguments):n}}},function(e,t,n){"use strict";function r(e){var t=(0,o.Map)();return function(){var n=o.List.of.apply(o.List,arguments);return t.has(n)||(t=t.set(n,e.apply(void 0,arguments))),t.get(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(3),a=function(e){return e&&e.__isMiddleware?e:function(t){return function(){if("object"===("undefined"==typeof e?"undefined":r(e))){var n=arguments.length<=0?void 0:arguments[0],a=void 0;if("string"==typeof n){var i=n;a=e[i]}else a=e[n.type];return null!==a&&void 0!==a?a:t.apply(void 0,arguments)}var s=void 0;try{var u=e.apply(void 0,arguments);if(null===u||void 0===u)s=t.apply(void 0,arguments);else if(2===arguments.length&&"string"==typeof(arguments.length<=1?void 0:arguments[1])&&(arguments.length<=1?void 0:arguments[1])===u)s=t.apply(void 0,arguments);else if(Array.isArray(u))s=u.concat(t.apply(void 0,arguments));else if(o.OrderedSet.isOrderedSet(u)){var l,d=(l=arguments.length-1,arguments.length<=l?void 0:arguments[l]);s=d.union(u).union(t.apply(void 0,arguments))}else s="function"==typeof u?e(t).apply(void 0,arguments):u}catch(n){s=e(t).apply(void 0,arguments)}finally{return s}}}};t.default=a},function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=g.hasOwnProperty(t)?g[t]:null;O.hasOwnProperty(t)&&u("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&u("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function a(e,n){if(n){u("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),u(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,a=r.__reactAutoBindPairs;n.hasOwnProperty(l)&&b.mixins(e,n.mixins);for(var i in n)if(n.hasOwnProperty(i)&&i!==l){var s=n[i],d=r.hasOwnProperty(i);if(o(d,i),b.hasOwnProperty(i))b[i](e,s);else{var c=g.hasOwnProperty(i),y="function"==typeof s,h=y&&!c&&!d&&n.autobind!==!1;if(h)a.push(i,s),r[i]=s;else if(d){var m=g[i];u(c&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,i),"DEFINE_MANY_MERGED"===m?r[i]=f(r[i],s):"DEFINE_MANY"===m&&(r[i]=p(r[i],s))}else r[i]=s}}}else;}function d(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in b;u(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;u(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function c(e,t){u(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(u(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return c(o,n),c(o,r),o}}function p(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function y(e,t){var n=t.bind(e);return n}function h(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=y(e,o)}}function m(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&h(this),this.props=e,this.context=r,this.refs=s,this.updater=o||n,this.state=null;var a=this.getInitialState?this.getInitialState():null;u("object"==typeof a&&!Array.isArray(a),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=a});t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],v.forEach(a.bind(null,t)),a(t,C),a(t,e),a(t,E),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),u(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)t.prototype[o]||(t.prototype[o]=null);return t}var v=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},b={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){d(e,t)},autobind:function(){}},C={componentDidMount:function(){this.__isMounted=!0}},E={componentWillUnmount:function(){this.__isMounted=!1}},O={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return i(_.prototype,e.prototype,O),m}var a,i=n(21),s=n(20),u=n(8),l="mixins";a={},e.exports=o},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t){/* | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("Immutable"),require("Draft"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","Immutable","Draft","ReactDOM"],t):"object"==typeof exports?exports.DraftExtend=t(require("React"),require("Immutable"),require("Draft"),require("ReactDOM")):e.DraftExtend=t(e.React,e.Immutable,e.Draft,e.ReactDOM)}(this,function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.compose=t.pluginUtils=t.createPlugin=t.KeyCommandController=t.Toolbar=t.Editor=void 0;var o=n(10),a=r(o),i=n(12),s=r(i),u=n(5),l=r(u),d=n(13),c=r(d),f=n(14),p=r(f),y=n(7),h=r(y);t.Editor=a.default,t.Toolbar=s.default,t.KeyCommandController=l.default,t.createPlugin=c.default,t.pluginUtils=p.default,t.compose=h.default},function(t,n){t.exports=e},function(e,t,n){"use strict";var r=n(1),o=n(18);if("undefined"==typeof r)throw Error("create-react-class could not find the React object. If you are using script tags, make sure that React is being loaded before create-react-class.");var a=(new r.Component).updater;e.exports=o(r.Component,r.isValidElement,a)},function(e,n){e.exports=t},function(e,t,n){e.exports=n(22)()},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(9),p=r(f),y=n(3),h=n(6),m={addKeyCommandListener:l.default.func,removeKeyCommandListener:l.default.func,handleKeyCommand:l.default.func},v=function(e){return(0,c.default)({displayName:"KeyCommandController("+e.displayName+")",propTypes:a({editorState:l.default.object,onChange:l.default.func,keyCommandListeners:l.default.arrayOf(l.default.func)},m),getDefaultProps:function(){return{keyCommandListeners:[]}},componentWillMount:function(){this.keyCommandOverrides=(0,y.List)(this.props.keyCommandListeners),this.keyCommandListeners=(0,y.List)()},componentDidMount:function(){var e=this,t=Object.keys(m),n=t.filter(function(t){return void 0!==e.props[t]}),r=0===n.length,o=n.length===t.length;(0,p.default)(r||o,"KeyCommandController: A KeyCommandController is receiving only some props ("+n.join(", ")+") necessary to defer to a parent key command controller."),o&&this.props.keyCommandListeners.forEach(function(t){e.props.addKeyCommandListener(t)})},componentWillUnmount:function(){var e=this;this.props.removeKeyCommandListener&&this.props.keyCommandListeners.forEach(function(t){e.props.removeKeyCommandListener(t)})},addKeyCommandListener:function e(t){var e=this.props.addKeyCommandListener;return e?void e(t):void(this.keyCommandListeners=this.keyCommandListeners.unshift(t))},removeKeyCommandListener:function e(t){var e=this.props.removeKeyCommandListener;return e?void e(t):void(this.keyCommandListeners=this.keyCommandListeners.filterNot(function(e){return e===t}))},handleKeyCommand:function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=this.props,o=r.editorState,a=r.onChange,e=r.handleKeyCommand;if(e)return e(t,n);var i=this.keyCommandListeners.concat(this.keyCommandOverrides).reduce(function(e,r){var o=e.state,i=e.hasChanged;if(i===!0)return{state:o,hasChanged:i};var s=r(o,t,n),u=s instanceof h.EditorState;return s===!0||u&&s!==o?u?(a(s),{state:s,hasChanged:!0}):{state:o,hasChanged:!0}:{state:o,hasChanged:i}},{state:o,hasChanged:!1});return i.hasChanged},focus:function(){this.refs.editor.focus()},blur:function(){this.refs.editor.blur()},render:function(){var t=this.props,n=t.editorState,r=t.onChange,i=(t.keyCommandListeners,o(t,["editorState","onChange","keyCommandListeners"]));return s.default.createElement(e,a({},i,{ref:"editor",editorState:n,onChange:r,addKeyCommandListener:this.addKeyCommandListener,removeKeyCommandListener:this.removeKeyCommandListener,handleKeyCommand:this.handleKeyCommand}))}})};t.default=v},function(e,t){e.exports=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){if(0===t.length)return arguments.length<=0?void 0:arguments[0];var e=t[t.length-1],n=t.slice(0,-1);return n.reduceRight(function(e,t){return t(e)},e.apply(void 0,arguments))}}},function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,u){if(o(t),!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var d=[n,r,a,i,s,u],c=0;l=new Error(t.replace(/%s/g,function(){return d[c++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=function(e,t,n,r,o,a,i,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,a,i,s],d=0;u=new Error(t.replace(/%s/g,function(){return l[d++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(6),p=n(5),y=r(p),h=n(11),m=r(h),v={className:l.default.string,editorState:l.default.object,onChange:l.default.func,decorators:l.default.array,baseDecorator:l.default.func,styleMap:l.default.object,styleFn:l.default.func,buttons:l.default.array,overlays:l.default.array,blockRendererFn:l.default.func,blockStyleFn:l.default.func,keyBindingFn:l.default.func,addKeyCommandListener:l.default.func.isRequired,removeKeyCommandListener:l.default.func.isRequired,handleReturn:l.default.func,onEscape:l.default.func,onTab:l.default.func,onUpArrow:l.default.func,onDownArrow:l.default.func,readOnly:l.default.bool,showButtons:l.default.bool,renderTray:l.default.func},g=(0,c.default)({displayName:"EditorWrapper",propTypes:v,childContextTypes:{getEditorState:l.default.func,getReadOnly:l.default.func,setReadOnly:l.default.func,onChange:l.default.func,focus:l.default.func,blur:l.default.func,editorRef:l.default.node},getDefaultProps:function(){return{className:"",editorState:f.EditorState.createEmpty(),onChange:function(){},decorators:[],baseDecorator:f.CompositeDecorator,styleMap:{},styleFn:function(){},buttons:[],overlays:[],blockRendererFn:function(){},blockStyleFn:function(){},keyBindingFn:function(){},readOnly:!1,showButtons:!0}},getInitialState:function(){var e=this.props.baseDecorator,t=new e(this.props.decorators);return{decorator:t,readOnly:!1}},getChildContext:function(){return{getEditorState:this.getDecoratedState,getReadOnly:this.getReadOnly,setReadOnly:this.setReadOnly,onChange:this.props.onChange,focus:this.focus,blur:this.blur,editorRef:this.refs.editor}},componentWillReceiveProps:function(e){if(e.decorators.length===this.state.decorator._decorators.length){var t=this.state.decorator._decorators.every(function(t,n){return t===e.decorators[n]});if(t)return}this.setState({decorator:new e.baseDecorator(e.decorators)})},keyBindingFn:function(e){var t=this.props.keyBindingFn(e);return t?t:(0,f.getDefaultKeyBinding)(e)},handleReturn:function(e,t){return this.props.handleReturn&&this.props.handleReturn(e,t)||this.props.handleKeyCommand("return",e)},onEscape:function(e){return this.props.onEscape&&this.props.onEscape(e)||this.props.handleKeyCommand("escape",e)},onTab:function(e){return this.props.onTab&&this.props.onTab(e)||this.props.handleKeyCommand("tab",e)},onUpArrow:function(e){return this.props.onUpArrow&&this.props.onUpArrow(e)||this.props.handleKeyCommand("up-arrow",e)},onDownArrow:function(e){return this.props.onDownArrow&&this.props.onDownArrow(e)||this.props.handleKeyCommand("down-arrow",e)},focus:function(){this.refs.editor.focus()},blur:function(){this.refs.editor.blur()},getOtherProps:function(){var e=this,t=Object.keys(this.props),n=Object.keys(v),r=t.filter(function(e){return n.indexOf(e)===-1});return r.reduce(function(t,n){return t[n]=e.props[n],t},{})},getReadOnly:function(){return this.state.readOnly||this.props.readOnly},setReadOnly:function(e){this.setState({readOnly:e})},getDecoratedState:function(){var e=this.props.editorState,t=this.state.decorator,n=e.getDecorator();return n&&n._decorators===t._decorators?e:f.EditorState.set(e,{decorator:t})},renderTray:function e(){var e=this.props.renderTray;return"function"!=typeof e?null:e()},renderPluginButtons:function(){var e=this,t=this.props,n=t.onChange,r=t.addKeyCommandListener,o=t.removeKeyCommandListener,i=t.showButtons;if(i===!1)return null;var u=this.getDecoratedState();return this.props.buttons.map(function(t,i){return s.default.createElement(t,a({},e.getOtherProps(),{key:"button-"+i,attachedToEditor:!0,editorState:u,onChange:n,addKeyCommandListener:r,removeKeyCommandListener:o}))})},renderOverlays:function(){var e=this,t=this.props,n=t.onChange,r=t.addKeyCommandListener,o=t.removeKeyCommandListener,i=this.getDecoratedState();return this.props.overlays.map(function(t,u){return s.default.createElement(m.default,{key:u},s.default.createElement(t,a({},e.getOtherProps(),{editorState:i,onChange:n,addKeyCommandListener:r,removeKeyCommandListener:o})))})},render:function(){var e=this.props,t=e.styleMap,n=e.styleFn,r=e.blockRendererFn,i=e.blockStyleFn,u=e.onChange,l=e.handleKeyCommand,d=o(e,["styleMap","styleFn","blockRendererFn","blockStyleFn","onChange","handleKeyCommand"]),c=this.getDecoratedState(),p="draft-extend "+this.props.className,y=this.getReadOnly();return s.default.createElement("div",{className:p},s.default.createElement("div",{className:"draft-extend-editor"},s.default.createElement(f.Editor,a({},d,{ref:"editor",editorState:c,readOnly:y,onChange:u,blockStyleFn:i,blockRendererFn:r,customStyleMap:t,customStyleFn:n,handleKeyCommand:l,keyBindingFn:this.keyBindingFn,handleReturn:this.handleReturn,onEscape:this.onEscape,onTab:this.onTab,onUpArrow:this.onUpArrow,onDownArrow:this.onDownArrow})),s.default.createElement("div",{className:"draft-extend-tray"},this.renderTray()),s.default.createElement("div",{className:"draft-extend-controls"},this.renderPluginButtons()),s.default.createElement("div",{className:"draft-extend-overlays"},this.renderOverlays())))}});t.default=(0,y.default)(g)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=r(o),i=n(24),s=r(i),u=n(2),l=r(u);t.default=(0,l.default)({displayName:"OverlayWrapper",getInitialState:function(){var e=document.createElement("div");return document.body.appendChild(e),{node:e}},componentDidMount:function(){this.renderOverlay()},componentDidUpdate:function(){this.renderOverlay()},componentWillUnmount:function(){s.default.unmountComponentAtNode(this.state.node)},renderOverlay:function(){var e=a.default.Children.only(this.props.children);s.default.render(e,this.state.node)},render:function(){return null}})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(1),s=r(i),u=n(4),l=r(u),d=n(2),c=r(d),f=n(5),p=r(f),y=(0,c.default)({displayName:"Toolbar",propTypes:{editorState:l.default.object,onChange:l.default.func,buttons:l.default.array,addKeyCommandListener:l.default.func.isRequired,removeKeyCommandListener:l.default.func.isRequired},childContextTypes:{getEditorState:l.default.func,onChange:l.default.func},getChildContext:function(){return{getEditorState:this.getEditorState,onChange:this.props.onChange}},getEditorState:function(){return this.props.editorState},renderButtons:function(){var e=this.props,t=e.editorState,n=e.onChange,r=e.buttons,i=e.addKeyCommandListener,u=e.removeKeyCommandListener,l=o(e,["editorState","onChange","buttons","addKeyCommandListener","removeKeyCommandListener"]);return r.map(function(e,r){return s.default.createElement(e,a({},l,{key:"button-"+r,editorState:t,onChange:n,addKeyCommandListener:i,removeKeyCommandListener:u}))})},render:function(){return s.default.createElement("ul",{className:"draft-extend-controls"},this.renderButtons())}});t.default=(0,p.default)(y)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=n(1),i=r(a),s=n(4),u=r(s),l=n(2),d=r(l),c=n(3),f=n(16),p=r(f),y=n(7),h=r(y),m=n(15),v=r(m),g=n(17),b=r(g),C=function(){},E=[],O={},_=function(e){return function(){return e.apply(void 0,arguments)}};_.__isMiddleware=!0;var M=(0,p.default)(h.default),S=(0,p.default)(v.default),T=(0,p.default)(function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Object.assign.apply(Object,[{}].concat(t))}),k=(0,p.default)(function(e,t){return e.concat(t)}),w=(0,p.default)(function(e){return Array.isArray(e)?e:[e]}),D=(0,p.default)(function(e){return function(t,n){return e(t,n,(0,c.OrderedSet)())}}),R=(0,p.default)(b.default),x=function e(t){var n=t.displayName,r=void 0===n?"Plugin":n,a=t.decorators,s=void 0===a?E:a,l=t.buttons,c=void 0===l?E:l,f=t.overlays,p=void 0===f?E:f,y=t.styleMap,h=void 0===y?O:y,m=t.styleFn,v=void 0===m?C:m,g=t.blockRendererFn,b=void 0===g?C:g,x=t.blockStyleFn,L=void 0===x?C:x,N=t.keyBindingFn,j=void 0===N?C:N,F=t.keyCommandListener,P=void 0===F?C:F,A=t.htmlToStyle,K=void 0===A?_:A,I=t.htmlToBlock,B=void 0===I?_:I,Y=t.htmlToEntity,U=void 0===Y?_:Y,q=t.textToEntity,W=void 0===q?_:q,H=t.styleToHTML,G=void 0===H?_:H,V=t.blockToHTML,z=void 0===V?_:V,Z=t.entityToHTML,J=void 0===Z?_:Z;return function(t){return s=w(s),c=w(c),p=w(p),t.prototype&&t.prototype.isReactComponent?(0,d.default)({displayName:r,propTypes:{styleMap:u.default.object,styleFn:u.default.func,decorators:u.default.array,buttons:u.default.array,overlays:u.default.array,blockRendererFn:u.default.func,blockStyleFn:u.default.func,keyBindingFn:u.default.func,keyCommandListeners:u.default.arrayOf(u.default.func)},getDefaultProps:function(){return{styleMap:O,styleFn:C,decorators:E,buttons:E,overlays:E,blockRendererFn:C,blockStyleFn:C,keyBindingFn:C,keyCommandListeners:E}},focus:function(){this.refs.child.focus&&this.refs.child.focus()},blur:function(){this.refs.child.blur&&this.refs.child.blur()},render:function(){var e=T(this.props.styleMap,h),n=S(this.props.styleFn,v),r=k(this.props.decorators,s),a=k(this.props.buttons,c),u=k(this.props.overlays,p),l=S(b,this.props.blockRendererFn),d=S(L,this.props.blockStyleFn),f=S(j,this.props.keyBindingFn),y=k(this.props.keyCommandListeners,w(P));return i.default.createElement(t,o({},this.props,{ref:"child",styleMap:e,styleFn:n,decorators:r,buttons:a,overlays:u,blockRendererFn:l,blockStyleFn:d,keyBindingFn:f,keyCommandListeners:y}))}}):function(){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];if(1===r.length&&("string"==typeof r[0]||r[0].hasOwnProperty("_map")&&null!=r[0].getBlockMap))return t({htmlToStyle:K,htmlToBlock:B,htmlToEntity:U,textToEntity:W,styleToHTML:G,blockToHTML:z,entityToHTML:J}).apply(void 0,r);var a=r[0],i=M(R(D(K)),R(a.htmlToStyle));i.__isMiddleware=!0;var s=M(R(B),R(a.htmlToBlock));s.__isMiddleware=!0;var u=M(R(U),R(a.htmlToEntity));u.__isMiddleware=!0;var l=M(R(W),R(a.textToEntity));l.__isMiddleware=!0;var d=M(R(G),R(a.styleToHTML));d.__isMiddleware=!0;var c=M(R(z),R(a.blockToHTML));c.__isMiddleware=!0;var f=M(R(J),R(a.entityToHTML));return f.__isMiddleware=!0,e({htmlToStyle:i,htmlToBlock:s,htmlToEntity:u,textToEntity:l,styleToHTML:d,blockToHTML:c,entityToHTML:f})(t)}}};t.default=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(6),a=n(3),i=n(9),s=r(i),u=function(e){return e.replace(/[a-z][A-Z]/g,function(e){return e[0]+"-"+e[1].toLowerCase()})},l=function(e){var t=e.getCurrentContent().getBlockForKey(e.getSelection().getStartKey());if(t)return t.getEntityAt(e.getSelection().getStartOffset())};t.default={camelCaseToHyphen:u,styleObjectToString:function(e){return Object.keys(e).map(function(t){return u(t)+": "+e[t]+";"}).join(" ").replace(/"/g,'\\"')},entityStrategy:function(e){return function(t,n,r){t.findEntityRanges(function(t){var n=t.getEntity();if(null===n)return!1;var a=r&&r.getEntity?r.getEntity(n):o.Entity.get(n);return a&&a.getType()===e},n)}},getEntitySelection:function(e,t){var n=[];return e.getCurrentContent().getBlocksAsArray().forEach(function(e){e.findEntityRanges(function(e){return e.getEntity()===t},function(t,r){n.push(o.SelectionState.createEmpty(e.getKey()).merge({anchorOffset:t,focusOffset:r,isBackward:!1,hasFocus:!0}))})}),(0,s.default)(1===n.length,"getEntitySelection: More than one range with the same entityKey. Please use unique entity instances"),n[0]},insertBlockAtCursor:function(e,t){var n=e.getCurrentContent(),r=e.getSelection(),i=o.Modifier.removeRange(n,r,"backward"),s=i.getSelectionAfter(),u=o.Modifier.splitBlock(i,s),l=u.getSelectionAfter(),d=o.Modifier.setBlockType(u,l,t.getType()),c=[t,new o.ContentBlock({key:(0,o.genKey)(),type:"unstyled",text:"",characterList:(0,a.List)()})],f=o.BlockMapBuilder.createFromArray(c),p=o.Modifier.replaceWithFragment(d,l,f),y=p.merge({selectionBefore:r,selectionAfter:p.getSelectionAfter().set("hasFocus",!0)});return o.EditorState.push(e,y,"insert-fragment")},getSelectedInlineStyles:function(e){var t=e.getSelection(),n=e.getCurrentContent(),r=n.getBlockMap().skipUntil(function(e,n){return n===t.getStartKey()}).takeUntil(function(e,r){return n.getKeyBefore(r)===t.getEndKey()});return r.reduce(function(e,n){var r=n.getKey(),o=0,a=n.getLength()-1;r===t.getStartKey()&&(o=t.getStartOffset()),r===t.getEndKey()&&(a=t.getEndOffset());for(var i=o;i<=a;i++)e=e.union(n.getInlineStyleAt(i));return e},(0,a.Set)())},matchAll:function(e,t){for(var n=[],r=t.exec(e);null!==r;)n.push(r.concat([r.index])),r=t.exec(e);return n},getActiveEntity:l,isEntityActive:function(e,t){var n=l(e),r=e.getCurrentContent();if(n){var a=r.getEntity?r.getEntity(n):o.Entity.get(n);return a&&a.type===t}return!1}}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return function(){var n=e.apply(void 0,arguments);return null===n||void 0===n?t.apply(void 0,arguments):n}}},function(e,t,n){"use strict";function r(e){var t=(0,o.Map)();return function(){var n=o.List.of.apply(o.List,arguments);return t.has(n)||(t=t.set(n,e.apply(void 0,arguments))),t.get(n)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var o=n(3)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=n(3),a=function(e){return e&&e.__isMiddleware?e:function(t){return function(){if("object"===("undefined"==typeof e?"undefined":r(e))){var n=arguments.length<=0?void 0:arguments[0],a=void 0;if("string"==typeof n){var i=n;a=e[i]}else a=e[n.type];return null!==a&&void 0!==a?a:t.apply(void 0,arguments)}var s=void 0;try{var u=e.apply(void 0,arguments);if(null===u||void 0===u)s=t.apply(void 0,arguments);else if(2===arguments.length&&"string"==typeof(arguments.length<=1?void 0:arguments[1])&&(arguments.length<=1?void 0:arguments[1])===u)s=t.apply(void 0,arguments);else if(Array.isArray(u))s=u.concat(t.apply(void 0,arguments));else if(o.OrderedSet.isOrderedSet(u)){var l,d=(l=arguments.length-1,arguments.length<=l?void 0:arguments[l]);s=d.union(u).union(t.apply(void 0,arguments))}else s="function"==typeof u?e(t).apply(void 0,arguments):u}catch(n){s=e(t).apply(void 0,arguments)}finally{return s}}}};t.default=a},function(e,t,n){"use strict";function r(e){return e}function o(e,t,n){function o(e,t){var n=g.hasOwnProperty(t)?g[t]:null;O.hasOwnProperty(t)&&u("OVERRIDE_BASE"===n,"ReactClassInterface: You are attempting to override `%s` from your class specification. Ensure that your method names do not overlap with React methods.",t),e&&u("DEFINE_MANY"===n||"DEFINE_MANY_MERGED"===n,"ReactClassInterface: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",t)}function a(e,n){if(n){u("function"!=typeof n,"ReactClass: You're attempting to use a component class or function as a mixin. Instead, just use a regular object."),u(!t(n),"ReactClass: You're attempting to use a component as a mixin. Instead, just use a regular object.");var r=e.prototype,a=r.__reactAutoBindPairs;n.hasOwnProperty(l)&&b.mixins(e,n.mixins);for(var i in n)if(n.hasOwnProperty(i)&&i!==l){var s=n[i],d=r.hasOwnProperty(i);if(o(d,i),b.hasOwnProperty(i))b[i](e,s);else{var c=g.hasOwnProperty(i),y="function"==typeof s,h=y&&!c&&!d&&n.autobind!==!1;if(h)a.push(i,s),r[i]=s;else if(d){var m=g[i];u(c&&("DEFINE_MANY_MERGED"===m||"DEFINE_MANY"===m),"ReactClass: Unexpected spec policy %s for key %s when mixing in component specs.",m,i),"DEFINE_MANY_MERGED"===m?r[i]=f(r[i],s):"DEFINE_MANY"===m&&(r[i]=p(r[i],s))}else r[i]=s}}}else;}function d(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in b;u(!o,'ReactClass: You are attempting to define a reserved property, `%s`, that shouldn\'t be on the "statics" key. Define it as an instance property instead; it will still be accessible on the constructor.',n);var a=n in e;u(!a,"ReactClass: You are attempting to define `%s` on your component more than once. This conflict may be due to a mixin.",n),e[n]=r}}}function c(e,t){u(e&&t&&"object"==typeof e&&"object"==typeof t,"mergeIntoWithNoDuplicateKeys(): Cannot merge non-objects.");for(var n in t)t.hasOwnProperty(n)&&(u(void 0===e[n],"mergeIntoWithNoDuplicateKeys(): Tried to merge two objects with the same key: `%s`. This conflict may be due to a mixin; in particular, this may be caused by two getInitialState() or getDefaultProps() methods returning objects with clashing keys.",n),e[n]=t[n]);return e}function f(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return c(o,n),c(o,r),o}}function p(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function y(e,t){var n=t.bind(e);return n}function h(e){for(var t=e.__reactAutoBindPairs,n=0;n<t.length;n+=2){var r=t[n],o=t[n+1];e[r]=y(e,o)}}function m(e){var t=r(function(e,r,o){this.__reactAutoBindPairs.length&&h(this),this.props=e,this.context=r,this.refs=s,this.updater=o||n,this.state=null;var a=this.getInitialState?this.getInitialState():null;u("object"==typeof a&&!Array.isArray(a),"%s.getInitialState(): must return an object or null",t.displayName||"ReactCompositeComponent"),this.state=a});t.prototype=new _,t.prototype.constructor=t,t.prototype.__reactAutoBindPairs=[],v.forEach(a.bind(null,t)),a(t,C),a(t,e),a(t,E),t.getDefaultProps&&(t.defaultProps=t.getDefaultProps()),u(t.prototype.render,"createClass(...): Class specification must implement a `render` method.");for(var o in g)t.prototype[o]||(t.prototype[o]=null);return t}var v=[],g={mixins:"DEFINE_MANY",statics:"DEFINE_MANY",propTypes:"DEFINE_MANY",contextTypes:"DEFINE_MANY",childContextTypes:"DEFINE_MANY",getDefaultProps:"DEFINE_MANY_MERGED",getInitialState:"DEFINE_MANY_MERGED",getChildContext:"DEFINE_MANY_MERGED",render:"DEFINE_ONCE",componentWillMount:"DEFINE_MANY",componentDidMount:"DEFINE_MANY",componentWillReceiveProps:"DEFINE_MANY",shouldComponentUpdate:"DEFINE_ONCE",componentWillUpdate:"DEFINE_MANY",componentDidUpdate:"DEFINE_MANY",componentWillUnmount:"DEFINE_MANY",updateComponent:"OVERRIDE_BASE"},b={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n<t.length;n++)a(e,t[n])},childContextTypes:function(e,t){e.childContextTypes=i({},e.childContextTypes,t)},contextTypes:function(e,t){e.contextTypes=i({},e.contextTypes,t)},getDefaultProps:function(e,t){e.getDefaultProps?e.getDefaultProps=f(e.getDefaultProps,t):e.getDefaultProps=t},propTypes:function(e,t){e.propTypes=i({},e.propTypes,t)},statics:function(e,t){d(e,t)},autobind:function(){}},C={componentDidMount:function(){this.__isMounted=!0}},E={componentWillUnmount:function(){this.__isMounted=!1}},O={replaceState:function(e,t){this.updater.enqueueReplaceState(this,e,t)},isMounted:function(){return!!this.__isMounted}},_=function(){};return i(_.prototype,e.prototype,O),m}var a,i=n(21),s=n(20),u=n(8),l="mixins";a={},e.exports=o},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t){/* | ||
object-assign | ||
@@ -3,0 +3,0 @@ (c) Sindre Sorhus |
@@ -71,3 +71,4 @@ 'use strict'; | ||
focus: _propTypes2.default.func, | ||
blur: _propTypes2.default.func | ||
blur: _propTypes2.default.func, | ||
editorRef: _propTypes2.default.node | ||
}, | ||
@@ -110,3 +111,4 @@ | ||
focus: this.focus, | ||
blur: this.blur | ||
blur: this.blur, | ||
editorRef: this.refs.editor | ||
}; | ||
@@ -113,0 +115,0 @@ }, |
{ | ||
"name": "draft-extend", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "Build extensible Draft.js editors with configurable plugins and integrated serialization.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202231
3883
1