framework/extensions/markdown/js/dist/admin.js.map
flarum-bot c766881e1f Bundled output for commit e63e161be6
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2023-05-07 16:49:15 +00:00

1 line
16 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,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,c,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,iBCAlD,EAA+BF,OAAOC,KAAKC,OAAO,gC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,kC,aCAxD,MAAM,EAA+BF,OAAOC,KAAKC,OAAO,kC,aCAzC,SAASC,EAAgBhB,EAAGiB,GAKzC,OAJAD,EAAkBf,OAAOiB,eAAiBjB,OAAOiB,eAAeC,OAAS,SAAyBnB,EAAGiB,GAEnG,OADAjB,EAAEoB,UAAYH,EACPjB,CACT,EACOgB,EAAgBhB,EAAGiB,EAC5B,CCLe,SAASI,EAAeC,EAAUC,G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AA,UAAsB,uBAAwBb,GAEvDa,IAAAA,UAAAA,qBAA4Cb,GAG9CW,EAAAA,EAAAA,QAAOE,IAAAA,UAAsB,gBAAgB,SAAUX,GACrDA,EAAMQ,IACJ,WACA,EAACpE,EAAe,CAACyE,IAAK/D,KAAKgE,WAAYC,mBAAoB,SAACC,GAAO,OAAMC,gBAAkBD,CAAO,GAC/FlE,KAAKgD,uBAAuBoB,WAE/B,IAEJ,GACF,G","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.core.compat['admin/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/app']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/TextEditor']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/BasicEditorDriver']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/utils/styleSelectedText']\"","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/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/markdown/./src/common/components/MarkdownToolbar.js","webpack://@flarum/markdown/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/markdown/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@flarum/markdown/./src/common/components/MarkdownButton.js","webpack://@flarum/markdown/external root \"flarum.core.compat['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.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/TextEditor'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/BasicEditorDriver'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/styleSelectedText'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import Component from 'flarum/common/Component';\n\nexport default class MarkdownToolbar extends Component {\n view(vnode) {\n return <div className=\"MarkdownToolbar\">{vnode.children}</div>;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","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 <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 >\n {icon(this.attrs.icon)}\n </button>\n );\n\n if (this.attrs.title) {\n return <Tooltip text={this.attrs.title}>{button}</Tooltip>;\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","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['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';\n\nimport MarkdownToolbar from './components/MarkdownToolbar';\nimport MarkdownButton from './components/MarkdownButton';\nimport ItemList from 'flarum/common/utils/ItemList';\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, 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};\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}\n\nfunction markdownToolbarItems(oldFunc) {\n const items = typeof oldFunc === 'function' ? oldFunc() : new ItemList();\n\n function tooltip(name, hotkey) {\n return app.translator.trans(`flarum-markdown.lib.composer.${name}_tooltip`) + (hotkey ? ` <${modifierKey}-${hotkey}>` : '');\n }\n\n const makeApplyStyle = (id) => {\n return () => applyStyle(id, this.attrs.composer.editor);\n };\n\n items.add('header', <MarkdownButton title={tooltip('header')} icon=\"fas fa-heading\" onclick={makeApplyStyle('header')} />, 1000);\n items.add('bold', <MarkdownButton title={tooltip('bold', 'b')} icon=\"fas fa-bold\" onclick={makeApplyStyle('bold')} />, 900);\n items.add('italic', <MarkdownButton title={tooltip('italic', 'i')} icon=\"fas fa-italic\" onclick={makeApplyStyle('italic')} />, 800);\n items.add(\n 'strikethrough',\n <MarkdownButton title={tooltip('strikethrough')} icon=\"fas fa-strikethrough\" onclick={makeApplyStyle('strikethrough')} />,\n 700\n );\n items.add('quote', <MarkdownButton title={tooltip('quote')} icon=\"fas fa-quote-left\" onclick={makeApplyStyle('quote')} />, 600);\n items.add('spoiler', <MarkdownButton title={tooltip('spoiler')} icon=\"fas fa-exclamation-triangle\" onclick={makeApplyStyle('spoiler')} />, 500);\n items.add('code', <MarkdownButton title={tooltip('code')} icon=\"fas fa-code\" onclick={makeApplyStyle('code')} />, 400);\n items.add('link', <MarkdownButton title={tooltip('link')} icon=\"fas fa-link\" onclick={makeApplyStyle('link')} />, 300);\n items.add('image', <MarkdownButton title={tooltip('image')} icon=\"fas fa-image\" onclick={makeApplyStyle('image')} />, 200);\n items.add(\n 'unordered_list',\n <MarkdownButton title={tooltip('unordered_list')} icon=\"fas fa-list-ul\" onclick={makeApplyStyle('unordered_list')} />,\n 100\n );\n items.add('ordered_list', <MarkdownButton title={tooltip('ordered_list')} icon=\"fas fa-list-ol\" onclick={makeApplyStyle('ordered_list')} />, 0);\n\n return items;\n}\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\n if (TextEditor.prototype.markdownToolbarItems) {\n override(TextEditor.prototype, 'markdownToolbarItems', markdownToolbarItems);\n } else {\n TextEditor.prototype.markdownToolbarItems = markdownToolbarItems;\n }\n\n extend(TextEditor.prototype, 'toolbarItems', function (items) {\n items.add(\n 'markdown',\n <MarkdownToolbar for={this.textareaId} setShortcutHandler={(handler) => (shortcutHandler = handler)}>\n {this.markdownToolbarItems().toArray()}\n </MarkdownToolbar>,\n 100\n );\n });\n}\n","import app from 'flarum/admin/app';\nimport { initialize } from '../common/index';\n\napp.initializers.add('flarum-markdown', initialize);\n"],"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","core","compat","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MarkdownToolbar","view","vnode","className","children","Component","MarkdownButton","oncreate","button","type","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","editorDriver","styleSelectedText","el","makeShortcut","e","metaKey","ctrlKey","markdownToolbarItems","oldFunc","items","ItemList","tooltip","name","app","makeApplyStyle","composer","editor","add","extend","BasicEditorDriver","TextEditor","override","for","textareaId","setShortcutHandler","handler","shortcutHandler","toArray"],"sourceRoot":""}