Pe 222 apps sidebar (#51)
* can open / close Apps view * gotten app list to load dynamically * updated icons bizzare that they all have the same bg color * can select an app form left bar * could not get ImageViewer to work :( * getting rid of screenshots * readme.md works * fixed the color problems for icons
215
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "Prompt",
|
"name": "waveterm",
|
||||||
"version": "0.3.1",
|
"version": "0.5.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -2289,6 +2289,15 @@
|
|||||||
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
|
"integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"color-convert": {
|
||||||
|
"version": "2.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||||
|
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"color-name": "~1.1.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"emoji-regex": {
|
"emoji-regex": {
|
||||||
"version": "9.2.2",
|
"version": "9.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz",
|
||||||
@ -2306,6 +2315,40 @@
|
|||||||
"strip-ansi": "^7.0.1"
|
"strip-ansi": "^7.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"string-width-cjs": {
|
||||||
|
"version": "npm:string-width@4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
|
||||||
@ -2315,6 +2358,23 @@
|
|||||||
"ansi-regex": "^6.0.1"
|
"ansi-regex": "^6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"strip-ansi-cjs": {
|
||||||
|
"version": "npm:strip-ansi@6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"dev": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"wrap-ansi": {
|
"wrap-ansi": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz",
|
||||||
@ -2325,6 +2385,60 @@
|
|||||||
"string-width": "^5.0.1",
|
"string-width": "^5.0.1",
|
||||||
"strip-ansi": "^7.0.1"
|
"strip-ansi": "^7.0.1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"wrap-ansi-cjs": {
|
||||||
|
"version": "npm:wrap-ansi@7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ansi-styles": "^4.0.0",
|
||||||
|
"string-width": "^4.1.0",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"ansi-styles": {
|
||||||
|
"version": "4.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||||
|
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"emoji-regex": {
|
||||||
|
"version": "8.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"string-width": {
|
||||||
|
"version": "4.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||||
|
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"emoji-regex": "^8.0.0",
|
||||||
|
"is-fullwidth-code-point": "^3.0.0",
|
||||||
|
"strip-ansi": "^6.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"strip-ansi": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"ansi-regex": "^5.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4846,25 +4960,6 @@
|
|||||||
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"electron": {
|
|
||||||
"version": "25.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/electron/-/electron-25.4.0.tgz",
|
|
||||||
"integrity": "sha512-VLTRxDhL4UvQbqM7pTNENnJo62cdAPZT92N+B7BZQ5Xfok1wuVPEewIjBot4K7U3EpLUuHn1veeLzho3ihiP+Q==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"@electron/get": "^2.0.0",
|
|
||||||
"@types/node": "^18.11.18",
|
|
||||||
"extract-zip": "^2.0.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": {
|
|
||||||
"version": "18.17.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.1.tgz",
|
|
||||||
"integrity": "sha512-xlR1jahfizdplZYRU59JlUx9uzF1ARa8jbhM11ccpCJya8kvos5jwdm2ZAgxSCwOl0fq21svP18EVwPBXMQudw==",
|
|
||||||
"dev": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"electron-installer-common": {
|
"electron-installer-common": {
|
||||||
"version": "0.10.3",
|
"version": "0.10.3",
|
||||||
"resolved": "https://registry.npmjs.org/electron-installer-common/-/electron-installer-common-0.10.3.tgz",
|
"resolved": "https://registry.npmjs.org/electron-installer-common/-/electron-installer-common-0.10.3.tgz",
|
||||||
@ -8897,6 +8992,53 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"raw-loader": {
|
||||||
|
"version": "4.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz",
|
||||||
|
"integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"loader-utils": "^2.0.0",
|
||||||
|
"schema-utils": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"ajv": {
|
||||||
|
"version": "6.12.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
|
||||||
|
"integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"fast-deep-equal": "^3.1.1",
|
||||||
|
"fast-json-stable-stringify": "^2.0.0",
|
||||||
|
"json-schema-traverse": "^0.4.1",
|
||||||
|
"uri-js": "^4.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ajv-keywords": {
|
||||||
|
"version": "3.5.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz",
|
||||||
|
"integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"json-schema-traverse": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"schema-utils": {
|
||||||
|
"version": "3.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz",
|
||||||
|
"integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/json-schema": "^7.0.8",
|
||||||
|
"ajv": "^6.12.5",
|
||||||
|
"ajv-keywords": "^3.5.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"rcedit": {
|
"rcedit": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/rcedit/-/rcedit-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/rcedit/-/rcedit-3.1.0.tgz",
|
||||||
@ -9897,17 +10039,6 @@
|
|||||||
"strip-ansi": "^6.0.1"
|
"strip-ansi": "^6.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"string-width-cjs": {
|
|
||||||
"version": "npm:string-width@4.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
|
||||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"emoji-regex": "^8.0.0",
|
|
||||||
"is-fullwidth-code-point": "^3.0.0",
|
|
||||||
"strip-ansi": "^6.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"string_decoder": {
|
"string_decoder": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||||
@ -9925,15 +10056,6 @@
|
|||||||
"ansi-regex": "^5.0.1"
|
"ansi-regex": "^5.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"strip-ansi-cjs": {
|
|
||||||
"version": "npm:strip-ansi@6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-regex": "^5.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"strip-bom": {
|
"strip-bom": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
|
||||||
@ -11050,17 +11172,6 @@
|
|||||||
"strip-ansi": "^6.0.0"
|
"strip-ansi": "^6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wrap-ansi-cjs": {
|
|
||||||
"version": "npm:wrap-ansi@7.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
|
||||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
|
||||||
"ansi-styles": "^4.0.0",
|
|
||||||
"string-width": "^4.1.0",
|
|
||||||
"strip-ansi": "^6.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
"lodash-webpack-plugin": "^0.11.6",
|
"lodash-webpack-plugin": "^0.11.6",
|
||||||
"mini-css-extract-plugin": "^2.6.0",
|
"mini-css-extract-plugin": "^2.6.0",
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
|
"raw-loader": "^4.0.2",
|
||||||
"react-split-it": "^2.0.0",
|
"react-split-it": "^2.0.0",
|
||||||
"style-loader": "^3.3.1",
|
"style-loader": "^3.3.1",
|
||||||
"typescript": "^4.7.3",
|
"typescript": "^4.7.3",
|
||||||
|
@ -197,7 +197,8 @@ a.a-block {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.history-view,
|
.history-view,
|
||||||
.bookmarks-view {
|
.bookmarks-view,
|
||||||
|
.plugins-view {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
@ -11,6 +11,8 @@ import type { ContextMenuOpts } from "../types/types";
|
|||||||
import localizedFormat from "dayjs/plugin/localizedFormat";
|
import localizedFormat from "dayjs/plugin/localizedFormat";
|
||||||
import { GlobalModel } from "../model/model";
|
import { GlobalModel } from "../model/model";
|
||||||
import { isBlank } from "../util/util";
|
import { isBlank } from "../util/util";
|
||||||
|
import { WorkspaceView } from "./workspace/workspaceview";
|
||||||
|
import { PluginsView } from "./pluginsview/pluginsview";
|
||||||
import { BookmarksView } from "./bookmarks/bookmarks";
|
import { BookmarksView } from "./bookmarks/bookmarks";
|
||||||
import { HistoryView } from "./history/history";
|
import { HistoryView } from "./history/history";
|
||||||
import {
|
import {
|
||||||
@ -21,7 +23,6 @@ import {
|
|||||||
} from "./common/modals/settings";
|
} from "./common/modals/settings";
|
||||||
import { RemotesModal } from "./connections/connections";
|
import { RemotesModal } from "./connections/connections";
|
||||||
import { TosModal } from "./common/modals/modals";
|
import { TosModal } from "./common/modals/modals";
|
||||||
import { WorkspaceView } from "../app/workspace/workspaceview";
|
|
||||||
import { MainSideBar } from "./sidebar/MainSideBar";
|
import { MainSideBar } from "./sidebar/MainSideBar";
|
||||||
import { DisconnectedModal, ClientStopModal, AlertModal, WelcomeModal } from "./common/modals/modals";
|
import { DisconnectedModal, ClientStopModal, AlertModal, WelcomeModal } from "./common/modals/modals";
|
||||||
import { ErrorBoundary } from "./common/error/errorboundary";
|
import { ErrorBoundary } from "./common/error/errorboundary";
|
||||||
@ -107,11 +108,13 @@ class App extends React.Component<{}, {}> {
|
|||||||
if (dcWait) {
|
if (dcWait) {
|
||||||
setTimeout(() => this.updateDcWait(false), 0);
|
setTimeout(() => this.updateDcWait(false), 0);
|
||||||
}
|
}
|
||||||
|
//console.log(`GlobalModel.activeMainView.get() = ${GlobalModel.activeMainView.get()}`); // @mike - if I remove this, I cant see plugins
|
||||||
return (
|
return (
|
||||||
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
|
<div id="main" className={"platform-" + platform} onContextMenu={this.handleContextMenu}>
|
||||||
<div className="main-content">
|
<div className="main-content">
|
||||||
<MainSideBar />
|
<MainSideBar />
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
|
<PluginsView />
|
||||||
<WorkspaceView />
|
<WorkspaceView />
|
||||||
<HistoryView />
|
<HistoryView />
|
||||||
<BookmarksView />
|
<BookmarksView />
|
||||||
|
137
src/app/pluginsview/pluginsview.less
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
@import "../../app/common/themes/themes.less";
|
||||||
|
|
||||||
|
.plugins-view {
|
||||||
|
background-color: @background-session;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
margin: 1.5em 1.5em 0.5em;
|
||||||
|
|
||||||
|
.plugins-title {
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-button {
|
||||||
|
position: absolute;
|
||||||
|
right: 1em;
|
||||||
|
top: 0.8em;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 1.5em;
|
||||||
|
height: 1.5em;
|
||||||
|
border-radius: 50%;
|
||||||
|
svg {
|
||||||
|
width: 1.5em;
|
||||||
|
height: 1.5em;
|
||||||
|
fill: @base-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
display: flex;
|
||||||
|
.plugins-list {
|
||||||
|
padding: 1em;
|
||||||
|
border-right: 1px solid @base-border;
|
||||||
|
min-height: calc(100vh - 6em);
|
||||||
|
max-height: calc(100vh - 6em);
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
.plugin-summary {
|
||||||
|
display: block;
|
||||||
|
padding: 10px;
|
||||||
|
max-width: 323px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
&.selected {
|
||||||
|
border-color: @prompt-green;
|
||||||
|
}
|
||||||
|
.plugin-summary-header {
|
||||||
|
display: flex;
|
||||||
|
.plugin-summary-icon {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
svg {
|
||||||
|
width: 32px;
|
||||||
|
height: 32px;
|
||||||
|
fill: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugin-summary-info {
|
||||||
|
flex: 1;
|
||||||
|
margin: 0 12px;
|
||||||
|
.plugin-summary-title {
|
||||||
|
}
|
||||||
|
.plugin-summary-vendor {
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugin-summary-body {
|
||||||
|
margin-top: 8px;
|
||||||
|
min-height: 54px;
|
||||||
|
max-height: 54px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugins-details {
|
||||||
|
flex: 1 !important;
|
||||||
|
padding: 2em;
|
||||||
|
min-height: calc(100vh - 6em);
|
||||||
|
max-height: calc(100vh - 6em);
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
.plugin-label {
|
||||||
|
min-width: 100%;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
.plugin-summary-header {
|
||||||
|
display: flex;
|
||||||
|
.plugin-summary-icon {
|
||||||
|
svg {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
fill: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugin-summary-info {
|
||||||
|
flex: 1;
|
||||||
|
margin: 0 12px;
|
||||||
|
.plugin-summary-title {
|
||||||
|
font-size: 1.1em;
|
||||||
|
margin-top: 0.3em;
|
||||||
|
}
|
||||||
|
.plugin-summary-vendor {
|
||||||
|
font-size: 0.9em;
|
||||||
|
margin-top: 0.4em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugin-summary-body {
|
||||||
|
margin-top: 1em;
|
||||||
|
}
|
||||||
|
.plugin-screenshots-container {
|
||||||
|
margin-top: 3em;
|
||||||
|
.plugin-screenshots {
|
||||||
|
display: flex;
|
||||||
|
overflow-x: auto;
|
||||||
|
width: 100%;
|
||||||
|
white-space: nowrap;
|
||||||
|
align-items: flex-start;
|
||||||
|
img {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 10px;
|
||||||
|
max-height: 50vh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.plugin-readme {
|
||||||
|
margin-top: 3em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
101
src/app/pluginsview/pluginsview.tsx
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
// Copyright 2023, Command Line Inc.
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import * as mobxReact from "mobx-react";
|
||||||
|
import * as mobx from "mobx";
|
||||||
|
import { boundMethod } from "autobind-decorator";
|
||||||
|
import { GlobalModel } from "../../model/model";
|
||||||
|
import { PluginModel } from "../../plugins/plugins";
|
||||||
|
import { ImageDisplay, Markdown } from "../common/common";
|
||||||
|
|
||||||
|
import { ReactComponent as XmarkIcon } from "../assets/icons/line/xmark.svg";
|
||||||
|
|
||||||
|
import "./pluginsview.less";
|
||||||
|
|
||||||
|
@mobxReact.observer
|
||||||
|
class PluginsView extends React.Component<{}, {}> {
|
||||||
|
@boundMethod
|
||||||
|
closeView(): void {
|
||||||
|
GlobalModel.pluginsModel.closeView();
|
||||||
|
}
|
||||||
|
|
||||||
|
render() {
|
||||||
|
if (GlobalModel.activeMainView.get() !== "plugins") {
|
||||||
|
return <></>;
|
||||||
|
}
|
||||||
|
const { pluginsModel } = GlobalModel;
|
||||||
|
console.log(`rendering details for ${pluginsModel.selectedPlugin.get().name}`);
|
||||||
|
const PluginList = () => (
|
||||||
|
<div className="plugins-list">
|
||||||
|
{PluginModel.allPlugins().map((plugin, i) => (
|
||||||
|
<div
|
||||||
|
key={i}
|
||||||
|
className={`plugin-summary hoverEffect ${
|
||||||
|
plugin.name === pluginsModel.selectedPlugin.get().name ? "selected" : ""
|
||||||
|
}`}
|
||||||
|
onClick={() => pluginsModel.setSelectedPlugin(plugin)}
|
||||||
|
>
|
||||||
|
<div className="plugin-summary-header">
|
||||||
|
<div className="plugin-summary-icon">{plugin.getIcon()}</div>
|
||||||
|
<div className="plugin-summary-info">
|
||||||
|
<div className="plugin-summary-title">{plugin.title}</div>
|
||||||
|
<div className="plugin-summary-vendor">{plugin.vendor}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="plugin-summary-body">{plugin.summary}</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const PluginDetails = () => {
|
||||||
|
const plugin = pluginsModel.selectedPlugin.get();
|
||||||
|
return (
|
||||||
|
<div className="plugins-details">
|
||||||
|
<div className="plugin-summary-header">
|
||||||
|
<div className="plugin-summary-icon">{plugin.getIcon()}</div>
|
||||||
|
<div className="plugin-summary-info">
|
||||||
|
<div className="plugin-summary-title">{plugin.title}</div>
|
||||||
|
<div className="plugin-summary-vendor">{plugin.vendor}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="plugin-summary-body">{plugin.summary}</div>
|
||||||
|
{plugin.screenshots && plugin.screenshots.length > 0 && (
|
||||||
|
<div className="plugin-screenshots-container">
|
||||||
|
<div className="plugin-label">{"Screenshots"}</div>
|
||||||
|
<div className="plugin-screenshots">
|
||||||
|
{plugin.screenshots.map((path, index) => (
|
||||||
|
<img key={index} src={path} alt={`Screenshot ${index}`} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{plugin.readme && (
|
||||||
|
<div className="plugin-readme">
|
||||||
|
<div className="plugin-label">{"Readme"}</div>
|
||||||
|
<Markdown text={plugin.readme} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="plugins-view">
|
||||||
|
<div className="header">
|
||||||
|
<div className="plugins-title">Apps</div>
|
||||||
|
<div className="close-button hoverEffect" title="Close (Escape)" onClick={this.closeView}>
|
||||||
|
<XmarkIcon className={"icon"} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="body">
|
||||||
|
<PluginList />
|
||||||
|
<PluginDetails />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { PluginsView };
|
@ -76,12 +76,19 @@ class MainSideBar extends React.Component<{}, {}> {
|
|||||||
GlobalCommandRunner.showRemote(remote.remoteid);
|
GlobalCommandRunner.showRemote(remote.remoteid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@boundMethod
|
||||||
|
handlePluginsClick(): void {
|
||||||
|
if (GlobalModel.activeMainView.get() == "plugins") {
|
||||||
|
GlobalModel.showSessionView();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
GlobalModel.pluginsModel.showPluginsView();
|
||||||
|
}
|
||||||
|
|
||||||
@boundMethod
|
@boundMethod
|
||||||
handleHistoryClick(): void {
|
handleHistoryClick(): void {
|
||||||
if (GlobalModel.activeMainView.get() == "history") {
|
if (GlobalModel.activeMainView.get() == "history") {
|
||||||
mobx.action(() => {
|
GlobalModel.showSessionView();
|
||||||
GlobalModel.activeMainView.set("session");
|
|
||||||
})();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GlobalModel.historyViewModel.reSearch();
|
GlobalModel.historyViewModel.reSearch();
|
||||||
@ -150,7 +157,6 @@ class MainSideBar extends React.Component<{}, {}> {
|
|||||||
}
|
}
|
||||||
return sessionList.map((session, index) => {
|
return sessionList.map((session, index) => {
|
||||||
const isActive = GlobalModel.activeMainView.get() == "session" && activeSessionId == session.sessionId;
|
const isActive = GlobalModel.activeMainView.get() == "session" && activeSessionId == session.sessionId;
|
||||||
/** @TODO: Handle archived sessions and talk to Mike about session settings */
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
@ -200,11 +206,11 @@ class MainSideBar extends React.Component<{}, {}> {
|
|||||||
</div>
|
</div>
|
||||||
<div className="contents">
|
<div className="contents">
|
||||||
<div className="top">
|
<div className="top">
|
||||||
{/*<div className="item disabled">
|
<div className="item hoverEffect" onClick={this.handlePluginsClick}>
|
||||||
<AppsIcon className="icon" />
|
<AppsIcon className="icon" />
|
||||||
Apps
|
Apps
|
||||||
<span className="hotkey">⌘A</span>
|
<span className="hotkey">⌘A</span>
|
||||||
</div>*/}
|
</div>
|
||||||
<div className="item hoverEffect" onClick={this.handleHistoryClick}>
|
<div className="item hoverEffect" onClick={this.handleHistoryClick}>
|
||||||
<HistoryIcon className="icon" />
|
<HistoryIcon className="icon" />
|
||||||
History
|
History
|
||||||
|
@ -15,6 +15,7 @@ import {
|
|||||||
isModKeyPress,
|
isModKeyPress,
|
||||||
} from "../util/util";
|
} from "../util/util";
|
||||||
import { TermWrap } from "../plugins/terminal/term";
|
import { TermWrap } from "../plugins/terminal/term";
|
||||||
|
import { PluginModel } from "../plugins/plugins";
|
||||||
import type {
|
import type {
|
||||||
SessionDataType,
|
SessionDataType,
|
||||||
LineType,
|
LineType,
|
||||||
@ -2423,7 +2424,36 @@ class BookmarksModel {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
}
|
||||||
|
|
||||||
|
class PluginsModel {
|
||||||
|
selectedPlugin: OV<RendererPluginType> = mobx.observable.box(null, { name: "selectedPlugin" });
|
||||||
|
|
||||||
|
showPluginsView(): void {
|
||||||
|
mobx.action(() => {
|
||||||
|
this.reset();
|
||||||
|
GlobalModel.activeMainView.set("plugins");
|
||||||
|
const allPlugins = PluginModel.allPlugins();
|
||||||
|
this.selectedPlugin.set(allPlugins.length > 0 ? allPlugins[0] : null);
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectedPlugin(plugin: RendererPluginType): void {
|
||||||
|
mobx.action(() => {
|
||||||
|
this.selectedPlugin.set(plugin);
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
reset(): void {
|
||||||
|
mobx.action(() => {
|
||||||
|
this.selectedPlugin.set(null);
|
||||||
|
})();
|
||||||
|
}
|
||||||
|
|
||||||
|
closeView(): void {
|
||||||
|
GlobalModel.showSessionView();
|
||||||
|
setTimeout(() => GlobalModel.inputModel.giveFocus(), 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class RemotesModalModel {
|
class RemotesModalModel {
|
||||||
@ -2658,7 +2688,7 @@ class Model {
|
|||||||
authKey: string;
|
authKey: string;
|
||||||
isDev: boolean;
|
isDev: boolean;
|
||||||
platform: string;
|
platform: string;
|
||||||
activeMainView: OV<"session" | "history" | "bookmarks" | "webshare"> = mobx.observable.box("session", {
|
activeMainView: OV<"plugins" | "session" | "history" | "bookmarks" | "webshare"> = mobx.observable.box("session", {
|
||||||
name: "activeMainView",
|
name: "activeMainView",
|
||||||
});
|
});
|
||||||
termFontSize: CV<number>;
|
termFontSize: CV<number>;
|
||||||
@ -2684,6 +2714,7 @@ class Model {
|
|||||||
remotesModalModel: RemotesModalModel;
|
remotesModalModel: RemotesModalModel;
|
||||||
|
|
||||||
inputModel: InputModel;
|
inputModel: InputModel;
|
||||||
|
pluginsModel: PluginsModel;
|
||||||
bookmarksModel: BookmarksModel;
|
bookmarksModel: BookmarksModel;
|
||||||
historyViewModel: HistoryViewModel;
|
historyViewModel: HistoryViewModel;
|
||||||
clientData: OV<ClientDataType> = mobx.observable.box(null, {
|
clientData: OV<ClientDataType> = mobx.observable.box(null, {
|
||||||
@ -2702,6 +2733,7 @@ class Model {
|
|||||||
);
|
);
|
||||||
this.ws.reconnect();
|
this.ws.reconnect();
|
||||||
this.inputModel = new InputModel();
|
this.inputModel = new InputModel();
|
||||||
|
this.pluginsModel = new PluginsModel();
|
||||||
this.bookmarksModel = new BookmarksModel();
|
this.bookmarksModel = new BookmarksModel();
|
||||||
this.historyViewModel = new HistoryViewModel();
|
this.historyViewModel = new HistoryViewModel();
|
||||||
this.remotesModalModel = new RemotesModalModel();
|
this.remotesModalModel = new RemotesModalModel();
|
||||||
@ -3203,7 +3235,9 @@ class Model {
|
|||||||
this.updateRemotes(update.remotes);
|
this.updateRemotes(update.remotes);
|
||||||
}
|
}
|
||||||
if ("mainview" in update) {
|
if ("mainview" in update) {
|
||||||
if (update.mainview == "bookmarks") {
|
if (update.mainview == "plugins") {
|
||||||
|
this.pluginsModel.showPluginsView();
|
||||||
|
} else if (update.mainview == "bookmarks") {
|
||||||
this.bookmarksModel.showBookmarksView(update.bookmarks, update.selectedbookmark);
|
this.bookmarksModel.showBookmarksView(update.bookmarks, update.selectedbookmark);
|
||||||
} else if (update.mainview == "session") {
|
} else if (update.mainview == "session") {
|
||||||
this.activeMainView.set("session");
|
this.activeMainView.set("session");
|
||||||
|
12
src/plugins/code/icon.svg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37176)"/>
|
||||||
|
<path d="M12.7568 13.803C13.0621 13.5231 13.0828 13.0487 12.8028 12.7434C12.5229 12.438 12.0485 12.4174 11.7432 12.6973L8.74319 15.4475C8.58822 15.5896 8.49999 15.7901 8.5 16.0004C8.50001 16.2106 8.58825 16.4112 8.74322 16.5532L11.7432 19.3031C12.0486 19.5829 12.523 19.5623 12.8029 19.2569C13.0828 18.9516 13.0621 18.4772 12.7568 18.1973L10.3599 16.0003L12.7568 13.803Z" fill="white"/>
|
||||||
|
<path d="M17.7301 11.9199C17.8249 11.5167 17.5749 11.113 17.1717 11.0181C16.7685 10.9233 16.3647 11.1733 16.2699 11.5765L14.2699 20.0808C14.1751 20.484 14.4251 20.8877 14.8283 20.9826C15.2315 21.0774 15.6353 20.8274 15.7301 20.4242L17.7301 11.9199Z" fill="white"/>
|
||||||
|
<path d="M20.2568 12.6973C19.9515 12.4174 19.4771 12.438 19.1972 12.7434C18.9172 13.0487 18.9379 13.5231 19.2432 13.803L21.6401 16.0003L19.2432 18.1973C18.9379 18.4772 18.9172 18.9516 19.1971 19.2569C19.477 19.5623 19.9514 19.5829 20.2568 19.3031L23.2568 16.5532C23.4118 16.4112 23.5 16.2106 23.5 16.0004C23.5 15.7901 23.4118 15.5896 23.2568 15.4475L20.2568 12.6973Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_629_37176" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#68D4EC"/>
|
||||||
|
<stop offset="1" stop-color="#005B70"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
5
src/plugins/code/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "Code Viewer",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "View and Edit source code with syntax highlightng and code completion."
|
||||||
|
}
|
8
src/plugins/code/readme.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Code Editor for Wave Terminal
|
||||||
|
|
||||||
|
These instructions are for setting up the build on MacOS.
|
||||||
|
If you're developing on Linux please use the [Linux Build Instructions](./build-linux.md).
|
||||||
|
|
||||||
|
## Running the Development Version of Wave
|
||||||
|
|
||||||
|
If you install the production version of Wave, you'll see a semi-transparent sidebar, and the data for Wave is stored in the directory ~/prompt. The development version has a red/brown sidebar and stores its data in ~/prompt-dev. This allows the production and development versions to be run simultaneously with no conflicts. If the dev database is corrupted by development bugs, or the schema changes in development it will not affect the production copy.
|
BIN
src/plugins/code/screenshots/1.png
Normal file
After Width: | Height: | Size: 248 KiB |
10
src/plugins/csv/icon.svg
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37175)"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M18.281 10H13.72C13.046 10 12.495 10 12.048 10.037C11.585 10.074 11.166 10.155 10.776 10.354C10.1646 10.6656 9.66756 11.1626 9.356 11.774C9.156 12.165 9.076 12.584 9.038 13.047C9 13.494 9 14.045 9 14.719V17.28C9 17.954 9 18.504 9.037 18.952C9.074 19.415 9.155 19.834 9.354 20.225C9.66556 20.8364 10.1626 21.3334 10.774 21.645C11.165 21.844 11.584 21.925 12.047 21.962C12.494 21.999 13.045 21.999 13.719 21.999H18.281C18.955 21.999 19.505 21.999 19.953 21.962C20.416 21.925 20.835 21.844 21.226 21.645C21.8374 21.3334 22.3344 20.8364 22.646 20.225C22.845 19.834 22.926 19.415 22.963 18.952C23 18.505 23 17.954 23 17.28V14.72C23 14.046 23 13.495 22.963 13.048C22.926 12.585 22.845 12.166 22.646 11.776C22.3344 11.1646 21.8374 10.6676 21.226 10.356C20.835 10.156 20.416 10.076 19.953 10.038C19.506 10 18.955 10 18.281 10ZM11.456 11.69C11.6 11.617 11.799 11.562 12.169 11.532C12.549 11.501 13.038 11.5 13.75 11.5H18.25C18.962 11.5 19.452 11.5 19.83 11.532C20.201 11.562 20.4 11.617 20.544 11.691C20.874 11.859 21.142 12.126 21.309 12.456C21.383 12.6 21.439 12.799 21.469 13.169C21.477 13.271 21.483 13.38 21.487 13.5H10.513C10.517 13.38 10.523 13.27 10.532 13.17C10.562 12.799 10.617 12.6 10.691 12.456C10.8588 12.1266 11.1266 11.8578 11.456 11.69ZM10.5 15V17.25C10.5 17.962 10.5 18.452 10.532 18.83C10.562 19.201 10.617 19.4 10.691 19.544C10.859 19.874 11.126 20.142 11.456 20.309C11.6 20.383 11.799 20.439 12.169 20.469C12.398 20.487 12.666 20.495 13 20.498V15H10.5ZM14.5 20.5H17.5V15H14.5V20.5ZM19 20.498C19.334 20.495 19.602 20.488 19.83 20.468C20.201 20.438 20.4 20.383 20.544 20.309C20.8732 20.1415 21.141 19.874 21.309 19.545C21.383 19.4 21.439 19.201 21.469 18.831C21.499 18.451 21.5 17.962 21.5 17.25V15H19V20.498Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_629_37175" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#8B46D0"/>
|
||||||
|
<stop offset="1" stop-color="#42156F"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
5
src/plugins/csv/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "CSV Viewer",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "View CSV files inline from within the terminal. I am now trying an animated gif :)"
|
||||||
|
}
|
BIN
src/plugins/csv/screenshots/csvview.gif
Normal file
After Width: | Height: | Size: 4.8 MiB |
11
src/plugins/image/icon.svg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37177)"/>
|
||||||
|
<path d="M15.3174 8.99805H16.6826C17.6351 8.99804 18.3956 8.99804 19.0099 9.04822C19.6399 9.0997 20.1818 9.20768 20.6795 9.46127C21.4791 9.86873 22.1293 10.5189 22.5368 11.3186C22.7904 11.8163 22.8984 12.3582 22.9498 12.9882C23 13.6024 23 14.363 23 15.3154L23 16.6849C23 17.6374 23 18.3979 22.9499 19.0122C22.8984 19.6422 22.7904 20.1841 22.5368 20.6818C22.1293 21.4815 21.4792 22.1316 20.6795 22.5391C20.1818 22.7927 19.6399 22.9007 19.0099 22.9521C18.3956 23.0023 17.6351 23.0023 16.6827 23.0023H15.3174C14.3649 23.0023 13.6044 23.0023 12.9901 22.9521C12.3601 22.9007 11.8182 22.7927 11.3205 22.5391C10.5209 22.1316 9.87068 21.4815 9.46322 20.6818C9.20963 20.1841 9.10165 19.6422 9.05018 19.0122C8.99999 18.3979 8.99999 17.6374 9 16.6849V15.3154C8.99999 14.363 8.99999 13.6024 9.05018 12.9882C9.10165 12.3582 9.20963 11.8163 9.46322 11.3186C9.87068 10.5189 10.5209 9.86873 11.3205 9.46127C11.8182 9.20768 12.3601 9.0997 12.9901 9.04822C13.6044 8.99804 14.3649 8.99804 15.3174 8.99805ZM13.1123 10.5432C12.575 10.5871 12.2525 10.6699 12.0015 10.7978C11.4841 11.0614 11.0634 11.4821 10.7997 11.9996C10.6718 12.2506 10.5891 12.5731 10.5452 13.1103C10.5006 13.6563 10.5 14.3556 10.5 15.348V16.6523C10.5 17.2122 10.5002 17.6788 10.5084 18.0771L11.7825 16.8029C12.487 16.0984 13.6367 16.1233 14.31 16.8578L15.1117 17.7325L17.571 15.2732C18.4497 14.3945 19.8743 14.3945 20.753 15.2732L21.5 16.0202L21.5 15.348C21.5 14.3556 21.4994 13.6563 21.4548 13.1103C21.4109 12.5731 21.3282 12.2506 21.2003 11.9996C20.9366 11.4821 20.5159 11.0614 19.9985 10.7978C19.7475 10.6699 19.425 10.5871 18.8877 10.5432C18.3417 10.4986 17.6425 10.498 16.65 10.498H15.35C14.3575 10.498 13.6583 10.4986 13.1123 10.5432ZM21.4905 18.132L19.6923 16.3339C19.3994 16.041 18.9245 16.041 18.6316 16.3339L15.9878 18.9777C15.4845 19.481 14.6633 19.4631 14.1824 18.9385L13.2042 17.8714C13.1081 17.7665 12.9438 17.7629 12.8432 17.8636L10.7692 19.9376C10.7791 19.9592 10.7893 19.9802 10.7997 20.0008C11.0634 20.5182 11.4841 20.9389 12.0015 21.2026C12.2525 21.3305 12.575 21.4132 13.1123 21.4571C13.6583 21.5017 14.3575 21.5023 15.35 21.5023H16.65C17.6425 21.5023 18.3417 21.5017 18.8877 21.4571C19.425 21.4132 19.7475 21.3305 19.9985 21.2026C20.516 20.9389 20.9366 20.5182 21.2003 20.0008C21.3282 19.7498 21.4109 19.4273 21.4548 18.89C21.4731 18.6663 21.484 18.4168 21.4905 18.132Z" fill="white"/>
|
||||||
|
<path d="M14.5009 13.2574C14.5009 13.9491 13.9402 14.5098 13.2485 14.5098C12.5568 14.5098 11.9961 13.9491 11.9961 13.2574C11.9961 12.5658 12.5568 12.0051 13.2485 12.0051C13.9402 12.0051 14.5009 12.5658 14.5009 13.2574Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_629_37177" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#F9839F"/>
|
||||||
|
<stop offset="1" stop-color="#B50A33"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.9 KiB |
5
src/plugins/image/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "ImageViewer",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "View Images inline in the terminal."
|
||||||
|
}
|
BIN
src/plugins/image/screenshots/imagviewlion.gif
Normal file
After Width: | Height: | Size: 555 KiB |
11
src/plugins/markdown/icon.svg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37174)"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.2186 9.49805H18.7814C19.4548 9.49804 20.0055 9.49803 20.4531 9.5346C20.9163 9.57245 21.3347 9.65318 21.7255 9.85227C22.337 10.1639 22.8342 10.661 23.1458 11.2726C23.3449 11.6633 23.4256 12.0817 23.4634 12.545C23.5 12.9925 23.5 13.5432 23.5 14.2166L23.5 17.7837C23.5 18.4571 23.5 19.0078 23.4635 19.4554C23.4256 19.9186 23.3449 20.337 23.1458 20.7278C22.8342 21.3393 22.337 21.8365 21.7255 22.1481C21.3348 22.3472 20.9164 22.4279 20.4531 22.4658C20.0055 22.5023 19.4548 22.5023 18.7815 22.5023H13.2186C12.5452 22.5023 11.9945 22.5023 11.5469 22.4658C11.0837 22.4279 10.6653 22.3472 10.2745 22.1481C9.663 21.8365 9.16582 21.3393 8.85423 20.7278C8.65514 20.337 8.5744 19.9187 8.53655 19.4554C8.49998 19.0078 8.49999 18.4571 8.5 17.7837V14.2166C8.49999 13.5433 8.49998 12.9925 8.53655 12.545C8.5744 12.0817 8.65514 11.6633 8.85423 11.2726C9.16582 10.6611 9.663 10.1639 10.2745 9.85228C10.6653 9.65318 11.0837 9.57245 11.5469 9.5346C11.9945 9.49803 12.5452 9.49804 13.2186 9.49805ZM11.6691 11.0296C11.2986 11.0599 11.0996 11.1154 10.9555 11.1888C10.6262 11.3566 10.3585 11.6243 10.1907 11.9536C10.1173 12.0976 10.0618 12.2966 10.0316 12.6671C10.0006 13.0464 10 13.5356 10 14.248V17.7523C10 18.4648 10.0006 18.954 10.0316 19.3332C10.0618 19.7037 10.1173 19.9028 10.1907 20.0468C10.3585 20.3761 10.6262 20.6438 10.9555 20.8116C11.0996 20.885 11.2986 20.9405 11.6691 20.9708C12.0483 21.0017 12.5376 21.0023 13.25 21.0023H18.75C19.4625 21.0023 19.9517 21.0017 20.331 20.9708C20.7015 20.9405 20.9005 20.885 21.0445 20.8116C21.3738 20.6438 21.6415 20.3761 21.8093 20.0468C21.8827 19.9028 21.9382 19.7037 21.9685 19.3332C21.9994 18.954 22 18.4647 22 17.7523L22 14.248C22 13.5356 21.9994 13.0464 21.9684 12.6671C21.9382 12.2966 21.8827 12.0976 21.8093 11.9536C21.6415 11.6243 21.3738 11.3566 21.0445 11.1888C20.9004 11.1154 20.7014 11.0599 20.3309 11.0296C19.9517 10.9986 19.4624 10.998 18.75 10.998H13.25C12.5376 10.998 12.0483 10.9986 11.6691 11.0296Z" fill="white"/>
|
||||||
|
<path d="M12.2381 12.7496H14.4497L15.971 16.457H16.0477L17.569 12.7496H19.7807V19.2951H18.042V15.511H17.9909L16.5335 19.244H15.4852L14.0278 15.4854H13.9767V19.2951H12.2381V12.7496Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_629_37174" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#5460CF"/>
|
||||||
|
<stop offset="1" stop-color="#0011B0"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
5
src/plugins/markdown/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "Markdown",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "Markdown is a lightweight markup language for creating formatted text using a plain-text editor."
|
||||||
|
}
|
11
src/plugins/mustache/icon.svg
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37176)"/>
|
||||||
|
<style>svg{fill:#ffffff}</style>
|
||||||
|
<g transform="scale(0.03) translate(220,300)">
|
||||||
|
<path d="M233.4 112c-32.9 0-64.4 13.1-87.7 36.3c-28.5 28.5-74.2 29.8-104.3 3.1l-1.5-1.3c-2.7-2.4-5.8-4.1-9-5c-1.3-.4-2.7-.7-4.1-.9c-1.1-.1-2.2-.2-3.3-.2c-3.6 .1-7 .9-10.1 2.4c-2.2 1-4.2 2.4-6 4.2C2.9 154.9 0 161.1 0 168v34C0 311.4 88.6 400 198 400c42.8 0 84.5-13.9 118.8-39.6L320 358l3.2 2.4c34.3 25.7 76 39.6 118.8 39.6c109.4 0 198-88.6 198-198V168c0-6.9-2.9-13.1-7.5-17.4c-4.2-4-9.8-6.5-16.1-6.6c-.4 0-.9 0-1.3 0c-2.4 .1-4.8 .5-7.1 1.3c-2.9 1-5.6 2.6-8 4.7l-1.5 1.3c-30.1 26.7-75.8 25.4-104.3-3.1C471 125.1 439.5 112 406.6 112h-1.2c-29.7 0-58.5 10.4-81.3 29.5l-4 3.3-4-3.3c-22.8-19-51.6-29.5-81.3-29.5h-1.2zm358.3 98.7C587.3 289.5 521.9 352 442 352c-32.5 0-64-10.5-90-30l-17.6-13.2c-8.5-6.4-20.3-6.4-28.8 0L288 322c-26 19.5-57.5 30-90 30c-79.9 0-145.3-62.5-149.8-141.3c44.3 16.7 96 7 131.4-28.4C193.9 168 213.3 160 233.4 160h1.2c18.5 0 36.4 6.5 50.6 18.3l19.3 16.1c8.9 7.4 21.8 7.4 30.7 0l19.3-16.1c14.2-11.8 32.1-18.3 50.6-18.3h1.2c20.2 0 39.5 8 53.8 22.3c35.4 35.4 87.1 45.1 131.4 28.4z"/>
|
||||||
|
</g>
|
||||||
|
<linearGradient id="paint0_linear_629_37176" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#ec9d68"/>
|
||||||
|
<stop offset="1" stop-color="#ff3002"/>
|
||||||
|
</linearGradient>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
5
src/plugins/mustache/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "Mustache",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "Mustache templates help create html files."
|
||||||
|
}
|
12
src/plugins/openai/icon.svg
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect width="32" height="32" rx="8" fill="url(#paint0_linear_629_37176)"/>
|
||||||
|
<path d="M12.7568 13.803C13.0621 13.5231 13.0828 13.0487 12.8028 12.7434C12.5229 12.438 12.0485 12.4174 11.7432 12.6973L8.74319 15.4475C8.58822 15.5896 8.49999 15.7901 8.5 16.0004C8.50001 16.2106 8.58825 16.4112 8.74322 16.5532L11.7432 19.3031C12.0486 19.5829 12.523 19.5623 12.8029 19.2569C13.0828 18.9516 13.0621 18.4772 12.7568 18.1973L10.3599 16.0003L12.7568 13.803Z" fill="white"/>
|
||||||
|
<path d="M17.7301 11.9199C17.8249 11.5167 17.5749 11.113 17.1717 11.0181C16.7685 10.9233 16.3647 11.1733 16.2699 11.5765L14.2699 20.0808C14.1751 20.484 14.4251 20.8877 14.8283 20.9826C15.2315 21.0774 15.6353 20.8274 15.7301 20.4242L17.7301 11.9199Z" fill="white"/>
|
||||||
|
<path d="M20.2568 12.6973C19.9515 12.4174 19.4771 12.438 19.1972 12.7434C18.9172 13.0487 18.9379 13.5231 19.2432 13.803L21.6401 16.0003L19.2432 18.1973C18.9379 18.4772 18.9172 18.9516 19.1971 19.2569C19.477 19.5623 19.9514 19.5829 20.2568 19.3031L23.2568 16.5532C23.4118 16.4112 23.5 16.2106 23.5 16.0004C23.5 15.7901 23.4118 15.5896 23.2568 15.4475L20.2568 12.6973Z" fill="white"/>
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="paint0_linear_629_37176" x1="0" y1="0" x2="32" y2="32" gradientUnits="userSpaceOnUse">
|
||||||
|
<stop stop-color="#68D4EC"/>
|
||||||
|
<stop offset="1" stop-color="#005B70"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
5
src/plugins/openai/meta.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"title": "OpenAI",
|
||||||
|
"vendor": "Wave",
|
||||||
|
"summary": "OpenAI plugin allows chatting with OpenAI APIs."
|
||||||
|
}
|
@ -11,89 +11,156 @@ import { OpenAIRenderer, OpenAIRendererModel } from "./openai/openai";
|
|||||||
import { isBlank } from "../util/util";
|
import { isBlank } from "../util/util";
|
||||||
import { sprintf } from "sprintf-js";
|
import { sprintf } from "sprintf-js";
|
||||||
|
|
||||||
const ImagePlugin: RendererPluginType = {
|
// TODO: @mike - I did refactoring with the though that I can move config out of this plugins.ts file to a
|
||||||
name: "image",
|
// plugins.json file. This way, adding a new plugin would reuire adding an entry to the json config. At a later
|
||||||
rendererType: "simple",
|
// stage, a plugin can become a self-contained-bundle, which would have my_plugin.json into it. it will be easy to
|
||||||
heightType: "pixels",
|
// merge this my_plugin.json into the big plugins.json. I got stuck while defining 'simpleComponent: SimpleImageRenderer'
|
||||||
dataType: "blob",
|
// in a json definition (something like Java.Reflection can be used to compose a class from its name. will try later)
|
||||||
collapseType: "hide",
|
const PluginConfigs: RendererPluginType[] = [
|
||||||
globalCss: null,
|
{
|
||||||
mimeTypes: ["image/*"],
|
name: "markdown",
|
||||||
simpleComponent: SimpleImageRenderer,
|
rendererType: "simple",
|
||||||
};
|
heightType: "pixels",
|
||||||
|
dataType: "blob",
|
||||||
const MarkdownPlugin: RendererPluginType = {
|
collapseType: "hide",
|
||||||
name: "markdown",
|
globalCss: null,
|
||||||
rendererType: "simple",
|
mimeTypes: ["text/markdown"],
|
||||||
heightType: "pixels",
|
simpleComponent: SimpleMarkdownRenderer,
|
||||||
dataType: "blob",
|
},
|
||||||
collapseType: "hide",
|
{
|
||||||
globalCss: null,
|
name: "mustache",
|
||||||
mimeTypes: ["text/markdown"],
|
rendererType: "simple",
|
||||||
simpleComponent: SimpleMarkdownRenderer,
|
heightType: "pixels",
|
||||||
};
|
dataType: "blob",
|
||||||
|
collapseType: "hide",
|
||||||
const MustachePlugin: RendererPluginType = {
|
globalCss: null,
|
||||||
name: "mustache",
|
mimeTypes: ["text/plain"],
|
||||||
rendererType: "simple",
|
simpleComponent: SimpleMustacheRenderer,
|
||||||
heightType: "pixels",
|
},
|
||||||
dataType: "blob",
|
{
|
||||||
collapseType: "hide",
|
name: "code",
|
||||||
globalCss: null,
|
rendererType: "simple",
|
||||||
mimeTypes: ["text/plain"],
|
heightType: "pixels",
|
||||||
simpleComponent: SimpleMustacheRenderer,
|
dataType: "blob",
|
||||||
};
|
collapseType: "hide",
|
||||||
|
globalCss: null,
|
||||||
const CodePlugin: RendererPluginType = {
|
mimeTypes: ["text/plain"],
|
||||||
name: "code",
|
simpleComponent: SourceCodeRenderer,
|
||||||
rendererType: "simple",
|
},
|
||||||
heightType: "pixels",
|
{
|
||||||
dataType: "blob",
|
name: "openai",
|
||||||
collapseType: "hide",
|
rendererType: "full",
|
||||||
globalCss: null,
|
heightType: "pixels",
|
||||||
mimeTypes: ["text/plain"],
|
dataType: "model",
|
||||||
simpleComponent: SourceCodeRenderer,
|
collapseType: "remove",
|
||||||
};
|
hidePrompt: true,
|
||||||
|
globalCss: null,
|
||||||
const OpenAIPlugin: RendererPluginType = {
|
mimeTypes: ["application/json"],
|
||||||
name: "openai",
|
fullComponent: OpenAIRenderer,
|
||||||
rendererType: "full",
|
modelCtor: () => new OpenAIRendererModel(),
|
||||||
heightType: "pixels",
|
},
|
||||||
dataType: "model",
|
{
|
||||||
collapseType: "remove",
|
name: "csv",
|
||||||
hidePrompt: true,
|
rendererType: "simple",
|
||||||
globalCss: null,
|
heightType: "pixels",
|
||||||
mimeTypes: ["application/json"],
|
dataType: "blob",
|
||||||
fullComponent: OpenAIRenderer,
|
collapseType: "hide",
|
||||||
modelCtor: () => new OpenAIRendererModel(),
|
globalCss: null,
|
||||||
};
|
mimeTypes: ["text/csv"],
|
||||||
|
simpleComponent: CSVRenderer,
|
||||||
const CSVPlugin: RendererPluginType = {
|
},
|
||||||
name: "csv",
|
{
|
||||||
rendererType: "simple",
|
name: "image",
|
||||||
heightType: "pixels",
|
rendererType: "simple",
|
||||||
dataType: "blob",
|
heightType: "pixels",
|
||||||
collapseType: "hide",
|
dataType: "blob",
|
||||||
globalCss: null,
|
collapseType: "hide",
|
||||||
mimeTypes: ["text/csv"],
|
globalCss: null,
|
||||||
simpleComponent: CSVRenderer,
|
mimeTypes: ["image/*"],
|
||||||
};
|
simpleComponent: SimpleImageRenderer,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
class PluginModelClass {
|
class PluginModelClass {
|
||||||
rendererPlugins: RendererPluginType[] = [];
|
rendererPlugins: RendererPluginType[] = [];
|
||||||
|
|
||||||
registerRendererPlugin(plugin: RendererPluginType) {
|
constructor(pluginConfigs: RendererPluginType[]) {
|
||||||
if (isBlank(plugin.name)) {
|
this.rendererPlugins = pluginConfigs.map((plugin: RendererPluginType): RendererPluginType => {
|
||||||
throw new Error("invalid plugin, no name");
|
if (isBlank(plugin.name)) {
|
||||||
|
throw new Error("invalid plugin, no name");
|
||||||
|
}
|
||||||
|
if (plugin.name == "terminal" || plugin.name == "none") {
|
||||||
|
throw new Error(sprintf("invalid plugin, name '%s' is reserved", plugin.name));
|
||||||
|
}
|
||||||
|
let existingPlugin = this.getRendererPluginByName(plugin.name);
|
||||||
|
if (existingPlugin != null) {
|
||||||
|
throw new Error(sprintf("plugin with name %s already registered", plugin.name));
|
||||||
|
}
|
||||||
|
this.rendererPlugins.push(plugin);
|
||||||
|
this.loadPluginResources(plugin);
|
||||||
|
return plugin;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// attach all screenshots. webpack doesnt allow dynamic paths, hence, we have to put static paths for each plugin
|
||||||
|
attachScreenshots(plugin) {
|
||||||
|
let screenshotsContext;
|
||||||
|
let imagePaths = [];
|
||||||
|
try {
|
||||||
|
switch (plugin.name) {
|
||||||
|
case "image":
|
||||||
|
screenshotsContext = require.context(`../plugins/image/screenshots`, false, /\.(png|jpe?g|gif)$/);
|
||||||
|
break;
|
||||||
|
case "markdown":
|
||||||
|
screenshotsContext = require.context(
|
||||||
|
`../plugins/markdown/screenshots`,
|
||||||
|
false,
|
||||||
|
/\.(png|jpe?g|gif)$/
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "mustache":
|
||||||
|
screenshotsContext = require.context(
|
||||||
|
`../plugins/mustache/screenshots`,
|
||||||
|
false,
|
||||||
|
/\.(png|jpe?g|gif)$/
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case "code":
|
||||||
|
screenshotsContext = require.context(`../plugins/code/screenshots`, false, /\.(png|jpe?g|gif)$/);
|
||||||
|
break;
|
||||||
|
case "openai":
|
||||||
|
screenshotsContext = require.context(`../plugins/openai/screenshots`, false, /\.(png|jpe?g|gif)$/);
|
||||||
|
break;
|
||||||
|
case "csv":
|
||||||
|
screenshotsContext = require.context(`../plugins/csv/screenshots`, false, /\.(png|jpe?g|gif)$/);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
imagePaths = screenshotsContext.keys().map(screenshotsContext);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Failed to load screenshots for plugin ${plugin.name}`);
|
||||||
}
|
}
|
||||||
if (plugin.name == "terminal" || plugin.name == "none") {
|
plugin.screenshots = imagePaths.map((path) => path.default);
|
||||||
throw new Error(sprintf("invalid plugin, name '%s' is reserved", plugin.name));
|
}
|
||||||
}
|
|
||||||
let existingPlugin = this.getRendererPluginByName(plugin.name);
|
// use dynamic import to attach the icon etc. ensure that the 'name' matches the dir the plugin is in
|
||||||
if (existingPlugin != null) {
|
async loadPluginResources(plugin) {
|
||||||
throw new Error(sprintf("plugin with name %s already registered", plugin.name));
|
this.attachScreenshots(plugin);
|
||||||
}
|
// attach other resources
|
||||||
this.rendererPlugins.push(plugin);
|
const handleImportError = (error, resourceType) =>
|
||||||
|
console.error(`Failed to load ${resourceType} for plugin ${plugin.name}`);
|
||||||
|
const iconPromise = import(`../plugins/${plugin.name}/icon.svg`)
|
||||||
|
.then((icon) => (plugin.getIcon = icon.ReactComponent))
|
||||||
|
.catch((error) => handleImportError(error, "icon"));
|
||||||
|
const readmePromise = import(`../plugins/${plugin.name}/readme.md`)
|
||||||
|
.then((content) => (plugin.readme = content.default))
|
||||||
|
.catch((error) => handleImportError(error, "readme"));
|
||||||
|
const metaPromise = import(`../plugins/${plugin.name}/meta.json`)
|
||||||
|
.then((json) => Object.assign(plugin, json))
|
||||||
|
.catch((error) => handleImportError(error, "meta"));
|
||||||
|
return Promise.allSettled([iconPromise, readmePromise, metaPromise]);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRendererPluginByName(name: string): RendererPluginType {
|
getRendererPluginByName(name: string): RendererPluginType {
|
||||||
@ -105,17 +172,15 @@ class PluginModelClass {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allPlugins() {
|
||||||
|
return this.rendererPlugins;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let PluginModel: PluginModelClass = null;
|
let PluginModel: PluginModelClass = null;
|
||||||
if ((window as any).PluginModel == null) {
|
if ((window as any).PluginModel == null) {
|
||||||
PluginModel = new PluginModelClass();
|
PluginModel = new PluginModelClass(PluginConfigs);
|
||||||
PluginModel.registerRendererPlugin(ImagePlugin);
|
|
||||||
PluginModel.registerRendererPlugin(MarkdownPlugin);
|
|
||||||
PluginModel.registerRendererPlugin(CodePlugin);
|
|
||||||
PluginModel.registerRendererPlugin(OpenAIPlugin);
|
|
||||||
PluginModel.registerRendererPlugin(MustachePlugin);
|
|
||||||
PluginModel.registerRendererPlugin(CSVPlugin);
|
|
||||||
(window as any).PluginModel = PluginModel;
|
(window as any).PluginModel = PluginModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,15 @@ var webCommon = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.svg$/,
|
test: /\.svg$/,
|
||||||
use: ["@svgr/webpack", "file-loader"],
|
use: [{ loader: "@svgr/webpack", options: { icon: true, svgo: false } }, "file-loader"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.md$/,
|
||||||
|
use: "raw-loader",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.(png|jpe?g|gif)$/i,
|
||||||
|
use: "file-loader",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -128,4 +136,4 @@ if (BundleAnalyzerPlugin != null) {
|
|||||||
webProd.plugins.push(new BundleAnalyzerPlugin());
|
webProd.plugins.push(new BundleAnalyzerPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {webDev: webDev, webProd: webProd};
|
module.exports = { webDev: webDev, webProd: webProd };
|
||||||
|
@ -6427,6 +6427,14 @@ raw-body@2.5.1:
|
|||||||
iconv-lite "0.4.24"
|
iconv-lite "0.4.24"
|
||||||
unpipe "1.0.0"
|
unpipe "1.0.0"
|
||||||
|
|
||||||
|
raw-loader@^4.0.2:
|
||||||
|
version "4.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/raw-loader/-/raw-loader-4.0.2.tgz#1aac6b7d1ad1501e66efdac1522c73e59a584eb6"
|
||||||
|
integrity sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==
|
||||||
|
dependencies:
|
||||||
|
loader-utils "^2.0.0"
|
||||||
|
schema-utils "^3.0.0"
|
||||||
|
|
||||||
rcedit@^3.0.1:
|
rcedit@^3.0.1:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-3.1.0.tgz#1563ec7a5663de639f94c5dc85429db1da364b3e"
|
resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-3.1.0.tgz#1563ec7a5663de639f94c5dc85429db1da364b3e"
|
||||||
|