diff --git a/gulpfile.js b/gulpfile.js index 7ed02998c9..ec7356be52 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,6 +3,7 @@ const utils = require('util') const cp = require('child_process') const exec = utils.promisify(cp.exec) const path = require('path') +const rename = require('gulp-rename') const gulp = require('gulp') const cleanCSS = require('gulp-clean-css') const del = require('del') @@ -65,6 +66,9 @@ const common = { 'node_modules/@highlightjs/cdn-assets/highlight.min.js', 'node_modules/@isomorphic-git/lightning-fs/dist/lightning-fs.min.js' ]).pipe(gulp.dest(path.join(outputPath, 'js'))), + () => gulp.src([ + 'node_modules/magic-portal/dist/index.umd.js', + ]).pipe(rename('magic_portal.js')).pipe(gulp.dest(path.join(outputPath, 'js'))), () => gulp.src([ 'node_modules/@tabler/icons/iconfont/tabler-icons.min.css', 'node_modules/inter-ui/inter.css', diff --git a/package.json b/package.json index 1ebc3a9f4d..237c1e54a5 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "del": "^6.0.0", "gulp": "^4.0.2", "gulp-clean-css": "^4.3.0", + "gulp-rename": "^2.0.0", "ip": "1.1.8", "npm-run-all": "^4.1.5", "playwright": "=1.31.0", @@ -122,6 +123,7 @@ "interactjs": "^1.10.17", "jszip": "3.8.0", "katex": "^0.16.7", + "magic-portal": "^1.0.0", "marked": "^5.1.2", "mldoc": "1.5.7", "path": "0.12.7", diff --git a/resources/js/magic_portal.js b/resources/js/magic_portal.js deleted file mode 100644 index e1660ea654..0000000000 --- a/resources/js/magic_portal.js +++ /dev/null @@ -1 +0,0 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.MagicPortal=t()}(this,function(){var e=function(e){var t=this;this.rpc_counter=0,this.channel=e,this.foreign=new Map,this.local=new Map,this.calls=new Map,this.queue=[],this.connectionEstablished=!1,this.channel.addEventListener("message",function(e){var n=e.data;if(n&&"object"==typeof n)switch(n.type){case"MP_INIT":return t.onInit(n);case"MP_SET":return t.onSet(n);case"MP_CALL":return t.onCall(n);case"MP_RETURN":return t.onReturn(n)}}),this.channel.postMessage({type:"MP_INIT",id:1,reply:!0})};e.prototype.onInit=function(e){this.connectionEstablished=!0;var t=this.queue;this.queue=[];for(var n=0,o=t;n