├── .babelrc ├── .gitignore ├── .vscode ├── getNet.js ├── pack-zip.js ├── run-webpack.js ├── server.crt ├── server.key ├── start-dev.js └── start-server.js ├── SweetPlasma.zip ├── dist ├── folder-open_dark.svg ├── folder_dark.svg ├── image_light.svg └── main.js ├── icon.png ├── package.json ├── plugin.json ├── postcss.config.js ├── readme.md ├── src ├── customStyles.scss ├── icon.css ├── main.js └── style.scss ├── tsconfig.json ├── typings ├── acode.d.ts ├── editorFile.d.ts ├── index.d.ts └── settings.d.ts └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env" 4 | ], 5 | "env": { 6 | "test": { 7 | "presets": [ 8 | "@babel/env" 9 | ] 10 | } 11 | }, 12 | "plugins": [ 13 | "html-tag-js/jsx/jsx-to-tag.js", 14 | "html-tag-js/jsx/syntax-parser.js", 15 | [ 16 | "@babel/plugin-transform-runtime" 17 | ] 18 | ], 19 | "compact": true 20 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | pnpm-lock.yaml -------------------------------------------------------------------------------- /.vscode/getNet.js: -------------------------------------------------------------------------------- 1 | const { networkInterfaces } = require('os'); 2 | 3 | module.exports = async (mode = 'dev') => { 4 | const { WiFi, Ethernet } = getIp(); 5 | const [ip] = WiFi || Ethernet; 6 | const port = '5500'; 7 | const src = `https://${ip || '10.0.0'}:${port}`; 8 | console.log('Server starting at: ', src); 9 | return { ip, port }; 10 | }; 11 | 12 | function getIp() { 13 | const nets = networkInterfaces(); 14 | const results = {}; // Or just '{}', an empty object 15 | 16 | Object.keys(nets).forEach((name) => { 17 | nets[name].forEach((net) => { 18 | // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses 19 | // 'IPv4' is in Node <= 17, from 18 it's a number 4 or 6 20 | const familyV4Value = typeof net.family === 'string' ? 'IPv4' : 4; 21 | if (net.family === familyV4Value && !net.internal) { 22 | if (!results[name]) { 23 | results[name] = []; 24 | } 25 | results[name].push(net.address); 26 | } 27 | }); 28 | }); 29 | return results; 30 | } 31 | -------------------------------------------------------------------------------- /.vscode/pack-zip.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const fs = require('fs'); 3 | const jszip = require('jszip'); 4 | 5 | const iconFile = path.join(__dirname, '../icon.png'); 6 | const pluginJSON = path.join(__dirname, '../plugin.json'); 7 | const distFolder = path.join(__dirname, '../dist'); 8 | let readmeDotMd = path.join(__dirname, '../readme.md'); 9 | 10 | if (!fs.existsSync(readmeDotMd)) { 11 | readmeDotMd = path.join(__dirname, '../README.md'); 12 | } 13 | 14 | // create zip file of dist folder 15 | 16 | const zip = new jszip(); 17 | 18 | zip.file('icon.png', fs.readFileSync(iconFile)); 19 | zip.file('plugin.json', fs.readFileSync(pluginJSON)); 20 | zip.file('readme.md', fs.readFileSync(readmeDotMd)); 21 | 22 | loadFile('', distFolder); 23 | 24 | zip 25 | .generateNodeStream({ type: 'nodebuffer', streamFiles: true }) 26 | .pipe(fs.createWriteStream(path.join(__dirname, '../SweetPlasma.zip'))) 27 | .on('finish', () => { 28 | console.log('dist.zip written.'); 29 | }); 30 | 31 | function loadFile(root, folder) { 32 | const distFiles = fs.readdirSync(folder); 33 | distFiles.forEach((file) => { 34 | 35 | const stat = fs.statSync(path.join(folder, file)); 36 | 37 | if (stat.isDirectory()) { 38 | zip.folder(file); 39 | loadFile(path.join(root, file), path.join(folder, file)); 40 | return; 41 | } 42 | 43 | if (!/LICENSE.txt/.test(file)) { 44 | zip.file(path.join(root, file), fs.readFileSync(path.join(folder, file))); 45 | } 46 | }); 47 | } -------------------------------------------------------------------------------- /.vscode/run-webpack.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const { spawn } = require('child_process'); 3 | const path = require('path'); 4 | 5 | const webpack = spawn('npx.cmd', ['webpack', '--mode=development', '--watch'], { cwd: path.resolve(__dirname, '../') }); 6 | 7 | webpack.on('error', (webpackError) => { 8 | if (webpackError) { 9 | console.error(webpackError); 10 | process.exit(1); 11 | } 12 | }); 13 | 14 | webpack.stdout.on('data', (chunk) => { 15 | const stdout = chunk.toString(); 16 | console.log(stdout); 17 | process.send(stdout); 18 | }); 19 | 20 | webpack.stdout.on('error', (error) => { 21 | console.log(error); 22 | }); 23 | 24 | webpack.stderr.on('data', (chunk) => { 25 | const stderr = chunk.toString(); 26 | console.log(stderr); 27 | }); 28 | -------------------------------------------------------------------------------- /.vscode/server.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICfjCCAecCFGoKwe9jqvLXZUsAKK8R9rBoxQBVMA0GCSqGSIb3DQEBCwUAMH4x 3 | CzAJBgNVBAYTAklOMRMwEQYDVQQIDApBaml0IEt1bWFyMQwwCgYDVQQHDANCU1Ax 4 | DjAMBgNVBAoMBUZYREJHMQwwCgYDVQQLDANERVYxDTALBgNVBAMMBEFqaXQxHzAd 5 | BgkqhkiG9w0BCQEWEG1lQGFqaXRrdW1hci5kZXYwHhcNMjIwODIxMDc0NjI1WhcN 6 | MjMwODIxMDc0NjI1WjB+MQswCQYDVQQGEwJJTjETMBEGA1UECAwKQWppdCBLdW1h 7 | cjEMMAoGA1UEBwwDQlNQMQ4wDAYDVQQKDAVGWERCRzEMMAoGA1UECwwDREVWMQ0w 8 | CwYDVQQDDARBaml0MR8wHQYJKoZIhvcNAQkBFhBtZUBhaml0a3VtYXIuZGV2MIGf 9 | MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQClD9GyID1GNGCdsq8vshf2h/tMUzxW 10 | mWqOoBi8ZSUrQGoZJ4vxSk5+kPkSvaZzj4zs+LnUMqIXPu1KSIXflVRXzAvh5VIE 11 | 7M0ithYYbGPSyviUWpatdLCvLCOPXZPTXc+66mY7RnCVzlBqGKOR2H4goeGWq0zG 12 | Q+V3pAM7gLUJsQIDAQABMA0GCSqGSIb3DQEBCwUAA4GBAHpMjw8nYPtJ20jO2i6M 13 | kJg09Hk91g63HEx4noV8WallM80exNYWJgzNI69UIRdh78QAEknJh43TSF61bVpo 14 | i+mtBHzZLyPv4LHKNN+6eBoMxi58tbWVZXQB4awW6d1AstHY10aSygOmOUKLtGxr 15 | lYt6v4QwWrm3j7oNCDRDwxlj 16 | -----END CERTIFICATE----- 17 | -------------------------------------------------------------------------------- /.vscode/server.key: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | Proc-Type: 4,ENCRYPTED 3 | DEK-Info: DES-EDE3-CBC,F6E1E7807FC07585 4 | 5 | 1RxeEBdxtQ0+Erd+wmDLuaHy07d81+5uqCBZ1FVkzFOReCwDHFvqT9pyo00soIBJ 6 | ECcUOQyVoV7XyQKZVna+XwQJ8WoiF7R0dVeP7q1E8whFhVD+ybnwvCHSe9Zv1DTo 7 | 8R74rrAqRRKOf0aFEt2DR3sO9vdljOQY0JSTOefFisJs++FSDGSMPzyoUjyGzix+ 8 | jOcbA9BjPoossVRNSNta9q7IMZRvYnF+mqbeKrlQ7dDV6BBCICJ15syzp0FFZcry 9 | 7Upmstp+HtFphDr1ABaXlbSzPIzj+lYBro4vV4v/FuyGigwzYhiftTzypz0sVV2u 10 | yOSIGkQkNrg+0iaD35BuLzuZnKvlmjwBeFL0xlN0oh2yUSqveTUwiyGXhJxqjuKe 11 | lK9LEkKFtkj+BB0gwKy0aHNYM7Z3F2FfNGd/FlxxEbZMfORm03W/I3ploJLKk6kO 12 | H69Rkh+5lPsO0q89YBuqptiJH4cgKSup+yWH8LASbz+nuxLEKJTasJZJFEFxO62v 13 | gVHARgwv/V5HYqE4FF860mQs/ZiRVJfTN1HWZ4OpEHjJMuDhWLCyqxHeLMvL8nxd 14 | 5qm9cGoguHWmv7JLe/R238AZhYg6eBybg+WAqOJZ2LdMQjAKFa5+oWezCAk1uLI9 15 | v12C5EBYZFI7znx2C4A+YAN7a3HAf+p6o467c1aL/8CQdb37soSpdnAKApx1uFBp 16 | TBxPrNXBOkND/bdU/w4E1lqMPg5KPFNn3gYe7YTB0fG4YqrBfpA0uswBdNHf4u4E 17 | u2Q99Fw9dIsj/BMkwFxTWM0Mb119VPyZm5nd5L4Y0GZmhND4UyVV0A== 18 | -----END RSA PRIVATE KEY----- 19 | -------------------------------------------------------------------------------- /.vscode/start-dev.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-console */ 2 | const { fork, spawn } = require('child_process'); 3 | const path = require('path'); 4 | 5 | main(); 6 | 7 | async function main() { 8 | let serverStarted = false; 9 | console.log('+--------------+'); 10 | console.log('| Starting dev |'); 11 | console.log('+--------------+'); 12 | const webpack = fork(path.resolve(__dirname, './run-webpack.js')); 13 | webpack.on('message', (chunk) => { 14 | if (!serverStarted && chunk.search(/compiled\ssuccessfully/)) { 15 | startServer(); 16 | serverStarted = true; 17 | } 18 | }); 19 | 20 | webpack.on('error', (err) => { 21 | console.log('WEBPACK ERROR', err); 22 | webpack.kill(1); 23 | process.exit(1); 24 | }); 25 | } 26 | 27 | async function startServer() { 28 | const server = fork(path.resolve(__dirname, './start-server.js')); 29 | server.on('error', (err) => { 30 | console.log('SERVER ERROR', err); 31 | server.kill(1); 32 | process.exit(1); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /.vscode/start-server.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable import/no-extraneous-dependencies */ 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const liveServer = require('live-server'); 5 | const getNet = require('./getNet'); 6 | 7 | const serverCrt = path.resolve(__dirname, 'server.crt'); 8 | const serverKey = path.resolve(__dirname, 'server.key'); 9 | 10 | main(); 11 | 12 | async function main() { 13 | const { ip: host, port } = await getNet('dev'); 14 | process.cwd = () => __dirname; 15 | liveServer.start({ 16 | open: false, 17 | port, 18 | host, 19 | cors: true, 20 | root: '../', 21 | ignore: 'node_modules,platforms,plugins', 22 | file: 'index.html', 23 | https: { 24 | cert: fs.readFileSync(serverCrt), 25 | key: fs.readFileSync(serverKey), 26 | passphrase: '1234', 27 | }, 28 | middleware: [(req, res, next) => { 29 | const url = req.originalUrl; 30 | const www = '../platforms/android/app/src/main/assets/www/'; 31 | 32 | if (url === '/cordova.js') { 33 | const file = path.resolve(__dirname, www, 'cordova.js'); 34 | sendFile(res, file); 35 | return; 36 | } 37 | 38 | if (url === '/cordova_plugins.js') { 39 | const file = path.resolve(__dirname, www, 'cordova_plugins.js'); 40 | sendFile(res, file); 41 | return; 42 | } 43 | 44 | next(); 45 | }], 46 | }); 47 | 48 | process.send('OK'); 49 | } 50 | 51 | function sendFile(res, filePath) { 52 | if (fs.existsSync(filePath)) { 53 | const stat = fs.statSync(filePath); 54 | 55 | res.writeHead(200, { 56 | 'Content-Type': 'application/javascript', 57 | 'Content-Length': stat.size, 58 | }); 59 | 60 | const readStream = fs.createReadStream(filePath); 61 | readStream.pipe(res); 62 | return; 63 | } 64 | 65 | res.writeHead(404, { 'Content-Type': 'text/plain' }); 66 | res.end(`ERROR cannot get ${filePath}`); 67 | } 68 | -------------------------------------------------------------------------------- /SweetPlasma.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bajrangCoder/SweetPlasma/ecf8e0137a70e439c061c3603ed5dbacbb4845b3/SweetPlasma.zip -------------------------------------------------------------------------------- /dist/folder-open_dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/folder_dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/image_light.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dist/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). 3 | * This devtool is neither made for production nor for readable output files. 4 | * It uses "eval()" calls to create a separate source file in the browser devtools. 5 | * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) 6 | * or disable the default devtool with "devtool: false". 7 | * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). 8 | */ 9 | /******/ (function() { // webpackBootstrap 10 | /******/ var __webpack_modules__ = ({ 11 | 12 | /***/ "./node_modules/.pnpm/html-tag-js@1.1.41/node_modules/html-tag-js/dist/tag.js": 13 | /*!************************************************************************************!*\ 14 | !*** ./node_modules/.pnpm/html-tag-js@1.1.41/node_modules/html-tag-js/dist/tag.js ***! 15 | \************************************************************************************/ 16 | /***/ (function(module) { 17 | 18 | eval("!function (e, t) {\n true ? module.exports = t() : 0;\n}(this, function () {\n return function () {\n \"use strict\";\n\n var e = {\n d: function (t, n) {\n for (var r in n) e.o(n, r) && !e.o(t, r) && Object.defineProperty(t, r, {\n enumerable: !0,\n get: n[r]\n });\n },\n o: function (e, t) {\n return Object.prototype.hasOwnProperty.call(e, t);\n }\n },\n t = {};\n function n(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var n = 0, r = new Array(t); n < t; n++) r[n] = e[n];\n return r;\n }\n function r(e) {\n return function (e) {\n if (Array.isArray(e)) return n(e);\n }(e) || function (e) {\n if (\"undefined\" != typeof Symbol && null != e[Symbol.iterator] || null != e[\"@@iterator\"]) return Array.from(e);\n }(e) || function (e, t) {\n if (e) {\n if (\"string\" == typeof e) return n(e, t);\n var r = Object.prototype.toString.call(e).slice(8, -1);\n return \"Object\" === r && e.constructor && (r = e.constructor.name), \"Map\" === r || \"Set\" === r ? Array.from(e) : \"Arguments\" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? n(e, t) : void 0;\n }\n }(e) || function () {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function o(e) {\n return o = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (e) {\n return typeof e;\n } : function (e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, o(e);\n }\n function i(e, t) {\n t instanceof Node || (t = c.text(\"\".concat(t))), t instanceof Text && \"clone\" in t && (t = t.clone()), e.append(t);\n }\n function c(e) {\n var t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};\n return \"string\" == typeof t && (t = {\n innerHTML: t\n }), function (e) {\n var t,\n n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {};\n if (\"function\" == typeof e) return e(n, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []);\n if (e instanceof Node) t = e;else {\n if (\"string\" != typeof e) throw new Error(\"Invalid tag, \", o(e));\n t = document.createElement(e);\n }\n return Object.keys(n).forEach(function (e) {\n var r = n[e];\n if (void 0 !== r) switch (e) {\n case \"child\":\n i(t, r);\n break;\n case \"children\":\n if (!Array.isArray(r)) throw new Error(\"children must be an array of Nodes\");\n r.flat().forEach(function (e) {\n i(t, e);\n });\n break;\n case \"attr\":\n Object.keys(r).forEach(function (e) {\n var n = r[e];\n void 0 !== n && t.setAttribute(e, n);\n });\n break;\n case \"style\":\n case \"dataset\":\n Object.keys(r).forEach(function (n) {\n var o = r[n];\n void 0 !== o && (t[e][n] = o);\n });\n break;\n case \"ref\":\n r.instanceOfRef && (r.el = t);\n break;\n default:\n t[e] = r;\n }\n }), t;\n }(e, t, arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : []);\n }\n return e.d(t, {\n default: function () {\n return c;\n }\n }), window && !window.tag && (window.tag = c), Object.defineProperties(c, {\n get: {\n value: function (e) {\n return document.querySelector(e);\n }\n },\n getAll: {\n value: function (e) {\n return r(document.querySelectorAll(e));\n }\n },\n parse: {\n value: function (e) {\n var t = document.createElement(\"div\");\n return t.innerHTML = e, 1 === t.childElementCount ? t.firstElementChild : r(t.children);\n }\n },\n text: {\n value: function (e) {\n return document.createTextNode(e);\n }\n },\n use: {\n value: function () {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : \"\",\n t = e,\n n = !1,\n r = document.createTextNode(e),\n o = [r];\n return Object.defineProperty(r, \"value\", {\n set: function (e) {\n t = e, o.forEach(function (t) {\n t.textContent = e;\n });\n },\n get: function () {\n return t;\n }\n }), Object.defineProperty(r, \"clone\", {\n value: function () {\n if (!n) return n = !0, r;\n var e = r.cloneNode();\n return o.push(e), e;\n }\n }), r;\n }\n }\n }), t.default;\n }();\n});\n\n//# sourceURL=webpack://acode-plugin/./node_modules/.pnpm/html-tag-js@1.1.41/node_modules/html-tag-js/dist/tag.js?"); 19 | 20 | /***/ }), 21 | 22 | /***/ "./src/main.js": 23 | /*!*********************!*\ 24 | !*** ./src/main.js ***! 25 | \*********************/ 26 | /***/ (function(module, __webpack_exports__, __webpack_require__) { 27 | 28 | "use strict"; 29 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var html_tag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! html-tag-js */ \"./node_modules/.pnpm/html-tag-js@1.1.41/node_modules/html-tag-js/dist/tag.js\");\n/* harmony import */ var html_tag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(html_tag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _plugin_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../plugin.json */ \"./plugin.json\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/style.scss\");\n/* harmony import */ var _icon_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./icon.css */ \"./src/icon.css\");\n/* harmony import */ var _customStyles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./customStyles.scss */ \"./src/customStyles.scss\");\n/* module decorator */ module = __webpack_require__.hmd(module);\n\nconst themes=acode.require(\"themes\");const ThemeBuilder=acode.require(\"themeBuilder\");const settings=acode.require(\"settings\");const sidebarApps=acode.require(\"sidebarApps\");const fileBrowser=acode.require(\"fileBrowser\");const toInternalUrl=acode.require(\"toInternalUrl\");const fs=acode.require(\"fsOperation\");const{editor}=editorManager;const editorThemeName=\"sweet-plasma\";const baseBgImgName=\"sweetplasma_bg_img.png\";ace.define(`ace/theme/${editorThemeName}.css`,[\"require\",\"exports\",\"module\"],function(require,exports,module){module.exports=_style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"];}),ace.define(`ace/theme/${editorThemeName}`,[\"require\",\"exports\",\"module\",`ace/theme/${editorThemeName}.css`,\"ace/lib/dom\"],function(require,exports,module){exports.isDark=!0,exports.cssClass=`ace-${editorThemeName}`,exports.cssText=require(`./${editorThemeName}.css`);const dom=require(\"../lib/dom\");dom.importCssString(exports.cssText,exports.cssClass,!1);});(function(){window.require([\"ace/theme/\"+editorThemeName],function(m){if( true&&typeof exports==\"object\"&&module){module.exports=m;}});})();class AcodePlugin{constructor(){if(!settings.value[_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id]){settings.value[_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id]={themeIcon:true,fileTabAnimation:true,floatingBtnAnimation:true,imageUrl:\"\",blurValue:\"4px\",transparency:\"0.4\",fancyAcode:true,fancyUniversalBlurValue:\"5px\",promptBlurValue:\"\",contextMenuBlurValue:\"\",paletteBlurValue:\"\",cursorMenuBlurValue:\"\",aceCompletionBlurValue:\"\"};settings.update(false);}}async init(){try{this.$iconsStyle=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"style\",{textContent:_icon_css__WEBPACK_IMPORTED_MODULE_3__[\"default\"],children:[],attr:{}});this.$customStyle=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"style\",{textContent:_customStyles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"],children:[],attr:{}});document.head.append(this.$iconsStyle,this.$customStyle);const sweetPlasma=new ThemeBuilder(\"Sweet Plasma\",\"dark\",\"free\");sweetPlasma.primaryColor=\"#1e1e2e\";sweetPlasma.darkenedPrimaryColor=\"#1A161F\";sweetPlasma.primaryTextColor=\"#FFFFFF\";sweetPlasma.secondaryColor=\"#222235\";sweetPlasma.secondaryTextColor=\"#D3D3D3\";sweetPlasma.activeColor=\"#BE93D4\";sweetPlasma.activeIconColor=\"#BE93D4\";sweetPlasma.linkTextColor=\"#7E57C2\";sweetPlasma.errorTextColor=\"#f60055\";sweetPlasma.borderColor=\"#3F3F54\";sweetPlasma.borderRadius=\"8px\";sweetPlasma.popupBorderRadius=\"6px\";sweetPlasma.popupIconColor=\"#FFFFFF\";sweetPlasma.popupBackgroundColor=\"#1e1e2e\";sweetPlasma.popupTextColor=\"#D3D3D3\";sweetPlasma.popupActiveColor=\"#7E57C2\";sweetPlasma.popupBorderColor=\"#9700be27\";sweetPlasma.boxShadowColor=\"rgba(0, 0, 0, 0.3)\";sweetPlasma.scrollbarColor=\"#ffffff12\";sweetPlasma.buttonActiveColor=\"#a160ed\";sweetPlasma.buttonBackgroundColor=\"#9700be\";sweetPlasma.buttonTextColor=\"#FFFFFF\";themes.add(sweetPlasma);/***********************\n * Sidebar\n ***********************/acode.addIcon(\"sweet-plasma\",this.baseUrl+\"icon.png\");sidebarApps.add(\"sweet-plasma\",\"sweet-plasma-sidebar\",\"SweetPlasma\",app=>{const plasmaContainer=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"div\",{className:\"plasma-container\"});const heading=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"h1\",{textContent:\"Add Image\"});const inputBox=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"div\",{className:\"input-box\"});const inputField=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"input\",{type:\"url\",id:\"image-url\",placeholder:\"Image url\",value:this.plugSettings.imageUrl?this.plugSettings.imageUrl:\"\"});inputField.addEventListener(\"keypress\",this.triggerEnterEvent.bind(this));const folderBtn=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"button\",{id:\"open-image-btn\"});folderBtn.innerHTML=``;folderBtn.addEventListener(\"click\",this.triggerFolderBtnEvent.bind(this));inputBox.append(inputField,folderBtn);const blurBox=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"div\",{className:\"blur-box\"});const blurLabel=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"label\",{textContent:\"Blur\",className:\"blur-input-lbl\"});const blurInputField=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"input\",{type:\"text\",id:\"blur-value\",value:this.plugSettings.blurValue?this.plugSettings.blurValue:\"4px\",placeholder:\"Blur value\"});blurInputField.addEventListener(\"keypress\",this.changeBlurValue.bind(this));blurBox.append(blurLabel,blurInputField);const transparencyBox=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"div\",{className:\"transparency-box\"});const transprancyLabel=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"label\",{textContent:\"Transparency\",className:\"transparency-input-lbl\"});const transparencyInputField=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"input\",{type:\"range\",id:\"transparency-value\",min:\"0\",max:\"1\",step:\"0.1\",value:this.plugSettings.transparency?this.plugSettings.transparency:\"0.4\"});transparencyInputField.addEventListener(\"input\",this.changeTransparencyValue.bind(this));const transparencyValueLbl=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"span\",{className:\"transparency-value-lbl\",textContent:this.plugSettings.transparency?this.plugSettings.transparency:\"0.4\"});transparencyBox.append(transprancyLabel,transparencyInputField,transparencyValueLbl);const removeImgBtn=html_tag_js__WEBPACK_IMPORTED_MODULE_0___default()(\"button\",{textContent:\"Remove\",id:\"remove-image-btn\"});removeImgBtn.addEventListener(\"click\",this.removeImg.bind(this));plasmaContainer.append(heading,inputBox,blurBox,transparencyBox,removeImgBtn);app.append(plasmaContainer);});ace.require(\"ace/ext/themelist\").themes.push({caption:editorThemeName.split(\"-\").map(name=>name[0].toUpperCase()+name.slice(1)).join(\" \"),theme:\"ace/theme/\"+editorThemeName,isDark:true});const acodeXController=acode.require(\"acodex\");if(acodeXController){const acodeXThemeNme=\"SweetPlasma\";const colorSchema={background:\"#222235\",foreground:\"#ffffff\",cursor:\"#ffffff\",cursorAccent:\"#00000000\",selectionBackground:\"#ffffff26\",black:\"#222235\",blue:\"#f69154\",brightBlack:\"#3F3F54\",brightBlue:\"#f69154\",brightCyan:\"#00dded\",brightGreen:\"#06c993\",brightMagenta:\"#ec89cb\",brightRed:\"#f60055\",brightWhite:\"#ffffff\",brightYellow:\"#9700be\",cyan:\"#00dded\",green:\"#06c993\",magenta:\"#ec89cb\",red:\"#f60055\",white:\"#ffffff\",yellow:\"#9700be\"};// Add theme\nacodeXController.addTheme(acodeXThemeNme,colorSchema);// Apply theme\n//acodeXController.applyTheme(acodeXThemeNme);\n}const currentTheme=settings.get(\"editorTheme\");if(currentTheme===editorThemeName)editor.setTheme(\"ace/theme/\"+editorThemeName);settings.on(\"update\",this.onThemeChange);if(!this.plugSettings.themeIcon){this.$iconsStyle.remove();}if(this.plugSettings.imageUrl){this.updateUiWithSettings();}if(this.plugSettings.fancyAcode){this.createFancyAcode();}this.onAnimationChange();}catch(error){acode.alert(\"Warning\",\"Please restart acode\");}}changeTransparencyValue(){const transparencyValue=document.querySelector(\"#transparency-value\").value;document.querySelector(\".transparency-value-lbl\").textContent=transparencyValue;this.plugSettings.transparency=transparencyValue;settings.update();this.updateUiWithSettings();}changeBlurValue(event){if(event.keyCode===13){const blurValue=document.querySelector(\"#blur-value\").value;if(!blurValue)return;this.plugSettings.blurValue=blurValue;settings.update();this.updateUiWithSettings();}}triggerEnterEvent(event){if(event.keyCode===13){const urlValue=document.querySelector(\"#image-url\").value;if(!urlValue)return;this.plugSettings.imageUrl=urlValue;settings.update();this.updateUiWithSettings();}}async triggerFolderBtnEvent(){// Create a hidden input element of type 'file'\nconst imageInput=document.createElement(\"input\");imageInput.type=\"file\";imageInput.accept=\"image/*\";imageInput.style.display=\"none\";const self=this;// Add an event listener for when a file is selected\nimageInput.addEventListener(\"change\",async function(){const selectedFile=imageInput.files[0];// Check if a file is selected\nif(selectedFile){// Read the selected file as a Data URI\nconst reader=new FileReader();reader.onload=async function(event){const imageDataURI=event.target.result;const blob=self.dataURItoBlob(imageDataURI);const bgImg=fs(window.DATA_STORAGE+baseBgImgName);if(await bgImg.exists()){await bgImg.delete();await fs(window.DATA_STORAGE).createFile(baseBgImgName,blob);}else{await fs(window.DATA_STORAGE).createFile(baseBgImgName,blob);}const urlOfImage=await toInternalUrl(window.DATA_STORAGE+baseBgImgName);document.querySelector(\"#image-url\").value=urlOfImage?urlOfImage:imageDataURI;self.plugSettings.imageUrl=urlOfImage?urlOfImage:imageDataURI;settings.update();self.updateUiWithSettings();};reader.readAsDataURL(selectedFile);}// Remove the input element from the DOM\ndocument.body.removeChild(imageInput);});// Append the input element to the document body\ndocument.body.appendChild(imageInput);// Trigger a click event on the hidden file input to open the file selection dialog\nimageInput.click();}dataURItoBlob(dataURI){var byteString=atob(dataURI.split(\",\")[1]);var mimeString=dataURI.split(\",\")[0].split(\":\")[1].split(\";\")[0];var ab=new ArrayBuffer(byteString.length);var ia=new Uint8Array(ab);for(var i=0;i{this.plugSettings[key]=value;settings.update();if(this.plugSettings.themeIcon){document.head.append(this.$iconsStyle);}else{this.$iconsStyle.remove();}if(this.plugSettings.fancyAcode){this.createFancyAcode();}else{document.querySelector(\".fancyAcodeStyles\").remove();}acode.alert(\"Warning\",\"Please restart acode\");}};}get plugSettings(){return settings.value[_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id];}async destroy(){sidebarApps.remove(\"sweet-plasma-sidebar\");settings.off(\"update\",this.onThemeChange);this.$iconsStyle.remove();this.$customStyle.remove();document.querySelector(\".fancyAcodeStyles\").remove();delete settings.value[_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id];settings.update(true);}}if(window.acode){const acodePlugin=new AcodePlugin();acode.setPluginInit(_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id,async(baseUrl,$page,_ref)=>{let{cacheFileUrl,cacheFile}=_ref;if(!baseUrl.endsWith(\"/\")){baseUrl+=\"/\";}acodePlugin.baseUrl=baseUrl;await acodePlugin.init($page,cacheFile,cacheFileUrl);},acodePlugin.settingsObj);acode.setPluginUnmount(_plugin_json__WEBPACK_IMPORTED_MODULE_1__.id,()=>{acodePlugin.destroy();});}\n\n//# sourceURL=webpack://acode-plugin/./src/main.js?"); 30 | 31 | /***/ }), 32 | 33 | /***/ "./src/customStyles.scss": 34 | /*!*******************************!*\ 35 | !*** ./src/customStyles.scss ***! 36 | \*******************************/ 37 | /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 38 | 39 | "use strict"; 40 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (\"root {\\n --floating-btn-animation: \\\"steam 20s linear infinite\\\";\\n --open-filelist-animation: \\\"changeColor 5s infinite alternate,glowingEffect 2s infinite alternate\\\";\\n}\\n\\n.open-file-list {\\n box-shadow: 0 3px 5px #1e1e2e;\\n}\\n\\n.open-file-list li.tile.active {\\n border-top: 2px solid #9700be;\\n -o-border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 1;\\n border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 1;\\n border-image-slice: 1;\\n animation: var(--open-filelist-animation);\\n}\\n\\n@keyframes changeColor {\\n 0% {\\n -o-border-image: linear-gradient(to right, #f60055, #9f6) 1;\\n border-image: linear-gradient(to right, #f60055, #9f6) 1;\\n }\\n 50% {\\n -o-border-image: linear-gradient(to right, #9700be, #ec89cb) 1;\\n border-image: linear-gradient(to right, #9700be, #ec89cb) 1;\\n }\\n 100% {\\n -o-border-image: linear-gradient(to right, #f60, #f96) 1;\\n border-image: linear-gradient(to right, #f60, #f96) 1;\\n }\\n}\\n@keyframes glowingEffect {\\n 0%, 100% {\\n box-shadow: 0 0 10px #9700be;\\n }\\n 50% {\\n box-shadow: 0 0 20px #9700be;\\n }\\n}\\n/*****\\nFloating icon\\n*****/\\nspan#quicktools-toggler .no_animation {\\n -o-border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 1;\\n border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 1;\\n border-image-slice: 1;\\n border-radius: 50%;\\n}\\nspan#quicktools-toggler:before {\\n background-color: var(--primary-color);\\n height: 100%;\\n width: 100%;\\n display: grid;\\n place-items: center;\\n border-radius: inherit;\\n}\\nspan#quicktools-toggler:after {\\n content: \\\"\\\";\\n position: absolute;\\n inset: -4px !important;\\n background: linear-gradient(45deg, #ec89cb, blue, #9700be, #f60055, #ec89cb, blue, #9700be, #f60055);\\n z-index: -1;\\n border-radius: inherit;\\n background-size: 400%;\\n filter: blur(10px);\\n animation: var(--floating-btn-animation);\\n}\\n\\n@keyframes steam {\\n 0% {\\n background-position: 0 0;\\n }\\n 50% {\\n background-position: 400% 0;\\n }\\n 100% {\\n background-position: 0 0;\\n }\\n}\\n/*****************\\n Sidebar styles\\n*****************/\\n.plasma-container {\\n padding: 0 5px;\\n text-align: center;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n margin: 0;\\n box-sizing: border-box;\\n width: 100%;\\n}\\n.plasma-container h1 {\\n font-size: 18px;\\n margin-bottom: 10px;\\n}\\n.plasma-container .input-box {\\n display: flex;\\n align-items: center;\\n height: 40px;\\n margin-bottom: 15px;\\n}\\n.plasma-container .input-box #image-url {\\n padding: 5px;\\n flex-grow: 1;\\n height: 100%;\\n border: 1px solid;\\n}\\n.plasma-container .input-box #open-image-btn {\\n background-color: var(--popup-border-color);\\n color: var(--primary-text-color);\\n border: 1px solid var(--border-color);\\n padding: 5px 10px;\\n border-radius: 3px;\\n margin-left: 3px;\\n margin-bottom: 10px;\\n cursor: pointer;\\n transition: border 0.3s ease;\\n height: 100%;\\n}\\n.plasma-container .input-box #open-image-btn:hover {\\n border: 1px dashed var(--border-color);\\n}\\n.plasma-container .blur-box {\\n display: flex;\\n flex-direction: column;\\n height: 40px;\\n margin-bottom: 15px;\\n}\\n.plasma-container .blur-box .blur-input-lbl {\\n font-size: 13px;\\n color: var(--primary-text-color);\\n margin-bottom: 5px;\\n text-align: left;\\n}\\n.plasma-container .blur-box #blur-value {\\n padding: 5px;\\n height: 100%;\\n width: 100%;\\n outline: none;\\n transition: 0.3s;\\n border: 1px solid;\\n font-size: 16px;\\n}\\n.plasma-container .transparency-box {\\n display: flex;\\n flex-direction: column;\\n margin-bottom: 15px;\\n margin-top: 10px;\\n width: 100%;\\n height: 50px;\\n}\\n.plasma-container .transparency-box .transparency-input-lbl {\\n font-size: 13px;\\n margin-bottom: 5px;\\n text-align: left;\\n}\\n.plasma-container .transparency-box #transparency-value {\\n width: 100%;\\n height: 10px;\\n border-radius: 5px;\\n}\\n.plasma-container .transparency-box .transparency-value-lbl {\\n font-size: 10px;\\n}\\n.plasma-container #remove-image-btn {\\n background-color: var(--error-text-color);\\n color: var(--primary-text-color);\\n border: none;\\n padding: 8px 12px;\\n border-radius: 5px;\\n cursor: pointer;\\n transition: transform 0.2s ease;\\n}\\n.plasma-container #remove-image-btn:hover {\\n transform: scale(1.1);\\n}\");\n\n//# sourceURL=webpack://acode-plugin/./src/customStyles.scss?"); 41 | 42 | /***/ }), 43 | 44 | /***/ "./src/icon.css": 45 | /*!**********************!*\ 46 | !*** ./src/icon.css ***! 47 | \**********************/ 48 | /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 49 | 50 | "use strict"; 51 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (\"/****\\nFolder icons\\n****/\\n.icon.folder:before {\\n display: inline-block;\\n content: \\\"\\\";\\n background-image: url(\\\"https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder_dark.svg\\\");\\n background-size: contain;\\n background-repeat: no-repeat;\\n height: 1em;\\n width: 1em;\\n}\\n\\n.list.collapsible.hidden .tile .icon.folder:before {\\n display: inline-block;\\n content: \\\"\\\";\\n color: transparent;\\n background-image: url(\\\"https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder_dark.svg\\\");\\n background-size: contain;\\n background-repeat: no-repeat;\\n height: 1em;\\n width: 1em;\\n}\\n\\n.list.collapsible .tile .icon.folder:before {\\n display: inline-block;\\n content: \\\"\\\";\\n background-image: url(\\\"https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder-open_dark.svg\\\");\\n background-size: contain;\\n background-repeat: no-repeat;\\n height: 1em;\\n width: 1em;\\n}\\n\\n.context-menu .folder:before {\\n content: \\\"\\\\e92a\\\";\\n background: transparent;\\n}\\n\\n.file_type_image:before {\\n display: inline-block;\\n content: \\\"\\\";\\n background-image: url(\\\"https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/image_light.svg\\\");\\n background-size: contain;\\n background-repeat: no-repeat;\\n height: 1em;\\n width: 1em;\\n}\");\n\n//# sourceURL=webpack://acode-plugin/./src/icon.css?"); 52 | 53 | /***/ }), 54 | 55 | /***/ "./src/style.scss": 56 | /*!************************!*\ 57 | !*** ./src/style.scss ***! 58 | \************************/ 59 | /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 60 | 61 | "use strict"; 62 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (\"/***\\n .ace-sweet-plasma\\n ***/\\n.ace-sweet-plasma {\\n color: #ffffff;\\n background-color: #1e1e2e;\\n /**\\n * keywords\\n * for example if else \\n * ID in css\\n */\\n /**\\n * Don't change indent guide \\n */\\n /**\\n * All the highlight rules bellow require extra syntax highlight plugin\\n **/\\n}\\n.ace-sweet-plasma .ace_gutter {\\n color: #808080;\\n background-color: #1e1e2e;\\n}\\n.ace-sweet-plasma .ace_gutter-active-line {\\n font-weight: 700;\\n color: #efdc35;\\n}\\n.ace-sweet-plasma .ace_print-margin {\\n width: 1px;\\n background: #2d363f;\\n}\\n.ace-sweet-plasma .ace_cursor {\\n background: rgba(0, 0, 0, 0);\\n color: #ffffff;\\n}\\n.ace-sweet-plasma .ace_marker-layer .ace_selection {\\n background: #87879F;\\n border-radius: 4px;\\n font-style: italic;\\n}\\n.ace-sweet-plasma .ace_multiselect .ace_selection.ace_start {\\n box-shadow: 0 0 3px black;\\n}\\n.ace-sweet-plasma .ace_marker-layer .ace_step {\\n background: rgb(198, 219, 174);\\n}\\n.ace-sweet-plasma .ace_marker-layer .ace_bracket {\\n margin: -1px 0 0 -1px;\\n border: 1px solid #3f3f54;\\n}\\n.ace-sweet-plasma .ace_marker-layer .ace_active-line {\\n border: 1px solid rgba(0, 0, 0, 0);\\n box-sizing: border-box;\\n background: rgba(255, 255, 255, 0.0470588235);\\n}\\n.ace-sweet-plasma .ace_marker-layer .ace_selected-word {\\n background-color: #3f3f54;\\n border: 1px solid #9700be;\\n}\\n.ace-sweet-plasma .ace_invisible {\\n color: #52524d;\\n}\\n.ace-sweet-plasma .hljs-keyword,\\n.ace-sweet-plasma .ace_keyword {\\n color: #f60055;\\n}\\n.ace-sweet-plasma .ace_keyword.ace_operator {\\n color: #f69154;\\n}\\n.ace-sweet-plasma .ace_constant.ace_language {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .ace_constant.ace_numeric {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .ace_constant.ace_character {\\n color: #bd93f9;\\n}\\n.ace-sweet-plasma .ace_constant.ace_character.ace_escape {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .ace_constant.ace_other {\\n color: #ffffff;\\n}\\n.ace-sweet-plasma .hljs-title,\\n.ace-sweet-plasma .ace_identifier {\\n color: #ffffff;\\n}\\n.ace-sweet-plasma .ace_support.ace_function {\\n color: #06c993;\\n}\\n.ace-sweet-plasma .ace_support.ace_function.ace_dom {\\n color: #00dded;\\n}\\n.ace-sweet-plasma .ace_support.ace_constant {\\n color: #bd93f9;\\n}\\n.ace-sweet-plasma .ace_class {\\n color: #00dded;\\n}\\n.ace-sweet-plasma .ace_variable.ace_language {\\n color: #efdc35;\\n}\\n.ace-sweet-plasma .ace_support.ace_type {\\n color: #00dded;\\n}\\n.ace-sweet-plasma .ace_meta.ace_tag {\\n color: #f60055;\\n}\\n.ace-sweet-plasma .ace_storage {\\n font-style: \\\"italic\\\";\\n color: #f60055;\\n}\\n.ace-sweet-plasma .ace_storage.ace_type {\\n color: #00dded;\\n}\\n.ace-sweet-plasma .ace_invalid {\\n color: #f8f8f0;\\n background-color: #ff79c6;\\n}\\n.ace-sweet-plasma .ace_invalid.ace_deprecated {\\n color: #f8f8f0;\\n background-color: #bd93f9;\\n}\\n.ace-sweet-plasma .ace_string {\\n color: #c95ae5;\\n}\\n.ace-sweet-plasma .ace_comment {\\n color: #5F5F7F;\\n}\\n.ace-sweet-plasma .ace_variable {\\n color: #efdc35;\\n}\\n.ace-sweet-plasma .ace_constant {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .hljs-params,\\n.ace-sweet-plasma .ace_variable.ace_parameter {\\n color: #f69154;\\n}\\n.ace-sweet-plasma .ace_entity.ace_other.ace_attribute-name {\\n color: #00dded;\\n}\\n.ace-sweet-plasma .ace_xml-pe.ace_xml,\\n.ace-sweet-plasma .ace_punctuation.ace_tag {\\n color: #f69154;\\n}\\n.ace-sweet-plasma .ace_tag-name.ace_tag,\\n.ace-sweet-plasma .ace_entity.ace_name.ace_tag {\\n color: #f60055;\\n}\\n.ace-sweet-plasma .ace_paren {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .ace_indent-guide {\\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) right repeat-y;\\n}\\n.ace-sweet-plasma .ace_indent-guide-active {\\n background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) right repeat-y;\\n}\\n.ace-sweet-plasma .ace_support.ace_constant.ace_js {\\n color: #f69154;\\n}\\n.ace-sweet-plasma .ace_entity.ace_name.ace_function {\\n color: #ec89cb;\\n}\\n.ace-sweet-plasma .ace_support.ace_constant.ace_css-in-js {\\n color: #9700be;\\n}\");\n\n//# sourceURL=webpack://acode-plugin/./src/style.scss?"); 63 | 64 | /***/ }), 65 | 66 | /***/ "./plugin.json": 67 | /*!*********************!*\ 68 | !*** ./plugin.json ***! 69 | \*********************/ 70 | /***/ (function(module) { 71 | 72 | "use strict"; 73 | eval("module.exports = JSON.parse('{\"id\":\"bajrangcoder.sweet\",\"name\":\"SweetPlasma\",\"main\":\"dist/main.js\",\"version\":\"1.0.5\",\"readme\":\"readme.md\",\"icon\":\"icon.png\",\"files\":[],\"minVersionCode\":290,\"price\":0,\"author\":{\"name\":\"Raunak Raj\",\"email\":\"bajrangcoders@gmail.com\",\"github\":\"bajrangCoder\"}}');\n\n//# sourceURL=webpack://acode-plugin/./plugin.json?"); 74 | 75 | /***/ }) 76 | 77 | /******/ }); 78 | /************************************************************************/ 79 | /******/ // The module cache 80 | /******/ var __webpack_module_cache__ = {}; 81 | /******/ 82 | /******/ // The require function 83 | /******/ function __webpack_require__(moduleId) { 84 | /******/ // Check if module is in cache 85 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 86 | /******/ if (cachedModule !== undefined) { 87 | /******/ return cachedModule.exports; 88 | /******/ } 89 | /******/ // Create a new module (and put it into the cache) 90 | /******/ var module = __webpack_module_cache__[moduleId] = { 91 | /******/ id: moduleId, 92 | /******/ loaded: false, 93 | /******/ exports: {} 94 | /******/ }; 95 | /******/ 96 | /******/ // Execute the module function 97 | /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 98 | /******/ 99 | /******/ // Flag the module as loaded 100 | /******/ module.loaded = true; 101 | /******/ 102 | /******/ // Return the exports of the module 103 | /******/ return module.exports; 104 | /******/ } 105 | /******/ 106 | /************************************************************************/ 107 | /******/ /* webpack/runtime/compat get default export */ 108 | /******/ !function() { 109 | /******/ // getDefaultExport function for compatibility with non-harmony modules 110 | /******/ __webpack_require__.n = function(module) { 111 | /******/ var getter = module && module.__esModule ? 112 | /******/ function() { return module['default']; } : 113 | /******/ function() { return module; }; 114 | /******/ __webpack_require__.d(getter, { a: getter }); 115 | /******/ return getter; 116 | /******/ }; 117 | /******/ }(); 118 | /******/ 119 | /******/ /* webpack/runtime/define property getters */ 120 | /******/ !function() { 121 | /******/ // define getter functions for harmony exports 122 | /******/ __webpack_require__.d = function(exports, definition) { 123 | /******/ for(var key in definition) { 124 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 125 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 126 | /******/ } 127 | /******/ } 128 | /******/ }; 129 | /******/ }(); 130 | /******/ 131 | /******/ /* webpack/runtime/harmony module decorator */ 132 | /******/ !function() { 133 | /******/ __webpack_require__.hmd = function(module) { 134 | /******/ module = Object.create(module); 135 | /******/ if (!module.children) module.children = []; 136 | /******/ Object.defineProperty(module, 'exports', { 137 | /******/ enumerable: true, 138 | /******/ set: function() { 139 | /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id); 140 | /******/ } 141 | /******/ }); 142 | /******/ return module; 143 | /******/ }; 144 | /******/ }(); 145 | /******/ 146 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 147 | /******/ !function() { 148 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 149 | /******/ }(); 150 | /******/ 151 | /******/ /* webpack/runtime/make namespace object */ 152 | /******/ !function() { 153 | /******/ // define __esModule on exports 154 | /******/ __webpack_require__.r = function(exports) { 155 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 156 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 157 | /******/ } 158 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 159 | /******/ }; 160 | /******/ }(); 161 | /******/ 162 | /************************************************************************/ 163 | /******/ 164 | /******/ // startup 165 | /******/ // Load entry module and return exports 166 | /******/ // This entry module is referenced by other modules so it can't be inlined 167 | /******/ var __webpack_exports__ = __webpack_require__("./src/main.js"); 168 | /******/ 169 | /******/ })() 170 | ; -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bajrangCoder/SweetPlasma/ecf8e0137a70e439c061c3603ed5dbacbb4845b3/icon.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "acode-plugin", 3 | "version": "1.0.4", 4 | "description": "Template for Acode plugin", 5 | "main": "dist/main.js", 6 | "repository": "https://github.com/deadlyjack/acode-plugin.git", 7 | "author": "Ajit ", 8 | "license": "MIT", 9 | "dependencies": { 10 | "html-tag-js": "^1.1.22", 11 | "postcss": "^8.4.27", 12 | "postcss-loader": "^7.3.3", 13 | "raw-loader": "^4.0.2", 14 | "sass": "^1.65.1", 15 | "sass-loader": "^13.3.2", 16 | "autoprefixer": "^10.4.14" 17 | }, 18 | "devDependencies": { 19 | "@babel/cli": "^7.18.10", 20 | "@babel/core": "^7.18.13", 21 | "@babel/plugin-transform-runtime": "^7.19.6", 22 | "@babel/preset-env": "^7.18.10", 23 | "babel-loader": "^9.1.0", 24 | "jszip": "^3.10.1", 25 | "live-server": "^1.2.2", 26 | "webpack": "^5.76.0", 27 | "webpack-cli": "^5.0.0" 28 | }, 29 | "scripts": { 30 | "build": "webpack", 31 | "build-release": "webpack --mode production", 32 | "start-dev": "node .vscode/start-dev" 33 | }, 34 | "browserslist": [ 35 | "> 0.25%, not dead" 36 | ], 37 | "resolutions": { 38 | "terser": ">=5.14.2 ", 39 | "glob-parent": ">=5.1.2" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /plugin.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "bajrangcoder.sweet", 3 | "name": "SweetPlasma", 4 | "main": "dist/main.js", 5 | "version": "1.0.5", 6 | "readme": "readme.md", 7 | "icon": "icon.png", 8 | "files": [], 9 | "minVersionCode": 290, 10 | "price": 0, 11 | "author": { 12 | "name": "Raunak Raj", 13 | "email": "bajrangcoders@gmail.com", 14 | "github": "bajrangCoder" 15 | } 16 | } -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | require('autoprefixer')({}) 4 | ] 5 | }; -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # SweetPlasma 2 | 3 | A feature-rich theme plugin for Acode inspired by the aesthetics of Linux KDE Plasma theme. Enhance your Acode experience with customizable app themes, editor and folder icons, and delightful animations. 4 | 5 | > Developed by [Raunak Raj](https://github.com/bajrangCoder) 6 | 7 | Buy Me A Coffee 8 | 9 |
10 | Updates 11 |
12 | v1.0.4 & v1.0.5 13 |

