framework/extensions/package-manager/js/dist/admin.js.map
2021-09-01 19:49:44 +01:00

1 line
13 KiB
Plaintext

{"version":3,"sources":["webpack://@sycho/flarum-package-manager/webpack/bootstrap","webpack://@sycho/flarum-package-manager/./admin.js","webpack://@sycho/flarum-package-manager/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@sycho/flarum-package-manager/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@sycho/flarum-package-manager/./src/admin/components/Installer.tsx","webpack://@sycho/flarum-package-manager/./src/admin/index.js","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/app']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['admin/components/LoadingModal']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/Component']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/components/Button']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/extend']\"","webpack://@sycho/flarum-package-manager/external \"flarum.core.compat['common/utils/Stream']\""],"names":["_inheritsLoose","subClass","superClass","prototype","Object","create","constructor","setPrototypeOf","_setPrototypeOf","o","p","__proto__","Installer","packageName","isLoading","oninit","vnode","Stream","view","app","translator","trans","extiverse","onsubmit","bind","data","modal","show","LoadingModal","request","method","url","forum","attribute","body","then","response","extensionId","attributes","id","alerts","type","extension","window","location","href","reload","m","redraw","Component","initializers","add","extensionData","registerSetting","extend","ExtensionPage","items","close"],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;Q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R,WAAhB,EAAqCtB,GAAG,CAACC,UAAJ,CAAeC,KAAf,CAAqB,0DAArB,CAArC;AACAsB,gBAAM,CAACC,QAAP,GAAkBzB,GAAG,CAACa,KAAJ,CAAUC,SAAV,CAAoB,UAApB,CAAlB;AACD,SAND,aAMW,YAAM;AACfd,aAAG,CAACO,KAAJ,CAAU+B,KAAV;AACD,SARD;AASD;AAfH,gBAFF;AAqBD,GAtBK,CAAN;AAuBD,CAhCD,E;;;;;;;;;;;ACPA,iD;;;;;;;;;;;ACAA,sE;;;;;;;;;;;ACAA,qE;;;;;;;;;;;ACAA,wD;;;;;;;;;;;ACAA,gE;;;;;;;;;;;ACAA,qD;;;;;;;;;;;ACAA,2D","file":"admin.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 = \"./admin.js\");\n","export * from './src/admin';","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}","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 type Mithril from 'mithril';\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from \"flarum/common/components/Button\";\nimport Stream from \"flarum/common/utils/Stream\";\nimport LoadingModal from \"flarum/admin/components/LoadingModal\";\n\nexport default class Installer extends Component {\n packageName!: Stream<string>;\n isLoading: boolean = false;\n\n oninit(vnode: Mithril.Vnode): void {\n super.oninit(vnode);\n\n this.packageName = Stream('');\n }\n\n view(): Mithril.Children {\n return (\n <div className=\"Form-group\">\n <label htmlFor=\"install-extension\">{app.translator.trans('sycho-package-manager.admin.extensions.install')}</label>\n <p className=\"helpText\">{app.translator.trans('sycho-package-manager.admin.extensions.install_help', {\n extiverse: <a href=\"https://extiverse.com\">extiverse.com</a>\n })}</p>\n <div className=\"FormControl-container\">\n <input className=\"FormControl\" id=\"install-extension\" placeholder=\"vendor/package-name\" bidi={this.packageName}/>\n <Button className=\"Button\" icon=\"fas fa-download\" onclick={this.onsubmit.bind(this)} loading={this.isLoading}>\n {app.translator.trans('sycho-package-manager.admin.extensions.proceed')}\n </Button>\n </div>\n </div>\n );\n }\n\n data(): any {\n return {\n package: this.packageName(),\n };\n }\n\n onsubmit(): void {\n this.isLoading = true;\n app.modal.show(LoadingModal);\n\n app.request({\n method: 'POST',\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,\n body: {\n data: this.data()\n },\n }).then((response) => {\n const extensionId = response.data.attributes.id;\n app.alerts.show({ type: 'success' }, app.translator.trans('sycho-package-manager.admin.extensions.successful_install', { extension: extensionId }));\n window.location.href = `${app.forum.attribute('adminUrl')}#/extension/${extensionId}`;\n window.location.reload();\n }).finally(() => {\n this.isLoading = false;\n m.redraw();\n });\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport Installer from \"./components/Installer\";\n\napp.initializers.add('sycho-package-manager', (app) => {\n app.extensionData\n .for('sycho-package-manager')\n .registerSetting(() => {\n return (\n <Installer />\n );\n });\n\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n items.add(\n 'remove',\n <Button\n className=\"Button Button--danger\"\n icon=\"fas fa-times\"\n onclick={() => {\n app.modal.show(LoadingModal);\n\n app.request({\n url: `${app.forum.attribute('apiUrl')}/package-manager/extensions/${this.extension.id}`,\n method: 'DELETE',\n }).then(() => {\n app.alerts.show({ type: 'success' }, app.translator.trans('sycho-package-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }).finally(() => {\n app.modal.close();\n });\n }}>\n Remove\n </Button>\n );\n });\n});\n","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['admin/components/LoadingModal'];","module.exports = flarum.core.compat['common/Component'];","module.exports = flarum.core.compat['common/components/Button'];","module.exports = flarum.core.compat['common/extend'];","module.exports = flarum.core.compat['common/utils/Stream'];"],"sourceRoot":""}