diff --git a/demo/App.tsx b/demo/App.tsx index afd17624..05887edd 100644 --- a/demo/App.tsx +++ b/demo/App.tsx @@ -60,9 +60,9 @@ export class App extends React.Component<{}, AppState> { }; render() { - const save: SaveImageHandler = async function*(data: ArrayBuffer) { + const save: SaveImageHandler = async function* (data: ArrayBuffer) { // Promise that waits for "time" milliseconds - const wait = function(time: number) { + const wait = function (time: number) { return new Promise((a, r) => { setTimeout(() => a(), time); }); diff --git a/docs/bundle-prod.js b/docs/bundle-prod.js index 914eabd6..58ea7b01 100644 --- a/docs/bundle-prod.js +++ b/docs/bundle-prod.js @@ -1,41 +1,41 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/react-mde/",n(n.s=13)}([function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";function r(e,t){if(!e)throw Error("Argument 'text' should be truthy");for(var n=function(e){return" "===e||10===e.charCodeAt(0)},r=0,a=e.length,o=t;o-1>-1;o--)if(n(e[o-1])){r=o;break}for(o=t;o=0&&n>=0;a--)switch(e.charCodeAt(a)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n},t.getBreaksNeededForEmptyLineAfter=function(e,t){if(void 0===e&&(e=""),t===e.length-1)return 0;for(var n=2,r=!0,a=t;a=0;a++)switch(e.charCodeAt(a)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}},function(e,t,n){"use strict"; +!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/react-mde/",n(n.s=13)}([function(e,t,n){"use strict";e.exports=n(15)},function(e,t,n){"use strict";function r(e,t){if(!e)throw Error("Argument 'text' should be truthy");for(var n=function(e){return" "===e||10===e.charCodeAt(0)},r=0,a=e.length,o=t;o-1>-1;o--)if(n(e[o-1])){r=o;break}for(o=t;o=0&&n>=0;a--)switch(e.charCodeAt(a)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n},t.getBreaksNeededForEmptyLineAfter=function(e,t){if(void 0===e&&(e=""),t===e.length-1)return 0;for(var n=2,r=!0,a=t;a=0;a++)switch(e.charCodeAt(a)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}},function(e,t,n){"use strict"; /*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/function r(e){return"string"==typeof e}function a(e){return Array.isArray(e)&&e.length>0}function o(e){return"object"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=function e(){for(var t=[],n=0;n0}function o(e){return"object"==typeof e}Object.defineProperty(t,"__esModule",{value:!0}),t.classNames=void 0,t.classNames=function e(){for(var t=[],n=0;n=l&&r<=l+d&&c.setStart(s=i,r-l),a>=l&&a<=l+d&&c.setEnd(u=i,a-l),l+=d,i=i.nextSibling}r!==a&&c.deleteContents(),c.insertNode(o)}else e.appendChild(o)}else{var f=e.value;e.value=f.slice(0,r)+t+f.slice(a)}e.setSelectionRange(r+t.length,r+t.length);var p=document.createEvent("UIEvent");p.initEvent("input",!0,!1),e.dispatchEvent(p)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n(0),o=n(2);t.SuggestionsDropdown=function(e){var t=e.classes,n=e.suggestions,i=e.caret,l=e.onSuggestionSelected,s=e.focusIndex,u=e.textAreaRef,c=a.useCallback((function(e){e.preventDefault();var t=parseInt(e.currentTarget.attributes["data-index"].value);l(t)}),[n]),d=a.useCallback((function(e){return e.preventDefault()}),[]);return r.createElement("ul",{className:o.classNames("mde-suggestions",t),style:{left:i.left-u.current.scrollLeft,top:i.top-u.current.scrollTop}},n.map((function(e,t){return r.createElement("li",{onClick:c,onMouseDown:d,key:t,"aria-selected":s===t?"true":"false","data-index":""+t},e.preview)})))}},function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(9)),r(n(39))},function(e,t,n){e.exports=n(14)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n(16),o=n(20);n(44),n(46),n(47),n(48),a.render(r.createElement(o.App,null),document.getElementById("#app_container"))},function(e,t,n){"use strict"; -/** @license React v16.12.0 + */Object.defineProperty(t,"__esModule",{value:!0}),t.insertText=void 0,t.insertText=function(e,t){if(e.focus(),document.selection){var n=document.selection.createRange();return n.text=t,n.collapse(!1),void n.select()}if(!document.execCommand("insertText",!1,t)){var r=e.selectionStart,a=e.selectionEnd;if("function"==typeof e.setRangeText)e.setRangeText(t);else if(function(e){if("TEXTAREA"!==e.nodeName)return!1;var t;if(void 0===t){var n=document.createElement("textarea");n.value="1",t=!!n.firstChild}return t}(e)){var o=document.createTextNode(t),i=e.firstChild;if(i){for(var l=0,s=null,u=null,c=document.createRange();i&&(null===s||null===u);){var d=i.nodeValue.length;r>=l&&r<=l+d&&c.setStart(s=i,r-l),a>=l&&a<=l+d&&c.setEnd(u=i,a-l),l+=d,i=i.nextSibling}r!==a&&c.deleteContents(),c.insertNode(o)}else e.appendChild(o)}else{var f=e.value;e.value=f.slice(0,r)+t+f.slice(a)}e.setSelectionRange(r+t.length,r+t.length);var p=document.createEvent("UIEvent");p.initEvent("input",!0,!1),e.dispatchEvent(p)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SuggestionsDropdown=void 0;var r=n(0),a=n(0),o=n(2);t.SuggestionsDropdown=function(e){var t=e.classes,n=e.suggestions,i=e.caret,l=e.onSuggestionSelected,s=e.focusIndex,u=e.textAreaRef,c=a.useCallback((function(e){e.preventDefault();var t=parseInt(e.currentTarget.attributes["data-index"].value);l(t)}),[n]),d=a.useCallback((function(e){return e.preventDefault()}),[]);return r.createElement("ul",{className:o.classNames("mde-suggestions",t),style:{left:i.left-u.current.scrollLeft,top:i.top-u.current.scrollTop}},n.map((function(e,t){return r.createElement("li",{onClick:c,onMouseDown:d,key:t,"aria-selected":s===t?"true":"false","data-index":""+t},e.preview)})))}},function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||t.hasOwnProperty(n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),a(n(9),t),a(n(39),t)},function(e,t,n){e.exports=n(14)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=n(16),o=n(20);n(43),n(45),n(46),n(47),a.render(r.createElement(o.App,null),document.getElementById("#app_container"))},function(e,t,n){"use strict"; +/** @license React v16.13.1 * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r=n(4),a="function"==typeof Symbol&&Symbol.for,o=a?Symbol.for("react.element"):60103,i=a?Symbol.for("react.portal"):60106,l=a?Symbol.for("react.fragment"):60107,s=a?Symbol.for("react.strict_mode"):60108,u=a?Symbol.for("react.profiler"):60114,c=a?Symbol.for("react.provider"):60109,d=a?Symbol.for("react.context"):60110,f=a?Symbol.for("react.forward_ref"):60112,p=a?Symbol.for("react.suspense"):60113;a&&Symbol.for("react.suspense_list");var h=a?Symbol.for("react.memo"):60115,m=a?Symbol.for("react.lazy"):60116;a&&Symbol.for("react.fundamental"),a&&Symbol.for("react.responder"),a&&Symbol.for("react.scope");var g="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nj.length&&j.push(e)}function N(e,t,n){return null==e?0:function e(t,n,r,a){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case i:s=!0}}if(s)return r(a,t,""===n?"."+L(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;uM.length&&M.push(e)}function A(e,t,n){return null==e?0:function e(t,n,r,a){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var s=!1;if(null===t)s=!0;else switch(l){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case o:case i:s=!0}}if(s)return r(a,t,""===n?"."+N(t,0):n),1;if(s=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;u