fixed editor background image issue

14 |

added transparent and gauzy blur effect to different acode components such as popup boxes, context menu, command palette, etc

15 |

1.0.5 : fixed gutter bug

16 |
17 |
18 | v1.0.2 & v1.0.3 19 |

Added ability to add background image in your Editor and theme for acodex

20 |

Fixed bugs

21 |
22 |
23 | v1.0.1 24 |

Improved Editor theme

25 |
26 |
27 | 28 | 29 | ## Features 30 | 31 | - **App Theme** 32 | - **Editor Theme**: A beautiful editor theme based on same app color schema. 33 | - **Sidebar Folder Icons**: Add beautiful candy folder icon to match app color schema. 34 | - **Fancy Animations**: Adds some smooth rgb animation on floating button and file tab bar 35 | - **Gausy Blury and Transparent Effect**: add transparent and blury effect inside your Editor, It will really give gorgeous look 😍 36 | 37 | ## TODO 38 | 39 | - [X] Add same app color schema to Acode terminal plugin, AcodeX 40 | 41 | - [X] Add the ability to set custom images as the background of the Acode app. 42 | 43 | ## Bug Reports 44 | 45 | If you encounter any bugs or issues while using the SweetPlasma plugin, please report them to our [GitHub repository](https://github.com/bajrangCoder/SweetPlasma). 46 | 47 | ## Contribution 48 | 49 | We welcome contributions from the community to enhance and improve the SweetPlasma plugin. If you'd like to contribute, please follow these steps: 50 | 51 | 1. Fork the [SweetPlasma repository](https://github.com/bajrangCoder/SweetPlasma). 52 | 2. Make your changes and improvements. 53 | 3. Submit a pull request outlining your changes. 54 | 55 | ## Documentation 56 | 57 | ### Installation 58 | 59 | 1. Install the SweetPlasma plugin from the Acode plugin Store(Acode>Settings>Plugins>SweetPlasma). 60 | 2. Read Usage section 61 | 62 | ### Usage 63 | 64 | - **App Theme:** Open Acode settings, navigate to the Theme section, and choose SweetPlasma as your app theme. 65 | - **Editor Theme:** Select from Acode>Settings>Theme>Editor>SweetPlasma. 66 | - **Folder Icons:** Enable or disable custom folder icons by toggling the option in the SweetPlasma settings. 67 | - **Animations:** Enjoy the subtle animations that SweetPlasma brings to your Acode experience. 68 | 69 | **Note:** To fully experience the SweetPlasma folder icons, it's recommended to disable other folder icon packs. 70 | 71 | ### How to add transparent effect or background image in your editor? 72 | 73 | - Open side bar > Select `SweetPlasma Logo` 74 | - and it will open wizard to add image in your editor 75 | - In `Image Url field`, you can paste any image url from internet or if you want image from your internal storage 76 | - then click small `Folder icon` and select any image. 77 | - You can also customise blur value and Transparency using blur input box and transparency slider. 78 | - Note: Blur effect value should be in `px` for eg: `5px` and press enter to save the value 79 | - For removing image from editor background, press `Remove` button and restart the app 80 | 81 | ### How to give different blur value to different acode components? 82 | 83 | - Open `settings.json` file (from Settings>Edit Settings.json file option) 84 | - and search for `bajrangcoder.sweet` inside the settings.json file and edit the values 85 | 86 | ### How to disable animation? 87 | 88 | To disable animation open SweetPlasma plugin page and on top right corner you will get a ⚙️ , Press it and it will open Settings page , From here you can disable. 89 | 90 | ### How to disable Fancy Design? 91 | 92 | To disable fancy design, open SweetPlasma plugin page and on top right corner you will get a ⚙️ , Press it and it will open Settings page , From here you can uncheck `Fancy Acode` option. 93 | 94 | 95 | ## Warning 96 | 97 | Disabling other folder icon packs is recommended to avoid conflicts and ensure a seamless integration of SweetPlasma's custom folder icons. 98 | 99 | We hope you enjoy using the SweetPlasma plugin to personalize and enhance your Acode environment. If you have any questions or suggestions, feel free to reach out to us through our [Repository](https://github.com/bajrangCoder/SweetPlasma). 100 | -------------------------------------------------------------------------------- /src/customStyles.scss: -------------------------------------------------------------------------------- 1 | root { 2 | --floating-btn-animation: "steam 20s linear infinite"; 3 | --open-filelist-animation: "changeColor 5s infinite alternate,glowingEffect 2s infinite alternate"; 4 | } 5 | 6 | .open-file-list { 7 | box-shadow: 0 3px 5px #1e1e2e; 8 | } 9 | 10 | .open-file-list li.tile.active { 11 | border-top: 2px solid #9700be; 12 | border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 1; 13 | border-image-slice: 1; 14 | animation: var(--open-filelist-animation); 15 | } 16 | 17 | @keyframes changeColor { 18 | 0% { 19 | border-image: linear-gradient(to right, #f60055, #9f6) 1; 20 | } 21 | 50% { 22 | border-image: linear-gradient(to right, #9700be, #ec89cb) 1; 23 | } 24 | 100% { 25 | border-image: linear-gradient(to right, #f60, #f96) 1; 26 | } 27 | } 28 | @keyframes glowingEffect { 29 | 0%, 30 | 100% { 31 | box-shadow: 0 0 10px #9700be; 32 | } 33 | 50% { 34 | box-shadow: 0 0 20px #9700be; 35 | } 36 | } 37 | 38 | /***** 39 | Floating icon 40 | *****/ 41 | span#quicktools-toggler { 42 | .no_animation { 43 | border-image: linear-gradient(45deg, #ec89cb, #9700be, #ec89cb, #9700be) 44 | 1; 45 | border-image-slice: 1; 46 | border-radius: 50%; 47 | } 48 | &:before { 49 | background-color: var(--primary-color); 50 | height: 100%; 51 | width: 100%; 52 | display: grid; 53 | place-items: center; 54 | border-radius: inherit; 55 | } 56 | &:after { 57 | content: ""; 58 | position: absolute; 59 | inset: -4px !important; 60 | background: linear-gradient( 61 | 45deg, 62 | #ec89cb, 63 | blue, 64 | #9700be, 65 | #f60055, 66 | #ec89cb, 67 | blue, 68 | #9700be, 69 | #f60055 70 | ); 71 | z-index: -1; 72 | border-radius: inherit; 73 | background-size: 400%; 74 | filter: blur(10px); 75 | animation: var(--floating-btn-animation); 76 | } 77 | } 78 | @keyframes steam { 79 | 0% { 80 | background-position: 0 0; 81 | } 82 | 50% { 83 | background-position: 400% 0; 84 | } 85 | 100% { 86 | background-position: 0 0; 87 | } 88 | } 89 | 90 | /***************** 91 | Sidebar styles 92 | *****************/ 93 | .plasma-container { 94 | padding: 0 5px; 95 | text-align: center; 96 | display: flex; 97 | flex-direction: column; 98 | align-items: center; 99 | margin: 0; 100 | box-sizing: border-box; 101 | width: 100%; 102 | h1 { 103 | font-size: 18px; 104 | margin-bottom: 10px; 105 | } 106 | .input-box { 107 | display: flex; 108 | align-items: center; 109 | height: 40px; 110 | margin-bottom: 15px; 111 | #image-url { 112 | padding: 5px; 113 | flex-grow: 1; 114 | height: 100%; 115 | border: 1px solid; 116 | } 117 | #open-image-btn { 118 | background-color: var(--popup-border-color); 119 | color: var(--primary-text-color); 120 | border: 1px solid var(--border-color); 121 | padding: 5px 10px; 122 | border-radius: 3px; 123 | margin-left: 3px; 124 | margin-bottom: 10px; 125 | cursor: pointer; 126 | transition: border 0.3s ease; 127 | height: 100%; 128 | &:hover { 129 | border: 1px dashed var(--border-color); 130 | } 131 | } 132 | } 133 | .blur-box { 134 | display: flex; 135 | flex-direction: column; 136 | height: 40px; 137 | margin-bottom: 15px; 138 | .blur-input-lbl { 139 | font-size: 13px; 140 | color: var(--primary-text-color); 141 | margin-bottom: 5px; 142 | text-align: left; 143 | } 144 | #blur-value { 145 | padding: 5px; 146 | height: 100%; 147 | width: 100%; 148 | outline: none; 149 | transition: 0.3s; 150 | border: 1px solid; 151 | font-size: 16px; 152 | } 153 | } 154 | .transparency-box { 155 | display: flex; 156 | flex-direction: column; 157 | margin-bottom: 15px; 158 | margin-top: 10px; 159 | width: 100%; 160 | height: 50px; 161 | .transparency-input-lbl{ 162 | font-size: 13px; 163 | margin-bottom: 5px; 164 | text-align: left; 165 | } 166 | #transparency-value{ 167 | width: 100%; 168 | height: 10px; 169 | border-radius: 5px; 170 | } 171 | .transparency-value-lbl{ 172 | font-size: 10px; 173 | } 174 | } 175 | #remove-image-btn { 176 | background-color: var(--error-text-color); 177 | color: var(--primary-text-color); 178 | border: none; 179 | padding: 8px 12px; 180 | border-radius: 5px; 181 | cursor: pointer; 182 | transition: transform 0.2s ease; 183 | &:hover { 184 | transform: scale(1.1); 185 | } 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /src/icon.css: -------------------------------------------------------------------------------- 1 | /**** 2 | Folder icons 3 | ****/ 4 | 5 | .icon.folder:before { 6 | display: inline-block; 7 | content: ""; 8 | background-image: url("https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder_dark.svg"); 9 | background-size: contain; 10 | background-repeat: no-repeat; 11 | height: 1em; 12 | width: 1em; 13 | } 14 | .list.collapsible.hidden .tile .icon.folder:before { 15 | display: inline-block; 16 | content: ""; 17 | color: transparent; 18 | background-image: url("https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder_dark.svg"); 19 | background-size: contain; 20 | background-repeat: no-repeat; 21 | height: 1em; 22 | width: 1em; 23 | } 24 | .list.collapsible .tile .icon.folder:before { 25 | display: inline-block; 26 | content: ""; 27 | background-image: url("https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/folder-open_dark.svg"); 28 | background-size: contain; 29 | background-repeat: no-repeat; 30 | height: 1em; 31 | width: 1em; 32 | } 33 | .context-menu .folder:before { 34 | content: "\e92a"; 35 | background: transparent; 36 | } 37 | .file_type_image:before { 38 | display: inline-block; 39 | content: ""; 40 | background-image: url("https://localhost/__cdvfile_files-external__/plugins/bajrangcoder.sweet/image_light.svg"); 41 | background-size: contain; 42 | background-repeat: no-repeat; 43 | height: 1em; 44 | width: 1em; 45 | } -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import plugin from "../plugin.json"; 2 | import style from "./style.scss"; 3 | import icons from "./icon.css"; 4 | import customStyle from "./customStyles.scss"; 5 | const themes = acode.require("themes"); 6 | const ThemeBuilder = acode.require("themeBuilder"); 7 | const settings = acode.require("settings"); 8 | const sidebarApps = acode.require("sidebarApps"); 9 | const fileBrowser = acode.require("fileBrowser"); 10 | const toInternalUrl = acode.require("toInternalUrl"); 11 | const fs = acode.require("fsOperation"); 12 | const { editor } = editorManager; 13 | const editorThemeName = "sweet-plasma"; 14 | const baseBgImgName = "sweetplasma_bg_img.png"; 15 | 16 | ace.define( 17 | `ace/theme/${editorThemeName}.css`, 18 | ["require", "exports", "module"], 19 | function (require, exports, module) { 20 | module.exports = style; 21 | } 22 | ), 23 | ace.define( 24 | `ace/theme/${editorThemeName}`, 25 | [ 26 | "require", 27 | "exports", 28 | "module", 29 | `ace/theme/${editorThemeName}.css`, 30 | "ace/lib/dom" 31 | ], 32 | function (require, exports, module) { 33 | (exports.isDark = !0), 34 | (exports.cssClass = `ace-${editorThemeName}`), 35 | (exports.cssText = require(`./${editorThemeName}.css`)); 36 | const dom = require("../lib/dom"); 37 | dom.importCssString(exports.cssText, exports.cssClass, !1); 38 | } 39 | ); 40 | (function () { 41 | window.require(["ace/theme/" + editorThemeName], function (m) { 42 | if (typeof module == "object" && typeof exports == "object" && module) { 43 | module.exports = m; 44 | } 45 | }); 46 | })(); 47 | 48 | class AcodePlugin { 49 | constructor() { 50 | if (!settings.value[plugin.id]) { 51 | settings.value[plugin.id] = { 52 | themeIcon: true, 53 | fileTabAnimation: true, 54 | floatingBtnAnimation: true, 55 | imageUrl: "", 56 | blurValue: "4px", 57 | transparency: "0.4", 58 | fancyAcode: true, 59 | fancyUniversalBlurValue: "5px", 60 | promptBlurValue: "", 61 | contextMenuBlurValue: "", 62 | paletteBlurValue: "", 63 | cursorMenuBlurValue: "", 64 | aceCompletionBlurValue: "" 65 | }; 66 | settings.update(false); 67 | } 68 | } 69 | 70 | async init() { 71 | try { 72 | this.$iconsStyle = ; 73 | this.$customStyle = ; 74 | document.head.append(this.$iconsStyle, this.$customStyle); 75 | const sweetPlasma = new ThemeBuilder( 76 | "Sweet Plasma", 77 | "dark", 78 | "free" 79 | ); 80 | sweetPlasma.primaryColor = "#1e1e2e"; 81 | sweetPlasma.darkenedPrimaryColor = "#1A161F"; 82 | sweetPlasma.primaryTextColor = "#FFFFFF"; 83 | sweetPlasma.secondaryColor = "#222235"; 84 | sweetPlasma.secondaryTextColor = "#D3D3D3"; 85 | sweetPlasma.activeColor = "#BE93D4"; 86 | sweetPlasma.activeIconColor = "#BE93D4"; 87 | sweetPlasma.linkTextColor = "#7E57C2"; 88 | sweetPlasma.errorTextColor = "#f60055"; 89 | sweetPlasma.borderColor = "#3F3F54"; 90 | sweetPlasma.borderRadius = "8px"; 91 | sweetPlasma.popupBorderRadius = "6px"; 92 | sweetPlasma.popupIconColor = "#FFFFFF"; 93 | sweetPlasma.popupBackgroundColor = "#1e1e2e"; 94 | sweetPlasma.popupTextColor = "#D3D3D3"; 95 | sweetPlasma.popupActiveColor = "#7E57C2"; 96 | sweetPlasma.popupBorderColor = "#9700be27"; 97 | sweetPlasma.boxShadowColor = "rgba(0, 0, 0, 0.3)"; 98 | sweetPlasma.scrollbarColor = "#ffffff12"; 99 | sweetPlasma.buttonActiveColor = "#a160ed"; 100 | sweetPlasma.buttonBackgroundColor = "#9700be"; 101 | sweetPlasma.buttonTextColor = "#FFFFFF"; 102 | themes.add(sweetPlasma); 103 | 104 | /*********************** 105 | * Sidebar 106 | ***********************/ 107 | acode.addIcon("sweet-plasma", this.baseUrl + "icon.png"); 108 | sidebarApps.add( 109 | "sweet-plasma", 110 | "sweet-plasma-sidebar", 111 | "SweetPlasma", 112 | app => { 113 | const plasmaContainer = tag("div", { 114 | className: "plasma-container" 115 | }); 116 | const heading = tag("h1", { 117 | textContent: "Add Image" 118 | }); 119 | const inputBox = tag("div", { 120 | className: "input-box" 121 | }); 122 | const inputField = tag("input", { 123 | type: "url", 124 | id: "image-url", 125 | placeholder: "Image url", 126 | value: this.plugSettings.imageUrl 127 | ? this.plugSettings.imageUrl 128 | : "" 129 | }); 130 | inputField.addEventListener( 131 | "keypress", 132 | this.triggerEnterEvent.bind(this) 133 | ); 134 | const folderBtn = tag("button", { 135 | id: "open-image-btn" 136 | }); 137 | folderBtn.innerHTML = ``; 138 | folderBtn.addEventListener( 139 | "click", 140 | this.triggerFolderBtnEvent.bind(this) 141 | ); 142 | inputBox.append(inputField, folderBtn); 143 | const blurBox = tag("div", { 144 | className: "blur-box" 145 | }); 146 | const blurLabel = tag("label", { 147 | textContent: "Blur", 148 | className: "blur-input-lbl" 149 | }); 150 | const blurInputField = tag("input", { 151 | type: "text", 152 | id: "blur-value", 153 | value: this.plugSettings.blurValue 154 | ? this.plugSettings.blurValue 155 | : "4px", 156 | placeholder: "Blur value" 157 | }); 158 | blurInputField.addEventListener( 159 | "keypress", 160 | this.changeBlurValue.bind(this) 161 | ); 162 | blurBox.append(blurLabel, blurInputField); 163 | const transparencyBox = tag("div", { 164 | className: "transparency-box" 165 | }); 166 | const transprancyLabel = tag("label", { 167 | textContent: "Transparency", 168 | className: "transparency-input-lbl" 169 | }); 170 | const transparencyInputField = tag("input", { 171 | type: "range", 172 | id: "transparency-value", 173 | min: "0", 174 | max: "1", 175 | step: "0.1", 176 | value: this.plugSettings.transparency 177 | ? this.plugSettings.transparency 178 | : "0.4" 179 | }); 180 | transparencyInputField.addEventListener( 181 | "input", 182 | this.changeTransparencyValue.bind(this) 183 | ); 184 | const transparencyValueLbl = tag("span", { 185 | className: "transparency-value-lbl", 186 | textContent: this.plugSettings.transparency 187 | ? this.plugSettings.transparency 188 | : "0.4" 189 | }); 190 | transparencyBox.append( 191 | transprancyLabel, 192 | transparencyInputField, 193 | transparencyValueLbl 194 | ); 195 | const removeImgBtn = tag("button", { 196 | textContent: "Remove", 197 | id: "remove-image-btn" 198 | }); 199 | removeImgBtn.addEventListener( 200 | "click", 201 | this.removeImg.bind(this) 202 | ); 203 | plasmaContainer.append( 204 | heading, 205 | inputBox, 206 | blurBox, 207 | transparencyBox, 208 | removeImgBtn 209 | ); 210 | app.append(plasmaContainer); 211 | } 212 | ); 213 | 214 | ace.require("ace/ext/themelist").themes.push({ 215 | caption: editorThemeName 216 | .split("-") 217 | .map(name => name[0].toUpperCase() + name.slice(1)) 218 | .join(" "), 219 | theme: "ace/theme/" + editorThemeName, 220 | isDark: true 221 | }); 222 | 223 | const acodeXController = acode.require("acodex"); 224 | if (acodeXController) { 225 | const acodeXThemeNme = "SweetPlasma"; 226 | const colorSchema = { 227 | background: "#222235", 228 | foreground: "#ffffff", 229 | cursor: "#ffffff", 230 | cursorAccent: "#00000000", 231 | selectionBackground: "#ffffff26", 232 | black: "#222235", 233 | blue: "#f69154", 234 | brightBlack: "#3F3F54", 235 | brightBlue: "#f69154", 236 | brightCyan: "#00dded", 237 | brightGreen: "#06c993", 238 | brightMagenta: "#ec89cb", 239 | brightRed: "#f60055", 240 | brightWhite: "#ffffff", 241 | brightYellow: "#9700be", 242 | cyan: "#00dded", 243 | green: "#06c993", 244 | magenta: "#ec89cb", 245 | red: "#f60055", 246 | white: "#ffffff", 247 | yellow: "#9700be" 248 | }; 249 | // Add theme 250 | acodeXController.addTheme(acodeXThemeNme, colorSchema); 251 | // Apply theme 252 | //acodeXController.applyTheme(acodeXThemeNme); 253 | } 254 | 255 | const currentTheme = settings.get("editorTheme"); 256 | if (currentTheme === editorThemeName) 257 | editor.setTheme("ace/theme/" + editorThemeName); 258 | settings.on("update", this.onThemeChange); 259 | if (!this.plugSettings.themeIcon) { 260 | this.$iconsStyle.remove(); 261 | } 262 | if (this.plugSettings.imageUrl) { 263 | this.updateUiWithSettings(); 264 | } 265 | 266 | if(this.plugSettings.fancyAcode){ 267 | this.createFancyAcode(); 268 | } 269 | 270 | this.onAnimationChange(); 271 | } catch (error) { 272 | acode.alert("Warning", "Please restart acode"); 273 | } 274 | } 275 | 276 | changeTransparencyValue() { 277 | const transparencyValue = document.querySelector( 278 | "#transparency-value" 279 | ).value; 280 | document.querySelector(".transparency-value-lbl").textContent = 281 | transparencyValue; 282 | this.plugSettings.transparency = transparencyValue; 283 | settings.update(); 284 | this.updateUiWithSettings(); 285 | } 286 | 287 | changeBlurValue(event) { 288 | if (event.keyCode === 13) { 289 | const blurValue = document.querySelector("#blur-value").value; 290 | if (!blurValue) return; 291 | this.plugSettings.blurValue = blurValue; 292 | settings.update(); 293 | this.updateUiWithSettings(); 294 | } 295 | } 296 | 297 | triggerEnterEvent(event) { 298 | if (event.keyCode === 13) { 299 | const urlValue = document.querySelector("#image-url").value; 300 | if (!urlValue) return; 301 | this.plugSettings.imageUrl = urlValue; 302 | settings.update(); 303 | this.updateUiWithSettings(); 304 | } 305 | } 306 | 307 | async triggerFolderBtnEvent() { 308 | // Create a hidden input element of type 'file' 309 | const imageInput = document.createElement("input"); 310 | imageInput.type = "file"; 311 | imageInput.accept = "image/*"; 312 | imageInput.style.display = "none"; 313 | const self = this; 314 | // Add an event listener for when a file is selected 315 | imageInput.addEventListener("change", async function () { 316 | const selectedFile = imageInput.files[0]; 317 | // Check if a file is selected 318 | if (selectedFile) { 319 | // Read the selected file as a Data URI 320 | const reader = new FileReader(); 321 | 322 | reader.onload = async function (event) { 323 | const imageDataURI = event.target.result; 324 | const blob = self.dataURItoBlob(imageDataURI); 325 | const bgImg = fs(window.DATA_STORAGE + baseBgImgName); 326 | if (await bgImg.exists()) { 327 | await bgImg.delete(); 328 | await fs(window.DATA_STORAGE).createFile( 329 | baseBgImgName, 330 | blob 331 | ); 332 | } else { 333 | await fs(window.DATA_STORAGE).createFile( 334 | baseBgImgName, 335 | blob 336 | ); 337 | } 338 | const urlOfImage = await toInternalUrl( 339 | window.DATA_STORAGE + baseBgImgName 340 | ); 341 | document.querySelector("#image-url").value = urlOfImage 342 | ? urlOfImage 343 | : imageDataURI; 344 | self.plugSettings.imageUrl = urlOfImage 345 | ? urlOfImage 346 | : imageDataURI; 347 | settings.update(); 348 | self.updateUiWithSettings(); 349 | }; 350 | reader.readAsDataURL(selectedFile); 351 | } 352 | // Remove the input element from the DOM 353 | document.body.removeChild(imageInput); 354 | }); 355 | // Append the input element to the document body 356 | document.body.appendChild(imageInput); 357 | // Trigger a click event on the hidden file input to open the file selection dialog 358 | imageInput.click(); 359 | } 360 | 361 | dataURItoBlob(dataURI) { 362 | var byteString = atob(dataURI.split(",")[1]); 363 | var mimeString = dataURI.split(",")[0].split(":")[1].split(";")[0]; 364 | var ab = new ArrayBuffer(byteString.length); 365 | var ia = new Uint8Array(ab); 366 | for (var i = 0; i < byteString.length; i++) { 367 | ia[i] = byteString.charCodeAt(i); 368 | } 369 | return new Blob([ab], { type: mimeString }); 370 | } 371 | 372 | removeImg() { 373 | this.plugSettings.imageUrl = ""; 374 | this.plugSettings.blurValue = ""; 375 | this.plugSettings.transparency = ""; 376 | settings.update(); 377 | acode.alert("Warning", "Restart App to see changes"); 378 | } 379 | 380 | updateUiWithSettings() { 381 | try { 382 | document.querySelector( 383 | ".ace_editor" 384 | ).style.background = `url("${this.plugSettings.imageUrl}")`; 385 | document.querySelector(".ace_editor").style.backgroundSize = 386 | "cover"; 387 | document.querySelector( 388 | ".ace_editor .ace_scroller" 389 | ).style.background = this.transparentColor( 390 | document.querySelector(".ace_editor .ace_content") 391 | ); 392 | document.querySelector( 393 | ".ace_editor .ace_scroller" 394 | ).style.backdropFilter = `blur(${this.plugSettings.blurValue})`; 395 | const transparentGutterColor = this.transparentColor(document.querySelector(".ace_editor .ace_content")); 396 | document.querySelector(".ace_editor .ace_gutter").style.background = transparentGutterColor; 397 | document.querySelector(".ace_editor .ace_gutter").style.backdropFilter = `blur(${this.plugSettings.blurValue})`; 398 | } catch (error) { 399 | console.log(error); 400 | } 401 | } 402 | 403 | transparentColor(element) { 404 | let currentBackgroundColor = 405 | window.getComputedStyle(element).backgroundColor; 406 | 407 | // Extract the RGB values 408 | var rgbValues = currentBackgroundColor.match(/\d+/g); 409 | 410 | // Convert the RGB values to RGBA by adding 1 for the alpha (transparency) value 411 | var currentAlpha = parseFloat(rgbValues[3]) || 1.0; 412 | currentAlpha = this.plugSettings.transparency; 413 | return `rgba(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]}, ${currentAlpha})`; 414 | } 415 | 416 | onAnimationChange() { 417 | const fileList = document.querySelector(".open-file-list"); 418 | //const activeTile = fileList.querySelector(".tile.active"); 419 | if (this.plugSettings.fileTabAnimation) { 420 | fileList.style.setProperty( 421 | "--open-filelist-animation", 422 | "changeColor 5s infinite alternate,glowingEffect 2s infinite alternate" 423 | ); 424 | } else { 425 | fileList.style.setProperty("--open-filelist-animation", ""); 426 | } 427 | 428 | const floatingIcon = document.getElementById("quicktools-toggler"); 429 | if (this.plugSettings.floatingBtnAnimation) { 430 | floatingIcon.classList.remove("no_animation"); 431 | floatingIcon.style.setProperty( 432 | "--floating-btn-animation", 433 | "steam 20s linear infinite" 434 | ); 435 | } else { 436 | floatingIcon.style.setProperty("--floating-btn-animation", ""); 437 | floatingIcon.classList.add("no_animation"); 438 | } 439 | } 440 | 441 | onThemeChange(value) { 442 | if (value === "ace/theme/" + editorThemeName) { 443 | editor.setTheme("ace/theme/" + editorThemeName); 444 | settings.update({ editorTheme: editorThemeName }); 445 | } 446 | } 447 | 448 | createFancyAcode() { 449 | if (document.querySelector(".fancyAcodeStyles")) { 450 | document.querySelector(".fancyAcodeStyles").remove(); 451 | } 452 | const fancyStyling = document.createElement("style"); 453 | fancyStyling.id = "fancyAcodeStyles"; 454 | fancyStyling.textContent = ` 455 | .prompt{ 456 | background-color: transparent; 457 | backdrop-filter: blur(${this.plugSettings.promptBlurValue ? this.plugSettings.promptBlurValue : this.plugSettings.fancyUniversalBlurValue}); 458 | border-color: var(--border-color); 459 | } 460 | .context-menu{ 461 | background-color: transparent; 462 | backdrop-filter: blur(${this.plugSettings.contextMenuBlurValue ? this.plugSettings.contextMenuBlurValue : this.plugSettings.fancyUniversalBlurValue}); 463 | border-color: var(--border-color); 464 | } 465 | #palette{ 466 | background-color: transparent; 467 | backdrop-filter: blur(${this.plugSettings.paletteBlurValue ? this.plugSettings.paletteBlurValue : this.plugSettings.fancyUniversalBlurValue}); 468 | border-color: var(--border-color); 469 | } 470 | #hints{ 471 | background-color: transparent; 472 | backdrop-filter: blur(${this.plugSettings.paletteBlurValue ? this.plugSettings.paletteBlurValue : this.plugSettings.fancyUniversalBlurValue}); 473 | border-color: var(--border-color); 474 | } 475 | .cursor-menu{ 476 | background-color: transparent; 477 | backdrop-filter: blur(${this.plugSettings.cursorMenuBlurValue ? this.plugSettings.cursorMenuBlurValue : this.plugSettings.fancyUniversalBlurValue}); 478 | border-color: var(--border-color); 479 | } 480 | .ace_dark.ace_editor.ace_autocomplete{ 481 | background-color: transparent; 482 | backdrop-filter: blur(${this.plugSettings.aceCompletionBlurValue ? this.plugSettings.aceCompletionBlurValue : this.plugSettings.fancyUniversalBlurValue}); 483 | border-color: var(--border-color); 484 | } 485 | `; 486 | document.head.append(fancyStyling); 487 | } 488 | 489 | get settingsObj() { 490 | return { 491 | list: [ 492 | { 493 | key: "themeIcon", 494 | text: "Enable Theme Icon", 495 | checkbox: !!this.plugSettings.themeIcon, 496 | info: `If set to "true" means checked, then it will add a some icon to acode and that will match Sweet Plasma schema. If set to "false" means unchecked then theme icon will not be applied` 497 | }, 498 | { 499 | key: "fileTabAnimation", 500 | text: "Enable File Tab animation", 501 | checkbox: !!this.plugSettings.fileTabAnimation, 502 | info: `If set to "true" means checked, then it will add a beautiful glowing effect to it. If set to "false" means unchecked then animation will not be applied` 503 | }, 504 | { 505 | key: "floatingBtnAnimation", 506 | text: "Enable Quicktools toggler anination", 507 | checkbox: !!this.plugSettings.floatingBtnAnimation, 508 | info: `If set to "true" means checked, then it will add a beautiful glowing effect to it. If set to "false" means unchecked then animation will not be applied` 509 | }, 510 | { 511 | key: "fancyAcode", 512 | text: "Enable Fancy Acode", 513 | checkbox: !!this.plugSettings.fancyAcode, 514 | info: `If set to "true" means checked, then acode components will be transparent and with gauzy blurry effect. If set to "false" means unchecked then it will be normal default design` 515 | }, 516 | { 517 | key: "fancyUniversalBlurValue", 518 | text: "Blur Value for fancy design", 519 | value: this.plugSettings.fancyUniversalBlurValue, 520 | prompt: "Blur Value for fancy design", 521 | promptType: "text" 522 | } 523 | ], 524 | cb: (key, value) => { 525 | this.plugSettings[key] = value; 526 | settings.update(); 527 | if (this.plugSettings.themeIcon) { 528 | document.head.append(this.$iconsStyle); 529 | } else { 530 | this.$iconsStyle.remove(); 531 | } 532 | if (this.plugSettings.fancyAcode) { 533 | this.createFancyAcode(); 534 | }else{ 535 | document.querySelector(".fancyAcodeStyles").remove(); 536 | } 537 | acode.alert("Warning", "Please restart acode"); 538 | } 539 | }; 540 | } 541 | 542 | get plugSettings() { 543 | return settings.value[plugin.id]; 544 | } 545 | 546 | async destroy() { 547 | sidebarApps.remove("sweet-plasma-sidebar"); 548 | settings.off("update", this.onThemeChange); 549 | this.$iconsStyle.remove(); 550 | this.$customStyle.remove(); 551 | document.querySelector(".fancyAcodeStyles").remove(); 552 | delete settings.value[plugin.id]; 553 | settings.update(true); 554 | } 555 | } 556 | 557 | if (window.acode) { 558 | const acodePlugin = new AcodePlugin(); 559 | acode.setPluginInit( 560 | plugin.id, 561 | async (baseUrl, $page, { cacheFileUrl, cacheFile }) => { 562 | if (!baseUrl.endsWith("/")) { 563 | baseUrl += "/"; 564 | } 565 | acodePlugin.baseUrl = baseUrl; 566 | await acodePlugin.init($page, cacheFile, cacheFileUrl); 567 | }, 568 | acodePlugin.settingsObj 569 | ); 570 | acode.setPluginUnmount(plugin.id, () => { 571 | acodePlugin.destroy(); 572 | }); 573 | } 574 | -------------------------------------------------------------------------------- /src/style.scss: -------------------------------------------------------------------------------- 1 | /*** 2 | .ace-sweet-plasma 3 | ***/ 4 | 5 | .ace-sweet-plasma { 6 | color: #ffffff; // default color 7 | background-color: #1e1e2e; // background-color of editor container 8 | 9 | // left side line number area 10 | .ace_gutter { 11 | color: #808080; // for line number color 12 | background-color: #1e1e2e; //if not added it will be same as editor container 13 | } 14 | 15 | // Active line for left side Line number area 16 | .ace_gutter-active-line { 17 | font-weight: 700; 18 | color: #efdc35; // for line number color active line 19 | // background-color: ; if not added it will be same as editor container 20 | } 21 | 22 | // vertical Line after 80 character if enabled 23 | .ace_print-margin { 24 | width: 1px; 25 | background: #2d363f; 26 | } 27 | 28 | // Cursor color 29 | .ace_cursor { 30 | background: #00000000; 31 | color: #ffffff; 32 | } 33 | 34 | // selection 35 | .ace_marker-layer .ace_selection { 36 | background: #87879F; 37 | border-radius: 4px; 38 | font-style: italic; 39 | } 40 | 41 | // Multiple cursor's active selection 42 | .ace_multiselect .ace_selection.ace_start { 43 | box-shadow: 0 0 3px black; 44 | } 45 | 46 | .ace_marker-layer .ace_step { 47 | background: rgb(198, 219, 174); 48 | } 49 | 50 | // highlights Matching brackets (Only change border color) 51 | .ace_marker-layer .ace_bracket { 52 | margin: -1px 0 0 -1px; 53 | border: 1px solid #3f3f54; 54 | } 55 | 56 | // editor container active line 57 | .ace_marker-layer .ace_active-line { 58 | border: 1px solid #00000000; 59 | box-sizing: border-box; 60 | background: #ffffff0c; 61 | } 62 | 63 | // next match for the current selected word 64 | // try a bit transparent color 65 | .ace_marker-layer .ace_selected-word { 66 | background-color: #3f3f54; 67 | border: 1px solid #9700be; 68 | } 69 | 70 | .ace_invisible { 71 | color: #52524d; 72 | } 73 | 74 | /** 75 | * keywords 76 | * for example if else 77 | * ID in css 78 | */ 79 | .hljs-keyword, 80 | .ace_keyword { 81 | color: #f60055; 82 | } 83 | 84 | // example = 85 | .ace_keyword.ace_operator { 86 | color: #f69154; 87 | } 88 | 89 | .ace_constant.ace_language { 90 | color: #ec89cb; 91 | } 92 | 93 | // numbers 94 | .ace_constant.ace_numeric { 95 | color: #ec89cb; 96 | } 97 | 98 | .ace_constant.ace_character { 99 | color: #bd93f9; 100 | } 101 | 102 | .ace_constant.ace_character.ace_escape { 103 | color: #ec89cb; 104 | } 105 | 106 | // excape in regex 107 | .ace_constant.ace_other { 108 | color: #ffffff; 109 | } 110 | 111 | // const abc = "hello" 112 | // abc will have the color 113 | .hljs-title, 114 | .ace_identifier { 115 | color: #ffffff; 116 | } 117 | 118 | // url() attr() in css 119 | .ace_support.ace_function { 120 | color: #06c993; 121 | } 122 | 123 | //in js -> addEventListener etc 124 | .ace_support.ace_function.ace_dom { 125 | color: #00dded; // if not provided it will take color of ace_support.ace_function 126 | } 127 | 128 | // in js style, length etc 129 | // in css auto, inset, inline-block etc 130 | .ace_support.ace_constant { 131 | color: #bd93f9; 132 | } 133 | 134 | // in js any variable or import starting with uppercase 135 | // requires extra syntax highlights plugin 136 | .ace_class { 137 | color: #00dded; 138 | } 139 | 140 | // window document Array Object Math Uint32Array isNaN 141 | .ace_variable.ace_language { 142 | color: #efdc35; 143 | } 144 | 145 | // in css display, transform, animation etc 146 | .ace_support.ace_type { 147 | color: #00dded; 148 | } 149 | 150 | // tag name in html
151 | .ace_meta.ace_tag { 152 | color: #f60055; 153 | } 154 | 155 | // let const var also => 156 | .ace_storage { 157 | font-style: "italic"; 158 | color: #f60055; 159 | } 160 | 161 | .ace_storage.ace_type { 162 | color: #00dded; 163 | } 164 | 165 | .ace_invalid { 166 | color: #f8f8f0; 167 | background-color: #ff79c6; 168 | } 169 | 170 | .ace_invalid.ace_deprecated { 171 | color: #f8f8f0; 172 | background-color: #bd93f9; 173 | } 174 | 175 | // string 176 | .ace_string { 177 | color: #c95ae5; 178 | } 179 | 180 | // comment 181 | .ace_comment { 182 | color: #5F5F7F; 183 | } 184 | 185 | // .class name in css 186 | .ace_variable { 187 | color: #efdc35; 188 | } 189 | 190 | // anything without . or # in css 191 | // e.g. body h1 192 | 193 | .ace_constant { 194 | color: #ec89cb; 195 | } 196 | 197 | // function parameters (abc) => 198 | .hljs-params, 199 | .ace_variable.ace_parameter { 200 | color: #f69154; 201 | } 202 | 203 | // attribute name in html 204 | .ace_entity.ace_other.ace_attribute-name { 205 | color: #00dded; 206 | } 207 | 208 | // <> in html 209 | .ace_xml-pe.ace_xml, 210 | .ace_punctuation.ace_tag { 211 | color: #f69154; 212 | } 213 | 214 | // html tag 215 | .ace_tag-name.ace_tag, 216 | .ace_entity.ace_name.ace_tag { 217 | color: #f60055; 218 | } 219 | 220 | .ace_paren { 221 | color: #ec89cb; 222 | } 223 | 224 | /** 225 | * Don't change indent guide 226 | */ 227 | 228 | .ace_indent-guide { 229 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWPQ09NrYAgMjP4PAAtGAwchHMyAAAAAAElFTkSuQmCC) 230 | right repeat-y; 231 | } 232 | 233 | .ace_indent-guide-active { 234 | background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQIW2PQ1dX9zzBz5sz/ABCcBFFentLlAAAAAElFTkSuQmCC) 235 | right repeat-y; 236 | } 237 | 238 | /** 239 | * All the highlight rules bellow require extra syntax highlight plugin 240 | **/ 241 | 242 | // innerHTML, classList etc 243 | .ace_support.ace_constant.ace_js { 244 | color: #f69154; 245 | } 246 | 247 | // all function call in js 248 | .ace_entity.ace_name.ace_function { 249 | color: #ec89cb; 250 | } 251 | .ace_support.ace_constant.ace_css-in-js { 252 | color: #9700be; 253 | } 254 | } 255 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2016", 4 | "module": "commonjs", 5 | "allowJs": true, 6 | "esModuleInterop": true, 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "skipLibCheck": true, 10 | "outDir": "dist" 11 | }, 12 | "exclude": ["./dist/**/*", "./postcss.config.js"] 13 | } 14 | -------------------------------------------------------------------------------- /typings/acode.d.ts: -------------------------------------------------------------------------------- 1 | type Input = string; 2 | type Strings = string[]; 3 | 4 | declare var acode: Acode; 5 | 6 | interface Acode { 7 | /** 8 | * Define a module 9 | * @param {string} name 10 | * @param {Object|function} module 11 | */ 12 | define(name: string, module: any): void; 13 | 14 | require(module: string): any; 15 | 16 | exec(key: string, val: any): boolean | undefined; 17 | 18 | get exitAppMessage(): string | undefined; 19 | 20 | setLoadingMessage(message: string): void; 21 | 22 | setPluginInit( 23 | id: string, 24 | initFunction: (baseUrl: string, $page: HTMLElement, options?: any) => Promise, 25 | settings?: any 26 | ): void; 27 | 28 | getPluginSettings(id: string): any; 29 | 30 | setPluginUnmount(id: string, unmountFunction: () => void): void; 31 | 32 | /** 33 | * @param {string} id plugin id 34 | * @param {string} baseUrl local plugin url 35 | * @param {HTMLElement} $page 36 | */ 37 | initPlugin(id: string, baseUrl: string, $page: HTMLElement, options?: any): Promise; 38 | 39 | unmountPlugin(id: string): void; 40 | 41 | registerFormatter(id: string, extensions: string[], format: () => Promise): void; 42 | 43 | unregisterFormatter(id: string): void; 44 | 45 | format(selectIfNull?: boolean): Promise; 46 | 47 | fsOperation(file: string): any; 48 | 49 | newEditorFile(filename: string, options?: any): void; 50 | 51 | // readonly formatters(): { id: string; name: string; exts: string[] }[]; 52 | 53 | /** 54 | * @param {string[]} extensions 55 | * @returns {Array<[id: string, name: string]>} options 56 | */ 57 | getFormatterFor(extensions: string[]): [id: string, name: string][]; 58 | 59 | alert(title: string, message: string, onhide: ()=>void): void; 60 | 61 | loader(title: string, message: string, cancel: { timeout: number,callback: ()=>void }): void; 62 | 63 | joinUrl(...args: string[]): string; 64 | 65 | addIcon(className: string, src: string): void; 66 | 67 | prompt( 68 | message: string, 69 | defaultValue: string, 70 | type: 'textarea' | 'text' | 'number' | 'tel' | 'search' | 'email' | 'url', 71 | options?: { 72 | match: RegExp, 73 | required: boolean, 74 | placeholder: string, 75 | test: (any)=>boolean 76 | } 77 | ): Promise; 78 | 79 | confirm(title: string, message: string): Promise; 80 | 81 | select( 82 | title: string, 83 | options: [string, string, string, boolean][] | string, 84 | opts?: { 85 | onCancel?: () => void; 86 | onHide?: () => void; 87 | hideOnSelect?: boolean; 88 | textTransform?: boolean; 89 | default?: string; 90 | } | boolean 91 | ): Promise; 92 | 93 | multiPrompt(title: string, inputs: Array, help: string): Promise; 94 | 95 | fileBrowser(mode: 'file' | 'folder' | 'both', info: string, doesOpenLast: boolean): Promise< 96 | | { 97 | name: string; 98 | type: 'file'; 99 | url: string; 100 | } 101 | | { 102 | list: { 103 | icon: string; 104 | isDirectory: boolean; 105 | isFile: boolean; 106 | mime: string; 107 | name: string; 108 | type: 'file' | 'folder'; 109 | uri: string; 110 | url: string; 111 | }[]; 112 | scroll: number; 113 | name: string; 114 | type: 'folder'; 115 | url: string; 116 | } 117 | >; 118 | 119 | toInternalUrl(url: string): Promise; 120 | } 121 | -------------------------------------------------------------------------------- /typings/editorFile.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bajrangCoder/SweetPlasma/ecf8e0137a70e439c061c3603ed5dbacbb4845b3/typings/editorFile.d.ts -------------------------------------------------------------------------------- /typings/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /typings/settings.d.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bajrangCoder/SweetPlasma/ecf8e0137a70e439c061c3603ed5dbacbb4845b3/typings/settings.d.ts -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const { exec } = require("child_process"); 2 | const path = require("path"); 3 | 4 | module.exports = (env, options) => { 5 | const { mode = "development" } = options; 6 | const rules = [ 7 | { 8 | test: /\.m?js$/, 9 | use: [ 10 | "html-tag-js/jsx/tag-loader.js", 11 | { 12 | loader: "babel-loader", 13 | options: { 14 | presets: ["@babel/preset-env"], 15 | }, 16 | }, 17 | ], 18 | }, 19 | { 20 | test: /\.(sa|sc|c)ss$/, 21 | use: ["raw-loader", "postcss-loader", "sass-loader"], 22 | }, 23 | ]; 24 | 25 | const main = { 26 | mode, 27 | entry: { 28 | main: "./src/main.js", 29 | }, 30 | output: { 31 | path: path.resolve(__dirname, "dist"), 32 | filename: "[name].js", 33 | chunkFilename: "[name].js", 34 | }, 35 | module: { 36 | rules, 37 | }, 38 | plugins: [ 39 | { 40 | apply: (compiler) => { 41 | compiler.hooks.afterDone.tap("pack-zip", () => { 42 | // run pack-zip.js 43 | exec( 44 | "node .vscode/pack-zip.js", 45 | (err, stdout, stderr) => { 46 | if (err) { 47 | console.error(err); 48 | return; 49 | } 50 | console.log(stdout); 51 | } 52 | ); 53 | }); 54 | }, 55 | }, 56 | ], 57 | }; 58 | 59 | return [main]; 60 | }; 61 | --------------------------------------------------------------------------------