mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 15:03:44 +08:00
9feb9dd4eb
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
1 line
15 KiB
Plaintext
Generated
1 line
15 KiB
Plaintext
Generated
{"version":3,"file":"admin.js","mappings":";MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,kCCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,0BCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,2BCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,6CCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,+CCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,+CCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iCCC7C,MAAMW,UAAwB,KAC3CC,KAAKC,GACH,OAAOC,EAAE,MAAO,CACdC,UAAW,mBACVF,EAAMG,SACX,EAEFP,OAAOC,IAAIO,IAAI,kBAAmB,o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MxD,IAAI,UAAWH,EAAEI,EAAgB,CACrCa,MAAO2C,EAAQ,WACf5C,KAAM,8BACND,QAASgD,EAAe,aACtB,KACJJ,EAAMxD,IAAI,OAAQH,EAAEI,EAAgB,CAClCa,MAAO2C,EAAQ,QACf5C,KAAM,cACND,QAASgD,EAAe,UACtB,KACJJ,EAAMxD,IAAI,OAAQH,EAAEI,EAAgB,CAClCa,MAAO2C,EAAQ,QACf5C,KAAM,cACND,QAASgD,EAAe,UACtB,KACJJ,EAAMxD,IAAI,QAASH,EAAEI,EAAgB,CACnCa,MAAO2C,EAAQ,SACf5C,KAAM,eACND,QAASgD,EAAe,WACtB,KACJJ,EAAMxD,IAAI,iBAAkBH,EAAEI,EAAgB,CAC5Ca,MAAO2C,EAAQ,kBACf5C,KAAM,iBACND,QAASgD,EAAe,oBACtB,KACJJ,EAAMxD,IAAI,eAAgBH,EAAEI,EAAgB,CAC1Ca,MAAO2C,EAAQ,gBACf5C,KAAM,iBACND,QAASgD,EAAe,kBACtB,GACGJ,CACT,CC1JA,qBAAqB,mBD2Jd,SAAoBO,IACzB,IAAAC,QAAO,cAA6B,eAAe,SAAUR,GAC3DA,EAAMxD,IAAI,OAAQkD,EAAa,OAAQ,IAAK5C,OAC5CkD,EAAMxD,IAAI,SAAUkD,EAAa,SAAU,IAAK5C,MAClD,IACI,oCACF,IAAA2D,UAAS,cAAsB,uBAAwBX,GAEvD,mCAA4CA,GAE9C,IAAAU,QAAO,cAAsB,gBAAgB,SAAUR,GACrDA,EAAMxD,IAAI,WAAYH,EAAEH,EAAiB,CACvCwE,IAAK5D,KAAK6D,WACVC,mBAAoBC,GAAWC,gBAAkBD,GAChD/D,KAAKgD,uBAAuBiB,WAAY,IAC7C,GACF","sources":["webpack://@flarum/markdown/webpack/bootstrap","webpack://@flarum/markdown/webpack/runtime/compat get default export","webpack://@flarum/markdown/webpack/runtime/define property getters","webpack://@flarum/markdown/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/markdown/webpack/runtime/make namespace object","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/components/TextEditor')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/utils/BasicEditorDriver')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/utils/styleSelectedText')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/helpers/icon')\"","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/markdown/./src/common/index.js","webpack://@flarum/markdown/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditor');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/BasicEditorDriver');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/styleSelectedText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","import Component from 'flarum/common/Component';\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return m(\"div\", {\n className: \"MarkdownToolbar\"\n }, vnode.children);\n }\n}\nflarum.reg.add('flarum-markdown', 'common/components/MarkdownToolbar', MarkdownToolbar)","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","import Component from 'flarum/common/Component';\nimport icon from 'flarum/common/helpers/icon';\nimport Tooltip from 'flarum/common/components/Tooltip';\nexport default class MarkdownButton extends Component {\n oncreate(vnode) {\n super.oncreate(vnode);\n }\n view() {\n const button = m(\"button\", {\n className: \"Button Button--icon Button--link\",\n type: \"button\",\n \"data-hotkey\": this.attrs.hotkey,\n onkeydown: this.keydown.bind(this),\n onclick: this.attrs.onclick\n }, icon(this.attrs.icon));\n if (this.attrs.title) {\n return m(Tooltip, {\n text: this.attrs.title\n }, button);\n }\n return button;\n }\n keydown(event) {\n if (event.key === ' ' || event.key === 'Enter') {\n event.preventDefault();\n this.element.click();\n }\n }\n}\nflarum.reg.add('flarum-markdown', 'common/components/MarkdownButton', MarkdownButton)","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","/*!\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 app from 'flarum/common/app';\nimport { extend, override } from 'flarum/common/extend';\nimport TextEditor from 'flarum/common/components/TextEditor';\nimport BasicEditorDriver from 'flarum/common/utils/BasicEditorDriver';\nimport styleSelectedText from 'flarum/common/utils/styleSelectedText';\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\nconst modifierKey = navigator.userAgent.match(/Macintosh/) ? '⌘' : 'ctrl';\nconst styles = {\n header: {\n prefix: '### '\n },\n bold: {\n prefix: '**',\n suffix: '**',\n trimFirst: true\n },\n italic: {\n prefix: '_',\n suffix: '_',\n trimFirst: true\n },\n strikethrough: {\n prefix: '~~',\n suffix: '~~',\n trimFirst: true\n },\n quote: {\n prefix: '> ',\n multiline: true,\n surroundWithNewlines: true\n },\n code: {\n prefix: '`',\n suffix: '`',\n blockPrefix: '```',\n blockSuffix: '```'\n },\n link: {\n prefix: '[',\n suffix: '](https://)',\n replaceNext: 'https://',\n scanFor: 'https?://'\n },\n image: {\n prefix: '![',\n suffix: '](https://)',\n replaceNext: 'https://',\n scanFor: 'https?://'\n },\n unordered_list: {\n prefix: '- ',\n multiline: true,\n surroundWithNewlines: true\n },\n ordered_list: {\n prefix: '1. ',\n multiline: true,\n orderedList: true\n },\n spoiler: {\n prefix: '>!',\n suffix: '!<',\n blockPrefix: '>! ',\n multiline: true,\n trimFirst: true\n }\n};\nconst applyStyle = (id, editorDriver) => {\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(editorDriver.el, styles[id]);\n};\nfunction makeShortcut(id, key, editorDriver) {\n return function (e) {\n if (e.key === key && (e.metaKey && modifierKey === '⌘' || e.ctrlKey && modifierKey === 'ctrl')) {\n e.preventDefault();\n applyStyle(id, editorDriver);\n }\n };\n}\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n function tooltip(name, hotkey) {\n return app.translator.trans(\"flarum-markdown.lib.composer.\".concat(name, \"_tooltip\")) + (hotkey ? \" <\".concat(modifierKey, \"-\").concat(hotkey, \">\") : '');\n }\n const makeApplyStyle = id => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n items.add('header', m(MarkdownButton, {\n title: tooltip('header'),\n icon: \"fas fa-heading\",\n onclick: makeApplyStyle('header')\n }), 1000);\n items.add('bold', m(MarkdownButton, {\n title: tooltip('bold', 'b'),\n icon: \"fas fa-bold\",\n onclick: makeApplyStyle('bold')\n }), 900);\n items.add('italic', m(MarkdownButton, {\n title: tooltip('italic', 'i'),\n icon: \"fas fa-italic\",\n onclick: makeApplyStyle('italic')\n }), 800);\n items.add('strikethrough', m(MarkdownButton, {\n title: tooltip('strikethrough'),\n icon: \"fas fa-strikethrough\",\n onclick: makeApplyStyle('strikethrough')\n }), 700);\n items.add('quote', m(MarkdownButton, {\n title: tooltip('quote'),\n icon: \"fas fa-quote-left\",\n onclick: makeApplyStyle('quote')\n }), 600);\n items.add('spoiler', m(MarkdownButton, {\n title: tooltip('spoiler'),\n icon: \"fas fa-exclamation-triangle\",\n onclick: makeApplyStyle('spoiler')\n }), 500);\n items.add('code', m(MarkdownButton, {\n title: tooltip('code'),\n icon: \"fas fa-code\",\n onclick: makeApplyStyle('code')\n }), 400);\n items.add('link', m(MarkdownButton, {\n title: tooltip('link'),\n icon: \"fas fa-link\",\n onclick: makeApplyStyle('link')\n }), 300);\n items.add('image', m(MarkdownButton, {\n title: tooltip('image'),\n icon: \"fas fa-image\",\n onclick: makeApplyStyle('image')\n }), 200);\n items.add('unordered_list', m(MarkdownButton, {\n title: tooltip('unordered_list'),\n icon: \"fas fa-list-ul\",\n onclick: makeApplyStyle('unordered_list')\n }), 100);\n items.add('ordered_list', m(MarkdownButton, {\n title: tooltip('ordered_list'),\n icon: \"fas fa-list-ol\",\n onclick: makeApplyStyle('ordered_list')\n }), 0);\n return items;\n}\nexport function initialize(app) {\n extend(BasicEditorDriver.prototype, 'keyHandlers', function (items) {\n items.add('bold', makeShortcut('bold', 'b', this));\n items.add('italic', makeShortcut('italic', 'i', this));\n });\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add('markdown', m(MarkdownToolbar, {\n for: this.textareaId,\n setShortcutHandler: handler => shortcutHandler = handler\n }, this.markdownToolbarItems().toArray()), 100);\n });\n}","import app from 'flarum/admin/app';\nimport { initialize } from '../common/index';\napp.initializers.add('flarum-markdown', initialize);"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","MarkdownToolbar","view","vnode","m","className","children","add","MarkdownButton","oncreate","super","button","type","this","attrs","hotkey","onkeydown","keydown","bind","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","editorDriver","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","tooltip","name","concat","makeApplyStyle","composer","editor","app","extend","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""} |