ShortcutsModal.svelte 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  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>
  108. <div class="flex flex-col space-y-3 w-full self-start">
  109. <div class="w-full flex justify-between items-center">
  110. <div class=" text-sm">{$i18n.t('Toggle settings')}</div>
  111. <div class="flex space-x-1 text-xs">
  112. <div
  113. 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"
  114. >
  115. Ctrl/⌘
  116. </div>
  117. <div
  118. 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"
  119. >
  120. .
  121. </div>
  122. </div>
  123. </div>
  124. <div class="w-full flex justify-between items-center">
  125. <div class=" text-sm">{$i18n.t('Toggle sidebar')}</div>
  126. <div class="flex space-x-1 text-xs">
  127. <div
  128. 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"
  129. >
  130. Ctrl/⌘
  131. </div>
  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. Shift
  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. S
  141. </div>
  142. </div>
  143. </div>
  144. <div class="w-full flex justify-between items-center">
  145. <div class=" text-sm">{$i18n.t('Delete chat')}</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. ⌫/Delete
  161. </div>
  162. </div>
  163. </div>
  164. <div class="w-full flex justify-between items-center">
  165. <div class=" text-sm">{$i18n.t('Show shortcuts')}</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. /
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. <div class=" flex justify-between dark:text-gray-300 px-5">
  183. <div class=" text-lg font-medium self-center">{$i18n.t('Input commands')}</div>
  184. </div>
  185. <div class="flex flex-col md:flex-row w-full p-5 md:space-x-4 dark:text-gray-200">
  186. <div class=" flex flex-col w-full sm:flex-row sm:justify-center sm:space-x-6">
  187. <div class="flex flex-col space-y-3 w-full self-start">
  188. <div class="w-full flex justify-between items-center">
  189. <div class=" text-sm">
  190. {$i18n.t('Attach file')}
  191. </div>
  192. <div class="flex space-x-1 text-xs">
  193. <div
  194. 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"
  195. >
  196. #
  197. </div>
  198. </div>
  199. </div>
  200. <div class="w-full flex justify-between items-center">
  201. <div class=" text-sm">
  202. {$i18n.t('Add custom prompt')}
  203. </div>
  204. <div class="flex space-x-1 text-xs">
  205. <div
  206. 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"
  207. >
  208. /
  209. </div>
  210. </div>
  211. </div>
  212. <div class="w-full flex justify-between items-center">
  213. <div class=" text-sm">
  214. {$i18n.t('Select model')}
  215. </div>
  216. <div class="flex space-x-1 text-xs">
  217. <div
  218. 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"
  219. >
  220. @
  221. </div>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </Modal>
  229. <style>
  230. input::-webkit-outer-spin-button,
  231. input::-webkit-inner-spin-button {
  232. /* display: none; <- Crashes Chrome on hover */
  233. -webkit-appearance: none;
  234. margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
  235. }
  236. .tabs::-webkit-scrollbar {
  237. display: none; /* for Chrome, Safari and Opera */
  238. }
  239. .tabs {
  240. -ms-overflow-style: none; /* IE and Edge */
  241. scrollbar-width: none; /* Firefox */
  242. }
  243. input[type='number'] {
  244. -moz-appearance: textfield; /* Firefox */
  245. }
  246. </style>