@sourcegraph/cody-web 0.38.0 → 0.40.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.
@@ -9,6 +9,14 @@ export interface CodyPromptTemplateProps {
9
9
  initialEditorState?: SerializedPromptEditorState | undefined;
10
10
  disabled?: boolean;
11
11
  placeholder?: string;
12
+ /**
13
+ * A custom portal container to have control over target for all floating UI within
14
+ * Cody Web UI, this is used to retarget a standard portal (end of the body) to
15
+ * element within Web SvelteKit app themed portal.
16
+ *
17
+ * For more details see this comment https://github.com/sourcegraph/sourcegraph/pull/9186#issuecomment-3774633656
18
+ */
19
+ portalContainer?: HTMLElement | null;
12
20
  /**
13
21
  * Whenever an external (imperative) Cody Chat API instance is ready,
14
22
  * for example it gives you ability to run prompt, Note that this handler
@@ -1 +1 @@
1
- {"version":3,"file":"CodyPromptTemplate.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyPromptTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAMzB,MAAM,OAAO,CAAA;AAEd,OAAO,EASH,KAAK,2BAA2B,EAGnC,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAIH,KAAK,kBAAkB,EAC1B,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,6BAA6B,CAAA;AAYpC,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,oBAAoB,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAA;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAA;CACvD;AACD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CAyCzE,CAAA"}
1
+ {"version":3,"file":"CodyPromptTemplate.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyPromptTemplate.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAMzB,MAAM,OAAO,CAAA;AAEd,OAAO,EASH,KAAK,2BAA2B,EAGnC,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAIH,KAAK,kBAAkB,EAC1B,MAAM,4BAA4B,CAAA;AAMnC,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,6BAA6B,CAAA;AAYpC,MAAM,WAAW,uBAAuB;IACpC,WAAW,EAAE,oBAAoB,CAAA;IACjC,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,kBAAkB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAA;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAEpC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,kBAAkB,KAAK,IAAI,CAAA;CACvD;AACD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CA2CzE,CAAA"}
@@ -49,6 +49,14 @@ export interface CodyWebChatProps {
49
49
  controller?: CodyWebChatController;
50
50
  /** How to render the chat, either as standalone page or sidebar. Defaults to 'sidebar'. */
51
51
  viewType?: ViewType;
52
+ /**
53
+ * A custom portal container to have control over target for all floating UI within
54
+ * Cody Web UI, this is used to retarget a standard portal (end of the body) to
55
+ * element within Web SvelteKit app themed portal.
56
+ *
57
+ * For more details see this comment https://github.com/sourcegraph/sourcegraph/pull/9186#issuecomment-3774633656
58
+ */
59
+ portalContainer?: HTMLElement | null;
52
60
  /**
53
61
  * Whenever an external (imperative) Cody Chat API instance is ready,
54
62
  * for example it gives you ability to run prompt, Note that this handler
@@ -1 +1 @@
1
- {"version":3,"file":"CodyWebChat.d.ts","sourceRoot":"","sources":["../../../lib/components/CodyWebChat.tsx"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,iBAAiB,EAOzB,MAAM,OAAO,CAAA;AAGd,OAAO,EACH,KAAK,WAAW,EAYnB,MAAM,0BAA0B,CAAA;AAQjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AAKjD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE/D,OAAO,EAAE,KAAK,oBAAoB,EAAmB,MAAM,kBAAkB,CAAA;AAG7E,OAAO,6BAA6B,CAAA;AAOpC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAA;AASzC,MAAM,MAAM,iBAAiB,GACvB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAA;AAElC,MAAM,MAAM,kBAAkB,GACxB;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;AACjE,KAAK,YAAY,GAAG,MAAM,IAAI,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAC9C;;OAEG;IACH,SAAS,CAAC,OAAO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IAAC,IAAI,EAAE,WAAW,EAAE,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAA;AACjE,KAAK,YAAY,GAAG,MAAM,IAAI,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAC9C;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,cAAc,GAAG,YAAY,CAAA;CACnD;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,oBAAoB,CAAA;IACjC,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,oFAAoF;IACpF,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAElC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,QAAQ,CAAA;IAEnB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IAEpC;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAA;CACtD;AACD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA2C3D,CAAA"}
@@ -1,7 +1,7 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { b as base64Js } from "./agent.worker-Bm74MuX8.mjs";
4
+ import { b as base64Js } from "./agent.worker-Di-hO351.mjs";
5
5
  var __defProp2 = Object.defineProperty;
6
6
  var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
7
  var __publicField2 = (obj, key, value) => {
package/dist/style.css CHANGED
@@ -1312,6 +1312,15 @@ button > ._model-title-with-icon_k71kd_5 ._badge_k71kd_39 {
1312
1312
  ._list-chips_mvyfp_1 ._list--item_mvyfp_41:not([aria-selected="true"]) {
1313
1313
  background-color: var(--vscode-dropdown-background);
1314
1314
  }
1315
+ ._container_bgbsm_1 {
1316
+ position: relative;
1317
+ left: 50%;
1318
+ transform: translateX(-50%);
1319
+ width: fit-content;
1320
+ height: 0;
1321
+ z-index: 50;
1322
+ top: -16px;
1323
+ }
1315
1324
  ._path_1dh30_1 {
1316
1325
  white-space: nowrap;
1317
1326
  text-overflow: ellipsis;
@@ -1516,14 +1525,14 @@ h4 {
1516
1525
  Root element which only exists to use container query
1517
1526
  for changing header tabs layout.
1518
1527
  */
1519
- ._tabs-root_hvph1_10 {
1528
+ ._tabs-root_xz9m6_10 {
1520
1529
  container-type: inline-size;
1521
1530
  container-name: tabs-container;
1522
1531
  isolation: isolate;
1523
1532
  z-index: 2;
1524
1533
  }
1525
1534
 
1526
- ._tabs-container_hvph1_17 {
1535
+ ._tabs-container_xz9m6_17 {
1527
1536
  display: flex;
1528
1537
  width: 100%;
1529
1538
  padding: 0;
@@ -1533,7 +1542,7 @@ h4 {
1533
1542
  background-color: var(--vscode-sideBar-background);
1534
1543
  }
1535
1544
 
1536
- ._tabs_hvph1_10 {
1545
+ ._tabs_xz9m6_10 {
1537
1546
  display: flex;
1538
1547
  flex-shrink: 0;
1539
1548
  gap: 2px;
@@ -1542,27 +1551,27 @@ h4 {
1542
1551
  border-bottom: 1px solid var(--vscode-dropdown-border);
1543
1552
  }
1544
1553
 
1545
- ._tabs_hvph1_10 > * {
1554
+ ._tabs_xz9m6_10 > * {
1546
1555
  flex-shrink: 0;
1547
1556
  }
1548
1557
 
1549
- ._sub-tabs_hvph1_40 {
1558
+ ._sub-tabs_xz9m6_40 {
1550
1559
  display: flex;
1551
1560
  flex-shrink: 0;
1552
1561
  gap: 8px;
1553
- padding: 0 12px 0 16px;
1562
+ padding: 0 12px 0 12px;
1554
1563
  }
1555
1564
 
1556
- ._sub-tabs_hvph1_40 > * {
1565
+ ._sub-tabs_xz9m6_40 > * {
1557
1566
  flex-shrink: 0;
1558
1567
  }
1559
1568
 
1560
- ._sub-tabs_hvph1_40 > button,
1561
- ._sub-tabs_hvph1_40 > a {
1569
+ ._sub-tabs_xz9m6_40 > button,
1570
+ ._sub-tabs_xz9m6_40 > a {
1562
1571
  padding: 8px;
1563
1572
  }
1564
1573
 
1565
- ._tab-action-label_hvph1_56 {
1574
+ ._tab-action-label_xz9m6_56 {
1566
1575
  display: inline;
1567
1576
  }
1568
1577
 
@@ -1574,25 +1583,25 @@ h4 {
1574
1583
  this override)
1575
1584
  */
1576
1585
  @container tabs-container (width < 575px) {
1577
- ._tabs-root_hvph1_10:not(._tabs-root--cody-web_hvph1_68) ._tab-action-label_hvph1_56 {
1586
+ ._tabs-root_xz9m6_10:not(._tabs-root--cody-web_xz9m6_68) ._tab-action-label_xz9m6_56 {
1578
1587
  display: none;
1579
1588
  }
1580
1589
  }
1581
1590
 
1582
1591
  /* Special override for Cody Web tabs */
1583
1592
  @container tabs-container (width < 375px) {
1584
- ._tabs-root--cody-web_hvph1_68 ._tab-action-label_hvph1_56 {
1593
+ ._tabs-root--cody-web_xz9m6_68 ._tab-action-label_xz9m6_56 {
1585
1594
  display: none;
1586
1595
  }
1587
1596
  }
1588
1597
 
1589
- ._dialog-overlay_hvph1_1 {
1598
+ ._dialog-overlay_xz9m6_1 {
1590
1599
  inset: 0;
1591
1600
  position: fixed;
1592
1601
  background-color: var(--vscode-overlay-background);
1593
1602
  }
1594
1603
 
1595
- ._dialog-content_hvph1_1 {
1604
+ ._dialog-content_xz9m6_1 {
1596
1605
  width: 90vw;
1597
1606
  max-width: 450px;
1598
1607
  max-height: 85vh;
@@ -1608,23 +1617,23 @@ h4 {
1608
1617
  hsl(206deg 22% 7% / 20%) 0 10px 20px -15px;
1609
1618
  }
1610
1619
 
1611
- ._dialog-content_hvph1_1:focus {
1620
+ ._dialog-content_xz9m6_1:focus {
1612
1621
  outline: none;
1613
1622
  }
1614
1623
 
1615
- ._dialog-title_hvph1_1 {
1624
+ ._dialog-title_xz9m6_1 {
1616
1625
  margin: 0;
1617
1626
  font-weight: 500;
1618
1627
  font-size: 17px;
1619
1628
  }
1620
1629
 
1621
- ._dialog-description_hvph1_1 {
1630
+ ._dialog-description_xz9m6_1 {
1622
1631
  margin: 10px 0 20px;
1623
1632
  font-size: 15px;
1624
1633
  line-height: 1.5;
1625
1634
  }
1626
1635
 
1627
- ._dialog-footer_hvph1_1 {
1636
+ ._dialog-footer_xz9m6_1 {
1628
1637
  margin-top: 1.5rem;
1629
1638
  width: 100%;
1630
1639
  display: flex;
@@ -2272,9 +2281,6 @@ imported in Sourcegraph shell.
2272
2281
  .tw-inset-0 {
2273
2282
  inset: 0px;
2274
2283
  }
2275
- .tw--top-8 {
2276
- top: -16px;
2277
- }
2278
2284
  .tw-bottom-0 {
2279
2285
  bottom: 0px;
2280
2286
  }
@@ -2497,9 +2503,6 @@ imported in Sourcegraph shell.
2497
2503
  .\!tw-h-\[30px\] {
2498
2504
  height: 30px !important;
2499
2505
  }
2500
- .tw-h-0 {
2501
- height: 0px;
2502
- }
2503
2506
  .tw-h-1 {
2504
2507
  height: 2px;
2505
2508
  }
@@ -2614,9 +2617,6 @@ imported in Sourcegraph shell.
2614
2617
  .\!tw-w-fit {
2615
2618
  width: fit-content !important;
2616
2619
  }
2617
- .tw-w-1\/2 {
2618
- width: 50%;
2619
- }
2620
2620
  .tw-w-1\/4 {
2621
2621
  width: 25%;
2622
2622
  }
@@ -5097,20 +5097,17 @@ imported in Sourcegraph shell.
5097
5097
  background-position-x: -200%;
5098
5098
  }
5099
5099
  }
5100
- :root {
5100
+ ._root_65pir_1 {
5101
5101
  --human-message-editor-gap: 0;
5102
5102
  --human-message-editor-cell-spacing-bottom: 6px;
5103
- }
5104
5103
 
5105
- ._root_n2nil_6 {
5106
5104
  display: flex;
5107
5105
  width: 100%;
5108
5106
  height: 100%;
5109
- font-size: 13px;
5110
5107
  overflow: hidden;
5111
5108
  }
5112
5109
 
5113
- ._container_n2nil_14 {
5110
+ ._container_65pir_11 {
5114
5111
  height: 100%;
5115
5112
  flex-grow: 1;
5116
5113
 
@@ -5125,38 +5122,25 @@ imported in Sourcegraph shell.
5125
5122
  cursor: text;
5126
5123
  }
5127
5124
 
5128
- ._container_n2nil_14 ._editor_n2nil_28 {
5125
+ ._container_65pir_11 ._editor_65pir_25 {
5129
5126
  scrollbar-gutter: stable;
5130
5127
  padding: var(--prompt-editor-padding-y) var(--prompt-editor-padding-x);
5131
5128
  }
5132
5129
 
5133
- ._toolbar_n2nil_34 {
5134
- padding: calc(0.75*var(--prompt-editor-padding-y)) var(--prompt-editor-padding-x);
5135
- overflow: hidden;
5136
- }
5137
-
5138
- ._container_n2nil_14:not(._focused_n2nil_39, [data-keep-toolbar-open]) ._editor-content-editable_n2nil_41 {
5130
+ ._container_65pir_11:not(._focused_65pir_31, [data-keep-toolbar-open]) ._editor-content-editable_65pir_32 {
5139
5131
  min-height: 1lh;
5140
5132
  }
5141
5133
 
5142
- ._container_n2nil_14:not(._focused_n2nil_39, [data-keep-toolbar-open]) ._toolbar_n2nil_34 {
5143
- height: 0;
5144
- opacity: 0;
5145
- margin-top: 0;
5146
- pointer-events: none;
5147
- padding: 0;
5148
- }
5149
-
5150
- ._container_n2nil_14:hover, ._container_n2nil_14:has(:focus-within, menu>button:focus) {
5134
+ ._container_65pir_11:hover, ._container_65pir_11:has(:focus-within, menu>button:focus) {
5151
5135
  background-color: var(--vscode-input-background);
5152
5136
  }
5153
5137
 
5154
5138
  /* Show focus ring when the input is focused or a toolbar button within the input container is
5155
5139
  focused, but NOT if something in a toolbar button's popover is focused. */
5156
- ._container_n2nil_14:has([data-lexical-editor='true']:focus-within, menu>button:focus) {
5140
+ ._container_65pir_11:has([data-lexical-editor='true']:focus-within, menu>button:focus) {
5157
5141
  outline-color: var(--vscode-focusBorder);
5158
5142
  }
5159
5143
 
5160
- ._editor-content-editable_n2nil_41 {
5144
+ ._editor-content-editable_65pir_32 {
5161
5145
  min-height: 3lh;
5162
5146
  }