@sourcegraph/cody-web 0.3.4 → 0.3.6

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.
@@ -1,4 +1,4 @@
1
- import { type FC, type PropsWithChildren } from 'react';
1
+ /// <reference types="react" />
2
2
  import type { MessageConnection } from 'vscode-jsonrpc/browser';
3
3
  import type { ChatExportResult } from 'cody-ai/src/jsonrpc/agent-protocol';
4
4
  import { type VSCodeWrapper } from 'cody-ai/webviews/utils/VSCodeApi';
@@ -18,6 +18,9 @@ interface CodyWebChatContextData {
18
18
  selectChat: (chat: ChatExportResult) => Promise<void>;
19
19
  }
20
20
  export declare const CodyWebChatContext: import("react").Context<CodyWebChatContextData>;
21
+ export interface CodyWebChatContextClient {
22
+ createNewChat: () => Promise<void>;
23
+ }
21
24
  interface CodyWebChatProviderProps {
22
25
  serverEndpoint: string;
23
26
  accessToken: string | null;
@@ -26,12 +29,15 @@ interface CodyWebChatProviderProps {
26
29
  initialContext?: InitialContext;
27
30
  customHeaders?: Record<string, string>;
28
31
  onNewChatCreated?: (chatId: string) => void;
32
+ onClientCreated?: (client: CodyWebChatContextClient) => void;
29
33
  }
30
34
  /**
31
35
  * The root store/provider node for the Cody Web chat, creates and shares
32
36
  * agent client and maintains active web panel ID, chat history and vscodeAPI.
33
37
  */
34
- export declare const CodyWebChatProvider: FC<PropsWithChildren<CodyWebChatProviderProps>>;
38
+ export declare const CodyWebChatProvider: import("react").ForwardRefExoticComponent<CodyWebChatProviderProps & {
39
+ children?: import("react").ReactNode;
40
+ } & import("react").RefAttributes<CodyWebChatContextClient>>;
35
41
  export declare function useWebAgentClient(): CodyWebChatContextData;
36
42
  export {};
37
43
  //# sourceMappingURL=CodyWebChatProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodyWebChatProvider.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebChatProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,EAAE,EACP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,IAAI,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACtC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3C,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAA;CAC/D;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;4DAsP9B,CAAA;AAEF,wBAAgB,iBAAiB,IAAI,sBAAsB,CAE1D"}
@@ -1,4 +1,4 @@
1
- export { CodyWebChatProvider } from './components/CodyWebChatProvider';
1
+ export { CodyWebChatProvider, type CodyWebChatContextClient } from './components/CodyWebChatProvider';
2
2
  export { CodyWebChat, type CodyWebChatProps } from './components/CodyWebChat';
3
3
  export { CodyWebHistory, getChatTitle, type ChatExportResult } from './components/CodyWebHistory';
4
4
  export type { Repository, InitialContext } from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEjG,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AACrG,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC7E,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAEjG,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA"}
package/dist/style.css CHANGED
@@ -52,24 +52,24 @@
52
52
  --description-font-size: 0.9em; /* match VS Code quickpick description */
53
53
  }
54
54
 
