mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
Add custom prompt commands (#47)
This commit is contained in:
parent
379dd90cae
commit
011f103ec6
8 changed files with 935 additions and 16 deletions
685
package-lock.json
generated
685
package-lock.json
generated
|
|
@ -11,12 +11,14 @@
|
|||
"dependencies": {
|
||||
"@huggingface/inference": "^1.8.0",
|
||||
"@tabler/icons-react": "^2.14.0",
|
||||
"@types/pouchdb": "^6.4.0",
|
||||
"axios": "^1.3.4",
|
||||
"crypto-js": "^4.1.1",
|
||||
"esbuild-plugin-svg": "^0.1.0",
|
||||
"eventsource-parser": "^1.0.0",
|
||||
"langchain": "^0.0.79",
|
||||
"next-i18next": "^13.2.2",
|
||||
"pouchdb": "^8.0.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
|
|
@ -2251,6 +2253,169 @@
|
|||
"integrity": "sha512-zvSN2Esek1aeLdKDYuntKAYjti9Z2oT4I8bfkLLhIxHlv3dwZ5vvATxOc31820iYm4hQRCwjUgDpwSMFjfTUnw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/pouchdb": {
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb/-/pouchdb-6.4.0.tgz",
|
||||
"integrity": "sha512-eGCpX+NXhd5VLJuJMzwe3L79fa9+IDTrAG3CPaf4s/31PD56hOrhDJTSmRELSXuiqXr6+OHzzP0PldSaWsFt7w==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-adapter-cordova-sqlite": "*",
|
||||
"@types/pouchdb-adapter-fruitdown": "*",
|
||||
"@types/pouchdb-adapter-http": "*",
|
||||
"@types/pouchdb-adapter-idb": "*",
|
||||
"@types/pouchdb-adapter-leveldb": "*",
|
||||
"@types/pouchdb-adapter-localstorage": "*",
|
||||
"@types/pouchdb-adapter-memory": "*",
|
||||
"@types/pouchdb-adapter-node-websql": "*",
|
||||
"@types/pouchdb-adapter-websql": "*",
|
||||
"@types/pouchdb-browser": "*",
|
||||
"@types/pouchdb-core": "*",
|
||||
"@types/pouchdb-http": "*",
|
||||
"@types/pouchdb-mapreduce": "*",
|
||||
"@types/pouchdb-node": "*",
|
||||
"@types/pouchdb-replication": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-cordova-sqlite": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-cordova-sqlite/-/pouchdb-adapter-cordova-sqlite-1.0.1.tgz",
|
||||
"integrity": "sha512-nqlXpW1ho3KBg1mUQvZgH2755y3z/rw4UA7ZJCPMRTHofxGMY8izRVw5rHBL4/7P615or0J2udpRYxgkT3D02g==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-fruitdown": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-fruitdown/-/pouchdb-adapter-fruitdown-6.1.3.tgz",
|
||||
"integrity": "sha512-Wz1Z1JLOW1hgmFQjqnSkmyyfH7by/iWb4abKn684WMvQfmxx6BxKJpJ4+eulkVPQzzgMMSgU1MpnQOm9FgRkbw==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-http": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-http/-/pouchdb-adapter-http-6.1.3.tgz",
|
||||
"integrity": "sha512-9Z4TLbF/KJWy/D2sWRPBA+RNU0odQimfdvlDX+EY7rGcd3aVoH8qjD/X0Xcd/0dfBH5pKrNIMFFQgW/TylRCmA==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-idb": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-idb/-/pouchdb-adapter-idb-6.1.4.tgz",
|
||||
"integrity": "sha512-KIAXbkF4uYUz0ZwfNEFLtEkK44mEWopAsD76UhucH92XnJloBysav+TjI4FFfYQyTjoW3S1s6V+Z14CUJZ0F6w==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-leveldb": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-leveldb/-/pouchdb-adapter-leveldb-6.1.3.tgz",
|
||||
"integrity": "sha512-ex8NFqQGFwEpFi7AaZ5YofmuemfZNsL3nTFZBUCAKYMBkazQij1pe2ILLStSvJr0XS0qxgXjCEW19T5Wqiiskg==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-localstorage": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-localstorage/-/pouchdb-adapter-localstorage-6.1.3.tgz",
|
||||
"integrity": "sha512-oor040tye1KKiGLWYtIy7rRT7C2yoyX3Tf6elEJRpjOA7Ja/H8lKc4LaSh9ATbptIcES6MRqZDxtp7ly9hsW3Q==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-memory": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-memory/-/pouchdb-adapter-memory-6.1.3.tgz",
|
||||
"integrity": "sha512-gVbsIMzDzgZYThFVT4eVNsmuZwVm/4jDxP1sjlgc3qtDIxbtBhGgyNfcskwwz9Zu5Lv1avkDsIWvcxQhnvRlHg==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-node-websql": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-node-websql/-/pouchdb-adapter-node-websql-6.1.3.tgz",
|
||||
"integrity": "sha512-F/P+os6Jsa7CgHtH64+Z0HfwIcj0hIRB5z8gNhF7L7dxPWoAfkopK5H2gydrP3sQrlGyN4WInF+UJW/Zu1+FKg==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-adapter-websql": "*",
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-adapter-websql": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-adapter-websql/-/pouchdb-adapter-websql-6.1.4.tgz",
|
||||
"integrity": "sha512-zMJQCtXC40hBsIDRn0GhmpeGMK0f9l/OGWfLguvczROzxxcOD7REI+e6SEmX7gJKw5JuMvlfuHzkQwjmvSJbtg==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-browser": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-browser/-/pouchdb-browser-6.1.3.tgz",
|
||||
"integrity": "sha512-EdYowrWxW9SWBMX/rux2eq7dbHi5Zeyzz+FF/IAsgQKnUxgeCO5VO2j4zTzos0SDyJvAQU+EYRc11r7xGn5tvA==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-adapter-http": "*",
|
||||
"@types/pouchdb-adapter-idb": "*",
|
||||
"@types/pouchdb-adapter-websql": "*",
|
||||
"@types/pouchdb-core": "*",
|
||||
"@types/pouchdb-mapreduce": "*",
|
||||
"@types/pouchdb-replication": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-core": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-core/-/pouchdb-core-7.0.11.tgz",
|
||||
"integrity": "sha512-KTKj0Taf8pLTj8eW3qBtCd1Fh+/yhEyVo6/1czTN46MnseobdmnqgXtzaKgHMbuLouh+SHK1vM++aMPaG1qTTA==",
|
||||
"dependencies": {
|
||||
"@types/debug": "*",
|
||||
"@types/pouchdb-find": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-find": {
|
||||
"version": "7.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-find/-/pouchdb-find-7.3.0.tgz",
|
||||
"integrity": "sha512-sFPli5tBjGX9UfXioik1jUzPdcN84eV82n0lmEFuoPepWqkLjQcyri0eOa++HYOaNPyMDhKFBqEALEZivK2dRg==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-http": {
|
||||
"version": "6.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-http/-/pouchdb-http-6.1.3.tgz",
|
||||
"integrity": "sha512-0e9E5SqNOyPl/3FnEIbENssB4FlJsNYuOy131nxrZk36S+y1R/6qO7ZVRypWpGTqBWSuVd7gCsq2UDwO/285+w==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-adapter-http": "*",
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-mapreduce": {
|
||||
"version": "6.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-mapreduce/-/pouchdb-mapreduce-6.1.7.tgz",
|
||||
"integrity": "sha512-WzBwm7tmO9QhfRzVaWT4v6JQSS/fG2OoUDrWrhX87rPe2Pn6laPvdK5li6myNRxCoI/l5e8Jd+oYBAFnaiFucA==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-node": {
|
||||
"version": "6.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-node/-/pouchdb-node-6.1.4.tgz",
|
||||
"integrity": "sha512-wnTCH8X1JOPpNOfVhz8HW0AvmdHh6pt40MuRj0jQnK7QEHsHS79WujsKTKSOF8QXtPwpvCNSsI7ut7H7tfxxJQ==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-adapter-http": "*",
|
||||
"@types/pouchdb-adapter-leveldb": "*",
|
||||
"@types/pouchdb-core": "*",
|
||||
"@types/pouchdb-mapreduce": "*",
|
||||
"@types/pouchdb-replication": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/pouchdb-replication": {
|
||||
"version": "6.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/pouchdb-replication/-/pouchdb-replication-6.4.4.tgz",
|
||||
"integrity": "sha512-BsE5LKpjJK4iAf6Fx5kyrMw+33V+Ip7uWldUnU2BYrrvtR+MLD22dcImm7DZN1st2wPPb91i0XEnQzvP0w1C/Q==",
|
||||
"dependencies": {
|
||||
"@types/pouchdb-core": "*",
|
||||
"@types/pouchdb-find": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/prettier": {
|
||||
"version": "2.7.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz",
|
||||
|
|
@ -2540,6 +2705,32 @@
|
|||
"integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/abort-controller": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
||||
"dependencies": {
|
||||
"event-target-shim": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.5"
|
||||
}
|
||||
},
|
||||
"node_modules/abstract-leveldown": {
|
||||
"version": "6.2.3",
|
||||
"resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz",
|
||||
"integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==",
|
||||
"dependencies": {
|
||||
"buffer": "^5.5.0",
|
||||
"immediate": "^3.2.3",
|
||||
"level-concat-iterator": "~2.0.0",
|
||||
"level-supports": "~1.0.0",
|
||||
"xtend": "~4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.8.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz",
|
||||
|
|
@ -2956,11 +3147,33 @@
|
|||
"node-int64": "^0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
||||
},
|
||||
"node_modules/builtin-modules": {
|
||||
"version": "3.3.0",
|
||||
|
|
@ -3126,6 +3339,14 @@
|
|||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/clone-buffer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz",
|
||||
"integrity": "sha512-KLLTJWrvwIP+OPfMn0x2PheDEP20RPUcGXj/ERegTgdmPEZylALQldygiqrPPu8P45uNuPs7ckmReLY6v/iA5g==",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/co": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||
|
|
@ -3210,6 +3431,11 @@
|
|||
"url": "https://opencollective.com/core-js"
|
||||
}
|
||||
},
|
||||
"node_modules/core-util-is": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
||||
},
|
||||
"node_modules/cross-fetch": {
|
||||
"version": "3.1.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz",
|
||||
|
|
@ -3427,6 +3653,18 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/deferred-leveldown": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz",
|
||||
"integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==",
|
||||
"dependencies": {
|
||||
"abstract-leveldown": "~6.2.1",
|
||||
"inherits": "^2.0.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/define-properties": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
|
||||
|
|
@ -3587,6 +3825,11 @@
|
|||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/double-ended-queue": {
|
||||
"version": "2.1.0-0",
|
||||
"resolved": "https://registry.npmjs.org/double-ended-queue/-/double-ended-queue-2.1.0-0.tgz",
|
||||
"integrity": "sha512-+BNfZ+deCo8hMNpDqDnvT+c0XpJ5cUa6mqYq89bho2Ifze4URTqRkcwR399hWoTrTkbZ/XJYDgP6rc7pRgffEQ=="
|
||||
},
|
||||
"node_modules/electron-to-chromium": {
|
||||
"version": "1.4.368",
|
||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.368.tgz",
|
||||
|
|
@ -3611,6 +3854,28 @@
|
|||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/encoding-down": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz",
|
||||
"integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==",
|
||||
"dependencies": {
|
||||
"abstract-leveldown": "^6.2.1",
|
||||
"inherits": "^2.0.3",
|
||||
"level-codec": "^9.0.0",
|
||||
"level-errors": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/end-stream": {
|
||||
"version": "0.1.0",
|
||||
"resolved": "https://registry.npmjs.org/end-stream/-/end-stream-0.1.0.tgz",
|
||||
"integrity": "sha512-Brl10T8kYnc75IepKizW6Y9liyW8ikz1B7n/xoHrJxoVSSjoqPn30sb7XVFfQERK4QfUMYRGs9dhWwtt2eu6uA==",
|
||||
"dependencies": {
|
||||
"write-stream": "~0.4.3"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||
|
|
@ -3623,6 +3888,17 @@
|
|||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/errno": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz",
|
||||
"integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==",
|
||||
"dependencies": {
|
||||
"prr": "~1.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"errno": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/error-ex": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
|
|
@ -4048,6 +4324,14 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/event-target-shim": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/eventemitter3": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
|
||||
|
|
@ -4196,6 +4480,17 @@
|
|||
"bser": "2.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/fetch-cookie": {
|
||||
"version": "0.11.0",
|
||||
"resolved": "https://registry.npmjs.org/fetch-cookie/-/fetch-cookie-0.11.0.tgz",
|
||||
"integrity": "sha512-BQm7iZLFhMWFy5CZ/162sAGjBfdNWb7a8LEqqnzsHFhxT/X/SVj/z2t2nu3aJvjlbQkrAlTUApplPRjWyH4mhA==",
|
||||
"dependencies": {
|
||||
"tough-cookie": "^2.3.3 || ^3.0.1 || ^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/file-entry-cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz",
|
||||
|
|
@ -4756,6 +5051,25 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ieee754": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
|
||||
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "5.2.4",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",
|
||||
|
|
@ -4765,6 +5079,11 @@
|
|||
"node": ">= 4"
|
||||
}
|
||||
},
|
||||
"node_modules/immediate": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz",
|
||||
"integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q=="
|
||||
},
|
||||
"node_modules/import-fresh": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||
|
|
@ -4832,8 +5151,7 @@
|
|||
"node_modules/inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||
},
|
||||
"node_modules/inline-style-parser": {
|
||||
"version": "0.1.1",
|
||||
|
|
@ -6755,6 +7073,158 @@
|
|||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/level": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/level/-/level-6.0.1.tgz",
|
||||
"integrity": "sha512-psRSqJZCsC/irNhfHzrVZbmPYXDcEYhA5TVNwr+V92jF44rbf86hqGp8fiT702FyiArScYIlPSBTDUASCVNSpw==",
|
||||
"dependencies": {
|
||||
"level-js": "^5.0.0",
|
||||
"level-packager": "^5.1.0",
|
||||
"leveldown": "^5.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/level"
|
||||
}
|
||||
},
|
||||
"node_modules/level-codec": {
|
||||
"version": "9.0.2",
|
||||
"resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz",
|
||||
"integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==",
|
||||
"dependencies": {
|
||||
"buffer": "^5.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-concat-iterator": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz",
|
||||
"integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-errors": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz",
|
||||
"integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==",
|
||||
"dependencies": {
|
||||
"errno": "~0.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-iterator-stream": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz",
|
||||
"integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.4",
|
||||
"readable-stream": "^3.4.0",
|
||||
"xtend": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-iterator-stream/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-iterator-stream/node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/level-js": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/level-js/-/level-js-5.0.2.tgz",
|
||||
"integrity": "sha512-SnBIDo2pdO5VXh02ZmtAyPP6/+6YTJg2ibLtl9C34pWvmtMEmRTWpra+qO/hifkUtBTOtfx6S9vLDjBsBK4gRg==",
|
||||
"dependencies": {
|
||||
"abstract-leveldown": "~6.2.3",
|
||||
"buffer": "^5.5.0",
|
||||
"inherits": "^2.0.3",
|
||||
"ltgt": "^2.1.2"
|
||||
}
|
||||
},
|
||||
"node_modules/level-packager": {
|
||||
"version": "5.1.1",
|
||||
"resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz",
|
||||
"integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==",
|
||||
"dependencies": {
|
||||
"encoding-down": "^6.3.0",
|
||||
"levelup": "^4.3.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-supports": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz",
|
||||
"integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==",
|
||||
"dependencies": {
|
||||
"xtend": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/level-write-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/level-write-stream/-/level-write-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-bBNKOEOMl8msO+uIM9YX/gUO6ckokZ/4pCwTm/lwvs46x6Xs8Zy0sn3Vh37eDqse4mhy4fOMIb/JsSM2nyQFtw==",
|
||||
"dependencies": {
|
||||
"end-stream": "~0.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/leveldown": {
|
||||
"version": "5.6.0",
|
||||
"resolved": "https://registry.npmjs.org/leveldown/-/leveldown-5.6.0.tgz",
|
||||
"integrity": "sha512-iB8O/7Db9lPaITU1aA2txU/cBEXAt4vWwKQRrrWuS6XDgbP4QZGj9BL2aNbwb002atoQ/lIotJkfyzz+ygQnUQ==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"abstract-leveldown": "~6.2.1",
|
||||
"napi-macros": "~2.0.0",
|
||||
"node-gyp-build": "~4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/levelup": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz",
|
||||
"integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==",
|
||||
"dependencies": {
|
||||
"deferred-leveldown": "~5.3.0",
|
||||
"level-errors": "~2.0.0",
|
||||
"level-iterator-stream": "~4.0.0",
|
||||
"level-supports": "~1.0.0",
|
||||
"xtend": "~4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/leven": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
|
||||
|
|
@ -6852,6 +7322,11 @@
|
|||
"yallist": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/ltgt": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz",
|
||||
"integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA=="
|
||||
},
|
||||
"node_modules/lz-string": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz",
|
||||
|
|
@ -7552,6 +8027,11 @@
|
|||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/napi-macros": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.0.0.tgz",
|
||||
"integrity": "sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg=="
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
|
||||
|
|
@ -7684,6 +8164,16 @@
|
|||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-gyp-build": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.1.1.tgz",
|
||||
"integrity": "sha512-dSq1xmcPDKPZ2EED2S6zw/b9NKsqzXRE6dVr8TVQnI3FJOTteUMuqF3Qqs6LZg+mLGYJWqQzMbIjMtJqTv87nQ==",
|
||||
"bin": {
|
||||
"node-gyp-build": "bin.js",
|
||||
"node-gyp-build-optional": "optional.js",
|
||||
"node-gyp-build-test": "build-test.js"
|
||||
}
|
||||
},
|
||||
"node_modules/node-int64": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
|
||||
|
|
@ -8188,6 +8678,77 @@
|
|||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/pouchdb": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pouchdb/-/pouchdb-8.0.1.tgz",
|
||||
"integrity": "sha512-xp5S83JOQn2NAL0ZQ5CU+DI26V9/YrYuVtkXnbGEIDrYiFfj5A8gAcfbxefXb/9O+Qn4n5RaT/19+8UBSZ42sw==",
|
||||
"dependencies": {
|
||||
"abort-controller": "3.0.0",
|
||||
"buffer-from": "1.1.2",
|
||||
"clone-buffer": "1.0.0",
|
||||
"double-ended-queue": "2.1.0-0",
|
||||
"fetch-cookie": "0.11.0",
|
||||
"immediate": "3.3.0",
|
||||
"level": "6.0.1",
|
||||
"level-codec": "9.0.2",
|
||||
"level-write-stream": "1.0.0",
|
||||
"leveldown": "5.6.0",
|
||||
"levelup": "4.4.0",
|
||||
"ltgt": "2.2.1",
|
||||
"node-fetch": "2.6.7",
|
||||
"readable-stream": "1.1.14",
|
||||
"spark-md5": "3.0.2",
|
||||
"through2": "3.0.2",
|
||||
"uuid": "8.3.2",
|
||||
"vuvuzela": "1.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/pouchdb/node_modules/node-fetch": {
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/pouchdb/node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/pouchdb/node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
||||
"bin": {
|
||||
"uuid": "dist/bin/uuid"
|
||||
}
|
||||
},
|
||||
"node_modules/pouchdb/node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/pouchdb/node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prelude-ls": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
|
||||
|
|
@ -8275,17 +8836,20 @@
|
|||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"node_modules/prr": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
|
||||
"integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw=="
|
||||
},
|
||||
"node_modules/psl": {
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
|
||||
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
|
||||
"dev": true
|
||||
"integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag=="
|
||||
},
|
||||
"node_modules/punycode": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
|
||||
"integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
|
|
@ -8309,8 +8873,7 @@
|
|||
"node_modules/querystringify": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
|
||||
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
|
||||
},
|
||||
"node_modules/queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
|
|
@ -8432,6 +8995,22 @@
|
|||
"react": ">= 0.14.0"
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "1.1.14",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
||||
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
||||
"dependencies": {
|
||||
"core-util-is": "~1.0.0",
|
||||
"inherits": "~2.0.1",
|
||||
"isarray": "0.0.1",
|
||||
"string_decoder": "~0.10.x"
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream/node_modules/isarray": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
||||
},
|
||||
"node_modules/redent": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz",
|
||||
|
|
@ -8542,8 +9121,7 @@
|
|||
"node_modules/requires-port": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ=="
|
||||
},
|
||||
"node_modules/resolve": {
|
||||
"version": "1.22.2",
|
||||
|
|
@ -8670,6 +9248,25 @@
|
|||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
]
|
||||
},
|
||||
"node_modules/safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
|
|
@ -8821,6 +9418,11 @@
|
|||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/spark-md5": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-3.0.2.tgz",
|
||||
"integrity": "sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw=="
|
||||
},
|
||||
"node_modules/sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
|
|
@ -8881,6 +9483,11 @@
|
|||
"node": ">=10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string_decoder": {
|
||||
"version": "0.10.31",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
|
||||
},
|
||||
"node_modules/string-length": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz",
|
||||
|
|
@ -9071,6 +9678,36 @@
|
|||
"dev": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/through2": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz",
|
||||
"integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.4",
|
||||
"readable-stream": "2 || 3"
|
||||
}
|
||||
},
|
||||
"node_modules/through2/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/through2/node_modules/string_decoder": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
|
||||
"integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
|
||||
"dependencies": {
|
||||
"safe-buffer": "~5.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tmpl": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
||||
|
|
@ -9102,7 +9739,6 @@
|
|||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz",
|
||||
"integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"psl": "^1.1.33",
|
||||
"punycode": "^2.1.1",
|
||||
|
|
@ -9354,7 +9990,6 @@
|
|||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
|
||||
"integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 4.0.0"
|
||||
}
|
||||
|
|
@ -9403,12 +10038,16 @@
|
|||
"version": "1.5.10",
|
||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
||||
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"querystringify": "^2.1.1",
|
||||
"requires-port": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/util-deprecate": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
|
||||
"integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
|
||||
|
|
@ -9499,6 +10138,11 @@
|
|||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vuvuzela": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vuvuzela/-/vuvuzela-1.0.3.tgz",
|
||||
"integrity": "sha512-Tm7jR1xTzBbPW+6y1tknKiEhz04Wf/1iZkcTJjSFcpNko43+dFW6+OOeQe9taJIug3NdfUAjFKgUSyQrIKaDvQ=="
|
||||
},
|
||||
"node_modules/w3c-keyname": {
|
||||
"version": "2.2.6",
|
||||
"resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.6.tgz",
|
||||
|
|
@ -9681,6 +10325,19 @@
|
|||
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/write-stream": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/write-stream/-/write-stream-0.4.3.tgz",
|
||||
"integrity": "sha512-IJrvkhbAnj89W/GAVdVgbnPiVw5Ntg/B4tc/MUCIEwj/g6JIww1DWJyB/yBMT3yw2/TkT6IUZ0+IYef3flEw8A==",
|
||||
"dependencies": {
|
||||
"readable-stream": "~0.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/write-stream/node_modules/readable-stream": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-0.0.4.tgz",
|
||||
"integrity": "sha512-azrivNydKRYt7zwLV5wWUK7YzKTWs3q87xSmY6DlHapPrCvaT6ZrukvM5erV+yCSSPmZT8zkSdttOHQpWWm9zw=="
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.13.0",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz",
|
||||
|
|
|
|||
|
|
@ -36,12 +36,14 @@
|
|||
"dependencies": {
|
||||
"@huggingface/inference": "^1.8.0",
|
||||
"@tabler/icons-react": "^2.14.0",
|
||||
"@types/pouchdb": "^6.4.0",
|
||||
"axios": "^1.3.4",
|
||||
"crypto-js": "^4.1.1",
|
||||
"esbuild-plugin-svg": "^0.1.0",
|
||||
"eventsource-parser": "^1.0.0",
|
||||
"langchain": "^0.0.79",
|
||||
"next-i18next": "^13.2.2",
|
||||
"pouchdb": "^8.0.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
|
|
|
|||
72
src/components/AddPromptModal.tsx
Normal file
72
src/components/AddPromptModal.tsx
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
import { App, Modal, Notice } from "obsidian";
|
||||
|
||||
|
||||
export class AddPromptModal extends Modal {
|
||||
constructor(app: App, onSave: (title: string, prompt: string) => void) {
|
||||
super(app);
|
||||
|
||||
this.contentEl.createEl('h2', { text: 'Add Custom Prompt' });
|
||||
|
||||
const formContainer = this.contentEl.createEl('div', { cls: 'custom-prompt-modal' });
|
||||
|
||||
const titleContainer = formContainer.createEl(
|
||||
'div',
|
||||
{ cls: 'custom-prompt-input-container' }
|
||||
);
|
||||
|
||||
titleContainer.createEl(
|
||||
'h3', { text: 'Title', cls: 'custom-prompt-header' }
|
||||
);
|
||||
titleContainer.createEl(
|
||||
'p',
|
||||
{
|
||||
text: 'The title of the prompt, must be unique.',
|
||||
cls: 'custom-prompt-description',
|
||||
}
|
||||
);
|
||||
|
||||
const titleField = titleContainer.createEl('input', { type: 'text' });
|
||||
|
||||
const promptContainer = formContainer.createEl(
|
||||
'div',
|
||||
{ cls: 'custom-prompt-input-container' }
|
||||
);
|
||||
|
||||
promptContainer.createEl(
|
||||
'h3', { text: 'Prompt', cls: 'custom-prompt-header' }
|
||||
);
|
||||
promptContainer.createEl(
|
||||
'p',
|
||||
{
|
||||
text: 'The content of the prompt. Use "{}" to represent the selected text. For example, "Improve the readability of the following text: {}"',
|
||||
cls: 'custom-prompt-description',
|
||||
}
|
||||
);
|
||||
const promptField = promptContainer.createEl('textarea');
|
||||
|
||||
promptContainer.createEl(
|
||||
'p',
|
||||
{
|
||||
text: 'Save the prompt to the local prompt library. You can then use it with the Copilot command: *Apply custom prompt to selection*.',
|
||||
cls: 'custom-prompt-description',
|
||||
}
|
||||
);
|
||||
|
||||
const saveButtonContainer = formContainer.createEl(
|
||||
'div',
|
||||
{ cls: 'custom-prompt-save-btn-container' }
|
||||
);
|
||||
const saveButton = saveButtonContainer.createEl(
|
||||
'button',
|
||||
{ text: 'Save', cls: 'custom-prompt-save-btn' }
|
||||
);
|
||||
saveButton.addEventListener('click', () => {
|
||||
if (titleField.value && promptField.value) {
|
||||
onSave(titleField.value, promptField.value);
|
||||
this.close();
|
||||
} else {
|
||||
new Notice('Please fill in both fields: Title and Prompt.');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@ import {
|
|||
createTranslateSelectionPrompt,
|
||||
eli5SelectionPrompt,
|
||||
emojifyPrompt,
|
||||
fillInSelectionForCustomPrompt,
|
||||
fixGrammarSpellingSelectionPrompt,
|
||||
formatDateTime,
|
||||
getChatContext,
|
||||
|
|
@ -28,7 +29,7 @@ import {
|
|||
rewriteTweetThreadSelectionPrompt,
|
||||
simplifyPrompt,
|
||||
summarizePrompt,
|
||||
tocPrompt
|
||||
tocPrompt,
|
||||
} from '@/utils';
|
||||
import { EventEmitter } from 'events';
|
||||
import { Notice, TFile } from 'obsidian';
|
||||
|
|
@ -142,7 +143,7 @@ const Chat: React.FC<ChatProps> = ({
|
|||
if (vectorStore) {
|
||||
activeNoteOnMessage = {
|
||||
sender: AI_SENDER,
|
||||
message: `I have Read [[${noteName}]].\n\n Please switch to "QA: Active Note" to ask questions about it.`,
|
||||
message: `I have read [[${noteName}]].\n\n Please switch to "QA: Active Note" to ask questions about it.`,
|
||||
isVisible: true,
|
||||
};
|
||||
if (currentChain === RETRIEVAL_QA_CHAIN) {
|
||||
|
|
@ -257,6 +258,13 @@ const Chat: React.FC<ChatProps> = ({
|
|||
),
|
||||
[]
|
||||
);
|
||||
useEffect(
|
||||
createEffect("applyCustomPromptSelection", (selectedText, prompt) =>
|
||||
fillInSelectionForCustomPrompt(prompt)(selectedText)
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<div className="chat-container">
|
||||
|
|
|
|||
31
src/components/ListPromptModal.tsx
Normal file
31
src/components/ListPromptModal.tsx
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import { App, FuzzySuggestModal } from "obsidian";
|
||||
|
||||
|
||||
export class ListPromptModal extends FuzzySuggestModal<string> {
|
||||
private onChoosePromptTitle: (promptTitle: string) => void;
|
||||
private promptTitles: string[];
|
||||
|
||||
constructor(
|
||||
app: App,
|
||||
promptTitles: string[],
|
||||
onChoosePromptTitle: (promptTitle: string) => void
|
||||
) {
|
||||
super(app);
|
||||
this.promptTitles = promptTitles;
|
||||
this.onChoosePromptTitle = onChoosePromptTitle;
|
||||
}
|
||||
|
||||
getItems(): string[] {
|
||||
return this.promptTitles;
|
||||
}
|
||||
|
||||
getItemText(promptTitle: string): string {
|
||||
return promptTitle;
|
||||
}
|
||||
|
||||
onChooseItem(promptTitle: string, evt: MouseEvent | KeyboardEvent) {
|
||||
this.onChoosePromptTitle(promptTitle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
104
src/main.ts
104
src/main.ts
|
|
@ -1,7 +1,9 @@
|
|||
import AIState, { LangChainParams } from '@/aiState';
|
||||
import { LLM_CHAIN } from '@/chainFactory';
|
||||
import { AddPromptModal } from "@/components/AddPromptModal";
|
||||
import CopilotView from '@/components/CopilotView';
|
||||
import { LanguageModal } from "@/components/LanguageModal";
|
||||
import { ListPromptModal } from "@/components/ListPromptModal";
|
||||
import { ToneModal } from "@/components/ToneModal";
|
||||
import {
|
||||
CHAT_VIEWTYPE, DEFAULT_SETTINGS, DEFAULT_SYSTEM_PROMPT
|
||||
|
|
@ -10,6 +12,8 @@ import { CopilotSettingTab } from '@/settings';
|
|||
import SharedState from '@/sharedState';
|
||||
import { sanitizeSettings } from "@/utils";
|
||||
import { Editor, Notice, Plugin, WorkspaceLeaf } from 'obsidian';
|
||||
import PouchDB from 'pouchdb';
|
||||
|
||||
|
||||
export interface CopilotSettings {
|
||||
openAiApiKey: string;
|
||||
|
|
@ -25,6 +29,12 @@ export interface CopilotSettings {
|
|||
debug: boolean;
|
||||
}
|
||||
|
||||
interface CustomPrompt {
|
||||
_id: string;
|
||||
_rev?: string;
|
||||
prompt: string;
|
||||
}
|
||||
|
||||
export default class CopilotPlugin extends Plugin {
|
||||
settings: CopilotSettings;
|
||||
// A chat history that stores the messages sent and received
|
||||
|
|
@ -33,6 +43,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
aiState: AIState;
|
||||
activateViewPromise: Promise<void> | null = null;
|
||||
chatIsVisible = false;
|
||||
dbPrompts: PouchDB.Database;
|
||||
|
||||
isChatVisible = () => this.chatIsVisible;
|
||||
|
||||
|
|
@ -43,6 +54,7 @@ export default class CopilotPlugin extends Plugin {
|
|||
this.sharedState = new SharedState();
|
||||
const langChainParams = this.getAIStateParams();
|
||||
this.aiState = new AIState(langChainParams);
|
||||
this.dbPrompts = new PouchDB<CustomPrompt>('copilot_custom_prompts');
|
||||
|
||||
this.registerView(
|
||||
CHAT_VIEWTYPE,
|
||||
|
|
@ -201,6 +213,91 @@ export default class CopilotPlugin extends Plugin {
|
|||
this.processSelection(editor, 'countTokensSelection');
|
||||
},
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: 'add-custom-prompt',
|
||||
name: 'Add custom prompt for selection',
|
||||
editorCallback: (editor: Editor) => {
|
||||
new AddPromptModal(this.app, async (title: string, prompt: string) => {
|
||||
try {
|
||||
// Save the prompt to the database
|
||||
await this.dbPrompts.put({ _id: title, prompt: prompt });
|
||||
new Notice('Custom prompt saved successfully.');
|
||||
} catch (e) {
|
||||
new Notice('Error saving custom prompt.');
|
||||
console.error(e);
|
||||
}
|
||||
}).open();
|
||||
},
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: 'apply-custom-prompt',
|
||||
name: 'Apply custom prompt to selection',
|
||||
editorCallback: (editor: Editor) => {
|
||||
this.fetchPromptTitles().then((promptTitles: string[]) => {
|
||||
new ListPromptModal(this.app, promptTitles, async (promptTitle: string) => {
|
||||
if (!promptTitle) {
|
||||
new Notice('Please select a prompt title.');
|
||||
return;
|
||||
}
|
||||
try {
|
||||
const doc = await this.dbPrompts.get(promptTitle) as CustomPrompt;
|
||||
if (!doc.prompt) {
|
||||
new Notice(`No prompt found with the title "${promptTitle}".`);
|
||||
return;
|
||||
}
|
||||
this.processSelection(editor, 'applyCustomPromptSelection', doc.prompt);
|
||||
} catch (err) {
|
||||
if (err.name === 'not_found') {
|
||||
new Notice(`No prompt found with the title "${promptTitle}".`);
|
||||
} else {
|
||||
console.error(err);
|
||||
new Notice('An error occurred.');
|
||||
}
|
||||
}
|
||||
}).open();
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: 'delete-custom-prompt',
|
||||
name: 'Delete custom prompt',
|
||||
checkCallback: (checking: boolean) => {
|
||||
if (checking) {
|
||||
return true;
|
||||
}
|
||||
|
||||
this.fetchPromptTitles().then((promptTitles: string[]) => {
|
||||
new ListPromptModal(this.app, promptTitles, async (promptTitle: string) => {
|
||||
if (!promptTitle) {
|
||||
new Notice('Please select a prompt title.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const doc = await this.dbPrompts.get(promptTitle);
|
||||
if (doc._rev) {
|
||||
await this.dbPrompts.remove(doc as PouchDB.Core.RemoveDocument);
|
||||
new Notice(`Prompt "${promptTitle}" has been deleted.`);
|
||||
} else {
|
||||
new Notice(`Failed to delete prompt "${promptTitle}": No revision found.`);
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.name === 'not_found') {
|
||||
new Notice(`No prompt found with the title "${promptTitle}".`);
|
||||
} else {
|
||||
console.error(err);
|
||||
new Notice('An error occurred while deleting the prompt.');
|
||||
}
|
||||
}
|
||||
}).open();
|
||||
});
|
||||
|
||||
return true;
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
processSelection(editor: Editor, eventType: string, eventSubtype?: string) {
|
||||
|
|
@ -257,6 +354,13 @@ export default class CopilotPlugin extends Plugin {
|
|||
await this.saveData(this.settings);
|
||||
}
|
||||
|
||||
async fetchPromptTitles(): Promise<string[]> {
|
||||
const response = await this.dbPrompts.allDocs({ include_docs: true });
|
||||
return response.rows
|
||||
.map(row => (row.doc as CustomPrompt)?._id)
|
||||
.filter(Boolean) as string[];
|
||||
}
|
||||
|
||||
getAIStateParams(): LangChainParams {
|
||||
const {
|
||||
openAiApiKey,
|
||||
|
|
|
|||
|
|
@ -158,3 +158,12 @@ export function createChangeToneSelectionPrompt(tone?: string) {
|
|||
return `Please change the tone of the following text to ${tone}:\n\n` + `${selectedText}`;
|
||||
};
|
||||
}
|
||||
|
||||
export function fillInSelectionForCustomPrompt(prompt?: string) {
|
||||
return (selectedText: string): string => {
|
||||
if (!prompt) {
|
||||
return selectedText;
|
||||
}
|
||||
return prompt.replace('{}', selectedText);
|
||||
};
|
||||
}
|
||||
|
|
|
|||
36
styles.css
36
styles.css
|
|
@ -217,3 +217,39 @@ If your plugin does not need CSS, delete this file.
|
|||
.bot-message {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
/* Apply some style to AddPromptModal */
|
||||
.custom-prompt-modal {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.custom-prompt-input-container {
|
||||
width: 90%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.custom-prompt-input-container input,
|
||||
.custom-prompt-input-container textarea {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.custom-prompt-input-container textarea {
|
||||
height: 150px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.custom-prompt-save-btn-container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.custom-prompt-save-btn {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue