@knpkv/codecommit 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. package/README.md +216 -0
  2. package/dist/package.json +50 -0
  3. package/dist/src/bin.d.ts +3 -0
  4. package/dist/src/bin.d.ts.map +1 -0
  5. package/dist/src/bin.js +204 -0
  6. package/dist/src/bin.js.map +1 -0
  7. package/dist/src/main.d.ts +2 -0
  8. package/dist/src/main.d.ts.map +1 -0
  9. package/dist/src/main.js +25 -0
  10. package/dist/src/main.js.map +1 -0
  11. package/dist/src/tui/App.d.ts +6 -0
  12. package/dist/src/tui/App.d.ts.map +1 -0
  13. package/dist/src/tui/App.js +40 -0
  14. package/dist/src/tui/App.js.map +1 -0
  15. package/dist/src/tui/Constants.d.ts +11 -0
  16. package/dist/src/tui/Constants.d.ts.map +1 -0
  17. package/dist/src/tui/Constants.js +40 -0
  18. package/dist/src/tui/Constants.js.map +1 -0
  19. package/dist/src/tui/ListBuilder.d.ts +32 -0
  20. package/dist/src/tui/ListBuilder.d.ts.map +1 -0
  21. package/dist/src/tui/ListBuilder.js +145 -0
  22. package/dist/src/tui/ListBuilder.js.map +1 -0
  23. package/dist/src/tui/atoms/actions.d.ts +39 -0
  24. package/dist/src/tui/atoms/actions.d.ts.map +1 -0
  25. package/dist/src/tui/atoms/actions.js +149 -0
  26. package/dist/src/tui/atoms/actions.js.map +1 -0
  27. package/dist/src/tui/atoms/app.d.ts +42 -0
  28. package/dist/src/tui/atoms/app.d.ts.map +1 -0
  29. package/dist/src/tui/atoms/app.js +69 -0
  30. package/dist/src/tui/atoms/app.js.map +1 -0
  31. package/dist/src/tui/atoms/index.d.ts +6 -0
  32. package/dist/src/tui/atoms/index.d.ts.map +1 -0
  33. package/dist/src/tui/atoms/index.js +7 -0
  34. package/dist/src/tui/atoms/index.js.map +1 -0
  35. package/dist/src/tui/atoms/runtime.d.ts +9 -0
  36. package/dist/src/tui/atoms/runtime.d.ts.map +1 -0
  37. package/dist/src/tui/atoms/runtime.js +22 -0
  38. package/dist/src/tui/atoms/runtime.js.map +1 -0
  39. package/dist/src/tui/atoms/ui.d.ts +103 -0
  40. package/dist/src/tui/atoms/ui.d.ts.map +1 -0
  41. package/dist/src/tui/atoms/ui.js +97 -0
  42. package/dist/src/tui/atoms/ui.js.map +1 -0
  43. package/dist/src/tui/components/Badge.d.ts +13 -0
  44. package/dist/src/tui/components/Badge.d.ts.map +1 -0
  45. package/dist/src/tui/components/Badge.js +48 -0
  46. package/dist/src/tui/components/Badge.js.map +1 -0
  47. package/dist/src/tui/components/DetailsView.d.ts +6 -0
  48. package/dist/src/tui/components/DetailsView.d.ts.map +1 -0
  49. package/dist/src/tui/components/DetailsView.js +81 -0
  50. package/dist/src/tui/components/DetailsView.js.map +1 -0
  51. package/dist/src/tui/components/ErrorBoundary.d.ts +20 -0
  52. package/dist/src/tui/components/ErrorBoundary.d.ts.map +1 -0
  53. package/dist/src/tui/components/ErrorBoundary.js +33 -0
  54. package/dist/src/tui/components/ErrorBoundary.js.map +1 -0
  55. package/dist/src/tui/components/Footer.d.ts +6 -0
  56. package/dist/src/tui/components/Footer.d.ts.map +1 -0
  57. package/dist/src/tui/components/Footer.js +29 -0
  58. package/dist/src/tui/components/Footer.js.map +1 -0
  59. package/dist/src/tui/components/Header.d.ts +6 -0
  60. package/dist/src/tui/components/Header.d.ts.map +1 -0
  61. package/dist/src/tui/components/Header.js +58 -0
  62. package/dist/src/tui/components/Header.js.map +1 -0
  63. package/dist/src/tui/components/ListItemRow.d.ts +13 -0
  64. package/dist/src/tui/components/ListItemRow.d.ts.map +1 -0
  65. package/dist/src/tui/components/ListItemRow.js +52 -0
  66. package/dist/src/tui/components/ListItemRow.js.map +1 -0
  67. package/dist/src/tui/components/MainList.d.ts +11 -0
  68. package/dist/src/tui/components/MainList.d.ts.map +1 -0
  69. package/dist/src/tui/components/MainList.js +124 -0
  70. package/dist/src/tui/components/MainList.js.map +1 -0
  71. package/dist/src/tui/components/NotificationsTable.d.ts +12 -0
  72. package/dist/src/tui/components/NotificationsTable.d.ts.map +1 -0
  73. package/dist/src/tui/components/NotificationsTable.js +72 -0
  74. package/dist/src/tui/components/NotificationsTable.js.map +1 -0
  75. package/dist/src/tui/components/QuickFilters.d.ts +6 -0
  76. package/dist/src/tui/components/QuickFilters.d.ts.map +1 -0
  77. package/dist/src/tui/components/QuickFilters.js +74 -0
  78. package/dist/src/tui/components/QuickFilters.js.map +1 -0
  79. package/dist/src/tui/components/SettingsTable.d.ts +12 -0
  80. package/dist/src/tui/components/SettingsTable.d.ts.map +1 -0
  81. package/dist/src/tui/components/SettingsTable.js +62 -0
  82. package/dist/src/tui/components/SettingsTable.js.map +1 -0
  83. package/dist/src/tui/components/Spinner.d.ts +11 -0
  84. package/dist/src/tui/components/Spinner.d.ts.map +1 -0
  85. package/dist/src/tui/components/Spinner.js +24 -0
  86. package/dist/src/tui/components/Spinner.js.map +1 -0
  87. package/dist/src/tui/components/StatusRow.d.ts +11 -0
  88. package/dist/src/tui/components/StatusRow.d.ts.map +1 -0
  89. package/dist/src/tui/components/StatusRow.js +11 -0
  90. package/dist/src/tui/components/StatusRow.js.map +1 -0
  91. package/dist/src/tui/components/Table.d.ts +20 -0
  92. package/dist/src/tui/components/Table.d.ts.map +1 -0
  93. package/dist/src/tui/components/Table.js +38 -0
  94. package/dist/src/tui/components/Table.js.map +1 -0
  95. package/dist/src/tui/components/index.d.ts +14 -0
  96. package/dist/src/tui/components/index.d.ts.map +1 -0
  97. package/dist/src/tui/components/index.js +14 -0
  98. package/dist/src/tui/components/index.js.map +1 -0
  99. package/dist/src/tui/components/mainlist-utils.d.ts +22 -0
  100. package/dist/src/tui/components/mainlist-utils.d.ts.map +1 -0
  101. package/dist/src/tui/components/mainlist-utils.js +71 -0
  102. package/dist/src/tui/components/mainlist-utils.js.map +1 -0
  103. package/dist/src/tui/components/table-utils.d.ts +25 -0
  104. package/dist/src/tui/components/table-utils.d.ts.map +1 -0
  105. package/dist/src/tui/components/table-utils.js +25 -0
  106. package/dist/src/tui/components/table-utils.js.map +1 -0
  107. package/dist/src/tui/context/dialog.d.ts +32 -0
  108. package/dist/src/tui/context/dialog.d.ts.map +1 -0
  109. package/dist/src/tui/context/dialog.js +41 -0
  110. package/dist/src/tui/context/dialog.js.map +1 -0
  111. package/dist/src/tui/context/theme.d.ts +25 -0
  112. package/dist/src/tui/context/theme.d.ts.map +1 -0
  113. package/dist/src/tui/context/theme.js +31 -0
  114. package/dist/src/tui/context/theme.js.map +1 -0
  115. package/dist/src/tui/hooks/index.d.ts +2 -0
  116. package/dist/src/tui/hooks/index.d.ts.map +1 -0
  117. package/dist/src/tui/hooks/index.js +2 -0
  118. package/dist/src/tui/hooks/index.js.map +1 -0
  119. package/dist/src/tui/hooks/useKeyboardNav.d.ts +16 -0
  120. package/dist/src/tui/hooks/useKeyboardNav.d.ts.map +1 -0
  121. package/dist/src/tui/hooks/useKeyboardNav.js +429 -0
  122. package/dist/src/tui/hooks/useKeyboardNav.js.map +1 -0
  123. package/dist/src/tui/hooks/useListNavigation.d.ts +3 -0
  124. package/dist/src/tui/hooks/useListNavigation.d.ts.map +1 -0
  125. package/dist/src/tui/hooks/useListNavigation.js +123 -0
  126. package/dist/src/tui/hooks/useListNavigation.js.map +1 -0
  127. package/dist/src/tui/mocks.d.ts +6 -0
  128. package/dist/src/tui/mocks.d.ts.map +1 -0
  129. package/dist/src/tui/mocks.js +36 -0
  130. package/dist/src/tui/mocks.js.map +1 -0
  131. package/dist/src/tui/theme/Resolver.d.ts +6 -0
  132. package/dist/src/tui/theme/Resolver.d.ts.map +1 -0
  133. package/dist/src/tui/theme/Resolver.js +73 -0
  134. package/dist/src/tui/theme/Resolver.js.map +1 -0
  135. package/dist/src/tui/theme/ThemeRegistry.d.ts +3 -0
  136. package/dist/src/tui/theme/ThemeRegistry.d.ts.map +1 -0
  137. package/dist/src/tui/theme/ThemeRegistry.js +70 -0
  138. package/dist/src/tui/theme/ThemeRegistry.js.map +1 -0
  139. package/dist/src/tui/theme/data/aura.json +69 -0
  140. package/dist/src/tui/theme/data/ayu.json +80 -0
  141. package/dist/src/tui/theme/data/carbonfox.json +248 -0
  142. package/dist/src/tui/theme/data/catppuccin-frappe.json +233 -0
  143. package/dist/src/tui/theme/data/catppuccin-macchiato.json +233 -0
  144. package/dist/src/tui/theme/data/catppuccin.json +112 -0
  145. package/dist/src/tui/theme/data/cobalt2.json +228 -0
  146. package/dist/src/tui/theme/data/cursor.json +249 -0
  147. package/dist/src/tui/theme/data/dracula.json +219 -0
  148. package/dist/src/tui/theme/data/everforest.json +241 -0
  149. package/dist/src/tui/theme/data/flexoki.json +237 -0
  150. package/dist/src/tui/theme/data/github.json +233 -0
  151. package/dist/src/tui/theme/data/gruvbox.json +242 -0
  152. package/dist/src/tui/theme/data/kanagawa.json +77 -0
  153. package/dist/src/tui/theme/data/lucent-orng.json +237 -0
  154. package/dist/src/tui/theme/data/material.json +235 -0
  155. package/dist/src/tui/theme/data/matrix.json +77 -0
  156. package/dist/src/tui/theme/data/mercury.json +245 -0
  157. package/dist/src/tui/theme/data/monokai.json +221 -0
  158. package/dist/src/tui/theme/data/nightowl.json +221 -0
  159. package/dist/src/tui/theme/data/nord.json +223 -0
  160. package/dist/src/tui/theme/data/one-dark.json +84 -0
  161. package/dist/src/tui/theme/data/opencode.json +245 -0
  162. package/dist/src/tui/theme/data/orng.json +249 -0
  163. package/dist/src/tui/theme/data/osaka-jade.json +93 -0
  164. package/dist/src/tui/theme/data/palenight.json +222 -0
  165. package/dist/src/tui/theme/data/rosepine.json +234 -0
  166. package/dist/src/tui/theme/data/solarized.json +223 -0
  167. package/dist/src/tui/theme/data/synthwave84.json +226 -0
  168. package/dist/src/tui/theme/data/tokyonight.json +243 -0
  169. package/dist/src/tui/theme/data/vercel.json +245 -0
  170. package/dist/src/tui/theme/data/vesper.json +218 -0
  171. package/dist/src/tui/theme/data/zenburn.json +223 -0
  172. package/dist/src/tui/theme/default.d.ts +40 -0
  173. package/dist/src/tui/theme/default.d.ts.map +1 -0
  174. package/dist/src/tui/theme/default.js +35 -0
  175. package/dist/src/tui/theme/default.js.map +1 -0
  176. package/dist/src/tui/theme/resolver-utils.d.ts +28 -0
  177. package/dist/src/tui/theme/resolver-utils.d.ts.map +1 -0
  178. package/dist/src/tui/theme/resolver-utils.js +19 -0
  179. package/dist/src/tui/theme/resolver-utils.js.map +1 -0
  180. package/dist/src/tui/theme/themes.d.ts +3 -0
  181. package/dist/src/tui/theme/themes.d.ts.map +1 -0
  182. package/dist/src/tui/theme/themes.js +13 -0
  183. package/dist/src/tui/theme/themes.js.map +1 -0
  184. package/dist/src/tui/ui/Dialog.d.ts +19 -0
  185. package/dist/src/tui/ui/Dialog.d.ts.map +1 -0
  186. package/dist/src/tui/ui/Dialog.js +39 -0
  187. package/dist/src/tui/ui/Dialog.js.map +1 -0
  188. package/dist/src/tui/ui/DialogCommand.d.ts +2 -0
  189. package/dist/src/tui/ui/DialogCommand.d.ts.map +1 -0
  190. package/dist/src/tui/ui/DialogCommand.js +182 -0
  191. package/dist/src/tui/ui/DialogCommand.js.map +1 -0
  192. package/dist/src/tui/ui/DialogCreatePR.d.ts +2 -0
  193. package/dist/src/tui/ui/DialogCreatePR.d.ts.map +1 -0
  194. package/dist/src/tui/ui/DialogCreatePR.js +397 -0
  195. package/dist/src/tui/ui/DialogCreatePR.js.map +1 -0
  196. package/dist/src/tui/ui/DialogHelp.d.ts +6 -0
  197. package/dist/src/tui/ui/DialogHelp.d.ts.map +1 -0
  198. package/dist/src/tui/ui/DialogHelp.js +93 -0
  199. package/dist/src/tui/ui/DialogHelp.js.map +1 -0
  200. package/dist/src/tui/ui/DialogTheme.d.ts +2 -0
  201. package/dist/src/tui/ui/DialogTheme.d.ts.map +1 -0
  202. package/dist/src/tui/ui/DialogTheme.js +124 -0
  203. package/dist/src/tui/ui/DialogTheme.js.map +1 -0
  204. package/dist/src/tui/ui/index.d.ts +6 -0
  205. package/dist/src/tui/ui/index.d.ts.map +1 -0
  206. package/dist/src/tui/ui/index.js +6 -0
  207. package/dist/src/tui/ui/index.js.map +1 -0
  208. package/dist/src/tui/utils/prTemplates.d.ts +19 -0
  209. package/dist/src/tui/utils/prTemplates.d.ts.map +1 -0
  210. package/dist/src/tui/utils/prTemplates.js +46 -0
  211. package/dist/src/tui/utils/prTemplates.js.map +1 -0
  212. package/dist/test/ConfigService.test.d.ts +2 -0
  213. package/dist/test/ConfigService.test.d.ts.map +1 -0
  214. package/dist/test/ConfigService.test.js +40 -0
  215. package/dist/test/ConfigService.test.js.map +1 -0
  216. package/dist/test/ListBuilder.test.d.ts +2 -0
  217. package/dist/test/ListBuilder.test.d.ts.map +1 -0
  218. package/dist/test/ListBuilder.test.js +246 -0
  219. package/dist/test/ListBuilder.test.js.map +1 -0
  220. package/dist/test/MainList.test.d.ts +2 -0
  221. package/dist/test/MainList.test.d.ts.map +1 -0
  222. package/dist/test/MainList.test.js +228 -0
  223. package/dist/test/MainList.test.js.map +1 -0
  224. package/dist/test/Resolver.test.d.ts +2 -0
  225. package/dist/test/Resolver.test.d.ts.map +1 -0
  226. package/dist/test/Resolver.test.js +81 -0
  227. package/dist/test/Resolver.test.js.map +1 -0
  228. package/dist/test/Table.test.d.ts +2 -0
  229. package/dist/test/Table.test.d.ts.map +1 -0
  230. package/dist/test/Table.test.js +100 -0
  231. package/dist/test/Table.test.js.map +1 -0
  232. package/dist/tsconfig.tsbuildinfo +1 -0
  233. package/package.json +50 -0
