diff --git a/extensions/markdown/js/dist/forum.js b/extensions/markdown/js/dist/forum.js index 1396daf65..a7c79abde 100644 --- a/extensions/markdown/js/dist/forum.js +++ b/extensions/markdown/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=8)}([function(t,e){t.exports=flarum.core.compat["common/Component"]},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["common/components/TextEditor"]},function(t,e){t.exports=flarum.core.compat["common/utils/BasicEditorDriver"]},function(t,e){t.exports=flarum.core.compat["common/utils/styleSelectedText"]},function(t,e){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["common/helpers/icon"]},function(t,e){t.exports=flarum.core.compat["common/components/Tooltip"]},function(t,e,o){"use strict";o.r(e),o.d(e,"markdownToolbarItems",(function(){return S}));var r=o(1),n=o(2),i=o.n(n),c=o(3),a=o.n(c),l=o(4),u=o.n(l),f=o(5),s=o.n(f);function d(t,e){return(d=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function p(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,d(t,e)}var h=o(0),x=o.n(h),k=function(t){function e(){return t.apply(this,arguments)||this}return p(e,t),e.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},e}(x.a),y=o(6),b=o.n(y),_=o(7),g=o.n(_),v=function(t){function e(){return t.apply(this,arguments)||this}p(e,t);var o=e.prototype;return o.oncreate=function(e){t.prototype.oncreate.call(this,e)},o.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},b()(this.attrs.icon));return this.attrs.title?m(g.a,{text:this.attrs.title},t):t},o.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},e}(x.a),w=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",O={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},j=function(t){u()(app.composer.editor.el,O[t])};function P(t,e){return function(o){o.key===e&&(o.metaKey&&"⌘"===w||o.ctrlKey&&"ctrl"===w)&&(o.preventDefault(),j(t))}}function S(){var t=new s.a,e=function(t,e){return app.translator.trans("flarum-markdown.forum.composer."+t+"_tooltip")+(e?" <"+w+"-"+e+">":"")},o=function(t){return function(){return j(t)}};return t.add("header",m(v,{title:e("header"),icon:"fas fa-heading",onclick:o("header")}),1e3),t.add("bold",m(v,{title:e("bold","b"),icon:"fas fa-bold",onclick:o("bold")}),900),t.add("italic",m(v,{title:e("italic","i"),icon:"fas fa-italic",onclick:o("italic")}),800),t.add("strikethrough",m(v,{title:e("strikethrough"),icon:"fas fa-strikethrough",onclick:o("strikethrough")}),700),t.add("quote",m(v,{title:e("quote"),icon:"fas fa-quote-left",onclick:o("quote")}),600),t.add("spoiler",m(v,{title:e("spoiler"),icon:"fas fa-exclamation-triangle",onclick:o("spoiler")}),500),t.add("code",m(v,{title:e("code"),icon:"fas fa-code",onclick:o("code")}),400),t.add("link",m(v,{title:e("link"),icon:"fas fa-link",onclick:o("link")}),300),t.add("image",m(v,{title:e("image"),icon:"fas fa-image",onclick:o("image")}),200),t.add("unordered_list",m(v,{title:e("unordered_list"),icon:"fas fa-list-ul",onclick:o("unordered_list")}),100),t.add("ordered_list",m(v,{title:e("ordered_list"),icon:"fas fa-list-ol",onclick:o("ordered_list")}),0),t}app.initializers.add("flarum-markdown",(function(t){Object(r.extend)(a.a.prototype,"keyHandlers",(function(t){t.add("bold",P("bold","b")),t.add("italic",P("italic","i"))})),Object(r.extend)(i.a.prototype,"toolbarItems",(function(t){t.add("markdown",m(k,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},S().toArray()),100)}))}))}]); +module.exports=function(t){var e={};function o(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,r){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=7)}([function(t,e){t.exports=flarum.core.compat["common/Component"]},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["common/components/TextEditor"]},function(t,e){t.exports=flarum.core.compat["common/utils/BasicEditorDriver"]},function(t,e){t.exports=flarum.core.compat["common/utils/styleSelectedText"]},function(t,e){t.exports=flarum.core.compat["common/helpers/icon"]},function(t,e){t.exports=flarum.core.compat["common/components/Tooltip"]},function(t,e,o){"use strict";o.r(e);var r=o(1),n=o(2),i=o.n(n),c=o(3),l=o.n(c),a=o(4),u=o.n(a);function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,f(t,e)}var p=o(0),d=o.n(p),x=function(t){function e(){return t.apply(this,arguments)||this}return s(e,t),e.prototype.view=function(t){return m("div",{class:"MarkdownToolbar"},t.children)},e}(d.a),h=o(5),k=o.n(h),y=o(6),b=o.n(y),v=function(t){function e(){return t.apply(this,arguments)||this}s(e,t);var o=e.prototype;return o.oncreate=function(e){t.prototype.oncreate.call(this,e)},o.view=function(){var t=m("button",{className:"Button Button--icon Button--link",type:"button","data-hotkey":this.attrs.hotkey,onkeydown:this.keydown.bind(this),onclick:this.attrs.onclick},k()(this.attrs.icon));return this.attrs.title?m(b.a,{text:this.attrs.title},t):t},o.keydown=function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),this.element.click())},e}(d.a),_=navigator.userAgent.match(/Macintosh/)?"⌘":"ctrl",g={header:{prefix:"### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},image:{prefix:"![",suffix:"](https://)",replaceNext:"https://",scanFor:"https?://"},unordered_list:{prefix:"- ",multiline:!0,surroundWithNewlines:!0},ordered_list:{prefix:"1. ",multiline:!0,orderedList:!0},spoiler:{prefix:">!",suffix:"!<",blockPrefix:">! ",multiline:!0,trimFirst:!0}},w=function(t){u()(app.composer.editor.el,g[t])};function O(t,e){return function(o){o.key===e&&(o.metaKey&&"⌘"===_||o.ctrlKey&&"ctrl"===_)&&(o.preventDefault(),w(t))}}app.initializers.add("flarum-markdown",(function(t){Object(r.extend)(l.a.prototype,"keyHandlers",(function(t){t.add("bold",O("bold","b")),t.add("italic",O("italic","i"))})),Object(r.extend)(i.a.prototype,"toolbarItems",(function(e){var o=function(e,o){return t.translator.trans("flarum-markdown.forum.composer."+e+"_tooltip")+(o?" <"+_+"-"+o+">":"")},r=function(t){return function(){return w(t)}};e.add("markdown",m(x,{for:this.textareaId,setShortcutHandler:function(t){return shortcutHandler=t}},m(v,{title:o("header"),icon:"fas fa-heading",onclick:r("header")}),m(v,{title:o("bold","b"),icon:"fas fa-bold",onclick:r("bold")}),m(v,{title:o("italic","i"),icon:"fas fa-italic",onclick:r("italic")}),m(v,{title:o("strikethrough"),icon:"fas fa-strikethrough",onclick:r("strikethrough")}),m(v,{title:o("quote"),icon:"fas fa-quote-left",onclick:r("quote")}),m(v,{title:o("spoiler"),icon:"fas fa-exclamation-triangle",onclick:r("spoiler")}),m(v,{title:o("code"),icon:"fas fa-code",onclick:r("code")}),m(v,{title:o("link"),icon:"fas fa-link",onclick:r("link")}),m(v,{title:o("image"),icon:"fas fa-image",onclick:r("image")}),m(v,{title:o("unordered_list"),icon:"fas fa-list-ul",onclick:r("unordered_list")}),m(v,{title:o("ordered_list"),icon:"fas fa-list-ol",onclick:r("ordered_list")})),100)}))}))}]); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/markdown/js/dist/forum.js.map b/extensions/markdown/js/dist/forum.js.map index e31dfa822..44ed69261 100644 --- a/extensions/markdown/js/dist/forum.js.map +++ b/extensions/markdown/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/external \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/external \"flarum.core.compat['extend']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/./src/forum/components/MarkdownToolbar.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","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","data-hotkey","this","attrs","hotkey","onkeydown","keydown","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","header","prefix","bold","suffix","trimFirst","italic","strikethrough","quote","multiline","surroundWithNewlines","code","blockPrefix","blockSuffix","link","replaceNext","scanFor","image","unordered_list","ordered_list","orderedList","spoiler","applyStyle","id","styleSelectedText","app","composer","editor","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","items","ItemList","tooltip","translator","trans","makeApplyStyle","add","initializers","extend","BasicEditorDriver","TextEditor","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAA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IAAI,QAAS,EAAC,EAAD,CAAgBlD,MAAO8C,EAAQ,SAAU/C,KAAK,eAAeD,QAASmD,EAAe,WAAc,KACtHL,EAAMM,IACJ,iBACA,EAAC,EAAD,CAAgBlD,MAAO8C,EAAQ,kBAAmB/C,KAAK,iBAAiBD,QAASmD,EAAe,oBAChG,KAEFL,EAAMM,IAAI,eAAgB,EAAC,EAAD,CAAgBlD,MAAO8C,EAAQ,gBAAiB/C,KAAK,iBAAiBD,QAASmD,EAAe,kBAAqB,GAEtIL,EAhDTT,IAAIgB,aAAaD,IAAI,mBAAmB,SAAUf,GAChDiB,iBAAOC,IAAkBtF,UAAW,eAAe,SAAU6E,GAC3DA,EAAMM,IAAI,OAAQX,EAAa,OAAQ,MACvCK,EAAMM,IAAI,SAAUX,EAAa,SAAU,SAG7Ca,iBAAOE,IAAWvF,UAAW,gBAAgB,SAAU6E,GACrDA,EAAMM,IACJ,WACA,EAAC,EAAD,CAAiBK,IAAK9D,KAAK+D,WAAYC,mBAAoB,SAACC,GAAD,OAAcC,gBAAkBD,IACxFf,IAAuBiB,WAE1B","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 = 8);\n","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['common/components/TextEditor'];","module.exports = flarum.core.compat['common/utils/BasicEditorDriver'];","module.exports = flarum.core.compat['common/utils/styleSelectedText'];","module.exports = flarum.core.compat['common/utils/ItemList'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/components/Tooltip'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return
\n {vnode.children}\n
;\n }\n}\n","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n {icon(this.attrs.icon)}\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport { extend } from 'flarum/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n header: { prefix: '### ' },\n bold: { prefix: '**', suffix: '**', trimFirst: true },\n italic: { prefix: '_', suffix: '_', trimFirst: true },\n strikethrough: { prefix: '~~', suffix: '~~', trimFirst: true },\n quote: { prefix: '> ', multiline: true, surroundWithNewlines: true },\n code: { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n link: { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n image: { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n unordered_list: { prefix: '- ', multiline: true, surroundWithNewlines: true },\n ordered_list: { prefix: '1. ', multiline: true, orderedList: true },\n spoiler: { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true },\n};\n\nconst applyStyle = (id) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(app.composer.editor.el, styles[id]);\n};\n\nfunction makeShortcut(id, key) {\n return function (e) {\n if (e.key === key && ((e.metaKey && modifierKey === '⌘') || (e.ctrlKey && modifierKey === 'ctrl'))) {\n e.preventDefault();\n applyStyle(id);\n }\n };\n}\n\napp.initializers.add('flarum-markdown', function (app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b'));\n items.add('italic', makeShortcut('italic', 'i'));\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n (shortcutHandler = handler)}>\n {markdownToolbarItems().toArray()}\n ,\n 100\n );\n });\n});\n\nexport function markdownToolbarItems() {\n const items = new ItemList();\n\n const tooltip = (name, hotkey) => {\n return app.translator.trans(`flarum-markdown.forum.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n };\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id);\n };\n\n items.add('header', , 1000);\n items.add('bold', , 900);\n items.add('italic', , 800);\n items.add(\n 'strikethrough',\n ,\n 700\n );\n items.add('quote', , 600);\n items.add('spoiler', , 500);\n items.add('code', , 400);\n items.add('link', , 300);\n items.add('image', , 200);\n items.add(\n 'unordered_list',\n ,\n 100\n );\n items.add('ordered_list', , 0);\n\n return items;\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/external \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/external \"flarum.core.compat['extend']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/utils/styleSelectedText']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/markdown/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/markdown/./src/forum/components/MarkdownToolbar.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","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","MarkdownToolbar","view","vnode","class","children","Component","MarkdownButton","oncreate","button","className","type","data-hotkey","this","attrs","hotkey","onkeydown","keydown","onclick","icon","title","text","event","preventDefault","element","click","modifierKey","navigator","userAgent","match","styles","prefix","suffix","trimFirst","multiline","surroundWithNewlines","blockPrefix","blockSuffix","replaceNext","scanFor","orderedList","applyStyle","id","styleSelectedText","app","composer","editor","el","makeShortcut","e","metaKey","ctrlKey","initializers","add","extend","BasicEditorDriver","items","TextEditor","tooltip","translator","trans","makeApplyStyle","for","textareaId","setShortcutHandler","handler","shortcutHandler"],"mappings":"2BAC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2C,EAAe,mBAE/F","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 = 7);\n","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['common/components/TextEditor'];","module.exports = flarum.core.compat['common/utils/BasicEditorDriver'];","module.exports = flarum.core.compat['common/utils/styleSelectedText'];","module.exports = flarum.core.compat['common/helpers/icon'];","module.exports = flarum.core.compat['common/components/Tooltip'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return
\n {vnode.children}\n
;\n }\n}\n","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n\n view() {\n const button = (\n \n {icon(this.attrs.icon)}\n \n );\n\n if (this.attrs.title) {\n return {button};\n }\n\n return button;\n }\n\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\n","/*!\n * Includes modified code from GitHub Markdown Toolbar Element\n * https://github.com/github/markdown-toolbar-element/\n *\n * Original Copyright GitHub, Inc.\n * Released under the MIT license\n * https://github.com/github/markdown-toolbar-element/blob/master/LICENSE\n */\n\nimport { extend } from 'flarum/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\n\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\n\nconst styles = {\n 'header': { prefix: '### ' },\n 'bold': { prefix: '**', suffix: '**', trimFirst: true },\n 'italic': { prefix: '_', suffix: '_', trimFirst: true },\n 'strikethrough': { prefix: '~~', suffix: '~~', trimFirst: true },\n 'quote': { prefix: '> ', multiline: true, surroundWithNewlines: true },\n 'code': { prefix: '`', suffix: '`', blockPrefix: '```', blockSuffix: '```' },\n 'link': { prefix: '[', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n 'image': { prefix: '![', suffix: '](https://)', replaceNext: 'https://', scanFor: 'https?://' },\n 'unordered_list': { prefix: '- ', multiline: true, surroundWithNewlines: true },\n 'ordered_list': { prefix: '1. ', multiline: true, orderedList: true },\n 'spoiler': { prefix: '>!', suffix: '!<', blockPrefix: '>! ', multiline: true, trimFirst: true }\n}\n\nconst applyStyle = (id) => {\n // This is a nasty hack that breaks encapsulation of the editor.\n // In future releases, we'll need to tweak the editor driver interface\n // to support triggering events like this.\n styleSelectedText(app.composer.editor.el, styles[id]);\n}\n\nfunction makeShortcut(id, key) {\n return function (e) {\n if (e.key === key && (e.metaKey && modifierKey === '⌘' || e.ctrlKey && modifierKey === 'ctrl')) {\n e.preventDefault();\n applyStyle(id);\n }\n }\n}\n\napp.initializers.add('flarum-markdown', function (app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b'));\n items.add('italic', makeShortcut('italic', 'i'));\n });\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n const tooltip = (name, hotkey) => {\n return app.translator.trans(`flarum-markdown.forum.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n };\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id);\n }\n\n items.add('markdown', (\n shortcutHandler = handler}>\n \n \n \n \n \n \n \n \n \n \n \n \n ), 100);\n });\n});\n"],"sourceRoot":""} \ No newline at end of file