diff --git a/package-lock.json b/package-lock.json index a9a8dc556..62e57cc9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,14 @@ "dependencies": { "@deadlyjack/ajax": "^1.2.6", "@ungap/custom-elements": "^1.3.0", + "@xterm/addon-attach": "^0.11.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/addon-image": "^0.8.0", + "@xterm/addon-search": "^0.15.0", + "@xterm/addon-unicode11": "^0.8.0", + "@xterm/addon-web-links": "^0.11.0", + "@xterm/addon-webgl": "^0.18.0", + "@xterm/xterm": "^5.5.0", "autosize": "^6.0.1", "cordova": "12.0.0", "core-js": "^3.37.1", @@ -46,8 +54,9 @@ "@types/url-parse": "^1.4.11", "autoprefixer": "^10.4.19", "babel-loader": "^9.1.3", + "com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot", "com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal", - "cordova-android": "13.0.0", + "cordova-android": "^13.0.0", "cordova-clipboard": "^1.3.0", "cordova-plugin-advanced-http": "^3.3.1", "cordova-plugin-browser": "file:src/plugins/browser", @@ -3061,6 +3070,75 @@ "node": ">=10.0.0" } }, + "node_modules/@xterm/addon-attach": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-attach/-/addon-attach-0.11.0.tgz", + "integrity": "sha512-JboCN0QAY6ZLY/SSB/Zl2cQ5zW1Eh4X3fH7BnuR1NB7xGRhzbqU2Npmpiw/3zFlxDaU88vtKzok44JKi2L2V2Q==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/addon-fit": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz", + "integrity": "sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/addon-image": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.8.0.tgz", + "integrity": "sha512-b/dqpFn3jUad2pUP5UpF4scPIh0WdxRQL/1qyiahGfUI85XZTCXo0py9G6AcOR2QYUw8eJ8EowGspT7BQcgw6A==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.2.0" + } + }, + "node_modules/@xterm/addon-search": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-search/-/addon-search-0.15.0.tgz", + "integrity": "sha512-ZBZKLQ+EuKE83CqCmSSz5y1tx+aNOCUaA7dm6emgOX+8J9H1FWXZyrKfzjwzV+V14TV3xToz1goIeRhXBS5qjg==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/addon-unicode11": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-unicode11/-/addon-unicode11-0.8.0.tgz", + "integrity": "sha512-LxinXu8SC4OmVa6FhgwsVCBZbr8WoSGzBl2+vqe8WcQ6hb1r6Gj9P99qTNdPiFPh4Ceiu2pC8xukZ6+2nnh49Q==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/addon-web-links": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-web-links/-/addon-web-links-0.11.0.tgz", + "integrity": "sha512-nIHQ38pQI+a5kXnRaTgwqSHnX7KE6+4SVoceompgHL26unAxdfP6IPqUTSYPQgSwM56hsElfoNrrW5V7BUED/Q==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/addon-webgl": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-webgl/-/addon-webgl-0.18.0.tgz", + "integrity": "sha512-xCnfMBTI+/HKPdRnSOHaJDRqEpq2Ugy8LEj9GiY4J3zJObo3joylIFaMvzBwbYRg8zLtkO0KQaStCeSfoaI2/w==", + "license": "MIT", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/xterm": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", + "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==", + "license": "MIT" + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -4002,6 +4080,10 @@ "dev": true, "license": "MIT" }, + "node_modules/com.foxdebug.acode.rk.exec.proot": { + "resolved": "src/plugins/proot", + "link": true + }, "node_modules/com.foxdebug.acode.rk.exec.terminal": { "resolved": "src/plugins/terminal", "link": true @@ -10799,7 +10881,7 @@ "src/plugins/proot": { "name": "com.foxdebug.acode.rk.exec.proot", "version": "1.0.0", - "extraneous": true, + "dev": true, "license": "MIT" }, "src/plugins/sdcard": { diff --git a/package.json b/package.json index 01b0c9261..88206ac5d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ }, "cordova-plugin-websocket": {}, "cordova-plugin-buildinfo": {}, + "com.foxdebug.acode.rk.exec.proot": {}, "cordova-plugin-system": {}, "com.foxdebug.acode.rk.exec.terminal": {} }, @@ -63,8 +64,9 @@ "@types/url-parse": "^1.4.11", "autoprefixer": "^10.4.19", "babel-loader": "^9.1.3", + "com.foxdebug.acode.rk.exec.proot": "file:src/plugins/proot", "com.foxdebug.acode.rk.exec.terminal": "file:src/plugins/terminal", - "cordova-android": "13.0.0", + "cordova-android": "^13.0.0", "cordova-clipboard": "^1.3.0", "cordova-plugin-advanced-http": "^3.3.1", "cordova-plugin-browser": "file:src/plugins/browser", @@ -95,6 +97,14 @@ "dependencies": { "@deadlyjack/ajax": "^1.2.6", "@ungap/custom-elements": "^1.3.0", + "@xterm/addon-attach": "^0.11.0", + "@xterm/addon-fit": "^0.10.0", + "@xterm/addon-image": "^0.8.0", + "@xterm/addon-search": "^0.15.0", + "@xterm/addon-unicode11": "^0.8.0", + "@xterm/addon-web-links": "^0.11.0", + "@xterm/addon-webgl": "^0.18.0", + "@xterm/xterm": "^5.5.0", "autosize": "^6.0.1", "cordova": "12.0.0", "core-js": "^3.37.1", diff --git a/src/ace/commands.js b/src/ace/commands.js index 516253d19..233a23c0b 100644 --- a/src/ace/commands.js +++ b/src/ace/commands.js @@ -341,6 +341,14 @@ const commands = [ }, readOnly: true, }, + { + name: "openTerminal", + description: "Open Terminal", + exec() { + acode.exec("new-terminal"); + }, + readOnly: true, + }, ]; export function setCommands(editor) { diff --git a/src/components/terminal/index.js b/src/components/terminal/index.js new file mode 100644 index 000000000..ef2372fa1 --- /dev/null +++ b/src/components/terminal/index.js @@ -0,0 +1,22 @@ +/** + * Terminal Components Export + */ + +import TerminalComponent from "./terminal"; +import { DEFAULT_TERMINAL_SETTINGS } from "./terminalDefaults"; +import TerminalManager from "./terminalManager"; +import TerminalThemeManager from "./terminalThemeManager"; + +export { + TerminalComponent, + TerminalManager, + TerminalThemeManager, + DEFAULT_TERMINAL_SETTINGS, +}; + +export default { + TerminalComponent, + TerminalManager, + TerminalThemeManager, + DEFAULT_TERMINAL_SETTINGS, +}; diff --git a/src/components/terminal/ligatures.js b/src/components/terminal/ligatures.js new file mode 100644 index 000000000..d7042dd51 --- /dev/null +++ b/src/components/terminal/ligatures.js @@ -0,0 +1,102 @@ +// pretty basic ligature implementation for webview +export default class LigaturesAddon { + constructor(options = {}) { + // fallback ligatures if a font does not support ligatures natively + this._fallbackLigatures = + options.fallbackLigatures || + [ + "<--", + "<---", + "<<-", + "<-", + "->", + "->>", + "-->", + "--->", + "<==", + "<===", + "<<=", + "<=", + "=>", + "=>>", + "==>", + "===>", + ">=", + ">>=", + "<->", + "<-->", + "<--->", + "<---->", + "<=>", + "<==>", + "<===>", + "<====>", + "<~~", + "<~", + "~>", + "~~>", + "::", + ":::", + "==", + "!=", + "===", + "!==", + ":=", + ":-", + ":+", + "<*", + "<*>", + "*>", + "<|", + "<|>", + "|>", + "+:", + "-:", + "=:", + ":>", + "++", + "+++", + " + + + + + diff --git a/www/index.html b/www/index.html index ae9aa7f4d..6ceca12d1 100644 --- a/www/index.html +++ b/www/index.html @@ -165,17 +165,17 @@ Acode + + + + + - - - - - diff --git a/www/res/fonts/MesloLGSNFRegular.ttf b/www/res/fonts/MesloLGSNFRegular.ttf new file mode 100644 index 000000000..b829758ea Binary files /dev/null and b/www/res/fonts/MesloLGSNFRegular.ttf differ diff --git a/www/res/icons/li-icons.ttf b/www/res/icons/li-icons.ttf index 05b3cf556..2880af54f 100644 Binary files a/www/res/icons/li-icons.ttf and b/www/res/icons/li-icons.ttf differ diff --git a/www/res/icons/style.css b/www/res/icons/style.css index dfeececdb..1fb38d5fe 100644 --- a/www/res/icons/style.css +++ b/www/res/icons/style.css @@ -8,7 +8,7 @@ @font-face { font-family: "li-icon"; - src: url("li-icons.ttf?59d3hz") format("truetype"); + src: url("li-icons.ttf?6wte0b") format("truetype"); font-weight: normal; font-style: normal; font-display: block; @@ -44,18 +44,21 @@ -moz-osx-font-smoothing: grayscale; } -.licons.verified:before { +.licons.terminal:before { content: "\e900"; } -.licons.tag:before { +.licons.cart:before { content: "\e901"; } .licons.scale:before { content: "\e902"; } -.licons.cart:before { +.licons.tag:before { content: "\e903"; } +.licons.verified:before { + content: "\e904"; +} .icon.acode:before { content: "\ea0d";