@@ -0,0 +1,223 @@
1
+ {
2
+ "$schema": "https://opencode.ai/theme.json",
3
+ "defs": {
4
+ "bg": "#3f3f3f",
5
+ "bgAlt": "#4f4f4f",
6
+ "bgPanel": "#5f5f5f",
7
+ "fg": "#dcdccc",
8
+ "fgMuted": "#9f9f9f",
9
+ "red": "#cc9393",
10
+ "redBright": "#dca3a3",
11
+ "green": "#7f9f7f",
12
+ "greenBright": "#8fb28f",
13
+ "yellow": "#f0dfaf",
14
+ "yellowDim": "#e0cf9f",
15
+ "blue": "#8cd0d3",
16
+ "blueDim": "#7cb8bb",
17
+ "magenta": "#dc8cc3",
18
+ "cyan": "#93e0e3",
19
+ "orange": "#dfaf8f"
20
+ },
21
+ "theme": {
22
+ "primary": {
23
+ "dark": "blue",
24
+ "light": "#5f7f8f"
25
+ },
26
+ "secondary": {
27
+ "dark": "magenta",
28
+ "light": "#8f5f8f"
29
+ },
30
+ "accent": {
31
+ "dark": "cyan",
32
+ "light": "#5f8f8f"
33
+ },
34
+ "error": {
35
+ "dark": "red",
36
+ "light": "#8f5f5f"
37
+ },
38
+ "warning": {
39
+ "dark": "yellow",
40
+ "light": "#8f8f5f"
41
+ },
42
+ "success": {
43
+ "dark": "green",
44
+ "light": "#5f8f5f"
45
+ },
46
+ "info": {
47
+ "dark": "orange",
48
+ "light": "#8f7f5f"
49
+ },
50
+ "text": {
51
+ "dark": "fg",
52
+ "light": "#3f3f3f"
53
+ },
54
+ "textMuted": {
55
+ "dark": "fgMuted",
56
+ "light": "#6f6f6f"
57
+ },
58
+ "background": {
59
+ "dark": "bg",
60
+ "light": "#ffffef"
61
+ },
62
+ "backgroundPanel": {
63
+ "dark": "bgAlt",
64
+ "light": "#f5f5e5"
65
+ },
66
+ "backgroundElement": {
67
+ "dark": "bgPanel",
68
+ "light": "#ebebdb"
69
+ },
70
+ "border": {
71
+ "dark": "#5f5f5f",
72
+ "light": "#d0d0c0"
73
+ },
74
+ "borderActive": {
75
+ "dark": "blue",
76
+ "light": "#5f7f8f"
77
+ },
78
+ "borderSubtle": {
79
+ "dark": "#4f4f4f",
80
+ "light": "#e0e0d0"
81
+ },
82
+ "diffAdded": {
83
+ "dark": "green",
84
+ "light": "#5f8f5f"
85
+ },
86
+ "diffRemoved": {
87
+ "dark": "red",
88
+ "light": "#8f5f5f"
89
+ },
90
+ "diffContext": {
91
+ "dark": "fgMuted",
92
+ "light": "#6f6f6f"
93
+ },
94
+ "diffHunkHeader": {
95
+ "dark": "cyan",
96
+ "light": "#5f8f8f"
97
+ },
98
+ "diffHighlightAdded": {
99
+ "dark": "greenBright",
100
+ "light": "#5f8f5f"
101
+ },
102
+ "diffHighlightRemoved": {
103
+ "dark": "redBright",
104
+ "light": "#8f5f5f"
105
+ },
106
+ "diffAddedBg": {
107
+ "dark": "#4f5f4f",
108
+ "light": "#efffef"
109
+ },
110
+ "diffRemovedBg": {
111
+ "dark": "#5f4f4f",
112
+ "light": "#ffefef"
113
+ },
114
+ "diffContextBg": {
115
+ "dark": "bgAlt",
116
+ "light": "#f5f5e5"
117
+ },
118
+ "diffLineNumber": {
119
+ "dark": "#6f6f6f",
120
+ "light": "#b0b0a0"
121
+ },
122
+ "diffAddedLineNumberBg": {
123
+ "dark": "#4f5f4f",
124
+ "light": "#efffef"
125
+ },
126
+ "diffRemovedLineNumberBg": {
127
+ "dark": "#5f4f4f",
128
+ "light": "#ffefef"
129
+ },
130
+ "markdownText": {
131
+ "dark": "fg",
132
+ "light": "#3f3f3f"
133
+ },
134
+ "markdownHeading": {
135
+ "dark": "yellow",
136
+ "light": "#8f8f5f"
137
+ },
138
+ "markdownLink": {
139
+ "dark": "blue",
140
+ "light": "#5f7f8f"
141
+ },
142
+ "markdownLinkText": {
143
+ "dark": "cyan",
144
+ "light": "#5f8f8f"
145
+ },
146
+ "markdownCode": {
147
+ "dark": "green",
148
+ "light": "#5f8f5f"
149
+ },
150
+ "markdownBlockQuote": {
151
+ "dark": "fgMuted",
152
+ "light": "#6f6f6f"
153
+ },
154
+ "markdownEmph": {
155
+ "dark": "yellowDim",
156
+ "light": "#8f8f5f"
157
+ },
158
+ "markdownStrong": {
159
+ "dark": "orange",
160
+ "light": "#8f7f5f"
161
+ },
162
+ "markdownHorizontalRule": {
163
+ "dark": "fgMuted",
164
+ "light": "#6f6f6f"
165
+ },
166
+ "markdownListItem": {
167
+ "dark": "blue",
168
+ "light": "#5f7f8f"
169
+ },
170
+ "markdownListEnumeration": {
171
+ "dark": "cyan",
172
+ "light": "#5f8f8f"
173
+ },
174
+ "markdownImage": {
175
+ "dark": "blue",
176
+ "light": "#5f7f8f"
177
+ },
178
+ "markdownImageText": {
179
+ "dark": "cyan",
180
+ "light": "#5f8f8f"
181
+ },
182
+ "markdownCodeBlock": {
183
+ "dark": "fg",
184
+ "light": "#3f3f3f"
185
+ },
186
+ "syntaxComment": {
187
+ "dark": "#7f9f7f",
188
+ "light": "#5f7f5f"
189
+ },
190
+ "syntaxKeyword": {
191
+ "dark": "yellow",
192
+ "light": "#8f8f5f"
193
+ },
194
+ "syntaxFunction": {
195
+ "dark": "blue",
196
+ "light": "#5f7f8f"
197
+ },
198
+ "syntaxVariable": {
199
+ "dark": "fg",
200
+ "light": "#3f3f3f"
201
+ },
202
+ "syntaxString": {
203
+ "dark": "red",
204
+ "light": "#8f5f5f"
205
+ },
206
+ "syntaxNumber": {
207
+ "dark": "greenBright",
208
+ "light": "#5f8f5f"
209
+ },
210
+ "syntaxType": {
211
+ "dark": "cyan",
212
+ "light": "#5f8f8f"
213
+ },
214
+ "syntaxOperator": {
215
+ "dark": "yellow",
216
+ "light": "#8f8f5f"
217
+ },
218
+ "syntaxPunctuation": {
219
+ "dark": "fg",
220
+ "light": "#3f3f3f"
221
+ }
222
+ }
223
+ }
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Theme color tokens for the TUI
3
+ * @category theme
4
+ */
5
+ export interface Theme {
6
+ readonly background: string;
7
+ readonly backgroundPanel: string;
8
+ readonly backgroundElement: string;
9
+ readonly backgroundHeader: string;
10
+ readonly backgroundHeaderLoading: string;
11
+ readonly backgroundHeaderError: string;
12
+ readonly backgroundHeaderWarning: string;
13
+ readonly text: string;
14
+ readonly textMuted: string;
15
+ readonly textAccent: string;
16
+ readonly textError: string;
17
+ readonly textWarning: string;
18
+ readonly textSuccess: string;
19
+ readonly primary: string;
20
+ readonly error: string;
21
+ readonly warning: string;
22
+ readonly success: string;
23
+ readonly selectedBackground: string;
24
+ readonly selectedText: string;
25
+ readonly markdownText: string;
26
+ readonly markdownHeading: string;
27
+ readonly markdownLink: string;
28
+ readonly markdownLinkText: string;
29
+ readonly markdownCode: string;
30
+ readonly markdownCodeBlock: string;
31
+ readonly markdownBlockQuote: string;
32
+ readonly markdownListItem: string;
33
+ readonly markdownEmph: string;
34
+ readonly markdownStrong: string;
35
+ readonly markdownHorizontalRule: string;
36
+ readonly markdownImage: string;
37
+ readonly markdownImageText: string;
38
+ }
39
+ export declare const defaultTheme: Theme;
40
+ //# sourceMappingURL=default.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/tui/theme/default.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAA;IACxC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAA;IACtC,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAA;IAExC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IAExB,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAE7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAA;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;IAClC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAA;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAA;IACvC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAA;CACnC;AAED,eAAO,MAAM,YAAY,EAAE,KAqC1B,CAAA"}
@@ -0,0 +1,35 @@
1
+ export const defaultTheme = {
2
+ background: "#171923",
3
+ backgroundPanel: "#1A202C",
4
+ backgroundElement: "#2D3748",
5
+ backgroundHeader: "#1A365D",
6
+ backgroundHeaderLoading: "#2C5282",
7
+ backgroundHeaderError: "#880000",
8
+ backgroundHeaderWarning: "#885500",
9
+ text: "#FFFFFF",
10
+ textMuted: "#A0AEC0",
11
+ textAccent: "#63B3ED",
12
+ textError: "#FC8181",
13
+ textWarning: "#F6E05E",
14
+ textSuccess: "#68D391",
15
+ primary: "#1E3A5F",
16
+ error: "#880000",
17
+ warning: "#885500",
18
+ success: "#276749",
19
+ selectedBackground: "#2D3748",
20
+ selectedText: "#FFFFFF",
21
+ markdownText: "#FFFFFF",
22
+ markdownHeading: "#63B3ED",
23
+ markdownLink: "#63B3ED",
24
+ markdownLinkText: "#63B3ED",
25
+ markdownCode: "#F6E05E",
26
+ markdownCodeBlock: "#FFFFFF",
27
+ markdownBlockQuote: "#A0AEC0",
28
+ markdownListItem: "#FFFFFF",
29
+ markdownEmph: "#FFFFFF",
30
+ markdownStrong: "#FFFFFF",
31
+ markdownHorizontalRule: "#A0AEC0",
32
+ markdownImage: "#63B3ED",
33
+ markdownImageText: "#63B3ED"
34
+ };
35
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../../src/tui/theme/default.ts"],"names":[],"mappings":"AA2CA,MAAM,CAAC,MAAM,YAAY,GAAU;IACjC,UAAU,EAAE,SAAS;IACrB,eAAe,EAAE,SAAS;IAC1B,iBAAiB,EAAE,SAAS;IAC5B,gBAAgB,EAAE,SAAS;IAC3B,uBAAuB,EAAE,SAAS;IAClC,qBAAqB,EAAE,SAAS;IAChC,uBAAuB,EAAE,SAAS;IAElC,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,SAAS;IAEtB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAElB,kBAAkB,EAAE,SAAS;IAC7B,YAAY,EAAE,SAAS;IAEvB,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,SAAS;IACvB,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;IAC5B,kBAAkB,EAAE,SAAS;IAC7B,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,SAAS;IACvB,cAAc,EAAE,SAAS;IACzB,sBAAsB,EAAE,SAAS;IACjC,aAAa,EAAE,SAAS;IACxB,iBAAiB,EAAE,SAAS;CAC7B,CAAA"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Pure helpers for theme resolution.
3
+ *
4
+ * Separated from Resolver.ts to avoid @opentui/core deps in tests.
5
+ *
6
+ * @internal
7
+ */
8
+ type HexColor = `#${string}`;
9
+ type RefName = string;
10
+ type Variant = {
11
+ readonly dark: HexColor | RefName;
12
+ readonly light: HexColor | RefName;
13
+ };
14
+ type ColorValue = HexColor | RefName | Variant;
15
+ export interface TuiThemeJson {
16
+ readonly defs?: Record<string, HexColor | RefName>;
17
+ readonly theme: Record<string, ColorValue>;
18
+ }
19
+ export type ThemeJson = TuiThemeJson;
20
+ export interface RGBALike {
21
+ readonly r: number;
22
+ readonly g: number;
23
+ readonly b: number;
24
+ }
25
+ export declare const rgbaToHex: (rgba: RGBALike) => string;
26
+ export declare const isThemeJson: (json: unknown) => json is ThemeJson;
27
+ export {};
28
+ //# sourceMappingURL=resolver-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver-utils.d.ts","sourceRoot":"","sources":["../../../../src/tui/theme/resolver-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,KAAK,QAAQ,GAAG,IAAI,MAAM,EAAE,CAAA;AAC5B,KAAK,OAAO,GAAG,MAAM,CAAA;AACrB,KAAK,OAAO,GAAG;IACb,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAA;IACjC,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAA;CACnC,CAAA;AACD,KAAK,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAA;AAE9C,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAA;IAClD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;CAC3C;AAED,MAAM,MAAM,SAAS,GAAG,YAAY,CAAA;AAEpC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,QAAQ,KAAG,MAK1C,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,SAGnD,CAAA"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Pure helpers for theme resolution.
3
+ *
4
+ * Separated from Resolver.ts to avoid @opentui/core deps in tests.
5
+ *
6
+ * @internal
7
+ */
8
+ export const rgbaToHex = (rgba) => {
9
+ const r = Math.round(rgba.r * 255).toString(16).padStart(2, "0");
10
+ const g = Math.round(rgba.g * 255).toString(16).padStart(2, "0");
11
+ const b = Math.round(rgba.b * 255).toString(16).padStart(2, "0");
12
+ return `#${r}${g}${b}`;
13
+ };
14
+ export const isThemeJson = (json) => {
15
+ if (typeof json !== "object" || json === null)
16
+ return false;
17
+ return "theme" in json;
18
+ };
19
+ //# sourceMappingURL=resolver-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver-utils.js","sourceRoot":"","sources":["../../../../src/tui/theme/resolver-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuBH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAc,EAAU,EAAE;IAClD,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAChE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAChE,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAChE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAa,EAAqB,EAAE;IAC9D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAC3D,OAAO,OAAO,IAAI,IAAI,CAAA;AACxB,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type Theme } from "./default.js";
2
+ export declare const themes: Record<string, Theme>;
3
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../../../src/tui/theme/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAE,MAAM,cAAc,CAAA;AAIvD,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAM,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { defaultTheme } from "./default.js";
2
+ import { isThemeJson, jsonToTheme } from "./Resolver.js";
3
+ import { themeRegistry } from "./ThemeRegistry.js";
4
+ export const themes = {};
5
+ for (const [name, json] of Object.entries(themeRegistry)) {
6
+ if (isThemeJson(json)) {
7
+ themes[`${name}-dark`] = jsonToTheme(json, "dark");
8
+ themes[`${name}-light`] = jsonToTheme(json, "light");
9
+ }
10
+ }
11
+ themes.dark = themes["dracula-dark"] ?? Object.values(themes)[0] ?? defaultTheme;
12
+ themes.light = themes["aura-light"] ?? Object.values(themes)[1] ?? defaultTheme;
13
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/tui/theme/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAc,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,CAAC,MAAM,MAAM,GAA0B,EAAE,CAAA;AAE/C,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;IACzD,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;QAClD,MAAM,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACtD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAA;AAChF,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,YAAY,CAAA"}
@@ -0,0 +1,19 @@
1
+ interface DialogProps {
2
+ readonly title: string;
3
+ readonly children: React.ReactNode;
4
+ readonly fullscreen?: boolean;
5
+ }
6
+ /**
7
+ * Base dialog wrapper component
8
+ * Renders a modal overlay with title bar and content
9
+ * @category ui
10
+ */
11
+ export declare function Dialog({ children, fullscreen, title }: DialogProps): import("react").ReactNode;
12
+ /**
13
+ * Renders the current dialog from DialogContext if present
14
+ * Place at root level of app
15
+ * @category ui
16
+ */
17
+ export declare function DialogRenderer(): import("react").ReactNode;
18
+ export {};
19
+ //# sourceMappingURL=Dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../../src/tui/ui/Dialog.tsx"],"names":[],"mappings":"AAGA,UAAU,WAAW;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAkB,EAAE,KAAK,EAAE,EAAE,WAAW,6BA8B1E;AAED;;;;GAIG;AACH,wBAAgB,cAAc,8BAQ7B"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
+ import { useDialog } from "../context/dialog.js";
3
+ import { useTheme } from "../context/theme.js";
4
+ /**
5
+ * Base dialog wrapper component
6
+ * Renders a modal overlay with title bar and content
7
+ * @category ui
8
+ */
9
+ export function Dialog({ children, fullscreen = false, title }) {
10
+ const { theme } = useTheme();
11
+ const containerStyle = fullscreen
12
+ ? { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }
13
+ : { position: "absolute", top: "15%", left: "15%", width: "70%", height: "auto" };
14
+ return (_jsxs("box", { style: {
15
+ ...containerStyle,
16
+ flexDirection: "column",
17
+ backgroundColor: theme.backgroundPanel,
18
+ padding: 0
19
+ }, children: [_jsx("box", { style: {
20
+ height: 1,
21
+ width: "100%",
22
+ backgroundColor: theme.backgroundElement,
23
+ paddingLeft: 2,
24
+ paddingRight: 2
25
+ }, children: _jsx("text", { fg: theme.textWarning, children: ` ${title}` }) }), _jsx("box", { style: { flexDirection: "column", padding: 1, flexGrow: 1 }, children: children })] }));
26
+ }
27
+ /**
28
+ * Renders the current dialog from DialogContext if present
29
+ * Place at root level of app
30
+ * @category ui
31
+ */
32
+ export function DialogRenderer() {
33
+ const { current: CurrentDialog } = useDialog();
34
+ if (!CurrentDialog) {
35
+ return null;
36
+ }
37
+ return _jsx(CurrentDialog, {});
38
+ }
39
+ //# sourceMappingURL=Dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../../src/tui/ui/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAQ9C;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,UAAU,GAAG,KAAK,EAAE,KAAK,EAAe;IACzE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE5B,MAAM,cAAc,GAAG,UAAU;QAC/B,CAAC,CAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAY;QACrF,CAAC,CAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAY,CAAA;IAE9F,OAAO,CACL,eACE,KAAK,EAAE;YACL,GAAG,cAAc;YACjB,aAAa,EAAE,QAAQ;YACvB,eAAe,EAAE,KAAK,CAAC,eAAe;YACtC,OAAO,EAAE,CAAC;SACX,aAED,cACE,KAAK,EAAE;oBACL,MAAM,EAAE,CAAC;oBACT,KAAK,EAAE,MAAM;oBACb,eAAe,EAAE,KAAK,CAAC,iBAAiB;oBACxC,WAAW,EAAE,CAAC;oBACd,YAAY,EAAE,CAAC;iBAChB,YAED,eAAM,EAAE,EAAE,KAAK,CAAC,WAAW,YAAG,KAAK,KAAK,EAAE,GAAQ,GAC9C,EACN,cAAK,KAAK,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,YAAG,QAAQ,GAAO,IAC9E,CACP,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE,CAAA;IAE9C,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,KAAC,aAAa,KAAG,CAAA;AAC1B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function DialogCommand(): import("react").ReactNode;
2
+ //# sourceMappingURL=DialogCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DialogCommand.d.ts","sourceRoot":"","sources":["../../../../src/tui/ui/DialogCommand.tsx"],"names":[],"mappings":"AAmBA,wBAAgB,aAAa,8BA0M5B"}
@@ -0,0 +1,182 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@opentui/react/jsx-runtime";
2
+ import { useAtomSet } from "@effect-atom/atom-react";
3
+ import { useKeyboard } from "@opentui/react";
4
+ import { useEffect, useMemo, useRef, useState } from "react";
5
+ import { clearNotificationsAtom, refreshAtom, setAllAccountsAtom } from "../atoms/app.js";
6
+ import { filterTextAtom, isFilteringAtom, isSettingsFilteringAtom, quickFilterTypeAtom, viewAtom } from "../atoms/ui.js";
7
+ import { useDialog } from "../context/dialog.js";
8
+ import { useTheme } from "../context/theme.js";
9
+ import { DialogCreatePR } from "./DialogCreatePR.js";
10
+ import { DialogHelp } from "./DialogHelp.js";
11
+ import { DialogTheme } from "./DialogTheme.js";
12
+ export function DialogCommand() {
13
+ const { theme } = useTheme();
14
+ const dialog = useDialog();
15
+ const [search, setSearch] = useState("");
16
+ const [selectedIndex, setSelectedIndex] = useState(0);
17
+ const [scrollOffset, setScrollOffset] = useState(0);
18
+ const scrollRef = useRef(null);
19
+ const visibleHeight = 11; // 15 max height - 3 for border/header - 1 for padding
20
+ const refresh = useAtomSet(refreshAtom);
21
+ const setView = useAtomSet(viewAtom);
22
+ const setIsFiltering = useAtomSet(isFilteringAtom);
23
+ const setIsSettingsFiltering = useAtomSet(isSettingsFilteringAtom);
24
+ const setFilterText = useAtomSet(filterTextAtom);
25
+ const clearNotifications = useAtomSet(clearNotificationsAtom);
26
+ const setQuickFilterType = useAtomSet(quickFilterTypeAtom);
27
+ const setAllAccounts = useAtomSet(setAllAccountsAtom);
28
+ const commands = useMemo(() => [
29
+ {
30
+ id: "create-pr",
31
+ label: "Create Pull Request",
32
+ shortcut: "c",
33
+ action: () => dialog.show(() => _jsx(DialogCreatePR, {}))
34
+ },
35
+ { id: "refresh", label: "Refresh PRs", shortcut: "r", action: () => refresh() },
36
+ {
37
+ id: "filter",
38
+ label: "Filter PRs",
39
+ shortcut: "/",
40
+ action: () => {
41
+ setView("prs");
42
+ setIsFiltering(true);
43
+ }
44
+ },
45
+ {
46
+ id: "clear-filter",
47
+ label: "Clear Filter",
48
+ action: () => {
49
+ setFilterText("");
50
+ setQuickFilterType("all");
51
+ }
52
+ },
53
+ { id: "view-prs", label: "View: Pull Requests", shortcut: "Esc", action: () => setView("prs") },
54
+ { id: "view-settings", label: "View: Settings", shortcut: "s", action: () => setView("settings") },
55
+ { id: "view-notifications", label: "View: Notifications", shortcut: "n", action: () => setView("notifications") },
56
+ { id: "filter-all", label: "Filter: All PRs", shortcut: "1", action: () => setQuickFilterType("all") },
57
+ { id: "filter-mine", label: "Filter: My PRs", shortcut: "2", action: () => setQuickFilterType("mine") },
58
+ { id: "filter-account", label: "Filter: By Account", shortcut: "3", action: () => setQuickFilterType("account") },
59
+ { id: "filter-author", label: "Filter: By Author", shortcut: "4", action: () => setQuickFilterType("author") },
60
+ { id: "filter-scope", label: "Filter: By Scope", shortcut: "5", action: () => setQuickFilterType("scope") },
61
+ { id: "filter-date", label: "Filter: By Age", shortcut: "6", action: () => setQuickFilterType("date") },
62
+ { id: "filter-repo", label: "Filter: By Repo", shortcut: "7", action: () => setQuickFilterType("repo") },
63
+ { id: "filter-status", label: "Filter: By Status", shortcut: "8", action: () => setQuickFilterType("status") },
64
+ {
65
+ id: "settings-filter",
66
+ label: "Settings: Filter Accounts",
67
+ shortcut: "/",
68
+ action: () => {
69
+ setView("settings");
70
+ setIsSettingsFiltering(true);
71
+ }
72
+ },
73
+ {
74
+ id: "settings-all-on",
75
+ label: "Settings: Enable All",
76
+ shortcut: "a",
77
+ action: () => setAllAccounts({ enabled: true })
78
+ },
79
+ {
80
+ id: "settings-all-off",
81
+ label: "Settings: Disable All",
82
+ shortcut: "d",
83
+ action: () => setAllAccounts({ enabled: false })
84
+ },
85
+ { id: "clear-notifications", label: "Clear Notifications", shortcut: "c", action: () => clearNotifications() },
86
+ { id: "theme", label: "Change Theme", shortcut: "t", action: () => dialog.show(() => _jsx(DialogTheme, {})) },
87
+ { id: "help", label: "Show Help", shortcut: "h", action: () => dialog.show(() => _jsx(DialogHelp, {})) }
88
+ ], [
89
+ refresh,
90
+ setView,
91
+ setIsFiltering,
92
+ setIsSettingsFiltering,
93
+ setFilterText,
94
+ clearNotifications,
95
+ setQuickFilterType,
96
+ setAllAccounts,
97
+ dialog
98
+ ]);
99
+ const filteredCommands = useMemo(() => {
100
+ if (!search)
101
+ return commands;
102
+ const s = search.toLowerCase();
103
+ return commands.filter((cmd) => cmd.label.toLowerCase().includes(s) || cmd.id.includes(s));
104
+ }, [commands, search]);
105
+ // Scroll to keep selected item visible with 1-item margin
106
+ useEffect(() => {
107
+ if (!scrollRef.current)
108
+ return;
109
+ let newOffset = scrollOffset;
110
+ // If selection is above visible area (with 1-item margin)
111
+ if (selectedIndex < scrollOffset + 1) {
112
+ newOffset = Math.max(0, selectedIndex - 1);
113
+ } // If selection is below visible area (with 1-item margin)
114
+ else if (selectedIndex > scrollOffset + visibleHeight - 2) {
115
+ newOffset = selectedIndex - visibleHeight + 2;
116
+ }
117
+ if (newOffset !== scrollOffset) {
118
+ setScrollOffset(newOffset);
119
+ scrollRef.current.scrollTo({ x: 0, y: newOffset });
120
+ }
121
+ }, [selectedIndex, scrollOffset, visibleHeight]);
122
+ useKeyboard((key) => {
123
+ if (key.name === "escape") {
124
+ dialog.hide();
125
+ }
126
+ else if (key.name === "return") {
127
+ const cmd = filteredCommands[selectedIndex];
128
+ if (cmd) {
129
+ dialog.hide();
130
+ cmd.action();
131
+ }
132
+ }
133
+ else if (key.name === "down") {
134
+ setSelectedIndex((i) => Math.min(i + 1, filteredCommands.length - 1));
135
+ }
136
+ else if (key.name === "up") {
137
+ setSelectedIndex((i) => Math.max(i - 1, 0));
138
+ }
139
+ else if (key.name === "backspace") {
140
+ setSearch((s) => s.slice(0, -1));
141
+ setSelectedIndex(0);
142
+ setScrollOffset(0);
143
+ }
144
+ else {
145
+ const char = key.char || (key.name?.length === 1 ? key.name : null);
146
+ if (char && char.length === 1) {
147
+ setSearch((s) => s + char);
148
+ setSelectedIndex(0);
149
+ setScrollOffset(0);
150
+ }
151
+ }
152
+ });
153
+ return (_jsxs("box", { style: {
154
+ position: "absolute",
155
+ top: 2,
156
+ left: "20%",
157
+ width: "60%",
158
+ height: Math.min(filteredCommands.length + 3, 15),
159
+ backgroundColor: theme.backgroundElement,
160
+ borderStyle: "rounded",
161
+ borderColor: theme.primary,
162
+ flexDirection: "column"
163
+ }, children: [_jsxs("box", { style: {
164
+ height: 1,
165
+ width: "100%",
166
+ paddingLeft: 1,
167
+ paddingRight: 1,
168
+ flexDirection: "row",
169
+ backgroundColor: theme.backgroundHeader
170
+ }, children: [_jsx("text", { fg: theme.text, children: `> ${search}` }), _jsx("text", { fg: theme.primary, children: "│" })] }), _jsxs("scrollbox", { ref: scrollRef, style: {
171
+ flexGrow: 1,
172
+ width: "100%"
173
+ }, children: [filteredCommands.map((cmd, i) => (_jsx("box", { style: {
174
+ height: 1,
175
+ width: "100%",
176
+ paddingLeft: 1,
177
+ paddingRight: 1,
178
+ flexDirection: "row",
179
+ ...(i === selectedIndex && { backgroundColor: theme.primary })
180
+ }, children: _jsx("text", { fg: i === selectedIndex ? theme.selectedText : theme.text, children: cmd.shortcut ? `${cmd.label} [${cmd.shortcut}]` : cmd.label }) }, cmd.id))), filteredCommands.length === 0 && (_jsx("box", { style: { height: 1, paddingLeft: 1 }, children: _jsx("text", { fg: theme.textMuted, children: "No commands found" }) }))] })] }));
181
+ }
182
+ //# sourceMappingURL=DialogCommand.js.map