xtralab 0.1.2 → 0.3.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 (75) hide show
  1. package/README.md +129 -46
  2. package/lib/fileBrowser/commands.d.ts +2 -2
  3. package/lib/fileBrowser/commands.js +2 -2
  4. package/lib/fileBrowser/fileBrowser.js +72 -2
  5. package/lib/fileBrowser/gitignore.d.ts +29 -0
  6. package/lib/fileBrowser/gitignore.js +74 -0
  7. package/lib/fileBrowser/icons.d.ts +4 -4
  8. package/lib/fileBrowser/icons.js +4 -4
  9. package/lib/fileBrowser/widget.d.ts +2 -2
  10. package/lib/fileBrowser/widget.js +2 -2
  11. package/lib/git/api.d.ts +11 -0
  12. package/lib/git/api.js +19 -0
  13. package/lib/git/commands.d.ts +3 -1
  14. package/lib/git/commands.js +10 -4
  15. package/lib/git/diffWidget.d.ts +11 -0
  16. package/lib/git/diffWidget.js +90 -9
  17. package/lib/git/icons.d.ts +1 -1
  18. package/lib/git/icons.js +1 -1
  19. package/lib/git/index.js +22 -6
  20. package/lib/git/panelComponent.d.ts +3 -1
  21. package/lib/git/panelComponent.js +6 -3
  22. package/lib/index.js +9 -1
  23. package/lib/launcher/agents.d.ts +78 -0
  24. package/lib/launcher/agents.js +168 -0
  25. package/lib/launcher/availability.d.ts +12 -0
  26. package/lib/launcher/availability.js +53 -0
  27. package/lib/launcher/commands.d.ts +22 -0
  28. package/lib/launcher/commands.js +89 -0
  29. package/lib/launcher/dashboard.d.ts +46 -0
  30. package/lib/launcher/dashboard.js +214 -0
  31. package/lib/launcher/icons.d.ts +33 -0
  32. package/lib/launcher/icons.js +113 -0
  33. package/lib/launcher/index.d.ts +23 -0
  34. package/lib/launcher/index.js +191 -0
  35. package/lib/launcher/invocation.d.ts +29 -0
  36. package/lib/launcher/invocation.js +42 -0
  37. package/lib/menus/index.d.ts +14 -0
  38. package/lib/menus/index.js +102 -0
  39. package/lib/sidebar/index.d.ts +18 -0
  40. package/lib/sidebar/index.js +155 -0
  41. package/lib/statusBar/index.d.ts +14 -0
  42. package/lib/statusBar/index.js +89 -0
  43. package/lib/statusBar/widget.d.ts +121 -0
  44. package/lib/statusBar/widget.js +237 -0
  45. package/package.json +25 -3
  46. package/schema/launcher.json +70 -0
  47. package/schema/sidebar.json +57 -0
  48. package/src/fileBrowser/commands.ts +2 -2
  49. package/src/fileBrowser/fileBrowser.tsx +76 -2
  50. package/src/fileBrowser/gitignore.ts +86 -0
  51. package/src/fileBrowser/icons.ts +4 -4
  52. package/src/fileBrowser/widget.tsx +3 -3
  53. package/src/git/api.ts +20 -0
  54. package/src/git/commands.ts +19 -5
  55. package/src/git/diffWidget.tsx +109 -13
  56. package/src/git/icons.ts +1 -1
  57. package/src/git/index.ts +31 -5
  58. package/src/git/panelComponent.tsx +17 -5
  59. package/src/index.ts +9 -1
  60. package/src/launcher/agents.ts +248 -0
  61. package/src/launcher/availability.ts +73 -0
  62. package/src/launcher/commands.ts +103 -0
  63. package/src/launcher/dashboard.tsx +462 -0
  64. package/src/launcher/icons.ts +123 -0
  65. package/src/launcher/index.ts +228 -0
  66. package/src/launcher/invocation.ts +45 -0
  67. package/src/menus/index.ts +124 -0
  68. package/src/sidebar/index.ts +195 -0
  69. package/src/statusBar/index.ts +115 -0
  70. package/src/statusBar/widget.tsx +318 -0
  71. package/style/git.css +4 -8
  72. package/style/index.css +2 -0
  73. package/style/index.js +2 -0
  74. package/style/launcher.css +323 -0
  75. package/style/statusBar.css +95 -0
