ShortcutsModal.svelte 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <script lang="ts">
  2. import { getContext } from 'svelte';
  3. import Modal from '../common/Modal.svelte';
  4. const i18n = getContext('i18n');
  5. export let show = false;
  6. </script>
  7. <Modal bind:show>
  8. <div class="text-gray-700 dark:text-gray-100">
  9. <div class=" flex justify-between dark:text-gray-300 px-5 pt-4">
  10. <div class=" text-lg font-medium self-center">{$i18n.t('Keyboard shortcuts')}</div>
  11. <button
  12. class="self-center"
  13. on:click={() => {
  14. show = false;
  15. }}
  16. >
  17. <svg
  18. xmlns="http://www.w3.org/2000/svg"
  19. viewBox="0 0 20 20"
  20. fill="currentColor"
  21. class="w-5 h-5"
  22. >
  23. <path
  24. d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
  25. />
  26. </svg>
  27. </button>
  28. </div>
  29. <div class="flex flex-col md:flex-row w-full p-5 md:space-x-4 dark:text-gray-200">
  30. <div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
  31. <div class="flex flex-col space-y-3 w-full self-start">
  32. <div class="w-full flex justify-between items-center">
  33. <div class=" text-sm">{$i18n.t('Open new chat')}</div>
  34. <div class="flex space-x-1 text-xs">
  35. <div
  36. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  37. >
  38. Ctrl/⌘
  39. </div>
  40. <div
  41. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  42. >
  43. Shift
  44. </div>
  45. <div
  46. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  47. >
  48. O
  49. </div>
  50. </div>
  51. </div>
  52. <div class="w-full flex justify-between items-center">
  53. <div class=" text-sm">{$i18n.t('Focus chat input')}</div>
  54. <div class="flex space-x-1 text-xs">
  55. <div
  56. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  57. >
  58. Shift
  59. </div>
  60. <div
  61. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  62. >
  63. Esc
  64. </div>
  65. </div>
  66. </div>
  67. <div class="w-full flex justify-between items-center">
  68. <div class=" text-sm">{$i18n.t('Copy last code block')}</div>
  69. <div class="flex space-x-1 text-xs">
  70. <div
  71. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  72. >
  73. Ctrl/⌘
  74. </div>
  75. <div
  76. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  77. >
  78. Shift
  79. </div>
  80. <div
  81. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  82. >
  83. ;
  84. </div>
  85. </div>
  86. </div>
  87. <div class="w-full flex justify-between items-center">
  88. <div class=" text-sm">{$i18n.t('Copy last response')}</div>
  89. <div class="flex space-x-1 text-xs">
  90. <div
  91. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  92. >
  93. Ctrl/⌘
  94. </div>
  95. <div
  96. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  97. >
  98. Shift
  99. </div>
  100. <div
  101. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  102. >
  103. C
  104. </div>
  105. </div>
  106. </div>
  107. <div class="w-full flex justify-between items-center">
  108. <div class=" text-sm">{$i18n.t('Generate prompt pair')}</div>
  109. <div class="flex space-x-1 text-xs">
  110. <div
  111. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  112. >
  113. Ctrl/⌘
  114. </div>
  115. <div
  116. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  117. >
  118. Shift
  119. </div>
  120. <div
  121. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  122. >
  123. Enter
  124. </div>
  125. </div>
  126. </div>
  127. </div>
  128. <div class="flex flex-col space-y-3 w-full self-start">
  129. <div class="w-full flex justify-between items-center">
  130. <div class=" text-sm">{$i18n.t('Toggle settings')}</div>
  131. <div class="flex space-x-1 text-xs">
  132. <div
  133. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  134. >
  135. Ctrl/⌘
  136. </div>
  137. <div
  138. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  139. >
  140. .
  141. </div>
  142. </div>
  143. </div>
  144. <div class="w-full flex justify-between items-center">
  145. <div class=" text-sm">{$i18n.t('Toggle sidebar')}</div>
  146. <div class="flex space-x-1 text-xs">
  147. <div
  148. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  149. >
  150. Ctrl/⌘
  151. </div>
  152. <div
  153. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  154. >
  155. Shift
  156. </div>
  157. <div
  158. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  159. >
  160. S
  161. </div>
  162. </div>
  163. </div>
  164. <div class="w-full flex justify-between items-center">
  165. <div class=" text-sm">{$i18n.t('Delete chat')}</div>
  166. <div class="flex space-x-1 text-xs">
  167. <div
  168. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  169. >
  170. Ctrl/⌘
  171. </div>
  172. <div
  173. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  174. >
  175. Shift
  176. </div>
  177. <div
  178. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  179. >
  180. ⌫/Delete
  181. </div>
  182. </div>
  183. </div>
  184. <div class="w-full flex justify-between items-center">
  185. <div class=" text-sm">{$i18n.t('Show shortcuts')}</div>
  186. <div class="flex space-x-1 text-xs">
  187. <div
  188. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  189. >
  190. Ctrl/⌘
  191. </div>
  192. <div
  193. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  194. >
  195. /
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <div class=" flex justify-between dark:text-gray-300 px-5">
  203. <div class=" text-lg font-medium self-center">{$i18n.t('Input commands')}</div>
  204. </div>
  205. <div class="flex flex-col md:flex-row w-full p-5 md:space-x-4 dark:text-gray-200">
  206. <div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
  207. <div class="flex flex-col space-y-3 w-full self-start">
  208. <div class="w-full flex justify-between items-center">
  209. <div class=" text-sm">
  210. {$i18n.t('Attach file from knowledge')}
  211. </div>
  212. <div class="flex space-x-1 text-xs">
  213. <div
  214. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  215. >
  216. #
  217. </div>
  218. </div>
  219. </div>
  220. <div class="w-full flex justify-between items-center">
  221. <div class=" text-sm">
  222. {$i18n.t('Add custom prompt')}
  223. </div>
  224. <div class="flex space-x-1 text-xs">
  225. <div
  226. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  227. >
  228. /
  229. </div>
  230. </div>
  231. </div>
  232. <div class="w-full flex justify-between items-center">
  233. <div class=" text-sm">
  234. {$i18n.t('Talk to model')}
  235. </div>
  236. <div class="flex space-x-1 text-xs">
  237. <div
  238. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  239. >
  240. @
  241. </div>
  242. </div>
  243. </div>
  244. <div class="w-full flex justify-between items-center">
  245. <div class=" text-sm">
  246. {$i18n.t('Accept autocomplete generation / Jump to prompt variable')}
  247. </div>
  248. <div class="flex space-x-1 text-xs">
  249. <div
  250. class=" h-fit py-1 px-2 flex items-center justify-center rounded-sm border border-black/10 capitalize text-gray-600 dark:border-white/10 dark:text-gray-300"
  251. >
  252. TAB
  253. </div>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. </div>
  259. </div>
  260. </Modal>
  261. <style>
  262. input::-webkit-outer-spin-button,
  263. input::-webkit-inner-spin-button {
  264. /* display: none; <- Crashes Chrome on hover */
  265. -webkit-appearance: none;
  266. margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
  267. }
  268. .tabs::-webkit-scrollbar {
  269. display: none; /* for Chrome, Safari and Opera */
  270. }
  271. .tabs {
  272. -ms-overflow-style: none; /* IE and Edge */
  273. scrollbar-width: none; /* Firefox */
  274. }
  275. input[type='number'] {
  276. -moz-appearance: textfield; /* Firefox */
  277. }
  278. </style>