framework/extensions/markdown/js/dist/forum.js.map
2019-09-10 00:07:51 +00:00

1 line
44 KiB
Plaintext

{"version":3,"sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/external \"flarum.core.compat['extend']\"","webpack://@flarum/markdown/external \"flarum.core.compat['components/TextEditor']\"","webpack://@flarum/markdown/external \"flarum.core.compat['Component']\"","webpack://@flarum/markdown/./node_modules/mdarea/mdarea.min.js","webpack://@flarum/markdown/external \"flarum.core.compat['helpers/icon']\"","webpack://@flarum/markdown/./src/forum/polyfills.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/./src/forum/components/MarkdownToolbar.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/markdown/./src/forum/util/insertText.js","webpack://@flarum/markdown/./src/forum/util/styles.js","webpack://@flarum/markdown/./src/forum/util/apply.js","webpack://@flarum/markdown/./src/forum/components/MarkdownButton.js","webpack://@flarum/markdown/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","self","undefined","a","test","navigator","platform","f","_","g","y","b","`","~","v","[","(","{","<","K","]",")","}",">","e","this","_useTab","_useInline","_indent","_reOutdent","_reKey","_handleKey","setElement","RegExp","x","selectionStart","selectionEnd","arguments","length","window","InputEvent","dispatchEvent","constructor","getElement","_elem","removeEventListener","addEventListener","getValue","setValue","getIndent","setIndent","Array","join","replace","isTabUsed","useTab","ignoreTab","isInlineEnabled","enableInline","disableInline","destroy","defaultPrevented","target","substring","ctrlKey","altKey","metaKey","shiftKey","lastIndexOf","h","u","charAt","exec","line","offset","prefix","parseInt","preventDefault","apply","String","startsWith","search","pos","endsWith","this_len","_inheritsLoose","subClass","superClass","__proto__","modifierKey","userAgent","match","MarkdownToolbar","config","isInitialized","document","getElementById","props","for","shortcut","view","id","data-for","style","display","children","event","button","element","querySelector","click","Component","_extends","assign","source","canInsertText","isMultipleLines","string","trim","split","repeat","wordSelectionEnd","text","multiline","index","breakpoint","newlinesToSurroundSelectedText","textarea","newlinesToAppend","newlinesToPrepend","beforeSelection","slice","afterSelection","breaksBefore","breaksAfter","newlinesBeforeSelection","newlinesAfterSelection","blockStyle","arg","suffix","blockPrefix","blockSuffix","replaceNext","prefixSpace","scanFor","surroundWithNewlines","originalSelectionStart","originalSelectionEnd","selectedText","prefixToUse","suffixToUse","wordSelectionStart","expandedSelectionStart","expandedSelectionEnd","beginsWithPrefix","endsWithSuffix","expandSelectedText","hasReplaceNext","indexOf","ref","replacementText","position","Math","max","min","whitespaceEdges","trimFirst","leadingWhitespace","trailingWhitespace","styleSelectedText","styleArgs","result","orderedList","startOfLine","endOfLine","orderedListRegex","noInitialSelection","textToUnstyle","lines","linesBefore","linesToUnstyle","every","map","lengthDiff","len","results","push","_newlinesToSurroundSe2","_newlinesToSurroundSe","multilineStyle","_ref","before","after","contentEditable","execCommand","error","createEvent","initEvent","setSelectionRange","insertText","MarkdownButton","$","tooltip","className","title","data-hotkey","hotkey","onclick","onkeydown","keydown","icon","stylesToApply","toolbar","parentElement","field","dataset","focus","app","initializers","add","extend","TextEditor","textareaId","vdom","attrs","context","editor","MarkdownArea","onunload","items","translator","trans","MarkdownToolbar_MarkdownToolbar","MarkdownButton_MarkdownButton"],"mappings":"2BACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAA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EAAQ,QAASQ,KAAK,cAAc3G,MAAO,CAAE5B,OAAQ,IAAKgE,OAAQ,IAAKC,YAAa,MAAOC,YAAa,SAC/H9K,EAAC0Q,EAAD,CAAgB7B,MAAOF,EAAQ,QAASQ,KAAK,cAAc3G,MAAO,CAAE5B,OAAQ,IAAKgE,OAAQ,SAAUG,YAAa,MAAOE,QAAS,eAChIjL,EAAC0Q,EAAD,CAAgB7B,MAAOF,EAAQ,SAAUQ,KAAK,eAAe3G,MAAO,CAAE5B,OAAQ,KAAMgE,OAAQ,SAAUG,YAAa,MAAOE,QAAS,eACnIjL,EAAC0Q,EAAD,CAAgB7B,MAAOF,EAAQ,kBAAmBQ,KAAK,iBAAiB3G,MAAO,CAAE5B,OAAQ,KAAMgD,WAAW,EAAMsB,sBAAsB,KACtIlL,EAAC0Q,EAAD,CAAgB7B,MAAOF,EAAQ,gBAAiBQ,KAAK,iBAAiB3G,MAAO,CAAE5B,OAAQ,MAAOgD,WAAW,EAAMiD,aAAa,MAE7H","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 6);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['Component'];","!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&module.exports?module.exports=t():e.MarkdownArea=t()}(\"undefined\"!=typeof self?self:this,function(){var a=/mac|iphone|ipad|ipod/i.test(navigator.platform)?\"metaKey\":\"ctrlKey\",o=/^[\"'`*_[({<>})\\]]$/,f=/[*_]/,_=/^[ \\t]*(?:(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?|>[ \\t]*)*(?::[ \\t]*)?/,c=/(?:[-+*]|\\d+\\.)[ \\t]+(?:\\[[ x]][ \\t]+)?$/,g=/[-+*\\[\\]x\\d.]/g,y=/[^ \\t]/g,p=/(\\d+)\\.(?=[ \\t]+$)/,m=/(?:(?:^[ \\t]+)?(?:[-+*]|\\d+\\.|[>:])(?:[ \\t]+\\[[ x]])?[ \\t]*|^[ \\t]+)$/,d=/^(?!$)/gm,b={\"`\":/^``$/m,\"~\":/^~~$/m},v={\"[\":\"]\",\"(\":\")\",\"{\":\"}\",\"<\":\">\"},K={\"]\":\"[\",\")\":\"(\",\"}\":\"{\",\">\":\"<\"};function e(e){this._useTab=!0,this._useInline=!0,this._indent=\" \",this._reOutdent=/^[ ]{4}/gm,this._reKey=t(!0,!0),this._handleKey=this._handleKey.bind(this),this.setElement(e)}function t(e,t){return new RegExp(\"^(?:Enter\"+(e?\"|Tab\":\"\")+\"|[io\"+(t?\"\\\"'`*_([{<>}\\\\])\":\"\")+\"])$\")}function x(e,t,n,i){if(e.value=t,e.selectionStart=n,e.selectionEnd=3<arguments.length?i:n,\"InputEvent\"in window)try{var s=new InputEvent(\"input\");e.dispatchEvent(s)}catch(i){}}return e.prototype={constructor:e,getElement:function(){return this._elem},setElement:function(e){this._elem&&this._elem.removeEventListener(\"keydown\",this._handleKey),(this._elem=e).addEventListener(\"keydown\",this._handleKey)},getValue:function(){return this._elem.value},setValue:function(e){this._elem.value=e},getIndent:function(){return this._indent},setIndent:function(e){this._indent=\"number\"==typeof e?new Array(e+1).join(\" \"):(e+\"\").replace(/[^ \\t]/g,\" \"),this._reOutdent=new RegExp(\"^\"+this._indent,\"mg\")},isTabUsed:function(){return this._useTab},useTab:function(){this._useTab=!0,this._reKey=t(!0,this._useInline)},ignoreTab:function(){this._useTab=!1,this._reKey=t(!1,this._useInline)},isInlineEnabled:function(){return this._useInline},enableInline:function(){this._useInline=!0,this._reKey=t(this._useTab,!0)},disableInline:function(){this._useInline=!1,this._reKey=t(this._useTab,!1)},destroy:function(){this._elem.removeEventListener(\"keydown\",this._handleKey),this._elem=this._reKey=this._handleKey=this._indent=this._reOutdent=null},_handleKey:function(e){if(!e.defaultPrevented&&this._reKey.test(e.key)){var t=e.target.value.substring(0,e.target.selectionStart),n=e.target.value.substring(e.target.selectionStart,e.target.selectionEnd),i=e.target.value.substring(e.target.selectionEnd);if(\"Enter\"!==e.key||e.ctrlKey||e.altKey||e.metaKey)if(\"Tab\"===e.key&&!e.shiftKey||\"i\"===e.key&&e[a])!function(e,t,n,i,s){var r=t.length,l=t.lastIndexOf(\"\\n\")+1;l<r&&(n=t.substring(l)+n,t=t.substring(0,l));(l<r||!n)&&(r+=s.length);n?n=n.replace(d,s):t+=s;x(e,t+n+i,r,n?l+n.length:r)}(this._elem,t,n,i,this._indent);else if(\"Tab\"===e.key&&e.shiftKey||\"o\"===e.key&&e[a])!function(e,t,n,i,s,r){var l=t.length,h=t.lastIndexOf(\"\\n\")+1;h<l&&(n=t.substring(h)+n,t=t.substring(0,h),n.substring(0,s.length)===s&&(l-=s.length));n=n.replace(r,\"\"),x(e,t+n+i,l,h+n.length)}(this._elem,t,n,i,this._indent,this._reOutdent);else{if(!o.test(e.key))return;s=this._elem,r=t,l=n,h=i,u=e.key,l||u in v||h.charAt(0)!==u?!l&&(\"'\"===u||u in K)?x(s,r+u+h,r.length+1):!l&&u in b&&b[u].test(r)?x(s,r+u+\"language\\n\"+u+u+u+(\"\\n\"!==h.charAt(0)?\"\\n\":\"\")+h,r.length+1,r.length+9):x(s,r+(K[u]||u)+l+(v[u]||u)+h,r.length+1,r.length+1+l.length):x(s,r+(f.test(u)?u+u:\"\")+h,r.length+1)}else!function(e,t,n,i,s){var r=n?null:(l=t,h=l.lastIndexOf(\"\\n\")+1,u=l.substring(h),a=_.exec(u),{line:u,offset:h,prefix:a&&a[0]});var l,h,u,a;!n&&r.prefix?s||r.prefix!==r.line?!s&&(d=r.prefix,c.test(d))?t+=\"\\n\"+r.prefix.replace(p,function(e,t){return parseInt(t)+1+\".\"}):t+=\"\\n\"+(o=r.prefix,f=s,o.replace(f?y:g,\" \")):t=t.substring(0,r.offset)+r.prefix.replace(m,\"\"):t+=\"\\n\";var o,f;var d;x(e,t+i,t.length)}(this._elem,t,n,i,e.shiftKey);e.preventDefault()}var s,r,l,h,u}},e});\n//# sourceMappingURL=mdarea.min.map\n","module.exports = flarum.core.compat['helpers/icon'];","/*! https://mths.be/startswith v0.2.0 by @mathias */\nif (!String.prototype.startsWith) {\n Object.defineProperty(String.prototype, 'startsWith', {\n value: function(search, pos) {\n pos = !pos || pos < 0 ? 0 : +pos;\n return this.substring(pos, pos + search.length) === search;\n }\n });\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(search, this_len) {\n if (this_len === undefined || this_len > this.length) {\n this_len = this.length;\n }\n return this.substring(this_len - search.length, this_len) === search;\n };\n}\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import Component from 'flarum/Component';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? 'Meta' : 'Control';\n\nexport default class MarkdownToolbar extends Component {\n config(isInitialized) {\n if (isInitialized) return;\n\n const field = document.getElementById(this.props.for);\n\n field.addEventListener('keydown', this.shortcut.bind(this));\n }\n\n view() {\n return <div id=\"MarkdownToolbar\" data-for={this.props.for} style={{ display: 'inline-block' }}>\n {this.props.children}\n </div>;\n }\n\n shortcut(event) {\n if ((event.metaKey && modifierKey === 'Meta') || (event.ctrlKey && modifierKey === 'Control')) {\n const button = this.element.querySelector(`[data-hotkey=\"${event.key}\"]`);\n\n if (button) {\n button.click();\n event.preventDefault()\n }\n }\n }\n}\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport let canInsertText = null;\n\nexport default (textarea, { text, selectionStart, selectionEnd }) => {\n const originalSelectionStart = textarea.selectionStart;\n const before = textarea.value.slice(0, originalSelectionStart);\n const after = textarea.value.slice(textarea.selectionEnd);\n\n if (canInsertText === null || canInsertText === true) {\n textarea.contentEditable = 'true';\n try {\n canInsertText = document.execCommand('insertText', false, text);\n }\n catch (error) {\n canInsertText = false;\n }\n textarea.contentEditable = 'false';\n }\n if (canInsertText && !textarea.value.slice(0, textarea.selectionStart).endsWith(text)) {\n canInsertText = false;\n }\n if (!canInsertText) {\n try {\n document.execCommand('ms-beginUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n textarea.value = before + text + after;\n try {\n document.execCommand('ms-endUndoUnit');\n }\n catch (e) {\n // Do nothing.\n }\n\n // fire custom event, works on IE\n const event = document.createEvent('Event');\n\n event.initEvent('input', true, true);\n\n textarea.dispatchEvent(event);\n }\n if (selectionStart != null && selectionEnd != null) {\n textarea.setSelectionRange(selectionStart, selectionEnd);\n }\n else {\n textarea.setSelectionRange(originalSelectionStart, textarea.selectionEnd);\n }\n};\n","/*\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nexport function isMultipleLines(string) {\n return string.trim().split('\\n').length > 1;\n}\n\nexport function repeat(string, n) {\n return Array(n + 1).join(string);\n}\n\nexport function wordSelectionStart(text, i) {\n let index = i;\n\n while (text[index] && text[index - 1] != null && !text[index - 1].match(/\\s/)) {\n index--;\n }\n\n return index;\n}\n\nexport function wordSelectionEnd(text, i, multiline) {\n let index = i;\n const breakpoint = multiline ? /\\n/ : /\\s/;\n\n while (text[index] && !text[index].match(breakpoint)) {\n index++;\n }\n\n return index;\n}\n\nexport function expandSelectedText(textarea, prefixToUse, suffixToUse) {\n let multiline = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n\n if (textarea.selectionStart === textarea.selectionEnd) {\n textarea.selectionStart = wordSelectionStart(textarea.value, textarea.selectionStart);\n textarea.selectionEnd = wordSelectionEnd(textarea.value, textarea.selectionEnd, multiline);\n } else {\n const expandedSelectionStart = textarea.selectionStart - prefixToUse.length;\n const expandedSelectionEnd = textarea.selectionEnd + suffixToUse.length;\n const beginsWithPrefix = textarea.value.slice(expandedSelectionStart, textarea.selectionStart) === prefixToUse;\n const endsWithSuffix = textarea.value.slice(textarea.selectionEnd, expandedSelectionEnd) === suffixToUse;\n\n if (beginsWithPrefix && endsWithSuffix) {\n textarea.selectionStart = expandedSelectionStart;\n textarea.selectionEnd = expandedSelectionEnd;\n }\n }\n\n return textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n}\n\nexport function newlinesToSurroundSelectedText(textarea) {\n const beforeSelection = textarea.value.slice(0, textarea.selectionStart);\n const afterSelection = textarea.value.slice(textarea.selectionEnd);\n const breaksBefore = beforeSelection.match(/\\n*$/);\n const breaksAfter = afterSelection.match(/^\\n*/);\n const newlinesBeforeSelection = breaksBefore ? breaksBefore[0].length : 0;\n const newlinesAfterSelection = breaksAfter ? breaksAfter[0].length : 0;\n let newlinesToAppend;\n let newlinesToPrepend;\n\n if (beforeSelection.match(/\\S/) && newlinesBeforeSelection < 2) {\n newlinesToAppend = repeat('\\n', 2 - newlinesBeforeSelection);\n }\n\n if (afterSelection.match(/\\S/) && newlinesAfterSelection < 2) {\n newlinesToPrepend = repeat('\\n', 2 - newlinesAfterSelection);\n }\n\n if (newlinesToAppend == null) {\n newlinesToAppend = '';\n }\n\n if (newlinesToPrepend == null) {\n newlinesToPrepend = '';\n }\n\n return {\n newlinesToAppend,\n newlinesToPrepend\n };\n}\n\nexport const blockStyle = (textarea, arg) => {\n let newlinesToAppend;\n let newlinesToPrepend;\n const { prefix, suffix, blockPrefix, blockSuffix, replaceNext, prefixSpace, scanFor, surroundWithNewlines } = arg;\n const originalSelectionStart = textarea.selectionStart;\n const originalSelectionEnd = textarea.selectionEnd;\n let selectedText = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let prefixToUse = isMultipleLines(selectedText) && blockPrefix.length > 0 ? `${blockPrefix}\\n` : prefix;\n let suffixToUse = isMultipleLines(selectedText) && blockSuffix.length > 0 ? `\\n${blockSuffix}` : suffix;\n\n if (prefixSpace) {\n const beforeSelection = textarea.value[textarea.selectionStart - 1];\n if (textarea.selectionStart !== 0 && beforeSelection != null && !beforeSelection.match(/\\s/)) {\n prefixToUse = ` ${prefixToUse}`;\n }\n }\n\n selectedText = expandSelectedText(textarea, prefixToUse, suffixToUse, arg.multiline);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const hasReplaceNext = replaceNext.length > 0 && suffixToUse.indexOf(replaceNext) > -1 && selectedText.length > 0;\n\n if (surroundWithNewlines) {\n const ref = newlinesToSurroundSelectedText(textarea);\n newlinesToAppend = ref.newlinesToAppend;\n newlinesToPrepend = ref.newlinesToPrepend;\n prefixToUse = newlinesToAppend + prefix;\n suffixToUse += newlinesToPrepend;\n }\n\n if (selectedText.startsWith(prefixToUse) && selectedText.endsWith(suffixToUse)) {\n const replacementText = selectedText.slice(prefixToUse.length, selectedText.length - suffixToUse.length);\n if (originalSelectionStart === originalSelectionEnd) {\n let position = originalSelectionStart - prefixToUse.length;\n position = Math.max(position, selectionStart);\n position = Math.min(position, selectionStart + replacementText.length);\n selectionStart = selectionEnd = position;\n }\n else {\n selectionEnd = selectionStart + replacementText.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (!hasReplaceNext) {\n let replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = originalSelectionStart + prefixToUse.length;\n selectionEnd = originalSelectionEnd + prefixToUse.length;\n const whitespaceEdges = selectedText.match(/^\\s*|\\s*$/g);\n if (arg.trimFirst && whitespaceEdges) {\n const leadingWhitespace = whitespaceEdges[0] || '';\n const trailingWhitespace = whitespaceEdges[1] || '';\n replacementText = leadingWhitespace + prefixToUse + selectedText.trim() + suffixToUse + trailingWhitespace;\n selectionStart += leadingWhitespace.length;\n selectionEnd -= trailingWhitespace.length;\n }\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else if (scanFor.length > 0 && selectedText.match(scanFor)) {\n suffixToUse = suffixToUse.replace(replaceNext, selectedText);\n const replacementText = prefixToUse + suffixToUse;\n selectionStart = selectionEnd = selectionStart + prefixToUse.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n else {\n const replacementText = prefixToUse + selectedText + suffixToUse;\n selectionStart = selectionStart + prefixToUse.length + selectedText.length + suffixToUse.indexOf(replaceNext);\n selectionEnd = selectionStart + replaceNext.length;\n return { text: replacementText, selectionStart, selectionEnd };\n }\n}\n\nexport const multilineStyle = (textarea, arg) => {\n const { prefix, suffix, surroundWithNewlines } = arg;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let selectionStart = textarea.selectionStart;\n let selectionEnd = textarea.selectionEnd;\n const lines = text.split('\\n');\n const undoStyle = lines.every(line => line.startsWith(prefix) && line.endsWith(suffix));\n if (undoStyle) {\n text = lines.map(line => line.slice(prefix.length, line.length - suffix.length)).join('\\n');\n selectionEnd = selectionStart + text.length;\n }\n else {\n text = lines.map(line => prefix + line + suffix).join('\\n');\n if (surroundWithNewlines) {\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart += newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n }\n return { text, selectionStart, selectionEnd };\n}\n\nexport const orderedList = (textarea) => {\n const orderedListRegex = /^\\d+\\.\\s+/;\n const noInitialSelection = textarea.selectionStart === textarea.selectionEnd;\n let selectionEnd;\n let selectionStart;\n let text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let textToUnstyle = text;\n let lines = text.split('\\n');\n let startOfLine, endOfLine;\n if (noInitialSelection) {\n const linesBefore = textarea.value.slice(0, textarea.selectionStart).split(/\\n/);\n startOfLine = textarea.selectionStart - linesBefore[linesBefore.length - 1].length;\n endOfLine = wordSelectionEnd(textarea.value, textarea.selectionStart, true);\n textToUnstyle = textarea.value.slice(startOfLine, endOfLine);\n }\n const linesToUnstyle = textToUnstyle.split('\\n');\n const undoStyling = linesToUnstyle.every(line => orderedListRegex.test(line));\n if (undoStyling) {\n lines = linesToUnstyle.map(line => line.replace(orderedListRegex, ''));\n text = lines.join('\\n');\n if (noInitialSelection && startOfLine && endOfLine) {\n const lengthDiff = linesToUnstyle[0].length - lines[0].length;\n selectionStart = selectionEnd = textarea.selectionStart - lengthDiff;\n textarea.selectionStart = startOfLine;\n textarea.selectionEnd = endOfLine;\n }\n }\n else {\n lines = (function () {\n let i;\n let len;\n let index;\n const results = [];\n for (index = i = 0, len = lines.length; i < len; index = ++i) {\n const line = lines[index];\n results.push(`${index + 1}. ${line}`);\n }\n return results;\n })();\n text = lines.join('\\n');\n const { newlinesToAppend, newlinesToPrepend } = newlinesToSurroundSelectedText(textarea);\n selectionStart = textarea.selectionStart + newlinesToAppend.length;\n selectionEnd = selectionStart + text.length;\n if (noInitialSelection)\n selectionStart = selectionEnd;\n text = newlinesToAppend + text + newlinesToPrepend;\n }\n return { text, selectionStart, selectionEnd };\n}\n","/*!\n * Original Copyright GitHub, Inc. Licensed under the MIT License.\n * See license text at https://github.com/github/markdown-toolbar-element/blob/master/LICENSE.\n */\n\nimport insertText from './insertText';\nimport { blockStyle, isMultipleLines, multilineStyle, orderedList } from './styles';\n\nexport const styleSelectedText = (textarea, styleArgs) => {\n const text = textarea.value.slice(textarea.selectionStart, textarea.selectionEnd);\n let result;\n if (styleArgs.orderedList) {\n result = orderedList(textarea);\n }\n else if (styleArgs.multiline && isMultipleLines(text)) {\n result = multilineStyle(textarea, styleArgs);\n }\n else {\n result = blockStyle(textarea, styleArgs);\n }\n\n insertText(textarea, result);\n};\n\nexport default (button, stylesToApply) => {\n const toolbar = button.parentElement;\n\n const defaults = {\n prefix: '',\n suffix: '',\n blockPrefix: '',\n blockSuffix: '',\n multiline: false,\n replaceNext: '',\n prefixSpace: false,\n scanFor: '',\n surroundWithNewlines: false,\n orderedList: false,\n trimFirst: false\n };\n\n const style = Object.assign({}, defaults, stylesToApply);\n\n const field = document.getElementById(toolbar.dataset.for);\n\n if (field) {\n field.focus();\n styleSelectedText(field, style);\n }\n}\n","import Component from 'flarum/Component';\nimport icon from 'flarum/helpers/icon';\nimport apply from '../util/apply';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nexport default class MarkdownButton extends Component {\n config(isInitialized) {\n if (isInitialized) return;\n\n this.$().tooltip();\n }\n\n view() {\n return <button className=\"Button Button--icon Button--link\" title={this.title()} data-hotkey={this.props.hotkey}\n onclick={this.click.bind(this)} onkeydown={this.keydown.bind(this)}>\n {icon(this.props.icon)}\n </button>;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.click();\n }\n }\n\n click() {\n return apply(this.element, this.props.style);\n }\n\n title() {\n let tooltip = this.props.title;\n\n if (this.props.hotkey) tooltip += ` <${modifierKey}-${this.props.hotkey}>`;\n\n return tooltip;\n }\n}\n","import { extend } from 'flarum/extend';\nimport TextEditor from 'flarum/components/TextEditor';\nimport MarkdownArea from 'mdarea';\n\nimport './polyfills';\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\n\napp.initializers.add('flarum-markdown', function(app) {\n\n let index = 1;\n\n extend(TextEditor.prototype, 'init', function() {\n this.textareaId = 'textarea'+(index++);\n });\n\n extend(TextEditor.prototype, 'view', function(vdom) {\n vdom.children[0].attrs.id = this.textareaId;\n });\n\n extend(TextEditor.prototype, 'configTextarea', function(value, element, isInitialized, context) {\n if (isInitialized) return;\n\n const editor = new MarkdownArea(element);\n editor.disableInline();\n editor.ignoreTab();\n\n context.onunload = function() {\n editor.destroy();\n };\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function(items) {\n const tooltip = name => app.translator.trans(`flarum-markdown.forum.composer.${name}_tooltip`);\n\n items.add('markdown', (\n <MarkdownToolbar for={this.textareaId}>\n <MarkdownButton title={tooltip('header')} icon=\"fas fa-heading\" style={{ prefix: '### ' }} />\n <MarkdownButton title={tooltip('bold')} icon=\"fas fa-bold\" style={{ prefix: '**', suffix: '**', trimFirst: true }} hotkey=\"b\" />\n <MarkdownButton title={tooltip('italic')} icon=\"fas fa-italic\" style={{ prefix: '_', suffix: '_', trimFirst: true }} hotkey=\"i\" />\n <MarkdownButton title={tooltip('quote')} icon=\"fas fa-quote-left\" style={{ prefix: '> ', multiline: true, surroundWithNewlines: true }} />\n <MarkdownButton title={tooltip('code')} icon=\"fas fa-code\" style={{ prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' }} />\n <MarkdownButton title={tooltip('link')} icon=\"fas fa-link\" style={{ prefix: '[', suffix: '](url)', replaceNext: 'url', scanFor: 'https?://' }} />\n <MarkdownButton title={tooltip('image')} icon=\"fas fa-image\" style={{ prefix: '![', suffix: '](src)', replaceNext: 'src', scanFor: 'https?://' }} />\n <MarkdownButton title={tooltip('unordered_list')} icon=\"fas fa-list-ul\" style={{ prefix: '- ', multiline: true, surroundWithNewlines: true }} />\n <MarkdownButton title={tooltip('ordered_list')} icon=\"fas fa-list-ol\" style={{ prefix: '1. ', multiline: true, orderedList: true }} />\n </MarkdownToolbar>\n ), 100);\n });\n});\n"],"sourceRoot":""}