@@ -0,0 +1,323 @@
1
+ /*
2
+ * Styling for the launcher dashboard widget. The widget replaces
3
+ * JupyterLab's stock `jp-Launcher`, so we don't piggy-back on the
4
+ * `jp-Launcher-*` classes — every selector is scoped under
5
+ * `jp-xtralab-Launcher` to keep the rules from leaking elsewhere.
6
+ *
7
+ * Colors and spacing pull from the active JupyterLab theme via the
8
+ * standard `--jp-*` custom properties so the launcher tracks dark/light
9
+ * mode automatically.
10
+ */
11
+
12
+ .jp-xtralab-Launcher {
13
+ display: flex;
14
+ flex-direction: column;
15
+ width: 100%;
16
+ height: 100%;
17
+ overflow: auto;
18
+ background-color: var(--jp-layout-color1);
19
+ color: var(--jp-ui-font-color1);
20
+ font-family: var(--jp-ui-font-family);
21
+ font-size: var(--jp-ui-font-size1);
22
+ }
23
+
24
+ .jp-xtralab-Launcher-body {
25
+ display: flex;
26
+ flex-direction: column;
27
+ gap: 24px;
28
+ width: 100%;
29
+ max-width: 720px;
30
+ margin: 0 auto;
31
+ padding: 32px 24px 48px;
32
+ box-sizing: border-box;
33
+ }
34
+
35
+ /*
36
+ * Sections — grouped content blocks. The agent picker uses a regular
37
+ * `<section>`; the changes panel uses a `<details>` so the user can
38
+ * collapse it. Both share the same gap + alignment so the page reads
39
+ * uniformly regardless of which element type is underneath.
40
+ */
41
+ .jp-xtralab-Launcher-section {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 8px;
45
+ }
46
+
47
+ .jp-xtralab-Launcher-section-title {
48
+ margin: 0;
49
+ font-size: var(--jp-ui-font-size1);
50
+ font-weight: 600;
51
+ color: var(--jp-ui-font-color2);
52
+ letter-spacing: 0.04em;
53
+ text-transform: uppercase;
54
+ }
55
+
56
+ /*
57
+ * Collapsible changes section. The native `<summary>` is a flex row
58
+ * that hosts the title, count badge, and refresh action; the disclosure
59
+ * triangle is the browser default — it rotates when the section opens.
60
+ */
61
+ .jp-xtralab-Launcher-changes-section {
62
+ /* Reset the default `<details>` block so its contents inherit the
63
+ section's gap-aligned column layout instead of stacking flush. */
64
+ display: flex;
65
+ flex-direction: column;
66
+ gap: 8px;
67
+ }
68
+
69
+ .jp-xtralab-Launcher-section-summary {
70
+ display: flex;
71
+ align-items: center;
72
+ gap: 8px;
73
+ list-style-position: outside;
74
+ cursor: pointer;
75
+ user-select: none;
76
+ padding: 2px 0;
77
+ border-radius: 4px;
78
+ }
79
+
80
+ .jp-xtralab-Launcher-section-summary:hover {
81
+ color: var(--jp-ui-font-color1);
82
+ }
83
+
84
+ .jp-xtralab-Launcher-section-summary:focus-visible {
85
+ outline: 1px solid var(--jp-brand-color1);
86
+ outline-offset: 1px;
87
+ }
88
+
89
+ .jp-xtralab-Launcher-section-count {
90
+ display: inline-flex;
91
+ align-items: center;
92
+ justify-content: center;
93
+ min-width: 20px;
94
+ height: 18px;
95
+ padding: 0 6px;
96
+ background-color: var(--jp-layout-color2);
97
+ color: var(--jp-ui-font-color2);
98
+ border-radius: 9px;
99
+ font-size: var(--jp-ui-font-size0);
100
+ font-variant-numeric: tabular-nums;
101
+ }
102
+
103
+ .jp-xtralab-Launcher-section-action {
104
+ margin-left: auto;
105
+ display: inline-flex;
106
+ align-items: center;
107
+ justify-content: center;
108
+ width: 24px;
109
+ height: 24px;
110
+ padding: 0;
111
+ background: transparent;
112
+ border: none;
113
+ border-radius: 4px;
114
+ color: var(--jp-ui-font-color2);
115
+ cursor: pointer;
116
+ }
117
+
118
+ .jp-xtralab-Launcher-section-action:hover {
119
+ background-color: var(--jp-layout-color2);
120
+ color: var(--jp-ui-font-color1);
121
+ }
122
+
123
+ .jp-xtralab-Launcher-section-action:focus-visible {
124
+ outline: 1px solid var(--jp-brand-color1);
125
+ outline-offset: 1px;
126
+ }
127
+
128
+ .jp-xtralab-Launcher-section-body {
129
+ display: flex;
130
+ flex-direction: column;
131
+ gap: 8px;
132
+ }
133
+
134
+ .jp-xtralab-Launcher-empty {
135
+ margin: 0;
136
+ padding: 8px 0;
137
+ color: var(--jp-ui-font-color3);
138
+ font-size: var(--jp-ui-font-size1);
139
+ }
140
+
141
+ /*
142
+ * Changed files list. Each row is a button so click + keyboard activate
143
+ * both work; the badge on the left mirrors the single-letter status
144
+ * indicator the git panel uses, kept in sync via FileChangeStatus.
145
+ */
146
+ .jp-xtralab-Launcher-changes {
147
+ list-style: none;
148
+ margin: 0;
149
+ padding: 0;
150
+ display: flex;
151
+ flex-direction: column;
152
+ border: 1px solid var(--jp-border-color2);
153
+ border-radius: 4px;
154
+ overflow: hidden;
155
+ }
156
+
157
+ .jp-xtralab-Launcher-changes > li + li {
158
+ border-top: 1px solid var(--jp-border-color3);
159
+ }
160
+
161
+ .jp-xtralab-Launcher-change {
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 8px;
165
+ width: 100%;
166
+ padding: 6px 10px;
167
+ background: transparent;
168
+ border: none;
169
+ text-align: left;
170
+ cursor: pointer;
171
+ color: inherit;
172
+ font: inherit;
173
+ }
174
+
175
+ .jp-xtralab-Launcher-change:hover {
176
+ background-color: var(--jp-layout-color2);
177
+ }
178
+
179
+ .jp-xtralab-Launcher-change:focus-visible {
180
+ outline: 1px solid var(--jp-brand-color1);
181
+ outline-offset: -1px;
182
+ }
183
+
184
+ .jp-xtralab-Launcher-change-badge {
185
+ display: inline-flex;
186
+ align-items: center;
187
+ justify-content: center;
188
+ width: 18px;
189
+ height: 18px;
190
+ font-size: 10px;
191
+ font-weight: 700;
192
+ border-radius: 3px;
193
+ font-family: var(--jp-code-font-family);
194
+ background-color: var(--jp-layout-color2);
195
+ color: var(--jp-ui-font-color2);
196
+ flex: 0 0 auto;
197
+ }
198
+
199
+ .jp-xtralab-Launcher-change-modified {
200
+ background-color: var(--jp-warn-color3, var(--jp-layout-color2));
201
+ color: var(--jp-warn-color1, var(--jp-ui-font-color1));
202
+ }
203
+
204
+ .jp-xtralab-Launcher-change-added,
205
+ .jp-xtralab-Launcher-change-untracked {
206
+ background-color: var(--jp-success-color3, var(--jp-layout-color2));
207
+ color: var(--jp-success-color1, var(--jp-ui-font-color1));
208
+ }
209
+
210
+ .jp-xtralab-Launcher-change-deleted {
211
+ background-color: var(--jp-error-color3, var(--jp-layout-color2));
212
+ color: var(--jp-error-color1, var(--jp-ui-font-color1));
213
+ }
214
+
215
+ .jp-xtralab-Launcher-change-path {
216
+ flex: 1 1 auto;
217
+ font-family: var(--jp-code-font-family);
218
+ font-size: var(--jp-code-font-size);
219
+ white-space: nowrap;
220
+ overflow: hidden;
221
+ text-overflow: ellipsis;
222
+ }
223
+
224
+ .jp-xtralab-Launcher-change-group {
225
+ flex: 0 0 auto;
226
+ color: var(--jp-ui-font-color3);
227
+ font-size: var(--jp-ui-font-size0);
228
+ text-transform: uppercase;
229
+ letter-spacing: 0.04em;
230
+ }
231
+
232
+ /*
233
+ * Prompt textarea + agent grid. The textarea is full-width and resizable
234
+ * vertically; the grid renders agent buttons as compact, icon-led tiles.
235
+ */
236
+ .jp-xtralab-Launcher-prompt {
237
+ width: 100%;
238
+ min-height: 72px;
239
+ padding: 10px 12px;
240
+ box-sizing: border-box;
241
+ resize: vertical;
242
+ background-color: var(--jp-input-background, var(--jp-layout-color1));
243
+ color: var(--jp-ui-font-color1);
244
+ border: 1px solid var(--jp-border-color2);
245
+ border-radius: 4px;
246
+ font: inherit;
247
+ font-family: var(--jp-ui-font-family);
248
+ line-height: 1.4;
249
+ }
250
+
251
+ .jp-xtralab-Launcher-prompt:focus {
252
+ outline: none;
253
+ border-color: var(--jp-brand-color1);
254
+ box-shadow: 0 0 0 1px var(--jp-brand-color1);
255
+ }
256
+
257
+ .jp-xtralab-Launcher-agent-hint {
258
+ margin: 0 0 4px;
259
+ color: var(--jp-ui-font-color2);
260
+ font-size: var(--jp-ui-font-size0);
261
+ line-height: 1.4;
262
+ }
263
+
264
+ .jp-xtralab-Launcher-agents {
265
+ display: grid;
266
+ grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
267
+ gap: 12px;
268
+ }
269
+
270
+ .jp-xtralab-Launcher-agent {
271
+ display: flex;
272
+ flex-direction: column;
273
+ align-items: center;
274
+ justify-content: center;
275
+ gap: 8px;
276
+ padding: 16px 8px;
277
+ background-color: var(--jp-layout-color1);
278
+ color: var(--jp-ui-font-color1);
279
+ border: 1px solid var(--jp-border-color2);
280
+ border-radius: 6px;
281
+ cursor: pointer;
282
+ font: inherit;
283
+ transition:
284
+ background-color 80ms ease,
285
+ border-color 80ms ease;
286
+ }
287
+
288
+ .jp-xtralab-Launcher-agent:focus-visible {
289
+ outline: 1px solid var(--jp-brand-color1);
290
+ outline-offset: 1px;
291
+ }
292
+
293
+ .jp-xtralab-Launcher-agent:disabled {
294
+ opacity: 0.45;
295
+ cursor: not-allowed;
296
+ }
297
+
298
+ .jp-xtralab-Launcher-agent-primary {
299
+ border-color: var(--jp-brand-color2);
300
+ box-shadow: 0 0 0 1px var(--jp-brand-color2);
301
+ }
302
+
303
+ .jp-xtralab-Launcher-agent:hover:not(:disabled) {
304
+ background-color: var(--jp-layout-color2);
305
+ border-color: var(--jp-border-color1);
306
+ }
307
+
308
+ .jp-xtralab-Launcher-agent-icon {
309
+ display: inline-flex;
310
+ width: 32px;
311
+ height: 32px;
312
+ }
313
+
314
+ .jp-xtralab-Launcher-agent-icon svg {
315
+ width: 100%;
316
+ height: 100%;
317
+ }
318
+
319
+ .jp-xtralab-Launcher-agent-label {
320
+ font-size: var(--jp-ui-font-size1);
321
+ font-weight: 500;
322
+ text-align: center;
323
+ }
@@ -0,0 +1,95 @@
1
+ /*
2
+ * Per-session terminal items on the status bar. Each session gets its
3
+ * own item, so the rules below scope tightly under
4
+ * `jp-xtralab-StatusBar-Terminal` to avoid leaking into other items
5
+ * registered by upstream extensions on the same bar.
6
+ *
7
+ * Colors and spacing pull from `--jp-*` custom properties so the items
8
+ * track the active JupyterLab theme.
9
+ */
10
+
11
+ .jp-xtralab-StatusBar-Terminal {
12
+ /* Each item is a single horizontal capsule. The host element comes
13
+ * from the status bar layout — we scope our styles to its inner
14
+ * container so the bar's own padding/margins are respected. */
15
+ display: flex;
16
+ align-items: center;
17
+ }
18
+
19
+ .jp-xtralab-StatusBar-Terminal-Container {
20
+ display: flex;
21
+ align-items: stretch;
22
+ height: 100%;
23
+ }
24
+
25
+ /*
26
+ * Activate button. Stretches the full row so the icon + label are
27
+ * one click target; the close button sits to the right and intercepts
28
+ * clicks on its own area via stopPropagation in the React handler.
29
+ */
30
+ .jp-xtralab-StatusBar-Terminal-Activate {
31
+ display: flex;
32
+ align-items: center;
33
+ gap: 4px;
34
+ padding: 0 6px;
35
+ background: transparent;
36
+ border: none;
37
+ color: inherit;
38
+ font: inherit;
39
+ cursor: pointer;
40
+ min-width: 0;
41
+ }
42
+
43
+ .jp-xtralab-StatusBar-Terminal-Activate:focus-visible {
44
+ outline: var(--jp-border-width) solid var(--jp-brand-color1);
45
+ outline-offset: -2px;
46
+ }
47
+
48
+ .jp-xtralab-StatusBar-Terminal-Label {
49
+ /* Cap each label so a verbose xterm title (Claude can include the
50
+ * cwd, branch, etc.) does not push every other status item off the
51
+ * bar. The truncation tooltip falls back to the full label via the
52
+ * surrounding container's `title` attribute. */
53
+ max-width: 160px;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ font-size: var(--jp-ui-font-size1);
58
+ }
59
+
60
+ /*
61
+ * Close button. Hidden by default so the row reads as plain text;
62
+ * fades in when the row is hovered or the button itself takes focus.
63
+ * No background-color change on hover — the outer item already
64
+ * shifts to `--jp-layout-color3` via `jp-mod-highlighted:hover`, and
65
+ * stacking another shade on top of that produced an unpleasant frame
66
+ * around the inner content.
67
+ */
68
+ .jp-xtralab-StatusBar-Terminal-Close {
69
+ display: flex;
70
+ align-items: center;
71
+ justify-content: center;
72
+ width: 18px;
73
+ margin-right: 2px;
74
+ background: transparent;
75
+ border: none;
76
+ color: var(--jp-ui-font-color2);
77
+ cursor: pointer;
78
+ opacity: 0;
79
+ transition: opacity 80ms linear;
80
+ }
81
+
82
+ .jp-xtralab-StatusBar-Terminal-Close:hover {
83
+ color: var(--jp-ui-font-color1);
84
+ }
85
+
86
+ .jp-xtralab-StatusBar-Terminal-Close:focus-visible {
87
+ opacity: 1;
88
+ outline: var(--jp-border-width) solid var(--jp-brand-color1);
89
+ outline-offset: -2px;
90
+ }
91
+
92
+ .jp-xtralab-StatusBar-Terminal-Container:hover
93
+ .jp-xtralab-StatusBar-Terminal-Close {
94
+ opacity: 1;
95
+ }