draft-extend
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -1,1 +0,6 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Immutable"),require("React"),require("Draft"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["Immutable","React","Draft","ReactDOM"],t):"object"==typeof exports?exports.DraftExtend=t(require("Immutable"),require("React"),require("Draft"),require("ReactDOM")):e.DraftExtend=t(e.Immutable,e.React,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(7),a=r(o),i=n(9),s=r(i),d=n(3),u=r(d),l=n(10),c=r(l),p=n(11),f=r(p),y=n(5),m=r(y);t.Editor=a.default,t.Toolbar=s.default,t.KeyCommandController=u.default,t.createPlugin=c.default,t.pluginUtils=f.default,t.compose=m.default},function(t,n){t.exports=e},function(e,n){e.exports=t},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(6),s=r(i),d=n(1),u=n(2),l=r(u),c=n(4),p={addKeyCommandListener:u.PropTypes.func,removeKeyCommandListener:u.PropTypes.func,handleKeyCommand:u.PropTypes.func},f=function(e){return l.default.createClass({displayName:"KeyCommandController("+e.displayName+")",propTypes:a({editorState:u.PropTypes.object,onChange:u.PropTypes.func,keyCommandListeners:u.PropTypes.arrayOf(u.PropTypes.func)},p),getDefaultProps:function(){return{keyCommandListeners:[]}},componentWillMount:function(){this.keyCommandOverrides=(0,d.List)(this.props.keyCommandListeners),this.keyCommandListeners=(0,d.List)()},componentDidMount:function(){var e=this,t=Object.keys(p),n=t.filter(function(t){return void 0!==e.props[t]}),r=0===n.length,o=n.length===t.length;(0,s.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),d=s instanceof c.EditorState;return s===!0||d&&s!==o?d?(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 l.default.createElement(e,a({},i,{ref:"editor",editorState:n,onChange:r,addKeyCommandListener:this.addKeyCommandListener,removeKeyCommandListener:this.removeKeyCommandListener,handleKeyCommand:this.handleKeyCommand}))}})};t.default=f},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";var r=function(e,t,n,r,o,a,i,s){if(!e){var d;if(void 0===t)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[n,r,o,a,i,s],l=0;d=new Error(t.replace(/%s/g,function(){return u[l++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}};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(2),s=r(i),d=(n(1),n(4)),u=n(3),l=r(u),c=n(8),p=r(c),f={className:i.PropTypes.string,editorState:i.PropTypes.object,onChange:i.PropTypes.func,decorators:i.PropTypes.array,styleMap:i.PropTypes.object,buttons:i.PropTypes.array,overlays:i.PropTypes.array,blockRendererFn:i.PropTypes.func,blockStyleFn:i.PropTypes.func,keyBindingFn:i.PropTypes.func,addKeyCommandListener:i.PropTypes.func.isRequired,removeKeyCommandListener:i.PropTypes.func.isRequired,handleReturn:i.PropTypes.func,onEscape:i.PropTypes.func,onTab:i.PropTypes.func,onUpArrow:i.PropTypes.func,onDownArrow:i.PropTypes.func,readOnly:i.PropTypes.bool,showButtons:i.PropTypes.bool},y=s.default.createClass({displayName:"EditorWrapper",propTypes:f,childContextTypes:{getEditorState:i.PropTypes.func,getReadOnly:i.PropTypes.func,setReadOnly:i.PropTypes.func,onChange:i.PropTypes.func,focus:i.PropTypes.func,blur:i.PropTypes.func},getDefaultProps:function(){return{className:"",editorState:d.EditorState.createEmpty(),onChange:function(){},decorators:[],styleMap:{},buttons:[],overlays:[],blockRendererFn:function(){},blockStyleFn:function(){},keyBindingFn:function(){},readOnly:!1,showButtons:!0}},getInitialState:function(){var e=new d.CompositeDecorator(this.props.decorators);return{decorator:e,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 d.CompositeDecorator(e.decorators)})},keyBindingFn:function(e){var t=this.props.keyBindingFn(e);return t?t:(0,d.getDefaultKeyBinding)(e)},handleReturn:function(e){return this.props.handleReturn&&this.props.handleReturn(e)||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(f),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:d.EditorState.set(e,{decorator:t})},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 d=this.getDecoratedState();return this.props.buttons.map(function(t,i){return s.default.createElement(t,a({},e.getOtherProps(),{key:"button-"+i,attachedToEditor:!0,editorState:d,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,d){return s.default.createElement(p.default,{key:d},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.blockRendererFn,r=e.blockStyleFn,i=e.onChange,u=e.handleKeyCommand,l=o(e,["styleMap","blockRendererFn","blockStyleFn","onChange","handleKeyCommand"]),c=this.getDecoratedState(),p="draft-extend "+this.props.className,f=this.getReadOnly();return s.default.createElement("div",{className:p},s.default.createElement("div",{className:"draft-extend-editor"},s.default.createElement(d.Editor,a({},l,{ref:"editor",editorState:c,readOnly:f,onChange:i,blockStyleFn:r,blockRendererFn:n,customStyleMap:t,handleKeyCommand:u,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-controls"},this.renderPluginButtons()),s.default.createElement("div",{className:"draft-extend-overlays"},this.renderOverlays())))}});t.default=(0,l.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=n(2),a=r(o),i=n(15),s=r(i);t.default=a.default.createClass({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(2),s=r(i),d=n(3),u=r(d),l=s.default.createClass({displayName:"Toolbar",propTypes:{editorState:i.PropTypes.object,onChange:i.PropTypes.func,buttons:i.PropTypes.array,addKeyCommandListener:i.PropTypes.func.isRequired,removeKeyCommandListener:i.PropTypes.func.isRequired},childContextTypes:{getEditorState:i.PropTypes.func,onChange:i.PropTypes.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,d=e.removeKeyCommandListener,u=o(e,["editorState","onChange","buttons","addKeyCommandListener","removeKeyCommandListener"]);return r.map(function(e,r){return s.default.createElement(e,a({},u,{key:"button-"+r,editorState:t,onChange:n,addKeyCommandListener:i,removeKeyCommandListener:d}))})},render:function(){return s.default.createElement("ul",{className:"draft-extend-controls"},this.renderButtons())}});t.default=(0,u.default)(l)},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(2),i=r(a),s=n(1),d=n(13),u=r(d),l=n(5),c=r(l),p=n(12),f=r(p),y=n(14),m=r(y),h=function(){},v=[],g={},C=function(e){return function(){return e.apply(void 0,arguments)}};C.__isMiddleware=!0;var b=(0,u.default)(c.default),T=(0,u.default)(f.default),O=(0,u.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,u.default)(function(e,t){return e.concat(t)}),P=(0,u.default)(function(e){return Array.isArray(e)?e:[e]}),S=(0,u.default)(function(e){return function(t,n){return e(t,n,(0,s.OrderedSet)())}}),L=(0,u.default)(m.default),M=function e(t){var n=t.displayName,r=void 0===n?"Plugin":n,s=t.decorators,d=void 0===s?v:s,u=t.buttons,l=void 0===u?v:u,c=t.overlays,p=void 0===c?v:c,f=t.styleMap,y=void 0===f?g:f,m=t.blockRendererFn,M=void 0===m?h:m,E=t.blockStyleFn,K=void 0===E?h:E,_=t.keyBindingFn,w=void 0===_?h:_,R=t.keyCommandListener,j=void 0===R?h:R,x=t.htmlToStyle,B=void 0===x?C:x,F=t.htmlToBlock,A=void 0===F?C:F,D=t.htmlToEntity,N=void 0===D?C:D,q=t.textToEntity,H=void 0===q?C:q,U=t.styleToHTML,I=void 0===U?C:U,W=t.blockToHTML,z=void 0===W?C:W,V=t.entityToHTML,Z=void 0===V?C:V;return function(t){return d=P(d),l=P(l),p=P(p),t.prototype&&t.prototype.isReactComponent?i.default.createClass({displayName:r,propTypes:{styleMap:a.PropTypes.object,decorators:a.PropTypes.array,buttons:a.PropTypes.array,overlays:a.PropTypes.array,blockRendererFn:a.PropTypes.func,blockStyleFn:a.PropTypes.func,keyBindingFn:a.PropTypes.func,keyCommandListeners:a.PropTypes.arrayOf(a.PropTypes.func)},getDefaultProps:function(){return{styleMap:g,decorators:v,buttons:v,overlays:v,blockRendererFn:h,blockStyleFn:h,keyBindingFn:h,keyCommandListeners:v}},focus:function(){this.refs.child.focus&&this.refs.child.focus()},blur:function(){this.refs.child.blur&&this.refs.child.blur()},render:function(){var e=O(this.props.styleMap,y),n=k(this.props.decorators,d),r=k(this.props.buttons,l),a=k(this.props.overlays,p),s=T(M,this.props.blockRendererFn),u=T(K,this.props.blockStyleFn),c=T(w,this.props.keyBindingFn),f=k(this.props.keyCommandListeners,P(j));return i.default.createElement(t,o({},this.props,{ref:"child",styleMap:e,decorators:n,buttons:r,overlays:a,blockRendererFn:s,blockStyleFn:u,keyBindingFn:c,keyCommandListeners:f}))}}):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:B,htmlToBlock:A,htmlToEntity:N,textToEntity:H,styleToHTML:I,blockToHTML:z,entityToHTML:Z}).apply(void 0,r);var a=r[0],i=b(L(S(B)),L(a.htmlToStyle));i.__isMiddleware=!0;var s=b(L(A),L(a.htmlToBlock));s.__isMiddleware=!0;var d=b(L(N),L(a.htmlToEntity));d.__isMiddleware=!0;var u=b(L(H),L(a.textToEntity));u.__isMiddleware=!0;var l=b(L(I),L(a.styleToHTML));l.__isMiddleware=!0;var c=b(L(z),L(a.blockToHTML));c.__isMiddleware=!0;var p=b(L(Z),L(a.entityToHTML));return p.__isMiddleware=!0,e({htmlToStyle:i,htmlToBlock:s,htmlToEntity:d,textToEntity:u,styleToHTML:l,blockToHTML:c,entityToHTML:p})(t)}}};t.default=M},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(4),a=n(1),i=n(6),s=r(i),d=function(e){return e.replace(/[a-z][A-Z]/g,function(e){return e[0]+"-"+e[1].toLowerCase()})},u=function(e){var t=e.getCurrentContent().getBlockForKey(e.getSelection().getStartKey());if(t)return t.getEntityAt(e.getSelection().getStartOffset())};t.default={camelCaseToHyphen:d,styleObjectToString:function(e){return Object.keys(e).map(function(t){return d(t)+": "+e[t]+";"}).join(" ").replace(/"/g,'\\"')},entityStrategy:function(e){return function(t,n){t.findEntityRanges(function(t){var n=t.getEntity();return null!==n&&o.Entity.get(n).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(),d=o.Modifier.splitBlock(i,s),u=d.getSelectionAfter(),l=o.Modifier.setBlockType(d,u,t.getType()),c=[t,new o.ContentBlock({key:(0,o.genKey)(),type:"unstyled",text:"",characterList:(0,a.List)()})],p=o.BlockMapBuilder.createFromArray(c),f=o.Modifier.replaceWithFragment(l,u,p),y=f.merge({selectionBefore:r,selectionAfter:f.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:u,isEntityActive:function(e,t){var n=u(e);if(n){var r=o.Entity.get(n);return r&&r.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(1)},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(1),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 d=e.apply(void 0,arguments);if(null===d||void 0===d)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])===d)s=t.apply(void 0,arguments);else if(Array.isArray(d))s=d.concat(t.apply(void 0,arguments));else if(o.OrderedSet.isOrderedSet(d)){var u,l=(u=arguments.length-1,arguments.length<=u?void 0:arguments[u]);s=l.union(d).union(t.apply(void 0,arguments))}else s="function"==typeof d?e(t).apply(void 0,arguments):d}catch(n){s=e(t).apply(void 0,arguments)}finally{return s}}}};t.default=a},function(e,t){e.exports=r}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Immutable"),require("React"),require("Draft"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["Immutable","React","Draft","ReactDOM"],t):"object"==typeof exports?exports.DraftExtend=t(require("Immutable"),require("React"),require("Draft"),require("ReactDOM")):e.DraftExtend=t(e.Immutable,e.React,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,n){e.exports=t},function(e,t,n){"use strict";var r=n(2),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,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(2),s=r(i),u=n(4),l=r(u),d=n(3),c=r(d),f=n(9),p=r(f),y=n(1),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(2),s=r(i),u=n(4),l=r(u),d=n(3),c=r(d),f=(n(1),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,styleMap:l.default.object,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},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:[],styleMap:{},buttons:[],overlays:[],blockRendererFn:function(){},blockStyleFn:function(){},keyBindingFn:function(){},readOnly:!1,showButtons:!0}},getInitialState:function(){var e=new f.CompositeDecorator(this.props.decorators);return{decorator:e,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 f.CompositeDecorator(e.decorators)})},keyBindingFn:function(e){var t=this.props.keyBindingFn(e);return t?t:(0,f.getDefaultKeyBinding)(e)},handleReturn:function(e){return this.props.handleReturn&&this.props.handleReturn(e)||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})},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.blockRendererFn,r=e.blockStyleFn,i=e.onChange,u=e.handleKeyCommand,l=o(e,["styleMap","blockRendererFn","blockStyleFn","onChange","handleKeyCommand"]),d=this.getDecoratedState(),c="draft-extend "+this.props.className,p=this.getReadOnly();return s.default.createElement("div",{className:c},s.default.createElement("div",{className:"draft-extend-editor"},s.default.createElement(f.Editor,a({},l,{ref:"editor",editorState:d,readOnly:p,onChange:i,blockStyleFn:r,blockRendererFn:n,customStyleMap:t,handleKeyCommand:u,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-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(2),a=r(o),i=n(24),s=r(i),u=n(3),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(2),s=r(i),u=n(4),l=r(u),d=n(3),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(2),i=r(a),s=n(4),u=r(s),l=n(3),d=r(l),c=n(1),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),k=(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))}),T=(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.blockRendererFn,v=void 0===m?C:m,g=t.blockStyleFn,b=void 0===g?C:g,x=t.keyBindingFn,L=void 0===x?C:x,j=t.keyCommandListener,N=void 0===j?C:j,P=t.htmlToStyle,A=void 0===P?_:P,K=t.htmlToBlock,F=void 0===K?_:K,I=t.htmlToEntity,B=void 0===I?_:I,Y=t.textToEntity,U=void 0===Y?_:Y,q=t.styleToHTML,W=void 0===q?_:q,H=t.blockToHTML,G=void 0===H?_:H,V=t.entityToHTML,z=void 0===V?_:V;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,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,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=k(this.props.styleMap,h),n=T(this.props.decorators,s),r=T(this.props.buttons,c),a=T(this.props.overlays,p),u=S(v,this.props.blockRendererFn),l=S(b,this.props.blockStyleFn),d=S(L,this.props.keyBindingFn),f=T(this.props.keyCommandListeners,w(N));return i.default.createElement(t,o({},this.props,{ref:"child",styleMap:e,decorators:n,buttons:r,overlays:a,blockRendererFn:u,blockStyleFn:l,keyBindingFn:d,keyCommandListeners:f}))}}):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:A,htmlToBlock:F,htmlToEntity:B,textToEntity:U,styleToHTML:W,blockToHTML:G,entityToHTML:z}).apply(void 0,r);var a=r[0],i=M(R(D(A)),R(a.htmlToStyle));i.__isMiddleware=!0;var s=M(R(F),R(a.htmlToBlock));s.__isMiddleware=!0;var u=M(R(B),R(a.htmlToEntity));u.__isMiddleware=!0;var l=M(R(U),R(a.textToEntity));l.__isMiddleware=!0;var d=M(R(W),R(a.styleToHTML));d.__isMiddleware=!0;var c=M(R(G),R(a.blockToHTML));c.__isMiddleware=!0;var f=M(R(z),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(1),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){t.findEntityRanges(function(t){var n=t.getEntity();return null!==n&&o.Entity.get(n).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);if(n){var r=o.Entity.get(n);return r&&r.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(1)},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(1),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 | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function r(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}var o=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=r()?Object.assign:function(e,t){for(var r,s,u=n(e),l=1;l<arguments.length;l++){r=Object(arguments[l]);for(var d in r)a.call(r,d)&&(u[d]=r[d]);if(o){s=o(r);for(var c=0;c<s.length;c++)i.call(r,s[c])&&(u[s[c]]=r[s[c]])}}return u}},function(e,t,n){"use strict";var r=n(19),o=n(8),a=n(23);e.exports=function(){function e(e,t,n,r,i,s){s!==a&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t){e.exports=r}])}); |
@@ -13,2 +13,10 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var _immutable = require('immutable'); | ||
@@ -31,24 +39,24 @@ | ||
var propTypes = { | ||
className: _react.PropTypes.string, | ||
editorState: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func, | ||
decorators: _react.PropTypes.array, | ||
styleMap: _react.PropTypes.object, | ||
buttons: _react.PropTypes.array, | ||
overlays: _react.PropTypes.array, | ||
blockRendererFn: _react.PropTypes.func, | ||
blockStyleFn: _react.PropTypes.func, | ||
keyBindingFn: _react.PropTypes.func, | ||
addKeyCommandListener: _react.PropTypes.func.isRequired, | ||
removeKeyCommandListener: _react.PropTypes.func.isRequired, | ||
handleReturn: _react.PropTypes.func, | ||
onEscape: _react.PropTypes.func, | ||
onTab: _react.PropTypes.func, | ||
onUpArrow: _react.PropTypes.func, | ||
onDownArrow: _react.PropTypes.func, | ||
readOnly: _react.PropTypes.bool, | ||
showButtons: _react.PropTypes.bool | ||
className: _propTypes2.default.string, | ||
editorState: _propTypes2.default.object, | ||
onChange: _propTypes2.default.func, | ||
decorators: _propTypes2.default.array, | ||
styleMap: _propTypes2.default.object, | ||
buttons: _propTypes2.default.array, | ||
overlays: _propTypes2.default.array, | ||
blockRendererFn: _propTypes2.default.func, | ||
blockStyleFn: _propTypes2.default.func, | ||
keyBindingFn: _propTypes2.default.func, | ||
addKeyCommandListener: _propTypes2.default.func.isRequired, | ||
removeKeyCommandListener: _propTypes2.default.func.isRequired, | ||
handleReturn: _propTypes2.default.func, | ||
onEscape: _propTypes2.default.func, | ||
onTab: _propTypes2.default.func, | ||
onUpArrow: _propTypes2.default.func, | ||
onDownArrow: _propTypes2.default.func, | ||
readOnly: _propTypes2.default.bool, | ||
showButtons: _propTypes2.default.bool | ||
}; | ||
var EditorWrapper = _react2.default.createClass({ | ||
var EditorWrapper = (0, _createReactClass2.default)({ | ||
displayName: 'EditorWrapper', | ||
@@ -59,8 +67,8 @@ | ||
childContextTypes: { | ||
getEditorState: _react.PropTypes.func, | ||
getReadOnly: _react.PropTypes.func, | ||
setReadOnly: _react.PropTypes.func, | ||
onChange: _react.PropTypes.func, | ||
focus: _react.PropTypes.func, | ||
blur: _react.PropTypes.func | ||
getEditorState: _propTypes2.default.func, | ||
getReadOnly: _propTypes2.default.func, | ||
setReadOnly: _propTypes2.default.func, | ||
onChange: _propTypes2.default.func, | ||
focus: _propTypes2.default.func, | ||
blur: _propTypes2.default.func | ||
}, | ||
@@ -67,0 +75,0 @@ |
@@ -9,2 +9,14 @@ 'use strict'; | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var _invariant = require('invariant'); | ||
@@ -16,6 +28,2 @@ | ||
var _react = require('react'); | ||
var _react2 = _interopRequireDefault(_react); | ||
var _draftJs = require('draft-js'); | ||
@@ -28,15 +36,15 @@ | ||
var providedProps = { | ||
addKeyCommandListener: _react.PropTypes.func, | ||
removeKeyCommandListener: _react.PropTypes.func, | ||
handleKeyCommand: _react.PropTypes.func | ||
addKeyCommandListener: _propTypes2.default.func, | ||
removeKeyCommandListener: _propTypes2.default.func, | ||
handleKeyCommand: _propTypes2.default.func | ||
}; | ||
var KeyCommandController = function KeyCommandController(Component) { | ||
return _react2.default.createClass({ | ||
return (0, _createReactClass2.default)({ | ||
displayName: 'KeyCommandController(' + Component.displayName + ')', | ||
propTypes: _extends({ | ||
editorState: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func, | ||
keyCommandListeners: _react.PropTypes.arrayOf(_react.PropTypes.func) | ||
editorState: _propTypes2.default.object, | ||
onChange: _propTypes2.default.func, | ||
keyCommandListeners: _propTypes2.default.arrayOf(_propTypes2.default.func) | ||
}, providedProps), | ||
@@ -43,0 +51,0 @@ |
@@ -15,5 +15,9 @@ 'use strict'; | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = _react2.default.createClass({ | ||
exports.default = (0, _createReactClass2.default)({ | ||
displayName: 'OverlayWrapper', | ||
@@ -20,0 +24,0 @@ getInitialState: function getInitialState() { |
@@ -13,2 +13,10 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var _KeyCommandController = require('./KeyCommandController'); | ||
@@ -22,16 +30,16 @@ | ||
var Toolbar = _react2.default.createClass({ | ||
var Toolbar = (0, _createReactClass2.default)({ | ||
displayName: 'Toolbar', | ||
propTypes: { | ||
editorState: _react.PropTypes.object, | ||
onChange: _react.PropTypes.func, | ||
buttons: _react.PropTypes.array, | ||
addKeyCommandListener: _react.PropTypes.func.isRequired, | ||
removeKeyCommandListener: _react.PropTypes.func.isRequired | ||
editorState: _propTypes2.default.object, | ||
onChange: _propTypes2.default.func, | ||
buttons: _propTypes2.default.array, | ||
addKeyCommandListener: _propTypes2.default.func.isRequired, | ||
removeKeyCommandListener: _propTypes2.default.func.isRequired | ||
}, | ||
childContextTypes: { | ||
getEditorState: _react.PropTypes.func, | ||
onChange: _react.PropTypes.func | ||
getEditorState: _propTypes2.default.func, | ||
onChange: _propTypes2.default.func | ||
}, | ||
@@ -38,0 +46,0 @@ |
@@ -13,2 +13,10 @@ 'use strict'; | ||
var _propTypes = require('prop-types'); | ||
var _propTypes2 = _interopRequireDefault(_propTypes); | ||
var _createReactClass = require('create-react-class'); | ||
var _createReactClass2 = _interopRequireDefault(_createReactClass); | ||
var _immutable = require('immutable'); | ||
@@ -107,14 +115,14 @@ | ||
// wrapping an Editor component | ||
return _react2.default.createClass({ | ||
return (0, _createReactClass2.default)({ | ||
displayName: displayName, | ||
propTypes: { | ||
styleMap: _react.PropTypes.object, | ||
decorators: _react.PropTypes.array, | ||
buttons: _react.PropTypes.array, | ||
overlays: _react.PropTypes.array, | ||
blockRendererFn: _react.PropTypes.func, | ||
blockStyleFn: _react.PropTypes.func, | ||
keyBindingFn: _react.PropTypes.func, | ||
keyCommandListeners: _react.PropTypes.arrayOf(_react.PropTypes.func) | ||
styleMap: _propTypes2.default.object, | ||
decorators: _propTypes2.default.array, | ||
buttons: _propTypes2.default.array, | ||
overlays: _propTypes2.default.array, | ||
blockRendererFn: _propTypes2.default.func, | ||
blockStyleFn: _propTypes2.default.func, | ||
keyBindingFn: _propTypes2.default.func, | ||
keyCommandListeners: _propTypes2.default.arrayOf(_propTypes2.default.func) | ||
}, | ||
@@ -121,0 +129,0 @@ |
{ | ||
"name": "draft-extend", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "Build extensible Draft.js editors with configurable plugins and integrated serialization.", | ||
@@ -27,10 +27,13 @@ "main": "lib/index.js", | ||
"author": "Ben Briggs", | ||
"license": "Apache License 2.0", | ||
"peerDependencies": { | ||
"draft-js": ">=0.7.0", | ||
"react": ">=15.0.2", | ||
"react-dom": ">=15.0.2" | ||
"react": "^15.0.0 || ^16.0.0", | ||
"react-dom": "^15.0.0 || ^16.0.0" | ||
}, | ||
"dependencies": { | ||
"create-react-class": "^15.6.2", | ||
"immutable": "^3.8.1", | ||
"invariant": "^2.2.1" | ||
"invariant": "^2.2.1", | ||
"prop-types": "^15.6.0" | ||
}, | ||
@@ -42,3 +45,3 @@ "devDependencies": { | ||
"babel-plugin-transform-object-rest-spread": "^6.6.5", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.5.0", | ||
@@ -49,6 +52,6 @@ "babel-standalone": "^6.7.7", | ||
"es6-shim": "^0.35.0", | ||
"react": "^15.0.2", | ||
"react-dom": "^15.0.2", | ||
"react": "^16.2.0", | ||
"react-dom": "^16.2.0", | ||
"webpack": "^1.13.0" | ||
} | ||
} |
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
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
198671
3817
7
+ Addedcreate-react-class@^15.6.2
+ Addedprop-types@^15.6.0
+ Addedcreate-react-class@15.7.0(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact@16.14.0(transitive)
+ Addedreact-dom@16.14.0(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedscheduler@0.19.1(transitive)
- Removedreact@18.3.1(transitive)
- Removedreact-dom@18.3.1(transitive)
- Removedscheduler@0.23.2(transitive)