55
- ._title_m1amm_5, ._description_m1amm_5, ._warning_m1amm_5 {
55
+ ._title_1vity_5, ._description_1vity_5, ._warning_1vity_5 {
56
56
  white-space: nowrap;
57
57
  text-overflow: ellipsis;
58
58
  overflow: hidden;
59
59
  }
60
60
 
61
- ._row_m1amm_11 {
61
+ ._row_1vity_11 {
62
62
  display: flex;
63
- align-items: end;
63
+ align-items: center;
64
64
  gap: 0.35rem;
65
65
  }
66
66
 
67
- ._description_m1amm_5, ._warning_m1amm_5 {
67
+ ._description_1vity_5, ._warning_1vity_5 {
68
68
  font-size: var(--description-font-size);
69
69
  opacity: 0.7;
70
70
  }
71
71
 
72
- ._description_m1amm_5 {
72
+ ._description_1vity_5 {
73
73
  flex: 1;
74
74
  }
75
75
  ._context-item-mention-node_19d28_1 {
@@ -154,39 +154,29 @@ body:is([data-vscode-theme-kind='vscode-high-contrast'], [data-vscode-theme-kind
154
154
  html[data-ide=JetBrains] ._template-input-node_14yoh_1 {
155
155
  background-color: transparent;
156
156
  }
157
- ._popover_ydt5o_1 {
157
+ ._popover_xivxy_1 {
158
158
  overflow: hidden;
159
159
  background: var(--vscode-sideBar-background);
160
160
  color: var(--vscode-sideBar-foreground);
161
161
  box-shadow: 0 0 8px 2px var(--vscode-widget-shadow);
162
162
  border-radius: 3px;
163
163
 
164
- min-width: 20vw;
165
- width: 400px;
166
- max-width: 90vw;
164
+ width: clamp(200px, 100vw, 400px);
167
165
  }
168
166
 
169
- ._reset-anchor_ydt5o_13 {
167
+ ._reset-anchor_xivxy_11 {
170
168
  /* Without this, the popover position jitters by +/- ~13px. */
171
169
  top: 0 !important;
172
170
  left: 0 !important;
173
171
  }
174
172
 
175
- ._container_adc1w_1 {
173
+ ._container_1oafp_1 {
176
174
  border: 1px solid var(--vscode-widget-border);
177
175
  border-radius: 3px;
178
176
  outline: none;
179
177
  }
180
178
 
181
- ._container_adc1w_1 [cmdk-empty], ._container_adc1w_1 [cmdk-loading] {
182
- padding: 0.325rem 0.5rem;
183
- }
184
-
185
- ._item_adc1w_11 {
186
- line-height: 1.2;
187
- }
188
-
189
- ._item_adc1w_11._context-item_adc1w_14 {
179
+ ._item_1oafp_7._context-item_1oafp_8 {
190
180
  display: flex;
191
181
  flex-direction: column;
192
182
  align-items: stretch !important;
@@ -2224,6 +2214,9 @@ imported in Sourcegraph shell.
2224
2214
  .tw-grid {
2225
2215
  display: grid;
2226
2216
  }
2217
+ .\!tw-h-\[30px\] {
2218
+ height: 30px !important;
2219
+ }
2227
2220
  .tw-h-8 {
2228
2221
  height: 16px;
2229
2222
  }
@@ -2248,8 +2241,11 @@ imported in Sourcegraph shell.
2248
2241
  .tw-h-px {
2249
2242
  height: 1px;
2250
2243
  }
2251
- .tw-max-h-\[400px\] {
2252
- max-height: 400px;
2244
+ .\!tw-max-h-\[392px\] {
2245
+ max-height: 392px !important;
2246
+ }
2247
+ .tw-max-h-\[500px\] {
2248
+ max-height: 500px;
2253
2249
  }
2254
2250
  .tw-w-72 {
2255
2251
  width: 18rem;
@@ -2455,6 +2451,9 @@ imported in Sourcegraph shell.
2455
2451
  .\!tw-rounded-full {
2456
2452
  border-radius: 9999px !important;
2457
2453
  }
2454
+ .\!tw-rounded-none {
2455
+ border-radius: 0px !important;
2456
+ }
2458
2457
  .tw-rounded {
2459
2458
  border-radius: 0.25rem;
2460
2459
  }
@@ -2482,6 +2481,9 @@ imported in Sourcegraph shell.
2482
2481
  .tw-border-\[1px\] {
2483
2482
  border-width: 1px;
2484
2483
  }
2484
+ .\!tw-border-b-0 {
2485
+ border-bottom-width: 0px !important;
2486
+ }
2485
2487
  .tw-border-b {
2486
2488
  border-bottom-width: 1px;
2487
2489
  }
@@ -2557,6 +2559,9 @@ imported in Sourcegraph shell.
2557
2559
  .\!tw-p-2 {
2558
2560
  padding: 4px !important;
2559
2561
  }
2562
+ .\!tw-p-3 {
2563
+ padding: 6px !important;
2564
+ }
2560
2565
  .tw-p-0 {
2561
2566
  padding: 0px;
2562
2567
  }
@@ -2662,6 +2667,9 @@ imported in Sourcegraph shell.
2662
2667
  .tw-align-middle {
2663
2668
  vertical-align: middle;
2664
2669
  }
2670
+ .\!tw-text-md {
2671
+ font-size: var(--vscode-font-size) !important;
2672
+ }
2665
2673
  .tw-text-lg {
2666
2674
  font-size: calc(var(--vscode-font-size) * 15 / 13);
2667
2675
  }
@@ -2683,6 +2691,9 @@ imported in Sourcegraph shell.
2683
2691
  .tw-uppercase {
2684
2692
  text-transform: uppercase;
2685
2693
  }
2694
+ .\!tw-leading-\[1\.2\] {
2695
+ line-height: 1.2 !important;
2696
+ }
2686
2697
  .tw-leading-none {
2687
2698
  line-height: 1;
2688
2699
  }
@@ -2695,6 +2706,9 @@ imported in Sourcegraph shell.
2695
2706
  .\!tw-text-foreground {
2696
2707
  color: var(--vscode-foreground) !important;
2697
2708
  }
2709
+ .\!tw-text-muted-foreground {
2710
+ color: var(--vscode-input-placeholderForeground) !important;
2711
+ }
2698
2712
  .tw-text-badge-foreground {
2699
2713
  color: var(--vscode-badge-foreground);
2700
2714
  }
@@ -3286,6 +3300,12 @@ body[data-vscode-theme-kind="vscode-high-contrast"] .high-contrast-dark\:tw-bord
3286
3300
  --tw-rotate: 90deg;
3287
3301
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
3288
3302
  }
3303
+ .\[\&_\[cmdk-group-heading\]\]\:\!tw-h-\[30px\] [cmdk-group-heading] {
3304
+ height: 30px !important;
3305
+ }
3306
+ .\[\&_\[cmdk-group-heading\]\]\:\!tw-p-3 [cmdk-group-heading] {
3307
+ padding: 6px !important;
3308
+ }
3289
3309
  .\[\&_\[cmdk-group-heading\]\]\:tw-px-2 [cmdk-group-heading] {
3290
3310
  padding-left: 4px;
3291
3311
  padding-right: 4px;
@@ -3294,12 +3314,18 @@ body[data-vscode-theme-kind="vscode-high-contrast"] .high-contrast-dark\:tw-bord
3294
3314
  padding-top: 3px;
3295
3315
  padding-bottom: 3px;
3296
3316
  }
3317
+ .\[\&_\[cmdk-group-heading\]\]\:\!tw-text-md [cmdk-group-heading] {
3318
+ font-size: var(--vscode-font-size) !important;
3319
+ }
3297
3320
  .\[\&_\[cmdk-group-heading\]\]\:tw-text-xs [cmdk-group-heading] {
3298
3321
  font-size: calc(calc(11/13)*var(--vscode-font-size));
3299
3322
  }
3300
3323
  .\[\&_\[cmdk-group-heading\]\]\:tw-font-medium [cmdk-group-heading] {
3301
3324
  font-weight: 500;
3302
3325
  }
3326
+ .\[\&_\[cmdk-group-heading\]\]\:\!tw-leading-\[1\.2\] [cmdk-group-heading] {
3327
+ line-height: 1.2 !important;
3328
+ }
3303
3329
  .\[\&_\[cmdk-group-heading\]\]\:tw-text-muted-foreground [cmdk-group-heading] {
3304
3330
  color: var(--vscode-input-placeholderForeground);
3305
3331
  }